@kong-ui-public/entities-certificates 2.1.20 → 2.1.21
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.
- package/dist/entities-certificates.es.js +4987 -4780
- package/dist/entities-certificates.umd.js +36 -36
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Pe,n){typeof exports=="object"&&typeof module<"u"?n(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"],n):(Pe=typeof globalThis<"u"?globalThis:Pe||self,n(Pe["kong-ui-public-entities-certificates"]={},Pe.Vue,Pe.VueRouter,Pe["kong-ui-public-i18n"],Pe.axios,Pe.Kongponents))})(this,function(Pe,n,Gr,pr,ip,np){"use strict";var yo=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 Ka;(function(e){(function(t){var r=typeof lo=="object"?lo:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),i=o(e);typeof r.Reflect>"u"?r.Reflect=e:i=o(r.Reflect,i),t(i);function o(s,a){return function(c,l){typeof s[c]!="function"&&Object.defineProperty(s,c,{configurable:!0,writable:!0,value:l}),a&&a(c,l)}}})(function(t){var r=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",o=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",s=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",a=typeof Object.create=="function",c={__proto__:[]}instanceof Array,l=!a&&!c,d={create:a?function(){return qa(Object.create(null))}:c?function(){return qa({__proto__:null})}:function(){return qa({})},has:l?function(x,B){return r.call(x,B)}:function(x,B){return B in x},get:l?function(x,B){return r.call(x,B)?x[B]:void 0}:function(x,B){return x[B]}},y=Object.getPrototypeOf(Function),p=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",A=!p&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ub(),b=!p&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:db(),h=!p&&typeof WeakMap=="function"?WeakMap:fb(),m=new h;function k(x,B,_,V){if(ye(_)){if(!X(x))throw new TypeError;if(!W(B))throw new TypeError;return q(x,B)}else{if(!X(x))throw new TypeError;if(!Q(B))throw new TypeError;if(!Q(V)&&!ye(V)&&!it(V))throw new TypeError;return it(V)&&(V=void 0),_=_e(_),$(x,B,_,V)}}t("decorate",k);function g(x,B){function _(V,G){if(!Q(V))throw new TypeError;if(!ye(G)&&!Se(G))throw new TypeError;we(x,B,V,G)}return _}t("metadata",g);function S(x,B,_,V){if(!Q(_))throw new TypeError;return ye(V)||(V=_e(V)),we(x,B,_,V)}t("defineMetadata",S);function v(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),U(x,B,_)}t("hasMetadata",v);function C(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),D(x,B,_)}t("hasOwnMetadata",C);function O(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),oe(x,B,_)}t("getMetadata",O);function F(x,B,_){if(!Q(B))throw new TypeError;return ye(_)||(_=_e(_)),de(x,B,_)}t("getOwnMetadata",F);function Y(x,B){if(!Q(x))throw new TypeError;return ye(B)||(B=_e(B)),pe(x,B)}t("getMetadataKeys",Y);function I(x,B){if(!Q(x))throw new TypeError;return ye(B)||(B=_e(B)),he(x,B)}t("getOwnMetadataKeys",I);function E(x,B,_){if(!Q(B))throw new TypeError;ye(_)||(_=_e(_));var V=K(B,_,!1);if(ye(V)||!V.delete(x))return!1;if(V.size>0)return!0;var G=m.get(B);return G.delete(_),G.size>0||m.delete(B),!0}t("deleteMetadata",E);function q(x,B){for(var _=x.length-1;_>=0;--_){var V=x[_],G=V(B);if(!ye(G)&&!it(G)){if(!W(G))throw new TypeError;B=G}}return B}function $(x,B,_,V){for(var G=x.length-1;G>=0;--G){var Te=x[G],te=Te(B,_,V);if(!ye(te)&&!it(te)){if(!Q(te))throw new TypeError;V=te}}return V}function K(x,B,_){var V=m.get(x);if(ye(V)){if(!_)return;V=new A,m.set(x,V)}var G=V.get(B);if(ye(G)){if(!_)return;G=new A,V.set(B,G)}return G}function U(x,B,_){var V=D(x,B,_);if(V)return!0;var G=Fa(B);return it(G)?!1:U(x,G,_)}function D(x,B,_){var V=K(B,_,!1);return ye(V)?!1:me(V.has(x))}function oe(x,B,_){var V=D(x,B,_);if(V)return de(x,B,_);var G=Fa(B);if(!it(G))return oe(x,G,_)}function de(x,B,_){var V=K(B,_,!1);if(!ye(V))return V.get(x)}function we(x,B,_,V){var G=K(_,V,!0);G.set(x,B)}function pe(x,B){var _=he(x,B),V=Fa(x);if(V===null)return _;var G=pe(V,B);if(G.length<=0)return _;if(_.length<=0)return G;for(var Te=new b,te=[],re=0,J=_;re<J.length;re++){var ae=J[re],ce=Te.has(ae);ce||(Te.add(ae),te.push(ae))}for(var Ht=0,Lf=G;Ht<Lf.length;Ht++){var ae=Lf[Ht],ce=Te.has(ae);ce||(Te.add(ae),te.push(ae))}return te}function he(x,B){var _=[],V=K(x,B,!1);if(ye(V))return _;for(var G=V.keys(),Te=sb(G),te=0;;){var re=cb(Te);if(!re)return _.length=te,_;var J=ab(re);try{_[te]=J}catch(ae){try{lb(Te)}finally{throw ae}}te++}}function Ce(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function ye(x){return x===void 0}function it(x){return x===null}function Z(x){return typeof x=="symbol"}function Q(x){return typeof x=="object"?x!==null:typeof x=="function"}function M(x,B){switch(Ce(x)){case 0:return x;case 1:return x;case 2:return x;case 3:return x;case 4:return x;case 5:return x}var _=B===3?"string":B===5?"number":"default",V=lr(x,o);if(V!==void 0){var G=V.call(x,_);if(Q(G))throw new TypeError;return G}return ie(x,_==="default"?"number":_)}function ie(x,B){if(B==="string"){var _=x.toString;if(ve(_)){var V=_.call(x);if(!Q(V))return V}var G=x.valueOf;if(ve(G)){var V=G.call(x);if(!Q(V))return V}}else{var G=x.valueOf;if(ve(G)){var V=G.call(x);if(!Q(V))return V}var Te=x.toString;if(ve(Te)){var V=Te.call(x);if(!Q(V))return V}}throw new TypeError}function me(x){return!!x}function Pe(x){return""+x}function _e(x){var B=M(x,3);return Z(B)?B:Pe(B)}function X(x){return Array.isArray?Array.isArray(x):x instanceof Object?x instanceof Array:Object.prototype.toString.call(x)==="[object Array]"}function ve(x){return typeof x=="function"}function W(x){return typeof x=="function"}function Se(x){switch(Ce(x)){case 3:return!0;case 4:return!0;default:return!1}}function lr(x,B){var _=x[B];if(_!=null){if(!ve(_))throw new TypeError;return _}}function sb(x){var B=lr(x,s);if(!ve(B))throw new TypeError;var _=B.call(x);if(!Q(_))throw new TypeError;return _}function ab(x){return x.value}function cb(x){var B=x.next();return B.done?!1:B}function lb(x){var B=x.return;B&&B.call(x)}function Fa(x){var B=Object.getPrototypeOf(x);if(typeof x!="function"||x===y||B!==y)return B;var _=x.prototype,V=_&&Object.getPrototypeOf(_);if(V==null||V===Object.prototype)return B;var G=V.constructor;return typeof G!="function"||G===x?B:G}function ub(){var x={},B=[],_=function(){function te(re,J,ae){this._index=0,this._keys=re,this._values=J,this._selector=ae}return te.prototype["@@iterator"]=function(){return this},te.prototype[s]=function(){return this},te.prototype.next=function(){var re=this._index;if(re>=0&&re<this._keys.length){var J=this._selector(this._keys[re],this._values[re]);return re+1>=this._keys.length?(this._index=-1,this._keys=B,this._values=B):this._index++,{value:J,done:!1}}return{value:void 0,done:!0}},te.prototype.throw=function(re){throw this._index>=0&&(this._index=-1,this._keys=B,this._values=B),re},te.prototype.return=function(re){return this._index>=0&&(this._index=-1,this._keys=B,this._values=B),{value:re,done:!0}},te}();return function(){function te(){this._keys=[],this._values=[],this._cacheKey=x,this._cacheIndex=-2}return Object.defineProperty(te.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),te.prototype.has=function(re){return this._find(re,!1)>=0},te.prototype.get=function(re){var J=this._find(re,!1);return J>=0?this._values[J]:void 0},te.prototype.set=function(re,J){var ae=this._find(re,!0);return this._values[ae]=J,this},te.prototype.delete=function(re){var J=this._find(re,!1);if(J>=0){for(var ae=this._keys.length,ce=J+1;ce<ae;ce++)this._keys[ce-1]=this._keys[ce],this._values[ce-1]=this._values[ce];return this._keys.length--,this._values.length--,re===this._cacheKey&&(this._cacheKey=x,this._cacheIndex=-2),!0}return!1},te.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=x,this._cacheIndex=-2},te.prototype.keys=function(){return new _(this._keys,this._values,V)},te.prototype.values=function(){return new _(this._keys,this._values,G)},te.prototype.entries=function(){return new _(this._keys,this._values,Te)},te.prototype["@@iterator"]=function(){return this.entries()},te.prototype[s]=function(){return this.entries()},te.prototype._find=function(re,J){return this._cacheKey!==re&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=re)),this._cacheIndex<0&&J&&(this._cacheIndex=this._keys.length,this._keys.push(re),this._values.push(void 0)),this._cacheIndex},te}();function V(te,re){return te}function G(te,re){return re}function Te(te,re){return[te,re]}}function db(){return function(){function x(){this._map=new A}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(B){return this._map.has(B)},x.prototype.add=function(B){return this._map.set(B,B),this},x.prototype.delete=function(B){return this._map.delete(B)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.values()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[s]=function(){return this.keys()},x}()}function fb(){var x=16,B=d.create(),_=V();return function(){function J(){this._key=V()}return J.prototype.has=function(ae){var ce=G(ae,!1);return ce!==void 0?d.has(ce,this._key):!1},J.prototype.get=function(ae){var ce=G(ae,!1);return ce!==void 0?d.get(ce,this._key):void 0},J.prototype.set=function(ae,ce){var Ht=G(ae,!0);return Ht[this._key]=ce,this},J.prototype.delete=function(ae){var ce=G(ae,!1);return ce!==void 0?delete ce[this._key]:!1},J.prototype.clear=function(){this._key=V()},J}();function V(){var J;do J="@@WeakMap@@"+re();while(d.has(B,J));return B[J]=!0,J}function G(J,ae){if(!r.call(J,_)){if(!ae)return;Object.defineProperty(J,_,{value:d.create()})}return J[_]}function Te(J,ae){for(var ce=0;ce<ae;++ce)J[ce]=Math.random()*255|0;return J}function te(J){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(J)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(J)):Te(new Uint8Array(J),J):Te(new Array(J),J)}function re(){var J=te(x);J[6]=J[6]&79|64,J[8]=J[8]&191|128;for(var ae="",ce=0;ce<x;++ce){var Ht=J[ce];(ce===4||ce===6||ce===8)&&(ae+="-"),Ht<16&&(ae+="0"),ae+=Ht.toString(16).toLowerCase()}return ae}}function qa(x){return x.__=void 0,delete x.__,x}})})(Ka||(Ka={}));/*!
|
|
14
|
+
***************************************************************************** */var Za;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof yo=="object"?yo:typeof self=="object"?self:typeof this=="object"?this:c(),i=o(e);typeof r.Reflect<"u"&&(i=o(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(l,d){return function(y,p){Object.defineProperty(l,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function c(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,o=typeof Symbol=="function",s=o&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=o&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,d=!c&&!l,y={create:c?function(){return Ya(Object.create(null))}:l?function(){return Ya({__proto__:null})}:function(){return Ya({})},has:d?function(S,A){return i.call(S,A)}:function(S,A){return A in S},get:d?function(S,A){return i.call(S,A)?S[A]:void 0}:function(S,A){return S[A]}},p=Object.getPrototypeOf(Function),B=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Sb(),b=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:xb(),h=typeof WeakMap=="function"?WeakMap:Ab(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,k=vb(),m=kb(k);function x(S,A,I,j){if(X(I)){if(!Oe(S))throw new TypeError;if(!Ce(A))throw new TypeError;return Z(S,A)}else{if(!Oe(S))throw new TypeError;if(!V(A))throw new TypeError;if(!V(j)&&!X(j)&&!ee(j))throw new TypeError;return ee(j)&&(j=void 0),I=te(I),H(S,A,I,j)}}t("decorate",x);function v(S,A){function I(j,Q){if(!V(j))throw new TypeError;if(!X(Q)&&!zr(Q))throw new TypeError;he(S,A,j,Q)}return I}t("metadata",v);function C(S,A,I,j){if(!V(I))throw new TypeError;return X(j)||(j=te(j)),he(S,A,I,j)}t("defineMetadata",C);function _(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),P(S,A,I)}t("hasMetadata",_);function z(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),se(S,A,I)}t("hasOwnMetadata",z);function re(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),fe(S,A,I)}t("getMetadata",re);function E(S,A,I){if(!V(A))throw new TypeError;return X(I)||(I=te(I)),ke(S,A,I)}t("getOwnMetadata",E);function O(S,A){if(!V(S))throw new TypeError;return X(A)||(A=te(A)),ye(S,A)}t("getMetadataKeys",O);function G(S,A){if(!V(S))throw new TypeError;return X(A)||(A=te(A)),Be(S,A)}t("getOwnMetadataKeys",G);function M(S,A,I){if(!V(A))throw new TypeError;if(X(I)||(I=te(I)),!V(A))throw new TypeError;X(I)||(I=te(I));var j=ji(A,I,!1);return X(j)?!1:j.OrdinaryDeleteMetadata(S,A,I)}t("deleteMetadata",M);function Z(S,A){for(var I=S.length-1;I>=0;--I){var j=S[I],Q=j(A);if(!X(Q)&&!ee(Q)){if(!Ce(Q))throw new TypeError;A=Q}}return A}function H(S,A,I,j){for(var Q=S.length-1;Q>=0;--Q){var Se=S[Q],_e=Se(A,I,j);if(!X(_e)&&!ee(_e)){if(!V(_e))throw new TypeError;j=_e}}return j}function P(S,A,I){var j=se(S,A,I);if(j)return!0;var Q=Ja(A);return ee(Q)?!1:P(S,Q,I)}function se(S,A,I){var j=ji(A,I,!1);return X(j)?!1:Me(j.OrdinaryHasOwnMetadata(S,A,I))}function fe(S,A,I){var j=se(S,A,I);if(j)return ke(S,A,I);var Q=Ja(A);if(!ee(Q))return fe(S,Q,I)}function ke(S,A,I){var j=ji(A,I,!1);if(!X(j))return j.OrdinaryGetOwnMetadata(S,A,I)}function he(S,A,I,j){var Q=ji(I,j,!0);Q.OrdinaryDefineOwnMetadata(S,A,I,j)}function ye(S,A){var I=Be(S,A),j=Ja(S);if(j===null)return I;var Q=ye(j,A);if(Q.length<=0)return I;if(I.length<=0)return Q;for(var Se=new b,_e=[],ne=0,D=I;ne<D.length;ne++){var q=D[ne],L=Se.has(q);L||(Se.add(q),_e.push(q))}for(var W=0,oe=Q;W<oe.length;W++){var q=oe[W],L=Se.has(q);L||(Se.add(q),_e.push(q))}return _e}function Be(S,A){var I=ji(S,A,!1);return I?I.OrdinaryOwnMetadataKeys(S,A):[]}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 X(S){return S===void 0}function ee(S){return S===null}function ge(S){return typeof S=="symbol"}function V(S){return typeof S=="object"?S!==null:typeof S=="function"}function ae(S,A){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 I=A===3?"string":A===5?"number":"default",j=Jf(S,s);if(j!==void 0){var Q=j.call(S,I);if(V(Q))throw new TypeError;return Q}return me(S,I==="default"?"number":I)}function me(S,A){if(A==="string"){var I=S.toString;if(J(I)){var j=I.call(S);if(!V(j))return j}var Q=S.valueOf;if(J(Q)){var j=Q.call(S);if(!V(j))return j}}else{var Q=S.valueOf;if(J(Q)){var j=Q.call(S);if(!V(j))return j}var Se=S.toString;if(J(Se)){var j=Se.call(S);if(!V(j))return j}}throw new TypeError}function Me(S){return!!S}function $t(S){return""+S}function te(S){var A=ae(S,3);return ge(A)?A:$t(A)}function Oe(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function J(S){return typeof S=="function"}function Ce(S){return typeof S=="function"}function zr(S){switch(zt(S)){case 3:return!0;case 4:return!0;default:return!1}}function Wa(S,A){return S===A||S!==S&&A!==A}function Jf(S,A){var I=S[A];if(I!=null){if(!J(I))throw new TypeError;return I}}function Yf(S){var A=Jf(S,a);if(!J(A))throw new TypeError;var I=A.call(S);if(!V(I))throw new TypeError;return I}function Zf(S){return S.value}function Qf(S){var A=S.next();return A.done?!1:A}function Xf(S){var A=S.return;A&&A.call(S)}function Ja(S){var A=Object.getPrototypeOf(S);if(typeof S!="function"||S===p||A!==p)return A;var I=S.prototype,j=I&&Object.getPrototypeOf(I);if(j==null||j===Object.prototype)return A;var Q=j.constructor;return typeof Q!="function"||Q===S?A:Q}function wb(){var S;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(S=Cb(r.Reflect));var A,I,j,Q=new h,Se={registerProvider:_e,getProvider:D,setProvider:L};return Se;function _e(W){if(!Object.isExtensible(Se))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===W:break;case X(A):A=W;break;case A===W:break;case X(I):I=W;break;case I===W:break;default:j===void 0&&(j=new b),j.add(W);break}}function ne(W,oe){if(!X(A)){if(A.isProviderFor(W,oe))return A;if(!X(I)){if(I.isProviderFor(W,oe))return A;if(!X(j))for(var be=Yf(j);;){var xe=Qf(be);if(!xe)return;var ft=Zf(xe);if(ft.isProviderFor(W,oe))return Xf(be),ft}}}if(!X(S)&&S.isProviderFor(W,oe))return S}function D(W,oe){var be=Q.get(W),xe;return X(be)||(xe=be.get(oe)),X(xe)&&(xe=ne(W,oe),X(xe)||(X(be)&&(be=new B,Q.set(W,be)),be.set(oe,xe))),xe}function q(W){if(X(W))throw new TypeError;return A===W||I===W||!X(j)&&j.has(W)}function L(W,oe,be){if(!q(be))throw new Error("Metadata provider not registered.");var xe=D(W,oe);if(xe!==be){if(!X(xe))return!1;var ft=Q.get(W);X(ft)&&(ft=new B,Q.set(W,ft)),ft.set(oe,be)}return!0}}function vb(){var S;return!X(g)&&V(r.Reflect)&&Object.isExtensible(r.Reflect)&&(S=r.Reflect[g]),X(S)&&(S=wb()),!X(g)&&V(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}function kb(S){var A=new h,I={isProviderFor:function(q,L){var W=A.get(q);return X(W)?!1:W.has(L)},OrdinaryDefineOwnMetadata:_e,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:Se,OrdinaryOwnMetadataKeys:ne,OrdinaryDeleteMetadata:D};return k.registerProvider(I),I;function j(q,L,W){var oe=A.get(q),be=!1;if(X(oe)){if(!W)return;oe=new B,A.set(q,oe),be=!0}var xe=oe.get(L);if(X(xe)){if(!W)return;if(xe=new B,oe.set(L,xe),!S.setProvider(q,L,I))throw oe.delete(L),be&&A.delete(q),new Error("Wrong provider for target.")}return xe}function Q(q,L,W){var oe=j(L,W,!1);return X(oe)?!1:Me(oe.has(q))}function Se(q,L,W){var oe=j(L,W,!1);if(!X(oe))return oe.get(q)}function _e(q,L,W,oe){var be=j(W,oe,!0);be.set(q,L)}function ne(q,L){var W=[],oe=j(q,L,!1);if(X(oe))return W;for(var be=oe.keys(),xe=Yf(be),ft=0;;){var ep=Qf(xe);if(!ep)return W.length=ft,W;var Bb=Zf(ep);try{W[ft]=Bb}catch(Ib){try{Xf(xe)}finally{throw Ib}}ft++}}function D(q,L,W){var oe=j(L,W,!1);if(X(oe)||!oe.delete(q))return!1;if(oe.size===0){var be=A.get(L);X(be)||(be.delete(W),be.size===0&&A.delete(be))}return!0}}function Cb(S){var A=S.defineMetadata,I=S.hasOwnMetadata,j=S.getOwnMetadata,Q=S.getOwnMetadataKeys,Se=S.deleteMetadata,_e=new h,ne={isProviderFor:function(D,q){var L=_e.get(D);return X(L)?Q(D,q).length?(X(L)&&(L=new b,_e.set(D,L)),L.add(q),!0):!1:L.has(q)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:I,OrdinaryGetOwnMetadata:j,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:Se};return ne}function ji(S,A,I){var j=k.getProvider(S,A);if(!X(j))return j;if(I){if(k.setProvider(S,A,m))return m;throw new Error("Illegal state.")}}function Sb(){var S={},A=[],I=function(){function ne(D,q,L){this._index=0,this._keys=D,this._values=q,this._selector=L}return ne.prototype["@@iterator"]=function(){return this},ne.prototype[a]=function(){return this},ne.prototype.next=function(){var D=this._index;if(D>=0&&D<this._keys.length){var q=this._selector(this._keys[D],this._values[D]);return D+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:q,done:!1}}return{value:void 0,done:!0}},ne.prototype.throw=function(D){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),D},ne.prototype.return=function(D){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:D,done:!0}},ne}(),j=function(){function ne(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(ne.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ne.prototype.has=function(D){return this._find(D,!1)>=0},ne.prototype.get=function(D){var q=this._find(D,!1);return q>=0?this._values[q]:void 0},ne.prototype.set=function(D,q){var L=this._find(D,!0);return this._values[L]=q,this},ne.prototype.delete=function(D){var q=this._find(D,!1);if(q>=0){for(var L=this._keys.length,W=q+1;W<L;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,Wa(D,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},ne.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},ne.prototype.keys=function(){return new I(this._keys,this._values,Q)},ne.prototype.values=function(){return new I(this._keys,this._values,Se)},ne.prototype.entries=function(){return new I(this._keys,this._values,_e)},ne.prototype["@@iterator"]=function(){return this.entries()},ne.prototype[a]=function(){return this.entries()},ne.prototype._find=function(D,q){if(!Wa(this._cacheKey,D)){this._cacheIndex=-1;for(var L=0;L<this._keys.length;L++)if(Wa(this._keys[L],D)){this._cacheIndex=L;break}}return this._cacheIndex<0&&q&&(this._cacheIndex=this._keys.length,this._keys.push(D),this._values.push(void 0)),this._cacheIndex},ne}();return j;function Q(ne,D){return ne}function Se(ne,D){return D}function _e(ne,D){return[ne,D]}}function xb(){var S=function(){function A(){this._map=new B}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(I){return this._map.has(I)},A.prototype.add=function(I){return this._map.set(I,I),this},A.prototype.delete=function(I){return this._map.delete(I)},A.prototype.clear=function(){this._map.clear()},A.prototype.keys=function(){return this._map.keys()},A.prototype.values=function(){return this._map.keys()},A.prototype.entries=function(){return this._map.entries()},A.prototype["@@iterator"]=function(){return this.keys()},A.prototype[a]=function(){return this.keys()},A}();return S}function Ab(){var S=16,A=y.create(),I=j();return function(){function D(){this._key=j()}return D.prototype.has=function(q){var L=Q(q,!1);return L!==void 0?y.has(L,this._key):!1},D.prototype.get=function(q){var L=Q(q,!1);return L!==void 0?y.get(L,this._key):void 0},D.prototype.set=function(q,L){var W=Q(q,!0);return W[this._key]=L,this},D.prototype.delete=function(q){var L=Q(q,!1);return L!==void 0?delete L[this._key]:!1},D.prototype.clear=function(){this._key=j()},D}();function j(){var D;do D="@@WeakMap@@"+ne();while(y.has(A,D));return A[D]=!0,D}function Q(D,q){if(!i.call(D,I)){if(!q)return;Object.defineProperty(D,I,{value:y.create()})}return D[I]}function Se(D,q){for(var L=0;L<q;++L)D[L]=Math.random()*255|0;return D}function _e(D){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(D)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(D)):Se(new Uint8Array(D),D):Se(new Array(D),D)}function ne(){var D=_e(S);D[6]=D[6]&79|64,D[8]=D[8]&191|128;for(var q="",L=0;L<S;++L){var W=D[L];(L===4||L===6||L===8)&&(q+="-"),W<16&&(q+="0"),q+=W.toString(16).toLowerCase()}return q}}function Ya(S){return S.__=void 0,delete S.__,S}})})(Za||(Za={}));/*!
|
|
15
15
|
* MIT License
|
|
16
16
|
*
|
|
17
17
|
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
35
|
* SOFTWARE.
|
|
36
36
|
*
|
|
37
|
-
*/const
|
|
37
|
+
*/const op="[object ArrayBuffer]";class ${static isArrayBuffer(t){return Object.prototype.toString.call(t)===op}static toArrayBuffer(t){return this.isArrayBuffer(t)?t:t.byteLength===t.buffer.byteLength||t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:this.toUint8Array(t.buffer).slice(t.byteOffset,t.byteOffset+t.byteLength).buffer}static toUint8Array(t){return this.toView(t,Uint8Array)}static toView(t,r){if(t.constructor===r)return t;if(this.isArrayBuffer(t))return new r(t);if(this.isArrayBufferView(t))return new r(t.buffer,t.byteOffset,t.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(t){return this.isArrayBufferView(t)||this.isArrayBuffer(t)}static isArrayBufferView(t){return ArrayBuffer.isView(t)||t&&this.isArrayBuffer(t.buffer)}static isEqual(t,r){const i=$.toUint8Array(t),o=$.toUint8Array(r);if(i.length!==o.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==o[s])return!1;return!0}static concat(...t){let r;Array.isArray(t[0])&&!(t[1]instanceof Function)||Array.isArray(t[0])&&t[1]instanceof Function?r=t[0]:t[t.length-1]instanceof Function?r=t.slice(0,t.length-1):r=t;let i=0;for(const a of r)i+=a.byteLength;const o=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);o.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const go="string",sp=/^[0-9a-f]+$/i,ap=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,cp=/^[a-zA-Z0-9-_]+$/;class Qa{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);return i.buffer}static toString(t){const r=$.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class pt{static toString(t,r=!1){const i=$.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=o.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),o=new DataView(i);for(let s=0;s<t.length;s++)o.setUint16(s*2,t.charCodeAt(s),r);return i}}class U{static isHex(t){return typeof t===go&&sp.test(t)}static isBase64(t){return typeof t===go&&ap.test(t)}static isBase64Url(t){return typeof t===go&&cp.test(t)}static ToString(t,r="utf8"){const i=$.toUint8Array(t);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return pt.toString(i,!0);case"utf16":case"utf16be":return pt.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(t,r="utf8"){if(!t)return new ArrayBuffer(0);switch(r.toLowerCase()){case"utf8":return this.FromUtf8String(t);case"binary":return this.FromBinary(t);case"hex":return this.FromHex(t);case"base64":return this.FromBase64(t);case"base64url":return this.FromBase64Url(t);case"utf16le":return pt.fromString(t,!0);case"utf16":case"utf16be":return pt.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=$.toUint8Array(t);if(typeof btoa<"u"){const i=this.ToString(r,"binary");return btoa(i)}else return Buffer.from(r).toString("base64")}static FromBase64(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!U.isBase64(r))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(r)):new Uint8Array(Buffer.from(r,"base64")).buffer}static FromBase64Url(t){const r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!U.isBase64Url(r))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(r.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(t){return this.ToBase64(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(t,r=U.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return Qa.fromString(t);case"utf16":case"utf16be":return pt.fromString(t);case"utf16le":case"usc2":return pt.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=U.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return Qa.toString(t);case"utf16":case"utf16be":return pt.toString(t);case"utf16le":case"usc2":return pt.toString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromBinary(t){const r=t.length,i=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);return i.buffer}static ToBinary(t){const r=$.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=$.toUint8Array(t);let i="";const o=r.length;for(let s=0;s<o;s++){const a=r[s];a<16&&(i+="0"),i+=a.toString(16)}return i}static FromHex(t){let r=this.formatString(t);if(!r)return new ArrayBuffer(0);if(!U.isHex(r))throw new TypeError("Argument 'hexString' is not HEX encoded");r.length%2&&(r=`0${r}`);const i=new Uint8Array(r.length/2);for(let o=0;o<r.length;o=o+2){const s=r.slice(o,o+2);i[o/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return pt.toString(t,r)}static FromUtf16String(t,r=!1){return pt.fromString(t,r)}static Base64Padding(t){const r=4-t.length%4;if(r<4)for(let i=0;i<r;i++)t+="=";return t}static formatString(t){return(t==null?void 0:t.replace(/[\n\r\t ]/g,""))||""}}U.DEFAULT_UTF8_ENCODING="utf8";function lp(...e){const t=e.map(o=>o.byteLength).reduce((o,s)=>o+s),r=new Uint8Array(t);let i=0;return e.map(o=>new Uint8Array(o)).forEach(o=>{for(const s of o)r[i++]=s}),r.buffer}function Xa(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}/*!
|
|
38
38
|
Copyright (c) Peculiar Ventures, LLC
|
|
39
|
-
*/function
|
|
39
|
+
*/function hr(e,t){let r=0;if(e.length===1)return e[0];for(let i=e.length-1;i>=0;i--)r+=e[e.length-1-i]*Math.pow(2,t*i);return r}function Gt(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let y=c-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(o/p),o-=d[s-y-1]*p}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function mo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),o=new Uint8Array(i);for(const s of e)o.set(s,r),r+=s.length;return o}function ec(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=hr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,hr(s,8)-i}function up(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=Gt(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let o=Gt(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),c=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function dp(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<r.length;o++)if(r[o]!==i[o])return!1;return!0}function Ze(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,o=new Array(i);for(let a=0;a<i;a++)o[a]="0";return o.join("").concat(r)}/*!
|
|
40
40
|
* Copyright (c) 2014, GMO GlobalSign
|
|
41
41
|
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
42
42
|
* All rights reserved.
|
|
@@ -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 po(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function wt(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class _i{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return po(this.items)}}const qr=[new Uint8Array([1])],Ja="0123456789",ho="name",Ya="valueHexView",Xf="isHexOnly",ep="idBlock",tp="tagClass",rp="tagNumber",ip="isConstructed",np="fromBER",op="toBER",sp="local",Le="",nt=new ArrayBuffer(0),Ti=new Uint8Array(0),Kr="EndOfContent",Za="OCTET STRING",Qa="BIT STRING";function dt(e){var t;return t=class extends e{constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?j.toUint8Array(s.valueHex):Ti}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!wt(this,a,o,s))return-1;const c=o+s;return this.valueHexView=a.subarray(o,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),o)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",nt)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:R.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class qt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:o=Ti}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=j.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:R.ToHex(this.valueBeforeDecodeView)}}}qt.NAME="baseBlock";class Me extends qt{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Me.NAME="valueBlock";class Xa extends dt(qt){constructor({idBlock:t={}}={}){var r,i,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?j.toUint8Array(t.valueHex):Ti,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",nt}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=Ft(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(t,r,i){const o=j.toUint8Array(t);if(!wt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const A=new Uint8Array(y);for(let b=0;b<d.length;b++)A[b]=d[b];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let A=0;A<l;A++)p[A]=d[A];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=dr(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}Xa.NAME="identificationBlock";class ec extends qt{constructor({lenBlock:t={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,i){const o=j.toUint8Array(t);if(!wt(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=o.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=dr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=Ft(this.length,8);if(o.byteLength>127)return this.error="Too big length",nt;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}ec.NAME="lengthBlock";const P={};class Ee extends qt{constructor({name:t=Le,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new Xa(o),this.lenBlock=new ec(o),this.valueBlock=s?new s(o):new Me(o)}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i: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(t,r){const i=r||new _i;r||tc(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?nt:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():R.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${R.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),i=t.toBER();return Qf(r,i)}}Ee.NAME="BaseBlock";function tc(e){if(e instanceof P.Constructed)for(const t of e.valueBlock.value)tc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class yo extends Ee{constructor({value:t=Le,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i: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}'`}}yo.NAME="BaseStringBlock";class rc extends dt(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}rc.NAME="PrimitiveValueBlock";var ic;class zr extends Ee{constructor(t={}){super(t,rc),this.idBlock.isConstructed=!1}}ic=zr,P.Primitive=ic,zr.NAME="PRIMITIVE";function ap(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function fr(e,t=0,r=e.length){const i=t;let o=new Ee({},Me);const s=new qt;if(!wt(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let c=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=c,r-=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 l=Ee;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};l=P.EndOfContent;break;case 1:l=P.Boolean;break;case 2:l=P.Integer;break;case 3:l=P.BitString;break;case 4:l=P.OctetString;break;case 5:l=P.Null;break;case 6:l=P.ObjectIdentifier;break;case 10:l=P.Enumerated;break;case 12:l=P.Utf8String;break;case 13:l=P.RelativeObjectIdentifier;break;case 14:l=P.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=P.Sequence;break;case 17:l=P.Set;break;case 18:l=P.NumericString;break;case 19:l=P.PrintableString;break;case 20:l=P.TeletexString;break;case 21:l=P.VideotexString;break;case 22:l=P.IA5String;break;case 23:l=P.UTCTime;break;case 24:l=P.GeneralizedTime;break;case 25:l=P.GraphicString;break;case 26:l=P.VisibleString;break;case 27:l=P.GeneralString;break;case 28:l=P.UniversalString;break;case 29:l=P.CharacterString;break;case 30:l=P.BmpString;break;case 31:l=P.DATE;break;case 32:l=P.TimeOfDay;break;case 33:l=P.DateTime;break;case 34:l=P.Duration;break;default:{const d=o.idBlock.isConstructed?new P.Constructed:new P.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?P.Constructed:P.Primitive}return o=ap(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:c,result:o}}function pr(e){if(!e.byteLength){const t=new Ee({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return fr(j.toUint8Array(e).slice(),0,e.byteLength)}function cp(e,t){return e?1:t}class Vt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=j.toUint8Array(t);if(!wt(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;cp(this.isIndefiniteForm,i)>0;){const a=fr(o,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Kr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Kr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new _i;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?nt:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Vt.NAME="ConstructedValueBlock";var nc;class He extends Ee{constructor(t={}){super(t,Vt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i: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 t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
71
|
+
*/function Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function bo(e){let t=0,r=0;for(let o=0;o<e.length;o++){const s=e[o];t+=s.byteLength}const i=new Uint8Array(t);for(let o=0;o<e.length;o++){const s=e[o];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function St(e,t,r,i){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):i<0?(e.error="Wrong parameter: inputLength less than zero",!1):t.byteLength-r-i<0?(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class $i{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return bo(this.items)}}const Wr=[new Uint8Array([1])],tc="0123456789",wo="name",rc="valueHexView",fp="isHexOnly",pp="idBlock",hp="tagClass",yp="tagNumber",gp="isConstructed",mp="fromBER",bp="toBER",wp="local",qe="",st=new ArrayBuffer(0),Mi=new Uint8Array(0),Jr="EndOfContent",ic="OCTET STRING",nc="BIT STRING";function ht(e){var t;return t=class extends e{constructor(...i){var o;super(...i);const s=i[0]||{};this.isHexOnly=(o=s.isHexOnly)!==null&&o!==void 0?o:!1,this.valueHexView=s.valueHex?$.toUint8Array(s.valueHex):Mi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,o,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!St(this,a,o,s))return-1;const c=o+s;return this.valueHexView=a.subarray(o,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),o)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",st)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:U.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Wt{constructor({blockLength:t=0,error:r=qe,warnings:i=[],valueBeforeDecode:o=Mi}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=$.toUint8Array(o)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(t){this.valueBeforeDecodeView=new Uint8Array(t)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:U.ToHex(this.valueBeforeDecodeView)}}}Wt.NAME="baseBlock";class Le extends Wt{fromBER(t,r,i){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}Le.NAME="valueBlock";class oc extends ht(Wt){constructor({idBlock:t={}}={}){var r,i,o,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?$.toUint8Array(t.valueHex):Mi,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(o=t.tagNumber)!==null&&o!==void 0?o:-1,this.isConstructed=(s=t.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(t=!1){let r=0;switch(this.tagClass){case 1:r|=0;break;case 2:r|=64;break;case 3:r|=128;break;case 4:r|=192;break;default:return this.error="Unknown tag class",st}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const o=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,o[0]=r}return o.buffer}if(!this.isHexOnly){const o=Gt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const o=this.valueHexView;for(let s=0;s<o.length-1;s++)i[s+1]=o[s]|128;i[this.valueHexView.byteLength]=o[o.length-1]}return i.buffer}fromBER(t,r,i){const o=$.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const B=new Uint8Array(y);for(let b=0;b<d.length;b++)B[b]=d[b];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let B=0;B<l;B++)p[B]=d[B];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=hr(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}oc.NAME="identificationBlock";class sc extends Wt{constructor({lenBlock:t={}}={}){var r,i,o;super(),this.isIndefiniteForm=(r=t.isIndefiniteForm)!==null&&r!==void 0?r:!1,this.longFormUsed=(i=t.longFormUsed)!==null&&i!==void 0?i:!1,this.length=(o=t.length)!==null&&o!==void 0?o:0}fromBER(t,r,i){const o=$.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=o.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=hr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const o=Gt(this.length,8);if(o.byteLength>127)return this.error="Too big length",st;if(r=new ArrayBuffer(o.byteLength+1),t)return r;const s=new Uint8Array(o);i=new Uint8Array(r),i[0]=o.byteLength|128;for(let a=0;a<o.byteLength;a++)i[a+1]=s[a];return r}return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=this.length),r}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}sc.NAME="lengthBlock";const R={};class Ve extends Wt{constructor({name:t=qe,optional:r=!1,primitiveSchema:i,...o}={},s){super(o),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new oc(o),this.lenBlock=new sc(o),this.valueBlock=s?new s(o):new Le(o)}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i: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(t,r){const i=r||new $i;r||ac(this);const o=this.idBlock.toBER(t);if(i.write(o),this.lenBlock.isIndefiniteForm)i.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(t,i),i.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(t);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(t);i.write(a),i.write(s)}return r?st:i.final()}toJSON(){const t={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(t.primitiveSchema=this.primitiveSchema.toJSON()),t}toString(t="ascii"){return t==="ascii"?this.onAsciiEncoding():U.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${U.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(t){if(this===t)return!0;if(!(t instanceof this.constructor))return!1;const r=this.toBER(),i=t.toBER();return dp(r,i)}}Ve.NAME="BaseBlock";function ac(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)ac(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class vo extends Ve{constructor({value:t=qe,...r}={},i){super(r,i),t&&this.fromString(t)}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}fromBER(t,r,i){const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i: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}'`}}vo.NAME="BaseStringBlock";class cc extends ht(Le){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}cc.NAME="PrimitiveValueBlock";var lc;class Yr extends Ve{constructor(t={}){super(t,cc),this.idBlock.isConstructed=!1}}lc=Yr,R.Primitive=lc,Yr.NAME="PRIMITIVE";function vp(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function yr(e,t=0,r=e.length){const i=t;let o=new Ve({},Le);const s=new Wt;if(!St(s,e,t,r))return o.error=s.error,{offset:-1,result:o};if(!e.subarray(t,t+r).length)return o.error="Zero buffer length",{offset:-1,result:o};let c=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),c===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=c,r-=o.idBlock.blockLength,c=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),c===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=c,r-=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 l=Ve;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};l=R.EndOfContent;break;case 1:l=R.Boolean;break;case 2:l=R.Integer;break;case 3:l=R.BitString;break;case 4:l=R.OctetString;break;case 5:l=R.Null;break;case 6:l=R.ObjectIdentifier;break;case 10:l=R.Enumerated;break;case 12:l=R.Utf8String;break;case 13:l=R.RelativeObjectIdentifier;break;case 14:l=R.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:l=R.Sequence;break;case 17:l=R.Set;break;case 18:l=R.NumericString;break;case 19:l=R.PrintableString;break;case 20:l=R.TeletexString;break;case 21:l=R.VideotexString;break;case 22:l=R.IA5String;break;case 23:l=R.UTCTime;break;case 24:l=R.GeneralizedTime;break;case 25:l=R.GraphicString;break;case 26:l=R.VisibleString;break;case 27:l=R.GeneralString;break;case 28:l=R.UniversalString;break;case 29:l=R.CharacterString;break;case 30:l=R.BmpString;break;case 31:l=R.DATE;break;case 32:l=R.TimeOfDay;break;case 33:l=R.DateTime;break;case 34:l=R.Duration;break;default:{const d=o.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=o.idBlock,d.lenBlock=o.lenBlock,d.warnings=o.warnings,o=d}}break;case 2:case 3:case 4:default:l=o.idBlock.isConstructed?R.Constructed:R.Primitive}return o=vp(o,l),c=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:c,result:o}}function gr(e){if(!e.byteLength){const t=new Ve({},Le);return t.error="Input buffer has zero length",{offset:-1,result:t}}return yr($.toUint8Array(e).slice(),0,e.byteLength)}function kp(e,t){return e?1:t}class Mt extends Le{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=$.toUint8Array(t);if(!St(this,o,r,i))return-1;if(this.valueBeforeDecodeView=o.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;kp(this.isIndefiniteForm,i)>0;){const a=yr(o,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new $i;for(let o=0;o<this.value.length;o++)this.value[o].toBER(t,i);return r?st:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}Mt.NAME="ConstructedValueBlock";var uc;class Ke extends Ve{constructor(t={}){super(t,Mt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const o=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i: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 t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
72
72
|
`).map(o=>` ${o}`).join(`
|
|
73
73
|
`));const r=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return t.length?`${r} :
|
|
74
74
|
${t.join(`
|
|
75
|
-
`)}`:`${r} :`}}nc=He,P.Constructed=nc,He.NAME="CONSTRUCTED";class oc extends Me{fromBER(t,r,i){return r}toBER(t){return nt}}oc.override="EndOfContentValueBlock";var sc;class mo extends Ee{constructor(t={}){super(t,oc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}sc=mo,P.EndOfContent=sc,mo.NAME=Kr;var ac;class Kt extends Ee{constructor(t={}){super(t,Me),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}ac=Kt,P.Null=ac,Kt.NAME="NULL";class cc extends dt(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=j.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const o=j.toUint8Array(t);return wt(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Wa.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}cc.NAME="BooleanValueBlock";var lc;let Vi=class extends Ee{constructor(t={}){super(t,cc),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};lc=Vi,P.Boolean=lc,Vi.NAME="BOOLEAN";class uc extends dt(Vt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Vt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Kr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Za)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?Vt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}uc.NAME="OctetStringValueBlock";var dc;let zt=class Hf extends Ee{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},uc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=fr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?He.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${R.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof Hf&&t.push(r.valueBlock.valueHexView);return j.concat(t)}};dc=zt,P.OctetString=dc,zt.NAME=Za;class fc extends dt(Vt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Vt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Kr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==Qa)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return o}const s=j.toUint8Array(t);if(!wt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=fr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Vt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return nt;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}fc.NAME="BitStringValueBlock";var pc;let Gt=class extends Ee{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},fc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return He.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};pc=Gt,P.BitString=pc,Gt.NAME=Qa;var hc;function lp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),o=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=o.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let A=y;A>=0;A--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=fo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=fo(r,s)),s}function yc(e){if(e>=qr.length)for(let t=qr.length;t<=e;t++){const r=new Uint8Array([0]);let i=qr[t-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=fo(r,i)),qr.push(i)}return qr[e]}function up(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=o.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class go extends dt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}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=Wa.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Zf(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,o=0){const s=this.fromBER(t,r,i);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const o=super.fromBER(t,r,i);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,o;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){o=s[l];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=up(yc(i),r),a="-";break;default:r=lp(r,yc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=Ja.charAt(r[l]));return c===!1&&(a+=Ja.charAt(0)),a}}hc=go,go.NAME="IntegerValueBlock",Object.defineProperty(hc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var mc;class ft extends Ee{constructor(t={}){super(t,go),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Oi(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Oi();const r=BigInt(t),i=new _i,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(R.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${R.ToHex(c)}`)+r,y=j.toUint8Array(R.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new ft({valueHex:i.final()})}convertToDER(){const t=new ft({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ft({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}mc=ft,P.Integer=mc,ft.NAME="INTEGER";var gc;class ji extends ft{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}gc=ji,P.Enumerated=gc,ji.NAME="ENUMERATED";class bo extends dt(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const o=j.toUint8Array(t);if(!wt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Oi();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Ft(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i}toString(){let t="";if(this.isHexOnly)t=R.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}bo.NAME="sidBlock";class bc extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new bo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,nt;r.push(o)}return po(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new bo;if(o>Number.MAX_SAFE_INTEGER){Oi();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}bc.NAME="ObjectIdentifierValueBlock";var wc;class Di extends Ee{constructor(t={}){super(t,bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}wc=Di,P.ObjectIdentifier=wc,Di.NAME="OBJECT IDENTIFIER";class wo extends dt(qt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=j.toUint8Array(t);if(!wt(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Ft(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",nt;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=R.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}wo.NAME="relativeSidBlock";class vc extends Me{constructor({value:t=Le,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new wo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const i=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,nt;i.push(s)}return po(i)}fromString(t){this.value=[];let r=0,i=0,o="";do{i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1;const s=new wo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}vc.NAME="RelativeObjectIdentifierValueBlock";var kc;class vo extends Ee{constructor(t={}){super(t,vc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}kc=vo,P.RelativeObjectIdentifier=kc,vo.NAME="RelativeObjectIdentifier";var Cc;class vt extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Cc=vt,P.Sequence=Cc,vt.NAME="SEQUENCE";var Sc;let kt=class extends He{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Sc=kt,P.Set=Sc,kt.NAME="SET";class xc extends dt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}xc.NAME="StringValueBlock";class Ac extends xc{}Ac.NAME="SimpleStringValueBlock";class Je extends yo{constructor({...t}={}){super(t,Ac)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,j.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);this.valueBlock.value=t}}Je.NAME="SIMPLE STRING";class Bc extends Je{fromBuffer(t){this.valueBlock.valueHexView=j.toUint8Array(t);try{this.valueBlock.value=R.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=R.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(R.FromUtf8String(t)),this.valueBlock.value=t}}Bc.NAME="Utf8StringValueBlock";var Ic;class Ct extends Bc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Ic=Ct,P.Utf8String=Ic,Ct.NAME="UTF8String";class Ec extends Je{fromBuffer(t){this.valueBlock.value=R.ToUtf16String(t),this.valueBlock.valueHexView=j.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(R.FromUtf16String(t))}}Ec.NAME="BmpStringValueBlock";var Nc;class $i extends Ec{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Nc=$i,P.BmpString=Nc,$i.NAME="BMPString";class Oc extends Je{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Ft(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}Oc.NAME="UniversalStringValueBlock";var _c;class Pi extends Oc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_c=Pi,P.UniversalString=_c,Pi.NAME="UniversalString";var Tc;class Mi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Tc=Mi,P.NumericString=Tc,Mi.NAME="NumericString";var Vc;class Ri extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Vc=Ri,P.PrintableString=Vc,Ri.NAME="PrintableString";var jc;class Ui extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}jc=Ui,P.TeletexString=jc,Ui.NAME="TeletexString";var Dc;class Li extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Dc=Li,P.VideotexString=Dc,Li.NAME="VideotexString";var $c;class Hi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}$c=Hi,P.IA5String=$c,Hi.NAME="IA5String";var Pc;class Fi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Pc=Fi,P.GraphicString=Pc,Fi.NAME="GraphicString";var Mc;class Gr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Mc=Gr,P.VisibleString=Mc,Gr.NAME="VisibleString";var Rc;class qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Rc=qi,P.GeneralString=Rc,qi.NAME="GeneralString";var Uc;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Uc=Ki,P.CharacterString=Uc,Ki.NAME="CharacterString";var Lc;class Wr extends Gr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,j.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=We(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=We(this.month,2),r[2]=We(this.day,2),r[3]=We(this.hour,2),r[4]=We(this.minute,2),r[5]=We(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}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}}}Lc=Wr,P.UTCTime=Lc,Wr.NAME="UTCTime";var Hc;class zi extends Wr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,A=i.indexOf("+"),b="";if(A===-1&&(A=i.indexOf("-"),p=-1),A!==-1){if(b=i.substring(A+1),i=i.substring(0,A),b.length!==2&&b.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(b.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,b.length===4){if(h=parseInt(b.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=i.substring(0,d)}else o=i;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(We(this.year,4)),r.push(We(this.month,2)),r.push(We(this.day,2)),r.push(We(this.hour,2)),r.push(We(this.minute,2)),r.push(We(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(We(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Hc=zi,P.GeneralizedTime=Hc,zi.NAME="GeneralizedTime";var Fc;class ko extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Fc=ko,P.DATE=Fc,ko.NAME="DATE";var qc;class Co extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}qc=Co,P.TimeOfDay=qc,Co.NAME="TimeOfDay";var Kc;class So extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Kc=So,P.DateTime=Kc,So.NAME="DateTime";var zc;class xo extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}zc=xo,P.Duration=zc,xo.NAME="Duration";var Gc;class Ao extends Ct{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Gc=Ao,P.TIME=Gc,Ao.NAME="TIME";class Wt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Bo extends Wt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Gi extends Wt{constructor({value:t=new Wt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class dp{constructor({data:t=Ti}={}){this.dataView=j.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=j.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=j.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Jt(e,t,r){if(r instanceof Bo){for(let s=0;s<r.value.length;s++)if(Jt(e,t,r.value[s]).verified)return{verified:!0,result:e};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(ho)&&(s.name=r.name),s}}if(r instanceof Wt)return r.hasOwnProperty(ho)&&(e[r.name]=t),{verified:!0,result:e};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ep in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(np in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(op in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(tp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(rp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(ip)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Xf in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(!(Ya in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(e[r.name]=t)),r instanceof P.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Gi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Gi){if(a=Jt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(ho in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};sp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Jt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&Ya in t.valueBlock){const s=fr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],a.name=r.name)),a}return Jt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function fp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=fr(j.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Jt(r.result,r.result,t)}const Wc=Object.freeze(Object.defineProperty({__proto__:null,Any:Wt,BaseBlock:Ee,BaseStringBlock:yo,BitString:Gt,BmpString:$i,Boolean:Vi,CharacterString:Ki,Choice:Bo,Constructed:He,DATE:ko,DateTime:So,Duration:xo,EndOfContent:mo,Enumerated:ji,GeneralString:qi,GeneralizedTime:zi,GraphicString:Fi,HexBlock:dt,IA5String:Hi,Integer:ft,Null:Kt,NumericString:Mi,ObjectIdentifier:Di,OctetString:zt,Primitive:zr,PrintableString:Ri,RawData:dp,RelativeObjectIdentifier:vo,Repeated:Gi,Sequence:vt,Set:kt,TIME:Ao,TeletexString:Ui,TimeOfDay:Co,UTCTime:Wr,UniversalString:Pi,Utf8String:Ct,ValueBlock:Me,VideotexString:Li,ViewWriter:_i,VisibleString:Gr,compareSchema:Jt,fromBER:pr,verifySchema:fp},Symbol.toStringTag,{value:"Module"}));var N;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(N||(N={}));var w;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(w||(w={}));class Wi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(j.isBufferSource(t))this.unusedBits=r,this.value=j.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Gt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Gt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Gt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ne{constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):j.isBufferSource(t)?this.buffer=j.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}fromASN(t){if(!(t instanceof zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new zt({valueHex:this.buffer})}toSchema(t){return new zt({name:t})}}const pp={fromASN:e=>e instanceof Kt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Kt;const t=pr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},hp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ft({value:+e})},yp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new ji({value:e})},ge={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ft({valueHex:e})},mp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Gt({valueHex:e})},gp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Di({value:e})},bp={fromASN:e=>e.valueBlock.value,toASN:e=>new Vi({value:e})},Ji={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new zt({valueHex:e})},wp={fromASN:e=>new ne(e.getValue()),toASN:e=>e.toASN()};function Qe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const Jc=Qe(Ct),vp=Qe($i),kp=Qe(Pi),Cp=Qe(Mi),Sp=Qe(Ri),xp=Qe(Ui),Ap=Qe(Li),Bp=Qe(Hi),Ip=Qe(Fi),Ep=Qe(Gr),Np=Qe(qi),Op=Qe(Ki),_p={fromASN:e=>e.toDate(),toASN:e=>new Wr({valueDate:e})},Tp={fromASN:e=>e.toDate(),toASN:e=>new zi({valueDate:e})},Vp={fromASN:()=>null,toASN:()=>new Kt};function Io(e){switch(e){case w.Any:return pp;case w.BitString:return mp;case w.BmpString:return vp;case w.Boolean:return bp;case w.CharacterString:return Op;case w.Enumerated:return yp;case w.GeneralString:return Np;case w.GeneralizedTime:return Tp;case w.GraphicString:return Ip;case w.IA5String:return Bp;case w.Integer:return hp;case w.Null:return Vp;case w.NumericString:return Cp;case w.ObjectIdentifier:return gp;case w.OctetString:return Ji;case w.PrintableString:return Sp;case w.TeletexString:return xp;case w.UTCTime:return _p;case w.UniversalString:return kp;case w.Utf8String:return Jc;case w.VideotexString:return Ap;case w.VisibleString:return Ep;default:return null}}function St(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:St(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function Yc(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:Yc(r)}return!1}function jp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class Dp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:N.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),o=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=w[a.type],p=Wc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else St(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===N.Choice?l=new Wt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Wt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?kt:vt;l=new y({name:"",value:[new Gi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||St(a.type)){const y=a.repeated?He:zr;o.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new He({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new He({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case N.Sequence:return new vt({value:o,name:""});case N.Set:return new kt({value:o,name:""});case N.Choice:return new Bo({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const Xe=new Dp,T=e=>t=>{let r;Xe.has(t)?r=Xe.get(t):(r=Xe.createDefault(t),Xe.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Xe.has(t.constructor)?i=Xe.get(t.constructor):(i=Xe.createDefault(t.constructor),Xe.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Io(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class Zc extends Error{constructor(){super(...arguments),this.schemas=[]}}class $p{static parse(t,r){const i=pr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(St(r))return new r().fromASN(t);const o=Xe.get(r);Xe.cache(r);let s=o.schema;if(t.constructor===He&&o.type!==N.Choice){s=new He({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Jt({},t,s);if(!a.verified)throw new Zc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(Yc(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=o.itemType;if(typeof l=="number"){const d=Io(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const y=o.items[l],p=y.type;if(typeof p=="number"||St(p)){const A=(i=y.converter)!==null&&i!==void 0?i:St(p)?new p:null;if(!A)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const b=y.repeated==="sequence"?vt:kt,h=new b;h.valueBlock=d.valueBlock;const m=pr(h.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 k=m.result.valueBlock.value;c[l]=Array.from(k,g=>A.fromASN(g))}else c[l]=Array.from(d,b=>A.fromASN(b));else{let b=d;if(y.implicit){let h;if(St(p))h=new p().toSchema("");else{const m=w[p],k=Wc[m];if(!k)throw new Error(`Cannot get '${m}' class from asn1js module`);h=new k}h.valueBlock=b.valueBlock,b=pr(h.toBER(!1)).result}c[l]=A.fromASN(b)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,A=>this.fromASN(A,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof Zc&&o.schemas.push(r.name),o}}}class Eo{static serialize(t){return t instanceof Ee?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&St(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Xe.get(r);Xe.cache(r);let o=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Io(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(c=>a.toASN(c))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&jp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Eo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||St(c.type))){const y={};y.valueHex=d instanceof Kt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new zr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else o.push(new He({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new He({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case N.Sequence:s=new vt({value:o});break;case N.Set:s=new kt({value:o});break;case N.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,i,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${w[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?vt:kt;s=new l({value:c})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,l=>this.toASN(l)),c=t.repeated==="sequence"?vt:kt;s=new c({value:a})}else s=this.toASN(o);return s}}class le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class H{static serialize(t){return Eo.serialize(t)}static parse(t,r){return $p.parse(t,r)}static toString(t){const r=j.isBufferSource(t)?j.toArrayBuffer(t):H.serialize(t),i=pr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var Qc={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,m){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let k=0,g=-1,S=(h.match(l.zoneIndex)||[])[0],v,C;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(g=h.indexOf(":",g+1))>=0;)k++;if(h.substr(0,2)==="::"&&k--,h.substr(-2,2)==="::"&&k--,k>m)return null;for(C=m-k,v=":";C--;)v+="0:";return h=h.replace("::",v),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),m=function(){const O=h.split(":"),F=[];for(let Y=0;Y<O.length;Y++)F.push(parseInt(O[Y],16));return F}(),{parts:m,zoneId:S}}function y(h,m,k,g){if(h.length!==m.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,v;for(;g>0;){if(v=k-g,v<0&&(v=0),h[S]>>v!==m[S]>>v)return!1;g-=k,S+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function A(h,m){for(;h.length<m;)h=`0${h}`;return h}const b={};b.IPv4=function(){function h(m){if(m.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let k,g;for(k=0;k<m.length;k++)if(g=m[k],!(0<=g&&g<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=m}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(m,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,m.octets,8,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let S,v,C;for(S=3;S>=0;S-=1)if(v=this.octets[S],v in g){if(C=g[v],k&&C!==0)return null;C!==8&&(k=!0),m+=C}else return null;return 32-m},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return b.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),b.IPv4.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let v=0;for(;v<4;)S.push(parseInt(k[v],10)|parseInt(g[v],10)^255),v++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.isIPv4=function(h){return this.parser(h)!==null},b.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},b.IPv4.isValidFourPartDecimal=function(h){return!!(b.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},b.IPv4.networkAddressFromCIDR=function(h){let m,k,g,S,v;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),v=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],k=0;k<4;)S.push(parseInt(g[k],10)&parseInt(v[k],10)),k++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.parse=function(h){const m=this.parser(h);if(m===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(m)},b.IPv4.parseCIDR=function(h){let m;if(m=h.match(/^(.+)\/(\d+)$/)){const k=parseInt(m[2]);if(k>=0&&k<=32){const g=[this.parse(m[1]),k];return Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},b.IPv4.parser=function(h){let m,k,g;if(m=h.match(i.fourOctet))return function(){const S=m.slice(1,6),v=[];for(let C=0;C<S.length;C++)k=S[C],v.push(p(k));return v}();if(m=h.match(i.longValue)){if(g=p(m[1]),g>4294967295||g<0)throw new Error("ipaddr: address outside defined range");return function(){const S=[];let v;for(v=0;v<=24;v+=8)S.push(g>>v&255);return S}().reverse()}else return(m=h.match(i.twoOctet))?function(){const S=m.slice(1,4),v=[];if(g=p(S[1]),g>16777215||g<0)throw new Error("ipaddr: address outside defined range");return v.push(p(S[0])),v.push(g>>16&255),v.push(g>>8&255),v.push(g&255),v}():(m=h.match(i.threeOctet))?function(){const S=m.slice(1,5),v=[];if(g=p(S[2]),g>65535||g<0)throw new Error("ipaddr: address outside defined range");return v.push(p(S[0])),v.push(p(S[1])),v.push(g>>8&255),v.push(g&255),v}():null},b.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const m=[0,0,0,0];let k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<4&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},b.IPv6=function(){function h(m,k){let g,S;if(m.length===16)for(this.parts=[],g=0;g<=14;g+=2)this.parts.push(m[g]<<8|m[g+1]);else if(m.length===8)this.parts=m;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=0;g<this.parts.length;g++)if(S=this.parts[g],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");k&&(this.zoneId=k)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(m,k){let g;if(k===void 0&&(g=m,m=g[0],k=g[1]),m.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,m.parts,16,k)},h.prototype.prefixLengthFromSubnetMask=function(){let m=0,k=!1;const g={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 S,v;for(let C=7;C>=0;C-=1)if(S=this.parts[C],S in g){if(v=g[S],k&&v!==0)return null;v!==16&&(k=!0),m+=v}else return null;return 128-m},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let m;const k=[],g=this.parts;for(let S=0;S<g.length;S++)m=g[S],k.push(m>>8),k.push(m&255);return k},h.prototype.toFixedLengthString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(A(this.parts[S].toString(16),4));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},h.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),k=m[0],g=m[1];return new b.IPv4([k>>8,k&255,g>>8,g&255])},h.prototype.toNormalizedString=function(){const m=(function(){const g=[];for(let S=0;S<this.parts.length;S++)g.push(this.parts[S].toString(16));return g}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),m+k},h.prototype.toRFC5952String=function(){const m=/((^|:)(0(:|$)){2,})/g,k=this.toNormalizedString();let g=0,S=-1,v;for(;v=m.exec(k);)v[0].length>S&&(g=v.index,S=v[0].length);return S<0?k:`${k.substring(0,g)}::${k.substring(g+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),b.IPv6.broadcastAddressFromCIDR=function(h){try{const m=this.parseCIDR(h),k=m[0].toByteArray(),g=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[];let v=0;for(;v<16;)S.push(parseInt(k[v],10)|parseInt(g[v],10)^255),v++;return new this(S)}catch(m){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${m})`)}},b.IPv6.isIPv6=function(h){return this.parser(h)!==null},b.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const m=this.parser(h);return new this(m.parts,m.zoneId),!0}catch{return!1}},b.IPv6.networkAddressFromCIDR=function(h){let m,k,g,S,v;try{for(m=this.parseCIDR(h),g=m[0].toByteArray(),v=this.subnetMaskFromPrefixLength(m[1]).toByteArray(),S=[],k=0;k<16;)S.push(parseInt(g[k],10)&parseInt(v[k],10)),k++;return new this(S)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},b.IPv6.parse=function(h){const m=this.parser(h);if(m.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(m.parts,m.zoneId)},b.IPv6.parseCIDR=function(h){let m,k,g;if((k=h.match(/^(.+)\/(\d+)$/))&&(m=parseInt(k[2]),m>=0&&m<=128))return g=[this.parse(k[1]),m],Object.defineProperty(g,"toString",{value:function(){return this.join("/")}}),g;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},b.IPv6.parser=function(h){let m,k,g,S,v,C;if(g=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${g[1]}`);if(l.native.test(h))return d(h,8);if((g=h.match(l.transitional))&&(C=g[6]||"",m=d(g[1].slice(0,-1)+C,6),m.parts)){for(v=[parseInt(g[2]),parseInt(g[3]),parseInt(g[4]),parseInt(g[5])],k=0;k<v.length;k++)if(S=v[k],!(0<=S&&S<=255))return null;return m.parts.push(v[0]<<8|v[1]),m.parts.push(v[2]<<8|v[3]),{parts:m.parts,zoneId:m.zoneId}}return null},b.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>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 k=0;const g=Math.floor(h/8);for(;k<g;)m[k]=255,k++;return g<16&&(m[g]=Math.pow(2,h%8)-1<<8-h%8),new this(m)},b.fromByteArray=function(h){const m=h.length;if(m===4)return new b.IPv4(h);if(m===16)return new b.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},b.isValid=function(h){return b.IPv6.isValid(h)||b.IPv4.isValid(h)},b.parse=function(h){if(b.IPv6.isValid(h))return b.IPv6.parse(h);if(b.IPv4.isValid(h))return b.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},b.parseCIDR=function(h){try{return b.IPv6.parseCIDR(h)}catch{try{return b.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},b.process=function(h){const m=this.parse(h);return m.kind()==="ipv6"&&m.isIPv4MappedAddress()?m.toIPv4Address():m},b.subnetMatch=function(h,m,k){let g,S,v,C;k==null&&(k="unicast");for(S in m)if(Object.prototype.hasOwnProperty.call(m,S)){for(v=m[S],v[0]&&!(v[0]instanceof Array)&&(v=[v]),g=0;g<v.length;g++)if(C=v[g],h.kind()===C[0].kind()&&h.match.apply(h,C))return S}return k},e.exports?e.exports=b:t.ipaddr=b})(lo)})(Qc);var Xc=Qc.exports;class el{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return Xc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(R.ToHex(t))}static fromString(t){const r=Xc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var No,Oo,_o;let Ne=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:w.TeletexString})],Ne.prototype,"teletexString",void 0),u([f({type:w.PrintableString})],Ne.prototype,"printableString",void 0),u([f({type:w.UniversalString})],Ne.prototype,"universalString",void 0),u([f({type:w.Utf8String})],Ne.prototype,"utf8String",void 0),u([f({type:w.BmpString})],Ne.prototype,"bmpString",void 0),Ne=u([T({type:N.Choice})],Ne);let hr=class extends Ne{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?R.ToHex(this.anyValue):super.toString())}};u([f({type:w.IA5String})],hr.prototype,"ia5String",void 0),u([f({type:w.Any})],hr.prototype,"anyValue",void 0),hr=u([T({type:N.Choice})],hr);class Jr{constructor(t={}){this.type="",this.value=new hr,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Jr.prototype,"type",void 0),u([f({type:hr})],Jr.prototype,"value",void 0);let yr=No=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,No.prototype)}};yr=No=u([T({type:N.Set,itemType:Jr})],yr);let To=Oo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Oo.prototype)}};To=Oo=u([T({type:N.Sequence,itemType:yr})],To);let xe=_o=class extends To{constructor(t){super(t),Object.setPrototypeOf(this,_o.prototype)}};xe=_o=u([T({type:N.Sequence})],xe);const Pp={fromASN:e=>el.toString(Ji.fromASN(e)),toASN:e=>Ji.toASN(el.fromString(e))};class Yr{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Yr.prototype,"typeId",void 0),u([f({type:w.Any,context:0})],Yr.prototype,"value",void 0);class Vo{constructor(t={}){this.partyName=new Ne,Object.assign(this,t)}}u([f({type:Ne,optional:!0,context:0,implicit:!0})],Vo.prototype,"nameAssigner",void 0),u([f({type:Ne,context:1,implicit:!0})],Vo.prototype,"partyName",void 0);let ee=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Yr,context:0,implicit:!0})],ee.prototype,"otherName",void 0),u([f({type:w.IA5String,context:1,implicit:!0})],ee.prototype,"rfc822Name",void 0),u([f({type:w.IA5String,context:2,implicit:!0})],ee.prototype,"dNSName",void 0),u([f({type:w.Any,context:3,implicit:!0})],ee.prototype,"x400Address",void 0),u([f({type:xe,context:4,implicit:!1})],ee.prototype,"directoryName",void 0),u([f({type:Vo,context:5})],ee.prototype,"ediPartyName",void 0),u([f({type:w.IA5String,context:6,implicit:!0})],ee.prototype,"uniformResourceIdentifier",void 0),u([f({type:w.OctetString,context:7,implicit:!0,converter:Pp})],ee.prototype,"iPAddress",void 0),u([f({type:w.ObjectIdentifier,context:8,implicit:!0})],ee.prototype,"registeredID",void 0),ee=u([T({type:N.Choice})],ee);const mr="1.3.6.1.5.5.7.3",Yt="2.5.29";var jo;class Yi{constructor(t={}){this.accessMethod="",this.accessLocation=new ee,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Yi.prototype,"accessMethod",void 0),u([f({type:ee})],Yi.prototype,"accessLocation",void 0);let tl=jo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};tl=jo=u([T({type:N.Sequence,itemType:Yi})],tl);const Do=`${Yt}.35`;class $o extends ne{}class Zt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:$o,context:0,optional:!0,implicit:!0})],Zt.prototype,"keyIdentifier",void 0),u([f({type:ee,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Zt.prototype,"authorityCertIssuer",void 0),u([f({type:w.Integer,context:2,optional:!0,implicit:!0,converter:ge})],Zt.prototype,"authorityCertSerialNumber",void 0);const rl=`${Yt}.19`;class Zi{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:w.Boolean,defaultValue:!1})],Zi.prototype,"cA",void 0),u([f({type:w.Integer,optional:!0})],Zi.prototype,"pathLenConstraint",void 0);var Po;let Re=Po=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};Re=Po=u([T({type:N.Sequence,itemType:ee})],Re);var Mo;let il=Mo=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};il=Mo=u([T({type:N.Sequence})],il);var Ro;const nl=`${Yt}.32`;let xt=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:w.IA5String})],xt.prototype,"ia5String",void 0),u([f({type:w.VisibleString})],xt.prototype,"visibleString",void 0),u([f({type:w.BmpString})],xt.prototype,"bmpString",void 0),u([f({type:w.Utf8String})],xt.prototype,"utf8String",void 0),xt=u([T({type:N.Choice})],xt);class Uo{constructor(t={}){this.organization=new xt,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:xt})],Uo.prototype,"organization",void 0),u([f({type:w.Integer,repeated:"sequence"})],Uo.prototype,"noticeNumbers",void 0);class Lo{constructor(t={}){Object.assign(this,t)}}u([f({type:Uo,optional:!0})],Lo.prototype,"noticeRef",void 0),u([f({type:xt,optional:!0})],Lo.prototype,"explicitText",void 0);let Qi=class{constructor(t={}){Object.assign(this,t)}};u([f({type:w.IA5String})],Qi.prototype,"cPSuri",void 0),u([f({type:Lo})],Qi.prototype,"userNotice",void 0),Qi=u([T({type:N.Choice})],Qi);class Ho{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Ho.prototype,"policyQualifierId",void 0),u([f({type:w.Any})],Ho.prototype,"qualifier",void 0);class Xi{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Xi.prototype,"policyIdentifier",void 0),u([f({type:Ho,repeated:"sequence",optional:!0})],Xi.prototype,"policyQualifiers",void 0);let en=Ro=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};en=Ro=u([T({type:N.Sequence,itemType:Xi})],en);let tn=class{constructor(t=0){this.value=t}};u([f({type:w.Integer})],tn.prototype,"value",void 0),tn=u([T({type:N.Choice})],tn);let ol=class extends tn{};ol=u([T({type:N.Choice})],ol);var Fo,ot;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(ot||(ot={}));class sl extends Wi{toJSON(){const t=[],r=this.toNumber();return r&ot.aACompromise&&t.push("aACompromise"),r&ot.affiliationChanged&&t.push("affiliationChanged"),r&ot.cACompromise&&t.push("cACompromise"),r&ot.certificateHold&&t.push("certificateHold"),r&ot.cessationOfOperation&&t.push("cessationOfOperation"),r&ot.keyCompromise&&t.push("keyCompromise"),r&ot.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&ot.superseded&&t.push("superseded"),r&ot.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let gr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,context:0,repeated:"sequence",implicit:!0})],gr.prototype,"fullName",void 0),u([f({type:yr,context:1,implicit:!0})],gr.prototype,"nameRelativeToCRLIssuer",void 0),gr=u([T({type:N.Choice})],gr);class Zr{constructor(t={}){Object.assign(this,t)}}u([f({type:gr,context:0,optional:!0})],Zr.prototype,"distributionPoint",void 0),u([f({type:sl,context:1,optional:!0,implicit:!0})],Zr.prototype,"reasons",void 0),u([f({type:ee,context:2,optional:!0,repeated:"sequence",implicit:!0})],Zr.prototype,"cRLIssuer",void 0);let qo=Fo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};qo=Fo=u([T({type:N.Sequence,itemType:Zr})],qo);var Ko;let al=Ko=class extends qo{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};al=Ko=u([T({type:N.Sequence,itemType:Zr})],al);class je{constructor(t={}){this.onlyContainsUserCerts=je.ONLY,this.onlyContainsCACerts=je.ONLY,this.indirectCRL=je.ONLY,this.onlyContainsAttributeCerts=je.ONLY,Object.assign(this,t)}}je.ONLY=!1,u([f({type:gr,context:0,optional:!0})],je.prototype,"distributionPoint",void 0),u([f({type:w.Boolean,context:1,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsUserCerts",void 0),u([f({type:w.Boolean,context:2,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsCACerts",void 0),u([f({type:sl,context:3,optional:!0,implicit:!0})],je.prototype,"onlySomeReasons",void 0),u([f({type:w.Boolean,context:4,defaultValue:je.ONLY,implicit:!0})],je.prototype,"indirectCRL",void 0),u([f({type:w.Boolean,context:5,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsAttributeCerts",void 0);var Qr;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(Qr||(Qr={}));let zo=class{constructor(t=Qr.unspecified){this.reason=Qr.unspecified,this.reason=t}toJSON(){return Qr[this.reason]}toString(){return this.toJSON()}};u([f({type:w.Enumerated})],zo.prototype,"reason",void 0),zo=u([T({type:N.Choice})],zo);var Go;const cl=`${Yt}.37`;let rn=Go=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};rn=Go=u([T({type:N.Sequence,itemType:w.ObjectIdentifier})],rn);const Mp=`${mr}.1`,Rp=`${mr}.2`,Up=`${mr}.3`,Lp=`${mr}.4`,Hp=`${mr}.8`,Fp=`${mr}.9`;let Wo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:w.Integer,converter:ge})],Wo.prototype,"value",void 0),Wo=u([T({type:N.Choice})],Wo);let Jo=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:w.GeneralizedTime})],Jo.prototype,"value",void 0),Jo=u([T({type:N.Choice})],Jo);var Yo;let ll=Yo=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};ll=Yo=u([T({type:N.Sequence})],ll);const ul=`${Yt}.15`;var st;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(st||(st={}));class Zo extends Wi{toJSON(){const t=this.toNumber(),r=[];return t&st.cRLSign&&r.push("crlSign"),t&st.dataEncipherment&&r.push("dataEncipherment"),t&st.decipherOnly&&r.push("decipherOnly"),t&st.digitalSignature&&r.push("digitalSignature"),t&st.encipherOnly&&r.push("encipherOnly"),t&st.keyAgreement&&r.push("keyAgreement"),t&st.keyCertSign&&r.push("keyCertSign"),t&st.keyEncipherment&&r.push("keyEncipherment"),t&st.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var Qo;class nn{constructor(t={}){this.base=new ee,this.minimum=0,Object.assign(this,t)}}u([f({type:ee})],nn.prototype,"base",void 0),u([f({type:w.Integer,context:0,defaultValue:0,implicit:!0})],nn.prototype,"minimum",void 0),u([f({type:w.Integer,context:1,optional:!0,implicit:!0})],nn.prototype,"maximum",void 0);let on=Qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};on=Qo=u([T({type:N.Sequence,itemType:nn})],on);class dl{constructor(t={}){Object.assign(this,t)}}u([f({type:on,context:0,optional:!0,implicit:!0})],dl.prototype,"permittedSubtrees",void 0),u([f({type:on,context:1,optional:!0,implicit:!0})],dl.prototype,"excludedSubtrees",void 0);class fl{constructor(t={}){Object.assign(this,t)}}u([f({type:w.Integer,context:0,implicit:!0,optional:!0,converter:ge})],fl.prototype,"requireExplicitPolicy",void 0),u([f({type:w.Integer,context:1,implicit:!0,optional:!0,converter:ge})],fl.prototype,"inhibitPolicyMapping",void 0);var Xo;class es{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],es.prototype,"issuerDomainPolicy",void 0),u([f({type:w.ObjectIdentifier})],es.prototype,"subjectDomainPolicy",void 0);let pl=Xo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};pl=Xo=u([T({type:N.Sequence,itemType:es})],pl);var ts;const hl=`${Yt}.17`;let rs=ts=class extends Re{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};rs=ts=u([T({type:N.Sequence})],rs);let At=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],At.prototype,"type",void 0),u([f({type:w.Any,repeated:"set"})],At.prototype,"values",void 0);var is;let yl=is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};yl=is=u([T({type:N.Sequence,itemType:At})],yl);const ml=`${Yt}.14`;class jt extends $o{}class gl{constructor(t={}){Object.assign(this,t)}}u([f({type:w.GeneralizedTime,context:0,implicit:!0,optional:!0})],gl.prototype,"notBefore",void 0),u([f({type:w.GeneralizedTime,context:1,implicit:!0,optional:!0})],gl.prototype,"notAfter",void 0);var Xr;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(Xr||(Xr={}));class bl extends Wi{toJSON(){const t=[],r=this.toNumber();return r&Xr.pKIXCertificate&&t.push("pKIXCertificate"),r&Xr.newExtensions&&t.push("newExtensions"),r&Xr.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class wl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new bl,Object.assign(this,t)}}u([f({type:w.GeneralString})],wl.prototype,"entrustVers",void 0),u([f({type:bl})],wl.prototype,"entrustInfoFlags",void 0);var ns;let vl=ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};vl=ns=u([T({type:N.Sequence,itemType:Yi})],vl);class L{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof L&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&Ga(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:w.ObjectIdentifier})],L.prototype,"algorithm",void 0),u([f({type:w.Any,optional:!0})],L.prototype,"parameters",void 0);class Bt{constructor(t={}){this.algorithm=new L,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Bt.prototype,"algorithm",void 0),u([f({type:w.BitString})],Bt.prototype,"subjectPublicKey",void 0);let De=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:w.UTCTime})],De.prototype,"utcTime",void 0),u([f({type:w.GeneralizedTime})],De.prototype,"generalTime",void 0),De=u([T({type:N.Choice})],De);class sn{constructor(t){this.notBefore=new De(new Date),this.notAfter=new De(new Date),t&&(this.notBefore=new De(t.notBefore),this.notAfter=new De(t.notAfter))}}u([f({type:De})],sn.prototype,"notBefore",void 0),u([f({type:De})],sn.prototype,"notAfter",void 0);var os;let at=class Ff{constructor(t={}){this.extnID="",this.critical=Ff.CRITICAL,this.extnValue=new ne,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:w.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:w.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ne})],at.prototype,"extnValue",void 0);let Qt=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};Qt=os=u([T({type:N.Sequence,itemType:at})],Qt);var br;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(br||(br={}));class et{constructor(t={}){this.version=br.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new L,this.issuer=new xe,this.validity=new sn,this.subject=new xe,this.subjectPublicKeyInfo=new Bt,Object.assign(this,t)}}u([f({type:w.Integer,context:0,defaultValue:br.v1})],et.prototype,"version",void 0),u([f({type:w.Integer,converter:ge})],et.prototype,"serialNumber",void 0),u([f({type:L})],et.prototype,"signature",void 0),u([f({type:xe})],et.prototype,"issuer",void 0),u([f({type:sn})],et.prototype,"validity",void 0),u([f({type:xe})],et.prototype,"subject",void 0),u([f({type:Bt})],et.prototype,"subjectPublicKeyInfo",void 0),u([f({type:w.BitString,context:1,implicit:!0,optional:!0})],et.prototype,"issuerUniqueID",void 0),u([f({type:w.BitString,context:2,implicit:!0,optional:!0})],et.prototype,"subjectUniqueID",void 0),u([f({type:Qt,context:3,optional:!0})],et.prototype,"extensions",void 0);class wr{constructor(t={}){this.tbsCertificate=new et,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:L})],wr.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],wr.prototype,"signatureValue",void 0);class an{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new De,Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],an.prototype,"userCertificate",void 0),u([f({type:De})],an.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],an.prototype,"crlEntryExtensions",void 0);class It{constructor(t={}){this.signature=new L,this.issuer=new xe,this.thisUpdate=new De,Object.assign(this,t)}}u([f({type:w.Integer,optional:!0})],It.prototype,"version",void 0),u([f({type:L})],It.prototype,"signature",void 0),u([f({type:xe})],It.prototype,"issuer",void 0),u([f({type:De})],It.prototype,"thisUpdate",void 0),u([f({type:De,optional:!0})],It.prototype,"nextUpdate",void 0),u([f({type:an,repeated:"sequence",optional:!0})],It.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],It.prototype,"crlExtensions",void 0);let ss=class{constructor(t={}){this.tbsCertList=new It,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:It})],ss.prototype,"tbsCertList",void 0),u([f({type:L})],ss.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],ss.prototype,"signature",void 0);let vr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],vr.prototype,"attrType",void 0),u([f({type:w.Any,repeated:"set"})],vr.prototype,"attrValues",void 0);class as{constructor(t={}){this.acIssuer=new ee,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ee})],as.prototype,"acIssuer",void 0),u([f({type:w.Integer})],as.prototype,"acSerial",void 0),u([f({type:At,repeated:"sequence"})],as.prototype,"attrs",void 0);var cs;let cn=cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};cn=cs=u([T({type:N.Sequence,itemType:w.ObjectIdentifier})],cn);class ln{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:w.Integer,optional:!0})],ln.prototype,"pathLenConstraint",void 0),u([f({type:cn,implicit:!0,context:0,optional:!0})],ln.prototype,"permittedAttrs",void 0),u([f({type:cn,implicit:!0,context:1,optional:!0})],ln.prototype,"excludedAttrs",void 0),u([f({type:w.Boolean,defaultValue:!0})],ln.prototype,"permitUnSpecified",void 0);class Xt{constructor(t={}){this.issuer=new Re,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Re})],Xt.prototype,"issuer",void 0),u([f({type:w.Integer,converter:ge})],Xt.prototype,"serial",void 0),u([f({type:w.BitString,optional:!0})],Xt.prototype,"issuerUID",void 0);var ls;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(ls||(ls={}));class er{constructor(t={}){this.digestedObjectType=ls.publicKey,this.digestAlgorithm=new L,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Enumerated})],er.prototype,"digestedObjectType",void 0),u([f({type:w.ObjectIdentifier,optional:!0})],er.prototype,"otherObjectTypeID",void 0),u([f({type:L})],er.prototype,"digestAlgorithm",void 0),u([f({type:w.BitString})],er.prototype,"objectDigest",void 0);class un{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,optional:!0})],un.prototype,"issuerName",void 0),u([f({type:Xt,context:0,implicit:!0,optional:!0})],un.prototype,"baseCertificateID",void 0),u([f({type:er,context:1,implicit:!0,optional:!0})],un.prototype,"objectDigestInfo",void 0);let kr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,repeated:"sequence"})],kr.prototype,"v1Form",void 0),u([f({type:un,context:0,implicit:!0})],kr.prototype,"v2Form",void 0),kr=u([T({type:N.Choice})],kr);class dn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:w.GeneralizedTime})],dn.prototype,"notBeforeTime",void 0),u([f({type:w.GeneralizedTime})],dn.prototype,"notAfterTime",void 0);class ei{constructor(t={}){Object.assign(this,t)}}u([f({type:Xt,implicit:!0,context:0,optional:!0})],ei.prototype,"baseCertificateID",void 0),u([f({type:Re,implicit:!0,context:1,optional:!0})],ei.prototype,"entityName",void 0),u([f({type:er,implicit:!0,context:2,optional:!0})],ei.prototype,"objectDigestInfo",void 0);var us;(function(e){e[e.v2=1]="v2"})(us||(us={}));class ct{constructor(t={}){this.version=us.v2,this.holder=new ei,this.issuer=new kr,this.signature=new L,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new dn,this.attributes=[],Object.assign(this,t)}}u([f({type:w.Integer})],ct.prototype,"version",void 0),u([f({type:ei})],ct.prototype,"holder",void 0),u([f({type:kr})],ct.prototype,"issuer",void 0),u([f({type:L})],ct.prototype,"signature",void 0),u([f({type:w.Integer,converter:ge})],ct.prototype,"serialNumber",void 0),u([f({type:dn})],ct.prototype,"attrCertValidityPeriod",void 0),u([f({type:At,repeated:"sequence"})],ct.prototype,"attributes",void 0),u([f({type:w.BitString,optional:!0})],ct.prototype,"issuerUniqueID",void 0),u([f({type:Qt,optional:!0})],ct.prototype,"extensions",void 0);class fn{constructor(t={}){this.acinfo=new ct,this.signatureAlgorithm=new L,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ct})],fn.prototype,"acinfo",void 0),u([f({type:L})],fn.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],fn.prototype,"signatureValue",void 0);var pn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(pn||(pn={}));class ds extends Wi{}class fs{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier,implicit:!0,context:0})],fs.prototype,"type",void 0),u([f({type:w.Any,implicit:!0,context:1})],fs.prototype,"value",void 0);class ps{constructor(t={}){this.policyId="",this.classList=new ds(pn.unclassified),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ps.prototype,"policyId",void 0),u([f({type:ds,defaultValue:new ds(pn.unclassified)})],ps.prototype,"classList",void 0),u([f({type:fs,repeated:"set"})],ps.prototype,"securityCategories",void 0);class hn{constructor(t={}){Object.assign(this,t)}}u([f({type:ne})],hn.prototype,"cotets",void 0),u([f({type:w.ObjectIdentifier})],hn.prototype,"oid",void 0),u([f({type:w.Utf8String})],hn.prototype,"string",void 0);class kl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],kl.prototype,"policyAuthority",void 0),u([f({type:hn,repeated:"sequence"})],kl.prototype,"values",void 0);var hs;class yn{constructor(t={}){this.targetCertificate=new Xt,Object.assign(this,t)}}u([f({type:Xt})],yn.prototype,"targetCertificate",void 0),u([f({type:ee,optional:!0})],yn.prototype,"targetName",void 0),u([f({type:er,optional:!0})],yn.prototype,"certDigestInfo",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ee,context:0,implicit:!0})],Cr.prototype,"targetName",void 0),u([f({type:ee,context:1,implicit:!0})],Cr.prototype,"targetGroup",void 0),u([f({type:yn,context:2,implicit:!0})],Cr.prototype,"targetCert",void 0),Cr=u([T({type:N.Choice})],Cr);let ys=hs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,hs.prototype)}};ys=hs=u([T({type:N.Sequence,itemType:Cr})],ys);var ms;let Cl=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Cl=ms=u([T({type:N.Sequence,itemType:ys})],Cl);class Sl{constructor(t={}){Object.assign(this,t)}}u([f({type:Re,implicit:!0,context:0,optional:!0})],Sl.prototype,"roleAuthority",void 0),u([f({type:ee,implicit:!0,context:1})],Sl.prototype,"roleName",void 0);class gs{constructor(t={}){this.service=new ee,this.ident=new ee,Object.assign(this,t)}}u([f({type:ee})],gs.prototype,"service",void 0),u([f({type:ee})],gs.prototype,"ident",void 0),u([f({type:ne,optional:!0})],gs.prototype,"authInfo",void 0);var bs;class ws{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ws.prototype,"otherCertFormat",void 0),u([f({type:w.Any})],ws.prototype,"otherCert",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wr})],Sr.prototype,"certificate",void 0),u([f({type:fn,context:2,implicit:!0})],Sr.prototype,"v2AttrCert",void 0),u([f({type:ws,context:3,implicit:!0})],Sr.prototype,"other",void 0),Sr=u([T({type:N.Choice})],Sr);let mn=bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};mn=bs=u([T({type:N.Set,itemType:Sr})],mn);class xr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],xr.prototype,"contentType",void 0),u([f({type:w.Any,context:0})],xr.prototype,"content",void 0);let ti=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ne})],ti.prototype,"single",void 0),u([f({type:w.Any})],ti.prototype,"any",void 0),ti=u([T({type:N.Choice})],ti);class gn{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],gn.prototype,"eContentType",void 0),u([f({type:ti,context:0,optional:!0})],gn.prototype,"eContent",void 0);var Et;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(Et||(Et={}));let ri=class extends L{};ri=u([T({type:N.Sequence})],ri);let bn=class extends L{};bn=u([T({type:N.Sequence})],bn);let pt=class extends L{};pt=u([T({type:N.Sequence})],pt);let wn=class extends L{};wn=u([T({type:N.Sequence})],wn);let xl=class extends L{};xl=u([T({type:N.Sequence})],xl);let vs=class extends L{};vs=u([T({type:N.Sequence})],vs);let ii=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ne,context:0,implicit:!0,optional:!0})],ii.prototype,"value",void 0),u([f({type:ne,converter:wp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ii.prototype,"constructedValue",void 0),ii=u([T({type:N.Choice})],ii);class ni{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new wn,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ni.prototype,"contentType",void 0),u([f({type:wn})],ni.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ii,optional:!0})],ni.prototype,"encryptedContent",void 0);class Ar{constructor(t={}){this.issuer=new xe,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:xe})],Ar.prototype,"issuer",void 0),u([f({type:w.Integer,converter:ge})],Ar.prototype,"serialNumber",void 0);class vn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],vn.prototype,"keyAttrId",void 0),u([f({type:w.Any,optional:!0})],vn.prototype,"keyAttr",void 0);var ks;class kn{constructor(t={}){this.subjectKeyIdentifier=new jt,Object.assign(this,t)}}u([f({type:jt})],kn.prototype,"subjectKeyIdentifier",void 0),u([f({type:w.GeneralizedTime,optional:!0})],kn.prototype,"date",void 0),u([f({type:vn,optional:!0})],kn.prototype,"other",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:kn,context:0,implicit:!0,optional:!0})],Br.prototype,"rKeyId",void 0),u([f({type:Ar,optional:!0})],Br.prototype,"issuerAndSerialNumber",void 0),Br=u([T({type:N.Choice})],Br);class Cs{constructor(t={}){this.rid=new Br,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:Br})],Cs.prototype,"rid",void 0),u([f({type:ne})],Cs.prototype,"encryptedKey",void 0);let Cn=ks=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cn=ks=u([T({type:N.Sequence,itemType:Cs})],Cn);class Ss{constructor(t={}){this.algorithm=new L,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:L})],Ss.prototype,"algorithm",void 0),u([f({type:w.BitString})],Ss.prototype,"publicKey",void 0);let tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0,optional:!0})],tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ss,context:1,implicit:!0,optional:!0})],tr.prototype,"originatorKey",void 0),u([f({type:Ar,optional:!0})],tr.prototype,"issuerAndSerialNumber",void 0),tr=u([T({type:N.Choice})],tr);class Ir{constructor(t={}){this.version=Et.v3,this.originator=new tr,this.keyEncryptionAlgorithm=new pt,this.recipientEncryptedKeys=new Cn,Object.assign(this,t)}}u([f({type:w.Integer})],Ir.prototype,"version",void 0),u([f({type:tr,context:0})],Ir.prototype,"originator",void 0),u([f({type:ne,context:1,optional:!0})],Ir.prototype,"ukm",void 0),u([f({type:pt})],Ir.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:Cn})],Ir.prototype,"recipientEncryptedKeys",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0})],Er.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ar})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([T({type:N.Choice})],Er);class oi{constructor(t={}){this.version=Et.v0,this.rid=new Er,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],oi.prototype,"version",void 0),u([f({type:Er})],oi.prototype,"rid",void 0),u([f({type:pt})],oi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],oi.prototype,"encryptedKey",void 0);class si{constructor(t={}){this.keyIdentifier=new ne,Object.assign(this,t)}}u([f({type:ne})],si.prototype,"keyIdentifier",void 0),u([f({type:w.GeneralizedTime,optional:!0})],si.prototype,"date",void 0),u([f({type:vn,optional:!0})],si.prototype,"other",void 0);class ai{constructor(t={}){this.version=Et.v4,this.kekid=new si,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],ai.prototype,"version",void 0),u([f({type:si})],ai.prototype,"kekid",void 0),u([f({type:pt})],ai.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],ai.prototype,"encryptedKey",void 0);class ci{constructor(t={}){this.version=Et.v0,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],ci.prototype,"version",void 0),u([f({type:vs,context:0,optional:!0})],ci.prototype,"keyDerivationAlgorithm",void 0),u([f({type:pt})],ci.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ne})],ci.prototype,"encryptedKey",void 0);class xs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],xs.prototype,"oriType",void 0),u([f({type:w.Any})],xs.prototype,"oriValue",void 0);let Dt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:oi,optional:!0})],Dt.prototype,"ktri",void 0),u([f({type:Ir,context:1,implicit:!0,optional:!0})],Dt.prototype,"kari",void 0),u([f({type:ai,context:2,implicit:!0,optional:!0})],Dt.prototype,"kekri",void 0),u([f({type:ci,context:3,implicit:!0,optional:!0})],Dt.prototype,"pwri",void 0),u([f({type:xs,context:4,implicit:!0,optional:!0})],Dt.prototype,"ori",void 0),Dt=u([T({type:N.Choice})],Dt);var As;let Sn=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};Sn=As=u([T({type:N.Set,itemType:Dt})],Sn);var Bs;class xn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],xn.prototype,"otherRevInfoFormat",void 0),u([f({type:w.Any})],xn.prototype,"otherRevInfo",void 0);let li=class{constructor(t={}){this.other=new xn,Object.assign(this,t)}};u([f({type:xn,context:1,implicit:!0})],li.prototype,"other",void 0),li=u([T({type:N.Choice})],li);let Is=Bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};Is=Bs=u([T({type:N.Set,itemType:li})],Is);class Es{constructor(t={}){Object.assign(this,t)}}u([f({type:mn,context:0,implicit:!0,optional:!0})],Es.prototype,"certs",void 0),u([f({type:Is,context:1,implicit:!0,optional:!0})],Es.prototype,"crls",void 0);var Ns;let Os=Ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};Os=Ns=u([T({type:N.Set,itemType:vr})],Os);class ui{constructor(t={}){this.version=Et.v0,this.recipientInfos=new Sn,this.encryptedContentInfo=new ni,Object.assign(this,t)}}u([f({type:w.Integer})],ui.prototype,"version",void 0),u([f({type:Es,context:0,implicit:!0,optional:!0})],ui.prototype,"originatorInfo",void 0),u([f({type:Sn})],ui.prototype,"recipientInfos",void 0),u([f({type:ni})],ui.prototype,"encryptedContentInfo",void 0),u([f({type:Os,context:1,implicit:!0,optional:!0})],ui.prototype,"unprotectedAttrs",void 0);const qp="1.2.840.113549.1.7.2";let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:jt,context:0,implicit:!0})],Nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ar})],Nr.prototype,"issuerAndSerialNumber",void 0),Nr=u([T({type:N.Choice})],Nr);var _s;class Nt{constructor(t={}){this.version=Et.v0,this.sid=new Nr,this.digestAlgorithm=new ri,this.signatureAlgorithm=new bn,this.signature=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],Nt.prototype,"version",void 0),u([f({type:Nr})],Nt.prototype,"sid",void 0),u([f({type:ri})],Nt.prototype,"digestAlgorithm",void 0),u([f({type:vr,repeated:"set",context:0,implicit:!0,optional:!0})],Nt.prototype,"signedAttrs",void 0),u([f({type:bn})],Nt.prototype,"signatureAlgorithm",void 0),u([f({type:ne})],Nt.prototype,"signature",void 0),u([f({type:vr,repeated:"set",context:1,implicit:!0,optional:!0})],Nt.prototype,"unsignedAttrs",void 0);let An=_s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};An=_s=u([T({type:N.Set,itemType:Nt})],An);var Ts;let Bn=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Bn=Ts=u([T({type:N.Set,itemType:ri})],Bn);class Or{constructor(t={}){this.version=Et.v0,this.digestAlgorithms=new Bn,this.encapContentInfo=new gn,this.signerInfos=new An,Object.assign(this,t)}}u([f({type:w.Integer})],Or.prototype,"version",void 0),u([f({type:Bn})],Or.prototype,"digestAlgorithms",void 0),u([f({type:gn})],Or.prototype,"encapContentInfo",void 0),u([f({type:mn,context:0,implicit:!0,optional:!0})],Or.prototype,"certificates",void 0),u([f({type:li,context:1,implicit:!0,optional:!0})],Or.prototype,"crls",void 0),u([f({type:An})],Or.prototype,"signerInfos",void 0);const di="1.2.840.10045.2.1",Vs="1.2.840.10045.4.1",Al="1.2.840.10045.4.3.1",js="1.2.840.10045.4.3.2",Ds="1.2.840.10045.4.3.3",$s="1.2.840.10045.4.3.4",Bl="1.2.840.10045.3.1.7",Il="1.3.132.0.34",El="1.3.132.0.35";function fi(e){return new L({algorithm:e})}const Kp=fi(Vs);fi(Al);const zp=fi(js),Gp=fi(Ds),Wp=fi($s);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],_r.prototype,"namedCurve",void 0),_r=u([T({type:N.Choice})],_r);class In{constructor(t={}){this.version=1,this.privateKey=new ne,Object.assign(this,t)}}u([f({type:w.Integer})],In.prototype,"version",void 0),u([f({type:ne})],In.prototype,"privateKey",void 0),u([f({type:_r,context:0,optional:!0})],In.prototype,"parameters",void 0),u([f({type:w.BitString,context:1,optional:!0})],In.prototype,"publicKey",void 0);class En{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],En.prototype,"r",void 0),u([f({type:w.Integer,converter:ge})],En.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",Tr=`${Fe}.1`,Jp=`${Fe}.7`,Yp=`${Fe}.9`,Zp=`${Fe}.10`,Qp=`${Fe}.2`,Xp=`${Fe}.4`,Nn=`${Fe}.5`,eh=`${Fe}.14`,Ps=`${Fe}.11`,On=`${Fe}.12`,_n=`${Fe}.13`,Nl=`${Fe}.15`,Ol=`${Fe}.16`,_l="1.3.14.3.2.26",Tl="2.16.840.1.101.3.4.2.4",Vl="2.16.840.1.101.3.4.2.1",jl="2.16.840.1.101.3.4.2.2",Dl="2.16.840.1.101.3.4.2.3",th="2.16.840.1.101.3.4.2.5",rh="2.16.840.1.101.3.4.2.6",ih="1.2.840.113549.2.2",nh="1.2.840.113549.2.5",Ms=`${Fe}.8`;function Ae(e){return new L({algorithm:e,parameters:null})}Ae(ih),Ae(nh);const rr=Ae(_l);Ae(Tl),Ae(Vl),Ae(jl),Ae(Dl),Ae(th),Ae(rh);const $l=new L({algorithm:Ms,parameters:H.serialize(rr)}),Pl=new L({algorithm:Yp,parameters:H.serialize(Ji.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ae(Tr),Ae(Qp),Ae(Xp),Ae(Nn),Ae(Nl),Ae(Ol),Ae(On),Ae(_n),Ae(Nl),Ae(Ol);class Tn{constructor(t={}){this.hashAlgorithm=new L(rr),this.maskGenAlgorithm=new L({algorithm:Ms,parameters:H.serialize(rr)}),this.pSourceAlgorithm=new L(Pl),Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:rr})],Tn.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:$l})],Tn.prototype,"maskGenAlgorithm",void 0),u([f({type:L,context:2,defaultValue:Pl})],Tn.prototype,"pSourceAlgorithm",void 0),new L({algorithm:Jp,parameters:H.serialize(new Tn)});class pi{constructor(t={}){this.hashAlgorithm=new L(rr),this.maskGenAlgorithm=new L({algorithm:Ms,parameters:H.serialize(rr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:L,context:0,defaultValue:rr})],pi.prototype,"hashAlgorithm",void 0),u([f({type:L,context:1,defaultValue:$l})],pi.prototype,"maskGenAlgorithm",void 0),u([f({type:w.Integer,context:2,defaultValue:20})],pi.prototype,"saltLength",void 0),u([f({type:w.Integer,context:3,defaultValue:1})],pi.prototype,"trailerField",void 0),new L({algorithm:Zp,parameters:H.serialize(new pi)});class Vn{constructor(t={}){this.digestAlgorithm=new L,this.digest=new ne,Object.assign(this,t)}}u([f({type:L})],Vn.prototype,"digestAlgorithm",void 0),u([f({type:ne})],Vn.prototype,"digest",void 0);var Rs;class jn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],jn.prototype,"prime",void 0),u([f({type:w.Integer,converter:ge})],jn.prototype,"exponent",void 0),u([f({type:w.Integer,converter:ge})],jn.prototype,"coefficient",void 0);let Us=Rs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};Us=Rs=u([T({type:N.Sequence,itemType:jn})],Us);class ht{constructor(t={}){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,t)}}u([f({type:w.Integer})],ht.prototype,"version",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"modulus",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"publicExponent",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"privateExponent",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"prime1",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"prime2",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"exponent1",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"exponent2",void 0),u([f({type:w.Integer,converter:ge})],ht.prototype,"coefficient",void 0),u([f({type:Us,optional:!0})],ht.prototype,"otherPrimeInfos",void 0);class Ls{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:ge})],Ls.prototype,"modulus",void 0),u([f({type:w.Integer,converter:ge})],Ls.prototype,"publicExponent",void 0);var Hs;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Hs||(Hs={}));const qe=Hs;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}uc=Ke,R.Constructed=uc,Ke.NAME="CONSTRUCTED";class dc extends Le{fromBER(t,r,i){return r}toBER(t){return st}}dc.override="EndOfContentValueBlock";var fc;class ko extends Ve{constructor(t={}){super(t,dc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}fc=ko,R.EndOfContent=fc,ko.NAME=Jr;var pc;class Jt extends Ve{constructor(t={}){super(t,Le),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(t,r,i){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=i,r+i>t.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):r+i}toBER(t,r){const i=new ArrayBuffer(2);if(!t){const o=new Uint8Array(i);o[0]=5,o[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}pc=Jt,R.Null=pc,Jt.NAME="NULL";class hc extends ht(Le){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=$.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const o=$.toUint8Array(t);return St(this,o,r,i)?(this.valueHexView=o.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ec.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}hc.NAME="BooleanValueBlock";var yc;let Pi=class extends Ve{constructor(t={}){super(t,hc),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(t){this.valueBlock.value=t}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};yc=Pi,R.Boolean=yc,Pi.NAME="BOOLEAN";class gc extends ht(Mt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let o=0;if(this.isConstructed){if(this.isHexOnly=!1,o=Mt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==ic)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,o=super.fromBER(t,r,i),this.blockLength=i;return o}toBER(t,r){return this.isConstructed?Mt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}gc.NAME="OctetStringValueBlock";var mc;let Yt=class tp extends Ve{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},gc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=yr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Ke.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${U.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const t=[];for(const r of this.valueBlock.value)r instanceof tp&&t.push(r.valueBlock.valueHexView);return $.concat(t)}};mc=Yt,R.OctetString=mc,Yt.NAME=ic;class bc extends ht(Mt){constructor({unusedBits:t=0,isConstructed:r=!1,...i}={}){super(i),this.unusedBits=t,this.isConstructed=r,this.blockLength=this.valueHexView.byteLength}fromBER(t,r,i){if(!i)return r;let o=-1;if(this.isConstructed){if(o=Mt.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const c of this.value){const l=c.constructor.NAME;if(l===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==nc)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return o}const s=$.toUint8Array(t);if(!St(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=yr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return Mt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return st;const i=new Uint8Array(this.valueHexView.length+1);return i[0]=this.unusedBits,i.set(this.valueHexView,1),i.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}bc.NAME="BitStringValueBlock";var wc;let Zt=class extends Ve{constructor({idBlock:t={},lenBlock:r={},...i}={}){var o,s;(o=i.isConstructed)!==null&&o!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(t,r,i){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(t,r,i)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Ke.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const o of r)t.push(o.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};wc=Zt,R.BitString=wc,Zt.NAME=nc;var vc;function Cp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),o=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=o.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let B=y;B>=0;B--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=mo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=mo(r,s)),s}function kc(e){if(e>=Wr.length)for(let t=Wr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Wr[t-1].slice(0);for(let o=i.length-1;o>=0;o--){const s=new Uint8Array([(i[o]<<1)+r[0]]);r[0]=s[0]/10,i[o]=s[0]%10}r[0]>0&&(i=mo(r,i)),Wr.push(i)}return Wr[e]}function Sp(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=o.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class Co extends ht(Le){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}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=ec.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(up(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,o=0){const s=this.fromBER(t,r,i);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&a[1]&128?this.valueHexView=a.subarray(1):o!==0&&a.length<o&&(o-a.length>1&&(o=a.length+1),this.valueHexView=a.subarray(o-a.length)),s}toDER(t=!1){const r=this.valueHexView;switch(!0){case(r[0]&128)!==0:{const i=new Uint8Array(this.valueHexView.length+1);i[0]=0,i.set(r,1),this.valueHexView=i}break;case(r[0]===0&&(r[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(t)}fromBER(t,r,i){const o=super.fromBER(t,r,i);return o===-1||this.setValueHex(),o}toBER(t){return t?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const t=this.valueHexView.length*8-1;let r=new Uint8Array(this.valueHexView.length*8/3),i=0,o;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){o=s[l];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=Sp(kc(i),r),a="-";break;default:r=Cp(r,kc(i))}i++,o>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=tc.charAt(r[l]));return c===!1&&(a+=tc.charAt(0)),a}}vc=Co,Co.NAME="IntegerValueBlock",Object.defineProperty(vc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Cc;class yt extends Ve{constructor(t={}){super(t,Co),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Di(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Di();const r=BigInt(t),i=new $i,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(U.FromHex(o));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${U.ToHex(c)}`)+r,y=$.toUint8Array(U.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new yt({valueHex:i.final()})}convertToDER(){const t=new yt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new yt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Cc=yt,R.Integer=Cc,yt.NAME="INTEGER";var Sc;class Ri extends yt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Sc=Ri,R.Enumerated=Sc,Ri.NAME="ENUMERATED";class So extends ht(Le){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const o=$.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=hr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Di();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let o=0;o<i.length;o++)i[o]=parseInt(r.slice(o*7,o*7+7),2)+(o+1<i.length?128:0);this.fromBER(i.buffer,0,i.length)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",st;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i}toString(){let t="";if(this.isHexOnly)t=U.ToHex(this.valueHexView);else if(this.isFirstSid){let r=this.valueDec;this.valueDec<=39?t="0.":this.valueDec<=79?(t="1.",r-=40):(t="2.",r-=80),t+=r.toString()}else t=this.valueDec.toString();return t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}So.NAME="sidBlock";class xc extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new So;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const o=this.value[i].toBER(t);if(o.byteLength===0)return this.error=this.value[i].error,st;r.push(o)}return bo(r)}fromString(t){this.value=[];let r=0,i=0,o="",s=!1;do if(i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(o,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new So;if(o>Number.MAX_SAFE_INTEGER){Di();const c=BigInt(o);a.valueBigInt=c}else if(a.valueDec=parseInt(o,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r?(o=`{${o}}`,this.value[i].isFirstSid?t=`2.{${o} - 80}`:t+=o):t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}xc.NAME="ObjectIdentifierValueBlock";var Ac;class Ui extends Ve{constructor(t={}){super(t,xc),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ac=Ui,R.ObjectIdentifier=Ac,Ui.NAME="OBJECT IDENTIFIER";class xo extends ht(Wt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=$.toUint8Array(t);if(!St(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=hr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const o=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=o[a]|128;return s[this.blockLength-1]=o[this.blockLength-1],s.buffer}const r=Gt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",st;const i=new Uint8Array(r.byteLength);if(!t){const o=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=o[a]|128;i[s]=o[s]}return i.buffer}toString(){let t="";return this.isHexOnly?t=U.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}xo.NAME="relativeSidBlock";class Bc extends Le{constructor({value:t=qe,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let o=r;for(;i>0;){const s=new xo;if(o=s.fromBER(t,o,i),o===-1)return this.blockLength=0,this.error=s.error,o;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return o}toBER(t,r){const i=[];for(let o=0;o<this.value.length;o++){const s=this.value[o].toBER(t);if(s.byteLength===0)return this.error=this.value[o].error,st;i.push(s)}return bo(i)}fromString(t){this.value=[];let r=0,i=0,o="";do{i=t.indexOf(".",r),i===-1?o=t.substring(r):o=t.substring(r,i),r=i+1;const s=new xo;if(s.valueDec=parseInt(o,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(i!==-1);return!0}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let o=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(o=`{${o}}`),t+=o}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Bc.NAME="RelativeObjectIdentifierValueBlock";var Ic;class Ao extends Ve{constructor(t={}){super(t,Bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}Ic=Ao,R.RelativeObjectIdentifier=Ic,Ao.NAME="RelativeObjectIdentifier";var Ec;class xt extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Ec=xt,R.Sequence=Ec,xt.NAME="SEQUENCE";var Nc;let At=class extends Ke{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Nc=At,R.Set=Nc,At.NAME="SET";class Oc extends ht(Le){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=qe}toJSON(){return{...super.toJSON(),value:this.value}}}Oc.NAME="StringValueBlock";class _c extends Oc{}_c.NAME="SimpleStringValueBlock";class Qe extends vo{constructor({...t}={}){super(t,_c)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,$.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let o=0;o<r;o++)i[o]=t.charCodeAt(o);this.valueBlock.value=t}}Qe.NAME="SIMPLE STRING";class Tc extends Qe{fromBuffer(t){this.valueBlock.valueHexView=$.toUint8Array(t);try{this.valueBlock.value=U.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=U.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(U.FromUtf8String(t)),this.valueBlock.value=t}}Tc.NAME="Utf8StringValueBlock";var Vc;class Bt extends Tc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Vc=Bt,R.Utf8String=Vc,Bt.NAME="UTF8String";class jc extends Qe{fromBuffer(t){this.valueBlock.value=U.ToUtf16String(t),this.valueBlock.valueHexView=$.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(U.FromUtf16String(t))}}jc.NAME="BmpStringValueBlock";var Dc;class Li extends jc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Dc=Li,R.BmpString=Dc,Li.NAME="BMPString";class $c extends Qe{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let o=0;o<i.length;o+=4)i[o]=i[o+3],i[o+1]=i[o+2],i[o+2]=0,i[o+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let o=0;o<r;o++){const s=Gt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[o*4+l+c]=a[l]}this.valueBlock.value=t}}$c.NAME="UniversalStringValueBlock";var Mc;class Hi extends $c{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Mc=Hi,R.UniversalString=Mc,Hi.NAME="UniversalString";var Pc;class Fi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Pc=Fi,R.NumericString=Pc,Fi.NAME="NumericString";var Rc;class qi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Rc=qi,R.PrintableString=Rc,qi.NAME="PrintableString";var Uc;class Ki extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Uc=Ki,R.TeletexString=Uc,Ki.NAME="TeletexString";var Lc;class zi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Lc=zi,R.VideotexString=Lc,zi.NAME="VideotexString";var Hc;class Gi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Hc=Gi,R.IA5String=Hc,Gi.NAME="IA5String";var Fc;class Wi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Fc=Wi,R.GraphicString=Fc,Wi.NAME="GraphicString";var qc;class Zr extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}qc=Zr,R.VisibleString=qc,Zr.NAME="VisibleString";var Kc;class Ji extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Kc=Ji,R.GeneralString=Kc,Ji.NAME="GeneralString";var zc;class Yi extends Qe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}zc=Yi,R.CharacterString=zc,Yi.NAME="CharacterString";var Gc;class Qr extends Zr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let o=0;o<t.length;o++)this.valueBlock.valueHexView[o]=t.charCodeAt(o)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,$.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return r}fromDate(t){this.year=t.getUTCFullYear(),this.month=t.getUTCMonth()+1,this.day=t.getUTCDate(),this.hour=t.getUTCHours(),this.minute=t.getUTCMinutes(),this.second=t.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(t){const i=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(t);if(i===null){this.error="Wrong input string for conversion";return}const o=parseInt(i[1],10);o>=50?this.year=1900+o:this.year=2e3+o,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ze(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ze(this.month,2),r[2]=Ze(this.day,2),r[3]=Ze(this.hour,2),r[4]=Ze(this.minute,2),r[5]=Ze(this.second,2),r[6]="Z",r.join("")}return super.toString(t)}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}}}Gc=Qr,R.UTCTime=Gc,Qr.NAME="UTCTime";var Wc;class Zi extends Qr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",o="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,B=i.indexOf("+"),b="";if(B===-1&&(B=i.indexOf("-"),p=-1),B!==-1){if(b=i.substring(B+1),i=i.substring(0,B),b.length!==2&&b.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(b.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,b.length===4){if(h=parseInt(b.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),o=i.substring(0,d)}else o=i;switch(!0){case o.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case o.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.minute=Math.floor(p),p=60*(p-this.minute),this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let p=60*s;this.second=Math.floor(p),p=1e3*(p-this.second),this.millisecond=Math.floor(p)}break;case o.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,d!==-1){const p=1e3*s;this.millisecond=Math.floor(p)}break;default:throw new Error("Wrong input string for conversion")}const y=a.exec(o);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ze(this.year,4)),r.push(Ze(this.month,2)),r.push(Ze(this.day,2)),r.push(Ze(this.hour,2)),r.push(Ze(this.minute,2)),r.push(Ze(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ze(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Wc=Zi,R.GeneralizedTime=Wc,Zi.NAME="GeneralizedTime";var Jc;class Bo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Jc=Bo,R.DATE=Jc,Bo.NAME="DATE";var Yc;class Io extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Yc=Io,R.TimeOfDay=Yc,Io.NAME="TimeOfDay";var Zc;class Eo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}Zc=Eo,R.DateTime=Zc,Eo.NAME="DateTime";var Qc;class No extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}Qc=No,R.Duration=Qc,No.NAME="Duration";var Xc;class Oo extends Bt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}Xc=Oo,R.TIME=Xc,Oo.NAME="TIME";class Qt{constructor({name:t=qe,optional:r=!1}={}){this.name=t,this.optional=r}}class _o extends Qt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Qi extends Qt{constructor({value:t=new Qt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class xp{constructor({data:t=Mi}={}){this.dataView=$.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=$.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=$.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Xt(e,t,r){if(r instanceof _o){for(let s=0;s<r.value.length;s++)if(Xt(e,t,r.value[s]).verified)return{verified:!0,result:e};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty(wo)&&(s.name=r.name),s}}if(r instanceof Qt)return r.hasOwnProperty(wo)&&(e[r.name]=t),{verified:!0,result:e};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(r instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(pp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(mp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(bp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const i=r.idBlock.toBER(!1);if(i.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(r.idBlock.fromBER(i,0,i.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(r.idBlock.hasOwnProperty(hp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(yp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(r.idBlock.hasOwnProperty(gp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(fp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if(!(rc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(e[r.name]=t)),r instanceof R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Qi){if(a=Xt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),a;if(wo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};wp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Xt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&rc in t.valueBlock){const s=yr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,qe),r.name&&(delete e[r.name],a.name=r.name)),a}return Xt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Ap(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=yr($.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Xt(r.result,r.result,t)}const el=Object.freeze(Object.defineProperty({__proto__:null,Any:Qt,BaseBlock:Ve,BaseStringBlock:vo,BitString:Zt,BmpString:Li,Boolean:Pi,CharacterString:Yi,Choice:_o,Constructed:Ke,DATE:Bo,DateTime:Eo,Duration:No,EndOfContent:ko,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:ht,IA5String:Gi,Integer:yt,Null:Jt,NumericString:Fi,ObjectIdentifier:Ui,OctetString:Yt,Primitive:Yr,PrintableString:qi,RawData:xp,RelativeObjectIdentifier:Ao,Repeated:Qi,Sequence:xt,Set:At,TIME:Oo,TeletexString:Ki,TimeOfDay:Io,UTCTime:Qr,UniversalString:Hi,Utf8String:Bt,ValueBlock:Le,VideotexString:zi,ViewWriter:$i,VisibleString:Zr,compareSchema:Xt,fromBER:gr,verifySchema:Ap},Symbol.toStringTag,{value:"Module"}));var N;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(N||(N={}));var w;(function(e){e[e.Any=1]="Any",e[e.Boolean=2]="Boolean",e[e.OctetString=3]="OctetString",e[e.BitString=4]="BitString",e[e.Integer=5]="Integer",e[e.Enumerated=6]="Enumerated",e[e.ObjectIdentifier=7]="ObjectIdentifier",e[e.Utf8String=8]="Utf8String",e[e.BmpString=9]="BmpString",e[e.UniversalString=10]="UniversalString",e[e.NumericString=11]="NumericString",e[e.PrintableString=12]="PrintableString",e[e.TeletexString=13]="TeletexString",e[e.VideotexString=14]="VideotexString",e[e.IA5String=15]="IA5String",e[e.GraphicString=16]="GraphicString",e[e.VisibleString=17]="VisibleString",e[e.GeneralString=18]="GeneralString",e[e.CharacterString=19]="CharacterString",e[e.UTCTime=20]="UTCTime",e[e.GeneralizedTime=21]="GeneralizedTime",e[e.DATE=22]="DATE",e[e.TimeOfDay=23]="TimeOfDay",e[e.DateTime=24]="DateTime",e[e.Duration=25]="Duration",e[e.TIME=26]="TIME",e[e.Null=27]="Null"})(w||(w={}));class Xi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if($.isBufferSource(t))this.unusedBits=r,this.value=$.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Zt))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=t.valueBlock.unusedBits,this.value=t.valueBlock.valueHex,this}toASN(){return new Zt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Zt({name:t})}toNumber(){let t="";const r=new Uint8Array(this.value);for(const i of r)t+=i.toString(2).padStart(8,"0");return t=t.split("").reverse().join(""),this.unusedBits&&(t=t.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(t,2)}fromNumber(t){let r=t.toString(2);const i=r.length+7>>3;this.unusedBits=(i<<3)-r.length;const o=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)o[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=o.buffer}}class ce{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):$.isBufferSource(t)?this.buffer=$.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Yt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Yt({valueHex:this.buffer})}toSchema(t){return new Yt({name:t})}}const Bp={fromASN:e=>e instanceof Jt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Jt;const t=gr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Ip={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new yt({value:+e})},Ep={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ri({value:e})},we={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new yt({valueHex:e})},Np={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Zt({valueHex:e})},Op={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ui({value:e})},_p={fromASN:e=>e.valueBlock.value,toASN:e=>new Pi({value:e})},en={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Yt({valueHex:e})},Tp={fromASN:e=>new ce(e.getValue()),toASN:e=>e.toASN()};function tt(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const tl=tt(Bt),Vp=tt(Li),jp=tt(Hi),Dp=tt(Fi),$p=tt(qi),Mp=tt(Ki),Pp=tt(zi),Rp=tt(Gi),Up=tt(Wi),Lp=tt(Zr),Hp=tt(Ji),Fp=tt(Yi),qp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Kp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},zp={fromASN:()=>null,toASN:()=>new Jt};function To(e){switch(e){case w.Any:return Bp;case w.BitString:return Np;case w.BmpString:return Vp;case w.Boolean:return _p;case w.CharacterString:return Fp;case w.Enumerated:return Ep;case w.GeneralString:return Hp;case w.GeneralizedTime:return Kp;case w.GraphicString:return Up;case w.IA5String:return Rp;case w.Integer:return Ip;case w.Null:return zp;case w.NumericString:return Dp;case w.ObjectIdentifier:return Op;case w.OctetString:return en;case w.PrintableString:return $p;case w.TeletexString:return Mp;case w.UTCTime:return qp;case w.UniversalString:return jp;case w.Utf8String:return tl;case w.VideotexString:return Pp;case w.VisibleString:return Lp;default:return null}}function It(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:It(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function rl(e){var t;if(e){const r=Object.getPrototypeOf(e);return((t=r==null?void 0:r.prototype)===null||t===void 0?void 0:t.constructor)===Array?!0:rl(r)}return!1}function Gp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let o=0;o<e.byteLength;o++)if(r[o]!==i[o])return!1;return!0}class Wp{constructor(){this.items=new WeakMap}has(t){return this.items.has(t)}get(t,r=!1){const i=this.items.get(t);if(!i)throw new Error(`Cannot get schema for '${t.prototype.constructor.name}' target`);if(r&&!i.schema)throw new Error(`Schema '${t.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return i}cache(t){const r=this.get(t);r.schema||(r.schema=this.create(t,!0))}createDefault(t){const r={type:N.Sequence,items:{}},i=this.findParentSchema(t);return i&&(Object.assign(r,i),r.items=Object.assign({},r.items,i.items)),r}create(t,r){const i=this.items.get(t)||this.createDefault(t),o=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=w[a.type],p=el[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else It(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===N.Choice?l=new Qt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Qt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?At:xt;l=new y({name:"",value:[new Qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||It(a.type)){const y=a.repeated?Ke:Yr;o.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new Ke({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new Ke({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,o.push(l)}switch(i.type){case N.Sequence:return new xt({value:o,name:""});case N.Set:return new At({value:o,name:""});case N.Choice:return new _o({value:o,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const rt=new Wp,T=e=>t=>{let r;rt.has(t)?r=rt.get(t):(r=rt.createDefault(t),rt.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;rt.has(t.constructor)?i=rt.get(t.constructor):(i=rt.createDefault(t.constructor),rt.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=To(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);o.converter=s}i.items[r]=o};class il extends Error{constructor(){super(...arguments),this.schemas=[]}}class Jp{static parse(t,r){const i=gr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(It(r))return new r().fromASN(t);const o=rt.get(r);rt.cache(r);let s=o.schema;if(t.constructor===Ke&&o.type!==N.Choice){s=new Ke({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const l in o.items)delete t[l]}const a=Xt({},t,s);if(!a.verified)throw new il(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(rl(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=o.itemType;if(typeof l=="number"){const d=To(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in o.items){const d=a.result[l];if(!d)continue;const y=o.items[l],p=y.type;if(typeof p=="number"||It(p)){const B=(i=y.converter)!==null&&i!==void 0?i:It(p)?new p:null;if(!B)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const b=y.repeated==="sequence"?xt:At,h=new b;h.valueBlock=d.valueBlock;const g=gr(h.toBER(!1));if(g.offset===-1)throw new Error(`Cannot parse the child item. ${g.result.error}`);if(!("value"in g.result.valueBlock&&Array.isArray(g.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const k=g.result.valueBlock.value;c[l]=Array.from(k,m=>B.fromASN(m))}else c[l]=Array.from(d,b=>B.fromASN(b));else{let b=d;if(y.implicit){let h;if(It(p))h=new p().toSchema("");else{const g=w[p],k=el[g];if(!k)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new k}h.valueBlock=b.valueBlock,b=gr(h.toBER(!1)).result}c[l]=B.fromASN(b)}}else if(y.repeated){if(!Array.isArray(d))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");c[l]=Array.from(d,B=>this.fromASN(B,p))}else c[l]=this.fromASN(d,p)}return c}catch(o){throw o instanceof il&&o.schemas.push(r.name),o}}}class Vo{static serialize(t){return t instanceof Ve?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&It(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=rt.get(r);rt.cache(r);let o=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=To(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(c=>a.toASN(c))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Gp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Vo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||It(c.type))){const y={};y.valueHex=d instanceof Jt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Yr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else o.push(new Ke({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else o.push(new Ke({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case N.Sequence:s=new xt({value:o});break;case N.Set:s=new At({value:o});break;case N.Choice:if(!o[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=o[0];break}return s}static toAsnItem(t,r,i,o){let s;if(typeof t.type=="number"){const a=t.converter;if(!a)throw new Error(`Property '${r}' doesn't have converter for type ${w[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(o,d=>a.toASN(d)),l=t.repeated==="sequence"?xt:At;s=new l({value:c})}else s=a.toASN(o)}else if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(o,l=>this.toASN(l)),c=t.repeated==="sequence"?xt:At;s=new c({value:a})}else s=this.toASN(o);return s}}class ue extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class K{static serialize(t){return Vo.serialize(t)}static parse(t,r){return Jp.parse(t,r)}static toString(t){const r=$.isBufferSource(t)?$.toArrayBuffer(t):K.serialize(t),i=gr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(o<3?a(s):o>3?a(t,r,s):a(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var nl={exports:{}};(function(e){(function(t){const r="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:new RegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:new RegExp(`^${r}\\.${r}$`,"i"),longValue:new RegExp(`^${r}$`,"i")},o=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let k=0,m=-1,x=(h.match(l.zoneIndex)||[])[0],v,C;for(x&&(x=x.substring(1),h=h.replace(/%.+$/,""));(m=h.indexOf(":",m+1))>=0;)k++;if(h.substr(0,2)==="::"&&k--,h.substr(-2,2)==="::"&&k--,k>g)return null;for(C=g-k,v=":";C--;)v+="0:";return h=h.replace("::",v),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const _=h.split(":"),z=[];for(let re=0;re<_.length;re++)z.push(parseInt(_[re],16));return z}(),{parts:g,zoneId:x}}function y(h,g,k,m){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,v;for(;m>0;){if(v=k-m,v<0&&(v=0),h[x]>>v!==g[x]>>v)return!1;m-=k,x+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}function B(h,g){for(;h.length<g;)h=`0${h}`;return h}const b={};b.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let k,m;for(k=0;k<g.length;k++)if(m=g[k],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,k){let m;if(k===void 0&&(m=g,g=m[0],k=m[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,k)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,k=!1;const m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let x,v,C;for(x=3;x>=0;x-=1)if(v=this.octets[x],v in m){if(C=m[v],k&&C!==0)return null;C!==8&&(k=!0),g+=C}else return null;return 32-g},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return b.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),b.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),k=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let v=0;for(;v<4;)x.push(parseInt(k[v],10)|parseInt(m[v],10)^255),v++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.isIPv4=function(h){return this.parser(h)!==null},b.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},b.IPv4.isValidFourPartDecimal=function(h){return!!(b.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},b.IPv4.networkAddressFromCIDR=function(h){let g,k,m,x,v;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],k=0;k<4;)x.push(parseInt(m[k],10)&parseInt(v[k],10)),k++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},b.IPv4.parse=function(h){const g=this.parser(h);if(g===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(g)},b.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const k=parseInt(g[2]);if(k>=0&&k<=32){const m=[this.parse(g[1]),k];return Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},b.IPv4.parser=function(h){let g,k,m;if(g=h.match(i.fourOctet))return function(){const x=g.slice(1,6),v=[];for(let C=0;C<x.length;C++)k=x[C],v.push(p(k));return v}();if(g=h.match(i.longValue)){if(m=p(g[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){const x=[];let v;for(v=0;v<=24;v+=8)x.push(m>>v&255);return x}().reverse()}else return(g=h.match(i.twoOctet))?function(){const x=g.slice(1,4),v=[];if(m=p(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return v.push(p(x[0])),v.push(m>>16&255),v.push(m>>8&255),v.push(m&255),v}():(g=h.match(i.threeOctet))?function(){const x=g.slice(1,5),v=[];if(m=p(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return v.push(p(x[0])),v.push(p(x[1])),v.push(m>>8&255),v.push(m&255),v}():null},b.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let k=0;const m=Math.floor(h/8);for(;k<m;)g[k]=255,k++;return m<4&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},b.IPv6=function(){function h(g,k){let m,x;if(g.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(g[m]<<8|g[m+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");k&&(this.zoneId=k)}return h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],reserved:[[new h([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[new h([8193,4,274,0,0,0,0,0]),48],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(g,k){let m;if(k===void 0&&(m=g,g=m[0],k=m[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,k)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,k=!1;const m={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 x,v;for(let C=7;C>=0;C-=1)if(x=this.parts[C],x in m){if(v=m[x],k&&v!==0)return null;v!==16&&(k=!0),g+=v}else return null;return 128-g},h.prototype.range=function(){return b.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const k=[],m=this.parts;for(let x=0;x<m.length;x++)g=m[x],k.push(g>>8),k.push(g&255);return k},h.prototype.toFixedLengthString=function(){const g=(function(){const m=[];for(let x=0;x<this.parts.length;x++)m.push(B(this.parts[x].toString(16),4));return m}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),g+k},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),k=g[0],m=g[1];return new b.IPv4([k>>8,k&255,m>>8,m&255])},h.prototype.toNormalizedString=function(){const g=(function(){const m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":");let k="";return this.zoneId&&(k=`%${this.zoneId}`),g+k},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,k=this.toNormalizedString();let m=0,x=-1,v;for(;v=g.exec(k);)v[0].length>x&&(m=v.index,x=v[0].length);return x<0?k:`${k.substring(0,m)}::${k.substring(m+x)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),b.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),k=g[0].toByteArray(),m=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let v=0;for(;v<16;)x.push(parseInt(k[v],10)|parseInt(m[v],10)^255),v++;return new this(x)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},b.IPv6.isIPv6=function(h){return this.parser(h)!==null},b.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{const g=this.parser(h);return new this(g.parts,g.zoneId),!0}catch{return!1}},b.IPv6.networkAddressFromCIDR=function(h){let g,k,m,x,v;try{for(g=this.parseCIDR(h),m=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],k=0;k<16;)x.push(parseInt(m[k],10)&parseInt(v[k],10)),k++;return new this(x)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},b.IPv6.parse=function(h){const g=this.parser(h);if(g.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(g.parts,g.zoneId)},b.IPv6.parseCIDR=function(h){let g,k,m;if((k=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(k[2]),g>=0&&g<=128))return m=[this.parse(k[1]),g],Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},b.IPv6.parser=function(h){let g,k,m,x,v,C;if(m=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(h))return d(h,8);if((m=h.match(l.transitional))&&(C=m[6]||"",g=d(m[1].slice(0,-1)+C,6),g.parts)){for(v=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],k=0;k<v.length;k++)if(x=v[k],!(0<=x&&x<=255))return null;return g.parts.push(v[0]<<8|v[1]),g.parts.push(v[2]<<8|v[3]),{parts:g.parts,zoneId:g.zoneId}}return null},b.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let k=0;const m=Math.floor(h/8);for(;k<m;)g[k]=255,k++;return m<16&&(g[m]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},b.fromByteArray=function(h){const g=h.length;if(g===4)return new b.IPv4(h);if(g===16)return new b.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},b.isValid=function(h){return b.IPv6.isValid(h)||b.IPv4.isValid(h)},b.parse=function(h){if(b.IPv6.isValid(h))return b.IPv6.parse(h);if(b.IPv4.isValid(h))return b.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},b.parseCIDR=function(h){try{return b.IPv6.parseCIDR(h)}catch{try{return b.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},b.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},b.subnetMatch=function(h,g,k){let m,x,v,C;k==null&&(k="unicast");for(x in g)if(Object.prototype.hasOwnProperty.call(g,x)){for(v=g[x],v[0]&&!(v[0]instanceof Array)&&(v=[v]),m=0;m<v.length;m++)if(C=v[m],h.kind()===C[0].kind()&&h.match.apply(h,C))return x}return k},e.exports?e.exports=b:t.ipaddr=b})(yo)})(nl);var ol=nl.exports;class sl{static decodeIP(t){if(t.length===64&&parseInt(t,16)===0)return"::/0";if(t.length!==16)return t;const r=parseInt(t.slice(8),16).toString(2).split("").reduce((o,s)=>o+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,o=>`${parseInt(o,16)}.`);return i=i.slice(0,-1),`${i}/${r}`}static toString(t){if(t.byteLength===4||t.byteLength===16){const r=new Uint8Array(t);return ol.fromByteArray(Array.from(r)).toString()}return this.decodeIP(U.ToHex(t))}static fromString(t){const r=ol.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var jo,Do,$o;let je=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:w.TeletexString})],je.prototype,"teletexString",void 0),u([f({type:w.PrintableString})],je.prototype,"printableString",void 0),u([f({type:w.UniversalString})],je.prototype,"universalString",void 0),u([f({type:w.Utf8String})],je.prototype,"utf8String",void 0),u([f({type:w.BmpString})],je.prototype,"bmpString",void 0),je=u([T({type:N.Choice})],je);let mr=class extends je{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?U.ToHex(this.anyValue):super.toString())}};u([f({type:w.IA5String})],mr.prototype,"ia5String",void 0),u([f({type:w.Any})],mr.prototype,"anyValue",void 0),mr=u([T({type:N.Choice})],mr);class Xr{constructor(t={}){this.type="",this.value=new mr,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Xr.prototype,"type",void 0),u([f({type:mr})],Xr.prototype,"value",void 0);let br=jo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,jo.prototype)}};br=jo=u([T({type:N.Set,itemType:Xr})],br);let Mo=Do=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Do.prototype)}};Mo=Do=u([T({type:N.Sequence,itemType:br})],Mo);let Ie=$o=class extends Mo{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Ie=$o=u([T({type:N.Sequence})],Ie);const Yp={fromASN:e=>sl.toString(en.fromASN(e)),toASN:e=>en.toASN(sl.fromString(e))};class ei{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ei.prototype,"typeId",void 0),u([f({type:w.Any,context:0})],ei.prototype,"value",void 0);class Po{constructor(t={}){this.partyName=new je,Object.assign(this,t)}}u([f({type:je,optional:!0,context:0,implicit:!0})],Po.prototype,"nameAssigner",void 0),u([f({type:je,context:1,implicit:!0})],Po.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ei,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:w.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:w.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:w.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:Ie,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:Po,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:w.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:w.OctetString,context:7,implicit:!0,converter:Yp})],ie.prototype,"iPAddress",void 0),u([f({type:w.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([T({type:N.Choice})],ie);const wr="1.3.6.1.5.5.7.3",er="2.5.29";var Ro;class tn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],tn.prototype,"accessMethod",void 0),u([f({type:ie})],tn.prototype,"accessLocation",void 0);let al=Ro=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};al=Ro=u([T({type:N.Sequence,itemType:tn})],al);const Uo=`${er}.35`;class Lo extends ce{}class tr{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Lo,context:0,optional:!0,implicit:!0})],tr.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],tr.prototype,"authorityCertIssuer",void 0),u([f({type:w.Integer,context:2,optional:!0,implicit:!0,converter:we})],tr.prototype,"authorityCertSerialNumber",void 0);const cl=`${er}.19`;class rn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:w.Boolean,defaultValue:!1})],rn.prototype,"cA",void 0),u([f({type:w.Integer,optional:!0})],rn.prototype,"pathLenConstraint",void 0);var Ho;let He=Ho=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};He=Ho=u([T({type:N.Sequence,itemType:ie})],He);var Fo;let ll=Fo=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};ll=Fo=u([T({type:N.Sequence})],ll);var qo;const ul=`${er}.32`;let Et=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:w.IA5String})],Et.prototype,"ia5String",void 0),u([f({type:w.VisibleString})],Et.prototype,"visibleString",void 0),u([f({type:w.BmpString})],Et.prototype,"bmpString",void 0),u([f({type:w.Utf8String})],Et.prototype,"utf8String",void 0),Et=u([T({type:N.Choice})],Et);class Ko{constructor(t={}){this.organization=new Et,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:Et})],Ko.prototype,"organization",void 0),u([f({type:w.Integer,repeated:"sequence"})],Ko.prototype,"noticeNumbers",void 0);class zo{constructor(t={}){Object.assign(this,t)}}u([f({type:Ko,optional:!0})],zo.prototype,"noticeRef",void 0),u([f({type:Et,optional:!0})],zo.prototype,"explicitText",void 0);let nn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:w.IA5String})],nn.prototype,"cPSuri",void 0),u([f({type:zo})],nn.prototype,"userNotice",void 0),nn=u([T({type:N.Choice})],nn);class Go{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Go.prototype,"policyQualifierId",void 0),u([f({type:w.Any})],Go.prototype,"qualifier",void 0);class on{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],on.prototype,"policyIdentifier",void 0),u([f({type:Go,repeated:"sequence",optional:!0})],on.prototype,"policyQualifiers",void 0);let sn=qo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};sn=qo=u([T({type:N.Sequence,itemType:on})],sn);let an=class{constructor(t=0){this.value=t}};u([f({type:w.Integer})],an.prototype,"value",void 0),an=u([T({type:N.Choice})],an);let dl=class extends an{};dl=u([T({type:N.Choice})],dl);var Wo,at;(function(e){e[e.unused=1]="unused",e[e.keyCompromise=2]="keyCompromise",e[e.cACompromise=4]="cACompromise",e[e.affiliationChanged=8]="affiliationChanged",e[e.superseded=16]="superseded",e[e.cessationOfOperation=32]="cessationOfOperation",e[e.certificateHold=64]="certificateHold",e[e.privilegeWithdrawn=128]="privilegeWithdrawn",e[e.aACompromise=256]="aACompromise"})(at||(at={}));class fl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&at.aACompromise&&t.push("aACompromise"),r&at.affiliationChanged&&t.push("affiliationChanged"),r&at.cACompromise&&t.push("cACompromise"),r&at.certificateHold&&t.push("certificateHold"),r&at.cessationOfOperation&&t.push("cessationOfOperation"),r&at.keyCompromise&&t.push("keyCompromise"),r&at.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&at.superseded&&t.push("superseded"),r&at.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],vr.prototype,"fullName",void 0),u([f({type:br,context:1,implicit:!0})],vr.prototype,"nameRelativeToCRLIssuer",void 0),vr=u([T({type:N.Choice})],vr);class ti{constructor(t={}){Object.assign(this,t)}}u([f({type:vr,context:0,optional:!0})],ti.prototype,"distributionPoint",void 0),u([f({type:fl,context:1,optional:!0,implicit:!0})],ti.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ti.prototype,"cRLIssuer",void 0);let Jo=Wo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};Jo=Wo=u([T({type:N.Sequence,itemType:ti})],Jo);var Yo;let pl=Yo=class extends Jo{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};pl=Yo=u([T({type:N.Sequence,itemType:ti})],pl);class Re{constructor(t={}){this.onlyContainsUserCerts=Re.ONLY,this.onlyContainsCACerts=Re.ONLY,this.indirectCRL=Re.ONLY,this.onlyContainsAttributeCerts=Re.ONLY,Object.assign(this,t)}}Re.ONLY=!1,u([f({type:vr,context:0,optional:!0})],Re.prototype,"distributionPoint",void 0),u([f({type:w.Boolean,context:1,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsUserCerts",void 0),u([f({type:w.Boolean,context:2,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsCACerts",void 0),u([f({type:fl,context:3,optional:!0,implicit:!0})],Re.prototype,"onlySomeReasons",void 0),u([f({type:w.Boolean,context:4,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"indirectCRL",void 0),u([f({type:w.Boolean,context:5,defaultValue:Re.ONLY,implicit:!0})],Re.prototype,"onlyContainsAttributeCerts",void 0);var ri;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ri||(ri={}));let Zo=class{constructor(t=ri.unspecified){this.reason=ri.unspecified,this.reason=t}toJSON(){return ri[this.reason]}toString(){return this.toJSON()}};u([f({type:w.Enumerated})],Zo.prototype,"reason",void 0),Zo=u([T({type:N.Choice})],Zo);var Qo;const hl=`${er}.37`;let cn=Qo=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};cn=Qo=u([T({type:N.Sequence,itemType:w.ObjectIdentifier})],cn);const Zp=`${wr}.1`,Qp=`${wr}.2`,Xp=`${wr}.3`,eh=`${wr}.4`,th=`${wr}.8`,rh=`${wr}.9`;let Xo=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:w.Integer,converter:we})],Xo.prototype,"value",void 0),Xo=u([T({type:N.Choice})],Xo);let es=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:w.GeneralizedTime})],es.prototype,"value",void 0),es=u([T({type:N.Choice})],es);var ts;let yl=ts=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};yl=ts=u([T({type:N.Sequence})],yl);const gl=`${er}.15`;var ct;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(ct||(ct={}));class rs extends Xi{toJSON(){const t=this.toNumber(),r=[];return t&ct.cRLSign&&r.push("crlSign"),t&ct.dataEncipherment&&r.push("dataEncipherment"),t&ct.decipherOnly&&r.push("decipherOnly"),t&ct.digitalSignature&&r.push("digitalSignature"),t&ct.encipherOnly&&r.push("encipherOnly"),t&ct.keyAgreement&&r.push("keyAgreement"),t&ct.keyCertSign&&r.push("keyCertSign"),t&ct.keyEncipherment&&r.push("keyEncipherment"),t&ct.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var is;class ln{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],ln.prototype,"base",void 0),u([f({type:w.Integer,context:0,defaultValue:0,implicit:!0})],ln.prototype,"minimum",void 0),u([f({type:w.Integer,context:1,optional:!0,implicit:!0})],ln.prototype,"maximum",void 0);let un=is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};un=is=u([T({type:N.Sequence,itemType:ln})],un);class ml{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],ml.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],ml.prototype,"excludedSubtrees",void 0);class bl{constructor(t={}){Object.assign(this,t)}}u([f({type:w.Integer,context:0,implicit:!0,optional:!0,converter:we})],bl.prototype,"requireExplicitPolicy",void 0),u([f({type:w.Integer,context:1,implicit:!0,optional:!0,converter:we})],bl.prototype,"inhibitPolicyMapping",void 0);var ns;class os{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],os.prototype,"issuerDomainPolicy",void 0),u([f({type:w.ObjectIdentifier})],os.prototype,"subjectDomainPolicy",void 0);let wl=ns=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};wl=ns=u([T({type:N.Sequence,itemType:os})],wl);var ss;const vl=`${er}.17`;let as=ss=class extends He{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};as=ss=u([T({type:N.Sequence})],as);let Nt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],Nt.prototype,"type",void 0),u([f({type:w.Any,repeated:"set"})],Nt.prototype,"values",void 0);var cs;let kl=cs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};kl=cs=u([T({type:N.Sequence,itemType:Nt})],kl);const Cl=`${er}.14`;class Pt extends Lo{}class Sl{constructor(t={}){Object.assign(this,t)}}u([f({type:w.GeneralizedTime,context:0,implicit:!0,optional:!0})],Sl.prototype,"notBefore",void 0),u([f({type:w.GeneralizedTime,context:1,implicit:!0,optional:!0})],Sl.prototype,"notAfter",void 0);var ii;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ii||(ii={}));class xl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&ii.pKIXCertificate&&t.push("pKIXCertificate"),r&ii.newExtensions&&t.push("newExtensions"),r&ii.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Al{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new xl,Object.assign(this,t)}}u([f({type:w.GeneralString})],Al.prototype,"entrustVers",void 0),u([f({type:xl})],Al.prototype,"entrustInfoFlags",void 0);var ls;let Bl=ls=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};Bl=ls=u([T({type:N.Sequence,itemType:tn})],Bl);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&Xa(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:w.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:w.Any,optional:!0})],F.prototype,"parameters",void 0);class Ot{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Ot.prototype,"algorithm",void 0),u([f({type:w.BitString})],Ot.prototype,"subjectPublicKey",void 0);let De=class{constructor(t){if(t)if(typeof t=="string"||typeof t=="number"||t instanceof Date){const r=new Date(t);r.getUTCFullYear()>2049?this.generalTime=r:this.utcTime=r}else Object.assign(this,t)}getTime(){const t=this.utcTime||this.generalTime;if(!t)throw new Error("Cannot get time from CHOICE object");return t}};u([f({type:w.UTCTime})],De.prototype,"utcTime",void 0),u([f({type:w.GeneralizedTime})],De.prototype,"generalTime",void 0),De=u([T({type:N.Choice})],De);class dn{constructor(t){this.notBefore=new De(new Date),this.notAfter=new De(new Date),t&&(this.notBefore=new De(t.notBefore),this.notAfter=new De(t.notAfter))}}u([f({type:De})],dn.prototype,"notBefore",void 0),u([f({type:De})],dn.prototype,"notAfter",void 0);var us;let lt=class rp{constructor(t={}){this.extnID="",this.critical=rp.CRITICAL,this.extnValue=new ce,Object.assign(this,t)}};lt.CRITICAL=!1,u([f({type:w.ObjectIdentifier})],lt.prototype,"extnID",void 0),u([f({type:w.Boolean,defaultValue:lt.CRITICAL})],lt.prototype,"critical",void 0),u([f({type:ce})],lt.prototype,"extnValue",void 0);let rr=us=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};rr=us=u([T({type:N.Sequence,itemType:lt})],rr);var kr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(kr||(kr={}));class it{constructor(t={}){this.version=kr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new F,this.issuer=new Ie,this.validity=new dn,this.subject=new Ie,this.subjectPublicKeyInfo=new Ot,Object.assign(this,t)}}u([f({type:w.Integer,context:0,defaultValue:kr.v1})],it.prototype,"version",void 0),u([f({type:w.Integer,converter:we})],it.prototype,"serialNumber",void 0),u([f({type:F})],it.prototype,"signature",void 0),u([f({type:Ie})],it.prototype,"issuer",void 0),u([f({type:dn})],it.prototype,"validity",void 0),u([f({type:Ie})],it.prototype,"subject",void 0),u([f({type:Ot})],it.prototype,"subjectPublicKeyInfo",void 0),u([f({type:w.BitString,context:1,implicit:!0,optional:!0})],it.prototype,"issuerUniqueID",void 0),u([f({type:w.BitString,context:2,implicit:!0,optional:!0})],it.prototype,"subjectUniqueID",void 0),u([f({type:rr,context:3,optional:!0})],it.prototype,"extensions",void 0);class Cr{constructor(t={}){this.tbsCertificate=new it,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:it})],Cr.prototype,"tbsCertificate",void 0),u([f({type:F})],Cr.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],Cr.prototype,"signatureValue",void 0);class fn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new De,Object.assign(this,t)}}u([f({type:w.Integer,converter:we})],fn.prototype,"userCertificate",void 0),u([f({type:De})],fn.prototype,"revocationDate",void 0),u([f({type:lt,optional:!0,repeated:"sequence"})],fn.prototype,"crlEntryExtensions",void 0);class _t{constructor(t={}){this.signature=new F,this.issuer=new Ie,this.thisUpdate=new De,Object.assign(this,t)}}u([f({type:w.Integer,optional:!0})],_t.prototype,"version",void 0),u([f({type:F})],_t.prototype,"signature",void 0),u([f({type:Ie})],_t.prototype,"issuer",void 0),u([f({type:De})],_t.prototype,"thisUpdate",void 0),u([f({type:De,optional:!0})],_t.prototype,"nextUpdate",void 0),u([f({type:fn,repeated:"sequence",optional:!0})],_t.prototype,"revokedCertificates",void 0),u([f({type:lt,optional:!0,context:0,repeated:"sequence"})],_t.prototype,"crlExtensions",void 0);let ds=class{constructor(t={}){this.tbsCertList=new _t,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:_t})],ds.prototype,"tbsCertList",void 0),u([f({type:F})],ds.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],ds.prototype,"signature",void 0);class Sr{constructor(t={}){this.issuer=new Ie,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Ie})],Sr.prototype,"issuer",void 0),u([f({type:w.Integer,converter:we})],Sr.prototype,"serialNumber",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Pt,context:0,implicit:!0})],xr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],xr.prototype,"issuerAndSerialNumber",void 0),xr=u([T({type:N.Choice})],xr);var Tt;(function(e){e[e.v0=0]="v0",e[e.v1=1]="v1",e[e.v2=2]="v2",e[e.v3=3]="v3",e[e.v4=4]="v4",e[e.v5=5]="v5"})(Tt||(Tt={}));let ni=class extends F{};ni=u([T({type:N.Sequence})],ni);let pn=class extends F{};pn=u([T({type:N.Sequence})],pn);let gt=class extends F{};gt=u([T({type:N.Sequence})],gt);let hn=class extends F{};hn=u([T({type:N.Sequence})],hn);let Il=class extends F{};Il=u([T({type:N.Sequence})],Il);let fs=class extends F{};fs=u([T({type:N.Sequence})],fs);let Ar=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],Ar.prototype,"attrType",void 0),u([f({type:w.Any,repeated:"set"})],Ar.prototype,"attrValues",void 0);var ps;class mt{constructor(t={}){this.version=Tt.v0,this.sid=new xr,this.digestAlgorithm=new ni,this.signatureAlgorithm=new pn,this.signature=new ce,Object.assign(this,t)}}u([f({type:w.Integer})],mt.prototype,"version",void 0),u([f({type:xr})],mt.prototype,"sid",void 0),u([f({type:ni})],mt.prototype,"digestAlgorithm",void 0),u([f({type:Ar,repeated:"set",context:0,implicit:!0,optional:!0})],mt.prototype,"signedAttrs",void 0),u([f({type:pn})],mt.prototype,"signatureAlgorithm",void 0),u([f({type:ce})],mt.prototype,"signature",void 0),u([f({type:Ar,repeated:"set",context:1,implicit:!0,optional:!0})],mt.prototype,"unsignedAttrs",void 0);let yn=ps=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};yn=ps=u([T({type:N.Set,itemType:mt})],yn);let El=class extends De{};El=u([T({type:N.Choice})],El);let Nl=class extends mt{};Nl=u([T({type:N.Sequence})],Nl);class hs{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],hs.prototype,"acIssuer",void 0),u([f({type:w.Integer})],hs.prototype,"acSerial",void 0),u([f({type:Nt,repeated:"sequence"})],hs.prototype,"attrs",void 0);var ys;let gn=ys=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gn=ys=u([T({type:N.Sequence,itemType:w.ObjectIdentifier})],gn);class mn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:w.Integer,optional:!0})],mn.prototype,"pathLenConstraint",void 0),u([f({type:gn,implicit:!0,context:0,optional:!0})],mn.prototype,"permittedAttrs",void 0),u([f({type:gn,implicit:!0,context:1,optional:!0})],mn.prototype,"excludedAttrs",void 0),u([f({type:w.Boolean,defaultValue:!0})],mn.prototype,"permitUnSpecified",void 0);class ir{constructor(t={}){this.issuer=new He,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:He})],ir.prototype,"issuer",void 0),u([f({type:w.Integer,converter:we})],ir.prototype,"serial",void 0),u([f({type:w.BitString,optional:!0})],ir.prototype,"issuerUID",void 0);var gs;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(gs||(gs={}));class nr{constructor(t={}){this.digestedObjectType=gs.publicKey,this.digestAlgorithm=new F,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Enumerated})],nr.prototype,"digestedObjectType",void 0),u([f({type:w.ObjectIdentifier,optional:!0})],nr.prototype,"otherObjectTypeID",void 0),u([f({type:F})],nr.prototype,"digestAlgorithm",void 0),u([f({type:w.BitString})],nr.prototype,"objectDigest",void 0);class bn{constructor(t={}){Object.assign(this,t)}}u([f({type:He,optional:!0})],bn.prototype,"issuerName",void 0),u([f({type:ir,context:0,implicit:!0,optional:!0})],bn.prototype,"baseCertificateID",void 0),u([f({type:nr,context:1,implicit:!0,optional:!0})],bn.prototype,"objectDigestInfo",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],Br.prototype,"v1Form",void 0),u([f({type:bn,context:0,implicit:!0})],Br.prototype,"v2Form",void 0),Br=u([T({type:N.Choice})],Br);class wn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:w.GeneralizedTime})],wn.prototype,"notBeforeTime",void 0),u([f({type:w.GeneralizedTime})],wn.prototype,"notAfterTime",void 0);class oi{constructor(t={}){Object.assign(this,t)}}u([f({type:ir,implicit:!0,context:0,optional:!0})],oi.prototype,"baseCertificateID",void 0),u([f({type:He,implicit:!0,context:1,optional:!0})],oi.prototype,"entityName",void 0),u([f({type:nr,implicit:!0,context:2,optional:!0})],oi.prototype,"objectDigestInfo",void 0);var ms;(function(e){e[e.v2=1]="v2"})(ms||(ms={}));class ut{constructor(t={}){this.version=ms.v2,this.holder=new oi,this.issuer=new Br,this.signature=new F,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new wn,this.attributes=[],Object.assign(this,t)}}u([f({type:w.Integer})],ut.prototype,"version",void 0),u([f({type:oi})],ut.prototype,"holder",void 0),u([f({type:Br})],ut.prototype,"issuer",void 0),u([f({type:F})],ut.prototype,"signature",void 0),u([f({type:w.Integer,converter:we})],ut.prototype,"serialNumber",void 0),u([f({type:wn})],ut.prototype,"attrCertValidityPeriod",void 0),u([f({type:Nt,repeated:"sequence"})],ut.prototype,"attributes",void 0),u([f({type:w.BitString,optional:!0})],ut.prototype,"issuerUniqueID",void 0),u([f({type:rr,optional:!0})],ut.prototype,"extensions",void 0);class vn{constructor(t={}){this.acinfo=new ut,this.signatureAlgorithm=new F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:ut})],vn.prototype,"acinfo",void 0),u([f({type:F})],vn.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],vn.prototype,"signatureValue",void 0);var kn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(kn||(kn={}));class bs extends Xi{}class ws{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier,implicit:!0,context:0})],ws.prototype,"type",void 0),u([f({type:w.Any,implicit:!0,context:1})],ws.prototype,"value",void 0);class vs{constructor(t={}){this.policyId="",this.classList=new bs(kn.unclassified),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],vs.prototype,"policyId",void 0),u([f({type:bs,defaultValue:new bs(kn.unclassified)})],vs.prototype,"classList",void 0),u([f({type:ws,repeated:"set"})],vs.prototype,"securityCategories",void 0);class Cn{constructor(t={}){Object.assign(this,t)}}u([f({type:ce})],Cn.prototype,"cotets",void 0),u([f({type:w.ObjectIdentifier})],Cn.prototype,"oid",void 0),u([f({type:w.Utf8String})],Cn.prototype,"string",void 0);class Ol{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Ol.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],Ol.prototype,"values",void 0);var ks;class Sn{constructor(t={}){this.targetCertificate=new ir,Object.assign(this,t)}}u([f({type:ir})],Sn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],Sn.prototype,"targetName",void 0),u([f({type:nr,optional:!0})],Sn.prototype,"certDigestInfo",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ir.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ir.prototype,"targetGroup",void 0),u([f({type:Sn,context:2,implicit:!0})],Ir.prototype,"targetCert",void 0),Ir=u([T({type:N.Choice})],Ir);let Cs=ks=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ks.prototype)}};Cs=ks=u([T({type:N.Sequence,itemType:Ir})],Cs);var Ss;let _l=Ss=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};_l=Ss=u([T({type:N.Sequence,itemType:Cs})],_l);class Tl{constructor(t={}){Object.assign(this,t)}}u([f({type:He,implicit:!0,context:0,optional:!0})],Tl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Tl.prototype,"roleName",void 0);class xs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],xs.prototype,"service",void 0),u([f({type:ie})],xs.prototype,"ident",void 0),u([f({type:ce,optional:!0})],xs.prototype,"authInfo",void 0);var As;class Bs{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Bs.prototype,"otherCertFormat",void 0),u([f({type:w.Any})],Bs.prototype,"otherCert",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Cr})],Er.prototype,"certificate",void 0),u([f({type:vn,context:2,implicit:!0})],Er.prototype,"v2AttrCert",void 0),u([f({type:Bs,context:3,implicit:!0})],Er.prototype,"other",void 0),Er=u([T({type:N.Choice})],Er);let xn=As=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};xn=As=u([T({type:N.Set,itemType:Er})],xn);class Nr{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Nr.prototype,"contentType",void 0),u([f({type:w.Any,context:0})],Nr.prototype,"content",void 0);let si=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ce})],si.prototype,"single",void 0),u([f({type:w.Any})],si.prototype,"any",void 0),si=u([T({type:N.Choice})],si);class An{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],An.prototype,"eContentType",void 0),u([f({type:si,context:0,optional:!0})],An.prototype,"eContent",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ce,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ce,converter:Tp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([T({type:N.Choice})],ai);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new hn,Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:hn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ai,optional:!0})],ci.prototype,"encryptedContent",void 0);class Bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Bn.prototype,"keyAttrId",void 0),u([f({type:w.Any,optional:!0})],Bn.prototype,"keyAttr",void 0);var Is;class In{constructor(t={}){this.subjectKeyIdentifier=new Pt,Object.assign(this,t)}}u([f({type:Pt})],In.prototype,"subjectKeyIdentifier",void 0),u([f({type:w.GeneralizedTime,optional:!0})],In.prototype,"date",void 0),u([f({type:Bn,optional:!0})],In.prototype,"other",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:In,context:0,implicit:!0,optional:!0})],Or.prototype,"rKeyId",void 0),u([f({type:Sr,optional:!0})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([T({type:N.Choice})],Or);class Es{constructor(t={}){this.rid=new Or,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:Or})],Es.prototype,"rid",void 0),u([f({type:ce})],Es.prototype,"encryptedKey",void 0);let En=Is=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};En=Is=u([T({type:N.Sequence,itemType:Es})],En);class Ns{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],Ns.prototype,"algorithm",void 0),u([f({type:w.BitString})],Ns.prototype,"publicKey",void 0);let or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Pt,context:0,implicit:!0,optional:!0})],or.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ns,context:1,implicit:!0,optional:!0})],or.prototype,"originatorKey",void 0),u([f({type:Sr,optional:!0})],or.prototype,"issuerAndSerialNumber",void 0),or=u([T({type:N.Choice})],or);class _r{constructor(t={}){this.version=Tt.v3,this.originator=new or,this.keyEncryptionAlgorithm=new gt,this.recipientEncryptedKeys=new En,Object.assign(this,t)}}u([f({type:w.Integer})],_r.prototype,"version",void 0),u([f({type:or,context:0})],_r.prototype,"originator",void 0),u([f({type:ce,context:1,optional:!0})],_r.prototype,"ukm",void 0),u([f({type:gt})],_r.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:En})],_r.prototype,"recipientEncryptedKeys",void 0);let Tr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Pt,context:0,implicit:!0})],Tr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Sr})],Tr.prototype,"issuerAndSerialNumber",void 0),Tr=u([T({type:N.Choice})],Tr);class li{constructor(t={}){this.version=Tt.v0,this.rid=new Tr,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:w.Integer})],li.prototype,"version",void 0),u([f({type:Tr})],li.prototype,"rid",void 0),u([f({type:gt})],li.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ce,Object.assign(this,t)}}u([f({type:ce})],ui.prototype,"keyIdentifier",void 0),u([f({type:w.GeneralizedTime,optional:!0})],ui.prototype,"date",void 0),u([f({type:Bn,optional:!0})],ui.prototype,"other",void 0);class di{constructor(t={}){this.version=Tt.v4,this.kekid=new ui,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:w.Integer})],di.prototype,"version",void 0),u([f({type:ui})],di.prototype,"kekid",void 0),u([f({type:gt})],di.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Tt.v0,this.keyEncryptionAlgorithm=new gt,this.encryptedKey=new ce,Object.assign(this,t)}}u([f({type:w.Integer})],fi.prototype,"version",void 0),u([f({type:fs,context:0,optional:!0})],fi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:gt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ce})],fi.prototype,"encryptedKey",void 0);class Os{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Os.prototype,"oriType",void 0),u([f({type:w.Any})],Os.prototype,"oriValue",void 0);let Rt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:li,optional:!0})],Rt.prototype,"ktri",void 0),u([f({type:_r,context:1,implicit:!0,optional:!0})],Rt.prototype,"kari",void 0),u([f({type:di,context:2,implicit:!0,optional:!0})],Rt.prototype,"kekri",void 0),u([f({type:fi,context:3,implicit:!0,optional:!0})],Rt.prototype,"pwri",void 0),u([f({type:Os,context:4,implicit:!0,optional:!0})],Rt.prototype,"ori",void 0),Rt=u([T({type:N.Choice})],Rt);var _s;let Nn=_s=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,_s.prototype)}};Nn=_s=u([T({type:N.Set,itemType:Rt})],Nn);var Ts;class On{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],On.prototype,"otherRevInfoFormat",void 0),u([f({type:w.Any})],On.prototype,"otherRevInfo",void 0);let pi=class{constructor(t={}){this.other=new On,Object.assign(this,t)}};u([f({type:On,context:1,implicit:!0})],pi.prototype,"other",void 0),pi=u([T({type:N.Choice})],pi);let Vs=Ts=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};Vs=Ts=u([T({type:N.Set,itemType:pi})],Vs);class js{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],js.prototype,"certs",void 0),u([f({type:Vs,context:1,implicit:!0,optional:!0})],js.prototype,"crls",void 0);var Ds;let $s=Ds=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};$s=Ds=u([T({type:N.Set,itemType:Ar})],$s);class hi{constructor(t={}){this.version=Tt.v0,this.recipientInfos=new Nn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:w.Integer})],hi.prototype,"version",void 0),u([f({type:js,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:$s,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const ih="1.2.840.113549.1.7.2";var Ms;let _n=Ms=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Ms.prototype)}};_n=Ms=u([T({type:N.Set,itemType:ni})],_n);class Vr{constructor(t={}){this.version=Tt.v0,this.digestAlgorithms=new _n,this.encapContentInfo=new An,this.signerInfos=new yn,Object.assign(this,t)}}u([f({type:w.Integer})],Vr.prototype,"version",void 0),u([f({type:_n})],Vr.prototype,"digestAlgorithms",void 0),u([f({type:An})],Vr.prototype,"encapContentInfo",void 0),u([f({type:xn,context:0,implicit:!0,optional:!0})],Vr.prototype,"certificates",void 0),u([f({type:pi,context:1,implicit:!0,optional:!0})],Vr.prototype,"crls",void 0),u([f({type:yn})],Vr.prototype,"signerInfos",void 0);const yi="1.2.840.10045.2.1",Ps="1.2.840.10045.4.1",Vl="1.2.840.10045.4.3.1",Rs="1.2.840.10045.4.3.2",Us="1.2.840.10045.4.3.3",Ls="1.2.840.10045.4.3.4",jl="1.2.840.10045.3.1.7",Dl="1.3.132.0.34",$l="1.3.132.0.35";function gi(e){return new F({algorithm:e})}const nh=gi(Ps);gi(Vl);const oh=gi(Rs),sh=gi(Us),ah=gi(Ls);let jr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:w.ObjectIdentifier})],jr.prototype,"namedCurve",void 0),jr=u([T({type:N.Choice})],jr);class Tn{constructor(t={}){this.version=1,this.privateKey=new ce,Object.assign(this,t)}}u([f({type:w.Integer})],Tn.prototype,"version",void 0),u([f({type:ce})],Tn.prototype,"privateKey",void 0),u([f({type:jr,context:0,optional:!0})],Tn.prototype,"parameters",void 0),u([f({type:w.BitString,context:1,optional:!0})],Tn.prototype,"publicKey",void 0);class Vn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:we})],Vn.prototype,"r",void 0),u([f({type:w.Integer,converter:we})],Vn.prototype,"s",void 0);const ze="1.2.840.113549.1.1",Dr=`${ze}.1`,ch=`${ze}.7`,lh=`${ze}.9`,uh=`${ze}.10`,dh=`${ze}.2`,fh=`${ze}.4`,jn=`${ze}.5`,ph=`${ze}.14`,Hs=`${ze}.11`,Dn=`${ze}.12`,$n=`${ze}.13`,Ml=`${ze}.15`,Pl=`${ze}.16`,Rl="1.3.14.3.2.26",Ul="2.16.840.1.101.3.4.2.4",Ll="2.16.840.1.101.3.4.2.1",Hl="2.16.840.1.101.3.4.2.2",Fl="2.16.840.1.101.3.4.2.3",hh="2.16.840.1.101.3.4.2.5",yh="2.16.840.1.101.3.4.2.6",gh="1.2.840.113549.2.2",mh="1.2.840.113549.2.5",Fs=`${ze}.8`;function Ee(e){return new F({algorithm:e,parameters:null})}Ee(gh),Ee(mh);const sr=Ee(Rl);Ee(Ul),Ee(Ll),Ee(Hl),Ee(Fl),Ee(hh),Ee(yh);const ql=new F({algorithm:Fs,parameters:K.serialize(sr)}),Kl=new F({algorithm:lh,parameters:K.serialize(en.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ee(Dr),Ee(dh),Ee(fh),Ee(jn),Ee(Ml),Ee(Pl),Ee(Dn),Ee($n),Ee(Ml),Ee(Pl);class Mn{constructor(t={}){this.hashAlgorithm=new F(sr),this.maskGenAlgorithm=new F({algorithm:Fs,parameters:K.serialize(sr)}),this.pSourceAlgorithm=new F(Kl),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:sr})],Mn.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ql})],Mn.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:Kl})],Mn.prototype,"pSourceAlgorithm",void 0),new F({algorithm:ch,parameters:K.serialize(new Mn)});class mi{constructor(t={}){this.hashAlgorithm=new F(sr),this.maskGenAlgorithm=new F({algorithm:Fs,parameters:K.serialize(sr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:sr})],mi.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:ql})],mi.prototype,"maskGenAlgorithm",void 0),u([f({type:w.Integer,context:2,defaultValue:20})],mi.prototype,"saltLength",void 0),u([f({type:w.Integer,context:3,defaultValue:1})],mi.prototype,"trailerField",void 0),new F({algorithm:uh,parameters:K.serialize(new mi)});class Pn{constructor(t={}){this.digestAlgorithm=new F,this.digest=new ce,Object.assign(this,t)}}u([f({type:F})],Pn.prototype,"digestAlgorithm",void 0),u([f({type:ce})],Pn.prototype,"digest",void 0);var qs;class Rn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:we})],Rn.prototype,"prime",void 0),u([f({type:w.Integer,converter:we})],Rn.prototype,"exponent",void 0),u([f({type:w.Integer,converter:we})],Rn.prototype,"coefficient",void 0);let Ks=qs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([T({type:N.Sequence,itemType:Rn})],Ks);class bt{constructor(t={}){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,t)}}u([f({type:w.Integer})],bt.prototype,"version",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"modulus",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"publicExponent",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"privateExponent",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"prime1",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"prime2",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"exponent1",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"exponent2",void 0),u([f({type:w.Integer,converter:we})],bt.prototype,"coefficient",void 0),u([f({type:Ks,optional:!0})],bt.prototype,"otherPrimeInfos",void 0);class zs{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.Integer,converter:we})],zs.prototype,"modulus",void 0),u([f({type:w.Integer,converter:we})],zs.prototype,"publicExponent",void 0);var Gs;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Gs||(Gs={}));const Ge=Gs;/*! *****************************************************************************
|
|
76
76
|
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
78
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -85,9 +85,9 @@ ${t.join(`
|
|
|
85
85
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
86
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
87
|
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */var
|
|
88
|
+
***************************************************************************** */var Ws=function(e,t){return Ws=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},Ws(e,t)};function Js(e,t){Ws(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function bh(e,t,r,i){function o(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function c(y){try{d(i.next(y))}catch(p){a(p)}}function l(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):o(y.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function wh(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(d){return function(y){return l([d,y])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=t.call(e,r)}catch(y){d=[6,y],o=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Un(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ln(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(c){a={error:c}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function ar(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ln(arguments[t]));return e}var vh="injectionTokens";function kh(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(vh,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function zl(e){return!!e.useClass}function Ys(e){return!!e.useFactory}var Gl=function(){function e(t){this.wrap=t,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return e.prototype.createProxy=function(t){var r=this,i={},o=!1,s,a=function(){return o||(s=t(r.wrap()),o=!0),s};return new Proxy(i,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},i=function(o){r[o]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=t();var c=Reflect[o];return c.apply(void 0,ar(s))}};return this.reflectMethods.forEach(i),r},e}();function $r(e){return typeof e=="string"||typeof e=="symbol"}function Ch(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function Wl(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Sh(e){return typeof e=="function"||e instanceof Gl}function Hn(e){return!!e.useToken}function Fn(e){return e.useValue!=null}function xh(e){return zl(e)||Fn(e)||Hn(e)||Ys(e)}var Zs=function(){function e(){this._registryMap=new Map}return e.prototype.entries=function(){return this._registryMap.entries()},e.prototype.getAll=function(t){return this.ensure(t),this._registryMap.get(t)},e.prototype.get=function(t){this.ensure(t);var r=this._registryMap.get(t);return r[r.length-1]||null},e.prototype.set=function(t,r){this.ensure(t),this._registryMap.get(t).push(r)},e.prototype.setAll=function(t,r){this._registryMap.set(t,r)},e.prototype.has=function(t){return this.ensure(t),this._registryMap.get(t).length>0},e.prototype.clear=function(){this._registryMap.clear()},e.prototype.ensure=function(t){this._registryMap.has(t)||this._registryMap.set(t,[])},e}(),Ah=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),Jl=function(){function e(){this.scopedResolutions=new Map}return e}();function Bh(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Ih(e,t,r){return r===void 0&&(r=" "),ar([e],t.message.split(`
|
|
89
89
|
`).map(function(i){return r+i})).join(`
|
|
90
|
-
`)}function yh(e,t,r){var i=$n(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=ph(s,t);return hh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function mh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var gh=function(e){qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),bh=function(e){qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(zs),wh=function(){function e(){this.preResolution=new gh,this.postResolution=new bh}return e}(),Hl=new Map,vh=function(){function e(t){this.parent=t,this._registry=new fh,this.interceptors=new wh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:qe.Transient}),this.ensureNotDisposed();var o;if(dh(r)?o=r:o={useClass:r},Pn(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+ir(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Pn(l.provider)?a=l.provider:a=null}if((i.lifecycle===qe.Singleton||i.lifecycle==qe.ContainerScoped||i.lifecycle==qe.ResolutionScoped)&&(Mn(o)||Ks(o)))throw new Error('Cannot use lifecycle "'+qe[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),Vr(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),Vr(t)){if(Vr(r))return this.register(t,{useToken:r},{lifecycle:qe.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:qe.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Vr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ll),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Vr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(uh(t)){var o=this.construct(t,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Dn(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Dn(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){o={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===qe.Singleton,o=t.options.lifecycle===qe.ContainerScoped,s=i||o,a;return Mn(t.provider)?a=t.provider.useValue:Pn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):Ml(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Ks(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===qe.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ll),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&Vr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Dn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=$n(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Mn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=Dn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=$n(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===qe.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return oh(this,void 0,void 0,function(){var t;return sh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var o=i.dispose();o&&t.push(o)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof Rl)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Hl.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,ir([void 0],a)))}();return mh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,c,l;try{return lh(o)?Ul(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,ir([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,ir([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Ul(o)?(l=i.resolve(o.transform,t)).transform.apply(l,ir([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(yh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),tt=new vh;function Gs(){return function(e){Hl.set(e,ch(e))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Ws;class Rn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:w.ObjectIdentifier})],Rn.prototype,"attrId",void 0),u([f({type:w.Any,repeated:"set"})],Rn.prototype,"attrValues",void 0);let Fl=Ws=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ws.prototype)}};Fl=Ws=u([T({type:N.Sequence,itemType:Rn})],Fl);var Js;let ql=Js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Js.prototype)}};ql=Js=u([T({type:N.Sequence,itemType:xr})],ql);class Kl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Kl.prototype,"certId",void 0),u([f({type:w.Any,context:0})],Kl.prototype,"certValue",void 0);class zl{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],zl.prototype,"crlId",void 0),u([f({type:w.Any,context:0})],zl.prototype,"crltValue",void 0);class Gl extends ne{}let Un=class{constructor(t={}){this.encryptionAlgorithm=new L,this.encryptedData=new Gl,Object.assign(this,t)}};u([f({type:L})],Un.prototype,"encryptionAlgorithm",void 0),u([f({type:Gl})],Un.prototype,"encryptedData",void 0);var Ys,Zs;(function(e){e[e.v1=0]="v1"})(Zs||(Zs={}));class Wl extends ne{}let Qs=Ys=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ys.prototype)}};Qs=Ys=u([T({type:N.Sequence,itemType:At})],Qs);class hi{constructor(t={}){this.version=Zs.v1,this.privateKeyAlgorithm=new L,this.privateKey=new Wl,Object.assign(this,t)}}u([f({type:w.Integer})],hi.prototype,"version",void 0),u([f({type:L})],hi.prototype,"privateKeyAlgorithm",void 0),u([f({type:Wl})],hi.prototype,"privateKey",void 0),u([f({type:Qs,implicit:!0,context:0,optional:!0})],hi.prototype,"attributes",void 0);let Jl=class extends hi{};Jl=u([T({type:N.Sequence})],Jl);let Yl=class extends Un{};Yl=u([T({type:N.Sequence})],Yl);class Zl{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Zl.prototype,"secretTypeId",void 0),u([f({type:w.Any,context:0})],Zl.prototype,"secretValue",void 0);class yi{constructor(t={}){this.mac=new Vn,this.macSalt=new ne,this.iterations=1,Object.assign(this,t)}}u([f({type:Vn})],yi.prototype,"mac",void 0),u([f({type:ne})],yi.prototype,"macSalt",void 0),u([f({type:w.Integer,defaultValue:1})],yi.prototype,"iterations",void 0);class Ln{constructor(t={}){this.version=3,this.authSafe=new xr,this.macData=new yi,Object.assign(this,t)}}u([f({type:w.Integer})],Ln.prototype,"version",void 0),u([f({type:xr})],Ln.prototype,"authSafe",void 0),u([f({type:yi,optional:!0})],Ln.prototype,"macData",void 0);var Xs;class Hn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Hn.prototype,"bagId",void 0),u([f({type:w.Any,context:0})],Hn.prototype,"bagValue",void 0),u([f({type:Rn,repeated:"set",optional:!0})],Hn.prototype,"bagAttributes",void 0);let Ql=Xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Ql=Xs=u([T({type:N.Sequence,itemType:Hn})],Ql);var ea,ta,ra;const Xl="1.2.840.113549.1.9",eu=`${Xl}.7`,ia=`${Xl}.14`;let Fn=class extends Ne{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:w.IA5String})],Fn.prototype,"ia5String",void 0),Fn=u([T({type:N.Choice})],Fn);let tu=class extends xr{};tu=u([T({type:N.Sequence})],tu);let ru=class extends Ln{};ru=u([T({type:N.Sequence})],ru);let iu=class extends Un{};iu=u([T({type:N.Sequence})],iu);let na=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.IA5String})],na.prototype,"value",void 0),na=u([T({type:N.Choice})],na);let nu=class extends Fn{};nu=u([T({type:N.Choice})],nu);let ou=class extends Ne{};ou=u([T({type:N.Choice})],ou);let oa=class{constructor(t=new Date){this.value=t}};u([f({type:w.GeneralizedTime})],oa.prototype,"value",void 0),oa=u([T({type:N.Choice})],oa);let su=class extends Ne{};su=u([T({type:N.Choice})],su);let sa=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:w.PrintableString})],sa.prototype,"value",void 0),sa=u([T({type:N.Choice})],sa);let qn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.PrintableString})],qn.prototype,"value",void 0),qn=u([T({type:N.Choice})],qn);let au=class extends qn{};au=u([T({type:N.Choice})],au);let cu=class extends Ne{};cu=u([T({type:N.Choice})],cu);let aa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.ObjectIdentifier})],aa.prototype,"value",void 0),aa=u([T({type:N.Choice})],aa);let lu=class extends De{};lu=u([T({type:N.Choice})],lu);let ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:w.Integer})],ca.prototype,"value",void 0),ca=u([T({type:N.Choice})],ca);let uu=class extends Nt{};uu=u([T({type:N.Sequence})],uu);let Kn=class extends Ne{};Kn=u([T({type:N.Choice})],Kn);let du=ea=class extends Qt{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};du=ea=u([T({type:N.Sequence})],du);let fu=ta=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};fu=ta=u([T({type:N.Set,itemType:vr})],fu);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.BmpString})],la.prototype,"value",void 0),la=u([T({type:N.Choice})],la);let ua=class extends L{};ua=u([T({type:N.Sequence})],ua);let pu=ra=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ra.prototype)}};pu=ra=u([T({type:N.Sequence,itemType:ua})],pu);var da;let zn=da=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,da.prototype)}};zn=da=u([T({type:N.Sequence,itemType:At})],zn);class jr{constructor(t={}){this.version=0,this.subject=new xe,this.subjectPKInfo=new Bt,this.attributes=new zn,Object.assign(this,t)}}u([f({type:w.Integer})],jr.prototype,"version",void 0),u([f({type:xe})],jr.prototype,"subject",void 0),u([f({type:Bt})],jr.prototype,"subjectPKInfo",void 0),u([f({type:zn,implicit:!0,context:0})],jr.prototype,"attributes",void 0);class mi{constructor(t={}){this.certificationRequestInfo=new jr,this.signatureAlgorithm=new L,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:jr})],mi.prototype,"certificationRequestInfo",void 0),u([f({type:L})],mi.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],mi.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function Eh(e,t,r){var i=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=Bh(s,t);return Ih("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Nh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Oh=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),_h=function(e){Js(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Zs),Th=function(){function e(){this.preResolution=new Oh,this.postResolution=new _h}return e}(),Yl=new Map,Vh=function(){function e(t){this.parent=t,this._registry=new Ah,this.interceptors=new Th,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:Ge.Transient}),this.ensureNotDisposed();var o;if(xh(r)?o=r:o={useClass:r},Hn(o))for(var s=[t],a=o;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+ar(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Hn(l.provider)?a=l.provider:a=null}if((i.lifecycle===Ge.Singleton||i.lifecycle==Ge.ContainerScoped||i.lifecycle==Ge.ResolutionScoped)&&(Fn(o)||Ys(o)))throw new Error('Cannot use lifecycle "'+Ge[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:o,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),$r(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),$r(t)){if($r(r))return this.register(t,{useToken:r},{lifecycle:Ge.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:Ge.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!$r(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:Ge.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Jl),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&$r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var o=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}if(Sh(t)){var o=this.construct(t,r);return this.executePostResolutionInterceptor(t,o,"Single"),o}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},e.prototype.executePreResolutionInterceptor=function(t,r){var i,o;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Un(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var o,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Un(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){o={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===Ge.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===Ge.Singleton,o=t.options.lifecycle===Ge.ContainerScoped,s=i||o,a;return Fn(t.provider)?a=t.provider.useValue:Hn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):zl(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Ys(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===Ge.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Jl),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&$r(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Un(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Ln(o.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Fn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.createChildContainer=function(){var t,r;this.ensureNotDisposed();var i=new e(this);try{for(var o=Un(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Ln(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===Ge.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===Ge.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i},e.prototype.beforeResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.preResolution.set(t,{callback:r,options:i})},e.prototype.afterResolution=function(t,r,i){i===void 0&&(i={frequency:"Always"}),this.interceptors.postResolution.set(t,{callback:r,options:i})},e.prototype.dispose=function(){return bh(this,void 0,void 0,function(){var t;return wh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var o=i.dispose();o&&t.push(o)}),[4,Promise.all(t)];case 1:return r.sent(),[2]}})})},e.prototype.getRegistration=function(t){return this.isRegistered(t)?this._registry.get(t):this.parent?this.parent.getRegistration(t):null},e.prototype.getAllRegistrations=function(t){return this.isRegistered(t)?this._registry.getAll(t):this.parent?this.parent.getAllRegistrations(t):null},e.prototype.construct=function(t,r){var i=this;if(t instanceof Gl)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=Yl.get(t);if(!s||s.length===0){if(t.length===0)return new t;throw new Error('TypeInfo not known for "'+t.name+'"')}var a=s.map(i.resolveParams(r,t));return new(t.bind.apply(t,ar([void 0],a)))}();return Nh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,c,l;try{return Ch(o)?Wl(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,ar([i.resolveAll(o.token)],o.transformArgs)):(c=i.resolve(o.transform)).transform.apply(c,ar([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):Wl(o)?(l=i.resolve(o.transform,t)).transform.apply(l,ar([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(Eh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),nt=new Vh;function Qs(){return function(e){Yl.set(e,kh(e))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Xs;class qn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:w.ObjectIdentifier})],qn.prototype,"attrId",void 0),u([f({type:w.Any,repeated:"set"})],qn.prototype,"attrValues",void 0);let Zl=Xs=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};Zl=Xs=u([T({type:N.Sequence,itemType:qn})],Zl);var ea;let Ql=ea=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ea.prototype)}};Ql=ea=u([T({type:N.Sequence,itemType:Nr})],Ql);class Xl{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Xl.prototype,"certId",void 0),u([f({type:w.Any,context:0})],Xl.prototype,"certValue",void 0);class eu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],eu.prototype,"crlId",void 0),u([f({type:w.Any,context:0})],eu.prototype,"crltValue",void 0);class tu extends ce{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new F,this.encryptedData=new tu,Object.assign(this,t)}};u([f({type:F})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:tu})],Kn.prototype,"encryptedData",void 0);var ta,ra;(function(e){e[e.v1=0]="v1"})(ra||(ra={}));class ru extends ce{}let ia=ta=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ta.prototype)}};ia=ta=u([T({type:N.Sequence,itemType:Nt})],ia);class bi{constructor(t={}){this.version=ra.v1,this.privateKeyAlgorithm=new F,this.privateKey=new ru,Object.assign(this,t)}}u([f({type:w.Integer})],bi.prototype,"version",void 0),u([f({type:F})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:ru})],bi.prototype,"privateKey",void 0),u([f({type:ia,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let iu=class extends bi{};iu=u([T({type:N.Sequence})],iu);let nu=class extends Kn{};nu=u([T({type:N.Sequence})],nu);class ou{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],ou.prototype,"secretTypeId",void 0),u([f({type:w.Any,context:0})],ou.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new Pn,this.macSalt=new ce,this.iterations=1,Object.assign(this,t)}}u([f({type:Pn})],wi.prototype,"mac",void 0),u([f({type:ce})],wi.prototype,"macSalt",void 0),u([f({type:w.Integer,defaultValue:1})],wi.prototype,"iterations",void 0);class zn{constructor(t={}){this.version=3,this.authSafe=new Nr,this.macData=new wi,Object.assign(this,t)}}u([f({type:w.Integer})],zn.prototype,"version",void 0),u([f({type:Nr})],zn.prototype,"authSafe",void 0),u([f({type:wi,optional:!0})],zn.prototype,"macData",void 0);var na;class Gn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:w.ObjectIdentifier})],Gn.prototype,"bagId",void 0),u([f({type:w.Any,context:0})],Gn.prototype,"bagValue",void 0),u([f({type:qn,repeated:"set",optional:!0})],Gn.prototype,"bagAttributes",void 0);let su=na=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};su=na=u([T({type:N.Sequence,itemType:Gn})],su);var oa,sa,aa;const au="1.2.840.113549.1.9",cu=`${au}.7`,ca=`${au}.14`;let Wn=class extends je{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:w.IA5String})],Wn.prototype,"ia5String",void 0),Wn=u([T({type:N.Choice})],Wn);let lu=class extends Nr{};lu=u([T({type:N.Sequence})],lu);let uu=class extends zn{};uu=u([T({type:N.Sequence})],uu);let du=class extends Kn{};du=u([T({type:N.Sequence})],du);let la=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.IA5String})],la.prototype,"value",void 0),la=u([T({type:N.Choice})],la);let fu=class extends Wn{};fu=u([T({type:N.Choice})],fu);let pu=class extends je{};pu=u([T({type:N.Choice})],pu);let ua=class{constructor(t=new Date){this.value=t}};u([f({type:w.GeneralizedTime})],ua.prototype,"value",void 0),ua=u([T({type:N.Choice})],ua);let hu=class extends je{};hu=u([T({type:N.Choice})],hu);let da=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:w.PrintableString})],da.prototype,"value",void 0),da=u([T({type:N.Choice})],da);let Jn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.PrintableString})],Jn.prototype,"value",void 0),Jn=u([T({type:N.Choice})],Jn);let yu=class extends Jn{};yu=u([T({type:N.Choice})],yu);let gu=class extends je{};gu=u([T({type:N.Choice})],gu);let fa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.ObjectIdentifier})],fa.prototype,"value",void 0),fa=u([T({type:N.Choice})],fa);let mu=class extends De{};mu=u([T({type:N.Choice})],mu);let pa=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:w.Integer})],pa.prototype,"value",void 0),pa=u([T({type:N.Choice})],pa);let bu=class extends mt{};bu=u([T({type:N.Sequence})],bu);let Yn=class extends je{};Yn=u([T({type:N.Choice})],Yn);let wu=oa=class extends rr{constructor(t){super(t),Object.setPrototypeOf(this,oa.prototype)}};wu=oa=u([T({type:N.Sequence})],wu);let vu=sa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};vu=sa=u([T({type:N.Set,itemType:Ar})],vu);let ha=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:w.BmpString})],ha.prototype,"value",void 0),ha=u([T({type:N.Choice})],ha);let ya=class extends F{};ya=u([T({type:N.Sequence})],ya);let ku=aa=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};ku=aa=u([T({type:N.Sequence,itemType:ya})],ku);var ga;let Zn=ga=class extends ue{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Zn=ga=u([T({type:N.Sequence,itemType:Nt})],Zn);class Mr{constructor(t={}){this.version=0,this.subject=new Ie,this.subjectPKInfo=new Ot,this.attributes=new Zn,Object.assign(this,t)}}u([f({type:w.Integer})],Mr.prototype,"version",void 0),u([f({type:Ie})],Mr.prototype,"subject",void 0),u([f({type:Ot})],Mr.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],Mr.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new Mr,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Mr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:F})],vi.prototype,"signatureAlgorithm",void 0),u([f({type:w.BitString})],vi.prototype,"signature",void 0);/*!
|
|
91
91
|
* MIT License
|
|
92
92
|
*
|
|
93
93
|
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
@@ -110,39 +110,39 @@ ${t.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
|
|
114
|
-
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:
|
|
116
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData
|
|
117
|
-
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Ot extends Pt{static isAsnEncoded(t){return j.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(R.isHex(t))return R.FromHex(t);if(R.isBase64(t))return R.FromBase64(t);if(R.isBase64Url(t))return R.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=R.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:R.isHex(r)?R.FromHex(r):R.isBase64(r)?R.FromBase64(r):R.isBase64Url(r)?R.FromBase64Url(r):j.toArrayBuffer(t)}}constructor(...t){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class sr extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,Bt):super(t),this.tag=Ze.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||Ye.get()):r=t[0]||Ye.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=tt.resolve(Wn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const o=H.parse(t.subjectPublicKey,Ls),s=j.toUint8Array(o.modulus);i.publicExponent=j.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Ye.get());const r=H.parse(this.rawData,Bt);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,Bt);switch(t.Algorithm=nr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case di:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new yt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const Zn="crypto.signatureFormatter";class jh{toAsnSignature(t,r){return j.toArrayBuffer(r)}toWebSignature(t,r){return j.toArrayBuffer(r)}}class Qn extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=H.serialize(r),this.serialNumber=R.ToHex(r.serialNumber),this.subjectName=new Mt(r.subject),this.subject=new Mt(r.subject).toString(),this.issuerName=new Mt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Wn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>mt.create(H.serialize(a)))),this.publicKey=new sr(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Ye.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof sr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(j.isBufferSource(s)){const d=new sr(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=tt.resolveAll(Zn).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Ye.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Ye.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,wr),i=r.tbsCertificate,o=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":nr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:nr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}Qn.NAME="Certificate";class ki extends yt{static async create(t,r=!1,i=Ye.get()){if(t instanceof Qn||or.isCryptoKey(t)){const o=t instanceof Qn?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new sr(s).getKeyIdentifier(i);return new ki(R.ToHex(c),r)}else return new ki(t,r)}constructor(...t){if(j.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Zt({keyIdentifier:new $o(R.FromHex(t[0]))});super(Do,t[1],H.serialize(r))}else{const r=t[0],i=r.name instanceof bi?H.parse(r.name.rawData,Re):r.name,o=new Zt({authorityCertIssuer:i,authorityCertSerialNumber:R.FromHex(r.serialNumber)});super(Do,t[1],H.serialize(o))}}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,Zt);r.keyIdentifier&&(this.keyId=R.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:R.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,Zt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new bi(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}ki.NAME="Authority Key Identifier";class Xu extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Zi);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new Zi({cA:t[0],pathLenConstraint:t[1]});super(rl,t[2],H.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}Xu.NAME="Basic Constraints";var ed;(function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"})(ed||(ed={}));class td extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,rn);this.usages=r.map(i=>i)}else{const r=new rn(t[0]);super(cl,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>$t.toString(r)).join(", "),t}}td.NAME="Extended Key Usages";var wa;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(wa||(wa={}));class va extends yt{constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,Zo);this.usages=r.toNumber()}else{const r=new Zo(t[0]);super(ul,t[1],H.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,Zo);return t[""]=r.toJSON().join(", "),t}}va.NAME="Key Usages";class Xn extends yt{static async create(t,r=!1,i=Ye.get()){let o;t instanceof sr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:j.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new sr(o).getKeyIdentifier(i);return new Xn(R.ToHex(a),r)}constructor(...t){if(j.isBufferSource(t[0])){super(t[0]);const r=H.parse(this.value,jt);this.keyId=R.ToHex(r)}else{const r=typeof t[0]=="string"?R.FromHex(t[0]):t[0],i=new jt(r);super(ml,t[1],H.serialize(i)),this.keyId=R.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=H.parse(this.value,jt);return t[""]=r,t}}Xn.NAME="Subject Key Identifier";class ka extends yt{constructor(...t){j.isBufferSource(t[0])?super(t[0]):super(hl,t[1],new bi(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=H.parse(t.extnValue,rs);this.names=new bi(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}ka.NAME="Subject Alternative Name";class rd extends yt{constructor(...t){var r;if(j.isBufferSource(t[0])){super(t[0]);const i=H.parse(this.value,en);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new en(i.map(a=>new Xi({policyIdentifier:a})));super(nl,o,H.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},$t.toString(r))),t}}rd.NAME="Certificate Policies",mt.register(nl,rd);class $r extends Pt{constructor(...t){let r;if(j.isBufferSource(t[0]))r=j.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>j.toArrayBuffer(s)):[];r=H.serialize(new At({type:i,values:o}))}super(r,At)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===$r.NAME&&(t[ue.NAME]=$t.toString(this.type)),t}}$r.NAME="Attribute";class id extends $r{constructor(...t){var r;if(j.isBufferSource(t[0]))super(t[0]);else{const i=new Kn({printableString:t[0]});super(eu,[H.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=H.parse(this.values[0],Kn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}id.NAME="Challenge Password";class Ca extends $r{constructor(...t){var r;if(j.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new Qt;for(const s of i)o.push(H.parse(s.rawData,at));super(ia,[H.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=H.parse(this.values[0],Qt);this.items=r.map(i=>mt.create(H.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[ue.NAME]]=i;return t}}Ca.NAME="Extensions";class eo{static register(t,r){this.items.set(t,r)}static create(t){const r=new $r(t),i=this.items.get(r.type);return i?new i(t):r}}eo.items=new Map;let Sa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new L({algorithm:Nn,parameters:null});case"sha-256":return new L({algorithm:Ps,parameters:null});case"sha-384":return new L({algorithm:On,parameters:null});case"sha-512":return new L({algorithm:_n,parameters:null})}}else return new L({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case Nn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ps:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case On:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case _n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Sa=u([Gs()],Sa),tt.registerSingleton(Gn,Sa);class rt{addPadding(t,r){const i=j.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=j.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new En,a=j.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),H.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=H.parse(r,En),o=t.namedCurve,s=rt.namedCurveSize.get(o)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return Yf(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const nd="1.3.101.110",od="1.3.101.111",sd="1.3.101.112",ad="1.3.101.113";let xa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=sd;break;case"ed448":r=ad;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=nd;break;case"x448":r=od;break}}return r?new L({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case sd:return{name:"EdDSA",namedCurve:"Ed25519"};case ad:return{name:"EdDSA",namedCurve:"Ed448"};case nd:return{name:"ECDH-ES",namedCurve:"X25519"};case od:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};xa=u([Gs()],xa),tt.registerSingleton(Gn,xa);class Dh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,mi):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=H.serialize(t.certificationRequestInfo),this.publicKey=new sr(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Wn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>eo.create(H.serialize(o)));const i=this.getAttribute(ia);this.extensions=[],i instanceof Ca&&(this.extensions=i.items),this.subjectName=new Mt(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Ye.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=tt.resolveAll(Zn).reverse();let s=null;for(const c of o)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=H.parse(this.rawData,mi),i=r.certificationRequestInfo,o=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{Algorithm:nr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Dh.NAME="PKCS#10 Certificate Request";var cd;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(cd||(cd={})),mt.register(rl,Xu),mt.register(cl,td),mt.register(ul,va),mt.register(ml,Xn),mt.register(Do,ki),mt.register(hl,ka),eo.register(eu,id),eo.register(ia,Ca),tt.registerSingleton(Zn,jh),tt.registerSingleton(Zn,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.namedCurveSize.set("P-521",66);function ld(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new Qn(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof ka){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof va){const s=Object.values(wa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function $h(){const e=ld(),t=n.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(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 Ph={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 Mh(){const e=ur.createI18n("en-us",Ph);return{i18n:e,i18nT:ur.i18nTComponent(e)}}const gt={useCertificate:$h,useI18n:Mh,useX509:ld},Ci={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"}}},Rh={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Uh="Copy to clipboard",Lh={message:Rh,iconTitle:Uh},Hh="kong-ui-copy-uuid-notify",ud="24px",Fh=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},qh=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),Kh=["aria-hidden"],zh={key:0,"data-testid":"kui-icon-svg-title"},Gh=qh(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Wh=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ud,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return ud}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",zh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Gh],8,Kh))]),_:1},8,["aria-hidden","style"]))}}),Jh=Fh(Wh,[["__scopeId","data-v-ac7fcfb4"]]),Yh="16px",Zh={class:"kong-ui-copy-uuid"},Qh=["onClick"],dd=15,Xh=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},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:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=ur.createI18n("en-us",Lh),i=e,o=t,s=i.notify||n.inject(Hh,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var b;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(b=i.uuid)==null?void 0:b.substring(0,5)}`:i.uuid}),p=b=>{l.value=b,setTimeout(()=>{l.value=i.tooltip},1800)},A=b=>{var h,m;if(!b(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>dd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,dd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(b,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Zh,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>A(k),["stop"])},[n.createVNode(n.unref(Jh),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Yh),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Qh)]),_:1})]),_:1},16))])}}}),ey=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},ty=ey(Xh,[["__scopeId","data-v-0c07874b"]]);var Aa=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(Aa||{}),ar=(e=>(e.Edit="edit",e.Create="create",e))(ar||{}),Rt=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Rt||{}),se=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(se||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function Ba(e={}){return{axiosInstance:qf.create({withCredentials:!0,timeout:3e4,...e})}}function ry(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ia="khcp-user-table-preferences",iy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function ny(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Ia));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(Ia,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||iy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ia)}}}const oy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},sy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ay={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},cy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ly={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"},endpoints:{get:"Get"},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}",structuredFormat:"Structured"}},uy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},dy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},fy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},py={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"}},hy={global:oy,deleteModal:sy,baseForm:ay,baseTable:cy,baseConfigCard:ly,filter:uy,debouncedFilter:dy,errors:fy,toggleModal:py};function Ea(){const e=ur.createI18n("en-us",hy);return{i18n:e,i18nT:ur.i18nTComponent(e)}}function fd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function yy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Ba({headers:e.requestHeaders}),{i18n:{t:s}}=Ea(),{debounce:a}=ry(),c=a(async C=>{await v(C)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),A=n.ref([]),b=n.ref(void 0),h=n.unref(t);let m=`${e.apiBaseUrl}${h}`;e.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:k}=fd(),g=async()=>{try{l.value=!0;const{data:C}=await o.get(`${m}?size=${r}`);C!=null&&C.next||(b.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[]),A.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[],p.value=A.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},S=n.ref(""),v=async C=>{var O,F,Y;if(S.value!==C)if(S.value=C||"",b.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let I=m+"";C&&(I+=`/${C}`);const{data:E}=await o.get(`${I}?size=${r}`);i.fetchedItemsKey in E?p.value=E[i.fetchedItemsKey]:E!=null&&E.id?p.value=[E]:p.value=[]}else if(C){const I=[];k(C)&&i.searchKeys.includes("id")?I.push((async()=>{const{data:$}=await o.get(`${m}/${C}`);return[$[i.fetchedItemsKey]??$]})()):I.push(...i.searchKeys.filter($=>$!=="id").map(async $=>{const{data:K}=await o.get(`${m}?${$}=${C}`);return K[i.fetchedItemsKey]}));const E=await Promise.all(I),q=new Set;p.value=[],(O=E==null?void 0:E.forEach)==null||O.call(E,$=>{var K;(K=$==null?void 0:$.forEach)==null||K.call($,U=>{q.has(U.id)||(q.add(U.id),p.value.push(U))})})}else p.value=A.value}catch(I){((F=I==null?void 0:I.response)==null?void 0:F.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",C?(p.value=(Y=b.value)==null?void 0:Y.filter(I=>{var E;let q=!1;for(const $ of i.searchKeys){const K=typeof I[$]=="string"?(E=I[$])==null?void 0:E.toLowerCase():I[$];K!=null&&K.includes(C.toLowerCase())&&(q=!0)}return q}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=b.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:b,loadItems:g,debouncedQueryChange:c}}function my(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function gy(){const{i18n:{t:e}}=Ea();return{getMessageFromError:t=>{var r,i,o;if(!t)return e("errors.unexpected");if((r=t==null?void 0:t.response)!=null&&r.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(s=>{let a=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(a=s.messages.join(", ")),s.field?`${s.field} - ${a}`:a}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function by(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function pd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:A}=a;try{let b=new URL(s.value.href);return o.value&&A?(b.search="",b=r.value.app==="konnect"?new URL(`${b.href}?filter[name][contains]=${A}`):new URL(`${b.href}/${A}/`)):(o.value||new URLSearchParams(A).forEach((h,m)=>{b.searchParams.append(m,h)}),y&&b.searchParams.append("sort_by",y),p==="desc"&&b.searchParams.append("sort_desc","1"),b.searchParams.append("size",String(l))),d&&c!==1&&b.searchParams.append("offset",String(d)),b.href}catch(b){return console.error("RouteList(fetcher)",b),i.value}}}function wy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=Ba({headers:e.requestHeaders}),s=pd(e,i),a=n.ref({status:Rt.Idle});return{fetcher:async c=>{try{a.value={status:Rt.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const A={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Rt.Idle,response:A},A}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Rt.NoResults,response:d,error:l},d):(a.value={status:Rt.Error,response:d,error:l},d)}},fetcherState:a}}function vy(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const hd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,yd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(hd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},md=e=>e==="*"||e==="x"||e==="X",gd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},ky=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Cy=(e,t)=>{if(md(e)||md(t))return 0;const[r,i]=ky(gd(e),gd(t));return r>i?1:r<i?-1:0},bd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Cy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Sy=(e,t)=>{const r=yd(e),i=yd(t),o=r.pop(),s=i.pop(),a=bd(r,i);return a!==0?a:o&&s?bd(o.split("."),s.split(".")):o||s?o?-1:1:0},wd=(e,t,r)=>{xy(r);const i=Sy(e,t);return vd[r].includes(i)},vd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},kd=Object.keys(vd),xy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(kd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${kd.join("|")}`)},Ay=e=>typeof e=="string"&&/^[v\d]/.test(e)&&hd.test(e);function By(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Ay(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&wd(o,a,"<")||c&&wd(o,c,">"))}function Iy(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Ie={useAxios:Ba,useDebouncedFilter:yy,useDeleteUrlBuilder:my,useErrors:gy,useExternalLinkCreator:by,useFetcher:wy,useFetchUrlBuilder:pd,useHelpers:fd,useStringHelpers:vy,useI18n:Ea,useGatewayFeatureSupported:By,useTruncationDetector:Iy},Ey={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ny="Copy to clipboard",Oy={message:Ey,iconTitle:Ny},_y="kong-ui-copy-uuid-notify",Cd="24px",Ty=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),jy=["aria-hidden"],Dy={key:0,"data-testid":"kui-icon-svg-title"},$y=Vy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Py=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Cd,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Cd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Dy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),$y],8,jy))]),_:1},8,["aria-hidden","style"]))}}),My=Ty(Py,[["__scopeId","data-v-ac7fcfb4"]]),Ry="16px",Uy={class:"kong-ui-copy-uuid"},Ly=["onClick"],Sd=15,Hy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},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:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=ur.createI18n("en-us",Oy),i=e,o=t,s=i.notify||n.inject(_y,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var b;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(b=i.uuid)==null?void 0:b.substring(0,5)}`:i.uuid}),p=b=>{l.value=b,setTimeout(()=>{l.value=i.tooltip},1800)},A=b=>{var h,m;if(!b(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>Sd,g=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((m=i.uuid)==null?void 0:m.substring(0,Sd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${g}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(b,h)=>{const m=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Uy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(g=>A(k),["stop"])},[n.createVNode(n.unref(My),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Ry),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,Ly)]),_:1})]),_:1},16))])}}}),Fy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},xd=Fy(Hy,[["__scopeId","data-v-0c07874b"]]),qy={key:0,class:"config-card-fieldset-title"},Ky=n.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Ie.useI18n(),{convertKeyToTitle:i}=Ie.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",qy,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(y,p)=>(n.openBlock(),n.createBlock(Si,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),lt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Ad=lt(Ky,[["__scopeId","data-v-68ca83ec"]]),zy=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Ie.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Gy=lt(zy,[["__scopeId","data-v-c96811e5"]]),Wy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Ie.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Jy="#0044f4",Yy="#e0e4ea",Zy="#3a3f51",Qy="1px",Xy="20px",em={class:"config-card-details-row"},tm=["data-testid"],rm=["data-testid"],im=["data-testid"],nm=["data-testid"],om={key:1},sm=["data-testid"],am=["data-testid"],cm=["data-testid"],lm=["data-testid"],um={name:"ConfigCardItem",components:{CopyUuid:xd,JsonCardItem:Ad,StatusBadge:Wy,InternalLinkItem:Gy}},dm=n.defineComponent({...um,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){n.useCssVars(h=>({"0da74440":y.value?"none":`solid ${n.unref(Qy)} ${n.unref(Yy)}`,"02a039da":d.value&&c.value?"block":"flex","690f3ced":d.value&&c.value?"100%":r.slim?"50%":"25%","691182c8":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Ie.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===se.Json||r.item.type===se.JsonArray),y=n.computed(()=>r.item.type===se.JsonArray),p=n.computed(()=>{switch(r.item.type){case se.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case se.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case se.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case se.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case se.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case se.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case se.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case se.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case se.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case se.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case se.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case se.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),A=n.ref(),{isTruncated:b}=Ie.useTruncationDetector(A);return(h,m)=>{const k=n.resolveComponent("KLabel"),g=n.resolveComponent("KBadge"),S=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",em,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,rm)]),key:"0"}:void 0]),1024)],!0)],8,tm),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",om,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:v,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,sm)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(n.unref(xd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,uuid:v}),null,16,["data-testid","uuid"]))),128))],8,am)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(g,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(n.unref(Kf.BadgeMethodAppearances)).includes(v.toLowerCase())?v.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,cm)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(Ad,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:v},null,8,["index","item"]))),128))],8,lm)):(n.openBlock(),n.createBlock(S,{key:4,label:n.unref(b)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:A,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,nm))],!0)],8,im)])}}}),Si=lt(dm,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Bd(e){return typeof e>"u"||e===null}function fm(e){return typeof e=="object"&&e!==null}function pm(e){return Array.isArray(e)?e:Bd(e)?[]:[e]}function hm(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function ym(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function mm(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var gm=Bd,bm=fm,wm=pm,vm=ym,km=mm,Cm=hm,Be={isNothing:gm,isObject:bm,toArray:wm,repeat:vm,isNegativeZero:km,extend:Cm};function Id(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
113
|
+
*/const Qn="crypto.algorithm";class jh{getAlgorithms(){return nt.resolveAll(Qn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new F({algorithm:t.name});if("parameters"in t){const i=t;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const i of this.getAlgorithms()){const o=i.toWebAlgorithm(t);if(o)return o}return{name:t.algorithm,parameters:t.parameters}}}const Xn="crypto.algorithmProvider";nt.registerSingleton(Xn,jh);var eo;const We="1.3.36.3.3.2.8.1.1",Cu=`${We}.1`,Su=`${We}.2`,xu=`${We}.3`,Au=`${We}.4`,Bu=`${We}.5`,Iu=`${We}.6`,Eu=`${We}.7`,Nu=`${We}.8`,Ou=`${We}.9`,_u=`${We}.10`,Tu=`${We}.11`,Vu=`${We}.12`,ju=`${We}.13`,Du=`${We}.14`,$u="brainpoolP160r1",Mu="brainpoolP160t1",Pu="brainpoolP192r1",Ru="brainpoolP192t1",Uu="brainpoolP224r1",Lu="brainpoolP224t1",Hu="brainpoolP256r1",Fu="brainpoolP256t1",qu="brainpoolP320r1",Ku="brainpoolP320t1",zu="brainpoolP384r1",Gu="brainpoolP384t1",Wu="brainpoolP512r1",Ju="brainpoolP512t1",ve="ECDSA";let ki=eo=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case ve.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return nh;case"sha-256":return oh;case"sha-384":return sh;case"sha-512":return ah}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=jl;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Dl;break;case"P-521":r=$l;break;case $u:r=Cu;break;case Mu:r=Su;break;case Pu:r=xu;break;case Ru:r=Au;break;case Uu:r=Bu;break;case Lu:r=Iu;break;case Hu:r=Eu;break;case Fu:r=Nu;break;case qu:r=Ou;break;case Ku:r=_u;break;case zu:r=Tu;break;case Gu:r=Vu;break;case Wu:r=ju;break;case Ju:r=Du;break}if(r)return new F({algorithm:yi,parameters:K.serialize(new jr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Ps:return{name:ve,hash:{name:"SHA-1"}};case Rs:return{name:ve,hash:{name:"SHA-256"}};case Us:return{name:ve,hash:{name:"SHA-384"}};case Ls:return{name:ve,hash:{name:"SHA-512"}};case yi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(K.parse(t.parameters,jr).namedCurve){case jl:return{name:ve,namedCurve:"P-256"};case eo.SECP256K1:return{name:ve,namedCurve:"K-256"};case Dl:return{name:ve,namedCurve:"P-384"};case $l:return{name:ve,namedCurve:"P-521"};case Cu:return{name:ve,namedCurve:$u};case Su:return{name:ve,namedCurve:Mu};case xu:return{name:ve,namedCurve:Pu};case Au:return{name:ve,namedCurve:Ru};case Bu:return{name:ve,namedCurve:Uu};case Iu:return{name:ve,namedCurve:Lu};case Eu:return{name:ve,namedCurve:Hu};case Nu:return{name:ve,namedCurve:Fu};case Ou:return{name:ve,namedCurve:qu};case _u:return{name:ve,namedCurve:Ku};case Tu:return{name:ve,namedCurve:zu};case Vu:return{name:ve,namedCurve:Gu};case ju:return{name:ve,namedCurve:Wu};case Du:return{name:ve,namedCurve:Ju}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([Qs()],ki),nt.registerSingleton(Qn,ki);const Yu=Symbol("name"),Zu=Symbol("value");class de{constructor(t,r={},i=""){this[Yu]=t,this[Zu]=i;for(const o in r)this[o]=r[o]}}de.NAME=Yu,de.VALUE=Zu;class Dh{static toTextObject(t){const r=new de("Algorithm Identifier",{},Ut.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case yi:{const i=new ki().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Ut{static toString(t){const r=this.items[t];return r||t}}Ut.items={[Rl]:"sha1",[Ul]:"sha224",[Ll]:"sha256",[Hl]:"sha384",[Fl]:"sha512",[Dr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[ph]:"sha224WithRSAEncryption",[Hs]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[$n]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[Ps]:"ecdsaWithSHA1",[Vl]:"ecdsaWithSHA224",[Rs]:"ecdsaWithSHA256",[Us]:"ecdsaWithSHA384",[Ls]:"ecdsaWithSHA512",[Zp]:"TLS WWW server authentication",[Qp]:"TLS WWW client authentication",[Xp]:"Code Signing",[eh]:"E-mail Protection",[th]:"Time Stamping",[rh]:"OCSP Signing",[ih]:"Signed Data"};class cr{static serialize(t){return this.serializeObj(t).join(`
|
|
114
|
+
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[de.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[de.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[de.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof de)l[de.NAME]=c,i.push(...this.serializeObj(l,r));else if($.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[de.NAME]=c,i.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),o=$.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}cr.oidSerializer=Ut,cr.algorithmSerializer=Dh;class Lt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=K.serialize(r),this.onInit(r)}else{const r=K.parse(t[0],t[1]);this.rawData=$.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?Xa(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return K.toString(this.rawData);case"text":return cr.serialize(this.toTextObject());case"hex":return U.ToHex(this.rawData);case"base64":return U.ToBase64(this.rawData);case"base64url":return U.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new de(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;$.isBufferSource(t[0])?r=$.toArrayBuffer(t[0]):r=K.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ce($.toArrayBuffer(t[2]))})),super(r,lt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[de.NAME]===wt.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}var Qu;class lr{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[Qu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(lr.DEFAULT,crypto)}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,r){return this.items.forEach(t,r)}has(t){return this.items.has(t)}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(t=lr.DEFAULT){const r=this.items.get(t.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${t}'`);return r}set(t,r){if(typeof t=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),r)}else this.items.set(lr.DEFAULT,t);return this}}Qu=Symbol.toStringTag,lr.DEFAULT="default";const Xe=new lr,$h=/^[0-2](?:\.[1-9][0-9]*)+$/;function Mh(e){return new RegExp($h).test(e)}class Xu{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Mh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Je=new Xu;Je.register("CN","2.5.4.3"),Je.register("L","2.5.4.7"),Je.register("ST","2.5.4.8"),Je.register("O","2.5.4.10"),Je.register("OU","2.5.4.11"),Je.register("C","2.5.4.6"),Je.register("DC","0.9.2342.19200300.100.1.25"),Je.register("E","1.2.840.113549.1.9.1"),Je.register("G","2.5.4.42"),Je.register("I","2.5.4.43"),Je.register("SN","2.5.4.4"),Je.register("T","2.5.4.12");function Ph(e,t){return`\\${U.ToHex(U.FromUtf8String(t)).toUpperCase()}`}function Rh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Ph)}class Ht{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}constructor(t,r={}){this.extraNames=new Xu,this.asn=new Ie;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const o=r[i];this.extraNames.register(i,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof Ie?this.asn=t:$.isBufferSource(t)?this.asn=K.parse(t,Ie):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Je.findId(t),i=[];for(const o of this.asn)for(const s of o)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||Je.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,o=r.value.anyValue?`#${U.ToHex(r.value.anyValue)}`:Rh(r.value.toString());return`${i}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const o={};for(const s of i){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${U.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new Ie,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,c]=o;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),o[3]=l);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new Xr({type:a});if(c.charAt(0)==="#")y.value.anyValue=U.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
|
|
115
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Ht.isASCII(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new br([y])),s=d}return r}fromJSON(t){const r=new Ie;for(const i of t){const o=new br;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=U.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return K.serialize(this.asn)}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const ed="Cannot initialize GeneralName from ASN.1 data.",td=`${ed} Unsupported string format in use.`,Uh=`${ed} Value doesn't match to GUID regular expression.`,rd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,id="1.3.6.1.4.1.311.25.1",nd="1.3.6.1.4.1.311.20.2.3",ma="dns",ba="dn",wa="email",va="ip",ka="url",Ca="guid",Sa="upn",to="id";class od extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case ba:{const i=new Ht(t[1]).toArrayBuffer(),o=K.parse(i,Ie);r=new ie({directoryName:o});break}case ma:r=new ie({dNSName:t[1]});break;case wa:r=new ie({rfc822Name:t[1]});break;case Ca:{const i=new RegExp(rd,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=i.slice(1).map((s,a)=>a<3?U.ToHex(new Uint8Array(U.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:id,value:K.serialize(new ce(U.FromHex(o)))})});break}case va:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Sa:{r=new ie({otherName:new ei({typeId:nd,value:K.serialize(tl.toASN(t[1]))})});break}case ka:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else $.isBufferSource(t[0])?r=K.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=ma,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=wa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=va,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ka,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=ba,this.value=new Ht(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===id){this.type=Ca;const r=K.parse(t.otherName.value,ce),i=new RegExp(rd,"i").exec(U.ToHex(r));if(!i)throw new Error(Uh);this.value=i.slice(1).map((o,s)=>s<3?U.ToHex(new Uint8Array(U.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===nd)this.type=Sa,this.value=K.parse(t.otherName.value,je).toString();else throw new Error(td);else throw new Error(td)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case ba:case ma:case Ca:case va:case to:case Sa:case ka:t=this.type.toUpperCase();break;case wa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=Ut.toString(r)),new de(t,void 0,r)}}class Ci extends Lt{constructor(t){let r;if(t instanceof He)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof ie)i.push(o);else{const s=K.parse(new od(o.type,o.value).rawData,ie);i.push(s)}r=new He(i)}else if($.isBufferSource(t))r=K.parse(t,He);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let o=null;try{o=new od(i)}catch{continue}r.push(o)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let o=t[i[de.NAME]];Array.isArray(o)||(o=[],t[i[de.NAME]]=o),o.push(i)}return t}}Ci.NAME="GeneralNames";const Si="-{5}",xi="\\n",Lh=`[^${xi}]+`,Hh=`${Si}BEGIN (${Lh}(?=${Si}))${Si}`,Fh=`${Si}END \\1${Si}`,Pr="\\n",qh=`[^:${xi}]+`,Kh=`(?:[^${xi}]+${Pr}(?: +[^${xi}]+${Pr})*)`,zh=`(?:[a-zA-Z0-9=+/]+${Pr})+`,sd=`${Hh}${Pr}(?:((?:${qh}: ${Kh})+))?${Pr}?(${zh})${Fh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(sd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(sd,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:o[1],headers:[],rawData:U.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp(Pr,"g"));let d=null;for(const y of l){const[p,B]=y.split(/:(.*)/);if(B===void 0){if(!d)throw new Error("Cannot parse PEM string. Incorrect header value");d.value+=p.trim()}else d&&a.headers.push(d),d={key:p,value:B.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(o=>{if(!$.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:$.toArrayBuffer(o)}))}):t.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");i.push(this.encodeStruct(o))}),i.join(`
|
|
116
|
+
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:$.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)o.push(`${d.key}: ${d.value}`);o.push("")}const s=U.ToBase64(t.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return o.push(...l),o.push(`-----END ${i}-----`),o.join(`
|
|
117
|
+
`)}}et.CertificateTag="CERTIFICATE",et.CrlTag="CRL",et.CertificateRequestTag="CERTIFICATE REQUEST",et.PublicKeyTag="PUBLIC KEY",et.PrivateKeyTag="PRIVATE KEY";class Vt extends Lt{static isAsnEncoded(t){return $.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(et.isPem(t))return et.decode(t)[0];if(U.isHex(t))return U.FromHex(t);if(U.isBase64(t))return U.FromBase64(t);if(U.isBase64Url(t))return U.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=U.ToBinary(t);return et.isPem(r)?et.decode(r)[0]:U.isHex(r)?U.FromHex(r):U.isBase64(r)?U.FromBase64(r):U.isBase64Url(r)?U.FromBase64Url(r):$.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return et.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=et.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||Xe.get()):r=t[0]||Xe.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=nt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Dr:{const o=K.parse(t.subjectPublicKey,zs),s=$.toUint8Array(o.modulus);i.publicExponent=$.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Xe.get());const r=K.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=K.parse(this.rawData,Ot);switch(t.Algorithm=cr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Dr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class vt{static register(t,r){this.items.set(t,r)}static create(t){const r=new wt(t),i=this.items.get(r.type);return i?new i(t):r}}vt.items=new Map;const ro="crypto.signatureFormatter";class Gh{toAsnSignature(t,r){return $.toArrayBuffer(r)}toWebSignature(t,r){return $.toArrayBuffer(r)}}class io extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Cr):super(t),this.tag=et.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=K.serialize(r),this.serialNumber=U.ToHex(r.serialNumber),this.subjectName=new Ht(r.subject),this.subject=new Ht(r.subject).toString(),this.issuerName=new Ht(r.issuer),this.issuer=this.issuerName.toString();const i=nt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>vt.create(K.serialize(a)))),this.publicKey=new ur(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Xe.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof ur)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if($.isBufferSource(s)){const d=new ur(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=nt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Xe.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Xe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=K.parse(this.rawData,Cr),i=r.tbsCertificate,o=new de("",{Version:`${kr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":cr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new de("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new de("");for(const a of this.extensions){const c=a.toTextObject();s[c[de.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new de("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends wt{static async create(t,r=!1,i=Xe.get()){if(t instanceof io||lr.isCryptoKey(t)){const o=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new ur(s).getKeyIdentifier(i);return new Ai(U.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if($.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Lo(U.FromHex(t[0]))});super(Uo,t[1],K.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?K.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:i,authorityCertSerialNumber:U.FromHex(r.serialNumber)});super(Uo,t[1],K.serialize(o))}}onInit(t){super.onInit(t);const r=K.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=U.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:U.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=K.parse(this.value,tr);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class ad extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(cl,t[2],K.serialize(r)),this.ca=t[0],this.pathLength=t[1]}}toTextObject(){const t=this.toTextObjectWithoutValue();return this.ca&&(t.CA=this.ca),this.pathLength!==void 0&&(t["Path Length"]=this.pathLength),t}}ad.NAME="Basic Constraints";var cd;(function(e){e.serverAuth="1.3.6.1.5.5.7.3.1",e.clientAuth="1.3.6.1.5.5.7.3.2",e.codeSigning="1.3.6.1.5.5.7.3.3",e.emailProtection="1.3.6.1.5.5.7.3.4",e.timeStamping="1.3.6.1.5.5.7.3.8",e.ocspSigning="1.3.6.1.5.5.7.3.9"})(cd||(cd={}));class ld extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(hl,t[1],K.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}ld.NAME="Extended Key Usages";var xa;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(xa||(xa={}));class Aa extends wt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,rs);this.usages=r.toNumber()}else{const r=new rs(t[0]);super(gl,t[1],K.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=K.parse(this.value,rs);return t[""]=r.toJSON().join(", "),t}}Aa.NAME="Key Usages";class no extends wt{static async create(t,r=!1,i=Xe.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:$.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(i);return new no(U.ToHex(a),r)}constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=K.parse(this.value,Pt);this.keyId=U.ToHex(r)}else{const r=typeof t[0]=="string"?U.FromHex(t[0]):t[0],i=new Pt(r);super(Cl,t[1],K.serialize(i)),this.keyId=U.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=K.parse(this.value,Pt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){$.isBufferSource(t[0])?super(t[0]):super(vl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=K.parse(t.extnValue,as);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Ba.NAME="Subject Alternative Name";class ud extends wt{constructor(...t){var r;if($.isBufferSource(t[0])){super(t[0]);const i=K.parse(this.value,sn);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(ul,o,K.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new de("",{},Ut.toString(r))),t}}ud.NAME="Certificate Policies",vt.register(ul,ud);class Rr extends Lt{constructor(...t){let r;if($.isBufferSource(t[0]))r=$.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>$.toArrayBuffer(s)):[];r=K.serialize(new Nt({type:i,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new de("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[de.NAME]===Rr.NAME&&(t[de.NAME]=Ut.toString(this.type)),t}}Rr.NAME="Attribute";class dd extends Rr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(cu,[K.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=K.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[de.VALUE]=this.password,t}}dd.NAME="Challenge Password";class Ia extends Rr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new rr;for(const s of i)o.push(K.parse(s.rawData,lt));super(ca,[K.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=K.parse(this.values[0],rr);this.items=r.map(i=>vt.create(K.serialize(i)))}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.items.map(i=>i.toTextObject());for(const i of r)t[i[de.NAME]]=i;return t}}Ia.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),i=this.items.get(r.type);return i?new i(t):r}}oo.items=new Map;let Ea=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new F({algorithm:jn,parameters:null});case"sha-256":return new F({algorithm:Hs,parameters:null});case"sha-384":return new F({algorithm:Dn,parameters:null});case"sha-512":return new F({algorithm:$n,parameters:null})}}else return new F({algorithm:Dr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Dr:return{name:"RSASSA-PKCS1-v1_5"};case jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Hs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case $n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ea=u([Qs()],Ea),nt.registerSingleton(Qn,Ea);class ot{addPadding(t,r){const i=$.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=$.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=ot.namedCurveSize.get(i)||ot.defaultNamedCurveSize,s=new Vn,a=$.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),K.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=K.parse(r,Vn),o=t.namedCurve,s=ot.namedCurveSize.get(o)||ot.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return lp(a,c)}return null}}ot.namedCurveSize=new Map,ot.defaultNamedCurveSize=32;const fd="1.3.101.110",pd="1.3.101.111",hd="1.3.101.112",yd="1.3.101.113";let Na=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=hd;break;case"ed448":r=yd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=fd;break;case"x448":r=pd;break}}return r?new F({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case hd:return{name:"EdDSA",namedCurve:"Ed25519"};case yd:return{name:"EdDSA",namedCurve:"Ed448"};case fd:return{name:"ECDH-ES",namedCurve:"X25519"};case pd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Na=u([Qs()],Na),nt.registerSingleton(Qn,Na);class Wh extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vi):super(t),this.tag=et.CertificateRequestTag}onInit(t){this.tbs=K.serialize(t.certificationRequestInfo),this.publicKey=new ur(t.certificationRequestInfo.subjectPKInfo);const r=nt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>oo.create(K.serialize(o)));const i=this.getAttribute(ca);this.extensions=[],i instanceof Ia&&(this.extensions=i.items),this.subjectName=new Ht(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Xe.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=nt.resolveAll(ro).reverse();let s=null;for(const c of o)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=K.parse(this.rawData,vi),i=r.certificationRequestInfo,o=new de("",{Version:`${kr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new de("");for(const a of this.attributes){const c=a.toTextObject();s[c[de.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new de("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Wh.NAME="PKCS#10 Certificate Request";var gd;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(gd||(gd={})),vt.register(cl,ad),vt.register(hl,ld),vt.register(gl,Aa),vt.register(Cl,no),vt.register(Uo,Ai),vt.register(vl,Ba),oo.register(cu,dd),oo.register(ca,Ia),nt.registerSingleton(ro,Gh),nt.registerSingleton(ro,ot),ot.namedCurveSize.set("P-256",32),ot.namedCurveSize.set("K-256",32),ot.namedCurveSize.set("P-384",48),ot.namedCurveSize.set("P-521",66);function md(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ba){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof Aa){const s=Object.values(xa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Jh(){const e=md(),t=n.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(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 Yh={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 Zh(){const e=pr.createI18n("en-us",Yh);return{i18n:e,i18nT:pr.i18nTComponent(e)}}const kt={useCertificate:Jh,useI18n:Zh,useX509:md},Bi={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"}}},Qh={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Xh="Copy to clipboard",ey={message:Qh,iconTitle:Xh},ty="kong-ui-copy-uuid-notify",bd="24px",ry=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},iy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),ny=["aria-hidden"],oy={key:0,"data-testid":"kui-icon-svg-title"},sy=iy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),ay=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:bd,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return bd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",oy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),sy],8,ny))]),_:1},8,["aria-hidden","style"]))}}),cy=ry(ay,[["__scopeId","data-v-ac7fcfb4"]]),ly="16px",uy={class:"kong-ui-copy-uuid"},dy=["onClick"],wd=15,fy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},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:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",ey),i=e,o=t,s=i.notify||n.inject(ty,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var b;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(b=i.uuid)==null?void 0:b.substring(0,5)}`:i.uuid}),p=b=>{l.value=b,setTimeout(()=>{l.value=i.tooltip},1800)},B=b=>{var h,g;if(!b(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>wd,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,wd))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(b,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",uy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(g,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>B(k),["stop"])},[n.createVNode(n.unref(cy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(ly),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,dy)]),_:1})]),_:1},16))])}}}),py=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},hy=py(fy,[["__scopeId","data-v-0c07874b"]]);var Oa=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(Oa||{}),dr=(e=>(e.Edit="edit",e.Create="create",e))(dr||{}),Ft=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ft||{}),le=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(le||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function _a(e={}){return{axiosInstance:ip.create({withCredentials:!0,timeout:3e4,...e})}}function yy(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ta="khcp-user-table-preferences",gy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function my(){const e=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(i){console.error("useTablePreferences(tryParseJson)",i);return}},t=()=>{const r=e(localStorage.getItem(Ta));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(Ta,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||gy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ta)}}}const by={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},wy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},vy={actions:{save:"Save",cancel:"Cancel",back:"Back"},errors:{edit:"The entity could not be edited at this time."}},ky={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Cy={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"},endpoints:{get:"Get"},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}",structuredFormat:"Structured"}},Sy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},xy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ay={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},By={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"}},Iy={global:by,deleteModal:wy,baseForm:vy,baseTable:ky,baseConfigCard:Cy,filter:Sy,debouncedFilter:xy,errors:Ay,toggleModal:By};function Va(){const e=pr.createI18n("en-us",Iy);return{i18n:e,i18nT:pr.i18nTComponent(e)}}function vd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function Ey(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=_a({headers:e.requestHeaders}),{i18n:{t:s}}=Va(),{debounce:a}=yy(),c=a(async C=>{await v(C)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),B=n.ref([]),b=n.ref(void 0),h=n.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:k}=vd(),m=async()=>{try{l.value=!0;const{data:C}=await o.get(`${g}?size=${r}`);C!=null&&C.next||(b.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[]),B.value=i.fetchedItemsKey in C?C[i.fetchedItemsKey]:[],p.value=B.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},x=n.ref(""),v=async C=>{var _,z,re;if(x.value!==C)if(x.value=C||"",b.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let E=g+"";C&&(E+=`/${C}`);const{data:O}=await o.get(`${E}?size=${r}`);i.fetchedItemsKey in O?p.value=O[i.fetchedItemsKey]:O!=null&&O.id?p.value=[O]:p.value=[]}else if(C){const E=[];k(C)&&i.searchKeys.includes("id")?E.push((async()=>{const{data:M}=await o.get(`${g}/${C}`);return[M[i.fetchedItemsKey]??M]})()):E.push(...i.searchKeys.filter(M=>M!=="id").map(async M=>{const{data:Z}=await o.get(`${g}?${M}=${C}`);return Z[i.fetchedItemsKey]}));const O=await Promise.all(E),G=new Set;p.value=[],(_=O==null?void 0:O.forEach)==null||_.call(O,M=>{var Z;(Z=M==null?void 0:M.forEach)==null||Z.call(M,H=>{G.has(H.id)||(G.add(H.id),p.value.push(H))})})}else p.value=B.value}catch(E){((z=E==null?void 0:E.response)==null?void 0:z.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",C?(p.value=(re=b.value)==null?void 0:re.filter(E=>{var O;let G=!1;for(const M of i.searchKeys){const Z=typeof E[M]=="string"?(O=E[M])==null?void 0:O.toLowerCase():E[M];Z!=null&&Z.includes(C.toLowerCase())&&(G=!0)}return G}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=b.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:b,loadItems:m,debouncedQueryChange:c}}function Ny(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function Oy(){const{i18n:{t:e}}=Va();return{getMessageFromError:t=>{var r,i,o;if(!t)return e("errors.unexpected");if((r=t==null?void 0:t.response)!=null&&r.data){if(t.response.data.detail)return t.response.data.detail;if((i=t.response.data.details)!=null&&i.length)return t.response.data.details.map(s=>{let a=e("errors.unexpected");return s.messages&&typeof s.messages=="object"&&s.messages.length&&(a=s.messages.join(", ")),s.field?`${s.field} - ${a}`:a}).join("; ");if(t.response.data.message){const{message:s}=t.response.data;return Array.isArray(s)?(o=s[0])!=null&&o.constraints?Object.values(s[0].constraints)[0]:s[0]:s}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(s=>`${s} ${t.response.data[s]}`).join(", ")}return t.message||e("errors.unexpected")}}}function _y(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function kd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:B}=a;try{let b=new URL(s.value.href);return o.value&&B?(b.search="",b=r.value.app==="konnect"?new URL(`${b.href}?filter[name][contains]=${B}`):new URL(`${b.href}/${B}/`)):(o.value||new URLSearchParams(B).forEach((h,g)=>{b.searchParams.append(g,h)}),y&&b.searchParams.append("sort_by",y),p==="desc"&&b.searchParams.append("sort_desc","1"),b.searchParams.append("size",String(l))),d&&c!==1&&b.searchParams.append("offset",String(d)),b.href}catch(b){return console.error("RouteList(fetcher)",b),i.value}}}function Ty(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=_a({headers:e.requestHeaders}),s=kd(e,i),a=n.ref({status:Ft.Idle});return{fetcher:async c=>{try{a.value={status:Ft.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const B={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ft.Idle,response:B},B}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ft.NoResults,response:d,error:l},d):(a.value={status:Ft.Error,response:d,error:l},d)}},fetcherState:a}}function Vy(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Cd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Sd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Cd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},xd=e=>e==="*"||e==="x"||e==="X",Ad=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},jy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Dy=(e,t)=>{if(xd(e)||xd(t))return 0;const[r,i]=jy(Ad(e),Ad(t));return r>i?1:r<i?-1:0},Bd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Dy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},$y=(e,t)=>{const r=Sd(e),i=Sd(t),o=r.pop(),s=i.pop(),a=Bd(r,i);return a!==0?a:o&&s?Bd(o.split("."),s.split(".")):o||s?o?-1:1:0},Id=(e,t,r)=>{My(r);const i=$y(e,t);return Ed[r].includes(i)},Ed={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Nd=Object.keys(Ed),My=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Nd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Nd.join("|")}`)},Py=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Cd.test(e);function Ry(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Py(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Id(o,a,"<")||c&&Id(o,c,">"))}function Uy(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Te={useAxios:_a,useDebouncedFilter:Ey,useDeleteUrlBuilder:Ny,useErrors:Oy,useExternalLinkCreator:_y,useFetcher:Ty,useFetchUrlBuilder:kd,useHelpers:vd,useStringHelpers:Vy,useI18n:Va,useGatewayFeatureSupported:Ry,useTruncationDetector:Uy},Ly={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Hy="Copy to clipboard",Fy={message:Ly,iconTitle:Hy},qy="kong-ui-copy-uuid-notify",Od="24px",Ky=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},zy=e=>(n.pushScopeId("data-v-ac7fcfb4"),e=e(),n.popScopeId(),e),Gy=["aria-hidden"],Wy={key:0,"data-testid":"kui-icon-svg-title"},Jy=zy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Yy=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Od,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Od}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Wy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Jy],8,Gy))]),_:1},8,["aria-hidden","style"]))}}),Zy=Ky(Yy,[["__scopeId","data-v-ac7fcfb4"]]),Qy="16px",Xy={class:"kong-ui-copy-uuid"},eg=["onClick"],_d=15,tg=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},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:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",Fy),i=e,o=t,s=i.notify||n.inject(qy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var b;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(b=i.uuid)==null?void 0:b.substring(0,5)}`:i.uuid}),p=b=>{l.value=b,setTimeout(()=>{l.value=i.tooltip},1800)},B=b=>{var h,g;if(!b(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const k=((h=i.uuid)==null?void 0:h.length)>_d,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,_d))+(k?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(b,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",Xy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(g,null,{default:n.withCtx(({copyToClipboard:k})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>B(k),["stop"])},[n.createVNode(n.unref(Zy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(Qy),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,eg)]),_:1})]),_:1},16))])}}}),rg=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Td=rg(tg,[["__scopeId","data-v-0c07874b"]]),ig={key:0,class:"config-card-fieldset-title"},ng=n.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Te.useI18n(),{convertKeyToTitle:i}=Te.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",ig,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(y,p)=>(n.openBlock(),n.createBlock(Ii,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),dt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vd=dt(ng,[["__scopeId","data-v-68ca83ec"]]),og=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),sg=dt(og,[["__scopeId","data-v-c96811e5"]]),ag=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),cg="#0044f4",lg="#e0e4ea",ug="#3a3f51",dg="1px",fg="20px",pg={class:"config-card-details-row"},hg=["data-testid"],yg=["data-testid"],gg=["data-testid"],mg=["data-testid"],bg={key:1},wg=["data-testid"],vg=["data-testid"],kg=["data-testid"],Cg=["data-testid"],Sg={name:"ConfigCardItem",components:{CopyUuid:Td,JsonCardItem:Vd,StatusBadge:ag,InternalLinkItem:sg}},xg=n.defineComponent({...Sg,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){n.useCssVars(h=>({"0da74440":y.value?"none":`solid ${n.unref(dg)} ${n.unref(lg)}`,"02a039da":d.value&&c.value?"block":"flex","690f3ced":d.value&&c.value?"100%":r.slim?"50%":"25%","691182c8":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Te.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===le.Json||r.item.type===le.JsonArray),y=n.computed(()=>r.item.type===le.JsonArray),p=n.computed(()=>{switch(r.item.type){case le.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case le.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case le.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case le.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case le.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case le.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case le.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case le.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case le.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case le.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case le.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case le.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-array-content`,item:r.item}};default:return{tag:"div",attrs:{"data-testid":`${r.item.key}-plain-text`},text:r.item.value}}}),B=n.ref(),{isTruncated:b}=Te.useTruncationDetector(B);return(h,g)=>{const k=n.resolveComponent("KLabel"),m=n.resolveComponent("KBadge"),x=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",pg,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(k,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,yg)]),key:"0"}:void 0]),1024)],!0)],8,hg),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",bg,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:v,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,wg)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(n.unref(Td),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,uuid:v}),null,16,["data-testid","uuid"]))),128))],8,vg)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(n.unref(np.BadgeMethodAppearances)).includes(v.toLowerCase())?v.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,kg)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(v,C)=>(n.openBlock(),n.createBlock(Vd,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:v},null,8,["index","item"]))),128))],8,Cg)):(n.openBlock(),n.createBlock(x,{key:4,label:n.unref(b)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:B,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,mg))],!0)],8,gg)])}}}),Ii=dt(xg,[["__scopeId","data-v-9c87856b"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function jd(e){return typeof e>"u"||e===null}function Ag(e){return typeof e=="object"&&e!==null}function Bg(e){return Array.isArray(e)?e:jd(e)?[]:[e]}function Ig(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function Eg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Ng(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Og=jd,_g=Ag,Tg=Bg,Vg=Eg,jg=Ng,Dg=Ig,Ne={isNothing:Og,isObject:_g,toArray:Tg,repeat:Vg,isNegativeZero:jg,extend:Dg};function Dd(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
118
118
|
|
|
119
|
-
`+e.mark.snippet),i+" "+r):i}function
|
|
120
|
-
`+c;for(d=
|
|
121
|
-
`,c+=
|
|
122
|
-
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=
|
|
123
|
-
`;return c.replace(/\n$/,"")}var
|
|
124
|
-
\r`;function
|
|
125
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function
|
|
126
|
-
`,t-1))}function
|
|
127
|
-
`,s?1+l:l):o===
|
|
128
|
-
`);break}for(i?
|
|
129
|
-
`,s?1+l:l)):d?(d=!1,e.result+=
|
|
130
|
-
`,l+1)):l===0?s&&(e.result+=" "):e.result+=
|
|
131
|
-
`,l):e.result+=
|
|
132
|
-
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
119
|
+
`+e.mark.snippet),i+" "+r):i}function Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Dd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ei.prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei.prototype.toString=function(e){return this.name+": "+Dd(this,e)};var Fe=Ei;function ja(e,t,r,i,o){var s="",a="",c=Math.floor(o/2)-1;return i-t>c&&(s=" ... ",t=i-c+s.length),r-i>c&&(a=" ...",r=i+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Da(e,t){return Ne.repeat(" ",t-e.length)+e}function $g(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var r=/\r?\n|\r|\0/g,i=[0],o=[],s,a=-1;s=r.exec(e.buffer);)o.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+y+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=ja(e.buffer,i[a-l],o[a-l],e.position-(i[a]-i[a-l]),p),c=Ne.repeat(" ",t.indent)+Da((e.line-l+1).toString(),y)+" | "+d.str+`
|
|
120
|
+
`+c;for(d=ja(e.buffer,i[a],o[a],e.position,p),c+=Ne.repeat(" ",t.indent)+Da((e.line+1).toString(),y)+" | "+d.str+`
|
|
121
|
+
`,c+=Ne.repeat("-",t.indent+y+3+d.pos)+`^
|
|
122
|
+
`,l=1;l<=t.linesAfter&&!(a+l>=o.length);l++)d=ja(e.buffer,i[a+l],o[a+l],e.position-(i[a]-i[a+l]),p),c+=Ne.repeat(" ",t.indent)+Da((e.line+l+1).toString(),y)+" | "+d.str+`
|
|
123
|
+
`;return c.replace(/\n$/,"")}var Mg=$g,Pg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Rg=["scalar","sequence","mapping"];function Ug(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Lg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Pg.indexOf(r)===-1)throw new Fe('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Ug(t.styleAliases||null),Rg.indexOf(this.kind)===-1)throw new Fe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var $e=Lg;function $d(e,t){var r=[];return e[t].forEach(function(i){var o=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(o=a)}),r[o]=i}),r}function Hg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(o){o.multi?(e.multi[o.kind].push(o),e.multi.fallback.push(o)):e[o.kind][o.tag]=e.fallback[o.tag]=o}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function $a(e){return this.extend(e)}$a.prototype.extend=function(e){var t=[],r=[];if(e instanceof $e)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new Fe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof $e))throw new Fe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Fe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Fe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof $e))throw new Fe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create($a.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=$d(i,"implicit"),i.compiledExplicit=$d(i,"explicit"),i.compiledTypeMap=Hg(i.compiledImplicit,i.compiledExplicit),i};var Md=$a,Pd=new $e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Rd=new $e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Ud=new $e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ld=new Md({explicit:[Pd,Rd,Ud]});function Fg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function qg(){return null}function Kg(e){return e===null}var Hd=new $e("tag:yaml.org,2002:null",{kind:"scalar",resolve:Fg,construct:qg,predicate:Kg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zg(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Gg(e){return e==="true"||e==="True"||e==="TRUE"}function Wg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Fd=new $e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zg,construct:Gg,predicate:Wg,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Jg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Yg(e){return 48<=e&&e<=55}function Zg(e){return 48<=e&&e<=57}function Qg(e){if(e===null)return!1;var t=e.length,r=0,i=!1,o;if(!t)return!1;if(o=e[r],(o==="-"||o==="+")&&(o=e[++r]),o==="0"){if(r+1===t)return!0;if(o=e[++r],o==="b"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(o!=="0"&&o!=="1")return!1;i=!0}return i&&o!=="_"}if(o==="x"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Jg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!Yg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Zg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function Xg(e){var t=e,r=1,i;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),i=t[0],(i==="-"||i==="+")&&(i==="-"&&(r=-1),t=t.slice(1),i=t[0]),t==="0")return 0;if(i==="0"){if(t[1]==="b")return r*parseInt(t.slice(2),2);if(t[1]==="x")return r*parseInt(t.slice(2),16);if(t[1]==="o")return r*parseInt(t.slice(2),8)}return r*parseInt(t,10)}function em(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Ne.isNegativeZero(e)}var qd=new $e("tag:yaml.org,2002:int",{kind:"scalar",resolve:Qg,construct:Xg,predicate:em,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),tm=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function rm(e){return!(e===null||!tm.test(e)||e[e.length-1]==="_")}function im(e){var t,r;return t=e.replace(/_/g,"").toLowerCase(),r=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:r*parseFloat(t,10)}var nm=/^[-+]?[0-9]+e/;function om(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ne.isNegativeZero(e))return"-0.0";return r=e.toString(10),nm.test(r)?r.replace("e",".e"):r}function sm(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Ne.isNegativeZero(e))}var Kd=new $e("tag:yaml.org,2002:float",{kind:"scalar",resolve:rm,construct:im,predicate:sm,represent:om,defaultStyle:"lowercase"}),zd=Ld.extend({implicit:[Hd,Fd,qd,Kd]}),Gd=zd,Wd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Jd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function am(e){return e===null?!1:Wd.exec(e)!==null||Jd.exec(e)!==null}function cm(e){var t,r,i,o,s,a,c,l=0,d=null,y,p,B;if(t=Wd.exec(e),t===null&&(t=Jd.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(r,i,o));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),B=new Date(Date.UTC(r,i,o,s,a,c,l)),d&&B.setTime(B.getTime()-d),B}function lm(e){return e.toISOString()}var Yd=new $e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:am,construct:cm,instanceOf:Date,represent:lm});function um(e){return e==="<<"||e===null}var Zd=new $e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:um}),Ma=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function dm(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Ma;for(r=0;r<o;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function fm(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Ma,a=0,c=[];for(t=0;t<o;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function pm(e){var t="",r=0,i,o,s=e.length,a=Ma;for(i=0;i<s;i++)i%3===0&&i&&(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]),r=(r<<8)+e[i];return o=s%3,o===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):o===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):o===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function hm(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Qd=new $e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:dm,construct:fm,predicate:hm,represent:pm}),ym=Object.prototype.hasOwnProperty,gm=Object.prototype.toString;function mm(e){if(e===null)return!0;var t=[],r,i,o,s,a,c=e;for(r=0,i=c.length;r<i;r+=1){if(o=c[r],a=!1,gm.call(o)!=="[object Object]")return!1;for(s in o)if(ym.call(o,s))if(!a)a=!0;else return!1;if(!a)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function bm(e){return e!==null?e:[]}var Xd=new $e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:mm,construct:bm}),wm=Object.prototype.toString;function vm(e){if(e===null)return!0;var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],wm.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function km(e){if(e===null)return[];var t,r,i,o,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],o=Object.keys(i),s[t]=[o[0],i[o[0]]];return s}var ef=new $e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:vm,construct:km}),Cm=Object.prototype.hasOwnProperty;function Sm(e){if(e===null)return!0;var t,r=e;for(t in r)if(Cm.call(r,t)&&r[t]!==null)return!1;return!0}function xm(e){return e!==null?e:{}}var tf=new $e("tag:yaml.org,2002:set",{kind:"mapping",resolve:Sm,construct:xm}),Pa=Gd.extend({implicit:[Yd,Zd],explicit:[Qd,Xd,ef,tf]}),qt=Object.prototype.hasOwnProperty,so=1,rf=2,nf=3,ao=4,Ra=1,Am=2,of=3,Bm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Im=/[\x85\u2028\u2029]/,Em=/[,\[\]\{\}]/,sf=/^(?:!|!!|![a-z\-]+!)$/i,af=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function cf(e){return Object.prototype.toString.call(e)}function Ct(e){return e===10||e===13}function fr(e){return e===9||e===32}function Ye(e){return e===9||e===32||e===10||e===13}function Ur(e){return e===44||e===91||e===93||e===123||e===125}function Nm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Om(e){return e===120?2:e===117?4:e===85?8:0}function _m(e){return 48<=e&&e<=57?e-48:-1}function lf(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
125
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Tm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var uf=new Array(256),df=new Array(256),Lr=0;Lr<256;Lr++)uf[Lr]=lf(Lr)?1:0,df[Lr]=lf(Lr);function Vm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Pa,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function ff(e,t){var r={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return r.snippet=Mg(r),new Fe(t,r)}function Y(e,t){throw ff(e,t)}function co(e,t){e.onWarning&&e.onWarning.call(null,ff(e,t))}var pf={YAML:function(e,t,r){var i,o,s;e.version!==null&&Y(e,"duplication of %YAML directive"),r.length!==1&&Y(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Y(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&Y(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&co(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,o;r.length!==2&&Y(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],sf.test(i)||Y(e,"ill-formed tag handle (first argument) of the TAG directive"),qt.call(e.tagMap,i)&&Y(e,'there is a previously declared suffix for "'+i+'" tag handle'),af.test(o)||Y(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{Y(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function Kt(e,t,r,i){var o,s,a,c;if(t<r){if(c=e.input.slice(t,r),i)for(o=0,s=c.length;o<s;o+=1)a=c.charCodeAt(o),a===9||32<=a&&a<=1114111||Y(e,"expected valid JSON character");else Bm.test(c)&&Y(e,"the stream contains non-printable characters");e.result+=c}}function hf(e,t,r,i){var o,s,a,c;for(Ne.isObject(r)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,c=o.length;a<c;a+=1)s=o[a],qt.call(t,s)||(t[s]=r[s],i[s]=!0)}function Hr(e,t,r,i,o,s,a,c,l){var d,y;if(Array.isArray(o))for(o=Array.prototype.slice.call(o),d=0,y=o.length;d<y;d+=1)Array.isArray(o[d])&&Y(e,"nested arrays are not supported inside keys"),typeof o=="object"&&cf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&cf(o)==="[object Object]"&&(o="[object Object]"),o=String(o),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)hf(e,t,s[d],r);else hf(e,t,s,r);else!e.json&&!qt.call(r,o)&&qt.call(t,o)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,Y(e,"duplicated mapping key")),o==="__proto__"?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[o]=s,delete r[o];return t}function Ua(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Ae(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;fr(o);)o===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),o=e.input.charCodeAt(++e.position);if(t&&o===35)do o=e.input.charCodeAt(++e.position);while(o!==10&&o!==13&&o!==0);if(Ct(o))for(Ua(e),o=e.input.charCodeAt(e.position),i++,e.lineIndent=0;o===32;)e.lineIndent++,o=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&co(e,"deficient indentation"),i}function lo(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||Ye(r)))}function La(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ne.repeat(`
|
|
126
|
+
`,t-1))}function jm(e,t,r){var i,o,s,a,c,l,d,y,p=e.kind,B=e.result,b;if(b=e.input.charCodeAt(e.position),Ye(b)||Ur(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;b!==0;){if(b===58){if(o=e.input.charCodeAt(e.position+1),Ye(o)||r&&Ur(o))break}else if(b===35){if(i=e.input.charCodeAt(e.position-1),Ye(i))break}else{if(e.position===e.lineStart&&lo(e)||r&&Ur(b))break;if(Ct(b))if(l=e.line,d=e.lineStart,y=e.lineIndent,Ae(e,!1,-1),e.lineIndent>=t){c=!0,b=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Kt(e,s,a,!1),La(e,e.line-l),s=a=e.position,c=!1),fr(b)||(a=e.position+1),b=e.input.charCodeAt(++e.position)}return Kt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=B,!1)}function Dm(e,t){var r,i,o;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Kt(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,o=e.position;else return!0;else Ct(r)?(Kt(e,i,o,!0),La(e,Ae(e,!1,t)),i=o=e.position):e.position===e.lineStart&&lo(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function $m(e,t){var r,i,o,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Kt(e,r,e.position,!0),e.position++,!0;if(c===92){if(Kt(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),Ct(c))Ae(e,!1,t);else if(c<256&&uf[c])e.result+=df[c],e.position++;else if((a=Om(c))>0){for(o=a,s=0;o>0;o--)c=e.input.charCodeAt(++e.position),(a=Nm(c))>=0?s=(s<<4)+a:Y(e,"expected hexadecimal character");e.result+=Tm(s),e.position++}else Y(e,"unknown escape sequence");r=i=e.position}else Ct(c)?(Kt(e,r,i,!0),La(e,Ae(e,!1,t)),r=i=e.position):e.position===e.lineStart&&lo(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function Mm(e,t){var r=!0,i,o,s,a=e.tag,c,l=e.anchor,d,y,p,B,b,h=Object.create(null),g,k,m,x;if(x=e.input.charCodeAt(e.position),x===91)y=93,b=!1,c=[];else if(x===123)y=125,b=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),x=e.input.charCodeAt(++e.position);x!==0;){if(Ae(e,!0,t),x=e.input.charCodeAt(e.position),x===y)return e.position++,e.tag=a,e.anchor=l,e.kind=b?"mapping":"sequence",e.result=c,!0;r?x===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),k=g=m=null,p=B=!1,x===63&&(d=e.input.charCodeAt(e.position+1),Ye(d)&&(p=B=!0,e.position++,Ae(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Fr(e,t,so,!1,!0),k=e.tag,g=e.result,Ae(e,!0,t),x=e.input.charCodeAt(e.position),(B||e.line===i)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),Ae(e,!0,t),Fr(e,t,so,!1,!0),m=e.result),b?Hr(e,c,h,k,g,m,i,o,s):p?c.push(Hr(e,null,h,k,g,m,i,o,s)):c.push(g),Ae(e,!0,t),x=e.input.charCodeAt(e.position),x===44?(r=!0,x=e.input.charCodeAt(++e.position)):r=!1}Y(e,"unexpected end of the stream within a flow collection")}function Pm(e,t){var r,i,o=Ra,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ra===o?o=p===43?of:Am:Y(e,"repeat of a chomping mode identifier");else if((y=_m(p))>=0)y===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?Y(e,"repeat of an indentation width identifier"):(c=t+y-1,a=!0);else break;if(fr(p)){do p=e.input.charCodeAt(++e.position);while(fr(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!Ct(p)&&p!==0)}for(;p!==0;){for(Ua(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),Ct(p)){l++;continue}if(e.lineIndent<c){o===of?e.result+=Ne.repeat(`
|
|
127
|
+
`,s?1+l:l):o===Ra&&s&&(e.result+=`
|
|
128
|
+
`);break}for(i?fr(p)?(d=!0,e.result+=Ne.repeat(`
|
|
129
|
+
`,s?1+l:l)):d?(d=!1,e.result+=Ne.repeat(`
|
|
130
|
+
`,l+1)):l===0?s&&(e.result+=" "):e.result+=Ne.repeat(`
|
|
131
|
+
`,l):e.result+=Ne.repeat(`
|
|
132
|
+
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!Ct(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Kt(e,r,e.position,!1)}return!0}function yf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,c=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!Ye(a))));){if(c=!0,e.position++,Ae(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Fr(e,t,nf,!1,!0),s.push(e.result),Ae(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Rm(e,t,r){var i,o,s,a,c,l,d=e.tag,y=e.anchor,p={},B=Object.create(null),b=null,h=null,g=null,k=!1,m=!1,x;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),x=e.input.charCodeAt(e.position);x!==0;){if(!k&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(x===63||x===58)&&Ye(i))x===63?(k&&(Hr(e,p,B,b,h,null,a,c,l),b=h=g=null),m=!0,k=!0,o=!0):k?(k=!1,o=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,x=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Fr(e,r,rf,!1,!0))break;if(e.line===s){for(x=e.input.charCodeAt(e.position);fr(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),Ye(x)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),k&&(Hr(e,p,B,b,h,null,a,c,l),b=h=g=null),m=!0,k=!1,o=!1,b=e.tag,h=e.result;else if(m)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(m)Y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=y,!0}if((e.line===s||e.lineIndent>t)&&(k&&(a=e.line,c=e.lineStart,l=e.position),Fr(e,t,ao,!0,o)&&(k?h=e.result:g=e.result),k||(Hr(e,p,B,b,h,g,a,c,l),b=h=g=null),Ae(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&x!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return k&&Hr(e,p,B,b,h,null,a,c,l),m&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),m}function Um(e){var t,r=!1,i=!1,o,s,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&Y(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(r=!0,a=e.input.charCodeAt(++e.position)):a===33?(i=!0,o="!!",a=e.input.charCodeAt(++e.position)):o="!",t=e.position,r){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(s=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ye(a);)a===33&&(i?Y(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),sf.test(o)||Y(e,"named tag handle cannot contain such characters"),i=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Em.test(s)&&Y(e,"tag suffix cannot contain flow indicator characters")}s&&!af.test(s)&&Y(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{Y(e,"tag name is malformed: "+s)}return r?e.tag=s:qt.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:Y(e,'undeclared tag handle "'+o+'"'),!0}function Lm(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ye(r)&&!Ur(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Hm(e){var t,r,i;if(i=e.input.charCodeAt(e.position),i!==42)return!1;for(i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!Ye(i)&&!Ur(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),qt.call(e.anchorMap,r)||Y(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],Ae(e,!0,-1),!0}function Fr(e,t,r,i,o){var s,a,c,l=1,d=!1,y=!1,p,B,b,h,g,k;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=c=ao===r||nf===r,i&&Ae(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;Um(e)||Lm(e);)Ae(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=d||o),(l===1||ao===r)&&(so===r||rf===r?g=t:g=t+1,k=e.position-e.lineStart,l===1?c&&(yf(e,k)||Rm(e,k,g))||Mm(e,g)?y=!0:(a&&Pm(e,g)||Dm(e,g)||$m(e,g)?y=!0:Hm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&Y(e,"alias node should not have any properties")):jm(e,g,so===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&yf(e,k))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,B=e.implicitTypes.length;p<B;p+=1)if(h=e.implicitTypes[p],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(qt.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,b=e.typeMap.multi[e.kind||"fallback"],p=0,B=b.length;p<B;p+=1)if(e.tag.slice(0,b[p].tag.length)===b[p].tag){h=b[p];break}h||Y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&Y(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+h.kind+'", not "'+e.kind+'"'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Y(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||y}function Fm(e){var t=e.position,r,i,o,s=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(Ae(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(s=!0,a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!Ye(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&Y(e,"directive name must not be less than one character in length");a!==0;){for(;fr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!Ct(a));break}if(Ct(a))break;for(r=e.position;a!==0&&!Ye(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Ua(e),qt.call(pf,i)?pf[i](e,i,o):co(e,'unknown document directive "'+i+'"')}if(Ae(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Ae(e,!0,-1)):s&&Y(e,"directives end mark is expected"),Fr(e,e.lineIndent-1,ao,!1,!0),Ae(e,!0,-1),e.checkLineBreaks&&Im.test(e.input.slice(t,e.position))&&co(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&lo(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Ae(e,!0,-1));return}if(e.position<e.length-1)Y(e,"end of the stream or a document separator is expected");else return}function gf(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
133
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new Vm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,Y(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)Fm(r);return r.documents}function qm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=gf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Km(e,t){var r=gf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Fe("expected a single document in the stream, but found more")}}var zm=qm,Gm=Km,mf={loadAll:zm,load:Gm},bf=Object.prototype.toString,wf=Object.prototype.hasOwnProperty,Ha=65279,Wm=9,Ni=10,Jm=13,Ym=32,Zm=33,Qm=34,Fa=35,Xm=37,e0=38,t0=39,r0=42,vf=44,i0=45,uo=58,n0=61,o0=62,s0=63,a0=64,kf=91,Cf=93,c0=96,Sf=123,l0=124,xf=125,Ue={};Ue[0]="\\0",Ue[7]="\\a",Ue[8]="\\b",Ue[9]="\\t",Ue[10]="\\n",Ue[11]="\\v",Ue[12]="\\f",Ue[13]="\\r",Ue[27]="\\e",Ue[34]='\\"',Ue[92]="\\\\",Ue[133]="\\N",Ue[160]="\\_",Ue[8232]="\\L",Ue[8233]="\\P";var u0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],d0=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function f0(e,t){var r,i,o,s,a,c,l;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&wf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function p0(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else if(e<=4294967295)r="U",i=8;else throw new Fe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Ne.repeat("0",i-t.length)+t}var h0=1,Oi=2;function y0(e){this.schema=e.schema||Pa,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Ne.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=f0(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Oi:h0,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Af(e,t){for(var r=Ne.repeat(" ",t),i=0,o=-1,s="",a,c=e.length;i<c;)o=e.indexOf(`
|
|
134
134
|
`,i),o===-1?(a=e.slice(i),i=c):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
|
|
135
|
-
`&&(s+=r),s+=a;return s}function
|
|
136
|
-
`+
|
|
135
|
+
`&&(s+=r),s+=a;return s}function qa(e,t){return`
|
|
136
|
+
`+Ne.repeat(" ",e.indent*t)}function g0(e,t){var r,i,o;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(o=e.implicitTypes[r],o.resolve(t))return!0;return!1}function fo(e){return e===Ym||e===Wm}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ha||65536<=e&&e<=1114111}function Bf(e){return _i(e)&&e!==Ha&&e!==Jm&&e!==Ni}function If(e,t,r){var i=Bf(e),o=i&&!fo(e);return(r?i:i&&e!==vf&&e!==kf&&e!==Cf&&e!==Sf&&e!==xf)&&e!==Fa&&!(t===uo&&!o)||Bf(t)&&!fo(t)&&e===Fa||t===uo&&o}function m0(e){return _i(e)&&e!==Ha&&!fo(e)&&e!==i0&&e!==s0&&e!==uo&&e!==vf&&e!==kf&&e!==Cf&&e!==Sf&&e!==xf&&e!==Fa&&e!==e0&&e!==r0&&e!==Zm&&e!==l0&&e!==n0&&e!==o0&&e!==t0&&e!==Qm&&e!==Xm&&e!==a0&&e!==c0}function b0(e){return!fo(e)&&e!==uo}function Ti(e,t){var r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&t+1<e.length&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function Ef(e){var t=/^\n* /;return t.test(e)}var Nf=1,Ka=2,Of=3,_f=4,qr=5;function w0(e,t,r,i,o,s,a,c){var l,d=0,y=null,p=!1,B=!1,b=i!==-1,h=-1,g=m0(Ti(e,0))&&b0(Ti(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),!_i(d))return qr;g=g&&If(d,y,c),y=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=Ti(e,l),d===Ni)p=!0,b&&(B=B||l-h-1>i&&e[h+1]!==" ",h=l);else if(!_i(d))return qr;g=g&&If(d,y,c),y=d}B=B||b&&l-h-1>i&&e[h+1]!==" "}return!p&&!B?g&&!a&&!o(e)?Nf:s===Oi?qr:Ka:r>9&&Ef(e)?qr:a?s===Oi?qr:Ka:B?_f:Of}function v0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(u0.indexOf(t)!==-1||d0.test(t)))return e.quotingType===Oi?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=i||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return g0(e,d)}switch(w0(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,o)){case Nf:return t;case Ka:return"'"+t.replace(/'/g,"''")+"'";case Of:return"|"+Tf(t,e.indent)+Vf(Af(t,s));case _f:return">"+Tf(t,e.indent)+Vf(Af(k0(t,a),s));case qr:return'"'+C0(t)+'"';default:throw new Fe("impossible error: invalid scalar style")}}()}function Tf(e,t){var r=Ef(e)?String(t):"",i=e[e.length-1]===`
|
|
137
137
|
`,o=i&&(e[e.length-2]===`
|
|
138
138
|
`||e===`
|
|
139
139
|
`),s=o?"+":i?"":"-";return r+s+`
|
|
140
|
-
`}function
|
|
141
|
-
`?e.slice(0,-1):e}function
|
|
142
|
-
`);return d=d!==-1?d:e.length,r.lastIndex=d,
|
|
140
|
+
`}function Vf(e){return e[e.length-1]===`
|
|
141
|
+
`?e.slice(0,-1):e}function k0(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
|
|
142
|
+
`);return d=d!==-1?d:e.length,r.lastIndex=d,jf(e.slice(0,d),t)}(),o=e[0]===`
|
|
143
143
|
`||e[0]===" ",s,a;a=r.exec(e);){var c=a[1],l=a[2];s=l[0]===" ",i+=c+(!o&&!s&&l!==""?`
|
|
144
|
-
`:"")+
|
|
144
|
+
`:"")+jf(l,t),o=s}return i}function jf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,c=0,l="";i=r.exec(e);)c=i.index,c-o>t&&(s=a>o?a:c,l+=`
|
|
145
145
|
`+e.slice(o,s),o=s+1),a=c;return l+=`
|
|
146
146
|
`,e.length-o>t&&a>o?l+=e.slice(o,a)+`
|
|
147
|
-
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}function
|
|
148
|
-
`:""}var y0=h0,m0={dump:y0};function Ha(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var g0=Oe,b0=Nd,w0=Vd,v0=Md,k0=Rd,C0=Va,S0=lf.load,x0=lf.loadAll,A0=m0.dump,B0=Ue,I0={binary:qd,float:Pd,map:Td,null:jd,pairs:zd,set:Gd,timestamp:Hd,bool:Dd,int:$d,merge:Fd,omap:Kd,seq:_d,str:Od},E0=Ha("safeLoad","load"),N0=Ha("safeLoadAll","loadAll"),O0=Ha("safeDump","dump"),_0={Type:g0,Schema:b0,FAILSAFE_SCHEMA:w0,JSON_SCHEMA:v0,CORE_SCHEMA:k0,DEFAULT_SCHEMA:C0,load:S0,loadAll:x0,dump:A0,YAMLException:B0,types:I0,safeLoad:E0,safeLoadAll:N0,safeDump:O0};const T0={key:0,class:"config-card-display-form"},V0=["data-testid"],j0={key:0,class:"config-card-prop-section-title"},D0={key:1,class:"config-card-display-json"},$0={key:0,class:"config-card-display-json-endpoint"},P0={key:2,class:"config-card-display-yaml"},M0=n.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null},fetcherUrl:{type:String,required:!0}},setup(e){n.useCssVars(l=>({"7b486894":`${c.value}ch`}));const t=e,r=n.useSlots(),{i18n:{t:i}}=Ie.useI18n(),o=l=>!!(l.tooltip||r[`${l.key}-label-tooltip`]),s=n.ref(""),a=n.ref(""),c=n.computed(()=>{var l;if(!t.fetcherUrl)return 0;const d=(l=t.fetcherUrl)==null?void 0:l.split("/");return d.length<2?0:41+d[d.length-2].length});return n.watch(()=>t.format,l=>{if(l!=="structured"){const d=JSON.parse(JSON.stringify(t.record));delete d.created_at,delete d.updated_at,l==="json"?s.value=JSON.stringify(d,null,2):l==="yaml"&&(a.value=_0.dump(d))}},{immediate:!0}),(l,d)=>{const y=n.resolveComponent("KBadge"),p=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",T0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,A=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${A}-props`,class:n.normalizeClass(`config-card-details-${A}-props`),"data-testid":`config-card-details-${A}-props`},[A!=="basic"?(n.openBlock(),n.createElementBlock("div",j0,n.toDisplayString(A==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[A],b=>(n.openBlock(),n.createBlock(Si,{key:b.key,item:b},n.createSlots({label:n.withCtx(()=>[n.renderSlot(l.$slots,`${b.key}-label`,{row:b},void 0,!0)]),[b.key]:n.withCtx(({rowValue:h})=>[n.renderSlot(l.$slots,b.key,{row:b,rowValue:h},void 0,!0)]),_:2},[o(b)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(l.$slots,`${b.key}-label-tooltip`,{row:b},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,V0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",D0,[t.fetcherUrl?(n.openBlock(),n.createElementBlock("div",$0,[n.createVNode(y,{appearance:"get"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("baseConfigCard.endpoints.get")),1)]),_:1}),n.createVNode(p,{id:"config-card-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),n.createVNode(p,{id:"config-card-codeblock",class:n.normalizeClass({"config-card-display-json-content":t.fetcherUrl}),code:s.value,language:"json",theme:"dark"},null,8,["class","code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",P0,[n.createVNode(p,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),R0=lt(M0,[["__scopeId","data-v-27f85338"]]),Nf="24px",U0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},L0=e=>(n.pushScopeId("data-v-84d5ee61"),e=e(),n.popScopeId(),e),H0=["aria-hidden"],F0={key:0,"data-testid":"kui-icon-svg-title"},q0=L0(()=>n.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),K0=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Nf,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Nf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",F0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),q0],8,H0))]),_:1},8,["aria-hidden","style"]))}}),z0=U0(K0,[["__scopeId","data-v-84d5ee61"]]),G0={"data-testid":"config-card-title"},W0={class:"config-card-actions"},J0=["href"],Y0={key:2,class:"config-card-details-section"},Z0={key:3,class:"config-card-details-section"},Q0=["data-testid"],X0={key:0,class:"config-card-prop-section-title"},e1=n.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.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},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=t,o=e,s=n.useSlots(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:c}=Ie.useErrors(),{convertKeyToTitle:l}=Ie.useStringHelpers(),{axiosInstance:d}=Ie.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),y=[{label:a("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),A=E=>{p.value=E==null?void 0:E.value},b={id:{type:se.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:se.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:se.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:se.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:se.BadgeTag,order:-1,section:fe.Basic}},h=n.ref(!1),m=n.ref(!1),k=n.ref(""),g=n.ref(),S=n.computed(()=>{var E,q,$;if(!g.value)return[];const K=[],U=Object.keys(g.value).length;for(const D in g.value){const oe=(q=(E=o.configSchema)==null?void 0:E[D])==null?void 0:q.order,de=($=b[D])==null?void 0:$.order;let we=U;(de||de===0)&&(we=de===-1?U+1:de),oe&&(we=oe===-1?U+1:oe),K.push([D,we])}return K.sort(function(D,oe){return D[1]-oe[1]}),K.map(D=>{var oe,de;const we=D[0],pe=(oe=g.value)==null?void 0:oe[we],he=((de=o.configSchema)==null?void 0:de[we])||{},Ce=b[we];return{key:we,value:pe,hidden:he.hidden||!1,type:he.type??((Ce==null?void 0:Ce.type)||se.Text),label:he.label??((Ce==null?void 0:Ce.label)||l(we)),tooltip:he.tooltip??((Ce==null?void 0:Ce.tooltip)||void 0),section:he.section??((Ce==null?void 0:Ce.section)||fe.Advanced)}}).filter(D=>!D.hidden&&D.key!==o.pluginConfigKey)}),v=n.computed(()=>{var E,q;if(!g.value||!o.pluginConfigKey)return[];const $=g.value[o.pluginConfigKey]||{},K=Object.keys($).length,U=[];for(const D in $){const oe=(q=(E=o.pluginConfigSchema)==null?void 0:E[D])==null?void 0:q.order,de=$[D];let we=de!=null&&de!==""?K-1:K;oe&&(we=oe===-1?K+1:oe),U.push([D,we])}return U.sort(function(D,oe){return D[1]-oe[1]}),U.map(D=>{var oe;const de=D[0],we=$[de],pe=((oe=o.pluginConfigSchema)==null?void 0:oe[de])||{};return{key:de,value:we,hidden:pe.hidden||!1,type:pe.type??se.Text,label:pe.label??l(de),tooltip:pe.tooltip??void 0,section:fe.Plugin}}).filter(D=>!D.hidden)}),C=n.computed(()=>{var E,q,$,K;return{basic:(E=S.value)==null?void 0:E.filter(U=>U.section===fe.Basic),advanced:(q=S.value)==null?void 0:q.filter(U=>U.section===fe.Advanced),plugin:(K=v.value)==null?void 0:K.concat(($=S.value)==null?void 0:$.filter(U=>U.section===fe.Plugin))}}),O=n.computed(()=>{const E=[];return C.value.basic.length&&E.push("basic"),C.value.advanced.length&&E.push("advanced"),C.value.plugin.length&&E.push("plugin"),E}),F=E=>!!(E.tooltip||s[`${E.key}-label-tooltip`]),Y=n.computed(()=>{var E,q;let $=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((E=o.config)==null?void 0:E.controlPlaneId)||""):o.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(q=o.config)!=null&&q.workspace?`/${o.config.workspace}`:"")),$=$.replace(/{id}/gi,o.config.entityId),$}),I=E=>{g.value&&E(JSON.stringify(g.value))?i("copy:success",g.value):i("copy:error")};return n.watch(h,E=>{i("loading",E)},{immediate:!0}),n.onBeforeMount(async()=>{m.value=!1,h.value=!0;try{const{data:E}=await d.get(Y.value);if(o.dataKey)if(typeof E[o.dataKey]<"u")g.value={...E[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else g.value={...E};Object.keys(o.configSchema).filter(q=>o.configSchema[q].forceShow).forEach(q=>{g.value&&typeof g.value[q]>"u"&&(g.value[q]=null)}),i("fetch:success",E)}catch(E){const q=c(E);k.value=q.startsWith("code")?a("baseConfigCard.errors.load"):q,m.value=!0,i("fetch:error",E)}finally{h.value=!1}}),(E,q)=>{const $=n.resolveComponent("KLabel"),K=n.resolveComponent("KSelect"),U=n.resolveComponent("KButton"),D=n.resolveComponent("KClipboardProvider"),oe=n.resolveComponent("KSkeleton"),de=n.resolveComponent("KEmptyState"),we=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(we,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",W0,[n.renderSlot(E.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock($,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(K,{key:1,appearance:"select","data-testid":"select-config-format",items:y,onChange:A})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(U,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(z0),{size:n.unref(Xy)},null,8,["size"])],8,J0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(D,{key:3},{default:n.withCtx(({copyToClipboard:pe})=>[!h.value&&!m.value?(n.openBlock(),n.createBlock(U,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:he=>I(pe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[h.value?(n.openBlock(),n.createBlock(oe,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):m.value?(n.openBlock(),n.createBlock(de,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(k.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",Y0,[n.createVNode(R0,{"fetcher-url":Y.value,format:p.value,"prop-list-types":O.value,"property-collections":C.value,record:g.value},n.createSlots({_:2},[n.renderList(Object.keys(E.$slots),pe=>({name:pe,fn:n.withCtx(({row:he,rowValue:Ce})=>[n.renderSlot(E.$slots,pe,{row:he,rowValue:Ce},void 0,!0)])}))]),1032,["fetcher-url","format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",Z0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.value,pe=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${pe}-props`,class:n.normalizeClass(`config-card-details-${pe}-props`),"data-testid":`config-card-details-${pe}-props`},[pe!=="basic"?(n.openBlock(),n.createElementBlock("div",X0,n.toDisplayString(pe==="advanced"?n.unref(a)("baseConfigCard.sections.advanced"):n.unref(a)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value[pe],he=>(n.openBlock(),n.createBlock(Si,{key:he.key,item:he},n.createSlots({label:n.withCtx(()=>[n.renderSlot(E.$slots,`${he.key}-label`,{row:he},void 0,!0)]),[he.key]:n.withCtx(({rowValue:Ce})=>[n.renderSlot(E.$slots,he.key,{row:he,rowValue:Ce},void 0,!0)]),_:2},[F(he)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(E.$slots,`${he.key}-label-tooltip`,{row:he},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Q0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",G0,[n.renderSlot(E.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Of=lt(e1,[["__scopeId","data-v-4f47d6ad"]]),t1={class:"form-actions","data-testid":"form-actions"},r1=n.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.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(e,{emit:t}){var r;const i=t,o=e,s=Fr.useRouter(),{i18n:{t:a}}=Ie.useI18n(),{getMessageFromError:c}=Ie.useErrors(),{axiosInstance:l}=Ie.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),A=n.computed(()=>o.canSubmit===!1||o.isReadonly),b=n.computed(()=>{var g,S;if(!o.editId)return"";let v=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((g=o.config)==null?void 0:g.controlPlaneId)||""):o.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(S=o.config)!=null&&S.workspace?`/${o.config.workspace}`:"")),v=v.replace(/{id}/gi,o.editId),v}),h=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):m()},m=()=>{i("cancel")},k=()=>{A.value||i("submit")};return n.watch(()=>d.value,g=>{i("loading",g)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:g}=await l.get(b.value);i("fetch:success",g)}catch(g){const S=c(g);p.value=S.startsWith("code")?a("baseForm.errors.edit"):S,y.value=!0,i("fetch:error",g)}finally{d.value=!1}}),(g,S)=>{const v=n.resolveComponent("KSkeleton"),C=n.resolveComponent("KEmptyState"),O=n.resolveComponent("KAlert"),F=n.resolveComponent("KButton"),Y=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(Y,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(v,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(C,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":h,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(m,["prevent"]),onSubmit:n.withModifiers(k,["prevent"])},[n.renderSlot(g.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(O,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",t1,[n.renderSlot(g.$slots,"form-actions",{},()=>[n.createVNode(F,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(F,{appearance:"primary","data-testid":"form-submit",disabled:A.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32))]),_:3})}}}),_f=lt(r1,[["__scopeId","data-v-448d8512"]]),i1={key:0,"data-testid":"first-col"},n1=n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var m;return((m=t.rowEl)==null?void 0:m.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var m;return((m=r.value)==null?void 0:m.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var m,k;const g=(m=t.rowEl)==null?void 0:m.querySelectorAll("td");return g?((k=g[0])==null?void 0:k.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var m,k,g;d.value=((m=i.value)==null?void 0:m.getBoundingClientRect().width)||0,y.value=((k=r.value)==null?void 0:k.clientWidth)||0,p.value=((g=l.value)==null?void 0:g.innerText)||""},l=n.ref({}),d=n.ref(0),y=n.ref(0),p=n.ref(""),A=n.computed(()=>[i.value,r.value]),b=n.watch(A,m=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(k=>{window.requestAnimationFrame(()=>{!Array.isArray(k)||!k.length||c()})});for(const k of m)k&&s.observe(k)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{b()}),(m,k)=>{const g=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",i1,[n.createVNode(g,{label:h.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(m.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(m.$slots,"default",{key:1},void 0,!0)],512)}}}),o1=lt(n1,[["__scopeId","data-v-e42a20c9"]]),s1={class:"toolbar-container"},a1={key:0,class:"toolbar-button-container"},c1=["data-testid"],l1=n.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,Object],default:null},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:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,i=t,{i18n:{t:o}}=Ie.useI18n(),s=n.computed(()=>{var O,F;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(O=r.errorMessage)==null?void 0:O.title,message:(F=r.errorMessage)==null?void 0:F.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=O=>O.hasData||!!r.query,l=n.computed(()=>{const O=[];return Object.keys(r.tableHeaders).forEach(F=>{const Y=r.tableHeaders[F];O.push({label:Y.label??F,key:F,sortable:Y.sortable??!1})}),r.enableEntityActions&&O.push({key:"actions",hideLabel:!0}),O}),d=O=>({"data-rowid":O.id,"data-testid":O.name,...r.rowAttributes(O)}),y=n.ref({}),p=O=>{var F;return(F=y.value)==null?void 0:F.$el.querySelector(`[data-rowid="${O.id}"]`)},A=O=>{const F={"data-testid":O.headerKey,...r.cellAttributes(O)};return O.colIndex===0&&(F.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),F},b=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},m=n.computed(()=>r.disableRowClick?void 0:(O,F)=>{i("click:row",F)}),k=O=>{i("sort",O)},{setTablePreferences:g,getTablePreferences:S}=ny(),v=n.computed(()=>{const O=S(r.preferencesStorageKey);return{...r.initialFetcherParams,...O}}),C=O=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,O)};return(O,F)=>{const Y=n.resolveComponent("KIcon"),I=n.resolveComponent("KButton"),E=n.resolveComponent("KDropdown"),q=n.resolveComponent("KTable"),$=n.resolveComponent("KCard");return n.openBlock(),n.createBlock($,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(q,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":A,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:b,"onRow:click":m.value,onSort:F[0]||(F[0]=K=>k(K)),"onUpdate:tablePreferences":C},n.createSlots({toolbar:n.withCtx(({state:K})=>[n.withDirectives(n.createElementVNode("div",s1,[n.renderSlot(O.$slots,"toolbar-filter",{},void 0,!0),O.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",a1,[n.renderSlot(O.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(K)]])]),actions:n.withCtx(({row:K,rowKey:U,rowValue:D})=>[n.createElementVNode("div",{class:"actions-container","data-testid":K.name},[n.createVNode(E,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(O.$slots,"actions",{row:K,rowKey:U,rowValue:D},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(I,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(Y,{color:n.unref(Zy),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,c1)]),_:2},[n.renderList(e.tableHeaders,(K,U)=>({name:U,fn:n.withCtx(({row:D,rowKey:oe,rowValue:de})=>[n.createVNode(o1,{"key-name":String(U),"row-el":p(D)},{default:n.withCtx(()=>[n.renderSlot(O.$slots,U,{row:D,rowKey:oe,rowValue:de},()=>[n.createTextVNode(n.toDisplayString(de),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-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Tf=lt(l1,[["__scopeId","data-v-57b5a97b"]]),u1={key:0,class:"kong-ui-entity-delete-error"},d1={key:1,class:"description"},f1=n.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(e,{emit:t}){const{i18nT:r}=Ie.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:a,onProceed:c},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",u1,[n.createVNode(y,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(n.openBlock(),n.createElementBlock("div",d1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Vf=lt(f1,[["__scopeId","data-v-1c9a2a07"]]),p1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},h1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},y1=["fill"],m1={mask:"url(#mask0_180_20349)"},g1=["fill"],jf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Jy})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",p1,[n.createElementVNode("mask",h1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,y1)]),n.createElementVNode("g",m1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,g1)])]))}}),b1={key:1,class:"kong-ui-entity-filter"},w1={class:"menu-item-title"},v1={class:"menu-item-indicator"},k1={class:"menu-item-body"},C1=["for"],S1={class:"menu-item-buttons"},x1={class:"filter-clear-button-container"},A1=n.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Ie.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),c=n.computed(()=>{const g=[];return new URLSearchParams(i.modelValue).forEach((S,v)=>{S!==""&&g.push(v)}),g}),l=n.computed(()=>{const g=i.config.fields;return Object.keys(g).filter(S=>g[S].searchable).map(S=>({label:g[S].label||S,value:S}))});n.watch(()=>i.modelValue,g=>{a.value={},new URLSearchParams(g).forEach((S,v)=>{a.value[v]=S})});const d=()=>{s.value=!s.value},y=g=>{o("update:modelValue",g)},p=g=>`filter-${g}`,A=g=>{var S,v;return(((v=(S=i.config.schema)==null?void 0:S[g])==null?void 0:v.values)??[]).map(C=>({value:C,label:C}))},b=g=>{var S,v;return((v=(S=i.config.schema)==null?void 0:S[g])==null?void 0:v.type)??"text"},h=g=>{a.value={...a.value,[g]:""},k()},m=()=>{a.value={},k(!0)},k=(g=!1)=>{const S=Object.keys(a.value).reduce((v,C)=>(a.value[C]&&(v[C]=`${a.value[C]}`),v),{});g&&(s.value=!1),o("update:modelValue",new URLSearchParams(S).toString())};return(g,S)=>{const v=n.resolveComponent("KInput"),C=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect"),F=n.resolveComponent("KMenuItem"),Y=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(v,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:n.withCtx(()=>[n.createVNode(jf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",b1,[n.createVNode(C,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(jf),n.createTextVNode(" "+n.toDisplayString(n.unref(r)("filter.filterButtonText"))+" "+n.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createVNode(Y,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(I,E)=>(n.openBlock(),n.createBlock(F,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":E===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",w1,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",v1,null,512),[[n.vShow,c.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var q,$;return[n.createElementVNode("div",k1,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,C1),(($=(q=e.config.schema)==null?void 0:q[I.value])==null?void 0:$.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:p(I.value),modelValue:a.value[I.value],"onUpdate:modelValue":K=>a.value[I.value]=K,appearance:"select",items:A(I.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(v,{key:1,id:p(I.value),modelValue:a.value[I.value],"onUpdate:modelValue":K=>a.value[I.value]=K,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:b(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",S1,[n.createVNode(C,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:S[0]||(S[0]=K=>k(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(C,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:K=>h(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",x1,[n.createVNode(C,{appearance:"tertiary",size:"small",onClick:m},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,s.value]])]))}}}),Df=lt(A1,[["__scopeId","data-v-15962ee2"]]),Tt=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),B1={class:"form-section-wrapper"},I1={key:0,class:"form-section-title"},E1={key:1,class:"form-section-description"},N1={key:2,class:"form-section-footer"},O1={class:"form-section-content"},_1=n.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(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",B1,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",I1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",E1,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",N1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",O1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),ao=lt(_1,[["__scopeId","data-v-3565daa7"]]),{useAxios:co,useDeleteUrlBuilder:$f,useErrors:Pf,useExternalLinkCreator:gb,useFetchUrlBuilder:bb,useFetcher:Mf,useDebouncedFilter:wb,useStringHelpers:Rf,useHelpers:Uf,useGatewayFeatureSupported:vb,useTruncationDetector:kb}=Ie,T1={class:"kong-ui-entities-certificates-list"},V1={key:0},j1={key:1},D1={key:0},$1={key:1},P1={key:0},M1={key:1},R1={key:1},U1={key:1},L1=n.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var Q;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),c=Fr.useRouter(),{axiosInstance:l}=co({headers:(Q=i.config)==null?void 0:Q.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),A={subject:{label:o("certificates.list.table_headers.subject")},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},b=n.computed(()=>{var ie,me;let M=`${i.config.apiBaseUrl}${Ci.list[i.config.app]}`;return i.config.app==="konnect"?M=M.replace(/{controlPlaneId}/gi,((ie=i.config)==null?void 0:ie.controlPlaneId)||""):i.config.app==="kongManager"&&(M=M.replace(/\/{workspace}/gi,(me=i.config)!=null&&me.workspace?`/${i.config.workspace}`:"")),M}),h=n.ref(""),m=n.computed(()=>{const M=i.config.app==="konnect"||i.config.isExactMatch;return M?{isExactMatch:M,placeholder:o("certificates.search.placeholder")}:{isExactMatch:M,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Mf(i.config,b.value),S=()=>{h.value=""},v=()=>{d.value++},C=n.ref(null),O=(M,ie)=>{const me=M.id;if(!ie(me)){r("copy:error",{entity:M,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:M,field:"id",message:o("certificates.copy.success",{val:me})})},F=(M,ie)=>{const me=JSON.stringify(M);if(!ie(me)){r("copy:error",{entity:M,message:o("certificates.errors.copy")});return}r("copy:success",{entity:M,message:o("certificates.copy.success_brief")})},Y=(M,ie)=>{M.type==="error"?r("copy:error",{entity:ie,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:ie,field:"cert",message:o("certificates.copy.success_brief")})},I=async M=>{var me;await((me=i.canRetrieve)==null?void 0:me.call(i,M))&&c.push(i.config.getViewRoute(M.id))},E=M=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(M)}),q=M=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(M)}),$=M=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(M)}},K=n.ref(void 0),U=n.ref(!1),D=n.ref(!1),oe=n.ref(""),de=$f(i.config,b.value),{certificateDataCache:we,getCertificateData:pe}=gt.useCertificate(),he=M=>{K.value=M,U.value=!0},Ce=()=>{U.value=!1},ye=async()=>{var M,ie,me;if((M=K.value)!=null&&M.id){D.value=!0;try{await l.delete(de(K.value.id)),D.value=!1,U.value=!1,d.value++,r("delete:success",K.value)}catch(Pe){oe.value=((me=(ie=Pe.response)==null?void 0:ie.data)==null?void 0:me.message)||Pe.message||o("certificates.errors.delete"),r("error",Pe)}finally{D.value=!1}}},it=n.ref(!0);n.watch(g,M=>{var ie,me,Pe,_e;if(Array.isArray((ie=M==null?void 0:M.response)==null?void 0:ie.data)&&(it.value=M.response.data.length>0),M.status===Rt.Error){C.value={title:o("certificates.errors.general")},(_e=(Pe=(me=M.error)==null?void 0:me.response)==null?void 0:Pe.data)!=null&&_e.message&&(C.value.message=M.error.response.data.message),r("error",M.error);return}we.value={},C.value=null});const Z=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(Z.value.title=o("certificates.list.empty_state.title"),Z.value.ctaText=o("certificates.actions.create"))}),(M,ie)=>{const me=n.resolveComponent("KButton"),Pe=n.resolveComponent("KBadge"),_e=n.resolveComponent("KTruncate"),X=n.resolveComponent("KDropdownItem"),ve=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",T1,[n.createVNode(n.unref(Tf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Z.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(A),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":ie[2]||(ie[2]=W=>I(W)),onSort:v},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Df),{modelValue:h.value,"onUpdate:modelValue":ie[0]||(ie[0]=W=>h.value=W),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Tt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(me,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,it.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",V1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.subject?W.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",j1,n.toDisplayString(n.unref(pe)(W).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",D1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.expiry?n.unref(s)(W.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",$1,n.toDisplayString(n.unref(pe)(W).schemaExpiry?n.unref(s)(n.unref(pe)(W).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:W})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",P1,n.toDisplayString((Se=W==null?void 0:W.metadata)!=null&&Se.dns_names?`dns=${W.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",M1,n.toDisplayString(n.unref(pe)(W).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:W})=>[W!=null&&W.cert?(n.openBlock(),n.createBlock(n.unref(ty),{key:0,"data-testid":"copy-certificate-cert",notify:Se=>Y(Se,W),truncated:!0,uuid:W.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",R1,"-"))]),tags:n.withCtx(({row:W})=>{var Se;return[((Se=W==null?void 0:W.tags)==null?void 0:Se.length)>0?(n.openBlock(),n.createBlock(_e,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(W==null?void 0:W.tags,lr=>(n.openBlock(),n.createBlock(Pe,{key:lr,onClick:ie[1]||(ie[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(lr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",U1,"-"))]}),actions:n.withCtx(({row:W})=>[n.createVNode(ve,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(X,{"data-testid":"action-entity-copy-id",onClick:lr=>O(W,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(ve,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(X,{"data-testid":"action-entity-copy-json",onClick:lr=>F(W,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canRetrieve(W)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-view","has-divider":"",item:E(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canEdit(W)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-edit",item:q(W.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Tt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-add-sni",item:$(W.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canDelete(W)},{default:n.withCtx(()=>[n.createVNode(X,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>he(W)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("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","use-action-outside"]),n.createVNode(n.unref(Vf),{"action-pending":D.value,"entity-type":n.unref(Aa).Certificate,error:oe.value,title:n.unref(o)("certificates.delete.title"),visible:U.value,onCancel:Ce,onProceed:ye},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},H1=Hr(L1,[["__scopeId","data-v-fa23e672"]]),F1={class:"kong-ui-entities-certificates-form"},q1=Hr(n.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var v;const r=t,i=e,o=Fr.useRouter(),{i18nT:s,i18n:{t:a}}=gt.useI18n(),{getMessageFromError:c}=Pf(),{axiosInstance:l}=co({headers:(v=i.config)==null?void 0:v.requestHeaders}),d=n.computed(()=>Ci.form[i.config.app].edit),y=n.computed(()=>i.certificateId?ar.Edit:ar.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),A=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),b=n.computed(()=>(y.value===ar.Create||JSON.stringify(p.fields)!==JSON.stringify(A))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var O;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((O=C==null?void 0:C.tags)==null?void 0:O.join(", "))||"",Object.assign(A,p.fields)},m=()=>{o.push(i.config.cancelRoute)},k=n.computed(()=>{var O,F;let C=`${i.config.apiBaseUrl}${Ci.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(F=i.config)!=null&&F.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),g=n.computed(()=>{var O,F;let C=`${i.config.apiBaseUrl}${Ci.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((O=i.config)==null?void 0:O.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(F=i.config)!=null&&F.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),S=async()=>{var C,O,F,Y,I,E,q,$,K;try{p.isReadonly=!0;const U={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(O=(C=p.fields.tags.split(","))==null?void 0:C.map(oe=>String(oe||"").trim()))==null?void 0:O.filter(oe=>oe!=="")};let D;await l.post(k.value,U),y.value==="create"?D=await l.post(g.value,U):y.value==="edit"&&(D=((F=i.config)==null?void 0:F.app)==="konnect"?await l.put(g.value,U):await l.patch(g.value,U)),p.fields.cert=((Y=D==null?void 0:D.data)==null?void 0:Y.cert)||"",p.fields.key=((I=D==null?void 0:D.data)==null?void 0:I.key)||"",p.fields.certAlt=((E=D==null?void 0:D.data)==null?void 0:E.cert_alt)||"",p.fields.keyAlt=((q=D==null?void 0:D.data)==null?void 0:q.key_alt)||"",p.fields.tags=((K=($=D==null?void 0:D.data)==null?void 0:$.tags)==null?void 0:K.join(", "))||"",Object.assign(A,p.fields),r("update",D==null?void 0:D.data)}catch(U){p.errorMessage=c(U),r("error",U)}finally{p.isReadonly=!1}};return(C,O)=>{const F=n.resolveComponent("KTextArea"),Y=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",F1,[n.createVNode(n.unref(_f),{"can-submit":b.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":O[5]||(O[5]=I=>C.$emit("error",I)),"onFetch:success":h,onLoading:O[6]||(O[6]=I=>C.$emit("loading",I)),onSubmit:S},{default:n.withCtx(()=>[n.createVNode(n.unref(ao),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:p.fields.cert,"onUpdate:modelValue":O[0]||(O[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.key,"onUpdate:modelValue":O[1]||(O[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.certAlt,"onUpdate:modelValue":O[2]||(O[2]=I=>p.fields.certAlt=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:n.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(F,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":O[3]||(O[3]=I=>p.fields.keyAlt=I),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:n.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(ao),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(Y,{modelValue:p.fields.tags,"onUpdate:modelValue":O[4]||(O[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(a)("certificates.form.fields.tags.help"),label:n.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.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"])])}}}),[["__scopeId","data-v-f66bc18c"]]),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"}}},K1={class:"kong-ui-ca-certificate-entity-config-card"},z1={key:0},G1=Hr(n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=gt.useI18n(),{convertKeyToTitle:c}=Rf(),{getPropValue:l}=Uf(),{getCertificateData:d}=gt.useCertificate(),y=n.computed(()=>Ni.form[o.config.app].edit),p=n.ref(),A=n.computed(()=>{if(p.value)return d(p.value)}),b=n.computed(()=>{var v;return((v=A.value)==null?void 0:v.schemaIssuer)||""}),h=n.computed(()=>{var v,C;return(v=A.value)!=null&&v.schemaExpiry?a((C=A.value)==null?void 0:C.schemaExpiry):""}),m=n.computed(()=>{var v;return((v=A.value)==null?void 0:v.schemaKeyUsages)||[]}),k=(v,C)=>{const O=l("rowValue",C);if(v==="expiry")return h.value;if(v==="key_usages")return m.value;if(O)return O[v]},g=v=>{p.value=v,i("fetch:success",v)},S=n.ref({id:{},updated_at:{},created_at:{},cert:{section:fe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:fe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:fe.Basic,type:se.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:fe.Basic,order:1.7,forceShow:!0},issuer:{section:fe.Basic,order:1.5,forceShow:!0},key_usages:{section:fe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(v,C)=>{const O=n.resolveComponent("KCodeBlock"),F=n.resolveComponent("KLabel"),Y=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",K1,[n.createVNode(n.unref(Of),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":S.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":C[0]||(C[0]=I=>v.$emit("copy:success",I)),"onFetch:error":C[1]||(C[1]=I=>v.$emit("fetch:error",I)),"onFetch:success":g,onLoading:C[2]||(C[2]=I=>v.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(l)("rowValue",I)?(n.openBlock(),n.createBlock(O,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(F,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(I=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",I)).filter(E=>!r.includes(E)),E=>(n.openBlock(),n.createBlock(n.unref(Si),{key:E,"data-testid":`ca-cert-metadata-${E}`,item:{key:E,label:n.unref(c)(E),value:k(E,I),type:E==="key_usages"?n.unref(se).BadgeTag:n.unref(se).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",z1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(I,E)=>(n.openBlock(),n.createBlock(Y,{key:`key_usages-badge-tag-${E}`,class:"config-badge","data-testid":`key_usages-badge-tag-${E}`,tooltip:I,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),W1={class:"kong-ui-entities-ca-certificates-list"},J1={key:0},Y1={key:1},Z1={key:0},Q1={key:1},X1={key:1},eb=Hr(n.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var it;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),c=Fr.useRouter(),{axiosInstance:l}=co({headers:(it=i.config)==null?void 0:it.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),A={issuer:{label:o("ca-certificates.list.table_headers.issuer")},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},b=n.computed(()=>{var Q,M;let Z=`${i.config.apiBaseUrl}${Ni.list[i.config.app]}`;return i.config.app==="konnect"?Z=Z.replace(/{controlPlaneId}/gi,((Q=i.config)==null?void 0:Q.controlPlaneId)||""):i.config.app==="kongManager"&&(Z=Z.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),Z}),h=n.ref(""),m=n.computed(()=>{const Z=i.config.app==="konnect"||i.config.isExactMatch;return Z?{isExactMatch:Z,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:Z,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:g}=Mf(i.config,b.value),S=()=>{h.value=""},v=()=>{d.value++},C=n.ref(null),O=(Z,Q)=>{const M=Z.id;if(!Q(M)){r("copy:error",{entity:Z,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:Z,field:"id",message:o("ca-certificates.copy.success",{val:M})})},F=(Z,Q)=>{const M=JSON.stringify(Z);if(!Q(M)){r("copy:error",{entity:Z,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:Z,message:o("ca-certificates.copy.success_brief")})},Y=async Z=>{var M;await((M=i.canRetrieve)==null?void 0:M.call(i,Z))&&c.push(i.config.getViewRoute(Z.id))},I=Z=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(Z)}),E=Z=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(Z)}),q=n.ref(void 0),$=n.ref(!1),K=n.ref(!1),U=n.ref(""),D=$f(i.config,b.value),{certificateDataCache:oe,getCertificateData:de}=gt.useCertificate(),we=Z=>{q.value=Z,$.value=!0},pe=()=>{$.value=!1},he=async()=>{var Z,Q,M;if((Z=q.value)!=null&&Z.id){K.value=!0;try{await l.delete(D(q.value.id)),K.value=!1,$.value=!1,d.value++,r("delete:success",q.value)}catch(ie){U.value=((M=(Q=ie.response)==null?void 0:Q.data)==null?void 0:M.message)||ie.message||o("ca-certificates.errors.delete"),r("error",ie)}finally{K.value=!1}}},Ce=n.ref(!0);n.watch(g,Z=>{var Q,M,ie,me;if(Array.isArray((Q=Z==null?void 0:Z.response)==null?void 0:Q.data)&&(Ce.value=Z.response.data.length>0),Z.status===Rt.Error){C.value={title:o("ca-certificates.errors.general")},(me=(ie=(M=Z.error)==null?void 0:M.response)==null?void 0:ie.data)!=null&&me.message&&(C.value.message=Z.error.response.data.message),r("error",Z.error);return}oe.value={},C.value=null});const ye=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(ye.value.title=o("ca-certificates.list.empty_state.title"),ye.value.ctaText=o("ca-certificates.actions.create"))}),(Z,Q)=>{const M=n.resolveComponent("KButton"),ie=n.resolveComponent("KBadge"),me=n.resolveComponent("KTruncate"),Pe=n.resolveComponent("KDropdownItem"),_e=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",W1,[n.createVNode(n.unref(Tf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ye.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(A),"use-action-outside":e.useActionOutside,onClearSearchInput:S,"onClick:row":Q[2]||(Q[2]=X=>Y(X)),onSort:v},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Df),{modelValue:h.value,"onUpdate:modelValue":Q[0]||(Q[0]=X=>h.value=X),config:m.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Tt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(M,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Ce.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:n.withCtx(({row:X})=>{var ve;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",J1,n.toDisplayString((ve=X==null?void 0:X.metadata)!=null&&ve.issuer?X.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",Y1,n.toDisplayString(n.unref(de)(X).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:X})=>{var ve;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString((ve=X==null?void 0:X.metadata)!=null&&ve.expiry?n.unref(s)(X.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Q1,n.toDisplayString(n.unref(de)(X).schemaExpiry?n.unref(s)(n.unref(de)(X).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:X})=>{var ve;return[((ve=X==null?void 0:X.tags)==null?void 0:ve.length)>0?(n.openBlock(),n.createBlock(me,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X==null?void 0:X.tags,W=>(n.openBlock(),n.createBlock(ie,{key:W,onClick:Q[1]||(Q[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(W),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",X1,"-"))]}),actions:n.withCtx(({row:X})=>[n.createVNode(_e,null,{default:n.withCtx(({copyToClipboard:ve})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-id",onClick:W=>O(X,ve)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(_e,null,{default:n.withCtx(({copyToClipboard:ve})=>[n.createVNode(Pe,{"data-testid":"action-entity-copy-json",onClick:W=>F(X,ve)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canRetrieve(X)},{default:n.withCtx(()=>[n.createVNode(Pe,{"data-testid":"action-entity-view","has-divider":"",item:I(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canEdit(X)},{default:n.withCtx(()=>[n.createVNode(Pe,{"data-testid":"action-entity-edit",item:E(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Tt),{"auth-function":()=>e.canDelete(X)},{default:n.withCtx(()=>[n.createVNode(Pe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ve=>we(X)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("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","use-action-outside"]),n.createVNode(n.unref(Vf),{"action-pending":K.value,"entity-type":n.unref(Aa).CACertificate,error:U.value,title:n.unref(o)("ca-certificates.delete.title"),visible:$.value,onCancel:pe,onProceed:he},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f25a63b4"]]),tb={class:"kong-ui-entities-ca-certificates-form"},rb=Hr(n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var S;const r=t,i=e,o=Fr.useRouter(),{i18n:{t:s}}=gt.useI18n(),{getMessageFromError:a}=Pf(),{axiosInstance:c}=co({headers:(S=i.config)==null?void 0:S.requestHeaders}),l=n.computed(()=>Ni.form[i.config.app].edit),d=n.computed(()=>i.certificateId?ar.Edit:ar.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),A=n.computed(()=>(d.value===ar.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),b=v=>{var C;y.fields.cert=(v==null?void 0:v.cert)||"",y.fields.certDigest=(v==null?void 0:v.cert_digest)||"",y.fields.tags=((C=v==null?void 0:v.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},m=n.computed(()=>{var C,O;let v=`${i.config.apiBaseUrl}${Ni.form[i.config.app].validate}`;return i.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),v=v.replace(/{id}/gi,i.certificateId),v}),k=n.computed(()=>{var C,O;let v=`${i.config.apiBaseUrl}${Ni.form[i.config.app][d.value]}`;return i.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(O=i.config)!=null&&O.workspace?`/${i.config.workspace}`:"")),v=v.replace(/{id}/gi,i.certificateId),v}),g=async()=>{var v,C,O,F,Y,I,E;try{y.isReadonly=!0;const q={cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(v=y.fields.tags.split(","))==null?void 0:v.map(K=>String(K||"").trim()))==null?void 0:C.filter(K=>K!=="")};let $;await c.post(m.value,q),d.value==="create"?$=await c.post(k.value,q):d.value==="edit"&&($=((O=i.config)==null?void 0:O.app)==="konnect"?await c.put(k.value,q):await c.patch(k.value,q)),y.fields.cert=((F=$==null?void 0:$.data)==null?void 0:F.cert)||"",y.fields.certDigest=((Y=$==null?void 0:$.data)==null?void 0:Y.cert_digest)||"",y.fields.tags=((E=(I=$==null?void 0:$.data)==null?void 0:I.tags)==null?void 0:E.join(", "))||"",Object.assign(p,y.fields),r("update",$==null?void 0:$.data)}catch(q){y.errorMessage=a(q),r("error",q)}finally{y.isReadonly=!1}};return(v,C)=>{const O=n.resolveComponent("KTextArea"),F=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",tb,[n.createVNode(n.unref(_f),{"can-submit":A.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=Y=>v.$emit("error",Y)),"onFetch:success":b,onLoading:C[4]||(C[4]=Y=>v.$emit("loading",Y)),onSubmit:g},{default:n.withCtx(()=>[n.createVNode(n.unref(ao),{description:n.unref(s)("ca-certificates.form.sections.cert.description"),title:n.unref(s)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=Y=>y.fields.cert=Y),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(F,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=Y=>y.fields.certDigest=Y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(ao),{description:n.unref(s)("ca-certificates.form.sections.general.description"),title:n.unref(s)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(F,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=Y=>y.fields.tags=Y),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(s)("ca-certificates.form.fields.tags.help"),label:n.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-bad536b1"]]),ib={class:"kong-ui-certificate-entity-config-card"},nb={key:0},ob=Hr(n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=gt.useI18n(),{convertKeyToTitle:c}=Rf(),{getPropValue:l}=Uf(),{getCertificateData:d}=gt.useCertificate(),y=n.computed(()=>Ci.form[i.config.app].edit),p=n.ref(),A=n.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:se.Redacted},metadata:{section:fe.Basic,type:se.Json},snis:{section:fe.Basic,type:se.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:fe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:se.Redacted}}),b=I=>{p.value=I,r("fetch:success",I)},h=(I,E)=>{const q=l("rowValue",E);if(I==="expiry")return k.value;if(I==="key_usages")return C.value;if(I==="san_names")return S.value;if(q)return q[I]},m=n.computed(()=>{if(p.value)return d(p.value)}),k=n.computed(()=>{var I,E;return(I=m.value)!=null&&I.schemaExpiry?s((E=m.value)==null?void 0:E.schemaExpiry):""}),g=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaIssuer)||""}),S=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaSanNames)||""}),v=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaSubject)||""}),C=n.computed(()=>{var I;return((I=m.value)==null?void 0:I.schemaKeyUsages)||[]}),O=n.computed(()=>{var I,E;return((E=(I=p==null?void 0:p.value)==null?void 0:I.snis)==null?void 0:E.length)>0}),F=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),Y=I=>{var E,q;return I==="san_names"?o("certificates.list.table_headers.san"):((q=(E=A.value)==null?void 0:E[I])==null?void 0:q.label)||c(I)};return(I,E)=>{const q=n.resolveComponent("KCodeBlock"),$=n.resolveComponent("KLabel"),K=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",ib,[n.createVNode(n.unref(Of),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":A.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":E[0]||(E[0]=U=>I.$emit("copy:success",U)),"onFetch:error":E[1]||(E[1]=U=>I.$emit("fetch:error",U)),"onFetch:success":b,onLoading:E[2]||(E[2]=U=>I.$emit("loading",U))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(U=>[n.unref(l)("rowValue",U)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",U),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode($,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(U=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",U)),D=>(n.openBlock(),n.createBlock(n.unref(Si),{key:D,item:{key:D,value:h(D,U),label:Y(D),type:D==="key_usages"||D==="snis"||D==="dns_names"?n.unref(se).BadgeTag:n.unref(se).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[C.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",nb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value,(U,D)=>(n.openBlock(),n.createBlock(K,{key:`key_usages-badge-tag-${D}`,class:"config-badge","data-testid":`key_usages-badge-tag-${D}`,tooltip:U,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(U),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[O.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},F.value?{name:"cert_alt",fn:n.withCtx(U=>[n.createTextVNode(" > "),n.unref(l)("rowValue",U)?(n.openBlock(),n.createBlock(q,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",U),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-920043bf"]]);Ve.CACertificateConfigCard=G1,Ve.CACertificateForm=rb,Ve.CACertificateList=eb,Ve.CertificateConfigCard=ob,Ve.CertificateForm=q1,Ve.CertificateList=H1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`+e.slice(a+1):l+=e.slice(o),l.slice(1)}function C0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Ti(e,o),i=Ue[r],!i&&_i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||p0(r);return t}function S0(e,t,r){var i="",o=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(jt(e,t,c,!1,!1)||typeof c>"u"&&jt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Df(e,t,r,i){var o="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(jt(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&jt(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=qa(e,t)),e.dump&&Ni===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function x0(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,c,l,d,y;for(a=0,c=s.length;a<c;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),jt(e,t,l,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),jt(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=o,e.dump="{"+i+"}"}function A0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,y,p,B;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Fe("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)B="",(!i||o!=="")&&(B+=qa(e,t)),d=a[c],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),jt(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ni===e.dump.charCodeAt(0)?B+="?":B+="? "),B+=e.dump,p&&(B+=qa(e,t)),jt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?B+=":":B+=": ",B+=e.dump,o+=B));e.tag=s,e.dump=o||"{}"}function $f(e,t,r){var i,o,s,a,c,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(c=o[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,bf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(wf.call(c.represent,l))i=c.represent[l](t,l);else throw new Fe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function jt(e,t,r,i,o,s,a){e.tag=null,e.dump=r,$f(e,r,!1)||$f(e,r,!0);var c=bf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[object Array]",p,B;if(y&&(p=e.duplicates.indexOf(r),B=p!==-1),(e.tag!==null&&e.tag!=="?"||B||e.indent!==2&&t>0)&&(o=!1),B&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&B&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(A0(e,t,e.dump,o),B&&(e.dump="&ref_"+p+e.dump)):(x0(e,t,e.dump),B&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Df(e,t-1,e.dump,o):Df(e,t,e.dump,o),B&&(e.dump="&ref_"+p+e.dump)):(S0(e,t,e.dump),B&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&v0(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Fe("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function B0(e,t){var r=[],i=[],o,s;for(za(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function za(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)za(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)za(e[i[o]],t,r)}function I0(e,t){t=t||{};var r=new y0(t);r.noRefs||B0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),jt(r,0,i,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var E0=I0,N0={dump:E0};function Ga(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var O0=$e,_0=Md,T0=Ld,V0=zd,j0=Gd,D0=Pa,$0=mf.load,M0=mf.loadAll,P0=N0.dump,R0=Fe,U0={binary:Qd,float:Kd,map:Ud,null:Hd,pairs:ef,set:tf,timestamp:Yd,bool:Fd,int:qd,merge:Zd,omap:Xd,seq:Rd,str:Pd},L0=Ga("safeLoad","load"),H0=Ga("safeLoadAll","loadAll"),F0=Ga("safeDump","dump"),q0={Type:O0,Schema:_0,FAILSAFE_SCHEMA:T0,JSON_SCHEMA:V0,CORE_SCHEMA:j0,DEFAULT_SCHEMA:D0,load:$0,loadAll:M0,dump:P0,YAMLException:R0,types:U0,safeLoad:L0,safeLoadAll:H0,safeDump:F0};const K0={key:0,class:"config-card-display-form"},z0=["data-testid"],G0={key:0,class:"config-card-prop-section-title"},W0={key:1,class:"config-card-display-json"},J0={key:0,class:"config-card-display-json-endpoint"},Y0={key:2,class:"config-card-display-yaml"},Z0=n.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null},fetcherUrl:{type:String,required:!0}},setup(e){n.useCssVars(l=>({"7b486894":`${c.value}ch`}));const t=e,r=n.useSlots(),{i18n:{t:i}}=Te.useI18n(),o=l=>!!(l.tooltip||r[`${l.key}-label-tooltip`]),s=n.ref(""),a=n.ref(""),c=n.computed(()=>{var l;if(!t.fetcherUrl)return 0;const d=(l=t.fetcherUrl)==null?void 0:l.split("/");return d.length<2?0:41+d[d.length-2].length});return n.watch(()=>t.format,l=>{if(l!=="structured"){const d=JSON.parse(JSON.stringify(t.record));delete d.created_at,delete d.updated_at,l==="json"?s.value=JSON.stringify(d,null,2):l==="yaml"&&(a.value=q0.dump(d))}},{immediate:!0}),(l,d)=>{const y=n.resolveComponent("KBadge"),p=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",K0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,B=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${B}-props`,class:n.normalizeClass(`config-card-details-${B}-props`),"data-testid":`config-card-details-${B}-props`},[B!=="basic"?(n.openBlock(),n.createElementBlock("div",G0,n.toDisplayString(B==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[B],b=>(n.openBlock(),n.createBlock(Ii,{key:b.key,item:b},n.createSlots({label:n.withCtx(()=>[n.renderSlot(l.$slots,`${b.key}-label`,{row:b},void 0,!0)]),[b.key]:n.withCtx(({rowValue:h})=>[n.renderSlot(l.$slots,b.key,{row:b,rowValue:h},void 0,!0)]),_:2},[o(b)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(l.$slots,`${b.key}-label-tooltip`,{row:b},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,z0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",W0,[t.fetcherUrl?(n.openBlock(),n.createElementBlock("div",J0,[n.createVNode(y,{appearance:"get"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("baseConfigCard.endpoints.get")),1)]),_:1}),n.createVNode(p,{id:"config-card-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),n.createVNode(p,{id:"config-card-codeblock",class:n.normalizeClass({"config-card-display-json-content":t.fetcherUrl}),code:s.value,language:"json",theme:"dark"},null,8,["class","code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",Y0,[n.createVNode(p,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),Q0=dt(Z0,[["__scopeId","data-v-27f85338"]]),Mf="24px",X0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},e1=e=>(n.pushScopeId("data-v-84d5ee61"),e=e(),n.popScopeId(),e),t1=["aria-hidden"],r1={key:0,"data-testid":"kui-icon-svg-title"},i1=e1(()=>n.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),n1=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Mf,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Mf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",r1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),i1],8,t1))]),_:1},8,["aria-hidden","style"]))}}),o1=X0(n1,[["__scopeId","data-v-84d5ee61"]]),s1={"data-testid":"config-card-title"},a1={class:"config-card-actions"},c1=["href"],l1={key:2,class:"config-card-details-section"},u1={key:3,class:"config-card-details-section"},d1=["data-testid"],f1={key:0,class:"config-card-prop-section-title"},p1=n.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.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},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=t,o=e,s=n.useSlots(),{i18n:{t:a}}=Te.useI18n(),{getMessageFromError:c}=Te.useErrors(),{convertKeyToTitle:l}=Te.useStringHelpers(),{axiosInstance:d}=Te.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),y=[{label:a("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),B=O=>{p.value=O==null?void 0:O.value},b={id:{type:le.ID,label:a("baseConfigCard.commonFields.id_label"),order:0,section:pe.Basic},name:{order:1,section:pe.Basic},enabled:{type:le.BadgeStatus,order:2,section:pe.Basic},updated_at:{type:le.Date,label:a("baseConfigCard.commonFields.updated_at_label"),order:3,section:pe.Basic},created_at:{type:le.Date,label:a("baseConfigCard.commonFields.created_at_label"),order:4,section:pe.Basic},tags:{type:le.BadgeTag,order:-1,section:pe.Basic}},h=n.ref(!1),g=n.ref(!1),k=n.ref(""),m=n.ref(),x=n.computed(()=>{var O,G,M;if(!m.value)return[];const Z=[],H=Object.keys(m.value).length;for(const P in m.value){const se=(G=(O=o.configSchema)==null?void 0:O[P])==null?void 0:G.order,fe=(M=b[P])==null?void 0:M.order;let ke=H;(fe||fe===0)&&(ke=fe===-1?H+1:fe),se&&(ke=se===-1?H+1:se),Z.push([P,ke])}return Z.sort(function(P,se){return P[1]-se[1]}),Z.map(P=>{var se,fe;const ke=P[0],he=(se=m.value)==null?void 0:se[ke],ye=((fe=o.configSchema)==null?void 0:fe[ke])||{},Be=b[ke];return{key:ke,value:he,hidden:ye.hidden||!1,type:ye.type??((Be==null?void 0:Be.type)||le.Text),label:ye.label??((Be==null?void 0:Be.label)||l(ke)),tooltip:ye.tooltip??((Be==null?void 0:Be.tooltip)||void 0),section:ye.section??((Be==null?void 0:Be.section)||pe.Advanced)}}).filter(P=>!P.hidden&&P.key!==o.pluginConfigKey)}),v=n.computed(()=>{var O,G;if(!m.value||!o.pluginConfigKey)return[];const M=m.value[o.pluginConfigKey]||{},Z=Object.keys(M).length,H=[];for(const P in M){const se=(G=(O=o.pluginConfigSchema)==null?void 0:O[P])==null?void 0:G.order,fe=M[P];let ke=fe!=null&&fe!==""?Z-1:Z;se&&(ke=se===-1?Z+1:se),H.push([P,ke])}return H.sort(function(P,se){return P[1]-se[1]}),H.map(P=>{var se;const fe=P[0],ke=M[fe],he=((se=o.pluginConfigSchema)==null?void 0:se[fe])||{};return{key:fe,value:ke,hidden:he.hidden||!1,type:he.type??le.Text,label:he.label??l(fe),tooltip:he.tooltip??void 0,section:pe.Plugin}}).filter(P=>!P.hidden)}),C=n.computed(()=>{var O,G,M,Z;return{basic:(O=x.value)==null?void 0:O.filter(H=>H.section===pe.Basic),advanced:(G=x.value)==null?void 0:G.filter(H=>H.section===pe.Advanced),plugin:(Z=v.value)==null?void 0:Z.concat((M=x.value)==null?void 0:M.filter(H=>H.section===pe.Plugin))}}),_=n.computed(()=>{const O=[];return C.value.basic.length&&O.push("basic"),C.value.advanced.length&&O.push("advanced"),C.value.plugin.length&&O.push("plugin"),O}),z=O=>!!(O.tooltip||s[`${O.key}-label-tooltip`]),re=n.computed(()=>{var O,G;let M=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?M=M.replace(/{controlPlaneId}/gi,((O=o.config)==null?void 0:O.controlPlaneId)||""):o.config.app==="kongManager"&&(M=M.replace(/\/{workspace}/gi,(G=o.config)!=null&&G.workspace?`/${o.config.workspace}`:"")),M=M.replace(/{id}/gi,o.config.entityId),M}),E=O=>{m.value&&O(JSON.stringify(m.value))?i("copy:success",m.value):i("copy:error")};return n.watch(h,O=>{i("loading",O)},{immediate:!0}),n.onBeforeMount(async()=>{g.value=!1,h.value=!0;try{const{data:O}=await d.get(re.value);if(o.dataKey)if(typeof O[o.dataKey]<"u")m.value={...O[o.dataKey]};else throw new Error(a("errors.dataKeyUndefined",{dataKey:o.dataKey}));else m.value={...O};Object.keys(o.configSchema).filter(G=>o.configSchema[G].forceShow).forEach(G=>{m.value&&typeof m.value[G]>"u"&&(m.value[G]=null)}),i("fetch:success",O)}catch(O){const G=c(O);k.value=G.startsWith("code")?a("baseConfigCard.errors.load"):G,g.value=!0,i("fetch:error",O)}finally{h.value=!1}}),(O,G)=>{const M=n.resolveComponent("KLabel"),Z=n.resolveComponent("KSelect"),H=n.resolveComponent("KButton"),P=n.resolveComponent("KClipboardProvider"),se=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),ke=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(ke,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",a1,[n.renderSlot(O.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(M,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(Z,{key:1,appearance:"select","data-testid":"select-config-format",items:y,onChange:B})):n.createCommentVNode("",!0),o.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(H,{key:2,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(o1),{size:n.unref(fg)},null,8,["size"])],8,c1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(P,{key:3},{default:n.withCtx(({copyToClipboard:he})=>[!h.value&&!g.value?(n.openBlock(),n.createBlock(H,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:ye=>E(he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),default:n.withCtx(()=>[h.value?(n.openBlock(),n.createBlock(se,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):g.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(k.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",l1,[n.createVNode(Q0,{"fetcher-url":re.value,format:p.value,"prop-list-types":_.value,"property-collections":C.value,record:m.value},n.createSlots({_:2},[n.renderList(Object.keys(O.$slots),he=>({name:he,fn:n.withCtx(({row:ye,rowValue:Be})=>[n.renderSlot(O.$slots,he,{row:ye,rowValue:Be},void 0,!0)])}))]),1032,["fetcher-url","format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",u1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.value,he=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${he}-props`,class:n.normalizeClass(`config-card-details-${he}-props`),"data-testid":`config-card-details-${he}-props`},[he!=="basic"?(n.openBlock(),n.createElementBlock("div",f1,n.toDisplayString(he==="advanced"?n.unref(a)("baseConfigCard.sections.advanced"):n.unref(a)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value[he],ye=>(n.openBlock(),n.createBlock(Ii,{key:ye.key,item:ye},n.createSlots({label:n.withCtx(()=>[n.renderSlot(O.$slots,`${ye.key}-label`,{row:ye},void 0,!0)]),[ye.key]:n.withCtx(({rowValue:Be})=>[n.renderSlot(O.$slots,ye.key,{row:ye,rowValue:Be},void 0,!0)]),_:2},[z(ye)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(O.$slots,`${ye.key}-label-tooltip`,{row:ye},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,d1))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",s1,[n.renderSlot(O.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Pf=dt(p1,[["__scopeId","data-v-4f47d6ad"]]),h1={class:"form-actions","data-testid":"form-actions"},y1=n.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.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(e,{emit:t}){var r;const i=t,o=e,s=Gr.useRouter(),{i18n:{t:a}}=Te.useI18n(),{getMessageFromError:c}=Te.useErrors(),{axiosInstance:l}=Te.useAxios({headers:(r=o.config)==null?void 0:r.requestHeaders}),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),B=n.computed(()=>o.canSubmit===!1||o.isReadonly),b=n.computed(()=>{var m,x;if(!o.editId)return"";let v=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((m=o.config)==null?void 0:m.controlPlaneId)||""):o.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(x=o.config)!=null&&x.workspace?`/${o.config.workspace}`:"")),v=v.replace(/{id}/gi,o.editId),v}),h=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):g()},g=()=>{i("cancel")},k=()=>{B.value||i("submit")};return n.watch(()=>d.value,m=>{i("loading",m)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:m}=await l.get(b.value);i("fetch:success",m)}catch(m){const x=c(m);p.value=x.startsWith("code")?a("baseForm.errors.edit"):x,y.value=!0,i("fetch:error",m)}finally{d.value=!1}}),(m,x)=>{const v=n.resolveComponent("KSkeleton"),C=n.resolveComponent("KEmptyState"),_=n.resolveComponent("KAlert"),z=n.resolveComponent("KButton"),re=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(re,{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(v,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(C,{key:1,"cta-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":h,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(g,["prevent"]),onSubmit:n.withModifiers(k,["prevent"])},[n.renderSlot(m.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(_,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",h1,[n.renderSlot(m.$slots,"form-actions",{},()=>[n.createVNode(z,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(z,{appearance:"primary","data-testid":"form-submit",disabled:B.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32))]),_:3})}}}),Rf=dt(y1,[["__scopeId","data-v-448d8512"]]),g1={key:0,"data-testid":"first-col"},m1=n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),o=n.computed(()=>{var g,k;const m=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return m?((k=m[0])==null?void 0:k.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,k,m;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((k=r.value)==null?void 0:k.clientWidth)||0,p.value=((m=l.value)==null?void 0:m.innerText)||""},l=n.ref({}),d=n.ref(0),y=n.ref(0),p=n.ref(""),B=n.computed(()=>[i.value,r.value]),b=n.watch(B,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(k=>{window.requestAnimationFrame(()=>{!Array.isArray(k)||!k.length||c()})});for(const k of g)k&&s.observe(k)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>y.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{b()}),(g,k)=>{const m=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",g1,[n.createVNode(m,{label:h.value?p.value:"","max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),b1=dt(m1,[["__scopeId","data-v-e42a20c9"]]),w1={class:"toolbar-container"},v1={key:0,class:"toolbar-button-container"},k1=["data-testid"],C1=n.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,Object],default:null},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:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:t}){const r=e,i=t,{i18n:{t:o}}=Te.useI18n(),s=n.computed(()=>{var _,z;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(_=r.errorMessage)==null?void 0:_.title,message:(z=r.errorMessage)==null?void 0:z.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=_=>_.hasData||!!r.query,l=n.computed(()=>{const _=[];return Object.keys(r.tableHeaders).forEach(z=>{const re=r.tableHeaders[z];_.push({label:re.label??z,key:z,sortable:re.sortable??!1})}),r.enableEntityActions&&_.push({key:"actions",hideLabel:!0}),_}),d=_=>({"data-rowid":_.id,"data-testid":_.name,...r.rowAttributes(_)}),y=n.ref({}),p=_=>{var z;return(z=y.value)==null?void 0:z.$el.querySelector(`[data-rowid="${_.id}"]`)},B=_=>{const z={"data-testid":_.headerKey,...r.cellAttributes(_)};return _.colIndex===0&&(z.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),z},b=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=n.computed(()=>r.disableRowClick?void 0:(_,z)=>{i("click:row",z)}),k=_=>{i("sort",_)},{setTablePreferences:m,getTablePreferences:x}=my(),v=n.computed(()=>{const _=x(r.preferencesStorageKey);return{...r.initialFetcherParams,..._}}),C=_=>{r.preferencesStorageKey&&m(r.preferencesStorageKey,_)};return(_,z)=>{const re=n.resolveComponent("KIcon"),E=n.resolveComponent("KButton"),O=n.resolveComponent("KDropdown"),G=n.resolveComponent("KTable"),M=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(M,{class:"kong-ui-entity-base-table",title:e.title},{default:n.withCtx(()=>[n.createVNode(G,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":B,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:b,"onRow:click":g.value,onSort:z[0]||(z[0]=Z=>k(Z)),"onUpdate:tablePreferences":C},n.createSlots({toolbar:n.withCtx(({state:Z})=>[n.withDirectives(n.createElementVNode("div",w1,[n.renderSlot(_.$slots,"toolbar-filter",{},void 0,!0),_.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",v1,[n.renderSlot(_.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,c(Z)]])]),actions:n.withCtx(({row:Z,rowKey:H,rowValue:P})=>[n.createElementVNode("div",{class:"actions-container","data-testid":Z.name},[n.createVNode(O,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(_.$slots,"actions",{row:Z,rowKey:H,rowValue:P},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(E,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(re,{color:n.unref(ug),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,k1)]),_:2},[n.renderList(e.tableHeaders,(Z,H)=>({name:H,fn:n.withCtx(({row:P,rowKey:se,rowValue:fe})=>[n.createVNode(b1,{"key-name":String(H),"row-el":p(P)},{default:n.withCtx(()=>[n.renderSlot(_.$slots,H,{row:P,rowKey:se,rowValue:fe},()=>[n.createTextVNode(n.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-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),Uf=dt(C1,[["__scopeId","data-v-57b5a97b"]]),S1={key:0,class:"kong-ui-entity-delete-error"},x1={key:1,class:"description"},A1=n.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(e,{emit:t}){const{i18nT:r}=Te.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},c=()=>{o("proceed")};return(l,d)=>{const y=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":s.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:a,onProceed:c},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",S1,[n.createVNode(y,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(n.openBlock(),n.createElementBlock("div",x1,[n.renderSlot(l.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),Lf=dt(A1,[["__scopeId","data-v-1c9a2a07"]]),B1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},I1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},E1=["fill"],N1={mask:"url(#mask0_180_20349)"},O1=["fill"],Hf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${cg})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",B1,[n.createElementVNode("mask",I1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,E1)]),n.createElementVNode("g",N1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,O1)])]))}}),_1={key:1,class:"kong-ui-entity-filter"},T1={class:"menu-item-title"},V1={class:"menu-item-indicator"},j1={class:"menu-item-body"},D1=["for"],$1={class:"menu-item-buttons"},M1={class:"filter-clear-button-container"},P1=n.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const{i18n:{t:r}}=Te.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),c=n.computed(()=>{const m=[];return new URLSearchParams(i.modelValue).forEach((x,v)=>{x!==""&&m.push(v)}),m}),l=n.computed(()=>{const m=i.config.fields;return Object.keys(m).filter(x=>m[x].searchable).map(x=>({label:m[x].label||x,value:x}))});n.watch(()=>i.modelValue,m=>{a.value={},new URLSearchParams(m).forEach((x,v)=>{a.value[v]=x})});const d=()=>{s.value=!s.value},y=m=>{o("update:modelValue",m)},p=m=>`filter-${m}`,B=m=>{var x,v;return(((v=(x=i.config.schema)==null?void 0:x[m])==null?void 0:v.values)??[]).map(C=>({value:C,label:C}))},b=m=>{var x,v;return((v=(x=i.config.schema)==null?void 0:x[m])==null?void 0:v.type)??"text"},h=m=>{a.value={...a.value,[m]:""},k()},g=()=>{a.value={},k(!0)},k=(m=!1)=>{const x=Object.keys(a.value).reduce((v,C)=>(a.value[C]&&(v[C]=`${a.value[C]}`),v),{});m&&(s.value=!1),o("update:modelValue",new URLSearchParams(x).toString())};return(m,x)=>{const v=n.resolveComponent("KInput"),C=n.resolveComponent("KButton"),_=n.resolveComponent("KSelect"),z=n.resolveComponent("KMenuItem"),re=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(v,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:n.withCtx(()=>[n.createVNode(Hf)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",_1,[n.createVNode(C,{appearance:"tertiary","data-testid":"filter-button",onClick:d},{default:n.withCtx(()=>[n.createVNode(Hf),n.createTextVNode(" "+n.toDisplayString(n.unref(r)("filter.filterButtonText"))+" "+n.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:d},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createVNode(re,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(E,O)=>(n.openBlock(),n.createBlock(z,{key:E.value,"data-testid":E.value,expandable:"","last-menu-item":O===l.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",T1,[n.createTextVNode(n.toDisplayString(E.label)+" ",1),n.withDirectives(n.createElementVNode("span",V1,null,512),[[n.vShow,c.value.includes(E.value)]])])]),itemBody:n.withCtx(()=>{var G,M;return[n.createElementVNode("div",j1,[n.createElementVNode("label",{class:"menu-item-label",for:p(E.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,D1),((M=(G=e.config.schema)==null?void 0:G[E.value])==null?void 0:M.type)==="select"?(n.openBlock(),n.createBlock(_,{key:0,id:p(E.value),modelValue:a.value[E.value],"onUpdate:modelValue":Z=>a.value[E.value]=Z,appearance:"select",items:B(E.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(v,{key:1,id:p(E.value),modelValue:a.value[E.value],"onUpdate:modelValue":Z=>a.value[E.value]=Z,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:b(E.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",$1,[n.createVNode(C,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:x[0]||(x[0]=Z=>k(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(C,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:Z=>h(E.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createElementVNode("div",M1,[n.createVNode(C,{appearance:"tertiary",size:"small",onClick:g},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[n.vShow,s.value]])]))}}}),Ff=dt(P1,[["__scopeId","data-v-15962ee2"]]),Dt=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),R1={class:"form-section-wrapper"},U1={key:0,class:"form-section-title"},L1={key:1,class:"form-section-description"},H1={key:2,class:"form-section-footer"},F1={class:"form-section-content"},q1=n.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(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",R1,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",U1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",L1,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",H1,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",F1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),po=dt(q1,[["__scopeId","data-v-3565daa7"]]),{useAxios:ho,useDeleteUrlBuilder:qf,useErrors:Kf,useExternalLinkCreator:Tb,useFetchUrlBuilder:Vb,useFetcher:zf,useDebouncedFilter:jb,useStringHelpers:Gf,useHelpers:Wf,useGatewayFeatureSupported:Db,useTruncationDetector:$b}=Te,K1={class:"kong-ui-entities-certificates-list"},z1={key:0},G1={key:1},W1={key:0},J1={key:1},Y1={key:0},Z1={key:1},Q1={key:1},X1={key:1},eb=n.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var ge;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(ge=i.config)==null?void 0:ge.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),B={subject:{label:o("certificates.list.table_headers.subject")},expiry:{label:o("certificates.list.table_headers.expiry")},san:{label:o("certificates.list.table_headers.san")},cert:{label:o("certificates.list.table_headers.cert")},tags:{label:o("certificates.list.table_headers.tags"),sortable:!0}},b=n.computed(()=>{var ae,me;let V=`${i.config.apiBaseUrl}${Bi.list[i.config.app]}`;return i.config.app==="konnect"?V=V.replace(/{controlPlaneId}/gi,((ae=i.config)==null?void 0:ae.controlPlaneId)||""):i.config.app==="kongManager"&&(V=V.replace(/\/{workspace}/gi,(me=i.config)!=null&&me.workspace?`/${i.config.workspace}`:"")),V}),h=n.ref(""),g=n.computed(()=>{const V=i.config.app==="konnect"||i.config.isExactMatch;return V?{isExactMatch:V,placeholder:o("certificates.search.placeholder")}:{isExactMatch:V,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:m}=zf(i.config,b.value),x=()=>{h.value=""},v=()=>{d.value++},C=n.ref(null),_=(V,ae)=>{const me=V.id;if(!ae(me)){r("copy:error",{entity:V,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:V,field:"id",message:o("certificates.copy.success",{val:me})})},z=(V,ae)=>{const me=JSON.stringify(V);if(!ae(me)){r("copy:error",{entity:V,message:o("certificates.errors.copy")});return}r("copy:success",{entity:V,message:o("certificates.copy.success_brief")})},re=(V,ae)=>{V.type==="error"?r("copy:error",{entity:ae,field:"cert",message:o("certificates.errors.copy")}):r("copy:success",{entity:ae,field:"cert",message:o("certificates.copy.success_brief")})},E=async V=>{var me;await((me=i.canRetrieve)==null?void 0:me.call(i,V))&&c.push(i.config.getViewRoute(V.id))},O=V=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(V)}),G=V=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(V)}),M=V=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(V)}},Z=n.ref(void 0),H=n.ref(!1),P=n.ref(!1),se=n.ref(""),fe=qf(i.config,b.value),{certificateDataCache:ke,getCertificateData:he}=kt.useCertificate(),ye=V=>{Z.value=V,H.value=!0},Be=()=>{H.value=!1},zt=async()=>{var V,ae,me;if((V=Z.value)!=null&&V.id){P.value=!0;try{await l.delete(fe(Z.value.id)),P.value=!1,H.value=!1,d.value++,r("delete:success",Z.value)}catch(Me){se.value=((me=(ae=Me.response)==null?void 0:ae.data)==null?void 0:me.message)||Me.message||o("certificates.errors.delete"),r("error",Me)}finally{P.value=!1}}},X=n.ref(!0);n.watch(m,V=>{var ae,me,Me,$t;if(Array.isArray((ae=V==null?void 0:V.response)==null?void 0:ae.data)&&(X.value=V.response.data.length>0),V.status===Ft.Error){C.value={title:o("certificates.errors.general")},($t=(Me=(me=V.error)==null?void 0:me.response)==null?void 0:Me.data)!=null&&$t.message&&(C.value.message=V.error.response.data.message),r("error",V.error);return}ke.value={},C.value=null});const ee=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("certificates.list.empty_state.description"),title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(ee.value.title=o("certificates.list.empty_state.title"),ee.value.ctaText=o("certificates.actions.create"))}),(V,ae)=>{const me=n.resolveComponent("KButton"),Me=n.resolveComponent("KBadge"),$t=n.resolveComponent("KTruncate"),te=n.resolveComponent("KDropdownItem"),Oe=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",K1,[n.createVNode(n.unref(Uf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":ee.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(B),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":ae[2]||(ae[2]=J=>E(J)),onSort:v},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Ff),{modelValue:h.value,"onUpdate:modelValue":ae[0]||(ae[0]=J=>h.value=J),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Dt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(me,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,X.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:n.withCtx(({row:J})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",z1,n.toDisplayString((Ce=J==null?void 0:J.metadata)!=null&&Ce.subject?J.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",G1,n.toDisplayString(n.unref(he)(J).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:J})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",W1,n.toDisplayString((Ce=J==null?void 0:J.metadata)!=null&&Ce.expiry?n.unref(s)(J.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",J1,n.toDisplayString(n.unref(he)(J).schemaExpiry?n.unref(s)(n.unref(he)(J).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:J})=>{var Ce;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",Y1,n.toDisplayString((Ce=J==null?void 0:J.metadata)!=null&&Ce.dns_names?`dns=${J.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",Z1,n.toDisplayString(n.unref(he)(J).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:J})=>[J!=null&&J.cert?(n.openBlock(),n.createBlock(n.unref(hy),{key:0,"data-testid":"copy-certificate-cert",notify:Ce=>re(Ce,J),truncated:!0,uuid:J.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",Q1,"-"))]),tags:n.withCtx(({row:J})=>{var Ce;return[((Ce=J==null?void 0:J.tags)==null?void 0:Ce.length)>0?(n.openBlock(),n.createBlock($t,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(J==null?void 0:J.tags,zr=>(n.openBlock(),n.createBlock(Me,{key:zr,onClick:ae[1]||(ae[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",X1,"-"))]}),actions:n.withCtx(({row:J})=>[n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>_(J,Ce)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Oe,null,{default:n.withCtx(({copyToClipboard:Ce})=>[n.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:zr=>z(J,Ce)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canRetrieve(J)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:O(J.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(J)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-edit",item:G(J.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Dt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-add-sni",item:M(J.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(J)},{default:n.withCtx(()=>[n.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Ce=>ye(J)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("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","use-action-outside"]),n.createVNode(n.unref(Lf),{"action-pending":P.value,"entity-type":n.unref(Oa).Certificate,error:se.value,title:n.unref(o)("certificates.delete.title"),visible:H.value,onCancel:Be,onProceed:zt},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Kr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},tb=Kr(eb,[["__scopeId","data-v-fa23e672"]]),rb={class:"kong-ui-entities-certificates-form"},ib=Kr(n.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var v;const r=t,i=e,o=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=kt.useI18n(),{getMessageFromError:c}=Kf(),{axiosInstance:l}=ho({headers:(v=i.config)==null?void 0:v.requestHeaders}),d=n.computed(()=>Bi.form[i.config.app].edit),y=n.computed(()=>i.certificateId?dr.Edit:dr.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),B=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),b=n.computed(()=>(y.value===dr.Create||JSON.stringify(p.fields)!==JSON.stringify(B))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var _;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((_=C==null?void 0:C.tags)==null?void 0:_.join(", "))||"",Object.assign(B,p.fields)},g=()=>{o.push(i.config.cancelRoute)},k=n.computed(()=>{var _,z;let C=`${i.config.apiBaseUrl}${Bi.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((_=i.config)==null?void 0:_.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(z=i.config)!=null&&z.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),m=n.computed(()=>{var _,z;let C=`${i.config.apiBaseUrl}${Bi.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((_=i.config)==null?void 0:_.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(z=i.config)!=null&&z.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),x=async()=>{var C,_,z,re,E,O,G,M,Z;try{p.isReadonly=!0;const H={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(_=(C=p.fields.tags.split(","))==null?void 0:C.map(se=>String(se||"").trim()))==null?void 0:_.filter(se=>se!=="")};let P;await l.post(k.value,H),y.value==="create"?P=await l.post(m.value,H):y.value==="edit"&&(P=((z=i.config)==null?void 0:z.app)==="konnect"?await l.put(m.value,H):await l.patch(m.value,H)),p.fields.cert=((re=P==null?void 0:P.data)==null?void 0:re.cert)||"",p.fields.key=((E=P==null?void 0:P.data)==null?void 0:E.key)||"",p.fields.certAlt=((O=P==null?void 0:P.data)==null?void 0:O.cert_alt)||"",p.fields.keyAlt=((G=P==null?void 0:P.data)==null?void 0:G.key_alt)||"",p.fields.tags=((Z=(M=P==null?void 0:P.data)==null?void 0:M.tags)==null?void 0:Z.join(", "))||"",Object.assign(B,p.fields),r("update",P==null?void 0:P.data)}catch(H){p.errorMessage=c(H),r("error",H)}finally{p.isReadonly=!1}};return(C,_)=>{const z=n.resolveComponent("KTextArea"),re=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",rb,[n.createVNode(n.unref(Rf),{"can-submit":b.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":_[5]||(_[5]=E=>C.$emit("error",E)),"onFetch:success":h,onLoading:_[6]||(_[6]=E=>C.$emit("loading",E)),onSubmit:x},{default:n.withCtx(()=>[n.createVNode(n.unref(po),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(z,{modelValue:p.fields.cert,"onUpdate:modelValue":_[0]||(_[0]=E=>p.fields.cert=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:n.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(z,{modelValue:p.fields.key,"onUpdate:modelValue":_[1]||(_[1]=E=>p.fields.key=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:n.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(z,{modelValue:p.fields.certAlt,"onUpdate:modelValue":_[2]||(_[2]=E=>p.fields.certAlt=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:n.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(z,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":_[3]||(_[3]=E=>p.fields.keyAlt=E),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:n.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(po),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(re,{modelValue:p.fields.tags,"onUpdate:modelValue":_[4]||(_[4]=E=>p.fields.tags=E),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(a)("certificates.form.fields.tags.help"),label:n.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(a)("certificates.form.fields.tags.placeholder"),readonly:p.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"])])}}}),[["__scopeId","data-v-f66bc18c"]]),Vi={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"}}},nb={class:"kong-ui-ca-certificate-entity-config-card"},ob={key:0},sb=Kr(n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=kt.useI18n(),{convertKeyToTitle:c}=Gf(),{getPropValue:l}=Wf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Vi.form[o.config.app].edit),p=n.ref(),B=n.computed(()=>{if(p.value)return d(p.value)}),b=n.computed(()=>{var v;return((v=B.value)==null?void 0:v.schemaIssuer)||""}),h=n.computed(()=>{var v,C;return(v=B.value)!=null&&v.schemaExpiry?a((C=B.value)==null?void 0:C.schemaExpiry):""}),g=n.computed(()=>{var v;return((v=B.value)==null?void 0:v.schemaKeyUsages)||[]}),k=(v,C)=>{const _=l("rowValue",C);if(v==="expiry")return h.value;if(v==="key_usages")return g.value;if(_)return _[v]},m=v=>{p.value=v,i("fetch:success",v)},x=n.ref({id:{},updated_at:{},created_at:{},cert:{section:pe.Basic,label:s("ca-certificates.form.fields.cert.label"),tooltip:s("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:pe.Basic,label:s("ca-certificates.form.fields.cert_digest.label"),tooltip:s("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:pe.Basic,type:le.Json,order:7},...o.config.app==="kongManager"&&{expiry:{label:s("certificates.list.table_headers.expiry"),section:pe.Basic,order:1.7,forceShow:!0},issuer:{section:pe.Basic,order:1.5,forceShow:!0},key_usages:{section:pe.Basic,forceShow:!0}},tags:{tooltip:s("ca-certificates.form.fields.tags.tooltip")}});return(v,C)=>{const _=n.resolveComponent("KCodeBlock"),z=n.resolveComponent("KLabel"),re=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",nb,[n.createVNode(n.unref(Pf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":C[0]||(C[0]=E=>v.$emit("copy:success",E)),"onFetch:error":C[1]||(C[1]=E=>v.$emit("fetch:error",E)),"onFetch:success":m,onLoading:C[2]||(C[2]=E=>v.$emit("loading",E))},{cert:n.withCtx(E=>[n.unref(l)("rowValue",E)?(n.openBlock(),n.createBlock(_,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",E),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(z,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(E=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",E)).filter(O=>!r.includes(O)),O=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:O,"data-testid":`ca-cert-metadata-${O}`,item:{key:O,label:n.unref(c)(O),value:k(O,E),type:O==="key_usages"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),key_usages:n.withCtx(()=>[g.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",ob,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(E,O)=>(n.openBlock(),n.createBlock(re,{key:`key_usages-badge-tag-${O}`,class:"config-badge","data-testid":`key_usages-badge-tag-${O}`,tooltip:E,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(E),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-a184a0cf"]]),ab={class:"kong-ui-entities-ca-certificates-list"},cb={key:0},lb={key:1},ub={key:0},db={key:1},fb={key:1},pb=Kr(n.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var X;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=ho({headers:(X=i.config)==null?void 0:X.requestHeaders}),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),B={issuer:{label:o("ca-certificates.list.table_headers.issuer")},expiry:{label:o("ca-certificates.list.table_headers.expiry")},tags:{label:o("ca-certificates.list.table_headers.tags"),sortable:!0}},b=n.computed(()=>{var ge,V;let ee=`${i.config.apiBaseUrl}${Vi.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((ge=i.config)==null?void 0:ge.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(V=i.config)!=null&&V.workspace?`/${i.config.workspace}`:"")),ee}),h=n.ref(""),g=n.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:o("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:k,fetcherState:m}=zf(i.config,b.value),x=()=>{h.value=""},v=()=>{d.value++},C=n.ref(null),_=(ee,ge)=>{const V=ee.id;if(!ge(V)){r("copy:error",{entity:ee,field:"id",message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:o("ca-certificates.copy.success",{val:V})})},z=(ee,ge)=>{const V=JSON.stringify(ee);if(!ge(V)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},re=async ee=>{var V;await((V=i.canRetrieve)==null?void 0:V.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},E=ee=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),O=ee=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),G=n.ref(void 0),M=n.ref(!1),Z=n.ref(!1),H=n.ref(""),P=qf(i.config,b.value),{certificateDataCache:se,getCertificateData:fe}=kt.useCertificate(),ke=ee=>{G.value=ee,M.value=!0},he=()=>{M.value=!1},ye=async()=>{var ee,ge,V;if((ee=G.value)!=null&&ee.id){Z.value=!0;try{await l.delete(P(G.value.id)),Z.value=!1,M.value=!1,d.value++,r("delete:success",G.value)}catch(ae){H.value=((V=(ge=ae.response)==null?void 0:ge.data)==null?void 0:V.message)||ae.message||o("ca-certificates.errors.delete"),r("error",ae)}finally{Z.value=!1}}},Be=n.ref(!0);n.watch(m,ee=>{var ge,V,ae,me;if(Array.isArray((ge=ee==null?void 0:ee.response)==null?void 0:ge.data)&&(Be.value=ee.response.data.length>0),ee.status===Ft.Error){C.value={title:o("ca-certificates.errors.general")},(me=(ae=(V=ee.error)==null?void 0:V.response)==null?void 0:ae.data)!=null&&me.message&&(C.value.message=ee.error.response.data.message),r("error",ee.error);return}se.value={},C.value=null});const zt=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:o("ca-certificates.list.empty_state.description"),title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(zt.value.title=o("ca-certificates.list.empty_state.title"),zt.value.ctaText=o("ca-certificates.actions.create"))}),(ee,ge)=>{const V=n.resolveComponent("KButton"),ae=n.resolveComponent("KBadge"),me=n.resolveComponent("KTruncate"),Me=n.resolveComponent("KDropdownItem"),$t=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",ab,[n.createVNode(n.unref(Uf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":zt.value,"enable-entity-actions":"","error-message":C.value,fetcher:n.unref(k),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(B),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":ge[2]||(ge[2]=te=>re(te)),onSort:v},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Ff),{modelValue:h.value,"onUpdate:modelValue":ge[0]||(ge[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:n.withCtx(()=>[n.createVNode(n.unref(Dt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(V,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Be.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:n.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",cb,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.issuer?te.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",lb,n.toDisplayString(n.unref(fe)(te).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:te})=>{var Oe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",ub,n.toDisplayString((Oe=te==null?void 0:te.metadata)!=null&&Oe.expiry?n.unref(s)(te.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",db,n.toDisplayString(n.unref(fe)(te).schemaExpiry?n.unref(s)(n.unref(fe)(te).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:te})=>{var Oe;return[((Oe=te==null?void 0:te.tags)==null?void 0:Oe.length)>0?(n.openBlock(),n.createBlock(me,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te==null?void 0:te.tags,J=>(n.openBlock(),n.createBlock(ae,{key:J,onClick:ge[1]||(ge[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(J),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",fb,"-"))]}),actions:n.withCtx(({row:te})=>[n.createVNode($t,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Me,{"data-testid":"action-entity-copy-id",onClick:J=>_(te,Oe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode($t,null,{default:n.withCtx(({copyToClipboard:Oe})=>[n.createVNode(Me,{"data-testid":"action-entity-copy-json",onClick:J=>z(te,Oe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canRetrieve(te)},{default:n.withCtx(()=>[n.createVNode(Me,{"data-testid":"action-entity-view","has-divider":"",item:E(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canEdit(te)},{default:n.withCtx(()=>[n.createVNode(Me,{"data-testid":"action-entity-edit",item:O(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Dt),{"auth-function":()=>e.canDelete(te)},{default:n.withCtx(()=>[n.createVNode(Me,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Oe=>ke(te)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("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","use-action-outside"]),n.createVNode(n.unref(Lf),{"action-pending":Z.value,"entity-type":n.unref(Oa).CACertificate,error:H.value,title:n.unref(o)("ca-certificates.delete.title"),visible:M.value,onCancel:he,onProceed:ye},{description:n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(o)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f25a63b4"]]),hb={class:"kong-ui-entities-ca-certificates-form"},yb=Kr(n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var x;const r=t,i=e,o=Gr.useRouter(),{i18n:{t:s}}=kt.useI18n(),{getMessageFromError:a}=Kf(),{axiosInstance:c}=ho({headers:(x=i.config)==null?void 0:x.requestHeaders}),l=n.computed(()=>Vi.form[i.config.app].edit),d=n.computed(()=>i.certificateId?dr.Edit:dr.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),B=n.computed(()=>(d.value===dr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),b=v=>{var C;y.fields.cert=(v==null?void 0:v.cert)||"",y.fields.certDigest=(v==null?void 0:v.cert_digest)||"",y.fields.tags=((C=v==null?void 0:v.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},g=n.computed(()=>{var C,_;let v=`${i.config.apiBaseUrl}${Vi.form[i.config.app].validate}`;return i.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(_=i.config)!=null&&_.workspace?`/${i.config.workspace}`:"")),v=v.replace(/{id}/gi,i.certificateId),v}),k=n.computed(()=>{var C,_;let v=`${i.config.apiBaseUrl}${Vi.form[i.config.app][d.value]}`;return i.config.app==="konnect"?v=v.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(v=v.replace(/\/{workspace}/gi,(_=i.config)!=null&&_.workspace?`/${i.config.workspace}`:"")),v=v.replace(/{id}/gi,i.certificateId),v}),m=async()=>{var v,C,_,z,re,E,O;try{y.isReadonly=!0;const G={cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(v=y.fields.tags.split(","))==null?void 0:v.map(Z=>String(Z||"").trim()))==null?void 0:C.filter(Z=>Z!=="")};let M;await c.post(g.value,G),d.value==="create"?M=await c.post(k.value,G):d.value==="edit"&&(M=((_=i.config)==null?void 0:_.app)==="konnect"?await c.put(k.value,G):await c.patch(k.value,G)),y.fields.cert=((z=M==null?void 0:M.data)==null?void 0:z.cert)||"",y.fields.certDigest=((re=M==null?void 0:M.data)==null?void 0:re.cert_digest)||"",y.fields.tags=((O=(E=M==null?void 0:M.data)==null?void 0:E.tags)==null?void 0:O.join(", "))||"",Object.assign(p,y.fields),r("update",M==null?void 0:M.data)}catch(G){y.errorMessage=a(G),r("error",G)}finally{y.isReadonly=!1}};return(v,C)=>{const _=n.resolveComponent("KTextArea"),z=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",hb,[n.createVNode(n.unref(Rf),{"can-submit":B.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=re=>v.$emit("error",re)),"onFetch:success":b,onLoading:C[4]||(C[4]=re=>v.$emit("loading",re)),onSubmit:m},{default:n.withCtx(()=>[n.createVNode(n.unref(po),{description:n.unref(s)("ca-certificates.form.sections.cert.description"),title:n.unref(s)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(_,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=re=>y.fields.cert=re),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:n.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(z,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=re=>y.fields.certDigest=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(po),{description:n.unref(s)("ca-certificates.form.sections.general.description"),title:n.unref(s)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(z,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=re=>y.fields.tags=re),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(s)("ca-certificates.form.fields.tags.help"),label:n.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("ca-certificates.form.fields.tags.placeholder"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),[["__scopeId","data-v-bad536b1"]]),gb={class:"kong-ui-certificate-entity-config-card"},mb={key:0},bb=Kr(n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=kt.useI18n(),{convertKeyToTitle:c}=Gf(),{getPropValue:l}=Wf(),{getCertificateData:d}=kt.useCertificate(),y=n.computed(()=>Bi.form[i.config.app].edit),p=n.ref(),B=n.ref({id:{},cert:{section:pe.Basic},key:{section:pe.Basic,type:le.Redacted},metadata:{section:pe.Basic,type:le.Json},snis:{section:pe.Basic,type:le.BadgeTag,label:o("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:o("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:pe.Basic,label:o("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:pe.Basic,label:o("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:pe.Basic,label:o("certificates.list.table_headers.san"),forceShow:!0},subject:{section:pe.Basic,label:o("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:pe.Advanced},key_alt:{section:pe.Advanced,type:le.Redacted}}),b=E=>{p.value=E,r("fetch:success",E)},h=(E,O)=>{const G=l("rowValue",O);if(E==="expiry")return k.value;if(E==="key_usages")return C.value;if(E==="san_names")return x.value;if(G)return G[E]},g=n.computed(()=>{if(p.value)return d(p.value)}),k=n.computed(()=>{var E,O;return(E=g.value)!=null&&E.schemaExpiry?s((O=g.value)==null?void 0:O.schemaExpiry):""}),m=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaIssuer)||""}),x=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaSanNames)||""}),v=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaSubject)||""}),C=n.computed(()=>{var E;return((E=g.value)==null?void 0:E.schemaKeyUsages)||[]}),_=n.computed(()=>{var E,O;return((O=(E=p==null?void 0:p.value)==null?void 0:E.snis)==null?void 0:O.length)>0}),z=n.computed(()=>{var E;return!!((E=p==null?void 0:p.value)!=null&&E.cert_alt)}),re=E=>{var O,G;return E==="san_names"?o("certificates.list.table_headers.san"):((G=(O=B.value)==null?void 0:O[E])==null?void 0:G.label)||c(E)};return(E,O)=>{const G=n.resolveComponent("KCodeBlock"),M=n.resolveComponent("KLabel"),Z=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",gb,[n.createVNode(n.unref(Pf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onCopy:success":O[0]||(O[0]=H=>E.$emit("copy:success",H)),"onFetch:error":O[1]||(O[1]=H=>E.$emit("fetch:error",H)),"onFetch:success":b,onLoading:O[2]||(O[2]=H=>E.$emit("loading",H))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(H=>[n.unref(l)("rowValue",H)?(n.openBlock(),n.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(l)("rowValue",H),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(M,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(H=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(l)("rowValue",H)),P=>(n.openBlock(),n.createBlock(n.unref(Ii),{key:P,item:{key:P,value:h(P,H),label:re(P),type:P==="key_usages"||P==="snis"||P==="dns_names"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(m.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(o)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[C.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",mb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.value,(H,P)=>(n.openBlock(),n.createBlock(Z,{key:`key_usages-badge-tag-${P}`,class:"config-badge","data-testid":`key_usages-badge-tag-${P}`,tooltip:H,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(H),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[_.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},z.value?{name:"cert_alt",fn:n.withCtx(H=>[n.createTextVNode(" > "),n.unref(l)("rowValue",H)?(n.openBlock(),n.createBlock(G,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(l)("rowValue",H),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-920043bf"]]);Pe.CACertificateConfigCard=sb,Pe.CACertificateForm=yb,Pe.CACertificateList=pb,Pe.CertificateConfigCard=bb,Pe.CertificateForm=ib,Pe.CertificateList=tb,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
|