@kong-ui-public/entities-certificates 3.11.32 → 3.11.33-pr.2694.d983d66d0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/package.json +4 -4
  2. package/dist/entities-certificates.es.js +0 -11060
  3. package/dist/entities-certificates.umd.js +0 -117
  4. package/dist/style.css +0 -1
  5. package/dist/types/ca-certificates-endpoints.d.ts +0 -18
  6. package/dist/types/ca-certificates-endpoints.d.ts.map +0 -1
  7. package/dist/types/certificates-endpoints.d.ts +0 -18
  8. package/dist/types/certificates-endpoints.d.ts.map +0 -1
  9. package/dist/types/components/CACertificateConfigCard.vue.d.ts +0 -63
  10. package/dist/types/components/CACertificateConfigCard.vue.d.ts.map +0 -1
  11. package/dist/types/components/CACertificateForm.vue.d.ts +0 -44
  12. package/dist/types/components/CACertificateForm.vue.d.ts.map +0 -1
  13. package/dist/types/components/CACertificateList.vue.d.ts +0 -118
  14. package/dist/types/components/CACertificateList.vue.d.ts.map +0 -1
  15. package/dist/types/components/CertificateConfigCard.vue.d.ts +0 -63
  16. package/dist/types/components/CertificateConfigCard.vue.d.ts.map +0 -1
  17. package/dist/types/components/CertificateForm.vue.d.ts +0 -57
  18. package/dist/types/components/CertificateForm.vue.d.ts.map +0 -1
  19. package/dist/types/components/CertificateFormSniField.vue.d.ts +0 -43
  20. package/dist/types/components/CertificateFormSniField.vue.d.ts.map +0 -1
  21. package/dist/types/components/CertificateList.vue.d.ts +0 -132
  22. package/dist/types/components/CertificateList.vue.d.ts.map +0 -1
  23. package/dist/types/composables/index.d.ts +0 -10
  24. package/dist/types/composables/index.d.ts.map +0 -1
  25. package/dist/types/composables/useCertificate.d.ts +0 -16
  26. package/dist/types/composables/useCertificate.d.ts.map +0 -1
  27. package/dist/types/composables/useI18n.d.ts +0 -9
  28. package/dist/types/composables/useI18n.d.ts.map +0 -1
  29. package/dist/types/composables/x509Helper.d.ts +0 -5
  30. package/dist/types/composables/x509Helper.d.ts.map +0 -1
  31. package/dist/types/index.d.ts +0 -14
  32. package/dist/types/index.d.ts.map +0 -1
  33. package/dist/types/types/certificate-config-card.d.ts +0 -33
  34. package/dist/types/types/certificate-config-card.d.ts.map +0 -1
  35. package/dist/types/types/certificate-form.d.ts +0 -46
  36. package/dist/types/types/certificate-form.d.ts.map +0 -1
  37. package/dist/types/types/certificate-list.d.ts +0 -33
  38. package/dist/types/types/certificate-list.d.ts.map +0 -1
  39. package/dist/types/types/index.d.ts +0 -6
  40. package/dist/types/types/index.d.ts.map +0 -1
  41. package/dist/types/types/x509.d.ts +0 -8
  42. package/dist/types/types/x509.d.ts.map +0 -1
@@ -1,117 +0,0 @@
1
- (function(Be,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/entities-shared"],o):(Be=typeof globalThis<"u"?globalThis:Be||self,o(Be["kong-ui-public-entities-certificates"]={},Be.Vue,Be.VueRouter,Be.KongIcons,Be["kong-ui-public-i18n"],Be["kong-ui-public-entities-shared"]))})(this,function(Be,o,Ui,je,za,A){"use strict";var Ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
2
- Copyright (C) Microsoft. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */var Ya;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Ja=="object"?Ja:typeof self=="object"?self:typeof this=="object"?this:u(),i=n(r);typeof t.Reflect<"u"&&(i=n(t.Reflect,i)),e(i,t),typeof t.Reflect>"u"&&(t.Reflect=r);function n(f,p){return function(m,y){Object.defineProperty(f,m,{configurable:!0,writable:!0,value:y}),p&&p(m,y)}}function s(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||c()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,p=!u&&!f,m={create:u?function(){return Ga(Object.create(null))}:f?function(){return Ga({__proto__:null})}:function(){return Ga({})},has:p?function(h,g){return i.call(h,g)}:function(h,g){return g in h},get:p?function(h,g){return i.call(h,g)?h[g]:void 0}:function(h,g){return h[g]}},y=Object.getPrototypeOf(Function),L=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Yp(),oe=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Zp(),ie=typeof WeakMap=="function"?WeakMap:Xp(),ee=n?Symbol.for("@reflect-metadata:registry"):void 0,ne=Gp(),$e=zp(ne);function ke(h,g,b,k){if(U(b)){if(!Ce(h))throw new TypeError;if(!K(g))throw new TypeError;return dt(h,g)}else{if(!Ce(h))throw new TypeError;if(!ce(g))throw new TypeError;if(!ce(k)&&!U(k)&&!ht(k))throw new TypeError;return ht(k)&&(k=void 0),b=z(b),ae(h,g,b,k)}}e("decorate",ke);function P(h,g){function b(k,$){if(!ce(k))throw new TypeError;if(!U($)&&!Ie($))throw new TypeError;Mr(h,g,k,$)}return b}e("metadata",P);function M(h,g,b,k){if(!ce(b))throw new TypeError;return U(k)||(k=z(k)),Mr(h,g,b,k)}e("defineMetadata",M);function se(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),le(h,g,b)}e("hasMetadata",se);function R(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),J(h,g,b)}e("hasOwnMetadata",R);function j(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),pt(h,g,b)}e("getMetadata",j);function S(h,g,b){if(!ce(g))throw new TypeError;return U(b)||(b=z(b)),nr(h,g,b)}e("getOwnMetadata",S);function F(h,g){if(!ce(h))throw new TypeError;return U(g)||(g=z(g)),Rt(h,g)}e("getMetadataKeys",F);function X(h,g){if(!ce(h))throw new TypeError;return U(g)||(g=z(g)),xt(h,g)}e("getOwnMetadataKeys",X);function ft(h,g,b){if(!ce(g))throw new TypeError;if(U(b)||(b=z(b)),!ce(g))throw new TypeError;U(b)||(b=z(b));var k=Mi(g,b,!1);return U(k)?!1:k.OrdinaryDeleteMetadata(h,g,b)}e("deleteMetadata",ft);function dt(h,g){for(var b=h.length-1;b>=0;--b){var k=h[b],$=k(g);if(!U($)&&!ht($)){if(!K($))throw new TypeError;g=$}}return g}function ae(h,g,b,k){for(var $=h.length-1;$>=0;--$){var he=h[$],be=he(g,b,k);if(!U(be)&&!ht(be)){if(!ce(be))throw new TypeError;k=be}}return k}function le(h,g,b){var k=J(h,g,b);if(k)return!0;var $=Wa(g);return ht($)?!1:le(h,$,b)}function J(h,g,b){var k=Mi(g,b,!1);return U(k)?!1:O(k.OrdinaryHasOwnMetadata(h,g,b))}function pt(h,g,b){var k=J(h,g,b);if(k)return nr(h,g,b);var $=Wa(g);if(!ht($))return pt(h,$,b)}function nr(h,g,b){var k=Mi(g,b,!1);if(!U(k))return k.OrdinaryGetOwnMetadata(h,g,b)}function Mr(h,g,b,k){var $=Mi(b,k,!0);$.OrdinaryDefineOwnMetadata(h,g,b,k)}function Rt(h,g){var b=xt(h,g),k=Wa(h);if(k===null)return b;var $=Rt(k,g);if($.length<=0)return b;if(b.length<=0)return $;for(var he=new oe,be=[],Y=0,B=b;Y<B.length;Y++){var I=B[Y],T=he.has(I);T||(he.add(I),be.push(I))}for(var V=0,Z=$;V<Z.length;V++){var I=Z[V],T=he.has(I);T||(he.add(I),be.push(I))}return be}function xt(h,g){var b=Mi(h,g,!1);return b?b.OrdinaryOwnMetadataKeys(h,g):[]}function Ur(h){if(h===null)return 1;switch(typeof h){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return h===null?1:6;default:return 6}}function U(h){return h===void 0}function ht(h){return h===null}function or(h){return typeof h=="symbol"}function ce(h){return typeof h=="object"?h!==null:typeof h=="function"}function Dt(h,g){switch(Ur(h)){case 0:return h;case 1:return h;case 2:return h;case 3:return h;case 4:return h;case 5:return h}var b="string",k=xe(h,s);if(k!==void 0){var $=k.call(h,b);if(ce($))throw new TypeError;return $}return G(h)}function G(h,g){var b,k,$;{var he=h.toString;if(Bt(he)){var k=he.call(h);if(!ce(k))return k}var b=h.valueOf;if(Bt(b)){var k=b.call(h);if(!ce(k))return k}}throw new TypeError}function O(h){return!!h}function H(h){return""+h}function z(h){var g=Dt(h);return or(g)?g:H(g)}function Ce(h){return Array.isArray?Array.isArray(h):h instanceof Object?h instanceof Array:Object.prototype.toString.call(h)==="[object Array]"}function Bt(h){return typeof h=="function"}function K(h){return typeof h=="function"}function Ie(h){switch(Ur(h)){case 3:return!0;case 4:return!0;default:return!1}}function D(h,g){return h===g||h!==h&&g!==g}function xe(h,g){var b=h[g];if(b!=null){if(!Bt(b))throw new TypeError;return b}}function Co(h){var g=xe(h,c);if(!Bt(g))throw new TypeError;var b=g.call(h);if(!ce(b))throw new TypeError;return b}function pf(h){return h.value}function hf(h){var g=h.next();return g.done?!1:g}function yf(h){var g=h.return;g&&g.call(h)}function Wa(h){var g=Object.getPrototypeOf(h);if(typeof h!="function"||h===y||g!==y)return g;var b=h.prototype,k=b&&Object.getPrototypeOf(b);if(k==null||k===Object.prototype)return g;var $=k.constructor;return typeof $!="function"||$===h?g:$}function Wp(){var h;!U(ee)&&typeof t.Reflect<"u"&&!(ee in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(h=Jp(t.Reflect));var g,b,k,$=new ie,he={registerProvider:be,getProvider:B,setProvider:T};return he;function be(V){if(!Object.isExtensible(he))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case h===V:break;case U(g):g=V;break;case g===V:break;case U(b):b=V;break;case b===V:break;default:k===void 0&&(k=new oe),k.add(V);break}}function Y(V,Z){if(!U(g)){if(g.isProviderFor(V,Z))return g;if(!U(b)){if(b.isProviderFor(V,Z))return g;if(!U(k))for(var fe=Co(k);;){var ye=hf(fe);if(!ye)return;var rt=pf(ye);if(rt.isProviderFor(V,Z))return yf(fe),rt}}}if(!U(h)&&h.isProviderFor(V,Z))return h}function B(V,Z){var fe=$.get(V),ye;return U(fe)||(ye=fe.get(Z)),U(ye)&&(ye=Y(V,Z),U(ye)||(U(fe)&&(fe=new L,$.set(V,fe)),fe.set(Z,ye))),ye}function I(V){if(U(V))throw new TypeError;return g===V||b===V||!U(k)&&k.has(V)}function T(V,Z,fe){if(!I(fe))throw new Error("Metadata provider not registered.");var ye=B(V,Z);if(ye!==fe){if(!U(ye))return!1;var rt=$.get(V);U(rt)&&(rt=new L,$.set(V,rt)),rt.set(Z,fe)}return!0}}function Gp(){var h;return!U(ee)&&ce(t.Reflect)&&Object.isExtensible(t.Reflect)&&(h=t.Reflect[ee]),U(h)&&(h=Wp()),!U(ee)&&ce(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,ee,{enumerable:!1,configurable:!1,writable:!1,value:h}),h}function zp(h){var g=new ie,b={isProviderFor:function(I,T){var V=g.get(I);return U(V)?!1:V.has(T)},OrdinaryDefineOwnMetadata:be,OrdinaryHasOwnMetadata:$,OrdinaryGetOwnMetadata:he,OrdinaryOwnMetadataKeys:Y,OrdinaryDeleteMetadata:B};return ne.registerProvider(b),b;function k(I,T,V){var Z=g.get(I),fe=!1;if(U(Z)){if(!V)return;Z=new L,g.set(I,Z),fe=!0}var ye=Z.get(T);if(U(ye)){if(!V)return;if(ye=new L,Z.set(T,ye),!h.setProvider(I,T,b))throw Z.delete(T),fe&&g.delete(I),new Error("Wrong provider for target.")}return ye}function $(I,T,V){var Z=k(T,V,!1);return U(Z)?!1:O(Z.has(I))}function he(I,T,V){var Z=k(T,V,!1);if(!U(Z))return Z.get(I)}function be(I,T,V,Z){var fe=k(V,Z,!0);fe.set(I,T)}function Y(I,T){var V=[],Z=k(I,T,!1);if(U(Z))return V;for(var fe=Z.keys(),ye=Co(fe),rt=0;;){var gf=hf(ye);if(!gf)return V.length=rt,V;var Qp=pf(gf);try{V[rt]=Qp}catch(eh){try{yf(ye)}finally{throw eh}}rt++}}function B(I,T,V){var Z=k(T,V,!1);if(U(Z)||!Z.delete(I))return!1;if(Z.size===0){var fe=g.get(T);U(fe)||(fe.delete(V),fe.size===0&&g.delete(fe))}return!0}}function Jp(h){var g=h.defineMetadata,b=h.hasOwnMetadata,k=h.getOwnMetadata,$=h.getOwnMetadataKeys,he=h.deleteMetadata,be=new ie,Y={isProviderFor:function(B,I){var T=be.get(B);return!U(T)&&T.has(I)?!0:$(B,I).length?(U(T)&&(T=new oe,be.set(B,T)),T.add(I),!0):!1},OrdinaryDefineOwnMetadata:g,OrdinaryHasOwnMetadata:b,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:$,OrdinaryDeleteMetadata:he};return Y}function Mi(h,g,b){var k=ne.getProvider(h,g);if(!U(k))return k;if(b){if(ne.setProvider(h,g,$e))return $e;throw new Error("Illegal state.")}}function Yp(){var h={},g=[],b=function(){function Y(B,I,T){this._index=0,this._keys=B,this._values=I,this._selector=T}return Y.prototype["@@iterator"]=function(){return this},Y.prototype[c]=function(){return this},Y.prototype.next=function(){var B=this._index;if(B>=0&&B<this._keys.length){var I=this._selector(this._keys[B],this._values[B]);return B+1>=this._keys.length?(this._index=-1,this._keys=g,this._values=g):this._index++,{value:I,done:!1}}return{value:void 0,done:!0}},Y.prototype.throw=function(B){throw this._index>=0&&(this._index=-1,this._keys=g,this._values=g),B},Y.prototype.return=function(B){return this._index>=0&&(this._index=-1,this._keys=g,this._values=g),{value:B,done:!0}},Y}(),k=function(){function Y(){this._keys=[],this._values=[],this._cacheKey=h,this._cacheIndex=-2}return Object.defineProperty(Y.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Y.prototype.has=function(B){return this._find(B,!1)>=0},Y.prototype.get=function(B){var I=this._find(B,!1);return I>=0?this._values[I]:void 0},Y.prototype.set=function(B,I){var T=this._find(B,!0);return this._values[T]=I,this},Y.prototype.delete=function(B){var I=this._find(B,!1);if(I>=0){for(var T=this._keys.length,V=I+1;V<T;V++)this._keys[V-1]=this._keys[V],this._values[V-1]=this._values[V];return this._keys.length--,this._values.length--,D(B,this._cacheKey)&&(this._cacheKey=h,this._cacheIndex=-2),!0}return!1},Y.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=h,this._cacheIndex=-2},Y.prototype.keys=function(){return new b(this._keys,this._values,$)},Y.prototype.values=function(){return new b(this._keys,this._values,he)},Y.prototype.entries=function(){return new b(this._keys,this._values,be)},Y.prototype["@@iterator"]=function(){return this.entries()},Y.prototype[c]=function(){return this.entries()},Y.prototype._find=function(B,I){if(!D(this._cacheKey,B)){this._cacheIndex=-1;for(var T=0;T<this._keys.length;T++)if(D(this._keys[T],B)){this._cacheIndex=T;break}}return this._cacheIndex<0&&I&&(this._cacheIndex=this._keys.length,this._keys.push(B),this._values.push(void 0)),this._cacheIndex},Y}();return k;function $(Y,B){return Y}function he(Y,B){return B}function be(Y,B){return[Y,B]}}function Zp(){var h=function(){function g(){this._map=new L}return Object.defineProperty(g.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),g.prototype.has=function(b){return this._map.has(b)},g.prototype.add=function(b){return this._map.set(b,b),this},g.prototype.delete=function(b){return this._map.delete(b)},g.prototype.clear=function(){this._map.clear()},g.prototype.keys=function(){return this._map.keys()},g.prototype.values=function(){return this._map.keys()},g.prototype.entries=function(){return this._map.entries()},g.prototype["@@iterator"]=function(){return this.keys()},g.prototype[c]=function(){return this.keys()},g}();return h}function Xp(){var h=16,g=m.create(),b=k();return function(){function B(){this._key=k()}return B.prototype.has=function(I){var T=$(I,!1);return T!==void 0?m.has(T,this._key):!1},B.prototype.get=function(I){var T=$(I,!1);return T!==void 0?m.get(T,this._key):void 0},B.prototype.set=function(I,T){var V=$(I,!0);return V[this._key]=T,this},B.prototype.delete=function(I){var T=$(I,!1);return T!==void 0?delete T[this._key]:!1},B.prototype.clear=function(){this._key=k()},B}();function k(){var B;do B="@@WeakMap@@"+Y();while(m.has(g,B));return g[B]=!0,B}function $(B,I){if(!i.call(B,b)){if(!I)return;Object.defineProperty(B,b,{value:m.create()})}return B[b]}function he(B,I){for(var T=0;T<I;++T)B[T]=Math.random()*255|0;return B}function be(B){if(typeof Uint8Array=="function"){var I=new Uint8Array(B);return typeof crypto<"u"?crypto.getRandomValues(I):typeof msCrypto<"u"?msCrypto.getRandomValues(I):he(I,B),I}return he(new Array(B),B)}function Y(){var B=be(h);B[6]=B[6]&79|64,B[8]=B[8]&191|128;for(var I="",T=0;T<h;++T){var V=B[T];(T===4||T===6||T===8)&&(I+="-"),V<16&&(I+="0"),I+=V.toString(16).toLowerCase()}return I}}function Ga(h){return h.__=void 0,delete h.__,h}})})(Ya||(Ya={}));/*!
15
- * MIT License
16
- *
17
- * Copyright (c) 2017-2024 Peculiar Ventures, LLC
18
- *
19
- * Permission is hereby granted, free of charge, to any person obtaining a copy
20
- * of this software and associated documentation files (the "Software"), to deal
21
- * in the Software without restriction, including without limitation the rights
22
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
- * copies of the Software, and to permit persons to whom the Software is
24
- * furnished to do so, subject to the following conditions:
25
- *
26
- * The above copyright notice and this permission notice shall be included in all
27
- * copies or substantial portions of the Software.
28
- *
29
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
- * SOFTWARE.
36
- *
37
- */const bf="[object ArrayBuffer]";class C{static isArrayBuffer(e){return Object.prototype.toString.call(e)===bf}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){const i=C.toUint8Array(e),n=C.toUint8Array(t);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let i=0;for(const c of t)i+=c.byteLength;const n=new Uint8Array(i);let s=0;for(const c of t){const u=this.toUint8Array(c);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const xo="string",vf=/^[0-9a-f\s]+$/i,wf=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Sf=/^[a-zA-Z0-9-_]+$/;class Za{static fromString(e){const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i.buffer}static toString(e){const t=C.toUint8Array(e);let i="";for(let s=0;s<t.length;s++)i+=String.fromCharCode(t[s]);return decodeURIComponent(escape(i))}}class it{static toString(e,t=!1){const i=C.toArrayBuffer(e),n=new DataView(i);let s="";for(let c=0;c<i.byteLength;c+=2){const u=n.getUint16(c,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){const i=new ArrayBuffer(e.length*2),n=new DataView(i);for(let s=0;s<e.length;s++)n.setUint16(s*2,e.charCodeAt(s),t);return i}}class _{static isHex(e){return typeof e===xo&&vf.test(e)}static isBase64(e){return typeof e===xo&&wf.test(e)}static isBase64Url(e){return typeof e===xo&&Sf.test(e)}static ToString(e,t="utf8"){const i=C.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return it.toString(i,!0);case"utf16":case"utf16be":return it.toString(i);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return it.fromString(e,!0);case"utf16":case"utf16be":return it.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const t=C.toUint8Array(e);if(typeof btoa<"u"){const i=this.ToString(t,"binary");return btoa(i)}else return Buffer.from(t).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=_.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Za.fromString(e);case"utf16":case"utf16be":return it.fromString(e);case"utf16le":case"usc2":return it.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=_.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Za.toString(e);case"utf16":case"utf16be":return it.toString(e);case"utf16le":case"usc2":return it.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const t=e.length,i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);return i.buffer}static ToBinary(e){const t=C.toUint8Array(e);let i="";for(let n=0;n<t.length;n++)i+=String.fromCharCode(t[n]);return i}static ToHex(e){const t=C.toUint8Array(e);let i="";const n=t.length;for(let s=0;s<n;s++){const c=t[s];c<16&&(i+="0"),i+=c.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const i=new Uint8Array(t.length/2);for(let n=0;n<t.length;n=n+2){const s=t.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(e,t=!1){return it.toString(e,t)}static FromUtf16String(e,t=!1){return it.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let i=0;i<t;i++)e+="=";return e}static formatString(e){return(e==null?void 0:e.replace(/[\n\r\t ]/g,""))||""}}_.DEFAULT_UTF8_ENCODING="utf8";function Af(...r){const e=r.map(n=>n.byteLength).reduce((n,s)=>n+s),t=new Uint8Array(e);let i=0;return r.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)t[i++]=s}),t.buffer}function Xa(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}/*!
38
- Copyright (c) Peculiar Ventures, LLC
39
- */function sr(r,e){let t=0;if(r.length===1)return r[0];for(let i=r.length-1;i>=0;i--)t+=r[r.length-1-i]*Math.pow(2,e*i);return t}function Mt(r,e,t=-1){const i=t;let n=r,s=0,c=Math.pow(2,e);for(let u=1;u<8;u++){if(r<c){let f;if(i<0)f=new ArrayBuffer(u),s=u;else{if(i<u)return new ArrayBuffer(0);f=new ArrayBuffer(i),s=i}const p=new Uint8Array(f);for(let m=u-1;m>=0;m--){const y=Math.pow(2,m*e);p[s-m-1]=Math.floor(n/y),n-=p[s-m-1]*y}return f}c*=Math.pow(2,e)}return new ArrayBuffer(0)}function Bo(...r){let e=0,t=0;for(const s of r)e+=s.length;const i=new ArrayBuffer(e),n=new Uint8Array(i);for(const s of r)n.set(s,t),t+=s.length;return n}function Qa(){const r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const u=r[0]===255&&r[1]&128,f=r[0]===0&&(r[1]&128)===0;(u||f)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;const i=sr(t,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,sr(s,8)-i}function kf(r){const e=r<0?r*-1:r;let t=128;for(let i=1;i<8;i++){if(e<=t){if(r<0){const c=t-e,u=Mt(c,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Mt(e,8,i),s=new Uint8Array(n);if(s[0]&128){const c=n.slice(0),u=new Uint8Array(c);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<c.byteLength;f++)s[f+1]=u[f];s[0]=0}return n}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function Cf(r,e){if(r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}function He(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let c=0;c<i;c++)n[c]="0";return n.join("").concat(t)}/*!
40
- * Copyright (c) 2014, GMO GlobalSign
41
- * Copyright (c) 2015-2022, Peculiar Ventures
42
- * All rights reserved.
43
- *
44
- * Author 2014-2019, Yury Strozhevsky
45
- *
46
- * Redistribution and use in source and binary forms, with or without modification,
47
- * are permitted provided that the following conditions are met:
48
- *
49
- * * Redistributions of source code must retain the above copyright notice, this
50
- * list of conditions and the following disclaimer.
51
- *
52
- * * Redistributions in binary form must reproduce the above copyright notice, this
53
- * list of conditions and the following disclaimer in the documentation and/or
54
- * other materials provided with the distribution.
55
- *
56
- * * Neither the name of the copyright holder nor the names of its
57
- * contributors may be used to endorse or promote products derived from
58
- * this software without specific prior written permission.
59
- *
60
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
61
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
62
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
63
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
64
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
65
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
66
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
67
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
68
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
- *
71
- */function $i(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Eo(r){let e=0,t=0;for(let n=0;n<r.length;n++){const s=r[n];e+=s.byteLength}const i=new Uint8Array(e);for(let n=0;n<r.length;n++){const s=r[n];i.set(new Uint8Array(s),t),t+=s.byteLength}return i.buffer}function yt(r,e,t,i){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):i<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-i<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class Hi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Eo(this.items)}}const $r=[new Uint8Array([1])],ec="0123456789",No="name",tc="valueHexView",xf="isHexOnly",Bf="idBlock",Ef="tagClass",Nf="tagNumber",If="isConstructed",Of="fromBER",_f="toBER",Tf="local",Pe="",Je=new ArrayBuffer(0),Li=new Uint8Array(0),Hr="EndOfContent",rc="OCTET STRING",ic="BIT STRING";function nt(r){var e;return e=class extends r{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?C.toUint8Array(s.valueHex):Li}fromBER(i,n,s){const c=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!yt(this,c,n,s))return-1;const u=n+s;return this.valueHexView=c.subarray(n,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Je)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:_.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Ut{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Pe,warnings:i=[],valueBeforeDecode:n=Li}={}){this.blockLength=e,this.error=t,this.warnings=i,this.valueBeforeDecodeView=C.toUint8Array(n)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:_.ToHex(this.valueBeforeDecodeView)}}}Ut.NAME="baseBlock";class Oe extends Ut{fromBER(e,t,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Oe.NAME="valueBlock";class nc extends nt(Ut){constructor({idBlock:e={}}={}){var t,i,n,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?C.toUint8Array(e.valueHex):Li,this.tagClass=(i=e.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=e.tagNumber)!==null&&n!==void 0?n:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Je}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,n[0]=t}return n.buffer}if(!this.isHexOnly){const n=Mt(this.tagNumber,7),s=new Uint8Array(n),c=n.byteLength,u=new Uint8Array(c+1);if(u[0]=t|31,!e){for(let f=0;f<c-1;f++)u[f+1]=s[f]|128;u[c]=s[c-1]}return u.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=t|31,!e){const n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(e,t,i){const n=C.toUint8Array(e);if(!yt(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let f=1,p=this.valueHexView=new Uint8Array(255),m=255;for(;s[f]&128;){if(p[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===m){m+=255;const L=new Uint8Array(m);for(let oe=0;oe<p.length;oe++)L[oe]=p[oe];p=this.valueHexView=new Uint8Array(m)}}this.blockLength=f+1,p[f-1]=s[f]&127;const y=new Uint8Array(f);for(let L=0;L<f;L++)y[L]=p[L];p=this.valueHexView=new Uint8Array(f),p.set(y),this.blockLength<=9?this.tagNumber=sr(p,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}nc.NAME="identificationBlock";class oc extends Ut{constructor({lenBlock:e={}}={}){var t,i,n;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(i=e.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(n=e.length)!==null&&n!==void 0?n:0}fromBER(e,t,i){const n=C.toUint8Array(e);if(!yt(this,n,t,i))return-1;const s=n.subarray(t,t+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const u=t+1,f=n.subarray(u,u+c);return f[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=sr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+1,t+this.blockLength}toBER(e=!1){let t,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=128),t;if(this.longFormUsed){const n=Mt(this.length,8);if(n.byteLength>127)return this.error="Too big length",Je;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const s=new Uint8Array(n);i=new Uint8Array(t),i[0]=n.byteLength|128;for(let c=0;c<n.byteLength;c++)i[c+1]=s[c];return t}return t=new ArrayBuffer(1),e===!1&&(i=new Uint8Array(t),i[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}oc.NAME="lengthBlock";const N={};class ve extends Ut{constructor({name:e=Pe,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new nc(n),this.lenBlock=new oc(n),this.valueBlock=s?new s(n):new Oe(n)}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}toBER(e,t){const i=t||new Hi;t||sc(this);const n=this.idBlock.toBER(e);if(i.write(n),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);i.write(c),i.write(s)}return t?Je:i.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():_.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,t=_.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),i=e.toBER();return Cf(t,i)}}ve.NAME="BaseBlock";function sc(r){var e;if(r instanceof N.Constructed)for(const t of r.valueBlock.value)sc(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class Io extends ve{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Pe,...t}={},i){super(t,i),e&&this.fromString(e)}fromBER(e,t,i){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}Io.NAME="BaseStringBlock";class ac extends nt(Oe){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}ac.NAME="PrimitiveValueBlock";var cc;class Lr extends ve{constructor(e={}){super(e,ac),this.idBlock.isConstructed=!1}}cc=Lr,N.Primitive=cc,Lr.NAME="PRIMITIVE";function Vf(r,e){if(r instanceof e)return r;const t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}function ar(r,e=0,t=r.length){const i=e;let n=new ve({},Oe);const s=new Ut;if(!yt(s,r,e,t))return n.error=s.error,{offset:-1,result:n};if(!r.subarray(e,e+t).length)return n.error="Zero buffer length",{offset:-1,result:n};let u=n.idBlock.fromBER(r,e,t);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),u===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(e=u,t-=n.idBlock.blockLength,u=n.lenBlock.fromBER(r,e,t),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),u===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(e=u,t-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let f=ve;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};f=N.EndOfContent;break;case 1:f=N.Boolean;break;case 2:f=N.Integer;break;case 3:f=N.BitString;break;case 4:f=N.OctetString;break;case 5:f=N.Null;break;case 6:f=N.ObjectIdentifier;break;case 10:f=N.Enumerated;break;case 12:f=N.Utf8String;break;case 13:f=N.RelativeObjectIdentifier;break;case 14:f=N.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:f=N.Sequence;break;case 17:f=N.Set;break;case 18:f=N.NumericString;break;case 19:f=N.PrintableString;break;case 20:f=N.TeletexString;break;case 21:f=N.VideotexString;break;case 22:f=N.IA5String;break;case 23:f=N.UTCTime;break;case 24:f=N.GeneralizedTime;break;case 25:f=N.GraphicString;break;case 26:f=N.VisibleString;break;case 27:f=N.GeneralString;break;case 28:f=N.UniversalString;break;case 29:f=N.CharacterString;break;case 30:f=N.BmpString;break;case 31:f=N.DATE;break;case 32:f=N.TimeOfDay;break;case 33:f=N.DateTime;break;case 34:f=N.Duration;break;default:{const p=n.idBlock.isConstructed?new N.Constructed:new N.Primitive;p.idBlock=n.idBlock,p.lenBlock=n.lenBlock,p.warnings=n.warnings,n=p}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?N.Constructed:N.Primitive}return n=Vf(n,f),u=n.fromBER(r,e,n.lenBlock.isIndefiniteForm?t:n.lenBlock.length),n.valueBeforeDecodeView=r.subarray(i,i+n.blockLength),{offset:u,result:n}}function cr(r){if(!r.byteLength){const e=new ve({},Oe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return ar(C.toUint8Array(r).slice(),0,r.byteLength)}function jf(r,e){return r?1:e}class Et extends Oe{constructor({value:e=[],isIndefiniteForm:t=!1,...i}={}){super(i),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,i){const n=C.toUint8Array(e);if(!yt(this,n,t,i))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;jf(this.isIndefiniteForm,i)>0;){const c=ar(n,s,i);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,i-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Hr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Hr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new Hi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Je:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}Et.NAME="ConstructedValueBlock";var lc;class _e extends ve{constructor(e={}){super(e,Et),this.idBlock.isConstructed=!0}fromBER(e,t,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){const e=[];for(const i of this.valueBlock.value)e.push(i.toString("ascii").split(`
72
- `).map(n=>` ${n}`).join(`
73
- `));const t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
74
- ${e.join(`
75
- `)}`:`${t} :`}}lc=_e,N.Constructed=lc,_e.NAME="CONSTRUCTED";class uc extends Oe{fromBER(e,t,i){return t}toBER(e){return Je}}uc.override="EndOfContentValueBlock";var fc;class Oo extends ve{constructor(e={}){super(e,uc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}fc=Oo,N.EndOfContent=fc,Oo.NAME=Hr;var dc;class $t extends ve{constructor(e={}){super(e,Oe),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,t+i>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+i}toBER(e,t){const i=new ArrayBuffer(2);if(!e){const n=new Uint8Array(i);n[0]=5,n[1]=0}return t&&t.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}dc=$t,N.Null=dc,$t.NAME="NULL";class pc extends nt(Oe){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=C.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,t,i){const n=C.toUint8Array(e);return yt(this,n,t,i)?(this.valueHexView=n.subarray(t,t+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Qa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}pc.NAME="BooleanValueBlock";var hc;let Fi=class extends ve{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,pc),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};hc=Fi,N.Boolean=hc,Fi.NAME="BOOLEAN";class yc extends nt(Et){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=Et.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===Hr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==rc)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,i),this.blockLength=i;return n}toBER(e,t){return this.isConstructed?Et.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}yc.NAME="OctetStringValueBlock";var _o;let Ht=class extends ve{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},yc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+i);try{if(s.byteLength){const c=ar(s,0,s.byteLength);c.offset!==-1&&c.offset===i&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return _e.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,t=_.ToHex(this.valueBlock.valueHexView);return`${e} : ${t}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof _o&&e.push(t.valueBlock.valueHexView);return C.concat(e)}};_o=Ht,N.OctetString=_o,Ht.NAME=rc;class gc extends nt(Et){constructor({unusedBits:e=0,isConstructed:t=!1,...i}={}){super(i),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,i){if(!i)return t;let n=-1;if(this.isConstructed){if(n=Et.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Hr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ic)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const p=u.valueBlock;if(this.unusedBits>0&&p.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=p.unusedBits}return n}const s=C.toUint8Array(e);if(!yt(this,s,t,i))return-1;const c=s.subarray(t,t+i);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=c.subarray(1);try{if(u.byteLength){const f=ar(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+i}toBER(e,t){if(this.isConstructed)return Et.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Je;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}gc.NAME="BitStringValueBlock";var mc;let Lt=class extends ve{constructor({idBlock:e={},lenBlock:t={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!i.isIndefiniteForm},...i},gc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return _e.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const c of t)e.push(c.toString(2).padStart(8,"0"));const i=e.join(""),n=this.constructor.NAME,s=i.substring(0,i.length-this.valueBlock.unusedBits);return`${n} : ${s}`}}};mc=Lt,N.BitString=mc,Lt.NAME=ic;var bc;function Pf(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const c=s.length-1,u=n.slice(0),f=u.length-1;let p=0;const m=f<c?c:f;let y=0;for(let L=m;L>=0;L--,y++){switch(!0){case y<u.length:p=s[c-y]+u[f-y]+t[0];break;default:p=s[c-y]+t[0]}switch(t[0]=p/10,!0){case y>=s.length:s=Bo(new Uint8Array([p%10]),s);break;default:s[c-y]=p%10}}return t[0]>0&&(s=Bo(t,s)),s}function vc(r){if(r>=$r.length)for(let e=$r.length;e<=r;e++){const t=new Uint8Array([0]);let i=$r[e-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+t[0]]);t[0]=s[0]/10,i[n]=s[0]%10}t[0]>0&&(i=Bo(t,i)),$r.push(i)}return $r[r]}function Rf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),c=s.length-1,u=n.slice(0),f=u.length-1;let p,m=0;for(let y=f;y>=0;y--,m++)switch(p=s[c-m]-u[f-m]-t,!0){case p<0:t=1,s[c-m]=p+10;break;default:t=0,s[c-m]=p}if(t>0)for(let y=c-f+1;y>=0;y--,m++)if(p=s[c-m]-t,p<0)t=1,s[c-m]=p+10;else{t=0,s[c-m]=p;break}return s.slice()}class To extends nt(Oe){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Qa.call(this)))}constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(kf(e))}get valueDec(){return this._valueDec}fromDER(e,t,i,n=0){const s=this.fromBER(e,t,i);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):n!==0&&c.length<n&&(n-c.length>1&&(n=c.length+1),this.valueHexView=c.subarray(n-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(t,1),this.valueHexView=i}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,i){const n=super.fromBER(e,t,i);return n===-1||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const e=this.valueHexView.length*8-1;let t=new Uint8Array(this.valueHexView.length*8/3),i=0,n;const s=this.valueHexView;let c="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let p=0;p<8;p++){if((n&1)===1)switch(i){case e:t=Rf(vc(i),t),c="-";break;default:t=Pf(t,vc(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(c+=ec.charAt(t[f]));return u===!1&&(c+=ec.charAt(0)),c}}bc=To,To.NAME="IntegerValueBlock",Object.defineProperty(bc.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Fr;class lr extends ve{constructor(e={}){super(e,To),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return $i(),BigInt(this.valueBlock.toString())}static fromBigInt(e){$i();const t=BigInt(e),i=new Hi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(_.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const p=BigInt(`0x${_.ToHex(u)}`)+t,m=C.toUint8Array(_.FromHex(p.toString(16)));m[0]|=128,i.write(m)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Fr({valueHex:i.final()})}convertToDER(){const e=new Fr({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Fr({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Fr=lr,N.Integer=Fr,lr.NAME="INTEGER";var wc;class qi extends lr{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}wc=qi,N.Enumerated=wc,qi.NAME="ENUMERATED";class Vo extends nt(Oe){constructor({valueDec:e=-1,isFirstSid:t=!1,...i}={}){super(i),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,i){if(!i)return t;const n=C.toUint8Array(e);if(!yt(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=sr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){$i();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const i=new Uint8Array(t.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(t.slice(n*7,n*7+7),2)+(n+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Mt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=_.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Vo.NAME="sidBlock";class Sc extends Oe{constructor({value:e=Pe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new Vo;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e){const t=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(e);if(n.byteLength===0)return this.error=this.value[i].error,Je;t.push(n)}return Eo(t)}fromString(e){this.value=[];let t=0,i=0,n="",s=!1;do if(i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1,s){const c=this.value[0];let u=0;switch(c.valueDec){case 0:break;case 1:u=40;break;case 2:u=80;break;default:this.value=[];return}const f=parseInt(n,10);if(isNaN(f))return;c.valueDec=f+u,s=!1}else{const c=new Vo;if(n>Number.MAX_SAFE_INTEGER){$i();const u=BigInt(n);c.valueBigInt=u}else if(c.valueDec=parseInt(n,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}while(i!==-1)}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t?(n=`{${n}}`,this.value[i].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){const e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}}Sc.NAME="ObjectIdentifierValueBlock";var Ac;class Ki extends ve{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Sc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ac=Ki,N.ObjectIdentifier=Ac,Ki.NAME="OBJECT IDENTIFIER";class jo extends nt(Ut){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,i){if(i===0)return t;const n=C.toUint8Array(e);if(!yt(this,n,t,i))return-1;const s=n.subarray(t,t+i);this.valueHexView=new Uint8Array(i);for(let u=0;u<i&&(this.valueHexView[u]=s[u]&127,this.blockLength++,!!(s[u]&128));u++);const c=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)c[u]=this.valueHexView[u];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=sr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=n[c]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Mt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Je;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)i[c]=n[c]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=_.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}jo.NAME="relativeSidBlock";class kc extends Oe{constructor({value:e=Pe,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new jo;if(n=s.fromBER(e,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(e,t){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(e);if(s.byteLength===0)return this.error=this.value[n].error,Je;i.push(s)}return Eo(i)}fromString(e){this.value=[];let t=0,i=0,n="";do{i=e.indexOf(".",t),i===-1?n=e.substring(t):n=e.substring(t,i),t=i+1;const s=new jo;if(s.valueDec=parseInt(n,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let e="",t=!1;for(let i=0;i<this.value.length;i++){t=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(e=`${e}.`),t&&(n=`{${n}}`),e+=n}return e}toJSON(){const e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}}kc.NAME="RelativeObjectIdentifierValueBlock";var Cc;class Po extends ve{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,kc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Cc=Po,N.RelativeObjectIdentifier=Cc,Po.NAME="RelativeObjectIdentifier";var xc;class Ye extends _e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}xc=Ye,N.Sequence=xc,Ye.NAME="SEQUENCE";var Bc;let ot=class extends _e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Bc=ot,N.Set=Bc,ot.NAME="SET";class Ec extends nt(Oe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Pe}toJSON(){return{...super.toJSON(),value:this.value}}}Ec.NAME="StringValueBlock";class Nc extends Ec{}Nc.NAME="SimpleStringValueBlock";class Le extends Io{constructor({...e}={}){super(e,Nc)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,C.toUint8Array(e))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.charCodeAt(n);this.valueBlock.value=e}}Le.NAME="SIMPLE STRING";class Ic extends Le{fromBuffer(e){this.valueBlock.valueHexView=C.toUint8Array(e);try{this.valueBlock.value=_.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=_.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(_.FromUtf8String(e)),this.valueBlock.value=e}}Ic.NAME="Utf8StringValueBlock";var Oc;class gt extends Ic{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Oc=gt,N.Utf8String=Oc,gt.NAME="UTF8String";class _c extends Le{fromBuffer(e){this.valueBlock.value=_.ToUtf16String(e),this.valueBlock.valueHexView=C.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(_.FromUtf16String(e))}}_c.NAME="BmpStringValueBlock";var Tc;class Wi extends _c{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Tc=Wi,N.BmpString=Tc,Wi.NAME="BMPString";class Vc extends Le{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),i=new Uint8Array(t);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,i=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let n=0;n<t;n++){const s=Mt(e.charCodeAt(n),8),c=new Uint8Array(s);if(c.length>4)continue;const u=4-c.length;for(let f=c.length-1;f>=0;f--)i[n*4+f+u]=c[f]}this.valueBlock.value=e}}Vc.NAME="UniversalStringValueBlock";var jc;class Gi extends Vc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}jc=Gi,N.UniversalString=jc,Gi.NAME="UniversalString";var Pc;class zi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Pc=zi,N.NumericString=Pc,zi.NAME="NumericString";var Rc;class Ji extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Rc=Ji,N.PrintableString=Rc,Ji.NAME="PrintableString";var Dc;class Yi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Dc=Yi,N.TeletexString=Dc,Yi.NAME="TeletexString";var Mc;class Zi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Mc=Zi,N.VideotexString=Mc,Zi.NAME="VideotexString";var Uc;class Xi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Uc=Xi,N.IA5String=Uc,Xi.NAME="IA5String";var $c;class Qi extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}$c=Qi,N.GraphicString=$c,Qi.NAME="GraphicString";var Hc;class qr extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Hc=qr,N.VisibleString=Hc,qr.NAME="VisibleString";var Lc;class en extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Lc=en,N.GeneralString=Lc,en.NAME="GeneralString";var Fc;class tn extends Le{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Fc=tn,N.CharacterString=Fc,tn.NAME="CharacterString";var qc;class Kr extends qr{constructor({value:e,valueDate:t,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let n=0;n<e.length;n++)this.valueBlock.valueHexView[n]=e.charCodeAt(n)}t&&(this.fromDate(t),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,C.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),i=new Uint8Array(t);for(let n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(i===null){this.error="Wrong input string for conversion";return}const n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(e="iso"){if(e==="iso"){const t=new Array(7);return t[0]=He(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=He(this.month,2),t[2]=He(this.day,2),t[3]=He(this.hour,2),t[4]=He(this.minute,2),t[5]=He(this.second,2),t[6]="Z",t.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}qc=Kr,N.UTCTime=qc,Kr.NAME="UTCTime";var Kc;class rn extends Kr{constructor(e={}){var t;super(e),(t=this.millisecond)!==null&&t!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let t=!1,i="",n="",s=0,c,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const y=new Number(e[e.length-1]);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");i=e}if(t){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let y=1,L=i.indexOf("+"),oe="";if(L===-1&&(L=i.indexOf("-"),y=-1),L!==-1){if(oe=i.substring(L+1),i=i.substring(0,L),oe.length!==2&&oe.length!==4)throw new Error("Wrong input string for conversion");let ie=parseInt(oe.substring(0,2),10);if(isNaN(ie.valueOf()))throw new Error("Wrong input string for conversion");if(u=y*ie,oe.length===4){if(ie=parseInt(oe.substring(2,4),10),isNaN(ie.valueOf()))throw new Error("Wrong input string for conversion");f=y*ie}}}let p=i.indexOf(".");if(p===-1&&(p=i.indexOf(",")),p!==-1){const y=new Number(`0${i.substring(p)}`);if(isNaN(y.valueOf()))throw new Error("Wrong input string for conversion");s=y.valueOf(),n=i.substring(0,p)}else n=i;switch(!0){case n.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,p!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.minute=Math.floor(y),y=60*(y-this.minute),this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){let y=60*s;this.second=Math.floor(y),y=1e3*(y-this.second),this.millisecond=Math.floor(y)}break;case n.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,p!==-1){const y=1e3*s;this.millisecond=Math.floor(y)}break;default:throw new Error("Wrong input string for conversion")}const m=c.exec(n);if(m===null)throw new Error("Wrong input string for conversion");for(let y=1;y<m.length;y++)switch(y){case 1:this.year=parseInt(m[y],10);break;case 2:this.month=parseInt(m[y],10);break;case 3:this.day=parseInt(m[y],10);break;case 4:this.hour=parseInt(m[y],10)+u;break;case 5:this.minute=parseInt(m[y],10)+f;break;case 6:this.second=parseInt(m[y],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const y=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=y.getUTCFullYear(),this.month=y.getUTCMonth(),this.day=y.getUTCDay(),this.hour=y.getUTCHours(),this.minute=y.getUTCMinutes(),this.second=y.getUTCSeconds(),this.millisecond=y.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(He(this.year,4)),t.push(He(this.month,2)),t.push(He(this.day,2)),t.push(He(this.hour,2)),t.push(He(this.minute,2)),t.push(He(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(He(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Kc=rn,N.GeneralizedTime=Kc,rn.NAME="GeneralizedTime";var Wc;class Ro extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Wc=Ro,N.DATE=Wc,Ro.NAME="DATE";var Gc;class Do extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Gc=Do,N.TimeOfDay=Gc,Do.NAME="TimeOfDay";var zc;class Mo extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}zc=Mo,N.DateTime=zc,Mo.NAME="DateTime";var Jc;class Uo extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Jc=Uo,N.Duration=Jc,Uo.NAME="Duration";var Yc;class $o extends gt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Yc=$o,N.TIME=Yc,$o.NAME="TIME";class Ft{constructor({name:e=Pe,optional:t=!1}={}){this.name=e,this.optional=t}}class Ho extends Ft{constructor({value:e=[],...t}={}){super(t),this.value=e}}class nn extends Ft{constructor({value:e=new Ft,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class Df{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=C.toUint8Array(e)}constructor({data:e=Li}={}){this.dataView=C.toUint8Array(e)}fromBER(e,t,i){const n=t+i;return this.dataView=C.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}}function Nt(r,e,t){if(t instanceof Ho){for(const s of t.value)if(Nt(r,e,s).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty(No)&&(s.name=t.name),s}}if(t instanceof Ft)return t.hasOwnProperty(No)&&(r[t.name]=e),{verified:!0,result:r};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Bf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Of in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(_f in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=t.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(Ef)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(Nf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:r};if(t.idBlock.hasOwnProperty(If)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(xf in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:r};if(t.idBlock.isHexOnly){if(!(tc in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(r[t.name]=e)),t instanceof N.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof nn&&(u=e.valueBlock.value.length),u===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let f=!0;for(let p=0;p<t.valueBlock.value.length;p++)f=f&&(t.valueBlock.value[p].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let f=0;f<u;f++)if(f-s>=e.valueBlock.value.length){if(t.valueBlock.value[f].optional===!1){const p={verified:!1,result:r};return r.error="Inconsistent length between ASN.1 data and schema",t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(delete r[t.name],p.name=t.name)),p}}else if(t.valueBlock.value[0]instanceof nn){if(c=Nt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&delete r[t.name]),c;if(No in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let p={};Tf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?p=e:p=r,typeof p[t.valueBlock.value[0].name]>"u"&&(p[t.valueBlock.value[0].name]=[]),p[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(c=Nt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),c.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&delete r[t.name]),c;if(c.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&tc in e.valueBlock){const s=ar(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Pe),t.name&&(delete r[t.name],c.name=t.name)),c}return Nt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function Mf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=ar(C.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Nt(t.result,t.result,e)}const Zc=Object.freeze(Object.defineProperty({__proto__:null,Any:Ft,BaseBlock:ve,BaseStringBlock:Io,BitString:Lt,BmpString:Wi,Boolean:Fi,CharacterString:tn,Choice:Ho,Constructed:_e,DATE:Ro,DateTime:Mo,Duration:Uo,EndOfContent:Oo,Enumerated:qi,GeneralString:en,GeneralizedTime:rn,GraphicString:Qi,HexBlock:nt,IA5String:Xi,Integer:lr,Null:$t,NumericString:zi,ObjectIdentifier:Ki,OctetString:Ht,Primitive:Lr,PrintableString:Ji,RawData:Df,RelativeObjectIdentifier:Po,Repeated:nn,Sequence:Ye,Set:ot,TIME:$o,TeletexString:Yi,TimeOfDay:Do,UTCTime:Kr,UniversalString:Gi,Utf8String:gt,ValueBlock:Oe,VideotexString:Zi,ViewWriter:Hi,VisibleString:qr,compareSchema:Nt,fromBER:cr,verifySchema:Mf},Symbol.toStringTag,{value:"Module"}));var v;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(v||(v={}));var d;(function(r){r[r.Any=1]="Any",r[r.Boolean=2]="Boolean",r[r.OctetString=3]="OctetString",r[r.BitString=4]="BitString",r[r.Integer=5]="Integer",r[r.Enumerated=6]="Enumerated",r[r.ObjectIdentifier=7]="ObjectIdentifier",r[r.Utf8String=8]="Utf8String",r[r.BmpString=9]="BmpString",r[r.UniversalString=10]="UniversalString",r[r.NumericString=11]="NumericString",r[r.PrintableString=12]="PrintableString",r[r.TeletexString=13]="TeletexString",r[r.VideotexString=14]="VideotexString",r[r.IA5String=15]="IA5String",r[r.GraphicString=16]="GraphicString",r[r.VisibleString=17]="VisibleString",r[r.GeneralString=18]="GeneralString",r[r.CharacterString=19]="CharacterString",r[r.UTCTime=20]="UTCTime",r[r.GeneralizedTime=21]="GeneralizedTime",r[r.DATE=22]="DATE",r[r.TimeOfDay=23]="TimeOfDay",r[r.DateTime=24]="DateTime",r[r.Duration=25]="Duration",r[r.TIME=26]="TIME",r[r.Null=27]="Null"})(d||(d={}));class on{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(C.isBufferSource(e))this.unusedBits=t,this.value=C.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Lt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new Lt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Lt({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const i of t)e+=i.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let t=e.toString(2);const i=t.length+7>>3;this.unusedBits=(i<<3)-t.length;const n=new Uint8Array(i);t=t.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class Q{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):C.isBufferSource(e)?this.buffer=C.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Ht))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Ht({valueHex:this.buffer})}toSchema(e){return new Ht({name:e})}}const Uf={fromASN:r=>r instanceof $t?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new $t;const e=cr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},$f={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new lr({value:+r})},Hf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new qi({value:r})},ue={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new lr({valueHex:r})},Lf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Lt({valueHex:r})},Ff={fromASN:r=>r.valueBlock.toString(),toASN:r=>new Ki({value:r})},qf={fromASN:r=>r.valueBlock.value,toASN:r=>new Fi({value:r})},sn={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ht({valueHex:r})},Kf={fromASN:r=>new Q(r.getValue()),toASN:r=>r.toASN()};function We(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Xc=We(gt),Wf=We(Wi),Gf=We(Gi),zf=We(zi),Jf=We(Ji),Yf=We(Yi),Zf=We(Zi),Xf=We(Xi),Qf=We(Qi),ed=We(qr),td=We(en),rd=We(tn),id={fromASN:r=>r.toDate(),toASN:r=>new Kr({valueDate:r})},nd={fromASN:r=>r.toDate(),toASN:r=>new rn({valueDate:r})},od={fromASN:()=>null,toASN:()=>new $t};function Wr(r){switch(r){case d.Any:return Uf;case d.BitString:return Lf;case d.BmpString:return Wf;case d.Boolean:return qf;case d.CharacterString:return rd;case d.Enumerated:return Hf;case d.GeneralString:return td;case d.GeneralizedTime:return nd;case d.GraphicString:return Qf;case d.IA5String:return Xf;case d.Integer:return $f;case d.Null:return od;case d.NumericString:return zf;case d.ObjectIdentifier:return Ff;case d.OctetString:return sn;case d.PrintableString:return Jf;case d.TeletexString:return Yf;case d.UTCTime:return id;case d.UniversalString:return Gf;case d.Utf8String:return Xc;case d.VideotexString:return Zf;case d.VisibleString:return ed;default:return null}}function mt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:mt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Qc(r){var e;if(r){const t=Object.getPrototypeOf(r);return((e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:Qc(t)}return!1}function sd(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),i=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)if(t[n]!==i[n])return!1;return!0}class ad{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!i.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:v.Sequence,items:{}},i=this.findParentSchema(e);return i&&(Object.assign(t,i),t.items=Object.assign({},t.items,i.items)),t}create(e,t){const i=this.items.get(e)||this.createDefault(e),n=[];for(const s in i.items){const c=i.items[s],u=t?s:"";let f;if(typeof c.type=="number"){const m=d[c.type],y=Zc[m];if(!y)throw new Error(`Cannot get ASN1 class by name '${m}'`);f=new y({name:u})}else mt(c.type)?f=new c.type().toSchema(u):c.optional?this.get(c.type).type===v.Choice?f=new Ft({name:u}):(f=this.create(c.type,!1),f.name=u):f=new Ft({name:u});const p=!!c.optional||c.defaultValue!==void 0;if(c.repeated){f.name="";const m=c.repeated==="set"?ot:Ye;f=new m({name:"",value:[new nn({name:u,value:f})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||mt(c.type)){const m=c.repeated?_e:Lr;n.push(new m({name:u,optional:p,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const m=!!c.repeated;let y=m?f:this.get(c.type,!0).schema;y="valueBlock"in y?y.valueBlock.value:y.value,n.push(new _e({name:m?"":u,optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:y}))}else n.push(new _e({optional:p,idBlock:{tagClass:3,tagNumber:c.context},value:[f]}));else f.optional=p,n.push(f)}switch(i.type){case v.Sequence:return new Ye({value:n,name:""});case v.Set:return new ot({value:n,name:""});case v.Choice:return new Ho({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=Object.getPrototypeOf(e);return t?this.items.get(t)||this.findParentSchema(t):null}}const we=new ad,w=r=>e=>{let t;we.has(e)?t=we.get(e):(t=we.createDefault(e),we.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;we.has(e.constructor)?i=we.get(e.constructor):(i=we.createDefault(e.constructor),we.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Wr(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}n.raw=r.raw,i.items[t]=n};class Gr extends Error{constructor(){super(...arguments),this.schemas=[]}}class cd{static parse(e,t){const i=cr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if(mt(t))return new t().fromASN(e);const i=we.get(t);we.cache(t);let n=i.schema;const s=this.handleChoiceTypes(e,i,t,n);if(s!=null&&s.result)return s.result;s!=null&&s.targetSchema&&(n=s.targetSchema);const c=this.handleSequenceTypes(e,i,t,n),u=new t;return Qc(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,c,u),u)}catch(i){throw i instanceof Gr&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===_e&&t.type===v.Choice&&e.idBlock.tagClass===3)for(const s in t.items){const c=t.items[s];if(c.context===e.idBlock.tagNumber&&c.implicit&&typeof c.type=="function"&&we.has(c.type)){const u=we.get(c.type);if(u&&u.type===v.Sequence){const f=new Ye;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in f.valueBlock){f.valueBlock.value=e.valueBlock.value;const p=this.fromASN(f,c.type),m=new i;return m[s]=p,{result:m}}}}}else if(e.constructor===_e&&t.type!==v.Choice){const s=new _e({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(const c in t.items)delete e[c];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===v.Sequence){const s=Nt({},e,n);if(!s.verified)throw new Gr(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{const s=Nt({},e,n);if(!s.verified)throw new Gr(`Data does not match to ${i.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,t,i){let n=e.slice(t);if(n.length===1&&n[0].constructor.name==="Sequence"){const s=n[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(n=s.valueBlock.value)}if(typeof i.type=="number"){const s=Wr(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(c=>c&&c.valueBlock).map(c=>{try{return s.fromASN(c)}catch{return}}).filter(c=>c!==void 0)}else return n.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,i.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,t){const i=Wr(t.type);if(!i)throw new Error(`No converter for ASN.1 type ${t.type}`);return i.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&we.has(e.type)&&we.get(e.type).type===v.Choice}static processOptionalChoiceField(e,t){try{return{processed:!0,value:this.fromASN(e,t.type)}}catch(i){if(i instanceof Gr&&/Wrong values for Choice type/.test(i.message))return{processed:!1};throw i}}static handleArrayTypes(e,t,i){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const n=t.itemType;if(typeof n=="number"){const s=Wr(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,c=>s.fromASN(c))}else return i.from(e.valueBlock.value,s=>this.fromASN(s,n))}static processSchemaItems(e,t,i){for(const n in e.items){const s=t.result[n];if(!s)continue;const c=e.items[n],u=c.type;let f;typeof u=="number"||mt(u)?f=this.processPrimitiveSchemaItem(s,c,u):f=this.processComplexSchemaItem(s,c,u),f&&typeof f=="object"&&"value"in f&&"raw"in f?(i[n]=f.value,i[`${n}Raw`]=f.raw):i[n]=f}}static processPrimitiveSchemaItem(e,t,i){var n;const s=(n=t.converter)!==null&&n!==void 0?n:mt(i)?new i:null;if(!s)throw new Error("Converter is empty");return t.repeated?this.processRepeatedPrimitiveItem(e,t,s):this.processSinglePrimitiveItem(e,t,i,s)}static processRepeatedPrimitiveItem(e,t,i){if(t.implicit){const n=t.repeated==="sequence"?Ye:ot,s=new n;s.valueBlock=e.valueBlock;const c=cr(s.toBER(!1));if(c.offset===-1)throw new Error(`Cannot parse the child item. ${c.result.error}`);if(!("value"in c.result.valueBlock&&Array.isArray(c.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const u=c.result.valueBlock.value;return Array.from(u,f=>i.fromASN(f))}else return Array.from(e,n=>i.fromASN(n))}static processSinglePrimitiveItem(e,t,i,n){let s=e;if(t.implicit){let c;if(mt(i))c=new i().toSchema("");else{const u=d[i],f=Zc[u];if(!f)throw new Error(`Cannot get '${u}' class from asn1js module`);c=new f}c.valueBlock=s.valueBlock,s=cr(c.toBER(!1)).result}return n.fromASN(s)}static processComplexSchemaItem(e,t,i){if(t.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,n=>this.fromASN(n,i))}else{const n=this.handleImplicitTagging(e,t,i);if(this.isOptionalChoiceField(t))try{return this.fromASN(n,i)}catch(s){if(s instanceof Gr&&/Wrong values for Choice type/.test(s.message))return;throw s}else{const s=this.fromASN(n,i);return t.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){const n=we.get(i);if(n.type===v.Sequence){const s=new Ye;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(n.type===v.Set){const s=new ot;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class Lo{static serialize(e){return e instanceof ve?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&mt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=we.get(t);we.cache(t);let n=[];if(i.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const c=Wr(i.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>c.toASN(u))}else n=e.map(c=>this.toAsnItem({type:i.itemType},"[]",t,c))}else for(const c in i.items){const u=i.items[c],f=e[c];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&sd(this.serialize(u.defaultValue),this.serialize(f)))continue;const p=Lo.toAsnItem(u,c,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||mt(u.type))){const m={};m.valueHex=p instanceof $t?p.valueBeforeDecodeView:p.valueBlock.toBER(),n.push(new Lr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...m}))}else n.push(new _e({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:p.valueBlock.value}));else n.push(new _e({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[p]}));else u.repeated?n=n.concat(p):n.push(p)}let s;switch(i.type){case v.Sequence:s=new Ye({value:n});break;case v.Set:s=new ot({value:n});break;case v.Choice:if(!n[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(e,t,i,n){let s;if(typeof e.type=="number"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${d[e.type]} in schema '${i.name}'`);if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const u=Array.from(n,p=>c.toASN(p)),f=e.repeated==="sequence"?Ye:ot;s=new f({value:u})}else s=c.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?Ye:ot;s=new u({value:c})}else s=this.toASN(n);return s}}class re extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class x{static serialize(e){return Lo.serialize(e)}static parse(e,t){return cd.parse(e,t)}static toString(e){const t=C.isBufferSource(e)?C.toArrayBuffer(e):x.serialize(e),i=cr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function a(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var u=r.length-1;u>=0;u--)(c=r[u])&&(s=(n<3?c(s):n>3?c(e,t,s):c(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}function W(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)}function de(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;class el{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const t=e.split(".");if(t.length!==4)throw new Error("Invalid IPv4 address");return t.map(i=>{const n=parseInt(i,10);if(isNaN(n)||n<0||n>255)throw new Error("Invalid IPv4 address part");return n})}static parseIPv6(e){const i=this.expandIPv6(e).split(":");if(i.length!==8)throw new Error("Invalid IPv6 address");return i.reduce((n,s)=>{const c=parseInt(s,16);if(isNaN(c)||c<0||c>65535)throw new Error("Invalid IPv6 address part");return n.push(c>>8&255),n.push(c&255),n},[])}static expandIPv6(e){if(!e.includes("::"))return e;const t=e.split("::");if(t.length>2)throw new Error("Invalid IPv6 address");const i=t[0]?t[0].split(":"):[],n=t[1]?t[1].split(":"):[],s=8-(i.length+n.length);if(s<0)throw new Error("Invalid IPv6 address");return[...i,...Array(s).fill("0"),...n].join(":")}static formatIPv6(e){const t=[];for(let i=0;i<16;i+=2)t.push((e[i]<<8|e[i+1]).toString(16));return this.compressIPv6(t.join(":"))}static compressIPv6(e){const t=e.split(":");let i=-1,n=0,s=-1,c=0;for(let u=0;u<t.length;u++)t[u]==="0"?(s===-1&&(s=u),c++):(c>n&&(i=s,n=c),s=-1,c=0);if(c>n&&(i=s,n=c),n>1){const u=t.slice(0,i).join(":"),f=t.slice(i+n).join(":");return`${u}::${f}`}return e}static parseCIDR(e){const[t,i]=e.split("/"),n=parseInt(i,10);if(this.isIPv4(t)){if(n<0||n>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(t),n]}else{if(n<0||n>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(t),n]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const t=parseInt(e.slice(8),16).toString(2).split("").reduce((n,s)=>n+ +s,0);let i=e.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,16)}.`);return i=i.slice(0,-1),`${i}/${t}`}static toString(e){const t=new Uint8Array(e);if(t.length===4)return Array.from(t).join(".");if(t.length===16)return this.formatIPv6(t);if(t.length===8||t.length===32){const i=t.length/2,n=t.slice(0,i),s=t.slice(i);if(t.every(f=>f===0))return t.length===8?"0.0.0.0/0":"::/0";const u=s.reduce((f,p)=>f+(p.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${u}`:`${this.formatIPv6(n)}/${u}`}return this.decodeIP(_.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length);let c=n;for(let f=0;f<s.length;f++)c>=8?(s[f]=255,c-=8):c>0&&(s[f]=255<<8-c,c=0);const u=new Uint8Array(i.length*2);return u.set(i,0),u.set(s,i.length),u.buffer}const t=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(t).buffer}}var Fo,qo,Ko;let Se=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:d.TeletexString})],Se.prototype,"teletexString",void 0),a([l({type:d.PrintableString})],Se.prototype,"printableString",void 0),a([l({type:d.UniversalString})],Se.prototype,"universalString",void 0),a([l({type:d.Utf8String})],Se.prototype,"utf8String",void 0),a([l({type:d.BmpString})],Se.prototype,"bmpString",void 0),Se=a([w({type:v.Choice})],Se);let ur=class extends Se{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?_.ToHex(this.anyValue):super.toString())}};a([l({type:d.IA5String})],ur.prototype,"ia5String",void 0),a([l({type:d.Any})],ur.prototype,"anyValue",void 0),ur=a([w({type:v.Choice})],ur);class an{constructor(e={}){this.type="",this.value=new ur,Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],an.prototype,"type",void 0),a([l({type:ur})],an.prototype,"value",void 0);let fr=Fo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Fo.prototype)}};fr=Fo=a([w({type:v.Set,itemType:an})],fr);let Wo=qo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Wo=qo=a([w({type:v.Sequence,itemType:fr})],Wo);let ge=Ko=class extends Wo{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};ge=Ko=a([w({type:v.Sequence})],ge);const ld={fromASN:r=>el.toString(sn.fromASN(r)),toASN:r=>sn.toASN(el.fromString(r))};class zr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],zr.prototype,"typeId",void 0),a([l({type:d.Any,context:0})],zr.prototype,"value",void 0);class Go{constructor(e={}){this.partyName=new Se,Object.assign(this,e)}}a([l({type:Se,optional:!0,context:0,implicit:!0})],Go.prototype,"nameAssigner",void 0),a([l({type:Se,context:1,implicit:!0})],Go.prototype,"partyName",void 0);let q=class{constructor(e={}){Object.assign(this,e)}};a([l({type:zr,context:0,implicit:!0})],q.prototype,"otherName",void 0),a([l({type:d.IA5String,context:1,implicit:!0})],q.prototype,"rfc822Name",void 0),a([l({type:d.IA5String,context:2,implicit:!0})],q.prototype,"dNSName",void 0),a([l({type:d.Any,context:3,implicit:!0})],q.prototype,"x400Address",void 0),a([l({type:ge,context:4,implicit:!1})],q.prototype,"directoryName",void 0),a([l({type:Go,context:5})],q.prototype,"ediPartyName",void 0),a([l({type:d.IA5String,context:6,implicit:!0})],q.prototype,"uniformResourceIdentifier",void 0),a([l({type:d.OctetString,context:7,implicit:!0,converter:ld})],q.prototype,"iPAddress",void 0),a([l({type:d.ObjectIdentifier,context:8,implicit:!0})],q.prototype,"registeredID",void 0),q=a([w({type:v.Choice})],q);const zo="1.3.6.1.5.5.7",ud=`${zo}.1`,dr=`${zo}.3`,cn=`${zo}.48`,tl=`${cn}.1`,rl=`${cn}.2`,il=`${cn}.3`,nl=`${cn}.5`,bt="2.5.29";var Jo;const Yo=`${ud}.1`;class Jr{constructor(e={}){this.accessMethod="",this.accessLocation=new q,Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Jr.prototype,"accessMethod",void 0),a([l({type:q})],Jr.prototype,"accessLocation",void 0);let pr=Jo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};pr=Jo=a([w({type:v.Sequence,itemType:Jr})],pr);const Zo=`${bt}.35`;class Xo extends Q{}class qt{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:Xo,context:0,optional:!0,implicit:!0})],qt.prototype,"keyIdentifier",void 0),a([l({type:q,context:1,optional:!0,implicit:!0,repeated:"sequence"})],qt.prototype,"authorityCertIssuer",void 0),a([l({type:d.Integer,context:2,optional:!0,implicit:!0,converter:ue})],qt.prototype,"authorityCertSerialNumber",void 0);const ol=`${bt}.19`;class ln{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:d.Boolean,defaultValue:!1})],ln.prototype,"cA",void 0),a([l({type:d.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0);var Qo;let Ee=Qo=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Ee=Qo=a([w({type:v.Sequence,itemType:q})],Ee);var es;let sl=es=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,es.prototype)}};sl=es=a([w({type:v.Sequence})],sl);var ts;const al=`${bt}.32`;let vt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:d.IA5String})],vt.prototype,"ia5String",void 0),a([l({type:d.VisibleString})],vt.prototype,"visibleString",void 0),a([l({type:d.BmpString})],vt.prototype,"bmpString",void 0),a([l({type:d.Utf8String})],vt.prototype,"utf8String",void 0),vt=a([w({type:v.Choice})],vt);class rs{constructor(e={}){this.organization=new vt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:vt})],rs.prototype,"organization",void 0),a([l({type:d.Integer,repeated:"sequence"})],rs.prototype,"noticeNumbers",void 0);class is{constructor(e={}){Object.assign(this,e)}}a([l({type:rs,optional:!0})],is.prototype,"noticeRef",void 0),a([l({type:vt,optional:!0})],is.prototype,"explicitText",void 0);let un=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.IA5String})],un.prototype,"cPSuri",void 0),a([l({type:is})],un.prototype,"userNotice",void 0),un=a([w({type:v.Choice})],un);class ns{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],ns.prototype,"policyQualifierId",void 0),a([l({type:d.Any})],ns.prototype,"qualifier",void 0);class fn{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],fn.prototype,"policyIdentifier",void 0),a([l({type:ns,repeated:"sequence",optional:!0})],fn.prototype,"policyQualifiers",void 0);let dn=ts=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};dn=ts=a([w({type:v.Sequence,itemType:fn})],dn);let pn=class{constructor(e=0){this.value=e}};a([l({type:d.Integer})],pn.prototype,"value",void 0),pn=a([w({type:v.Choice})],pn);let cl=class extends pn{};cl=a([w({type:v.Choice})],cl);var os;const ss=`${bt}.31`;var Ze;(function(r){r[r.unused=1]="unused",r[r.keyCompromise=2]="keyCompromise",r[r.cACompromise=4]="cACompromise",r[r.affiliationChanged=8]="affiliationChanged",r[r.superseded=16]="superseded",r[r.cessationOfOperation=32]="cessationOfOperation",r[r.certificateHold=64]="certificateHold",r[r.privilegeWithdrawn=128]="privilegeWithdrawn",r[r.aACompromise=256]="aACompromise"})(Ze||(Ze={}));class ll extends on{toJSON(){const e=[],t=this.toNumber();return t&Ze.aACompromise&&e.push("aACompromise"),t&Ze.affiliationChanged&&e.push("affiliationChanged"),t&Ze.cACompromise&&e.push("cACompromise"),t&Ze.certificateHold&&e.push("certificateHold"),t&Ze.cessationOfOperation&&e.push("cessationOfOperation"),t&Ze.keyCompromise&&e.push("keyCompromise"),t&Ze.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Ze.superseded&&e.push("superseded"),t&Ze.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Kt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:q,context:0,repeated:"sequence",implicit:!0})],Kt.prototype,"fullName",void 0),a([l({type:fr,context:1,implicit:!0})],Kt.prototype,"nameRelativeToCRLIssuer",void 0),Kt=a([w({type:v.Choice})],Kt);class hr{constructor(e={}){Object.assign(this,e)}}a([l({type:Kt,context:0,optional:!0})],hr.prototype,"distributionPoint",void 0),a([l({type:ll,context:1,optional:!0,implicit:!0})],hr.prototype,"reasons",void 0),a([l({type:q,context:2,optional:!0,repeated:"sequence",implicit:!0})],hr.prototype,"cRLIssuer",void 0);let yr=os=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,os.prototype)}};yr=os=a([w({type:v.Sequence,itemType:hr})],yr);var as;let ul=as=class extends yr{constructor(e){super(e),Object.setPrototypeOf(this,as.prototype)}};ul=as=a([w({type:v.Sequence,itemType:hr})],ul);class Ne{constructor(e={}){this.onlyContainsUserCerts=Ne.ONLY,this.onlyContainsCACerts=Ne.ONLY,this.indirectCRL=Ne.ONLY,this.onlyContainsAttributeCerts=Ne.ONLY,Object.assign(this,e)}}Ne.ONLY=!1,a([l({type:Kt,context:0,optional:!0})],Ne.prototype,"distributionPoint",void 0),a([l({type:d.Boolean,context:1,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"onlyContainsUserCerts",void 0),a([l({type:d.Boolean,context:2,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"onlyContainsCACerts",void 0),a([l({type:ll,context:3,optional:!0,implicit:!0})],Ne.prototype,"onlySomeReasons",void 0),a([l({type:d.Boolean,context:4,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"indirectCRL",void 0),a([l({type:d.Boolean,context:5,defaultValue:Ne.ONLY,implicit:!0})],Ne.prototype,"onlyContainsAttributeCerts",void 0);var Yr;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(Yr||(Yr={}));let cs=class{constructor(e=Yr.unspecified){this.reason=Yr.unspecified,this.reason=e}toJSON(){return Yr[this.reason]}toString(){return this.toJSON()}};a([l({type:d.Enumerated})],cs.prototype,"reason",void 0),cs=a([w({type:v.Choice})],cs);var ls;const fl=`${bt}.37`;let hn=ls=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};hn=ls=a([w({type:v.Sequence,itemType:d.ObjectIdentifier})],hn);const fd=`${dr}.1`,dd=`${dr}.2`,pd=`${dr}.3`,hd=`${dr}.4`,yd=`${dr}.8`,gd=`${dr}.9`;let us=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:d.Integer,converter:ue})],us.prototype,"value",void 0),us=a([w({type:v.Choice})],us);let fs=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:d.GeneralizedTime})],fs.prototype,"value",void 0),fs=a([w({type:v.Choice})],fs);var ds;const dl=`${bt}.18`;let pl=ds=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,ds.prototype)}};pl=ds=a([w({type:v.Sequence})],pl);const hl=`${bt}.15`;var Xe;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(Xe||(Xe={}));class ps extends on{toJSON(){const e=this.toNumber(),t=[];return e&Xe.cRLSign&&t.push("crlSign"),e&Xe.dataEncipherment&&t.push("dataEncipherment"),e&Xe.decipherOnly&&t.push("decipherOnly"),e&Xe.digitalSignature&&t.push("digitalSignature"),e&Xe.encipherOnly&&t.push("encipherOnly"),e&Xe.keyAgreement&&t.push("keyAgreement"),e&Xe.keyCertSign&&t.push("keyCertSign"),e&Xe.keyEncipherment&&t.push("keyEncipherment"),e&Xe.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var hs;class yn{constructor(e={}){this.base=new q,this.minimum=0,Object.assign(this,e)}}a([l({type:q})],yn.prototype,"base",void 0),a([l({type:d.Integer,context:0,defaultValue:0,implicit:!0})],yn.prototype,"minimum",void 0),a([l({type:d.Integer,context:1,optional:!0,implicit:!0})],yn.prototype,"maximum",void 0);let gn=hs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,hs.prototype)}};gn=hs=a([w({type:v.Sequence,itemType:yn})],gn);class yl{constructor(e={}){Object.assign(this,e)}}a([l({type:gn,context:0,optional:!0,implicit:!0})],yl.prototype,"permittedSubtrees",void 0),a([l({type:gn,context:1,optional:!0,implicit:!0})],yl.prototype,"excludedSubtrees",void 0);class gl{constructor(e={}){Object.assign(this,e)}}a([l({type:d.Integer,context:0,implicit:!0,optional:!0,converter:ue})],gl.prototype,"requireExplicitPolicy",void 0),a([l({type:d.Integer,context:1,implicit:!0,optional:!0,converter:ue})],gl.prototype,"inhibitPolicyMapping",void 0);var ys;class gs{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],gs.prototype,"issuerDomainPolicy",void 0),a([l({type:d.ObjectIdentifier})],gs.prototype,"subjectDomainPolicy",void 0);let ml=ys=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};ml=ys=a([w({type:v.Sequence,itemType:gs})],ml);var ms;const bl=`${bt}.17`;let bs=ms=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,ms.prototype)}};bs=ms=a([w({type:v.Sequence})],bs);let wt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],wt.prototype,"type",void 0),a([l({type:d.Any,repeated:"set"})],wt.prototype,"values",void 0);var vs;let vl=vs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};vl=vs=a([w({type:v.Sequence,itemType:wt})],vl);const wl=`${bt}.14`;class It extends Xo{}class Sl{constructor(e={}){Object.assign(this,e)}}a([l({type:d.GeneralizedTime,context:0,implicit:!0,optional:!0})],Sl.prototype,"notBefore",void 0),a([l({type:d.GeneralizedTime,context:1,implicit:!0,optional:!0})],Sl.prototype,"notAfter",void 0);var Zr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Zr||(Zr={}));class Al extends on{toJSON(){const e=[],t=this.toNumber();return t&Zr.pKIXCertificate&&e.push("pKIXCertificate"),t&Zr.newExtensions&&e.push("newExtensions"),t&Zr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class kl{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Al,Object.assign(this,e)}}a([l({type:d.GeneralString})],kl.prototype,"entrustVers",void 0),a([l({type:Al})],kl.prototype,"entrustInfoFlags",void 0);var ws;let Cl=ws=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};Cl=ws=a([w({type:v.Sequence,itemType:Jr})],Cl);class E{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof E&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Xa(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:d.ObjectIdentifier})],E.prototype,"algorithm",void 0),a([l({type:d.Any,optional:!0})],E.prototype,"parameters",void 0);class st{constructor(e={}){this.algorithm=new E,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:E})],st.prototype,"algorithm",void 0),a([l({type:d.BitString})],st.prototype,"subjectPublicKey",void 0);let Ae=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:d.UTCTime})],Ae.prototype,"utcTime",void 0),a([l({type:d.GeneralizedTime})],Ae.prototype,"generalTime",void 0),Ae=a([w({type:v.Choice})],Ae);class mn{constructor(e){this.notBefore=new Ae(new Date),this.notAfter=new Ae(new Date),e&&(this.notBefore=new Ae(e.notBefore),this.notAfter=new Ae(e.notAfter))}}a([l({type:Ae})],mn.prototype,"notBefore",void 0),a([l({type:Ae})],mn.prototype,"notAfter",void 0);var Ss;let Qe=class mf{constructor(e={}){this.extnID="",this.critical=mf.CRITICAL,this.extnValue=new Q,Object.assign(this,e)}};Qe.CRITICAL=!1,a([l({type:d.ObjectIdentifier})],Qe.prototype,"extnID",void 0),a([l({type:d.Boolean,defaultValue:Qe.CRITICAL})],Qe.prototype,"critical",void 0),a([l({type:Q})],Qe.prototype,"extnValue",void 0);let Wt=Ss=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ss.prototype)}};Wt=Ss=a([w({type:v.Sequence,itemType:Qe})],Wt);var gr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(gr||(gr={}));class Ge{constructor(e={}){this.version=gr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new E,this.issuer=new ge,this.validity=new mn,this.subject=new ge,this.subjectPublicKeyInfo=new st,Object.assign(this,e)}}a([l({type:d.Integer,context:0,defaultValue:gr.v1})],Ge.prototype,"version",void 0),a([l({type:d.Integer,converter:ue})],Ge.prototype,"serialNumber",void 0),a([l({type:E})],Ge.prototype,"signature",void 0),a([l({type:ge})],Ge.prototype,"issuer",void 0),a([l({type:mn})],Ge.prototype,"validity",void 0),a([l({type:ge})],Ge.prototype,"subject",void 0),a([l({type:st})],Ge.prototype,"subjectPublicKeyInfo",void 0),a([l({type:d.BitString,context:1,implicit:!0,optional:!0})],Ge.prototype,"issuerUniqueID",void 0),a([l({type:d.BitString,context:2,implicit:!0,optional:!0})],Ge.prototype,"subjectUniqueID",void 0),a([l({type:Wt,context:3,optional:!0})],Ge.prototype,"extensions",void 0);class mr{constructor(e={}){this.tbsCertificate=new Ge,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ge,raw:!0})],mr.prototype,"tbsCertificate",void 0),a([l({type:E})],mr.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],mr.prototype,"signatureValue",void 0);class bn{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Ae,Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],bn.prototype,"userCertificate",void 0),a([l({type:Ae})],bn.prototype,"revocationDate",void 0),a([l({type:Qe,optional:!0,repeated:"sequence"})],bn.prototype,"crlEntryExtensions",void 0);class St{constructor(e={}){this.signature=new E,this.issuer=new ge,this.thisUpdate=new Ae,Object.assign(this,e)}}a([l({type:d.Integer,optional:!0})],St.prototype,"version",void 0),a([l({type:E})],St.prototype,"signature",void 0),a([l({type:ge})],St.prototype,"issuer",void 0),a([l({type:Ae})],St.prototype,"thisUpdate",void 0),a([l({type:Ae,optional:!0})],St.prototype,"nextUpdate",void 0),a([l({type:bn,repeated:"sequence",optional:!0})],St.prototype,"revokedCertificates",void 0),a([l({type:Qe,optional:!0,context:0,repeated:"sequence"})],St.prototype,"crlExtensions",void 0);let As=class{constructor(e={}){this.tbsCertList=new St,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:St,raw:!0})],As.prototype,"tbsCertList",void 0),a([l({type:E})],As.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],As.prototype,"signature",void 0);class br{constructor(e={}){this.issuer=new ge,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:ge})],br.prototype,"issuer",void 0),a([l({type:d.Integer,converter:ue})],br.prototype,"serialNumber",void 0);let vr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:It,context:0,implicit:!0})],vr.prototype,"subjectKeyIdentifier",void 0),a([l({type:br})],vr.prototype,"issuerAndSerialNumber",void 0),vr=a([w({type:v.Choice})],vr);var At;(function(r){r[r.v0=0]="v0",r[r.v1=1]="v1",r[r.v2=2]="v2",r[r.v3=3]="v3",r[r.v4=4]="v4",r[r.v5=5]="v5"})(At||(At={}));let Xr=class extends E{};Xr=a([w({type:v.Sequence})],Xr);let vn=class extends E{};vn=a([w({type:v.Sequence})],vn);let at=class extends E{};at=a([w({type:v.Sequence})],at);let wn=class extends E{};wn=a([w({type:v.Sequence})],wn);let xl=class extends E{};xl=a([w({type:v.Sequence})],xl);let ks=class extends E{};ks=a([w({type:v.Sequence})],ks);let wr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],wr.prototype,"attrType",void 0),a([l({type:d.Any,repeated:"set"})],wr.prototype,"attrValues",void 0);var Cs;class ct{constructor(e={}){this.version=At.v0,this.sid=new vr,this.digestAlgorithm=new Xr,this.signatureAlgorithm=new vn,this.signature=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],ct.prototype,"version",void 0),a([l({type:vr})],ct.prototype,"sid",void 0),a([l({type:Xr})],ct.prototype,"digestAlgorithm",void 0),a([l({type:wr,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],ct.prototype,"signedAttrs",void 0),a([l({type:vn})],ct.prototype,"signatureAlgorithm",void 0),a([l({type:Q})],ct.prototype,"signature",void 0),a([l({type:wr,repeated:"set",context:1,implicit:!0,optional:!0})],ct.prototype,"unsignedAttrs",void 0);let Sn=Cs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};Sn=Cs=a([w({type:v.Set,itemType:ct})],Sn);let Bl=class extends ct{};Bl=a([w({type:v.Sequence})],Bl);let El=class extends Ae{};El=a([w({type:v.Choice})],El);class xs{constructor(e={}){this.acIssuer=new q,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:q})],xs.prototype,"acIssuer",void 0),a([l({type:d.Integer})],xs.prototype,"acSerial",void 0),a([l({type:wt,repeated:"sequence"})],xs.prototype,"attrs",void 0);var Bs;let An=Bs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};An=Bs=a([w({type:v.Sequence,itemType:d.ObjectIdentifier})],An);class kn{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:d.Integer,optional:!0})],kn.prototype,"pathLenConstraint",void 0),a([l({type:An,implicit:!0,context:0,optional:!0})],kn.prototype,"permittedAttrs",void 0),a([l({type:An,implicit:!0,context:1,optional:!0})],kn.prototype,"excludedAttrs",void 0),a([l({type:d.Boolean,defaultValue:!0})],kn.prototype,"permitUnSpecified",void 0);class Gt{constructor(e={}){this.issuer=new Ee,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ee})],Gt.prototype,"issuer",void 0),a([l({type:d.Integer,converter:ue})],Gt.prototype,"serial",void 0),a([l({type:d.BitString,optional:!0})],Gt.prototype,"issuerUID",void 0);var Es;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(Es||(Es={}));class zt{constructor(e={}){this.digestedObjectType=Es.publicKey,this.digestAlgorithm=new E,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Enumerated})],zt.prototype,"digestedObjectType",void 0),a([l({type:d.ObjectIdentifier,optional:!0})],zt.prototype,"otherObjectTypeID",void 0),a([l({type:E})],zt.prototype,"digestAlgorithm",void 0),a([l({type:d.BitString})],zt.prototype,"objectDigest",void 0);class Cn{constructor(e={}){Object.assign(this,e)}}a([l({type:Ee,optional:!0})],Cn.prototype,"issuerName",void 0),a([l({type:Gt,context:0,implicit:!0,optional:!0})],Cn.prototype,"baseCertificateID",void 0),a([l({type:zt,context:1,implicit:!0,optional:!0})],Cn.prototype,"objectDigestInfo",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:q,repeated:"sequence"})],Sr.prototype,"v1Form",void 0),a([l({type:Cn,context:0,implicit:!0})],Sr.prototype,"v2Form",void 0),Sr=a([w({type:v.Choice})],Sr);class xn{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:d.GeneralizedTime})],xn.prototype,"notBeforeTime",void 0),a([l({type:d.GeneralizedTime})],xn.prototype,"notAfterTime",void 0);class Qr{constructor(e={}){Object.assign(this,e)}}a([l({type:Gt,implicit:!0,context:0,optional:!0})],Qr.prototype,"baseCertificateID",void 0),a([l({type:Ee,implicit:!0,context:1,optional:!0})],Qr.prototype,"entityName",void 0),a([l({type:zt,implicit:!0,context:2,optional:!0})],Qr.prototype,"objectDigestInfo",void 0);var Ns;(function(r){r[r.v2=1]="v2"})(Ns||(Ns={}));class et{constructor(e={}){this.version=Ns.v2,this.holder=new Qr,this.issuer=new Sr,this.signature=new E,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new xn,this.attributes=[],Object.assign(this,e)}}a([l({type:d.Integer})],et.prototype,"version",void 0),a([l({type:Qr})],et.prototype,"holder",void 0),a([l({type:Sr})],et.prototype,"issuer",void 0),a([l({type:E})],et.prototype,"signature",void 0),a([l({type:d.Integer,converter:ue})],et.prototype,"serialNumber",void 0),a([l({type:xn})],et.prototype,"attrCertValidityPeriod",void 0),a([l({type:wt,repeated:"sequence"})],et.prototype,"attributes",void 0),a([l({type:d.BitString,optional:!0})],et.prototype,"issuerUniqueID",void 0),a([l({type:Wt,optional:!0})],et.prototype,"extensions",void 0);class Bn{constructor(e={}){this.acinfo=new et,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:et})],Bn.prototype,"acinfo",void 0),a([l({type:E})],Bn.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],Bn.prototype,"signatureValue",void 0);var En;(function(r){r[r.unmarked=1]="unmarked",r[r.unclassified=2]="unclassified",r[r.restricted=4]="restricted",r[r.confidential=8]="confidential",r[r.secret=16]="secret",r[r.topSecret=32]="topSecret"})(En||(En={}));class Is extends on{}class Os{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier,implicit:!0,context:0})],Os.prototype,"type",void 0),a([l({type:d.Any,implicit:!0,context:1})],Os.prototype,"value",void 0);class _s{constructor(e={}){this.policyId="",this.classList=new Is(En.unclassified),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],_s.prototype,"policyId",void 0),a([l({type:Is,defaultValue:new Is(En.unclassified)})],_s.prototype,"classList",void 0),a([l({type:Os,repeated:"set"})],_s.prototype,"securityCategories",void 0);class Nn{constructor(e={}){Object.assign(this,e)}}a([l({type:Q})],Nn.prototype,"cotets",void 0),a([l({type:d.ObjectIdentifier})],Nn.prototype,"oid",void 0),a([l({type:d.Utf8String})],Nn.prototype,"string",void 0);class Nl{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ee,implicit:!0,context:0,optional:!0})],Nl.prototype,"policyAuthority",void 0),a([l({type:Nn,repeated:"sequence"})],Nl.prototype,"values",void 0);var Ts;class In{constructor(e={}){this.targetCertificate=new Gt,Object.assign(this,e)}}a([l({type:Gt})],In.prototype,"targetCertificate",void 0),a([l({type:q,optional:!0})],In.prototype,"targetName",void 0),a([l({type:zt,optional:!0})],In.prototype,"certDigestInfo",void 0);let Ar=class{constructor(e={}){Object.assign(this,e)}};a([l({type:q,context:0,implicit:!0})],Ar.prototype,"targetName",void 0),a([l({type:q,context:1,implicit:!0})],Ar.prototype,"targetGroup",void 0),a([l({type:In,context:2,implicit:!0})],Ar.prototype,"targetCert",void 0),Ar=a([w({type:v.Choice})],Ar);let Vs=Ts=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=a([w({type:v.Sequence,itemType:Ar})],Vs);var js;let Il=js=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,js.prototype)}};Il=js=a([w({type:v.Sequence,itemType:Vs})],Il);class Ol{constructor(e={}){Object.assign(this,e)}}a([l({type:Ee,implicit:!0,context:0,optional:!0})],Ol.prototype,"roleAuthority",void 0),a([l({type:q,implicit:!0,context:1})],Ol.prototype,"roleName",void 0);class Ps{constructor(e={}){this.service=new q,this.ident=new q,Object.assign(this,e)}}a([l({type:q})],Ps.prototype,"service",void 0),a([l({type:q})],Ps.prototype,"ident",void 0),a([l({type:Q,optional:!0})],Ps.prototype,"authInfo",void 0);var Rs;class Ds{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Ds.prototype,"otherCertFormat",void 0),a([l({type:d.Any})],Ds.prototype,"otherCert",void 0);let kr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:mr})],kr.prototype,"certificate",void 0),a([l({type:Bn,context:2,implicit:!0})],kr.prototype,"v2AttrCert",void 0),a([l({type:Ds,context:3,implicit:!0})],kr.prototype,"other",void 0),kr=a([w({type:v.Choice})],kr);let On=Rs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Rs.prototype)}};On=Rs=a([w({type:v.Set,itemType:kr})],On);class Cr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Cr.prototype,"contentType",void 0),a([l({type:d.Any,context:0})],Cr.prototype,"content",void 0);let ei=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q})],ei.prototype,"single",void 0),a([l({type:d.Any})],ei.prototype,"any",void 0),ei=a([w({type:v.Choice})],ei);class _n{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],_n.prototype,"eContentType",void 0),a([l({type:ei,context:0,optional:!0})],_n.prototype,"eContent",void 0);let ti=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Q,context:0,implicit:!0,optional:!0})],ti.prototype,"value",void 0),a([l({type:Q,converter:Kf,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ti.prototype,"constructedValue",void 0),ti=a([w({type:v.Choice})],ti);class ri{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],ri.prototype,"contentType",void 0),a([l({type:wn})],ri.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:ti,optional:!0})],ri.prototype,"encryptedContent",void 0);class Tn{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Tn.prototype,"keyAttrId",void 0),a([l({type:d.Any,optional:!0})],Tn.prototype,"keyAttr",void 0);var Ms;class Vn{constructor(e={}){this.subjectKeyIdentifier=new It,Object.assign(this,e)}}a([l({type:It})],Vn.prototype,"subjectKeyIdentifier",void 0),a([l({type:d.GeneralizedTime,optional:!0})],Vn.prototype,"date",void 0),a([l({type:Tn,optional:!0})],Vn.prototype,"other",void 0);let xr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Vn,context:0,implicit:!0,optional:!0})],xr.prototype,"rKeyId",void 0),a([l({type:br,optional:!0})],xr.prototype,"issuerAndSerialNumber",void 0),xr=a([w({type:v.Choice})],xr);class Us{constructor(e={}){this.rid=new xr,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:xr})],Us.prototype,"rid",void 0),a([l({type:Q})],Us.prototype,"encryptedKey",void 0);let jn=Ms=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ms.prototype)}};jn=Ms=a([w({type:v.Sequence,itemType:Us})],jn);class $s{constructor(e={}){this.algorithm=new E,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:E})],$s.prototype,"algorithm",void 0),a([l({type:d.BitString})],$s.prototype,"publicKey",void 0);let Jt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:It,context:0,implicit:!0,optional:!0})],Jt.prototype,"subjectKeyIdentifier",void 0),a([l({type:$s,context:1,implicit:!0,optional:!0})],Jt.prototype,"originatorKey",void 0),a([l({type:br,optional:!0})],Jt.prototype,"issuerAndSerialNumber",void 0),Jt=a([w({type:v.Choice})],Jt);class Br{constructor(e={}){this.version=At.v3,this.originator=new Jt,this.keyEncryptionAlgorithm=new at,this.recipientEncryptedKeys=new jn,Object.assign(this,e)}}a([l({type:d.Integer})],Br.prototype,"version",void 0),a([l({type:Jt,context:0})],Br.prototype,"originator",void 0),a([l({type:Q,context:1,optional:!0})],Br.prototype,"ukm",void 0),a([l({type:at})],Br.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:jn})],Br.prototype,"recipientEncryptedKeys",void 0);let Er=class{constructor(e={}){Object.assign(this,e)}};a([l({type:It,context:0,implicit:!0})],Er.prototype,"subjectKeyIdentifier",void 0),a([l({type:br})],Er.prototype,"issuerAndSerialNumber",void 0),Er=a([w({type:v.Choice})],Er);class ii{constructor(e={}){this.version=At.v0,this.rid=new Er,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],ii.prototype,"version",void 0),a([l({type:Er})],ii.prototype,"rid",void 0),a([l({type:at})],ii.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Q})],ii.prototype,"encryptedKey",void 0);class ni{constructor(e={}){this.keyIdentifier=new Q,Object.assign(this,e)}}a([l({type:Q})],ni.prototype,"keyIdentifier",void 0),a([l({type:d.GeneralizedTime,optional:!0})],ni.prototype,"date",void 0),a([l({type:Tn,optional:!0})],ni.prototype,"other",void 0);class oi{constructor(e={}){this.version=At.v4,this.kekid=new ni,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],oi.prototype,"version",void 0),a([l({type:ni})],oi.prototype,"kekid",void 0),a([l({type:at})],oi.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Q})],oi.prototype,"encryptedKey",void 0);class si{constructor(e={}){this.version=At.v0,this.keyEncryptionAlgorithm=new at,this.encryptedKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],si.prototype,"version",void 0),a([l({type:ks,context:0,optional:!0})],si.prototype,"keyDerivationAlgorithm",void 0),a([l({type:at})],si.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Q})],si.prototype,"encryptedKey",void 0);class Hs{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Hs.prototype,"oriType",void 0),a([l({type:d.Any})],Hs.prototype,"oriValue",void 0);let Ot=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ii,optional:!0})],Ot.prototype,"ktri",void 0),a([l({type:Br,context:1,implicit:!0,optional:!0})],Ot.prototype,"kari",void 0),a([l({type:oi,context:2,implicit:!0,optional:!0})],Ot.prototype,"kekri",void 0),a([l({type:si,context:3,implicit:!0,optional:!0})],Ot.prototype,"pwri",void 0),a([l({type:Hs,context:4,implicit:!0,optional:!0})],Ot.prototype,"ori",void 0),Ot=a([w({type:v.Choice})],Ot);var Ls;let Pn=Ls=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ls.prototype)}};Pn=Ls=a([w({type:v.Set,itemType:Ot})],Pn);var Fs;class Rn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Rn.prototype,"otherRevInfoFormat",void 0),a([l({type:d.Any})],Rn.prototype,"otherRevInfo",void 0);let Dn=class{constructor(e={}){this.other=new Rn,Object.assign(this,e)}};a([l({type:Rn,context:1,implicit:!0})],Dn.prototype,"other",void 0),Dn=a([w({type:v.Choice})],Dn);let Mn=Fs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Fs.prototype)}};Mn=Fs=a([w({type:v.Set,itemType:Dn})],Mn);class qs{constructor(e={}){Object.assign(this,e)}}a([l({type:On,context:0,implicit:!0,optional:!0})],qs.prototype,"certs",void 0),a([l({type:Mn,context:1,implicit:!0,optional:!0})],qs.prototype,"crls",void 0);var Ks;let Ws=Ks=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Ws=Ks=a([w({type:v.Set,itemType:wr})],Ws);class ai{constructor(e={}){this.version=At.v0,this.recipientInfos=new Pn,this.encryptedContentInfo=new ri,Object.assign(this,e)}}a([l({type:d.Integer})],ai.prototype,"version",void 0),a([l({type:qs,context:0,implicit:!0,optional:!0})],ai.prototype,"originatorInfo",void 0),a([l({type:Pn})],ai.prototype,"recipientInfos",void 0),a([l({type:ri})],ai.prototype,"encryptedContentInfo",void 0),a([l({type:Ws,context:1,implicit:!0,optional:!0})],ai.prototype,"unprotectedAttrs",void 0);const md="1.2.840.113549.1.7.2";var Gs;let Un=Gs=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,Gs.prototype)}};Un=Gs=a([w({type:v.Set,itemType:Xr})],Un);class Nr{constructor(e={}){this.version=At.v0,this.digestAlgorithms=new Un,this.encapContentInfo=new _n,this.signerInfos=new Sn,Object.assign(this,e)}}a([l({type:d.Integer})],Nr.prototype,"version",void 0),a([l({type:Un})],Nr.prototype,"digestAlgorithms",void 0),a([l({type:_n})],Nr.prototype,"encapContentInfo",void 0),a([l({type:On,context:0,implicit:!0,optional:!0})],Nr.prototype,"certificates",void 0),a([l({type:Mn,context:1,implicit:!0,optional:!0})],Nr.prototype,"crls",void 0),a([l({type:Sn})],Nr.prototype,"signerInfos",void 0);const ci="1.2.840.10045.2.1",zs="1.2.840.10045.4.1",_l="1.2.840.10045.4.3.1",Js="1.2.840.10045.4.3.2",Ys="1.2.840.10045.4.3.3",Zs="1.2.840.10045.4.3.4",Tl="1.2.840.10045.3.1.7",Vl="1.3.132.0.34",jl="1.3.132.0.35";function li(r){return new E({algorithm:r})}const bd=li(zs);li(_l);const vd=li(Js),wd=li(Ys),Sd=li(Zs);let ui=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],ui.prototype,"fieldType",void 0),a([l({type:d.Any})],ui.prototype,"parameters",void 0),ui=a([w({type:v.Sequence})],ui);class Ad extends Q{}let Ir=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.OctetString})],Ir.prototype,"a",void 0),a([l({type:d.OctetString})],Ir.prototype,"b",void 0),a([l({type:d.BitString,optional:!0})],Ir.prototype,"seed",void 0),Ir=a([w({type:v.Sequence})],Ir);var Xs;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Xs||(Xs={}));let kt=class{constructor(e={}){this.version=Xs.ecpVer1,Object.assign(this,e)}};a([l({type:d.Integer})],kt.prototype,"version",void 0),a([l({type:ui})],kt.prototype,"fieldID",void 0),a([l({type:Ir})],kt.prototype,"curve",void 0),a([l({type:Ad})],kt.prototype,"base",void 0),a([l({type:d.Integer,converter:ue})],kt.prototype,"order",void 0),a([l({type:d.Integer,optional:!0})],kt.prototype,"cofactor",void 0),kt=a([w({type:v.Sequence})],kt);let _t=class{constructor(e={}){Object.assign(this,e)}};a([l({type:d.ObjectIdentifier})],_t.prototype,"namedCurve",void 0),a([l({type:d.Null})],_t.prototype,"implicitCurve",void 0),a([l({type:kt})],_t.prototype,"specifiedCurve",void 0),_t=a([w({type:v.Choice})],_t);class $n{constructor(e={}){this.version=1,this.privateKey=new Q,Object.assign(this,e)}}a([l({type:d.Integer})],$n.prototype,"version",void 0),a([l({type:Q})],$n.prototype,"privateKey",void 0),a([l({type:_t,context:0,optional:!0})],$n.prototype,"parameters",void 0),a([l({type:d.BitString,context:1,optional:!0})],$n.prototype,"publicKey",void 0);class Hn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],Hn.prototype,"r",void 0),a([l({type:d.Integer,converter:ue})],Hn.prototype,"s",void 0);const Re="1.2.840.113549.1.1",Yt=`${Re}.1`,kd=`${Re}.7`,Cd=`${Re}.9`,fi=`${Re}.10`,xd=`${Re}.2`,Bd=`${Re}.4`,Ln=`${Re}.5`,Ed=`${Re}.14`,Qs=`${Re}.11`,Fn=`${Re}.12`,qn=`${Re}.13`,Pl=`${Re}.15`,Rl=`${Re}.16`,Kn="1.3.14.3.2.26",Dl="2.16.840.1.101.3.4.2.4",Wn="2.16.840.1.101.3.4.2.1",Gn="2.16.840.1.101.3.4.2.2",zn="2.16.840.1.101.3.4.2.3",Nd="2.16.840.1.101.3.4.2.5",Id="2.16.840.1.101.3.4.2.6",Od="1.2.840.113549.2.2",_d="1.2.840.113549.2.5",Jn=`${Re}.8`;function me(r){return new E({algorithm:r,parameters:null})}me(Od),me(_d);const Zt=me(Kn);me(Dl),me(Wn),me(Gn),me(zn),me(Nd),me(Id);const Ml=new E({algorithm:Jn,parameters:x.serialize(Zt)}),Ul=new E({algorithm:Cd,parameters:x.serialize(sn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});me(Yt),me(xd),me(Bd),me(Ln),me(Pl),me(Rl),me(Fn),me(qn),me(Pl),me(Rl);class Yn{constructor(e={}){this.hashAlgorithm=new E(Zt),this.maskGenAlgorithm=new E({algorithm:Jn,parameters:x.serialize(Zt)}),this.pSourceAlgorithm=new E(Ul),Object.assign(this,e)}}a([l({type:E,context:0,defaultValue:Zt})],Yn.prototype,"hashAlgorithm",void 0),a([l({type:E,context:1,defaultValue:Ml})],Yn.prototype,"maskGenAlgorithm",void 0),a([l({type:E,context:2,defaultValue:Ul})],Yn.prototype,"pSourceAlgorithm",void 0),new E({algorithm:kd,parameters:x.serialize(new Yn)});class Xt{constructor(e={}){this.hashAlgorithm=new E(Zt),this.maskGenAlgorithm=new E({algorithm:Jn,parameters:x.serialize(Zt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:E,context:0,defaultValue:Zt})],Xt.prototype,"hashAlgorithm",void 0),a([l({type:E,context:1,defaultValue:Ml})],Xt.prototype,"maskGenAlgorithm",void 0),a([l({type:d.Integer,context:2,defaultValue:20})],Xt.prototype,"saltLength",void 0),a([l({type:d.Integer,context:3,defaultValue:1})],Xt.prototype,"trailerField",void 0),new E({algorithm:fi,parameters:x.serialize(new Xt)});class Zn{constructor(e={}){this.digestAlgorithm=new E,this.digest=new Q,Object.assign(this,e)}}a([l({type:E})],Zn.prototype,"digestAlgorithm",void 0),a([l({type:Q})],Zn.prototype,"digest",void 0);var ea;class Xn{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],Xn.prototype,"prime",void 0),a([l({type:d.Integer,converter:ue})],Xn.prototype,"exponent",void 0),a([l({type:d.Integer,converter:ue})],Xn.prototype,"coefficient",void 0);let ta=ea=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ea.prototype)}};ta=ea=a([w({type:v.Sequence,itemType:Xn})],ta);class lt{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer})],lt.prototype,"version",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"modulus",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"publicExponent",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"privateExponent",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"prime1",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"prime2",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"exponent1",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"exponent2",void 0),a([l({type:d.Integer,converter:ue})],lt.prototype,"coefficient",void 0),a([l({type:ta,optional:!0})],lt.prototype,"otherPrimeInfos",void 0);class ra{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.Integer,converter:ue})],ra.prototype,"modulus",void 0),a([l({type:d.Integer,converter:ue})],ra.prototype,"publicExponent",void 0);var ia;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(ia||(ia={}));const De=ia;/*! *****************************************************************************
76
- Copyright (c) Microsoft Corporation.
77
-
78
- Permission to use, copy, modify, and/or distribute this software for any
79
- purpose with or without fee is hereby granted.
80
-
81
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
82
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
83
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
84
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
85
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
86
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
87
- PERFORMANCE OF THIS SOFTWARE.
88
- ***************************************************************************** */var na=function(r,e){return na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},na(r,e)};function oa(r,e){na(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Td(r,e,t,i){function n(s){return s instanceof t?s:new t(function(c){c(s)})}return new(t||(t=Promise))(function(s,c){function u(m){try{p(i.next(m))}catch(y){c(y)}}function f(m){try{p(i.throw(m))}catch(y){c(y)}}function p(m){m.done?s(m.value):n(m.value).then(u,f)}p((i=i.apply(r,[])).next())})}function Vd(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(m){return f([p,m])}}function f(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=p[0]&2?n.return:p[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,p[1])).done)return s;switch(n=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){t.label=p[1];break}if(p[0]===6&&t.label<s[1]){t.label=s[1],s=p;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(p);break}s[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(m){p=[6,m],n=0}finally{i=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Qn(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function eo(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){c={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return s}function Qt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(eo(arguments[e]));return r}var jd="injectionTokens";function Pd(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(jd,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function $l(r){return!!r.useClass}function sa(r){return!!r.useFactory}var Hl=function(){function r(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return r.prototype.createProxy=function(e){var t=this,i={},n=!1,s,c=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(c))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];s[0]=e();var u=Reflect[n];return u.apply(void 0,Qt(s))}};return this.reflectMethods.forEach(i),t},r}();function Or(r){return typeof r=="string"||typeof r=="symbol"}function Rd(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function Ll(r){return typeof r=="object"&&"token"in r&&"transform"in r}function Dd(r){return typeof r=="function"||r instanceof Hl}function to(r){return!!r.useToken}function ro(r){return r.useValue!=null}function Md(r){return $l(r)||ro(r)||to(r)||sa(r)}var aa=function(){function r(){this._registryMap=new Map}return r.prototype.entries=function(){return this._registryMap.entries()},r.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},r.prototype.get=function(e){this.ensure(e);var t=this._registryMap.get(e);return t[t.length-1]||null},r.prototype.set=function(e,t){this.ensure(e),this._registryMap.get(e).push(t)},r.prototype.setAll=function(e,t){this._registryMap.set(e,t)},r.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},r.prototype.clear=function(){this._registryMap.clear()},r.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},r}(),Ud=function(r){oa(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(aa),io=function(){function r(){this.scopedResolutions=new Map}return r}();function $d(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function Hd(r,e,t){return t===void 0&&(t=" "),Qt([r],e.message.split(`
89
- `).map(function(i){return t+i})).join(`
90
- `)}function Ld(r,e,t){var i=eo(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,c=$d(s,e);return Hd("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function Fd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var qd=function(r){oa(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(aa),Kd=function(r){oa(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(aa),Wd=function(){function r(){this.preResolution=new qd,this.postResolution=new Kd}return r}(),Fl=new Map,Gd=function(){function r(e){this.parent=e,this._registry=new Ud,this.interceptors=new Wd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:De.Transient}),this.ensureNotDisposed();var n;if(Md(t)?n=t:n={useClass:t},to(n))for(var s=[e],c=n;c!=null;){var u=c.useToken;if(s.includes(u))throw new Error("Token registration cycle detected! "+Qt(s,[u]).join(" -> "));s.push(u);var f=this._registry.get(u);f&&to(f.provider)?c=f.provider:c=null}if((i.lifecycle===De.Singleton||i.lifecycle==De.ContainerScoped||i.lifecycle==De.ResolutionScoped)&&(ro(n)||sa(n)))throw new Error('Cannot use lifecycle "'+De[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:n,options:i}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),Or(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})},r.prototype.registerInstance=function(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})},r.prototype.registerSingleton=function(e,t){if(this.ensureNotDisposed(),Or(e)){if(Or(t))return this.register(e,{useToken:t},{lifecycle:De.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:De.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Or(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:De.Singleton})},r.prototype.resolve=function(e,t,i){t===void 0&&(t=new io),i===void 0&&(i=!1),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Or(e)){if(i)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),n){var s=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Dd(e)){var s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},r.prototype.executePreResolutionInterceptor=function(e,t){var i,n;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=Qn(this.interceptors.preResolution.getAll(e)),u=c.next();!u.done;u=c.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(p){i={error:p}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,i){var n,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var u=Qn(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var p=f.value;p.options.frequency!="Once"&&c.push(p),p.callback(e,t,i)}}catch(m){n={error:m}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===De.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===De.Singleton,n=e.options.lifecycle===De.ContainerScoped,s=i||n,c;return ro(e.provider)?c=e.provider.useValue:to(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):$l(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):sa(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===De.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t,i){var n=this;t===void 0&&(t=new io),i===void 0&&(i=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Or(e)){if(i)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var c=s.map(function(f){return n.resolveRegistration(f,t)});return this.executePostResolutionInterceptor(e,c,"All"),c}var u=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,u,"All"),u},r.prototype.isRegistered=function(e,t){return t===void 0&&(t=!1),this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},r.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},r.prototype.clearInstances=function(){var e,t;this.ensureNotDisposed();try{for(var i=Qn(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=eo(n.value,2),c=s[0],u=s[1];this._registry.setAll(c,u.filter(function(f){return!ro(f.provider)}).map(function(f){return f.instance=void 0,f}))}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var i=new r(this);try{for(var n=Qn(this._registry.entries()),s=n.next();!s.done;s=n.next()){var c=eo(s.value,2),u=c[0],f=c[1];f.some(function(p){var m=p.options;return m.lifecycle===De.ContainerScoped})&&i._registry.setAll(u,f.map(function(p){return p.options.lifecycle===De.ContainerScoped?{provider:p.provider,options:p.options}:p}))}}catch(p){e={error:p}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return i},r.prototype.beforeResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:i})},r.prototype.afterResolution=function(e,t,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:i})},r.prototype.dispose=function(){return Td(this,void 0,void 0,function(){var e;return Vd(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(i){var n=i.dispose();n&&e.push(n)}),[4,Promise.all(e)];case 1:return t.sent(),[2]}})})},r.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},r.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},r.prototype.construct=function(e,t){var i=this;if(e instanceof Hl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=Fl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Qt([void 0],c)))}();return Fd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var c,u,f;try{return Rd(n)?Ll(n)?n.multiple?(c=i.resolve(n.transform)).transform.apply(c,Qt([i.resolveAll(n.token,new io,n.isOptional)],n.transformArgs)):(u=i.resolve(n.transform)).transform.apply(u,Qt([i.resolve(n.token,e,n.isOptional)],n.transformArgs)):n.multiple?i.resolveAll(n.token,new io,n.isOptional):i.resolve(n.token,e,n.isOptional):Ll(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Qt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(p){throw new Error(Ld(t,s,p))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Te=new Gd;function no(r){return function(e){Fl.set(e,Pd(e))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var ca;class oo{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:d.ObjectIdentifier})],oo.prototype,"attrId",void 0),a([l({type:d.Any,repeated:"set"})],oo.prototype,"attrValues",void 0);let ql=ca=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ca.prototype)}};ql=ca=a([w({type:v.Sequence,itemType:oo})],ql);var la;let Kl=la=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,la.prototype)}};Kl=la=a([w({type:v.Sequence,itemType:Cr})],Kl);class Wl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Wl.prototype,"certId",void 0),a([l({type:d.Any,context:0})],Wl.prototype,"certValue",void 0);class Gl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Gl.prototype,"crlId",void 0),a([l({type:d.Any,context:0})],Gl.prototype,"crltValue",void 0);class zl extends Q{}let so=class{constructor(e={}){this.encryptionAlgorithm=new E,this.encryptedData=new zl,Object.assign(this,e)}};a([l({type:E})],so.prototype,"encryptionAlgorithm",void 0),a([l({type:zl})],so.prototype,"encryptedData",void 0);var ua,fa;(function(r){r[r.v1=0]="v1"})(fa||(fa={}));class Jl extends Q{}let da=ua=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ua.prototype)}};da=ua=a([w({type:v.Sequence,itemType:wt})],da);class di{constructor(e={}){this.version=fa.v1,this.privateKeyAlgorithm=new E,this.privateKey=new Jl,Object.assign(this,e)}}a([l({type:d.Integer})],di.prototype,"version",void 0),a([l({type:E})],di.prototype,"privateKeyAlgorithm",void 0),a([l({type:Jl})],di.prototype,"privateKey",void 0),a([l({type:da,implicit:!0,context:0,optional:!0})],di.prototype,"attributes",void 0);let Yl=class extends di{};Yl=a([w({type:v.Sequence})],Yl);let Zl=class extends so{};Zl=a([w({type:v.Sequence})],Zl);class Xl{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],Xl.prototype,"secretTypeId",void 0),a([l({type:d.Any,context:0})],Xl.prototype,"secretValue",void 0);class pi{constructor(e={}){this.mac=new Zn,this.macSalt=new Q,this.iterations=1,Object.assign(this,e)}}a([l({type:Zn})],pi.prototype,"mac",void 0),a([l({type:Q})],pi.prototype,"macSalt",void 0),a([l({type:d.Integer,defaultValue:1})],pi.prototype,"iterations",void 0);class ao{constructor(e={}){this.version=3,this.authSafe=new Cr,this.macData=new pi,Object.assign(this,e)}}a([l({type:d.Integer})],ao.prototype,"version",void 0),a([l({type:Cr})],ao.prototype,"authSafe",void 0),a([l({type:pi,optional:!0})],ao.prototype,"macData",void 0);var pa;class co{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:d.ObjectIdentifier})],co.prototype,"bagId",void 0),a([l({type:d.Any,context:0})],co.prototype,"bagValue",void 0),a([l({type:oo,repeated:"set",optional:!0})],co.prototype,"bagAttributes",void 0);let Ql=pa=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,pa.prototype)}};Ql=pa=a([w({type:v.Sequence,itemType:co})],Ql);var ha,ya,ga;const eu="1.2.840.113549.1.9",tu=`${eu}.7`,ma=`${eu}.14`;let lo=class extends Se{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:d.IA5String})],lo.prototype,"ia5String",void 0),lo=a([w({type:v.Choice})],lo);let ru=class extends Cr{};ru=a([w({type:v.Sequence})],ru);let iu=class extends ao{};iu=a([w({type:v.Sequence})],iu);let nu=class extends so{};nu=a([w({type:v.Sequence})],nu);let ba=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.IA5String})],ba.prototype,"value",void 0),ba=a([w({type:v.Choice})],ba);let ou=class extends lo{};ou=a([w({type:v.Choice})],ou);let su=class extends Se{};su=a([w({type:v.Choice})],su);let va=class{constructor(e=new Date){this.value=e}};a([l({type:d.GeneralizedTime})],va.prototype,"value",void 0),va=a([w({type:v.Choice})],va);let au=class extends Se{};au=a([w({type:v.Choice})],au);let wa=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:d.PrintableString})],wa.prototype,"value",void 0),wa=a([w({type:v.Choice})],wa);let uo=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.PrintableString})],uo.prototype,"value",void 0),uo=a([w({type:v.Choice})],uo);let cu=class extends uo{};cu=a([w({type:v.Choice})],cu);let lu=class extends Se{};lu=a([w({type:v.Choice})],lu);let Sa=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.ObjectIdentifier})],Sa.prototype,"value",void 0),Sa=a([w({type:v.Choice})],Sa);let uu=class extends Ae{};uu=a([w({type:v.Choice})],uu);let Aa=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:d.Integer})],Aa.prototype,"value",void 0),Aa=a([w({type:v.Choice})],Aa);let fu=class extends ct{};fu=a([w({type:v.Sequence})],fu);let fo=class extends Se{};fo=a([w({type:v.Choice})],fo);let du=ha=class extends Wt{constructor(e){super(e),Object.setPrototypeOf(this,ha.prototype)}};du=ha=a([w({type:v.Sequence})],du);let pu=ya=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ya.prototype)}};pu=ya=a([w({type:v.Set,itemType:wr})],pu);let ka=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:d.BmpString})],ka.prototype,"value",void 0),ka=a([w({type:v.Choice})],ka);let Ca=class extends E{};Ca=a([w({type:v.Sequence})],Ca);let hu=ga=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,ga.prototype)}};hu=ga=a([w({type:v.Sequence,itemType:Ca})],hu);var xa;let po=xa=class extends re{constructor(e){super(e),Object.setPrototypeOf(this,xa.prototype)}};po=xa=a([w({type:v.Sequence,itemType:wt})],po);class _r{constructor(e={}){this.version=0,this.subject=new ge,this.subjectPKInfo=new st,this.attributes=new po,Object.assign(this,e)}}a([l({type:d.Integer})],_r.prototype,"version",void 0),a([l({type:ge})],_r.prototype,"subject",void 0),a([l({type:st})],_r.prototype,"subjectPKInfo",void 0),a([l({type:po,implicit:!0,context:0,optional:!0})],_r.prototype,"attributes",void 0);class hi{constructor(e={}){this.certificationRequestInfo=new _r,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:_r,raw:!0})],hi.prototype,"certificationRequestInfo",void 0),a([l({type:E})],hi.prototype,"signatureAlgorithm",void 0),a([l({type:d.BitString})],hi.prototype,"signature",void 0);/*!
91
- * MIT License
92
- *
93
- * Copyright (c) Peculiar Ventures. All rights reserved.
94
- *
95
- * Permission is hereby granted, free of charge, to any person obtaining a copy
96
- * of this software and associated documentation files (the "Software"), to deal
97
- * in the Software without restriction, including without limitation the rights
98
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
- * copies of the Software, and to permit persons to whom the Software is
100
- * furnished to do so, subject to the following conditions:
101
- *
102
- * The above copyright notice and this permission notice shall be included in all
103
- * copies or substantial portions of the Software.
104
- *
105
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
106
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
107
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
108
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
109
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
110
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111
- * SOFTWARE.
112
- *
113
- */const yi="crypto.algorithm";class zd{getAlgorithms(){return Te.resolveAll(yi)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const i=t.toAsnAlgorithm(e);if(i)return i}if(/^[0-9.]+$/.test(e.name)){const t=new E({algorithm:e.name});if("parameters"in e){const i=e;t.parameters=i.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const i of this.getAlgorithms()){const n=i.toWebAlgorithm(e);if(n)return n}return{name:e.algorithm,parameters:e.parameters}}}const Tr="crypto.algorithmProvider";Te.registerSingleton(Tr,zd);var ho;const Me="1.3.36.3.3.2.8.1.1",yu=`${Me}.1`,gu=`${Me}.2`,mu=`${Me}.3`,bu=`${Me}.4`,vu=`${Me}.5`,wu=`${Me}.6`,Su=`${Me}.7`,Au=`${Me}.8`,ku=`${Me}.9`,Cu=`${Me}.10`,xu=`${Me}.11`,Bu=`${Me}.12`,Eu=`${Me}.13`,Nu=`${Me}.14`,Iu="brainpoolP160r1",Ou="brainpoolP160t1",_u="brainpoolP192r1",Tu="brainpoolP192t1",Vu="brainpoolP224r1",ju="brainpoolP224t1",Pu="brainpoolP256r1",Ru="brainpoolP256t1",Du="brainpoolP320r1",Mu="brainpoolP320t1",Uu="brainpoolP384r1",$u="brainpoolP384t1",Hu="brainpoolP512r1",Lu="brainpoolP512t1",pe="ECDSA";let gi=ho=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case pe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return bd;case"sha-256":return vd;case"sha-384":return wd;case"sha-512":return Sd}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=Tl;break;case"K-256":t=ho.SECP256K1;break;case"P-384":t=Vl;break;case"P-521":t=jl;break;case Iu:t=yu;break;case Ou:t=gu;break;case _u:t=mu;break;case Tu:t=bu;break;case Vu:t=vu;break;case ju:t=wu;break;case Pu:t=Su;break;case Ru:t=Au;break;case Du:t=ku;break;case Mu:t=Cu;break;case Uu:t=xu;break;case $u:t=Bu;break;case Hu:t=Eu;break;case Lu:t=Nu;break}if(t)return new E({algorithm:ci,parameters:x.serialize(new _t({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case zs:return{name:pe,hash:{name:"SHA-1"}};case Js:return{name:pe,hash:{name:"SHA-256"}};case Ys:return{name:pe,hash:{name:"SHA-384"}};case Zs:return{name:pe,hash:{name:"SHA-512"}};case ci:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(x.parse(e.parameters,_t).namedCurve){case Tl:return{name:pe,namedCurve:"P-256"};case ho.SECP256K1:return{name:pe,namedCurve:"K-256"};case Vl:return{name:pe,namedCurve:"P-384"};case jl:return{name:pe,namedCurve:"P-521"};case yu:return{name:pe,namedCurve:Iu};case gu:return{name:pe,namedCurve:Ou};case mu:return{name:pe,namedCurve:_u};case bu:return{name:pe,namedCurve:Tu};case vu:return{name:pe,namedCurve:Vu};case wu:return{name:pe,namedCurve:ju};case Su:return{name:pe,namedCurve:Pu};case Au:return{name:pe,namedCurve:Ru};case ku:return{name:pe,namedCurve:Du};case Cu:return{name:pe,namedCurve:Mu};case xu:return{name:pe,namedCurve:Uu};case Bu:return{name:pe,namedCurve:$u};case Eu:return{name:pe,namedCurve:Hu};case Nu:return{name:pe,namedCurve:Lu}}}}return null}};gi.SECP256K1="1.3.132.0.10",gi=ho=a([no()],gi),Te.registerSingleton(yi,gi);const Fu=Symbol("name"),qu=Symbol("value");class te{constructor(e,t={},i=""){this[Fu]=e,this[qu]=i;for(const n in t)this[n]=t[n]}}te.NAME=Fu,te.VALUE=qu;class Jd{static toTextObject(e){const t=new te("Algorithm Identifier",{},Tt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case ci:{const i=new gi().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Tt{static toString(e){const t=this.items[e];return t||e}}Tt.items={[Kn]:"sha1",[Dl]:"sha224",[Wn]:"sha256",[Gn]:"sha384",[zn]:"sha512",[Yt]:"rsaEncryption",[Ln]:"sha1WithRSAEncryption",[Ed]:"sha224WithRSAEncryption",[Qs]:"sha256WithRSAEncryption",[Fn]:"sha384WithRSAEncryption",[qn]:"sha512WithRSAEncryption",[ci]:"ecPublicKey",[zs]:"ecdsaWithSHA1",[_l]:"ecdsaWithSHA224",[Js]:"ecdsaWithSHA256",[Ys]:"ecdsaWithSHA384",[Zs]:"ecdsaWithSHA512",[fd]:"TLS WWW server authentication",[dd]:"TLS WWW client authentication",[pd]:"Code Signing",[hd]:"E-mail Protection",[yd]:"Time Stamping",[gd]:"OCSP Signing",[md]:"Signed Data"};class er{static serialize(e){return this.serializeObj(e).join(`
114
- `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const i=[];let n=this.pad(t++),s="";const c=e[te.VALUE];c&&(s=` ${c}`),i.push(`${n}${e[te.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],p=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${p}${f}`);else if(f instanceof Date)i.push(`${n}${p}${f.toUTCString()}`);else if(Array.isArray(f))for(const m of f)m[te.NAME]=u,i.push(...this.serializeObj(m,t));else if(f instanceof te)f[te.NAME]=u,i.push(...this.serializeObj(f,t));else if(C.isBufferSource(f))u?(i.push(`${n}${p}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const m=f.toTextObject();m[te.NAME]=u,i.push(...this.serializeObj(m,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(e,t=0){const i=this.pad(t),n=C.toUint8Array(e),s=[];for(let c=0;c<n.length;){const u=[];for(let f=0;f<16&&c<n.length;f++){f===8&&u.push("");const p=n[c++].toString(16).padStart(2,"0");u.push(p)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}er.oidSerializer=Tt,er.algorithmSerializer=Jd;var Vr;class Vt{get rawData(){return W(this,Vr,"f")||de(this,Vr,x.serialize(this.asn),"f"),W(this,Vr,"f")}constructor(...e){Vr.set(this,void 0),C.isBufferSource(e[0])?(this.asn=x.parse(e[0],e[1]),de(this,Vr,C.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof Vt?Xa(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return x.toString(this.rawData);case"text":return er.serialize(this.toTextObject());case"hex":return _.ToHex(this.rawData);case"base64":return _.ToBase64(this.rawData);case"base64url":return _.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new te(this.getTextName(),{},e)}}Vr=new WeakMap,Vt.NAME="ASN";class Fe extends Vt{constructor(...e){let t;C.isBufferSource(e[0])?t=C.toArrayBuffer(e[0]):t=x.serialize(new Qe({extnID:e[0],critical:e[1],extnValue:new Q(C.toArrayBuffer(e[2]))})),super(t,Qe)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[te.NAME]===Fe.NAME&&(e[te.NAME]=Tt.toString(this.type)),e}}var Ku;class jt{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[Ku]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(jt.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(jt.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,t){return this.items.forEach(e,t)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=jt.DEFAULT){const t=this.items.get(e.toLowerCase());if(!t)throw new Error(`Cannot get Crypto by name '${e}'`);return t}set(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(jt.DEFAULT,e);return this}}Ku=Symbol.toStringTag,jt.DEFAULT="default";const Ve=new jt,Yd=/^[0-2](?:\.[1-9][0-9]*)+$/;function Zd(r){return new RegExp(Yd).test(r)}class Wu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Zd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Ue=new Wu;Ue.register("CN","2.5.4.3"),Ue.register("L","2.5.4.7"),Ue.register("ST","2.5.4.8"),Ue.register("O","2.5.4.10"),Ue.register("OU","2.5.4.11"),Ue.register("C","2.5.4.6"),Ue.register("DC","0.9.2342.19200300.100.1.25"),Ue.register("E","1.2.840.113549.1.9.1"),Ue.register("G","2.5.4.42"),Ue.register("I","2.5.4.43"),Ue.register("SN","2.5.4.4"),Ue.register("T","2.5.4.12");function Xd(r,e){return`\\${_.ToHex(_.FromUtf8String(e)).toUpperCase()}`}function Qd(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Xd)}class tr{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,t={}){this.extraNames=new Wu,this.asn=new ge;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];this.extraNames.register(i,n)}typeof e=="string"?this.asn=this.fromString(e):e instanceof ge?this.asn=e:C.isBufferSource(e)?this.asn=x.parse(e,ge):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Ue.findId(e),i=[];for(const n of this.asn)for(const s of n)s.type===t&&i.push(s.value.toString());return i}getName(e){return this.extraNames.get(e)||Ue.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${_.ToHex(t.value.anyValue)}`:Qd(t.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const i of this.asn){const n={};for(const s of i){const c=this.getName(s.type)||s.type;(e=n[c])!==null&&e!==void 0||(n[c]=[]),n[c].push(s.value.anyValue?`#${_.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new ge,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,c,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const p=n[3];c=this.getTypeOid(c);const m=this.createAttribute(c,u);s==="+"?t[t.length-1].push(m):t.push(new fr([m])),s=p}return t}fromJSON(e){const t=new ge;for(const i of e){const n=new fr;for(const s in i){const c=this.getTypeOid(s),u=i[s];for(const f of u){const p=this.createAttribute(c,f);n.push(p)}}t.push(n)}return t}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,t){const i=new an({type:e});if(typeof t=="object")for(const n in t)switch(n){case"ia5String":i.value.ia5String=t[n];break;case"utf8String":i.value.utf8String=t[n];break;case"universalString":i.value.universalString=t[n];break;case"bmpString":i.value.bmpString=t[n];break;case"printableString":i.value.printableString=t[n];break}else if(t[0]==="#")i.value.anyValue=_.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:tr.isPrintableString(n)?i.value.printableString=n:i.value.utf8String=n}return i}processStringValue(e){const t=/"(.*?[^\\])?"/.exec(e);return t&&(e=t[1]),e.replace(/\\0a/ig,`
115
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return x.serialize(this.asn)}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Ve.get()):i=e[0]||Ve.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const Gu="Cannot initialize GeneralName from ASN.1 data.",zu=`${Gu} Unsupported string format in use.`,ep=`${Gu} Value doesn't match to GUID regular expression.`,Ju=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Yu="1.3.6.1.4.1.311.25.1",Zu="1.3.6.1.4.1.311.20.2.3",Ba="dns",Ea="dn",Na="email",Ia="ip",Oa="url",_a="guid",Ta="upn",yo="id";class Pt extends Vt{constructor(...e){let t;if(e.length===2)switch(e[0]){case Ea:{const i=new tr(e[1]).toArrayBuffer(),n=x.parse(i,ge);t=new q({directoryName:n});break}case Ba:t=new q({dNSName:e[1]});break;case Na:t=new q({rfc822Name:e[1]});break;case _a:{const i=new RegExp(Ju,"i").exec(e[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,c)=>c<3?_.ToHex(new Uint8Array(_.FromHex(s)).reverse()):s).join("");t=new q({otherName:new zr({typeId:Yu,value:x.serialize(new Q(_.FromHex(n)))})});break}case Ia:t=new q({iPAddress:e[1]});break;case yo:t=new q({registeredID:e[1]});break;case Ta:{t=new q({otherName:new zr({typeId:Zu,value:x.serialize(Xc.toASN(e[1]))})});break}case Oa:t=new q({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else C.isBufferSource(e[0])?t=x.parse(e[0],q):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=Ba,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Na,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=Ia,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=Oa,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=yo,this.value=e.registeredID;else if(e.directoryName!=null)this.type=Ea,this.value=new tr(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Yu){this.type=_a;const t=x.parse(e.otherName.value,Q),i=new RegExp(Ju,"i").exec(_.ToHex(t));if(!i)throw new Error(ep);this.value=i.slice(1).map((n,s)=>s<3?_.ToHex(new Uint8Array(_.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Zu)this.type=Ta,this.value=x.parse(e.otherName.value,Se).toString();else throw new Error(zu);else throw new Error(zu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case Ea:case Ba:case _a:case Ia:case yo:case Ta:case Oa:e=this.type.toUpperCase();break;case Na:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===yo&&(t=Tt.toString(t)),new te(e,void 0,t)}}class rr extends Vt{constructor(e){let t;if(e instanceof Ee)t=e;else if(Array.isArray(e)){const i=[];for(const n of e)if(n instanceof q)i.push(n);else{const s=x.parse(new Pt(n.type,n.value).rawData,q);i.push(s)}t=new Ee(i)}else if(C.isBufferSource(e))t=x.parse(e,Ee);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const i of e){let n=null;try{n=new Pt(i)}catch{continue}t.push(n)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const i=t.toTextObject();let n=e[i[te.NAME]];Array.isArray(n)||(n=[],e[i[te.NAME]]=n),n.push(i)}return e}}rr.NAME="GeneralNames";const mi="-{5}",bi="\\n",tp=`[^${bi}]+`,rp=`${mi}BEGIN (${tp}(?=${mi}))${mi}`,ip=`${mi}END \\1${mi}`,jr="\\n",np=`[^:${bi}]+`,op=`(?:[^${bi}]+${jr}(?: +[^${bi}]+${jr})*)`,sp=`(?:[a-zA-Z0-9=+/]+${jr})+`,Xu=`${rp}${jr}(?:((?:${np}: ${op})+))?${jr}?(${sp})${ip}`;class qe{static isPem(e){return typeof e=="string"&&new RegExp(Xu,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Xu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${bi}]+`,"g"),""),c={type:n[1],headers:[],rawData:_.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(jr,"g"));let p=null;for(const m of f){const[y,L]=m.split(/:(.*)/);if(L===void 0){if(!p)throw new Error("Cannot parse PEM string. Incorrect header value");p.value+=y.trim()}else p&&c.headers.push(p),p={key:y,value:L.trim()}}p&&c.headers.push(p)}i.push(c)}return i}static decode(e){return this.decodeWithHeaders(e).map(i=>i.rawData)}static decodeFirst(e){const t=this.decode(e);if(!t.length)throw new RangeError("PEM string doesn't contain any objects");return t[0]}static encode(e,t){if(Array.isArray(e)){const i=new Array;return t?e.forEach(n=>{if(!C.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:t,rawData:C.toArrayBuffer(n)}))}):e.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
116
- `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:C.toArrayBuffer(e)})}}static encodeStruct(e){var t;const i=e.type.toLocaleUpperCase(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const p of e.headers)n.push(`${p.key}: ${p.value}`);n.push("")}const s=_.ToBase64(e.rawData);let c,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?c=s.substring(u):(c=s.substring(u,u+64),u+=64),c.length!==0);)if(f.push(c),c.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
117
- `)}}qe.CertificateTag="CERTIFICATE",qe.CrlTag="CRL",qe.CertificateRequestTag="CERTIFICATE REQUEST",qe.PublicKeyTag="PUBLIC KEY",qe.PrivateKeyTag="PRIVATE KEY";class Ct extends Vt{static isAsnEncoded(e){return C.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(qe.isPem(e))return qe.decode(e)[0];if(_.isHex(e))return _.FromHex(e);if(_.isBase64(e))return _.FromBase64(e);if(_.isBase64Url(e))return _.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=C.toUint8Array(e);if(t.length>0&&t[0]===48)return C.toArrayBuffer(e);const i=_.ToBinary(e);if(qe.isPem(i))return qe.decode(i)[0];if(_.isHex(i))return _.FromHex(i);if(_.isBase64(i))return _.FromBase64(i);if(_.isBase64Url(i))return _.FromBase64Url(i);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){Ct.isAsnEncoded(e[0])?super(Ct.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return qe.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ut extends Ct{static async create(e,t=Ve.get()){if(e instanceof ut)return e;if(jt.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ut(i)}else{if(e.publicKey)return e.publicKey;if(C.isBufferSource(e))return new ut(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Ct.isAsnEncoded(e)?super(e,st):super(e),this.tag=qe.PublicKeyTag}async export(...e){let t,i=["verify"],n={hash:"SHA-256",...this.algorithm};e.length>1?(n=e[0]||n,i=e[1]||i,t=e[2]||Ve.get()):t=e[0]||Ve.get();let s=this.rawData;const c=x.parse(this.rawData,st);return c.algorithm.algorithm===fi&&(s=ap(c,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Te.resolve(Tr),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Yt:{const n=x.parse(e.subjectPublicKey,ra),s=C.toUint8Array(n.modulus);i.publicExponent=C.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let i,n="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(n=e[0]||n,i=e[1]||Ve.get()):i=e[0]||Ve.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(...e){let t,i="SHA-1";e.length===1?typeof e[0]=="string"?(i=e[0],t=Ve.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Ve.get();const n=x.parse(this.rawData,st);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,st);switch(e.Algorithm=er.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case ci:e["EC Point"]=t.subjectPublicKey;break;case Yt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function ap(r,e){return r.algorithm=new E({algorithm:Yt,parameters:null}),e=x.serialize(r),e}class vi extends Fe{static async create(e,t=!1,i=Ve.get()){if("name"in e&&"serialNumber"in e)return new vi(e,t);const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new vi(_.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new qt({keyIdentifier:new Xo(_.FromHex(e[0]))});super(Zo,e[1],x.serialize(t))}else{const t=e[0],i=t.name instanceof rr?x.parse(t.name.rawData,Ee):t.name,n=new qt({authorityCertIssuer:i,authorityCertSerialNumber:_.FromHex(t.serialNumber)});super(Zo,e[1],x.serialize(n))}}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,qt);t.keyIdentifier&&(this.keyId=_.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?_.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,qt);return t.authorityCertIssuer&&(e["Authority Issuer"]=new rr(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}vi.NAME="Authority Key Identifier";class Qu extends Fe{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,ln);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new ln({cA:e[0],pathLenConstraint:e[1]});super(ol,e[2],x.serialize(t)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}Qu.NAME="Basic Constraints";var ef;(function(r){r.serverAuth="1.3.6.1.5.5.7.3.1",r.clientAuth="1.3.6.1.5.5.7.3.2",r.codeSigning="1.3.6.1.5.5.7.3.3",r.emailProtection="1.3.6.1.5.5.7.3.4",r.timeStamping="1.3.6.1.5.5.7.3.8",r.ocspSigning="1.3.6.1.5.5.7.3.9"})(ef||(ef={}));class tf extends Fe{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,hn);this.usages=t.map(i=>i)}else{const t=new hn(e[0]);super(fl,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Tt.toString(t)).join(", "),e}}tf.NAME="Extended Key Usages";var Va;(function(r){r[r.digitalSignature=1]="digitalSignature",r[r.nonRepudiation=2]="nonRepudiation",r[r.keyEncipherment=4]="keyEncipherment",r[r.dataEncipherment=8]="dataEncipherment",r[r.keyAgreement=16]="keyAgreement",r[r.keyCertSign=32]="keyCertSign",r[r.cRLSign=64]="cRLSign",r[r.encipherOnly=128]="encipherOnly",r[r.decipherOnly=256]="decipherOnly"})(Va||(Va={}));class ja extends Fe{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,ps);this.usages=t.toNumber()}else{const t=new ps(e[0]);super(hl,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,ps);return e[""]=t.toJSON().join(", "),e}}ja.NAME="Key Usages";class go extends Fe{static async create(e,t=!1,i=Ve.get()){const s=await(await ut.create(e,i)).getKeyIdentifier(i);return new go(_.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,It);this.keyId=_.ToHex(t)}else{const t=typeof e[0]=="string"?_.FromHex(e[0]):e[0],i=new It(t);super(wl,e[1],x.serialize(i)),this.keyId=_.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,It);return e[""]=t,e}}go.NAME="Subject Key Identifier";class Pa extends Fe{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(bl,e[1],new rr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,bs);this.names=new rr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}Pa.NAME="Subject Alternative Name";class Ke{static register(e,t){this.items.set(e,t)}static create(e){const t=new Fe(e),i=this.items.get(t.type);return i?new i(e):t}}Ke.items=new Map;class rf extends Fe{constructor(...e){var t;if(C.isBufferSource(e[0])){super(e[0]);const i=x.parse(this.value,dn);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new dn(i.map(c=>new fn({policyIdentifier:c})));super(al,n,x.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new te("",{},Tt.toString(t))),e}}rf.NAME="Certificate Policies",Ke.register(al,rf);class nf extends Fe{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const n=e[0].map(c=>new hr({distributionPoint:new Kt({fullName:[new q({uniformResourceIdentifier:c})]})})),s=new yr(n);super(ss,e[1],x.serialize(s))}else{const i=new yr(e[0]);super(ss,e[1],x.serialize(i))}(t=this.distributionPoints)!==null&&t!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,yr);this.distributionPoints=t}toTextObject(){const e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(t=>{var i;const n={};return t.distributionPoint&&(n[""]=(i=t.distributionPoint.fullName)===null||i===void 0?void 0:i.map(s=>new Pt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}nf.NAME="CRL Distribution Points";class of extends Fe{constructor(...e){var t,i,n,s;if(C.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof pr){const c=new pr(e[0]);super(Yo,e[1],x.serialize(c))}else{const c=e[0],u=new pr;bo(u,c,tl,"ocsp"),bo(u,c,rl,"caIssuers"),bo(u,c,il,"timeStamping"),bo(u,c,nl,"caRepository"),super(Yo,e[1],x.serialize(u))}(t=this.ocsp)!==null&&t!==void 0||(this.ocsp=[]),(i=this.caIssuers)!==null&&i!==void 0||(this.caIssuers=[]),(n=this.timeStamping)!==null&&n!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],x.parse(e.extnValue,pr).forEach(i=>{switch(i.accessMethod){case tl:this.ocsp.push(new Pt(i.accessLocation));break;case rl:this.caIssuers.push(new Pt(i.accessLocation));break;case il:this.timeStamping.push(new Pt(i.accessLocation));break;case nl:this.caRepository.push(new Pt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&mo(e,"OCSP",this.ocsp),this.caIssuers.length&&mo(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&mo(e,"Time Stamping",this.timeStamping),this.caRepository.length&&mo(e,"CA Repository",this.caRepository),e}}of.NAME="Authority Info Access";function mo(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new te("");t.forEach((n,s)=>{const c=n.toTextObject(),u=`${c[te.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(c)}),r[e]=i}}function bo(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(c=>{typeof c=="string"&&(c=new Pt("url",c)),r.push(new Jr({accessMethod:t,accessLocation:x.parse(c.rawData,q)}))})}class sf extends Fe{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(dl,e[1],new rr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,Ee);this.names=new rr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}sf.NAME="Issuer Alternative Name";class Pr extends Vt{constructor(...e){let t;if(C.isBufferSource(e[0]))t=C.toArrayBuffer(e[0]);else{const i=e[0],n=Array.isArray(e[1])?e[1].map(s=>C.toArrayBuffer(s)):[];t=x.serialize(new wt({type:i,values:n}))}super(t,wt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new te("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[te.NAME]===Pr.NAME&&(e[te.NAME]=Tt.toString(this.type)),e}}Pr.NAME="Attribute";class af extends Pr{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=new fo({printableString:e[0]});super(tu,[x.serialize(i)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=x.parse(this.values[0],fo);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[te.VALUE]=this.password,e}}af.NAME="Challenge Password";class Ra extends Pr{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Wt;for(const s of i)n.push(x.parse(s.rawData,Qe));super(ma,[x.serialize(n)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=x.parse(this.values[0],Wt);this.items=t.map(i=>Ke.create(x.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[te.NAME]]=i;return e}}Ra.NAME="Extensions";class vo{static register(e,t){this.items.set(e,t)}static create(e){const t=new Pr(e),i=this.items.get(t.type);return i?new i(e):t}}vo.items=new Map;const wo="crypto.signatureFormatter";class cp{toAsnSignature(e,t){return C.toArrayBuffer(t)}toWebSignature(e,t){return C.toArrayBuffer(t)}}var So;let Da=So=class{static createPssParams(e,t){const i=So.getHashAlgorithm(e);return i?new Xt({hashAlgorithm:i,maskGenAlgorithm:new E({algorithm:Jn,parameters:x.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Te.resolve(Tr);return typeof e=="string"?t.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?t.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let t;if(typeof e.hash=="string")t=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")t=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(t.toLowerCase()){case"sha-1":return new E({algorithm:Ln,parameters:null});case"sha-256":return new E({algorithm:Qs,parameters:null});case"sha-384":return new E({algorithm:Fn,parameters:null});case"sha-512":return new E({algorithm:qn,parameters:null})}}else return new E({algorithm:Yt,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");const t=So.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new E({algorithm:fi,parameters:x.serialize(t)})}else return new E({algorithm:fi,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Yt:return{name:"RSASSA-PKCS1-v1_5"};case Ln:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Qs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Fn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case qn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case fi:if(e.parameters){const t=x.parse(e.parameters,Xt);return{name:"RSA-PSS",hash:Te.resolve(Tr).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};Da=So=a([no()],Da),Te.registerSingleton(yi,Da);let Ma=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new E({algorithm:Kn});case"sha-256":return new E({algorithm:Wn});case"sha-384":return new E({algorithm:Gn});case"sha-512":return new E({algorithm:zn})}return null}toWebAlgorithm(e){switch(e.algorithm){case Kn:return{name:"SHA-1"};case Wn:return{name:"SHA-256"};case Gn:return{name:"SHA-384"};case zn:return{name:"SHA-512"}}return null}};Ma=a([no()],Ma),Te.registerSingleton(yi,Ma);class ze{addPadding(e,t){const i=C.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n.buffer}removePadding(e,t=!1){let i=C.toUint8Array(e);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(t&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const i=e.namedCurve,n=ze.namedCurveSize.get(i)||ze.defaultNamedCurveSize,s=new Hn,c=C.toUint8Array(t);return s.r=this.removePadding(c.slice(0,n),!0),s.s=this.removePadding(c.slice(n,n+n),!0),x.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=x.parse(t,Hn),n=e.namedCurve,s=ze.namedCurveSize.get(n)||ze.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Af(c,u)}return null}}ze.namedCurveSize=new Map,ze.defaultNamedCurveSize=32;const Ua="1.3.101.110",cf="1.3.101.111",$a="1.3.101.112",lf="1.3.101.113";let Ha=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=$a;break;case"x25519":t=Ua;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=$a;break;case"ed448":t=lf;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=Ua;break;case"x448":t=cf;break}}return t?new E({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case $a:return{name:"Ed25519"};case lf:return{name:"EdDSA",namedCurve:"Ed448"};case Ua:return{name:"X25519"};case cf:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ha=a([no()],Ha),Te.registerSingleton(yi,Ha);var wi,Si,Ai,ki,Ci,xi,Bi,Rr;class lp extends Ct{get subjectName(){return W(this,Si,"f")||de(this,Si,new tr(this.asn.certificationRequestInfo.subject),"f"),W(this,Si,"f")}get subject(){return W(this,Ai,"f")||de(this,Ai,this.subjectName.toString(),"f"),W(this,Ai,"f")}get signatureAlgorithm(){if(!W(this,ki,"f")){const e=Te.resolve(Tr);de(this,ki,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return W(this,ki,"f")}get signature(){return W(this,Ci,"f")||de(this,Ci,this.asn.signature,"f"),W(this,Ci,"f")}get publicKey(){return W(this,xi,"f")||de(this,xi,new ut(this.asn.certificationRequestInfo.subjectPKInfo),"f"),W(this,xi,"f")}get attributes(){return W(this,Bi,"f")||de(this,Bi,this.asn.certificationRequestInfo.attributes.map(e=>vo.create(x.serialize(e))),"f"),W(this,Bi,"f")}get extensions(){if(!W(this,Rr,"f")){de(this,Rr,[],"f");const e=this.getAttribute(ma);e instanceof Ra&&de(this,Rr,e.items,"f")}return W(this,Rr,"f")}get tbs(){return W(this,wi,"f")||de(this,wi,this.asn.certificationRequestInfoRaw||x.serialize(this.asn.certificationRequestInfo),"f"),W(this,wi,"f")}constructor(e){const t=Ct.isAsnEncoded(e)?[e,hi]:[e];super(t[0],t[1]),wi.set(this,void 0),Si.set(this,void 0),Ai.set(this,void 0),ki.set(this,void 0),Ci.set(this,void 0),xi.set(this,void 0),Bi.set(this,void 0),Rr.set(this,void 0),this.tag=qe.CertificateRequestTag}onInit(e){}getAttribute(e){for(const t of this.attributes)if(t.type===e)return t;return null}getAttributes(e){return this.attributes.filter(t=>t.type===e)}getExtension(e){for(const t of this.extensions)if(t.type===e)return t;return null}getExtensions(e){return this.extensions.filter(t=>t.type===e)}async verify(e=Ve.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Te.resolveAll(wo).reverse();let s=null;for(const u of n)if(s=u.toWebSignature(t,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,hi),i=t.certificationRequestInfo,n=new te("",{Version:`${gr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new te("");for(const c of this.attributes){const u=c.toTextObject();s[u[te.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new te("",{Algorithm:er.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}wi=new WeakMap,Si=new WeakMap,Ai=new WeakMap,ki=new WeakMap,Ci=new WeakMap,xi=new WeakMap,Bi=new WeakMap,Rr=new WeakMap,lp.NAME="PKCS#10 Certificate Request";var Ei,Ni,Ii,Oi,_i,Ti,Vi,ji,Pi,Ri,Dr,Di;class uf extends Ct{get publicKey(){return W(this,Di,"f")||de(this,Di,new ut(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),W(this,Di,"f")}get serialNumber(){if(!W(this,Ni,"f")){const e=this.asn.tbsCertificate;let t=new Uint8Array(e.serialNumber);t.length>1&&t[0]===0&&t[1]>127&&(t=t.slice(1)),de(this,Ni,_.ToHex(t),"f")}return W(this,Ni,"f")}get subjectName(){return W(this,Ii,"f")||de(this,Ii,new tr(this.asn.tbsCertificate.subject),"f"),W(this,Ii,"f")}get subject(){return W(this,Oi,"f")||de(this,Oi,this.subjectName.toString(),"f"),W(this,Oi,"f")}get issuerName(){return W(this,_i,"f")||de(this,_i,new tr(this.asn.tbsCertificate.issuer),"f"),W(this,_i,"f")}get issuer(){return W(this,Ti,"f")||de(this,Ti,this.issuerName.toString(),"f"),W(this,Ti,"f")}get notBefore(){if(!W(this,Vi,"f")){const e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");de(this,Vi,e,"f")}return W(this,Vi,"f")}get notAfter(){if(!W(this,ji,"f")){const e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");de(this,ji,e,"f")}return W(this,ji,"f")}get signatureAlgorithm(){if(!W(this,Pi,"f")){const e=Te.resolve(Tr);de(this,Pi,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return W(this,Pi,"f")}get signature(){return W(this,Ri,"f")||de(this,Ri,this.asn.signatureValue,"f"),W(this,Ri,"f")}get extensions(){return W(this,Dr,"f")||(de(this,Dr,[],"f"),this.asn.tbsCertificate.extensions&&de(this,Dr,this.asn.tbsCertificate.extensions.map(e=>Ke.create(x.serialize(e))),"f")),W(this,Dr,"f")}get tbs(){return W(this,Ei,"f")||de(this,Ei,this.asn.tbsCertificateRaw||x.serialize(this.asn.tbsCertificate),"f"),W(this,Ei,"f")}constructor(e){const t=Ct.isAsnEncoded(e)?[e,mr]:[e];super(t[0],t[1]),Ei.set(this,void 0),Ni.set(this,void 0),Ii.set(this,void 0),Oi.set(this,void 0),_i.set(this,void 0),Ti.set(this,void 0),Vi.set(this,void 0),ji.set(this,void 0),Pi.set(this,void 0),Ri.set(this,void 0),Dr.set(this,void 0),Di.set(this,void 0),this.tag=qe.CertificateTag}onInit(e){}getExtension(e){for(const t of this.extensions)if(typeof e=="string"){if(t.type===e)return t}else if(t instanceof e)return t;return null}getExtensions(e){return this.extensions.filter(t=>typeof e=="string"?t.type===e:t instanceof e)}async verify(e={},t=Ve.get()){let i,n;const s=e.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],t);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],t);else if(s instanceof ut)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(C.isBufferSource(s)){const p=new ut(s);i={...p.algorithm,...this.signatureAlgorithm},n=await p.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const c=Te.resolveAll(wo).reverse();let u=null;for(const p of c)if(u=p.toWebSignature(i,this.signature),u)break;if(!u)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const f=await t.subtle.verify(this.signatureAlgorithm,n,u,this.tbs);if(e.signatureOnly)return f;{const m=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<m&&m<this.notAfter.getTime()}}async getThumbprint(...e){let t,i="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(i=e[0]||i,t=e[1])),t??(t=Ve.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Ve.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,mr),i=t.tbsCertificate,n=new te("",{Version:`${gr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":er.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new te("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new te("");for(const c of this.extensions){const u=c.toTextObject();s[u[te.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new te("",{Algorithm:er.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}Ei=new WeakMap,Ni=new WeakMap,Ii=new WeakMap,Oi=new WeakMap,_i=new WeakMap,Ti=new WeakMap,Vi=new WeakMap,ji=new WeakMap,Pi=new WeakMap,Ri=new WeakMap,Dr=new WeakMap,Di=new WeakMap,uf.NAME="Certificate";var ff;(function(r){r[r.unspecified=0]="unspecified",r[r.keyCompromise=1]="keyCompromise",r[r.cACompromise=2]="cACompromise",r[r.affiliationChanged=3]="affiliationChanged",r[r.superseded=4]="superseded",r[r.cessationOfOperation=5]="cessationOfOperation",r[r.certificateHold=6]="certificateHold",r[r.removeFromCRL=8]="removeFromCRL",r[r.privilegeWithdrawn=9]="privilegeWithdrawn",r[r.aACompromise=10]="aACompromise"})(ff||(ff={})),Ke.register(ol,Qu),Ke.register(fl,tf),Ke.register(hl,ja),Ke.register(wl,go),Ke.register(Zo,vi),Ke.register(bl,Pa),Ke.register(ss,nf),Ke.register(Yo,of),Ke.register(dl,sf),vo.register(tu,af),vo.register(ma,Ra),Te.registerSingleton(wo,cp),Te.registerSingleton(wo,ze),ze.namedCurveSize.set("P-256",32),ze.namedCurveSize.set("K-256",32),ze.namedCurveSize.set("P-384",48),ze.namedCurveSize.set("P-521",66);function df(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new uf(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof Pa){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,p)=>{const m=p.type,y=f[m]??[];return{...f,[m]:[...y,p.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof ja){const s=Object.values(Va),c=Array(s.length/2).fill(null).reduce((u,f,p)=>{const m=s[s.length/2+p];if(n.usages&m){const y=s[p];u.push(y)}return u},[]);i.keyUsage=c}return i}}}function up(){const r=df(),e=o.ref({}),t=n=>{if(!(n.id in e.value))try{e.value[n.id]=r.parseMetaCertificateData(n.cert)}catch{e.value[n.id]=void 0}return e.value[n.id]};return{certificateDataCache:e,getCertificateData:n=>{const s=t(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const fp={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."},empty_state_v2:{create:"New certificate",title:"Configure your first certificate",group:"Certificates created in gateways within this group will automatically appear here.",description:"Certificates manage SSL/TLS encryption, ensuring secure communication between clients and your API services.",learn_more:"Learn more"}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},snis:{label:"SNIs",placeholder:"Enter an SNI",add:"Add an SNI",tooltip:"Zero or more hostnames to associate with this certificate as SNIs",editingTip:"To manage SNIs for this certificate, click {link}.",editingTipLink:"here"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."},empty_state_v2:{create:"New CA certificate",title:"Configure your first CA certificate",group:"CA Certificates created in gateways within this group will automatically appear here.",description:"CA Certificates validate the authenticity of client and server certificates, reinforcing the trust and security of your API communications.",learn_more:"Learn more"}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function dp(){const r=za.createI18n("en-us",fp);return{i18n:r,i18nT:za.i18nTComponent(r)}}const tt={useCertificate:up,useI18n:dp,useX509:df},La="/v2/control-planes/{controlPlaneId}/core-entities",Fa="/{workspace}",Ao={list:{konnect:`${La}/certificates`,kongManager:`${Fa}/certificates`},form:{konnect:{create:`${La}/certificates`,edit:`${La}/certificates/{id}`},kongManager:{create:`${Fa}/certificates`,edit:`${Fa}/certificates/{id}`}}},pp={class:"kong-ui-entities-certificates-list"},hp={class:"button-row"},yp={key:0},gp={key:1},mp={key:0},bp={key:1},vp={key:0},wp={key:1},Sp={key:1},Ap=o.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var G;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=tt.useI18n(),u=Ui.useRouter(),{axiosInstance:f}=A.useAxios((G=i.config)==null?void 0:G.axiosRequestConfig),{handleStateChange:p,hasRecords:m}=A.useTableState(()=>ne.value),y=o.computed(()=>m.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),ie={subject:{label:n("certificates.list.table_headers.subject"),hidable:!1},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},ee=o.computed(()=>{var H,z;let O=`${i.config.apiBaseUrl}${Ao.list[i.config.app]}`;return i.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((H=i.config)==null?void 0:H.controlPlaneId)||""):i.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(z=i.config)!=null&&z.workspace?`/${i.config.workspace}`:"")),O}),ne=o.ref(""),$e=o.computed(()=>{const O=i.config.app==="konnect"||i.config.isExactMatch;return O?{isExactMatch:O,placeholder:n("certificates.search.placeholder")}:{isExactMatch:O,schema:i.config.filterSchema}}),{fetcher:ke,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),ee),se=()=>{ne.value=""},R=()=>{M.value++},j=o.ref(null),S=async(O,H)=>{const z=O.id;if(!await H(z)){t("copy:error",{entity:O,field:"id",message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,field:"id",message:n("certificates.copy.success",{val:z})})},F=async(O,H)=>{const z=JSON.stringify(O);if(!await H(z)){t("copy:error",{entity:O,message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("certificates.copy.success_brief")})},X=async O=>{var z;await((z=i.canRetrieve)==null?void 0:z.call(i,O))&&u.push(i.config.getViewRoute(O.id))},ft=O=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(O)}),dt=O=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(O)}),ae=O=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(O)}},le=o.ref(void 0),J=o.ref(!1),pt=o.ref(!1),nr=o.ref(""),Mr=A.useDeleteUrlBuilder(i.config,ee.value),{certificateDataCache:Rt,getCertificateData:xt}=tt.useCertificate(),Ur=O=>{le.value=O,J.value=!0},U=()=>{J.value=!1},ht=async()=>{var O,H,z;if((O=le.value)!=null&&O.id){pt.value=!0;try{await f.delete(Mr(le.value.id)),pt.value=!1,J.value=!1,M.value++,t("delete:success",le.value)}catch(Ce){nr.value=((z=(H=Ce.response)==null?void 0:H.data)==null?void 0:z.message)||Ce.message||n("certificates.errors.delete"),t("error",Ce)}finally{pt.value=!1}}},or=()=>{u.push(i.config.createRoute)};o.watch(P,O=>{var H,z,Ce;if(O.status===A.FetcherStatus.Error){j.value={title:n("certificates.errors.general")},(Ce=(z=(H=O.error)==null?void 0:H.response)==null?void 0:z.data)!=null&&Ce.message&&(j.value.message=O.error.response.data.message),t("error",O.error);return}Rt.value={},j.value=null});const ce=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")}),Dt=o.ref(!1);return o.onBeforeMount(async()=>{Dt.value=await i.canCreate(),Dt.value&&(ce.value.title=n("certificates.list.empty_state.title"),ce.value.ctaText=n("certificates.actions.create"))}),(O,H)=>{const z=o.resolveComponent("KButton"),Ce=o.resolveComponent("KEmptyState"),Bt=o.resolveComponent("KCopy"),K=o.resolveComponent("KDropdownItem"),Ie=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",pp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":ce.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(ke),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:ne.value,"table-headers":o.unref(ie),onClearSearchInput:se,"onClick:row":H[3]||(H[3]=D=>X(D)),onSort:R,onState:o.unref(p)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ne.value,"onUpdate:modelValue":H[0]||(H[0]=D=>ne.value=D),config:$e.value},null,8,["modelValue","config"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":r.canCreate},{default:o.withCtx(()=>[r.useToolbarCreationButton?(o.openBlock(),o.createBlock(z,{key:0,appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])):o.createCommentVNode("",!0)]),_:1},8,["auth-function"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",hp,[y.value?(o.openBlock(),o.createBlock(z,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"certificates-learn-more-button",icon:"",onClick:H[1]||(H[1]=D=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(z,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"]))])],8,["disabled"]))]),subject:o.withCtx(({row:D})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",yp,o.toDisplayString((xe=D==null?void 0:D.metadata)!=null&&xe.subject?D.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",gp,o.toDisplayString(o.unref(xt)(D).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:D})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",mp,o.toDisplayString((xe=D==null?void 0:D.metadata)!=null&&xe.expiry?o.unref(s)(D.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",bp,o.toDisplayString(o.unref(xt)(D).schemaExpiry?o.unref(s)(o.unref(xt)(D).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:D})=>{var xe;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",vp,o.toDisplayString((xe=D==null?void 0:D.metadata)!=null&&xe.dns_names?`dns=${D.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",wp,o.toDisplayString(o.unref(xt)(D).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:D})=>[D!=null&&D.cert?(o.openBlock(),o.createBlock(Bt,{key:0,"data-testid":"copy-certificate-cert",text:D.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Sp,"-"))]),tags:o.withCtx(({row:D})=>[o.createVNode(o.unref(A.TableTags),{tags:D==null?void 0:D.tags},null,8,["tags"])]),actions:o.withCtx(({row:D})=>[o.createVNode(Ie,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(K,{"data-testid":"action-entity-copy-id",onClick:Co=>S(D,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Ie,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(K,{"data-testid":"action-entity-copy-json",onClick:Co=>F(D,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(D)},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-view","has-divider":"",item:ft(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(D)},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-edit",item:dt(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":()=>r.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(K,{"data-testid":"action-entity-add-sni",item:ae(D.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(D)},{default:o.withCtx(()=>[o.createVNode(K,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Ur(D)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ne.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var D;return[o.createVNode(Ce,{"data-testid":"certificates-entity-empty-state","icon-background":"",message:o.unref(n)("certificates.list.empty_state_v2.description"),title:o.unref(n)("certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(je.ServiceDocumentIcon),{decoration:""})]),action:o.withCtx(()=>[Dt.value?(o.openBlock(),o.createBlock(z,{key:0,"data-testid":"entity-create-button",onClick:or},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(z,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:H[2]||(H[2]=xe=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(D=r.config)!=null&&D.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(A.EntityDeleteModal),{"action-pending":pt.value,"entity-type":o.unref(A.EntityTypes).Certificate,error:nr.value,title:o.unref(n)("certificates.delete.title"),visible:J.value,onCancel:U,onProceed:ht},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),ir=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},kp=ir(Ap,[["__scopeId","data-v-198dc311"]]),Cp="#d60027",xp={class:"sni-field-container"},Bp={key:1,class:"sni-field-controls-container"},Ep={key:0},Np=ir(o.defineComponent({__name:"CertificateFormSniField",props:{isEditing:{type:Boolean,default:!1},modelValue:{type:Array,required:!0},sniListRoute:{type:Object,required:!0}},emits:["add","remove","update:modelValue"],setup(r,{emit:e}){const t=r,i=e,{i18nT:n,i18n:{t:s}}=tt.useI18n(),c=o.ref([]);return o.watch(t.modelValue,u=>{c.value=[...u]},{immediate:!0,deep:!0}),o.watch(c,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const p=o.resolveComponent("KLabel"),m=o.resolveComponent("KInput"),y=o.resolveComponent("KButton"),L=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",xp,[o.createVNode(p,{info:o.unref(s)("certificates.form.fields.snis.tooltip")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.label")),1)]),_:1},8,["info"]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,(oe,ie)=>(o.openBlock(),o.createElementBlock("div",{key:ie,class:"sni-field-input"},[!r.isEditing||c.value[ie]?(o.openBlock(),o.createBlock(m,{key:0,modelValue:c.value[ie],"onUpdate:modelValue":ee=>c.value[ie]=ee,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${ie+1}`,disabled:r.isEditing,placeholder:o.unref(s)("certificates.form.fields.snis.placeholder")},null,8,["modelValue","onUpdate:modelValue","data-testid","disabled","placeholder"])):o.createCommentVNode("",!0),r.isEditing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Bp,[o.createVNode(y,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:ee=>u.$emit("remove",ie)},{default:o.withCtx(()=>[o.createVNode(o.unref(je.TrashIcon),{color:o.unref(Cp)},null,8,["color"])]),_:1},8,["onClick"]),o.createVNode(y,{appearance:"tertiary","data-testid":"add-sni",disabled:ie!==c.value.length-1,icon:"",onClick:f[0]||(f[0]=ee=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon))]),_:1},8,["disabled"])]))]))),128)),c.value.length===0?(o.openBlock(),o.createElementBlock("div",Ep,[o.createVNode(y,{onClick:f[1]||(f[1]=oe=>u.$emit("add"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.add")),1)]),_:1})])):o.createCommentVNode("",!0),r.isEditing?(o.openBlock(),o.createBlock(o.unref(n),{key:1,keypath:"certificates.form.fields.snis.editingTip"},{link:o.withCtx(()=>[o.createVNode(L,{to:r.sniListRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("certificates.form.fields.snis.editingTipLink")),1)]),_:1},8,["to"])]),_:1})):o.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-a5577ce8"]]),Ip={class:"kong-ui-entities-certificates-form"},Op=ir(o.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""},showSnisField:{type:Boolean,required:!1,default:!1}},emits:["update","error","loading"],setup(r,{emit:e}){var se;const t=e,i=r,n=Ui.useRouter(),{i18nT:s,i18n:{t:c}}=tt.useI18n(),{getMessageFromError:u}=A.useErrors(),{axiosInstance:f}=A.useAxios((se=i.config)==null?void 0:se.axiosRequestConfig),p=o.computed(()=>Ao.form[i.config.app].edit),m=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),y=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),L=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),oe=o.computed(()=>(m.value===A.EntityBaseFormType.Create||JSON.stringify(y.fields)!==JSON.stringify(L))&&!!y.fields.cert&&!!y.fields.key),ie=R=>{var j,S;y.fields.cert=(R==null?void 0:R.cert)||"",y.fields.key=(R==null?void 0:R.key)||"",y.fields.certAlt=(R==null?void 0:R.cert_alt)||"",y.fields.keyAlt=(R==null?void 0:R.key_alt)||"",y.fields.snis=(j=R==null?void 0:R.snis)!=null&&j.length?R.snis:[""],y.fields.tags=((S=R==null?void 0:R.tags)==null?void 0:S.join(", "))||"",Object.assign(L,y.fields)},ee=()=>{n.push(i.config.cancelRoute)},ne=()=>{y.fields.snis.push("")},$e=R=>{y.fields.snis.splice(R,1)},ke=o.computed(()=>{var j,S;let R=`${i.config.apiBaseUrl}${Ao.form[i.config.app][m.value]}`;return i.config.app==="konnect"?R=R.replace(/{controlPlaneId}/gi,((j=i.config)==null?void 0:j.controlPlaneId)||""):i.config.app==="kongManager"&&(R=R.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),R=R.replace(/{id}/gi,i.certificateId),R}),P=o.computed(()=>{var R,j;return{cert:y.fields.cert,key:y.fields.key,cert_alt:y.fields.certAlt||null,key_alt:y.fields.keyAlt||null,...i.showSnisField?{snis:y.fields.snis.filter(Boolean)}:{},tags:(j=(R=y.fields.tags.split(","))==null?void 0:R.map(S=>String(S||"").trim()))==null?void 0:j.filter(S=>S!=="")}}),M=async()=>{var R,j,S,F,X,ft,dt,ae,le;try{y.isReadonly=!0;let J;m.value==="create"?J=await f.post(ke.value,P.value):m.value==="edit"&&(J=((R=i.config)==null?void 0:R.app)==="konnect"?await f.put(ke.value,P.value):await f.patch(ke.value,P.value)),y.fields.cert=((j=J==null?void 0:J.data)==null?void 0:j.cert)||"",y.fields.key=((S=J==null?void 0:J.data)==null?void 0:S.key)||"",y.fields.certAlt=((F=J==null?void 0:J.data)==null?void 0:F.cert_alt)||"",y.fields.keyAlt=((X=J==null?void 0:J.data)==null?void 0:X.key_alt)||"",y.fields.snis=(dt=(ft=J==null?void 0:J.data)==null?void 0:ft.snis)!=null&&dt.length?J.data.snis:[""],y.fields.tags=((le=(ae=J==null?void 0:J.data)==null?void 0:ae.tags)==null?void 0:le.join(", "))||"",Object.assign(L,y.fields),t("update",J==null?void 0:J.data)}catch(J){y.errorMessage=u(J),t("error",J)}finally{y.isReadonly=!1}};return(R,j)=>{const S=o.resolveComponent("KTextArea"),F=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Ip,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":oe.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).Certificate,"error-message":y.errorMessage,"fetch-url":p.value,"form-fields":P.value,"is-readonly":y.isReadonly,onCancel:ee,"onFetch:error":j[7]||(j[7]=X=>R.$emit("error",X)),"onFetch:success":ie,onLoading:j[8]||(j[8]=X=>R.$emit("loading",X)),onSubmit:M},{default:o.withCtx(()=>[o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(c)("certificates.form.sections.ssl.description"),title:o.unref(c)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(S,{modelValue:y.fields.cert,"onUpdate:modelValue":j[0]||(j[0]=X=>y.fields.cert=X),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(c)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:y.fields.key,"onUpdate:modelValue":j[1]||(j[1]=X=>y.fields.key=X),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(c)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:y.fields.certAlt,"onUpdate:modelValue":j[2]||(j[2]=X=>y.fields.certAlt=X),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(c)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:y.fields.keyAlt,"onUpdate:modelValue":j[3]||(j[3]=X=>y.fields.keyAlt=X),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(c)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:y.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(c)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(Np,{key:0,modelValue:y.fields.snis,"onUpdate:modelValue":j[4]||(j[4]=X=>y.fields.snis=X),"is-editing":m.value===o.unref(A.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:ne,onRemove:j[5]||(j[5]=X=>$e(X))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(c)("certificates.form.sections.general.description"),title:o.unref(c)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(F,{modelValue:y.fields.tags,"onUpdate:modelValue":j[6]||(j[6]=X=>y.fields.tags=X),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(c)("certificates.form.fields.tags.help"),label:o.unref(c)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(c)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(c)("certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-8efa723a"]]),qa="/v2/control-planes/{controlPlaneId}/core-entities",Ka="/{workspace}",ko={list:{konnect:`${qa}/ca_certificates`,kongManager:`${Ka}/ca_certificates`},form:{konnect:{create:`${qa}/ca_certificates`,edit:`${qa}/ca_certificates/{id}`},kongManager:{create:`${Ka}/ca_certificates`,edit:`${Ka}/ca_certificates/{id}`}}},_p={class:"kong-ui-ca-certificate-entity-config-card"},Tp={key:0},Vp=ir(o.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=["dns_names","san_names","subject"],i=e,n=r,{i18n:{t:s,formatUnixTimeStamp:c}}=tt.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:p}=tt.useCertificate(),m=o.computed(()=>ko.form[n.config.app].edit),y=o.ref(),L=o.computed(()=>{if(y.value)return p(y.value)}),oe=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaIssuer)||""}),ie=o.computed(()=>{var P,M;return(P=L.value)!=null&&P.schemaExpiry?c((M=L.value)==null?void 0:M.schemaExpiry):""}),ee=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaKeyUsages)||[]}),ne=(P,M)=>{const se=f("rowValue",M);if(P==="expiry")return ie.value;if(P==="key_usages")return ee.value;if(se)return se[P]},$e=P=>{y.value=P,i("fetch:success",P)},ke=o.ref({id:{},updated_at:{},created_at:{},cert:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:A.ConfigurationSchemaSection.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json,order:7},...n.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:A.ConfigurationSchemaSection.Basic,order:1.7,forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,order:1.5,forceShow:!0},key_usages:{section:A.ConfigurationSchemaSection.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(P,M)=>{const se=o.resolveComponent("KCodeBlock"),R=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",_p,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":ke.value,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"fetch-url":m.value,"hide-title":r.hideTitle,"onFetch:error":M[0]||(M[0]=S=>P.$emit("fetch:error",S)),"onFetch:success":$e,onLoading:M[1]||(M[1]=S=>P.$emit("loading",S))},{cert:o.withCtx(S=>[o.unref(f)("rowValue",S)?(o.openBlock(),o.createBlock(se,{key:0,id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",S),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(R,{class:"metadata-label"},{default:o.withCtx(()=>[...M[2]||(M[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(S=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",S)).filter(F=>!t.includes(F)),F=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:F,"data-testid":`ca-cert-metadata-${F}`,item:{key:F,label:o.unref(u)(F),value:ne(F,S),type:F==="key_usages"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(oe.value||"–"),1)]),key_usages:o.withCtx(()=>[ee.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Tp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ee.value,(S,F)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${F}`,class:"config-badge","data-testid":`key_usages-badge-tag-${F}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-83648433"]]),jp={class:"kong-ui-entities-ca-certificates-list"},Pp={class:"button-row"},Rp={key:0},Dp={key:1},Mp={key:0},Up={key:1},$p=ir(o.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||!r.createRoute||!r.getViewRoute||!r.getEditRoute||r.app==="kongManager"&&!r.isExactMatch&&!r.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1},useToolbarCreationButton:{type:Boolean,default:!1}},emits:["error","click:learn-more","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var Dt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=tt.useI18n(),u=Ui.useRouter(),{axiosInstance:f}=A.useAxios((Dt=i.config)==null?void 0:Dt.axiosRequestConfig),{hasRecords:p,handleStateChange:m}=A.useTableState(()=>ne.value),y=o.computed(()=>p.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),ie={issuer:{label:n("ca-certificates.list.table_headers.issuer"),hidable:!1},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},ee=o.computed(()=>{var O,H;let G=`${i.config.apiBaseUrl}${ko.list[i.config.app]}`;return i.config.app==="konnect"?G=G.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(G=G.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),G}),ne=o.ref(""),$e=o.computed(()=>{const G=i.config.app==="konnect"||i.config.isExactMatch;return G?{isExactMatch:G,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:G,schema:i.config.filterSchema}}),{fetcher:ke,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),ee),se=()=>{ne.value=""},R=()=>{M.value++},j=o.ref(null),S=async(G,O)=>{const H=G.id;if(!await O(H)){t("copy:error",{entity:G,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:G,field:"id",message:n("ca-certificates.copy.success",{val:H})})},F=async(G,O)=>{const H=JSON.stringify(G);if(!await O(H)){t("copy:error",{entity:G,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:G,message:n("ca-certificates.copy.success_brief")})},X=async G=>{var H;await((H=i.canRetrieve)==null?void 0:H.call(i,G))&&u.push(i.config.getViewRoute(G.id))},ft=G=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(G)}),dt=G=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(G)}),ae=o.ref(void 0),le=o.ref(!1),J=o.ref(!1),pt=o.ref(""),nr=A.useDeleteUrlBuilder(i.config,ee.value),{certificateDataCache:Mr,getCertificateData:Rt}=tt.useCertificate(),xt=G=>{ae.value=G,le.value=!0},Ur=()=>{le.value=!1},U=async()=>{var G,O,H;if((G=ae.value)!=null&&G.id){J.value=!0;try{await f.delete(nr(ae.value.id)),J.value=!1,le.value=!1,M.value++,t("delete:success",ae.value)}catch(z){pt.value=((H=(O=z.response)==null?void 0:O.data)==null?void 0:H.message)||z.message||n("ca-certificates.errors.delete"),t("error",z)}finally{J.value=!1}}},ht=()=>{u.push(i.config.createRoute)};o.watch(P,G=>{var O,H,z;if(G.status===A.FetcherStatus.Error){j.value={title:n("ca-certificates.errors.general")},(z=(H=(O=G.error)==null?void 0:O.response)==null?void 0:H.data)!=null&&z.message&&(j.value.message=G.error.response.data.message),t("error",G.error);return}Mr.value={},j.value=null});const or=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")}),ce=o.ref(!1);return o.onBeforeMount(async()=>{ce.value=await i.canCreate(),ce.value&&(or.value.title=n("ca-certificates.list.empty_state.title"),or.value.ctaText=n("ca-certificates.actions.create"))}),(G,O)=>{const H=o.resolveComponent("KButton"),z=o.resolveComponent("KEmptyState"),Ce=o.resolveComponent("KDropdownItem"),Bt=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",jp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":or.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(ke),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:ne.value,"table-headers":o.unref(ie),onClearSearchInput:se,"onClick:row":O[3]||(O[3]=K=>X(K)),onSort:R,onState:o.unref(m)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ne.value,"onUpdate:modelValue":O[0]||(O[0]=K=>ne.value=K),config:$e.value},null,8,["modelValue","config"]),r.useToolbarCreationButton?(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:0,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])):o.createCommentVNode("",!0)]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.Teleport,{disabled:!r.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[o.createElementVNode("div",Pp,[y.value?(o.openBlock(),o.createBlock(H,{key:0,appearance:"secondary",class:"open-learning-hub","data-testid":"ca-certificates-learn-more-button",icon:"",onClick:O[1]||(O[1]=K=>G.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""})]),_:1})):o.createCommentVNode("",!0),r.useToolbarCreationButton?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(A.PermissionsWrapper),{key:1,"auth-function":r.canCreate},{default:o.withCtx(()=>[o.createVNode(H,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon)),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["size","to"])]),_:1},8,["auth-function"]))])],8,["disabled"]))]),issuer:o.withCtx(({row:K})=>{var Ie;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Rp,o.toDisplayString((Ie=K==null?void 0:K.metadata)!=null&&Ie.issuer?K.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",Dp,o.toDisplayString(o.unref(Rt)(K).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:K})=>{var Ie;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Mp,o.toDisplayString((Ie=K==null?void 0:K.metadata)!=null&&Ie.expiry?o.unref(s)(K.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Up,o.toDisplayString(o.unref(Rt)(K).schemaExpiry?o.unref(s)(o.unref(Rt)(K).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:K})=>[o.createVNode(o.unref(A.TableTags),{tags:K==null?void 0:K.tags},null,8,["tags"])]),actions:o.withCtx(({row:K})=>[o.createVNode(Bt,null,{default:o.withCtx(({copyToClipboard:Ie})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-id",onClick:D=>S(K,Ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Bt,null,{default:o.withCtx(({copyToClipboard:Ie})=>[o.createVNode(Ce,{"data-testid":"action-entity-copy-json",onClick:D=>F(K,Ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canRetrieve(K)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-view","has-divider":"",item:ft(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canEdit(K)},{default:o.withCtx(()=>[o.createVNode(Ce,{"data-testid":"action-entity-edit",item:dt(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":()=>r.canDelete(K)},{default:o.withCtx(()=>[o.createVNode(Ce,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ie=>xt(K)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ne.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var K;return[o.createVNode(z,{"data-testid":"ca-certificates-entity-empty-state","icon-background":"",message:o.unref(n)("ca-certificates.list.empty_state_v2.description"),title:o.unref(n)("ca-certificates.list.empty_state_v2.title")},o.createSlots({icon:o.withCtx(()=>[o.createVNode(o.unref(je.ServiceDocumentIcon),{decorative:""})]),action:o.withCtx(()=>[ce.value?(o.openBlock(),o.createBlock(H,{key:0,"data-testid":"entity-create-button",onClick:ht},{default:o.withCtx(()=>[o.createVNode(o.unref(je.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(H,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:O[2]||(O[2]=Ie=>G.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(je.BookIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.learn_more")),1)]),_:1})]),_:2},[(K=r.config)!=null&&K.isControlPlaneGroup?{name:"default",fn:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.empty_state_v2.group")),1)]),key:"0"}:void 0]),1032,["message","title"])]}),key:"0"}:void 0]),1032,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","onState"]),o.createVNode(o.unref(A.EntityDeleteModal),{"action-pending":J.value,"entity-type":o.unref(A.EntityTypes).CACertificate,error:pt.value,title:o.unref(n)("ca-certificates.delete.title"),visible:le.value,onCancel:Ur,onProceed:U},{description:o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-c4525d48"]]),Hp={class:"kong-ui-entities-ca-certificates-form"},Lp=ir(o.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(r,{emit:e}){var ke;const t=e,i=r,n=Ui.useRouter(),{i18n:{t:s}}=tt.useI18n(),{getMessageFromError:c}=A.useErrors(),{axiosInstance:u}=A.useAxios((ke=i.config)==null?void 0:ke.axiosRequestConfig),f=o.computed(()=>ko.form[i.config.app].edit),p=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),m=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),y=o.reactive({cert:"",certDigest:"",tags:""}),L=o.computed(()=>(p.value===A.EntityBaseFormType.Create||JSON.stringify(m.fields)!==JSON.stringify(y))&&!!m.fields.cert),oe=P=>{var M;m.fields.cert=(P==null?void 0:P.cert)||"",m.fields.certDigest=(P==null?void 0:P.cert_digest)||"",m.fields.tags=((M=P==null?void 0:P.tags)==null?void 0:M.join(", "))||"",Object.assign(y,m.fields)},ie=()=>{n.push(i.config.cancelRoute)},ee=o.computed(()=>{var M,se;let P=`${i.config.apiBaseUrl}${ko.form[i.config.app][p.value]}`;return i.config.app==="konnect"?P=P.replace(/{controlPlaneId}/gi,((M=i.config)==null?void 0:M.controlPlaneId)||""):i.config.app==="kongManager"&&(P=P.replace(/\/{workspace}/gi,(se=i.config)!=null&&se.workspace?`/${i.config.workspace}`:"")),P=P.replace(/{id}/gi,i.certificateId),P}),ne=o.computed(()=>{var P,M;return{cert:m.fields.cert,cert_digest:m.fields.certDigest||null,tags:(M=(P=m.fields.tags.split(","))==null?void 0:P.map(se=>String(se||"").trim()))==null?void 0:M.filter(se=>se!=="")}}),$e=async()=>{var P,M,se,R,j;try{m.isReadonly=!0;let S;p.value==="create"?S=await u.post(ee.value,ne.value):p.value==="edit"&&(S=((P=i.config)==null?void 0:P.app)==="konnect"?await u.put(ee.value,ne.value):await u.patch(ee.value,ne.value)),m.fields.cert=((M=S==null?void 0:S.data)==null?void 0:M.cert)||"",m.fields.certDigest=((se=S==null?void 0:S.data)==null?void 0:se.cert_digest)||"",m.fields.tags=((j=(R=S==null?void 0:S.data)==null?void 0:R.tags)==null?void 0:j.join(", "))||"",Object.assign(y,m.fields),t("update",S==null?void 0:S.data)}catch(S){m.errorMessage=c(S),t("error",S)}finally{m.isReadonly=!1}};return(P,M)=>{const se=o.resolveComponent("KTextArea"),R=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Hp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":L.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"error-message":m.errorMessage,"fetch-url":f.value,"form-fields":ne.value,"is-readonly":m.isReadonly,onCancel:ie,"onFetch:error":M[3]||(M[3]=j=>P.$emit("error",j)),"onFetch:success":oe,onLoading:M[4]||(M[4]=j=>P.$emit("loading",j)),onSubmit:$e},{default:o.withCtx(()=>[o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(se,{modelValue:m.fields.cert,"onUpdate:modelValue":M[0]||(M[0]=j=>m.fields.cert=j),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip"),tooltipAttributes:{maxWidth:"400"}},readonly:m.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(R,{modelValue:m.fields.certDigest,"onUpdate:modelValue":M[1]||(M[1]=j=>m.fields.certDigest=j),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:m.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(R,{modelValue:m.fields.tags,"onUpdate:modelValue":M[2]||(M[2]=j=>m.fields.tags=j),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:m.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-65a16c52"]]),Fp={class:"kong-ui-certificate-entity-config-card"},qp={key:0},Kp=ir(o.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:r=>!(!r||!["konnect","kongManager"].includes(r==null?void 0:r.app)||r.app==="konnect"&&!r.controlPlaneId||r.app==="kongManager"&&typeof r.workspace!="string"||!r.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(r,{emit:e}){const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:c}=tt.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:p}=tt.useCertificate(),m=o.computed(()=>Ao.form[i.config.app].edit),y=o.ref(),L=o.ref({id:{},cert:{section:A.ConfigurationSchemaSection.Basic},key:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Redacted},metadata:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.Json},snis:{section:A.ConfigurationSchemaSection.Basic,type:A.ConfigurationSchemaType.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:A.ConfigurationSchemaSection.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:A.ConfigurationSchemaSection.Advanced},key_alt:{section:A.ConfigurationSchemaSection.Advanced,type:A.ConfigurationSchemaType.Redacted}}),oe=S=>{y.value=S,t("fetch:success",S)},ie=(S,F)=>{const X=f("rowValue",F);if(S==="expiry")return ne.value;if(S==="key_usages")return M.value;if(S==="san_names")return ke.value;if(X)return X[S]},ee=o.computed(()=>{if(y.value)return p(y.value)}),ne=o.computed(()=>{var S,F;return(S=ee.value)!=null&&S.schemaExpiry?s((F=ee.value)==null?void 0:F.schemaExpiry):""}),$e=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaIssuer)||""}),ke=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaSanNames)||""}),P=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaSubject)||""}),M=o.computed(()=>{var S;return((S=ee.value)==null?void 0:S.schemaKeyUsages)||[]}),se=o.computed(()=>{var S,F;return((F=(S=y==null?void 0:y.value)==null?void 0:S.snis)==null?void 0:F.length)>0}),R=o.computed(()=>{var S;return!!((S=y==null?void 0:y.value)!=null&&S.cert_alt)}),j=S=>{var F,X;return S==="san_names"?n("certificates.list.table_headers.san"):((X=(F=L.value)==null?void 0:F[S])==null?void 0:X.label)||u(S)};return(S,F)=>{const X=o.resolveComponent("KCodeBlock"),ft=o.resolveComponent("KLabel"),dt=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",Fp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":L.value,"entity-type":o.unref(A.SupportedEntityType).Certificate,"fetch-url":m.value,"hide-title":r.hideTitle,"onFetch:error":F[0]||(F[0]=ae=>S.$emit("fetch:error",ae)),"onFetch:success":oe,onLoading:F[1]||(F[1]=ae=>S.$emit("loading",ae))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(ae=>[o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(X,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(ft,{class:"metadata-label"},{default:o.withCtx(()=>[...F[2]||(F[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(ae=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",ae)),le=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:le,item:{key:le,value:ie(le,ae),label:j(le),type:le==="key_usages"||le==="snis"||le==="dns_names"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ne.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString($e.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ke.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(P.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(c),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[M.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",qp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(M.value,(ae,le)=>(o.openBlock(),o.createBlock(dt,{key:`key_usages-badge-tag-${le}`,class:"config-badge","data-testid":`key_usages-badge-tag-${le}`,tooltip:ae,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ae),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[se.value?void 0:{name:"snis",fn:o.withCtx(()=>[F[3]||(F[3]=o.createTextVNode(" – ",-1))]),key:"0"},R.value?{name:"cert_alt",fn:o.withCtx(ae=>[F[4]||(F[4]=o.createTextVNode(" > ",-1)),o.unref(f)("rowValue",ae)?(o.openBlock(),o.createBlock(X,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",ae),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","entity-type","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-de8f90ef"]]);Be.CACertificateConfigCard=Vp,Be.CACertificateForm=Lp,Be.CACertificateList=$p,Be.CertificateConfigCard=Kp,Be.CertificateForm=Op,Be.CertificateList=kp,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});