@kong-ui-public/entities-certificates 3.11.21 → 3.11.22-pr.2722.b1aa23ae4.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 +5 -5
  2. package/dist/entities-certificates.es.js +0 -10855
  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 -62
  10. package/dist/types/components/CACertificateConfigCard.vue.d.ts.map +0 -1
  11. package/dist/types/components/CACertificateForm.vue.d.ts +0 -43
  12. package/dist/types/components/CACertificateForm.vue.d.ts.map +0 -1
  13. package/dist/types/components/CACertificateList.vue.d.ts +0 -117
  14. package/dist/types/components/CACertificateList.vue.d.ts.map +0 -1
  15. package/dist/types/components/CertificateConfigCard.vue.d.ts +0 -62
  16. package/dist/types/components/CertificateConfigCard.vue.d.ts.map +0 -1
  17. package/dist/types/components/CertificateForm.vue.d.ts +0 -56
  18. package/dist/types/components/CertificateForm.vue.d.ts.map +0 -1
  19. package/dist/types/components/CertificateFormSniField.vue.d.ts +0 -42
  20. package/dist/types/components/CertificateFormSniField.vue.d.ts.map +0 -1
  21. package/dist/types/components/CertificateList.vue.d.ts +0 -131
  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(Ce,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):(Ce=typeof globalThis<"u"?globalThis:Ce||self,o(Ce["kong-ui-public-entities-certificates"]={},Ce.Vue,Ce.VueRouter,Ce.KongIcons,Ce["kong-ui-public-i18n"],Ce["kong-ui-public-entities-shared"]))})(this,function(Ce,o,gi,_e,xa,A){"use strict";var Ba=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 Ea;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof Ba=="object"?Ba: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,d){return function(g,h){Object.defineProperty(f,g,{configurable:!0,writable:!0,value:h}),d&&d(g,h)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function u(){return s()||a()}})(function(e,t){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",f={__proto__:[]}instanceof Array,d=!u&&!f,g={create:u?function(){return Ca(Object.create(null))}:f?function(){return Ca({__proto__:null})}:function(){return Ca({})},has:d?function(y,m){return i.call(y,m)}:function(y,m){return m in y},get:d?function(y,m){return i.call(y,m)?y[m]:void 0}:function(y,m){return y[m]}},h=Object.getPrototypeOf(Function),L=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Ep(),ne=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Np(),re=typeof WeakMap=="function"?WeakMap:Ip(),X=n?Symbol.for("@reflect-metadata:registry"):void 0,ie=Cp(),Me=xp(ie);function Se(y,m,b,k){if(U(b)){if(!Ae(y))throw new TypeError;if(!K(m))throw new TypeError;return ut(y,m)}else{if(!Ae(y))throw new TypeError;if(!ae(m))throw new TypeError;if(!ae(k)&&!U(k)&&!dt(k))throw new TypeError;return dt(k)&&(k=void 0),b=G(b),se(y,m,b,k)}}e("decorate",Se);function P(y,m){function b(k,$){if(!ae(k))throw new TypeError;if(!U($)&&!Ee($))throw new TypeError;Vr(y,m,k,$)}return b}e("metadata",P);function M(y,m,b,k){if(!ae(b))throw new TypeError;return U(k)||(k=G(k)),Vr(y,m,b,k)}e("defineMetadata",M);function oe(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),ce(y,m,b)}e("hasMetadata",oe);function R(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),z(y,m,b)}e("hasOwnMetadata",R);function j(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),ft(y,m,b)}e("getMetadata",j);function S(y,m,b){if(!ae(m))throw new TypeError;return U(b)||(b=G(b)),rr(y,m,b)}e("getOwnMetadata",S);function F(y,m){if(!ae(y))throw new TypeError;return U(m)||(m=G(m)),Pt(y,m)}e("getMetadataKeys",F);function Z(y,m){if(!ae(y))throw new TypeError;return U(m)||(m=G(m)),kt(y,m)}e("getOwnMetadataKeys",Z);function lt(y,m,b){if(!ae(m))throw new TypeError;if(U(b)||(b=G(b)),!ae(m))throw new TypeError;U(b)||(b=G(b));var k=yi(m,b,!1);return U(k)?!1:k.OrdinaryDeleteMetadata(y,m,b)}e("deleteMetadata",lt);function ut(y,m){for(var b=y.length-1;b>=0;--b){var k=y[b],$=k(m);if(!U($)&&!dt($)){if(!K($))throw new TypeError;m=$}}return m}function se(y,m,b,k){for(var $=y.length-1;$>=0;--$){var de=y[$],me=de(m,b,k);if(!U(me)&&!dt(me)){if(!ae(me))throw new TypeError;k=me}}return k}function ce(y,m,b){var k=z(y,m,b);if(k)return!0;var $=ka(m);return dt($)?!1:ce(y,$,b)}function z(y,m,b){var k=yi(m,b,!1);return U(k)?!1:O(k.OrdinaryHasOwnMetadata(y,m,b))}function ft(y,m,b){var k=z(y,m,b);if(k)return rr(y,m,b);var $=ka(m);if(!dt($))return ft(y,$,b)}function rr(y,m,b){var k=yi(m,b,!1);if(!U(k))return k.OrdinaryGetOwnMetadata(y,m,b)}function Vr(y,m,b,k){var $=yi(b,k,!0);$.OrdinaryDefineOwnMetadata(y,m,b,k)}function Pt(y,m){var b=kt(y,m),k=ka(y);if(k===null)return b;var $=Pt(k,m);if($.length<=0)return b;if(b.length<=0)return $;for(var de=new ne,me=[],J=0,B=b;J<B.length;J++){var I=B[J],_=de.has(I);_||(de.add(I),me.push(I))}for(var V=0,Y=$;V<Y.length;V++){var I=Y[V],_=de.has(I);_||(de.add(I),me.push(I))}return me}function kt(y,m){var b=yi(y,m,!1);return b?b.OrdinaryOwnMetadataKeys(y,m):[]}function jr(y){if(y===null)return 1;switch(typeof y){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return y===null?1:6;default:return 6}}function U(y){return y===void 0}function dt(y){return y===null}function ir(y){return typeof y=="symbol"}function ae(y){return typeof y=="object"?y!==null:typeof y=="function"}function Rt(y,m){switch(jr(y)){case 0:return y;case 1:return y;case 2:return y;case 3:return y;case 4:return y;case 5:return y}var b="string",k=ke(y,s);if(k!==void 0){var $=k.call(y,b);if(ae($))throw new TypeError;return $}return W(y)}function W(y,m){var b,k,$;{var de=y.toString;if(Ct(de)){var k=de.call(y);if(!ae(k))return k}var b=y.valueOf;if(Ct(b)){var k=b.call(y);if(!ae(k))return k}}throw new TypeError}function O(y){return!!y}function H(y){return""+y}function G(y){var m=Rt(y);return ir(m)?m:H(m)}function Ae(y){return Array.isArray?Array.isArray(y):y instanceof Object?y instanceof Array:Object.prototype.toString.call(y)==="[object Array]"}function Ct(y){return typeof y=="function"}function K(y){return typeof y=="function"}function Ee(y){switch(jr(y)){case 3:return!0;case 4:return!0;default:return!1}}function D(y,m){return y===m||y!==y&&m!==m}function ke(y,m){var b=y[m];if(b!=null){if(!Ct(b))throw new TypeError;return b}}function eo(y){var m=ke(y,a);if(!Ct(m))throw new TypeError;var b=m.call(y);if(!ae(b))throw new TypeError;return b}function Fu(y){return y.value}function qu(y){var m=y.next();return m.done?!1:m}function Ku(y){var m=y.return;m&&m.call(y)}function ka(y){var m=Object.getPrototypeOf(y);if(typeof y!="function"||y===h||m!==h)return m;var b=y.prototype,k=b&&Object.getPrototypeOf(b);if(k==null||k===Object.prototype)return m;var $=k.constructor;return typeof $!="function"||$===y?m:$}function kp(){var y;!U(X)&&typeof t.Reflect<"u"&&!(X in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(y=Bp(t.Reflect));var m,b,k,$=new re,de={registerProvider:me,getProvider:B,setProvider:_};return de;function me(V){if(!Object.isExtensible(de))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case y===V:break;case U(m):m=V;break;case m===V:break;case U(b):b=V;break;case b===V:break;default:k===void 0&&(k=new ne),k.add(V);break}}function J(V,Y){if(!U(m)){if(m.isProviderFor(V,Y))return m;if(!U(b)){if(b.isProviderFor(V,Y))return m;if(!U(k))for(var ue=eo(k);;){var pe=qu(ue);if(!pe)return;var et=Fu(pe);if(et.isProviderFor(V,Y))return Ku(ue),et}}}if(!U(y)&&y.isProviderFor(V,Y))return y}function B(V,Y){var ue=$.get(V),pe;return U(ue)||(pe=ue.get(Y)),U(pe)&&(pe=J(V,Y),U(pe)||(U(ue)&&(ue=new L,$.set(V,ue)),ue.set(Y,pe))),pe}function I(V){if(U(V))throw new TypeError;return m===V||b===V||!U(k)&&k.has(V)}function _(V,Y,ue){if(!I(ue))throw new Error("Metadata provider not registered.");var pe=B(V,Y);if(pe!==ue){if(!U(pe))return!1;var et=$.get(V);U(et)&&(et=new L,$.set(V,et)),et.set(Y,ue)}return!0}}function Cp(){var y;return!U(X)&&ae(t.Reflect)&&Object.isExtensible(t.Reflect)&&(y=t.Reflect[X]),U(y)&&(y=kp()),!U(X)&&ae(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,X,{enumerable:!1,configurable:!1,writable:!1,value:y}),y}function xp(y){var m=new re,b={isProviderFor:function(I,_){var V=m.get(I);return U(V)?!1:V.has(_)},OrdinaryDefineOwnMetadata:me,OrdinaryHasOwnMetadata:$,OrdinaryGetOwnMetadata:de,OrdinaryOwnMetadataKeys:J,OrdinaryDeleteMetadata:B};return ie.registerProvider(b),b;function k(I,_,V){var Y=m.get(I),ue=!1;if(U(Y)){if(!V)return;Y=new L,m.set(I,Y),ue=!0}var pe=Y.get(_);if(U(pe)){if(!V)return;if(pe=new L,Y.set(_,pe),!y.setProvider(I,_,b))throw Y.delete(_),ue&&m.delete(I),new Error("Wrong provider for target.")}return pe}function $(I,_,V){var Y=k(_,V,!1);return U(Y)?!1:O(Y.has(I))}function de(I,_,V){var Y=k(_,V,!1);if(!U(Y))return Y.get(I)}function me(I,_,V,Y){var ue=k(V,Y,!0);ue.set(I,_)}function J(I,_){var V=[],Y=k(I,_,!1);if(U(Y))return V;for(var ue=Y.keys(),pe=eo(ue),et=0;;){var Wu=qu(pe);if(!Wu)return V.length=et,V;var Op=Fu(Wu);try{V[et]=Op}catch(Tp){try{Ku(pe)}finally{throw Tp}}et++}}function B(I,_,V){var Y=k(_,V,!1);if(U(Y)||!Y.delete(I))return!1;if(Y.size===0){var ue=m.get(_);U(ue)||(ue.delete(V),ue.size===0&&m.delete(ue))}return!0}}function Bp(y){var m=y.defineMetadata,b=y.hasOwnMetadata,k=y.getOwnMetadata,$=y.getOwnMetadataKeys,de=y.deleteMetadata,me=new re,J={isProviderFor:function(B,I){var _=me.get(B);return!U(_)&&_.has(I)?!0:$(B,I).length?(U(_)&&(_=new ne,me.set(B,_)),_.add(I),!0):!1},OrdinaryDefineOwnMetadata:m,OrdinaryHasOwnMetadata:b,OrdinaryGetOwnMetadata:k,OrdinaryOwnMetadataKeys:$,OrdinaryDeleteMetadata:de};return J}function yi(y,m,b){var k=ie.getProvider(y,m);if(!U(k))return k;if(b){if(ie.setProvider(y,m,Me))return Me;throw new Error("Illegal state.")}}function Ep(){var y={},m=[],b=function(){function J(B,I,_){this._index=0,this._keys=B,this._values=I,this._selector=_}return J.prototype["@@iterator"]=function(){return this},J.prototype[a]=function(){return this},J.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=m,this._values=m):this._index++,{value:I,done:!1}}return{value:void 0,done:!0}},J.prototype.throw=function(B){throw this._index>=0&&(this._index=-1,this._keys=m,this._values=m),B},J.prototype.return=function(B){return this._index>=0&&(this._index=-1,this._keys=m,this._values=m),{value:B,done:!0}},J}(),k=function(){function J(){this._keys=[],this._values=[],this._cacheKey=y,this._cacheIndex=-2}return Object.defineProperty(J.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),J.prototype.has=function(B){return this._find(B,!1)>=0},J.prototype.get=function(B){var I=this._find(B,!1);return I>=0?this._values[I]:void 0},J.prototype.set=function(B,I){var _=this._find(B,!0);return this._values[_]=I,this},J.prototype.delete=function(B){var I=this._find(B,!1);if(I>=0){for(var _=this._keys.length,V=I+1;V<_;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=y,this._cacheIndex=-2),!0}return!1},J.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=y,this._cacheIndex=-2},J.prototype.keys=function(){return new b(this._keys,this._values,$)},J.prototype.values=function(){return new b(this._keys,this._values,de)},J.prototype.entries=function(){return new b(this._keys,this._values,me)},J.prototype["@@iterator"]=function(){return this.entries()},J.prototype[a]=function(){return this.entries()},J.prototype._find=function(B,I){if(!D(this._cacheKey,B)){this._cacheIndex=-1;for(var _=0;_<this._keys.length;_++)if(D(this._keys[_],B)){this._cacheIndex=_;break}}return this._cacheIndex<0&&I&&(this._cacheIndex=this._keys.length,this._keys.push(B),this._values.push(void 0)),this._cacheIndex},J}();return k;function $(J,B){return J}function de(J,B){return B}function me(J,B){return[J,B]}}function Np(){var y=function(){function m(){this._map=new L}return Object.defineProperty(m.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),m.prototype.has=function(b){return this._map.has(b)},m.prototype.add=function(b){return this._map.set(b,b),this},m.prototype.delete=function(b){return this._map.delete(b)},m.prototype.clear=function(){this._map.clear()},m.prototype.keys=function(){return this._map.keys()},m.prototype.values=function(){return this._map.keys()},m.prototype.entries=function(){return this._map.entries()},m.prototype["@@iterator"]=function(){return this.keys()},m.prototype[a]=function(){return this.keys()},m}();return y}function Ip(){var y=16,m=g.create(),b=k();return function(){function B(){this._key=k()}return B.prototype.has=function(I){var _=$(I,!1);return _!==void 0?g.has(_,this._key):!1},B.prototype.get=function(I){var _=$(I,!1);return _!==void 0?g.get(_,this._key):void 0},B.prototype.set=function(I,_){var V=$(I,!0);return V[this._key]=_,this},B.prototype.delete=function(I){var _=$(I,!1);return _!==void 0?delete _[this._key]:!1},B.prototype.clear=function(){this._key=k()},B}();function k(){var B;do B="@@WeakMap@@"+J();while(g.has(m,B));return m[B]=!0,B}function $(B,I){if(!i.call(B,b)){if(!I)return;Object.defineProperty(B,b,{value:g.create()})}return B[b]}function de(B,I){for(var _=0;_<I;++_)B[_]=Math.random()*255|0;return B}function me(B){if(typeof Uint8Array=="function"){var I=new Uint8Array(B);return typeof crypto<"u"?crypto.getRandomValues(I):typeof msCrypto<"u"?msCrypto.getRandomValues(I):de(I,B),I}return de(new Array(B),B)}function J(){var B=me(y);B[6]=B[6]&79|64,B[8]=B[8]&191|128;for(var I="",_=0;_<y;++_){var V=B[_];(_===4||_===6||_===8)&&(I+="-"),V<16&&(I+="0"),I+=V.toString(16).toLowerCase()}return I}}function Ca(y){return y.__=void 0,delete y.__,y}})})(Ea||(Ea={}));/*!
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 zu="[object ArrayBuffer]";class C{static isArrayBuffer(e){return Object.prototype.toString.call(e)===zu}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 a of t)i+=a.byteLength;const n=new Uint8Array(i);let s=0;for(const a of t){const u=this.toUint8Array(a);n.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(n,e[e.length-1]):n.buffer}}const to="string",Ju=/^[0-9a-f\s]+$/i,Yu=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Zu=/^[a-zA-Z0-9-_]+$/;class Na{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 tt{static toString(e,t=!1){const i=C.toArrayBuffer(e),n=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const u=n.getUint16(a,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 T{static isHex(e){return typeof e===to&&Ju.test(e)}static isBase64(e){return typeof e===to&&Yu.test(e)}static isBase64Url(e){return typeof e===to&&Zu.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 tt.toString(i,!0);case"utf16":case"utf16be":return tt.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 tt.fromString(e,!0);case"utf16":case"utf16be":return tt.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(!T.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(!T.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=T.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return Na.fromString(e);case"utf16":case"utf16be":return tt.fromString(e);case"utf16le":case"usc2":return tt.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=T.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return Na.toString(e);case"utf16":case"utf16be":return tt.toString(e);case"utf16le":case"usc2":return tt.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 a=t[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!T.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 tt.toString(e,t)}static FromUtf16String(e,t=!1){return tt.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,""))||""}}T.DEFAULT_UTF8_ENCODING="utf8";function Qu(...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 Ia(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 nr(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 Dt(r,e,t=-1){const i=t;let n=r,s=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){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 d=new Uint8Array(f);for(let g=u-1;g>=0;g--){const h=Math.pow(2,g*e);d[s-g-1]=Math.floor(n/h),n-=d[s-g-1]*h}return f}a*=Math.pow(2,e)}return new ArrayBuffer(0)}function ro(...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 Oa(){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=nr(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,nr(s,8)-i}function Xu(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 a=t-e,u=Dt(a,8,i),f=new Uint8Array(u);return f[0]|=128,u}let n=Dt(e,8,i),s=new Uint8Array(n);if(s[0]&128){const a=n.slice(0),u=new Uint8Array(a);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let f=0;f<a.byteLength;f++)s[f+1]=u[f];s[0]=0}return n}t*=Math.pow(2,8)}return new ArrayBuffer(0)}function ef(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 Ue(r,e){const t=r.toString(10);if(e<t.length)return"";const i=e-t.length,n=new Array(i);for(let a=0;a<i;a++)n[a]="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 mi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function io(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 pt(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 bi{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return io(this.items)}}const Pr=[new Uint8Array([1])],Ta="0123456789",no="name",_a="valueHexView",tf="isHexOnly",rf="idBlock",nf="tagClass",of="tagNumber",sf="isConstructed",af="fromBER",cf="toBER",lf="local",Ve="",Ge=new ArrayBuffer(0),vi=new Uint8Array(0),Rr="EndOfContent",Va="OCTET STRING",ja="BIT STRING";function rt(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):vi}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!pt(this,a,n,s))return-1;const u=n+s;return this.valueHexView=a.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",Ge)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:T.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Mt{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=Ve,warnings:i=[],valueBeforeDecode:n=vi}={}){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:T.ToHex(this.valueBeforeDecodeView)}}}Mt.NAME="baseBlock";class Ne extends Mt{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'")}}Ne.NAME="valueBlock";class Pa extends rt(Mt){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):vi,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",Ge}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=Dt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let f=0;f<a-1;f++)u[f+1]=s[f]|128;u[a]=s[a-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(!pt(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,d=this.valueHexView=new Uint8Array(255),g=255;for(;s[f]&128;){if(d[f-1]=s[f]&127,f++,f>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(f===g){g+=255;const L=new Uint8Array(g);for(let ne=0;ne<d.length;ne++)L[ne]=d[ne];d=this.valueHexView=new Uint8Array(g)}}this.blockLength=f+1,d[f-1]=s[f]&127;const h=new Uint8Array(f);for(let L=0;L<f;L++)h[L]=d[L];d=this.valueHexView=new Uint8Array(f),d.set(h),this.blockLength<=9?this.tagNumber=nr(d,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}}}Pa.NAME="identificationBlock";class Ra extends Mt{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(!pt(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 a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+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+a);return f[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=nr(f,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+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=Dt(this.length,8);if(n.byteLength>127)return this.error="Too big length",Ge;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 a=0;a<n.byteLength;a++)i[a+1]=s[a];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}}}Ra.NAME="lengthBlock";const N={};class be extends Mt{constructor({name:e=Ve,optional:t=!1,primitiveSchema:i,...n}={},s){super(n),this.name=e,this.optional=t,i&&(this.primitiveSchema=i),this.idBlock=new Pa(n),this.lenBlock=new Ra(n),this.valueBlock=s?new s(n):new Ne(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 bi;t||Da(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 a=this.lenBlock.toBER(e);i.write(a),i.write(s)}return t?Ge: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():T.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,t=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 ef(t,i)}}be.NAME="BaseBlock";function Da(r){var e;if(r instanceof N.Constructed)for(const t of r.valueBlock.value)Da(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class oo extends be{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Ve,...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}'`}}oo.NAME="BaseStringBlock";class Ma extends rt(Ne){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}Ma.NAME="PrimitiveValueBlock";var Ua;class Dr extends be{constructor(e={}){super(e,Ma),this.idBlock.isConstructed=!1}}Ua=Dr,N.Primitive=Ua,Dr.NAME="PRIMITIVE";function uf(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 or(r,e=0,t=r.length){const i=e;let n=new be({},Ne);const s=new Mt;if(!pt(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=be;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 d=n.idBlock.isConstructed?new N.Constructed:new N.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:f=n.idBlock.isConstructed?N.Constructed:N.Primitive}return n=uf(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 sr(r){if(!r.byteLength){const e=new be({},Ne);return e.error="Input buffer has zero length",{offset:-1,result:e}}return or(C.toUint8Array(r).slice(),0,r.byteLength)}function ff(r,e){return r?1:e}class xt extends Ne{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(!pt(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(;ff(this.isIndefiniteForm,i)>0;){const a=or(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Rr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Rr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const i=t||new bi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(e,i);return t?Ge:i.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}xt.NAME="ConstructedValueBlock";var $a;class Ie extends be{constructor(e={}){super(e,xt),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} :`}}$a=Ie,N.Constructed=$a,Ie.NAME="CONSTRUCTED";class Ha extends Ne{fromBER(e,t,i){return t}toBER(e){return Ge}}Ha.override="EndOfContentValueBlock";var La;class so extends be{constructor(e={}){super(e,Ha),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}La=so,N.EndOfContent=La,so.NAME=Rr;var Fa;class Ut extends be{constructor(e={}){super(e,Ne),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}`}}Fa=Ut,N.Null=Fa,Ut.NAME="NULL";class qa extends rt(Ne){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 pt(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,Oa.call(this),this.blockLength=i,t+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}qa.NAME="BooleanValueBlock";var Ka;let wi=class extends be{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};Ka=wi,N.Boolean=Ka,wi.NAME="BOOLEAN";class Wa extends rt(xt){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=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Rr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Va)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?xt.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Wa.NAME="OctetStringValueBlock";var ao;let $t=class extends be{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},Wa),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 a=or(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(e,t,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ie.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,t=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 ao&&e.push(t.valueBlock.valueHexView);return C.concat(e)}};ao=$t,N.OctetString=ao,$t.NAME=Va;class Ga extends rt(xt){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=xt.prototype.fromBER.call(this,e,t,i),n===-1)return n;for(const u of this.value){const f=u.constructor.NAME;if(f===Rr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(f!==ja)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=u.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=C.toUint8Array(e);if(!pt(this,s,t,i))return-1;const a=s.subarray(t,t+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const u=a.subarray(1);try{if(u.byteLength){const f=or(u,0,u.byteLength);f.offset!==-1&&f.offset===i-1&&(this.value=[f.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,t+i}toBER(e,t){if(this.isConstructed)return xt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Ge;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}}}Ga.NAME="BitStringValueBlock";var za;let Ht=class extends be{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},Ga),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 Ie.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const a of t)e.push(a.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}`}}};za=Ht,N.BitString=za,Ht.NAME=ja;var Ja;function df(r,e){const t=new Uint8Array([0]),i=new Uint8Array(r),n=new Uint8Array(e);let s=i.slice(0);const a=s.length-1,u=n.slice(0),f=u.length-1;let d=0;const g=f<a?a:f;let h=0;for(let L=g;L>=0;L--,h++){switch(!0){case h<u.length:d=s[a-h]+u[f-h]+t[0];break;default:d=s[a-h]+t[0]}switch(t[0]=d/10,!0){case h>=s.length:s=ro(new Uint8Array([d%10]),s);break;default:s[a-h]=d%10}}return t[0]>0&&(s=ro(t,s)),s}function Ya(r){if(r>=Pr.length)for(let e=Pr.length;e<=r;e++){const t=new Uint8Array([0]);let i=Pr[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=ro(t,i)),Pr.push(i)}return Pr[r]}function pf(r,e){let t=0;const i=new Uint8Array(r),n=new Uint8Array(e),s=i.slice(0),a=s.length-1,u=n.slice(0),f=u.length-1;let d,g=0;for(let h=f;h>=0;h--,g++)switch(d=s[a-g]-u[f-g]-t,!0){case d<0:t=1,s[a-g]=d+10;break;default:t=0,s[a-g]=d}if(t>0)for(let h=a-f+1;h>=0;h--,g++)if(d=s[a-g]-t,d<0)t=1,s[a-g]=d+10;else{t=0,s[a-g]=d;break}return s.slice()}class co extends rt(Ne){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=Oa.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(Xu(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 a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-a.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 a="",u=!1;for(let f=s.byteLength-1;f>=0;f--){n=s[f];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case e:t=pf(Ya(i),t),a="-";break;default:t=df(t,Ya(i))}i++,n>>=1}}for(let f=0;f<t.length;f++)t[f]&&(u=!0),u&&(a+=Ta.charAt(t[f]));return u===!1&&(a+=Ta.charAt(0)),a}}Ja=co,co.NAME="IntegerValueBlock",Object.defineProperty(Ja.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Mr;class ar extends be{constructor(e={}){super(e,co),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return mi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){mi();const t=BigInt(e),i=new bi,n=t.toString(16).replace(/^-/,""),s=new Uint8Array(T.FromHex(n));if(t<0){const u=new Uint8Array(s.length+(s[0]&128?1:0));u[0]|=128;const d=BigInt(`0x${T.ToHex(u)}`)+t,g=C.toUint8Array(T.FromHex(d.toString(16)));g[0]|=128,i.write(g)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new Mr({valueHex:i.final()})}convertToDER(){const e=new Mr({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Mr({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Mr=ar,N.Integer=Mr,ar.NAME="INTEGER";var Za;class Si extends ar{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Za=Si,N.Enumerated=Za,Si.NAME="ENUMERATED";class lo extends rt(Ne){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(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=nr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){mi();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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Dt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ge;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i}toString(){let e="";if(this.isHexOnly)e=T.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}}}lo.NAME="sidBlock";class Qa extends Ne{constructor({value:e=Ve,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new lo;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,Ge;t.push(n)}return io(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 a=this.value[0];let u=0;switch(a.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;a.valueDec=f+u,s=!1}else{const a=new lo;if(n>Number.MAX_SAFE_INTEGER){mi();const u=BigInt(n);a.valueBigInt=u}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}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}}Qa.NAME="ObjectIdentifierValueBlock";var Xa;class Ai extends be{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,Qa),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Xa=Ai,N.ObjectIdentifier=Xa,Ai.NAME="OBJECT IDENTIFIER";class uo extends rt(Mt){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(!pt(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 a=new Uint8Array(this.blockLength);for(let u=0;u<this.blockLength;u++)a[u]=this.valueHexView[u];return this.valueHexView=a,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=nr(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 a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const t=Dt(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ge;const i=new Uint8Array(t.byteLength);if(!e){const n=new Uint8Array(t),s=t.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[s]}return i.buffer}toString(){let e="";return this.isHexOnly?e=T.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}uo.NAME="relativeSidBlock";class ec extends Ne{constructor({value:e=Ve,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,i){let n=t;for(;i>0;){const s=new uo;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,Ge;i.push(s)}return io(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 uo;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}}ec.NAME="RelativeObjectIdentifierValueBlock";var tc;class fo extends be{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,ec),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}tc=fo,N.RelativeObjectIdentifier=tc,fo.NAME="RelativeObjectIdentifier";var rc;class ze extends Ie{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}rc=ze,N.Sequence=rc,ze.NAME="SEQUENCE";var ic;let it=class extends Ie{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};ic=it,N.Set=ic,it.NAME="SET";class nc extends rt(Ne){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Ve}toJSON(){return{...super.toJSON(),value:this.value}}}nc.NAME="StringValueBlock";class oc extends nc{}oc.NAME="SimpleStringValueBlock";class $e extends oo{constructor({...e}={}){super(e,oc)}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}}$e.NAME="SIMPLE STRING";class sc extends $e{fromBuffer(e){this.valueBlock.valueHexView=C.toUint8Array(e);try{this.valueBlock.value=T.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=T.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(T.FromUtf8String(e)),this.valueBlock.value=e}}sc.NAME="Utf8StringValueBlock";var ac;class ht extends sc{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ac=ht,N.Utf8String=ac,ht.NAME="UTF8String";class cc extends $e{fromBuffer(e){this.valueBlock.value=T.ToUtf16String(e),this.valueBlock.valueHexView=C.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(T.FromUtf16String(e))}}cc.NAME="BmpStringValueBlock";var lc;class ki extends cc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}lc=ki,N.BmpString=lc,ki.NAME="BMPString";class uc extends $e{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=Dt(e.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const u=4-a.length;for(let f=a.length-1;f>=0;f--)i[n*4+f+u]=a[f]}this.valueBlock.value=e}}uc.NAME="UniversalStringValueBlock";var fc;class Ci extends uc{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}fc=Ci,N.UniversalString=fc,Ci.NAME="UniversalString";var dc;class xi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}dc=xi,N.NumericString=dc,xi.NAME="NumericString";var pc;class Bi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}pc=Bi,N.PrintableString=pc,Bi.NAME="PrintableString";var hc;class Ei extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}hc=Ei,N.TeletexString=hc,Ei.NAME="TeletexString";var yc;class Ni extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}yc=Ni,N.VideotexString=yc,Ni.NAME="VideotexString";var gc;class Ii extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}gc=Ii,N.IA5String=gc,Ii.NAME="IA5String";var mc;class Oi extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}mc=Oi,N.GraphicString=mc,Oi.NAME="GraphicString";var bc;class Ur extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}bc=Ur,N.VisibleString=bc,Ur.NAME="VisibleString";var vc;class Ti extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}vc=Ti,N.GeneralString=vc,Ti.NAME="GeneralString";var wc;class _i extends $e{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}wc=_i,N.CharacterString=wc,_i.NAME="CharacterString";var Sc;class $r extends Ur{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]=Ue(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=Ue(this.month,2),t[2]=Ue(this.day,2),t[3]=Ue(this.hour,2),t[4]=Ue(this.minute,2),t[5]=Ue(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}}}Sc=$r,N.UTCTime=Sc,$r.NAME="UTCTime";var Ac;class Vi extends $r{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,a,u=0,f=0;if(e[e.length-1]==="Z")i=e.substring(0,e.length-1),t=!0;else{const h=new Number(e[e.length-1]);if(isNaN(h.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 h=1,L=i.indexOf("+"),ne="";if(L===-1&&(L=i.indexOf("-"),h=-1),L!==-1){if(ne=i.substring(L+1),i=i.substring(0,L),ne.length!==2&&ne.length!==4)throw new Error("Wrong input string for conversion");let re=parseInt(ne.substring(0,2),10);if(isNaN(re.valueOf()))throw new Error("Wrong input string for conversion");if(u=h*re,ne.length===4){if(re=parseInt(ne.substring(2,4),10),isNaN(re.valueOf()))throw new Error("Wrong input string for conversion");f=h*re}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const h=new Number(`0${i.substring(d)}`);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");s=h.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.minute=Math.floor(h),h=60*(h-this.minute),this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let h=60*s;this.second=Math.floor(h),h=1e3*(h-this.second),this.millisecond=Math.floor(h)}break;case n.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const h=1e3*s;this.millisecond=Math.floor(h)}break;default:throw new Error("Wrong input string for conversion")}const g=a.exec(n);if(g===null)throw new Error("Wrong input string for conversion");for(let h=1;h<g.length;h++)switch(h){case 1:this.year=parseInt(g[h],10);break;case 2:this.month=parseInt(g[h],10);break;case 3:this.day=parseInt(g[h],10);break;case 4:this.hour=parseInt(g[h],10)+u;break;case 5:this.minute=parseInt(g[h],10)+f;break;case 6:this.second=parseInt(g[h],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const h=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=h.getUTCFullYear(),this.month=h.getUTCMonth(),this.day=h.getUTCDay(),this.hour=h.getUTCHours(),this.minute=h.getUTCMinutes(),this.second=h.getUTCSeconds(),this.millisecond=h.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(Ue(this.year,4)),t.push(Ue(this.month,2)),t.push(Ue(this.day,2)),t.push(Ue(this.hour,2)),t.push(Ue(this.minute,2)),t.push(Ue(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(Ue(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Ac=Vi,N.GeneralizedTime=Ac,Vi.NAME="GeneralizedTime";var kc;class po extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}kc=po,N.DATE=kc,po.NAME="DATE";var Cc;class ho extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Cc=ho,N.TimeOfDay=Cc,ho.NAME="TimeOfDay";var xc;class yo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}xc=yo,N.DateTime=xc,yo.NAME="DateTime";var Bc;class go extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Bc=go,N.Duration=Bc,go.NAME="Duration";var Ec;class mo extends ht{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Ec=mo,N.TIME=Ec,mo.NAME="TIME";class Lt{constructor({name:e=Ve,optional:t=!1}={}){this.name=e,this.optional=t}}class bo extends Lt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class ji extends Lt{constructor({value:e=new Lt,local:t=!1,...i}={}){super(i),this.value=e,this.local=t}}class hf{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=C.toUint8Array(e)}constructor({data:e=vi}={}){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 Bt(r,e,t){if(t instanceof bo){for(const s of t.value)if(Bt(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 Lt)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(!(rf in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(af in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(cf 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(nf)===!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(of)===!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(sf)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(tf 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(!(_a in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,a=e.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:r};for(let u=0;u<s.length;u++)if(s[u]!==a[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(r[t.name]=e)),t instanceof N.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},u=t.valueBlock.value.length;if(u>0&&t.valueBlock.value[0]instanceof ji&&(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 d=0;d<t.valueBlock.value.length;d++)f=f&&(t.valueBlock.value[d].optional||!1);return f?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),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 d={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,Ve),t.name&&(delete r[t.name],d.name=t.name)),d}}else if(t.valueBlock.value[0]instanceof ji){if(a=Bt(r,e.valueBlock.value[f],t.valueBlock.value[0].value),a.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&delete r[t.name]),a;if(no in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let d={};lf in t.valueBlock.value[0]&&t.valueBlock.value[0].local?d=e:d=r,typeof d[t.valueBlock.value[0].name]>"u"&&(d[t.valueBlock.value[0].name]=[]),d[t.valueBlock.value[0].name].push(e.valueBlock.value[f])}}else if(a=Bt(r,e.valueBlock.value[f-s],t.valueBlock.value[f]),a.verified===!1)if(t.valueBlock.value[f].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&delete r[t.name]),a;if(a.verified===!1){const f={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(delete r[t.name],f.name=t.name)),f}return{verified:!0,result:r}}if(t.primitiveSchema&&_a in e.valueBlock){const s=or(e.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ve),t.name&&(delete r[t.name],a.name=t.name)),a}return Bt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function yf(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=or(C.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Bt(t.result,t.result,e)}const Nc=Object.freeze(Object.defineProperty({__proto__:null,Any:Lt,BaseBlock:be,BaseStringBlock:oo,BitString:Ht,BmpString:ki,Boolean:wi,CharacterString:_i,Choice:bo,Constructed:Ie,DATE:po,DateTime:yo,Duration:go,EndOfContent:so,Enumerated:Si,GeneralString:Ti,GeneralizedTime:Vi,GraphicString:Oi,HexBlock:rt,IA5String:Ii,Integer:ar,Null:Ut,NumericString:xi,ObjectIdentifier:Ai,OctetString:$t,Primitive:Dr,PrintableString:Bi,RawData:hf,RelativeObjectIdentifier:fo,Repeated:ji,Sequence:ze,Set:it,TIME:mo,TeletexString:Ei,TimeOfDay:ho,UTCTime:$r,UniversalString:Ci,Utf8String:ht,ValueBlock:Ne,VideotexString:Ni,ViewWriter:bi,VisibleString:Ur,compareSchema:Bt,fromBER:sr,verifySchema:yf},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 p;(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"})(p||(p={}));class Pi{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 Ht))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 Ht({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ht({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 $t))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new $t({valueHex:this.buffer})}toSchema(e){return new $t({name:e})}}const gf={fromASN:r=>r instanceof Ut?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Ut;const e=sr(r);if(e.result.error)throw new Error(e.result.error);return e.result}},mf={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new ar({value:+r})},bf={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new Si({value:r})},le={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new ar({valueHex:r})},vf={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ht({valueHex:r})},wf={fromASN:r=>r.valueBlock.toString(),toASN:r=>new Ai({value:r})},Sf={fromASN:r=>r.valueBlock.value,toASN:r=>new wi({value:r})},Ri={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new $t({valueHex:r})},Af={fromASN:r=>new Q(r.getValue()),toASN:r=>r.toASN()};function qe(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const Ic=qe(ht),kf=qe(ki),Cf=qe(Ci),xf=qe(xi),Bf=qe(Bi),Ef=qe(Ei),Nf=qe(Ni),If=qe(Ii),Of=qe(Oi),Tf=qe(Ur),_f=qe(Ti),Vf=qe(_i),jf={fromASN:r=>r.toDate(),toASN:r=>new $r({valueDate:r})},Pf={fromASN:r=>r.toDate(),toASN:r=>new Vi({valueDate:r})},Rf={fromASN:()=>null,toASN:()=>new Ut};function Hr(r){switch(r){case p.Any:return gf;case p.BitString:return vf;case p.BmpString:return kf;case p.Boolean:return Sf;case p.CharacterString:return Vf;case p.Enumerated:return bf;case p.GeneralString:return _f;case p.GeneralizedTime:return Pf;case p.GraphicString:return Of;case p.IA5String:return If;case p.Integer:return mf;case p.Null:return Rf;case p.NumericString:return xf;case p.ObjectIdentifier:return wf;case p.OctetString:return Ri;case p.PrintableString:return Bf;case p.TeletexString:return Ef;case p.UTCTime:return jf;case p.UniversalString:return Cf;case p.Utf8String:return Ic;case p.VideotexString:return Nf;case p.VisibleString:return Tf;default:return null}}function yt(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:yt(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function Oc(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:Oc(t)}return!1}function Df(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 Mf{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 a=i.items[s],u=t?s:"";let f;if(typeof a.type=="number"){const g=p[a.type],h=Nc[g];if(!h)throw new Error(`Cannot get ASN1 class by name '${g}'`);f=new h({name:u})}else yt(a.type)?f=new a.type().toSchema(u):a.optional?this.get(a.type).type===v.Choice?f=new Lt({name:u}):(f=this.create(a.type,!1),f.name=u):f=new Lt({name:u});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){f.name="";const g=a.repeated==="set"?it:ze;f=new g({name:"",value:[new ji({name:u,value:f})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||yt(a.type)){const g=a.repeated?Ie:Dr;n.push(new g({name:u,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const g=!!a.repeated;let h=g?f:this.get(a.type,!0).schema;h="valueBlock"in h?h.valueBlock.value:h.value,n.push(new Ie({name:g?"":u,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:h}))}else n.push(new Ie({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[f]}));else f.optional=d,n.push(f)}switch(i.type){case v.Sequence:return new ze({value:n,name:""});case v.Set:return new it({value:n,name:""});case v.Choice:return new bo({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 he=new Mf,w=r=>e=>{let t;he.has(e)?t=he.get(e):(t=he.createDefault(e),he.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let i;he.has(e.constructor)?i=he.get(e.constructor):(i=he.createDefault(e.constructor),he.set(e.constructor,i));const n=Object.assign({},r);if(typeof n.type=="number"&&!n.converter){const s=Hr(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);n.converter=s}i.items[t]=n};class Lr extends Error{constructor(){super(...arguments),this.schemas=[]}}class Uf{static parse(e,t){const i=sr(e);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,t)}static fromASN(e,t){try{if(yt(t))return new t().fromASN(e);const i=he.get(t);he.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 a=this.handleSequenceTypes(e,i,t,n);if(a&&"isManualMapping"in a)return a.result;const u=a,f=new t;return Oc(t)?this.handleArrayTypes(e,i,t):(this.processSchemaItems(i,u,f),f)}catch(i){throw i instanceof Lr&&i.schemas.push(t.name),i}}static handleChoiceTypes(e,t,i,n){if(e.constructor===Ie&&t.type===v.Choice&&e.idBlock.tagClass===3)for(const s in t.items){const a=t.items[s];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&he.has(a.type)){const u=he.get(a.type);if(u&&u.type===v.Sequence){const f=new ze;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in f.valueBlock){f.valueBlock.value=e.valueBlock.value;const d=this.fromASN(f,a.type),g=new i;return g[s]=d,{result:g}}}}}else if(e.constructor===Ie&&t.type!==v.Choice){const s=new Ie({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:t.schema.valueBlock.value});for(const a in t.items)delete e[a];return{targetSchema:s}}return null}static handleSequenceTypes(e,t,i,n){if(t.type===v.Sequence){if(Object.keys(t.items).filter(u=>{const f=t.items[u];return f.optional&&typeof f.type=="function"&&he.has(f.type)&&he.get(f.type).type===v.Choice}).length>0&&"value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&i.name==="CertReqMsg")return this.handleManualMapping(e,t,i);const a=Bt({},e,n);if(!a.verified)throw new Lr(`Data does not match to ${i.name} ASN1 schema. ${a.result.error}`);return a}else{const s=Bt({},e,n);if(!s.verified)throw new Lr(`Data does not match to ${i.name} ASN1 schema. ${s.result.error}`);return s}}static handleManualMapping(e,t,i){const n=new i,s=e.valueBlock.value,a=Object.keys(t.items);let u=0;for(let f=0;f<a.length;f++){const d=a[f],g=t.items[d];if(u>=s.length)break;if(g.repeated){n[d]=this.processRepeatedField(s,u,g);break}else if(typeof g.type=="number")n[d]=this.processPrimitiveField(s[u],g),u++;else if(this.isOptionalChoiceField(g)){const h=this.processOptionalChoiceField(s[u],g);h.processed&&(n[d]=h.value,u++)}else n[d]=this.fromASN(s[u],g.type),u++}return{result:n,verified:!0,isManualMapping:!0}}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=Hr(i.type);if(!s)throw new Error(`No converter for ASN.1 type ${i.type}`);return n.filter(a=>a&&a.valueBlock).map(a=>{try{return s.fromASN(a)}catch{return}}).filter(a=>a!==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=Hr(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"&&he.has(e.type)&&he.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 Lr&&/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=Hr(n);if(!s)throw new Error(`Cannot get default converter for array item of ${i.name} ASN1 schema`);return i.from(e.valueBlock.value,a=>s.fromASN(a))}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 a=e.items[n],u=a.type;typeof u=="number"||yt(u)?i[n]=this.processPrimitiveSchemaItem(s,a,u):i[n]=this.processComplexSchemaItem(s,a,u)}}static processPrimitiveSchemaItem(e,t,i){var n;const s=(n=t.converter)!==null&&n!==void 0?n:yt(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"?ze:it,s=new n;s.valueBlock=e.valueBlock;const a=sr(s.toBER(!1));if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const u=a.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 a;if(yt(i))a=new i().toSchema("");else{const u=p[i],f=Nc[u];if(!f)throw new Error(`Cannot get '${u}' class from asn1js module`);a=new f}a.valueBlock=s.valueBlock,s=sr(a.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 Lr&&/Wrong values for Choice type/.test(s.message))return;throw s}else return this.fromASN(n,i)}}static handleImplicitTagging(e,t,i){if(t.implicit&&typeof t.context=="number"){const n=he.get(i);if(n.type===v.Sequence){const s=new ze;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 it;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 vo{static serialize(e){return e instanceof be?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&yt(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,i=he.get(t);he.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 a=Hr(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);n=e.map(u=>a.toASN(u))}else n=e.map(a=>this.toAsnItem({type:i.itemType},"[]",t,a))}else for(const a in i.items){const u=i.items[a],f=e[a];if(f===void 0||u.defaultValue===f||typeof u.defaultValue=="object"&&typeof f=="object"&&Df(this.serialize(u.defaultValue),this.serialize(f)))continue;const d=vo.toAsnItem(u,a,t,f);if(typeof u.context=="number")if(u.implicit)if(!u.repeated&&(typeof u.type=="number"||yt(u.type))){const g={};g.valueHex=d instanceof Ut?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Dr({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},...g}))}else n.push(new Ie({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:d.valueBlock.value}));else n.push(new Ie({optional:u.optional,idBlock:{tagClass:3,tagNumber:u.context},value:[d]}));else u.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case v.Sequence:s=new ze({value:n});break;case v.Set:s=new it({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 a=e.converter;if(!a)throw new Error(`Property '${t}' doesn't have converter for type ${p[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,d=>a.toASN(d)),f=e.repeated==="sequence"?ze:it;s=new f({value:u})}else s=a.toASN(n)}else if(e.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,f=>this.toASN(f)),u=e.repeated==="sequence"?ze:it;s=new u({value:a})}else s=this.toASN(n);return s}}class te 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 vo.serialize(e)}static parse(e,t){return Uf.parse(e,t)}static toString(e){const t=C.isBufferSource(e)?C.toArrayBuffer(e):x.serialize(e),i=sr(t);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function c(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;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--)(a=r[u])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;class Tc{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 a=parseInt(s,16);if(isNaN(a)||a<0||a>65535)throw new Error("Invalid IPv6 address part");return n.push(a>>8&255),n.push(a&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,a=0;for(let u=0;u<t.length;u++)t[u]==="0"?(s===-1&&(s=u),a++):(a>n&&(i=s,n=a),s=-1,a=0);if(a>n&&(i=s,n=a),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,d)=>f+(d.toString(2).match(/1/g)||[]).length,0);return t.length===8?`${Array.from(n).join(".")}/${u}`:`${this.formatIPv6(n)}/${u}`}return this.decodeIP(T.ToHex(e))}static fromString(e){if(e.includes("/")){const[i,n]=this.parseCIDR(e),s=new Uint8Array(i.length);let a=n;for(let f=0;f<s.length;f++)a>=8?(s[f]=255,a-=8):a>0&&(s[f]=255<<8-a,a=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 wo,So,Ao;let ve=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};c([l({type:p.TeletexString})],ve.prototype,"teletexString",void 0),c([l({type:p.PrintableString})],ve.prototype,"printableString",void 0),c([l({type:p.UniversalString})],ve.prototype,"universalString",void 0),c([l({type:p.Utf8String})],ve.prototype,"utf8String",void 0),c([l({type:p.BmpString})],ve.prototype,"bmpString",void 0),ve=c([w({type:v.Choice})],ve);let cr=class extends ve{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?T.ToHex(this.anyValue):super.toString())}};c([l({type:p.IA5String})],cr.prototype,"ia5String",void 0),c([l({type:p.Any})],cr.prototype,"anyValue",void 0),cr=c([w({type:v.Choice})],cr);class Di{constructor(e={}){this.type="",this.value=new cr,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Di.prototype,"type",void 0),c([l({type:cr})],Di.prototype,"value",void 0);let lr=wo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};lr=wo=c([w({type:v.Set,itemType:Di})],lr);let ko=So=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,So.prototype)}};ko=So=c([w({type:v.Sequence,itemType:lr})],ko);let ye=Ao=class extends ko{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};ye=Ao=c([w({type:v.Sequence})],ye);const $f={fromASN:r=>Tc.toString(Ri.fromASN(r)),toASN:r=>Ri.toASN(Tc.fromString(r))};class Fr{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Fr.prototype,"typeId",void 0),c([l({type:p.Any,context:0})],Fr.prototype,"value",void 0);class Co{constructor(e={}){this.partyName=new ve,Object.assign(this,e)}}c([l({type:ve,optional:!0,context:0,implicit:!0})],Co.prototype,"nameAssigner",void 0),c([l({type:ve,context:1,implicit:!0})],Co.prototype,"partyName",void 0);let q=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Fr,context:0,implicit:!0})],q.prototype,"otherName",void 0),c([l({type:p.IA5String,context:1,implicit:!0})],q.prototype,"rfc822Name",void 0),c([l({type:p.IA5String,context:2,implicit:!0})],q.prototype,"dNSName",void 0),c([l({type:p.Any,context:3,implicit:!0})],q.prototype,"x400Address",void 0),c([l({type:ye,context:4,implicit:!1})],q.prototype,"directoryName",void 0),c([l({type:Co,context:5})],q.prototype,"ediPartyName",void 0),c([l({type:p.IA5String,context:6,implicit:!0})],q.prototype,"uniformResourceIdentifier",void 0),c([l({type:p.OctetString,context:7,implicit:!0,converter:$f})],q.prototype,"iPAddress",void 0),c([l({type:p.ObjectIdentifier,context:8,implicit:!0})],q.prototype,"registeredID",void 0),q=c([w({type:v.Choice})],q);const xo="1.3.6.1.5.5.7",Hf=`${xo}.1`,ur=`${xo}.3`,Mi=`${xo}.48`,_c=`${Mi}.1`,Vc=`${Mi}.2`,jc=`${Mi}.3`,Pc=`${Mi}.5`,gt="2.5.29";var Bo;const Eo=`${Hf}.1`;class qr{constructor(e={}){this.accessMethod="",this.accessLocation=new q,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],qr.prototype,"accessMethod",void 0),c([l({type:q})],qr.prototype,"accessLocation",void 0);let fr=Bo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Bo.prototype)}};fr=Bo=c([w({type:v.Sequence,itemType:qr})],fr);const No=`${gt}.35`;class Io extends Q{}class Ft{constructor(e={}){e&&Object.assign(this,e)}}c([l({type:Io,context:0,optional:!0,implicit:!0})],Ft.prototype,"keyIdentifier",void 0),c([l({type:q,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ft.prototype,"authorityCertIssuer",void 0),c([l({type:p.Integer,context:2,optional:!0,implicit:!0,converter:le})],Ft.prototype,"authorityCertSerialNumber",void 0);const Rc=`${gt}.19`;class Ui{constructor(e={}){this.cA=!1,Object.assign(this,e)}}c([l({type:p.Boolean,defaultValue:!1})],Ui.prototype,"cA",void 0),c([l({type:p.Integer,optional:!0})],Ui.prototype,"pathLenConstraint",void 0);var Oo;let xe=Oo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Oo.prototype)}};xe=Oo=c([w({type:v.Sequence,itemType:q})],xe);var To;let Dc=To=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Dc=To=c([w({type:v.Sequence})],Dc);var _o;const Mc=`${gt}.32`;let mt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};c([l({type:p.IA5String})],mt.prototype,"ia5String",void 0),c([l({type:p.VisibleString})],mt.prototype,"visibleString",void 0),c([l({type:p.BmpString})],mt.prototype,"bmpString",void 0),c([l({type:p.Utf8String})],mt.prototype,"utf8String",void 0),mt=c([w({type:v.Choice})],mt);class Vo{constructor(e={}){this.organization=new mt,this.noticeNumbers=[],Object.assign(this,e)}}c([l({type:mt})],Vo.prototype,"organization",void 0),c([l({type:p.Integer,repeated:"sequence"})],Vo.prototype,"noticeNumbers",void 0);class jo{constructor(e={}){Object.assign(this,e)}}c([l({type:Vo,optional:!0})],jo.prototype,"noticeRef",void 0),c([l({type:mt,optional:!0})],jo.prototype,"explicitText",void 0);let $i=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.IA5String})],$i.prototype,"cPSuri",void 0),c([l({type:jo})],$i.prototype,"userNotice",void 0),$i=c([w({type:v.Choice})],$i);class Po{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Po.prototype,"policyQualifierId",void 0),c([l({type:p.Any})],Po.prototype,"qualifier",void 0);class Hi{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Hi.prototype,"policyIdentifier",void 0),c([l({type:Po,repeated:"sequence",optional:!0})],Hi.prototype,"policyQualifiers",void 0);let Li=_o=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,_o.prototype)}};Li=_o=c([w({type:v.Sequence,itemType:Hi})],Li);let Fi=class{constructor(e=0){this.value=e}};c([l({type:p.Integer})],Fi.prototype,"value",void 0),Fi=c([w({type:v.Choice})],Fi);let Uc=class extends Fi{};Uc=c([w({type:v.Choice})],Uc);var Ro;const Do=`${gt}.31`;var Je;(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"})(Je||(Je={}));class $c extends Pi{toJSON(){const e=[],t=this.toNumber();return t&Je.aACompromise&&e.push("aACompromise"),t&Je.affiliationChanged&&e.push("affiliationChanged"),t&Je.cACompromise&&e.push("cACompromise"),t&Je.certificateHold&&e.push("certificateHold"),t&Je.cessationOfOperation&&e.push("cessationOfOperation"),t&Je.keyCompromise&&e.push("keyCompromise"),t&Je.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&Je.superseded&&e.push("superseded"),t&Je.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let qt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:q,context:0,repeated:"sequence",implicit:!0})],qt.prototype,"fullName",void 0),c([l({type:lr,context:1,implicit:!0})],qt.prototype,"nameRelativeToCRLIssuer",void 0),qt=c([w({type:v.Choice})],qt);class dr{constructor(e={}){Object.assign(this,e)}}c([l({type:qt,context:0,optional:!0})],dr.prototype,"distributionPoint",void 0),c([l({type:$c,context:1,optional:!0,implicit:!0})],dr.prototype,"reasons",void 0),c([l({type:q,context:2,optional:!0,repeated:"sequence",implicit:!0})],dr.prototype,"cRLIssuer",void 0);let pr=Ro=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};pr=Ro=c([w({type:v.Sequence,itemType:dr})],pr);var Mo;let Hc=Mo=class extends pr{constructor(e){super(e),Object.setPrototypeOf(this,Mo.prototype)}};Hc=Mo=c([w({type:v.Sequence,itemType:dr})],Hc);class Be{constructor(e={}){this.onlyContainsUserCerts=Be.ONLY,this.onlyContainsCACerts=Be.ONLY,this.indirectCRL=Be.ONLY,this.onlyContainsAttributeCerts=Be.ONLY,Object.assign(this,e)}}Be.ONLY=!1,c([l({type:qt,context:0,optional:!0})],Be.prototype,"distributionPoint",void 0),c([l({type:p.Boolean,context:1,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"onlyContainsUserCerts",void 0),c([l({type:p.Boolean,context:2,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"onlyContainsCACerts",void 0),c([l({type:$c,context:3,optional:!0,implicit:!0})],Be.prototype,"onlySomeReasons",void 0),c([l({type:p.Boolean,context:4,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"indirectCRL",void 0),c([l({type:p.Boolean,context:5,defaultValue:Be.ONLY,implicit:!0})],Be.prototype,"onlyContainsAttributeCerts",void 0);var Kr;(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"})(Kr||(Kr={}));let Uo=class{constructor(e=Kr.unspecified){this.reason=Kr.unspecified,this.reason=e}toJSON(){return Kr[this.reason]}toString(){return this.toJSON()}};c([l({type:p.Enumerated})],Uo.prototype,"reason",void 0),Uo=c([w({type:v.Choice})],Uo);var $o;const Lc=`${gt}.37`;let qi=$o=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,$o.prototype)}};qi=$o=c([w({type:v.Sequence,itemType:p.ObjectIdentifier})],qi);const Lf=`${ur}.1`,Ff=`${ur}.2`,qf=`${ur}.3`,Kf=`${ur}.4`,Wf=`${ur}.8`,Gf=`${ur}.9`;let Ho=class{constructor(e=new ArrayBuffer(0)){this.value=e}};c([l({type:p.Integer,converter:le})],Ho.prototype,"value",void 0),Ho=c([w({type:v.Choice})],Ho);let Lo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};c([l({type:p.GeneralizedTime})],Lo.prototype,"value",void 0),Lo=c([w({type:v.Choice})],Lo);var Fo;const Fc=`${gt}.18`;let qc=Fo=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,Fo.prototype)}};qc=Fo=c([w({type:v.Sequence})],qc);const Kc=`${gt}.15`;var Ye;(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"})(Ye||(Ye={}));class qo extends Pi{toJSON(){const e=this.toNumber(),t=[];return e&Ye.cRLSign&&t.push("crlSign"),e&Ye.dataEncipherment&&t.push("dataEncipherment"),e&Ye.decipherOnly&&t.push("decipherOnly"),e&Ye.digitalSignature&&t.push("digitalSignature"),e&Ye.encipherOnly&&t.push("encipherOnly"),e&Ye.keyAgreement&&t.push("keyAgreement"),e&Ye.keyCertSign&&t.push("keyCertSign"),e&Ye.keyEncipherment&&t.push("keyEncipherment"),e&Ye.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var Ko;class Ki{constructor(e={}){this.base=new q,this.minimum=0,Object.assign(this,e)}}c([l({type:q})],Ki.prototype,"base",void 0),c([l({type:p.Integer,context:0,defaultValue:0,implicit:!0})],Ki.prototype,"minimum",void 0),c([l({type:p.Integer,context:1,optional:!0,implicit:!0})],Ki.prototype,"maximum",void 0);let Wi=Ko=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ko.prototype)}};Wi=Ko=c([w({type:v.Sequence,itemType:Ki})],Wi);class Wc{constructor(e={}){Object.assign(this,e)}}c([l({type:Wi,context:0,optional:!0,implicit:!0})],Wc.prototype,"permittedSubtrees",void 0),c([l({type:Wi,context:1,optional:!0,implicit:!0})],Wc.prototype,"excludedSubtrees",void 0);class Gc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.Integer,context:0,implicit:!0,optional:!0,converter:le})],Gc.prototype,"requireExplicitPolicy",void 0),c([l({type:p.Integer,context:1,implicit:!0,optional:!0,converter:le})],Gc.prototype,"inhibitPolicyMapping",void 0);var Wo;class Go{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Go.prototype,"issuerDomainPolicy",void 0),c([l({type:p.ObjectIdentifier})],Go.prototype,"subjectDomainPolicy",void 0);let zc=Wo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Wo.prototype)}};zc=Wo=c([w({type:v.Sequence,itemType:Go})],zc);var zo;const Jc=`${gt}.17`;let Jo=zo=class extends xe{constructor(e){super(e),Object.setPrototypeOf(this,zo.prototype)}};Jo=zo=c([w({type:v.Sequence})],Jo);let bt=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],bt.prototype,"type",void 0),c([l({type:p.Any,repeated:"set"})],bt.prototype,"values",void 0);var Yo;let Yc=Yo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Yc=Yo=c([w({type:v.Sequence,itemType:bt})],Yc);const Zc=`${gt}.14`;class Et extends Io{}class Qc{constructor(e={}){Object.assign(this,e)}}c([l({type:p.GeneralizedTime,context:0,implicit:!0,optional:!0})],Qc.prototype,"notBefore",void 0),c([l({type:p.GeneralizedTime,context:1,implicit:!0,optional:!0})],Qc.prototype,"notAfter",void 0);var Wr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(Wr||(Wr={}));class Xc extends Pi{toJSON(){const e=[],t=this.toNumber();return t&Wr.pKIXCertificate&&e.push("pKIXCertificate"),t&Wr.newExtensions&&e.push("newExtensions"),t&Wr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class el{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Xc,Object.assign(this,e)}}c([l({type:p.GeneralString})],el.prototype,"entrustVers",void 0),c([l({type:Xc})],el.prototype,"entrustInfoFlags",void 0);var Zo;let tl=Zo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Zo.prototype)}};tl=Zo=c([w({type:v.Sequence,itemType:qr})],tl);class E{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof E&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Ia(e.parameters,this.parameters)||e.parameters===this.parameters)}}c([l({type:p.ObjectIdentifier})],E.prototype,"algorithm",void 0),c([l({type:p.Any,optional:!0})],E.prototype,"parameters",void 0);class nt{constructor(e={}){this.algorithm=new E,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:E})],nt.prototype,"algorithm",void 0),c([l({type:p.BitString})],nt.prototype,"subjectPublicKey",void 0);let we=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}};c([l({type:p.UTCTime})],we.prototype,"utcTime",void 0),c([l({type:p.GeneralizedTime})],we.prototype,"generalTime",void 0),we=c([w({type:v.Choice})],we);class Gi{constructor(e){this.notBefore=new we(new Date),this.notAfter=new we(new Date),e&&(this.notBefore=new we(e.notBefore),this.notAfter=new we(e.notAfter))}}c([l({type:we})],Gi.prototype,"notBefore",void 0),c([l({type:we})],Gi.prototype,"notAfter",void 0);var Qo;let Ze=class Gu{constructor(e={}){this.extnID="",this.critical=Gu.CRITICAL,this.extnValue=new Q,Object.assign(this,e)}};Ze.CRITICAL=!1,c([l({type:p.ObjectIdentifier})],Ze.prototype,"extnID",void 0),c([l({type:p.Boolean,defaultValue:Ze.CRITICAL})],Ze.prototype,"critical",void 0),c([l({type:Q})],Ze.prototype,"extnValue",void 0);let Kt=Qo=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Qo.prototype)}};Kt=Qo=c([w({type:v.Sequence,itemType:Ze})],Kt);var hr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(hr||(hr={}));class Ke{constructor(e={}){this.version=hr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new E,this.issuer=new ye,this.validity=new Gi,this.subject=new ye,this.subjectPublicKeyInfo=new nt,Object.assign(this,e)}}c([l({type:p.Integer,context:0,defaultValue:hr.v1})],Ke.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],Ke.prototype,"serialNumber",void 0),c([l({type:E})],Ke.prototype,"signature",void 0),c([l({type:ye})],Ke.prototype,"issuer",void 0),c([l({type:Gi})],Ke.prototype,"validity",void 0),c([l({type:ye})],Ke.prototype,"subject",void 0),c([l({type:nt})],Ke.prototype,"subjectPublicKeyInfo",void 0),c([l({type:p.BitString,context:1,implicit:!0,optional:!0})],Ke.prototype,"issuerUniqueID",void 0),c([l({type:p.BitString,context:2,implicit:!0,optional:!0})],Ke.prototype,"subjectUniqueID",void 0),c([l({type:Kt,context:3,optional:!0})],Ke.prototype,"extensions",void 0);class yr{constructor(e={}){this.tbsCertificate=new Ke,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Ke})],yr.prototype,"tbsCertificate",void 0),c([l({type:E})],yr.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],yr.prototype,"signatureValue",void 0);class zi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new we,Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],zi.prototype,"userCertificate",void 0),c([l({type:we})],zi.prototype,"revocationDate",void 0),c([l({type:Ze,optional:!0,repeated:"sequence"})],zi.prototype,"crlEntryExtensions",void 0);class vt{constructor(e={}){this.signature=new E,this.issuer=new ye,this.thisUpdate=new we,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],vt.prototype,"version",void 0),c([l({type:E})],vt.prototype,"signature",void 0),c([l({type:ye})],vt.prototype,"issuer",void 0),c([l({type:we})],vt.prototype,"thisUpdate",void 0),c([l({type:we,optional:!0})],vt.prototype,"nextUpdate",void 0),c([l({type:zi,repeated:"sequence",optional:!0})],vt.prototype,"revokedCertificates",void 0),c([l({type:Ze,optional:!0,context:0,repeated:"sequence"})],vt.prototype,"crlExtensions",void 0);let Xo=class{constructor(e={}){this.tbsCertList=new vt,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};c([l({type:vt})],Xo.prototype,"tbsCertList",void 0),c([l({type:E})],Xo.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],Xo.prototype,"signature",void 0);class gr{constructor(e={}){this.issuer=new ye,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:ye})],gr.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],gr.prototype,"serialNumber",void 0);let mr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0})],mr.prototype,"subjectKeyIdentifier",void 0),c([l({type:gr})],mr.prototype,"issuerAndSerialNumber",void 0),mr=c([w({type:v.Choice})],mr);var wt;(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"})(wt||(wt={}));let Gr=class extends E{};Gr=c([w({type:v.Sequence})],Gr);let Ji=class extends E{};Ji=c([w({type:v.Sequence})],Ji);let ot=class extends E{};ot=c([w({type:v.Sequence})],ot);let Yi=class extends E{};Yi=c([w({type:v.Sequence})],Yi);let rl=class extends E{};rl=c([w({type:v.Sequence})],rl);let es=class extends E{};es=c([w({type:v.Sequence})],es);let br=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],br.prototype,"attrType",void 0),c([l({type:p.Any,repeated:"set"})],br.prototype,"attrValues",void 0);var ts;class st{constructor(e={}){this.version=wt.v0,this.sid=new mr,this.digestAlgorithm=new Gr,this.signatureAlgorithm=new Ji,this.signature=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],st.prototype,"version",void 0),c([l({type:mr})],st.prototype,"sid",void 0),c([l({type:Gr})],st.prototype,"digestAlgorithm",void 0),c([l({type:br,repeated:"set",context:0,implicit:!0,optional:!0})],st.prototype,"signedAttrs",void 0),c([l({type:Ji})],st.prototype,"signatureAlgorithm",void 0),c([l({type:Q})],st.prototype,"signature",void 0),c([l({type:br,repeated:"set",context:1,implicit:!0,optional:!0})],st.prototype,"unsignedAttrs",void 0);let Zi=ts=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};Zi=ts=c([w({type:v.Set,itemType:st})],Zi);let il=class extends we{};il=c([w({type:v.Choice})],il);let nl=class extends st{};nl=c([w({type:v.Sequence})],nl);class rs{constructor(e={}){this.acIssuer=new q,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}c([l({type:q})],rs.prototype,"acIssuer",void 0),c([l({type:p.Integer})],rs.prototype,"acSerial",void 0),c([l({type:bt,repeated:"sequence"})],rs.prototype,"attrs",void 0);var is;let Qi=is=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,is.prototype)}};Qi=is=c([w({type:v.Sequence,itemType:p.ObjectIdentifier})],Qi);class Xi{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}c([l({type:p.Integer,optional:!0})],Xi.prototype,"pathLenConstraint",void 0),c([l({type:Qi,implicit:!0,context:0,optional:!0})],Xi.prototype,"permittedAttrs",void 0),c([l({type:Qi,implicit:!0,context:1,optional:!0})],Xi.prototype,"excludedAttrs",void 0),c([l({type:p.Boolean,defaultValue:!0})],Xi.prototype,"permitUnSpecified",void 0);class Wt{constructor(e={}){this.issuer=new xe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:xe})],Wt.prototype,"issuer",void 0),c([l({type:p.Integer,converter:le})],Wt.prototype,"serial",void 0),c([l({type:p.BitString,optional:!0})],Wt.prototype,"issuerUID",void 0);var ns;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(ns||(ns={}));class Gt{constructor(e={}){this.digestedObjectType=ns.publicKey,this.digestAlgorithm=new E,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Enumerated})],Gt.prototype,"digestedObjectType",void 0),c([l({type:p.ObjectIdentifier,optional:!0})],Gt.prototype,"otherObjectTypeID",void 0),c([l({type:E})],Gt.prototype,"digestAlgorithm",void 0),c([l({type:p.BitString})],Gt.prototype,"objectDigest",void 0);class en{constructor(e={}){Object.assign(this,e)}}c([l({type:xe,optional:!0})],en.prototype,"issuerName",void 0),c([l({type:Wt,context:0,implicit:!0,optional:!0})],en.prototype,"baseCertificateID",void 0),c([l({type:Gt,context:1,implicit:!0,optional:!0})],en.prototype,"objectDigestInfo",void 0);let vr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:q,repeated:"sequence"})],vr.prototype,"v1Form",void 0),c([l({type:en,context:0,implicit:!0})],vr.prototype,"v2Form",void 0),vr=c([w({type:v.Choice})],vr);class tn{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}c([l({type:p.GeneralizedTime})],tn.prototype,"notBeforeTime",void 0),c([l({type:p.GeneralizedTime})],tn.prototype,"notAfterTime",void 0);class zr{constructor(e={}){Object.assign(this,e)}}c([l({type:Wt,implicit:!0,context:0,optional:!0})],zr.prototype,"baseCertificateID",void 0),c([l({type:xe,implicit:!0,context:1,optional:!0})],zr.prototype,"entityName",void 0),c([l({type:Gt,implicit:!0,context:2,optional:!0})],zr.prototype,"objectDigestInfo",void 0);var os;(function(r){r[r.v2=1]="v2"})(os||(os={}));class Qe{constructor(e={}){this.version=os.v2,this.holder=new zr,this.issuer=new vr,this.signature=new E,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new tn,this.attributes=[],Object.assign(this,e)}}c([l({type:p.Integer})],Qe.prototype,"version",void 0),c([l({type:zr})],Qe.prototype,"holder",void 0),c([l({type:vr})],Qe.prototype,"issuer",void 0),c([l({type:E})],Qe.prototype,"signature",void 0),c([l({type:p.Integer,converter:le})],Qe.prototype,"serialNumber",void 0),c([l({type:tn})],Qe.prototype,"attrCertValidityPeriod",void 0),c([l({type:bt,repeated:"sequence"})],Qe.prototype,"attributes",void 0),c([l({type:p.BitString,optional:!0})],Qe.prototype,"issuerUniqueID",void 0),c([l({type:Kt,optional:!0})],Qe.prototype,"extensions",void 0);class rn{constructor(e={}){this.acinfo=new Qe,this.signatureAlgorithm=new E,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Qe})],rn.prototype,"acinfo",void 0),c([l({type:E})],rn.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],rn.prototype,"signatureValue",void 0);var nn;(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"})(nn||(nn={}));class ss extends Pi{}class as{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier,implicit:!0,context:0})],as.prototype,"type",void 0),c([l({type:p.Any,implicit:!0,context:1})],as.prototype,"value",void 0);class cs{constructor(e={}){this.policyId="",this.classList=new ss(nn.unclassified),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],cs.prototype,"policyId",void 0),c([l({type:ss,defaultValue:new ss(nn.unclassified)})],cs.prototype,"classList",void 0),c([l({type:as,repeated:"set"})],cs.prototype,"securityCategories",void 0);class on{constructor(e={}){Object.assign(this,e)}}c([l({type:Q})],on.prototype,"cotets",void 0),c([l({type:p.ObjectIdentifier})],on.prototype,"oid",void 0),c([l({type:p.Utf8String})],on.prototype,"string",void 0);class ol{constructor(e={}){this.values=[],Object.assign(this,e)}}c([l({type:xe,implicit:!0,context:0,optional:!0})],ol.prototype,"policyAuthority",void 0),c([l({type:on,repeated:"sequence"})],ol.prototype,"values",void 0);var ls;class sn{constructor(e={}){this.targetCertificate=new Wt,Object.assign(this,e)}}c([l({type:Wt})],sn.prototype,"targetCertificate",void 0),c([l({type:q,optional:!0})],sn.prototype,"targetName",void 0),c([l({type:Gt,optional:!0})],sn.prototype,"certDigestInfo",void 0);let wr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:q,context:0,implicit:!0})],wr.prototype,"targetName",void 0),c([l({type:q,context:1,implicit:!0})],wr.prototype,"targetGroup",void 0),c([l({type:sn,context:2,implicit:!0})],wr.prototype,"targetCert",void 0),wr=c([w({type:v.Choice})],wr);let us=ls=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};us=ls=c([w({type:v.Sequence,itemType:wr})],us);var fs;let sl=fs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,fs.prototype)}};sl=fs=c([w({type:v.Sequence,itemType:us})],sl);class al{constructor(e={}){Object.assign(this,e)}}c([l({type:xe,implicit:!0,context:0,optional:!0})],al.prototype,"roleAuthority",void 0),c([l({type:q,implicit:!0,context:1})],al.prototype,"roleName",void 0);class ds{constructor(e={}){this.service=new q,this.ident=new q,Object.assign(this,e)}}c([l({type:q})],ds.prototype,"service",void 0),c([l({type:q})],ds.prototype,"ident",void 0),c([l({type:Q,optional:!0})],ds.prototype,"authInfo",void 0);var ps;class hs{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],hs.prototype,"otherCertFormat",void 0),c([l({type:p.Any})],hs.prototype,"otherCert",void 0);let Sr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:yr})],Sr.prototype,"certificate",void 0),c([l({type:rn,context:2,implicit:!0})],Sr.prototype,"v2AttrCert",void 0),c([l({type:hs,context:3,implicit:!0})],Sr.prototype,"other",void 0),Sr=c([w({type:v.Choice})],Sr);let an=ps=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ps.prototype)}};an=ps=c([w({type:v.Set,itemType:Sr})],an);class Ar{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Ar.prototype,"contentType",void 0),c([l({type:p.Any,context:0})],Ar.prototype,"content",void 0);let Jr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Q})],Jr.prototype,"single",void 0),c([l({type:p.Any})],Jr.prototype,"any",void 0),Jr=c([w({type:v.Choice})],Jr);class cn{constructor(e={}){this.eContentType="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],cn.prototype,"eContentType",void 0),c([l({type:Jr,context:0,optional:!0})],cn.prototype,"eContent",void 0);let Yr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Q,context:0,implicit:!0,optional:!0})],Yr.prototype,"value",void 0),c([l({type:Q,converter:Af,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Yr.prototype,"constructedValue",void 0),Yr=c([w({type:v.Choice})],Yr);class Zr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Yi,Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Zr.prototype,"contentType",void 0),c([l({type:Yi})],Zr.prototype,"contentEncryptionAlgorithm",void 0),c([l({type:Yr,optional:!0})],Zr.prototype,"encryptedContent",void 0);class ln{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],ln.prototype,"keyAttrId",void 0),c([l({type:p.Any,optional:!0})],ln.prototype,"keyAttr",void 0);var ys;class un{constructor(e={}){this.subjectKeyIdentifier=new Et,Object.assign(this,e)}}c([l({type:Et})],un.prototype,"subjectKeyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],un.prototype,"date",void 0),c([l({type:ln,optional:!0})],un.prototype,"other",void 0);let kr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:un,context:0,implicit:!0,optional:!0})],kr.prototype,"rKeyId",void 0),c([l({type:gr,optional:!0})],kr.prototype,"issuerAndSerialNumber",void 0),kr=c([w({type:v.Choice})],kr);class gs{constructor(e={}){this.rid=new kr,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:kr})],gs.prototype,"rid",void 0),c([l({type:Q})],gs.prototype,"encryptedKey",void 0);let fn=ys=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ys.prototype)}};fn=ys=c([w({type:v.Sequence,itemType:gs})],fn);class ms{constructor(e={}){this.algorithm=new E,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:E})],ms.prototype,"algorithm",void 0),c([l({type:p.BitString})],ms.prototype,"publicKey",void 0);let zt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0,optional:!0})],zt.prototype,"subjectKeyIdentifier",void 0),c([l({type:ms,context:1,implicit:!0,optional:!0})],zt.prototype,"originatorKey",void 0),c([l({type:gr,optional:!0})],zt.prototype,"issuerAndSerialNumber",void 0),zt=c([w({type:v.Choice})],zt);class Cr{constructor(e={}){this.version=wt.v3,this.originator=new zt,this.keyEncryptionAlgorithm=new ot,this.recipientEncryptedKeys=new fn,Object.assign(this,e)}}c([l({type:p.Integer})],Cr.prototype,"version",void 0),c([l({type:zt,context:0})],Cr.prototype,"originator",void 0),c([l({type:Q,context:1,optional:!0})],Cr.prototype,"ukm",void 0),c([l({type:ot})],Cr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:fn})],Cr.prototype,"recipientEncryptedKeys",void 0);let xr=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Et,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),c([l({type:gr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=c([w({type:v.Choice})],xr);class Qr{constructor(e={}){this.version=wt.v0,this.rid=new xr,this.keyEncryptionAlgorithm=new ot,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],Qr.prototype,"version",void 0),c([l({type:xr})],Qr.prototype,"rid",void 0),c([l({type:ot})],Qr.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Q})],Qr.prototype,"encryptedKey",void 0);class Xr{constructor(e={}){this.keyIdentifier=new Q,Object.assign(this,e)}}c([l({type:Q})],Xr.prototype,"keyIdentifier",void 0),c([l({type:p.GeneralizedTime,optional:!0})],Xr.prototype,"date",void 0),c([l({type:ln,optional:!0})],Xr.prototype,"other",void 0);class ei{constructor(e={}){this.version=wt.v4,this.kekid=new Xr,this.keyEncryptionAlgorithm=new ot,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],ei.prototype,"version",void 0),c([l({type:Xr})],ei.prototype,"kekid",void 0),c([l({type:ot})],ei.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Q})],ei.prototype,"encryptedKey",void 0);class ti{constructor(e={}){this.version=wt.v0,this.keyEncryptionAlgorithm=new ot,this.encryptedKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],ti.prototype,"version",void 0),c([l({type:es,context:0,optional:!0})],ti.prototype,"keyDerivationAlgorithm",void 0),c([l({type:ot})],ti.prototype,"keyEncryptionAlgorithm",void 0),c([l({type:Q})],ti.prototype,"encryptedKey",void 0);class bs{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],bs.prototype,"oriType",void 0),c([l({type:p.Any})],bs.prototype,"oriValue",void 0);let Nt=class{constructor(e={}){Object.assign(this,e)}};c([l({type:Qr,optional:!0})],Nt.prototype,"ktri",void 0),c([l({type:Cr,context:1,implicit:!0,optional:!0})],Nt.prototype,"kari",void 0),c([l({type:ei,context:2,implicit:!0,optional:!0})],Nt.prototype,"kekri",void 0),c([l({type:ti,context:3,implicit:!0,optional:!0})],Nt.prototype,"pwri",void 0),c([l({type:bs,context:4,implicit:!0,optional:!0})],Nt.prototype,"ori",void 0),Nt=c([w({type:v.Choice})],Nt);var vs;let dn=vs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};dn=vs=c([w({type:v.Set,itemType:Nt})],dn);var ws;class pn{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],pn.prototype,"otherRevInfoFormat",void 0),c([l({type:p.Any})],pn.prototype,"otherRevInfo",void 0);let hn=class{constructor(e={}){this.other=new pn,Object.assign(this,e)}};c([l({type:pn,context:1,implicit:!0})],hn.prototype,"other",void 0),hn=c([w({type:v.Choice})],hn);let yn=ws=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};yn=ws=c([w({type:v.Set,itemType:hn})],yn);class Ss{constructor(e={}){Object.assign(this,e)}}c([l({type:an,context:0,implicit:!0,optional:!0})],Ss.prototype,"certs",void 0),c([l({type:yn,context:1,implicit:!0,optional:!0})],Ss.prototype,"crls",void 0);var As;let ks=As=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};ks=As=c([w({type:v.Set,itemType:br})],ks);class ri{constructor(e={}){this.version=wt.v0,this.recipientInfos=new dn,this.encryptedContentInfo=new Zr,Object.assign(this,e)}}c([l({type:p.Integer})],ri.prototype,"version",void 0),c([l({type:Ss,context:0,implicit:!0,optional:!0})],ri.prototype,"originatorInfo",void 0),c([l({type:dn})],ri.prototype,"recipientInfos",void 0),c([l({type:Zr})],ri.prototype,"encryptedContentInfo",void 0),c([l({type:ks,context:1,implicit:!0,optional:!0})],ri.prototype,"unprotectedAttrs",void 0);const zf="1.2.840.113549.1.7.2";var Cs;let gn=Cs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};gn=Cs=c([w({type:v.Set,itemType:Gr})],gn);class Br{constructor(e={}){this.version=wt.v0,this.digestAlgorithms=new gn,this.encapContentInfo=new cn,this.signerInfos=new Zi,Object.assign(this,e)}}c([l({type:p.Integer})],Br.prototype,"version",void 0),c([l({type:gn})],Br.prototype,"digestAlgorithms",void 0),c([l({type:cn})],Br.prototype,"encapContentInfo",void 0),c([l({type:an,context:0,implicit:!0,optional:!0})],Br.prototype,"certificates",void 0),c([l({type:yn,context:1,implicit:!0,optional:!0})],Br.prototype,"crls",void 0),c([l({type:Zi})],Br.prototype,"signerInfos",void 0);const ii="1.2.840.10045.2.1",xs="1.2.840.10045.4.1",cl="1.2.840.10045.4.3.1",Bs="1.2.840.10045.4.3.2",Es="1.2.840.10045.4.3.3",Ns="1.2.840.10045.4.3.4",ll="1.2.840.10045.3.1.7",ul="1.3.132.0.34",fl="1.3.132.0.35";function ni(r){return new E({algorithm:r})}const Jf=ni(xs);ni(cl);const Yf=ni(Bs),Zf=ni(Es),Qf=ni(Ns);let oi=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],oi.prototype,"fieldType",void 0),c([l({type:p.Any})],oi.prototype,"parameters",void 0),oi=c([w({type:v.Sequence})],oi);class Xf extends Q{}let Er=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.OctetString})],Er.prototype,"a",void 0),c([l({type:p.OctetString})],Er.prototype,"b",void 0),c([l({type:p.BitString,optional:!0})],Er.prototype,"seed",void 0),Er=c([w({type:v.Sequence})],Er);var Is;(function(r){r[r.ecpVer1=1]="ecpVer1"})(Is||(Is={}));let St=class{constructor(e={}){this.version=Is.ecpVer1,Object.assign(this,e)}};c([l({type:p.Integer})],St.prototype,"version",void 0),c([l({type:oi})],St.prototype,"fieldID",void 0),c([l({type:Er})],St.prototype,"curve",void 0),c([l({type:Xf})],St.prototype,"base",void 0),c([l({type:p.Integer,converter:le})],St.prototype,"order",void 0),c([l({type:p.Integer,optional:!0})],St.prototype,"cofactor",void 0),St=c([w({type:v.Sequence})],St);let It=class{constructor(e={}){Object.assign(this,e)}};c([l({type:p.ObjectIdentifier})],It.prototype,"namedCurve",void 0),c([l({type:p.Null})],It.prototype,"implicitCurve",void 0),c([l({type:St})],It.prototype,"specifiedCurve",void 0),It=c([w({type:v.Choice})],It);class mn{constructor(e={}){this.version=1,this.privateKey=new Q,Object.assign(this,e)}}c([l({type:p.Integer})],mn.prototype,"version",void 0),c([l({type:Q})],mn.prototype,"privateKey",void 0),c([l({type:It,context:0,optional:!0})],mn.prototype,"parameters",void 0),c([l({type:p.BitString,context:1,optional:!0})],mn.prototype,"publicKey",void 0);class bn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],bn.prototype,"r",void 0),c([l({type:p.Integer,converter:le})],bn.prototype,"s",void 0);const je="1.2.840.113549.1.1",Jt=`${je}.1`,ed=`${je}.7`,td=`${je}.9`,si=`${je}.10`,rd=`${je}.2`,id=`${je}.4`,vn=`${je}.5`,nd=`${je}.14`,Os=`${je}.11`,wn=`${je}.12`,Sn=`${je}.13`,dl=`${je}.15`,pl=`${je}.16`,An="1.3.14.3.2.26",hl="2.16.840.1.101.3.4.2.4",kn="2.16.840.1.101.3.4.2.1",Cn="2.16.840.1.101.3.4.2.2",xn="2.16.840.1.101.3.4.2.3",od="2.16.840.1.101.3.4.2.5",sd="2.16.840.1.101.3.4.2.6",ad="1.2.840.113549.2.2",cd="1.2.840.113549.2.5",Bn=`${je}.8`;function ge(r){return new E({algorithm:r,parameters:null})}ge(ad),ge(cd);const Yt=ge(An);ge(hl),ge(kn),ge(Cn),ge(xn),ge(od),ge(sd);const yl=new E({algorithm:Bn,parameters:x.serialize(Yt)}),gl=new E({algorithm:td,parameters:x.serialize(Ri.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ge(Jt),ge(rd),ge(id),ge(vn),ge(dl),ge(pl),ge(wn),ge(Sn),ge(dl),ge(pl);class En{constructor(e={}){this.hashAlgorithm=new E(Yt),this.maskGenAlgorithm=new E({algorithm:Bn,parameters:x.serialize(Yt)}),this.pSourceAlgorithm=new E(gl),Object.assign(this,e)}}c([l({type:E,context:0,defaultValue:Yt})],En.prototype,"hashAlgorithm",void 0),c([l({type:E,context:1,defaultValue:yl})],En.prototype,"maskGenAlgorithm",void 0),c([l({type:E,context:2,defaultValue:gl})],En.prototype,"pSourceAlgorithm",void 0),new E({algorithm:ed,parameters:x.serialize(new En)});class Zt{constructor(e={}){this.hashAlgorithm=new E(Yt),this.maskGenAlgorithm=new E({algorithm:Bn,parameters:x.serialize(Yt)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}c([l({type:E,context:0,defaultValue:Yt})],Zt.prototype,"hashAlgorithm",void 0),c([l({type:E,context:1,defaultValue:yl})],Zt.prototype,"maskGenAlgorithm",void 0),c([l({type:p.Integer,context:2,defaultValue:20})],Zt.prototype,"saltLength",void 0),c([l({type:p.Integer,context:3,defaultValue:1})],Zt.prototype,"trailerField",void 0),new E({algorithm:si,parameters:x.serialize(new Zt)});class Nn{constructor(e={}){this.digestAlgorithm=new E,this.digest=new Q,Object.assign(this,e)}}c([l({type:E})],Nn.prototype,"digestAlgorithm",void 0),c([l({type:Q})],Nn.prototype,"digest",void 0);var Ts;class In{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],In.prototype,"prime",void 0),c([l({type:p.Integer,converter:le})],In.prototype,"exponent",void 0),c([l({type:p.Integer,converter:le})],In.prototype,"coefficient",void 0);let _s=Ts=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ts.prototype)}};_s=Ts=c([w({type:v.Sequence,itemType:In})],_s);class at{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)}}c([l({type:p.Integer})],at.prototype,"version",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"publicExponent",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"privateExponent",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"prime1",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"prime2",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"exponent1",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"exponent2",void 0),c([l({type:p.Integer,converter:le})],at.prototype,"coefficient",void 0),c([l({type:_s,optional:!0})],at.prototype,"otherPrimeInfos",void 0);class Vs{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.Integer,converter:le})],Vs.prototype,"modulus",void 0),c([l({type:p.Integer,converter:le})],Vs.prototype,"publicExponent",void 0);var js;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(js||(js={}));const Pe=js;/*! *****************************************************************************
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 Ps=function(r,e){return Ps=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])},Ps(r,e)};function Rs(r,e){Ps(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ld(r,e,t,i){function n(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function u(g){try{d(i.next(g))}catch(h){a(h)}}function f(g){try{d(i.throw(g))}catch(h){a(h)}}function d(g){g.done?s(g.value):n(g.value).then(u,f)}d((i=i.apply(r,[])).next())})}function ud(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(d){return function(g){return f([d,g])}}function f(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){t.label=d[1];break}if(d[0]===6&&t.label<s[1]){t.label=s[1],s=d;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(d);break}s[2]&&t.ops.pop(),t.trys.pop();continue}d=e.call(r,t)}catch(g){d=[6,g],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function On(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 Tn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return s}function Qt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Tn(arguments[e]));return r}var fd="injectionTokens";function dd(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(fd,r)||{};return Object.keys(t).forEach(function(i){e[+i]=t[i]}),e}function ml(r){return!!r.useClass}function Ds(r){return!!r.useFactory}var bl=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,a=function(){return n||(s=e(t.wrap()),n=!0),s};return new Proxy(i,this.createHandler(a))},r.prototype.createHandler=function(e){var t={},i=function(n){t[n]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=e();var u=Reflect[n];return u.apply(void 0,Qt(s))}};return this.reflectMethods.forEach(i),t},r}();function Nr(r){return typeof r=="string"||typeof r=="symbol"}function pd(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function vl(r){return typeof r=="object"&&"token"in r&&"transform"in r}function hd(r){return typeof r=="function"||r instanceof bl}function _n(r){return!!r.useToken}function Vn(r){return r.useValue!=null}function yd(r){return ml(r)||Vn(r)||_n(r)||Ds(r)}var Ms=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}(),gd=function(r){Rs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ms),jn=function(){function r(){this.scopedResolutions=new Map}return r}();function md(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function bd(r,e,t){return t===void 0&&(t=" "),Qt([r],e.message.split(`
89
- `).map(function(i){return t+i})).join(`
90
- `)}function vd(r,e,t){var i=Tn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=md(s,e);return bd("Cannot inject the dependency "+a+' of "'+r.name+'" constructor. Reason:',t)}function wd(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var Sd=function(r){Rs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ms),Ad=function(r){Rs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(Ms),kd=function(){function r(){this.preResolution=new Sd,this.postResolution=new Ad}return r}(),wl=new Map,Cd=function(){function r(e){this.parent=e,this._registry=new gd,this.interceptors=new kd,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,i){i===void 0&&(i={lifecycle:Pe.Transient}),this.ensureNotDisposed();var n;if(yd(t)?n=t:n={useClass:t},_n(n))for(var s=[e],a=n;a!=null;){var u=a.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&&_n(f.provider)?a=f.provider:a=null}if((i.lifecycle===Pe.Singleton||i.lifecycle==Pe.ContainerScoped||i.lifecycle==Pe.ResolutionScoped)&&(Vn(n)||Ds(n)))throw new Error('Cannot use lifecycle "'+Pe[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(),Nr(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(),Nr(e)){if(Nr(t))return this.register(e,{useToken:t},{lifecycle:Pe.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Pe.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=e;return t&&!Nr(t)&&(i=t),this.register(e,{useClass:i},{lifecycle:Pe.Singleton})},r.prototype.resolve=function(e,t,i){t===void 0&&(t=new jn),i===void 0&&(i=!1),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&Nr(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(hd(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 a=On(this.interceptors.preResolution.getAll(e)),u=a.next();!u.done;u=a.next()){var f=u.value;f.options.frequency!="Once"&&s.push(f),f.callback(e,t)}}catch(d){i={error:d}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}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 a=[];try{for(var u=On(this.interceptors.postResolution.getAll(e)),f=u.next();!f.done;f=u.next()){var d=f.value;d.options.frequency!="Once"&&a.push(d),d.callback(e,t,i)}}catch(g){n={error:g}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(e,a)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Pe.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var i=e.options.lifecycle===Pe.Singleton,n=e.options.lifecycle===Pe.ContainerScoped,s=i||n,a;return Vn(e.provider)?a=e.provider.useValue:_n(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ml(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Ds(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,t),e.options.lifecycle===Pe.ResolutionScoped&&t.scopedResolutions.set(e,a),a},r.prototype.resolveAll=function(e,t,i){var n=this;t===void 0&&(t=new jn),i===void 0&&(i=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&Nr(e)){if(i)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var a=s.map(function(f){return n.resolveRegistration(f,t)});return this.executePostResolutionInterceptor(e,a,"All"),a}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=On(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Tn(n.value,2),a=s[0],u=s[1];this._registry.setAll(a,u.filter(function(f){return!Vn(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=On(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Tn(s.value,2),u=a[0],f=a[1];f.some(function(d){var g=d.options;return g.lifecycle===Pe.ContainerScoped})&&i._registry.setAll(u,f.map(function(d){return d.options.lifecycle===Pe.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){e={error:d}}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 ld(this,void 0,void 0,function(){var e;return ud(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 bl)return e.createProxy(function(s){return i.resolve(s,t)});var n=function(){var s=wl.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var a=s.map(i.resolveParams(t,e));return new(e.bind.apply(e,Qt([void 0],a)))}();return wd(n)&&this.disposables.add(n),n},r.prototype.resolveParams=function(e,t){var i=this;return function(n,s){var a,u,f;try{return pd(n)?vl(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,Qt([i.resolveAll(n.token,new jn,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 jn,n.isOptional):i.resolve(n.token,e,n.isOptional):vl(n)?(f=i.resolve(n.transform,e)).transform.apply(f,Qt([i.resolve(n.token,e)],n.transformArgs)):i.resolve(n,e)}catch(d){throw new Error(vd(t,s,d))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),Oe=new Cd;function Pn(r){return function(e){wl.set(e,dd(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 Us;class Rn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}c([l({type:p.ObjectIdentifier})],Rn.prototype,"attrId",void 0),c([l({type:p.Any,repeated:"set"})],Rn.prototype,"attrValues",void 0);let Sl=Us=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Us.prototype)}};Sl=Us=c([w({type:v.Sequence,itemType:Rn})],Sl);var $s;let Al=$s=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,$s.prototype)}};Al=$s=c([w({type:v.Sequence,itemType:Ar})],Al);class kl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],kl.prototype,"certId",void 0),c([l({type:p.Any,context:0})],kl.prototype,"certValue",void 0);class Cl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Cl.prototype,"crlId",void 0),c([l({type:p.Any,context:0})],Cl.prototype,"crltValue",void 0);class xl extends Q{}let Dn=class{constructor(e={}){this.encryptionAlgorithm=new E,this.encryptedData=new xl,Object.assign(this,e)}};c([l({type:E})],Dn.prototype,"encryptionAlgorithm",void 0),c([l({type:xl})],Dn.prototype,"encryptedData",void 0);var Hs,Ls;(function(r){r[r.v1=0]="v1"})(Ls||(Ls={}));class Bl extends Q{}let Fs=Hs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Hs.prototype)}};Fs=Hs=c([w({type:v.Sequence,itemType:bt})],Fs);class ai{constructor(e={}){this.version=Ls.v1,this.privateKeyAlgorithm=new E,this.privateKey=new Bl,Object.assign(this,e)}}c([l({type:p.Integer})],ai.prototype,"version",void 0),c([l({type:E})],ai.prototype,"privateKeyAlgorithm",void 0),c([l({type:Bl})],ai.prototype,"privateKey",void 0),c([l({type:Fs,implicit:!0,context:0,optional:!0})],ai.prototype,"attributes",void 0);let El=class extends ai{};El=c([w({type:v.Sequence})],El);let Nl=class extends Dn{};Nl=c([w({type:v.Sequence})],Nl);class Il{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Il.prototype,"secretTypeId",void 0),c([l({type:p.Any,context:0})],Il.prototype,"secretValue",void 0);class ci{constructor(e={}){this.mac=new Nn,this.macSalt=new Q,this.iterations=1,Object.assign(this,e)}}c([l({type:Nn})],ci.prototype,"mac",void 0),c([l({type:Q})],ci.prototype,"macSalt",void 0),c([l({type:p.Integer,defaultValue:1})],ci.prototype,"iterations",void 0);class Mn{constructor(e={}){this.version=3,this.authSafe=new Ar,this.macData=new ci,Object.assign(this,e)}}c([l({type:p.Integer})],Mn.prototype,"version",void 0),c([l({type:Ar})],Mn.prototype,"authSafe",void 0),c([l({type:ci,optional:!0})],Mn.prototype,"macData",void 0);var qs;class Un{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:p.ObjectIdentifier})],Un.prototype,"bagId",void 0),c([l({type:p.Any,context:0})],Un.prototype,"bagValue",void 0),c([l({type:Rn,repeated:"set",optional:!0})],Un.prototype,"bagAttributes",void 0);let Ol=qs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,qs.prototype)}};Ol=qs=c([w({type:v.Sequence,itemType:Un})],Ol);var Ks,Ws,Gs;const Tl="1.2.840.113549.1.9",_l=`${Tl}.7`,zs=`${Tl}.14`;let $n=class extends ve{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};c([l({type:p.IA5String})],$n.prototype,"ia5String",void 0),$n=c([w({type:v.Choice})],$n);let Vl=class extends Ar{};Vl=c([w({type:v.Sequence})],Vl);let jl=class extends Mn{};jl=c([w({type:v.Sequence})],jl);let Pl=class extends Dn{};Pl=c([w({type:v.Sequence})],Pl);let Js=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.IA5String})],Js.prototype,"value",void 0),Js=c([w({type:v.Choice})],Js);let Rl=class extends $n{};Rl=c([w({type:v.Choice})],Rl);let Dl=class extends ve{};Dl=c([w({type:v.Choice})],Dl);let Ys=class{constructor(e=new Date){this.value=e}};c([l({type:p.GeneralizedTime})],Ys.prototype,"value",void 0),Ys=c([w({type:v.Choice})],Ys);let Ml=class extends ve{};Ml=c([w({type:v.Choice})],Ml);let Zs=class{constructor(e="M"){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Zs.prototype,"value",void 0),Zs=c([w({type:v.Choice})],Zs);let Hn=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.PrintableString})],Hn.prototype,"value",void 0),Hn=c([w({type:v.Choice})],Hn);let Ul=class extends Hn{};Ul=c([w({type:v.Choice})],Ul);let $l=class extends ve{};$l=c([w({type:v.Choice})],$l);let Qs=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.ObjectIdentifier})],Qs.prototype,"value",void 0),Qs=c([w({type:v.Choice})],Qs);let Hl=class extends we{};Hl=c([w({type:v.Choice})],Hl);let Xs=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};c([l({type:p.Integer})],Xs.prototype,"value",void 0),Xs=c([w({type:v.Choice})],Xs);let Ll=class extends st{};Ll=c([w({type:v.Sequence})],Ll);let Ln=class extends ve{};Ln=c([w({type:v.Choice})],Ln);let Fl=Ks=class extends Kt{constructor(e){super(e),Object.setPrototypeOf(this,Ks.prototype)}};Fl=Ks=c([w({type:v.Sequence})],Fl);let ql=Ws=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Ws.prototype)}};ql=Ws=c([w({type:v.Set,itemType:br})],ql);let ea=class{constructor(e=""){this.value=e}toString(){return this.value}};c([l({type:p.BmpString})],ea.prototype,"value",void 0),ea=c([w({type:v.Choice})],ea);let ta=class extends E{};ta=c([w({type:v.Sequence})],ta);let Kl=Gs=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,Gs.prototype)}};Kl=Gs=c([w({type:v.Sequence,itemType:ta})],Kl);var ra;let Fn=ra=class extends te{constructor(e){super(e),Object.setPrototypeOf(this,ra.prototype)}};Fn=ra=c([w({type:v.Sequence,itemType:bt})],Fn);class Ir{constructor(e={}){this.version=0,this.subject=new ye,this.subjectPKInfo=new nt,this.attributes=new Fn,Object.assign(this,e)}}c([l({type:p.Integer})],Ir.prototype,"version",void 0),c([l({type:ye})],Ir.prototype,"subject",void 0),c([l({type:nt})],Ir.prototype,"subjectPKInfo",void 0),c([l({type:Fn,implicit:!0,context:0})],Ir.prototype,"attributes",void 0);class li{constructor(e={}){this.certificationRequestInfo=new Ir,this.signatureAlgorithm=new E,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}c([l({type:Ir})],li.prototype,"certificationRequestInfo",void 0),c([l({type:E})],li.prototype,"signatureAlgorithm",void 0),c([l({type:p.BitString})],li.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 ui="crypto.algorithm";class xd{getAlgorithms(){return Oe.resolveAll(ui)}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 Or="crypto.algorithmProvider";Oe.registerSingleton(Or,xd);var qn;const Re="1.3.36.3.3.2.8.1.1",Wl=`${Re}.1`,Gl=`${Re}.2`,zl=`${Re}.3`,Jl=`${Re}.4`,Yl=`${Re}.5`,Zl=`${Re}.6`,Ql=`${Re}.7`,Xl=`${Re}.8`,eu=`${Re}.9`,tu=`${Re}.10`,ru=`${Re}.11`,iu=`${Re}.12`,nu=`${Re}.13`,ou=`${Re}.14`,su="brainpoolP160r1",au="brainpoolP160t1",cu="brainpoolP192r1",lu="brainpoolP192t1",uu="brainpoolP224r1",fu="brainpoolP224t1",du="brainpoolP256r1",pu="brainpoolP256t1",hu="brainpoolP320r1",yu="brainpoolP320t1",gu="brainpoolP384r1",mu="brainpoolP384t1",bu="brainpoolP512r1",vu="brainpoolP512t1",fe="ECDSA";let fi=qn=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case fe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Jf;case"sha-256":return Yf;case"sha-384":return Zf;case"sha-512":return Qf}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=ll;break;case"K-256":t=qn.SECP256K1;break;case"P-384":t=ul;break;case"P-521":t=fl;break;case su:t=Wl;break;case au:t=Gl;break;case cu:t=zl;break;case lu:t=Jl;break;case uu:t=Yl;break;case fu:t=Zl;break;case du:t=Ql;break;case pu:t=Xl;break;case hu:t=eu;break;case yu:t=tu;break;case gu:t=ru;break;case mu:t=iu;break;case bu:t=nu;break;case vu:t=ou;break}if(t)return new E({algorithm:ii,parameters:x.serialize(new It({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case xs:return{name:fe,hash:{name:"SHA-1"}};case Bs:return{name:fe,hash:{name:"SHA-256"}};case Es:return{name:fe,hash:{name:"SHA-384"}};case Ns:return{name:fe,hash:{name:"SHA-512"}};case ii:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(x.parse(e.parameters,It).namedCurve){case ll:return{name:fe,namedCurve:"P-256"};case qn.SECP256K1:return{name:fe,namedCurve:"K-256"};case ul:return{name:fe,namedCurve:"P-384"};case fl:return{name:fe,namedCurve:"P-521"};case Wl:return{name:fe,namedCurve:su};case Gl:return{name:fe,namedCurve:au};case zl:return{name:fe,namedCurve:cu};case Jl:return{name:fe,namedCurve:lu};case Yl:return{name:fe,namedCurve:uu};case Zl:return{name:fe,namedCurve:fu};case Ql:return{name:fe,namedCurve:du};case Xl:return{name:fe,namedCurve:pu};case eu:return{name:fe,namedCurve:hu};case tu:return{name:fe,namedCurve:yu};case ru:return{name:fe,namedCurve:gu};case iu:return{name:fe,namedCurve:mu};case nu:return{name:fe,namedCurve:bu};case ou:return{name:fe,namedCurve:vu}}}}return null}};fi.SECP256K1="1.3.132.0.10",fi=qn=c([Pn()],fi),Oe.registerSingleton(ui,fi);const wu=Symbol("name"),Su=Symbol("value");class ee{constructor(e,t={},i=""){this[wu]=e,this[Su]=i;for(const n in t)this[n]=t[n]}}ee.NAME=wu,ee.VALUE=Su;class Bd{static toTextObject(e){const t=new ee("Algorithm Identifier",{},Ot.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case ii:{const i=new fi().toWebAlgorithm(e);i&&"namedCurve"in i?t["Named Curve"]=i.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class Ot{static toString(e){const t=this.items[e];return t||e}}Ot.items={[An]:"sha1",[hl]:"sha224",[kn]:"sha256",[Cn]:"sha384",[xn]:"sha512",[Jt]:"rsaEncryption",[vn]:"sha1WithRSAEncryption",[nd]:"sha224WithRSAEncryption",[Os]:"sha256WithRSAEncryption",[wn]:"sha384WithRSAEncryption",[Sn]:"sha512WithRSAEncryption",[ii]:"ecPublicKey",[xs]:"ecdsaWithSHA1",[cl]:"ecdsaWithSHA224",[Bs]:"ecdsaWithSHA256",[Es]:"ecdsaWithSHA384",[Ns]:"ecdsaWithSHA512",[Lf]:"TLS WWW server authentication",[Ff]:"TLS WWW client authentication",[qf]:"Code Signing",[Kf]:"E-mail Protection",[Wf]:"Time Stamping",[Gf]:"OCSP Signing",[zf]:"Signed Data"};class Xt{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 a=e[ee.VALUE];a&&(s=` ${a}`),i.push(`${n}${e[ee.NAME]}:${s}`),n=this.pad(t);for(const u in e){if(typeof u=="symbol")continue;const f=e[u],d=u?`${u}: `:"";if(typeof f=="string"||typeof f=="number"||typeof f=="boolean")i.push(`${n}${d}${f}`);else if(f instanceof Date)i.push(`${n}${d}${f.toUTCString()}`);else if(Array.isArray(f))for(const g of f)g[ee.NAME]=u,i.push(...this.serializeObj(g,t));else if(f instanceof ee)f[ee.NAME]=u,i.push(...this.serializeObj(f,t));else if(C.isBufferSource(f))u?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(f,t+1))):i.push(...this.serializeBufferSource(f,t));else if("toTextObject"in f){const g=f.toTextObject();g[ee.NAME]=u,i.push(...this.serializeObj(g,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 a=0;a<n.length;){const u=[];for(let f=0;f<16&&a<n.length;f++){f===8&&u.push("");const d=n[a++].toString(16).padStart(2,"0");u.push(d)}s.push(`${i}${u.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Xt.oidSerializer=Ot,Xt.algorithmSerializer=Bd;class Tt{constructor(...e){if(e.length===1){const t=e[0];this.rawData=x.serialize(t),this.onInit(t)}else{const t=x.parse(e[0],e[1]);this.rawData=C.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof Tt?Ia(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return x.toString(this.rawData);case"text":return Xt.serialize(this.toTextObject());case"hex":return T.ToHex(this.rawData);case"base64":return T.ToBase64(this.rawData);case"base64url":return T.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 ee(this.getTextName(),{},e)}}Tt.NAME="ASN";class He extends Tt{constructor(...e){let t;C.isBufferSource(e[0])?t=C.toArrayBuffer(e[0]):t=x.serialize(new Ze({extnID:e[0],critical:e[1],extnValue:new Q(C.toArrayBuffer(e[2]))})),super(t,Ze)}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[ee.NAME]===He.NAME&&(e[ee.NAME]=Ot.toString(this.type)),e}}var Au;class _t{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[Au]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(_t.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(_t.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=_t.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(_t.DEFAULT,e);return this}}Au=Symbol.toStringTag,_t.DEFAULT="default";const Te=new _t,Ed=/^[0-2](?:\.[1-9][0-9]*)+$/;function Nd(r){return new RegExp(Ed).test(r)}class ku{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return Nd(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const De=new ku;De.register("CN","2.5.4.3"),De.register("L","2.5.4.7"),De.register("ST","2.5.4.8"),De.register("O","2.5.4.10"),De.register("OU","2.5.4.11"),De.register("C","2.5.4.6"),De.register("DC","0.9.2342.19200300.100.1.25"),De.register("E","1.2.840.113549.1.9.1"),De.register("G","2.5.4.42"),De.register("I","2.5.4.43"),De.register("SN","2.5.4.4"),De.register("T","2.5.4.12");function Id(r,e){return`\\${T.ToHex(T.FromUtf8String(e)).toUpperCase()}`}function Od(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Id)}class Vt{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 ku,this.asn=new ye;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 ye?this.asn=e:C.isBufferSource(e)?this.asn=x.parse(e,ye):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||De.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)||De.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const i=this.getName(t.type)||t.type,n=t.value.anyValue?`#${T.ToHex(t.value.anyValue)}`:Od(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 a=this.getName(s.type)||s.type;(e=n[a])!==null&&e!==void 0||(n[a]=[]),n[a].push(s.value.anyValue?`#${T.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(n)}return t}fromString(e){const t=new ye,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${e},`);){let[,a,u]=n;const f=u[u.length-1];(f===","||f==="+")&&(u=u.slice(0,u.length-1),n[3]=f);const d=n[3];a=this.getTypeOid(a);const g=this.createAttribute(a,u);s==="+"?t[t.length-1].push(g):t.push(new lr([g])),s=d}return t}fromJSON(e){const t=new ye;for(const i of e){const n=new lr;for(const s in i){const a=this.getTypeOid(s),u=i[s];for(const f of u){const d=this.createAttribute(a,f);n.push(d)}}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 Di({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=T.FromHex(t.slice(1));else{const n=this.processStringValue(t);e===this.getName("E")||e===this.getName("DC")?i.value.ia5String=n:Vt.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]||Te.get()):i=e[0]||Te.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const Cu="Cannot initialize GeneralName from ASN.1 data.",xu=`${Cu} Unsupported string format in use.`,Td=`${Cu} Value doesn't match to GUID regular expression.`,Bu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,Eu="1.3.6.1.4.1.311.25.1",Nu="1.3.6.1.4.1.311.20.2.3",ia="dns",na="dn",oa="email",sa="ip",aa="url",ca="guid",la="upn",Kn="id";class jt extends Tt{constructor(...e){let t;if(e.length===2)switch(e[0]){case na:{const i=new Vt(e[1]).toArrayBuffer(),n=x.parse(i,ye);t=new q({directoryName:n});break}case ia:t=new q({dNSName:e[1]});break;case oa:t=new q({rfc822Name:e[1]});break;case ca:{const i=new RegExp(Bu,"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,a)=>a<3?T.ToHex(new Uint8Array(T.FromHex(s)).reverse()):s).join("");t=new q({otherName:new Fr({typeId:Eu,value:x.serialize(new Q(T.FromHex(n)))})});break}case sa:t=new q({iPAddress:e[1]});break;case Kn:t=new q({registeredID:e[1]});break;case la:{t=new q({otherName:new Fr({typeId:Nu,value:x.serialize(Ic.toASN(e[1]))})});break}case aa: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=ia,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=oa,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=sa,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=aa,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=Kn,this.value=e.registeredID;else if(e.directoryName!=null)this.type=na,this.value=new Vt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===Eu){this.type=ca;const t=x.parse(e.otherName.value,Q),i=new RegExp(Bu,"i").exec(T.ToHex(t));if(!i)throw new Error(Td);this.value=i.slice(1).map((n,s)=>s<3?T.ToHex(new Uint8Array(T.FromHex(n)).reverse()):n).join("-")}else if(e.otherName.typeId===Nu)this.type=la,this.value=x.parse(e.otherName.value,ve).toString();else throw new Error(xu);else throw new Error(xu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case na:case ia:case ca:case sa:case Kn:case la:case aa:e=this.type.toUpperCase();break;case oa:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===Kn&&(t=Ot.toString(t)),new ee(e,void 0,t)}}class er extends Tt{constructor(e){let t;if(e instanceof xe)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 jt(n.type,n.value).rawData,q);i.push(s)}t=new xe(i)}else if(C.isBufferSource(e))t=x.parse(e,xe);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 jt(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[ee.NAME]];Array.isArray(n)||(n=[],e[i[ee.NAME]]=n),n.push(i)}return e}}er.NAME="GeneralNames";const di="-{5}",pi="\\n",_d=`[^${pi}]+`,Vd=`${di}BEGIN (${_d}(?=${di}))${di}`,jd=`${di}END \\1${di}`,Tr="\\n",Pd=`[^:${pi}]+`,Rd=`(?:[^${pi}]+${Tr}(?: +[^${pi}]+${Tr})*)`,Dd=`(?:[a-zA-Z0-9=+/]+${Tr})+`,Iu=`${Vd}${Tr}(?:((?:${Pd}: ${Rd})+))?${Tr}?(${Dd})${jd}`;class Le{static isPem(e){return typeof e=="string"&&new RegExp(Iu,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(Iu,"g"),i=[];let n=null;for(;n=t.exec(e);){const s=n[3].replace(new RegExp(`[${pi}]+`,"g"),""),a={type:n[1],headers:[],rawData:T.FromBase64(s)},u=n[2];if(u){const f=u.split(new RegExp(Tr,"g"));let d=null;for(const g of f){const[h,L]=g.split(/:(.*)/);if(L===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=h.trim()}else d&&a.headers.push(d),d={key:h,value:L.trim()}}d&&a.headers.push(d)}i.push(a)}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 d of e.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=T.ToBase64(e.rawData);let a,u=0;const f=Array();for(;u<s.length&&(s.length-u<64?a=s.substring(u):(a=s.substring(u,u+64),u+=64),a.length!==0);)if(f.push(a),a.length<64)break;return n.push(...f),n.push(`-----END ${i}-----`),n.join(`
117
- `)}}Le.CertificateTag="CERTIFICATE",Le.CrlTag="CRL",Le.CertificateRequestTag="CERTIFICATE REQUEST",Le.PublicKeyTag="PUBLIC KEY",Le.PrivateKeyTag="PRIVATE KEY";class At extends Tt{static isAsnEncoded(e){return C.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Le.isPem(e))return Le.decode(e)[0];if(T.isHex(e))return T.FromHex(e);if(T.isBase64(e))return T.FromBase64(e);if(T.isBase64Url(e))return T.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=T.ToBinary(e);return Le.isPem(t)?Le.decode(t)[0]:T.isHex(t)?T.FromHex(t):T.isBase64(t)?T.FromBase64(t):T.isBase64Url(t)?T.FromBase64Url(t):C.toArrayBuffer(e)}}constructor(...e){At.isAsnEncoded(e[0])?super(At.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return Le.encode(this.rawData,this.tag);default:return super.toString(e)}}}class ct extends At{static async create(e,t=Te.get()){if(e instanceof ct)return e;if(_t.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const i=await t.subtle.exportKey("spki",e);return new ct(i)}else{if(e.publicKey)return e.publicKey;if(C.isBufferSource(e))return new ct(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){At.isAsnEncoded(e)?super(e,nt):super(e),this.tag=Le.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]||Te.get()):t=e[0]||Te.get();let s=this.rawData;const a=x.parse(this.rawData,nt);return a.algorithm.algorithm===si&&(s=Md(a,s)),t.subtle.importKey("spki",s,n,!0,i)}onInit(e){const t=Oe.resolve(Or),i=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case Jt:{const n=x.parse(e.subjectPublicKey,Vs),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]||Te.get()):i=e[0]||Te.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=Te.get()):t=e[0]:e.length===2?(i=e[0],t=e[1]):t=Te.get();const n=x.parse(this.rawData,nt);return await t.subtle.digest(i,n.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,nt);switch(e.Algorithm=Xt.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case ii:e["EC Point"]=t.subjectPublicKey;break;case Jt:default:e["Raw Data"]=t.subjectPublicKey}return e}}function Md(r,e){return r.algorithm=new E({algorithm:Jt,parameters:null}),e=x.serialize(r),e}class hi extends He{static async create(e,t=!1,i=Te.get()){if("name"in e&&"serialNumber"in e)return new hi(e,t);const s=await(await ct.create(e,i)).getKeyIdentifier(i);return new hi(T.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Ft({keyIdentifier:new Io(T.FromHex(e[0]))});super(No,e[1],x.serialize(t))}else{const t=e[0],i=t.name instanceof er?x.parse(t.name.rawData,xe):t.name,n=new Ft({authorityCertIssuer:i,authorityCertSerialNumber:T.FromHex(t.serialNumber)});super(No,e[1],x.serialize(n))}}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,Ft);t.keyIdentifier&&(this.keyId=T.ToHex(t.keyIdentifier)),(t.authorityCertIssuer||t.authorityCertSerialNumber)&&(this.certId={name:t.authorityCertIssuer||[],serialNumber:t.authorityCertSerialNumber?T.ToHex(t.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,Ft);return t.authorityCertIssuer&&(e["Authority Issuer"]=new er(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}hi.NAME="Authority Key Identifier";class Ou extends He{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,Ui);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Ui({cA:e[0],pathLenConstraint:e[1]});super(Rc,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}}Ou.NAME="Basic Constraints";var Tu;(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"})(Tu||(Tu={}));class _u extends He{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,qi);this.usages=t.map(i=>i)}else{const t=new qi(e[0]);super(Lc,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>Ot.toString(t)).join(", "),e}}_u.NAME="Extended Key Usages";var ua;(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"})(ua||(ua={}));class fa extends He{constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,qo);this.usages=t.toNumber()}else{const t=new qo(e[0]);super(Kc,e[1],x.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,qo);return e[""]=t.toJSON().join(", "),e}}fa.NAME="Key Usages";class Wn extends He{static async create(e,t=!1,i=Te.get()){const s=await(await ct.create(e,i)).getKeyIdentifier(i);return new Wn(T.ToHex(s),t)}constructor(...e){if(C.isBufferSource(e[0])){super(e[0]);const t=x.parse(this.value,Et);this.keyId=T.ToHex(t)}else{const t=typeof e[0]=="string"?T.FromHex(e[0]):e[0],i=new Et(t);super(Zc,e[1],x.serialize(i)),this.keyId=T.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=x.parse(this.value,Et);return e[""]=t,e}}Wn.NAME="Subject Key Identifier";class da extends He{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(Jc,e[1],new er(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,Jo);this.names=new er(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}da.NAME="Subject Alternative Name";class Fe{static register(e,t){this.items.set(e,t)}static create(e){const t=new He(e),i=this.items.get(t.type);return i?new i(e):t}}Fe.items=new Map;class Vu extends He{constructor(...e){var t;if(C.isBufferSource(e[0])){super(e[0]);const i=x.parse(this.value,Li);this.policies=i.map(n=>n.policyIdentifier)}else{const i=e[0],n=(t=e[1])!==null&&t!==void 0?t:!1,s=new Li(i.map(a=>new Hi({policyIdentifier:a})));super(Mc,n,x.serialize(s)),this.policies=i}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new ee("",{},Ot.toString(t))),e}}Vu.NAME="Certificate Policies",Fe.register(Mc,Vu);class ju extends He{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(a=>new dr({distributionPoint:new qt({fullName:[new q({uniformResourceIdentifier:a})]})})),s=new pr(n);super(Do,e[1],x.serialize(s))}else{const i=new pr(e[0]);super(Do,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,pr);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 jt(s).toString()).join(", ")),t.reasons&&(n.Reasons=t.reasons.toString()),t.cRLIssuer&&(n["CRL Issuer"]=t.cRLIssuer.map(s=>s.toString()).join(", ")),n}),e}}ju.NAME="CRL Distribution Points";class Pu extends He{constructor(...e){var t,i,n,s;if(C.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof fr){const a=new fr(e[0]);super(Eo,e[1],x.serialize(a))}else{const a=e[0],u=new fr;zn(u,a,_c,"ocsp"),zn(u,a,Vc,"caIssuers"),zn(u,a,jc,"timeStamping"),zn(u,a,Pc,"caRepository"),super(Eo,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,fr).forEach(i=>{switch(i.accessMethod){case _c:this.ocsp.push(new jt(i.accessLocation));break;case Vc:this.caIssuers.push(new jt(i.accessLocation));break;case jc:this.timeStamping.push(new jt(i.accessLocation));break;case Pc:this.caRepository.push(new jt(i.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&Gn(e,"OCSP",this.ocsp),this.caIssuers.length&&Gn(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&Gn(e,"Time Stamping",this.timeStamping),this.caRepository.length&&Gn(e,"CA Repository",this.caRepository),e}}Pu.NAME="Authority Info Access";function Gn(r,e,t){if(t.length===1)r[e]=t[0].toTextObject();else{const i=new ee("");t.forEach((n,s)=>{const a=n.toTextObject(),u=`${a[ee.NAME]} ${s+1}`;let f=i[u];Array.isArray(f)||(f=[],i[u]=f),f.push(a)}),r[e]=i}}function zn(r,e,t,i){const n=e[i];n&&(Array.isArray(n)?n:[n]).forEach(a=>{typeof a=="string"&&(a=new jt("url",a)),r.push(new qr({accessMethod:t,accessLocation:x.parse(a.rawData,q)}))})}class Ru extends He{constructor(...e){C.isBufferSource(e[0])?super(e[0]):super(Fc,e[1],new er(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=x.parse(e.extnValue,xe);this.names=new er(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const i in t)e[i]=t[i];return e}}Ru.NAME="Issuer Alternative Name";class _r extends Tt{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 bt({type:i,values:n}))}super(t,bt)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new ee("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[ee.NAME]===_r.NAME&&(e[ee.NAME]=Ot.toString(this.type)),e}}_r.NAME="Attribute";class Du extends _r{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=new Ln({printableString:e[0]});super(_l,[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],Ln);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[ee.VALUE]=this.password,e}}Du.NAME="Challenge Password";class pa extends _r{constructor(...e){var t;if(C.isBufferSource(e[0]))super(e[0]);else{const i=e[0],n=new Kt;for(const s of i)n.push(x.parse(s.rawData,Ze));super(zs,[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],Kt);this.items=t.map(i=>Fe.create(x.serialize(i)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(i=>i.toTextObject());for(const i of t)e[i[ee.NAME]]=i;return e}}pa.NAME="Extensions";class Jn{static register(e,t){this.items.set(e,t)}static create(e){const t=new _r(e),i=this.items.get(t.type);return i?new i(e):t}}Jn.items=new Map;const Yn="crypto.signatureFormatter";class Ud{toAsnSignature(e,t){return C.toArrayBuffer(t)}toWebSignature(e,t){return C.toArrayBuffer(t)}}var Zn;let ha=Zn=class{static createPssParams(e,t){const i=Zn.getHashAlgorithm(e);return i?new Zt({hashAlgorithm:i,maskGenAlgorithm:new E({algorithm:Bn,parameters:x.serialize(i)}),saltLength:t}):null}static getHashAlgorithm(e){const t=Oe.resolve(Or);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:vn,parameters:null});case"sha-256":return new E({algorithm:Os,parameters:null});case"sha-384":return new E({algorithm:wn,parameters:null});case"sha-512":return new E({algorithm:Sn,parameters:null})}}else return new E({algorithm:Jt,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=Zn.createPssParams(e.hash,e.saltLength);if(!t)throw new Error("Cannot create PSS parameters");return new E({algorithm:si,parameters:x.serialize(t)})}else return new E({algorithm:si,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Jt:return{name:"RSASSA-PKCS1-v1_5"};case vn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Os:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case wn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case si:if(e.parameters){const t=x.parse(e.parameters,Zt);return{name:"RSA-PSS",hash:Oe.resolve(Or).toWebAlgorithm(t.hashAlgorithm),saltLength:t.saltLength}}else return{name:"RSA-PSS"}}return null}};ha=Zn=c([Pn()],ha),Oe.registerSingleton(ui,ha);let ya=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new E({algorithm:An});case"sha-256":return new E({algorithm:kn});case"sha-384":return new E({algorithm:Cn});case"sha-512":return new E({algorithm:xn})}return null}toWebAlgorithm(e){switch(e.algorithm){case An:return{name:"SHA-1"};case kn:return{name:"SHA-256"};case Cn:return{name:"SHA-384"};case xn:return{name:"SHA-512"}}return null}};ya=c([Pn()],ya),Oe.registerSingleton(ui,ya);class We{addPadding(e,t){const i=C.toUint8Array(t),n=new Uint8Array(e);return n.set(i,e-i.length),n}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=We.namedCurveSize.get(i)||We.defaultNamedCurveSize,s=new bn,a=C.toUint8Array(t);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),x.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const i=x.parse(t,bn),n=e.namedCurve,s=We.namedCurveSize.get(n)||We.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),u=this.addPadding(s,this.removePadding(i.s));return Qu(a,u)}return null}}We.namedCurveSize=new Map,We.defaultNamedCurveSize=32;const ga="1.3.101.110",Mu="1.3.101.111",ma="1.3.101.112",Uu="1.3.101.113";let ba=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"ed25519":t=ma;break;case"x25519":t=ga;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=ma;break;case"ed448":t=Uu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=ga;break;case"x448":t=Mu;break}}return t?new E({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case ma:return{name:"Ed25519"};case Uu:return{name:"EdDSA",namedCurve:"Ed448"};case ga:return{name:"X25519"};case Mu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};ba=c([Pn()],ba),Oe.registerSingleton(ui,ba);class $d extends At{constructor(e){At.isAsnEncoded(e)?super(e,li):super(e),this.tag=Le.CertificateRequestTag}onInit(e){this.tbs=x.serialize(e.certificationRequestInfo),this.publicKey=new ct(e.certificationRequestInfo.subjectPKInfo);const t=Oe.resolve(Or);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(n=>Jn.create(x.serialize(n)));const i=this.getAttribute(zs);this.extensions=[],i instanceof pa&&(this.extensions=i.items),this.subjectName=new Vt(e.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}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=Te.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(t,["verify"],e),n=Oe.resolveAll(Yn).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,li),i=t.certificationRequestInfo,n=new ee("",{Version:`${hr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ee("");for(const a of this.attributes){const u=a.toTextObject();s[u[ee.NAME]]=u}n.Attributes=s}return e.Data=n,e.Signature=new ee("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}$d.NAME="PKCS#10 Certificate Request";class $u extends At{constructor(e){At.isAsnEncoded(e)?super(e,yr):super(e),this.tag=Le.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=x.serialize(t);let i=new Uint8Array(t.serialNumber);i.length>1&&i[0]===0&&i[1]>127&&(i=i.slice(1)),this.serialNumber=T.ToHex(i),this.subjectName=new Vt(t.subject),this.subject=new Vt(t.subject).toString(),this.issuerName=new Vt(t.issuer),this.issuer=this.issuerName.toString();const n=Oe.resolve(Or);this.signatureAlgorithm=n.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const s=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!s)throw new Error("Cannot get 'notBefore' value");this.notBefore=s;const a=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!a)throw new Error("Cannot get 'notAfter' value");this.notAfter=a,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(u=>Fe.create(x.serialize(u)))),this.publicKey=new ct(t.subjectPublicKeyInfo)}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=Te.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 ct)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],t);else if(C.isBufferSource(s)){const d=new ct(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],t)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=Oe.resolveAll(Yn).reverse();let u=null;for(const d of a)if(u=d.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 g=(e.date||new Date).getTime();return f&&this.notBefore.getTime()<g&&g<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=Te.get()),await t.subtle.digest(i,this.rawData)}async isSelfSigned(e=Te.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=x.parse(this.rawData,yr),i=t.tbsCertificate,n=new ee("",{Version:`${hr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":Xt.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ee("",{"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 ee("");for(const a of this.extensions){const u=a.toTextObject();s[u[ee.NAME]]=u}n.Extensions=s}return e.Data=n,e.Signature=new ee("",{Algorithm:Xt.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}$u.NAME="Certificate";var Hu;(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"})(Hu||(Hu={})),Fe.register(Rc,Ou),Fe.register(Lc,_u),Fe.register(Kc,fa),Fe.register(Zc,Wn),Fe.register(No,hi),Fe.register(Jc,da),Fe.register(Do,ju),Fe.register(Eo,Pu),Fe.register(Fc,Ru),Jn.register(_l,Du),Jn.register(zs,pa),Oe.registerSingleton(Yn,Ud),Oe.registerSingleton(Yn,We),We.namedCurveSize.set("P-256",32),We.namedCurveSize.set("K-256",32),We.namedCurveSize.set("P-384",48),We.namedCurveSize.set("P-521",66);function Lu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new $u(e),i={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const n of t.extensions)if(n instanceof da){const s=n.names.toJSON(),u=Object.entries(s).map(f=>({type:f[1].type,value:f[1].value})).reduce((f,d)=>{const g=d.type,h=f[g]??[];return{...f,[g]:[...h,d.value]}},{});for(const f in u)i.subjectAltName=`${f}=${u[f].join(", ")}`}else if(n instanceof fa){const s=Object.values(ua),a=Array(s.length/2).fill(null).reduce((u,f,d)=>{const g=s[s.length/2+d];if(n.usages&g){const h=s[d];u.push(h)}return u},[]);i.keyUsage=a}return i}}}function Hd(){const r=Lu(),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 Ld={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 Fd(){const r=xa.createI18n("en-us",Ld);return{i18n:r,i18nT:xa.i18nTComponent(r)}}const Xe={useCertificate:Hd,useI18n:Fd,useX509:Lu},va="/v2/control-planes/{controlPlaneId}/core-entities",wa="/{workspace}",Qn={list:{konnect:`${va}/certificates`,kongManager:`${wa}/certificates`},form:{konnect:{create:`${va}/certificates`,edit:`${va}/certificates/{id}`},kongManager:{create:`${wa}/certificates`,edit:`${wa}/certificates/{id}`}}},qd={class:"kong-ui-entities-certificates-list"},Kd={class:"button-row"},Wd={key:0},Gd={key:1},zd={key:0},Jd={key:1},Yd={key:0},Zd={key:1},Qd={key:1},Xd=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 W;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=Xe.useI18n(),u=gi.useRouter(),{axiosInstance:f}=A.useAxios((W=i.config)==null?void 0:W.axiosRequestConfig),{handleStateChange:d,hasRecords:g}=A.useTableState(()=>ie.value),h=o.computed(()=>g.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),re={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}},X=o.computed(()=>{var H,G;let O=`${i.config.apiBaseUrl}${Qn.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,(G=i.config)!=null&&G.workspace?`/${i.config.workspace}`:"")),O}),ie=o.ref(""),Me=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:Se,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),oe=()=>{ie.value=""},R=()=>{M.value++},j=o.ref(null),S=async(O,H)=>{const G=O.id;if(!await H(G)){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:G})})},F=async(O,H)=>{const G=JSON.stringify(O);if(!await H(G)){t("copy:error",{entity:O,message:n("certificates.errors.copy")});return}t("copy:success",{entity:O,message:n("certificates.copy.success_brief")})},Z=async O=>{var G;await((G=i.canRetrieve)==null?void 0:G.call(i,O))&&u.push(i.config.getViewRoute(O.id))},lt=O=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(O)}),ut=O=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(O)}),se=O=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(O)}},ce=o.ref(void 0),z=o.ref(!1),ft=o.ref(!1),rr=o.ref(""),Vr=A.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Pt,getCertificateData:kt}=Xe.useCertificate(),jr=O=>{ce.value=O,z.value=!0},U=()=>{z.value=!1},dt=async()=>{var O,H,G;if((O=ce.value)!=null&&O.id){ft.value=!0;try{await f.delete(Vr(ce.value.id)),ft.value=!1,z.value=!1,M.value++,t("delete:success",ce.value)}catch(Ae){rr.value=((G=(H=Ae.response)==null?void 0:H.data)==null?void 0:G.message)||Ae.message||n("certificates.errors.delete"),t("error",Ae)}finally{ft.value=!1}}},ir=()=>{u.push(i.config.createRoute)};o.watch(P,O=>{var H,G,Ae;if(O.status===A.FetcherStatus.Error){j.value={title:n("certificates.errors.general")},(Ae=(G=(H=O.error)==null?void 0:H.response)==null?void 0:G.data)!=null&&Ae.message&&(j.value.message=O.error.response.data.message),t("error",O.error);return}Pt.value={},j.value=null});const ae=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")}),Rt=o.ref(!1);return o.onBeforeMount(async()=>{Rt.value=await i.canCreate(),Rt.value&&(ae.value.title=n("certificates.list.empty_state.title"),ae.value.ctaText=n("certificates.actions.create"))}),(O,H)=>{const G=o.resolveComponent("KButton"),Ae=o.resolveComponent("KEmptyState"),Ct=o.resolveComponent("KCopy"),K=o.resolveComponent("KDropdownItem"),Ee=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",qd,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":ae.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(Se),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:ie.value,"table-headers":o.unref(re),onClearSearchInput:oe,"onClick:row":H[3]||(H[3]=D=>Z(D)),onSort:R,onState:o.unref(d)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ie.value,"onUpdate:modelValue":H[0]||(H[0]=D=>ie.value=D),config:Me.value},null,8,["modelValue","config"]),o.createVNode(o.unref(A.PermissionsWrapper),{"auth-function":r.canCreate},{default:o.withCtx(()=>[r.useToolbarCreationButton?(o.openBlock(),o.createBlock(G,{key:0,appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.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",Kd,[h.value?(o.openBlock(),o.createBlock(G,{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(_e.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(G,{appearance:"primary","data-testid":"toolbar-add-certificate",size:r.useActionOutside?"medium":"large",to:r.config.createRoute},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.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 ke;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Wd,o.toDisplayString((ke=D==null?void 0:D.metadata)!=null&&ke.subject?D.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",Gd,o.toDisplayString(o.unref(kt)(D).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:D})=>{var ke;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",zd,o.toDisplayString((ke=D==null?void 0:D.metadata)!=null&&ke.expiry?o.unref(s)(D.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",Jd,o.toDisplayString(o.unref(kt)(D).schemaExpiry?o.unref(s)(o.unref(kt)(D).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:D})=>{var ke;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Yd,o.toDisplayString((ke=D==null?void 0:D.metadata)!=null&&ke.dns_names?`dns=${D.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",Zd,o.toDisplayString(o.unref(kt)(D).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:D})=>[D!=null&&D.cert?(o.openBlock(),o.createBlock(Ct,{key:0,"data-testid":"copy-certificate-cert",text:D.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",Qd,"-"))]),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(Ee,null,{default:o.withCtx(({copyToClipboard:ke})=>[o.createVNode(K,{"data-testid":"action-entity-copy-id",onClick:eo=>S(D,ke)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Ee,null,{default:o.withCtx(({copyToClipboard:ke})=>[o.createVNode(K,{"data-testid":"action-entity-copy-json",onClick:eo=>F(D,ke)},{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:lt(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:ut(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:se(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:ke=>jr(D)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ie.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var D;return[o.createVNode(Ae,{"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(_e.ServiceDocumentIcon),{decoration:""})]),action:o.withCtx(()=>[Rt.value?(o.openBlock(),o.createBlock(G,{key:0,"data-testid":"entity-create-button",onClick:ir},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon),{decorative:""}),o.createTextVNode(" "+o.toDisplayString(o.unref(n)("certificates.list.empty_state_v2.create")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(G,{appearance:"secondary","data-testid":"entity-learn-more-button",onClick:H[2]||(H[2]=ke=>O.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.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":ft.value,"entity-type":o.unref(A.EntityTypes).Certificate,error:rr.value,title:o.unref(n)("certificates.delete.title"),visible:z.value,onCancel:U,onProceed:dt},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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"])])}}}),tr=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},ep=tr(Xd,[["__scopeId","data-v-198dc311"]]),tp="#d60027",rp={class:"sni-field-container"},ip={key:1,class:"sni-field-controls-container"},np={key:0},op=tr(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}}=Xe.useI18n(),a=o.ref([]);return o.watch(t.modelValue,u=>{a.value=[...u]},{immediate:!0,deep:!0}),o.watch(a,u=>{i("update:modelValue",u)},{deep:!0}),(u,f)=>{const d=o.resolveComponent("KLabel"),g=o.resolveComponent("KInput"),h=o.resolveComponent("KButton"),L=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",rp,[o.createVNode(d,{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(a.value,(ne,re)=>(o.openBlock(),o.createElementBlock("div",{key:re,class:"sni-field-input"},[!r.isEditing||a.value[re]?(o.openBlock(),o.createBlock(g,{key:0,modelValue:a.value[re],"onUpdate:modelValue":X=>a.value[re]=X,modelModifiers:{trim:!0},"data-testid":`sni-field-input-${re+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",ip,[o.createVNode(h,{appearance:"tertiary",class:"remove-button","data-testid":"remove-sni",icon:"",onClick:X=>u.$emit("remove",re)},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.TrashIcon),{color:o.unref(tp)},null,8,["color"])]),_:1},8,["onClick"]),o.createVNode(h,{appearance:"tertiary","data-testid":"add-sni",disabled:re!==a.value.length-1,icon:"",onClick:f[0]||(f[0]=X=>u.$emit("add"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.AddIcon))]),_:1},8,["disabled"])]))]))),128)),a.value.length===0?(o.openBlock(),o.createElementBlock("div",np,[o.createVNode(h,{onClick:f[1]||(f[1]=ne=>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"]]),sp={class:"kong-ui-entities-certificates-form"},ap=tr(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 oe;const t=e,i=r,n=gi.useRouter(),{i18nT:s,i18n:{t:a}}=Xe.useI18n(),{getMessageFromError:u}=A.useErrors(),{axiosInstance:f}=A.useAxios((oe=i.config)==null?void 0:oe.axiosRequestConfig),d=o.computed(()=>Qn.form[i.config.app].edit),g=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),h=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""},isReadonly:!1,errorMessage:""}),L=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",snis:[""],tags:""}),ne=o.computed(()=>(g.value===A.EntityBaseFormType.Create||JSON.stringify(h.fields)!==JSON.stringify(L))&&!!h.fields.cert&&!!h.fields.key),re=R=>{var j,S;h.fields.cert=(R==null?void 0:R.cert)||"",h.fields.key=(R==null?void 0:R.key)||"",h.fields.certAlt=(R==null?void 0:R.cert_alt)||"",h.fields.keyAlt=(R==null?void 0:R.key_alt)||"",h.fields.snis=(j=R==null?void 0:R.snis)!=null&&j.length?R.snis:[""],h.fields.tags=((S=R==null?void 0:R.tags)==null?void 0:S.join(", "))||"",Object.assign(L,h.fields)},X=()=>{n.push(i.config.cancelRoute)},ie=()=>{h.fields.snis.push("")},Me=R=>{h.fields.snis.splice(R,1)},Se=o.computed(()=>{var j,S;let R=`${i.config.apiBaseUrl}${Qn.form[i.config.app][g.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:h.fields.cert,key:h.fields.key,cert_alt:h.fields.certAlt||null,key_alt:h.fields.keyAlt||null,...i.showSnisField?{snis:h.fields.snis.filter(Boolean)}:{},tags:(j=(R=h.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,Z,lt,ut,se,ce;try{h.isReadonly=!0;let z;g.value==="create"?z=await f.post(Se.value,P.value):g.value==="edit"&&(z=((R=i.config)==null?void 0:R.app)==="konnect"?await f.put(Se.value,P.value):await f.patch(Se.value,P.value)),h.fields.cert=((j=z==null?void 0:z.data)==null?void 0:j.cert)||"",h.fields.key=((S=z==null?void 0:z.data)==null?void 0:S.key)||"",h.fields.certAlt=((F=z==null?void 0:z.data)==null?void 0:F.cert_alt)||"",h.fields.keyAlt=((Z=z==null?void 0:z.data)==null?void 0:Z.key_alt)||"",h.fields.snis=(ut=(lt=z==null?void 0:z.data)==null?void 0:lt.snis)!=null&&ut.length?z.data.snis:[""],h.fields.tags=((ce=(se=z==null?void 0:z.data)==null?void 0:se.tags)==null?void 0:ce.join(", "))||"",Object.assign(L,h.fields),t("update",z==null?void 0:z.data)}catch(z){h.errorMessage=u(z),t("error",z)}finally{h.isReadonly=!1}};return(R,j)=>{const S=o.resolveComponent("KTextArea"),F=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",sp,[o.createVNode(o.unref(A.EntityBaseForm),{"can-submit":ne.value,config:r.config,"edit-id":r.certificateId,"entity-type":o.unref(A.SupportedEntityType).Certificate,"error-message":h.errorMessage,"fetch-url":d.value,"form-fields":P.value,"is-readonly":h.isReadonly,onCancel:X,"onFetch:error":j[7]||(j[7]=Z=>R.$emit("error",Z)),"onFetch:success":re,onLoading:j[8]||(j[8]=Z=>R.$emit("loading",Z)),onSubmit:M},{default:o.withCtx(()=>[o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(S,{modelValue:h.fields.cert,"onUpdate:modelValue":j[0]||(j[0]=Z=>h.fields.cert=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:h.fields.key,"onUpdate:modelValue":j[1]||(j[1]=Z=>h.fields.key=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:h.fields.certAlt,"onUpdate:modelValue":j[2]||(j[2]=Z=>h.fields.certAlt=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(S,{modelValue:h.fields.keyAlt,"onUpdate:modelValue":j[3]||(j[3]=Z=>h.fields.keyAlt=Z),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),"label-attributes":{tooltipAttributes:{maxWidth:"400"}},readonly:h.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(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),r.showSnisField&&r.config.sniListRoute?(o.openBlock(),o.createBlock(op,{key:0,modelValue:h.fields.snis,"onUpdate:modelValue":j[4]||(j[4]=Z=>h.fields.snis=Z),"is-editing":g.value===o.unref(A.EntityBaseFormType).Edit,"sni-list-route":r.config.sniListRoute,onAdd:ie,onRemove:j[5]||(j[5]=Z=>Me(Z))},null,8,["modelValue","is-editing","sni-list-route"])):o.createCommentVNode("",!0)]),_:1},8,["description","title"]),o.createVNode(o.unref(A.EntityFormSection),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(F,{modelValue:h.fields.tags,"onUpdate:modelValue":j[6]||(j[6]=Z=>h.fields.tags=Z),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"400"}},placeholder:o.unref(a)("certificates.form.fields.tags.placeholder"),readonly:h.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"]]),Sa="/v2/control-planes/{controlPlaneId}/core-entities",Aa="/{workspace}",Xn={list:{konnect:`${Sa}/ca_certificates`,kongManager:`${Aa}/ca_certificates`},form:{konnect:{create:`${Sa}/ca_certificates`,edit:`${Sa}/ca_certificates/{id}`},kongManager:{create:`${Aa}/ca_certificates`,edit:`${Aa}/ca_certificates/{id}`}}},cp={class:"kong-ui-ca-certificate-entity-config-card"},lp={key:0},up=tr(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:a}}=Xe.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:d}=Xe.useCertificate(),g=o.computed(()=>Xn.form[n.config.app].edit),h=o.ref(),L=o.computed(()=>{if(h.value)return d(h.value)}),ne=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaIssuer)||""}),re=o.computed(()=>{var P,M;return(P=L.value)!=null&&P.schemaExpiry?a((M=L.value)==null?void 0:M.schemaExpiry):""}),X=o.computed(()=>{var P;return((P=L.value)==null?void 0:P.schemaKeyUsages)||[]}),ie=(P,M)=>{const oe=f("rowValue",M);if(P==="expiry")return re.value;if(P==="key_usages")return X.value;if(oe)return oe[P]},Me=P=>{h.value=P,i("fetch:success",P)},Se=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 oe=o.resolveComponent("KCodeBlock"),R=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",cp,[o.createVNode(o.unref(A.EntityBaseConfigCard),{config:r.config,"config-card-doc":r.configCardDoc,"config-schema":Se.value,"entity-type":o.unref(A.SupportedEntityType).CaCertificate,"fetch-url":g.value,"hide-title":r.hideTitle,"onFetch:error":M[0]||(M[0]=S=>P.$emit("fetch:error",S)),"onFetch:success":Me,onLoading:M[1]||(M[1]=S=>P.$emit("loading",S))},{cert:o.withCtx(S=>[o.unref(f)("rowValue",S)?(o.openBlock(),o.createBlock(oe,{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:ie(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(re.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ne.value||"–"),1)]),key_usages:o.withCtx(()=>[X.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",lp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(X.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"]]),fp={class:"kong-ui-entities-ca-certificates-list"},dp={class:"button-row"},pp={key:0},hp={key:1},yp={key:0},gp={key:1},mp=tr(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 Rt;const t=e,i=r,{i18n:{t:n,formatUnixTimeStamp:s},i18nT:a}=Xe.useI18n(),u=gi.useRouter(),{axiosInstance:f}=A.useAxios((Rt=i.config)==null?void 0:Rt.axiosRequestConfig),{hasRecords:d,handleStateChange:g}=A.useTableState(()=>ie.value),h=o.computed(()=>d.value&&i.config.app==="konnect"),L=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),re={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}},X=o.computed(()=>{var O,H;let W=`${i.config.apiBaseUrl}${Xn.list[i.config.app]}`;return i.config.app==="konnect"?W=W.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(W=W.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),W}),ie=o.ref(""),Me=o.computed(()=>{const W=i.config.app==="konnect"||i.config.isExactMatch;return W?{isExactMatch:W,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:W,schema:i.config.filterSchema}}),{fetcher:Se,fetcherState:P,fetcherCacheKey:M}=A.useFetcher(o.computed(()=>({...i.config,cacheIdentifier:i.cacheIdentifier})),X),oe=()=>{ie.value=""},R=()=>{M.value++},j=o.ref(null),S=async(W,O)=>{const H=W.id;if(!await O(H)){t("copy:error",{entity:W,field:"id",message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:W,field:"id",message:n("ca-certificates.copy.success",{val:H})})},F=async(W,O)=>{const H=JSON.stringify(W);if(!await O(H)){t("copy:error",{entity:W,message:n("ca-certificates.errors.copy")});return}t("copy:success",{entity:W,message:n("ca-certificates.copy.success_brief")})},Z=async W=>{var H;await((H=i.canRetrieve)==null?void 0:H.call(i,W))&&u.push(i.config.getViewRoute(W.id))},lt=W=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(W)}),ut=W=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(W)}),se=o.ref(void 0),ce=o.ref(!1),z=o.ref(!1),ft=o.ref(""),rr=A.useDeleteUrlBuilder(i.config,X.value),{certificateDataCache:Vr,getCertificateData:Pt}=Xe.useCertificate(),kt=W=>{se.value=W,ce.value=!0},jr=()=>{ce.value=!1},U=async()=>{var W,O,H;if((W=se.value)!=null&&W.id){z.value=!0;try{await f.delete(rr(se.value.id)),z.value=!1,ce.value=!1,M.value++,t("delete:success",se.value)}catch(G){ft.value=((H=(O=G.response)==null?void 0:O.data)==null?void 0:H.message)||G.message||n("ca-certificates.errors.delete"),t("error",G)}finally{z.value=!1}}},dt=()=>{u.push(i.config.createRoute)};o.watch(P,W=>{var O,H,G;if(W.status===A.FetcherStatus.Error){j.value={title:n("ca-certificates.errors.general")},(G=(H=(O=W.error)==null?void 0:O.response)==null?void 0:H.data)!=null&&G.message&&(j.value.message=W.error.response.data.message),t("error",W.error);return}Vr.value={},j.value=null});const ir=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")}),ae=o.ref(!1);return o.onBeforeMount(async()=>{ae.value=await i.canCreate(),ae.value&&(ir.value.title=n("ca-certificates.list.empty_state.title"),ir.value.ctaText=n("ca-certificates.actions.create"))}),(W,O)=>{const H=o.resolveComponent("KButton"),G=o.resolveComponent("KEmptyState"),Ae=o.resolveComponent("KDropdownItem"),Ct=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",fp,[o.createVNode(o.unref(A.EntityBaseTable),{"cache-identifier":r.cacheIdentifier,"disable-sorting":L.value,"empty-state-options":ir.value,"enable-entity-actions":"","error-message":j.value,fetcher:o.unref(Se),"fetcher-cache-key":o.unref(M),"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:ie.value,"table-headers":o.unref(re),onClearSearchInput:oe,"onClick:row":O[3]||(O[3]=K=>Z(K)),onSort:R,onState:o.unref(g)},o.createSlots({"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(A.EntityFilter),{modelValue:ie.value,"onUpdate:modelValue":O[0]||(O[0]=K=>ie.value=K),config:Me.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(_e.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",dp,[h.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=>W.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.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(_e.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 Ee;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",pp,o.toDisplayString((Ee=K==null?void 0:K.metadata)!=null&&Ee.issuer?K.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",hp,o.toDisplayString(o.unref(Pt)(K).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:K})=>{var Ee;return[r.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",yp,o.toDisplayString((Ee=K==null?void 0:K.metadata)!=null&&Ee.expiry?o.unref(s)(K.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",gp,o.toDisplayString(o.unref(Pt)(K).schemaExpiry?o.unref(s)(o.unref(Pt)(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(Ct,null,{default:o.withCtx(({copyToClipboard:Ee})=>[o.createVNode(Ae,{"data-testid":"action-entity-copy-id",onClick:D=>S(K,Ee)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:1},8,["onClick"])]),_:2},1024),o.createVNode(Ct,null,{default:o.withCtx(({copyToClipboard:Ee})=>[o.createVNode(Ae,{"data-testid":"action-entity-copy-json",onClick:D=>F(K,Ee)},{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(Ae,{"data-testid":"action-entity-view","has-divider":"",item:lt(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(Ae,{"data-testid":"action-entity-edit",item:ut(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(Ae,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ee=>kt(K)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:1},8,["onClick"])]),_:2},1032,["auth-function"])]),_:2},[!ie.value&&r.config.app==="konnect"?{name:"empty-state",fn:o.withCtx(()=>{var K;return[o.createVNode(G,{"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(_e.ServiceDocumentIcon),{decorative:""})]),action:o.withCtx(()=>[ae.value?(o.openBlock(),o.createBlock(H,{key:0,"data-testid":"entity-create-button",onClick:dt},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.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]=Ee=>W.$emit("click:learn-more"))},{default:o.withCtx(()=>[o.createVNode(o.unref(_e.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":z.value,"entity-type":o.unref(A.EntityTypes).CACertificate,error:ft.value,title:o.unref(n)("ca-certificates.delete.title"),visible:ce.value,onCancel:jr,onProceed:U},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{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"]]),bp={class:"kong-ui-entities-ca-certificates-form"},vp=tr(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 Se;const t=e,i=r,n=gi.useRouter(),{i18n:{t:s}}=Xe.useI18n(),{getMessageFromError:a}=A.useErrors(),{axiosInstance:u}=A.useAxios((Se=i.config)==null?void 0:Se.axiosRequestConfig),f=o.computed(()=>Xn.form[i.config.app].edit),d=o.computed(()=>i.certificateId?A.EntityBaseFormType.Edit:A.EntityBaseFormType.Create),g=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),h=o.reactive({cert:"",certDigest:"",tags:""}),L=o.computed(()=>(d.value===A.EntityBaseFormType.Create||JSON.stringify(g.fields)!==JSON.stringify(h))&&!!g.fields.cert),ne=P=>{var M;g.fields.cert=(P==null?void 0:P.cert)||"",g.fields.certDigest=(P==null?void 0:P.cert_digest)||"",g.fields.tags=((M=P==null?void 0:P.tags)==null?void 0:M.join(", "))||"",Object.assign(h,g.fields)},re=()=>{n.push(i.config.cancelRoute)},X=o.computed(()=>{var M,oe;let P=`${i.config.apiBaseUrl}${Xn.form[i.config.app][d.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,(oe=i.config)!=null&&oe.workspace?`/${i.config.workspace}`:"")),P=P.replace(/{id}/gi,i.certificateId),P}),ie=o.computed(()=>{var P,M;return{cert:g.fields.cert,cert_digest:g.fields.certDigest||null,tags:(M=(P=g.fields.tags.split(","))==null?void 0:P.map(oe=>String(oe||"").trim()))==null?void 0:M.filter(oe=>oe!=="")}}),Me=async()=>{var P,M,oe,R,j;try{g.isReadonly=!0;let S;d.value==="create"?S=await u.post(X.value,ie.value):d.value==="edit"&&(S=((P=i.config)==null?void 0:P.app)==="konnect"?await u.put(X.value,ie.value):await u.patch(X.value,ie.value)),g.fields.cert=((M=S==null?void 0:S.data)==null?void 0:M.cert)||"",g.fields.certDigest=((oe=S==null?void 0:S.data)==null?void 0:oe.cert_digest)||"",g.fields.tags=((j=(R=S==null?void 0:S.data)==null?void 0:R.tags)==null?void 0:j.join(", "))||"",Object.assign(h,g.fields),t("update",S==null?void 0:S.data)}catch(S){g.errorMessage=a(S),t("error",S)}finally{g.isReadonly=!1}};return(P,M)=>{const oe=o.resolveComponent("KTextArea"),R=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",bp,[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":g.errorMessage,"fetch-url":f.value,"form-fields":ie.value,"is-readonly":g.isReadonly,onCancel:re,"onFetch:error":M[3]||(M[3]=j=>P.$emit("error",j)),"onFetch:success":ne,onLoading:M[4]||(M[4]=j=>P.$emit("loading",j)),onSubmit:Me},{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(oe,{modelValue:g.fields.cert,"onUpdate:modelValue":M[0]||(M[0]=j=>g.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:g.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(R,{modelValue:g.fields.certDigest,"onUpdate:modelValue":M[1]||(M[1]=j=>g.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:g.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:g.fields.tags,"onUpdate:modelValue":M[2]||(M[2]=j=>g.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:g.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"]]),wp={class:"kong-ui-certificate-entity-config-card"},Sp={key:0},Ap=tr(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:a}=Xe.useI18n(),{convertKeyToTitle:u}=A.useStringHelpers(),{getPropValue:f}=A.useHelpers(),{getCertificateData:d}=Xe.useCertificate(),g=o.computed(()=>Qn.form[i.config.app].edit),h=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}}),ne=S=>{h.value=S,t("fetch:success",S)},re=(S,F)=>{const Z=f("rowValue",F);if(S==="expiry")return ie.value;if(S==="key_usages")return M.value;if(S==="san_names")return Se.value;if(Z)return Z[S]},X=o.computed(()=>{if(h.value)return d(h.value)}),ie=o.computed(()=>{var S,F;return(S=X.value)!=null&&S.schemaExpiry?s((F=X.value)==null?void 0:F.schemaExpiry):""}),Me=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaIssuer)||""}),Se=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaSanNames)||""}),P=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaSubject)||""}),M=o.computed(()=>{var S;return((S=X.value)==null?void 0:S.schemaKeyUsages)||[]}),oe=o.computed(()=>{var S,F;return((F=(S=h==null?void 0:h.value)==null?void 0:S.snis)==null?void 0:F.length)>0}),R=o.computed(()=>{var S;return!!((S=h==null?void 0:h.value)!=null&&S.cert_alt)}),j=S=>{var F,Z;return S==="san_names"?n("certificates.list.table_headers.san"):((Z=(F=L.value)==null?void 0:F[S])==null?void 0:Z.label)||u(S)};return(S,F)=>{const Z=o.resolveComponent("KCodeBlock"),lt=o.resolveComponent("KLabel"),ut=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",wp,[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":g.value,"hide-title":r.hideTitle,"onFetch:error":F[0]||(F[0]=se=>S.$emit("fetch:error",se)),"onFetch:success":ne,onLoading:F[1]||(F[1]=se=>S.$emit("loading",se))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(se=>[o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(Z,{key:0,id:`certificate-${r.config.entityId}-cert-codeblock`,code:o.unref(f)("rowValue",se),language:"plaintext","single-line":""},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(lt,{class:"metadata-label"},{default:o.withCtx(()=>[...F[2]||(F[2]=[o.createTextVNode(" Metadata ",-1)])]),_:1})]),metadata:o.withCtx(se=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(f)("rowValue",se)),ce=>(o.openBlock(),o.createBlock(o.unref(A.ConfigCardItem),{key:ce,item:{key:ce,value:re(ce,se),label:j(ce),type:ce==="key_usages"||ce==="snis"||ce==="dns_names"?o.unref(A.ConfigurationSchemaType).BadgeTag:o.unref(A.ConfigurationSchemaType).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Me.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Se.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(P.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{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(a),{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",Sp,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(M.value,(se,ce)=>(o.openBlock(),o.createBlock(ut,{key:`key_usages-badge-tag-${ce}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ce}`,tooltip:se,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(se),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[oe.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(se=>[F[4]||(F[4]=o.createTextVNode(" > ",-1)),o.unref(f)("rowValue",se)?(o.openBlock(),o.createBlock(Z,{key:0,id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:o.unref(f)("rowValue",se),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"]]);Ce.CACertificateConfigCard=up,Ce.CACertificateForm=vp,Ce.CACertificateList=mp,Ce.CertificateConfigCard=Ap,Ce.CertificateForm=ap,Ce.CertificateList=ep,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})});