@kong-ui-public/entities-certificates 1.1.25 → 1.1.26

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.
@@ -1,4 +1,4 @@
1
- (function(we,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],i):(we=typeof globalThis<"u"?globalThis:we||self,i(we["kong-ui-public-entities-certificates"]={},we.Vue,we.VueRouter,we["kong-ui-public-i18n"],we.axios,we.Kongponents))})(this,function(we,i,xr,Wt,zu,Gu){"use strict";var Vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
1
+ (function(we,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("axios"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","axios","@kong/kongponents"],i):(we=typeof globalThis<"u"?globalThis:we||self,i(we["kong-ui-public-entities-certificates"]={},we.Vue,we.VueRouter,we["kong-ui-public-i18n"],we.axios,we.Kongponents))})(this,function(we,i,xr,Wt,zu,Gu){"use strict";var Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! *****************************************************************************
2
2
  Copyright (C) Microsoft. All rights reserved.
3
3
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
4
  this file except in compliance with the License. You may obtain a copy of the
@@ -11,7 +11,7 @@
11
11
 
12
12
  See the Apache Version 2.0 License for specific language governing permissions
13
13
  and limitations under the License.
14
- ***************************************************************************** */var ta;(function(r){(function(e){var t=typeof Vn=="object"?Vn:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=o(r);typeof t.Reflect>"u"?t.Reflect=r:n=o(t.Reflect,n),e(n);function o(s,c){return function(d,u){typeof s[d]!="function"&&Object.defineProperty(s,d,{configurable:!0,writable:!0,value:u}),c&&c(d,u)}}})(function(e){var t=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",o=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",d={__proto__:[]}instanceof Array,u=!c&&!d,f={create:c?function(){return ea(Object.create(null))}:d?function(){return ea({__proto__:null})}:function(){return ea({})},has:u?function(S,x){return t.call(S,x)}:function(S,x){return x in S},get:u?function(S,x){return t.call(S,x)?S[x]:void 0}:function(S,x){return S[x]}},h=Object.getPrototypeOf(Function),w=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",T=!w&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:fy(),C=!w&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:py(),p=!w&&typeof WeakMap=="function"?WeakMap:hy(),m=new p;function y(S,x,N,j){if(H(N)){if(!q(S))throw new TypeError;if(!Gt(x))throw new TypeError;return V(S,x)}else{if(!q(S))throw new TypeError;if(!J(x))throw new TypeError;if(!J(j)&&!H(j)&&!ce(j))throw new TypeError;return ce(j)&&(j=void 0),N=le(N),M(S,x,N,j)}}e("decorate",y);function b(S,x){function N(j,K){if(!J(j))throw new TypeError;if(!H(K)&&!ay(K))throw new TypeError;mt(S,x,j,K)}return N}e("metadata",b);function k(S,x,N,j){if(!J(N))throw new TypeError;return H(j)||(j=le(j)),mt(S,x,N,j)}e("defineMetadata",k);function g(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),L(S,x,N)}e("hasMetadata",g);function A(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),fe(S,x,N)}e("hasOwnMetadata",A);function I(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),Ve(S,x,N)}e("getMetadata",I);function B(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),Be(S,x,N)}e("getOwnMetadata",B);function _(S,x){if(!J(S))throw new TypeError;return H(x)||(x=le(x)),Sr(S,x)}e("getMetadataKeys",_);function X(S,x){if(!J(S))throw new TypeError;return H(x)||(x=le(x)),At(S,x)}e("getOwnMetadataKeys",X);function W(S,x,N){if(!J(x))throw new TypeError;H(N)||(N=le(N));var j=z(x,N,!1);if(H(j)||!j.delete(S))return!1;if(j.size>0)return!0;var K=m.get(x);return K.delete(N),K.size>0||m.delete(x),!0}e("deleteMetadata",W);function V(S,x){for(var N=S.length-1;N>=0;--N){var j=S[N],K=j(x);if(!H(K)&&!ce(K)){if(!Gt(K))throw new TypeError;x=K}}return x}function M(S,x,N,j){for(var K=S.length-1;K>=0;--K){var ve=S[K],Q=ve(x,N,j);if(!H(Q)&&!ce(Q)){if(!J(Q))throw new TypeError;j=Q}}return j}function z(S,x,N){var j=m.get(S);if(H(j)){if(!N)return;j=new T,m.set(S,j)}var K=j.get(x);if(H(K)){if(!N)return;K=new T,j.set(x,K)}return K}function L(S,x,N){var j=fe(S,x,N);if(j)return!0;var K=Xs(x);return ce(K)?!1:L(S,K,N)}function fe(S,x,N){var j=z(x,N,!1);return H(j)?!1:Cr(j.has(S))}function Ve(S,x,N){var j=fe(S,x,N);if(j)return Be(S,x,N);var K=Xs(x);if(!ce(K))return Ve(S,K,N)}function Be(S,x,N){var j=z(x,N,!1);if(!H(j))return j.get(S)}function mt(S,x,N,j){var K=z(N,j,!0);K.set(S,x)}function Sr(S,x){var N=At(S,x),j=Xs(S);if(j===null)return N;var K=Sr(j,x);if(K.length<=0)return N;if(N.length<=0)return K;for(var ve=new C,Q=[],ee=0,G=N;ee<G.length;ee++){var ie=G[ee],ne=ve.has(ie);ne||(ve.add(ie),Q.push(ie))}for(var Bt=0,Fu=K;Bt<Fu.length;Bt++){var ie=Fu[Bt],ne=ve.has(ie);ne||(ve.add(ie),Q.push(ie))}return Q}function At(S,x){var N=[],j=z(S,x,!1);if(H(j))return N;for(var K=j.keys(),ve=cy(K),Q=0;;){var ee=uy(ve);if(!ee)return N.length=Q,N;var G=ly(ee);try{N[Q]=G}catch(ie){try{dy(ve)}finally{throw ie}}Q++}}function zt(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function H(S){return S===void 0}function ce(S){return S===null}function F(S){return typeof S=="symbol"}function J(S){return typeof S=="object"?S!==null:typeof S=="function"}function ge(S,x){switch(zt(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var N=x===3?"string":x===5?"number":"default",j=Hu(S,o);if(j!==void 0){var K=j.call(S,N);if(J(K))throw new TypeError;return K}return Re(S,N==="default"?"number":N)}function Re(S,x){if(x==="string"){var N=S.toString;if(ue(N)){var j=N.call(S);if(!J(j))return j}var K=S.valueOf;if(ue(K)){var j=K.call(S);if(!J(j))return j}}else{var K=S.valueOf;if(ue(K)){var j=K.call(S);if(!J(j))return j}var ve=S.toString;if(ue(ve)){var j=ve.call(S);if(!J(j))return j}}throw new TypeError}function Cr(S){return!!S}function Z(S){return""+S}function le(S){var x=ge(S,3);return F(x)?x:Z(x)}function q(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function ue(S){return typeof S=="function"}function Gt(S){return typeof S=="function"}function ay(S){switch(zt(S)){case 3:return!0;case 4:return!0;default:return!1}}function Hu(S,x){var N=S[x];if(N!=null){if(!ue(N))throw new TypeError;return N}}function cy(S){var x=Hu(S,s);if(!ue(x))throw new TypeError;var N=x.call(S);if(!J(N))throw new TypeError;return N}function ly(S){return S.value}function uy(S){var x=S.next();return x.done?!1:x}function dy(S){var x=S.return;x&&x.call(S)}function Xs(S){var x=Object.getPrototypeOf(S);if(typeof S!="function"||S===h||x!==h)return x;var N=S.prototype,j=N&&Object.getPrototypeOf(N);if(j==null||j===Object.prototype)return x;var K=j.constructor;return typeof K!="function"||K===S?x:K}function fy(){var S={},x=[],N=function(){function Q(ee,G,ie){this._index=0,this._keys=ee,this._values=G,this._selector=ie}return Q.prototype["@@iterator"]=function(){return this},Q.prototype[s]=function(){return this},Q.prototype.next=function(){var ee=this._index;if(ee>=0&&ee<this._keys.length){var G=this._selector(this._keys[ee],this._values[ee]);return ee+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:G,done:!1}}return{value:void 0,done:!0}},Q.prototype.throw=function(ee){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),ee},Q.prototype.return=function(ee){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:ee,done:!0}},Q}();return function(){function Q(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(Q.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Q.prototype.has=function(ee){return this._find(ee,!1)>=0},Q.prototype.get=function(ee){var G=this._find(ee,!1);return G>=0?this._values[G]:void 0},Q.prototype.set=function(ee,G){var ie=this._find(ee,!0);return this._values[ie]=G,this},Q.prototype.delete=function(ee){var G=this._find(ee,!1);if(G>=0){for(var ie=this._keys.length,ne=G+1;ne<ie;ne++)this._keys[ne-1]=this._keys[ne],this._values[ne-1]=this._values[ne];return this._keys.length--,this._values.length--,ee===this._cacheKey&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},Q.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},Q.prototype.keys=function(){return new N(this._keys,this._values,j)},Q.prototype.values=function(){return new N(this._keys,this._values,K)},Q.prototype.entries=function(){return new N(this._keys,this._values,ve)},Q.prototype["@@iterator"]=function(){return this.entries()},Q.prototype[s]=function(){return this.entries()},Q.prototype._find=function(ee,G){return this._cacheKey!==ee&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=ee)),this._cacheIndex<0&&G&&(this._cacheIndex=this._keys.length,this._keys.push(ee),this._values.push(void 0)),this._cacheIndex},Q}();function j(Q,ee){return Q}function K(Q,ee){return ee}function ve(Q,ee){return[Q,ee]}}function py(){return function(){function S(){this._map=new T}return Object.defineProperty(S.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),S.prototype.has=function(x){return this._map.has(x)},S.prototype.add=function(x){return this._map.set(x,x),this},S.prototype.delete=function(x){return this._map.delete(x)},S.prototype.clear=function(){this._map.clear()},S.prototype.keys=function(){return this._map.keys()},S.prototype.values=function(){return this._map.values()},S.prototype.entries=function(){return this._map.entries()},S.prototype["@@iterator"]=function(){return this.keys()},S.prototype[s]=function(){return this.keys()},S}()}function hy(){var S=16,x=f.create(),N=j();return function(){function G(){this._key=j()}return G.prototype.has=function(ie){var ne=K(ie,!1);return ne!==void 0?f.has(ne,this._key):!1},G.prototype.get=function(ie){var ne=K(ie,!1);return ne!==void 0?f.get(ne,this._key):void 0},G.prototype.set=function(ie,ne){var Bt=K(ie,!0);return Bt[this._key]=ne,this},G.prototype.delete=function(ie){var ne=K(ie,!1);return ne!==void 0?delete ne[this._key]:!1},G.prototype.clear=function(){this._key=j()},G}();function j(){var G;do G="@@WeakMap@@"+ee();while(f.has(x,G));return x[G]=!0,G}function K(G,ie){if(!t.call(G,N)){if(!ie)return;Object.defineProperty(G,N,{value:f.create()})}return G[N]}function ve(G,ie){for(var ne=0;ne<ie;++ne)G[ne]=Math.random()*255|0;return G}function Q(G){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(G)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(G)):ve(new Uint8Array(G),G):ve(new Array(G),G)}function ee(){var G=Q(S);G[6]=G[6]&79|64,G[8]=G[8]&191|128;for(var ie="",ne=0;ne<S;++ne){var Bt=G[ne];(ne===4||ne===6||ne===8)&&(ie+="-"),Bt<16&&(ie+="0"),ie+=Bt.toString(16).toLowerCase()}return ie}}function ea(S){return S.__=void 0,delete S.__,S}})})(ta||(ta={}));/*!
14
+ ***************************************************************************** */var ta;(function(r){(function(e){var t=typeof Tn=="object"?Tn:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=o(r);typeof t.Reflect>"u"?t.Reflect=r:n=o(t.Reflect,n),e(n);function o(s,c){return function(d,u){typeof s[d]!="function"&&Object.defineProperty(s,d,{configurable:!0,writable:!0,value:u}),c&&c(d,u)}}})(function(e){var t=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",o=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",d={__proto__:[]}instanceof Array,u=!c&&!d,f={create:c?function(){return ea(Object.create(null))}:d?function(){return ea({__proto__:null})}:function(){return ea({})},has:u?function(S,x){return t.call(S,x)}:function(S,x){return x in S},get:u?function(S,x){return t.call(S,x)?S[x]:void 0}:function(S,x){return S[x]}},h=Object.getPrototypeOf(Function),w=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",V=!w&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:fy(),C=!w&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:py(),p=!w&&typeof WeakMap=="function"?WeakMap:hy(),m=new p;function y(S,x,N,j){if(H(N)){if(!q(S))throw new TypeError;if(!Gt(x))throw new TypeError;return T(S,x)}else{if(!q(S))throw new TypeError;if(!J(x))throw new TypeError;if(!J(j)&&!H(j)&&!ce(j))throw new TypeError;return ce(j)&&(j=void 0),N=le(N),M(S,x,N,j)}}e("decorate",y);function b(S,x){function N(j,K){if(!J(j))throw new TypeError;if(!H(K)&&!ay(K))throw new TypeError;mt(S,x,j,K)}return N}e("metadata",b);function k(S,x,N,j){if(!J(N))throw new TypeError;return H(j)||(j=le(j)),mt(S,x,N,j)}e("defineMetadata",k);function g(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),L(S,x,N)}e("hasMetadata",g);function A(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),fe(S,x,N)}e("hasOwnMetadata",A);function B(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),Te(S,x,N)}e("getMetadata",B);function E(S,x,N){if(!J(x))throw new TypeError;return H(N)||(N=le(N)),Be(S,x,N)}e("getOwnMetadata",E);function _(S,x){if(!J(S))throw new TypeError;return H(x)||(x=le(x)),Sr(S,x)}e("getMetadataKeys",_);function X(S,x){if(!J(S))throw new TypeError;return H(x)||(x=le(x)),At(S,x)}e("getOwnMetadataKeys",X);function W(S,x,N){if(!J(x))throw new TypeError;H(N)||(N=le(N));var j=z(x,N,!1);if(H(j)||!j.delete(S))return!1;if(j.size>0)return!0;var K=m.get(x);return K.delete(N),K.size>0||m.delete(x),!0}e("deleteMetadata",W);function T(S,x){for(var N=S.length-1;N>=0;--N){var j=S[N],K=j(x);if(!H(K)&&!ce(K)){if(!Gt(K))throw new TypeError;x=K}}return x}function M(S,x,N,j){for(var K=S.length-1;K>=0;--K){var ve=S[K],Q=ve(x,N,j);if(!H(Q)&&!ce(Q)){if(!J(Q))throw new TypeError;j=Q}}return j}function z(S,x,N){var j=m.get(S);if(H(j)){if(!N)return;j=new V,m.set(S,j)}var K=j.get(x);if(H(K)){if(!N)return;K=new V,j.set(x,K)}return K}function L(S,x,N){var j=fe(S,x,N);if(j)return!0;var K=Xs(x);return ce(K)?!1:L(S,K,N)}function fe(S,x,N){var j=z(x,N,!1);return H(j)?!1:Cr(j.has(S))}function Te(S,x,N){var j=fe(S,x,N);if(j)return Be(S,x,N);var K=Xs(x);if(!ce(K))return Te(S,K,N)}function Be(S,x,N){var j=z(x,N,!1);if(!H(j))return j.get(S)}function mt(S,x,N,j){var K=z(N,j,!0);K.set(S,x)}function Sr(S,x){var N=At(S,x),j=Xs(S);if(j===null)return N;var K=Sr(j,x);if(K.length<=0)return N;if(N.length<=0)return K;for(var ve=new C,Q=[],ee=0,G=N;ee<G.length;ee++){var ie=G[ee],ne=ve.has(ie);ne||(ve.add(ie),Q.push(ie))}for(var Bt=0,Fu=K;Bt<Fu.length;Bt++){var ie=Fu[Bt],ne=ve.has(ie);ne||(ve.add(ie),Q.push(ie))}return Q}function At(S,x){var N=[],j=z(S,x,!1);if(H(j))return N;for(var K=j.keys(),ve=cy(K),Q=0;;){var ee=uy(ve);if(!ee)return N.length=Q,N;var G=ly(ee);try{N[Q]=G}catch(ie){try{dy(ve)}finally{throw ie}}Q++}}function zt(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function H(S){return S===void 0}function ce(S){return S===null}function F(S){return typeof S=="symbol"}function J(S){return typeof S=="object"?S!==null:typeof S=="function"}function ge(S,x){switch(zt(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var N=x===3?"string":x===5?"number":"default",j=Hu(S,o);if(j!==void 0){var K=j.call(S,N);if(J(K))throw new TypeError;return K}return Re(S,N==="default"?"number":N)}function Re(S,x){if(x==="string"){var N=S.toString;if(ue(N)){var j=N.call(S);if(!J(j))return j}var K=S.valueOf;if(ue(K)){var j=K.call(S);if(!J(j))return j}}else{var K=S.valueOf;if(ue(K)){var j=K.call(S);if(!J(j))return j}var ve=S.toString;if(ue(ve)){var j=ve.call(S);if(!J(j))return j}}throw new TypeError}function Cr(S){return!!S}function Z(S){return""+S}function le(S){var x=ge(S,3);return F(x)?x:Z(x)}function q(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function ue(S){return typeof S=="function"}function Gt(S){return typeof S=="function"}function ay(S){switch(zt(S)){case 3:return!0;case 4:return!0;default:return!1}}function Hu(S,x){var N=S[x];if(N!=null){if(!ue(N))throw new TypeError;return N}}function cy(S){var x=Hu(S,s);if(!ue(x))throw new TypeError;var N=x.call(S);if(!J(N))throw new TypeError;return N}function ly(S){return S.value}function uy(S){var x=S.next();return x.done?!1:x}function dy(S){var x=S.return;x&&x.call(S)}function Xs(S){var x=Object.getPrototypeOf(S);if(typeof S!="function"||S===h||x!==h)return x;var N=S.prototype,j=N&&Object.getPrototypeOf(N);if(j==null||j===Object.prototype)return x;var K=j.constructor;return typeof K!="function"||K===S?x:K}function fy(){var S={},x=[],N=function(){function Q(ee,G,ie){this._index=0,this._keys=ee,this._values=G,this._selector=ie}return Q.prototype["@@iterator"]=function(){return this},Q.prototype[s]=function(){return this},Q.prototype.next=function(){var ee=this._index;if(ee>=0&&ee<this._keys.length){var G=this._selector(this._keys[ee],this._values[ee]);return ee+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:G,done:!1}}return{value:void 0,done:!0}},Q.prototype.throw=function(ee){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),ee},Q.prototype.return=function(ee){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:ee,done:!0}},Q}();return function(){function Q(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(Q.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Q.prototype.has=function(ee){return this._find(ee,!1)>=0},Q.prototype.get=function(ee){var G=this._find(ee,!1);return G>=0?this._values[G]:void 0},Q.prototype.set=function(ee,G){var ie=this._find(ee,!0);return this._values[ie]=G,this},Q.prototype.delete=function(ee){var G=this._find(ee,!1);if(G>=0){for(var ie=this._keys.length,ne=G+1;ne<ie;ne++)this._keys[ne-1]=this._keys[ne],this._values[ne-1]=this._values[ne];return this._keys.length--,this._values.length--,ee===this._cacheKey&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},Q.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},Q.prototype.keys=function(){return new N(this._keys,this._values,j)},Q.prototype.values=function(){return new N(this._keys,this._values,K)},Q.prototype.entries=function(){return new N(this._keys,this._values,ve)},Q.prototype["@@iterator"]=function(){return this.entries()},Q.prototype[s]=function(){return this.entries()},Q.prototype._find=function(ee,G){return this._cacheKey!==ee&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=ee)),this._cacheIndex<0&&G&&(this._cacheIndex=this._keys.length,this._keys.push(ee),this._values.push(void 0)),this._cacheIndex},Q}();function j(Q,ee){return Q}function K(Q,ee){return ee}function ve(Q,ee){return[Q,ee]}}function py(){return function(){function S(){this._map=new V}return Object.defineProperty(S.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),S.prototype.has=function(x){return this._map.has(x)},S.prototype.add=function(x){return this._map.set(x,x),this},S.prototype.delete=function(x){return this._map.delete(x)},S.prototype.clear=function(){this._map.clear()},S.prototype.keys=function(){return this._map.keys()},S.prototype.values=function(){return this._map.values()},S.prototype.entries=function(){return this._map.entries()},S.prototype["@@iterator"]=function(){return this.keys()},S.prototype[s]=function(){return this.keys()},S}()}function hy(){var S=16,x=f.create(),N=j();return function(){function G(){this._key=j()}return G.prototype.has=function(ie){var ne=K(ie,!1);return ne!==void 0?f.has(ne,this._key):!1},G.prototype.get=function(ie){var ne=K(ie,!1);return ne!==void 0?f.get(ne,this._key):void 0},G.prototype.set=function(ie,ne){var Bt=K(ie,!0);return Bt[this._key]=ne,this},G.prototype.delete=function(ie){var ne=K(ie,!1);return ne!==void 0?delete ne[this._key]:!1},G.prototype.clear=function(){this._key=j()},G}();function j(){var G;do G="@@WeakMap@@"+ee();while(f.has(x,G));return x[G]=!0,G}function K(G,ie){if(!t.call(G,N)){if(!ie)return;Object.defineProperty(G,N,{value:f.create()})}return G[N]}function ve(G,ie){for(var ne=0;ne<ie;++ne)G[ne]=Math.random()*255|0;return G}function Q(G){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(G)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(G)):ve(new Uint8Array(G),G):ve(new Array(G),G)}function ee(){var G=Q(S);G[6]=G[6]&79|64,G[8]=G[8]&191|128;for(var ie="",ne=0;ne<S;++ne){var Bt=G[ne];(ne===4||ne===6||ne===8)&&(ie+="-"),Bt<16&&(ie+="0"),ie+=Bt.toString(16).toLowerCase()}return ie}}function ea(S){return S.__=void 0,delete S.__,S}})})(ta||(ta={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 Peculiar Ventures, LLC
@@ -68,11 +68,11 @@
68
68
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
69
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
70
  *
71
- */function oi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Dn(r){let e=0,t=0;for(let o=0;o<r.length;o++){const s=r[o];e+=s.byteLength}const n=new Uint8Array(e);for(let o=0;o<r.length;o++){const s=r[o];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}function nt(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<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 si{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Dn(this.items)}}const Ar=[new Uint8Array([1])],oa="0123456789",$n="name",sa="valueHexView",td="isHexOnly",rd="idBlock",id="tagClass",nd="tagNumber",od="isConstructed",sd="fromBER",ad="toBER",cd="local",Ie="",Ke=new ArrayBuffer(0),ai=new Uint8Array(0),Br="EndOfContent",aa="OCTET STRING",ca="BIT STRING";function Ye(r){var e;return e=class extends r{constructor(...n){var o;super(...n);const s=n[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?P.toUint8Array(s.valueHex):ai}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,s){const c=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!nt(this,c,o,s))return-1;const d=o+s;return this.valueHexView=c.subarray(o,d),this.valueHexView.length?(this.blockLength=s,d):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?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",Ke)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:$.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Et{constructor({blockLength:e=0,error:t=Ie,warnings:n=[],valueBeforeDecode:o=ai}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=P.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:$.ToHex(this.valueBeforeDecodeView)}}}Et.NAME="baseBlock";class xe extends Et{fromBER(e,t,n){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'")}}xe.NAME="valueBlock";class la extends Ye(Et){constructor({idBlock:e={}}={}){var t,n,o,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?P.toUint8Array(e.valueHex):ai,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-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",Ke}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,o[0]=t}return o.buffer}if(!this.isHexOnly){const o=It(this.tagNumber,7),s=new Uint8Array(o),c=o.byteLength,d=new Uint8Array(c+1);if(d[0]=t|31,!e){for(let u=0;u<c-1;u++)d[u+1]=s[u]|128;d[c]=s[c-1]}return d.buffer}const n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)n[s+1]=o[s]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(e,t,n){const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);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 d=s[0]&31;if(d!==31)this.tagNumber=d,this.blockLength=1;else{let u=1,f=this.valueHexView=new Uint8Array(255),h=255;for(;s[u]&128;){if(f[u-1]=s[u]&127,u++,u>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(u===h){h+=255;const T=new Uint8Array(h);for(let C=0;C<f.length;C++)T[C]=f[C];f=this.valueHexView=new Uint8Array(h)}}this.blockLength=u+1,f[u-1]=s[u]&127;const w=new Uint8Array(u);for(let T=0;T<u;T++)w[T]=f[T];f=this.valueHexView=new Uint8Array(u),f.set(w),this.blockLength<=9?this.tagNumber=Jt(f,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}}}la.NAME="identificationBlock";class ua extends Et{constructor({lenBlock:e={}}={}){var t,n,o;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,t,n){const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const d=t+1,u=o.subarray(d,d+c);return u[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Jt(u,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){const o=It(this.length,8);if(o.byteLength>127)return this.error="Too big length",Ke;if(t=new ArrayBuffer(o.byteLength+1),e)return t;const s=new Uint8Array(o);n=new Uint8Array(t),n[0]=o.byteLength|128;for(let c=0;c<o.byteLength;c++)n[c+1]=s[c];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}ua.NAME="lengthBlock";const D={};class me extends Et{constructor({name:e=Ie,optional:t=!1,primitiveSchema:n,...o}={},s){super(o),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new la(o),this.lenBlock=new ua(o),this.valueBlock=s?new s(o):new xe(o)}fromBER(e,t,n){const o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}toBER(e,t){const n=t||new si;t||da(this);const o=this.idBlock.toBER(e);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);n.write(c),n.write(s)}return t?Ke:n.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():$.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${$.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),n=e.toBER();return ed(t,n)}}me.NAME="BaseBlock";function da(r){if(r instanceof D.Constructed)for(const e of r.valueBlock.value)da(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class Rn extends me{constructor({value:e=Ie,...t}={},n){super(t,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,n){const o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}Rn.NAME="BaseStringBlock";class fa extends Ye(xe){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}fa.NAME="PrimitiveValueBlock";var pa;class Ir extends me{constructor(e={}){super(e,fa),this.idBlock.isConstructed=!1}}pa=Ir,D.Primitive=pa,Ir.NAME="PRIMITIVE";function ld(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 Yt(r,e=0,t=r.length){const n=e;let o=new me({},xe);const s=new Et;if(!nt(s,r,e,t))return o.error=s.error,{offset:-1,result:o};if(!r.subarray(e,e+t).length)return o.error="Zero buffer length",{offset:-1,result:o};let d=o.idBlock.fromBER(r,e,t);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),d===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=d,t-=o.idBlock.blockLength,d=o.lenBlock.fromBER(r,e,t),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),d===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=d,t-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let u=me;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};u=D.EndOfContent;break;case 1:u=D.Boolean;break;case 2:u=D.Integer;break;case 3:u=D.BitString;break;case 4:u=D.OctetString;break;case 5:u=D.Null;break;case 6:u=D.ObjectIdentifier;break;case 10:u=D.Enumerated;break;case 12:u=D.Utf8String;break;case 13:u=D.RelativeObjectIdentifier;break;case 14:u=D.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:u=D.Sequence;break;case 17:u=D.Set;break;case 18:u=D.NumericString;break;case 19:u=D.PrintableString;break;case 20:u=D.TeletexString;break;case 21:u=D.VideotexString;break;case 22:u=D.IA5String;break;case 23:u=D.UTCTime;break;case 24:u=D.GeneralizedTime;break;case 25:u=D.GraphicString;break;case 26:u=D.VisibleString;break;case 27:u=D.GeneralString;break;case 28:u=D.UniversalString;break;case 29:u=D.CharacterString;break;case 30:u=D.BmpString;break;case 31:u=D.DATE;break;case 32:u=D.TimeOfDay;break;case 33:u=D.DateTime;break;case 34:u=D.Duration;break;default:{const f=o.idBlock.isConstructed?new D.Constructed:new D.Primitive;f.idBlock=o.idBlock,f.lenBlock=o.lenBlock,f.warnings=o.warnings,o=f}}break;case 2:case 3:case 4:default:u=o.idBlock.isConstructed?D.Constructed:D.Primitive}return o=ld(o,u),d=o.fromBER(r,e,o.lenBlock.isIndefiniteForm?t:o.lenBlock.length),o.valueBeforeDecodeView=r.subarray(n,n+o.blockLength),{offset:d,result:o}}function Zt(r){if(!r.byteLength){const e=new me({},xe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Yt(P.toUint8Array(r).slice(),0,r.byteLength)}function ud(r,e){return r?1:e}class bt extends xe{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;if(this.valueBeforeDecodeView=o.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;ud(this.isIndefiniteForm,n)>0;){const c=Yt(o,s,n);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,n-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Br)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Br?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const n=t||new si;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,n);return t?Ke:n.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}bt.NAME="ConstructedValueBlock";var ha;class Ee extends me{constructor(e={}){super(e,bt),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){const e=[];for(const n of this.valueBlock.value)e.push(n.toString("ascii").split(`
71
+ */function oi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Dn(r){let e=0,t=0;for(let o=0;o<r.length;o++){const s=r[o];e+=s.byteLength}const n=new Uint8Array(e);for(let o=0;o<r.length;o++){const s=r[o];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}function nt(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<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 si{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Dn(this.items)}}const Ar=[new Uint8Array([1])],oa="0123456789",$n="name",sa="valueHexView",td="isHexOnly",rd="idBlock",id="tagClass",nd="tagNumber",od="isConstructed",sd="fromBER",ad="toBER",cd="local",Ie="",Ke=new ArrayBuffer(0),ai=new Uint8Array(0),Br="EndOfContent",aa="OCTET STRING",ca="BIT STRING";function Ye(r){var e;return e=class extends r{constructor(...n){var o;super(...n);const s=n[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?P.toUint8Array(s.valueHex):ai}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}fromBER(n,o,s){const c=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!nt(this,c,o,s))return-1;const d=o+s;return this.valueHexView=c.subarray(o,d),this.valueHexView.length?(this.blockLength=s,d):(this.warnings.push("Zero buffer length"),o)}toBER(n=!1){return this.isHexOnly?n?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",Ke)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:$.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class Et{constructor({blockLength:e=0,error:t=Ie,warnings:n=[],valueBeforeDecode:o=ai}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=P.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:$.ToHex(this.valueBeforeDecodeView)}}}Et.NAME="baseBlock";class xe extends Et{fromBER(e,t,n){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'")}}xe.NAME="valueBlock";class la extends Ye(Et){constructor({idBlock:e={}}={}){var t,n,o,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?P.toUint8Array(e.valueHex):ai,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(o=e.tagNumber)!==null&&o!==void 0?o:-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",Ke}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,o[0]=t}return o.buffer}if(!this.isHexOnly){const o=It(this.tagNumber,7),s=new Uint8Array(o),c=o.byteLength,d=new Uint8Array(c+1);if(d[0]=t|31,!e){for(let u=0;u<c-1;u++)d[u+1]=s[u]|128;d[c]=s[c-1]}return d.buffer}const n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)n[s+1]=o[s]|128;n[this.valueHexView.byteLength]=o[o.length-1]}return n.buffer}fromBER(e,t,n){const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);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 d=s[0]&31;if(d!==31)this.tagNumber=d,this.blockLength=1;else{let u=1,f=this.valueHexView=new Uint8Array(255),h=255;for(;s[u]&128;){if(f[u-1]=s[u]&127,u++,u>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(u===h){h+=255;const V=new Uint8Array(h);for(let C=0;C<f.length;C++)V[C]=f[C];f=this.valueHexView=new Uint8Array(h)}}this.blockLength=u+1,f[u-1]=s[u]&127;const w=new Uint8Array(u);for(let V=0;V<u;V++)w[V]=f[V];f=this.valueHexView=new Uint8Array(u),f.set(w),this.blockLength<=9?this.tagNumber=Jt(f,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}}}la.NAME="identificationBlock";class ua extends Et{constructor({lenBlock:e={}}={}){var t,n,o;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(o=e.length)!==null&&o!==void 0?o:0}fromBER(e,t,n){const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;const c=s[0]&127;if(c>8)return this.error="Too big integer",-1;if(c+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const d=t+1,u=o.subarray(d,d+c);return u[c-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Jt(u,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=c+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){const o=It(this.length,8);if(o.byteLength>127)return this.error="Too big length",Ke;if(t=new ArrayBuffer(o.byteLength+1),e)return t;const s=new Uint8Array(o);n=new Uint8Array(t),n[0]=o.byteLength|128;for(let c=0;c<o.byteLength;c++)n[c+1]=s[c];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}ua.NAME="lengthBlock";const D={};class me extends Et{constructor({name:e=Ie,optional:t=!1,primitiveSchema:n,...o}={},s){super(o),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new la(o),this.lenBlock=new ua(o),this.valueBlock=s?new s(o):new xe(o)}fromBER(e,t,n){const o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}toBER(e,t){const n=t||new si;t||da(this);const o=this.idBlock.toBER(e);if(n.write(o),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const c=this.lenBlock.toBER(e);n.write(c),n.write(s)}return t?Ke:n.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():$.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${$.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const t=this.toBER(),n=e.toBER();return ed(t,n)}}me.NAME="BaseBlock";function da(r){if(r instanceof D.Constructed)for(const e of r.valueBlock.value)da(e)&&(r.lenBlock.isIndefiniteForm=!0);return!!r.lenBlock.isIndefiniteForm}class Rn extends me{constructor({value:e=Ie,...t}={},n){super(t,n),e&&this.fromString(e)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,n){const o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}Rn.NAME="BaseStringBlock";class fa extends Ye(xe){constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}}fa.NAME="PrimitiveValueBlock";var pa;class Ir extends me{constructor(e={}){super(e,fa),this.idBlock.isConstructed=!1}}pa=Ir,D.Primitive=pa,Ir.NAME="PRIMITIVE";function ld(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 Yt(r,e=0,t=r.length){const n=e;let o=new me({},xe);const s=new Et;if(!nt(s,r,e,t))return o.error=s.error,{offset:-1,result:o};if(!r.subarray(e,e+t).length)return o.error="Zero buffer length",{offset:-1,result:o};let d=o.idBlock.fromBER(r,e,t);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),d===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(e=d,t-=o.idBlock.blockLength,d=o.lenBlock.fromBER(r,e,t),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),d===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(e=d,t-=o.lenBlock.blockLength,!o.idBlock.isConstructed&&o.lenBlock.isIndefiniteForm)return o.error="Indefinite length form used for primitive encoding form",{offset:-1,result:o};let u=me;switch(o.idBlock.tagClass){case 1:if(o.idBlock.tagNumber>=37&&o.idBlock.isHexOnly===!1)return o.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:o};switch(o.idBlock.tagNumber){case 0:if(o.idBlock.isConstructed&&o.lenBlock.length>0)return o.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:o};u=D.EndOfContent;break;case 1:u=D.Boolean;break;case 2:u=D.Integer;break;case 3:u=D.BitString;break;case 4:u=D.OctetString;break;case 5:u=D.Null;break;case 6:u=D.ObjectIdentifier;break;case 10:u=D.Enumerated;break;case 12:u=D.Utf8String;break;case 13:u=D.RelativeObjectIdentifier;break;case 14:u=D.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:u=D.Sequence;break;case 17:u=D.Set;break;case 18:u=D.NumericString;break;case 19:u=D.PrintableString;break;case 20:u=D.TeletexString;break;case 21:u=D.VideotexString;break;case 22:u=D.IA5String;break;case 23:u=D.UTCTime;break;case 24:u=D.GeneralizedTime;break;case 25:u=D.GraphicString;break;case 26:u=D.VisibleString;break;case 27:u=D.GeneralString;break;case 28:u=D.UniversalString;break;case 29:u=D.CharacterString;break;case 30:u=D.BmpString;break;case 31:u=D.DATE;break;case 32:u=D.TimeOfDay;break;case 33:u=D.DateTime;break;case 34:u=D.Duration;break;default:{const f=o.idBlock.isConstructed?new D.Constructed:new D.Primitive;f.idBlock=o.idBlock,f.lenBlock=o.lenBlock,f.warnings=o.warnings,o=f}}break;case 2:case 3:case 4:default:u=o.idBlock.isConstructed?D.Constructed:D.Primitive}return o=ld(o,u),d=o.fromBER(r,e,o.lenBlock.isIndefiniteForm?t:o.lenBlock.length),o.valueBeforeDecodeView=r.subarray(n,n+o.blockLength),{offset:d,result:o}}function Zt(r){if(!r.byteLength){const e=new me({},xe);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Yt(P.toUint8Array(r).slice(),0,r.byteLength)}function ud(r,e){return r?1:e}class bt extends xe{constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;if(this.valueBeforeDecodeView=o.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;ud(this.isIndefiniteForm,n)>0;){const c=Yt(o,s,n);if(c.offset===-1)return this.error=c.result.error,this.warnings.concat(c.result.warnings),-1;if(s=c.offset,this.blockLength+=c.result.blockLength,n-=c.result.blockLength,this.value.push(c.result),this.isIndefiniteForm&&c.result.constructor.NAME===Br)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Br?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){const n=t||new si;for(let o=0;o<this.value.length;o++)this.value[o].toBER(e,n);return t?Ke:n.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const t of this.value)e.value.push(t.toJSON());return e}}bt.NAME="ConstructedValueBlock";var ha;class Ee extends me{constructor(e={}){super(e,bt),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return o===-1?(this.error=this.valueBlock.error,o):(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),o)}onAsciiEncoding(){const e=[];for(const n of this.valueBlock.value)e.push(n.toString("ascii").split(`
72
72
  `).map(o=>` ${o}`).join(`
73
73
  `));const t=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :
74
74
  ${e.join(`
75
- `)}`:`${t} :`}}ha=Ee,D.Constructed=ha,Ee.NAME="CONSTRUCTED";class ya extends xe{fromBER(e,t,n){return t}toBER(e){return Ke}}ya.override="EndOfContentValueBlock";var ga;class Mn extends me{constructor(e={}){super(e,ya),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}ga=Mn,D.EndOfContent=ga,Mn.NAME=Br;var ma;class Nt extends me{constructor(e={}){super(e,xe),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){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+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){const n=new ArrayBuffer(2);if(!e){const o=new Uint8Array(n);o[0]=5,o[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}}ma=Nt,D.Null=ma,Nt.NAME="NULL";class ba extends Ye(xe){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=P.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,n){const o=P.toUint8Array(e);return nt(this,o,t,n)?(this.valueHexView=o.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,na.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ba.NAME="BooleanValueBlock";var va;let ci=class extends me{constructor(e={}){super(e,ba),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};va=ci,D.Boolean=va,ci.NAME="BOOLEAN";class wa extends Ye(bt){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=bt.prototype.fromBER.call(this,e,t,n),o===-1)return o;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===Br){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==aa)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(e,t,n),this.blockLength=n;return o}toBER(e,t){return this.isConstructed?bt.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 ka;let _t=class Ku extends me{constructor({idBlock:e={},lenBlock:t={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},wa),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===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+n);try{if(s.byteLength){const c=Yt(s,0,s.byteLength);c.offset!==-1&&c.offset===n&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Ee.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${$.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof Ku&&e.push(t.valueBlock.valueHexView);return P.concat(e)}};ka=_t,D.OctetString=ka,_t.NAME=aa;class Sa extends Ye(bt){constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let o=-1;if(this.isConstructed){if(o=bt.prototype.fromBER.call(this,e,t,n),o===-1)return o;for(const d of this.value){const u=d.constructor.NAME;if(u===Br){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(u!==ca)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const f=d.valueBlock;if(this.unusedBits>0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return o}const s=P.toUint8Array(e);if(!nt(this,s,t,n))return-1;const c=s.subarray(t,t+n);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const d=c.subarray(1);try{if(d.byteLength){const u=Yt(d,0,d.byteLength);u.offset!==-1&&u.offset===n-1&&(this.value=[u.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+n}toBER(e,t){if(this.isConstructed)return bt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Ke;const n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Sa.NAME="BitStringValueBlock";var Ca;let Ot=class extends me{constructor({idBlock:e={},lenBlock:t={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},Sa),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ee.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const o of t)e.push(o.toString(2).padStart(8,"0"));const n=e.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};Ca=Ot,D.BitString=Ca,Ot.NAME=ca;var xa;function dd(r,e){const t=new Uint8Array([0]),n=new Uint8Array(r),o=new Uint8Array(e);let s=n.slice(0);const c=s.length-1,d=o.slice(0),u=d.length-1;let f=0;const h=u<c?c:u;let w=0;for(let T=h;T>=0;T--,w++){switch(!0){case w<d.length:f=s[c-w]+d[u-w]+t[0];break;default:f=s[c-w]+t[0]}switch(t[0]=f/10,!0){case w>=s.length:s=Pn(new Uint8Array([f%10]),s);break;default:s[c-w]=f%10}}return t[0]>0&&(s=Pn(t,s)),s}function Aa(r){if(r>=Ar.length)for(let e=Ar.length;e<=r;e++){const t=new Uint8Array([0]);let n=Ar[e-1].slice(0);for(let o=n.length-1;o>=0;o--){const s=new Uint8Array([(n[o]<<1)+t[0]]);t[0]=s[0]/10,n[o]=s[0]%10}t[0]>0&&(n=Pn(t,n)),Ar.push(n)}return Ar[r]}function fd(r,e){let t=0;const n=new Uint8Array(r),o=new Uint8Array(e),s=n.slice(0),c=s.length-1,d=o.slice(0),u=d.length-1;let f,h=0;for(let w=u;w>=0;w--,h++)switch(f=s[c-h]-d[u-h]-t,!0){case f<0:t=1,s[c-h]=f+10;break;default:t=0,s[c-h]=f}if(t>0)for(let w=c-u+1;w>=0;w--,h++)if(f=s[c-h]-t,f<0)t=1,s[c-h]=f+10;else{t=0,s[c-h]=f;break}return s.slice()}class Un extends Ye(xe){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=na.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Xu(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,o=0){const s=this.fromBER(e,t,n);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):o!==0&&c.length<o&&(o-c.length>1&&(o=c.length+1),this.valueHexView=c.subarray(o-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){const o=super.fromBER(e,t,n);return o===-1||this.setValueHex(),o}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),n=0,o;const s=this.valueHexView;let c="",d=!1;for(let u=s.byteLength-1;u>=0;u--){o=s[u];for(let f=0;f<8;f++){if((o&1)===1)switch(n){case e:t=fd(Aa(n),t),c="-";break;default:t=dd(t,Aa(n))}n++,o>>=1}}for(let u=0;u<t.length;u++)t[u]&&(d=!0),d&&(c+=oa.charAt(t[u]));return d===!1&&(c+=oa.charAt(0)),c}}xa=Un,Un.NAME="IntegerValueBlock",Object.defineProperty(xa.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ba;class Ze extends me{constructor(e={}){super(e,Un),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return oi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){oi();const t=BigInt(e),n=new si,o=t.toString(16).replace(/^-/,""),s=new Uint8Array($.FromHex(o));if(t<0){const d=new Uint8Array(s.length+(s[0]&128?1:0));d[0]|=128;const f=BigInt(`0x${$.ToHex(d)}`)+t,h=P.toUint8Array($.FromHex(f.toString(16)));h[0]|=128,n.write(h)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new Ze({valueHex:n.final()})}convertToDER(){const e=new Ze({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Ze({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ba=Ze,D.Integer=Ba,Ze.NAME="INTEGER";var Ia;class li extends Ze{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ia=li,D.Enumerated=Ia,li.NAME="ENUMERATED";class Ln extends Ye(xe){constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let d=0;d<n&&(this.valueHexView[d]=s[d]&127,this.blockLength++,!!(s[d]&128));d++);const c=new Uint8Array(this.blockLength);for(let d=0;d<this.blockLength;d++)c[d]=this.valueHexView[d];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Jt(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){oi();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const n=new Uint8Array(t.length/7);for(let o=0;o<n.length;o++)n[o]=parseInt(t.slice(o*7,o*7+7),2)+(o+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=o[c]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const t=It(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ke;const n=new Uint8Array(t.byteLength);if(!e){const o=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)n[c]=o[c]|128;n[s]=o[s]}return n}toString(){let e="";if(this.isHexOnly)e=$.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Ln.NAME="sidBlock";class Ea extends xe{constructor({value:e=Ie,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let o=t;for(;n>0;){const s=new Ln;if(o=s.fromBER(e,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(e){const t=[];for(let n=0;n<this.value.length;n++){const o=this.value[n].toBER(e);if(o.byteLength===0)return this.error=this.value[n].error,Ke;t.push(o)}return Dn(t)}fromString(e){this.value=[];let t=0,n=0,o="",s=!1;do if(n=e.indexOf(".",t),n===-1?o=e.substring(t):o=e.substring(t,n),t=n+1,s){const c=this.value[0];let d=0;switch(c.valueDec){case 0:break;case 1:d=40;break;case 2:d=80;break;default:this.value=[];return}const u=parseInt(o,10);if(isNaN(u))return;c.valueDec=u+d,s=!1}else{const c=new Ln;if(o>Number.MAX_SAFE_INTEGER){oi();const d=BigInt(o);c.valueBigInt=d}else if(c.valueDec=parseInt(o,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(e=`${e}.`),t?(o=`{${o}}`,this.value[n].isFirstSid?e=`2.{${o} - 80}`:e+=o):e+=o}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}}Ea.NAME="ObjectIdentifierValueBlock";var Na;class ui extends me{constructor(e={}){super(e,Ea),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Na=ui,D.ObjectIdentifier=Na,ui.NAME="OBJECT IDENTIFIER";class Hn extends Ye(Et){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let d=0;d<n&&(this.valueHexView[d]=s[d]&127,this.blockLength++,!!(s[d]&128));d++);const c=new Uint8Array(this.blockLength);for(let d=0;d<this.blockLength;d++)c[d]=this.valueHexView[d];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Jt(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 o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=o[c]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const t=It(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ke;const n=new Uint8Array(t.byteLength);if(!e){const o=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)n[c]=o[c]|128;n[s]=o[s]}return n.buffer}toString(){let e="";return this.isHexOnly?e=$.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Hn.NAME="relativeSidBlock";class _a extends xe{constructor({value:e=Ie,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let o=t;for(;n>0;){const s=new Hn;if(o=s.fromBER(e,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(e,t){const n=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(e);if(s.byteLength===0)return this.error=this.value[o].error,Ke;n.push(s)}return Dn(n)}fromString(e){this.value=[];let t=0,n=0,o="";do{n=e.indexOf(".",t),n===-1?o=e.substring(t):o=e.substring(t,n),t=n+1;const s=new Hn;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(o=`{${o}}`),e+=o}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}}_a.NAME="RelativeObjectIdentifierValueBlock";var Oa;class Fn extends me{constructor(e={}){super(e,_a),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Oa=Fn,D.RelativeObjectIdentifier=Oa,Fn.NAME="RelativeObjectIdentifier";var Ta;class ot extends Ee{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ta=ot,D.Sequence=Ta,ot.NAME="SEQUENCE";var Va;let st=class extends Ee{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Va=st,D.Set=Va,st.NAME="SET";class ja extends Ye(xe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Ie}toJSON(){return{...super.toJSON(),value:this.value}}}ja.NAME="StringValueBlock";class Pa extends ja{}Pa.NAME="SimpleStringValueBlock";class Pe extends Rn{constructor({...e}={}){super(e,Pa)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,P.toUint8Array(e))}fromString(e){const t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let o=0;o<t;o++)n[o]=e.charCodeAt(o);this.valueBlock.value=e}}Pe.NAME="SIMPLE STRING";class Da extends Pe{fromBuffer(e){this.valueBlock.valueHexView=P.toUint8Array(e);try{this.valueBlock.value=$.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=$.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array($.FromUtf8String(e)),this.valueBlock.value=e}}Da.NAME="Utf8StringValueBlock";var $a;class at extends Da{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}$a=at,D.Utf8String=$a,at.NAME="UTF8String";class Ra extends Pe{fromBuffer(e){this.valueBlock.value=$.ToUtf16String(e),this.valueBlock.valueHexView=P.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array($.FromUtf16String(e))}}Ra.NAME="BmpStringValueBlock";var Ma;class di extends Ra{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Ma=di,D.BmpString=Ma,di.NAME="BMPString";class Ua extends Pe{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let o=0;o<n.length;o+=4)n[o]=n[o+3],n[o+1]=n[o+2],n[o+2]=0,n[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let o=0;o<t;o++){const s=It(e.charCodeAt(o),8),c=new Uint8Array(s);if(c.length>4)continue;const d=4-c.length;for(let u=c.length-1;u>=0;u--)n[o*4+u+d]=c[u]}this.valueBlock.value=e}}Ua.NAME="UniversalStringValueBlock";var La;class fi extends Ua{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}La=fi,D.UniversalString=La,fi.NAME="UniversalString";var Ha;class pi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Ha=pi,D.NumericString=Ha,pi.NAME="NumericString";var Fa;class hi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Fa=hi,D.PrintableString=Fa,hi.NAME="PrintableString";var Ka;class yi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Ka=yi,D.TeletexString=Ka,yi.NAME="TeletexString";var qa;class gi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}qa=gi,D.VideotexString=qa,gi.NAME="VideotexString";var za;class mi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}za=mi,D.IA5String=za,mi.NAME="IA5String";var Ga;class bi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Ga=bi,D.GraphicString=Ga,bi.NAME="GraphicString";var Wa;class Er extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Wa=Er,D.VisibleString=Wa,Er.NAME="VisibleString";var Ja;class vi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Ja=vi,D.GeneralString=Ja,vi.NAME="GeneralString";var Ya;class wi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Ya=wi,D.CharacterString=Ya,wi.NAME="CharacterString";var Za;class Nr extends Er{constructor({value:e,valueDate:t,...n}={}){if(super(n),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 o=0;o<e.length;o++)this.valueBlock.valueHexView[o]=e.charCodeAt(o)}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,P.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);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 n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}const o=parseInt(n[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){const t=new Array(7);return t[0]=je(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=je(this.month,2),t[2]=je(this.day,2),t[3]=je(this.hour,2),t[4]=je(this.minute,2),t[5]=je(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}}}Za=Nr,D.UTCTime=Za,Nr.NAME="UTCTime";var Qa;class ki extends Nr{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(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,n="",o="",s=0,c,d=0,u=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{const w=new Number(e[e.length-1]);if(isNaN(w.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let w=1,T=n.indexOf("+"),C="";if(T===-1&&(T=n.indexOf("-"),w=-1),T!==-1){if(C=n.substring(T+1),n=n.substring(0,T),C.length!==2&&C.length!==4)throw new Error("Wrong input string for conversion");let p=parseInt(C.substring(0,2),10);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");if(d=w*p,C.length===4){if(p=parseInt(C.substring(2,4),10),isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");u=w*p}}}let f=n.indexOf(".");if(f===-1&&(f=n.indexOf(",")),f!==-1){const w=new Number(`0${n.substring(f)}`);if(isNaN(w.valueOf()))throw new Error("Wrong input string for conversion");s=w.valueOf(),o=n.substring(0,f)}else o=n;switch(!0){case o.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let w=60*s;this.minute=Math.floor(w),w=60*(w-this.minute),this.second=Math.floor(w),w=1e3*(w-this.second),this.millisecond=Math.floor(w)}break;case o.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let w=60*s;this.second=Math.floor(w),w=1e3*(w-this.second),this.millisecond=Math.floor(w)}break;case o.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){const w=1e3*s;this.millisecond=Math.floor(w)}break;default:throw new Error("Wrong input string for conversion")}const h=c.exec(o);if(h===null)throw new Error("Wrong input string for conversion");for(let w=1;w<h.length;w++)switch(w){case 1:this.year=parseInt(h[w],10);break;case 2:this.month=parseInt(h[w],10);break;case 3:this.day=parseInt(h[w],10);break;case 4:this.hour=parseInt(h[w],10)+d;break;case 5:this.minute=parseInt(h[w],10)+u;break;case 6:this.second=parseInt(h[w],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const w=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=w.getUTCFullYear(),this.month=w.getUTCMonth(),this.day=w.getUTCDay(),this.hour=w.getUTCHours(),this.minute=w.getUTCMinutes(),this.second=w.getUTCSeconds(),this.millisecond=w.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(je(this.year,4)),t.push(je(this.month,2)),t.push(je(this.day,2)),t.push(je(this.hour,2)),t.push(je(this.minute,2)),t.push(je(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(je(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Qa=ki,D.GeneralizedTime=Qa,ki.NAME="GeneralizedTime";var Xa;class Kn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Xa=Kn,D.DATE=Xa,Kn.NAME="DATE";var ec;class qn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ec=qn,D.TimeOfDay=ec,qn.NAME="TimeOfDay";var tc;class zn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}tc=zn,D.DateTime=tc,zn.NAME="DateTime";var rc;class Gn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}rc=Gn,D.Duration=rc,Gn.NAME="Duration";var ic;class Wn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}ic=Wn,D.TIME=ic,Wn.NAME="TIME";class Tt{constructor({name:e=Ie,optional:t=!1}={}){this.name=e,this.optional=t}}class Jn extends Tt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Si extends Tt{constructor({value:e=new Tt,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}}class pd{constructor({data:e=ai}={}){this.dataView=P.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=P.toUint8Array(e)}fromBER(e,t,n){const o=t+n;return this.dataView=P.toUint8Array(e).subarray(t,o),o}toBER(e){return this.dataView.slice().buffer}}function Vt(r,e,t){if(t instanceof Jn){for(let s=0;s<t.value.length;s++)if(Vt(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty($n)&&(s.name=t.name),s}}if(t instanceof Tt)return t.hasOwnProperty($n)&&(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(!(rd in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(sd in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ad in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(id)===!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(nd)===!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(od)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(td 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(!(sa in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let d=0;d<s.length;d++)if(s[d]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&(r[t.name]=e)),t instanceof D.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},d=t.valueBlock.value.length;if(d>0&&t.valueBlock.value[0]instanceof Si&&(d=e.valueBlock.value.length),d===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let u=!0;for(let f=0;f<t.valueBlock.value.length;f++)u=u&&(t.valueBlock.value[f].optional||!1);return u?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let u=0;u<d;u++)if(u-s>=e.valueBlock.value.length){if(t.valueBlock.value[u].optional===!1){const f={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,Ie),t.name&&(delete r[t.name],f.name=t.name)),f}}else if(t.valueBlock.value[0]instanceof Si){if(c=Vt(r,e.valueBlock.value[u],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&delete r[t.name]),c;if($n in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let f={};cd in t.valueBlock.value[0]&&t.valueBlock.value[0].local?f=e:f=r,typeof f[t.valueBlock.value[0].name]>"u"&&(f[t.valueBlock.value[0].name]=[]),f[t.valueBlock.value[0].name].push(e.valueBlock.value[u])}}else if(c=Vt(r,e.valueBlock.value[u-s],t.valueBlock.value[u]),c.verified===!1)if(t.valueBlock.value[u].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&delete r[t.name]),c;if(c.verified===!1){const u={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&(delete r[t.name],u.name=t.name)),u}return{verified:!0,result:r}}if(t.primitiveSchema&&sa in e.valueBlock){const s=Yt(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&(delete r[t.name],c.name=t.name)),c}return Vt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function hd(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=Yt(P.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Vt(t.result,t.result,e)}const nc=Object.freeze(Object.defineProperty({__proto__:null,Any:Tt,BaseBlock:me,BaseStringBlock:Rn,BitString:Ot,BmpString:di,Boolean:ci,CharacterString:wi,Choice:Jn,Constructed:Ee,DATE:Kn,DateTime:zn,Duration:Gn,EndOfContent:Mn,Enumerated:li,GeneralString:vi,GeneralizedTime:ki,GraphicString:bi,HexBlock:Ye,IA5String:mi,Integer:Ze,Null:Nt,NumericString:pi,ObjectIdentifier:ui,OctetString:_t,Primitive:Ir,PrintableString:hi,RawData:pd,RelativeObjectIdentifier:Fn,Repeated:Si,Sequence:ot,Set:st,TIME:Wn,TeletexString:yi,TimeOfDay:qn,UTCTime:Nr,UniversalString:fi,Utf8String:at,ValueBlock:xe,VideotexString:gi,ViewWriter:si,VisibleString:Er,compareSchema:Vt,fromBER:Zt,verifySchema:hd},Symbol.toStringTag,{value:"Module"}));var E;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(E||(E={}));var v;(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"})(v||(v={}));class Ci{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(P.isBufferSource(e))this.unusedBits=t,this.value=P.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ot))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 Ot({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ot({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const n of t)e+=n.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 n=t.length+7>>3;this.unusedBits=(n<<3)-t.length;const o=new Uint8Array(n);t=t.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)o[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class te{constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):P.isBufferSource(e)?this.buffer=P.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 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 yd={fromASN:r=>r instanceof Nt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Nt;const e=Zt(r);if(e.result.error)throw new Error(e.result.error);return e.result}},gd={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new Ze({value:+r})},md={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new li({value:r})},de={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ze({valueHex:r})},bd={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ot({valueHex:r})},vd={fromASN:r=>r.valueBlock.toString(),toASN:r=>new ui({value:r})},wd={fromASN:r=>r.valueBlock.value,toASN:r=>new ci({value:r})},xi={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new _t({valueHex:r})},kd={fromASN:r=>new te(r.getValue()),toASN:r=>r.toASN()};function Me(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const oc=Me(at),Sd=Me(di),Cd=Me(fi),xd=Me(pi),Ad=Me(hi),Bd=Me(yi),Id=Me(gi),Ed=Me(mi),Nd=Me(bi),_d=Me(Er),Od=Me(vi),Td=Me(wi),Vd={fromASN:r=>r.toDate(),toASN:r=>new Nr({valueDate:r})},jd={fromASN:r=>r.toDate(),toASN:r=>new ki({valueDate:r})},Pd={fromASN:()=>null,toASN:()=>new Nt};function Yn(r){switch(r){case v.Any:return yd;case v.BitString:return bd;case v.BmpString:return Sd;case v.Boolean:return wd;case v.CharacterString:return Td;case v.Enumerated:return md;case v.GeneralString:return Od;case v.GeneralizedTime:return jd;case v.GraphicString:return Nd;case v.IA5String:return Ed;case v.Integer:return gd;case v.Null:return Pd;case v.NumericString:return xd;case v.ObjectIdentifier:return vd;case v.OctetString:return xi;case v.PrintableString:return Ad;case v.TeletexString:return Bd;case v.UTCTime:return Vd;case v.UniversalString:return Cd;case v.Utf8String:return oc;case v.VideotexString:return Id;case v.VisibleString:return _d;default:return null}}function ct(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:ct(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function sc(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:sc(t)}return!1}function Dd(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),n=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)if(t[o]!==n[o])return!1;return!0}class $d{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:E.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(t,n),t.items=Object.assign({},t.items,n.items)),t}create(e,t){const n=this.items.get(e)||this.createDefault(e),o=[];for(const s in n.items){const c=n.items[s],d=t?s:"";let u;if(typeof c.type=="number"){const h=v[c.type],w=nc[h];if(!w)throw new Error(`Cannot get ASN1 class by name '${h}'`);u=new w({name:d})}else ct(c.type)?u=new c.type().toSchema(d):c.optional?this.get(c.type).type===E.Choice?u=new Tt({name:d}):(u=this.create(c.type,!1),u.name=d):u=new Tt({name:d});const f=!!c.optional||c.defaultValue!==void 0;if(c.repeated){u.name="";const h=c.repeated==="set"?st:ot;u=new h({name:"",value:[new Si({name:d,value:u})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||ct(c.type)){const h=c.repeated?Ee:Ir;o.push(new h({name:d,optional:f,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const h=!!c.repeated;let w=h?u:this.get(c.type,!0).schema;w="valueBlock"in w?w.valueBlock.value:w.value,o.push(new Ee({name:h?"":d,optional:f,idBlock:{tagClass:3,tagNumber:c.context},value:w}))}else o.push(new Ee({optional:f,idBlock:{tagClass:3,tagNumber:c.context},value:[u]}));else u.optional=f,o.push(u)}switch(n.type){case E.Sequence:return new ot({value:o,name:""});case E.Set:return new st({value:o,name:""});case E.Choice:return new Jn({value:o,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 Ue=new $d,O=r=>e=>{let t;Ue.has(e)?t=Ue.get(e):(t=Ue.createDefault(e),Ue.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let n;Ue.has(e.constructor)?n=Ue.get(e.constructor):(n=Ue.createDefault(e.constructor),Ue.set(e.constructor,n));const o=Object.assign({},r);if(typeof o.type=="number"&&!o.converter){const s=Yn(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);o.converter=s}n.items[t]=o};class ac extends Error{constructor(){super(...arguments),this.schemas=[]}}class Rd{static parse(e,t){const n=Zt(e);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,t)}static fromASN(e,t){var n;try{if(ct(t))return new t().fromASN(e);const o=Ue.get(t);Ue.cache(t);let s=o.schema;if(e.constructor===Ee&&o.type!==E.Choice){s=new Ee({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const u in o.items)delete e[u]}const c=Vt({},e,s);if(!c.verified)throw new ac(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const d=new t;if(sc(t)){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 u=o.itemType;if(typeof u=="number"){const f=Yn(u);if(!f)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,h=>f.fromASN(h))}else return t.from(e.valueBlock.value,f=>this.fromASN(f,u))}for(const u in o.items){const f=c.result[u];if(!f)continue;const h=o.items[u],w=h.type;if(typeof w=="number"||ct(w)){const T=(n=h.converter)!==null&&n!==void 0?n:ct(w)?new w:null;if(!T)throw new Error("Converter is empty");if(h.repeated)if(h.implicit){const C=h.repeated==="sequence"?ot:st,p=new C;p.valueBlock=f.valueBlock;const m=Zt(p.toBER(!1));if(m.offset===-1)throw new Error(`Cannot parse the child item. ${m.result.error}`);if(!("value"in m.result.valueBlock&&Array.isArray(m.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const y=m.result.valueBlock.value;d[u]=Array.from(y,b=>T.fromASN(b))}else d[u]=Array.from(f,C=>T.fromASN(C));else{let C=f;if(h.implicit){let p;if(ct(w))p=new w().toSchema("");else{const m=v[w],y=nc[m];if(!y)throw new Error(`Cannot get '${m}' class from asn1js module`);p=new y}p.valueBlock=C.valueBlock,C=Zt(p.toBER(!1)).result}d[u]=T.fromASN(C)}}else if(h.repeated){if(!Array.isArray(f))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");d[u]=Array.from(f,T=>this.fromASN(T,w))}else d[u]=this.fromASN(f,w)}return d}catch(o){throw o instanceof ac&&o.schemas.push(t.name),o}}}class Zn{static serialize(e){return e instanceof me?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&ct(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,n=Ue.get(t);Ue.cache(t);let o=[];if(n.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){const c=Yn(n.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);o=e.map(d=>c.toASN(d))}else o=e.map(c=>this.toAsnItem({type:n.itemType},"[]",t,c))}else for(const c in n.items){const d=n.items[c],u=e[c];if(u===void 0||d.defaultValue===u||typeof d.defaultValue=="object"&&typeof u=="object"&&Dd(this.serialize(d.defaultValue),this.serialize(u)))continue;const f=Zn.toAsnItem(d,c,t,u);if(typeof d.context=="number")if(d.implicit)if(!d.repeated&&(typeof d.type=="number"||ct(d.type))){const h={};h.valueHex=f instanceof Nt?f.valueBeforeDecodeView:f.valueBlock.toBER(),o.push(new Ir({optional:d.optional,idBlock:{tagClass:3,tagNumber:d.context},...h}))}else o.push(new Ee({optional:d.optional,idBlock:{tagClass:3,tagNumber:d.context},value:f.valueBlock.value}));else o.push(new Ee({optional:d.optional,idBlock:{tagClass:3,tagNumber:d.context},value:[f]}));else d.repeated?o=o.concat(f):o.push(f)}let s;switch(n.type){case E.Sequence:s=new ot({value:o});break;case E.Set:s=new st({value:o});break;case E.Choice:if(!o[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(e,t,n,o){let s;if(typeof e.type=="number"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${v[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const d=Array.from(o,f=>c.toASN(f)),u=e.repeated==="sequence"?ot:st;s=new u({value:d})}else s=c.toASN(o)}else if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,u=>this.toASN(u)),d=e.repeated==="sequence"?ot:st;s=new d({value:c})}else s=this.toASN(o);return s}}class oe extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class U{static serialize(e){return Zn.serialize(e)}static parse(e,t){return Rd.parse(e,t)}static toString(e){const t=P.isBufferSource(e)?P.toArrayBuffer(e):U.serialize(e),n=Zt(t);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function a(r,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(o<3?c(s):o>3?c(e,t,s):c(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var cc={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",d="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${d})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${d})|(?:::)(?:${d})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function f(p,m){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let y=0,b=-1,k=(p.match(u.zoneIndex)||[])[0],g,A;for(k&&(k=k.substring(1),p=p.replace(/%.+$/,""));(b=p.indexOf(":",b+1))>=0;)y++;if(p.substr(0,2)==="::"&&y--,p.substr(-2,2)==="::"&&y--,y>m)return null;for(A=m-y,g=":";A--;)g+="0:";return p=p.replace("::",g),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),m=function(){const I=p.split(":"),B=[];for(let _=0;_<I.length;_++)B.push(parseInt(I[_],16));return B}(),{parts:m,zoneId:k}}function h(p,m,y,b){if(p.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let k=0,g;for(;b>0;){if(g=y-b,g<0&&(g=0),p[k]>>g!==m[k]>>g)return!1;b-=y,k+=1}return!0}function w(p){if(s.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(o.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function T(p,m){for(;p.length<m;)p=`0${p}`;return p}const C={};C.IPv4=function(){function p(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,b;for(y=0;y<m.length;y++)if(b=m[y],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(m,y){let b;if(y===void 0&&(b=m,m=b[0],y=b[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,m.octets,8,y)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1;const b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let k,g,A;for(k=3;k>=0;k-=1)if(g=this.octets[k],g in b){if(A=b[g],y&&A!==0)return null;A!==8&&(y=!0),m+=A}else return null;return 32-m},p.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return C.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),C.IPv4.broadcastAddressFromCIDR=function(p){try{const m=this.parseCIDR(p),y=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[];let g=0;for(;g<4;)k.push(parseInt(y[g],10)|parseInt(b[g],10)^255),g++;return new this(k)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.isIPv4=function(p){return this.parser(p)!==null},C.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},C.IPv4.isValidFourPartDecimal=function(p){return!!(C.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},C.IPv4.networkAddressFromCIDR=function(p){let m,y,b,k,g;try{for(m=this.parseCIDR(p),b=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[],y=0;y<4;)k.push(parseInt(b[y],10)&parseInt(g[y],10)),y++;return new this(k)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.parse=function(p){const m=this.parser(p);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},C.IPv4.parseCIDR=function(p){let m;if(m=p.match(/^(.+)\/(\d+)$/)){const y=parseInt(m[2]);if(y>=0&&y<=32){const b=[this.parse(m[1]),y];return Object.defineProperty(b,"toString",{value:function(){return this.join("/")}}),b}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},C.IPv4.parser=function(p){let m,y,b;if(m=p.match(n.fourOctet))return function(){const k=m.slice(1,6),g=[];for(let A=0;A<k.length;A++)y=k[A],g.push(w(y));return g}();if(m=p.match(n.longValue)){if(b=w(m[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return function(){const k=[];let g;for(g=0;g<=24;g+=8)k.push(b>>g&255);return k}().reverse()}else return(m=p.match(n.twoOctet))?function(){const k=m.slice(1,4),g=[];if(b=w(k[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return g.push(w(k[0])),g.push(b>>16&255),g.push(b>>8&255),g.push(b&255),g}():(m=p.match(n.threeOctet))?function(){const k=m.slice(1,5),g=[];if(b=w(k[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return g.push(w(k[0])),g.push(w(k[1])),g.push(b>>8&255),g.push(b&255),g}():null},C.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let y=0;const b=Math.floor(p/8);for(;y<b;)m[y]=255,y++;return b<4&&(m[b]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},C.IPv6=function(){function p(m,y){let b,k;if(m.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(m[b]<<8|m[b+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(k=this.parts[b],!(0<=k&&k<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],reserved:[[new p([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[new p([8193,4,274,0,0,0,0,0]),48],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(m,y){let b;if(y===void 0&&(b=m,m=b[0],y=b[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,m.parts,16,y)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1;const b={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let k,g;for(let A=7;A>=0;A-=1)if(k=this.parts[A],k in b){if(g=b[k],y&&g!==0)return null;g!==16&&(y=!0),m+=g}else return null;return 128-m},p.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let m;const y=[],b=this.parts;for(let k=0;k<b.length;k++)m=b[k],y.push(m>>8),y.push(m&255);return y},p.prototype.toFixedLengthString=function(){const m=(function(){const b=[];for(let k=0;k<this.parts.length;k++)b.push(T(this.parts[k].toString(16),4));return b}).call(this).join(":");let y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},p.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const m=this.parts.slice(-2),y=m[0],b=m[1];return new C.IPv4([y>>8,y&255,b>>8,b&255])},p.prototype.toNormalizedString=function(){const m=(function(){const b=[];for(let k=0;k<this.parts.length;k++)b.push(this.parts[k].toString(16));return b}).call(this).join(":");let y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},p.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString();let b=0,k=-1,g;for(;g=m.exec(y);)g[0].length>k&&(b=g.index,k=g[0].length);return k<0?y:`${y.substring(0,b)}::${y.substring(b+k)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),C.IPv6.broadcastAddressFromCIDR=function(p){try{const m=this.parseCIDR(p),y=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[];let g=0;for(;g<16;)k.push(parseInt(y[g],10)|parseInt(b[g],10)^255),g++;return new this(k)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},C.IPv6.isIPv6=function(p){return this.parser(p)!==null},C.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{const m=this.parser(p);return new this(m.parts,m.zoneId),!0}catch{return!1}},C.IPv6.networkAddressFromCIDR=function(p){let m,y,b,k,g;try{for(m=this.parseCIDR(p),b=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[],y=0;y<16;)k.push(parseInt(b[y],10)&parseInt(g[y],10)),y++;return new this(k)}catch(A){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${A})`)}},C.IPv6.parse=function(p){const m=this.parser(p);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},C.IPv6.parseCIDR=function(p){let m,y,b;if((y=p.match(/^(.+)\/(\d+)$/))&&(m=parseInt(y[2]),m>=0&&m<=128))return b=[this.parse(y[1]),m],Object.defineProperty(b,"toString",{value:function(){return this.join("/")}}),b;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},C.IPv6.parser=function(p){let m,y,b,k,g,A;if(b=p.match(u.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(u.native.test(p))return f(p,8);if((b=p.match(u.transitional))&&(A=b[6]||"",m=f(b[1].slice(0,-1)+A,6),m.parts)){for(g=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],y=0;y<g.length;y++)if(k=g[y],!(0<=k&&k<=255))return null;return m.parts.push(g[0]<<8|g[1]),m.parts.push(g[2]<<8|g[3]),{parts:m.parts,zoneId:m.zoneId}}return null},C.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>128)throw new Error("ipaddr: invalid IPv6 prefix length");const m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let y=0;const b=Math.floor(p/8);for(;y<b;)m[y]=255,y++;return b<16&&(m[b]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},C.fromByteArray=function(p){const m=p.length;if(m===4)return new C.IPv4(p);if(m===16)return new C.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},C.isValid=function(p){return C.IPv6.isValid(p)||C.IPv4.isValid(p)},C.parse=function(p){if(C.IPv6.isValid(p))return C.IPv6.parse(p);if(C.IPv4.isValid(p))return C.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},C.parseCIDR=function(p){try{return C.IPv6.parseCIDR(p)}catch{try{return C.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},C.process=function(p){const m=this.parse(p);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},C.subnetMatch=function(p,m,y){let b,k,g,A;y==null&&(y="unicast");for(k in m)if(Object.prototype.hasOwnProperty.call(m,k)){for(g=m[k],g[0]&&!(g[0]instanceof Array)&&(g=[g]),b=0;b<g.length;b++)if(A=g[b],p.kind()===A[0].kind()&&p.match.apply(p,A))return k}return y},r.exports?r.exports=C:e.ipaddr=C})(Vn)})(cc);var lc=cc.exports;class uc{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((o,s)=>o+ +s,0);let n=e.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return n=n.slice(0,-1),`${n}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return lc.fromByteArray(Array.from(t)).toString()}return this.decodeIP($.ToHex(e))}static fromString(e){const t=lc.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var Qn,Xn,eo;let be=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:v.TeletexString})],be.prototype,"teletexString",void 0),a([l({type:v.PrintableString})],be.prototype,"printableString",void 0),a([l({type:v.UniversalString})],be.prototype,"universalString",void 0),a([l({type:v.Utf8String})],be.prototype,"utf8String",void 0),a([l({type:v.BmpString})],be.prototype,"bmpString",void 0),be=a([O({type:E.Choice})],be);let Qt=class extends be{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?$.ToHex(this.anyValue):super.toString())}};a([l({type:v.IA5String})],Qt.prototype,"ia5String",void 0),a([l({type:v.Any})],Qt.prototype,"anyValue",void 0),Qt=a([O({type:E.Choice})],Qt);class _r{constructor(e={}){this.type="",this.value=new Qt,Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],_r.prototype,"type",void 0),a([l({type:Qt})],_r.prototype,"value",void 0);let Xt=Qn=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Qn.prototype)}};Xt=Qn=a([O({type:E.Set,itemType:_r})],Xt);let to=Xn=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Xn.prototype)}};to=Xn=a([O({type:E.Sequence,itemType:Xt})],to);let he=eo=class extends to{constructor(e){super(e),Object.setPrototypeOf(this,eo.prototype)}};he=eo=a([O({type:E.Sequence})],he);const Md={fromASN:r=>uc.toString(xi.fromASN(r)),toASN:r=>xi.toASN(uc.fromString(r))};class Or{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Or.prototype,"typeId",void 0),a([l({type:v.Any,context:0})],Or.prototype,"value",void 0);class ro{constructor(e={}){this.partyName=new be,Object.assign(this,e)}}a([l({type:be,optional:!0,context:0,implicit:!0})],ro.prototype,"nameAssigner",void 0),a([l({type:be,context:1,implicit:!0})],ro.prototype,"partyName",void 0);let Y=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Or,context:0,implicit:!0})],Y.prototype,"otherName",void 0),a([l({type:v.IA5String,context:1,implicit:!0})],Y.prototype,"rfc822Name",void 0),a([l({type:v.IA5String,context:2,implicit:!0})],Y.prototype,"dNSName",void 0),a([l({type:v.Any,context:3,implicit:!0})],Y.prototype,"x400Address",void 0),a([l({type:he,context:4,implicit:!1})],Y.prototype,"directoryName",void 0),a([l({type:ro,context:5})],Y.prototype,"ediPartyName",void 0),a([l({type:v.IA5String,context:6,implicit:!0})],Y.prototype,"uniformResourceIdentifier",void 0),a([l({type:v.OctetString,context:7,implicit:!0,converter:Md})],Y.prototype,"iPAddress",void 0),a([l({type:v.ObjectIdentifier,context:8,implicit:!0})],Y.prototype,"registeredID",void 0),Y=a([O({type:E.Choice})],Y);const er="1.3.6.1.5.5.7.3",jt="2.5.29";var io;class Ai{constructor(e={}){this.accessMethod="",this.accessLocation=new Y,Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Ai.prototype,"accessMethod",void 0),a([l({type:Y})],Ai.prototype,"accessLocation",void 0);let dc=io=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,io.prototype)}};dc=io=a([O({type:E.Sequence,itemType:Ai})],dc);const no=`${jt}.35`;class oo extends te{}class Pt{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:oo,context:0,optional:!0,implicit:!0})],Pt.prototype,"keyIdentifier",void 0),a([l({type:Y,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Pt.prototype,"authorityCertIssuer",void 0),a([l({type:v.Integer,context:2,optional:!0,implicit:!0,converter:de})],Pt.prototype,"authorityCertSerialNumber",void 0);const fc=`${jt}.19`;class Bi{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:v.Boolean,defaultValue:!1})],Bi.prototype,"cA",void 0),a([l({type:v.Integer,optional:!0})],Bi.prototype,"pathLenConstraint",void 0);var so;let Ae=so=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,so.prototype)}};Ae=so=a([O({type:E.Sequence,itemType:Y})],Ae);var ao;let pc=ao=class extends Ae{constructor(e){super(e),Object.setPrototypeOf(this,ao.prototype)}};pc=ao=a([O({type:E.Sequence})],pc);var co;const hc=`${jt}.32`;let lt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:v.IA5String})],lt.prototype,"ia5String",void 0),a([l({type:v.VisibleString})],lt.prototype,"visibleString",void 0),a([l({type:v.BmpString})],lt.prototype,"bmpString",void 0),a([l({type:v.Utf8String})],lt.prototype,"utf8String",void 0),lt=a([O({type:E.Choice})],lt);class lo{constructor(e={}){this.organization=new lt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:lt})],lo.prototype,"organization",void 0),a([l({type:v.Integer,repeated:"sequence"})],lo.prototype,"noticeNumbers",void 0);class uo{constructor(e={}){Object.assign(this,e)}}a([l({type:lo,optional:!0})],uo.prototype,"noticeRef",void 0),a([l({type:lt,optional:!0})],uo.prototype,"explicitText",void 0);let Ii=class{constructor(e={}){Object.assign(this,e)}};a([l({type:v.IA5String})],Ii.prototype,"cPSuri",void 0),a([l({type:uo})],Ii.prototype,"userNotice",void 0),Ii=a([O({type:E.Choice})],Ii);class fo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],fo.prototype,"policyQualifierId",void 0),a([l({type:v.Any})],fo.prototype,"qualifier",void 0);class Ei{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Ei.prototype,"policyIdentifier",void 0),a([l({type:fo,repeated:"sequence",optional:!0})],Ei.prototype,"policyQualifiers",void 0);let Ni=co=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,co.prototype)}};Ni=co=a([O({type:E.Sequence,itemType:Ei})],Ni);let _i=class{constructor(e=0){this.value=e}};a([l({type:v.Integer})],_i.prototype,"value",void 0),_i=a([O({type:E.Choice})],_i);let yc=class extends _i{};yc=a([O({type:E.Choice})],yc);var po,qe;(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"})(qe||(qe={}));class gc extends Ci{toJSON(){const e=[],t=this.toNumber();return t&qe.aACompromise&&e.push("aACompromise"),t&qe.affiliationChanged&&e.push("affiliationChanged"),t&qe.cACompromise&&e.push("cACompromise"),t&qe.certificateHold&&e.push("certificateHold"),t&qe.cessationOfOperation&&e.push("cessationOfOperation"),t&qe.keyCompromise&&e.push("keyCompromise"),t&qe.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&qe.superseded&&e.push("superseded"),t&qe.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let tr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Y,context:0,repeated:"sequence",implicit:!0})],tr.prototype,"fullName",void 0),a([l({type:Xt,context:1,implicit:!0})],tr.prototype,"nameRelativeToCRLIssuer",void 0),tr=a([O({type:E.Choice})],tr);class Tr{constructor(e={}){Object.assign(this,e)}}a([l({type:tr,context:0,optional:!0})],Tr.prototype,"distributionPoint",void 0),a([l({type:gc,context:1,optional:!0,implicit:!0})],Tr.prototype,"reasons",void 0),a([l({type:Y,context:2,optional:!0,repeated:"sequence",implicit:!0})],Tr.prototype,"cRLIssuer",void 0);let ho=po=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,po.prototype)}};ho=po=a([O({type:E.Sequence,itemType:Tr})],ho);var yo;let mc=yo=class extends ho{constructor(e){super(e),Object.setPrototypeOf(this,yo.prototype)}};mc=yo=a([O({type:E.Sequence,itemType:Tr})],mc);class ke{constructor(e={}){this.onlyContainsUserCerts=ke.ONLY,this.onlyContainsCACerts=ke.ONLY,this.indirectCRL=ke.ONLY,this.onlyContainsAttributeCerts=ke.ONLY,Object.assign(this,e)}}ke.ONLY=!1,a([l({type:tr,context:0,optional:!0})],ke.prototype,"distributionPoint",void 0),a([l({type:v.Boolean,context:1,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsUserCerts",void 0),a([l({type:v.Boolean,context:2,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsCACerts",void 0),a([l({type:gc,context:3,optional:!0,implicit:!0})],ke.prototype,"onlySomeReasons",void 0),a([l({type:v.Boolean,context:4,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"indirectCRL",void 0),a([l({type:v.Boolean,context:5,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsAttributeCerts",void 0);var Vr;(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"})(Vr||(Vr={}));let go=class{constructor(e=Vr.unspecified){this.reason=Vr.unspecified,this.reason=e}toJSON(){return Vr[this.reason]}toString(){return this.toJSON()}};a([l({type:v.Enumerated})],go.prototype,"reason",void 0),go=a([O({type:E.Choice})],go);var mo;const bc=`${jt}.37`;let Oi=mo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,mo.prototype)}};Oi=mo=a([O({type:E.Sequence,itemType:v.ObjectIdentifier})],Oi);const Ud=`${er}.1`,Ld=`${er}.2`,Hd=`${er}.3`,Fd=`${er}.4`,Kd=`${er}.8`,qd=`${er}.9`;let bo=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:v.Integer,converter:de})],bo.prototype,"value",void 0),bo=a([O({type:E.Choice})],bo);let vo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:v.GeneralizedTime})],vo.prototype,"value",void 0),vo=a([O({type:E.Choice})],vo);var wo;let vc=wo=class extends Ae{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};vc=wo=a([O({type:E.Sequence})],vc);const wc=`${jt}.15`;var ze;(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"})(ze||(ze={}));class ko extends Ci{toJSON(){const e=this.toNumber(),t=[];return e&ze.cRLSign&&t.push("crlSign"),e&ze.dataEncipherment&&t.push("dataEncipherment"),e&ze.decipherOnly&&t.push("decipherOnly"),e&ze.digitalSignature&&t.push("digitalSignature"),e&ze.encipherOnly&&t.push("encipherOnly"),e&ze.keyAgreement&&t.push("keyAgreement"),e&ze.keyCertSign&&t.push("keyCertSign"),e&ze.keyEncipherment&&t.push("keyEncipherment"),e&ze.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var So;class Ti{constructor(e={}){this.base=new Y,this.minimum=0,Object.assign(this,e)}}a([l({type:Y})],Ti.prototype,"base",void 0),a([l({type:v.Integer,context:0,defaultValue:0,implicit:!0})],Ti.prototype,"minimum",void 0),a([l({type:v.Integer,context:1,optional:!0,implicit:!0})],Ti.prototype,"maximum",void 0);let Vi=So=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,So.prototype)}};Vi=So=a([O({type:E.Sequence,itemType:Ti})],Vi);class kc{constructor(e={}){Object.assign(this,e)}}a([l({type:Vi,context:0,optional:!0,implicit:!0})],kc.prototype,"permittedSubtrees",void 0),a([l({type:Vi,context:1,optional:!0,implicit:!0})],kc.prototype,"excludedSubtrees",void 0);class Sc{constructor(e={}){Object.assign(this,e)}}a([l({type:v.Integer,context:0,implicit:!0,optional:!0,converter:de})],Sc.prototype,"requireExplicitPolicy",void 0),a([l({type:v.Integer,context:1,implicit:!0,optional:!0,converter:de})],Sc.prototype,"inhibitPolicyMapping",void 0);var Co;class xo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],xo.prototype,"issuerDomainPolicy",void 0),a([l({type:v.ObjectIdentifier})],xo.prototype,"subjectDomainPolicy",void 0);let Cc=Co=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};Cc=Co=a([O({type:E.Sequence,itemType:xo})],Cc);var Ao;const xc=`${jt}.17`;let Bo=Ao=class extends Ae{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};Bo=Ao=a([O({type:E.Sequence})],Bo);let ut=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:v.ObjectIdentifier})],ut.prototype,"type",void 0),a([l({type:v.Any,repeated:"set"})],ut.prototype,"values",void 0);var Io;let Ac=Io=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Io.prototype)}};Ac=Io=a([O({type:E.Sequence,itemType:ut})],Ac);const Bc=`${jt}.14`;class vt extends oo{}class Ic{constructor(e={}){Object.assign(this,e)}}a([l({type:v.GeneralizedTime,context:0,implicit:!0,optional:!0})],Ic.prototype,"notBefore",void 0),a([l({type:v.GeneralizedTime,context:1,implicit:!0,optional:!0})],Ic.prototype,"notAfter",void 0);var jr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(jr||(jr={}));class Ec extends Ci{toJSON(){const e=[],t=this.toNumber();return t&jr.pKIXCertificate&&e.push("pKIXCertificate"),t&jr.newExtensions&&e.push("newExtensions"),t&jr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Nc{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Ec,Object.assign(this,e)}}a([l({type:v.GeneralString})],Nc.prototype,"entrustVers",void 0),a([l({type:Ec})],Nc.prototype,"entrustInfoFlags",void 0);var Eo;let _c=Eo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Eo.prototype)}};_c=Eo=a([O({type:E.Sequence,itemType:Ai})],_c);class R{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof R&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&ia(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:v.ObjectIdentifier})],R.prototype,"algorithm",void 0),a([l({type:v.Any,optional:!0})],R.prototype,"parameters",void 0);class dt{constructor(e={}){this.algorithm=new R,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:R})],dt.prototype,"algorithm",void 0),a([l({type:v.BitString})],dt.prototype,"subjectPublicKey",void 0);let Se=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:v.UTCTime})],Se.prototype,"utcTime",void 0),a([l({type:v.GeneralizedTime})],Se.prototype,"generalTime",void 0),Se=a([O({type:E.Choice})],Se);class ji{constructor(e){this.notBefore=new Se(new Date),this.notAfter=new Se(new Date),e&&(this.notBefore=new Se(e.notBefore),this.notAfter=new Se(e.notAfter))}}a([l({type:Se})],ji.prototype,"notBefore",void 0),a([l({type:Se})],ji.prototype,"notAfter",void 0);var No;let Ge=class qu{constructor(e={}){this.extnID="",this.critical=qu.CRITICAL,this.extnValue=new te,Object.assign(this,e)}};Ge.CRITICAL=!1,a([l({type:v.ObjectIdentifier})],Ge.prototype,"extnID",void 0),a([l({type:v.Boolean,defaultValue:Ge.CRITICAL})],Ge.prototype,"critical",void 0),a([l({type:te})],Ge.prototype,"extnValue",void 0);let Dt=No=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};Dt=No=a([O({type:E.Sequence,itemType:Ge})],Dt);var rr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(rr||(rr={}));class Le{constructor(e={}){this.version=rr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new R,this.issuer=new he,this.validity=new ji,this.subject=new he,this.subjectPublicKeyInfo=new dt,Object.assign(this,e)}}a([l({type:v.Integer,context:0,defaultValue:rr.v1})],Le.prototype,"version",void 0),a([l({type:v.Integer,converter:de})],Le.prototype,"serialNumber",void 0),a([l({type:R})],Le.prototype,"signature",void 0),a([l({type:he})],Le.prototype,"issuer",void 0),a([l({type:ji})],Le.prototype,"validity",void 0),a([l({type:he})],Le.prototype,"subject",void 0),a([l({type:dt})],Le.prototype,"subjectPublicKeyInfo",void 0),a([l({type:v.BitString,context:1,implicit:!0,optional:!0})],Le.prototype,"issuerUniqueID",void 0),a([l({type:v.BitString,context:2,implicit:!0,optional:!0})],Le.prototype,"subjectUniqueID",void 0),a([l({type:Dt,context:3,optional:!0})],Le.prototype,"extensions",void 0);class ir{constructor(e={}){this.tbsCertificate=new Le,this.signatureAlgorithm=new R,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Le})],ir.prototype,"tbsCertificate",void 0),a([l({type:R})],ir.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],ir.prototype,"signatureValue",void 0);class Pi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Se,Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],Pi.prototype,"userCertificate",void 0),a([l({type:Se})],Pi.prototype,"revocationDate",void 0),a([l({type:Ge,optional:!0,repeated:"sequence"})],Pi.prototype,"crlEntryExtensions",void 0);class ft{constructor(e={}){this.signature=new R,this.issuer=new he,this.thisUpdate=new Se,Object.assign(this,e)}}a([l({type:v.Integer,optional:!0})],ft.prototype,"version",void 0),a([l({type:R})],ft.prototype,"signature",void 0),a([l({type:he})],ft.prototype,"issuer",void 0),a([l({type:Se})],ft.prototype,"thisUpdate",void 0),a([l({type:Se,optional:!0})],ft.prototype,"nextUpdate",void 0),a([l({type:Pi,repeated:"sequence",optional:!0})],ft.prototype,"revokedCertificates",void 0),a([l({type:Ge,optional:!0,context:0,repeated:"sequence"})],ft.prototype,"crlExtensions",void 0);let _o=class{constructor(e={}){this.tbsCertList=new ft,this.signatureAlgorithm=new R,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:ft})],_o.prototype,"tbsCertList",void 0),a([l({type:R})],_o.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],_o.prototype,"signature",void 0);let nr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:v.ObjectIdentifier})],nr.prototype,"attrType",void 0),a([l({type:v.Any,repeated:"set"})],nr.prototype,"attrValues",void 0);class Oo{constructor(e={}){this.acIssuer=new Y,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:Y})],Oo.prototype,"acIssuer",void 0),a([l({type:v.Integer})],Oo.prototype,"acSerial",void 0),a([l({type:ut,repeated:"sequence"})],Oo.prototype,"attrs",void 0);var To;let Di=To=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,To.prototype)}};Di=To=a([O({type:E.Sequence,itemType:v.ObjectIdentifier})],Di);class $i{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:v.Integer,optional:!0})],$i.prototype,"pathLenConstraint",void 0),a([l({type:Di,implicit:!0,context:0,optional:!0})],$i.prototype,"permittedAttrs",void 0),a([l({type:Di,implicit:!0,context:1,optional:!0})],$i.prototype,"excludedAttrs",void 0),a([l({type:v.Boolean,defaultValue:!0})],$i.prototype,"permitUnSpecified",void 0);class $t{constructor(e={}){this.issuer=new Ae,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ae})],$t.prototype,"issuer",void 0),a([l({type:v.Integer,converter:de})],$t.prototype,"serial",void 0),a([l({type:v.BitString,optional:!0})],$t.prototype,"issuerUID",void 0);var Vo;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(Vo||(Vo={}));class Rt{constructor(e={}){this.digestedObjectType=Vo.publicKey,this.digestAlgorithm=new R,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Enumerated})],Rt.prototype,"digestedObjectType",void 0),a([l({type:v.ObjectIdentifier,optional:!0})],Rt.prototype,"otherObjectTypeID",void 0),a([l({type:R})],Rt.prototype,"digestAlgorithm",void 0),a([l({type:v.BitString})],Rt.prototype,"objectDigest",void 0);class Ri{constructor(e={}){Object.assign(this,e)}}a([l({type:Ae,optional:!0})],Ri.prototype,"issuerName",void 0),a([l({type:$t,context:0,implicit:!0,optional:!0})],Ri.prototype,"baseCertificateID",void 0),a([l({type:Rt,context:1,implicit:!0,optional:!0})],Ri.prototype,"objectDigestInfo",void 0);let or=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Y,repeated:"sequence"})],or.prototype,"v1Form",void 0),a([l({type:Ri,context:0,implicit:!0})],or.prototype,"v2Form",void 0),or=a([O({type:E.Choice})],or);class Mi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:v.GeneralizedTime})],Mi.prototype,"notBeforeTime",void 0),a([l({type:v.GeneralizedTime})],Mi.prototype,"notAfterTime",void 0);class Pr{constructor(e={}){Object.assign(this,e)}}a([l({type:$t,implicit:!0,context:0,optional:!0})],Pr.prototype,"baseCertificateID",void 0),a([l({type:Ae,implicit:!0,context:1,optional:!0})],Pr.prototype,"entityName",void 0),a([l({type:Rt,implicit:!0,context:2,optional:!0})],Pr.prototype,"objectDigestInfo",void 0);var jo;(function(r){r[r.v2=1]="v2"})(jo||(jo={}));class We{constructor(e={}){this.version=jo.v2,this.holder=new Pr,this.issuer=new or,this.signature=new R,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Mi,this.attributes=[],Object.assign(this,e)}}a([l({type:v.Integer})],We.prototype,"version",void 0),a([l({type:Pr})],We.prototype,"holder",void 0),a([l({type:or})],We.prototype,"issuer",void 0),a([l({type:R})],We.prototype,"signature",void 0),a([l({type:v.Integer,converter:de})],We.prototype,"serialNumber",void 0),a([l({type:Mi})],We.prototype,"attrCertValidityPeriod",void 0),a([l({type:ut,repeated:"sequence"})],We.prototype,"attributes",void 0),a([l({type:v.BitString,optional:!0})],We.prototype,"issuerUniqueID",void 0),a([l({type:Dt,optional:!0})],We.prototype,"extensions",void 0);class Ui{constructor(e={}){this.acinfo=new We,this.signatureAlgorithm=new R,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:We})],Ui.prototype,"acinfo",void 0),a([l({type:R})],Ui.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],Ui.prototype,"signatureValue",void 0);var Li;(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"})(Li||(Li={}));class Po extends Ci{}class Do{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier,implicit:!0,context:0})],Do.prototype,"type",void 0),a([l({type:v.Any,implicit:!0,context:1})],Do.prototype,"value",void 0);class $o{constructor(e={}){this.policyId="",this.classList=new Po(Li.unclassified),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],$o.prototype,"policyId",void 0),a([l({type:Po,defaultValue:new Po(Li.unclassified)})],$o.prototype,"classList",void 0),a([l({type:Do,repeated:"set"})],$o.prototype,"securityCategories",void 0);class Hi{constructor(e={}){Object.assign(this,e)}}a([l({type:te})],Hi.prototype,"cotets",void 0),a([l({type:v.ObjectIdentifier})],Hi.prototype,"oid",void 0),a([l({type:v.Utf8String})],Hi.prototype,"string",void 0);class Oc{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ae,implicit:!0,context:0,optional:!0})],Oc.prototype,"policyAuthority",void 0),a([l({type:Hi,repeated:"sequence"})],Oc.prototype,"values",void 0);var Ro;class Fi{constructor(e={}){this.targetCertificate=new $t,Object.assign(this,e)}}a([l({type:$t})],Fi.prototype,"targetCertificate",void 0),a([l({type:Y,optional:!0})],Fi.prototype,"targetName",void 0),a([l({type:Rt,optional:!0})],Fi.prototype,"certDigestInfo",void 0);let sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Y,context:0,implicit:!0})],sr.prototype,"targetName",void 0),a([l({type:Y,context:1,implicit:!0})],sr.prototype,"targetGroup",void 0),a([l({type:Fi,context:2,implicit:!0})],sr.prototype,"targetCert",void 0),sr=a([O({type:E.Choice})],sr);let Mo=Ro=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};Mo=Ro=a([O({type:E.Sequence,itemType:sr})],Mo);var Uo;let Tc=Uo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Uo.prototype)}};Tc=Uo=a([O({type:E.Sequence,itemType:Mo})],Tc);class Vc{constructor(e={}){Object.assign(this,e)}}a([l({type:Ae,implicit:!0,context:0,optional:!0})],Vc.prototype,"roleAuthority",void 0),a([l({type:Y,implicit:!0,context:1})],Vc.prototype,"roleName",void 0);class Lo{constructor(e={}){this.service=new Y,this.ident=new Y,Object.assign(this,e)}}a([l({type:Y})],Lo.prototype,"service",void 0),a([l({type:Y})],Lo.prototype,"ident",void 0),a([l({type:te,optional:!0})],Lo.prototype,"authInfo",void 0);var Ho;class Fo{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Fo.prototype,"otherCertFormat",void 0),a([l({type:v.Any})],Fo.prototype,"otherCert",void 0);let ar=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ir})],ar.prototype,"certificate",void 0),a([l({type:Ui,context:2,implicit:!0})],ar.prototype,"v2AttrCert",void 0),a([l({type:Fo,context:3,implicit:!0})],ar.prototype,"other",void 0),ar=a([O({type:E.Choice})],ar);let Ki=Ho=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};Ki=Ho=a([O({type:E.Set,itemType:ar})],Ki);class cr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],cr.prototype,"contentType",void 0),a([l({type:v.Any,context:0})],cr.prototype,"content",void 0);let Dr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te})],Dr.prototype,"single",void 0),a([l({type:v.Any})],Dr.prototype,"any",void 0),Dr=a([O({type:E.Choice})],Dr);class qi{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],qi.prototype,"eContentType",void 0),a([l({type:Dr,context:0,optional:!0})],qi.prototype,"eContent",void 0);var pt;(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"})(pt||(pt={}));let $r=class extends R{};$r=a([O({type:E.Sequence})],$r);let zi=class extends R{};zi=a([O({type:E.Sequence})],zi);let Qe=class extends R{};Qe=a([O({type:E.Sequence})],Qe);let Gi=class extends R{};Gi=a([O({type:E.Sequence})],Gi);let jc=class extends R{};jc=a([O({type:E.Sequence})],jc);let Ko=class extends R{};Ko=a([O({type:E.Sequence})],Ko);let Rr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te,context:0,implicit:!0,optional:!0})],Rr.prototype,"value",void 0),a([l({type:te,converter:kd,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Rr.prototype,"constructedValue",void 0),Rr=a([O({type:E.Choice})],Rr);class Mr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Gi,Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Mr.prototype,"contentType",void 0),a([l({type:Gi})],Mr.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:Rr,optional:!0})],Mr.prototype,"encryptedContent",void 0);class lr{constructor(e={}){this.issuer=new he,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:he})],lr.prototype,"issuer",void 0),a([l({type:v.Integer,converter:de})],lr.prototype,"serialNumber",void 0);class Wi{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Wi.prototype,"keyAttrId",void 0),a([l({type:v.Any,optional:!0})],Wi.prototype,"keyAttr",void 0);var qo;class Ji{constructor(e={}){this.subjectKeyIdentifier=new vt,Object.assign(this,e)}}a([l({type:vt})],Ji.prototype,"subjectKeyIdentifier",void 0),a([l({type:v.GeneralizedTime,optional:!0})],Ji.prototype,"date",void 0),a([l({type:Wi,optional:!0})],Ji.prototype,"other",void 0);let ur=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Ji,context:0,implicit:!0,optional:!0})],ur.prototype,"rKeyId",void 0),a([l({type:lr,optional:!0})],ur.prototype,"issuerAndSerialNumber",void 0),ur=a([O({type:E.Choice})],ur);class zo{constructor(e={}){this.rid=new ur,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:ur})],zo.prototype,"rid",void 0),a([l({type:te})],zo.prototype,"encryptedKey",void 0);let Yi=qo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Yi=qo=a([O({type:E.Sequence,itemType:zo})],Yi);class Go{constructor(e={}){this.algorithm=new R,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:R})],Go.prototype,"algorithm",void 0),a([l({type:v.BitString})],Go.prototype,"publicKey",void 0);let Mt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:vt,context:0,implicit:!0,optional:!0})],Mt.prototype,"subjectKeyIdentifier",void 0),a([l({type:Go,context:1,implicit:!0,optional:!0})],Mt.prototype,"originatorKey",void 0),a([l({type:lr,optional:!0})],Mt.prototype,"issuerAndSerialNumber",void 0),Mt=a([O({type:E.Choice})],Mt);class dr{constructor(e={}){this.version=pt.v3,this.originator=new Mt,this.keyEncryptionAlgorithm=new Qe,this.recipientEncryptedKeys=new Yi,Object.assign(this,e)}}a([l({type:v.Integer})],dr.prototype,"version",void 0),a([l({type:Mt,context:0})],dr.prototype,"originator",void 0),a([l({type:te,context:1,optional:!0})],dr.prototype,"ukm",void 0),a([l({type:Qe})],dr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Yi})],dr.prototype,"recipientEncryptedKeys",void 0);let fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:vt,context:0,implicit:!0})],fr.prototype,"subjectKeyIdentifier",void 0),a([l({type:lr})],fr.prototype,"issuerAndSerialNumber",void 0),fr=a([O({type:E.Choice})],fr);class Ur{constructor(e={}){this.version=pt.v0,this.rid=new fr,this.keyEncryptionAlgorithm=new Qe,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],Ur.prototype,"version",void 0),a([l({type:fr})],Ur.prototype,"rid",void 0),a([l({type:Qe})],Ur.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Ur.prototype,"encryptedKey",void 0);class Lr{constructor(e={}){this.keyIdentifier=new te,Object.assign(this,e)}}a([l({type:te})],Lr.prototype,"keyIdentifier",void 0),a([l({type:v.GeneralizedTime,optional:!0})],Lr.prototype,"date",void 0),a([l({type:Wi,optional:!0})],Lr.prototype,"other",void 0);class Hr{constructor(e={}){this.version=pt.v4,this.kekid=new Lr,this.keyEncryptionAlgorithm=new Qe,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],Hr.prototype,"version",void 0),a([l({type:Lr})],Hr.prototype,"kekid",void 0),a([l({type:Qe})],Hr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Hr.prototype,"encryptedKey",void 0);class Fr{constructor(e={}){this.version=pt.v0,this.keyEncryptionAlgorithm=new Qe,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],Fr.prototype,"version",void 0),a([l({type:Ko,context:0,optional:!0})],Fr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:Qe})],Fr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Fr.prototype,"encryptedKey",void 0);class Wo{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Wo.prototype,"oriType",void 0),a([l({type:v.Any})],Wo.prototype,"oriValue",void 0);let wt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Ur,optional:!0})],wt.prototype,"ktri",void 0),a([l({type:dr,context:1,implicit:!0,optional:!0})],wt.prototype,"kari",void 0),a([l({type:Hr,context:2,implicit:!0,optional:!0})],wt.prototype,"kekri",void 0),a([l({type:Fr,context:3,implicit:!0,optional:!0})],wt.prototype,"pwri",void 0),a([l({type:Wo,context:4,implicit:!0,optional:!0})],wt.prototype,"ori",void 0),wt=a([O({type:E.Choice})],wt);var Jo;let Zi=Jo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};Zi=Jo=a([O({type:E.Set,itemType:wt})],Zi);var Yo;class Qi{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Qi.prototype,"otherRevInfoFormat",void 0),a([l({type:v.Any})],Qi.prototype,"otherRevInfo",void 0);let Kr=class{constructor(e={}){this.other=new Qi,Object.assign(this,e)}};a([l({type:Qi,context:1,implicit:!0})],Kr.prototype,"other",void 0),Kr=a([O({type:E.Choice})],Kr);let Zo=Yo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Zo=Yo=a([O({type:E.Set,itemType:Kr})],Zo);class Qo{constructor(e={}){Object.assign(this,e)}}a([l({type:Ki,context:0,implicit:!0,optional:!0})],Qo.prototype,"certs",void 0),a([l({type:Zo,context:1,implicit:!0,optional:!0})],Qo.prototype,"crls",void 0);var Xo;let es=Xo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Xo.prototype)}};es=Xo=a([O({type:E.Set,itemType:nr})],es);class qr{constructor(e={}){this.version=pt.v0,this.recipientInfos=new Zi,this.encryptedContentInfo=new Mr,Object.assign(this,e)}}a([l({type:v.Integer})],qr.prototype,"version",void 0),a([l({type:Qo,context:0,implicit:!0,optional:!0})],qr.prototype,"originatorInfo",void 0),a([l({type:Zi})],qr.prototype,"recipientInfos",void 0),a([l({type:Mr})],qr.prototype,"encryptedContentInfo",void 0),a([l({type:es,context:1,implicit:!0,optional:!0})],qr.prototype,"unprotectedAttrs",void 0);const zd="1.2.840.113549.1.7.2";let pr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:vt,context:0,implicit:!0})],pr.prototype,"subjectKeyIdentifier",void 0),a([l({type:lr})],pr.prototype,"issuerAndSerialNumber",void 0),pr=a([O({type:E.Choice})],pr);var ts;class ht{constructor(e={}){this.version=pt.v0,this.sid=new pr,this.digestAlgorithm=new $r,this.signatureAlgorithm=new zi,this.signature=new te,Object.assign(this,e)}}a([l({type:v.Integer})],ht.prototype,"version",void 0),a([l({type:pr})],ht.prototype,"sid",void 0),a([l({type:$r})],ht.prototype,"digestAlgorithm",void 0),a([l({type:nr,repeated:"set",context:0,implicit:!0,optional:!0})],ht.prototype,"signedAttrs",void 0),a([l({type:zi})],ht.prototype,"signatureAlgorithm",void 0),a([l({type:te})],ht.prototype,"signature",void 0),a([l({type:nr,repeated:"set",context:1,implicit:!0,optional:!0})],ht.prototype,"unsignedAttrs",void 0);let Xi=ts=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};Xi=ts=a([O({type:E.Set,itemType:ht})],Xi);var rs;let en=rs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,rs.prototype)}};en=rs=a([O({type:E.Set,itemType:$r})],en);class hr{constructor(e={}){this.version=pt.v0,this.digestAlgorithms=new en,this.encapContentInfo=new qi,this.signerInfos=new Xi,Object.assign(this,e)}}a([l({type:v.Integer})],hr.prototype,"version",void 0),a([l({type:en})],hr.prototype,"digestAlgorithms",void 0),a([l({type:qi})],hr.prototype,"encapContentInfo",void 0),a([l({type:Ki,context:0,implicit:!0,optional:!0})],hr.prototype,"certificates",void 0),a([l({type:Kr,context:1,implicit:!0,optional:!0})],hr.prototype,"crls",void 0),a([l({type:Xi})],hr.prototype,"signerInfos",void 0);const zr="1.2.840.10045.2.1",is="1.2.840.10045.4.1",Pc="1.2.840.10045.4.3.1",ns="1.2.840.10045.4.3.2",os="1.2.840.10045.4.3.3",ss="1.2.840.10045.4.3.4",Dc="1.2.840.10045.3.1.7",$c="1.3.132.0.34",Rc="1.3.132.0.35";function Gr(r){return new R({algorithm:r})}const Gd=Gr(is);Gr(Pc);const Wd=Gr(ns),Jd=Gr(os),Yd=Gr(ss);let yr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:v.ObjectIdentifier})],yr.prototype,"namedCurve",void 0),yr=a([O({type:E.Choice})],yr);class tn{constructor(e={}){this.version=1,this.privateKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],tn.prototype,"version",void 0),a([l({type:te})],tn.prototype,"privateKey",void 0),a([l({type:yr,context:0,optional:!0})],tn.prototype,"parameters",void 0),a([l({type:v.BitString,context:1,optional:!0})],tn.prototype,"publicKey",void 0);class rn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],rn.prototype,"r",void 0),a([l({type:v.Integer,converter:de})],rn.prototype,"s",void 0);const Ne="1.2.840.113549.1.1",gr=`${Ne}.1`,Zd=`${Ne}.7`,Qd=`${Ne}.9`,Xd=`${Ne}.10`,ef=`${Ne}.2`,tf=`${Ne}.4`,nn=`${Ne}.5`,rf=`${Ne}.14`,as=`${Ne}.11`,on=`${Ne}.12`,sn=`${Ne}.13`,Mc=`${Ne}.15`,Uc=`${Ne}.16`,Lc="1.3.14.3.2.26",Hc="2.16.840.1.101.3.4.2.4",Fc="2.16.840.1.101.3.4.2.1",Kc="2.16.840.1.101.3.4.2.2",qc="2.16.840.1.101.3.4.2.3",nf="2.16.840.1.101.3.4.2.5",of="2.16.840.1.101.3.4.2.6",sf="1.2.840.113549.2.2",af="1.2.840.113549.2.5",cs=`${Ne}.8`;function ye(r){return new R({algorithm:r,parameters:null})}ye(sf),ye(af);const Ut=ye(Lc);ye(Hc),ye(Fc),ye(Kc),ye(qc),ye(nf),ye(of);const zc=new R({algorithm:cs,parameters:U.serialize(Ut)}),Gc=new R({algorithm:Qd,parameters:U.serialize(xi.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ye(gr),ye(ef),ye(tf),ye(nn),ye(Mc),ye(Uc),ye(on),ye(sn),ye(Mc),ye(Uc);class an{constructor(e={}){this.hashAlgorithm=new R(Ut),this.maskGenAlgorithm=new R({algorithm:cs,parameters:U.serialize(Ut)}),this.pSourceAlgorithm=new R(Gc),Object.assign(this,e)}}a([l({type:R,context:0,defaultValue:Ut})],an.prototype,"hashAlgorithm",void 0),a([l({type:R,context:1,defaultValue:zc})],an.prototype,"maskGenAlgorithm",void 0),a([l({type:R,context:2,defaultValue:Gc})],an.prototype,"pSourceAlgorithm",void 0),new R({algorithm:Zd,parameters:U.serialize(new an)});class Wr{constructor(e={}){this.hashAlgorithm=new R(Ut),this.maskGenAlgorithm=new R({algorithm:cs,parameters:U.serialize(Ut)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:R,context:0,defaultValue:Ut})],Wr.prototype,"hashAlgorithm",void 0),a([l({type:R,context:1,defaultValue:zc})],Wr.prototype,"maskGenAlgorithm",void 0),a([l({type:v.Integer,context:2,defaultValue:20})],Wr.prototype,"saltLength",void 0),a([l({type:v.Integer,context:3,defaultValue:1})],Wr.prototype,"trailerField",void 0),new R({algorithm:Xd,parameters:U.serialize(new Wr)});class cn{constructor(e={}){this.digestAlgorithm=new R,this.digest=new te,Object.assign(this,e)}}a([l({type:R})],cn.prototype,"digestAlgorithm",void 0),a([l({type:te})],cn.prototype,"digest",void 0);var ls;class ln{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],ln.prototype,"prime",void 0),a([l({type:v.Integer,converter:de})],ln.prototype,"exponent",void 0),a([l({type:v.Integer,converter:de})],ln.prototype,"coefficient",void 0);let us=ls=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};us=ls=a([O({type:E.Sequence,itemType:ln})],us);class Xe{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer})],Xe.prototype,"version",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"modulus",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"publicExponent",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"privateExponent",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"prime1",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"prime2",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"exponent1",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"exponent2",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"coefficient",void 0),a([l({type:us,optional:!0})],Xe.prototype,"otherPrimeInfos",void 0);class ds{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],ds.prototype,"modulus",void 0),a([l({type:v.Integer,converter:de})],ds.prototype,"publicExponent",void 0);var fs;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(fs||(fs={}));const _e=fs;/*! *****************************************************************************
75
+ `)}`:`${t} :`}}ha=Ee,D.Constructed=ha,Ee.NAME="CONSTRUCTED";class ya extends xe{fromBER(e,t,n){return t}toBER(e){return Ke}}ya.override="EndOfContentValueBlock";var ga;class Mn extends me{constructor(e={}){super(e,ya),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}ga=Mn,D.EndOfContent=ga,Mn.NAME=Br;var ma;class Nt extends me{constructor(e={}){super(e,xe),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,n){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+=n,t+n>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+n}toBER(e,t){const n=new ArrayBuffer(2);if(!e){const o=new Uint8Array(n);o[0]=5,o[1]=0}return t&&t.write(n),n}onAsciiEncoding(){return`${this.constructor.NAME}`}}ma=Nt,D.Null=ma,Nt.NAME="NULL";class ba extends Ye(xe){constructor({value:e,...t}={}){super(t),t.valueHex?this.valueHexView=P.toUint8Array(t.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,n){const o=P.toUint8Array(e);return nt(this,o,t,n)?(this.valueHexView=o.subarray(t,t+n),n>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,na.call(this),this.blockLength=n,t+n):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}ba.NAME="BooleanValueBlock";var va;let ci=class extends me{constructor(e={}){super(e,ba),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};va=ci,D.Boolean=va,ci.NAME="BOOLEAN";class wa extends Ye(bt){constructor({isConstructed:e=!1,...t}={}){super(t),this.isConstructed=e}fromBER(e,t,n){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=bt.prototype.fromBER.call(this,e,t,n),o===-1)return o;for(let s=0;s<this.value.length;s++){const c=this.value[s].constructor.NAME;if(c===Br){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(c!==aa)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(e,t,n),this.blockLength=n;return o}toBER(e,t){return this.isConstructed?bt.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 ka;let _t=class Ku extends me{constructor({idBlock:e={},lenBlock:t={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},wa),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,n){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,n===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+n);try{if(s.byteLength){const c=Yt(s,0,s.byteLength);c.offset!==-1&&c.offset===n&&(this.valueBlock.value=[c.result])}}catch{}}return super.fromBER(e,t,n)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Ee.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${$.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof Ku&&e.push(t.valueBlock.valueHexView);return P.concat(e)}};ka=_t,D.OctetString=ka,_t.NAME=aa;class Sa extends Ye(bt){constructor({unusedBits:e=0,isConstructed:t=!1,...n}={}){super(n),this.unusedBits=e,this.isConstructed=t,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,n){if(!n)return t;let o=-1;if(this.isConstructed){if(o=bt.prototype.fromBER.call(this,e,t,n),o===-1)return o;for(const d of this.value){const u=d.constructor.NAME;if(u===Br){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(u!==ca)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const f=d.valueBlock;if(this.unusedBits>0&&f.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=f.unusedBits}return o}const s=P.toUint8Array(e);if(!nt(this,s,t,n))return-1;const c=s.subarray(t,t+n);if(this.unusedBits=c[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const d=c.subarray(1);try{if(d.byteLength){const u=Yt(d,0,d.byteLength);u.offset!==-1&&u.offset===n-1&&(this.value=[u.result])}}catch{}}return this.valueHexView=c.subarray(1),this.blockLength=c.length,t+n}toBER(e,t){if(this.isConstructed)return bt.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return Ke;const n=new Uint8Array(this.valueHexView.length+1);return n[0]=this.unusedBits,n.set(this.valueHexView,1),n.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}Sa.NAME="BitStringValueBlock";var Ca;let Ot=class extends me{constructor({idBlock:e={},lenBlock:t={},...n}={}){var o,s;(o=n.isConstructed)!==null&&o!==void 0||(n.isConstructed=!!(!((s=n.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:n.isConstructed,...e},lenBlock:{...t,isIndefiniteForm:!!n.isIndefiniteForm},...n},Sa),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,n){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,n)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ee.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const o of t)e.push(o.toString(2).padStart(8,"0"));const n=e.join("");return`${this.constructor.NAME} : ${n.substring(0,n.length-this.valueBlock.unusedBits)}`}}};Ca=Ot,D.BitString=Ca,Ot.NAME=ca;var xa;function dd(r,e){const t=new Uint8Array([0]),n=new Uint8Array(r),o=new Uint8Array(e);let s=n.slice(0);const c=s.length-1,d=o.slice(0),u=d.length-1;let f=0;const h=u<c?c:u;let w=0;for(let V=h;V>=0;V--,w++){switch(!0){case w<d.length:f=s[c-w]+d[u-w]+t[0];break;default:f=s[c-w]+t[0]}switch(t[0]=f/10,!0){case w>=s.length:s=Pn(new Uint8Array([f%10]),s);break;default:s[c-w]=f%10}}return t[0]>0&&(s=Pn(t,s)),s}function Aa(r){if(r>=Ar.length)for(let e=Ar.length;e<=r;e++){const t=new Uint8Array([0]);let n=Ar[e-1].slice(0);for(let o=n.length-1;o>=0;o--){const s=new Uint8Array([(n[o]<<1)+t[0]]);t[0]=s[0]/10,n[o]=s[0]%10}t[0]>0&&(n=Pn(t,n)),Ar.push(n)}return Ar[r]}function fd(r,e){let t=0;const n=new Uint8Array(r),o=new Uint8Array(e),s=n.slice(0),c=s.length-1,d=o.slice(0),u=d.length-1;let f,h=0;for(let w=u;w>=0;w--,h++)switch(f=s[c-h]-d[u-h]-t,!0){case f<0:t=1,s[c-h]=f+10;break;default:t=0,s[c-h]=f}if(t>0)for(let w=c-u+1;w>=0;w--,h++)if(f=s[c-h]-t,f<0)t=1,s[c-h]=f+10;else{t=0,s[c-h]=f;break}return s.slice()}class Un extends Ye(xe){constructor({value:e,...t}={}){super(t),this._valueDec=0,t.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}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=na.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Xu(e))}get valueDec(){return this._valueDec}fromDER(e,t,n,o=0){const s=this.fromBER(e,t,n);if(s===-1)return s;const c=this.valueHexView;return c[0]===0&&c[1]&128?this.valueHexView=c.subarray(1):o!==0&&c.length<o&&(o-c.length>1&&(o=c.length+1),this.valueHexView=c.subarray(o-c.length)),s}toDER(e=!1){const t=this.valueHexView;switch(!0){case(t[0]&128)!==0:{const n=new Uint8Array(this.valueHexView.length+1);n[0]=0,n.set(t,1),this.valueHexView=n}break;case(t[0]===0&&(t[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,t,n){const o=super.fromBER(e,t,n);return o===-1||this.setValueHex(),o}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),n=0,o;const s=this.valueHexView;let c="",d=!1;for(let u=s.byteLength-1;u>=0;u--){o=s[u];for(let f=0;f<8;f++){if((o&1)===1)switch(n){case e:t=fd(Aa(n),t),c="-";break;default:t=dd(t,Aa(n))}n++,o>>=1}}for(let u=0;u<t.length;u++)t[u]&&(d=!0),d&&(c+=oa.charAt(t[u]));return d===!1&&(c+=oa.charAt(0)),c}}xa=Un,Un.NAME="IntegerValueBlock",Object.defineProperty(xa.prototype,"valueHex",{set:function(r){this.valueHexView=new Uint8Array(r),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ba;class Ze extends me{constructor(e={}){super(e,Un),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return oi(),BigInt(this.valueBlock.toString())}static fromBigInt(e){oi();const t=BigInt(e),n=new si,o=t.toString(16).replace(/^-/,""),s=new Uint8Array($.FromHex(o));if(t<0){const d=new Uint8Array(s.length+(s[0]&128?1:0));d[0]|=128;const f=BigInt(`0x${$.ToHex(d)}`)+t,h=P.toUint8Array($.FromHex(f.toString(16)));h[0]|=128,n.write(h)}else s[0]&128&&n.write(new Uint8Array([0])),n.write(s);return new Ze({valueHex:n.final()})}convertToDER(){const e=new Ze({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Ze({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ba=Ze,D.Integer=Ba,Ze.NAME="INTEGER";var Ia;class li extends Ze{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Ia=li,D.Enumerated=Ia,li.NAME="ENUMERATED";class Ln extends Ye(xe){constructor({valueDec:e=-1,isFirstSid:t=!1,...n}={}){super(n),this.valueDec=e,this.isFirstSid=t}fromBER(e,t,n){if(!n)return t;const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let d=0;d<n&&(this.valueHexView[d]=s[d]&127,this.blockLength++,!!(s[d]&128));d++);const c=new Uint8Array(this.blockLength);for(let d=0;d<this.blockLength;d++)c[d]=this.valueHexView[d];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Jt(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){oi();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const n=new Uint8Array(t.length/7);for(let o=0;o<n.length;o++)n[o]=parseInt(t.slice(o*7,o*7+7),2)+(o+1<n.length?128:0);this.fromBER(n.buffer,0,n.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=o[c]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const t=It(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ke;const n=new Uint8Array(t.byteLength);if(!e){const o=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)n[c]=o[c]|128;n[s]=o[s]}return n}toString(){let e="";if(this.isHexOnly)e=$.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Ln.NAME="sidBlock";class Ea extends xe{constructor({value:e=Ie,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let o=t;for(;n>0;){const s=new Ln;if(o=s.fromBER(e,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(e){const t=[];for(let n=0;n<this.value.length;n++){const o=this.value[n].toBER(e);if(o.byteLength===0)return this.error=this.value[n].error,Ke;t.push(o)}return Dn(t)}fromString(e){this.value=[];let t=0,n=0,o="",s=!1;do if(n=e.indexOf(".",t),n===-1?o=e.substring(t):o=e.substring(t,n),t=n+1,s){const c=this.value[0];let d=0;switch(c.valueDec){case 0:break;case 1:d=40;break;case 2:d=80;break;default:this.value=[];return}const u=parseInt(o,10);if(isNaN(u))return;c.valueDec=u+d,s=!1}else{const c=new Ln;if(o>Number.MAX_SAFE_INTEGER){oi();const d=BigInt(o);c.valueBigInt=d}else if(c.valueDec=parseInt(o,10),isNaN(c.valueDec))return;this.value.length||(c.isFirstSid=!0,s=!0),this.value.push(c)}while(n!==-1)}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(e=`${e}.`),t?(o=`{${o}}`,this.value[n].isFirstSid?e=`2.{${o} - 80}`:e+=o):e+=o}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}}Ea.NAME="ObjectIdentifierValueBlock";var Na;class ui extends me{constructor(e={}){super(e,Ea),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Na=ui,D.ObjectIdentifier=Na,ui.NAME="OBJECT IDENTIFIER";class Hn extends Ye(Et){constructor({valueDec:e=0,...t}={}){super(t),this.valueDec=e}fromBER(e,t,n){if(n===0)return t;const o=P.toUint8Array(e);if(!nt(this,o,t,n))return-1;const s=o.subarray(t,t+n);this.valueHexView=new Uint8Array(n);for(let d=0;d<n&&(this.valueHexView[d]=s[d]&127,this.blockLength++,!!(s[d]&128));d++);const c=new Uint8Array(this.blockLength);for(let d=0;d<this.blockLength;d++)c[d]=this.valueHexView[d];return this.valueHexView=c,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Jt(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 o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength-1;c++)s[c]=o[c]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const t=It(this.valueDec,7);if(t.byteLength===0)return this.error="Error during encoding SID value",Ke;const n=new Uint8Array(t.byteLength);if(!e){const o=new Uint8Array(t),s=t.byteLength-1;for(let c=0;c<s;c++)n[c]=o[c]|128;n[s]=o[s]}return n.buffer}toString(){let e="";return this.isHexOnly?e=$.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Hn.NAME="relativeSidBlock";class _a extends xe{constructor({value:e=Ie,...t}={}){super(t),this.value=[],e&&this.fromString(e)}fromBER(e,t,n){let o=t;for(;n>0;){const s=new Hn;if(o=s.fromBER(e,o,n),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,n-=s.blockLength,this.value.push(s)}return o}toBER(e,t){const n=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(e);if(s.byteLength===0)return this.error=this.value[o].error,Ke;n.push(s)}return Dn(n)}fromString(e){this.value=[];let t=0,n=0,o="";do{n=e.indexOf(".",t),n===-1?o=e.substring(t):o=e.substring(t,n),t=n+1;const s=new Hn;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(n!==-1);return!0}toString(){let e="",t=!1;for(let n=0;n<this.value.length;n++){t=this.value[n].isHexOnly;let o=this.value[n].toString();n!==0&&(e=`${e}.`),t&&(o=`{${o}}`),e+=o}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}}_a.NAME="RelativeObjectIdentifierValueBlock";var Oa;class Fn extends me{constructor(e={}){super(e,_a),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Oa=Fn,D.RelativeObjectIdentifier=Oa,Fn.NAME="RelativeObjectIdentifier";var Va;class ot extends Ee{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Va=ot,D.Sequence=Va,ot.NAME="SEQUENCE";var Ta;let st=class extends Ee{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Ta=st,D.Set=Ta,st.NAME="SET";class ja extends Ye(xe){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=Ie}toJSON(){return{...super.toJSON(),value:this.value}}}ja.NAME="StringValueBlock";class Pa extends ja{}Pa.NAME="SimpleStringValueBlock";class Pe extends Rn{constructor({...e}={}){super(e,Pa)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,P.toUint8Array(e))}fromString(e){const t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t);for(let o=0;o<t;o++)n[o]=e.charCodeAt(o);this.valueBlock.value=e}}Pe.NAME="SIMPLE STRING";class Da extends Pe{fromBuffer(e){this.valueBlock.valueHexView=P.toUint8Array(e);try{this.valueBlock.value=$.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=$.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array($.FromUtf8String(e)),this.valueBlock.value=e}}Da.NAME="Utf8StringValueBlock";var $a;class at extends Da{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}$a=at,D.Utf8String=$a,at.NAME="UTF8String";class Ra extends Pe{fromBuffer(e){this.valueBlock.value=$.ToUtf16String(e),this.valueBlock.valueHexView=P.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array($.FromUtf16String(e))}}Ra.NAME="BmpStringValueBlock";var Ma;class di extends Ra{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Ma=di,D.BmpString=Ma,di.NAME="BMPString";class Ua extends Pe{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),n=new Uint8Array(t);for(let o=0;o<n.length;o+=4)n[o]=n[o+3],n[o+1]=n[o+2],n[o+2]=0,n[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,n=this.valueBlock.valueHexView=new Uint8Array(t*4);for(let o=0;o<t;o++){const s=It(e.charCodeAt(o),8),c=new Uint8Array(s);if(c.length>4)continue;const d=4-c.length;for(let u=c.length-1;u>=0;u--)n[o*4+u+d]=c[u]}this.valueBlock.value=e}}Ua.NAME="UniversalStringValueBlock";var La;class fi extends Ua{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}La=fi,D.UniversalString=La,fi.NAME="UniversalString";var Ha;class pi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Ha=pi,D.NumericString=Ha,pi.NAME="NumericString";var Fa;class hi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Fa=hi,D.PrintableString=Fa,hi.NAME="PrintableString";var Ka;class yi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Ka=yi,D.TeletexString=Ka,yi.NAME="TeletexString";var qa;class gi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}qa=gi,D.VideotexString=qa,gi.NAME="VideotexString";var za;class mi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}za=mi,D.IA5String=za,mi.NAME="IA5String";var Ga;class bi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Ga=bi,D.GraphicString=Ga,bi.NAME="GraphicString";var Wa;class Er extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Wa=Er,D.VisibleString=Wa,Er.NAME="VisibleString";var Ja;class vi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Ja=vi,D.GeneralString=Ja,vi.NAME="GeneralString";var Ya;class wi extends Pe{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Ya=wi,D.CharacterString=Ya,wi.NAME="CharacterString";var Za;class Nr extends Er{constructor({value:e,valueDate:t,...n}={}){if(super(n),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 o=0;o<e.length;o++)this.valueBlock.valueHexView[o]=e.charCodeAt(o)}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,P.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let o=0;o<e.length;o++)n[o]=e.charCodeAt(o);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 n=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(n===null){this.error="Wrong input string for conversion";return}const o=parseInt(n[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(n[2],10),this.day=parseInt(n[3],10),this.hour=parseInt(n[4],10),this.minute=parseInt(n[5],10),this.second=parseInt(n[6],10)}toString(e="iso"){if(e==="iso"){const t=new Array(7);return t[0]=je(this.year<2e3?this.year-1900:this.year-2e3,2),t[1]=je(this.month,2),t[2]=je(this.day,2),t[3]=je(this.hour,2),t[4]=je(this.minute,2),t[5]=je(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}}}Za=Nr,D.UTCTime=Za,Nr.NAME="UTCTime";var Qa;class ki extends Nr{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(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t=!1,n="",o="",s=0,c,d=0,u=0;if(e[e.length-1]==="Z")n=e.substring(0,e.length-1),t=!0;else{const w=new Number(e[e.length-1]);if(isNaN(w.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(t){if(n.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(n.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let w=1,V=n.indexOf("+"),C="";if(V===-1&&(V=n.indexOf("-"),w=-1),V!==-1){if(C=n.substring(V+1),n=n.substring(0,V),C.length!==2&&C.length!==4)throw new Error("Wrong input string for conversion");let p=parseInt(C.substring(0,2),10);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");if(d=w*p,C.length===4){if(p=parseInt(C.substring(2,4),10),isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");u=w*p}}}let f=n.indexOf(".");if(f===-1&&(f=n.indexOf(",")),f!==-1){const w=new Number(`0${n.substring(f)}`);if(isNaN(w.valueOf()))throw new Error("Wrong input string for conversion");s=w.valueOf(),o=n.substring(0,f)}else o=n;switch(!0){case o.length===8:if(c=/(\d{4})(\d{2})(\d{2})/ig,f!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let w=60*s;this.minute=Math.floor(w),w=60*(w-this.minute),this.second=Math.floor(w),w=1e3*(w-this.second),this.millisecond=Math.floor(w)}break;case o.length===12:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){let w=60*s;this.second=Math.floor(w),w=1e3*(w-this.second),this.millisecond=Math.floor(w)}break;case o.length===14:if(c=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,f!==-1){const w=1e3*s;this.millisecond=Math.floor(w)}break;default:throw new Error("Wrong input string for conversion")}const h=c.exec(o);if(h===null)throw new Error("Wrong input string for conversion");for(let w=1;w<h.length;w++)switch(w){case 1:this.year=parseInt(h[w],10);break;case 2:this.month=parseInt(h[w],10);break;case 3:this.day=parseInt(h[w],10);break;case 4:this.hour=parseInt(h[w],10)+d;break;case 5:this.minute=parseInt(h[w],10)+u;break;case 6:this.second=parseInt(h[w],10);break;default:throw new Error("Wrong input string for conversion")}if(t===!1){const w=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=w.getUTCFullYear(),this.month=w.getUTCMonth(),this.day=w.getUTCDay(),this.hour=w.getUTCHours(),this.minute=w.getUTCMinutes(),this.second=w.getUTCSeconds(),this.millisecond=w.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const t=[];return t.push(je(this.year,4)),t.push(je(this.month,2)),t.push(je(this.day,2)),t.push(je(this.hour,2)),t.push(je(this.minute,2)),t.push(je(this.second,2)),this.millisecond!==0&&(t.push("."),t.push(je(this.millisecond,3))),t.push("Z"),t.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Qa=ki,D.GeneralizedTime=Qa,ki.NAME="GeneralizedTime";var Xa;class Kn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Xa=Kn,D.DATE=Xa,Kn.NAME="DATE";var ec;class qn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ec=qn,D.TimeOfDay=ec,qn.NAME="TimeOfDay";var tc;class zn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}tc=zn,D.DateTime=tc,zn.NAME="DateTime";var rc;class Gn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}rc=Gn,D.Duration=rc,Gn.NAME="Duration";var ic;class Wn extends at{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}ic=Wn,D.TIME=ic,Wn.NAME="TIME";class Vt{constructor({name:e=Ie,optional:t=!1}={}){this.name=e,this.optional=t}}class Jn extends Vt{constructor({value:e=[],...t}={}){super(t),this.value=e}}class Si extends Vt{constructor({value:e=new Vt,local:t=!1,...n}={}){super(n),this.value=e,this.local=t}}class pd{constructor({data:e=ai}={}){this.dataView=P.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=P.toUint8Array(e)}fromBER(e,t,n){const o=t+n;return this.dataView=P.toUint8Array(e).subarray(t,o),o}toBER(e){return this.dataView.slice().buffer}}function Tt(r,e,t){if(t instanceof Jn){for(let s=0;s<t.value.length;s++)if(Tt(r,e,t.value[s]).verified)return{verified:!0,result:r};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return t.hasOwnProperty($n)&&(s.name=t.name),s}}if(t instanceof Vt)return t.hasOwnProperty($n)&&(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(!(rd in t))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(sd in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ad in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=t.idBlock.toBER(!1);if(n.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(t.idBlock.fromBER(n,0,n.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(t.idBlock.hasOwnProperty(id)===!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(nd)===!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(od)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(t.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:r};if(!(td 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(!(sa in t.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=t.idBlock.valueHexView,c=e.idBlock.valueHexView;if(s.length!==c.length)return{verified:!1,result:r};for(let d=0;d<s.length;d++)if(s[d]!==c[1])return{verified:!1,result:r}}if(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&(r[t.name]=e)),t instanceof D.Constructed){let s=0,c={verified:!1,result:{error:"Unknown error"}},d=t.valueBlock.value.length;if(d>0&&t.valueBlock.value[0]instanceof Si&&(d=e.valueBlock.value.length),d===0)return{verified:!0,result:r};if(e.valueBlock.value.length===0&&t.valueBlock.value.length!==0){let u=!0;for(let f=0;f<t.valueBlock.value.length;f++)u=u&&(t.valueBlock.value[f].optional||!1);return u?{verified:!0,result:r}:(t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&delete r[t.name]),r.error="Inconsistent object length",{verified:!1,result:r})}for(let u=0;u<d;u++)if(u-s>=e.valueBlock.value.length){if(t.valueBlock.value[u].optional===!1){const f={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,Ie),t.name&&(delete r[t.name],f.name=t.name)),f}}else if(t.valueBlock.value[0]instanceof Si){if(c=Tt(r,e.valueBlock.value[u],t.valueBlock.value[0].value),c.verified===!1)if(t.valueBlock.value[0].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&delete r[t.name]),c;if($n in t.valueBlock.value[0]&&t.valueBlock.value[0].name.length>0){let f={};cd in t.valueBlock.value[0]&&t.valueBlock.value[0].local?f=e:f=r,typeof f[t.valueBlock.value[0].name]>"u"&&(f[t.valueBlock.value[0].name]=[]),f[t.valueBlock.value[0].name].push(e.valueBlock.value[u])}}else if(c=Tt(r,e.valueBlock.value[u-s],t.valueBlock.value[u]),c.verified===!1)if(t.valueBlock.value[u].optional)s++;else return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&delete r[t.name]),c;if(c.verified===!1){const u={verified:!1,result:r};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&(delete r[t.name],u.name=t.name)),u}return{verified:!0,result:r}}if(t.primitiveSchema&&sa in e.valueBlock){const s=Yt(e.valueBlock.valueHexView);if(s.offset===-1){const c={verified:!1,result:s.result};return t.name&&(t.name=t.name.replace(/^\s+|\s+$/g,Ie),t.name&&(delete r[t.name],c.name=t.name)),c}return Tt(r,s.result,t.primitiveSchema)}return{verified:!0,result:r}}function hd(r,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const t=Yt(P.toUint8Array(r));return t.offset===-1?{verified:!1,result:t.result}:Tt(t.result,t.result,e)}const nc=Object.freeze(Object.defineProperty({__proto__:null,Any:Vt,BaseBlock:me,BaseStringBlock:Rn,BitString:Ot,BmpString:di,Boolean:ci,CharacterString:wi,Choice:Jn,Constructed:Ee,DATE:Kn,DateTime:zn,Duration:Gn,EndOfContent:Mn,Enumerated:li,GeneralString:vi,GeneralizedTime:ki,GraphicString:bi,HexBlock:Ye,IA5String:mi,Integer:Ze,Null:Nt,NumericString:pi,ObjectIdentifier:ui,OctetString:_t,Primitive:Ir,PrintableString:hi,RawData:pd,RelativeObjectIdentifier:Fn,Repeated:Si,Sequence:ot,Set:st,TIME:Wn,TeletexString:yi,TimeOfDay:qn,UTCTime:Nr,UniversalString:fi,Utf8String:at,ValueBlock:xe,VideotexString:gi,ViewWriter:si,VisibleString:Er,compareSchema:Tt,fromBER:Zt,verifySchema:hd},Symbol.toStringTag,{value:"Module"}));var I;(function(r){r[r.Sequence=0]="Sequence",r[r.Set=1]="Set",r[r.Choice=2]="Choice"})(I||(I={}));var v;(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"})(v||(v={}));class Ci{constructor(e,t=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(P.isBufferSource(e))this.unusedBits=t,this.value=P.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Ot))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 Ot({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Ot({name:e})}toNumber(){let e="";const t=new Uint8Array(this.value);for(const n of t)e+=n.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 n=t.length+7>>3;this.unusedBits=(n<<3)-t.length;const o=new Uint8Array(n);t=t.padStart(n<<3,"0").split("").reverse().join("");let s=0;for(;s<n;)o[s]=parseInt(t.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class te{constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):P.isBufferSource(e)?this.buffer=P.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 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 yd={fromASN:r=>r instanceof Nt?null:r.valueBeforeDecodeView,toASN:r=>{if(r===null)return new Nt;const e=Zt(r);if(e.result.error)throw new Error(e.result.error);return e.result}},gd={fromASN:r=>r.valueBlock.valueHexView.byteLength>=4?r.valueBlock.toString():r.valueBlock.valueDec,toASN:r=>new Ze({value:+r})},md={fromASN:r=>r.valueBlock.valueDec,toASN:r=>new li({value:r})},de={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ze({valueHex:r})},bd={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new Ot({valueHex:r})},vd={fromASN:r=>r.valueBlock.toString(),toASN:r=>new ui({value:r})},wd={fromASN:r=>r.valueBlock.value,toASN:r=>new ci({value:r})},xi={fromASN:r=>r.valueBlock.valueHexView,toASN:r=>new _t({valueHex:r})},kd={fromASN:r=>new te(r.getValue()),toASN:r=>r.toASN()};function Me(r){return{fromASN:e=>e.valueBlock.value,toASN:e=>new r({value:e})}}const oc=Me(at),Sd=Me(di),Cd=Me(fi),xd=Me(pi),Ad=Me(hi),Bd=Me(yi),Id=Me(gi),Ed=Me(mi),Nd=Me(bi),_d=Me(Er),Od=Me(vi),Vd=Me(wi),Td={fromASN:r=>r.toDate(),toASN:r=>new Nr({valueDate:r})},jd={fromASN:r=>r.toDate(),toASN:r=>new ki({valueDate:r})},Pd={fromASN:()=>null,toASN:()=>new Nt};function Yn(r){switch(r){case v.Any:return yd;case v.BitString:return bd;case v.BmpString:return Sd;case v.Boolean:return wd;case v.CharacterString:return Vd;case v.Enumerated:return md;case v.GeneralString:return Od;case v.GeneralizedTime:return jd;case v.GraphicString:return Nd;case v.IA5String:return Ed;case v.Integer:return gd;case v.Null:return Pd;case v.NumericString:return xd;case v.ObjectIdentifier:return vd;case v.OctetString:return xi;case v.PrintableString:return Ad;case v.TeletexString:return Bd;case v.UTCTime:return Td;case v.UniversalString:return Cd;case v.Utf8String:return oc;case v.VideotexString:return Id;case v.VisibleString:return _d;default:return null}}function ct(r){return typeof r=="function"&&r.prototype?r.prototype.toASN&&r.prototype.fromASN?!0:ct(r.prototype):!!(r&&typeof r=="object"&&"toASN"in r&&"fromASN"in r)}function sc(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:sc(t)}return!1}function Dd(r,e){if(!(r&&e)||r.byteLength!==e.byteLength)return!1;const t=new Uint8Array(r),n=new Uint8Array(e);for(let o=0;o<r.byteLength;o++)if(t[o]!==n[o])return!1;return!0}class $d{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,t=!1){const n=this.items.get(e);if(!n)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(t&&!n.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return n}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:I.Sequence,items:{}},n=this.findParentSchema(e);return n&&(Object.assign(t,n),t.items=Object.assign({},t.items,n.items)),t}create(e,t){const n=this.items.get(e)||this.createDefault(e),o=[];for(const s in n.items){const c=n.items[s],d=t?s:"";let u;if(typeof c.type=="number"){const h=v[c.type],w=nc[h];if(!w)throw new Error(`Cannot get ASN1 class by name '${h}'`);u=new w({name:d})}else ct(c.type)?u=new c.type().toSchema(d):c.optional?this.get(c.type).type===I.Choice?u=new Vt({name:d}):(u=this.create(c.type,!1),u.name=d):u=new Vt({name:d});const f=!!c.optional||c.defaultValue!==void 0;if(c.repeated){u.name="";const h=c.repeated==="set"?st:ot;u=new h({name:"",value:[new Si({name:d,value:u})]})}if(c.context!==null&&c.context!==void 0)if(c.implicit)if(typeof c.type=="number"||ct(c.type)){const h=c.repeated?Ee:Ir;o.push(new h({name:d,optional:f,idBlock:{tagClass:3,tagNumber:c.context}}))}else{this.cache(c.type);const h=!!c.repeated;let w=h?u:this.get(c.type,!0).schema;w="valueBlock"in w?w.valueBlock.value:w.value,o.push(new Ee({name:h?"":d,optional:f,idBlock:{tagClass:3,tagNumber:c.context},value:w}))}else o.push(new Ee({optional:f,idBlock:{tagClass:3,tagNumber:c.context},value:[u]}));else u.optional=f,o.push(u)}switch(n.type){case I.Sequence:return new ot({value:o,name:""});case I.Set:return new st({value:o,name:""});case I.Choice:return new Jn({value:o,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 Ue=new $d,O=r=>e=>{let t;Ue.has(e)?t=Ue.get(e):(t=Ue.createDefault(e),Ue.set(e,t)),Object.assign(t,r)},l=r=>(e,t)=>{let n;Ue.has(e.constructor)?n=Ue.get(e.constructor):(n=Ue.createDefault(e.constructor),Ue.set(e.constructor,n));const o=Object.assign({},r);if(typeof o.type=="number"&&!o.converter){const s=Yn(r.type);if(!s)throw new Error(`Cannot get default converter for property '${t}' of ${e.constructor.name}`);o.converter=s}n.items[t]=o};class ac extends Error{constructor(){super(...arguments),this.schemas=[]}}class Rd{static parse(e,t){const n=Zt(e);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,t)}static fromASN(e,t){var n;try{if(ct(t))return new t().fromASN(e);const o=Ue.get(t);Ue.cache(t);let s=o.schema;if(e.constructor===Ee&&o.type!==I.Choice){s=new Ee({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const u in o.items)delete e[u]}const c=Tt({},e,s);if(!c.verified)throw new ac(`Data does not match to ${t.name} ASN1 schema. ${c.result.error}`);const d=new t;if(sc(t)){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 u=o.itemType;if(typeof u=="number"){const f=Yn(u);if(!f)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,h=>f.fromASN(h))}else return t.from(e.valueBlock.value,f=>this.fromASN(f,u))}for(const u in o.items){const f=c.result[u];if(!f)continue;const h=o.items[u],w=h.type;if(typeof w=="number"||ct(w)){const V=(n=h.converter)!==null&&n!==void 0?n:ct(w)?new w:null;if(!V)throw new Error("Converter is empty");if(h.repeated)if(h.implicit){const C=h.repeated==="sequence"?ot:st,p=new C;p.valueBlock=f.valueBlock;const m=Zt(p.toBER(!1));if(m.offset===-1)throw new Error(`Cannot parse the child item. ${m.result.error}`);if(!("value"in m.result.valueBlock&&Array.isArray(m.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const y=m.result.valueBlock.value;d[u]=Array.from(y,b=>V.fromASN(b))}else d[u]=Array.from(f,C=>V.fromASN(C));else{let C=f;if(h.implicit){let p;if(ct(w))p=new w().toSchema("");else{const m=v[w],y=nc[m];if(!y)throw new Error(`Cannot get '${m}' class from asn1js module`);p=new y}p.valueBlock=C.valueBlock,C=Zt(p.toBER(!1)).result}d[u]=V.fromASN(C)}}else if(h.repeated){if(!Array.isArray(f))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");d[u]=Array.from(f,V=>this.fromASN(V,w))}else d[u]=this.fromASN(f,w)}return d}catch(o){throw o instanceof ac&&o.schemas.push(t.name),o}}}class Zn{static serialize(e){return e instanceof me?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&ct(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const t=e.constructor,n=Ue.get(t);Ue.cache(t);let o=[];if(n.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof n.itemType=="number"){const c=Yn(n.itemType);if(!c)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);o=e.map(d=>c.toASN(d))}else o=e.map(c=>this.toAsnItem({type:n.itemType},"[]",t,c))}else for(const c in n.items){const d=n.items[c],u=e[c];if(u===void 0||d.defaultValue===u||typeof d.defaultValue=="object"&&typeof u=="object"&&Dd(this.serialize(d.defaultValue),this.serialize(u)))continue;const f=Zn.toAsnItem(d,c,t,u);if(typeof d.context=="number")if(d.implicit)if(!d.repeated&&(typeof d.type=="number"||ct(d.type))){const h={};h.valueHex=f instanceof Nt?f.valueBeforeDecodeView:f.valueBlock.toBER(),o.push(new Ir({optional:d.optional,idBlock:{tagClass:3,tagNumber:d.context},...h}))}else o.push(new Ee({optional:d.optional,idBlock:{tagClass:3,tagNumber:d.context},value:f.valueBlock.value}));else o.push(new Ee({optional:d.optional,idBlock:{tagClass:3,tagNumber:d.context},value:[f]}));else d.repeated?o=o.concat(f):o.push(f)}let s;switch(n.type){case I.Sequence:s=new ot({value:o});break;case I.Set:s=new st({value:o});break;case I.Choice:if(!o[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(e,t,n,o){let s;if(typeof e.type=="number"){const c=e.converter;if(!c)throw new Error(`Property '${t}' doesn't have converter for type ${v[e.type]} in schema '${n.name}'`);if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const d=Array.from(o,f=>c.toASN(f)),u=e.repeated==="sequence"?ot:st;s=new u({value:d})}else s=c.toASN(o)}else if(e.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,u=>this.toASN(u)),d=e.repeated==="sequence"?ot:st;s=new d({value:c})}else s=this.toASN(o);return s}}class oe extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const t of e)this.push(t)}}}class U{static serialize(e){return Zn.serialize(e)}static parse(e,t){return Rd.parse(e,t)}static toString(e){const t=P.isBufferSource(e)?P.toArrayBuffer(e):U.serialize(e),n=Zt(t);if(n.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${n.result.error}`);return n.result.toString()}}function a(r,e,t,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(c=r[d])&&(s=(o<3?c(s):o>3?c(e,t,s):c(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s}typeof SuppressedError=="function"&&SuppressedError;var cc={exports:{}};(function(r){(function(e){const t="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",d="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${d})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${d})|(?:::)(?:${d})?)${t}\\.${t}\\.${t}\\.${t}(${c})?$`,"i")};function f(p,m){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let y=0,b=-1,k=(p.match(u.zoneIndex)||[])[0],g,A;for(k&&(k=k.substring(1),p=p.replace(/%.+$/,""));(b=p.indexOf(":",b+1))>=0;)y++;if(p.substr(0,2)==="::"&&y--,p.substr(-2,2)==="::"&&y--,y>m)return null;for(A=m-y,g=":";A--;)g+="0:";return p=p.replace("::",g),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),m=function(){const B=p.split(":"),E=[];for(let _=0;_<B.length;_++)E.push(parseInt(B[_],16));return E}(),{parts:m,zoneId:k}}function h(p,m,y,b){if(p.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let k=0,g;for(;b>0;){if(g=y-b,g<0&&(g=0),p[k]>>g!==m[k]>>g)return!1;b-=y,k+=1}return!0}function w(p){if(s.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(o.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function V(p,m){for(;p.length<m;)p=`0${p}`;return p}const C={};C.IPv4=function(){function p(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,b;for(y=0;y<m.length;y++)if(b=m[y],!(0<=b&&b<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return p.prototype.SpecialRanges={unspecified:[[new p([0,0,0,0]),8]],broadcast:[[new p([255,255,255,255]),32]],multicast:[[new p([224,0,0,0]),4]],linkLocal:[[new p([169,254,0,0]),16]],loopback:[[new p([127,0,0,0]),8]],carrierGradeNat:[[new p([100,64,0,0]),10]],private:[[new p([10,0,0,0]),8],[new p([172,16,0,0]),12],[new p([192,168,0,0]),16]],reserved:[[new p([192,0,0,0]),24],[new p([192,0,2,0]),24],[new p([192,88,99,0]),24],[new p([198,18,0,0]),15],[new p([198,51,100,0]),24],[new p([203,0,113,0]),24],[new p([240,0,0,0]),4]]},p.prototype.kind=function(){return"ipv4"},p.prototype.match=function(m,y){let b;if(y===void 0&&(b=m,m=b[0],y=b[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,m.octets,8,y)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1;const b={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let k,g,A;for(k=3;k>=0;k-=1)if(g=this.octets[k],g in b){if(A=b[g],y&&A!==0)return null;A!==8&&(y=!0),m+=A}else return null;return 32-m},p.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return C.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p}(),C.IPv4.broadcastAddressFromCIDR=function(p){try{const m=this.parseCIDR(p),y=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[];let g=0;for(;g<4;)k.push(parseInt(y[g],10)|parseInt(b[g],10)^255),g++;return new this(k)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.isIPv4=function(p){return this.parser(p)!==null},C.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},C.IPv4.isValidFourPartDecimal=function(p){return!!(C.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},C.IPv4.networkAddressFromCIDR=function(p){let m,y,b,k,g;try{for(m=this.parseCIDR(p),b=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[],y=0;y<4;)k.push(parseInt(b[y],10)&parseInt(g[y],10)),y++;return new this(k)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},C.IPv4.parse=function(p){const m=this.parser(p);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},C.IPv4.parseCIDR=function(p){let m;if(m=p.match(/^(.+)\/(\d+)$/)){const y=parseInt(m[2]);if(y>=0&&y<=32){const b=[this.parse(m[1]),y];return Object.defineProperty(b,"toString",{value:function(){return this.join("/")}}),b}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},C.IPv4.parser=function(p){let m,y,b;if(m=p.match(n.fourOctet))return function(){const k=m.slice(1,6),g=[];for(let A=0;A<k.length;A++)y=k[A],g.push(w(y));return g}();if(m=p.match(n.longValue)){if(b=w(m[1]),b>4294967295||b<0)throw new Error("ipaddr: address outside defined range");return function(){const k=[];let g;for(g=0;g<=24;g+=8)k.push(b>>g&255);return k}().reverse()}else return(m=p.match(n.twoOctet))?function(){const k=m.slice(1,4),g=[];if(b=w(k[1]),b>16777215||b<0)throw new Error("ipaddr: address outside defined range");return g.push(w(k[0])),g.push(b>>16&255),g.push(b>>8&255),g.push(b&255),g}():(m=p.match(n.threeOctet))?function(){const k=m.slice(1,5),g=[];if(b=w(k[2]),b>65535||b<0)throw new Error("ipaddr: address outside defined range");return g.push(w(k[0])),g.push(w(k[1])),g.push(b>>8&255),g.push(b&255),g}():null},C.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let y=0;const b=Math.floor(p/8);for(;y<b;)m[y]=255,y++;return b<4&&(m[b]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},C.IPv6=function(){function p(m,y){let b,k;if(m.length===16)for(this.parts=[],b=0;b<=14;b+=2)this.parts.push(m[b]<<8|m[b+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(b=0;b<this.parts.length;b++)if(k=this.parts[b],!(0<=k&&k<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return p.prototype.SpecialRanges={unspecified:[new p([0,0,0,0,0,0,0,0]),128],linkLocal:[new p([65152,0,0,0,0,0,0,0]),10],multicast:[new p([65280,0,0,0,0,0,0,0]),8],loopback:[new p([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new p([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new p([0,0,0,0,0,65535,0,0]),96],rfc6145:[new p([0,0,0,0,65535,0,0,0]),96],rfc6052:[new p([100,65435,0,0,0,0,0,0]),96],"6to4":[new p([8194,0,0,0,0,0,0,0]),16],teredo:[new p([8193,0,0,0,0,0,0,0]),32],reserved:[[new p([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new p([8193,2,0,0,0,0,0,0]),48],amt:[new p([8193,3,0,0,0,0,0,0]),32],as112v6:[new p([8193,4,274,0,0,0,0,0]),48],deprecated:[new p([8193,16,0,0,0,0,0,0]),28],orchid2:[new p([8193,32,0,0,0,0,0,0]),28]},p.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},p.prototype.kind=function(){return"ipv6"},p.prototype.match=function(m,y){let b;if(y===void 0&&(b=m,m=b[0],y=b[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,m.parts,16,y)},p.prototype.prefixLengthFromSubnetMask=function(){let m=0,y=!1;const b={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let k,g;for(let A=7;A>=0;A-=1)if(k=this.parts[A],k in b){if(g=b[k],y&&g!==0)return null;g!==16&&(y=!0),m+=g}else return null;return 128-m},p.prototype.range=function(){return C.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let m;const y=[],b=this.parts;for(let k=0;k<b.length;k++)m=b[k],y.push(m>>8),y.push(m&255);return y},p.prototype.toFixedLengthString=function(){const m=(function(){const b=[];for(let k=0;k<this.parts.length;k++)b.push(V(this.parts[k].toString(16),4));return b}).call(this).join(":");let y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},p.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const m=this.parts.slice(-2),y=m[0],b=m[1];return new C.IPv4([y>>8,y&255,b>>8,b&255])},p.prototype.toNormalizedString=function(){const m=(function(){const b=[];for(let k=0;k<this.parts.length;k++)b.push(this.parts[k].toString(16));return b}).call(this).join(":");let y="";return this.zoneId&&(y=`%${this.zoneId}`),m+y},p.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString();let b=0,k=-1,g;for(;g=m.exec(y);)g[0].length>k&&(b=g.index,k=g[0].length);return k<0?y:`${y.substring(0,b)}::${y.substring(b+k)}`},p.prototype.toString=function(){return this.toRFC5952String()},p}(),C.IPv6.broadcastAddressFromCIDR=function(p){try{const m=this.parseCIDR(p),y=m[0].toByteArray(),b=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[];let g=0;for(;g<16;)k.push(parseInt(y[g],10)|parseInt(b[g],10)^255),g++;return new this(k)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},C.IPv6.isIPv6=function(p){return this.parser(p)!==null},C.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{const m=this.parser(p);return new this(m.parts,m.zoneId),!0}catch{return!1}},C.IPv6.networkAddressFromCIDR=function(p){let m,y,b,k,g;try{for(m=this.parseCIDR(p),b=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),k=[],y=0;y<16;)k.push(parseInt(b[y],10)&parseInt(g[y],10)),y++;return new this(k)}catch(A){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${A})`)}},C.IPv6.parse=function(p){const m=this.parser(p);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},C.IPv6.parseCIDR=function(p){let m,y,b;if((y=p.match(/^(.+)\/(\d+)$/))&&(m=parseInt(y[2]),m>=0&&m<=128))return b=[this.parse(y[1]),m],Object.defineProperty(b,"toString",{value:function(){return this.join("/")}}),b;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},C.IPv6.parser=function(p){let m,y,b,k,g,A;if(b=p.match(u.deprecatedTransitional))return this.parser(`::ffff:${b[1]}`);if(u.native.test(p))return f(p,8);if((b=p.match(u.transitional))&&(A=b[6]||"",m=f(b[1].slice(0,-1)+A,6),m.parts)){for(g=[parseInt(b[2]),parseInt(b[3]),parseInt(b[4]),parseInt(b[5])],y=0;y<g.length;y++)if(k=g[y],!(0<=k&&k<=255))return null;return m.parts.push(g[0]<<8|g[1]),m.parts.push(g[2]<<8|g[3]),{parts:m.parts,zoneId:m.zoneId}}return null},C.IPv6.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>128)throw new Error("ipaddr: invalid IPv6 prefix length");const m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let y=0;const b=Math.floor(p/8);for(;y<b;)m[y]=255,y++;return b<16&&(m[b]=Math.pow(2,p%8)-1<<8-p%8),new this(m)},C.fromByteArray=function(p){const m=p.length;if(m===4)return new C.IPv4(p);if(m===16)return new C.IPv6(p);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},C.isValid=function(p){return C.IPv6.isValid(p)||C.IPv4.isValid(p)},C.parse=function(p){if(C.IPv6.isValid(p))return C.IPv6.parse(p);if(C.IPv4.isValid(p))return C.IPv4.parse(p);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},C.parseCIDR=function(p){try{return C.IPv6.parseCIDR(p)}catch{try{return C.IPv4.parseCIDR(p)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},C.process=function(p){const m=this.parse(p);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},C.subnetMatch=function(p,m,y){let b,k,g,A;y==null&&(y="unicast");for(k in m)if(Object.prototype.hasOwnProperty.call(m,k)){for(g=m[k],g[0]&&!(g[0]instanceof Array)&&(g=[g]),b=0;b<g.length;b++)if(A=g[b],p.kind()===A[0].kind()&&p.match.apply(p,A))return k}return y},r.exports?r.exports=C:e.ipaddr=C})(Tn)})(cc);var lc=cc.exports;class uc{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((o,s)=>o+ +s,0);let n=e.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return n=n.slice(0,-1),`${n}/${t}`}static toString(e){if(e.byteLength===4||e.byteLength===16){const t=new Uint8Array(e);return lc.fromByteArray(Array.from(t)).toString()}return this.decodeIP($.ToHex(e))}static fromString(e){const t=lc.parse(e);return new Uint8Array(t.toByteArray()).buffer}}var Qn,Xn,eo;let be=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};a([l({type:v.TeletexString})],be.prototype,"teletexString",void 0),a([l({type:v.PrintableString})],be.prototype,"printableString",void 0),a([l({type:v.UniversalString})],be.prototype,"universalString",void 0),a([l({type:v.Utf8String})],be.prototype,"utf8String",void 0),a([l({type:v.BmpString})],be.prototype,"bmpString",void 0),be=a([O({type:I.Choice})],be);let Qt=class extends be{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?$.ToHex(this.anyValue):super.toString())}};a([l({type:v.IA5String})],Qt.prototype,"ia5String",void 0),a([l({type:v.Any})],Qt.prototype,"anyValue",void 0),Qt=a([O({type:I.Choice})],Qt);class _r{constructor(e={}){this.type="",this.value=new Qt,Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],_r.prototype,"type",void 0),a([l({type:Qt})],_r.prototype,"value",void 0);let Xt=Qn=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Qn.prototype)}};Xt=Qn=a([O({type:I.Set,itemType:_r})],Xt);let to=Xn=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Xn.prototype)}};to=Xn=a([O({type:I.Sequence,itemType:Xt})],to);let he=eo=class extends to{constructor(e){super(e),Object.setPrototypeOf(this,eo.prototype)}};he=eo=a([O({type:I.Sequence})],he);const Md={fromASN:r=>uc.toString(xi.fromASN(r)),toASN:r=>xi.toASN(uc.fromString(r))};class Or{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Or.prototype,"typeId",void 0),a([l({type:v.Any,context:0})],Or.prototype,"value",void 0);class ro{constructor(e={}){this.partyName=new be,Object.assign(this,e)}}a([l({type:be,optional:!0,context:0,implicit:!0})],ro.prototype,"nameAssigner",void 0),a([l({type:be,context:1,implicit:!0})],ro.prototype,"partyName",void 0);let Y=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Or,context:0,implicit:!0})],Y.prototype,"otherName",void 0),a([l({type:v.IA5String,context:1,implicit:!0})],Y.prototype,"rfc822Name",void 0),a([l({type:v.IA5String,context:2,implicit:!0})],Y.prototype,"dNSName",void 0),a([l({type:v.Any,context:3,implicit:!0})],Y.prototype,"x400Address",void 0),a([l({type:he,context:4,implicit:!1})],Y.prototype,"directoryName",void 0),a([l({type:ro,context:5})],Y.prototype,"ediPartyName",void 0),a([l({type:v.IA5String,context:6,implicit:!0})],Y.prototype,"uniformResourceIdentifier",void 0),a([l({type:v.OctetString,context:7,implicit:!0,converter:Md})],Y.prototype,"iPAddress",void 0),a([l({type:v.ObjectIdentifier,context:8,implicit:!0})],Y.prototype,"registeredID",void 0),Y=a([O({type:I.Choice})],Y);const er="1.3.6.1.5.5.7.3",jt="2.5.29";var io;class Ai{constructor(e={}){this.accessMethod="",this.accessLocation=new Y,Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Ai.prototype,"accessMethod",void 0),a([l({type:Y})],Ai.prototype,"accessLocation",void 0);let dc=io=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,io.prototype)}};dc=io=a([O({type:I.Sequence,itemType:Ai})],dc);const no=`${jt}.35`;class oo extends te{}class Pt{constructor(e={}){e&&Object.assign(this,e)}}a([l({type:oo,context:0,optional:!0,implicit:!0})],Pt.prototype,"keyIdentifier",void 0),a([l({type:Y,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Pt.prototype,"authorityCertIssuer",void 0),a([l({type:v.Integer,context:2,optional:!0,implicit:!0,converter:de})],Pt.prototype,"authorityCertSerialNumber",void 0);const fc=`${jt}.19`;class Bi{constructor(e={}){this.cA=!1,Object.assign(this,e)}}a([l({type:v.Boolean,defaultValue:!1})],Bi.prototype,"cA",void 0),a([l({type:v.Integer,optional:!0})],Bi.prototype,"pathLenConstraint",void 0);var so;let Ae=so=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,so.prototype)}};Ae=so=a([O({type:I.Sequence,itemType:Y})],Ae);var ao;let pc=ao=class extends Ae{constructor(e){super(e),Object.setPrototypeOf(this,ao.prototype)}};pc=ao=a([O({type:I.Sequence})],pc);var co;const hc=`${jt}.32`;let lt=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};a([l({type:v.IA5String})],lt.prototype,"ia5String",void 0),a([l({type:v.VisibleString})],lt.prototype,"visibleString",void 0),a([l({type:v.BmpString})],lt.prototype,"bmpString",void 0),a([l({type:v.Utf8String})],lt.prototype,"utf8String",void 0),lt=a([O({type:I.Choice})],lt);class lo{constructor(e={}){this.organization=new lt,this.noticeNumbers=[],Object.assign(this,e)}}a([l({type:lt})],lo.prototype,"organization",void 0),a([l({type:v.Integer,repeated:"sequence"})],lo.prototype,"noticeNumbers",void 0);class uo{constructor(e={}){Object.assign(this,e)}}a([l({type:lo,optional:!0})],uo.prototype,"noticeRef",void 0),a([l({type:lt,optional:!0})],uo.prototype,"explicitText",void 0);let Ii=class{constructor(e={}){Object.assign(this,e)}};a([l({type:v.IA5String})],Ii.prototype,"cPSuri",void 0),a([l({type:uo})],Ii.prototype,"userNotice",void 0),Ii=a([O({type:I.Choice})],Ii);class fo{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],fo.prototype,"policyQualifierId",void 0),a([l({type:v.Any})],fo.prototype,"qualifier",void 0);class Ei{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Ei.prototype,"policyIdentifier",void 0),a([l({type:fo,repeated:"sequence",optional:!0})],Ei.prototype,"policyQualifiers",void 0);let Ni=co=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,co.prototype)}};Ni=co=a([O({type:I.Sequence,itemType:Ei})],Ni);let _i=class{constructor(e=0){this.value=e}};a([l({type:v.Integer})],_i.prototype,"value",void 0),_i=a([O({type:I.Choice})],_i);let yc=class extends _i{};yc=a([O({type:I.Choice})],yc);var po,qe;(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"})(qe||(qe={}));class gc extends Ci{toJSON(){const e=[],t=this.toNumber();return t&qe.aACompromise&&e.push("aACompromise"),t&qe.affiliationChanged&&e.push("affiliationChanged"),t&qe.cACompromise&&e.push("cACompromise"),t&qe.certificateHold&&e.push("certificateHold"),t&qe.cessationOfOperation&&e.push("cessationOfOperation"),t&qe.keyCompromise&&e.push("keyCompromise"),t&qe.privilegeWithdrawn&&e.push("privilegeWithdrawn"),t&qe.superseded&&e.push("superseded"),t&qe.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let tr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Y,context:0,repeated:"sequence",implicit:!0})],tr.prototype,"fullName",void 0),a([l({type:Xt,context:1,implicit:!0})],tr.prototype,"nameRelativeToCRLIssuer",void 0),tr=a([O({type:I.Choice})],tr);class Vr{constructor(e={}){Object.assign(this,e)}}a([l({type:tr,context:0,optional:!0})],Vr.prototype,"distributionPoint",void 0),a([l({type:gc,context:1,optional:!0,implicit:!0})],Vr.prototype,"reasons",void 0),a([l({type:Y,context:2,optional:!0,repeated:"sequence",implicit:!0})],Vr.prototype,"cRLIssuer",void 0);let ho=po=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,po.prototype)}};ho=po=a([O({type:I.Sequence,itemType:Vr})],ho);var yo;let mc=yo=class extends ho{constructor(e){super(e),Object.setPrototypeOf(this,yo.prototype)}};mc=yo=a([O({type:I.Sequence,itemType:Vr})],mc);class ke{constructor(e={}){this.onlyContainsUserCerts=ke.ONLY,this.onlyContainsCACerts=ke.ONLY,this.indirectCRL=ke.ONLY,this.onlyContainsAttributeCerts=ke.ONLY,Object.assign(this,e)}}ke.ONLY=!1,a([l({type:tr,context:0,optional:!0})],ke.prototype,"distributionPoint",void 0),a([l({type:v.Boolean,context:1,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsUserCerts",void 0),a([l({type:v.Boolean,context:2,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsCACerts",void 0),a([l({type:gc,context:3,optional:!0,implicit:!0})],ke.prototype,"onlySomeReasons",void 0),a([l({type:v.Boolean,context:4,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"indirectCRL",void 0),a([l({type:v.Boolean,context:5,defaultValue:ke.ONLY,implicit:!0})],ke.prototype,"onlyContainsAttributeCerts",void 0);var Tr;(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"})(Tr||(Tr={}));let go=class{constructor(e=Tr.unspecified){this.reason=Tr.unspecified,this.reason=e}toJSON(){return Tr[this.reason]}toString(){return this.toJSON()}};a([l({type:v.Enumerated})],go.prototype,"reason",void 0),go=a([O({type:I.Choice})],go);var mo;const bc=`${jt}.37`;let Oi=mo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,mo.prototype)}};Oi=mo=a([O({type:I.Sequence,itemType:v.ObjectIdentifier})],Oi);const Ud=`${er}.1`,Ld=`${er}.2`,Hd=`${er}.3`,Fd=`${er}.4`,Kd=`${er}.8`,qd=`${er}.9`;let bo=class{constructor(e=new ArrayBuffer(0)){this.value=e}};a([l({type:v.Integer,converter:de})],bo.prototype,"value",void 0),bo=a([O({type:I.Choice})],bo);let vo=class{constructor(e){this.value=new Date,e&&(this.value=e)}};a([l({type:v.GeneralizedTime})],vo.prototype,"value",void 0),vo=a([O({type:I.Choice})],vo);var wo;let vc=wo=class extends Ae{constructor(e){super(e),Object.setPrototypeOf(this,wo.prototype)}};vc=wo=a([O({type:I.Sequence})],vc);const wc=`${jt}.15`;var ze;(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"})(ze||(ze={}));class ko extends Ci{toJSON(){const e=this.toNumber(),t=[];return e&ze.cRLSign&&t.push("crlSign"),e&ze.dataEncipherment&&t.push("dataEncipherment"),e&ze.decipherOnly&&t.push("decipherOnly"),e&ze.digitalSignature&&t.push("digitalSignature"),e&ze.encipherOnly&&t.push("encipherOnly"),e&ze.keyAgreement&&t.push("keyAgreement"),e&ze.keyCertSign&&t.push("keyCertSign"),e&ze.keyEncipherment&&t.push("keyEncipherment"),e&ze.nonRepudiation&&t.push("nonRepudiation"),t}toString(){return`[${this.toJSON().join(", ")}]`}}var So;class Vi{constructor(e={}){this.base=new Y,this.minimum=0,Object.assign(this,e)}}a([l({type:Y})],Vi.prototype,"base",void 0),a([l({type:v.Integer,context:0,defaultValue:0,implicit:!0})],Vi.prototype,"minimum",void 0),a([l({type:v.Integer,context:1,optional:!0,implicit:!0})],Vi.prototype,"maximum",void 0);let Ti=So=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,So.prototype)}};Ti=So=a([O({type:I.Sequence,itemType:Vi})],Ti);class kc{constructor(e={}){Object.assign(this,e)}}a([l({type:Ti,context:0,optional:!0,implicit:!0})],kc.prototype,"permittedSubtrees",void 0),a([l({type:Ti,context:1,optional:!0,implicit:!0})],kc.prototype,"excludedSubtrees",void 0);class Sc{constructor(e={}){Object.assign(this,e)}}a([l({type:v.Integer,context:0,implicit:!0,optional:!0,converter:de})],Sc.prototype,"requireExplicitPolicy",void 0),a([l({type:v.Integer,context:1,implicit:!0,optional:!0,converter:de})],Sc.prototype,"inhibitPolicyMapping",void 0);var Co;class xo{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],xo.prototype,"issuerDomainPolicy",void 0),a([l({type:v.ObjectIdentifier})],xo.prototype,"subjectDomainPolicy",void 0);let Cc=Co=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Co.prototype)}};Cc=Co=a([O({type:I.Sequence,itemType:xo})],Cc);var Ao;const xc=`${jt}.17`;let Bo=Ao=class extends Ae{constructor(e){super(e),Object.setPrototypeOf(this,Ao.prototype)}};Bo=Ao=a([O({type:I.Sequence})],Bo);let ut=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};a([l({type:v.ObjectIdentifier})],ut.prototype,"type",void 0),a([l({type:v.Any,repeated:"set"})],ut.prototype,"values",void 0);var Io;let Ac=Io=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Io.prototype)}};Ac=Io=a([O({type:I.Sequence,itemType:ut})],Ac);const Bc=`${jt}.14`;class vt extends oo{}class Ic{constructor(e={}){Object.assign(this,e)}}a([l({type:v.GeneralizedTime,context:0,implicit:!0,optional:!0})],Ic.prototype,"notBefore",void 0),a([l({type:v.GeneralizedTime,context:1,implicit:!0,optional:!0})],Ic.prototype,"notAfter",void 0);var jr;(function(r){r[r.keyUpdateAllowed=1]="keyUpdateAllowed",r[r.newExtensions=2]="newExtensions",r[r.pKIXCertificate=4]="pKIXCertificate"})(jr||(jr={}));class Ec extends Ci{toJSON(){const e=[],t=this.toNumber();return t&jr.pKIXCertificate&&e.push("pKIXCertificate"),t&jr.newExtensions&&e.push("newExtensions"),t&jr.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class Nc{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new Ec,Object.assign(this,e)}}a([l({type:v.GeneralString})],Nc.prototype,"entrustVers",void 0),a([l({type:Ec})],Nc.prototype,"entrustInfoFlags",void 0);var Eo;let _c=Eo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Eo.prototype)}};_c=Eo=a([O({type:I.Sequence,itemType:Ai})],_c);class R{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof R&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&ia(e.parameters,this.parameters)||e.parameters===this.parameters)}}a([l({type:v.ObjectIdentifier})],R.prototype,"algorithm",void 0),a([l({type:v.Any,optional:!0})],R.prototype,"parameters",void 0);class dt{constructor(e={}){this.algorithm=new R,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:R})],dt.prototype,"algorithm",void 0),a([l({type:v.BitString})],dt.prototype,"subjectPublicKey",void 0);let Se=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const t=new Date(e);t.getUTCFullYear()>2049?this.generalTime=t:this.utcTime=t}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};a([l({type:v.UTCTime})],Se.prototype,"utcTime",void 0),a([l({type:v.GeneralizedTime})],Se.prototype,"generalTime",void 0),Se=a([O({type:I.Choice})],Se);class ji{constructor(e){this.notBefore=new Se(new Date),this.notAfter=new Se(new Date),e&&(this.notBefore=new Se(e.notBefore),this.notAfter=new Se(e.notAfter))}}a([l({type:Se})],ji.prototype,"notBefore",void 0),a([l({type:Se})],ji.prototype,"notAfter",void 0);var No;let Ge=class qu{constructor(e={}){this.extnID="",this.critical=qu.CRITICAL,this.extnValue=new te,Object.assign(this,e)}};Ge.CRITICAL=!1,a([l({type:v.ObjectIdentifier})],Ge.prototype,"extnID",void 0),a([l({type:v.Boolean,defaultValue:Ge.CRITICAL})],Ge.prototype,"critical",void 0),a([l({type:te})],Ge.prototype,"extnValue",void 0);let Dt=No=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,No.prototype)}};Dt=No=a([O({type:I.Sequence,itemType:Ge})],Dt);var rr;(function(r){r[r.v1=0]="v1",r[r.v2=1]="v2",r[r.v3=2]="v3"})(rr||(rr={}));class Le{constructor(e={}){this.version=rr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new R,this.issuer=new he,this.validity=new ji,this.subject=new he,this.subjectPublicKeyInfo=new dt,Object.assign(this,e)}}a([l({type:v.Integer,context:0,defaultValue:rr.v1})],Le.prototype,"version",void 0),a([l({type:v.Integer,converter:de})],Le.prototype,"serialNumber",void 0),a([l({type:R})],Le.prototype,"signature",void 0),a([l({type:he})],Le.prototype,"issuer",void 0),a([l({type:ji})],Le.prototype,"validity",void 0),a([l({type:he})],Le.prototype,"subject",void 0),a([l({type:dt})],Le.prototype,"subjectPublicKeyInfo",void 0),a([l({type:v.BitString,context:1,implicit:!0,optional:!0})],Le.prototype,"issuerUniqueID",void 0),a([l({type:v.BitString,context:2,implicit:!0,optional:!0})],Le.prototype,"subjectUniqueID",void 0),a([l({type:Dt,context:3,optional:!0})],Le.prototype,"extensions",void 0);class ir{constructor(e={}){this.tbsCertificate=new Le,this.signatureAlgorithm=new R,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Le})],ir.prototype,"tbsCertificate",void 0),a([l({type:R})],ir.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],ir.prototype,"signatureValue",void 0);class Pi{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new Se,Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],Pi.prototype,"userCertificate",void 0),a([l({type:Se})],Pi.prototype,"revocationDate",void 0),a([l({type:Ge,optional:!0,repeated:"sequence"})],Pi.prototype,"crlEntryExtensions",void 0);class ft{constructor(e={}){this.signature=new R,this.issuer=new he,this.thisUpdate=new Se,Object.assign(this,e)}}a([l({type:v.Integer,optional:!0})],ft.prototype,"version",void 0),a([l({type:R})],ft.prototype,"signature",void 0),a([l({type:he})],ft.prototype,"issuer",void 0),a([l({type:Se})],ft.prototype,"thisUpdate",void 0),a([l({type:Se,optional:!0})],ft.prototype,"nextUpdate",void 0),a([l({type:Pi,repeated:"sequence",optional:!0})],ft.prototype,"revokedCertificates",void 0),a([l({type:Ge,optional:!0,context:0,repeated:"sequence"})],ft.prototype,"crlExtensions",void 0);let _o=class{constructor(e={}){this.tbsCertList=new ft,this.signatureAlgorithm=new R,this.signature=new ArrayBuffer(0),Object.assign(this,e)}};a([l({type:ft})],_o.prototype,"tbsCertList",void 0),a([l({type:R})],_o.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],_o.prototype,"signature",void 0);let nr=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};a([l({type:v.ObjectIdentifier})],nr.prototype,"attrType",void 0),a([l({type:v.Any,repeated:"set"})],nr.prototype,"attrValues",void 0);class Oo{constructor(e={}){this.acIssuer=new Y,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}a([l({type:Y})],Oo.prototype,"acIssuer",void 0),a([l({type:v.Integer})],Oo.prototype,"acSerial",void 0),a([l({type:ut,repeated:"sequence"})],Oo.prototype,"attrs",void 0);var Vo;let Di=Vo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Vo.prototype)}};Di=Vo=a([O({type:I.Sequence,itemType:v.ObjectIdentifier})],Di);class $i{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}a([l({type:v.Integer,optional:!0})],$i.prototype,"pathLenConstraint",void 0),a([l({type:Di,implicit:!0,context:0,optional:!0})],$i.prototype,"permittedAttrs",void 0),a([l({type:Di,implicit:!0,context:1,optional:!0})],$i.prototype,"excludedAttrs",void 0),a([l({type:v.Boolean,defaultValue:!0})],$i.prototype,"permitUnSpecified",void 0);class $t{constructor(e={}){this.issuer=new Ae,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:Ae})],$t.prototype,"issuer",void 0),a([l({type:v.Integer,converter:de})],$t.prototype,"serial",void 0),a([l({type:v.BitString,optional:!0})],$t.prototype,"issuerUID",void 0);var To;(function(r){r[r.publicKey=0]="publicKey",r[r.publicKeyCert=1]="publicKeyCert",r[r.otherObjectTypes=2]="otherObjectTypes"})(To||(To={}));class Rt{constructor(e={}){this.digestedObjectType=To.publicKey,this.digestAlgorithm=new R,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Enumerated})],Rt.prototype,"digestedObjectType",void 0),a([l({type:v.ObjectIdentifier,optional:!0})],Rt.prototype,"otherObjectTypeID",void 0),a([l({type:R})],Rt.prototype,"digestAlgorithm",void 0),a([l({type:v.BitString})],Rt.prototype,"objectDigest",void 0);class Ri{constructor(e={}){Object.assign(this,e)}}a([l({type:Ae,optional:!0})],Ri.prototype,"issuerName",void 0),a([l({type:$t,context:0,implicit:!0,optional:!0})],Ri.prototype,"baseCertificateID",void 0),a([l({type:Rt,context:1,implicit:!0,optional:!0})],Ri.prototype,"objectDigestInfo",void 0);let or=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Y,repeated:"sequence"})],or.prototype,"v1Form",void 0),a([l({type:Ri,context:0,implicit:!0})],or.prototype,"v2Form",void 0),or=a([O({type:I.Choice})],or);class Mi{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}a([l({type:v.GeneralizedTime})],Mi.prototype,"notBeforeTime",void 0),a([l({type:v.GeneralizedTime})],Mi.prototype,"notAfterTime",void 0);class Pr{constructor(e={}){Object.assign(this,e)}}a([l({type:$t,implicit:!0,context:0,optional:!0})],Pr.prototype,"baseCertificateID",void 0),a([l({type:Ae,implicit:!0,context:1,optional:!0})],Pr.prototype,"entityName",void 0),a([l({type:Rt,implicit:!0,context:2,optional:!0})],Pr.prototype,"objectDigestInfo",void 0);var jo;(function(r){r[r.v2=1]="v2"})(jo||(jo={}));class We{constructor(e={}){this.version=jo.v2,this.holder=new Pr,this.issuer=new or,this.signature=new R,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Mi,this.attributes=[],Object.assign(this,e)}}a([l({type:v.Integer})],We.prototype,"version",void 0),a([l({type:Pr})],We.prototype,"holder",void 0),a([l({type:or})],We.prototype,"issuer",void 0),a([l({type:R})],We.prototype,"signature",void 0),a([l({type:v.Integer,converter:de})],We.prototype,"serialNumber",void 0),a([l({type:Mi})],We.prototype,"attrCertValidityPeriod",void 0),a([l({type:ut,repeated:"sequence"})],We.prototype,"attributes",void 0),a([l({type:v.BitString,optional:!0})],We.prototype,"issuerUniqueID",void 0),a([l({type:Dt,optional:!0})],We.prototype,"extensions",void 0);class Ui{constructor(e={}){this.acinfo=new We,this.signatureAlgorithm=new R,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:We})],Ui.prototype,"acinfo",void 0),a([l({type:R})],Ui.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],Ui.prototype,"signatureValue",void 0);var Li;(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"})(Li||(Li={}));class Po extends Ci{}class Do{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier,implicit:!0,context:0})],Do.prototype,"type",void 0),a([l({type:v.Any,implicit:!0,context:1})],Do.prototype,"value",void 0);class $o{constructor(e={}){this.policyId="",this.classList=new Po(Li.unclassified),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],$o.prototype,"policyId",void 0),a([l({type:Po,defaultValue:new Po(Li.unclassified)})],$o.prototype,"classList",void 0),a([l({type:Do,repeated:"set"})],$o.prototype,"securityCategories",void 0);class Hi{constructor(e={}){Object.assign(this,e)}}a([l({type:te})],Hi.prototype,"cotets",void 0),a([l({type:v.ObjectIdentifier})],Hi.prototype,"oid",void 0),a([l({type:v.Utf8String})],Hi.prototype,"string",void 0);class Oc{constructor(e={}){this.values=[],Object.assign(this,e)}}a([l({type:Ae,implicit:!0,context:0,optional:!0})],Oc.prototype,"policyAuthority",void 0),a([l({type:Hi,repeated:"sequence"})],Oc.prototype,"values",void 0);var Ro;class Fi{constructor(e={}){this.targetCertificate=new $t,Object.assign(this,e)}}a([l({type:$t})],Fi.prototype,"targetCertificate",void 0),a([l({type:Y,optional:!0})],Fi.prototype,"targetName",void 0),a([l({type:Rt,optional:!0})],Fi.prototype,"certDigestInfo",void 0);let sr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Y,context:0,implicit:!0})],sr.prototype,"targetName",void 0),a([l({type:Y,context:1,implicit:!0})],sr.prototype,"targetGroup",void 0),a([l({type:Fi,context:2,implicit:!0})],sr.prototype,"targetCert",void 0),sr=a([O({type:I.Choice})],sr);let Mo=Ro=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ro.prototype)}};Mo=Ro=a([O({type:I.Sequence,itemType:sr})],Mo);var Uo;let Vc=Uo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Uo.prototype)}};Vc=Uo=a([O({type:I.Sequence,itemType:Mo})],Vc);class Tc{constructor(e={}){Object.assign(this,e)}}a([l({type:Ae,implicit:!0,context:0,optional:!0})],Tc.prototype,"roleAuthority",void 0),a([l({type:Y,implicit:!0,context:1})],Tc.prototype,"roleName",void 0);class Lo{constructor(e={}){this.service=new Y,this.ident=new Y,Object.assign(this,e)}}a([l({type:Y})],Lo.prototype,"service",void 0),a([l({type:Y})],Lo.prototype,"ident",void 0),a([l({type:te,optional:!0})],Lo.prototype,"authInfo",void 0);var Ho;class Fo{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Fo.prototype,"otherCertFormat",void 0),a([l({type:v.Any})],Fo.prototype,"otherCert",void 0);let ar=class{constructor(e={}){Object.assign(this,e)}};a([l({type:ir})],ar.prototype,"certificate",void 0),a([l({type:Ui,context:2,implicit:!0})],ar.prototype,"v2AttrCert",void 0),a([l({type:Fo,context:3,implicit:!0})],ar.prototype,"other",void 0),ar=a([O({type:I.Choice})],ar);let Ki=Ho=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ho.prototype)}};Ki=Ho=a([O({type:I.Set,itemType:ar})],Ki);class cr{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],cr.prototype,"contentType",void 0),a([l({type:v.Any,context:0})],cr.prototype,"content",void 0);let Dr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te})],Dr.prototype,"single",void 0),a([l({type:v.Any})],Dr.prototype,"any",void 0),Dr=a([O({type:I.Choice})],Dr);class qi{constructor(e={}){this.eContentType="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],qi.prototype,"eContentType",void 0),a([l({type:Dr,context:0,optional:!0})],qi.prototype,"eContent",void 0);var pt;(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"})(pt||(pt={}));let $r=class extends R{};$r=a([O({type:I.Sequence})],$r);let zi=class extends R{};zi=a([O({type:I.Sequence})],zi);let Qe=class extends R{};Qe=a([O({type:I.Sequence})],Qe);let Gi=class extends R{};Gi=a([O({type:I.Sequence})],Gi);let jc=class extends R{};jc=a([O({type:I.Sequence})],jc);let Ko=class extends R{};Ko=a([O({type:I.Sequence})],Ko);let Rr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:te,context:0,implicit:!0,optional:!0})],Rr.prototype,"value",void 0),a([l({type:te,converter:kd,context:0,implicit:!0,optional:!0,repeated:"sequence"})],Rr.prototype,"constructedValue",void 0),Rr=a([O({type:I.Choice})],Rr);class Mr{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new Gi,Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Mr.prototype,"contentType",void 0),a([l({type:Gi})],Mr.prototype,"contentEncryptionAlgorithm",void 0),a([l({type:Rr,optional:!0})],Mr.prototype,"encryptedContent",void 0);class lr{constructor(e={}){this.issuer=new he,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:he})],lr.prototype,"issuer",void 0),a([l({type:v.Integer,converter:de})],lr.prototype,"serialNumber",void 0);class Wi{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Wi.prototype,"keyAttrId",void 0),a([l({type:v.Any,optional:!0})],Wi.prototype,"keyAttr",void 0);var qo;class Ji{constructor(e={}){this.subjectKeyIdentifier=new vt,Object.assign(this,e)}}a([l({type:vt})],Ji.prototype,"subjectKeyIdentifier",void 0),a([l({type:v.GeneralizedTime,optional:!0})],Ji.prototype,"date",void 0),a([l({type:Wi,optional:!0})],Ji.prototype,"other",void 0);let ur=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Ji,context:0,implicit:!0,optional:!0})],ur.prototype,"rKeyId",void 0),a([l({type:lr,optional:!0})],ur.prototype,"issuerAndSerialNumber",void 0),ur=a([O({type:I.Choice})],ur);class zo{constructor(e={}){this.rid=new ur,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:ur})],zo.prototype,"rid",void 0),a([l({type:te})],zo.prototype,"encryptedKey",void 0);let Yi=qo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,qo.prototype)}};Yi=qo=a([O({type:I.Sequence,itemType:zo})],Yi);class Go{constructor(e={}){this.algorithm=new R,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:R})],Go.prototype,"algorithm",void 0),a([l({type:v.BitString})],Go.prototype,"publicKey",void 0);let Mt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:vt,context:0,implicit:!0,optional:!0})],Mt.prototype,"subjectKeyIdentifier",void 0),a([l({type:Go,context:1,implicit:!0,optional:!0})],Mt.prototype,"originatorKey",void 0),a([l({type:lr,optional:!0})],Mt.prototype,"issuerAndSerialNumber",void 0),Mt=a([O({type:I.Choice})],Mt);class dr{constructor(e={}){this.version=pt.v3,this.originator=new Mt,this.keyEncryptionAlgorithm=new Qe,this.recipientEncryptedKeys=new Yi,Object.assign(this,e)}}a([l({type:v.Integer})],dr.prototype,"version",void 0),a([l({type:Mt,context:0})],dr.prototype,"originator",void 0),a([l({type:te,context:1,optional:!0})],dr.prototype,"ukm",void 0),a([l({type:Qe})],dr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:Yi})],dr.prototype,"recipientEncryptedKeys",void 0);let fr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:vt,context:0,implicit:!0})],fr.prototype,"subjectKeyIdentifier",void 0),a([l({type:lr})],fr.prototype,"issuerAndSerialNumber",void 0),fr=a([O({type:I.Choice})],fr);class Ur{constructor(e={}){this.version=pt.v0,this.rid=new fr,this.keyEncryptionAlgorithm=new Qe,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],Ur.prototype,"version",void 0),a([l({type:fr})],Ur.prototype,"rid",void 0),a([l({type:Qe})],Ur.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Ur.prototype,"encryptedKey",void 0);class Lr{constructor(e={}){this.keyIdentifier=new te,Object.assign(this,e)}}a([l({type:te})],Lr.prototype,"keyIdentifier",void 0),a([l({type:v.GeneralizedTime,optional:!0})],Lr.prototype,"date",void 0),a([l({type:Wi,optional:!0})],Lr.prototype,"other",void 0);class Hr{constructor(e={}){this.version=pt.v4,this.kekid=new Lr,this.keyEncryptionAlgorithm=new Qe,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],Hr.prototype,"version",void 0),a([l({type:Lr})],Hr.prototype,"kekid",void 0),a([l({type:Qe})],Hr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Hr.prototype,"encryptedKey",void 0);class Fr{constructor(e={}){this.version=pt.v0,this.keyEncryptionAlgorithm=new Qe,this.encryptedKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],Fr.prototype,"version",void 0),a([l({type:Ko,context:0,optional:!0})],Fr.prototype,"keyDerivationAlgorithm",void 0),a([l({type:Qe})],Fr.prototype,"keyEncryptionAlgorithm",void 0),a([l({type:te})],Fr.prototype,"encryptedKey",void 0);class Wo{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Wo.prototype,"oriType",void 0),a([l({type:v.Any})],Wo.prototype,"oriValue",void 0);let wt=class{constructor(e={}){Object.assign(this,e)}};a([l({type:Ur,optional:!0})],wt.prototype,"ktri",void 0),a([l({type:dr,context:1,implicit:!0,optional:!0})],wt.prototype,"kari",void 0),a([l({type:Hr,context:2,implicit:!0,optional:!0})],wt.prototype,"kekri",void 0),a([l({type:Fr,context:3,implicit:!0,optional:!0})],wt.prototype,"pwri",void 0),a([l({type:Wo,context:4,implicit:!0,optional:!0})],wt.prototype,"ori",void 0),wt=a([O({type:I.Choice})],wt);var Jo;let Zi=Jo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Jo.prototype)}};Zi=Jo=a([O({type:I.Set,itemType:wt})],Zi);var Yo;class Qi{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],Qi.prototype,"otherRevInfoFormat",void 0),a([l({type:v.Any})],Qi.prototype,"otherRevInfo",void 0);let Kr=class{constructor(e={}){this.other=new Qi,Object.assign(this,e)}};a([l({type:Qi,context:1,implicit:!0})],Kr.prototype,"other",void 0),Kr=a([O({type:I.Choice})],Kr);let Zo=Yo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Yo.prototype)}};Zo=Yo=a([O({type:I.Set,itemType:Kr})],Zo);class Qo{constructor(e={}){Object.assign(this,e)}}a([l({type:Ki,context:0,implicit:!0,optional:!0})],Qo.prototype,"certs",void 0),a([l({type:Zo,context:1,implicit:!0,optional:!0})],Qo.prototype,"crls",void 0);var Xo;let es=Xo=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Xo.prototype)}};es=Xo=a([O({type:I.Set,itemType:nr})],es);class qr{constructor(e={}){this.version=pt.v0,this.recipientInfos=new Zi,this.encryptedContentInfo=new Mr,Object.assign(this,e)}}a([l({type:v.Integer})],qr.prototype,"version",void 0),a([l({type:Qo,context:0,implicit:!0,optional:!0})],qr.prototype,"originatorInfo",void 0),a([l({type:Zi})],qr.prototype,"recipientInfos",void 0),a([l({type:Mr})],qr.prototype,"encryptedContentInfo",void 0),a([l({type:es,context:1,implicit:!0,optional:!0})],qr.prototype,"unprotectedAttrs",void 0);const zd="1.2.840.113549.1.7.2";let pr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:vt,context:0,implicit:!0})],pr.prototype,"subjectKeyIdentifier",void 0),a([l({type:lr})],pr.prototype,"issuerAndSerialNumber",void 0),pr=a([O({type:I.Choice})],pr);var ts;class ht{constructor(e={}){this.version=pt.v0,this.sid=new pr,this.digestAlgorithm=new $r,this.signatureAlgorithm=new zi,this.signature=new te,Object.assign(this,e)}}a([l({type:v.Integer})],ht.prototype,"version",void 0),a([l({type:pr})],ht.prototype,"sid",void 0),a([l({type:$r})],ht.prototype,"digestAlgorithm",void 0),a([l({type:nr,repeated:"set",context:0,implicit:!0,optional:!0})],ht.prototype,"signedAttrs",void 0),a([l({type:zi})],ht.prototype,"signatureAlgorithm",void 0),a([l({type:te})],ht.prototype,"signature",void 0),a([l({type:nr,repeated:"set",context:1,implicit:!0,optional:!0})],ht.prototype,"unsignedAttrs",void 0);let Xi=ts=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ts.prototype)}};Xi=ts=a([O({type:I.Set,itemType:ht})],Xi);var rs;let en=rs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,rs.prototype)}};en=rs=a([O({type:I.Set,itemType:$r})],en);class hr{constructor(e={}){this.version=pt.v0,this.digestAlgorithms=new en,this.encapContentInfo=new qi,this.signerInfos=new Xi,Object.assign(this,e)}}a([l({type:v.Integer})],hr.prototype,"version",void 0),a([l({type:en})],hr.prototype,"digestAlgorithms",void 0),a([l({type:qi})],hr.prototype,"encapContentInfo",void 0),a([l({type:Ki,context:0,implicit:!0,optional:!0})],hr.prototype,"certificates",void 0),a([l({type:Kr,context:1,implicit:!0,optional:!0})],hr.prototype,"crls",void 0),a([l({type:Xi})],hr.prototype,"signerInfos",void 0);const zr="1.2.840.10045.2.1",is="1.2.840.10045.4.1",Pc="1.2.840.10045.4.3.1",ns="1.2.840.10045.4.3.2",os="1.2.840.10045.4.3.3",ss="1.2.840.10045.4.3.4",Dc="1.2.840.10045.3.1.7",$c="1.3.132.0.34",Rc="1.3.132.0.35";function Gr(r){return new R({algorithm:r})}const Gd=Gr(is);Gr(Pc);const Wd=Gr(ns),Jd=Gr(os),Yd=Gr(ss);let yr=class{constructor(e={}){Object.assign(this,e)}};a([l({type:v.ObjectIdentifier})],yr.prototype,"namedCurve",void 0),yr=a([O({type:I.Choice})],yr);class tn{constructor(e={}){this.version=1,this.privateKey=new te,Object.assign(this,e)}}a([l({type:v.Integer})],tn.prototype,"version",void 0),a([l({type:te})],tn.prototype,"privateKey",void 0),a([l({type:yr,context:0,optional:!0})],tn.prototype,"parameters",void 0),a([l({type:v.BitString,context:1,optional:!0})],tn.prototype,"publicKey",void 0);class rn{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],rn.prototype,"r",void 0),a([l({type:v.Integer,converter:de})],rn.prototype,"s",void 0);const Ne="1.2.840.113549.1.1",gr=`${Ne}.1`,Zd=`${Ne}.7`,Qd=`${Ne}.9`,Xd=`${Ne}.10`,ef=`${Ne}.2`,tf=`${Ne}.4`,nn=`${Ne}.5`,rf=`${Ne}.14`,as=`${Ne}.11`,on=`${Ne}.12`,sn=`${Ne}.13`,Mc=`${Ne}.15`,Uc=`${Ne}.16`,Lc="1.3.14.3.2.26",Hc="2.16.840.1.101.3.4.2.4",Fc="2.16.840.1.101.3.4.2.1",Kc="2.16.840.1.101.3.4.2.2",qc="2.16.840.1.101.3.4.2.3",nf="2.16.840.1.101.3.4.2.5",of="2.16.840.1.101.3.4.2.6",sf="1.2.840.113549.2.2",af="1.2.840.113549.2.5",cs=`${Ne}.8`;function ye(r){return new R({algorithm:r,parameters:null})}ye(sf),ye(af);const Ut=ye(Lc);ye(Hc),ye(Fc),ye(Kc),ye(qc),ye(nf),ye(of);const zc=new R({algorithm:cs,parameters:U.serialize(Ut)}),Gc=new R({algorithm:Qd,parameters:U.serialize(xi.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ye(gr),ye(ef),ye(tf),ye(nn),ye(Mc),ye(Uc),ye(on),ye(sn),ye(Mc),ye(Uc);class an{constructor(e={}){this.hashAlgorithm=new R(Ut),this.maskGenAlgorithm=new R({algorithm:cs,parameters:U.serialize(Ut)}),this.pSourceAlgorithm=new R(Gc),Object.assign(this,e)}}a([l({type:R,context:0,defaultValue:Ut})],an.prototype,"hashAlgorithm",void 0),a([l({type:R,context:1,defaultValue:zc})],an.prototype,"maskGenAlgorithm",void 0),a([l({type:R,context:2,defaultValue:Gc})],an.prototype,"pSourceAlgorithm",void 0),new R({algorithm:Zd,parameters:U.serialize(new an)});class Wr{constructor(e={}){this.hashAlgorithm=new R(Ut),this.maskGenAlgorithm=new R({algorithm:cs,parameters:U.serialize(Ut)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}a([l({type:R,context:0,defaultValue:Ut})],Wr.prototype,"hashAlgorithm",void 0),a([l({type:R,context:1,defaultValue:zc})],Wr.prototype,"maskGenAlgorithm",void 0),a([l({type:v.Integer,context:2,defaultValue:20})],Wr.prototype,"saltLength",void 0),a([l({type:v.Integer,context:3,defaultValue:1})],Wr.prototype,"trailerField",void 0),new R({algorithm:Xd,parameters:U.serialize(new Wr)});class cn{constructor(e={}){this.digestAlgorithm=new R,this.digest=new te,Object.assign(this,e)}}a([l({type:R})],cn.prototype,"digestAlgorithm",void 0),a([l({type:te})],cn.prototype,"digest",void 0);var ls;class ln{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],ln.prototype,"prime",void 0),a([l({type:v.Integer,converter:de})],ln.prototype,"exponent",void 0),a([l({type:v.Integer,converter:de})],ln.prototype,"coefficient",void 0);let us=ls=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ls.prototype)}};us=ls=a([O({type:I.Sequence,itemType:ln})],us);class Xe{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer})],Xe.prototype,"version",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"modulus",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"publicExponent",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"privateExponent",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"prime1",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"prime2",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"exponent1",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"exponent2",void 0),a([l({type:v.Integer,converter:de})],Xe.prototype,"coefficient",void 0),a([l({type:us,optional:!0})],Xe.prototype,"otherPrimeInfos",void 0);class ds{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.Integer,converter:de})],ds.prototype,"modulus",void 0),a([l({type:v.Integer,converter:de})],ds.prototype,"publicExponent",void 0);var fs;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(fs||(fs={}));const _e=fs;/*! *****************************************************************************
76
76
  Copyright (c) Microsoft Corporation.
77
77
 
78
78
  Permission to use, copy, modify, and/or distribute this software for any
@@ -87,7 +87,7 @@ ${e.join(`
87
87
  PERFORMANCE OF THIS SOFTWARE.
88
88
  ***************************************************************************** */var ps=function(r,e){return ps=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])},ps(r,e)};function hs(r,e){ps(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function cf(r,e,t,n){function o(s){return s instanceof t?s:new t(function(c){c(s)})}return new(t||(t=Promise))(function(s,c){function d(h){try{f(n.next(h))}catch(w){c(w)}}function u(h){try{f(n.throw(h))}catch(w){c(w)}}function f(h){h.done?s(h.value):o(h.value).then(d,u)}f((n=n.apply(r,e||[])).next())})}function lf(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(f){return function(h){return u([f,h])}}function u(f){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,o&&(s=f[0]&2?o.return:f[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,f[1])).done)return s;switch(o=0,s&&(f=[f[0]&2,s.value]),f[0]){case 0:case 1:s=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,o=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){t.label=f[1];break}if(f[0]===6&&t.label<s[1]){t.label=s[1],s=f;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(f);break}s[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(h){f=[6,h],o=0}finally{n=s=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function un(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dn(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(d){c={error:d}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(c)throw c.error}}return s}function Lt(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(dn(arguments[e]));return r}var uf="injectionTokens";function df(r){var e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(uf,r)||{};return Object.keys(t).forEach(function(n){e[+n]=t[n]}),e}function Wc(r){return!!r.useClass}function ys(r){return!!r.useFactory}var Jc=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,n={},o=!1,s,c=function(){return o||(s=e(t.wrap()),o=!0),s};return new Proxy(n,this.createHandler(c))},r.prototype.createHandler=function(e){var t={},n=function(o){t[o]=function(){for(var s=[],c=0;c<arguments.length;c++)s[c]=arguments[c];s[0]=e();var d=Reflect[o];return d.apply(void 0,Lt(s))}};return this.reflectMethods.forEach(n),t},r}();function mr(r){return typeof r=="string"||typeof r=="symbol"}function ff(r){return typeof r=="object"&&"token"in r&&"multiple"in r}function Yc(r){return typeof r=="object"&&"token"in r&&"transform"in r}function pf(r){return typeof r=="function"||r instanceof Jc}function fn(r){return!!r.useToken}function pn(r){return r.useValue!=null}function hf(r){return Wc(r)||pn(r)||fn(r)||ys(r)}var gs=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}(),yf=function(r){hs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(gs),Zc=function(){function r(){this.scopedResolutions=new Map}return r}();function gf(r,e){if(r===null)return"at position #"+e;var t=r.split(",")[e].trim();return'"'+t+'" at position #'+e}function mf(r,e,t){return t===void 0&&(t=" "),Lt([r],e.message.split(`
89
89
  `).map(function(n){return t+n})).join(`
90
- `)}function bf(r,e,t){var n=dn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[1],s=o===void 0?null:o,c=gf(s,e);return mf("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function vf(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var wf=function(r){hs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(gs),kf=function(r){hs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(gs),Sf=function(){function r(){this.preResolution=new wf,this.postResolution=new kf}return r}(),Qc=new Map,Cf=function(){function r(e){this.parent=e,this._registry=new yf,this.interceptors=new Sf,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,n){n===void 0&&(n={lifecycle:_e.Transient}),this.ensureNotDisposed();var o;if(hf(t)?o=t:o={useClass:t},fn(o))for(var s=[e],c=o;c!=null;){var d=c.useToken;if(s.includes(d))throw new Error("Token registration cycle detected! "+Lt(s,[d]).join(" -> "));s.push(d);var u=this._registry.get(d);u&&fn(u.provider)?c=u.provider:c=null}if((n.lifecycle===_e.Singleton||n.lifecycle==_e.ContainerScoped||n.lifecycle==_e.ResolutionScoped)&&(pn(o)||ys(o)))throw new Error('Cannot use lifecycle "'+_e[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:o,options:n}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),mr(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(),mr(e)){if(mr(t))return this.register(e,{useToken:t},{lifecycle:_e.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:_e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return t&&!mr(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:_e.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new Zc),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&mr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),n){var o=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,o,"Single"),o}if(pf(e)){var o=this.construct(e,t);return this.executePostResolutionInterceptor(e,o,"Single"),o}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 n,o;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=un(this.interceptors.preResolution.getAll(e)),d=c.next();!d.done;d=c.next()){var u=d.value;u.options.frequency!="Once"&&s.push(u),u.callback(e,t)}}catch(f){n={error:f}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,n){var o,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var d=un(this.interceptors.postResolution.getAll(e)),u=d.next();!u.done;u=d.next()){var f=u.value;f.options.frequency!="Once"&&c.push(f),f.callback(e,t,n)}}catch(h){o={error:h}}finally{try{u&&!u.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var n=e.options.lifecycle===_e.Singleton,o=e.options.lifecycle===_e.ContainerScoped,s=n||o,c;return pn(e.provider)?c=e.provider.useValue:fn(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Wc(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):ys(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var n=this;t===void 0&&(t=new Zc),this.ensureNotDisposed();var o=this.getAllRegistrations(e);if(!o&&mr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),o){var s=o.map(function(d){return n.resolveRegistration(d,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},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 n=un(this._registry.entries()),o=n.next();!o.done;o=n.next()){var s=dn(o.value,2),c=s[0],d=s[1];this._registry.setAll(c,d.filter(function(u){return!pn(u.provider)}).map(function(u){return u.instance=void 0,u}))}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var n=new r(this);try{for(var o=un(this._registry.entries()),s=o.next();!s.done;s=o.next()){var c=dn(s.value,2),d=c[0],u=c[1];u.some(function(f){var h=f.options;return h.lifecycle===_e.ContainerScoped})&&n._registry.setAll(d,u.map(function(f){return f.options.lifecycle===_e.ContainerScoped?{provider:f.provider,options:f.options}:f}))}}catch(f){e={error:f}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return n},r.prototype.beforeResolution=function(e,t,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:n})},r.prototype.afterResolution=function(e,t,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:n})},r.prototype.dispose=function(){return cf(this,void 0,void 0,function(){var e;return lf(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(n){var o=n.dispose();o&&e.push(o)}),[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 n=this;if(e instanceof Jc)return e.createProxy(function(s){return n.resolve(s,t)});var o=function(){var s=Qc.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(n.resolveParams(t,e));return new(e.bind.apply(e,Lt([void 0],c)))}();return vf(o)&&this.disposables.add(o),o},r.prototype.resolveParams=function(e,t){var n=this;return function(o,s){var c,d,u;try{return ff(o)?Yc(o)?o.multiple?(c=n.resolve(o.transform)).transform.apply(c,Lt([n.resolveAll(o.token)],o.transformArgs)):(d=n.resolve(o.transform)).transform.apply(d,Lt([n.resolve(o.token,e)],o.transformArgs)):o.multiple?n.resolveAll(o.token):n.resolve(o.token,e):Yc(o)?(u=n.resolve(o.transform,e)).transform.apply(u,Lt([n.resolve(o.token,e)],o.transformArgs)):n.resolve(o,e)}catch(f){throw new Error(bf(t,s,f))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),He=new Cf;function ms(){return function(r){Qc.set(r,df(r))}}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 bs;class hn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:v.ObjectIdentifier})],hn.prototype,"attrId",void 0),a([l({type:v.Any,repeated:"set"})],hn.prototype,"attrValues",void 0);let Xc=bs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,bs.prototype)}};Xc=bs=a([O({type:E.Sequence,itemType:hn})],Xc);var vs;let el=vs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};el=vs=a([O({type:E.Sequence,itemType:cr})],el);class tl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],tl.prototype,"certId",void 0),a([l({type:v.Any,context:0})],tl.prototype,"certValue",void 0);class rl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],rl.prototype,"crlId",void 0),a([l({type:v.Any,context:0})],rl.prototype,"crltValue",void 0);class il extends te{}let yn=class{constructor(e={}){this.encryptionAlgorithm=new R,this.encryptedData=new il,Object.assign(this,e)}};a([l({type:R})],yn.prototype,"encryptionAlgorithm",void 0),a([l({type:il})],yn.prototype,"encryptedData",void 0);var ws,ks;(function(r){r[r.v1=0]="v1"})(ks||(ks={}));class nl extends te{}let Ss=ws=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};Ss=ws=a([O({type:E.Sequence,itemType:ut})],Ss);class Jr{constructor(e={}){this.version=ks.v1,this.privateKeyAlgorithm=new R,this.privateKey=new nl,Object.assign(this,e)}}a([l({type:v.Integer})],Jr.prototype,"version",void 0),a([l({type:R})],Jr.prototype,"privateKeyAlgorithm",void 0),a([l({type:nl})],Jr.prototype,"privateKey",void 0),a([l({type:Ss,implicit:!0,context:0,optional:!0})],Jr.prototype,"attributes",void 0);let ol=class extends Jr{};ol=a([O({type:E.Sequence})],ol);let sl=class extends yn{};sl=a([O({type:E.Sequence})],sl);class al{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],al.prototype,"secretTypeId",void 0),a([l({type:v.Any,context:0})],al.prototype,"secretValue",void 0);class Yr{constructor(e={}){this.mac=new cn,this.macSalt=new te,this.iterations=1,Object.assign(this,e)}}a([l({type:cn})],Yr.prototype,"mac",void 0),a([l({type:te})],Yr.prototype,"macSalt",void 0),a([l({type:v.Integer,defaultValue:1})],Yr.prototype,"iterations",void 0);class gn{constructor(e={}){this.version=3,this.authSafe=new cr,this.macData=new Yr,Object.assign(this,e)}}a([l({type:v.Integer})],gn.prototype,"version",void 0),a([l({type:cr})],gn.prototype,"authSafe",void 0),a([l({type:Yr,optional:!0})],gn.prototype,"macData",void 0);var Cs;class mn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],mn.prototype,"bagId",void 0),a([l({type:v.Any,context:0})],mn.prototype,"bagValue",void 0),a([l({type:hn,repeated:"set",optional:!0})],mn.prototype,"bagAttributes",void 0);let cl=Cs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};cl=Cs=a([O({type:E.Sequence,itemType:mn})],cl);var xs,As,Bs;const ll="1.2.840.113549.1.9",ul=`${ll}.7`,Is=`${ll}.14`;let bn=class extends be{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:v.IA5String})],bn.prototype,"ia5String",void 0),bn=a([O({type:E.Choice})],bn);let dl=class extends cr{};dl=a([O({type:E.Sequence})],dl);let fl=class extends gn{};fl=a([O({type:E.Sequence})],fl);let pl=class extends yn{};pl=a([O({type:E.Sequence})],pl);let Es=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.IA5String})],Es.prototype,"value",void 0),Es=a([O({type:E.Choice})],Es);let hl=class extends bn{};hl=a([O({type:E.Choice})],hl);let yl=class extends be{};yl=a([O({type:E.Choice})],yl);let Ns=class{constructor(e=new Date){this.value=e}};a([l({type:v.GeneralizedTime})],Ns.prototype,"value",void 0),Ns=a([O({type:E.Choice})],Ns);let gl=class extends be{};gl=a([O({type:E.Choice})],gl);let _s=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:v.PrintableString})],_s.prototype,"value",void 0),_s=a([O({type:E.Choice})],_s);let vn=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.PrintableString})],vn.prototype,"value",void 0),vn=a([O({type:E.Choice})],vn);let ml=class extends vn{};ml=a([O({type:E.Choice})],ml);let bl=class extends be{};bl=a([O({type:E.Choice})],bl);let Os=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.ObjectIdentifier})],Os.prototype,"value",void 0),Os=a([O({type:E.Choice})],Os);let vl=class extends Se{};vl=a([O({type:E.Choice})],vl);let Ts=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:v.Integer})],Ts.prototype,"value",void 0),Ts=a([O({type:E.Choice})],Ts);let wl=class extends ht{};wl=a([O({type:E.Sequence})],wl);let wn=class extends be{};wn=a([O({type:E.Choice})],wn);let kl=xs=class extends Dt{constructor(e){super(e),Object.setPrototypeOf(this,xs.prototype)}};kl=xs=a([O({type:E.Sequence})],kl);let Sl=As=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};Sl=As=a([O({type:E.Set,itemType:nr})],Sl);let Vs=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.BmpString})],Vs.prototype,"value",void 0),Vs=a([O({type:E.Choice})],Vs);let js=class extends R{};js=a([O({type:E.Sequence})],js);let Cl=Bs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};Cl=Bs=a([O({type:E.Sequence,itemType:js})],Cl);var Ps;let kn=Ps=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ps.prototype)}};kn=Ps=a([O({type:E.Sequence,itemType:ut})],kn);class br{constructor(e={}){this.version=0,this.subject=new he,this.subjectPKInfo=new dt,this.attributes=new kn,Object.assign(this,e)}}a([l({type:v.Integer})],br.prototype,"version",void 0),a([l({type:he})],br.prototype,"subject",void 0),a([l({type:dt})],br.prototype,"subjectPKInfo",void 0),a([l({type:kn,implicit:!0,context:0})],br.prototype,"attributes",void 0);class Zr{constructor(e={}){this.certificationRequestInfo=new br,this.signatureAlgorithm=new R,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:br})],Zr.prototype,"certificationRequestInfo",void 0),a([l({type:R})],Zr.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],Zr.prototype,"signature",void 0);/*!
90
+ `)}function bf(r,e,t){var n=dn(r.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=n[1],s=o===void 0?null:o,c=gf(s,e);return mf("Cannot inject the dependency "+c+' of "'+r.name+'" constructor. Reason:',t)}function vf(r){if(typeof r.dispose!="function")return!1;var e=r.dispose;return!(e.length>0)}var wf=function(r){hs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(gs),kf=function(r){hs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(gs),Sf=function(){function r(){this.preResolution=new wf,this.postResolution=new kf}return r}(),Qc=new Map,Cf=function(){function r(e){this.parent=e,this._registry=new yf,this.interceptors=new Sf,this.disposed=!1,this.disposables=new Set}return r.prototype.register=function(e,t,n){n===void 0&&(n={lifecycle:_e.Transient}),this.ensureNotDisposed();var o;if(hf(t)?o=t:o={useClass:t},fn(o))for(var s=[e],c=o;c!=null;){var d=c.useToken;if(s.includes(d))throw new Error("Token registration cycle detected! "+Lt(s,[d]).join(" -> "));s.push(d);var u=this._registry.get(d);u&&fn(u.provider)?c=u.provider:c=null}if((n.lifecycle===_e.Singleton||n.lifecycle==_e.ContainerScoped||n.lifecycle==_e.ResolutionScoped)&&(pn(o)||ys(o)))throw new Error('Cannot use lifecycle "'+_e[n.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:o,options:n}),this},r.prototype.registerType=function(e,t){return this.ensureNotDisposed(),mr(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(),mr(e)){if(mr(t))return this.register(e,{useToken:t},{lifecycle:_e.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:_e.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var n=e;return t&&!mr(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:_e.Singleton})},r.prototype.resolve=function(e,t){t===void 0&&(t=new Zc),this.ensureNotDisposed();var n=this.getRegistration(e);if(!n&&mr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"Single"),n){var o=this.resolveRegistration(n,t);return this.executePostResolutionInterceptor(e,o,"Single"),o}if(pf(e)){var o=this.construct(e,t);return this.executePostResolutionInterceptor(e,o,"Single"),o}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 n,o;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var c=un(this.interceptors.preResolution.getAll(e)),d=c.next();!d.done;d=c.next()){var u=d.value;u.options.frequency!="Once"&&s.push(u),u.callback(e,t)}}catch(f){n={error:f}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}this.interceptors.preResolution.setAll(e,s)}},r.prototype.executePostResolutionInterceptor=function(e,t,n){var o,s;if(this.interceptors.postResolution.has(e)){var c=[];try{for(var d=un(this.interceptors.postResolution.getAll(e)),u=d.next();!u.done;u=d.next()){var f=u.value;f.options.frequency!="Once"&&c.push(f),f.callback(e,t,n)}}catch(h){o={error:h}}finally{try{u&&!u.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(e,c)}},r.prototype.resolveRegistration=function(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);var n=e.options.lifecycle===_e.Singleton,o=e.options.lifecycle===_e.ContainerScoped,s=n||o,c;return pn(e.provider)?c=e.provider.useValue:fn(e.provider)?c=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Wc(e.provider)?c=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):ys(e.provider)?c=e.provider.useFactory(this):c=this.construct(e.provider,t),e.options.lifecycle===_e.ResolutionScoped&&t.scopedResolutions.set(e,c),c},r.prototype.resolveAll=function(e,t){var n=this;t===void 0&&(t=new Zc),this.ensureNotDisposed();var o=this.getAllRegistrations(e);if(!o&&mr(e))throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"');if(this.executePreResolutionInterceptor(e,"All"),o){var s=o.map(function(d){return n.resolveRegistration(d,t)});return this.executePostResolutionInterceptor(e,s,"All"),s}var c=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,c,"All"),c},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 n=un(this._registry.entries()),o=n.next();!o.done;o=n.next()){var s=dn(o.value,2),c=s[0],d=s[1];this._registry.setAll(c,d.filter(function(u){return!pn(u.provider)}).map(function(u){return u.instance=void 0,u}))}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},r.prototype.createChildContainer=function(){var e,t;this.ensureNotDisposed();var n=new r(this);try{for(var o=un(this._registry.entries()),s=o.next();!s.done;s=o.next()){var c=dn(s.value,2),d=c[0],u=c[1];u.some(function(f){var h=f.options;return h.lifecycle===_e.ContainerScoped})&&n._registry.setAll(d,u.map(function(f){return f.options.lifecycle===_e.ContainerScoped?{provider:f.provider,options:f.options}:f}))}}catch(f){e={error:f}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return n},r.prototype.beforeResolution=function(e,t,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:t,options:n})},r.prototype.afterResolution=function(e,t,n){n===void 0&&(n={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:t,options:n})},r.prototype.dispose=function(){return cf(this,void 0,void 0,function(){var e;return lf(this,function(t){switch(t.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(n){var o=n.dispose();o&&e.push(o)}),[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 n=this;if(e instanceof Jc)return e.createProxy(function(s){return n.resolve(s,t)});var o=function(){var s=Qc.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var c=s.map(n.resolveParams(t,e));return new(e.bind.apply(e,Lt([void 0],c)))}();return vf(o)&&this.disposables.add(o),o},r.prototype.resolveParams=function(e,t){var n=this;return function(o,s){var c,d,u;try{return ff(o)?Yc(o)?o.multiple?(c=n.resolve(o.transform)).transform.apply(c,Lt([n.resolveAll(o.token)],o.transformArgs)):(d=n.resolve(o.transform)).transform.apply(d,Lt([n.resolve(o.token,e)],o.transformArgs)):o.multiple?n.resolveAll(o.token):n.resolve(o.token,e):Yc(o)?(u=n.resolve(o.transform,e)).transform.apply(u,Lt([n.resolve(o.token,e)],o.transformArgs)):n.resolve(o,e)}catch(f){throw new Error(bf(t,s,f))}}},r.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},r}(),He=new Cf;function ms(){return function(r){Qc.set(r,df(r))}}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 bs;class hn{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}a([l({type:v.ObjectIdentifier})],hn.prototype,"attrId",void 0),a([l({type:v.Any,repeated:"set"})],hn.prototype,"attrValues",void 0);let Xc=bs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,bs.prototype)}};Xc=bs=a([O({type:I.Sequence,itemType:hn})],Xc);var vs;let el=vs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,vs.prototype)}};el=vs=a([O({type:I.Sequence,itemType:cr})],el);class tl{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],tl.prototype,"certId",void 0),a([l({type:v.Any,context:0})],tl.prototype,"certValue",void 0);class rl{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],rl.prototype,"crlId",void 0),a([l({type:v.Any,context:0})],rl.prototype,"crltValue",void 0);class il extends te{}let yn=class{constructor(e={}){this.encryptionAlgorithm=new R,this.encryptedData=new il,Object.assign(this,e)}};a([l({type:R})],yn.prototype,"encryptionAlgorithm",void 0),a([l({type:il})],yn.prototype,"encryptedData",void 0);var ws,ks;(function(r){r[r.v1=0]="v1"})(ks||(ks={}));class nl extends te{}let Ss=ws=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,ws.prototype)}};Ss=ws=a([O({type:I.Sequence,itemType:ut})],Ss);class Jr{constructor(e={}){this.version=ks.v1,this.privateKeyAlgorithm=new R,this.privateKey=new nl,Object.assign(this,e)}}a([l({type:v.Integer})],Jr.prototype,"version",void 0),a([l({type:R})],Jr.prototype,"privateKeyAlgorithm",void 0),a([l({type:nl})],Jr.prototype,"privateKey",void 0),a([l({type:Ss,implicit:!0,context:0,optional:!0})],Jr.prototype,"attributes",void 0);let ol=class extends Jr{};ol=a([O({type:I.Sequence})],ol);let sl=class extends yn{};sl=a([O({type:I.Sequence})],sl);class al{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],al.prototype,"secretTypeId",void 0),a([l({type:v.Any,context:0})],al.prototype,"secretValue",void 0);class Yr{constructor(e={}){this.mac=new cn,this.macSalt=new te,this.iterations=1,Object.assign(this,e)}}a([l({type:cn})],Yr.prototype,"mac",void 0),a([l({type:te})],Yr.prototype,"macSalt",void 0),a([l({type:v.Integer,defaultValue:1})],Yr.prototype,"iterations",void 0);class gn{constructor(e={}){this.version=3,this.authSafe=new cr,this.macData=new Yr,Object.assign(this,e)}}a([l({type:v.Integer})],gn.prototype,"version",void 0),a([l({type:cr})],gn.prototype,"authSafe",void 0),a([l({type:Yr,optional:!0})],gn.prototype,"macData",void 0);var Cs;class mn{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:v.ObjectIdentifier})],mn.prototype,"bagId",void 0),a([l({type:v.Any,context:0})],mn.prototype,"bagValue",void 0),a([l({type:hn,repeated:"set",optional:!0})],mn.prototype,"bagAttributes",void 0);let cl=Cs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Cs.prototype)}};cl=Cs=a([O({type:I.Sequence,itemType:mn})],cl);var xs,As,Bs;const ll="1.2.840.113549.1.9",ul=`${ll}.7`,Is=`${ll}.14`;let bn=class extends be{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};a([l({type:v.IA5String})],bn.prototype,"ia5String",void 0),bn=a([O({type:I.Choice})],bn);let dl=class extends cr{};dl=a([O({type:I.Sequence})],dl);let fl=class extends gn{};fl=a([O({type:I.Sequence})],fl);let pl=class extends yn{};pl=a([O({type:I.Sequence})],pl);let Es=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.IA5String})],Es.prototype,"value",void 0),Es=a([O({type:I.Choice})],Es);let hl=class extends bn{};hl=a([O({type:I.Choice})],hl);let yl=class extends be{};yl=a([O({type:I.Choice})],yl);let Ns=class{constructor(e=new Date){this.value=e}};a([l({type:v.GeneralizedTime})],Ns.prototype,"value",void 0),Ns=a([O({type:I.Choice})],Ns);let gl=class extends be{};gl=a([O({type:I.Choice})],gl);let _s=class{constructor(e="M"){this.value=e}toString(){return this.value}};a([l({type:v.PrintableString})],_s.prototype,"value",void 0),_s=a([O({type:I.Choice})],_s);let vn=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.PrintableString})],vn.prototype,"value",void 0),vn=a([O({type:I.Choice})],vn);let ml=class extends vn{};ml=a([O({type:I.Choice})],ml);let bl=class extends be{};bl=a([O({type:I.Choice})],bl);let Os=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.ObjectIdentifier})],Os.prototype,"value",void 0),Os=a([O({type:I.Choice})],Os);let vl=class extends Se{};vl=a([O({type:I.Choice})],vl);let Vs=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};a([l({type:v.Integer})],Vs.prototype,"value",void 0),Vs=a([O({type:I.Choice})],Vs);let wl=class extends ht{};wl=a([O({type:I.Sequence})],wl);let wn=class extends be{};wn=a([O({type:I.Choice})],wn);let kl=xs=class extends Dt{constructor(e){super(e),Object.setPrototypeOf(this,xs.prototype)}};kl=xs=a([O({type:I.Sequence})],kl);let Sl=As=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,As.prototype)}};Sl=As=a([O({type:I.Set,itemType:nr})],Sl);let Ts=class{constructor(e=""){this.value=e}toString(){return this.value}};a([l({type:v.BmpString})],Ts.prototype,"value",void 0),Ts=a([O({type:I.Choice})],Ts);let js=class extends R{};js=a([O({type:I.Sequence})],js);let Cl=Bs=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Bs.prototype)}};Cl=Bs=a([O({type:I.Sequence,itemType:js})],Cl);var Ps;let kn=Ps=class extends oe{constructor(e){super(e),Object.setPrototypeOf(this,Ps.prototype)}};kn=Ps=a([O({type:I.Sequence,itemType:ut})],kn);class br{constructor(e={}){this.version=0,this.subject=new he,this.subjectPKInfo=new dt,this.attributes=new kn,Object.assign(this,e)}}a([l({type:v.Integer})],br.prototype,"version",void 0),a([l({type:he})],br.prototype,"subject",void 0),a([l({type:dt})],br.prototype,"subjectPKInfo",void 0),a([l({type:kn,implicit:!0,context:0})],br.prototype,"attributes",void 0);class Zr{constructor(e={}){this.certificationRequestInfo=new br,this.signatureAlgorithm=new R,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}a([l({type:br})],Zr.prototype,"certificationRequestInfo",void 0),a([l({type:R})],Zr.prototype,"signatureAlgorithm",void 0),a([l({type:v.BitString})],Zr.prototype,"signature",void 0);/*!
91
91
  * MIT License
92
92
  *
93
93
  * Copyright (c) Peculiar Ventures. All rights reserved.
@@ -110,8 +110,8 @@ ${e.join(`
110
110
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
111
111
  * SOFTWARE.
112
112
  *
113
- */const Sn="crypto.algorithm";class xf{getAlgorithms(){return He.resolveAll(Sn)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const n=t.toAsnAlgorithm(e);if(n)return n}if(/^[0-9.]+$/.test(e.name)){const t=new R({algorithm:e.name});if("parameters"in e){const n=e;t.parameters=n.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const n of this.getAlgorithms()){const o=n.toWebAlgorithm(e);if(o)return o}return{name:e.algorithm,parameters:e.parameters}}}const Cn="crypto.algorithmProvider";He.registerSingleton(Cn,xf);var xn;const Oe="1.3.36.3.3.2.8.1.1",xl=`${Oe}.1`,Al=`${Oe}.2`,Bl=`${Oe}.3`,Il=`${Oe}.4`,El=`${Oe}.5`,Nl=`${Oe}.6`,_l=`${Oe}.7`,Ol=`${Oe}.8`,Tl=`${Oe}.9`,Vl=`${Oe}.10`,jl=`${Oe}.11`,Pl=`${Oe}.12`,Dl=`${Oe}.13`,$l=`${Oe}.14`,Rl="brainpoolP160r1",Ml="brainpoolP160t1",Ul="brainpoolP192r1",Ll="brainpoolP192t1",Hl="brainpoolP224r1",Fl="brainpoolP224t1",Kl="brainpoolP256r1",ql="brainpoolP256t1",zl="brainpoolP320r1",Gl="brainpoolP320t1",Wl="brainpoolP384r1",Jl="brainpoolP384t1",Yl="brainpoolP512r1",Zl="brainpoolP512t1",pe="ECDSA";let Qr=xn=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case pe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Gd;case"sha-256":return Wd;case"sha-384":return Jd;case"sha-512":return Yd}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=Dc;break;case"K-256":t=xn.SECP256K1;break;case"P-384":t=$c;break;case"P-521":t=Rc;break;case Rl:t=xl;break;case Ml:t=Al;break;case Ul:t=Bl;break;case Ll:t=Il;break;case Hl:t=El;break;case Fl:t=Nl;break;case Kl:t=_l;break;case ql:t=Ol;break;case zl:t=Tl;break;case Gl:t=Vl;break;case Wl:t=jl;break;case Jl:t=Pl;break;case Yl:t=Dl;break;case Zl:t=$l;break}if(t)return new R({algorithm:zr,parameters:U.serialize(new yr({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case is:return{name:pe,hash:{name:"SHA-1"}};case ns:return{name:pe,hash:{name:"SHA-256"}};case os:return{name:pe,hash:{name:"SHA-384"}};case ss:return{name:pe,hash:{name:"SHA-512"}};case zr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(U.parse(e.parameters,yr).namedCurve){case Dc:return{name:pe,namedCurve:"P-256"};case xn.SECP256K1:return{name:pe,namedCurve:"K-256"};case $c:return{name:pe,namedCurve:"P-384"};case Rc:return{name:pe,namedCurve:"P-521"};case xl:return{name:pe,namedCurve:Rl};case Al:return{name:pe,namedCurve:Ml};case Bl:return{name:pe,namedCurve:Ul};case Il:return{name:pe,namedCurve:Ll};case El:return{name:pe,namedCurve:Hl};case Nl:return{name:pe,namedCurve:Fl};case _l:return{name:pe,namedCurve:Kl};case Ol:return{name:pe,namedCurve:ql};case Tl:return{name:pe,namedCurve:zl};case Vl:return{name:pe,namedCurve:Gl};case jl:return{name:pe,namedCurve:Wl};case Pl:return{name:pe,namedCurve:Jl};case Dl:return{name:pe,namedCurve:Yl};case $l:return{name:pe,namedCurve:Zl}}}}return null}};Qr.SECP256K1="1.3.132.0.10",Qr=xn=a([ms()],Qr),He.registerSingleton(Sn,Qr);const Ql=Symbol("name"),Xl=Symbol("value");class se{constructor(e,t={},n=""){this[Ql]=e,this[Xl]=n;for(const o in t)this[o]=t[o]}}se.NAME=Ql,se.VALUE=Xl;class Af{static toTextObject(e){const t=new se("Algorithm Identifier",{},kt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case zr:{const n=new Qr().toWebAlgorithm(e);n&&"namedCurve"in n?t["Named Curve"]=n.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class kt{static toString(e){const t=this.items[e];return t||e}}kt.items={[Lc]:"sha1",[Hc]:"sha224",[Fc]:"sha256",[Kc]:"sha384",[qc]:"sha512",[gr]:"rsaEncryption",[nn]:"sha1WithRSAEncryption",[rf]:"sha224WithRSAEncryption",[as]:"sha256WithRSAEncryption",[on]:"sha384WithRSAEncryption",[sn]:"sha512WithRSAEncryption",[zr]:"ecPublicKey",[is]:"ecdsaWithSHA1",[Pc]:"ecdsaWithSHA224",[ns]:"ecdsaWithSHA256",[os]:"ecdsaWithSHA384",[ss]:"ecdsaWithSHA512",[Ud]:"TLS WWW server authentication",[Ld]:"TLS WWW client authentication",[Hd]:"Code Signing",[Fd]:"E-mail Protection",[Kd]:"Time Stamping",[qd]:"OCSP Signing",[zd]:"Signed Data"};class Ht{static serialize(e){return this.serializeObj(e).join(`
114
- `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const n=[];let o=this.pad(t++),s="";const c=e[se.VALUE];c&&(s=` ${c}`),n.push(`${o}${e[se.NAME]}:${s}`),o=this.pad(t);for(const d in e){if(typeof d=="symbol")continue;const u=e[d],f=d?`${d}: `:"";if(typeof u=="string"||typeof u=="number"||typeof u=="boolean")n.push(`${o}${f}${u}`);else if(u instanceof Date)n.push(`${o}${f}${u.toUTCString()}`);else if(Array.isArray(u))for(const h of u)h[se.NAME]=d,n.push(...this.serializeObj(h,t));else if(u instanceof se)u[se.NAME]=d,n.push(...this.serializeObj(u,t));else if(P.isBufferSource(u))d?(n.push(`${o}${f}`),n.push(...this.serializeBufferSource(u,t+1))):n.push(...this.serializeBufferSource(u,t));else if("toTextObject"in u){const h=u.toTextObject();h[se.NAME]=d,n.push(...this.serializeObj(h,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(e,t=0){const n=this.pad(t),o=P.toUint8Array(e),s=[];for(let c=0;c<o.length;){const d=[];for(let u=0;u<16&&c<o.length;u++){u===8&&d.push("");const f=o[c++].toString(16).padStart(2,"0");d.push(f)}s.push(`${n}${d.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Ht.oidSerializer=kt,Ht.algorithmSerializer=Af;class St{constructor(...e){if(e.length===1){const t=e[0];this.rawData=U.serialize(t),this.onInit(t)}else{const t=U.parse(e[0],e[1]);this.rawData=P.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof St?ia(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return U.toString(this.rawData);case"text":return Ht.serialize(this.toTextObject());case"hex":return $.ToHex(this.rawData);case"base64":return $.ToBase64(this.rawData);case"base64url":return $.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new se(this.getTextName(),{},e)}}St.NAME="ASN";class et extends St{constructor(...e){let t;P.isBufferSource(e[0])?t=P.toArrayBuffer(e[0]):t=U.serialize(new Ge({extnID:e[0],critical:e[1],extnValue:new te(P.toArrayBuffer(e[2]))})),super(t,Ge)}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[se.NAME]===et.NAME&&(e[se.NAME]=kt.toString(this.type)),e}}var eu;class Ft{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[eu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(Ft.DEFAULT,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=Ft.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(Ft.DEFAULT,e);return this}}eu=Symbol.toStringTag,Ft.DEFAULT="default";const De=new Ft,Bf=/^[0-2](?:\.[1-9][0-9]*)+$/;function If(r){return new RegExp(Bf).test(r)}class tu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return If(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Te=new tu;Te.register("CN","2.5.4.3"),Te.register("L","2.5.4.7"),Te.register("ST","2.5.4.8"),Te.register("O","2.5.4.10"),Te.register("OU","2.5.4.11"),Te.register("C","2.5.4.6"),Te.register("DC","0.9.2342.19200300.100.1.25"),Te.register("E","1.2.840.113549.1.9.1"),Te.register("G","2.5.4.42"),Te.register("I","2.5.4.43"),Te.register("SN","2.5.4.4"),Te.register("T","2.5.4.12");function Ef(r,e){return`\\${$.ToHex($.FromUtf8String(e)).toUpperCase()}`}function Nf(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Ef)}class Ct{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}constructor(e,t={}){this.extraNames=new tu,this.asn=new he;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const o=t[n];this.extraNames.register(n,o)}typeof e=="string"?this.asn=this.fromString(e):e instanceof he?this.asn=e:P.isBufferSource(e)?this.asn=U.parse(e,he):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Te.findId(e),n=[];for(const o of this.asn)for(const s of o)s.type===t&&n.push(s.value.toString());return n}getName(e){return this.extraNames.get(e)||Te.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const n=this.getName(t.type)||t.type,o=t.value.anyValue?`#${$.ToHex(t.value.anyValue)}`:Nf(t.value.toString());return`${n}=${o}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const n of this.asn){const o={};for(const s of n){const c=this.getName(s.type)||s.type;(e=o[c])!==null&&e!==void 0||(o[c]=[]),o[c].push(s.value.anyValue?`#${$.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(o)}return t}fromString(e){const t=new he,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=n.exec(`${e},`);){let[,c,d]=o;const u=d[d.length-1];(u===","||u==="+")&&(d=d.slice(0,d.length-1),o[3]=u);const f=o[3];if(/[\d.]+/.test(c)||(c=this.getName(c)||""),!c)throw new Error(`Cannot get OID for name type '${c}'`);const h=new _r({type:c});if(d.charAt(0)==="#")h.value.anyValue=$.FromHex(d.slice(1));else{const w=/"(.*?[^\\])?"/.exec(d);w&&(d=w[1]),d=d.replace(/\\0a/ig,`
115
- `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),c===this.getName("E")||c===this.getName("DC")?h.value.ia5String=d:Ct.isASCII(d)?h.value.printableString=d:h.value.utf8String=d}s==="+"?t[t.length-1].push(h):t.push(new Xt([h])),s=f}return t}fromJSON(e){const t=new he;for(const n of e){const o=new Xt;for(const s in n){let c=s;if(/[\d.]+/.test(s)||(c=this.getName(s)||""),!c)throw new Error(`Cannot get OID for name type '${s}'`);const d=n[s];for(const u of d){const f=new _r({type:c});if(typeof u=="object")for(const h in u)switch(h){case"ia5String":f.value.ia5String=u[h];break;case"utf8String":f.value.utf8String=u[h];break;case"universalString":f.value.universalString=u[h];break;case"bmpString":f.value.bmpString=u[h];break;case"printableString":f.value.printableString=u[h];break}else u[0]==="#"?f.value.anyValue=$.FromHex(u.slice(1)):c===this.getName("E")||c===this.getName("DC")?f.value.ia5String=u:f.value.printableString=u;o.push(f)}}t.push(o)}return t}toArrayBuffer(){return U.serialize(this.asn)}async getThumbprint(...e){var t;let n,o="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(o=e[0]||o,n=e[1]||De.get()):n=e[0]||De.get(),await n.subtle.digest(o,this.toArrayBuffer())}}const ru="Cannot initialize GeneralName from ASN.1 data.",iu=`${ru} Unsupported string format in use.`,_f=`${ru} Value doesn't match to GUID regular expression.`,nu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,ou="1.3.6.1.4.1.311.25.1",su="1.3.6.1.4.1.311.20.2.3",Ds="dns",$s="dn",Rs="email",Ms="ip",Us="url",Ls="guid",Hs="upn",An="id";class au extends St{constructor(...e){let t;if(e.length===2)switch(e[0]){case $s:{const n=new Ct(e[1]).toArrayBuffer(),o=U.parse(n,he);t=new Y({directoryName:o});break}case Ds:t=new Y({dNSName:e[1]});break;case Rs:t=new Y({rfc822Name:e[1]});break;case Ls:{const n=new RegExp(nu,"i").exec(e[1]);if(!n)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=n.slice(1).map((s,c)=>c<3?$.ToHex(new Uint8Array($.FromHex(s)).reverse()):s).join("");t=new Y({otherName:new Or({typeId:ou,value:U.serialize(new te($.FromHex(o)))})});break}case Ms:t=new Y({iPAddress:e[1]});break;case An:t=new Y({registeredID:e[1]});break;case Hs:{t=new Y({otherName:new Or({typeId:su,value:U.serialize(oc.toASN(e[1]))})});break}case Us:t=new Y({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else P.isBufferSource(e[0])?t=U.parse(e[0],Y):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=Ds,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Rs,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=Ms,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=Us,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=An,this.value=e.registeredID;else if(e.directoryName!=null)this.type=$s,this.value=new Ct(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===ou){this.type=Ls;const t=U.parse(e.otherName.value,te),n=new RegExp(nu,"i").exec($.ToHex(t));if(!n)throw new Error(_f);this.value=n.slice(1).map((o,s)=>s<3?$.ToHex(new Uint8Array($.FromHex(o)).reverse()):o).join("-")}else if(e.otherName.typeId===su)this.type=Hs,this.value=U.parse(e.otherName.value,be).toString();else throw new Error(iu);else throw new Error(iu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case $s:case Ds:case Ls:case Ms:case An:case Hs:case Us:e=this.type.toUpperCase();break;case Rs:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===An&&(t=kt.toString(t)),new se(e,void 0,t)}}class Xr extends St{constructor(e){let t;if(e instanceof Ae)t=e;else if(Array.isArray(e)){const n=[];for(const o of e)if(o instanceof Y)n.push(o);else{const s=U.parse(new au(o.type,o.value).rawData,Y);n.push(s)}t=new Ae(n)}else if(P.isBufferSource(e))t=U.parse(e,Ae);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const n of e){let o=null;try{o=new au(n)}catch{continue}t.push(o)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const n=t.toTextObject();let o=e[n[se.NAME]];Array.isArray(o)||(o=[],e[n[se.NAME]]=o),o.push(n)}return e}}Xr.NAME="GeneralNames";const ei="-{5}",ti="\\n",Of=`[^${ti}]+`,Tf=`${ei}BEGIN (${Of}(?=${ei}))${ei}`,Vf=`${ei}END \\1${ei}`,vr="\\n",jf=`[^:${ti}]+`,Pf=`(?:[^${ti}]+${vr}(?: +[^${ti}]+${vr})*)`,Df=`(?:[a-zA-Z0-9=+/]+${vr})+`,cu=`${Tf}${vr}(?:((?:${jf}: ${Pf})+))?${vr}?(${Df})${Vf}`;class $e{static isPem(e){return typeof e=="string"&&new RegExp(cu,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(cu,"g"),n=[];let o=null;for(;o=t.exec(e);){const s=o[3].replace(new RegExp(`[${ti}]+`,"g"),""),c={type:o[1],headers:[],rawData:$.FromBase64(s)},d=o[2];if(d){const u=d.split(new RegExp(vr,"g"));let f=null;for(const h of u){const[w,T]=h.split(/:(.*)/);if(T===void 0){if(!f)throw new Error("Cannot parse PEM string. Incorrect header value");f.value+=w.trim()}else f&&c.headers.push(f),f={key:w,value:T.trim()}}f&&c.headers.push(f)}n.push(c)}return n}static decode(e){return this.decodeWithHeaders(e).map(n=>n.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 n=new Array;return t?e.forEach(o=>{if(!P.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");n.push(this.encodeStruct({type:t,rawData:P.toArrayBuffer(o)}))}):e.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");n.push(this.encodeStruct(o))}),n.join(`
113
+ */const Sn="crypto.algorithm";class xf{getAlgorithms(){return He.resolveAll(Sn)}toAsnAlgorithm(e){({...e});for(const t of this.getAlgorithms()){const n=t.toAsnAlgorithm(e);if(n)return n}if(/^[0-9.]+$/.test(e.name)){const t=new R({algorithm:e.name});if("parameters"in e){const n=e;t.parameters=n.parameters}return t}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const n of this.getAlgorithms()){const o=n.toWebAlgorithm(e);if(o)return o}return{name:e.algorithm,parameters:e.parameters}}}const Cn="crypto.algorithmProvider";He.registerSingleton(Cn,xf);var xn;const Oe="1.3.36.3.3.2.8.1.1",xl=`${Oe}.1`,Al=`${Oe}.2`,Bl=`${Oe}.3`,Il=`${Oe}.4`,El=`${Oe}.5`,Nl=`${Oe}.6`,_l=`${Oe}.7`,Ol=`${Oe}.8`,Vl=`${Oe}.9`,Tl=`${Oe}.10`,jl=`${Oe}.11`,Pl=`${Oe}.12`,Dl=`${Oe}.13`,$l=`${Oe}.14`,Rl="brainpoolP160r1",Ml="brainpoolP160t1",Ul="brainpoolP192r1",Ll="brainpoolP192t1",Hl="brainpoolP224r1",Fl="brainpoolP224t1",Kl="brainpoolP256r1",ql="brainpoolP256t1",zl="brainpoolP320r1",Gl="brainpoolP320t1",Wl="brainpoolP384r1",Jl="brainpoolP384t1",Yl="brainpoolP512r1",Zl="brainpoolP512t1",pe="ECDSA";let Qr=xn=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case pe.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Gd;case"sha-256":return Wd;case"sha-384":return Jd;case"sha-512":return Yd}else if("namedCurve"in e){let t="";switch(e.namedCurve){case"P-256":t=Dc;break;case"K-256":t=xn.SECP256K1;break;case"P-384":t=$c;break;case"P-521":t=Rc;break;case Rl:t=xl;break;case Ml:t=Al;break;case Ul:t=Bl;break;case Ll:t=Il;break;case Hl:t=El;break;case Fl:t=Nl;break;case Kl:t=_l;break;case ql:t=Ol;break;case zl:t=Vl;break;case Gl:t=Tl;break;case Wl:t=jl;break;case Jl:t=Pl;break;case Yl:t=Dl;break;case Zl:t=$l;break}if(t)return new R({algorithm:zr,parameters:U.serialize(new yr({namedCurve:t}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case is:return{name:pe,hash:{name:"SHA-1"}};case ns:return{name:pe,hash:{name:"SHA-256"}};case os:return{name:pe,hash:{name:"SHA-384"}};case ss:return{name:pe,hash:{name:"SHA-512"}};case zr:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(U.parse(e.parameters,yr).namedCurve){case Dc:return{name:pe,namedCurve:"P-256"};case xn.SECP256K1:return{name:pe,namedCurve:"K-256"};case $c:return{name:pe,namedCurve:"P-384"};case Rc:return{name:pe,namedCurve:"P-521"};case xl:return{name:pe,namedCurve:Rl};case Al:return{name:pe,namedCurve:Ml};case Bl:return{name:pe,namedCurve:Ul};case Il:return{name:pe,namedCurve:Ll};case El:return{name:pe,namedCurve:Hl};case Nl:return{name:pe,namedCurve:Fl};case _l:return{name:pe,namedCurve:Kl};case Ol:return{name:pe,namedCurve:ql};case Vl:return{name:pe,namedCurve:zl};case Tl:return{name:pe,namedCurve:Gl};case jl:return{name:pe,namedCurve:Wl};case Pl:return{name:pe,namedCurve:Jl};case Dl:return{name:pe,namedCurve:Yl};case $l:return{name:pe,namedCurve:Zl}}}}return null}};Qr.SECP256K1="1.3.132.0.10",Qr=xn=a([ms()],Qr),He.registerSingleton(Sn,Qr);const Ql=Symbol("name"),Xl=Symbol("value");class se{constructor(e,t={},n=""){this[Ql]=e,this[Xl]=n;for(const o in t)this[o]=t[o]}}se.NAME=Ql,se.VALUE=Xl;class Af{static toTextObject(e){const t=new se("Algorithm Identifier",{},kt.toString(e.algorithm));if(e.parameters)switch(e.algorithm){case zr:{const n=new Qr().toWebAlgorithm(e);n&&"namedCurve"in n?t["Named Curve"]=n.namedCurve:t.Parameters=e.parameters;break}default:t.Parameters=e.parameters}return t}}class kt{static toString(e){const t=this.items[e];return t||e}}kt.items={[Lc]:"sha1",[Hc]:"sha224",[Fc]:"sha256",[Kc]:"sha384",[qc]:"sha512",[gr]:"rsaEncryption",[nn]:"sha1WithRSAEncryption",[rf]:"sha224WithRSAEncryption",[as]:"sha256WithRSAEncryption",[on]:"sha384WithRSAEncryption",[sn]:"sha512WithRSAEncryption",[zr]:"ecPublicKey",[is]:"ecdsaWithSHA1",[Pc]:"ecdsaWithSHA224",[ns]:"ecdsaWithSHA256",[os]:"ecdsaWithSHA384",[ss]:"ecdsaWithSHA512",[Ud]:"TLS WWW server authentication",[Ld]:"TLS WWW client authentication",[Hd]:"Code Signing",[Fd]:"E-mail Protection",[Kd]:"Time Stamping",[qd]:"OCSP Signing",[zd]:"Signed Data"};class Ht{static serialize(e){return this.serializeObj(e).join(`
114
+ `)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,t=0){const n=[];let o=this.pad(t++),s="";const c=e[se.VALUE];c&&(s=` ${c}`),n.push(`${o}${e[se.NAME]}:${s}`),o=this.pad(t);for(const d in e){if(typeof d=="symbol")continue;const u=e[d],f=d?`${d}: `:"";if(typeof u=="string"||typeof u=="number"||typeof u=="boolean")n.push(`${o}${f}${u}`);else if(u instanceof Date)n.push(`${o}${f}${u.toUTCString()}`);else if(Array.isArray(u))for(const h of u)h[se.NAME]=d,n.push(...this.serializeObj(h,t));else if(u instanceof se)u[se.NAME]=d,n.push(...this.serializeObj(u,t));else if(P.isBufferSource(u))d?(n.push(`${o}${f}`),n.push(...this.serializeBufferSource(u,t+1))):n.push(...this.serializeBufferSource(u,t));else if("toTextObject"in u){const h=u.toTextObject();h[se.NAME]=d,n.push(...this.serializeObj(h,t))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return n}static serializeBufferSource(e,t=0){const n=this.pad(t),o=P.toUint8Array(e),s=[];for(let c=0;c<o.length;){const d=[];for(let u=0;u<16&&c<o.length;u++){u===8&&d.push("");const f=o[c++].toString(16).padStart(2,"0");d.push(f)}s.push(`${n}${d.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Ht.oidSerializer=kt,Ht.algorithmSerializer=Af;class St{constructor(...e){if(e.length===1){const t=e[0];this.rawData=U.serialize(t),this.onInit(t)}else{const t=U.parse(e[0],e[1]);this.rawData=P.toArrayBuffer(e[0]),this.onInit(t)}}equal(e){return e instanceof St?ia(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return U.toString(this.rawData);case"text":return Ht.serialize(this.toTextObject());case"hex":return $.ToHex(this.rawData);case"base64":return $.ToBase64(this.rawData);case"base64url":return $.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new se(this.getTextName(),{},e)}}St.NAME="ASN";class et extends St{constructor(...e){let t;P.isBufferSource(e[0])?t=P.toArrayBuffer(e[0]):t=U.serialize(new Ge({extnID:e[0],critical:e[1],extnValue:new te(P.toArrayBuffer(e[2]))})),super(t,Ge)}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[se.NAME]===et.NAME&&(e[se.NAME]=kt.toString(this.type)),e}}var eu;class Ft{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[eu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(Ft.DEFAULT,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=Ft.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(Ft.DEFAULT,e);return this}}eu=Symbol.toStringTag,Ft.DEFAULT="default";const De=new Ft,Bf=/^[0-2](?:\.[1-9][0-9]*)+$/;function If(r){return new RegExp(Bf).test(r)}class tu{constructor(e={}){this.items={};for(const t in e)this.register(t,e[t])}get(e){return this.items[e]||null}findId(e){return If(e)?e:this.get(e)}register(e,t){this.items[e]=t,this.items[t]=e}}const Ve=new tu;Ve.register("CN","2.5.4.3"),Ve.register("L","2.5.4.7"),Ve.register("ST","2.5.4.8"),Ve.register("O","2.5.4.10"),Ve.register("OU","2.5.4.11"),Ve.register("C","2.5.4.6"),Ve.register("DC","0.9.2342.19200300.100.1.25"),Ve.register("E","1.2.840.113549.1.9.1"),Ve.register("G","2.5.4.42"),Ve.register("I","2.5.4.43"),Ve.register("SN","2.5.4.4"),Ve.register("T","2.5.4.12");function Ef(r,e){return`\\${$.ToHex($.FromUtf8String(e)).toUpperCase()}`}function Nf(r){return r.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Ef)}class Ct{static isASCII(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>255)return!1;return!0}constructor(e,t={}){this.extraNames=new tu,this.asn=new he;for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const o=t[n];this.extraNames.register(n,o)}typeof e=="string"?this.asn=this.fromString(e):e instanceof he?this.asn=e:P.isBufferSource(e)?this.asn=U.parse(e,he):this.asn=this.fromJSON(e)}getField(e){const t=this.extraNames.findId(e)||Ve.findId(e),n=[];for(const o of this.asn)for(const s of o)s.type===t&&n.push(s.value.toString());return n}getName(e){return this.extraNames.get(e)||Ve.get(e)}toString(){return this.asn.map(e=>e.map(t=>{const n=this.getName(t.type)||t.type,o=t.value.anyValue?`#${$.ToHex(t.value.anyValue)}`:Nf(t.value.toString());return`${n}=${o}`}).join("+")).join(", ")}toJSON(){var e;const t=[];for(const n of this.asn){const o={};for(const s of n){const c=this.getName(s.type)||s.type;(e=o[c])!==null&&e!==void 0||(o[c]=[]),o[c].push(s.value.anyValue?`#${$.ToHex(s.value.anyValue)}`:s.value.toString())}t.push(o)}return t}fromString(e){const t=new he,n=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=n.exec(`${e},`);){let[,c,d]=o;const u=d[d.length-1];(u===","||u==="+")&&(d=d.slice(0,d.length-1),o[3]=u);const f=o[3];if(/[\d.]+/.test(c)||(c=this.getName(c)||""),!c)throw new Error(`Cannot get OID for name type '${c}'`);const h=new _r({type:c});if(d.charAt(0)==="#")h.value.anyValue=$.FromHex(d.slice(1));else{const w=/"(.*?[^\\])?"/.exec(d);w&&(d=w[1]),d=d.replace(/\\0a/ig,`
115
+ `).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),c===this.getName("E")||c===this.getName("DC")?h.value.ia5String=d:Ct.isASCII(d)?h.value.printableString=d:h.value.utf8String=d}s==="+"?t[t.length-1].push(h):t.push(new Xt([h])),s=f}return t}fromJSON(e){const t=new he;for(const n of e){const o=new Xt;for(const s in n){let c=s;if(/[\d.]+/.test(s)||(c=this.getName(s)||""),!c)throw new Error(`Cannot get OID for name type '${s}'`);const d=n[s];for(const u of d){const f=new _r({type:c});if(typeof u=="object")for(const h in u)switch(h){case"ia5String":f.value.ia5String=u[h];break;case"utf8String":f.value.utf8String=u[h];break;case"universalString":f.value.universalString=u[h];break;case"bmpString":f.value.bmpString=u[h];break;case"printableString":f.value.printableString=u[h];break}else u[0]==="#"?f.value.anyValue=$.FromHex(u.slice(1)):c===this.getName("E")||c===this.getName("DC")?f.value.ia5String=u:f.value.printableString=u;o.push(f)}}t.push(o)}return t}toArrayBuffer(){return U.serialize(this.asn)}async getThumbprint(...e){var t;let n,o="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(o=e[0]||o,n=e[1]||De.get()):n=e[0]||De.get(),await n.subtle.digest(o,this.toArrayBuffer())}}const ru="Cannot initialize GeneralName from ASN.1 data.",iu=`${ru} Unsupported string format in use.`,_f=`${ru} Value doesn't match to GUID regular expression.`,nu=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,ou="1.3.6.1.4.1.311.25.1",su="1.3.6.1.4.1.311.20.2.3",Ds="dns",$s="dn",Rs="email",Ms="ip",Us="url",Ls="guid",Hs="upn",An="id";class au extends St{constructor(...e){let t;if(e.length===2)switch(e[0]){case $s:{const n=new Ct(e[1]).toArrayBuffer(),o=U.parse(n,he);t=new Y({directoryName:o});break}case Ds:t=new Y({dNSName:e[1]});break;case Rs:t=new Y({rfc822Name:e[1]});break;case Ls:{const n=new RegExp(nu,"i").exec(e[1]);if(!n)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=n.slice(1).map((s,c)=>c<3?$.ToHex(new Uint8Array($.FromHex(s)).reverse()):s).join("");t=new Y({otherName:new Or({typeId:ou,value:U.serialize(new te($.FromHex(o)))})});break}case Ms:t=new Y({iPAddress:e[1]});break;case An:t=new Y({registeredID:e[1]});break;case Hs:{t=new Y({otherName:new Or({typeId:su,value:U.serialize(oc.toASN(e[1]))})});break}case Us:t=new Y({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else P.isBufferSource(e[0])?t=U.parse(e[0],Y):t=e[0];super(t)}onInit(e){if(e.dNSName!=null)this.type=Ds,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=Rs,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=Ms,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=Us,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=An,this.value=e.registeredID;else if(e.directoryName!=null)this.type=$s,this.value=new Ct(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===ou){this.type=Ls;const t=U.parse(e.otherName.value,te),n=new RegExp(nu,"i").exec($.ToHex(t));if(!n)throw new Error(_f);this.value=n.slice(1).map((o,s)=>s<3?$.ToHex(new Uint8Array($.FromHex(o)).reverse()):o).join("-")}else if(e.otherName.typeId===su)this.type=Hs,this.value=U.parse(e.otherName.value,be).toString();else throw new Error(iu);else throw new Error(iu)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case $s:case Ds:case Ls:case Ms:case An:case Hs:case Us:e=this.type.toUpperCase();break;case Rs:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let t=this.value;return this.type===An&&(t=kt.toString(t)),new se(e,void 0,t)}}class Xr extends St{constructor(e){let t;if(e instanceof Ae)t=e;else if(Array.isArray(e)){const n=[];for(const o of e)if(o instanceof Y)n.push(o);else{const s=U.parse(new au(o.type,o.value).rawData,Y);n.push(s)}t=new Ae(n)}else if(P.isBufferSource(e))t=U.parse(e,Ae);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(t)}onInit(e){const t=[];for(const n of e){let o=null;try{o=new au(n)}catch{continue}t.push(o)}this.items=t}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const t of this.items){const n=t.toTextObject();let o=e[n[se.NAME]];Array.isArray(o)||(o=[],e[n[se.NAME]]=o),o.push(n)}return e}}Xr.NAME="GeneralNames";const ei="-{5}",ti="\\n",Of=`[^${ti}]+`,Vf=`${ei}BEGIN (${Of}(?=${ei}))${ei}`,Tf=`${ei}END \\1${ei}`,vr="\\n",jf=`[^:${ti}]+`,Pf=`(?:[^${ti}]+${vr}(?: +[^${ti}]+${vr})*)`,Df=`(?:[a-zA-Z0-9=+/]+${vr})+`,cu=`${Vf}${vr}(?:((?:${jf}: ${Pf})+))?${vr}?(${Df})${Tf}`;class $e{static isPem(e){return typeof e=="string"&&new RegExp(cu,"g").test(e)}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const t=new RegExp(cu,"g"),n=[];let o=null;for(;o=t.exec(e);){const s=o[3].replace(new RegExp(`[${ti}]+`,"g"),""),c={type:o[1],headers:[],rawData:$.FromBase64(s)},d=o[2];if(d){const u=d.split(new RegExp(vr,"g"));let f=null;for(const h of u){const[w,V]=h.split(/:(.*)/);if(V===void 0){if(!f)throw new Error("Cannot parse PEM string. Incorrect header value");f.value+=w.trim()}else f&&c.headers.push(f),f={key:w,value:V.trim()}}f&&c.headers.push(f)}n.push(c)}return n}static decode(e){return this.decodeWithHeaders(e).map(n=>n.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 n=new Array;return t?e.forEach(o=>{if(!P.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");n.push(this.encodeStruct({type:t,rawData:P.toArrayBuffer(o)}))}):e.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");n.push(this.encodeStruct(o))}),n.join(`
116
116
  `)}else{if(!t)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:t,rawData:P.toArrayBuffer(e)})}}static encodeStruct(e){var t;const n=e.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${n}-----`),!((t=e.headers)===null||t===void 0)&&t.length){for(const f of e.headers)o.push(`${f.key}: ${f.value}`);o.push("")}const s=$.ToBase64(e.rawData);let c,d=0;const u=Array();for(;d<s.length&&(s.length-d<64?c=s.substring(d):(c=s.substring(d,d+64),d+=64),c.length!==0);)if(u.push(c),c.length<64)break;return o.push(...u),o.push(`-----END ${n}-----`),o.join(`
117
- `)}}$e.CertificateTag="CERTIFICATE",$e.CrlTag="CRL",$e.CertificateRequestTag="CERTIFICATE REQUEST",$e.PublicKeyTag="PUBLIC KEY",$e.PrivateKeyTag="PRIVATE KEY";class yt extends St{static isAsnEncoded(e){return P.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if($e.isPem(e))return $e.decode(e)[0];if($.isHex(e))return $.FromHex(e);if($.isBase64(e))return $.FromBase64(e);if($.isBase64Url(e))return $.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=$.ToBinary(e);return $e.isPem(t)?$e.decode(t)[0]:$.isHex(t)?$.FromHex(t):$.isBase64(t)?$.FromBase64(t):$.isBase64Url(t)?$.FromBase64Url(t):P.toArrayBuffer(e)}}constructor(...e){yt.isAsnEncoded(e[0])?super(yt.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return $e.encode(this.rawData,this.tag);default:return super.toString(e)}}}class Kt extends yt{constructor(e){yt.isAsnEncoded(e)?super(e,dt):super(e),this.tag=$e.PublicKeyTag}async export(...e){let t,n=["verify"],o={hash:"SHA-256",...this.algorithm};return e.length>1?(o=e[0]||o,n=e[1]||n,t=e[2]||De.get()):t=e[0]||De.get(),t.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(e){const t=He.resolve(Cn),n=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case gr:{const o=U.parse(e.subjectPublicKey,ds),s=P.toUint8Array(o.modulus);n.publicExponent=P.toUint8Array(o.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let n,o="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(o=e[0]||o,n=e[1]||De.get()):n=e[0]||De.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(e){e||(e=De.get());const t=U.parse(this.rawData,dt);return await e.subtle.digest("SHA-1",t.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=U.parse(this.rawData,dt);switch(e.Algorithm=Ht.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case zr:e["EC Point"]=t.subjectPublicKey;break;case gr:default:e["Raw Data"]=t.subjectPublicKey}return e}}class tt{static register(e,t){this.items.set(e,t)}static create(e){const t=new et(e),n=this.items.get(t.type);return n?new n(e):t}}tt.items=new Map;const Bn="crypto.signatureFormatter";class $f{toAsnSignature(e,t){return P.toArrayBuffer(t)}toWebSignature(e,t){return P.toArrayBuffer(t)}}class In extends yt{constructor(e){yt.isAsnEncoded(e)?super(e,ir):super(e),this.tag=$e.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=U.serialize(t),this.serialNumber=$.ToHex(t.serialNumber),this.subjectName=new Ct(t.subject),this.subject=new Ct(t.subject).toString(),this.issuerName=new Ct(t.issuer),this.issuer=this.issuerName.toString();const n=He.resolve(Cn);this.signatureAlgorithm=n.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const o=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>tt.create(U.serialize(c)))),this.publicKey=new Kt(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=De.get()){let n,o;const s=e.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(n,["verify"],t);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(n,["verify"],t);else if(s instanceof Kt)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],t);else if(P.isBufferSource(s)){const f=new Kt(s);n={...f.algorithm,...this.signatureAlgorithm},o=await f.export(n,["verify"],t)}else n={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const c=He.resolveAll(Bn).reverse();let d=null;for(const f of c)if(d=f.toWebSignature(n,this.signature),d)break;if(!d)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const u=await t.subtle.verify(this.signatureAlgorithm,o,d,this.tbs);if(e.signatureOnly)return u;{const h=(e.date||new Date).getTime();return u&&this.notBefore.getTime()<h&&h<this.notAfter.getTime()}}async getThumbprint(...e){let t,n="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(n=e[0]||n,t=e[1])),t??(t=De.get()),await t.subtle.digest(n,this.rawData)}async isSelfSigned(e=De.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=U.parse(this.rawData,ir),n=t.tbsCertificate,o=new se("",{Version:`${rr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":Ht.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new se("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(o["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(o["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){const s=new se("");for(const c of this.extensions){const d=c.toTextObject();s[d[se.NAME]]=d}o.Extensions=s}return e.Data=o,e.Signature=new se("",{Algorithm:Ht.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}In.NAME="Certificate";class ri extends et{static async create(e,t=!1,n=De.get()){if(e instanceof In||Ft.isCryptoKey(e)){const o=e instanceof In?await e.publicKey.export(n):e,s=await n.subtle.exportKey("spki",o),d=await new Kt(s).getKeyIdentifier(n);return new ri($.ToHex(d),t)}else return new ri(e,t)}constructor(...e){if(P.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Pt({keyIdentifier:new oo($.FromHex(e[0]))});super(no,e[1],U.serialize(t))}else{const t=e[0],n=t.name instanceof Xr?U.parse(t.name.rawData,Ae):t.name,o=new Pt({authorityCertIssuer:n,authorityCertSerialNumber:$.FromHex(t.serialNumber)});super(no,e[1],U.serialize(o))}}onInit(e){super.onInit(e);const t=U.parse(e.extnValue,Pt);t.keyIdentifier&&(this.keyId=$.ToHex(t.keyIdentifier)),t.authorityCertIssuer&&t.authorityCertSerialNumber&&(this.certId={name:t.authorityCertIssuer,serialNumber:$.ToHex(t.authorityCertSerialNumber)})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=U.parse(this.value,Pt);return t.authorityCertIssuer&&(e["Authority Issuer"]=new Xr(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}ri.NAME="Authority Key Identifier";class lu extends et{constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,Bi);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Bi({cA:e[0],pathLenConstraint:e[1]});super(fc,e[2],U.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}}lu.NAME="Basic Constraints";var uu;(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"})(uu||(uu={}));class du extends et{constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,Oi);this.usages=t.map(n=>n)}else{const t=new Oi(e[0]);super(bc,e[1],U.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>kt.toString(t)).join(", "),e}}du.NAME="Extended Key Usages";var Fs;(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"})(Fs||(Fs={}));class Ks extends et{constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,ko);this.usages=t.toNumber()}else{const t=new ko(e[0]);super(wc,e[1],U.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=U.parse(this.value,ko);return e[""]=t.toJSON().join(", "),e}}Ks.NAME="Key Usages";class En extends et{static async create(e,t=!1,n=De.get()){let o;e instanceof Kt?o=e.rawData:"publicKey"in e?o=e.publicKey.rawData:P.isBufferSource(e)?o=e:o=await n.subtle.exportKey("spki",e);const c=await new Kt(o).getKeyIdentifier(n);return new En($.ToHex(c),t)}constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,vt);this.keyId=$.ToHex(t)}else{const t=typeof e[0]=="string"?$.FromHex(e[0]):e[0],n=new vt(t);super(Bc,e[1],U.serialize(n)),this.keyId=$.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=U.parse(this.value,vt);return e[""]=t,e}}En.NAME="Subject Key Identifier";class qs extends et{constructor(...e){P.isBufferSource(e[0])?super(e[0]):super(xc,e[1],new Xr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=U.parse(e.extnValue,Bo);this.names=new Xr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const n in t)e[n]=t[n];return e}}qs.NAME="Subject Alternative Name";class fu extends et{constructor(...e){var t;if(P.isBufferSource(e[0])){super(e[0]);const n=U.parse(this.value,Ni);this.policies=n.map(o=>o.policyIdentifier)}else{const n=e[0],o=(t=e[1])!==null&&t!==void 0?t:!1,s=new Ni(n.map(c=>new Ei({policyIdentifier:c})));super(hc,o,U.serialize(s)),this.policies=n}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new se("",{},kt.toString(t))),e}}fu.NAME="Certificate Policies",tt.register(hc,fu);class wr extends St{constructor(...e){let t;if(P.isBufferSource(e[0]))t=P.toArrayBuffer(e[0]);else{const n=e[0],o=Array.isArray(e[1])?e[1].map(s=>P.toArrayBuffer(s)):[];t=U.serialize(new ut({type:n,values:o}))}super(t,ut)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new se("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[se.NAME]===wr.NAME&&(e[se.NAME]=kt.toString(this.type)),e}}wr.NAME="Attribute";class pu extends wr{constructor(...e){var t;if(P.isBufferSource(e[0]))super(e[0]);else{const n=new wn({printableString:e[0]});super(ul,[U.serialize(n)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=U.parse(this.values[0],wn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[se.VALUE]=this.password,e}}pu.NAME="Challenge Password";class zs extends wr{constructor(...e){var t;if(P.isBufferSource(e[0]))super(e[0]);else{const n=e[0],o=new Dt;for(const s of n)o.push(U.parse(s.rawData,Ge));super(Is,[U.serialize(o)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=U.parse(this.values[0],Dt);this.items=t.map(n=>tt.create(U.serialize(n)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(n=>n.toTextObject());for(const n of t)e[n[se.NAME]]=n;return e}}zs.NAME="Extensions";class Nn{static register(e,t){this.items.set(e,t)}static create(e){const t=new wr(e),n=this.items.get(t.type);return n?new n(e):t}}Nn.items=new Map;let Gs=class{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 R({algorithm:nn,parameters:null});case"sha-256":return new R({algorithm:as,parameters:null});case"sha-384":return new R({algorithm:on,parameters:null});case"sha-512":return new R({algorithm:sn,parameters:null})}}else return new R({algorithm:gr,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case gr:return{name:"RSASSA-PKCS1-v1_5"};case nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case as:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case on:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Gs=a([ms()],Gs),He.registerSingleton(Sn,Gs);class Fe{addPadding(e,t){const n=P.toUint8Array(t),o=new Uint8Array(e);return o.set(n,e-n.length),o}removePadding(e,t=!1){let n=P.toUint8Array(e);for(let o=0;o<n.length;o++)if(n[o]){n=n.slice(o);break}if(t&&n[0]>127){const o=new Uint8Array(n.length+1);return o.set(n,1),o.buffer}return n.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const n=e.namedCurve,o=Fe.namedCurveSize.get(n)||Fe.defaultNamedCurveSize,s=new rn,c=P.toUint8Array(t);return s.r=this.removePadding(c.slice(0,o),!0),s.s=this.removePadding(c.slice(o,o+o),!0),U.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const n=U.parse(t,rn),o=e.namedCurve,s=Fe.namedCurveSize.get(o)||Fe.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(n.r)),d=this.addPadding(s,this.removePadding(n.s));return Qu(c,d)}return null}}Fe.namedCurveSize=new Map,Fe.defaultNamedCurveSize=32;const hu="1.3.101.110",yu="1.3.101.111",gu="1.3.101.112",mu="1.3.101.113";let Ws=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=gu;break;case"ed448":t=mu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=hu;break;case"x448":t=yu;break}}return t?new R({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case gu:return{name:"EdDSA",namedCurve:"Ed25519"};case mu:return{name:"EdDSA",namedCurve:"Ed448"};case hu:return{name:"ECDH-ES",namedCurve:"X25519"};case yu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ws=a([ms()],Ws),He.registerSingleton(Sn,Ws);class Rf extends yt{constructor(e){yt.isAsnEncoded(e)?super(e,Zr):super(e),this.tag=$e.CertificateRequestTag}onInit(e){this.tbs=U.serialize(e.certificationRequestInfo),this.publicKey=new Kt(e.certificationRequestInfo.subjectPKInfo);const t=He.resolve(Cn);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(o=>Nn.create(U.serialize(o)));const n=this.getAttribute(Is);this.extensions=[],n instanceof zs&&(this.extensions=n.items),this.subjectName=new Ct(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=De.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(t,["verify"],e),o=He.resolveAll(Bn).reverse();let s=null;for(const d of o)if(s=d.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,n,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),t=U.parse(this.rawData,Zr),n=t.certificationRequestInfo,o=new se("",{Version:`${rr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new se("");for(const c of this.attributes){const d=c.toTextObject();s[d[se.NAME]]=d}o.Attributes=s}return e.Data=o,e.Signature=new se("",{Algorithm:Ht.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}Rf.NAME="PKCS#10 Certificate Request";var bu;(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"})(bu||(bu={})),tt.register(fc,lu),tt.register(bc,du),tt.register(wc,Ks),tt.register(Bc,En),tt.register(no,ri),tt.register(xc,qs),Nn.register(ul,pu),Nn.register(Is,zs),He.registerSingleton(Bn,$f),He.registerSingleton(Bn,Fe),Fe.namedCurveSize.set("P-256",32),Fe.namedCurveSize.set("K-256",32),Fe.namedCurveSize.set("P-384",48),Fe.namedCurveSize.set("P-521",66);function vu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new In(e),n={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const o of t.extensions)if(o instanceof qs){const s=o.names.toJSON(),d=Object.entries(s).map(u=>({type:u[1].type,value:u[1].value})).reduce((u,f)=>{const h=f.type,w=u[h]??[];return{...u,[h]:[...w,f.value]}},{});for(const u in d)n.subjectAltName=`${u}=${d[u].join(", ")}`}else if(o instanceof Ks){const s=Object.values(Fs),c=Array(s.length/2).fill(null).reduce((d,u,f)=>{const h=s[s.length/2+f];if(o.usages&h){const w=s[f];d.push(w)}return d},[]);n.keyUsage=c}return n}}}function Mf(){const r=vu(),e=i.ref({}),t=o=>{if(!(o.id in e.value))try{e.value[o.id]=r.parseMetaCertificateData(o.cert)}catch{e.value[o.id]=void 0}return e.value[o.id]};return{certificateDataCache:e,getCertificateData:o=>{const s=t(o);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 Uf={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."}},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"},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."}},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 Lf(){const r=Wt.createI18n("en-us",Uf);return{i18n:r,i18nT:Wt.i18nTComponent(r)}}const rt={useCertificate:Mf,useI18n:Lf,useX509:vu},ii={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}},Hf={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ff="Copy to clipboard",Kf={message:Hf,iconTitle:Ff},qf="kong-ui-copy-uuid-notify",zf={class:"kong-ui-copy-uuid"},Gf=["title"],Wf=["onClick"],wu=15,Jf=i.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:r=>["uuid","hidden","redacted","deleted"].includes(r)}},emits:["success","error"],setup(r,{emit:e}){const t=r,{t:n}=Wt.createI18n("en-us",Kf),o=t.notify||i.inject(qf,()=>{}),s=i.computed(()=>!!(t.tooltip&&t.successTooltip)),c=i.ref(t.tooltip),d=i.computed(()=>t.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),u=i.computed(()=>t.format==="redacted"?"*****":t.format==="deleted"?`*${t.uuid.substring(0,5)}`:t.uuid),f=w=>{c.value=w,setTimeout(()=>{c.value=t.tooltip},1800)},h=w=>{if(!w(t.uuid)){typeof o=="function"&&o({type:"error",message:n("message.fail")}),s.value?f(n("message.fail")):e("error",t.uuid);return}const T=t.uuid.length>wu,C=t.format==="hidden"||t.format==="redacted"?n("message.success.prefix"):`"${t.uuid.substring(0,wu)+(T?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${C}${n("message.success.content")}`}),s.value?f(t.successTooltip):e("success",t.uuid)};return(w,T)=>{const C=i.resolveComponent("KIcon"),p=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",zf,[r.format!=="hidden"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":"copy-id",title:r.uuid},[i.createElementVNode("div",{class:i.normalizeClass(["uuid-container",r.truncated?"truncated-uuid":null,r.useMono?"mono":null])},i.toDisplayString(u.value),3)],8,Gf)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.tooltip?"KTooltip":"div"),i.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:i.withCtx(()=>[i.createVNode(p,null,{default:i.withCtx(({copyToClipboard:m})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(y=>h(m),["stop"])},[i.createVNode(C,{class:"uuid-icon",color:r.iconColor,"hide-title":!!r.tooltip||void 0,icon:"copy",size:"16",title:i.unref(n)("iconTitle")},null,8,["color","hide-title","title"])],8,Wf)]),_:1})]),_:1},16))])}}}),Yf=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Zf=Yf(Jf,[["__scopeId","data-v-e4ea1359"]]);var Js=(r=>(r.GatewayService="service",r.Route="route",r.Consumer="consumer",r.ConsumerGroup="consumer group",r.Plugin="plugin",r.Upstream="upstream",r.Certificate="certificate",r.CACertificate="ca certificate",r.SNI="SNI",r.Key="key",r.KeySet="key set",r.Vault="vault",r.Application="application",r.Developer="developer",r.acls="ACL Credential",r["basic-auth"]="Basic Auth Credential",r["key-auth"]="Key Auth Credential",r["key-auth-enc"]="Key Auth Encrypted Credential",r.oauth2="OAuth 2.0 Credential",r["hmac-auth"]="HMAC Credential",r.jwt="JWT Credential",r.Target="target",r.Policy="policy",r))(Js||{}),qt=(r=>(r.Edit="edit",r.Create="create",r))(qt||{}),xt=(r=>(r[r.Loading=0]="Loading",r[r.Idle=1]="Idle",r[r.NoResults=2]="NoResults",r[r.Error=3]="Error",r))(xt||{}),re=(r=>(r.ID="id",r.IdArray="id-array",r.Text="plain-text",r.Date="date",r.Redacted="redacted",r.RedactedArray="redacted-array",r.Json="json",r.JsonArray="json-array",r.BadgeTag="badge-tag",r.BadgeStatus="badge-status",r.BadgeMethod="badge-method",r.LinkInternal="link-internal",r.LinkExternal="link-external",r))(re||{}),ae=(r=>(r.Basic="basic",r.Advanced="advanced",r.Plugin="plugin",r))(ae||{});function Ys(r={}){return{axiosInstance:zu.create({withCredentials:!0,timeout:3e4,...r})}}function Qf(){return{debounce:(r,e)=>{let t;return(...n)=>{clearTimeout(t),t=window==null?void 0:window.setTimeout(()=>{r(...n)},e)}}}}const Zs="khcp-user-table-preferences",Xf={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ep(){const r=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},e=()=>{const t=r(localStorage.getItem(Zs));return!t||!Object.keys(t).length?new Map:new Map(Object.entries(t))};return{setTablePreferences:(t,n)=>{try{const o=e();o.set(t,n),localStorage.setItem(Zs,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:t=>{const n=e();return(n==null?void 0:n.get(t))||void 0||Xf},deleteAllTablePreferences:()=>{localStorage.removeItem(Zs)}}}const tp={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},rp={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},ip={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},np={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}"}},op={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},sp={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ap={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},cp={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},lp={deleteModal:tp,baseForm:rp,baseTable:ip,baseConfigCard:np,filter:op,debouncedFilter:sp,errors:ap,toggleModal:cp};function Qs(){const r=Wt.createI18n("en-us",lp);return{i18n:r,i18nT:Wt.i18nTComponent(r)}}function up(r,e,t,n={fetchedItemsKey:"data",searchKeys:["id"]}){t||(t="100");const{axiosInstance:o}=Ys({headers:r.requestHeaders}),{i18n:{t:s}}=Qs(),{debounce:c}=Qf(),d=c(async k=>{await b(k)},200),u=i.ref(!1),f=i.ref(""),h=i.ref(""),w=i.ref([]),T=i.ref(void 0),C=i.unref(e);let p=`${r.apiBaseUrl}${C}`;r.app==="konnect"?p=p.replace(/{controlPlaneId}/gi,(r==null?void 0:r.controlPlaneId)||""):r.app==="kongManager"&&(p=p.replace(/\/{workspace}/gi,r!=null&&r.workspace?`/${r.workspace}`:""));const m=async()=>{try{u.value=!0;const{data:k}=await o.get(`${p}?size=${t}`);k!=null&&k.next||(T.value=n.fetchedItemsKey in k?k[n.fetchedItemsKey]:[]),w.value=n.fetchedItemsKey in k?k[n.fetchedItemsKey]:[]}catch{w.value=[],f.value=s("debouncedFilter.errors.fetch")}finally{u.value=!1}},y=i.ref(""),b=async k=>{var g,A;if(y.value!==k)if(y.value=k||"",T.value===void 0)try{u.value=!0,f.value="",h.value="";let I=p+"";k&&(I+=`/${k}`);const{data:B}=await o.get(`${I}?size=${t}`);n.fetchedItemsKey in B?w.value=B[n.fetchedItemsKey]:B!=null&&B.id?w.value=[B]:w.value=[]}catch(I){((g=I==null?void 0:I.response)==null?void 0:g.status)===404?h.value=s("debouncedFilter.errors.invalid"):(w.value=[],f.value=s("debouncedFilter.errors.fetch"))}finally{u.value=!1}else u.value=!0,h.value="",k?(w.value=(A=T.value)==null?void 0:A.filter(I=>{var B;let _=!1;for(const X of n.searchKeys){const W=typeof I[X]=="string"?(B=I[X])==null?void 0:B.toLowerCase():I[X];W!=null&&W.includes(k.toLowerCase())&&(_=!0)}return _}),(!w.value||!w.value.length)&&(h.value=s("debouncedFilter.errors.invalid"))):w.value=T.value,u.value=!1};return{loading:u,error:f,validationError:h,results:w,allRecords:T,loadItems:m,debouncedQueryChange:d}}function dp(r,e){const t=i.unref(e),n=i.computed(()=>r.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${t}`):new URL(t));return n.value.search="",o=>`${n.value.href}/${o}`}function fp(){const{i18n:{t:r}}=Qs();return{getMessageFromError:e=>{var t,n,o;if(!e)return r("errors.unexpected");if((t=e==null?void 0:e.response)!=null&&t.data){if(e.response.data.detail)return e.response.data.detail;if((n=e.response.data.details)!=null&&n.length)return e.response.data.details.map(s=>{let c=r("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(e.response.data.message){const{message:s}=e.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof e.response.data=="string")return e.response.data;if(typeof e.response.data=="object")return Object.keys(e.response.data).map(s=>`${s} ${e.response.data[s]}`).join(", ")}return e.message||r("errors.unexpected")}}}function ku(r,e){const t=i.ref(i.unref(r)),n=i.ref(i.unref(e)),o=i.computed(()=>!!(t.value.app==="konnect"||t.value.isExactMatch)),s=i.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return c=>{const{page:d,pageSize:u,offset:f,sortColumnKey:h,sortColumnOrder:w,query:T}=c;try{let C=new URL(s.value.href);return o.value&&T?(C.search="",C=new URL(`${C.href}/${T}/`)):(o.value||new URLSearchParams(T).forEach((p,m)=>{C.searchParams.append(m,p)}),h&&C.searchParams.append("sort_by",h),w==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(u))),f&&d!==1&&C.searchParams.append("offset",String(f)),C.href}catch(C){return console.error("RouteList(fetcher)",C),n.value}}}function pp(r,e,t="data"){const n=i.unref(e),{axiosInstance:o}=Ys({headers:r.requestHeaders}),s=ku(r,n),c=i.ref({status:xt.Idle});return{fetcher:async d=>{try{c.value={status:xt.Loading};const u=s(d),{data:f}=await o.get(u),h=t&&t.replace(/[^\w-_]/gi,"");let w;f[h]&&Array.isArray(f[h])?w=f[h]:w=Object.keys(f).length?[f]:[];const T={data:w,total:w.length,...f.offset?{pagination:{offset:f.offset}}:null};return c.value={status:xt.Idle,response:T},T}catch(u){const f={data:[],total:0};return d.query&&u.response.status===404?(c.value={status:xt.NoResults,response:f,error:u},f):(c.value={status:xt.Error,response:f,error:u},f)}},fetcherState:c}}function hp(){return{convertKeyToTitle:(r,e="_")=>r?r.split(e).map(t=>t.toLowerCase()==="id"?t.toUpperCase():t.charAt(0).toUpperCase()+t.substring(1)).join(" "):""}}const Su=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Cu=r=>{if(typeof r!="string")throw new TypeError("Invalid argument expected string");const e=r.match(Su);if(!e)throw new Error(`Invalid argument not valid semver ('${r}' received)`);return e.shift(),e},xu=r=>r==="*"||r==="x"||r==="X",Au=r=>{const e=parseInt(r,10);return isNaN(e)?r:e},yp=(r,e)=>typeof r!=typeof e?[String(r),String(e)]:[r,e],gp=(r,e)=>{if(xu(r)||xu(e))return 0;const[t,n]=yp(Au(r),Au(e));return t>n?1:t<n?-1:0},Bu=(r,e)=>{for(let t=0;t<Math.max(r.length,e.length);t++){const n=gp(r[t]||"0",e[t]||"0");if(n!==0)return n}return 0},mp=(r,e)=>{const t=Cu(r),n=Cu(e),o=t.pop(),s=n.pop(),c=Bu(t,n);return c!==0?c:o&&s?Bu(o.split("."),s.split(".")):o||s?o?-1:1:0},Iu=(r,e,t)=>{bp(t);const n=mp(r,e);return Eu[t].includes(n)},Eu={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Nu=Object.keys(Eu),bp=r=>{if(typeof r!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof r}`);if(Nu.indexOf(r)===-1)throw new Error(`Invalid operator, expected one of ${Nu.join("|")}`)},vp=r=>typeof r=="string"&&/^[v\d]/.test(r)&&Su.test(r);function wp(r){const{gatewayInfo:e,supportedRange:t}=r;if(!e)return!0;const{edition:n,version:o}=e;if(!vp(o))return console.error("Invalid version"),!1;const s=t[n];if(!s)return!1;const[c,d]=s;return!(c&&Iu(o,c,"<")||d&&Iu(o,d,">"))}const Ce={useAxios:Ys,useDebouncedFilter:up,useDeleteUrlBuilder:dp,useErrors:fp,useFetcher:pp,useFetchUrlBuilder:ku,useStringHelpers:hp,useI18n:Qs,useGatewayFeatureSupported:wp},kp={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Sp="Copy to clipboard",Cp={message:kp,iconTitle:Sp},xp="kong-ui-copy-uuid-notify",Ap={class:"kong-ui-copy-uuid"},Bp=["title"],Ip=["onClick"],_u=15,Ep=i.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:r=>["uuid","hidden","redacted","deleted"].includes(r)}},emits:["success","error"],setup(r,{emit:e}){const t=r,{t:n}=Wt.createI18n("en-us",Cp),o=t.notify||i.inject(xp,()=>{}),s=i.computed(()=>!!(t.tooltip&&t.successTooltip)),c=i.ref(t.tooltip),d=i.computed(()=>t.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),u=i.computed(()=>t.format==="redacted"?"*****":t.format==="deleted"?`*${t.uuid.substring(0,5)}`:t.uuid),f=w=>{c.value=w,setTimeout(()=>{c.value=t.tooltip},1800)},h=w=>{if(!w(t.uuid)){typeof o=="function"&&o({type:"error",message:n("message.fail")}),s.value?f(n("message.fail")):e("error",t.uuid);return}const T=t.uuid.length>_u,C=t.format==="hidden"||t.format==="redacted"?n("message.success.prefix"):`"${t.uuid.substring(0,_u)+(T?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${C}${n("message.success.content")}`}),s.value?f(t.successTooltip):e("success",t.uuid)};return(w,T)=>{const C=i.resolveComponent("KIcon"),p=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Ap,[r.format!=="hidden"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":"copy-id",title:r.uuid},[i.createElementVNode("div",{class:i.normalizeClass(["uuid-container",r.truncated?"truncated-uuid":null,r.useMono?"mono":null])},i.toDisplayString(u.value),3)],8,Bp)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.tooltip?"KTooltip":"div"),i.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:i.withCtx(()=>[i.createVNode(p,null,{default:i.withCtx(({copyToClipboard:m})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(y=>h(m),["stop"])},[i.createVNode(C,{class:"uuid-icon",color:r.iconColor,"hide-title":!!r.tooltip||void 0,icon:"copy",size:"16",title:i.unref(n)("iconTitle")},null,8,["color","hide-title","title"])],8,Ip)]),_:1})]),_:1},16))])}}}),Np=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Ou=Np(Ep,[["__scopeId","data-v-e4ea1359"]]),_p={key:0,class:"config-card-fieldset-title"},Op=i.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(r){const e=r,{i18n:{t}}=Ce.useI18n(),{convertKeyToTitle:n}=Ce.useStringHelpers(),o=i.computed(()=>e.item.key??"json-array-item"),s=i.computed(()=>e.item.value??e.item),c=i.computed(()=>{const u=JSON.parse(JSON.stringify(s.value));return e.isArrayItem&&delete u.name,u}),d=i.computed(()=>{var u;return e.isArrayItem?(u=s.value)!=null&&u.name?n(s.value.name,"_"):t("baseConfigCard.general.entryTitle",{index:e.index}):""});return(u,f)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.isArrayItem?"fieldset":"div"),{class:i.normalizeClass(r.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:i.withCtx(()=>[r.isArrayItem?(i.openBlock(),i.createElementBlock("legend",_p,[i.createElementVNode("b",null,i.toDisplayString(d.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(c.value),(h,w)=>(i.openBlock(),i.createBlock(_n,{key:`${o.value}-property-${w}`,item:{key:h,label:i.unref(n)(h),value:c.value[h]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),it=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Tu=it(Op,[["__scopeId","data-v-68ca83ec"]]),Tp=it(i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(r){const{i18n:{t:e}}=Ce.useI18n();return(t,n)=>{const o=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(o,{appearance:"btn-link",class:"navigation-button",onClick:n[0]||(n[0]=s=>t.$emit("navigation-click",r.item))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.item.value||i.unref(e)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),Vp=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(r){const{i18n:{t:e}}=Ce.useI18n();return(t,n)=>{const o=i.resolveComponent("KBadge");return i.openBlock(),i.createBlock(o,{appearance:r.status?"success":"neutral"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.status?i.unref(e)("baseConfigCard.statusBadge.enabledLabel"):i.unref(e)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),jp="#0044f4",Pp="#e0e4ea",Dp="#3a3f51",$p="1px",Rp={class:"config-card-details-row"},Mp=["data-testid"],Up=["data-testid"],Lp=["data-testid"],Hp=["data-testid"],Fp={key:1},Kp=["data-testid"],qp=["data-testid"],zp=["data-testid"],Gp=["data-testid"],Wp=["title"],Jp={name:"ConfigCardItem",components:{CopyUuid:Ou,JsonCardItem:Tu,StatusBadge:Vp,InternalLinkItem:Tp}},Yp=i.defineComponent({...Jp,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(r,{emit:e}){const t=r;i.useCssVars(w=>({"2c6ac268":f.value?"none":`solid ${i.unref($p)} ${i.unref(Pp)}`,c7a65802:u.value&&c.value?"block":"flex","778426fe":u.value&&c.value?"100%":t.slim?"50%":"25%","777f9b48":u.value&&c.value?"100%":t.slim?"50%":"75%"}));const n=i.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Ce.useI18n(),c=i.computed(()=>t.item.value!==void 0&&t.item.value!==null&&t.item.value!==""),d=i.computed(()=>!!(t.item.tooltip||n["label-tooltip"])),u=i.computed(()=>t.item.type===re.Json||t.item.type===re.JsonArray),f=i.computed(()=>t.item.type===re.JsonArray),h=i.computed(()=>{switch(t.item.type){case re.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${t.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,uuid:t.item.value,notify:()=>{}}};case re.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,notify:()=>{}}};case re.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${t.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,uuid:t.item.value,notify:()=>{}}};case re.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,notify:()=>{}}};case re.Date:return{tag:"div",attrs:{"data-testid":`${t.item.key}-date`},text:s(t.item.value)};case re.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${t.item.key}-badge-status`,status:t.item.value}};case re.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case re.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case re.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${t.item.key}-internal-link`,item:t.item,onNavigationClick:w=>{e("navigation-click",w)}}};case re.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${t.item.key}-external-link`,href:t.item.value},text:t.item.value};case re.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${t.item.key}-json-content`,item:t.item}};case re.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${t.item.key}-json-array-content`,item:t.item}};default:return{tag:"div",attrs:{"data-testid":`${t.item.key}-plain-text`},text:t.item.value}}});return(w,T)=>{const C=i.resolveComponent("KLabel"),p=i.resolveComponent("KBadge"),m=i.resolveComponent("KMethodBadge");return i.openBlock(),i.createElementBlock("div",Rp,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${r.item.key}-label`},[i.renderSlot(w.$slots,"label",{item:r.item},()=>[i.createVNode(C,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.item.label)+" ",1)]),_:2},[d.value?{name:"tooltip",fn:i.withCtx(()=>[i.createElementVNode("div",{"data-testid":`${r.item.key}-label-tooltip`},[i.renderSlot(w.$slots,"label-tooltip",{},()=>[i.createTextVNode(i.toDisplayString(r.item.tooltip),1)],!0)],8,Up)]),key:"0"}:void 0]),1024)],!0)],8,Mp),i.createElementVNode("div",{class:"config-card-details-value","data-testid":`${r.item.key}-property-value`},[i.renderSlot(w.$slots,r.item.key,{rowValue:r.item.value},()=>[c.value?(i.openBlock(),i.createElementBlock("div",Fp,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(h.value.tag),i.normalizeProps(i.guardReactiveProps(h.value.attrs)),{default:i.withCtx(()=>[h.value.additionalComponent==="KBadge"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${r.item.key}-badge-tags`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(p,{key:`${r.item.key}-badge-tag-${b}`,class:"config-badge","data-testid":`${r.item.key}-badge-tag-${b}`,"truncation-tooltip":y},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,Kp)):i.createCommentVNode("",!0),h.value.additionalComponent==="CopyUuid"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${r.item.key}-copy-uuid-array`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(i.unref(Ou),i.mergeProps(h.value.childAttrs,{key:`${r.item.key}-copy-uuid-${b}`,"data-testid":`${r.item.key}-copy-uuid-${b}`,uuid:y}),null,16,["data-testid","uuid"]))),128))],8,qp)):h.value.additionalComponent==="KMethodBadge"?(i.openBlock(),i.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${r.item.key}-badge-methods`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(m,{key:`${r.item.key}-badge-method-${b}`,class:"config-badge","data-testid":`${r.item.key}-badge-method-${b}`,"is-rounded":"",label:y,method:i.unref(Gu.MethodsArray).includes(y.toLowerCase())?y.toLowerCase():"custom"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,zp)):i.createCommentVNode("",!0),h.value.additionalComponent==="JsonCardItem"?(i.openBlock(),i.createElementBlock("div",{key:3,"data-testid":`${t.item.key}-json-array-content`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(Tu,{key:`json-array-item-${b}`,index:b,"is-array-item":"",item:y},null,8,["index","item"]))),128))],8,Gp)):(i.openBlock(),i.createElementBlock("span",{key:4,class:i.normalizeClass(["attrs-data-text",{truncated:r.truncated}]),title:r.truncated?r.item.value:void 0},i.toDisplayString(h.value.text),11,Wp))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${r.item.key}-no-value`}," – ",8,Hp))],!0)],8,Lp)])}}}),_n=it(Yp,[["__scopeId","data-v-a3c5ab01"]]),Zp={"data-testid":"config-card-title"},Qp={class:"config-card-actions"},Xp={class:"config-card-details-section"},eh=["data-testid"],th={key:0,class:"config-card-prop-section-title"},Vu=it(i.defineComponent({__name:"EntityBaseConfigCard",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)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(r,{emit:e}){var t;const n=r,o=i.useSlots(),{i18n:{t:s}}=Ce.useI18n(),{getMessageFromError:c}=Ce.useErrors(),{convertKeyToTitle:d}=Ce.useStringHelpers(),{axiosInstance:u}=Ce.useAxios({headers:(t=n.config)==null?void 0:t.requestHeaders}),f={id:{type:re.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:ae.Basic},name:{order:1,section:ae.Basic},enabled:{type:re.BadgeStatus,order:2,section:ae.Basic},updated_at:{type:re.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:ae.Basic},created_at:{type:re.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:ae.Basic},tags:{type:re.BadgeTag,order:-1,section:ae.Basic}},h=i.ref(!1),w=i.ref(!1),T=i.ref(""),C=i.ref(),p=i.computed(()=>{var I,B,_;if(!C.value)return[];const X=[],W=Object.keys(C.value).length;for(const V in C.value){const M=(B=(I=n.configSchema)==null?void 0:I[V])==null?void 0:B.order,z=(_=f[V])==null?void 0:_.order;let L=W;(z||z===0)&&(L=z===-1?W+1:z),M&&(L=M===-1?W+1:M),X.push([V,L])}return X.sort(function(V,M){return V[1]-M[1]}),X.map(V=>{var M,z;const L=V[0],fe=(M=C.value)==null?void 0:M[L],Ve=((z=n.configSchema)==null?void 0:z[L])||{},Be=f[L];return{key:L,value:fe,hidden:Ve.hidden||!1,type:Ve.type??((Be==null?void 0:Be.type)||re.Text),label:Ve.label??((Be==null?void 0:Be.label)||d(L)),tooltip:Ve.tooltip??((Be==null?void 0:Be.tooltip)||void 0),section:Ve.section??((Be==null?void 0:Be.section)||ae.Advanced)}}).filter(V=>!V.hidden&&V.key!==n.pluginConfigKey)}),m=i.computed(()=>{var I,B;if(!C.value||!n.pluginConfigKey)return[];const _=C.value[n.pluginConfigKey]||{},X=Object.keys(_).length,W=[];for(const V in _){const M=(B=(I=n.pluginConfigSchema)==null?void 0:I[V])==null?void 0:B.order,z=_[V];let L=z!=null&&z!==""?X-1:X;M&&(L=M===-1?X+1:M),W.push([V,L])}return W.sort(function(V,M){return V[1]-M[1]}),W.map(V=>{var M;const z=V[0],L=_[z],fe=((M=n.pluginConfigSchema)==null?void 0:M[z])||{};return{key:z,value:L,hidden:fe.hidden||!1,type:fe.type??re.Text,label:fe.label??d(z),tooltip:fe.tooltip??void 0,section:ae.Plugin}}).filter(V=>!V.hidden)}),y=i.computed(()=>{var I,B,_,X;return{basic:(I=p.value)==null?void 0:I.filter(W=>W.section===ae.Basic),advanced:(B=p.value)==null?void 0:B.filter(W=>W.section===ae.Advanced),plugin:(X=m.value)==null?void 0:X.concat((_=p.value)==null?void 0:_.filter(W=>W.section===ae.Plugin))}}),b=i.computed(()=>{const I=[];return y.value.basic.length&&I.push("basic"),y.value.advanced.length&&I.push("advanced"),y.value.plugin.length&&I.push("plugin"),I}),k=I=>!!(I.tooltip||o[`${I.key}-label-tooltip`]),g=i.computed(()=>{var I,B;let _=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((I=n.config)==null?void 0:I.controlPlaneId)||""):n.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(B=n.config)!=null&&B.workspace?`/${n.config.workspace}`:"")),_=_.replace(/{id}/gi,n.config.entityId),_}),A=I=>{C.value&&I(JSON.stringify(C.value))?e("copy:success",C.value):e("copy:error")};return i.watch(h,I=>{e("loading",I)},{immediate:!0}),i.onBeforeMount(async()=>{w.value=!1,h.value=!0;try{const{data:I}=await u.get(g.value);if(n.dataKey)if(typeof I[n.dataKey]<"u")C.value={...I[n.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:n.dataKey}));else C.value={...I};Object.keys(n.configSchema).filter(B=>n.configSchema[B].forceShow).forEach(B=>{C.value&&typeof C.value[B]>"u"&&(C.value[B]=null)}),e("fetch:success",I)}catch(I){const B=c(I);T.value=B.startsWith("code")?s("baseConfigCard.errors.load"):B,w.value=!0,e("fetch:error",I)}finally{h.value=!1}}),(I,B)=>{const _=i.resolveComponent("KButton"),X=i.resolveComponent("KClipboardProvider"),W=i.resolveComponent("KSkeleton"),V=i.resolveComponent("KEmptyState"),M=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(M,{"border-variant":"noBorder",class:"kong-ui-entity-base-config-card"},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",Qp,[i.renderSlot(I.$slots,"actions",{},void 0,!0),i.createVNode(X,null,{default:i.withCtx(({copyToClipboard:z})=>[!h.value&&!w.value?(i.openBlock(),i.createBlock(_,{key:0,appearance:"btn-link","data-testid":"json-copy-button",onClick:L=>A(z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]),_:1})])]),body:i.withCtx(()=>[h.value?(i.openBlock(),i.createBlock(W,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):w.value?(i.openBlock(),i.createBlock(V,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(T.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Xp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,z=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${z}-props`,class:i.normalizeClass(`config-card-details-${z}-props`),"data-testid":`config-card-details-${z}-props`},[z!=="basic"?(i.openBlock(),i.createElementBlock("div",th,i.toDisplayString(z==="advanced"?i.unref(s)("baseConfigCard.sections.advanced"):i.unref(s)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.value[z],L=>(i.openBlock(),i.createBlock(_n,{key:L.key,item:L},i.createSlots({label:i.withCtx(()=>[i.renderSlot(I.$slots,`${L.key}-label`,{row:L},void 0,!0)]),[L.key]:i.withCtx(({rowValue:fe})=>[i.renderSlot(I.$slots,L.key,{row:L,rowValue:fe},void 0,!0)]),_:2},[k(L)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(I.$slots,`${L.key}-label-tooltip`,{row:L},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,eh))),128))])]),_:2},[r.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("div",Zp,[i.renderSlot(I.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-b72bbdde"]]),rh=["onReset","onSubmit"],ih={class:"form-actions","data-testid":"form-actions"},ju=it(i.defineComponent({__name:"EntityBaseForm",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")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(r,{emit:e}){var t;const n=r,o=xr.useRouter(),{i18n:{t:s}}=Ce.useI18n(),{getMessageFromError:c}=Ce.useErrors(),{axiosInstance:d}=Ce.useAxios({headers:(t=n.config)==null?void 0:t.requestHeaders}),u=i.ref(!1),f=i.ref(!1),h=i.ref(""),w=i.computed(()=>n.canSubmit===!1||n.isReadonly),T=i.computed(()=>{var y,b;if(!n.editId)return"";let k=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=n.config)==null?void 0:y.controlPlaneId)||""):n.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),k=k.replace(/{id}/gi,n.editId),k}),C=()=>{n.config.cancelRoute?o.push(n.config.cancelRoute):p()},p=()=>{e("cancel")},m=()=>{w.value||e("submit")};return i.watch(()=>u.value,y=>{e("loading",y)},{immediate:!0}),i.onBeforeMount(async()=>{if(n.editId)try{f.value=!1,u.value=!0;const{data:y}=await d.get(T.value);e("fetch:success",y)}catch(y){const b=c(y);h.value=b.startsWith("code")?s("baseForm.errors.edit"):b,f.value=!0,e("fetch:error",y)}finally{u.value=!1}}),(y,b)=>{const k=i.resolveComponent("KSkeleton"),g=i.resolveComponent("KEmptyState"),A=i.resolveComponent("KAlert"),I=i.resolveComponent("KButton"),B=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(B,{class:"kong-ui-entity-base-form"},{body:i.withCtx(()=>[u.value?(i.openBlock(),i.createBlock(k,{key:0,type:"form"})):f.value?(i.openBlock(),i.createBlock(g,{key:1,"cta-text":i.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(h.value),1)]),_:1},8,["cta-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:i.withModifiers(p,["prevent"]),onSubmit:i.withModifiers(m,["prevent"])},[i.renderSlot(y.$slots,"default",{},void 0,!0),r.errorMessage?(i.openBlock(),i.createBlock(A,{key:0,"alert-message":r.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):i.createCommentVNode("",!0),i.createElementVNode("div",ih,[i.renderSlot(y.$slots,"form-actions",{},()=>[i.createVNode(I,{appearance:"outline","data-testid":"form-cancel",disabled:r.isReadonly,type:"reset"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),i.createVNode(I,{appearance:"primary","data-testid":"form-submit",disabled:w.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,rh))]),_:3})}}}),[["__scopeId","data-v-2286e5f2"]]),nh={key:0},oh=it(i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(r){const e=r,t=i.computed(()=>{var m;return((m=e.rowEl)==null?void 0:m.querySelector(`[data-testid="${e.keyName}"]`))||null}),n=i.computed(()=>{var m;return((m=t.value)==null?void 0:m.querySelector('[role="button"]'))||null}),o=i.computed(()=>{var m,y;const b=(m=e.rowEl)==null?void 0:m.querySelectorAll("td");return b?((y=b[0])==null?void 0:y.getAttribute("data-testid"))===e.keyName:!1});let s;const c=()=>{s&&(s.disconnect(),s=void 0)},d=()=>{var m,y,b;f.value=((m=n.value)==null?void 0:m.getBoundingClientRect().width)||0,h.value=((y=t.value)==null?void 0:y.clientWidth)||0,w.value=((b=u.value)==null?void 0:b.innerText)||""},u=i.ref({}),f=i.ref(0),h=i.ref(0),w=i.ref(""),T=i.computed(()=>[n.value,t.value]),C=i.watch(T,m=>{if(o.value&&(c(),"ResizeObserver"in window&&window)){s=new ResizeObserver(y=>{window.requestAnimationFrame(()=>{!Array.isArray(y)||!y.length||d()})});for(const y of m)y&&s.observe(y)}},{immediate:!0,flush:"post",deep:!0}),p=i.computed(()=>o.value?f.value>h.value:!1);return i.onMounted(()=>{d()}),i.onUnmounted(()=>{C()}),(m,y)=>{const b=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:u,class:"content-wrapper"},[o.value?(i.openBlock(),i.createElementBlock("span",nh,[i.createVNode(b,{disabled:!p.value,label:w.value,"max-width":"300",placement:"bottomStart"},{default:i.withCtx(()=>[i.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["disabled","label"])])):i.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-f8a220e9"]]),sh={class:"toolbar-container"},ah={key:0,class:"toolbar-button-container"},ch=["data-testid"],Pu=it(i.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(r,{emit:e}){const t=r,{i18n:{t:n}}=Ce.useI18n(),o=i.computed(()=>t.cacheIdentifier||t.preferencesStorageKey),s=g=>g.hasData||!!t.query,c=i.computed(()=>{const g=[];return Object.keys(t.tableHeaders).forEach(A=>{const I=t.tableHeaders[A];g.push({label:I.label??A,key:A,sortable:I.sortable??!1})}),t.enableEntityActions&&g.push({key:"actions",hideLabel:!0}),g}),d=g=>({"data-rowid":g.id,"data-testid":g.name,...t.rowAttributes(g)}),u=i.ref({}),f=g=>{var A;return(A=u.value)==null?void 0:A.$el.querySelector(`[data-rowid="${g.id}"]`)},h=g=>{const A={"data-testid":g.headerKey,...t.cellAttributes(g)};return g.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},w=()=>{e("empty-state-cta-clicked"),T()},T=()=>{e("clear-search-input")},C=(g,A)=>{e("click:row",A)},p=g=>{e("sort",g)},{setTablePreferences:m,getTablePreferences:y}=ep(),b=i.computed(()=>{const g=y(t.preferencesStorageKey);return{...t.initialFetcherParams,...g}}),k=g=>{t.preferencesStorageKey&&m(t.preferencesStorageKey,g)};return(g,A)=>{const I=i.resolveComponent("KIcon"),B=i.resolveComponent("KButton"),_=i.resolveComponent("KDropdownMenu"),X=i.resolveComponent("KTable"),W=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(W,{class:"kong-ui-entity-base-table",title:r.title},{body:i.withCtx(()=>[i.createVNode(X,{ref_key:"tableRefs",ref:u,"cache-identifier":o.value,"cell-attrs":h,"disable-pagination-page-jump":r.disablePaginationPageJump,"disable-sorting":r.disableSorting,"empty-state-action-button-icon":r.query?"":"plus","empty-state-action-message":r.query?i.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):r.emptyStateOptions.ctaText,"empty-state-action-route":r.query?"":r.emptyStateOptions.ctaPath,"empty-state-icon":r.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":r.query?i.unref(n)("baseTable.emptyState.noSearchResultsMessage"):r.emptyStateOptions.message,"empty-state-title":r.query?i.unref(n)("baseTable.emptyState.noSearchResultsTitle"):r.emptyStateOptions.title,"enable-client-sort":r.enableClientSort,"error-state-title":r.errorMessage,fetcher:r.fetcher,"fetcher-cache-key":String(r.fetcherCacheKey),"has-error":!!r.errorMessage,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":b.value,"is-loading":r.isLoading,"pagination-type":r.paginationType,"row-attrs":d,"search-input":r.query,onKtableEmptyStateCtaClicked:w,"onRow:click":C,onSort:A[0]||(A[0]=V=>p(V)),"onUpdate:tablePreferences":k},i.createSlots({toolbar:i.withCtx(({state:V})=>[i.withDirectives(i.createElementVNode("div",sh,[i.renderSlot(g.$slots,"toolbar-filter",{},void 0,!0),g.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",ah,[i.renderSlot(g.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,s(V)]])]),actions:i.withCtx(({row:V,rowKey:M,rowValue:z})=>[i.createElementVNode("div",{class:"actions-container","data-testid":V.name},[i.createVNode(_,{"kpop-attributes":{placement:"bottomEnd"},width:r.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(g.$slots,"actions",{row:V,rowKey:M,rowValue:z},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(B,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:i.withCtx(()=>[i.createVNode(I,{color:i.unref(Dp),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,ch)]),_:2},[i.renderList(r.tableHeaders,(V,M)=>({name:M,fn:i.withCtx(({row:z,rowKey:L,rowValue:fe})=>[i.createVNode(oh,{"key-name":String(M),"row-el":f(z)},{default:i.withCtx(()=>[i.renderSlot(g.$slots,M,{row:z,rowKey:L,rowValue:fe},()=>[i.createTextVNode(i.toDisplayString(fe),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-a598b1d9"]]),lh={key:0,class:"kong-ui-entity-delete-error"},uh={key:1,class:"description"},Du=it(i.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(r,{emit:e}){const t=r,{i18nT:n}=Ce.useI18n(),o=i.computed(()=>t.needConfirm?t.entityName:""),s=()=>{e("cancel")},c=()=>{e("proceed")};return(d,u)=>{const f=i.resolveComponent("KAlert"),h=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(h,{"action-button-text":"Yes, delete","action-pending":r.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":r.visible,title:r.title,type:"danger",onCanceled:s,onProceed:c},{"body-content":i.withCtx(()=>[r.error?(i.openBlock(),i.createElementBlock("div",lh,[i.createVNode(f,{appearance:"danger"},{alertMessage:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.error),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(i.unref(n),{class:"message",keypath:t.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},i.createSlots({entityType:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.entityType),1)]),_:2},[t.entityName?{name:"entityName",fn:i.withCtx(()=>[i.createElementVNode("strong",null,i.toDisplayString(t.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),t.description||d.$slots.description?(i.openBlock(),i.createElementBlock("div",uh,[i.renderSlot(d.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(t.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),dh={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},fh={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},ph=["fill"],hh={mask:"url(#mask0_180_20349)"},yh=["fill"],gh=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${jp})`}},setup(r){return(e,t)=>(i.openBlock(),i.createElementBlock("svg",dh,[i.createElementVNode("mask",fh,[i.createElementVNode("rect",{fill:r.color,height:"20",width:"20"},null,8,ph)]),i.createElementVNode("g",hh,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:r.color},null,8,yh)])]))}}),mh={key:1,class:"kong-ui-entity-filter"},bh={class:"menu-item-title"},vh={class:"menu-item-indicator"},wh={class:"menu-item-body"},kh=["for"],Sh={class:"menu-item-buttons"},$u=it(i.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,{i18n:{t:n}}=Ce.useI18n(),o=i.ref(!1),s=i.ref({}),c=i.computed(()=>{const y=[];return new URLSearchParams(t.modelValue).forEach((b,k)=>{b!==""&&y.push(k)}),y}),d=i.computed(()=>{const y=t.config.fields;return Object.keys(y).filter(b=>y[b].searchable).map(b=>({label:y[b].label||b,value:b}))});i.watch(()=>t.modelValue,y=>{s.value={},new URLSearchParams(y).forEach((b,k)=>{s.value[k]=b})});const u=()=>{o.value=!o.value},f=y=>{e("update:modelValue",y)},h=y=>`filter-${y}`,w=y=>{var b,k;return(((k=(b=t.config.schema)==null?void 0:b[y])==null?void 0:k.values)??[]).map(g=>({value:g,label:g}))},T=y=>{var b,k;return((k=(b=t.config.schema)==null?void 0:b[y])==null?void 0:k.type)??"text"},C=y=>{s.value={...s.value,[y]:""},m()},p=()=>{s.value={},m(!0)},m=(y=!1)=>{const b=Object.keys(s.value).reduce((k,g)=>(s.value[g]&&(k[g]=`${s.value[g]}`),k),{});y&&(o.value=!1),e("update:modelValue",new URLSearchParams(b).toString())};return(y,b)=>{const k=i.resolveComponent("KInput"),g=i.resolveComponent("KButton"),A=i.resolveComponent("KSelect"),I=i.resolveComponent("KMenuItem"),B=i.resolveComponent("KMenu");return r.config.isExactMatch?(i.openBlock(),i.createBlock(k,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":r.modelValue,placeholder:r.config.placeholder,"onUpdate:modelValue":f},{icon:i.withCtx(()=>[i.createVNode(gh)]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",mh,[i.createVNode(g,{appearance:"btn-link","data-testid":"filter-button",icon:"filter",onClick:u},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.filterButtonText"))+" "+i.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),i.withDirectives(i.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:u},null,512),[[i.vShow,o.value]]),i.withDirectives(i.createVNode(B,{class:"kong-ui-entity-filter-menu"},{body:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,(_,X)=>(i.openBlock(),i.createBlock(I,{key:_.value,"data-testid":_.value,expandable:"","last-menu-item":X===d.value.length-1},{itemTitle:i.withCtx(()=>[i.createElementVNode("span",bh,[i.createTextVNode(i.toDisplayString(_.label)+" ",1),i.withDirectives(i.createElementVNode("span",vh,null,512),[[i.vShow,c.value.includes(_.value)]])])]),itemBody:i.withCtx(()=>{var W,V;return[i.createElementVNode("div",wh,[i.createElementVNode("label",{class:"menu-item-label",for:h(_.value)},i.toDisplayString(i.unref(n)("filter.fieldLabel")),9,kh),((V=(W=r.config.schema)==null?void 0:W[_.value])==null?void 0:V.type)==="select"?(i.openBlock(),i.createBlock(A,{key:0,id:h(_.value),modelValue:s.value[_.value],"onUpdate:modelValue":M=>s.value[_.value]=M,appearance:"select",items:w(_.value),placeholder:i.unref(n)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(k,{key:1,id:h(_.value),modelValue:s.value[_.value],"onUpdate:modelValue":M=>s.value[_.value]=M,autocomplete:"off",placeholder:i.unref(n)("filter.inputPlaceholder"),size:"small",type:T(_.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),i.createElementVNode("div",Sh,[i.createVNode(g,{appearance:"btn-link","data-testid":"apply-filter",size:"small",onClick:b[0]||(b[0]=M=>m(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.applyButtonText")),1)]),_:1}),i.createVNode(g,{appearance:"btn-link","data-testid":"clear-filter",size:"small",onClick:M=>C(_.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:i.withCtx(()=>[i.createVNode(g,{onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.clearAllButtonText")),1)]),_:1})]),_:1},512),[[i.vShow,o.value]])]))}}}),[["__scopeId","data-v-745f38c0"]]),gt=i.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(r){const e=r,t=i.ref(void 0),n=i.computed(()=>t.value===!0||t.value!==void 0&&e.forceShow===!0);return i.watch(()=>e.authFunction,async()=>{t.value=await e.authFunction()},{immediate:!0}),(o,s)=>n.value?i.renderSlot(o.$slots,"default",{key:0,isAllowed:t.value}):i.createCommentVNode("",!0)}}),Ch={class:"form-section-wrapper"},xh={key:0,class:"form-section-title"},Ah={key:1,class:"form-section-description"},Bh={key:2,class:"form-section-footer"},Ih={class:"form-section-content"},On=it(i.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(r){const e=i.useSlots();return(t,n)=>(i.openBlock(),i.createElementBlock("fieldset",{class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":r.hasDivider}])},[i.createElementVNode("div",Ch,[r.hideInfoHeader?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["form-section-info",{sticky:r.stickyInfoHeader}])},[r.title?(i.openBlock(),i.createElementBlock("h4",xh,i.toDisplayString(r.title),1)):i.createCommentVNode("",!0),r.description||i.unref(e).description?(i.openBlock(),i.createElementBlock("div",Ah,[i.renderSlot(t.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(r.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(e).footer?(i.openBlock(),i.createElementBlock("div",Bh,[i.renderSlot(t.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",Ih,[i.renderSlot(t.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:Tn,useDeleteUrlBuilder:Ru,useErrors:Mu,useFetchUrlBuilder:Iy,useFetcher:Uu,useDebouncedFilter:Ey,useStringHelpers:Lu,useGatewayFeatureSupported:Ny}=Ce,_y="",Oy="",Eh={class:"kong-ui-entities-certificates-list"},Nh={key:0},_h={key:1},Oh={key:0},Th={key:1},Vh={key:0},jh={key:1},Ph={key:1},Dh={key:1},$h=i.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}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var ce;const t=r,{i18n:{t:n,formatUnixTimeStamp:o},i18nT:s}=rt.useI18n(),c=xr.useRouter(),{axiosInstance:d}=Tn({headers:(ce=t.config)==null?void 0:ce.requestHeaders}),u=i.ref(1),f=i.computed(()=>t.config.app!=="kongManager"||!!t.config.disableSorting),w={subject:{label:n("certificates.list.table_headers.subject")},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}},T=i.computed(()=>{var J,ge;let F=`${t.config.apiBaseUrl}${ii.list[t.config.app]}`;return t.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((J=t.config)==null?void 0:J.controlPlaneId)||""):t.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(ge=t.config)!=null&&ge.workspace?`/${t.config.workspace}`:"")),F}),C=i.ref(""),p=i.computed(()=>{const F=t.config.app==="konnect"||t.config.isExactMatch;return F?{isExactMatch:F,placeholder:n("certificates.search.placeholder")}:{isExactMatch:F,schema:t.config.filterSchema}}),{fetcher:m,fetcherState:y}=Uu(t.config,T.value),b=()=>{C.value=""},k=()=>{u.value++},g=i.ref(""),A=(F,J)=>{const ge=F.id;if(!J(ge)){e("copy:error",{entity:F,field:"id",message:n("certificates.errors.copy")});return}e("copy:success",{entity:F,field:"id",message:n("certificates.copy.success",{val:ge})})},I=(F,J)=>{const ge=JSON.stringify(F);if(!J(ge)){e("copy:error",{entity:F,message:n("certificates.errors.copy")});return}e("copy:success",{entity:F,message:n("certificates.copy.success_brief")})},B=(F,J)=>{F.type==="error"?e("copy:error",{entity:J,field:"cert",message:n("certificates.errors.copy")}):e("copy:success",{entity:J,field:"cert",message:n("certificates.copy.success_brief")})},_=async F=>{var ge;await((ge=t.canRetrieve)==null?void 0:ge.call(t,F))&&c.push(t.config.getViewRoute(F.id))},X=F=>({label:n("certificates.actions.view"),to:t.config.getViewRoute(F)}),W=F=>({label:n("certificates.actions.edit"),to:t.config.getEditRoute(F)}),V=F=>{if(t.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:t.config.getCreateSniRoute(F)}},M=i.ref(void 0),z=i.ref(!1),L=i.ref(!1),fe=i.ref(""),Ve=Ru(t.config,T.value),{certificateDataCache:Be,getCertificateData:mt}=rt.useCertificate(),Sr=F=>{M.value=F,z.value=!0},At=()=>{z.value=!1},zt=async()=>{var F,J,ge;if((F=M.value)!=null&&F.id){L.value=!0;try{await d.delete(Ve(M.value.id)),L.value=!1,z.value=!1,u.value++,e("delete:success",M.value)}catch(Re){fe.value=((ge=(J=Re.response)==null?void 0:J.data)==null?void 0:ge.message)||Re.message||n("certificates.errors.delete"),e("error",Re)}finally{L.value=!1}}};i.watch(y,F=>{if(F.status===xt.Error){g.value=n("certificates.errors.general"),e("error",F.error);return}Be.value={},g.value=""});const H=i.ref({ctaPath:t.config.createRoute,ctaText:void 0,message:n("certificates.list.empty_state.description"),title:n("certificates.title")});return i.onBeforeMount(async()=>{await t.canCreate()&&(H.value.title=n("certificates.list.empty_state.title"),H.value.ctaText=n("certificates.actions.create"))}),(F,J)=>{const ge=i.resolveComponent("KButton"),Re=i.resolveComponent("KBadge"),Cr=i.resolveComponent("KTruncate"),Z=i.resolveComponent("KDropdownItem"),le=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Eh,[i.createVNode(i.unref(Pu),{"cache-identifier":r.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":f.value,"empty-state-options":H.value,"enable-entity-actions":"","error-message":g.value,fetcher:i.unref(m),"fetcher-cache-key":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":i.unref(w),onClearSearchInput:b,"onClick:row":J[2]||(J[2]=q=>_(q)),onSort:k},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref($u),{modelValue:C.value,"onUpdate:modelValue":J[0]||(J[0]=q=>C.value=q),config:p.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[i.createVNode(i.unref(gt),{"auth-function":()=>r.canCreate()},{default:i.withCtx(()=>[i.createVNode(ge,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:r.config.createRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),subject:i.withCtx(({row:q})=>{var ue;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Nh,i.toDisplayString((ue=q==null?void 0:q.metadata)!=null&&ue.subject?q.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",_h,i.toDisplayString(i.unref(mt)(q).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:q})=>{var ue;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Oh,i.toDisplayString((ue=q==null?void 0:q.metadata)!=null&&ue.expiry?i.unref(o)(q.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",Th,i.toDisplayString(i.unref(mt)(q).schemaExpiry?i.unref(o)(i.unref(mt)(q).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:q})=>{var ue;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Vh,i.toDisplayString((ue=q==null?void 0:q.metadata)!=null&&ue.dns_names?`dns=${q.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",jh,i.toDisplayString(i.unref(mt)(q).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:q})=>[q!=null&&q.cert?(i.openBlock(),i.createBlock(i.unref(Zf),{key:0,"data-testid":"copy-certificate-cert",notify:ue=>B(ue,q),truncated:!0,uuid:q.cert},null,8,["notify","uuid"])):(i.openBlock(),i.createElementBlock("span",Ph,"-"))]),tags:i.withCtx(({row:q})=>{var ue;return[((ue=q==null?void 0:q.tags)==null?void 0:ue.length)>0?(i.openBlock(),i.createBlock(Cr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(q==null?void 0:q.tags,Gt=>(i.openBlock(),i.createBlock(Re,{key:Gt,onClick:J[1]||(J[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Gt),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Dh,"-"))]}),actions:i.withCtx(({row:q})=>[i.createVNode(le,null,{default:i.withCtx(({copyToClipboard:ue})=>[i.createVNode(Z,{"data-testid":"action-entity-copy-id",onClick:Gt=>A(q,ue)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(le,null,{default:i.withCtx(({copyToClipboard:ue})=>[i.createVNode(Z,{"data-testid":"action-entity-copy-json",onClick:Gt=>I(q,ue)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(gt),{"auth-function":()=>r.canRetrieve(q)},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-view","has-divider":"",item:X(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(gt),{"auth-function":()=>r.canEdit(q)},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-edit",item:W(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref(gt),{key:0,"auth-function":()=>r.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-add-sni",item:V(q.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(gt),{"auth-function":()=>r.canDelete(q)},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:ue=>Sr(q)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),i.createVNode(i.unref(Du),{"action-pending":L.value,"entity-type":i.unref(Js).Certificate,error:fe.value,title:i.unref(n)("certificates.delete.title"),visible:z.value,onCancel:At,onProceed:zt},{description:i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(n)("certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Ty="",kr=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Rh=kr($h,[["__scopeId","data-v-7079e57f"]]),Mh={class:"kong-ui-entities-certificates-form"},Uh=i.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:""}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=r,n=xr.useRouter(),{i18nT:o,i18n:{t:s}}=rt.useI18n(),{getMessageFromError:c}=Mu(),{axiosInstance:d}=Tn({headers:(k=t.config)==null?void 0:k.requestHeaders}),u=i.computed(()=>ii.form[t.config.app].edit),f=i.computed(()=>t.certificateId?qt.Edit:qt.Create),h=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),w=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),T=i.computed(()=>(f.value===qt.Create||JSON.stringify(h.fields)!==JSON.stringify(w))&&!!h.fields.cert&&!!h.fields.key),C=g=>{var A;h.fields.cert=(g==null?void 0:g.cert)||"",h.fields.key=(g==null?void 0:g.key)||"",h.fields.certAlt=(g==null?void 0:g.cert_alt)||"",h.fields.keyAlt=(g==null?void 0:g.key_alt)||"",h.fields.tags=((A=g==null?void 0:g.tags)==null?void 0:A.join(", "))||"",Object.assign(w,h.fields)},p=()=>{n.push(t.config.cancelRoute)},m=i.computed(()=>{var A,I;let g=`${t.config.apiBaseUrl}${ii.form[t.config.app].validate}`;return t.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((A=t.config)==null?void 0:A.controlPlaneId)||""):t.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(I=t.config)!=null&&I.workspace?`/${t.config.workspace}`:"")),g=g.replace(/{id}/gi,t.certificateId),g}),y=i.computed(()=>{var A,I;let g=`${t.config.apiBaseUrl}${ii.form[t.config.app][f.value]}`;return t.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((A=t.config)==null?void 0:A.controlPlaneId)||""):t.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(I=t.config)!=null&&I.workspace?`/${t.config.workspace}`:"")),g=g.replace(/{id}/gi,t.certificateId),g}),b=async()=>{var g,A,I,B,_,X,W,V,M;try{h.isReadonly=!0;const z={cert:h.fields.cert,key:h.fields.key,cert_alt:h.fields.certAlt||null,key_alt:h.fields.keyAlt||null,tags:(A=(g=h.fields.tags.split(","))==null?void 0:g.map(fe=>String(fe||"").trim()))==null?void 0:A.filter(fe=>fe!=="")};let L;await d.post(m.value,z),f.value==="create"?L=await d.post(y.value,z):f.value==="edit"&&(L=((I=t.config)==null?void 0:I.app)==="konnect"?await d.put(y.value,z):await d.patch(y.value,z)),h.fields.cert=((B=L==null?void 0:L.data)==null?void 0:B.cert)||"",h.fields.key=((_=L==null?void 0:L.data)==null?void 0:_.key)||"",h.fields.certAlt=((X=L==null?void 0:L.data)==null?void 0:X.cert_alt)||"",h.fields.keyAlt=((W=L==null?void 0:L.data)==null?void 0:W.key_alt)||"",h.fields.tags=((M=(V=L==null?void 0:L.data)==null?void 0:V.tags)==null?void 0:M.join(", "))||"",Object.assign(w,h.fields),e("update",L==null?void 0:L.data)}catch(z){h.errorMessage=c(z),e("error",z)}finally{h.isReadonly=!1}};return(g,A)=>{const I=i.resolveComponent("KTextArea"),B=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Mh,[i.createVNode(i.unref(ju),{"can-submit":T.value,config:r.config,"edit-id":r.certificateId,"error-message":h.errorMessage,"fetch-url":u.value,"is-readonly":h.isReadonly,onCancel:p,"onFetch:error":A[5]||(A[5]=_=>g.$emit("error",_)),"onFetch:success":C,onLoading:A[6]||(A[6]=_=>g.$emit("loading",_)),onSubmit:b},{default:i.withCtx(()=>[i.createVNode(i.unref(On),{description:i.unref(s)("certificates.form.sections.ssl.description"),title:i.unref(s)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(I,{modelValue:h.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=_=>h.fields.cert=_),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert","disable-character-limit":"",label:i.unref(s)("certificates.form.fields.cert.label"),readonly:h.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(I,{modelValue:h.fields.key,"onUpdate:modelValue":A[1]||(A[1]=_=>h.fields.key=_),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key","disable-character-limit":"",label:i.unref(s)("certificates.form.fields.key.label"),readonly:h.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(B,{modelValue:h.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=_=>h.fields.certAlt=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-cert-alt",label:i.unref(s)("certificates.form.fields.cert_alt.label"),readonly:h.isReadonly,type:"text"},null,8,["modelValue","label","readonly"]),i.createVNode(B,{modelValue:h.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=_=>h.fields.keyAlt=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-key-alt",label:i.unref(s)("certificates.form.fields.key_alt.label"),readonly:h.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(On),{description:i.unref(s)("certificates.form.sections.general.description"),title:i.unref(s)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(B,{modelValue:h.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=_=>h.fields.tags=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:i.unref(s)("certificates.form.fields.tags.help"),label:i.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:i.unref(s)("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","error-message","fetch-url","is-readonly"])])}}}),Vy="",Lh=kr(Uh,[["__scopeId","data-v-ffa3e98c"]]),ni={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},Hh={class:"kong-ui-ca-certificate-entity-config-card"},Fh={key:0},Kh=i.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)},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(r,{emit:e}){const t=r,n=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=rt.useI18n(),{convertKeyToTitle:c}=Lu(),{getCertificateData:d}=rt.useCertificate(),u=i.computed(()=>ni.form[t.config.app].edit),f=i.ref(),h=i.computed(()=>{if(f.value)return d(f.value)}),w=i.computed(()=>{var y;return((y=h.value)==null?void 0:y.schemaIssuer)||""}),T=i.computed(()=>{var y,b;return(y=h.value)!=null&&y.schemaExpiry?s((b=h.value)==null?void 0:b.schemaExpiry):""}),C=i.computed(()=>{var y;return((y=h.value)==null?void 0:y.schemaKeyUsages)||[]}),p=y=>{f.value=y,e("fetch:success",y)},m=i.ref({id:{},updated_at:{},created_at:{},cert:{section:ae.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:ae.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:ae.Basic,type:re.Json,order:7},...t.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:ae.Basic,order:1.7,forceShow:!0},issuer:{section:ae.Basic,order:1.5,forceShow:!0},key_usages:{section:ae.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(y,b)=>{const k=i.resolveComponent("KCodeBlock"),g=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Hh,[i.createVNode(i.unref(Vu),{config:r.config,"config-schema":m.value,"fetch-url":u.value,"hide-title":r.hideTitle,"onCopy:success":b[0]||(b[0]=A=>y.$emit("copy:success",A)),"onFetch:error":b[1]||(b[1]=A=>y.$emit("fetch:error",A)),"onFetch:success":p,onLoading:b[2]||(b[2]=A=>y.$emit("loading",A))},{cert:i.withCtx(({rowValue:A})=>[i.createVNode(k,{id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:A,"is-single-line":"",language:"plaintext"},null,8,["id","code"])]),metadata:i.withCtx(({rowValue:A})=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(A).filter(I=>!n.includes(I)),I=>(i.openBlock(),i.createBlock(i.unref(_n),{key:I,"data-testid":`ca-cert-metadata-${I}`,item:{key:I,label:i.unref(c)(I),value:I==="expiry"?T.value:I==="key_usages"?C.value:A[I],type:I==="key_usages"?i.unref(re).BadgeTag:i.unref(re).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(w.value||"–"),1)]),key_usages:i.withCtx(()=>[C.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fh,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(A,I)=>(i.openBlock(),i.createBlock(g,{key:`key_usages-badge-tag-${I}`,class:"config-badge","data-testid":`key_usages-badge-tag-${I}`,"truncation-tooltip":A},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(A),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:1},8,["config","config-schema","fetch-url","hide-title"])])}}}),jy="",qh=kr(Kh,[["__scopeId","data-v-c7364467"]]),zh={class:"kong-ui-entities-ca-certificates-list"},Gh={key:0},Wh={key:1},Jh={key:0},Yh={key:1},Zh={key:1},Qh=i.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}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var zt;const t=r,{i18n:{t:n,formatUnixTimeStamp:o},i18nT:s}=rt.useI18n(),c=xr.useRouter(),{axiosInstance:d}=Tn({headers:(zt=t.config)==null?void 0:zt.requestHeaders}),u=i.ref(1),f=i.computed(()=>t.config.app!=="kongManager"||!!t.config.disableSorting),w={issuer:{label:n("ca-certificates.list.table_headers.issuer")},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},T=i.computed(()=>{var ce,F;let H=`${t.config.apiBaseUrl}${ni.list[t.config.app]}`;return t.config.app==="konnect"?H=H.replace(/{controlPlaneId}/gi,((ce=t.config)==null?void 0:ce.controlPlaneId)||""):t.config.app==="kongManager"&&(H=H.replace(/\/{workspace}/gi,(F=t.config)!=null&&F.workspace?`/${t.config.workspace}`:"")),H}),C=i.ref(""),p=i.computed(()=>{const H=t.config.app==="konnect"||t.config.isExactMatch;return H?{isExactMatch:H,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:H,schema:t.config.filterSchema}}),{fetcher:m,fetcherState:y}=Uu(t.config,T.value),b=()=>{C.value=""},k=()=>{u.value++},g=i.ref(""),A=(H,ce)=>{const F=H.id;if(!ce(F)){e("copy:error",{entity:H,field:"id",message:n("ca-certificates.errors.copy")});return}e("copy:success",{entity:H,field:"id",message:n("ca-certificates.copy.success",{val:F})})},I=(H,ce)=>{const F=JSON.stringify(H);if(!ce(F)){e("copy:error",{entity:H,message:n("ca-certificates.errors.copy")});return}e("copy:success",{entity:H,message:n("ca-certificates.copy.success_brief")})},B=async H=>{var F;await((F=t.canRetrieve)==null?void 0:F.call(t,H))&&c.push(t.config.getViewRoute(H.id))},_=H=>({label:n("ca-certificates.actions.view"),to:t.config.getViewRoute(H)}),X=H=>({label:n("ca-certificates.actions.edit"),to:t.config.getEditRoute(H)}),W=i.ref(void 0),V=i.ref(!1),M=i.ref(!1),z=i.ref(""),L=Ru(t.config,T.value),{certificateDataCache:fe,getCertificateData:Ve}=rt.useCertificate(),Be=H=>{W.value=H,V.value=!0},mt=()=>{V.value=!1},Sr=async()=>{var H,ce,F;if((H=W.value)!=null&&H.id){M.value=!0;try{await d.delete(L(W.value.id)),M.value=!1,V.value=!1,u.value++,e("delete:success",W.value)}catch(J){z.value=((F=(ce=J.response)==null?void 0:ce.data)==null?void 0:F.message)||J.message||n("ca-certificates.errors.delete"),e("error",J)}finally{M.value=!1}}};i.watch(y,H=>{if(H.status===xt.Error){g.value=n("ca-certificates.errors.general"),e("error",H.error);return}fe.value={},g.value=""});const At=i.ref({ctaPath:t.config.createRoute,ctaText:void 0,message:n("ca-certificates.list.empty_state.description"),title:n("ca-certificates.title")});return i.onBeforeMount(async()=>{await t.canCreate()&&(At.value.title=n("ca-certificates.list.empty_state.title"),At.value.ctaText=n("ca-certificates.actions.create"))}),(H,ce)=>{const F=i.resolveComponent("KButton"),J=i.resolveComponent("KBadge"),ge=i.resolveComponent("KTruncate"),Re=i.resolveComponent("KDropdownItem"),Cr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",zh,[i.createVNode(i.unref(Pu),{"cache-identifier":r.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":f.value,"empty-state-options":At.value,"enable-entity-actions":"","error-message":g.value,fetcher:i.unref(m),"fetcher-cache-key":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":i.unref(w),onClearSearchInput:b,"onClick:row":ce[2]||(ce[2]=Z=>B(Z)),onSort:k},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref($u),{modelValue:C.value,"onUpdate:modelValue":ce[0]||(ce[0]=Z=>C.value=Z),config:p.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[i.createVNode(i.unref(gt),{"auth-function":()=>r.canCreate()},{default:i.withCtx(()=>[i.createVNode(F,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:r.config.createRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),issuer:i.withCtx(({row:Z})=>{var le;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Gh,i.toDisplayString((le=Z==null?void 0:Z.metadata)!=null&&le.issuer?Z.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",Wh,i.toDisplayString(i.unref(Ve)(Z).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var le;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Jh,i.toDisplayString((le=Z==null?void 0:Z.metadata)!=null&&le.expiry?i.unref(o)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",Yh,i.toDisplayString(i.unref(Ve)(Z).schemaExpiry?i.unref(o)(i.unref(Ve)(Z).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:Z})=>{var le;return[((le=Z==null?void 0:Z.tags)==null?void 0:le.length)>0?(i.openBlock(),i.createBlock(ge,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,q=>(i.openBlock(),i.createBlock(J,{key:q,onClick:ce[1]||(ce[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(q),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Zh,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(Cr,null,{default:i.withCtx(({copyToClipboard:le})=>[i.createVNode(Re,{"data-testid":"action-entity-copy-id",onClick:q=>A(Z,le)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(Cr,null,{default:i.withCtx(({copyToClipboard:le})=>[i.createVNode(Re,{"data-testid":"action-entity-copy-json",onClick:q=>I(Z,le)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(gt),{"auth-function":()=>r.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(Re,{"data-testid":"action-entity-view","has-divider":"",item:_(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(gt),{"auth-function":()=>r.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(Re,{"data-testid":"action-entity-edit",item:X(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(gt),{"auth-function":()=>r.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(Re,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:le=>Be(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),i.createVNode(i.unref(Du),{"action-pending":M.value,"entity-type":i.unref(Js).CACertificate,error:z.value,title:i.unref(n)("ca-certificates.delete.title"),visible:V.value,onCancel:mt,onProceed:Sr},{description:i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Py="",Xh=kr(Qh,[["__scopeId","data-v-d539b808"]]),ey={class:"kong-ui-entities-ca-certificates-form"},ty=i.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 b;const t=r,n=xr.useRouter(),{i18n:{t:o}}=rt.useI18n(),{getMessageFromError:s}=Mu(),{axiosInstance:c}=Tn({headers:(b=t.config)==null?void 0:b.requestHeaders}),d=i.computed(()=>ni.form[t.config.app].edit),u=i.computed(()=>t.certificateId?qt.Edit:qt.Create),f=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),h=i.reactive({cert:"",certDigest:"",tags:""}),w=i.computed(()=>(u.value===qt.Create||JSON.stringify(f.fields)!==JSON.stringify(h))&&!!f.fields.cert),T=k=>{var g;f.fields.cert=(k==null?void 0:k.cert)||"",f.fields.certDigest=(k==null?void 0:k.cert_digest)||"",f.fields.tags=((g=k==null?void 0:k.tags)==null?void 0:g.join(", "))||"",Object.assign(h,f.fields)},C=()=>{n.push(t.config.cancelRoute)},p=i.computed(()=>{var g,A;let k=`${t.config.apiBaseUrl}${ni.form[t.config.app].validate}`;return t.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((g=t.config)==null?void 0:g.controlPlaneId)||""):t.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(A=t.config)!=null&&A.workspace?`/${t.config.workspace}`:"")),k=k.replace(/{id}/gi,t.certificateId),k}),m=i.computed(()=>{var g,A;let k=`${t.config.apiBaseUrl}${ni.form[t.config.app][u.value]}`;return t.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((g=t.config)==null?void 0:g.controlPlaneId)||""):t.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(A=t.config)!=null&&A.workspace?`/${t.config.workspace}`:"")),k=k.replace(/{id}/gi,t.certificateId),k}),y=async()=>{var k,g,A,I,B,_,X;try{f.isReadonly=!0;const W={cert:f.fields.cert,cert_digest:f.fields.certDigest||null,tags:(g=(k=f.fields.tags.split(","))==null?void 0:k.map(M=>String(M||"").trim()))==null?void 0:g.filter(M=>M!=="")};let V;await c.post(p.value,W),u.value==="create"?V=await c.post(m.value,W):u.value==="edit"&&(V=((A=t.config)==null?void 0:A.app)==="konnect"?await c.put(m.value,W):await c.patch(m.value,W)),f.fields.cert=((I=V==null?void 0:V.data)==null?void 0:I.cert)||"",f.fields.certDigest=((B=V==null?void 0:V.data)==null?void 0:B.cert_digest)||"",f.fields.tags=((X=(_=V==null?void 0:V.data)==null?void 0:_.tags)==null?void 0:X.join(", "))||"",Object.assign(h,f.fields),e("update",V==null?void 0:V.data)}catch(W){f.errorMessage=s(W),e("error",W)}finally{f.isReadonly=!1}};return(k,g)=>{const A=i.resolveComponent("KTextArea"),I=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",ey,[i.createVNode(i.unref(ju),{"can-submit":w.value,config:r.config,"edit-id":r.certificateId,"error-message":f.errorMessage,"fetch-url":d.value,"is-readonly":f.isReadonly,onCancel:C,"onFetch:error":g[3]||(g[3]=B=>k.$emit("error",B)),"onFetch:success":T,onLoading:g[4]||(g[4]=B=>k.$emit("loading",B)),onSubmit:y},{default:i.withCtx(()=>[i.createVNode(i.unref(On),{description:i.unref(o)("ca-certificates.form.sections.cert.description"),title:i.unref(o)("ca-certificates.form.sections.cert.title")},{default:i.withCtx(()=>[i.createVNode(A,{modelValue:f.fields.cert,"onUpdate:modelValue":g[0]||(g[0]=B=>f.fields.cert=B),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert","disable-character-limit":"",label:i.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:i.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:f.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),i.createVNode(I,{modelValue:f.fields.certDigest,"onUpdate:modelValue":g[1]||(g[1]=B=>f.fields.certDigest=B),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:i.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:f.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(On),{description:i.unref(o)("ca-certificates.form.sections.general.description"),title:i.unref(o)("ca-certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(I,{modelValue:f.fields.tags,"onUpdate:modelValue":g[2]||(g[2]=B=>f.fields.tags=B),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:i.unref(o)("ca-certificates.form.fields.tags.help"),label:i.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:i.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:f.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),Dy="",ry=kr(ty,[["__scopeId","data-v-a1cf8ed1"]]),iy={class:"kong-ui-certificate-entity-config-card"},ny={key:0},oy=i.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)},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(r,{emit:e}){const t=r,{i18n:{t:n,formatUnixTimeStamp:o},i18nT:s}=rt.useI18n(),{convertKeyToTitle:c}=Lu(),{getCertificateData:d}=rt.useCertificate(),u=i.computed(()=>ii.form[t.config.app].edit),f=i.ref(),h=i.ref({id:{},cert:{section:ae.Basic},key:{section:ae.Basic,type:re.Redacted},metadata:{section:ae.Basic,type:re.Json},snis:{section:ae.Basic,type:re.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...t.config.app==="kongManager"&&{expiry:{section:ae.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:ae.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:ae.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:ae.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:ae.Advanced},key_alt:{section:ae.Advanced,type:re.Redacted}}),w=B=>{f.value=B,e("fetch:success",B)},T=i.computed(()=>{if(f.value)return d(f.value)}),C=i.computed(()=>{var B,_;return(B=T.value)!=null&&B.schemaExpiry?o((_=T.value)==null?void 0:_.schemaExpiry):""}),p=i.computed(()=>{var B;return((B=T.value)==null?void 0:B.schemaIssuer)||""}),m=i.computed(()=>{var B;return((B=T.value)==null?void 0:B.schemaSanNames)||""}),y=i.computed(()=>{var B;return((B=T.value)==null?void 0:B.schemaSubject)||""}),b=i.computed(()=>{var B;return((B=T.value)==null?void 0:B.schemaKeyUsages)||[]}),k=i.computed(()=>{var B,_;return((_=(B=f==null?void 0:f.value)==null?void 0:B.snis)==null?void 0:_.length)>0}),g=i.computed(()=>{var B;return!!((B=f==null?void 0:f.value)!=null&&B.cert_alt)}),A=B=>{var _,X;return B==="san_names"?n("certificates.list.table_headers.san"):((X=(_=h.value)==null?void 0:_[B])==null?void 0:X.label)||c(B)},I=(B,_)=>B==="expiry"?C.value:B==="key_usages"?b.value:B==="san_names"?m.value:_[B];return(B,_)=>{const X=i.resolveComponent("KCodeBlock"),W=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",iy,[i.createVNode(i.unref(Vu),{config:r.config,"config-schema":h.value,"fetch-url":u.value,"hide-title":r.hideTitle,"onCopy:success":_[0]||(_[0]=V=>B.$emit("copy:success",V)),"onFetch:error":_[1]||(_[1]=V=>B.$emit("fetch:error",V)),"onFetch:success":w,onLoading:_[2]||(_[2]=V=>B.$emit("loading",V))},i.createSlots({"cert-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:i.withCtx(({rowValue:V})=>[i.createVNode(X,{id:`certificate-${r.config.entityId}-cert-codeblock`,code:V,"is-single-line":"",language:"plaintext"},null,8,["id","code"])]),"key-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),metadata:i.withCtx(({rowValue:V})=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(V),M=>(i.openBlock(),i.createBlock(i.unref(_n),{key:M,item:{key:M,value:I(M,V),label:A(M),type:M==="key_usages"||M==="snis"||M==="dns_names"?i.unref(re).BadgeTag:i.unref(re).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[b.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ny,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,(V,M)=>(i.openBlock(),i.createBlock(W,{key:`key_usages-badge-tag-${M}`,class:"config-badge","data-testid":`key_usages-badge-tag-${M}`,"truncation-tooltip":V},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(V),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:2},[k.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},g.value?{name:"cert_alt",fn:i.withCtx(({rowValue:V})=>[i.createVNode(X,{id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:V,"is-single-line":"",language:"plaintext"},null,8,["id","code"])]),key:"1"}:void 0]),1032,["config","config-schema","fetch-url","hide-title"])])}}}),$y="",sy=kr(oy,[["__scopeId","data-v-842a59fa"]]);we.CACertificateConfigCard=qh,we.CACertificateForm=ry,we.CACertificateList=Xh,we.CertificateConfigCard=sy,we.CertificateForm=Lh,we.CertificateList=Rh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
117
+ `)}}$e.CertificateTag="CERTIFICATE",$e.CrlTag="CRL",$e.CertificateRequestTag="CERTIFICATE REQUEST",$e.PublicKeyTag="PUBLIC KEY",$e.PrivateKeyTag="PRIVATE KEY";class yt extends St{static isAsnEncoded(e){return P.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if($e.isPem(e))return $e.decode(e)[0];if($.isHex(e))return $.FromHex(e);if($.isBase64(e))return $.FromBase64(e);if($.isBase64Url(e))return $.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const t=$.ToBinary(e);return $e.isPem(t)?$e.decode(t)[0]:$.isHex(t)?$.FromHex(t):$.isBase64(t)?$.FromBase64(t):$.isBase64Url(t)?$.FromBase64Url(t):P.toArrayBuffer(e)}}constructor(...e){yt.isAsnEncoded(e[0])?super(yt.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){switch(e){case"pem":return $e.encode(this.rawData,this.tag);default:return super.toString(e)}}}class Kt extends yt{constructor(e){yt.isAsnEncoded(e)?super(e,dt):super(e),this.tag=$e.PublicKeyTag}async export(...e){let t,n=["verify"],o={hash:"SHA-256",...this.algorithm};return e.length>1?(o=e[0]||o,n=e[1]||n,t=e[2]||De.get()):t=e[0]||De.get(),t.subtle.importKey("spki",this.rawData,o,!0,n)}onInit(e){const t=He.resolve(Cn),n=this.algorithm=t.toWebAlgorithm(e.algorithm);switch(e.algorithm.algorithm){case gr:{const o=U.parse(e.subjectPublicKey,ds),s=P.toUint8Array(o.modulus);n.publicExponent=P.toUint8Array(o.publicExponent),n.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...e){var t;let n,o="SHA-1";return e.length>=1&&!(!((t=e[0])===null||t===void 0)&&t.subtle)?(o=e[0]||o,n=e[1]||De.get()):n=e[0]||De.get(),await n.subtle.digest(o,this.rawData)}async getKeyIdentifier(e){e||(e=De.get());const t=U.parse(this.rawData,dt);return await e.subtle.digest("SHA-1",t.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),t=U.parse(this.rawData,dt);switch(e.Algorithm=Ht.serializeAlgorithm(t.algorithm),t.algorithm.algorithm){case zr:e["EC Point"]=t.subjectPublicKey;break;case gr:default:e["Raw Data"]=t.subjectPublicKey}return e}}class tt{static register(e,t){this.items.set(e,t)}static create(e){const t=new et(e),n=this.items.get(t.type);return n?new n(e):t}}tt.items=new Map;const Bn="crypto.signatureFormatter";class $f{toAsnSignature(e,t){return P.toArrayBuffer(t)}toWebSignature(e,t){return P.toArrayBuffer(t)}}class In extends yt{constructor(e){yt.isAsnEncoded(e)?super(e,ir):super(e),this.tag=$e.CertificateTag}onInit(e){const t=e.tbsCertificate;this.tbs=U.serialize(t),this.serialNumber=$.ToHex(t.serialNumber),this.subjectName=new Ct(t.subject),this.subject=new Ct(t.subject).toString(),this.issuerName=new Ct(t.issuer),this.issuer=this.issuerName.toString();const n=He.resolve(Cn);this.signatureAlgorithm=n.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signatureValue;const o=t.validity.notBefore.utcTime||t.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=t.validity.notAfter.utcTime||t.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],t.extensions&&(this.extensions=t.extensions.map(c=>tt.create(U.serialize(c)))),this.publicKey=new Kt(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=De.get()){let n,o;const s=e.publicKey;try{if(!s)n={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(n,["verify"],t);else if("publicKey"in s)n={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(n,["verify"],t);else if(s instanceof Kt)n={...s.algorithm,...this.signatureAlgorithm},o=await s.export(n,["verify"],t);else if(P.isBufferSource(s)){const f=new Kt(s);n={...f.algorithm,...this.signatureAlgorithm},o=await f.export(n,["verify"],t)}else n={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const c=He.resolveAll(Bn).reverse();let d=null;for(const f of c)if(d=f.toWebSignature(n,this.signature),d)break;if(!d)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const u=await t.subtle.verify(this.signatureAlgorithm,o,d,this.tbs);if(e.signatureOnly)return u;{const h=(e.date||new Date).getTime();return u&&this.notBefore.getTime()<h&&h<this.notAfter.getTime()}}async getThumbprint(...e){let t,n="SHA-1";return e[0]&&(e[0].subtle?t=e[0]:(n=e[0]||n,t=e[1])),t??(t=De.get()),await t.subtle.digest(n,this.rawData)}async isSelfSigned(e=De.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),t=U.parse(this.rawData,ir),n=t.tbsCertificate,o=new se("",{Version:`${rr[n.version]} (${n.version})`,"Serial Number":n.serialNumber,"Signature Algorithm":Ht.serializeAlgorithm(n.signature),Issuer:this.issuer,Validity:new se("",{"Not Before":n.validity.notBefore.getTime(),"Not After":n.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(n.issuerUniqueID&&(o["Issuer Unique ID"]=n.issuerUniqueID),n.subjectUniqueID&&(o["Subject Unique ID"]=n.subjectUniqueID),this.extensions.length){const s=new se("");for(const c of this.extensions){const d=c.toTextObject();s[d[se.NAME]]=d}o.Extensions=s}return e.Data=o,e.Signature=new se("",{Algorithm:Ht.serializeAlgorithm(t.signatureAlgorithm),"":t.signatureValue}),e}}In.NAME="Certificate";class ri extends et{static async create(e,t=!1,n=De.get()){if(e instanceof In||Ft.isCryptoKey(e)){const o=e instanceof In?await e.publicKey.export(n):e,s=await n.subtle.exportKey("spki",o),d=await new Kt(s).getKeyIdentifier(n);return new ri($.ToHex(d),t)}else return new ri(e,t)}constructor(...e){if(P.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const t=new Pt({keyIdentifier:new oo($.FromHex(e[0]))});super(no,e[1],U.serialize(t))}else{const t=e[0],n=t.name instanceof Xr?U.parse(t.name.rawData,Ae):t.name,o=new Pt({authorityCertIssuer:n,authorityCertSerialNumber:$.FromHex(t.serialNumber)});super(no,e[1],U.serialize(o))}}onInit(e){super.onInit(e);const t=U.parse(e.extnValue,Pt);t.keyIdentifier&&(this.keyId=$.ToHex(t.keyIdentifier)),t.authorityCertIssuer&&t.authorityCertSerialNumber&&(this.certId={name:t.authorityCertIssuer,serialNumber:$.ToHex(t.authorityCertSerialNumber)})}toTextObject(){const e=this.toTextObjectWithoutValue(),t=U.parse(this.value,Pt);return t.authorityCertIssuer&&(e["Authority Issuer"]=new Xr(t.authorityCertIssuer).toTextObject()),t.authorityCertSerialNumber&&(e["Authority Serial Number"]=t.authorityCertSerialNumber),t.keyIdentifier&&(e[""]=t.keyIdentifier),e}}ri.NAME="Authority Key Identifier";class lu extends et{constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,Bi);this.ca=t.cA,this.pathLength=t.pathLenConstraint}else{const t=new Bi({cA:e[0],pathLenConstraint:e[1]});super(fc,e[2],U.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}}lu.NAME="Basic Constraints";var uu;(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"})(uu||(uu={}));class du extends et{constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,Oi);this.usages=t.map(n=>n)}else{const t=new Oi(e[0]);super(bc,e[1],U.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(t=>kt.toString(t)).join(", "),e}}du.NAME="Extended Key Usages";var Fs;(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"})(Fs||(Fs={}));class Ks extends et{constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,ko);this.usages=t.toNumber()}else{const t=new ko(e[0]);super(wc,e[1],U.serialize(t)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=U.parse(this.value,ko);return e[""]=t.toJSON().join(", "),e}}Ks.NAME="Key Usages";class En extends et{static async create(e,t=!1,n=De.get()){let o;e instanceof Kt?o=e.rawData:"publicKey"in e?o=e.publicKey.rawData:P.isBufferSource(e)?o=e:o=await n.subtle.exportKey("spki",e);const c=await new Kt(o).getKeyIdentifier(n);return new En($.ToHex(c),t)}constructor(...e){if(P.isBufferSource(e[0])){super(e[0]);const t=U.parse(this.value,vt);this.keyId=$.ToHex(t)}else{const t=typeof e[0]=="string"?$.FromHex(e[0]):e[0],n=new vt(t);super(Bc,e[1],U.serialize(n)),this.keyId=$.ToHex(t)}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=U.parse(this.value,vt);return e[""]=t,e}}En.NAME="Subject Key Identifier";class qs extends et{constructor(...e){P.isBufferSource(e[0])?super(e[0]):super(xc,e[1],new Xr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const t=U.parse(e.extnValue,Bo);this.names=new Xr(t)}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.names.toTextObject();for(const n in t)e[n]=t[n];return e}}qs.NAME="Subject Alternative Name";class fu extends et{constructor(...e){var t;if(P.isBufferSource(e[0])){super(e[0]);const n=U.parse(this.value,Ni);this.policies=n.map(o=>o.policyIdentifier)}else{const n=e[0],o=(t=e[1])!==null&&t!==void 0?t:!1,s=new Ni(n.map(c=>new Ei({policyIdentifier:c})));super(hc,o,U.serialize(s)),this.policies=n}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(t=>new se("",{},kt.toString(t))),e}}fu.NAME="Certificate Policies",tt.register(hc,fu);class wr extends St{constructor(...e){let t;if(P.isBufferSource(e[0]))t=P.toArrayBuffer(e[0]);else{const n=e[0],o=Array.isArray(e[1])?e[1].map(s=>P.toArrayBuffer(s)):[];t=U.serialize(new ut({type:n,values:o}))}super(t,ut)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(t=>new se("",{"":t})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[se.NAME]===wr.NAME&&(e[se.NAME]=kt.toString(this.type)),e}}wr.NAME="Attribute";class pu extends wr{constructor(...e){var t;if(P.isBufferSource(e[0]))super(e[0]);else{const n=new wn({printableString:e[0]});super(ul,[U.serialize(n)])}(t=this.password)!==null&&t!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const t=U.parse(this.values[0],wn);this.password=t.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[se.VALUE]=this.password,e}}pu.NAME="Challenge Password";class zs extends wr{constructor(...e){var t;if(P.isBufferSource(e[0]))super(e[0]);else{const n=e[0],o=new Dt;for(const s of n)o.push(U.parse(s.rawData,Ge));super(Is,[U.serialize(o)])}(t=this.items)!==null&&t!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const t=U.parse(this.values[0],Dt);this.items=t.map(n=>tt.create(U.serialize(n)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),t=this.items.map(n=>n.toTextObject());for(const n of t)e[n[se.NAME]]=n;return e}}zs.NAME="Extensions";class Nn{static register(e,t){this.items.set(e,t)}static create(e){const t=new wr(e),n=this.items.get(t.type);return n?new n(e):t}}Nn.items=new Map;let Gs=class{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 R({algorithm:nn,parameters:null});case"sha-256":return new R({algorithm:as,parameters:null});case"sha-384":return new R({algorithm:on,parameters:null});case"sha-512":return new R({algorithm:sn,parameters:null})}}else return new R({algorithm:gr,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case gr:return{name:"RSASSA-PKCS1-v1_5"};case nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case as:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case on:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case sn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Gs=a([ms()],Gs),He.registerSingleton(Sn,Gs);class Fe{addPadding(e,t){const n=P.toUint8Array(t),o=new Uint8Array(e);return o.set(n,e-n.length),o}removePadding(e,t=!1){let n=P.toUint8Array(e);for(let o=0;o<n.length;o++)if(n[o]){n=n.slice(o);break}if(t&&n[0]>127){const o=new Uint8Array(n.length+1);return o.set(n,1),o.buffer}return n.buffer}toAsnSignature(e,t){if(e.name==="ECDSA"){const n=e.namedCurve,o=Fe.namedCurveSize.get(n)||Fe.defaultNamedCurveSize,s=new rn,c=P.toUint8Array(t);return s.r=this.removePadding(c.slice(0,o),!0),s.s=this.removePadding(c.slice(o,o+o),!0),U.serialize(s)}return null}toWebSignature(e,t){if(e.name==="ECDSA"){const n=U.parse(t,rn),o=e.namedCurve,s=Fe.namedCurveSize.get(o)||Fe.defaultNamedCurveSize,c=this.addPadding(s,this.removePadding(n.r)),d=this.addPadding(s,this.removePadding(n.s));return Qu(c,d)}return null}}Fe.namedCurveSize=new Map,Fe.defaultNamedCurveSize=32;const hu="1.3.101.110",yu="1.3.101.111",gu="1.3.101.112",mu="1.3.101.113";let Ws=class{toAsnAlgorithm(e){let t=null;switch(e.name.toLowerCase()){case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":t=gu;break;case"ed448":t=mu;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":t=hu;break;case"x448":t=yu;break}}return t?new R({algorithm:t}):null}toWebAlgorithm(e){switch(e.algorithm){case gu:return{name:"EdDSA",namedCurve:"Ed25519"};case mu:return{name:"EdDSA",namedCurve:"Ed448"};case hu:return{name:"ECDH-ES",namedCurve:"X25519"};case yu:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ws=a([ms()],Ws),He.registerSingleton(Sn,Ws);class Rf extends yt{constructor(e){yt.isAsnEncoded(e)?super(e,Zr):super(e),this.tag=$e.CertificateRequestTag}onInit(e){this.tbs=U.serialize(e.certificationRequestInfo),this.publicKey=new Kt(e.certificationRequestInfo.subjectPKInfo);const t=He.resolve(Cn);this.signatureAlgorithm=t.toWebAlgorithm(e.signatureAlgorithm),this.signature=e.signature,this.attributes=e.certificationRequestInfo.attributes.map(o=>Nn.create(U.serialize(o)));const n=this.getAttribute(Is);this.extensions=[],n instanceof zs&&(this.extensions=n.items),this.subjectName=new Ct(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=De.get()){const t={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(t,["verify"],e),o=He.resolveAll(Bn).reverse();let s=null;for(const d of o)if(s=d.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,n,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),t=U.parse(this.rawData,Zr),n=t.certificationRequestInfo,o=new se("",{Version:`${rr[n.version]} (${n.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new se("");for(const c of this.attributes){const d=c.toTextObject();s[d[se.NAME]]=d}o.Attributes=s}return e.Data=o,e.Signature=new se("",{Algorithm:Ht.serializeAlgorithm(t.signatureAlgorithm),"":t.signature}),e}}Rf.NAME="PKCS#10 Certificate Request";var bu;(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"})(bu||(bu={})),tt.register(fc,lu),tt.register(bc,du),tt.register(wc,Ks),tt.register(Bc,En),tt.register(no,ri),tt.register(xc,qs),Nn.register(ul,pu),Nn.register(Is,zs),He.registerSingleton(Bn,$f),He.registerSingleton(Bn,Fe),Fe.namedCurveSize.set("P-256",32),Fe.namedCurveSize.set("K-256",32),Fe.namedCurveSize.set("P-384",48),Fe.namedCurveSize.set("P-521",66);function vu(){return{parseMetaCertificateData:e=>{if(/{vault:\/\/.*}/g.test(e))throw new Error("not a X.509 certificate");const t=new In(e),n={subject:t.subjectName.toString(),issuer:t.issuer,notAfter:t.notAfter};for(const o of t.extensions)if(o instanceof qs){const s=o.names.toJSON(),d=Object.entries(s).map(u=>({type:u[1].type,value:u[1].value})).reduce((u,f)=>{const h=f.type,w=u[h]??[];return{...u,[h]:[...w,f.value]}},{});for(const u in d)n.subjectAltName=`${u}=${d[u].join(", ")}`}else if(o instanceof Ks){const s=Object.values(Fs),c=Array(s.length/2).fill(null).reduce((d,u,f)=>{const h=s[s.length/2+f];if(o.usages&h){const w=s[f];d.push(w)}return d},[]);n.keyUsage=c}return n}}}function Mf(){const r=vu(),e=i.ref({}),t=o=>{if(!(o.id in e.value))try{e.value[o.id]=r.parseMetaCertificateData(o.cert)}catch{e.value[o.id]=void 0}return e.value[o.id]};return{certificateDataCache:e,getCertificateData:o=>{const s=t(o);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 Uf={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."}},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"},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."}},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 Lf(){const r=Wt.createI18n("en-us",Uf);return{i18n:r,i18nT:Wt.i18nTComponent(r)}}const rt={useCertificate:Mf,useI18n:Lf,useX509:vu},ii={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}},Hf={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ff="Copy to clipboard",Kf={message:Hf,iconTitle:Ff},qf="kong-ui-copy-uuid-notify",zf={class:"kong-ui-copy-uuid"},Gf=["title"],Wf=["onClick"],wu=15,Jf=i.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:r=>["uuid","hidden","redacted","deleted"].includes(r)}},emits:["success","error"],setup(r,{emit:e}){const t=r,{t:n}=Wt.createI18n("en-us",Kf),o=t.notify||i.inject(qf,()=>{}),s=i.computed(()=>!!(t.tooltip&&t.successTooltip)),c=i.ref(t.tooltip),d=i.computed(()=>t.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),u=i.computed(()=>t.format==="redacted"?"*****":t.format==="deleted"?`*${t.uuid.substring(0,5)}`:t.uuid),f=w=>{c.value=w,setTimeout(()=>{c.value=t.tooltip},1800)},h=w=>{if(!w(t.uuid)){typeof o=="function"&&o({type:"error",message:n("message.fail")}),s.value?f(n("message.fail")):e("error",t.uuid);return}const V=t.uuid.length>wu,C=t.format==="hidden"||t.format==="redacted"?n("message.success.prefix"):`"${t.uuid.substring(0,wu)+(V?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${C}${n("message.success.content")}`}),s.value?f(t.successTooltip):e("success",t.uuid)};return(w,V)=>{const C=i.resolveComponent("KIcon"),p=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",zf,[r.format!=="hidden"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":"copy-id",title:r.uuid},[i.createElementVNode("div",{class:i.normalizeClass(["uuid-container",r.truncated?"truncated-uuid":null,r.useMono?"mono":null])},i.toDisplayString(u.value),3)],8,Gf)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.tooltip?"KTooltip":"div"),i.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:i.withCtx(()=>[i.createVNode(p,null,{default:i.withCtx(({copyToClipboard:m})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(y=>h(m),["stop"])},[i.createVNode(C,{class:"uuid-icon",color:r.iconColor,"hide-title":!!r.tooltip||void 0,icon:"copy",size:"16",title:i.unref(n)("iconTitle")},null,8,["color","hide-title","title"])],8,Wf)]),_:1})]),_:1},16))])}}}),Yf=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Zf=Yf(Jf,[["__scopeId","data-v-e4ea1359"]]);var Js=(r=>(r.GatewayService="service",r.Route="route",r.Consumer="consumer",r.ConsumerGroup="consumer group",r.Plugin="plugin",r.Upstream="upstream",r.Certificate="certificate",r.CACertificate="ca certificate",r.SNI="SNI",r.Key="key",r.KeySet="key set",r.Vault="vault",r.Application="application",r.Developer="developer",r.acls="ACL Credential",r["basic-auth"]="Basic Auth Credential",r["key-auth"]="Key Auth Credential",r["key-auth-enc"]="Key Auth Encrypted Credential",r.oauth2="OAuth 2.0 Credential",r["hmac-auth"]="HMAC Credential",r.jwt="JWT Credential",r.Target="target",r.Policy="policy",r))(Js||{}),qt=(r=>(r.Edit="edit",r.Create="create",r))(qt||{}),xt=(r=>(r[r.Loading=0]="Loading",r[r.Idle=1]="Idle",r[r.NoResults=2]="NoResults",r[r.Error=3]="Error",r))(xt||{}),re=(r=>(r.ID="id",r.IdArray="id-array",r.Text="plain-text",r.Date="date",r.Redacted="redacted",r.RedactedArray="redacted-array",r.Json="json",r.JsonArray="json-array",r.BadgeTag="badge-tag",r.BadgeStatus="badge-status",r.BadgeMethod="badge-method",r.LinkInternal="link-internal",r.LinkExternal="link-external",r))(re||{}),ae=(r=>(r.Basic="basic",r.Advanced="advanced",r.Plugin="plugin",r))(ae||{});function Ys(r={}){return{axiosInstance:zu.create({withCredentials:!0,timeout:3e4,...r})}}function Qf(){return{debounce:(r,e)=>{let t;return(...n)=>{clearTimeout(t),t=window==null?void 0:window.setTimeout(()=>{r(...n)},e)}}}}const Zs="khcp-user-table-preferences",Xf={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ep(){const r=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(n){console.error("useTablePreferences(tryParseJson)",n);return}},e=()=>{const t=r(localStorage.getItem(Zs));return!t||!Object.keys(t).length?new Map:new Map(Object.entries(t))};return{setTablePreferences:(t,n)=>{try{const o=e();o.set(t,n),localStorage.setItem(Zs,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:t=>{const n=e();return(n==null?void 0:n.get(t))||void 0||Xf},deleteAllTablePreferences:()=>{localStorage.removeItem(Zs)}}}const tp={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},rp={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},ip={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},np={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}"}},op={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},sp={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ap={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},cp={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},lp={deleteModal:tp,baseForm:rp,baseTable:ip,baseConfigCard:np,filter:op,debouncedFilter:sp,errors:ap,toggleModal:cp};function Qs(){const r=Wt.createI18n("en-us",lp);return{i18n:r,i18nT:Wt.i18nTComponent(r)}}function up(r,e,t,n={fetchedItemsKey:"data",searchKeys:["id"]}){t||(t="100");const{axiosInstance:o}=Ys({headers:r.requestHeaders}),{i18n:{t:s}}=Qs(),{debounce:c}=Qf(),d=c(async k=>{await b(k)},200),u=i.ref(!1),f=i.ref(""),h=i.ref(""),w=i.ref([]),V=i.ref(void 0),C=i.unref(e);let p=`${r.apiBaseUrl}${C}`;r.app==="konnect"?p=p.replace(/{controlPlaneId}/gi,(r==null?void 0:r.controlPlaneId)||""):r.app==="kongManager"&&(p=p.replace(/\/{workspace}/gi,r!=null&&r.workspace?`/${r.workspace}`:""));const m=async()=>{try{u.value=!0;const{data:k}=await o.get(`${p}?size=${t}`);k!=null&&k.next||(V.value=n.fetchedItemsKey in k?k[n.fetchedItemsKey]:[]),w.value=n.fetchedItemsKey in k?k[n.fetchedItemsKey]:[]}catch{w.value=[],f.value=s("debouncedFilter.errors.fetch")}finally{u.value=!1}},y=i.ref(""),b=async k=>{var g,A;if(y.value!==k)if(y.value=k||"",V.value===void 0)try{u.value=!0,f.value="",h.value="";let B=p+"";k&&(B+=`/${k}`);const{data:E}=await o.get(`${B}?size=${t}`);n.fetchedItemsKey in E?w.value=E[n.fetchedItemsKey]:E!=null&&E.id?w.value=[E]:w.value=[]}catch(B){((g=B==null?void 0:B.response)==null?void 0:g.status)===404?h.value=s("debouncedFilter.errors.invalid"):(w.value=[],f.value=s("debouncedFilter.errors.fetch"))}finally{u.value=!1}else u.value=!0,h.value="",k?(w.value=(A=V.value)==null?void 0:A.filter(B=>{var E;let _=!1;for(const X of n.searchKeys){const W=typeof B[X]=="string"?(E=B[X])==null?void 0:E.toLowerCase():B[X];W!=null&&W.includes(k.toLowerCase())&&(_=!0)}return _}),(!w.value||!w.value.length)&&(h.value=s("debouncedFilter.errors.invalid"))):w.value=V.value,u.value=!1};return{loading:u,error:f,validationError:h,results:w,allRecords:V,loadItems:m,debouncedQueryChange:d}}function dp(r,e){const t=i.unref(e),n=i.computed(()=>r.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${t}`):new URL(t));return n.value.search="",o=>`${n.value.href}/${o}`}function fp(){const{i18n:{t:r}}=Qs();return{getMessageFromError:e=>{var t,n,o;if(!e)return r("errors.unexpected");if((t=e==null?void 0:e.response)!=null&&t.data){if(e.response.data.detail)return e.response.data.detail;if((n=e.response.data.details)!=null&&n.length)return e.response.data.details.map(s=>{let c=r("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(c=s.messages.join(", ")),s.field?`${s.field} - ${c}`:c}).join("; ");if(e.response.data.message){const{message:s}=e.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof e.response.data=="string")return e.response.data;if(typeof e.response.data=="object")return Object.keys(e.response.data).map(s=>`${s} ${e.response.data[s]}`).join(", ")}return e.message||r("errors.unexpected")}}}function ku(r,e){const t=i.ref(i.unref(r)),n=i.ref(i.unref(e)),o=i.computed(()=>!!(t.value.app==="konnect"||t.value.isExactMatch)),s=i.computed(()=>n.value.startsWith("/")?new URL(`${window.location.origin}${n.value}`):new URL(n.value));return c=>{const{page:d,pageSize:u,offset:f,sortColumnKey:h,sortColumnOrder:w,query:V}=c;try{let C=new URL(s.value.href);return o.value&&V?(C.search="",C=new URL(`${C.href}/${V}/`)):(o.value||new URLSearchParams(V).forEach((p,m)=>{C.searchParams.append(m,p)}),h&&C.searchParams.append("sort_by",h),w==="desc"&&C.searchParams.append("sort_desc","1"),C.searchParams.append("size",String(u))),f&&d!==1&&C.searchParams.append("offset",String(f)),C.href}catch(C){return console.error("RouteList(fetcher)",C),n.value}}}function pp(r,e,t="data"){const n=i.unref(e),{axiosInstance:o}=Ys({headers:r.requestHeaders}),s=ku(r,n),c=i.ref({status:xt.Idle});return{fetcher:async d=>{try{c.value={status:xt.Loading};const u=s(d),{data:f}=await o.get(u),h=t&&t.replace(/[^\w-_]/gi,"");let w;f[h]&&Array.isArray(f[h])?w=f[h]:w=Object.keys(f).length?[f]:[];const V={data:w,total:w.length,...f.offset?{pagination:{offset:f.offset}}:null};return c.value={status:xt.Idle,response:V},V}catch(u){const f={data:[],total:0};return d.query&&u.response.status===404?(c.value={status:xt.NoResults,response:f,error:u},f):(c.value={status:xt.Error,response:f,error:u},f)}},fetcherState:c}}function hp(){return{convertKeyToTitle:(r,e="_")=>r?r.split(e).map(t=>t.toLowerCase()==="id"?t.toUpperCase():t.charAt(0).toUpperCase()+t.substring(1)).join(" "):""}}const Su=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Cu=r=>{if(typeof r!="string")throw new TypeError("Invalid argument expected string");const e=r.match(Su);if(!e)throw new Error(`Invalid argument not valid semver ('${r}' received)`);return e.shift(),e},xu=r=>r==="*"||r==="x"||r==="X",Au=r=>{const e=parseInt(r,10);return isNaN(e)?r:e},yp=(r,e)=>typeof r!=typeof e?[String(r),String(e)]:[r,e],gp=(r,e)=>{if(xu(r)||xu(e))return 0;const[t,n]=yp(Au(r),Au(e));return t>n?1:t<n?-1:0},Bu=(r,e)=>{for(let t=0;t<Math.max(r.length,e.length);t++){const n=gp(r[t]||"0",e[t]||"0");if(n!==0)return n}return 0},mp=(r,e)=>{const t=Cu(r),n=Cu(e),o=t.pop(),s=n.pop(),c=Bu(t,n);return c!==0?c:o&&s?Bu(o.split("."),s.split(".")):o||s?o?-1:1:0},Iu=(r,e,t)=>{bp(t);const n=mp(r,e);return Eu[t].includes(n)},Eu={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Nu=Object.keys(Eu),bp=r=>{if(typeof r!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof r}`);if(Nu.indexOf(r)===-1)throw new Error(`Invalid operator, expected one of ${Nu.join("|")}`)},vp=r=>typeof r=="string"&&/^[v\d]/.test(r)&&Su.test(r);function wp(r){const{gatewayInfo:e,supportedRange:t}=r;if(!e)return!0;const{edition:n,version:o}=e;if(!vp(o))return console.error("Invalid version"),!1;const s=t[n];if(!s)return!1;const[c,d]=s;return!(c&&Iu(o,c,"<")||d&&Iu(o,d,">"))}const Ce={useAxios:Ys,useDebouncedFilter:up,useDeleteUrlBuilder:dp,useErrors:fp,useFetcher:pp,useFetchUrlBuilder:ku,useStringHelpers:hp,useI18n:Qs,useGatewayFeatureSupported:wp},kp={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Sp="Copy to clipboard",Cp={message:kp,iconTitle:Sp},xp="kong-ui-copy-uuid-notify",Ap={class:"kong-ui-copy-uuid"},Bp=["title"],Ip=["onClick"],_u=15,Ep=i.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:r=>["uuid","hidden","redacted","deleted"].includes(r)}},emits:["success","error"],setup(r,{emit:e}){const t=r,{t:n}=Wt.createI18n("en-us",Cp),o=t.notify||i.inject(xp,()=>{}),s=i.computed(()=>!!(t.tooltip&&t.successTooltip)),c=i.ref(t.tooltip),d=i.computed(()=>t.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),u=i.computed(()=>t.format==="redacted"?"*****":t.format==="deleted"?`*${t.uuid.substring(0,5)}`:t.uuid),f=w=>{c.value=w,setTimeout(()=>{c.value=t.tooltip},1800)},h=w=>{if(!w(t.uuid)){typeof o=="function"&&o({type:"error",message:n("message.fail")}),s.value?f(n("message.fail")):e("error",t.uuid);return}const V=t.uuid.length>_u,C=t.format==="hidden"||t.format==="redacted"?n("message.success.prefix"):`"${t.uuid.substring(0,_u)+(V?"...":"")}"`;typeof o=="function"&&o({type:"success",message:`${C}${n("message.success.content")}`}),s.value?f(t.successTooltip):e("success",t.uuid)};return(w,V)=>{const C=i.resolveComponent("KIcon"),p=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Ap,[r.format!=="hidden"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":"copy-id",title:r.uuid},[i.createElementVNode("div",{class:i.normalizeClass(["uuid-container",r.truncated?"truncated-uuid":null,r.useMono?"mono":null])},i.toDisplayString(u.value),3)],8,Bp)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.tooltip?"KTooltip":"div"),i.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:i.withCtx(()=>[i.createVNode(p,null,{default:i.withCtx(({copyToClipboard:m})=>[i.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:i.withModifiers(y=>h(m),["stop"])},[i.createVNode(C,{class:"uuid-icon",color:r.iconColor,"hide-title":!!r.tooltip||void 0,icon:"copy",size:"16",title:i.unref(n)("iconTitle")},null,8,["color","hide-title","title"])],8,Ip)]),_:1})]),_:1},16))])}}}),Np=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Ou=Np(Ep,[["__scopeId","data-v-e4ea1359"]]),_p={key:0,class:"config-card-fieldset-title"},Op=i.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(r){const e=r,{i18n:{t}}=Ce.useI18n(),{convertKeyToTitle:n}=Ce.useStringHelpers(),o=i.computed(()=>e.item.key??"json-array-item"),s=i.computed(()=>e.item.value??e.item),c=i.computed(()=>{const u=JSON.parse(JSON.stringify(s.value));return e.isArrayItem&&delete u.name,u}),d=i.computed(()=>{var u;return e.isArrayItem?(u=s.value)!=null&&u.name?n(s.value.name,"_"):t("baseConfigCard.general.entryTitle",{index:e.index}):""});return(u,f)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.isArrayItem?"fieldset":"div"),{class:i.normalizeClass(r.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:i.withCtx(()=>[r.isArrayItem?(i.openBlock(),i.createElementBlock("legend",_p,[i.createElementVNode("b",null,i.toDisplayString(d.value),1)])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(c.value),(h,w)=>(i.openBlock(),i.createBlock(_n,{key:`${o.value}-property-${w}`,item:{key:h,label:i.unref(n)(h),value:c.value[h]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),it=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Vu=it(Op,[["__scopeId","data-v-68ca83ec"]]),Vp=it(i.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(r){const{i18n:{t:e}}=Ce.useI18n();return(t,n)=>{const o=i.resolveComponent("KButton");return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(o,{appearance:"btn-link",class:"navigation-button",onClick:n[0]||(n[0]=s=>t.$emit("navigation-click",r.item))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.item.value||i.unref(e)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),[["__scopeId","data-v-7410504d"]]),Tp=i.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(r){const{i18n:{t:e}}=Ce.useI18n();return(t,n)=>{const o=i.resolveComponent("KBadge");return i.openBlock(),i.createBlock(o,{appearance:r.status?"success":"neutral"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.status?i.unref(e)("baseConfigCard.statusBadge.enabledLabel"):i.unref(e)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),jp="#0044f4",Pp="#e0e4ea",Dp="#3a3f51",$p="1px",Rp={class:"config-card-details-row"},Mp=["data-testid"],Up=["data-testid"],Lp=["data-testid"],Hp=["data-testid"],Fp={key:1},Kp=["data-testid"],qp=["data-testid"],zp=["data-testid"],Gp=["data-testid"],Wp=["title"],Jp={name:"ConfigCardItem",components:{CopyUuid:Ou,JsonCardItem:Vu,StatusBadge:Tp,InternalLinkItem:Vp}},Yp=i.defineComponent({...Jp,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(r,{emit:e}){const t=r;i.useCssVars(w=>({"2c6ac268":f.value?"none":`solid ${i.unref($p)} ${i.unref(Pp)}`,c7a65802:u.value&&c.value?"block":"flex","778426fe":u.value&&c.value?"100%":t.slim?"50%":"25%","777f9b48":u.value&&c.value?"100%":t.slim?"50%":"75%"}));const n=i.useSlots(),{i18n:{t:o,formatUnixTimeStamp:s}}=Ce.useI18n(),c=i.computed(()=>t.item.value!==void 0&&t.item.value!==null&&t.item.value!==""),d=i.computed(()=>!!(t.item.tooltip||n["label-tooltip"])),u=i.computed(()=>t.item.type===re.Json||t.item.type===re.JsonArray),f=i.computed(()=>t.item.type===re.JsonArray),h=i.computed(()=>{switch(t.item.type){case re.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${t.item.key}-copy-uuid`,"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,uuid:t.item.value,notify:()=>{}}};case re.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,notify:()=>{}}};case re.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${t.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,uuid:t.item.value,notify:()=>{}}};case re.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":o("baseConfigCard.copy.success"),tooltip:o("baseConfigCard.copy.tooltip",{label:t.item.label}),truncated:!1,notify:()=>{}}};case re.Date:return{tag:"div",attrs:{"data-testid":`${t.item.key}-date`},text:s(t.item.value)};case re.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${t.item.key}-badge-status`,status:t.item.value}};case re.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case re.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case re.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${t.item.key}-internal-link`,item:t.item,onNavigationClick:w=>{e("navigation-click",w)}}};case re.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${t.item.key}-external-link`,href:t.item.value},text:t.item.value};case re.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${t.item.key}-json-content`,item:t.item}};case re.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${t.item.key}-json-array-content`,item:t.item}};default:return{tag:"div",attrs:{"data-testid":`${t.item.key}-plain-text`},text:t.item.value}}});return(w,V)=>{const C=i.resolveComponent("KLabel"),p=i.resolveComponent("KBadge"),m=i.resolveComponent("KMethodBadge");return i.openBlock(),i.createElementBlock("div",Rp,[i.createElementVNode("div",{class:"config-card-details-label","data-testid":`${r.item.key}-label`},[i.renderSlot(w.$slots,"label",{item:r.item},()=>[i.createVNode(C,{"tooltip-attributes":{maxWidth:"500px"}},i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.item.label)+" ",1)]),_:2},[d.value?{name:"tooltip",fn:i.withCtx(()=>[i.createElementVNode("div",{"data-testid":`${r.item.key}-label-tooltip`},[i.renderSlot(w.$slots,"label-tooltip",{},()=>[i.createTextVNode(i.toDisplayString(r.item.tooltip),1)],!0)],8,Up)]),key:"0"}:void 0]),1024)],!0)],8,Mp),i.createElementVNode("div",{class:"config-card-details-value","data-testid":`${r.item.key}-property-value`},[i.renderSlot(w.$slots,r.item.key,{rowValue:r.item.value},()=>[c.value?(i.openBlock(),i.createElementBlock("div",Fp,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(h.value.tag),i.normalizeProps(i.guardReactiveProps(h.value.attrs)),{default:i.withCtx(()=>[h.value.additionalComponent==="KBadge"?(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${r.item.key}-badge-tags`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(p,{key:`${r.item.key}-badge-tag-${b}`,class:"config-badge","data-testid":`${r.item.key}-badge-tag-${b}`,"truncation-tooltip":y},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))],8,Kp)):i.createCommentVNode("",!0),h.value.additionalComponent==="CopyUuid"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${r.item.key}-copy-uuid-array`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(i.unref(Ou),i.mergeProps(h.value.childAttrs,{key:`${r.item.key}-copy-uuid-${b}`,"data-testid":`${r.item.key}-copy-uuid-${b}`,uuid:y}),null,16,["data-testid","uuid"]))),128))],8,qp)):h.value.additionalComponent==="KMethodBadge"?(i.openBlock(),i.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${r.item.key}-badge-methods`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(m,{key:`${r.item.key}-badge-method-${b}`,class:"config-badge","data-testid":`${r.item.key}-badge-method-${b}`,"is-rounded":"",label:y,method:i.unref(Gu.MethodsArray).includes(y.toLowerCase())?y.toLowerCase():"custom"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y),1)]),_:2},1032,["data-testid","label","method"]))),128))],8,zp)):i.createCommentVNode("",!0),h.value.additionalComponent==="JsonCardItem"?(i.openBlock(),i.createElementBlock("div",{key:3,"data-testid":`${t.item.key}-json-array-content`},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.item.value,(y,b)=>(i.openBlock(),i.createBlock(Vu,{key:`json-array-item-${b}`,index:b,"is-array-item":"",item:y},null,8,["index","item"]))),128))],8,Gp)):(i.openBlock(),i.createElementBlock("span",{key:4,class:i.normalizeClass(["attrs-data-text",{truncated:r.truncated}]),title:r.truncated?r.item.value:void 0},i.toDisplayString(h.value.text),11,Wp))]),_:1},16))])):(i.openBlock(),i.createElementBlock("div",{key:0,"data-testid":`${r.item.key}-no-value`}," – ",8,Hp))],!0)],8,Lp)])}}}),_n=it(Yp,[["__scopeId","data-v-a3c5ab01"]]),Zp={"data-testid":"config-card-title"},Qp={class:"config-card-actions"},Xp={class:"config-card-details-section"},eh=["data-testid"],th={key:0,class:"config-card-prop-section-title"},Tu=it(i.defineComponent({__name:"EntityBaseConfigCard",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)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(r,{emit:e}){var t;const n=r,o=i.useSlots(),{i18n:{t:s}}=Ce.useI18n(),{getMessageFromError:c}=Ce.useErrors(),{convertKeyToTitle:d}=Ce.useStringHelpers(),{axiosInstance:u}=Ce.useAxios({headers:(t=n.config)==null?void 0:t.requestHeaders}),f={id:{type:re.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:ae.Basic},name:{order:1,section:ae.Basic},enabled:{type:re.BadgeStatus,order:2,section:ae.Basic},updated_at:{type:re.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:ae.Basic},created_at:{type:re.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:ae.Basic},tags:{type:re.BadgeTag,order:-1,section:ae.Basic}},h=i.ref(!1),w=i.ref(!1),V=i.ref(""),C=i.ref(),p=i.computed(()=>{var B,E,_;if(!C.value)return[];const X=[],W=Object.keys(C.value).length;for(const T in C.value){const M=(E=(B=n.configSchema)==null?void 0:B[T])==null?void 0:E.order,z=(_=f[T])==null?void 0:_.order;let L=W;(z||z===0)&&(L=z===-1?W+1:z),M&&(L=M===-1?W+1:M),X.push([T,L])}return X.sort(function(T,M){return T[1]-M[1]}),X.map(T=>{var M,z;const L=T[0],fe=(M=C.value)==null?void 0:M[L],Te=((z=n.configSchema)==null?void 0:z[L])||{},Be=f[L];return{key:L,value:fe,hidden:Te.hidden||!1,type:Te.type??((Be==null?void 0:Be.type)||re.Text),label:Te.label??((Be==null?void 0:Be.label)||d(L)),tooltip:Te.tooltip??((Be==null?void 0:Be.tooltip)||void 0),section:Te.section??((Be==null?void 0:Be.section)||ae.Advanced)}}).filter(T=>!T.hidden&&T.key!==n.pluginConfigKey)}),m=i.computed(()=>{var B,E;if(!C.value||!n.pluginConfigKey)return[];const _=C.value[n.pluginConfigKey]||{},X=Object.keys(_).length,W=[];for(const T in _){const M=(E=(B=n.pluginConfigSchema)==null?void 0:B[T])==null?void 0:E.order,z=_[T];let L=z!=null&&z!==""?X-1:X;M&&(L=M===-1?X+1:M),W.push([T,L])}return W.sort(function(T,M){return T[1]-M[1]}),W.map(T=>{var M;const z=T[0],L=_[z],fe=((M=n.pluginConfigSchema)==null?void 0:M[z])||{};return{key:z,value:L,hidden:fe.hidden||!1,type:fe.type??re.Text,label:fe.label??d(z),tooltip:fe.tooltip??void 0,section:ae.Plugin}}).filter(T=>!T.hidden)}),y=i.computed(()=>{var B,E,_,X;return{basic:(B=p.value)==null?void 0:B.filter(W=>W.section===ae.Basic),advanced:(E=p.value)==null?void 0:E.filter(W=>W.section===ae.Advanced),plugin:(X=m.value)==null?void 0:X.concat((_=p.value)==null?void 0:_.filter(W=>W.section===ae.Plugin))}}),b=i.computed(()=>{const B=[];return y.value.basic.length&&B.push("basic"),y.value.advanced.length&&B.push("advanced"),y.value.plugin.length&&B.push("plugin"),B}),k=B=>!!(B.tooltip||o[`${B.key}-label-tooltip`]),g=i.computed(()=>{var B,E;let _=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((B=n.config)==null?void 0:B.controlPlaneId)||""):n.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(E=n.config)!=null&&E.workspace?`/${n.config.workspace}`:"")),_=_.replace(/{id}/gi,n.config.entityId),_}),A=B=>{C.value&&B(JSON.stringify(C.value))?e("copy:success",C.value):e("copy:error")};return i.watch(h,B=>{e("loading",B)},{immediate:!0}),i.onBeforeMount(async()=>{w.value=!1,h.value=!0;try{const{data:B}=await u.get(g.value);if(n.dataKey)if(typeof B[n.dataKey]<"u")C.value={...B[n.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:n.dataKey}));else C.value={...B};Object.keys(n.configSchema).filter(E=>n.configSchema[E].forceShow).forEach(E=>{C.value&&typeof C.value[E]>"u"&&(C.value[E]=null)}),e("fetch:success",B)}catch(B){const E=c(B);V.value=E.startsWith("code")?s("baseConfigCard.errors.load"):E,w.value=!0,e("fetch:error",B)}finally{h.value=!1}}),(B,E)=>{const _=i.resolveComponent("KButton"),X=i.resolveComponent("KClipboardProvider"),W=i.resolveComponent("KSkeleton"),T=i.resolveComponent("KEmptyState"),M=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(M,{"border-variant":"noBorder",class:"kong-ui-entity-base-config-card"},i.createSlots({actions:i.withCtx(()=>[i.createElementVNode("div",Qp,[i.renderSlot(B.$slots,"actions",{},void 0,!0),i.createVNode(X,null,{default:i.withCtx(({copyToClipboard:z})=>[!h.value&&!w.value?(i.openBlock(),i.createBlock(_,{key:0,appearance:"btn-link","data-testid":"json-copy-button",onClick:L=>A(z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]),_:1})])]),body:i.withCtx(()=>[h.value?(i.openBlock(),i.createBlock(W,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):w.value?(i.openBlock(),i.createBlock(T,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(V.value),1)]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Xp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,z=>(i.openBlock(),i.createElementBlock("div",{key:`config-card-details-${z}-props`,class:i.normalizeClass(`config-card-details-${z}-props`),"data-testid":`config-card-details-${z}-props`},[z!=="basic"?(i.openBlock(),i.createElementBlock("div",th,i.toDisplayString(z==="advanced"?i.unref(s)("baseConfigCard.sections.advanced"):i.unref(s)("baseConfigCard.sections.plugin")),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.value[z],L=>(i.openBlock(),i.createBlock(_n,{key:L.key,item:L},i.createSlots({label:i.withCtx(()=>[i.renderSlot(B.$slots,`${L.key}-label`,{row:L},void 0,!0)]),[L.key]:i.withCtx(({rowValue:fe})=>[i.renderSlot(B.$slots,L.key,{row:L,rowValue:fe},void 0,!0)]),_:2},[k(L)?{name:"label-tooltip",fn:i.withCtx(()=>[i.renderSlot(B.$slots,`${L.key}-label-tooltip`,{row:L},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,eh))),128))])]),_:2},[r.hideTitle?void 0:{name:"title",fn:i.withCtx(()=>[i.createElementVNode("div",Zp,[i.renderSlot(B.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-b72bbdde"]]),rh=["onReset","onSubmit"],ih={class:"form-actions","data-testid":"form-actions"},ju=it(i.defineComponent({__name:"EntityBaseForm",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")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(r,{emit:e}){var t;const n=r,o=xr.useRouter(),{i18n:{t:s}}=Ce.useI18n(),{getMessageFromError:c}=Ce.useErrors(),{axiosInstance:d}=Ce.useAxios({headers:(t=n.config)==null?void 0:t.requestHeaders}),u=i.ref(!1),f=i.ref(!1),h=i.ref(""),w=i.computed(()=>n.canSubmit===!1||n.isReadonly),V=i.computed(()=>{var y,b;if(!n.editId)return"";let k=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((y=n.config)==null?void 0:y.controlPlaneId)||""):n.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(b=n.config)!=null&&b.workspace?`/${n.config.workspace}`:"")),k=k.replace(/{id}/gi,n.editId),k}),C=()=>{n.config.cancelRoute?o.push(n.config.cancelRoute):p()},p=()=>{e("cancel")},m=()=>{w.value||e("submit")};return i.watch(()=>u.value,y=>{e("loading",y)},{immediate:!0}),i.onBeforeMount(async()=>{if(n.editId)try{f.value=!1,u.value=!0;const{data:y}=await d.get(V.value);e("fetch:success",y)}catch(y){const b=c(y);h.value=b.startsWith("code")?s("baseForm.errors.edit"):b,f.value=!0,e("fetch:error",y)}finally{u.value=!1}}),(y,b)=>{const k=i.resolveComponent("KSkeleton"),g=i.resolveComponent("KEmptyState"),A=i.resolveComponent("KAlert"),B=i.resolveComponent("KButton"),E=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(E,{class:"kong-ui-entity-base-form"},{body:i.withCtx(()=>[u.value?(i.openBlock(),i.createBlock(k,{key:0,type:"form"})):f.value?(i.openBlock(),i.createBlock(g,{key:1,"cta-text":i.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:i.withCtx(()=>[i.createElementVNode("h3",null,i.toDisplayString(h.value),1)]),_:1},8,["cta-text"])):(i.openBlock(),i.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:i.withModifiers(p,["prevent"]),onSubmit:i.withModifiers(m,["prevent"])},[i.renderSlot(y.$slots,"default",{},void 0,!0),r.errorMessage?(i.openBlock(),i.createBlock(A,{key:0,"alert-message":r.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):i.createCommentVNode("",!0),i.createElementVNode("div",ih,[i.renderSlot(y.$slots,"form-actions",{},()=>[i.createVNode(B,{appearance:"outline","data-testid":"form-cancel",disabled:r.isReadonly,type:"reset"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),i.createVNode(B,{appearance:"primary","data-testid":"form-submit",disabled:w.value,type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,rh))]),_:3})}}}),[["__scopeId","data-v-2286e5f2"]]),nh={key:0},oh=it(i.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(r){const e=r,t=i.computed(()=>{var m;return((m=e.rowEl)==null?void 0:m.querySelector(`[data-testid="${e.keyName}"]`))||null}),n=i.computed(()=>{var m;return((m=t.value)==null?void 0:m.querySelector('[role="button"]'))||null}),o=i.computed(()=>{var m,y;const b=(m=e.rowEl)==null?void 0:m.querySelectorAll("td");return b?((y=b[0])==null?void 0:y.getAttribute("data-testid"))===e.keyName:!1});let s;const c=()=>{s&&(s.disconnect(),s=void 0)},d=()=>{var m,y,b;f.value=((m=n.value)==null?void 0:m.getBoundingClientRect().width)||0,h.value=((y=t.value)==null?void 0:y.clientWidth)||0,w.value=((b=u.value)==null?void 0:b.innerText)||""},u=i.ref({}),f=i.ref(0),h=i.ref(0),w=i.ref(""),V=i.computed(()=>[n.value,t.value]),C=i.watch(V,m=>{if(o.value&&(c(),"ResizeObserver"in window&&window)){s=new ResizeObserver(y=>{window.requestAnimationFrame(()=>{!Array.isArray(y)||!y.length||d()})});for(const y of m)y&&s.observe(y)}},{immediate:!0,flush:"post",deep:!0}),p=i.computed(()=>o.value?f.value>h.value:!1);return i.onMounted(()=>{d()}),i.onUnmounted(()=>{C()}),(m,y)=>{const b=i.resolveComponent("KTooltip");return i.openBlock(),i.createElementBlock("span",{ref_key:"contentRef",ref:u,class:"content-wrapper"},[o.value?(i.openBlock(),i.createElementBlock("span",nh,[i.createVNode(b,{disabled:!p.value,label:w.value,"max-width":"300",placement:"bottomStart"},{default:i.withCtx(()=>[i.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["disabled","label"])])):i.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-f8a220e9"]]),sh={class:"toolbar-container"},ah={key:0,class:"toolbar-button-container"},ch=["data-testid"],Pu=it(i.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(r,{emit:e}){const t=r,{i18n:{t:n}}=Ce.useI18n(),o=i.computed(()=>t.cacheIdentifier||t.preferencesStorageKey),s=g=>g.hasData||!!t.query,c=i.computed(()=>{const g=[];return Object.keys(t.tableHeaders).forEach(A=>{const B=t.tableHeaders[A];g.push({label:B.label??A,key:A,sortable:B.sortable??!1})}),t.enableEntityActions&&g.push({key:"actions",hideLabel:!0}),g}),d=g=>({"data-rowid":g.id,"data-testid":g.name,...t.rowAttributes(g)}),u=i.ref({}),f=g=>{var A;return(A=u.value)==null?void 0:A.$el.querySelector(`[data-rowid="${g.id}"]`)},h=g=>{const A={"data-testid":g.headerKey,...t.cellAttributes(g)};return g.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},w=()=>{e("empty-state-cta-clicked"),V()},V=()=>{e("clear-search-input")},C=(g,A)=>{e("click:row",A)},p=g=>{e("sort",g)},{setTablePreferences:m,getTablePreferences:y}=ep(),b=i.computed(()=>{const g=y(t.preferencesStorageKey);return{...t.initialFetcherParams,...g}}),k=g=>{t.preferencesStorageKey&&m(t.preferencesStorageKey,g)};return(g,A)=>{const B=i.resolveComponent("KIcon"),E=i.resolveComponent("KButton"),_=i.resolveComponent("KDropdownMenu"),X=i.resolveComponent("KTable"),W=i.resolveComponent("KCard");return i.openBlock(),i.createBlock(W,{class:"kong-ui-entity-base-table",title:r.title},{body:i.withCtx(()=>[i.createVNode(X,{ref_key:"tableRefs",ref:u,"cache-identifier":o.value,"cell-attrs":h,"disable-pagination-page-jump":r.disablePaginationPageJump,"disable-sorting":r.disableSorting,"empty-state-action-button-icon":r.query?"":"plus","empty-state-action-message":r.query?i.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):r.emptyStateOptions.ctaText,"empty-state-action-route":r.query?"":r.emptyStateOptions.ctaPath,"empty-state-icon":r.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":r.query?i.unref(n)("baseTable.emptyState.noSearchResultsMessage"):r.emptyStateOptions.message,"empty-state-title":r.query?i.unref(n)("baseTable.emptyState.noSearchResultsTitle"):r.emptyStateOptions.title,"enable-client-sort":r.enableClientSort,"error-state-title":r.errorMessage,fetcher:r.fetcher,"fetcher-cache-key":String(r.fetcherCacheKey),"has-error":!!r.errorMessage,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":b.value,"is-loading":r.isLoading,"pagination-type":r.paginationType,"row-attrs":d,"search-input":r.query,onKtableEmptyStateCtaClicked:w,"onRow:click":C,onSort:A[0]||(A[0]=T=>p(T)),"onUpdate:tablePreferences":k},i.createSlots({toolbar:i.withCtx(({state:T})=>[i.withDirectives(i.createElementVNode("div",sh,[i.renderSlot(g.$slots,"toolbar-filter",{},void 0,!0),g.$slots["toolbar-button"]?(i.openBlock(),i.createElementBlock("div",ah,[i.renderSlot(g.$slots,"toolbar-button",{},void 0,!0)])):i.createCommentVNode("",!0)],512),[[i.vShow,s(T)]])]),actions:i.withCtx(({row:T,rowKey:M,rowValue:z})=>[i.createElementVNode("div",{class:"actions-container","data-testid":T.name},[i.createVNode(_,{"kpop-attributes":{placement:"bottomEnd"},width:r.dropdownMenuWidth},{items:i.withCtx(()=>[i.renderSlot(g.$slots,"actions",{row:T,rowKey:M,rowValue:z},void 0,!0)]),default:i.withCtx(()=>[i.createVNode(E,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:i.withCtx(()=>[i.createVNode(B,{color:i.unref(Dp),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,ch)]),_:2},[i.renderList(r.tableHeaders,(T,M)=>({name:M,fn:i.withCtx(({row:z,rowKey:L,rowValue:fe})=>[i.createVNode(oh,{"key-name":String(M),"row-el":f(z)},{default:i.withCtx(()=>[i.renderSlot(g.$slots,M,{row:z,rowKey:L,rowValue:fe},()=>[i.createTextVNode(i.toDisplayString(fe),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-a598b1d9"]]),lh={key:0,class:"kong-ui-entity-delete-error"},uh={key:1,class:"description"},Du=it(i.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(r,{emit:e}){const t=r,{i18nT:n}=Ce.useI18n(),o=i.computed(()=>t.needConfirm?t.entityName:""),s=()=>{e("cancel")},c=()=>{e("proceed")};return(d,u)=>{const f=i.resolveComponent("KAlert"),h=i.resolveComponent("KPrompt");return i.openBlock(),i.createBlock(h,{"action-button-text":"Yes, delete","action-pending":r.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":r.visible,title:r.title,type:"danger",onCanceled:s,onProceed:c},{"body-content":i.withCtx(()=>[r.error?(i.openBlock(),i.createElementBlock("div",lh,[i.createVNode(f,{appearance:"danger"},{alertMessage:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.error),1)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(i.unref(n),{class:"message",keypath:t.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},i.createSlots({entityType:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.entityType),1)]),_:2},[t.entityName?{name:"entityName",fn:i.withCtx(()=>[i.createElementVNode("strong",null,i.toDisplayString(t.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),t.description||d.$slots.description?(i.openBlock(),i.createElementBlock("div",uh,[i.renderSlot(d.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(t.description),1)],!0)])):i.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),dh={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},fh={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},ph=["fill"],hh={mask:"url(#mask0_180_20349)"},yh=["fill"],gh=i.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${jp})`}},setup(r){return(e,t)=>(i.openBlock(),i.createElementBlock("svg",dh,[i.createElementVNode("mask",fh,[i.createElementVNode("rect",{fill:r.color,height:"20",width:"20"},null,8,ph)]),i.createElementVNode("g",hh,[i.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:r.color},null,8,yh)])]))}}),mh={key:1,class:"kong-ui-entity-filter"},bh={class:"menu-item-title"},vh={class:"menu-item-indicator"},wh={class:"menu-item-body"},kh=["for"],Sh={class:"menu-item-buttons"},$u=it(i.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,{i18n:{t:n}}=Ce.useI18n(),o=i.ref(!1),s=i.ref({}),c=i.computed(()=>{const y=[];return new URLSearchParams(t.modelValue).forEach((b,k)=>{b!==""&&y.push(k)}),y}),d=i.computed(()=>{const y=t.config.fields;return Object.keys(y).filter(b=>y[b].searchable).map(b=>({label:y[b].label||b,value:b}))});i.watch(()=>t.modelValue,y=>{s.value={},new URLSearchParams(y).forEach((b,k)=>{s.value[k]=b})});const u=()=>{o.value=!o.value},f=y=>{e("update:modelValue",y)},h=y=>`filter-${y}`,w=y=>{var b,k;return(((k=(b=t.config.schema)==null?void 0:b[y])==null?void 0:k.values)??[]).map(g=>({value:g,label:g}))},V=y=>{var b,k;return((k=(b=t.config.schema)==null?void 0:b[y])==null?void 0:k.type)??"text"},C=y=>{s.value={...s.value,[y]:""},m()},p=()=>{s.value={},m(!0)},m=(y=!1)=>{const b=Object.keys(s.value).reduce((k,g)=>(s.value[g]&&(k[g]=`${s.value[g]}`),k),{});y&&(o.value=!1),e("update:modelValue",new URLSearchParams(b).toString())};return(y,b)=>{const k=i.resolveComponent("KInput"),g=i.resolveComponent("KButton"),A=i.resolveComponent("KSelect"),B=i.resolveComponent("KMenuItem"),E=i.resolveComponent("KMenu");return r.config.isExactMatch?(i.openBlock(),i.createBlock(k,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":r.modelValue,placeholder:r.config.placeholder,"onUpdate:modelValue":f},{icon:i.withCtx(()=>[i.createVNode(gh)]),_:1},8,["model-value","placeholder"])):(i.openBlock(),i.createElementBlock("div",mh,[i.createVNode(g,{appearance:"btn-link","data-testid":"filter-button",icon:"filter",onClick:u},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.filterButtonText"))+" "+i.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),i.withDirectives(i.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:u},null,512),[[i.vShow,o.value]]),i.withDirectives(i.createVNode(E,{class:"kong-ui-entity-filter-menu"},{body:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,(_,X)=>(i.openBlock(),i.createBlock(B,{key:_.value,"data-testid":_.value,expandable:"","last-menu-item":X===d.value.length-1},{itemTitle:i.withCtx(()=>[i.createElementVNode("span",bh,[i.createTextVNode(i.toDisplayString(_.label)+" ",1),i.withDirectives(i.createElementVNode("span",vh,null,512),[[i.vShow,c.value.includes(_.value)]])])]),itemBody:i.withCtx(()=>{var W,T;return[i.createElementVNode("div",wh,[i.createElementVNode("label",{class:"menu-item-label",for:h(_.value)},i.toDisplayString(i.unref(n)("filter.fieldLabel")),9,kh),((T=(W=r.config.schema)==null?void 0:W[_.value])==null?void 0:T.type)==="select"?(i.openBlock(),i.createBlock(A,{key:0,id:h(_.value),modelValue:s.value[_.value],"onUpdate:modelValue":M=>s.value[_.value]=M,appearance:"select",items:w(_.value),placeholder:i.unref(n)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(i.openBlock(),i.createBlock(k,{key:1,id:h(_.value),modelValue:s.value[_.value],"onUpdate:modelValue":M=>s.value[_.value]=M,autocomplete:"off",placeholder:i.unref(n)("filter.inputPlaceholder"),size:"small",type:V(_.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),i.createElementVNode("div",Sh,[i.createVNode(g,{appearance:"btn-link","data-testid":"apply-filter",size:"small",onClick:b[0]||(b[0]=M=>m(!0))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.applyButtonText")),1)]),_:1}),i.createVNode(g,{appearance:"btn-link","data-testid":"clear-filter",size:"small",onClick:M=>C(_.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:i.withCtx(()=>[i.createVNode(g,{onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("filter.clearAllButtonText")),1)]),_:1})]),_:1},512),[[i.vShow,o.value]])]))}}}),[["__scopeId","data-v-745f38c0"]]),gt=i.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(r){const e=r,t=i.ref(void 0),n=i.computed(()=>t.value===!0||t.value!==void 0&&e.forceShow===!0);return i.watch(()=>e.authFunction,async()=>{t.value=await e.authFunction()},{immediate:!0}),(o,s)=>n.value?i.renderSlot(o.$slots,"default",{key:0,isAllowed:t.value}):i.createCommentVNode("",!0)}}),Ch={class:"form-section-wrapper"},xh={key:0,class:"form-section-title"},Ah={key:1,class:"form-section-description"},Bh={key:2,class:"form-section-footer"},Ih={class:"form-section-content"},On=it(i.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(r){const e=i.useSlots();return(t,n)=>(i.openBlock(),i.createElementBlock("fieldset",{class:i.normalizeClass(["kong-ui-entity-form-section",{"has-divider":r.hasDivider}])},[i.createElementVNode("div",Ch,[r.hideInfoHeader?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["form-section-info",{sticky:r.stickyInfoHeader}])},[r.title?(i.openBlock(),i.createElementBlock("h4",xh,i.toDisplayString(r.title),1)):i.createCommentVNode("",!0),r.description||i.unref(e).description?(i.openBlock(),i.createElementBlock("div",Ah,[i.renderSlot(t.$slots,"description",{},()=>[i.createElementVNode("p",null,i.toDisplayString(r.description),1)],!0)])):i.createCommentVNode("",!0),i.unref(e).footer?(i.openBlock(),i.createElementBlock("div",Bh,[i.renderSlot(t.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],2)),i.createElementVNode("div",Ih,[i.renderSlot(t.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:Vn,useDeleteUrlBuilder:Ru,useErrors:Mu,useFetchUrlBuilder:Iy,useFetcher:Uu,useDebouncedFilter:Ey,useStringHelpers:Lu,useGatewayFeatureSupported:Ny}=Ce,_y="",Oy="",Eh={class:"kong-ui-entities-certificates-list"},Nh={key:0},_h={key:1},Oh={key:0},Vh={key:1},Th={key:0},jh={key:1},Ph={key:1},Dh={key:1},$h=i.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}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var ce;const t=r,{i18n:{t:n,formatUnixTimeStamp:o},i18nT:s}=rt.useI18n(),c=xr.useRouter(),{axiosInstance:d}=Vn({headers:(ce=t.config)==null?void 0:ce.requestHeaders}),u=i.ref(1),f=i.computed(()=>t.config.app!=="kongManager"||!!t.config.disableSorting),w={subject:{label:n("certificates.list.table_headers.subject")},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}},V=i.computed(()=>{var J,ge;let F=`${t.config.apiBaseUrl}${ii.list[t.config.app]}`;return t.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((J=t.config)==null?void 0:J.controlPlaneId)||""):t.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(ge=t.config)!=null&&ge.workspace?`/${t.config.workspace}`:"")),F}),C=i.ref(""),p=i.computed(()=>{const F=t.config.app==="konnect"||t.config.isExactMatch;return F?{isExactMatch:F,placeholder:n("certificates.search.placeholder")}:{isExactMatch:F,schema:t.config.filterSchema}}),{fetcher:m,fetcherState:y}=Uu(t.config,V.value),b=()=>{C.value=""},k=()=>{u.value++},g=i.ref(""),A=(F,J)=>{const ge=F.id;if(!J(ge)){e("copy:error",{entity:F,field:"id",message:n("certificates.errors.copy")});return}e("copy:success",{entity:F,field:"id",message:n("certificates.copy.success",{val:ge})})},B=(F,J)=>{const ge=JSON.stringify(F);if(!J(ge)){e("copy:error",{entity:F,message:n("certificates.errors.copy")});return}e("copy:success",{entity:F,message:n("certificates.copy.success_brief")})},E=(F,J)=>{F.type==="error"?e("copy:error",{entity:J,field:"cert",message:n("certificates.errors.copy")}):e("copy:success",{entity:J,field:"cert",message:n("certificates.copy.success_brief")})},_=async F=>{var ge;await((ge=t.canRetrieve)==null?void 0:ge.call(t,F))&&c.push(t.config.getViewRoute(F.id))},X=F=>({label:n("certificates.actions.view"),to:t.config.getViewRoute(F)}),W=F=>({label:n("certificates.actions.edit"),to:t.config.getEditRoute(F)}),T=F=>{if(t.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:t.config.getCreateSniRoute(F)}},M=i.ref(void 0),z=i.ref(!1),L=i.ref(!1),fe=i.ref(""),Te=Ru(t.config,V.value),{certificateDataCache:Be,getCertificateData:mt}=rt.useCertificate(),Sr=F=>{M.value=F,z.value=!0},At=()=>{z.value=!1},zt=async()=>{var F,J,ge;if((F=M.value)!=null&&F.id){L.value=!0;try{await d.delete(Te(M.value.id)),L.value=!1,z.value=!1,u.value++,e("delete:success",M.value)}catch(Re){fe.value=((ge=(J=Re.response)==null?void 0:J.data)==null?void 0:ge.message)||Re.message||n("certificates.errors.delete"),e("error",Re)}finally{L.value=!1}}};i.watch(y,F=>{if(F.status===xt.Error){g.value=n("certificates.errors.general"),e("error",F.error);return}Be.value={},g.value=""});const H=i.ref({ctaPath:t.config.createRoute,ctaText:void 0,message:n("certificates.list.empty_state.description"),title:n("certificates.title")});return i.onBeforeMount(async()=>{await t.canCreate()&&(H.value.title=n("certificates.list.empty_state.title"),H.value.ctaText=n("certificates.actions.create"))}),(F,J)=>{const ge=i.resolveComponent("KButton"),Re=i.resolveComponent("KBadge"),Cr=i.resolveComponent("KTruncate"),Z=i.resolveComponent("KDropdownItem"),le=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",Eh,[i.createVNode(i.unref(Pu),{"cache-identifier":r.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":f.value,"empty-state-options":H.value,"enable-entity-actions":"","error-message":g.value,fetcher:i.unref(m),"fetcher-cache-key":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":i.unref(w),onClearSearchInput:b,"onClick:row":J[2]||(J[2]=q=>_(q)),onSort:k},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref($u),{modelValue:C.value,"onUpdate:modelValue":J[0]||(J[0]=q=>C.value=q),config:p.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[i.createVNode(i.unref(gt),{"auth-function":()=>r.canCreate()},{default:i.withCtx(()=>[i.createVNode(ge,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:r.config.createRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),subject:i.withCtx(({row:q})=>{var ue;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Nh,i.toDisplayString((ue=q==null?void 0:q.metadata)!=null&&ue.subject?q.metadata.subject:"-"),1)):(i.openBlock(),i.createElementBlock("b",_h,i.toDisplayString(i.unref(mt)(q).schemaSubject||"-"),1))]}),expiry:i.withCtx(({row:q})=>{var ue;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Oh,i.toDisplayString((ue=q==null?void 0:q.metadata)!=null&&ue.expiry?i.unref(o)(q.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",Vh,i.toDisplayString(i.unref(mt)(q).schemaExpiry?i.unref(o)(i.unref(mt)(q).schemaExpiry):"-"),1))]}),san:i.withCtx(({row:q})=>{var ue;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Th,i.toDisplayString((ue=q==null?void 0:q.metadata)!=null&&ue.dns_names?`dns=${q.metadata.dns_names.join(", ")}`:"-"),1)):(i.openBlock(),i.createElementBlock("span",jh,i.toDisplayString(i.unref(mt)(q).schemaSanNames||"-"),1))]}),cert:i.withCtx(({row:q})=>[q!=null&&q.cert?(i.openBlock(),i.createBlock(i.unref(Zf),{key:0,"data-testid":"copy-certificate-cert",notify:ue=>E(ue,q),truncated:!0,uuid:q.cert},null,8,["notify","uuid"])):(i.openBlock(),i.createElementBlock("span",Ph,"-"))]),tags:i.withCtx(({row:q})=>{var ue;return[((ue=q==null?void 0:q.tags)==null?void 0:ue.length)>0?(i.openBlock(),i.createBlock(Cr,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(q==null?void 0:q.tags,Gt=>(i.openBlock(),i.createBlock(Re,{key:Gt,onClick:J[1]||(J[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(Gt),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Dh,"-"))]}),actions:i.withCtx(({row:q})=>[i.createVNode(le,null,{default:i.withCtx(({copyToClipboard:ue})=>[i.createVNode(Z,{"data-testid":"action-entity-copy-id",onClick:Gt=>A(q,ue)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(le,null,{default:i.withCtx(({copyToClipboard:ue})=>[i.createVNode(Z,{"data-testid":"action-entity-copy-json",onClick:Gt=>B(q,ue)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(gt),{"auth-function":()=>r.canRetrieve(q)},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-view","has-divider":"",item:X(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(gt),{"auth-function":()=>r.canEdit(q)},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-edit",item:W(q.id)},null,8,["item"])]),_:2},1032,["auth-function"]),r.config.getCreateSniRoute?(i.openBlock(),i.createBlock(i.unref(gt),{key:0,"auth-function":()=>r.canCreateSni()},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-add-sni",item:T(q.id)},null,8,["item"])]),_:2},1032,["auth-function"])):i.createCommentVNode("",!0),i.createVNode(i.unref(gt),{"auth-function":()=>r.canDelete(q)},{default:i.withCtx(()=>[i.createVNode(Z,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:ue=>Sr(q)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),i.createVNode(i.unref(Du),{"action-pending":L.value,"entity-type":i.unref(Js).Certificate,error:fe.value,title:i.unref(n)("certificates.delete.title"),visible:z.value,onCancel:At,onProceed:zt},{description:i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(n)("certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Vy="",kr=(r,e)=>{const t=r.__vccOpts||r;for(const[n,o]of e)t[n]=o;return t},Rh=kr($h,[["__scopeId","data-v-7079e57f"]]),Mh={class:"kong-ui-entities-certificates-form"},Uh=i.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:""}},emits:["update","error","loading"],setup(r,{emit:e}){var k;const t=r,n=xr.useRouter(),{i18nT:o,i18n:{t:s}}=rt.useI18n(),{getMessageFromError:c}=Mu(),{axiosInstance:d}=Vn({headers:(k=t.config)==null?void 0:k.requestHeaders}),u=i.computed(()=>ii.form[t.config.app].edit),f=i.computed(()=>t.certificateId?qt.Edit:qt.Create),h=i.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),w=i.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),V=i.computed(()=>(f.value===qt.Create||JSON.stringify(h.fields)!==JSON.stringify(w))&&!!h.fields.cert&&!!h.fields.key),C=g=>{var A;h.fields.cert=(g==null?void 0:g.cert)||"",h.fields.key=(g==null?void 0:g.key)||"",h.fields.certAlt=(g==null?void 0:g.cert_alt)||"",h.fields.keyAlt=(g==null?void 0:g.key_alt)||"",h.fields.tags=((A=g==null?void 0:g.tags)==null?void 0:A.join(", "))||"",Object.assign(w,h.fields)},p=()=>{n.push(t.config.cancelRoute)},m=i.computed(()=>{var A,B;let g=`${t.config.apiBaseUrl}${ii.form[t.config.app].validate}`;return t.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((A=t.config)==null?void 0:A.controlPlaneId)||""):t.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(B=t.config)!=null&&B.workspace?`/${t.config.workspace}`:"")),g=g.replace(/{id}/gi,t.certificateId),g}),y=i.computed(()=>{var A,B;let g=`${t.config.apiBaseUrl}${ii.form[t.config.app][f.value]}`;return t.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((A=t.config)==null?void 0:A.controlPlaneId)||""):t.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(B=t.config)!=null&&B.workspace?`/${t.config.workspace}`:"")),g=g.replace(/{id}/gi,t.certificateId),g}),b=async()=>{var g,A,B,E,_,X,W,T,M;try{h.isReadonly=!0;const z={cert:h.fields.cert,key:h.fields.key,cert_alt:h.fields.certAlt||null,key_alt:h.fields.keyAlt||null,tags:(A=(g=h.fields.tags.split(","))==null?void 0:g.map(fe=>String(fe||"").trim()))==null?void 0:A.filter(fe=>fe!=="")};let L;await d.post(m.value,z),f.value==="create"?L=await d.post(y.value,z):f.value==="edit"&&(L=((B=t.config)==null?void 0:B.app)==="konnect"?await d.put(y.value,z):await d.patch(y.value,z)),h.fields.cert=((E=L==null?void 0:L.data)==null?void 0:E.cert)||"",h.fields.key=((_=L==null?void 0:L.data)==null?void 0:_.key)||"",h.fields.certAlt=((X=L==null?void 0:L.data)==null?void 0:X.cert_alt)||"",h.fields.keyAlt=((W=L==null?void 0:L.data)==null?void 0:W.key_alt)||"",h.fields.tags=((M=(T=L==null?void 0:L.data)==null?void 0:T.tags)==null?void 0:M.join(", "))||"",Object.assign(w,h.fields),e("update",L==null?void 0:L.data)}catch(z){h.errorMessage=c(z),e("error",z)}finally{h.isReadonly=!1}};return(g,A)=>{const B=i.resolveComponent("KTextArea"),E=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",Mh,[i.createVNode(i.unref(ju),{"can-submit":V.value,config:r.config,"edit-id":r.certificateId,"error-message":h.errorMessage,"fetch-url":u.value,"is-readonly":h.isReadonly,onCancel:p,"onFetch:error":A[5]||(A[5]=_=>g.$emit("error",_)),"onFetch:success":C,onLoading:A[6]||(A[6]=_=>g.$emit("loading",_)),onSubmit:b},{default:i.withCtx(()=>[i.createVNode(i.unref(On),{description:i.unref(s)("certificates.form.sections.ssl.description"),title:i.unref(s)("certificates.form.sections.ssl.title")},{default:i.withCtx(()=>[i.createVNode(B,{modelValue:h.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=_=>h.fields.cert=_),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert","disable-character-limit":"",label:i.unref(s)("certificates.form.fields.cert.label"),readonly:h.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(B,{modelValue:h.fields.key,"onUpdate:modelValue":A[1]||(A[1]=_=>h.fields.key=_),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key","disable-character-limit":"",label:i.unref(s)("certificates.form.fields.key.label"),readonly:h.isReadonly,required:""},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(B,{modelValue:h.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=_=>h.fields.certAlt=_),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt","disable-character-limit":"",label:i.unref(s)("certificates.form.fields.cert_alt.label"),readonly:h.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(o),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(s)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),i.createVNode(B,{modelValue:h.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=_=>h.fields.keyAlt=_),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key-alt","disable-character-limit":"",label:i.unref(s)("certificates.form.fields.key_alt.label"),readonly:h.isReadonly},{"label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(o),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("em",null,i.toDisplayString(i.unref(s)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(On),{description:i.unref(s)("certificates.form.sections.general.description"),title:i.unref(s)("certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(E,{modelValue:h.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=_=>h.fields.tags=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:i.unref(s)("certificates.form.fields.tags.help"),label:i.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:i.unref(s)("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","error-message","fetch-url","is-readonly"])])}}}),Ty="",Lh=kr(Uh,[["__scopeId","data-v-ba62e0cc"]]),ni={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},Hh={class:"kong-ui-ca-certificate-entity-config-card"},Fh={key:0},Kh=i.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)},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(r,{emit:e}){const t=r,n=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=rt.useI18n(),{convertKeyToTitle:c}=Lu(),{getCertificateData:d}=rt.useCertificate(),u=i.computed(()=>ni.form[t.config.app].edit),f=i.ref(),h=i.computed(()=>{if(f.value)return d(f.value)}),w=i.computed(()=>{var y;return((y=h.value)==null?void 0:y.schemaIssuer)||""}),V=i.computed(()=>{var y,b;return(y=h.value)!=null&&y.schemaExpiry?s((b=h.value)==null?void 0:b.schemaExpiry):""}),C=i.computed(()=>{var y;return((y=h.value)==null?void 0:y.schemaKeyUsages)||[]}),p=y=>{f.value=y,e("fetch:success",y)},m=i.ref({id:{},updated_at:{},created_at:{},cert:{section:ae.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:ae.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:ae.Basic,type:re.Json,order:7},...t.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:ae.Basic,order:1.7,forceShow:!0},issuer:{section:ae.Basic,order:1.5,forceShow:!0},key_usages:{section:ae.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(y,b)=>{const k=i.resolveComponent("KCodeBlock"),g=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",Hh,[i.createVNode(i.unref(Tu),{config:r.config,"config-schema":m.value,"fetch-url":u.value,"hide-title":r.hideTitle,"onCopy:success":b[0]||(b[0]=A=>y.$emit("copy:success",A)),"onFetch:error":b[1]||(b[1]=A=>y.$emit("fetch:error",A)),"onFetch:success":p,onLoading:b[2]||(b[2]=A=>y.$emit("loading",A))},{cert:i.withCtx(({rowValue:A})=>[i.createVNode(k,{id:`ca-cert-${r.config.entityId}-cert-codeblock`,code:A,"is-single-line":"",language:"plaintext"},null,8,["id","code"])]),metadata:i.withCtx(({rowValue:A})=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(A).filter(B=>!n.includes(B)),B=>(i.openBlock(),i.createBlock(i.unref(_n),{key:B,"data-testid":`ca-cert-metadata-${B}`,item:{key:B,label:i.unref(c)(B),value:B==="expiry"?V.value:B==="key_usages"?C.value:A[B],type:B==="key_usages"?i.unref(re).BadgeTag:i.unref(re).Text}},null,8,["data-testid","item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(V.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(w.value||"–"),1)]),key_usages:i.withCtx(()=>[C.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fh,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(A,B)=>(i.openBlock(),i.createBlock(g,{key:`key_usages-badge-tag-${B}`,class:"config-badge","data-testid":`key_usages-badge-tag-${B}`,"truncation-tooltip":A},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(A),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:1},8,["config","config-schema","fetch-url","hide-title"])])}}}),jy="",qh=kr(Kh,[["__scopeId","data-v-c7364467"]]),zh={class:"kong-ui-entities-ca-certificates-list"},Gh={key:0},Wh={key:1},Jh={key:0},Yh={key:1},Zh={key:1},Qh=i.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}},emits:["error","copy:success","copy:error","delete:success"],setup(r,{emit:e}){var zt;const t=r,{i18n:{t:n,formatUnixTimeStamp:o},i18nT:s}=rt.useI18n(),c=xr.useRouter(),{axiosInstance:d}=Vn({headers:(zt=t.config)==null?void 0:zt.requestHeaders}),u=i.ref(1),f=i.computed(()=>t.config.app!=="kongManager"||!!t.config.disableSorting),w={issuer:{label:n("ca-certificates.list.table_headers.issuer")},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},V=i.computed(()=>{var ce,F;let H=`${t.config.apiBaseUrl}${ni.list[t.config.app]}`;return t.config.app==="konnect"?H=H.replace(/{controlPlaneId}/gi,((ce=t.config)==null?void 0:ce.controlPlaneId)||""):t.config.app==="kongManager"&&(H=H.replace(/\/{workspace}/gi,(F=t.config)!=null&&F.workspace?`/${t.config.workspace}`:"")),H}),C=i.ref(""),p=i.computed(()=>{const H=t.config.app==="konnect"||t.config.isExactMatch;return H?{isExactMatch:H,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:H,schema:t.config.filterSchema}}),{fetcher:m,fetcherState:y}=Uu(t.config,V.value),b=()=>{C.value=""},k=()=>{u.value++},g=i.ref(""),A=(H,ce)=>{const F=H.id;if(!ce(F)){e("copy:error",{entity:H,field:"id",message:n("ca-certificates.errors.copy")});return}e("copy:success",{entity:H,field:"id",message:n("ca-certificates.copy.success",{val:F})})},B=(H,ce)=>{const F=JSON.stringify(H);if(!ce(F)){e("copy:error",{entity:H,message:n("ca-certificates.errors.copy")});return}e("copy:success",{entity:H,message:n("ca-certificates.copy.success_brief")})},E=async H=>{var F;await((F=t.canRetrieve)==null?void 0:F.call(t,H))&&c.push(t.config.getViewRoute(H.id))},_=H=>({label:n("ca-certificates.actions.view"),to:t.config.getViewRoute(H)}),X=H=>({label:n("ca-certificates.actions.edit"),to:t.config.getEditRoute(H)}),W=i.ref(void 0),T=i.ref(!1),M=i.ref(!1),z=i.ref(""),L=Ru(t.config,V.value),{certificateDataCache:fe,getCertificateData:Te}=rt.useCertificate(),Be=H=>{W.value=H,T.value=!0},mt=()=>{T.value=!1},Sr=async()=>{var H,ce,F;if((H=W.value)!=null&&H.id){M.value=!0;try{await d.delete(L(W.value.id)),M.value=!1,T.value=!1,u.value++,e("delete:success",W.value)}catch(J){z.value=((F=(ce=J.response)==null?void 0:ce.data)==null?void 0:F.message)||J.message||n("ca-certificates.errors.delete"),e("error",J)}finally{M.value=!1}}};i.watch(y,H=>{if(H.status===xt.Error){g.value=n("ca-certificates.errors.general"),e("error",H.error);return}fe.value={},g.value=""});const At=i.ref({ctaPath:t.config.createRoute,ctaText:void 0,message:n("ca-certificates.list.empty_state.description"),title:n("ca-certificates.title")});return i.onBeforeMount(async()=>{await t.canCreate()&&(At.value.title=n("ca-certificates.list.empty_state.title"),At.value.ctaText=n("ca-certificates.actions.create"))}),(H,ce)=>{const F=i.resolveComponent("KButton"),J=i.resolveComponent("KBadge"),ge=i.resolveComponent("KTruncate"),Re=i.resolveComponent("KDropdownItem"),Cr=i.resolveComponent("KClipboardProvider");return i.openBlock(),i.createElementBlock("div",zh,[i.createVNode(i.unref(Pu),{"cache-identifier":r.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":f.value,"empty-state-options":At.value,"enable-entity-actions":"","error-message":g.value,fetcher:i.unref(m),"fetcher-cache-key":u.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":i.unref(w),onClearSearchInput:b,"onClick:row":ce[2]||(ce[2]=Z=>E(Z)),onSort:k},{"toolbar-filter":i.withCtx(()=>[i.createVNode(i.unref($u),{modelValue:C.value,"onUpdate:modelValue":ce[0]||(ce[0]=Z=>C.value=Z),config:p.value},null,8,["modelValue","config"])]),"toolbar-button":i.withCtx(()=>[i.createVNode(i.unref(gt),{"auth-function":()=>r.canCreate()},{default:i.withCtx(()=>[i.createVNode(F,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:r.config.createRoute},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),issuer:i.withCtx(({row:Z})=>{var le;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("b",Gh,i.toDisplayString((le=Z==null?void 0:Z.metadata)!=null&&le.issuer?Z.metadata.issuer:"-"),1)):(i.openBlock(),i.createElementBlock("b",Wh,i.toDisplayString(i.unref(Te)(Z).schemaIssuer||"-"),1))]}),expiry:i.withCtx(({row:Z})=>{var le;return[r.config.app==="konnect"?(i.openBlock(),i.createElementBlock("span",Jh,i.toDisplayString((le=Z==null?void 0:Z.metadata)!=null&&le.expiry?i.unref(o)(Z.metadata.expiry):"-"),1)):(i.openBlock(),i.createElementBlock("span",Yh,i.toDisplayString(i.unref(Te)(Z).schemaExpiry?i.unref(o)(i.unref(Te)(Z).schemaExpiry):"-"),1))]}),tags:i.withCtx(({row:Z})=>{var le;return[((le=Z==null?void 0:Z.tags)==null?void 0:le.length)>0?(i.openBlock(),i.createBlock(ge,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Z==null?void 0:Z.tags,q=>(i.openBlock(),i.createBlock(J,{key:q,onClick:ce[1]||(ce[1]=i.withModifiers(()=>{},["stop"]))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(q),1)]),_:2},1024))),128))]),_:2},1024)):(i.openBlock(),i.createElementBlock("span",Zh,"-"))]}),actions:i.withCtx(({row:Z})=>[i.createVNode(Cr,null,{default:i.withCtx(({copyToClipboard:le})=>[i.createVNode(Re,{"data-testid":"action-entity-copy-id",onClick:q=>A(Z,le)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(Cr,null,{default:i.withCtx(({copyToClipboard:le})=>[i.createVNode(Re,{"data-testid":"action-entity-copy-json",onClick:q=>B(Z,le)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),i.createVNode(i.unref(gt),{"auth-function":()=>r.canRetrieve(Z)},{default:i.withCtx(()=>[i.createVNode(Re,{"data-testid":"action-entity-view","has-divider":"",item:_(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(gt),{"auth-function":()=>r.canEdit(Z)},{default:i.withCtx(()=>[i.createVNode(Re,{"data-testid":"action-entity-edit",item:X(Z.id)},null,8,["item"])]),_:2},1032,["auth-function"]),i.createVNode(i.unref(gt),{"auth-function":()=>r.canDelete(Z)},{default:i.withCtx(()=>[i.createVNode(Re,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:le=>Be(Z)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers"]),i.createVNode(i.unref(Du),{"action-pending":M.value,"entity-type":i.unref(Js).CACertificate,error:z.value,title:i.unref(n)("ca-certificates.delete.title"),visible:T.value,onCancel:mt,onProceed:Sr},{description:i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":i.withCtx(()=>[i.createElementVNode("b",null,i.toDisplayString(i.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),i.createElementVNode("p",null,i.toDisplayString(i.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Py="",Xh=kr(Qh,[["__scopeId","data-v-d539b808"]]),ey={class:"kong-ui-entities-ca-certificates-form"},ty=i.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 b;const t=r,n=xr.useRouter(),{i18n:{t:o}}=rt.useI18n(),{getMessageFromError:s}=Mu(),{axiosInstance:c}=Vn({headers:(b=t.config)==null?void 0:b.requestHeaders}),d=i.computed(()=>ni.form[t.config.app].edit),u=i.computed(()=>t.certificateId?qt.Edit:qt.Create),f=i.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),h=i.reactive({cert:"",certDigest:"",tags:""}),w=i.computed(()=>(u.value===qt.Create||JSON.stringify(f.fields)!==JSON.stringify(h))&&!!f.fields.cert),V=k=>{var g;f.fields.cert=(k==null?void 0:k.cert)||"",f.fields.certDigest=(k==null?void 0:k.cert_digest)||"",f.fields.tags=((g=k==null?void 0:k.tags)==null?void 0:g.join(", "))||"",Object.assign(h,f.fields)},C=()=>{n.push(t.config.cancelRoute)},p=i.computed(()=>{var g,A;let k=`${t.config.apiBaseUrl}${ni.form[t.config.app].validate}`;return t.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((g=t.config)==null?void 0:g.controlPlaneId)||""):t.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(A=t.config)!=null&&A.workspace?`/${t.config.workspace}`:"")),k=k.replace(/{id}/gi,t.certificateId),k}),m=i.computed(()=>{var g,A;let k=`${t.config.apiBaseUrl}${ni.form[t.config.app][u.value]}`;return t.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((g=t.config)==null?void 0:g.controlPlaneId)||""):t.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(A=t.config)!=null&&A.workspace?`/${t.config.workspace}`:"")),k=k.replace(/{id}/gi,t.certificateId),k}),y=async()=>{var k,g,A,B,E,_,X;try{f.isReadonly=!0;const W={cert:f.fields.cert,cert_digest:f.fields.certDigest||null,tags:(g=(k=f.fields.tags.split(","))==null?void 0:k.map(M=>String(M||"").trim()))==null?void 0:g.filter(M=>M!=="")};let T;await c.post(p.value,W),u.value==="create"?T=await c.post(m.value,W):u.value==="edit"&&(T=((A=t.config)==null?void 0:A.app)==="konnect"?await c.put(m.value,W):await c.patch(m.value,W)),f.fields.cert=((B=T==null?void 0:T.data)==null?void 0:B.cert)||"",f.fields.certDigest=((E=T==null?void 0:T.data)==null?void 0:E.cert_digest)||"",f.fields.tags=((X=(_=T==null?void 0:T.data)==null?void 0:_.tags)==null?void 0:X.join(", "))||"",Object.assign(h,f.fields),e("update",T==null?void 0:T.data)}catch(W){f.errorMessage=s(W),e("error",W)}finally{f.isReadonly=!1}};return(k,g)=>{const A=i.resolveComponent("KTextArea"),B=i.resolveComponent("KInput");return i.openBlock(),i.createElementBlock("div",ey,[i.createVNode(i.unref(ju),{"can-submit":w.value,config:r.config,"edit-id":r.certificateId,"error-message":f.errorMessage,"fetch-url":d.value,"is-readonly":f.isReadonly,onCancel:C,"onFetch:error":g[3]||(g[3]=E=>k.$emit("error",E)),"onFetch:success":V,onLoading:g[4]||(g[4]=E=>k.$emit("loading",E)),onSubmit:y},{default:i.withCtx(()=>[i.createVNode(i.unref(On),{description:i.unref(o)("ca-certificates.form.sections.cert.description"),title:i.unref(o)("ca-certificates.form.sections.cert.title")},{default:i.withCtx(()=>[i.createVNode(A,{modelValue:f.fields.cert,"onUpdate:modelValue":g[0]||(g[0]=E=>f.fields.cert=E),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert","disable-character-limit":"",label:i.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:i.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:f.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),i.createVNode(B,{modelValue:f.fields.certDigest,"onUpdate:modelValue":g[1]||(g[1]=E=>f.fields.certDigest=E),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:i.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:f.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),i.createVNode(i.unref(On),{description:i.unref(o)("ca-certificates.form.sections.general.description"),title:i.unref(o)("ca-certificates.form.sections.general.title")},{default:i.withCtx(()=>[i.createVNode(B,{modelValue:f.fields.tags,"onUpdate:modelValue":g[2]||(g[2]=E=>f.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:i.unref(o)("ca-certificates.form.fields.tags.help"),label:i.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:i.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:i.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:f.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),Dy="",ry=kr(ty,[["__scopeId","data-v-a1cf8ed1"]]),iy={class:"kong-ui-certificate-entity-config-card"},ny={key:0},oy=i.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)},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(r,{emit:e}){const t=r,{i18n:{t:n,formatUnixTimeStamp:o},i18nT:s}=rt.useI18n(),{convertKeyToTitle:c}=Lu(),{getCertificateData:d}=rt.useCertificate(),u=i.computed(()=>ii.form[t.config.app].edit),f=i.ref(),h=i.ref({id:{},cert:{section:ae.Basic},key:{section:ae.Basic,type:re.Redacted},metadata:{section:ae.Basic,type:re.Json},snis:{section:ae.Basic,type:re.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...t.config.app==="kongManager"&&{expiry:{section:ae.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:ae.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:ae.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:ae.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:ae.Advanced},key_alt:{section:ae.Advanced,type:re.Redacted}}),w=E=>{f.value=E,e("fetch:success",E)},V=i.computed(()=>{if(f.value)return d(f.value)}),C=i.computed(()=>{var E,_;return(E=V.value)!=null&&E.schemaExpiry?o((_=V.value)==null?void 0:_.schemaExpiry):""}),p=i.computed(()=>{var E;return((E=V.value)==null?void 0:E.schemaIssuer)||""}),m=i.computed(()=>{var E;return((E=V.value)==null?void 0:E.schemaSanNames)||""}),y=i.computed(()=>{var E;return((E=V.value)==null?void 0:E.schemaSubject)||""}),b=i.computed(()=>{var E;return((E=V.value)==null?void 0:E.schemaKeyUsages)||[]}),k=i.computed(()=>{var E,_;return((_=(E=f==null?void 0:f.value)==null?void 0:E.snis)==null?void 0:_.length)>0}),g=i.computed(()=>{var E;return!!((E=f==null?void 0:f.value)!=null&&E.cert_alt)}),A=E=>{var _,X;return E==="san_names"?n("certificates.list.table_headers.san"):((X=(_=h.value)==null?void 0:_[E])==null?void 0:X.label)||c(E)},B=(E,_)=>E==="expiry"?C.value:E==="key_usages"?b.value:E==="san_names"?m.value:_[E];return(E,_)=>{const X=i.resolveComponent("KCodeBlock"),W=i.resolveComponent("KBadge");return i.openBlock(),i.createElementBlock("div",iy,[i.createVNode(i.unref(Tu),{config:r.config,"config-schema":h.value,"fetch-url":u.value,"hide-title":r.hideTitle,"onCopy:success":_[0]||(_[0]=T=>E.$emit("copy:success",T)),"onFetch:error":_[1]||(_[1]=T=>E.$emit("fetch:error",T)),"onFetch:success":w,onLoading:_[2]||(_[2]=T=>E.$emit("loading",T))},i.createSlots({"cert-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:i.withCtx(({rowValue:T})=>[i.createVNode(X,{id:`certificate-${r.config.entityId}-cert-codeblock`,code:T,"is-single-line":"",language:"plaintext"},null,8,["id","code"])]),"key-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),metadata:i.withCtx(({rowValue:T})=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(T),M=>(i.openBlock(),i.createBlock(i.unref(_n),{key:M,item:{key:M,value:B(M,T),label:A(M),type:M==="key_usages"||M==="snis"||M==="dns_names"?i.unref(re).BadgeTag:i.unref(re).Text}},null,8,["item"]))),128))]),expiry:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(C.value||"–"),1)]),issuer:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value||"–"),1)]),san_names:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.value||"–"),1)]),subject:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.value||"–"),1)]),"cert_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":i.withCtx(()=>[i.createVNode(i.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:i.withCtx(()=>[i.createElementVNode("i",null,i.toDisplayString(i.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:i.withCtx(()=>[b.value.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ny,i.toDisplayString("–"))),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,(T,M)=>(i.openBlock(),i.createBlock(W,{key:`key_usages-badge-tag-${M}`,class:"config-badge","data-testid":`key_usages-badge-tag-${M}`,"truncation-tooltip":T},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:2},[k.value?void 0:{name:"snis",fn:i.withCtx(()=>[i.createTextVNode(" – ")]),key:"0"},g.value?{name:"cert_alt",fn:i.withCtx(({rowValue:T})=>[i.createVNode(X,{id:`certificate-${r.config.entityId}-cert-alt-codeblock`,code:T,"is-single-line":"",language:"plaintext"},null,8,["id","code"])]),key:"1"}:void 0]),1032,["config","config-schema","fetch-url","hide-title"])])}}}),$y="",sy=kr(oy,[["__scopeId","data-v-842a59fa"]]);we.CACertificateConfigCard=qh,we.CACertificateForm=ry,we.CACertificateList=Xh,we.CertificateConfigCard=sy,we.CertificateForm=Lh,we.CertificateList=Rh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});