@kong-ui-public/entities-certificates 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(je,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):(je=typeof globalThis<"u"?globalThis:je||self,n(je["kong-ui-public-entities-certificates"]={},je.Vue,je.VueRouter,je["kong-ui-public-i18n"],je.axios,je.Kongponents))})(this,function(je,n,Wr,$i,ol,dp){"use strict";const sl="24px",fp=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},pp=e=>(n.pushScopeId("data-v-
|
|
1
|
+
(function(je,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):(je=typeof globalThis<"u"?globalThis:je||self,n(je["kong-ui-public-entities-certificates"]={},je.Vue,je.VueRouter,je["kong-ui-public-i18n"],je.axios,je.Kongponents))})(this,function(je,n,Wr,$i,ol,dp){"use strict";const sl="24px",fp=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},pp=e=>(n.pushScopeId("data-v-f68c7837"),e=e(),n.popScopeId(),e),hp=["aria-hidden"],yp={key:0,"data-testid":"kui-icon-svg-title"},gp=pp(()=>n.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),al=fp(n.defineComponent({__name:"AddIcon",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:sl,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 sl}),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 add-icon","data-testid":"kui-icon-wrapper-add-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-add-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",yp,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),gp],8,hp))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-f68c7837"]]);var xo=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 ll;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof xo=="object"?xo:typeof self=="object"?self:typeof this=="object"?this:l(),i=o(e);typeof r.Reflect<"u"&&(i=o(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,p){Object.defineProperty(c,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 l(){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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return nl(Object.create(null))}:c?function(){return nl({__proto__:null})}:function(){return nl({})},has:d?function(C,A){return i.call(C,A)}:function(C,A){return A in C},get:d?function(C,A){return i.call(C,A)?C[A]:void 0}:function(C,A){return C[A]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:jb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Db(),h=typeof WeakMap=="function"?WeakMap:$b(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,b=_b(),v=Vb(b);function x(C,A,_,$){if(X(_)){if(!Se(C))throw new TypeError;if(!xe(A))throw new TypeError;return D(C,A)}else{if(!Se(C))throw new TypeError;if(!K(A))throw new TypeError;if(!K($)&&!X($)&&!ee($))throw new TypeError;return ee($)&&($=void 0),_=te(_),Q(C,A,_,$)}}t("decorate",x);function E(C,A){function _($,Z){if(!K($))throw new TypeError;if(!X(Z)&&!Gr(Z))throw new TypeError;qr(C,A,$,Z)}return _}t("metadata",E);function k(C,A,_,$){if(!K(_))throw new TypeError;return X($)||($=te($)),qr(C,A,_,$)}t("defineMetadata",k);function B(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),ne(C,A,_)}t("hasMetadata",B);function S(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),Ie(C,A,_)}t("hasOwnMetadata",S);function T(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),Ce(C,A,_)}t("getMetadata",T);function O(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),Ee(C,A,_)}t("getOwnMetadata",O);function N(C,A){if(!K(C))throw new TypeError;return X(A)||(A=te(A)),Kr(C,A)}t("getMetadataKeys",N);function re(C,A){if(!K(C))throw new TypeError;return X(A)||(A=te(A)),dr(C,A)}t("getOwnMetadataKeys",re);function q(C,A,_){if(!K(A))throw new TypeError;if(X(_)||(_=te(_)),!K(A))throw new TypeError;X(_)||(_=te(_));var $=Di(A,_,!1);return X($)?!1:$.OrdinaryDeleteMetadata(C,A,_)}t("deleteMetadata",q);function D(C,A){for(var _=C.length-1;_>=0;--_){var $=C[_],Z=$(A);if(!X(Z)&&!ee(Z)){if(!xe(Z))throw new TypeError;A=Z}}return A}function Q(C,A,_,$){for(var Z=C.length-1;Z>=0;--Z){var ge=C[Z],Ae=ge(A,_,$);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;$=Ae}}return $}function ne(C,A,_){var $=Ie(C,A,_);if($)return!0;var Z=il(A);return ee(Z)?!1:ne(C,Z,_)}function Ie(C,A,_){var $=Di(A,_,!1);return X($)?!1:Qe($.OrdinaryHasOwnMetadata(C,A,_))}function Ce(C,A,_){var $=Ie(C,A,_);if($)return Ee(C,A,_);var Z=il(A);if(!ee(Z))return Ce(C,Z,_)}function Ee(C,A,_){var $=Di(A,_,!1);if(!X($))return $.OrdinaryGetOwnMetadata(C,A,_)}function qr(C,A,_,$){var Z=Di(_,$,!0);Z.OrdinaryDefineOwnMetadata(C,A,_,$)}function Kr(C,A){var _=dr(C,A),$=il(C);if($===null)return _;var Z=Kr($,A);if(Z.length<=0)return _;if(_.length<=0)return Z;for(var ge=new w,Ae=[],oe=0,M=_;oe<M.length;oe++){var z=M[oe],F=ge.has(z);F||(ge.add(z),Ae.push(z))}for(var W=0,se=Z;W<se.length;W++){var z=se[W],F=ge.has(z);F||(ge.add(z),Ae.push(z))}return Ae}function dr(C,A){var _=Di(C,A,!1);return _?_.OrdinaryOwnMetadataKeys(C,A):[]}function Dt(C){if(C===null)return 1;switch(typeof C){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return C===null?1:6;default:return 6}}function X(C){return C===void 0}function ee(C){return C===null}function U(C){return typeof C=="symbol"}function K(C){return typeof C=="object"?C!==null:typeof C=="function"}function de(C,A){switch(Dt(C)){case 0:return C;case 1:return C;case 2:return C;case 3:return C;case 4:return C;case 5:return C}var _=A===3?"string":A===5?"number":"default",$=ip(C,s);if($!==void 0){var Z=$.call(C,_);if(K(Z))throw new TypeError;return Z}return Ue(C,_==="default"?"number":_)}function Ue(C,A){if(A==="string"){var _=C.toString;if(Y(_)){var $=_.call(C);if(!K($))return $}var Z=C.valueOf;if(Y(Z)){var $=Z.call(C);if(!K($))return $}}else{var Z=C.valueOf;if(Y(Z)){var $=Z.call(C);if(!K($))return $}var ge=C.toString;if(Y(ge)){var $=ge.call(C);if(!K($))return $}}throw new TypeError}function Qe(C){return!!C}function zr(C){return""+C}function te(C){var A=de(C,3);return U(A)?A:zr(A)}function Se(C){return Array.isArray?Array.isArray(C):C instanceof Object?C instanceof Array:Object.prototype.toString.call(C)==="[object Array]"}function Y(C){return typeof C=="function"}function xe(C){return typeof C=="function"}function Gr(C){switch(Dt(C)){case 3:return!0;case 4:return!0;default:return!1}}function rl(C,A){return C===A||C!==C&&A!==A}function ip(C,A){var _=C[A];if(_!=null){if(!Y(_))throw new TypeError;return _}}function np(C){var A=ip(C,a);if(!Y(A))throw new TypeError;var _=A.call(C);if(!K(_))throw new TypeError;return _}function op(C){return C.value}function sp(C){var A=C.next();return A.done?!1:A}function ap(C){var A=C.return;A&&A.call(C)}function il(C){var A=Object.getPrototypeOf(C);if(typeof C!="function"||C===p||A!==p)return A;var _=C.prototype,$=_&&Object.getPrototypeOf(_);if($==null||$===Object.prototype)return A;var Z=$.constructor;return typeof Z!="function"||Z===C?A:Z}function Ob(){var C;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(C=Tb(r.Reflect));var A,_,$,Z=new h,ge={registerProvider:Ae,getProvider:M,setProvider:F};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case C===W:break;case X(A):A=W;break;case A===W:break;case X(_):_=W;break;case _===W:break;default:$===void 0&&($=new w),$.add(W);break}}function oe(W,se){if(!X(A)){if(A.isProviderFor(W,se))return A;if(!X(_)){if(_.isProviderFor(W,se))return A;if(!X($))for(var pe=np($);;){var me=sp(pe);if(!me)return;var ut=op(me);if(ut.isProviderFor(W,se))return ap(pe),ut}}}if(!X(C)&&C.isProviderFor(W,se))return C}function M(W,se){var pe=Z.get(W),me;return X(pe)||(me=pe.get(se)),X(me)&&(me=oe(W,se),X(me)||(X(pe)&&(pe=new I,Z.set(W,pe)),pe.set(se,me))),me}function z(W){if(X(W))throw new TypeError;return A===W||_===W||!X($)&&$.has(W)}function F(W,se,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var me=M(W,se);if(me!==pe){if(!X(me))return!1;var ut=Z.get(W);X(ut)&&(ut=new I,Z.set(W,ut)),ut.set(se,pe)}return!0}}function _b(){var C;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(C=r.Reflect[g]),X(C)&&(C=Ob()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:C}),C}function Vb(C){var A=new h,_={isProviderFor:function(z,F){var W=A.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Z,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:M};return b.registerProvider(_),_;function $(z,F,W){var se=A.get(z),pe=!1;if(X(se)){if(!W)return;se=new I,A.set(z,se),pe=!0}var me=se.get(F);if(X(me)){if(!W)return;if(me=new I,se.set(F,me),!C.setProvider(z,F,_))throw se.delete(F),pe&&A.delete(z),new Error("Wrong provider for target.")}return me}function Z(z,F,W){var se=$(F,W,!1);return X(se)?!1:Qe(se.has(z))}function ge(z,F,W){var se=$(F,W,!1);if(!X(se))return se.get(z)}function Ae(z,F,W,se){var pe=$(W,se,!0);pe.set(z,F)}function oe(z,F){var W=[],se=$(z,F,!1);if(X(se))return W;for(var pe=se.keys(),me=np(pe),ut=0;;){var lp=sp(me);if(!lp)return W.length=ut,W;var Mb=op(lp);try{W[ut]=Mb}catch(Pb){try{ap(me)}finally{throw Pb}}ut++}}function M(z,F,W){var se=$(F,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=A.get(F);X(pe)||(pe.delete(W),pe.size===0&&A.delete(pe))}return!0}}function Tb(C){var A=C.defineMetadata,_=C.hasOwnMetadata,$=C.getOwnMetadata,Z=C.getOwnMetadataKeys,ge=C.deleteMetadata,Ae=new h,oe={isProviderFor:function(M,z){var F=Ae.get(M);return X(F)?Z(M,z).length?(X(F)&&(F=new w,Ae.set(M,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:$,OrdinaryOwnMetadataKeys:Z,OrdinaryDeleteMetadata:ge};return oe}function Di(C,A,_){var $=b.getProvider(C,A);if(!X($))return $;if(_){if(b.setProvider(C,A,v))return v;throw new Error("Illegal state.")}}function jb(){var C={},A=[],_=function(){function oe(M,z,F){this._index=0,this._keys=M,this._values=z,this._selector=F}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[a]=function(){return this},oe.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var z=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),M},oe.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:M,done:!0}},oe}(),$=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=C,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function(M){return this._find(M,!1)>=0},oe.prototype.get=function(M){var z=this._find(M,!1);return z>=0?this._values[z]:void 0},oe.prototype.set=function(M,z){var F=this._find(M,!0);return this._values[F]=z,this},oe.prototype.delete=function(M){var z=this._find(M,!1);if(z>=0){for(var F=this._keys.length,W=z+1;W<F;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,rl(M,this._cacheKey)&&(this._cacheKey=C,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=C,this._cacheIndex=-2},oe.prototype.keys=function(){return new _(this._keys,this._values,Z)},oe.prototype.values=function(){return new _(this._keys,this._values,ge)},oe.prototype.entries=function(){return new _(this._keys,this._values,Ae)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[a]=function(){return this.entries()},oe.prototype._find=function(M,z){if(!rl(this._cacheKey,M)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(rl(this._keys[F],M)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},oe}();return $;function Z(oe,M){return oe}function ge(oe,M){return M}function Ae(oe,M){return[oe,M]}}function Db(){var C=function(){function A(){this._map=new I}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(_){return this._map.has(_)},A.prototype.add=function(_){return this._map.set(_,_),this},A.prototype.delete=function(_){return this._map.delete(_)},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 C}function $b(){var C=16,A=y.create(),_=$();return function(){function M(){this._key=$()}return M.prototype.has=function(z){var F=Z(z,!1);return F!==void 0?y.has(F,this._key):!1},M.prototype.get=function(z){var F=Z(z,!1);return F!==void 0?y.get(F,this._key):void 0},M.prototype.set=function(z,F){var W=Z(z,!0);return W[this._key]=F,this},M.prototype.delete=function(z){var F=Z(z,!1);return F!==void 0?delete F[this._key]:!1},M.prototype.clear=function(){this._key=$()},M}();function $(){var M;do M="@@WeakMap@@"+oe();while(y.has(A,M));return A[M]=!0,M}function Z(M,z){if(!i.call(M,_)){if(!z)return;Object.defineProperty(M,_,{value:y.create()})}return M[_]}function ge(M,z){for(var F=0;F<z;++F)M[F]=Math.random()*255|0;return M}function Ae(M){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(M)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(M)):ge(new Uint8Array(M),M):ge(new Array(M),M)}function oe(){var M=Ae(C);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var z="",F=0;F<C;++F){var W=M[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function nl(C){return C.__=void 0,delete C.__,C}})})(ll||(ll={}));/*!
|
|
14
|
+
***************************************************************************** */var ll;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof xo=="object"?xo:typeof self=="object"?self:typeof this=="object"?this:l(),i=o(e);typeof r.Reflect<"u"&&(i=o(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function o(c,d){return function(y,p){Object.defineProperty(c,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 l(){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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,d=!l&&!c,y={create:l?function(){return nl(Object.create(null))}:c?function(){return nl({__proto__:null})}:function(){return nl({})},has:d?function(C,A){return i.call(C,A)}:function(C,A){return A in C},get:d?function(C,A){return i.call(C,A)?C[A]:void 0}:function(C,A){return C[A]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Tb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:jb(),h=typeof WeakMap=="function"?WeakMap:Db(),g=o?Symbol.for("@reflect-metadata:registry"):void 0,b=Ob(),v=_b(b);function x(C,A,_,$){if(X(_)){if(!Se(C))throw new TypeError;if(!xe(A))throw new TypeError;return D(C,A)}else{if(!Se(C))throw new TypeError;if(!K(A))throw new TypeError;if(!K($)&&!X($)&&!ee($))throw new TypeError;return ee($)&&($=void 0),_=te(_),Q(C,A,_,$)}}t("decorate",x);function E(C,A){function _($,Z){if(!K($))throw new TypeError;if(!X(Z)&&!Gr(Z))throw new TypeError;qr(C,A,$,Z)}return _}t("metadata",E);function k(C,A,_,$){if(!K(_))throw new TypeError;return X($)||($=te($)),qr(C,A,_,$)}t("defineMetadata",k);function B(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),ne(C,A,_)}t("hasMetadata",B);function S(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),Ie(C,A,_)}t("hasOwnMetadata",S);function T(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),Ce(C,A,_)}t("getMetadata",T);function O(C,A,_){if(!K(A))throw new TypeError;return X(_)||(_=te(_)),Ee(C,A,_)}t("getOwnMetadata",O);function N(C,A){if(!K(C))throw new TypeError;return X(A)||(A=te(A)),Kr(C,A)}t("getMetadataKeys",N);function re(C,A){if(!K(C))throw new TypeError;return X(A)||(A=te(A)),dr(C,A)}t("getOwnMetadataKeys",re);function q(C,A,_){if(!K(A))throw new TypeError;if(X(_)||(_=te(_)),!K(A))throw new TypeError;X(_)||(_=te(_));var $=Di(A,_,!1);return X($)?!1:$.OrdinaryDeleteMetadata(C,A,_)}t("deleteMetadata",q);function D(C,A){for(var _=C.length-1;_>=0;--_){var $=C[_],Z=$(A);if(!X(Z)&&!ee(Z)){if(!xe(Z))throw new TypeError;A=Z}}return A}function Q(C,A,_,$){for(var Z=C.length-1;Z>=0;--Z){var ge=C[Z],Ae=ge(A,_,$);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;$=Ae}}return $}function ne(C,A,_){var $=Ie(C,A,_);if($)return!0;var Z=il(A);return ee(Z)?!1:ne(C,Z,_)}function Ie(C,A,_){var $=Di(A,_,!1);return X($)?!1:Qe($.OrdinaryHasOwnMetadata(C,A,_))}function Ce(C,A,_){var $=Ie(C,A,_);if($)return Ee(C,A,_);var Z=il(A);if(!ee(Z))return Ce(C,Z,_)}function Ee(C,A,_){var $=Di(A,_,!1);if(!X($))return $.OrdinaryGetOwnMetadata(C,A,_)}function qr(C,A,_,$){var Z=Di(_,$,!0);Z.OrdinaryDefineOwnMetadata(C,A,_,$)}function Kr(C,A){var _=dr(C,A),$=il(C);if($===null)return _;var Z=Kr($,A);if(Z.length<=0)return _;if(_.length<=0)return Z;for(var ge=new w,Ae=[],oe=0,M=_;oe<M.length;oe++){var z=M[oe],F=ge.has(z);F||(ge.add(z),Ae.push(z))}for(var W=0,se=Z;W<se.length;W++){var z=se[W],F=ge.has(z);F||(ge.add(z),Ae.push(z))}return Ae}function dr(C,A){var _=Di(C,A,!1);return _?_.OrdinaryOwnMetadataKeys(C,A):[]}function Dt(C){if(C===null)return 1;switch(typeof C){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return C===null?1:6;default:return 6}}function X(C){return C===void 0}function ee(C){return C===null}function U(C){return typeof C=="symbol"}function K(C){return typeof C=="object"?C!==null:typeof C=="function"}function de(C,A){switch(Dt(C)){case 0:return C;case 1:return C;case 2:return C;case 3:return C;case 4:return C;case 5:return C}var _=A===3?"string":A===5?"number":"default",$=ip(C,s);if($!==void 0){var Z=$.call(C,_);if(K(Z))throw new TypeError;return Z}return Ue(C,_==="default"?"number":_)}function Ue(C,A){if(A==="string"){var _=C.toString;if(Y(_)){var $=_.call(C);if(!K($))return $}var Z=C.valueOf;if(Y(Z)){var $=Z.call(C);if(!K($))return $}}else{var Z=C.valueOf;if(Y(Z)){var $=Z.call(C);if(!K($))return $}var ge=C.toString;if(Y(ge)){var $=ge.call(C);if(!K($))return $}}throw new TypeError}function Qe(C){return!!C}function zr(C){return""+C}function te(C){var A=de(C,3);return U(A)?A:zr(A)}function Se(C){return Array.isArray?Array.isArray(C):C instanceof Object?C instanceof Array:Object.prototype.toString.call(C)==="[object Array]"}function Y(C){return typeof C=="function"}function xe(C){return typeof C=="function"}function Gr(C){switch(Dt(C)){case 3:return!0;case 4:return!0;default:return!1}}function rl(C,A){return C===A||C!==C&&A!==A}function ip(C,A){var _=C[A];if(_!=null){if(!Y(_))throw new TypeError;return _}}function np(C){var A=ip(C,a);if(!Y(A))throw new TypeError;var _=A.call(C);if(!K(_))throw new TypeError;return _}function op(C){return C.value}function sp(C){var A=C.next();return A.done?!1:A}function ap(C){var A=C.return;A&&A.call(C)}function il(C){var A=Object.getPrototypeOf(C);if(typeof C!="function"||C===p||A!==p)return A;var _=C.prototype,$=_&&Object.getPrototypeOf(_);if($==null||$===Object.prototype)return A;var Z=$.constructor;return typeof Z!="function"||Z===C?A:Z}function Nb(){var C;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(C=Vb(r.Reflect));var A,_,$,Z=new h,ge={registerProvider:Ae,getProvider:M,setProvider:F};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case C===W:break;case X(A):A=W;break;case A===W:break;case X(_):_=W;break;case _===W:break;default:$===void 0&&($=new w),$.add(W);break}}function oe(W,se){if(!X(A)){if(A.isProviderFor(W,se))return A;if(!X(_)){if(_.isProviderFor(W,se))return A;if(!X($))for(var pe=np($);;){var me=sp(pe);if(!me)return;var ut=op(me);if(ut.isProviderFor(W,se))return ap(pe),ut}}}if(!X(C)&&C.isProviderFor(W,se))return C}function M(W,se){var pe=Z.get(W),me;return X(pe)||(me=pe.get(se)),X(me)&&(me=oe(W,se),X(me)||(X(pe)&&(pe=new I,Z.set(W,pe)),pe.set(se,me))),me}function z(W){if(X(W))throw new TypeError;return A===W||_===W||!X($)&&$.has(W)}function F(W,se,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var me=M(W,se);if(me!==pe){if(!X(me))return!1;var ut=Z.get(W);X(ut)&&(ut=new I,Z.set(W,ut)),ut.set(se,pe)}return!0}}function Ob(){var C;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(C=r.Reflect[g]),X(C)&&(C=Nb()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:C}),C}function _b(C){var A=new h,_={isProviderFor:function(z,F){var W=A.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Z,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:M};return b.registerProvider(_),_;function $(z,F,W){var se=A.get(z),pe=!1;if(X(se)){if(!W)return;se=new I,A.set(z,se),pe=!0}var me=se.get(F);if(X(me)){if(!W)return;if(me=new I,se.set(F,me),!C.setProvider(z,F,_))throw se.delete(F),pe&&A.delete(z),new Error("Wrong provider for target.")}return me}function Z(z,F,W){var se=$(F,W,!1);return X(se)?!1:Qe(se.has(z))}function ge(z,F,W){var se=$(F,W,!1);if(!X(se))return se.get(z)}function Ae(z,F,W,se){var pe=$(W,se,!0);pe.set(z,F)}function oe(z,F){var W=[],se=$(z,F,!1);if(X(se))return W;for(var pe=se.keys(),me=np(pe),ut=0;;){var lp=sp(me);if(!lp)return W.length=ut,W;var $b=op(lp);try{W[ut]=$b}catch(Mb){try{ap(me)}finally{throw Mb}}ut++}}function M(z,F,W){var se=$(F,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=A.get(F);X(pe)||(pe.delete(W),pe.size===0&&A.delete(pe))}return!0}}function Vb(C){var A=C.defineMetadata,_=C.hasOwnMetadata,$=C.getOwnMetadata,Z=C.getOwnMetadataKeys,ge=C.deleteMetadata,Ae=new h,oe={isProviderFor:function(M,z){var F=Ae.get(M);return X(F)?Z(M,z).length?(X(F)&&(F=new w,Ae.set(M,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:A,OrdinaryHasOwnMetadata:_,OrdinaryGetOwnMetadata:$,OrdinaryOwnMetadataKeys:Z,OrdinaryDeleteMetadata:ge};return oe}function Di(C,A,_){var $=b.getProvider(C,A);if(!X($))return $;if(_){if(b.setProvider(C,A,v))return v;throw new Error("Illegal state.")}}function Tb(){var C={},A=[],_=function(){function oe(M,z,F){this._index=0,this._keys=M,this._values=z,this._selector=F}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[a]=function(){return this},oe.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var z=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=A,this._values=A):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=A,this._values=A),M},oe.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=A,this._values=A),{value:M,done:!0}},oe}(),$=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=C,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function(M){return this._find(M,!1)>=0},oe.prototype.get=function(M){var z=this._find(M,!1);return z>=0?this._values[z]:void 0},oe.prototype.set=function(M,z){var F=this._find(M,!0);return this._values[F]=z,this},oe.prototype.delete=function(M){var z=this._find(M,!1);if(z>=0){for(var F=this._keys.length,W=z+1;W<F;W++)this._keys[W-1]=this._keys[W],this._values[W-1]=this._values[W];return this._keys.length--,this._values.length--,rl(M,this._cacheKey)&&(this._cacheKey=C,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=C,this._cacheIndex=-2},oe.prototype.keys=function(){return new _(this._keys,this._values,Z)},oe.prototype.values=function(){return new _(this._keys,this._values,ge)},oe.prototype.entries=function(){return new _(this._keys,this._values,Ae)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[a]=function(){return this.entries()},oe.prototype._find=function(M,z){if(!rl(this._cacheKey,M)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(rl(this._keys[F],M)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},oe}();return $;function Z(oe,M){return oe}function ge(oe,M){return M}function Ae(oe,M){return[oe,M]}}function jb(){var C=function(){function A(){this._map=new I}return Object.defineProperty(A.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),A.prototype.has=function(_){return this._map.has(_)},A.prototype.add=function(_){return this._map.set(_,_),this},A.prototype.delete=function(_){return this._map.delete(_)},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 C}function Db(){var C=16,A=y.create(),_=$();return function(){function M(){this._key=$()}return M.prototype.has=function(z){var F=Z(z,!1);return F!==void 0?y.has(F,this._key):!1},M.prototype.get=function(z){var F=Z(z,!1);return F!==void 0?y.get(F,this._key):void 0},M.prototype.set=function(z,F){var W=Z(z,!0);return W[this._key]=F,this},M.prototype.delete=function(z){var F=Z(z,!1);return F!==void 0?delete F[this._key]:!1},M.prototype.clear=function(){this._key=$()},M}();function $(){var M;do M="@@WeakMap@@"+oe();while(y.has(A,M));return A[M]=!0,M}function Z(M,z){if(!i.call(M,_)){if(!z)return;Object.defineProperty(M,_,{value:y.create()})}return M[_]}function ge(M,z){for(var F=0;F<z;++F)M[F]=Math.random()*255|0;return M}function Ae(M){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(M)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(M)):ge(new Uint8Array(M),M):ge(new Array(M),M)}function oe(){var M=Ae(C);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var z="",F=0;F<C;++F){var W=M[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function nl(C){return C.__=void 0,delete C.__,C}})})(ll||(ll={}));/*!
|
|
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 mp="[object ArrayBuffer]";class P{static isArrayBuffer(t){return Object.prototype.toString.call(t)===mp}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=P.toUint8Array(t),o=P.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 l=this.toUint8Array(a);o.set(l,s),s+=l.length}return t[t.length-1]instanceof Function?this.toView(o,t[t.length-1]):o.buffer}}const Ao="string",bp=/^[0-9a-f]+$/i,wp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,vp=/^[a-zA-Z0-9-_]+$/;class cl{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=P.toUint8Array(t);let i="";for(let s=0;s<r.length;s++)i+=String.fromCharCode(r[s]);return decodeURIComponent(escape(i))}}class dt{static toString(t,r=!1){const i=P.toArrayBuffer(t),o=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const l=o.getUint16(a,r);s+=String.fromCharCode(l)}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 L{static isHex(t){return typeof t===Ao&&bp.test(t)}static isBase64(t){return typeof t===Ao&&wp.test(t)}static isBase64Url(t){return typeof t===Ao&&vp.test(t)}static ToString(t,r="utf8"){const i=P.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 dt.toString(i,!0);case"utf16":case"utf16be":return dt.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 dt.fromString(t,!0);case"utf16":case"utf16be":return dt.fromString(t);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToBase64(t){const r=P.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(!L.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(!L.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=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.FromBinary(t);case"utf8":return cl.fromString(t);case"utf16":case"utf16be":return dt.fromString(t);case"utf16le":case"usc2":return dt.fromString(t,!0);default:throw new Error(`Unknown type of encoding '${r}'`)}}static ToUtf8String(t,r=L.DEFAULT_UTF8_ENCODING){switch(r){case"ascii":return this.ToBinary(t);case"utf8":return cl.toString(t);case"utf16":case"utf16be":return dt.toString(t);case"utf16le":case"usc2":return dt.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=P.toUint8Array(t);let i="";for(let o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);return i}static ToHex(t){const r=P.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(!L.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 dt.toString(t,r)}static FromUtf16String(t,r=!1){return dt.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,""))||""}}L.DEFAULT_UTF8_ENCODING="utf8";function kp(...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 ul(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 fr(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 Kt(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let l=1;l<8;l++){if(e<a){let c;if(i<0)c=new ArrayBuffer(l),s=l;else{if(i<l)return new ArrayBuffer(0);c=new ArrayBuffer(i),s=i}const d=new Uint8Array(c);for(let y=l-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 c}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function Bo(...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 dl(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const l=e[0]===255&&e[1]&128,c=e[0]===0&&(e[1]&128)===0;(l||c)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let l=0;l<this.valueHex.byteLength;l++)r[l]=0;r[0]=e[0]&128;const i=fr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let l=0;l<this.valueHex.byteLength;l++)s[l]=e[l];return s[0]&=127,fr(s,8)-i}function
|
|
39
|
+
*/function fr(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 Kt(e,t,r=-1){const i=r;let o=e,s=0,a=Math.pow(2,t);for(let l=1;l<8;l++){if(e<a){let c;if(i<0)c=new ArrayBuffer(l),s=l;else{if(i<l)return new ArrayBuffer(0);c=new ArrayBuffer(i),s=i}const d=new Uint8Array(c);for(let y=l-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 c}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function Bo(...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 dl(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const l=e[0]===255&&e[1]&128,c=e[0]===0&&(e[1]&128)===0;(l||c)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let l=0;l<this.valueHex.byteLength;l++)r[l]=0;r[0]=e[0]&128;const i=fr(r,8),o=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(o);for(let l=0;l<this.valueHex.byteLength;l++)s[l]=e[l];return s[0]&=127,fr(s,8)-i}function Cp(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,l=Kt(a,8,i),c=new Uint8Array(l);return c[0]|=128,l}let o=Kt(t,8,i),s=new Uint8Array(o);if(s[0]&128){const a=o.slice(0),l=new Uint8Array(a);o=new ArrayBuffer(o.byteLength+1),s=new Uint8Array(o);for(let c=0;c<a.byteLength;c++)s[c+1]=l[c];s[0]=0}return o}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function Sp(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 We(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 Mi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Io(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 Ct(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 Pi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return Io(this.items)}}const Jr=[new Uint8Array([1])],fl="0123456789",Eo="name",pl="valueHexView",Ap="isHexOnly",Bp="idBlock",Ip="tagClass",Ep="tagNumber",Np="isConstructed",Op="fromBER",_p="toBER",Vp="local",Le="",nt=new ArrayBuffer(0),Ri=new Uint8Array(0),Yr="EndOfContent",hl="OCTET STRING",yl="BIT STRING";function ft(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?P.toUint8Array(s.valueHex):Ri}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(!Ct(this,a,o,s))return-1;const l=o+s;return this.valueHexView=a.subarray(o,l),this.valueHexView.length?(this.blockLength=s,l):(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:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class zt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:o=Ri}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=P.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:L.ToHex(this.valueBeforeDecodeView)}}}zt.NAME="baseBlock";class Me extends zt{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 gl extends ft(zt){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?P.toUint8Array(t.valueHex):Ri,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=Kt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,l=new Uint8Array(a+1);if(l[0]=r|31,!t){for(let c=0;c<a-1;c++)l[c+1]=s[c]|128;l[a]=s[a-1]}return l.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=P.toUint8Array(t);if(!Ct(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 l=s[0]&31;if(l!==31)this.tagNumber=l,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===y){y+=255;const I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=c+1,d[c-1]=s[c]&127;const p=new Uint8Array(c);for(let I=0;I<c;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(c),d.set(p),this.blockLength<=9?this.tagNumber=fr(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}}}gl.NAME="identificationBlock";class ml extends zt{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=P.toUint8Array(t);if(!Ct(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 l=r+1,c=o.subarray(l,l+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=fr(c,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=Kt(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}}}ml.NAME="lengthBlock";const R={};class Ne extends zt{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 gl(o),this.lenBlock=new ml(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 Pi;r||bl(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():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.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 xp(r,i)}}Ne.NAME="BaseBlock";function bl(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)bl(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class No extends Ne{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}'`}}No.NAME="BaseStringBlock";class wl extends ft(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}wl.NAME="PrimitiveValueBlock";var vl;class Zr extends Ne{constructor(t={}){super(t,wl),this.idBlock.isConstructed=!1}}vl=Zr,R.Primitive=vl,Zr.NAME="PRIMITIVE";function Tp(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 pr(e,t=0,r=e.length){const i=t;let o=new Ne({},Me);const s=new zt;if(!Ct(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 l=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),l===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=l,r-=o.idBlock.blockLength,l=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),l===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=l,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 c=Ne;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};c=R.EndOfContent;break;case 1:c=R.Boolean;break;case 2:c=R.Integer;break;case 3:c=R.BitString;break;case 4:c=R.OctetString;break;case 5:c=R.Null;break;case 6:c=R.ObjectIdentifier;break;case 10:c=R.Enumerated;break;case 12:c=R.Utf8String;break;case 13:c=R.RelativeObjectIdentifier;break;case 14:c=R.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=R.Sequence;break;case 17:c=R.Set;break;case 18:c=R.NumericString;break;case 19:c=R.PrintableString;break;case 20:c=R.TeletexString;break;case 21:c=R.VideotexString;break;case 22:c=R.IA5String;break;case 23:c=R.UTCTime;break;case 24:c=R.GeneralizedTime;break;case 25:c=R.GraphicString;break;case 26:c=R.VisibleString;break;case 27:c=R.GeneralString;break;case 28:c=R.UniversalString;break;case 29:c=R.CharacterString;break;case 30:c=R.BmpString;break;case 31:c=R.DATE;break;case 32:c=R.TimeOfDay;break;case 33:c=R.DateTime;break;case 34:c=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:c=o.idBlock.isConstructed?R.Constructed:R.Primitive}return o=Tp(o,c),l=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:l,result:o}}function hr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return pr(P.toUint8Array(e).slice(),0,e.byteLength)}function jp(e,t){return e?1:t}class $t extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=P.toUint8Array(t);if(!Ct(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(;jp(this.isIndefiniteForm,i)>0;){const a=pr(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===Yr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Yr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Pi;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}}$t.NAME="ConstructedValueBlock";var kl;class Fe extends Ne{constructor(t={}){super(t,$t),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 Mi(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Io(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 Ct(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 Pi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return Io(this.items)}}const Jr=[new Uint8Array([1])],fl="0123456789",Eo="name",pl="valueHexView",xp="isHexOnly",Ap="idBlock",Bp="tagClass",Ip="tagNumber",Ep="isConstructed",Np="fromBER",Op="toBER",_p="local",Le="",nt=new ArrayBuffer(0),Ri=new Uint8Array(0),Yr="EndOfContent",hl="OCTET STRING",yl="BIT STRING";function ft(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?P.toUint8Array(s.valueHex):Ri}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(!Ct(this,a,o,s))return-1;const l=o+s;return this.valueHexView=a.subarray(o,l),this.valueHexView.length?(this.blockLength=s,l):(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:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class zt{constructor({blockLength:t=0,error:r=Le,warnings:i=[],valueBeforeDecode:o=Ri}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=P.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:L.ToHex(this.valueBeforeDecodeView)}}}zt.NAME="baseBlock";class Me extends zt{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 gl extends ft(zt){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?P.toUint8Array(t.valueHex):Ri,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=Kt(this.tagNumber,7),s=new Uint8Array(o),a=o.byteLength,l=new Uint8Array(a+1);if(l[0]=r|31,!t){for(let c=0;c<a-1;c++)l[c+1]=s[c]|128;l[a]=s[a-1]}return l.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=P.toUint8Array(t);if(!Ct(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 l=s[0]&31;if(l!==31)this.tagNumber=l,this.blockLength=1;else{let c=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[c]&128;){if(d[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===y){y+=255;const I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=c+1,d[c-1]=s[c]&127;const p=new Uint8Array(c);for(let I=0;I<c;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(c),d.set(p),this.blockLength<=9?this.tagNumber=fr(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}}}gl.NAME="identificationBlock";class ml extends zt{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=P.toUint8Array(t);if(!Ct(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 l=r+1,c=o.subarray(l,l+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=fr(c,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=Kt(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}}}ml.NAME="lengthBlock";const R={};class Ne extends zt{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 gl(o),this.lenBlock=new ml(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 Pi;r||bl(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():L.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${L.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 Sp(r,i)}}Ne.NAME="BaseBlock";function bl(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)bl(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class No extends Ne{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}'`}}No.NAME="BaseStringBlock";class wl extends ft(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}wl.NAME="PrimitiveValueBlock";var vl;class Zr extends Ne{constructor(t={}){super(t,wl),this.idBlock.isConstructed=!1}}vl=Zr,R.Primitive=vl,Zr.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 pr(e,t=0,r=e.length){const i=t;let o=new Ne({},Me);const s=new zt;if(!Ct(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 l=o.idBlock.fromBER(e,t,r);if(o.idBlock.warnings.length&&o.warnings.concat(o.idBlock.warnings),l===-1)return o.error=o.idBlock.error,{offset:-1,result:o};if(t=l,r-=o.idBlock.blockLength,l=o.lenBlock.fromBER(e,t,r),o.lenBlock.warnings.length&&o.warnings.concat(o.lenBlock.warnings),l===-1)return o.error=o.lenBlock.error,{offset:-1,result:o};if(t=l,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 c=Ne;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};c=R.EndOfContent;break;case 1:c=R.Boolean;break;case 2:c=R.Integer;break;case 3:c=R.BitString;break;case 4:c=R.OctetString;break;case 5:c=R.Null;break;case 6:c=R.ObjectIdentifier;break;case 10:c=R.Enumerated;break;case 12:c=R.Utf8String;break;case 13:c=R.RelativeObjectIdentifier;break;case 14:c=R.TIME;break;case 15:return o.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:o};case 16:c=R.Sequence;break;case 17:c=R.Set;break;case 18:c=R.NumericString;break;case 19:c=R.PrintableString;break;case 20:c=R.TeletexString;break;case 21:c=R.VideotexString;break;case 22:c=R.IA5String;break;case 23:c=R.UTCTime;break;case 24:c=R.GeneralizedTime;break;case 25:c=R.GraphicString;break;case 26:c=R.VisibleString;break;case 27:c=R.GeneralString;break;case 28:c=R.UniversalString;break;case 29:c=R.CharacterString;break;case 30:c=R.BmpString;break;case 31:c=R.DATE;break;case 32:c=R.TimeOfDay;break;case 33:c=R.DateTime;break;case 34:c=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:c=o.idBlock.isConstructed?R.Constructed:R.Primitive}return o=Vp(o,c),l=o.fromBER(e,t,o.lenBlock.isIndefiniteForm?r:o.lenBlock.length),o.valueBeforeDecodeView=e.subarray(i,i+o.blockLength),{offset:l,result:o}}function hr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return pr(P.toUint8Array(e).slice(),0,e.byteLength)}function Tp(e,t){return e?1:t}class $t extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const o=P.toUint8Array(t);if(!Ct(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(;Tp(this.isIndefiniteForm,i)>0;){const a=pr(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===Yr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Yr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Pi;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}}$t.NAME="ConstructedValueBlock";var kl;class Fe extends Ne{constructor(t={}){super(t,$t),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} :`}}kl=Fe,R.Constructed=kl,Fe.NAME="CONSTRUCTED";class Cl extends Me{fromBER(t,r,i){return r}toBER(t){return nt}}Cl.override="EndOfContentValueBlock";var Sl;class Oo extends Ne{constructor(t={}){super(t,Cl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Sl=Oo,R.EndOfContent=Sl,Oo.NAME=Yr;var xl;class Gt extends Ne{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}`}}xl=Gt,R.Null=xl,Gt.NAME="NULL";class Al extends ft(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=P.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=P.toUint8Array(t);return Ct(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,dl.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Al.NAME="BooleanValueBlock";var Bl;let Ui=class extends Ne{constructor(t={}){super(t,Al),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}`}};Bl=Ui,R.Boolean=Bl,Ui.NAME="BOOLEAN";class Il extends ft($t){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=$t.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===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==hl)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?$t.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Il.NAME="OctetStringValueBlock";var El;let Wt=class cp extends Ne{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},Il),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=pr(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?Fe.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.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 cp&&t.push(r.valueBlock.valueHexView);return P.concat(t)}};El=Wt,R.OctetString=El,Wt.NAME=hl;class Nl extends ft($t){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=$t.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==yl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.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=P.toUint8Array(t);if(!Ct(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 l=a.subarray(1);try{if(l.byteLength){const c=pr(l,0,l.byteLength);c.offset!==-1&&c.offset===i-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return $t.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}}}Nl.NAME="BitStringValueBlock";var Ol;let Jt=class extends Ne{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},Nl),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 Fe.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)}`}}};Ol=Jt,R.BitString=Ol,Jt.NAME=yl;var _l;function Dp(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,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<l.length:d=s[a-p]+l[c-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=Bo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=Bo(r,s)),s}function Vl(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Jr[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=Bo(r,i)),Jr.push(i)}return Jr[e]}function $p(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let p=c;p>=0;p--,y++)switch(d=s[a-y]-l[c-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-c+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 _o extends ft(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=dl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Sp(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="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=$p(Vl(i),r),a="-";break;default:r=Dp(r,Vl(i))}i++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=fl.charAt(r[c]));return l===!1&&(a+=fl.charAt(0)),a}}_l=_o,_o.NAME="IntegerValueBlock",Object.defineProperty(_l.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Tl;class pt extends Ne{constructor(t={}){super(t,_o),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Mi(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Mi();const r=BigInt(t),i=new Pi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=P.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new pt({valueHex:i.final()})}convertToDER(){const t=new pt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new pt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Tl=pt,R.Integer=Tl,pt.NAME="INTEGER";var jl;class Li extends pt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}jl=Li,R.Enumerated=jl,Li.NAME="ENUMERATED";class Vo extends ft(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=P.toUint8Array(t);if(!Ct(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let l=0;l<i&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=fr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Mi();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=Kt(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=L.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}}}Vo.NAME="sidBlock";class Dl 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 Vo;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 Io(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 l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new Vo;if(o>Number.MAX_SAFE_INTEGER){Mi();const l=BigInt(o);a.valueBigInt=l}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}}Dl.NAME="ObjectIdentifierValueBlock";var $l;class Fi extends Ne{constructor(t={}){super(t,Dl),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()}}}$l=Fi,R.ObjectIdentifier=$l,Fi.NAME="OBJECT IDENTIFIER";class To extends ft(zt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=P.toUint8Array(t);if(!Ct(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let l=0;l<i&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=fr(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=Kt(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=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}To.NAME="relativeSidBlock";class Ml 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 To;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 Io(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 To;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}}Ml.NAME="RelativeObjectIdentifierValueBlock";var Pl;class jo extends Ne{constructor(t={}){super(t,Ml),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()}}}Pl=jo,R.RelativeObjectIdentifier=Pl,jo.NAME="RelativeObjectIdentifier";var Rl;class St extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Rl=St,R.Sequence=Rl,St.NAME="SEQUENCE";var Ul;let xt=class extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Ul=xt,R.Set=Ul,xt.NAME="SET";class Ll extends ft(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Ll.NAME="StringValueBlock";class Fl extends Ll{}Fl.NAME="SimpleStringValueBlock";class Je extends No{constructor({...t}={}){super(t,Fl)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,P.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 Hl extends Je{fromBuffer(t){this.valueBlock.valueHexView=P.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}Hl.NAME="Utf8StringValueBlock";var ql;class At extends Hl{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ql=At,R.Utf8String=ql,At.NAME="UTF8String";class Kl extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=P.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Kl.NAME="BmpStringValueBlock";var zl;class Hi extends Kl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}zl=Hi,R.BmpString=zl,Hi.NAME="BMPString";class Gl 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=Kt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)i[o*4+c+l]=a[c]}this.valueBlock.value=t}}Gl.NAME="UniversalStringValueBlock";var Wl;class qi extends Gl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Wl=qi,R.UniversalString=Wl,qi.NAME="UniversalString";var Jl;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Jl=Ki,R.NumericString=Jl,Ki.NAME="NumericString";var Yl;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Yl=zi,R.PrintableString=Yl,zi.NAME="PrintableString";var Zl;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Zl=Gi,R.TeletexString=Zl,Gi.NAME="TeletexString";var Ql;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Ql=Wi,R.VideotexString=Ql,Wi.NAME="VideotexString";var Xl;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Xl=Ji,R.IA5String=Xl,Ji.NAME="IA5String";var ec;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}ec=Yi,R.GraphicString=ec,Yi.NAME="GraphicString";var tc;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}tc=Qr,R.VisibleString=tc,Qr.NAME="VisibleString";var rc;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}rc=Zi,R.GeneralString=rc,Zi.NAME="GeneralString";var ic;class Qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}ic=Qi,R.CharacterString=ic,Qi.NAME="CharacterString";var nc;class Xr extends Qr{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,P.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}}}nc=Xr,R.UTCTime=nc,Xr.NAME="UTCTime";var oc;class Xi extends Xr{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,l=0,c=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,I=i.indexOf("+"),w="";if(I===-1&&(I=i.indexOf("-"),p=-1),I!==-1){if(w=i.substring(I+1),i=i.substring(0,I),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=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)+l;break;case 5:this.minute=parseInt(y[p],10)+c;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}}}oc=Xi,R.GeneralizedTime=oc,Xi.NAME="GeneralizedTime";var sc;class Do extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}sc=Do,R.DATE=sc,Do.NAME="DATE";var ac;class $o extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ac=$o,R.TimeOfDay=ac,$o.NAME="TimeOfDay";var lc;class Mo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}lc=Mo,R.DateTime=lc,Mo.NAME="DateTime";var cc;class Po extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}cc=Po,R.Duration=cc,Po.NAME="Duration";var uc;class Ro extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}uc=Ro,R.TIME=uc,Ro.NAME="TIME";class Yt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Uo extends Yt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class en extends Yt{constructor({value:t=new Yt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Mp{constructor({data:t=Ri}={}){this.dataView=P.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=P.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=P.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Zt(e,t,r){if(r instanceof Uo){for(let s=0;s<r.value.length;s++)if(Zt(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(Eo)&&(s.name=r.name),s}}if(r instanceof Yt)return r.hasOwnProperty(Eo)&&(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(!(Bp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Op in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(_p 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(Ip)===!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(Ep)===!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(Np)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(Ap 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(!(pl 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 l=0;l<s.length;l++)if(s[l]!==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 R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof en&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{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 c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].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 en){if(a=Zt(e,t.valueBlock.value[c],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(Eo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};Vp 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[c])}}else if(a=Zt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].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 c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&pl in t.valueBlock){const s=pr(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 Zt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Pp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=pr(P.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Zt(r.result,r.result,t)}const dc=Object.freeze(Object.defineProperty({__proto__:null,Any:Yt,BaseBlock:Ne,BaseStringBlock:No,BitString:Jt,BmpString:Hi,Boolean:Ui,CharacterString:Qi,Choice:Uo,Constructed:Fe,DATE:Do,DateTime:Mo,Duration:Po,EndOfContent:Oo,Enumerated:Li,GeneralString:Zi,GeneralizedTime:Xi,GraphicString:Yi,HexBlock:ft,IA5String:Ji,Integer:pt,Null:Gt,NumericString:Ki,ObjectIdentifier:Fi,OctetString:Wt,Primitive:Zr,PrintableString:zi,RawData:Mp,RelativeObjectIdentifier:jo,Repeated:en,Sequence:St,Set:xt,TIME:Ro,TeletexString:Gi,TimeOfDay:$o,UTCTime:Xr,UniversalString:qi,Utf8String:At,ValueBlock:Me,VideotexString:Wi,ViewWriter:Pi,VisibleString:Qr,compareSchema:Zt,fromBER:hr,verifySchema:Pp},Symbol.toStringTag,{value:"Module"}));var V;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(V||(V={}));var m;(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"})(m||(m={}));class tn{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(P.isBufferSource(t))this.unusedBits=r,this.value=P.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Jt))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 Jt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Jt({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 ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):P.isBufferSource(t)?this.buffer=P.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Wt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Wt({valueHex:this.buffer})}toSchema(t){return new Wt({name:t})}}const Rp={fromASN:e=>e instanceof Gt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Gt;const t=hr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Up={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new pt({value:+e})},Lp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Li({value:e})},he={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new pt({valueHex:e})},Fp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Hp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Fi({value:e})},qp={fromASN:e=>e.valueBlock.value,toASN:e=>new Ui({value:e})},rn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Wt({valueHex:e})},Kp={fromASN:e=>new ae(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const fc=Xe(At),zp=Xe(Hi),Gp=Xe(qi),Wp=Xe(Ki),Jp=Xe(zi),Yp=Xe(Gi),Zp=Xe(Wi),Qp=Xe(Ji),Xp=Xe(Yi),eh=Xe(Qr),th=Xe(Zi),rh=Xe(Qi),ih={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},nh={fromASN:e=>e.toDate(),toASN:e=>new Xi({valueDate:e})},oh={fromASN:()=>null,toASN:()=>new Gt};function Lo(e){switch(e){case m.Any:return Rp;case m.BitString:return Fp;case m.BmpString:return zp;case m.Boolean:return qp;case m.CharacterString:return rh;case m.Enumerated:return Lp;case m.GeneralString:return th;case m.GeneralizedTime:return nh;case m.GraphicString:return Xp;case m.IA5String:return Qp;case m.Integer:return Up;case m.Null:return oh;case m.NumericString:return Wp;case m.ObjectIdentifier:return Hp;case m.OctetString:return rn;case m.PrintableString:return Jp;case m.TeletexString:return Yp;case m.UTCTime:return ih;case m.UniversalString:return Gp;case m.Utf8String:return fc;case m.VideotexString:return Zp;case m.VisibleString:return eh;default:return null}}function Bt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:Bt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function pc(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:pc(r)}return!1}function sh(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 ah{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:V.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],l=r?s:"";let c;if(typeof a.type=="number"){const y=m[a.type],p=dc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new p({name:l})}else Bt(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===V.Choice?c=new Yt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Yt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?xt:St;c=new y({name:"",value:[new en({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||Bt(a.type)){const y=a.repeated?Fe:Zr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?c:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new Fe({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new Fe({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(i.type){case V.Sequence:return new St({value:o,name:""});case V.Set:return new xt({value:o,name:""});case V.Choice:return new Uo({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 et=new ah,j=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;et.has(t.constructor)?i=et.get(t.constructor):(i=et.createDefault(t.constructor),et.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Lo(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 hc extends Error{constructor(){super(...arguments),this.schemas=[]}}class lh{static parse(t,r){const i=hr(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(Bt(r))return new r().fromASN(t);const o=et.get(r);et.cache(r);let s=o.schema;if(t.constructor===Fe&&o.type!==V.Choice){s=new Fe({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Zt({},t,s);if(!a.verified)throw new hc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(pc(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 c=o.itemType;if(typeof c=="number"){const d=Lo(c);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,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],p=y.type;if(typeof p=="number"||Bt(p)){const I=(i=y.converter)!==null&&i!==void 0?i:Bt(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?St:xt,h=new w;h.valueBlock=d.valueBlock;const g=hr(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 b=g.result.valueBlock.value;l[c]=Array.from(b,v=>I.fromASN(v))}else l[c]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(Bt(p))h=new p().toSchema("");else{const g=m[p],b=dc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=hr(h.toBER(!1)).result}l[c]=I.fromASN(w)}}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.");l[c]=Array.from(d,I=>this.fromASN(I,p))}else l[c]=this.fromASN(d,p)}return l}catch(o){throw o instanceof hc&&o.schemas.push(r.name),o}}}class Fo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&Bt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=et.get(r);et.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=Lo(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const l=i.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&sh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=Fo.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||Bt(l.type))){const y={};y.valueHex=d instanceof Gt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Zr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case V.Sequence:s=new St({value:o});break;case V.Set:s=new xt({value:o});break;case V.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 ${m[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?St:xt;s=new c({value:l})}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,c=>this.toASN(c)),l=t.repeated==="sequence"?St:xt;s=new l({value:a})}else s=this.toASN(o);return s}}class ce extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Fo.serialize(t)}static parse(t,r){return lh.parse(t,r)}static toString(t){const r=P.isBufferSource(t)?P.toArrayBuffer(t):G.serialize(t),i=hr(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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 yc={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,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,x=(h.match(c.zoneIndex)||[])[0],E,k;for(x&&(x=x.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(k=g-b,E=":";k--;)E+="0:";return h=h.replace("::",E),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const B=h.split(":"),S=[];for(let T=0;T<B.length;T++)S.push(parseInt(B[T],16));return S}(),{parts:g,zoneId:x}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,E;for(;v>0;){if(E=b-v,E<0&&(E=0),h[x]>>E!==g[x]>>E)return!1;v-=b,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 I(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let x,E,k;for(x=3;x>=0;x-=1)if(E=this.octets[x],E in v){if(k=v[E],b&&k!==0)return null;k!==8&&(b=!0),g+=k}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let E=0;for(;E<4;)x.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,b,v,x,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],b=0;b<4;)x.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.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)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,v;if(g=h.match(i.fourOctet))return function(){const x=g.slice(1,6),E=[];for(let k=0;k<x.length;k++)b=x[k],E.push(p(b));return E}();if(g=h.match(i.longValue)){if(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const x=[];let E;for(E=0;E<=24;E+=8)x.push(v>>E&255);return x}().reverse()}else return(g=h.match(i.twoOctet))?function(){const x=g.slice(1,4),E=[];if(v=p(x[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(x[0])),E.push(v>>16&255),E.push(v>>8&255),E.push(v&255),E}():(g=h.match(i.threeOctet))?function(){const x=g.slice(1,5),E=[];if(v=p(x[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(x[0])),E.push(p(x[1])),E.push(v>>8&255),E.push(v&255),E}():null},w.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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let v,x;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(x=this.parts[v],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={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,E;for(let k=7;k>=0;k-=1)if(x=this.parts[k],x in v){if(E=v[x],b&&E!==0)return null;E!==16&&(b=!0),g+=E}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let x=0;x<v.length;x++)g=v[x],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let x=0;x<this.parts.length;x++)v.push(I(this.parts[x].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},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),b=g[0],v=g[1];return new w.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let x=0;x<this.parts.length;x++)v.push(this.parts[x].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,x=-1,E;for(;E=g.exec(b);)E[0].length>x&&(v=E.index,x=E[0].length);return x<0?b:`${b.substring(0,v)}::${b.substring(v+x)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let E=0;for(;E<16;)x.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(x)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.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}},w.IPv6.networkAddressFromCIDR=function(h){let g,b,v,x,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],b=0;b<16;)x.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(x)}catch(k){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${k})`)}},w.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)},w.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,v,x,E,k;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(k=v[6]||"",g=d(v[1].slice(0,-1)+k,6),g.parts)){for(E=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<E.length;b++)if(x=E[b],!(0<=x&&x<=255))return null;return g.parts.push(E[0]<<8|E[1]),g.parts.push(E[2]<<8|E[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,b){let v,x,E,k;b==null&&(b="unicast");for(x in g)if(Object.prototype.hasOwnProperty.call(g,x)){for(E=g[x],E[0]&&!(E[0]instanceof Array)&&(E=[E]),v=0;v<E.length;v++)if(k=E[v],h.kind()===k[0].kind()&&h.match.apply(h,k))return x}return b},e.exports?e.exports=w:t.ipaddr=w})(xo)})(yc);var gc=yc.exports;class mc{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 gc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=gc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ho,qo,Ko;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:V.Choice})],Oe);let yr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],yr.prototype,"ia5String",void 0),u([f({type:m.Any})],yr.prototype,"anyValue",void 0),yr=u([j({type:V.Choice})],yr);class ei{constructor(t={}){this.type="",this.value=new yr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:yr})],ei.prototype,"value",void 0);let gr=Ho=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};gr=Ho=u([j({type:V.Set,itemType:ei})],gr);let zo=qo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};zo=qo=u([j({type:V.Sequence,itemType:gr})],zo);let we=Ko=class extends zo{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};we=Ko=u([j({type:V.Sequence})],we);const ch={fromASN:e=>mc.toString(rn.fromASN(e)),toASN:e=>rn.toASN(mc.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Go{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Go.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Go.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:we,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:Go,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:ch})],ie.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([j({type:V.Choice})],ie);const mr="1.3.6.1.5.5.7.3",Qt="2.5.29";var Wo;class nn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],nn.prototype,"accessMethod",void 0),u([f({type:ie})],nn.prototype,"accessLocation",void 0);let bc=Wo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};bc=Wo=u([j({type:V.Sequence,itemType:nn})],bc);const Jo=`${Qt}.35`;class Yo extends ae{}class Xt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Yo,context:0,optional:!0,implicit:!0})],Xt.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Xt.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:he})],Xt.prototype,"authorityCertSerialNumber",void 0);const wc=`${Qt}.19`;class on{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],on.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],on.prototype,"pathLenConstraint",void 0);var Zo;let Pe=Zo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};Pe=Zo=u([j({type:V.Sequence,itemType:ie})],Pe);var Qo;let vc=Qo=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};vc=Qo=u([j({type:V.Sequence})],vc);var Xo;const kc=`${Qt}.32`;let It=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],It.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],It.prototype,"visibleString",void 0),u([f({type:m.BmpString})],It.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],It.prototype,"utf8String",void 0),It=u([j({type:V.Choice})],It);class es{constructor(t={}){this.organization=new It,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:It})],es.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],es.prototype,"noticeNumbers",void 0);class ts{constructor(t={}){Object.assign(this,t)}}u([f({type:es,optional:!0})],ts.prototype,"noticeRef",void 0),u([f({type:It,optional:!0})],ts.prototype,"explicitText",void 0);let sn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],sn.prototype,"cPSuri",void 0),u([f({type:ts})],sn.prototype,"userNotice",void 0),sn=u([j({type:V.Choice})],sn);class rs{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],rs.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],rs.prototype,"qualifier",void 0);class an{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],an.prototype,"policyIdentifier",void 0),u([f({type:rs,repeated:"sequence",optional:!0})],an.prototype,"policyQualifiers",void 0);let ln=Xo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};ln=Xo=u([j({type:V.Sequence,itemType:an})],ln);let cn=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],cn.prototype,"value",void 0),cn=u([j({type:V.Choice})],cn);let Cc=class extends cn{};Cc=u([j({type:V.Choice})],Cc);var is,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 Sc extends tn{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 br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],br.prototype,"fullName",void 0),u([f({type:gr,context:1,implicit:!0})],br.prototype,"nameRelativeToCRLIssuer",void 0),br=u([j({type:V.Choice})],br);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:br,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:Sc,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ns=is=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};ns=is=u([j({type:V.Sequence,itemType:ri})],ns);var os;let xc=os=class extends ns{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};xc=os=u([j({type:V.Sequence,itemType:ri})],xc);class De{constructor(t={}){this.onlyContainsUserCerts=De.ONLY,this.onlyContainsCACerts=De.ONLY,this.indirectCRL=De.ONLY,this.onlyContainsAttributeCerts=De.ONLY,Object.assign(this,t)}}De.ONLY=!1,u([f({type:br,context:0,optional:!0})],De.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsCACerts",void 0),u([f({type:Sc,context:3,optional:!0,implicit:!0})],De.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:De.ONLY,implicit:!0})],De.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsAttributeCerts",void 0);var ii;(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"})(ii||(ii={}));let ss=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ss.prototype,"reason",void 0),ss=u([j({type:V.Choice})],ss);var as;const Ac=`${Qt}.37`;let un=as=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};un=as=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],un);const uh=`${mr}.1`,dh=`${mr}.2`,fh=`${mr}.3`,ph=`${mr}.4`,hh=`${mr}.8`,yh=`${mr}.9`;let ls=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],ls.prototype,"value",void 0),ls=u([j({type:V.Choice})],ls);let cs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],cs.prototype,"value",void 0),cs=u([j({type:V.Choice})],cs);var us;let Bc=us=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};Bc=us=u([j({type:V.Sequence})],Bc);const Ic=`${Qt}.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 ds extends tn{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 fs;class dn{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],dn.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],dn.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],dn.prototype,"maximum",void 0);let fn=fs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};fn=fs=u([j({type:V.Sequence,itemType:dn})],fn);class Ec{constructor(t={}){Object.assign(this,t)}}u([f({type:fn,context:0,optional:!0,implicit:!0})],Ec.prototype,"permittedSubtrees",void 0),u([f({type:fn,context:1,optional:!0,implicit:!0})],Ec.prototype,"excludedSubtrees",void 0);class Nc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:he})],Nc.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:he})],Nc.prototype,"inhibitPolicyMapping",void 0);var ps;class hs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],hs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],hs.prototype,"subjectDomainPolicy",void 0);let Oc=ps=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};Oc=ps=u([j({type:V.Sequence,itemType:hs})],Oc);var ys;const _c=`${Qt}.17`;let gs=ys=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gs=ys=u([j({type:V.Sequence})],gs);let Et=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Et.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Et.prototype,"values",void 0);var ms;let Vc=ms=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Vc=ms=u([j({type:V.Sequence,itemType:Et})],Vc);const Tc=`${Qt}.14`;class Mt extends Yo{}class jc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],jc.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],jc.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class Dc extends tn{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class $c{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Dc,Object.assign(this,t)}}u([f({type:m.GeneralString})],$c.prototype,"entrustVers",void 0),u([f({type:Dc})],$c.prototype,"entrustInfoFlags",void 0);var bs;let Mc=bs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};Mc=bs=u([j({type:V.Sequence,itemType:nn})],Mc);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&ul(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],H.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],H.prototype,"parameters",void 0);class Nt{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Nt.prototype,"algorithm",void 0),u([f({type:m.BitString})],Nt.prototype,"subjectPublicKey",void 0);let _e=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:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([j({type:V.Choice})],_e);class pn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],pn.prototype,"notBefore",void 0),u([f({type:_e})],pn.prototype,"notAfter",void 0);var ws;let at=class up{constructor(t={}){this.extnID="",this.critical=up.CRITICAL,this.extnValue=new ae,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ae})],at.prototype,"extnValue",void 0);let er=ws=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};er=ws=u([j({type:V.Sequence,itemType:at})],er);var wr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(wr||(wr={}));class tt{constructor(t={}){this.version=wr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new H,this.issuer=new we,this.validity=new pn,this.subject=new we,this.subjectPublicKeyInfo=new Nt,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:wr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],tt.prototype,"serialNumber",void 0),u([f({type:H})],tt.prototype,"signature",void 0),u([f({type:we})],tt.prototype,"issuer",void 0),u([f({type:pn})],tt.prototype,"validity",void 0),u([f({type:we})],tt.prototype,"subject",void 0),u([f({type:Nt})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:er,context:3,optional:!0})],tt.prototype,"extensions",void 0);class vr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],vr.prototype,"tbsCertificate",void 0),u([f({type:H})],vr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vr.prototype,"signatureValue",void 0);class hn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],hn.prototype,"userCertificate",void 0),u([f({type:_e})],hn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],hn.prototype,"crlEntryExtensions",void 0);class Ot{constructor(t={}){this.signature=new H,this.issuer=new we,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Ot.prototype,"version",void 0),u([f({type:H})],Ot.prototype,"signature",void 0),u([f({type:we})],Ot.prototype,"issuer",void 0),u([f({type:_e})],Ot.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Ot.prototype,"nextUpdate",void 0),u([f({type:hn,repeated:"sequence",optional:!0})],Ot.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Ot.prototype,"crlExtensions",void 0);let vs=class{constructor(t={}){this.tbsCertList=new Ot,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Ot})],vs.prototype,"tbsCertList",void 0),u([f({type:H})],vs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vs.prototype,"signature",void 0);class kr{constructor(t={}){this.issuer=new we,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:we})],kr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],kr.prototype,"serialNumber",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Cr.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Cr.prototype,"issuerAndSerialNumber",void 0),Cr=u([j({type:V.Choice})],Cr);var _t;(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"})(_t||(_t={}));let oi=class extends H{};oi=u([j({type:V.Sequence})],oi);let yn=class extends H{};yn=u([j({type:V.Sequence})],yn);let ht=class extends H{};ht=u([j({type:V.Sequence})],ht);let gn=class extends H{};gn=u([j({type:V.Sequence})],gn);let Pc=class extends H{};Pc=u([j({type:V.Sequence})],Pc);let ks=class extends H{};ks=u([j({type:V.Sequence})],ks);let Sr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Sr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],Sr.prototype,"attrValues",void 0);var Cs;class yt{constructor(t={}){this.version=_t.v0,this.sid=new Cr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new yn,this.signature=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],yt.prototype,"version",void 0),u([f({type:Cr})],yt.prototype,"sid",void 0),u([f({type:oi})],yt.prototype,"digestAlgorithm",void 0),u([f({type:Sr,repeated:"set",context:0,implicit:!0,optional:!0})],yt.prototype,"signedAttrs",void 0),u([f({type:yn})],yt.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],yt.prototype,"signature",void 0),u([f({type:Sr,repeated:"set",context:1,implicit:!0,optional:!0})],yt.prototype,"unsignedAttrs",void 0);let mn=Cs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};mn=Cs=u([j({type:V.Set,itemType:yt})],mn);let Rc=class extends _e{};Rc=u([j({type:V.Choice})],Rc);let Uc=class extends yt{};Uc=u([j({type:V.Sequence})],Uc);class Ss{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],Ss.prototype,"acIssuer",void 0),u([f({type:m.Integer})],Ss.prototype,"acSerial",void 0),u([f({type:Et,repeated:"sequence"})],Ss.prototype,"attrs",void 0);var xs;let bn=xs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};bn=xs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],bn);class wn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],wn.prototype,"pathLenConstraint",void 0),u([f({type:bn,implicit:!0,context:0,optional:!0})],wn.prototype,"permittedAttrs",void 0),u([f({type:bn,implicit:!0,context:1,optional:!0})],wn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],wn.prototype,"permitUnSpecified",void 0);class tr{constructor(t={}){this.issuer=new Pe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pe})],tr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],tr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],tr.prototype,"issuerUID",void 0);var As;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(As||(As={}));class rr{constructor(t={}){this.digestedObjectType=As.publicKey,this.digestAlgorithm=new H,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],rr.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],rr.prototype,"otherObjectTypeID",void 0),u([f({type:H})],rr.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],rr.prototype,"objectDigest",void 0);class vn{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,optional:!0})],vn.prototype,"issuerName",void 0),u([f({type:tr,context:0,implicit:!0,optional:!0})],vn.prototype,"baseCertificateID",void 0),u([f({type:rr,context:1,implicit:!0,optional:!0})],vn.prototype,"objectDigestInfo",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],xr.prototype,"v1Form",void 0),u([f({type:vn,context:0,implicit:!0})],xr.prototype,"v2Form",void 0),xr=u([j({type:V.Choice})],xr);class kn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],kn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],kn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:tr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Pe,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:rr,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Bs;(function(e){e[e.v2=1]="v2"})(Bs||(Bs={}));class lt{constructor(t={}){this.version=Bs.v2,this.holder=new si,this.issuer=new xr,this.signature=new H,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new kn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],lt.prototype,"version",void 0),u([f({type:si})],lt.prototype,"holder",void 0),u([f({type:xr})],lt.prototype,"issuer",void 0),u([f({type:H})],lt.prototype,"signature",void 0),u([f({type:m.Integer,converter:he})],lt.prototype,"serialNumber",void 0),u([f({type:kn})],lt.prototype,"attrCertValidityPeriod",void 0),u([f({type:Et,repeated:"sequence"})],lt.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],lt.prototype,"issuerUniqueID",void 0),u([f({type:er,optional:!0})],lt.prototype,"extensions",void 0);class Cn{constructor(t={}){this.acinfo=new lt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:lt})],Cn.prototype,"acinfo",void 0),u([f({type:H})],Cn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Cn.prototype,"signatureValue",void 0);var Sn;(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"})(Sn||(Sn={}));class Is extends tn{}class Es{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Es.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Es.prototype,"value",void 0);class Ns{constructor(t={}){this.policyId="",this.classList=new Is(Sn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ns.prototype,"policyId",void 0),u([f({type:Is,defaultValue:new Is(Sn.unclassified)})],Ns.prototype,"classList",void 0),u([f({type:Es,repeated:"set"})],Ns.prototype,"securityCategories",void 0);class xn{constructor(t={}){Object.assign(this,t)}}u([f({type:ae})],xn.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],xn.prototype,"oid",void 0),u([f({type:m.Utf8String})],xn.prototype,"string",void 0);class Lc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Lc.prototype,"policyAuthority",void 0),u([f({type:xn,repeated:"sequence"})],Lc.prototype,"values",void 0);var Os;class An{constructor(t={}){this.targetCertificate=new tr,Object.assign(this,t)}}u([f({type:tr})],An.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],An.prototype,"targetName",void 0),u([f({type:rr,optional:!0})],An.prototype,"certDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ar.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ar.prototype,"targetGroup",void 0),u([f({type:An,context:2,implicit:!0})],Ar.prototype,"targetCert",void 0),Ar=u([j({type:V.Choice})],Ar);let _s=Os=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};_s=Os=u([j({type:V.Sequence,itemType:Ar})],_s);var Vs;let Fc=Vs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Fc=Vs=u([j({type:V.Sequence,itemType:_s})],Fc);class Hc{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Hc.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Hc.prototype,"roleName",void 0);class Ts{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Ts.prototype,"service",void 0),u([f({type:ie})],Ts.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Ts.prototype,"authInfo",void 0);var js;class Ds{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ds.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ds.prototype,"otherCert",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:vr})],Br.prototype,"certificate",void 0),u([f({type:Cn,context:2,implicit:!0})],Br.prototype,"v2AttrCert",void 0),u([f({type:Ds,context:3,implicit:!0})],Br.prototype,"other",void 0),Br=u([j({type:V.Choice})],Br);let Bn=js=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Bn=js=u([j({type:V.Set,itemType:Br})],Bn);class Ir{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ir.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Ir.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([j({type:V.Choice})],ai);class In{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],In.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],In.prototype,"eContent",void 0);let li=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae,context:0,implicit:!0,optional:!0})],li.prototype,"value",void 0),u([f({type:ae,converter:Kp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],li.prototype,"constructedValue",void 0),li=u([j({type:V.Choice})],li);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new gn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:gn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:li,optional:!0})],ci.prototype,"encryptedContent",void 0);class En{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],En.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],En.prototype,"keyAttr",void 0);var $s;class Nn{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([f({type:Mt})],Nn.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],Nn.prototype,"date",void 0),u([f({type:En,optional:!0})],Nn.prototype,"other",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Nn,context:0,implicit:!0,optional:!0})],Er.prototype,"rKeyId",void 0),u([f({type:kr,optional:!0})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([j({type:V.Choice})],Er);class Ms{constructor(t={}){this.rid=new Er,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Er})],Ms.prototype,"rid",void 0),u([f({type:ae})],Ms.prototype,"encryptedKey",void 0);let On=$s=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};On=$s=u([j({type:V.Sequence,itemType:Ms})],On);class Ps{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Ps.prototype,"algorithm",void 0),u([f({type:m.BitString})],Ps.prototype,"publicKey",void 0);let ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0,optional:!0})],ir.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ps,context:1,implicit:!0,optional:!0})],ir.prototype,"originatorKey",void 0),u([f({type:kr,optional:!0})],ir.prototype,"issuerAndSerialNumber",void 0),ir=u([j({type:V.Choice})],ir);class Nr{constructor(t={}){this.version=_t.v3,this.originator=new ir,this.keyEncryptionAlgorithm=new ht,this.recipientEncryptedKeys=new On,Object.assign(this,t)}}u([f({type:m.Integer})],Nr.prototype,"version",void 0),u([f({type:ir,context:0})],Nr.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],Nr.prototype,"ukm",void 0),u([f({type:ht})],Nr.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:On})],Nr.prototype,"recipientEncryptedKeys",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Or.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([j({type:V.Choice})],Or);class ui{constructor(t={}){this.version=_t.v0,this.rid=new Or,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:Or})],ui.prototype,"rid",void 0),u([f({type:ht})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:En,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=_t.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:ht})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=_t.v0,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:ks,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:ht})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],pi.prototype,"encryptedKey",void 0);class Rs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Rs.prototype,"oriType",void 0),u([f({type:m.Any})],Rs.prototype,"oriValue",void 0);let Pt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],Pt.prototype,"ktri",void 0),u([f({type:Nr,context:1,implicit:!0,optional:!0})],Pt.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],Pt.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],Pt.prototype,"pwri",void 0),u([f({type:Rs,context:4,implicit:!0,optional:!0})],Pt.prototype,"ori",void 0),Pt=u([j({type:V.Choice})],Pt);var Us;let _n=Us=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Us.prototype)}};_n=Us=u([j({type:V.Set,itemType:Pt})],_n);var Ls;class Vn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Vn.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],Vn.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new Vn,Object.assign(this,t)}};u([f({type:Vn,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([j({type:V.Choice})],hi);let Fs=Ls=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ls.prototype)}};Fs=Ls=u([j({type:V.Set,itemType:hi})],Fs);class Hs{constructor(t={}){Object.assign(this,t)}}u([f({type:Bn,context:0,implicit:!0,optional:!0})],Hs.prototype,"certs",void 0),u([f({type:Fs,context:1,implicit:!0,optional:!0})],Hs.prototype,"crls",void 0);var qs;let Ks=qs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([j({type:V.Set,itemType:Sr})],Ks);class yi{constructor(t={}){this.version=_t.v0,this.recipientInfos=new _n,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Hs,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:_n})],yi.prototype,"recipientInfos",void 0),u([f({type:ci})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Ks,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const gh="1.2.840.113549.1.7.2";var zs;let Tn=zs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Tn=zs=u([j({type:V.Set,itemType:oi})],Tn);class _r{constructor(t={}){this.version=_t.v0,this.digestAlgorithms=new Tn,this.encapContentInfo=new In,this.signerInfos=new mn,Object.assign(this,t)}}u([f({type:m.Integer})],_r.prototype,"version",void 0),u([f({type:Tn})],_r.prototype,"digestAlgorithms",void 0),u([f({type:In})],_r.prototype,"encapContentInfo",void 0),u([f({type:Bn,context:0,implicit:!0,optional:!0})],_r.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],_r.prototype,"crls",void 0),u([f({type:mn})],_r.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Gs="1.2.840.10045.4.1",qc="1.2.840.10045.4.3.1",Ws="1.2.840.10045.4.3.2",Js="1.2.840.10045.4.3.3",Ys="1.2.840.10045.4.3.4",Kc="1.2.840.10045.3.1.7",zc="1.3.132.0.34",Gc="1.3.132.0.35";function mi(e){return new H({algorithm:e})}const mh=mi(Gs);mi(qc);const bh=mi(Ws),wh=mi(Js),vh=mi(Ys);let Vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Vr.prototype,"namedCurve",void 0),Vr=u([j({type:V.Choice})],Vr);class jn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],jn.prototype,"version",void 0),u([f({type:ae})],jn.prototype,"privateKey",void 0),u([f({type:Vr,context:0,optional:!0})],jn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],jn.prototype,"publicKey",void 0);class Dn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Dn.prototype,"r",void 0),u([f({type:m.Integer,converter:he})],Dn.prototype,"s",void 0);const He="1.2.840.113549.1.1",Tr=`${He}.1`,kh=`${He}.7`,Ch=`${He}.9`,Sh=`${He}.10`,xh=`${He}.2`,Ah=`${He}.4`,$n=`${He}.5`,Bh=`${He}.14`,Zs=`${He}.11`,Mn=`${He}.12`,Pn=`${He}.13`,Wc=`${He}.15`,Jc=`${He}.16`,Yc="1.3.14.3.2.26",Zc="2.16.840.1.101.3.4.2.4",Qc="2.16.840.1.101.3.4.2.1",Xc="2.16.840.1.101.3.4.2.2",eu="2.16.840.1.101.3.4.2.3",Ih="2.16.840.1.101.3.4.2.5",Eh="2.16.840.1.101.3.4.2.6",Nh="1.2.840.113549.2.2",Oh="1.2.840.113549.2.5",Qs=`${He}.8`;function ve(e){return new H({algorithm:e,parameters:null})}ve(Nh),ve(Oh);const nr=ve(Yc);ve(Zc),ve(Qc),ve(Xc),ve(eu),ve(Ih),ve(Eh);const tu=new H({algorithm:Qs,parameters:G.serialize(nr)}),ru=new H({algorithm:Ch,parameters:G.serialize(rn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ve(Tr),ve(xh),ve(Ah),ve($n),ve(Wc),ve(Jc),ve(Mn),ve(Pn),ve(Wc),ve(Jc);class Rn{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.pSourceAlgorithm=new H(ru),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],Rn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:tu})],Rn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:ru})],Rn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:kh,parameters:G.serialize(new Rn)});class bi{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],bi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:tu})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new H({algorithm:Sh,parameters:G.serialize(new bi)});class Un{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],Un.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Un.prototype,"digest",void 0);var Xs;class Ln{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Ln.prototype,"prime",void 0),u([f({type:m.Integer,converter:he})],Ln.prototype,"exponent",void 0),u([f({type:m.Integer,converter:he})],Ln.prototype,"coefficient",void 0);let ea=Xs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};ea=Xs=u([j({type:V.Sequence,itemType:Ln})],ea);class gt{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:m.Integer})],gt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"coefficient",void 0),u([f({type:ea,optional:!0})],gt.prototype,"otherPrimeInfos",void 0);class ta{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],ta.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],ta.prototype,"publicExponent",void 0);var ra;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(ra||(ra={}));const qe=ra;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}kl=Fe,R.Constructed=kl,Fe.NAME="CONSTRUCTED";class Cl extends Me{fromBER(t,r,i){return r}toBER(t){return nt}}Cl.override="EndOfContentValueBlock";var Sl;class Oo extends Ne{constructor(t={}){super(t,Cl),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}Sl=Oo,R.EndOfContent=Sl,Oo.NAME=Yr;var xl;class Gt extends Ne{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}`}}xl=Gt,R.Null=xl,Gt.NAME="NULL";class Al extends ft(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=P.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=P.toUint8Array(t);return Ct(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,dl.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}Al.NAME="BooleanValueBlock";var Bl;let Ui=class extends Ne{constructor(t={}){super(t,Al),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}`}};Bl=Ui,R.Boolean=Bl,Ui.NAME="BOOLEAN";class Il extends ft($t){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=$t.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===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==hl)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?$t.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Il.NAME="OctetStringValueBlock";var El;let Wt=class cp extends Ne{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},Il),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=pr(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?Fe.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${L.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 cp&&t.push(r.valueBlock.valueHexView);return P.concat(t)}};El=Wt,R.OctetString=El,Wt.NAME=hl;class Nl extends ft($t){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=$t.prototype.fromBER.call(this,t,r,i),o===-1)return o;for(const l of this.value){const c=l.constructor.NAME;if(c===Yr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(c!==yl)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=l.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=P.toUint8Array(t);if(!Ct(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 l=a.subarray(1);try{if(l.byteLength){const c=pr(l,0,l.byteLength);c.offset!==-1&&c.offset===i-1&&(this.value=[c.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return $t.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}}}Nl.NAME="BitStringValueBlock";var Ol;let Jt=class extends Ne{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},Nl),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 Fe.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)}`}}};Ol=Jt,R.BitString=Ol,Jt.NAME=yl;var _l;function jp(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,l=o.slice(0),c=l.length-1;let d=0;const y=c<a?a:c;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<l.length:d=s[a-p]+l[c-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=Bo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=Bo(r,s)),s}function Vl(e){if(e>=Jr.length)for(let t=Jr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Jr[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=Bo(r,i)),Jr.push(i)}return Jr[e]}function Dp(e,t){let r=0;const i=new Uint8Array(e),o=new Uint8Array(t),s=i.slice(0),a=s.length-1,l=o.slice(0),c=l.length-1;let d,y=0;for(let p=c;p>=0;p--,y++)switch(d=s[a-y]-l[c-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-c+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 _o extends ft(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=dl.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(Cp(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="",l=!1;for(let c=s.byteLength-1;c>=0;c--){o=s[c];for(let d=0;d<8;d++){if((o&1)===1)switch(i){case t:r=Dp(Vl(i),r),a="-";break;default:r=jp(r,Vl(i))}i++,o>>=1}}for(let c=0;c<r.length;c++)r[c]&&(l=!0),l&&(a+=fl.charAt(r[c]));return l===!1&&(a+=fl.charAt(0)),a}}_l=_o,_o.NAME="IntegerValueBlock",Object.defineProperty(_l.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Tl;class pt extends Ne{constructor(t={}){super(t,_o),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Mi(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Mi();const r=BigInt(t),i=new Pi,o=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(o));if(r<0){const l=new Uint8Array(s.length+(s[0]&128?1:0));l[0]|=128;const d=BigInt(`0x${L.ToHex(l)}`)+r,y=P.toUint8Array(L.FromHex(d.toString(16)));y[0]|=128,i.write(y)}else s[0]&128&&i.write(new Uint8Array([0])),i.write(s);return new pt({valueHex:i.final()})}convertToDER(){const t=new pt({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new pt({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Tl=pt,R.Integer=Tl,pt.NAME="INTEGER";var jl;class Li extends pt{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}jl=Li,R.Enumerated=jl,Li.NAME="ENUMERATED";class Vo extends ft(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=P.toUint8Array(t);if(!Ct(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let l=0;l<i&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=fr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Mi();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=Kt(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=L.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}}}Vo.NAME="sidBlock";class Dl 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 Vo;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 Io(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 l=0;switch(a.valueDec){case 0:break;case 1:l=40;break;case 2:l=80;break;default:this.value=[];return}const c=parseInt(o,10);if(isNaN(c))return;a.valueDec=c+l,s=!1}else{const a=new Vo;if(o>Number.MAX_SAFE_INTEGER){Mi();const l=BigInt(o);a.valueBigInt=l}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}}Dl.NAME="ObjectIdentifierValueBlock";var $l;class Fi extends Ne{constructor(t={}){super(t,Dl),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()}}}$l=Fi,R.ObjectIdentifier=$l,Fi.NAME="OBJECT IDENTIFIER";class To extends ft(zt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const o=P.toUint8Array(t);if(!Ct(this,o,r,i))return-1;const s=o.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let l=0;l<i&&(this.valueHexView[l]=s[l]&127,this.blockLength++,!!(s[l]&128));l++);const a=new Uint8Array(this.blockLength);for(let l=0;l<this.blockLength;l++)a[l]=this.valueHexView[l];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=fr(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=Kt(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=L.ToHex(this.valueHexView):t=this.valueDec.toString(),t}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}To.NAME="relativeSidBlock";class Ml 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 To;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 Io(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 To;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}}Ml.NAME="RelativeObjectIdentifierValueBlock";var Pl;class jo extends Ne{constructor(t={}){super(t,Ml),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()}}}Pl=jo,R.RelativeObjectIdentifier=Pl,jo.NAME="RelativeObjectIdentifier";var Rl;class St extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Rl=St,R.Sequence=Rl,St.NAME="SEQUENCE";var Ul;let xt=class extends Fe{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Ul=xt,R.Set=Ul,xt.NAME="SET";class Ll extends ft(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Le}toJSON(){return{...super.toJSON(),value:this.value}}}Ll.NAME="StringValueBlock";class Fl extends Ll{}Fl.NAME="SimpleStringValueBlock";class Je extends No{constructor({...t}={}){super(t,Fl)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,P.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 Hl extends Je{fromBuffer(t){this.valueBlock.valueHexView=P.toUint8Array(t);try{this.valueBlock.value=L.ToUtf8String(t)}catch(r){this.warnings.push(`Error during "decodeURIComponent": ${r}, using raw string`),this.valueBlock.value=L.ToBinary(t)}}fromString(t){this.valueBlock.valueHexView=new Uint8Array(L.FromUtf8String(t)),this.valueBlock.value=t}}Hl.NAME="Utf8StringValueBlock";var ql;class At extends Hl{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}ql=At,R.Utf8String=ql,At.NAME="UTF8String";class Kl extends Je{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=P.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Kl.NAME="BmpStringValueBlock";var zl;class Hi extends Kl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}zl=Hi,R.BmpString=zl,Hi.NAME="BMPString";class Gl 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=Kt(t.charCodeAt(o),8),a=new Uint8Array(s);if(a.length>4)continue;const l=4-a.length;for(let c=a.length-1;c>=0;c--)i[o*4+c+l]=a[c]}this.valueBlock.value=t}}Gl.NAME="UniversalStringValueBlock";var Wl;class qi extends Gl{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Wl=qi,R.UniversalString=Wl,qi.NAME="UniversalString";var Jl;class Ki extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Jl=Ki,R.NumericString=Jl,Ki.NAME="NumericString";var Yl;class zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Yl=zi,R.PrintableString=Yl,zi.NAME="PrintableString";var Zl;class Gi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Zl=Gi,R.TeletexString=Zl,Gi.NAME="TeletexString";var Ql;class Wi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Ql=Wi,R.VideotexString=Ql,Wi.NAME="VideotexString";var Xl;class Ji extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Xl=Ji,R.IA5String=Xl,Ji.NAME="IA5String";var ec;class Yi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}ec=Yi,R.GraphicString=ec,Yi.NAME="GraphicString";var tc;class Qr extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}tc=Qr,R.VisibleString=tc,Qr.NAME="VisibleString";var rc;class Zi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}rc=Zi,R.GeneralString=rc,Zi.NAME="GeneralString";var ic;class Qi extends Je{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}ic=Qi,R.CharacterString=ic,Qi.NAME="CharacterString";var nc;class Xr extends Qr{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,P.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}}}nc=Xr,R.UTCTime=nc,Xr.NAME="UTCTime";var oc;class Xi extends Xr{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,l=0,c=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,I=i.indexOf("+"),w="";if(I===-1&&(I=i.indexOf("-"),p=-1),I!==-1){if(w=i.substring(I+1),i=i.substring(0,I),w.length!==2&&w.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(w.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(l=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");c=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)+l;break;case 5:this.minute=parseInt(y[p],10)+c;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}}}oc=Xi,R.GeneralizedTime=oc,Xi.NAME="GeneralizedTime";var sc;class Do extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}sc=Do,R.DATE=sc,Do.NAME="DATE";var ac;class $o extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}ac=$o,R.TimeOfDay=ac,$o.NAME="TimeOfDay";var lc;class Mo extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}lc=Mo,R.DateTime=lc,Mo.NAME="DateTime";var cc;class Po extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}cc=Po,R.Duration=cc,Po.NAME="Duration";var uc;class Ro extends At{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}uc=Ro,R.TIME=uc,Ro.NAME="TIME";class Yt{constructor({name:t=Le,optional:r=!1}={}){this.name=t,this.optional=r}}class Uo extends Yt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class en extends Yt{constructor({value:t=new Yt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class $p{constructor({data:t=Ri}={}){this.dataView=P.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=P.toUint8Array(t)}fromBER(t,r,i){const o=r+i;return this.dataView=P.toUint8Array(t).subarray(r,o),o}toBER(t){return this.dataView.slice().buffer}}function Zt(e,t,r){if(r instanceof Uo){for(let s=0;s<r.value.length;s++)if(Zt(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(Eo)&&(s.name=r.name),s}}if(r instanceof Yt)return r.hasOwnProperty(Eo)&&(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(!(Ap 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(Bp)===!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(Ip)===!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(Ep)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(xp 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(!(pl 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 l=0;l<s.length;l++)if(s[l]!==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 R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},l=r.valueBlock.value.length;if(l>0&&r.valueBlock.value[0]instanceof en&&(l=t.valueBlock.value.length),l===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let c=!0;for(let d=0;d<r.valueBlock.value.length;d++)c=c&&(r.valueBlock.value[d].optional||!1);return c?{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 c=0;c<l;c++)if(c-s>=t.valueBlock.value.length){if(r.valueBlock.value[c].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 en){if(a=Zt(e,t.valueBlock.value[c],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(Eo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};_p 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[c])}}else if(a=Zt(e,t.valueBlock.value[c-s],r.valueBlock.value[c]),a.verified===!1)if(r.valueBlock.value[c].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 c={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Le),r.name&&(delete e[r.name],c.name=r.name)),c}return{verified:!0,result:e}}if(r.primitiveSchema&&pl in t.valueBlock){const s=pr(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 Zt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Mp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=pr(P.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Zt(r.result,r.result,t)}const dc=Object.freeze(Object.defineProperty({__proto__:null,Any:Yt,BaseBlock:Ne,BaseStringBlock:No,BitString:Jt,BmpString:Hi,Boolean:Ui,CharacterString:Qi,Choice:Uo,Constructed:Fe,DATE:Do,DateTime:Mo,Duration:Po,EndOfContent:Oo,Enumerated:Li,GeneralString:Zi,GeneralizedTime:Xi,GraphicString:Yi,HexBlock:ft,IA5String:Ji,Integer:pt,Null:Gt,NumericString:Ki,ObjectIdentifier:Fi,OctetString:Wt,Primitive:Zr,PrintableString:zi,RawData:$p,RelativeObjectIdentifier:jo,Repeated:en,Sequence:St,Set:xt,TIME:Ro,TeletexString:Gi,TimeOfDay:$o,UTCTime:Xr,UniversalString:qi,Utf8String:At,ValueBlock:Me,VideotexString:Wi,ViewWriter:Pi,VisibleString:Qr,compareSchema:Zt,fromBER:hr,verifySchema:Mp},Symbol.toStringTag,{value:"Module"}));var V;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(V||(V={}));var m;(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"})(m||(m={}));class tn{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if(P.isBufferSource(t))this.unusedBits=r,this.value=P.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Jt))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 Jt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Jt({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 ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):P.isBufferSource(t)?this.buffer=P.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Wt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Wt({valueHex:this.buffer})}toSchema(t){return new Wt({name:t})}}const Pp={fromASN:e=>e instanceof Gt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new Gt;const t=hr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Rp={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new pt({value:+e})},Up={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Li({value:e})},he={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new pt({valueHex:e})},Lp={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Jt({valueHex:e})},Fp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Fi({value:e})},Hp={fromASN:e=>e.valueBlock.value,toASN:e=>new Ui({value:e})},rn={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Wt({valueHex:e})},qp={fromASN:e=>new ae(e.getValue()),toASN:e=>e.toASN()};function Xe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const fc=Xe(At),Kp=Xe(Hi),zp=Xe(qi),Gp=Xe(Ki),Wp=Xe(zi),Jp=Xe(Gi),Yp=Xe(Wi),Zp=Xe(Ji),Qp=Xe(Yi),Xp=Xe(Qr),eh=Xe(Zi),th=Xe(Qi),rh={fromASN:e=>e.toDate(),toASN:e=>new Xr({valueDate:e})},ih={fromASN:e=>e.toDate(),toASN:e=>new Xi({valueDate:e})},nh={fromASN:()=>null,toASN:()=>new Gt};function Lo(e){switch(e){case m.Any:return Pp;case m.BitString:return Lp;case m.BmpString:return Kp;case m.Boolean:return Hp;case m.CharacterString:return th;case m.Enumerated:return Up;case m.GeneralString:return eh;case m.GeneralizedTime:return ih;case m.GraphicString:return Qp;case m.IA5String:return Zp;case m.Integer:return Rp;case m.Null:return nh;case m.NumericString:return Gp;case m.ObjectIdentifier:return Fp;case m.OctetString:return rn;case m.PrintableString:return Wp;case m.TeletexString:return Jp;case m.UTCTime:return rh;case m.UniversalString:return zp;case m.Utf8String:return fc;case m.VideotexString:return Yp;case m.VisibleString:return Xp;default:return null}}function Bt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:Bt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function pc(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:pc(r)}return!1}function oh(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 sh{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:V.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],l=r?s:"";let c;if(typeof a.type=="number"){const y=m[a.type],p=dc[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);c=new p({name:l})}else Bt(a.type)?c=new a.type().toSchema(l):a.optional?this.get(a.type).type===V.Choice?c=new Yt({name:l}):(c=this.create(a.type,!1),c.name=l):c=new Yt({name:l});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){c.name="";const y=a.repeated==="set"?xt:St;c=new y({name:"",value:[new en({name:l,value:c})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||Bt(a.type)){const y=a.repeated?Fe:Zr;o.push(new y({name:l,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?c:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,o.push(new Fe({name:y?"":l,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else o.push(new Fe({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[c]}));else c.optional=d,o.push(c)}switch(i.type){case V.Sequence:return new St({value:o,name:""});case V.Set:return new xt({value:o,name:""});case V.Choice:return new Uo({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 et=new sh,j=e=>t=>{let r;et.has(t)?r=et.get(t):(r=et.createDefault(t),et.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;et.has(t.constructor)?i=et.get(t.constructor):(i=et.createDefault(t.constructor),et.set(t.constructor,i));const o=Object.assign({},e);if(typeof o.type=="number"&&!o.converter){const s=Lo(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 hc extends Error{constructor(){super(...arguments),this.schemas=[]}}class ah{static parse(t,r){const i=hr(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(Bt(r))return new r().fromASN(t);const o=et.get(r);et.cache(r);let s=o.schema;if(t.constructor===Fe&&o.type!==V.Choice){s=new Fe({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:o.schema.valueBlock.value});for(const c in o.items)delete t[c]}const a=Zt({},t,s);if(!a.verified)throw new hc(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const l=new r;if(pc(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 c=o.itemType;if(typeof c=="number"){const d=Lo(c);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,c))}for(const c in o.items){const d=a.result[c];if(!d)continue;const y=o.items[c],p=y.type;if(typeof p=="number"||Bt(p)){const I=(i=y.converter)!==null&&i!==void 0?i:Bt(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?St:xt,h=new w;h.valueBlock=d.valueBlock;const g=hr(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 b=g.result.valueBlock.value;l[c]=Array.from(b,v=>I.fromASN(v))}else l[c]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(Bt(p))h=new p().toSchema("");else{const g=m[p],b=dc[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=hr(h.toBER(!1)).result}l[c]=I.fromASN(w)}}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.");l[c]=Array.from(d,I=>this.fromASN(I,p))}else l[c]=this.fromASN(d,p)}return l}catch(o){throw o instanceof hc&&o.schemas.push(r.name),o}}}class Fo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&Bt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=et.get(r);et.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=Lo(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);o=t.map(l=>a.toASN(l))}else o=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const l=i.items[a],c=t[a];if(c===void 0||l.defaultValue===c||typeof l.defaultValue=="object"&&typeof c=="object"&&oh(this.serialize(l.defaultValue),this.serialize(c)))continue;const d=Fo.toAsnItem(l,a,r,c);if(typeof l.context=="number")if(l.implicit)if(!l.repeated&&(typeof l.type=="number"||Bt(l.type))){const y={};y.valueHex=d instanceof Gt?d.valueBeforeDecodeView:d.valueBlock.toBER(),o.push(new Zr({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},...y}))}else o.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:d.valueBlock.value}));else o.push(new Fe({optional:l.optional,idBlock:{tagClass:3,tagNumber:l.context},value:[d]}));else l.repeated?o=o.concat(d):o.push(d)}let s;switch(i.type){case V.Sequence:s=new St({value:o});break;case V.Set:s=new xt({value:o});break;case V.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 ${m[t.type]} in schema '${i.name}'`);if(t.repeated){if(!Array.isArray(o))throw new TypeError("Parameter 'objProp' should be type of Array.");const l=Array.from(o,d=>a.toASN(d)),c=t.repeated==="sequence"?St:xt;s=new c({value:l})}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,c=>this.toASN(c)),l=t.repeated==="sequence"?St:xt;s=new l({value:a})}else s=this.toASN(o);return s}}class ce extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Fo.serialize(t)}static parse(t,r){return ah.parse(t,r)}static toString(t){const r=P.isBufferSource(t)?P.toArrayBuffer(t):G.serialize(t),i=hr(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 l=e.length-1;l>=0;l--)(a=e[l])&&(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 yc={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,}",l="(?:[0-9a-f]+::?)+",c={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${l})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${l})|(?:::)(?:${l})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,v=-1,x=(h.match(c.zoneIndex)||[])[0],E,k;for(x&&(x=x.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(k=g-b,E=":";k--;)E+="0:";return h=h.replace("::",E),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),g=function(){const B=h.split(":"),S=[];for(let T=0;T<B.length;T++)S.push(parseInt(B[T],16));return S}(),{parts:g,zoneId:x}}function y(h,g,b,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,E;for(;v>0;){if(E=b-v,E<0&&(E=0),h[x]>>E!==g[x]>>E)return!1;v-=b,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 I(h,g){for(;h.length<g;)h=`0${h}`;return h}const w={};w.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let x,E,k;for(x=3;x>=0;x-=1)if(E=this.octets[x],E in v){if(k=v[E],b&&k!==0)return null;k!==8&&(b=!0),g+=k}else return null;return 32-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return w.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),w.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let E=0;for(;E<4;)x.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.IPv4.isIPv4=function(h){return this.parser(h)!==null},w.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},w.IPv4.isValidFourPartDecimal=function(h){return!!(w.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},w.IPv4.networkAddressFromCIDR=function(h){let g,b,v,x,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],b=0;b<4;)x.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},w.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)},w.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,v;if(g=h.match(i.fourOctet))return function(){const x=g.slice(1,6),E=[];for(let k=0;k<x.length;k++)b=x[k],E.push(p(b));return E}();if(g=h.match(i.longValue)){if(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const x=[];let E;for(E=0;E<=24;E+=8)x.push(v>>E&255);return x}().reverse()}else return(g=h.match(i.twoOctet))?function(){const x=g.slice(1,4),E=[];if(v=p(x[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(x[0])),E.push(v>>16&255),E.push(v>>8&255),E.push(v&255),E}():(g=h.match(i.threeOctet))?function(){const x=g.slice(1,5),E=[];if(v=p(x[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(x[0])),E.push(p(x[1])),E.push(v>>8&255),E.push(v&255),E}():null},w.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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let v,x;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(x=this.parts[v],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}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,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={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,E;for(let k=7;k>=0;k-=1)if(x=this.parts[k],x in v){if(E=v[x],b&&E!==0)return null;E!==16&&(b=!0),g+=E}else return null;return 128-g},h.prototype.range=function(){return w.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let x=0;x<v.length;x++)g=v[x],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let x=0;x<this.parts.length;x++)v.push(I(this.parts[x].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},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),b=g[0],v=g[1];return new w.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let x=0;x<this.parts.length;x++)v.push(this.parts[x].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,x=-1,E;for(;E=g.exec(b);)E[0].length>x&&(v=E.index,x=E[0].length);return x<0?b:`${b.substring(0,v)}::${b.substring(v+x)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[];let E=0;for(;E<16;)x.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(x)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},w.IPv6.isIPv6=function(h){return this.parser(h)!==null},w.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}},w.IPv6.networkAddressFromCIDR=function(h){let g,b,v,x,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),x=[],b=0;b<16;)x.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(x)}catch(k){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${k})`)}},w.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)},w.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,v,x,E,k;if(v=h.match(c.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(c.native.test(h))return d(h,8);if((v=h.match(c.transitional))&&(k=v[6]||"",g=d(v[1].slice(0,-1)+k,6),g.parts)){for(E=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[5])],b=0;b<E.length;b++)if(x=E[b],!(0<=x&&x<=255))return null;return g.parts.push(E[0]<<8|E[1]),g.parts.push(E[2]<<8|E[3]),{parts:g.parts,zoneId:g.zoneId}}return null},w.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 b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.fromByteArray=function(h){const g=h.length;if(g===4)return new w.IPv4(h);if(g===16)return new w.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},w.isValid=function(h){return w.IPv6.isValid(h)||w.IPv4.isValid(h)},w.parse=function(h){if(w.IPv6.isValid(h))return w.IPv6.parse(h);if(w.IPv4.isValid(h))return w.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},w.parseCIDR=function(h){try{return w.IPv6.parseCIDR(h)}catch{try{return w.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},w.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},w.subnetMatch=function(h,g,b){let v,x,E,k;b==null&&(b="unicast");for(x in g)if(Object.prototype.hasOwnProperty.call(g,x)){for(E=g[x],E[0]&&!(E[0]instanceof Array)&&(E=[E]),v=0;v<E.length;v++)if(k=E[v],h.kind()===k[0].kind()&&h.match.apply(h,k))return x}return b},e.exports?e.exports=w:t.ipaddr=w})(xo)})(yc);var gc=yc.exports;class mc{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 gc.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=gc.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Ho,qo,Ko;let Oe=class{constructor(t={}){Object.assign(this,t)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};u([f({type:m.TeletexString})],Oe.prototype,"teletexString",void 0),u([f({type:m.PrintableString})],Oe.prototype,"printableString",void 0),u([f({type:m.UniversalString})],Oe.prototype,"universalString",void 0),u([f({type:m.Utf8String})],Oe.prototype,"utf8String",void 0),u([f({type:m.BmpString})],Oe.prototype,"bmpString",void 0),Oe=u([j({type:V.Choice})],Oe);let yr=class extends Oe{constructor(t={}){super(t),Object.assign(this,t)}toString(){return this.ia5String||(this.anyValue?L.ToHex(this.anyValue):super.toString())}};u([f({type:m.IA5String})],yr.prototype,"ia5String",void 0),u([f({type:m.Any})],yr.prototype,"anyValue",void 0),yr=u([j({type:V.Choice})],yr);class ei{constructor(t={}){this.type="",this.value=new yr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"type",void 0),u([f({type:yr})],ei.prototype,"value",void 0);let gr=Ho=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};gr=Ho=u([j({type:V.Set,itemType:ei})],gr);let zo=qo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};zo=qo=u([j({type:V.Sequence,itemType:gr})],zo);let we=Ko=class extends zo{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};we=Ko=u([j({type:V.Sequence})],we);const lh={fromASN:e=>mc.toString(rn.fromASN(e)),toASN:e=>rn.toASN(mc.fromString(e))};class ti{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ti.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ti.prototype,"value",void 0);class Go{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Go.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Go.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ti,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type:m.IA5String,context:1,implicit:!0})],ie.prototype,"rfc822Name",void 0),u([f({type:m.IA5String,context:2,implicit:!0})],ie.prototype,"dNSName",void 0),u([f({type:m.Any,context:3,implicit:!0})],ie.prototype,"x400Address",void 0),u([f({type:we,context:4,implicit:!1})],ie.prototype,"directoryName",void 0),u([f({type:Go,context:5})],ie.prototype,"ediPartyName",void 0),u([f({type:m.IA5String,context:6,implicit:!0})],ie.prototype,"uniformResourceIdentifier",void 0),u([f({type:m.OctetString,context:7,implicit:!0,converter:lh})],ie.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([j({type:V.Choice})],ie);const mr="1.3.6.1.5.5.7.3",Qt="2.5.29";var Wo;class nn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],nn.prototype,"accessMethod",void 0),u([f({type:ie})],nn.prototype,"accessLocation",void 0);let bc=Wo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Wo.prototype)}};bc=Wo=u([j({type:V.Sequence,itemType:nn})],bc);const Jo=`${Qt}.35`;class Yo extends ae{}class Xt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Yo,context:0,optional:!0,implicit:!0})],Xt.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Xt.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:he})],Xt.prototype,"authorityCertSerialNumber",void 0);const wc=`${Qt}.19`;class on{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],on.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],on.prototype,"pathLenConstraint",void 0);var Zo;let Pe=Zo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};Pe=Zo=u([j({type:V.Sequence,itemType:ie})],Pe);var Qo;let vc=Qo=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};vc=Qo=u([j({type:V.Sequence})],vc);var Xo;const kc=`${Qt}.32`;let It=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],It.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],It.prototype,"visibleString",void 0),u([f({type:m.BmpString})],It.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],It.prototype,"utf8String",void 0),It=u([j({type:V.Choice})],It);class es{constructor(t={}){this.organization=new It,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:It})],es.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],es.prototype,"noticeNumbers",void 0);class ts{constructor(t={}){Object.assign(this,t)}}u([f({type:es,optional:!0})],ts.prototype,"noticeRef",void 0),u([f({type:It,optional:!0})],ts.prototype,"explicitText",void 0);let sn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],sn.prototype,"cPSuri",void 0),u([f({type:ts})],sn.prototype,"userNotice",void 0),sn=u([j({type:V.Choice})],sn);class rs{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],rs.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],rs.prototype,"qualifier",void 0);class an{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],an.prototype,"policyIdentifier",void 0),u([f({type:rs,repeated:"sequence",optional:!0})],an.prototype,"policyQualifiers",void 0);let ln=Xo=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};ln=Xo=u([j({type:V.Sequence,itemType:an})],ln);let cn=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],cn.prototype,"value",void 0),cn=u([j({type:V.Choice})],cn);let Cc=class extends cn{};Cc=u([j({type:V.Choice})],Cc);var is,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 Sc extends tn{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 br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],br.prototype,"fullName",void 0),u([f({type:gr,context:1,implicit:!0})],br.prototype,"nameRelativeToCRLIssuer",void 0),br=u([j({type:V.Choice})],br);class ri{constructor(t={}){Object.assign(this,t)}}u([f({type:br,context:0,optional:!0})],ri.prototype,"distributionPoint",void 0),u([f({type:Sc,context:1,optional:!0,implicit:!0})],ri.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ri.prototype,"cRLIssuer",void 0);let ns=is=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};ns=is=u([j({type:V.Sequence,itemType:ri})],ns);var os;let xc=os=class extends ns{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};xc=os=u([j({type:V.Sequence,itemType:ri})],xc);class De{constructor(t={}){this.onlyContainsUserCerts=De.ONLY,this.onlyContainsCACerts=De.ONLY,this.indirectCRL=De.ONLY,this.onlyContainsAttributeCerts=De.ONLY,Object.assign(this,t)}}De.ONLY=!1,u([f({type:br,context:0,optional:!0})],De.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsCACerts",void 0),u([f({type:Sc,context:3,optional:!0,implicit:!0})],De.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:De.ONLY,implicit:!0})],De.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:De.ONLY,implicit:!0})],De.prototype,"onlyContainsAttributeCerts",void 0);var ii;(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"})(ii||(ii={}));let ss=class{constructor(t=ii.unspecified){this.reason=ii.unspecified,this.reason=t}toJSON(){return ii[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ss.prototype,"reason",void 0),ss=u([j({type:V.Choice})],ss);var as;const Ac=`${Qt}.37`;let un=as=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};un=as=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],un);const ch=`${mr}.1`,uh=`${mr}.2`,dh=`${mr}.3`,fh=`${mr}.4`,ph=`${mr}.8`,hh=`${mr}.9`;let ls=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],ls.prototype,"value",void 0),ls=u([j({type:V.Choice})],ls);let cs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],cs.prototype,"value",void 0),cs=u([j({type:V.Choice})],cs);var us;let Bc=us=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};Bc=us=u([j({type:V.Sequence})],Bc);const Ic=`${Qt}.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 ds extends tn{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 fs;class dn{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],dn.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],dn.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],dn.prototype,"maximum",void 0);let fn=fs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};fn=fs=u([j({type:V.Sequence,itemType:dn})],fn);class Ec{constructor(t={}){Object.assign(this,t)}}u([f({type:fn,context:0,optional:!0,implicit:!0})],Ec.prototype,"permittedSubtrees",void 0),u([f({type:fn,context:1,optional:!0,implicit:!0})],Ec.prototype,"excludedSubtrees",void 0);class Nc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:he})],Nc.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:he})],Nc.prototype,"inhibitPolicyMapping",void 0);var ps;class hs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],hs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],hs.prototype,"subjectDomainPolicy",void 0);let Oc=ps=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};Oc=ps=u([j({type:V.Sequence,itemType:hs})],Oc);var ys;const _c=`${Qt}.17`;let gs=ys=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};gs=ys=u([j({type:V.Sequence})],gs);let Et=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Et.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Et.prototype,"values",void 0);var ms;let Vc=ms=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Vc=ms=u([j({type:V.Sequence,itemType:Et})],Vc);const Tc=`${Qt}.14`;class Mt extends Yo{}class jc{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],jc.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],jc.prototype,"notAfter",void 0);var ni;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ni||(ni={}));class Dc extends tn{toJSON(){const t=[],r=this.toNumber();return r&ni.pKIXCertificate&&t.push("pKIXCertificate"),r&ni.newExtensions&&t.push("newExtensions"),r&ni.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class $c{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Dc,Object.assign(this,t)}}u([f({type:m.GeneralString})],$c.prototype,"entrustVers",void 0),u([f({type:Dc})],$c.prototype,"entrustInfoFlags",void 0);var bs;let Mc=bs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};Mc=bs=u([j({type:V.Sequence,itemType:nn})],Mc);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&ul(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],H.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],H.prototype,"parameters",void 0);class Nt{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Nt.prototype,"algorithm",void 0),u([f({type:m.BitString})],Nt.prototype,"subjectPublicKey",void 0);let _e=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:m.UTCTime})],_e.prototype,"utcTime",void 0),u([f({type:m.GeneralizedTime})],_e.prototype,"generalTime",void 0),_e=u([j({type:V.Choice})],_e);class pn{constructor(t){this.notBefore=new _e(new Date),this.notAfter=new _e(new Date),t&&(this.notBefore=new _e(t.notBefore),this.notAfter=new _e(t.notAfter))}}u([f({type:_e})],pn.prototype,"notBefore",void 0),u([f({type:_e})],pn.prototype,"notAfter",void 0);var ws;let at=class up{constructor(t={}){this.extnID="",this.critical=up.CRITICAL,this.extnValue=new ae,Object.assign(this,t)}};at.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],at.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:at.CRITICAL})],at.prototype,"critical",void 0),u([f({type:ae})],at.prototype,"extnValue",void 0);let er=ws=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ws.prototype)}};er=ws=u([j({type:V.Sequence,itemType:at})],er);var wr;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(wr||(wr={}));class tt{constructor(t={}){this.version=wr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new H,this.issuer=new we,this.validity=new pn,this.subject=new we,this.subjectPublicKeyInfo=new Nt,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:wr.v1})],tt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],tt.prototype,"serialNumber",void 0),u([f({type:H})],tt.prototype,"signature",void 0),u([f({type:we})],tt.prototype,"issuer",void 0),u([f({type:pn})],tt.prototype,"validity",void 0),u([f({type:we})],tt.prototype,"subject",void 0),u([f({type:Nt})],tt.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],tt.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],tt.prototype,"subjectUniqueID",void 0),u([f({type:er,context:3,optional:!0})],tt.prototype,"extensions",void 0);class vr{constructor(t={}){this.tbsCertificate=new tt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:tt})],vr.prototype,"tbsCertificate",void 0),u([f({type:H})],vr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vr.prototype,"signatureValue",void 0);class hn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],hn.prototype,"userCertificate",void 0),u([f({type:_e})],hn.prototype,"revocationDate",void 0),u([f({type:at,optional:!0,repeated:"sequence"})],hn.prototype,"crlEntryExtensions",void 0);class Ot{constructor(t={}){this.signature=new H,this.issuer=new we,this.thisUpdate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],Ot.prototype,"version",void 0),u([f({type:H})],Ot.prototype,"signature",void 0),u([f({type:we})],Ot.prototype,"issuer",void 0),u([f({type:_e})],Ot.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Ot.prototype,"nextUpdate",void 0),u([f({type:hn,repeated:"sequence",optional:!0})],Ot.prototype,"revokedCertificates",void 0),u([f({type:at,optional:!0,context:0,repeated:"sequence"})],Ot.prototype,"crlExtensions",void 0);let vs=class{constructor(t={}){this.tbsCertList=new Ot,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Ot})],vs.prototype,"tbsCertList",void 0),u([f({type:H})],vs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vs.prototype,"signature",void 0);class kr{constructor(t={}){this.issuer=new we,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:we})],kr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],kr.prototype,"serialNumber",void 0);let Cr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Cr.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Cr.prototype,"issuerAndSerialNumber",void 0),Cr=u([j({type:V.Choice})],Cr);var _t;(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"})(_t||(_t={}));let oi=class extends H{};oi=u([j({type:V.Sequence})],oi);let yn=class extends H{};yn=u([j({type:V.Sequence})],yn);let ht=class extends H{};ht=u([j({type:V.Sequence})],ht);let gn=class extends H{};gn=u([j({type:V.Sequence})],gn);let Pc=class extends H{};Pc=u([j({type:V.Sequence})],Pc);let ks=class extends H{};ks=u([j({type:V.Sequence})],ks);let Sr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Sr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],Sr.prototype,"attrValues",void 0);var Cs;class yt{constructor(t={}){this.version=_t.v0,this.sid=new Cr,this.digestAlgorithm=new oi,this.signatureAlgorithm=new yn,this.signature=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],yt.prototype,"version",void 0),u([f({type:Cr})],yt.prototype,"sid",void 0),u([f({type:oi})],yt.prototype,"digestAlgorithm",void 0),u([f({type:Sr,repeated:"set",context:0,implicit:!0,optional:!0})],yt.prototype,"signedAttrs",void 0),u([f({type:yn})],yt.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],yt.prototype,"signature",void 0),u([f({type:Sr,repeated:"set",context:1,implicit:!0,optional:!0})],yt.prototype,"unsignedAttrs",void 0);let mn=Cs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};mn=Cs=u([j({type:V.Set,itemType:yt})],mn);let Rc=class extends _e{};Rc=u([j({type:V.Choice})],Rc);let Uc=class extends yt{};Uc=u([j({type:V.Sequence})],Uc);class Ss{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],Ss.prototype,"acIssuer",void 0),u([f({type:m.Integer})],Ss.prototype,"acSerial",void 0),u([f({type:Et,repeated:"sequence"})],Ss.prototype,"attrs",void 0);var xs;let bn=xs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};bn=xs=u([j({type:V.Sequence,itemType:m.ObjectIdentifier})],bn);class wn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],wn.prototype,"pathLenConstraint",void 0),u([f({type:bn,implicit:!0,context:0,optional:!0})],wn.prototype,"permittedAttrs",void 0),u([f({type:bn,implicit:!0,context:1,optional:!0})],wn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],wn.prototype,"permitUnSpecified",void 0);class tr{constructor(t={}){this.issuer=new Pe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pe})],tr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],tr.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],tr.prototype,"issuerUID",void 0);var As;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(As||(As={}));class rr{constructor(t={}){this.digestedObjectType=As.publicKey,this.digestAlgorithm=new H,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],rr.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],rr.prototype,"otherObjectTypeID",void 0),u([f({type:H})],rr.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],rr.prototype,"objectDigest",void 0);class vn{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,optional:!0})],vn.prototype,"issuerName",void 0),u([f({type:tr,context:0,implicit:!0,optional:!0})],vn.prototype,"baseCertificateID",void 0),u([f({type:rr,context:1,implicit:!0,optional:!0})],vn.prototype,"objectDigestInfo",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],xr.prototype,"v1Form",void 0),u([f({type:vn,context:0,implicit:!0})],xr.prototype,"v2Form",void 0),xr=u([j({type:V.Choice})],xr);class kn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],kn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],kn.prototype,"notAfterTime",void 0);class si{constructor(t={}){Object.assign(this,t)}}u([f({type:tr,implicit:!0,context:0,optional:!0})],si.prototype,"baseCertificateID",void 0),u([f({type:Pe,implicit:!0,context:1,optional:!0})],si.prototype,"entityName",void 0),u([f({type:rr,implicit:!0,context:2,optional:!0})],si.prototype,"objectDigestInfo",void 0);var Bs;(function(e){e[e.v2=1]="v2"})(Bs||(Bs={}));class lt{constructor(t={}){this.version=Bs.v2,this.holder=new si,this.issuer=new xr,this.signature=new H,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new kn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],lt.prototype,"version",void 0),u([f({type:si})],lt.prototype,"holder",void 0),u([f({type:xr})],lt.prototype,"issuer",void 0),u([f({type:H})],lt.prototype,"signature",void 0),u([f({type:m.Integer,converter:he})],lt.prototype,"serialNumber",void 0),u([f({type:kn})],lt.prototype,"attrCertValidityPeriod",void 0),u([f({type:Et,repeated:"sequence"})],lt.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],lt.prototype,"issuerUniqueID",void 0),u([f({type:er,optional:!0})],lt.prototype,"extensions",void 0);class Cn{constructor(t={}){this.acinfo=new lt,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:lt})],Cn.prototype,"acinfo",void 0),u([f({type:H})],Cn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],Cn.prototype,"signatureValue",void 0);var Sn;(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"})(Sn||(Sn={}));class Is extends tn{}class Es{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Es.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Es.prototype,"value",void 0);class Ns{constructor(t={}){this.policyId="",this.classList=new Is(Sn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ns.prototype,"policyId",void 0),u([f({type:Is,defaultValue:new Is(Sn.unclassified)})],Ns.prototype,"classList",void 0),u([f({type:Es,repeated:"set"})],Ns.prototype,"securityCategories",void 0);class xn{constructor(t={}){Object.assign(this,t)}}u([f({type:ae})],xn.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],xn.prototype,"oid",void 0),u([f({type:m.Utf8String})],xn.prototype,"string",void 0);class Lc{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Lc.prototype,"policyAuthority",void 0),u([f({type:xn,repeated:"sequence"})],Lc.prototype,"values",void 0);var Os;class An{constructor(t={}){this.targetCertificate=new tr,Object.assign(this,t)}}u([f({type:tr})],An.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],An.prototype,"targetName",void 0),u([f({type:rr,optional:!0})],An.prototype,"certDigestInfo",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],Ar.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],Ar.prototype,"targetGroup",void 0),u([f({type:An,context:2,implicit:!0})],Ar.prototype,"targetCert",void 0),Ar=u([j({type:V.Choice})],Ar);let _s=Os=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};_s=Os=u([j({type:V.Sequence,itemType:Ar})],_s);var Vs;let Fc=Vs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Fc=Vs=u([j({type:V.Sequence,itemType:_s})],Fc);class Hc{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Hc.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Hc.prototype,"roleName",void 0);class Ts{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Ts.prototype,"service",void 0),u([f({type:ie})],Ts.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Ts.prototype,"authInfo",void 0);var js;class Ds{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ds.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ds.prototype,"otherCert",void 0);let Br=class{constructor(t={}){Object.assign(this,t)}};u([f({type:vr})],Br.prototype,"certificate",void 0),u([f({type:Cn,context:2,implicit:!0})],Br.prototype,"v2AttrCert",void 0),u([f({type:Ds,context:3,implicit:!0})],Br.prototype,"other",void 0),Br=u([j({type:V.Choice})],Br);let Bn=js=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Bn=js=u([j({type:V.Set,itemType:Br})],Bn);class Ir{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ir.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Ir.prototype,"content",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae})],ai.prototype,"single",void 0),u([f({type:m.Any})],ai.prototype,"any",void 0),ai=u([j({type:V.Choice})],ai);class In{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],In.prototype,"eContentType",void 0),u([f({type:ai,context:0,optional:!0})],In.prototype,"eContent",void 0);let li=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae,context:0,implicit:!0,optional:!0})],li.prototype,"value",void 0),u([f({type:ae,converter:qp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],li.prototype,"constructedValue",void 0),li=u([j({type:V.Choice})],li);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new gn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:gn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:li,optional:!0})],ci.prototype,"encryptedContent",void 0);class En{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],En.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],En.prototype,"keyAttr",void 0);var $s;class Nn{constructor(t={}){this.subjectKeyIdentifier=new Mt,Object.assign(this,t)}}u([f({type:Mt})],Nn.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],Nn.prototype,"date",void 0),u([f({type:En,optional:!0})],Nn.prototype,"other",void 0);let Er=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Nn,context:0,implicit:!0,optional:!0})],Er.prototype,"rKeyId",void 0),u([f({type:kr,optional:!0})],Er.prototype,"issuerAndSerialNumber",void 0),Er=u([j({type:V.Choice})],Er);class Ms{constructor(t={}){this.rid=new Er,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Er})],Ms.prototype,"rid",void 0),u([f({type:ae})],Ms.prototype,"encryptedKey",void 0);let On=$s=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};On=$s=u([j({type:V.Sequence,itemType:Ms})],On);class Ps{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Ps.prototype,"algorithm",void 0),u([f({type:m.BitString})],Ps.prototype,"publicKey",void 0);let ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0,optional:!0})],ir.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ps,context:1,implicit:!0,optional:!0})],ir.prototype,"originatorKey",void 0),u([f({type:kr,optional:!0})],ir.prototype,"issuerAndSerialNumber",void 0),ir=u([j({type:V.Choice})],ir);class Nr{constructor(t={}){this.version=_t.v3,this.originator=new ir,this.keyEncryptionAlgorithm=new ht,this.recipientEncryptedKeys=new On,Object.assign(this,t)}}u([f({type:m.Integer})],Nr.prototype,"version",void 0),u([f({type:ir,context:0})],Nr.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],Nr.prototype,"ukm",void 0),u([f({type:ht})],Nr.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:On})],Nr.prototype,"recipientEncryptedKeys",void 0);let Or=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Mt,context:0,implicit:!0})],Or.prototype,"subjectKeyIdentifier",void 0),u([f({type:kr})],Or.prototype,"issuerAndSerialNumber",void 0),Or=u([j({type:V.Choice})],Or);class ui{constructor(t={}){this.version=_t.v0,this.rid=new Or,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],ui.prototype,"version",void 0),u([f({type:Or})],ui.prototype,"rid",void 0),u([f({type:ht})],ui.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],ui.prototype,"encryptedKey",void 0);class di{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],di.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],di.prototype,"date",void 0),u([f({type:En,optional:!0})],di.prototype,"other",void 0);class fi{constructor(t={}){this.version=_t.v4,this.kekid=new di,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:di})],fi.prototype,"kekid",void 0),u([f({type:ht})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class pi{constructor(t={}){this.version=_t.v0,this.keyEncryptionAlgorithm=new ht,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],pi.prototype,"version",void 0),u([f({type:ks,context:0,optional:!0})],pi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:ht})],pi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],pi.prototype,"encryptedKey",void 0);class Rs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Rs.prototype,"oriType",void 0),u([f({type:m.Any})],Rs.prototype,"oriValue",void 0);let Pt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ui,optional:!0})],Pt.prototype,"ktri",void 0),u([f({type:Nr,context:1,implicit:!0,optional:!0})],Pt.prototype,"kari",void 0),u([f({type:fi,context:2,implicit:!0,optional:!0})],Pt.prototype,"kekri",void 0),u([f({type:pi,context:3,implicit:!0,optional:!0})],Pt.prototype,"pwri",void 0),u([f({type:Rs,context:4,implicit:!0,optional:!0})],Pt.prototype,"ori",void 0),Pt=u([j({type:V.Choice})],Pt);var Us;let _n=Us=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Us.prototype)}};_n=Us=u([j({type:V.Set,itemType:Pt})],_n);var Ls;class Vn{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Vn.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],Vn.prototype,"otherRevInfo",void 0);let hi=class{constructor(t={}){this.other=new Vn,Object.assign(this,t)}};u([f({type:Vn,context:1,implicit:!0})],hi.prototype,"other",void 0),hi=u([j({type:V.Choice})],hi);let Fs=Ls=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Ls.prototype)}};Fs=Ls=u([j({type:V.Set,itemType:hi})],Fs);class Hs{constructor(t={}){Object.assign(this,t)}}u([f({type:Bn,context:0,implicit:!0,optional:!0})],Hs.prototype,"certs",void 0),u([f({type:Fs,context:1,implicit:!0,optional:!0})],Hs.prototype,"crls",void 0);var qs;let Ks=qs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};Ks=qs=u([j({type:V.Set,itemType:Sr})],Ks);class yi{constructor(t={}){this.version=_t.v0,this.recipientInfos=new _n,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],yi.prototype,"version",void 0),u([f({type:Hs,context:0,implicit:!0,optional:!0})],yi.prototype,"originatorInfo",void 0),u([f({type:_n})],yi.prototype,"recipientInfos",void 0),u([f({type:ci})],yi.prototype,"encryptedContentInfo",void 0),u([f({type:Ks,context:1,implicit:!0,optional:!0})],yi.prototype,"unprotectedAttrs",void 0);const yh="1.2.840.113549.1.7.2";var zs;let Tn=zs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Tn=zs=u([j({type:V.Set,itemType:oi})],Tn);class _r{constructor(t={}){this.version=_t.v0,this.digestAlgorithms=new Tn,this.encapContentInfo=new In,this.signerInfos=new mn,Object.assign(this,t)}}u([f({type:m.Integer})],_r.prototype,"version",void 0),u([f({type:Tn})],_r.prototype,"digestAlgorithms",void 0),u([f({type:In})],_r.prototype,"encapContentInfo",void 0),u([f({type:Bn,context:0,implicit:!0,optional:!0})],_r.prototype,"certificates",void 0),u([f({type:hi,context:1,implicit:!0,optional:!0})],_r.prototype,"crls",void 0),u([f({type:mn})],_r.prototype,"signerInfos",void 0);const gi="1.2.840.10045.2.1",Gs="1.2.840.10045.4.1",qc="1.2.840.10045.4.3.1",Ws="1.2.840.10045.4.3.2",Js="1.2.840.10045.4.3.3",Ys="1.2.840.10045.4.3.4",Kc="1.2.840.10045.3.1.7",zc="1.3.132.0.34",Gc="1.3.132.0.35";function mi(e){return new H({algorithm:e})}const gh=mi(Gs);mi(qc);const mh=mi(Ws),bh=mi(Js),wh=mi(Ys);let Vr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Vr.prototype,"namedCurve",void 0),Vr=u([j({type:V.Choice})],Vr);class jn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],jn.prototype,"version",void 0),u([f({type:ae})],jn.prototype,"privateKey",void 0),u([f({type:Vr,context:0,optional:!0})],jn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],jn.prototype,"publicKey",void 0);class Dn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Dn.prototype,"r",void 0),u([f({type:m.Integer,converter:he})],Dn.prototype,"s",void 0);const He="1.2.840.113549.1.1",Tr=`${He}.1`,vh=`${He}.7`,kh=`${He}.9`,Ch=`${He}.10`,Sh=`${He}.2`,xh=`${He}.4`,$n=`${He}.5`,Ah=`${He}.14`,Zs=`${He}.11`,Mn=`${He}.12`,Pn=`${He}.13`,Wc=`${He}.15`,Jc=`${He}.16`,Yc="1.3.14.3.2.26",Zc="2.16.840.1.101.3.4.2.4",Qc="2.16.840.1.101.3.4.2.1",Xc="2.16.840.1.101.3.4.2.2",eu="2.16.840.1.101.3.4.2.3",Bh="2.16.840.1.101.3.4.2.5",Ih="2.16.840.1.101.3.4.2.6",Eh="1.2.840.113549.2.2",Nh="1.2.840.113549.2.5",Qs=`${He}.8`;function ve(e){return new H({algorithm:e,parameters:null})}ve(Eh),ve(Nh);const nr=ve(Yc);ve(Zc),ve(Qc),ve(Xc),ve(eu),ve(Bh),ve(Ih);const tu=new H({algorithm:Qs,parameters:G.serialize(nr)}),ru=new H({algorithm:kh,parameters:G.serialize(rn.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ve(Tr),ve(Sh),ve(xh),ve($n),ve(Wc),ve(Jc),ve(Mn),ve(Pn),ve(Wc),ve(Jc);class Rn{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.pSourceAlgorithm=new H(ru),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],Rn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:tu})],Rn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:ru})],Rn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:vh,parameters:G.serialize(new Rn)});class bi{constructor(t={}){this.hashAlgorithm=new H(nr),this.maskGenAlgorithm=new H({algorithm:Qs,parameters:G.serialize(nr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:nr})],bi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:tu})],bi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],bi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],bi.prototype,"trailerField",void 0),new H({algorithm:Ch,parameters:G.serialize(new bi)});class Un{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],Un.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Un.prototype,"digest",void 0);var Xs;class Ln{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Ln.prototype,"prime",void 0),u([f({type:m.Integer,converter:he})],Ln.prototype,"exponent",void 0),u([f({type:m.Integer,converter:he})],Ln.prototype,"coefficient",void 0);let ea=Xs=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Xs.prototype)}};ea=Xs=u([j({type:V.Sequence,itemType:Ln})],ea);class gt{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:m.Integer})],gt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:he})],gt.prototype,"coefficient",void 0),u([f({type:ea,optional:!0})],gt.prototype,"otherPrimeInfos",void 0);class ta{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],ta.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],ta.prototype,"publicExponent",void 0);var ra;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(ra||(ra={}));const qe=ra;/*! *****************************************************************************
|
|
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 ia=function(e,t){return ia=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])},ia(e,t)};function na(e,t){ia(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function
|
|
88
|
+
***************************************************************************** */var ia=function(e,t){return ia=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])},ia(e,t)};function na(e,t){ia(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Oh(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 l(y){try{d(i.next(y))}catch(p){a(p)}}function c(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):o(y.value).then(l,c)}d((i=i.apply(e,t||[])).next())})}function _h(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:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(d){return function(y){return c([d,y])}}function c(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 Fn(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 Hn(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(l){a={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function or(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Hn(arguments[t]));return e}var Vh="injectionTokens";function Th(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 iu(e){return!!e.useClass}function oa(e){return!!e.useFactory}var nu=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 l=Reflect[o];return l.apply(void 0,or(s))}};return this.reflectMethods.forEach(i),r},e}();function jr(e){return typeof e=="string"||typeof e=="symbol"}function jh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function ou(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Dh(e){return typeof e=="function"||e instanceof nu}function qn(e){return!!e.useToken}function Kn(e){return e.useValue!=null}function $h(e){return iu(e)||Kn(e)||qn(e)||oa(e)}var sa=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}(),Mh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),su=function(){function e(){this.scopedResolutions=new Map}return e}();function Ph(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Rh(e,t,r){return r===void 0&&(r=" "),or([e],t.message.split(`
|
|
89
89
|
`).map(function(i){return r+i})).join(`
|
|
90
|
-
`)}function Lh(e,t,r){var i=Hn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=Rh(s,t);return Uh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Fh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Hh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),qh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),Kh=function(){function e(){this.preResolution=new Hh,this.postResolution=new qh}return e}(),au=new Map,zh=function(){function e(t){this.parent=t,this._registry=new Ph,this.interceptors=new Kh,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(Mh(r)?o=r:o={useClass:r},qn(o))for(var s=[t],a=o;a!=null;){var l=a.useToken;if(s.includes(l))throw new Error("Token registration cycle detected! "+or(s,[l]).join(" -> "));s.push(l);var c=this._registry.get(l);c&&qn(c.provider)?a=c.provider:a=null}if((i.lifecycle===qe.Singleton||i.lifecycle==qe.ContainerScoped||i.lifecycle==qe.ResolutionScoped)&&(Kn(o)||oa(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(),jr(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(),jr(t)){if(jr(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&&!jr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new su),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&jr(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($h(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=Fn(this.interceptors.preResolution.getAll(t)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&s.push(c),c.callback(t,r)}}catch(d){i={error:d}}finally{try{l&&!l.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 l=Fn(this.interceptors.postResolution.getAll(t)),c=l.next();!c.done;c=l.next()){var d=c.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){o={error:y}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}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 Kn(t.provider)?a=t.provider.useValue:qn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):iu(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):oa(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 su),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&jr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(l){return i.resolveRegistration(l,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=Fn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Hn(o.value,2),a=s[0],l=s[1];this._registry.setAll(a,l.filter(function(c){return!Kn(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){t={error:c}}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=Fn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Hn(s.value,2),l=a[0],c=a[1];c.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&i._registry.setAll(l,c.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 _h(this,void 0,void 0,function(){var t;return Vh(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 nu)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=au.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,or([void 0],a)))}();return Fh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,l,c;try{return Dh(o)?ou(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,or([i.resolveAll(o.token)],o.transformArgs)):(l=i.resolve(o.transform)).transform.apply(l,or([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):ou(o)?(c=i.resolve(o.transform,t)).transform.apply(c,or([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(Lh(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}(),rt=new zh;function aa(){return function(e){au.set(e,jh(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 la;class zn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],zn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],zn.prototype,"attrValues",void 0);let lu=la=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};lu=la=u([j({type:V.Sequence,itemType:zn})],lu);var ca;let cu=ca=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};cu=ca=u([j({type:V.Sequence,itemType:Ir})],cu);class uu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],uu.prototype,"certId",void 0),u([f({type:m.Any,context:0})],uu.prototype,"certValue",void 0);class du{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],du.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],du.prototype,"crltValue",void 0);class fu extends ae{}let Gn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new fu,Object.assign(this,t)}};u([f({type:H})],Gn.prototype,"encryptionAlgorithm",void 0),u([f({type:fu})],Gn.prototype,"encryptedData",void 0);var ua,da;(function(e){e[e.v1=0]="v1"})(da||(da={}));class pu extends ae{}let fa=ua=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};fa=ua=u([j({type:V.Sequence,itemType:Et})],fa);class wi{constructor(t={}){this.version=da.v1,this.privateKeyAlgorithm=new H,this.privateKey=new pu,Object.assign(this,t)}}u([f({type:m.Integer})],wi.prototype,"version",void 0),u([f({type:H})],wi.prototype,"privateKeyAlgorithm",void 0),u([f({type:pu})],wi.prototype,"privateKey",void 0),u([f({type:fa,implicit:!0,context:0,optional:!0})],wi.prototype,"attributes",void 0);let hu=class extends wi{};hu=u([j({type:V.Sequence})],hu);let yu=class extends Gn{};yu=u([j({type:V.Sequence})],yu);class gu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],gu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],gu.prototype,"secretValue",void 0);class vi{constructor(t={}){this.mac=new Un,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Un})],vi.prototype,"mac",void 0),u([f({type:ae})],vi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],vi.prototype,"iterations",void 0);class Wn{constructor(t={}){this.version=3,this.authSafe=new Ir,this.macData=new vi,Object.assign(this,t)}}u([f({type:m.Integer})],Wn.prototype,"version",void 0),u([f({type:Ir})],Wn.prototype,"authSafe",void 0),u([f({type:vi,optional:!0})],Wn.prototype,"macData",void 0);var pa;class Jn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Jn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Jn.prototype,"bagValue",void 0),u([f({type:zn,repeated:"set",optional:!0})],Jn.prototype,"bagAttributes",void 0);let mu=pa=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};mu=pa=u([j({type:V.Sequence,itemType:Jn})],mu);var ha,ya,ga;const bu="1.2.840.113549.1.9",wu=`${bu}.7`,ma=`${bu}.14`;let Yn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Yn.prototype,"ia5String",void 0),Yn=u([j({type:V.Choice})],Yn);let vu=class extends Ir{};vu=u([j({type:V.Sequence})],vu);let ku=class extends Wn{};ku=u([j({type:V.Sequence})],ku);let Cu=class extends Gn{};Cu=u([j({type:V.Sequence})],Cu);let ba=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],ba.prototype,"value",void 0),ba=u([j({type:V.Choice})],ba);let Su=class extends Yn{};Su=u([j({type:V.Choice})],Su);let xu=class extends Oe{};xu=u([j({type:V.Choice})],xu);let wa=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],wa.prototype,"value",void 0),wa=u([j({type:V.Choice})],wa);let Au=class extends Oe{};Au=u([j({type:V.Choice})],Au);let va=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],va.prototype,"value",void 0),va=u([j({type:V.Choice})],va);let Zn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Zn.prototype,"value",void 0),Zn=u([j({type:V.Choice})],Zn);let Bu=class extends Zn{};Bu=u([j({type:V.Choice})],Bu);let Iu=class extends Oe{};Iu=u([j({type:V.Choice})],Iu);let ka=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],ka.prototype,"value",void 0),ka=u([j({type:V.Choice})],ka);let Eu=class extends _e{};Eu=u([j({type:V.Choice})],Eu);let Ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],Ca.prototype,"value",void 0),Ca=u([j({type:V.Choice})],Ca);let Nu=class extends yt{};Nu=u([j({type:V.Sequence})],Nu);let Qn=class extends Oe{};Qn=u([j({type:V.Choice})],Qn);let Ou=ha=class extends er{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};Ou=ha=u([j({type:V.Sequence})],Ou);let _u=ya=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};_u=ya=u([j({type:V.Set,itemType:Sr})],_u);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],Sa.prototype,"value",void 0),Sa=u([j({type:V.Choice})],Sa);let xa=class extends H{};xa=u([j({type:V.Sequence})],xa);let Vu=ga=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Vu=ga=u([j({type:V.Sequence,itemType:xa})],Vu);var Aa;let Xn=Aa=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Aa.prototype)}};Xn=Aa=u([j({type:V.Sequence,itemType:Et})],Xn);class Dr{constructor(t={}){this.version=0,this.subject=new we,this.subjectPKInfo=new Nt,this.attributes=new Xn,Object.assign(this,t)}}u([f({type:m.Integer})],Dr.prototype,"version",void 0),u([f({type:we})],Dr.prototype,"subject",void 0),u([f({type:Nt})],Dr.prototype,"subjectPKInfo",void 0),u([f({type:Xn,implicit:!0,context:0})],Dr.prototype,"attributes",void 0);class ki{constructor(t={}){this.certificationRequestInfo=new Dr,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Dr})],ki.prototype,"certificationRequestInfo",void 0),u([f({type:H})],ki.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ki.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function Uh(e,t,r){var i=Hn(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),o=i[1],s=o===void 0?null:o,a=Ph(s,t);return Rh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Lh(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Fh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),Hh=function(e){na(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(sa),qh=function(){function e(){this.preResolution=new Fh,this.postResolution=new Hh}return e}(),au=new Map,Kh=function(){function e(t){this.parent=t,this._registry=new Mh,this.interceptors=new qh,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($h(r)?o=r:o={useClass:r},qn(o))for(var s=[t],a=o;a!=null;){var l=a.useToken;if(s.includes(l))throw new Error("Token registration cycle detected! "+or(s,[l]).join(" -> "));s.push(l);var c=this._registry.get(l);c&&qn(c.provider)?a=c.provider:a=null}if((i.lifecycle===qe.Singleton||i.lifecycle==qe.ContainerScoped||i.lifecycle==qe.ResolutionScoped)&&(Kn(o)||oa(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(),jr(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(),jr(t)){if(jr(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&&!jr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:qe.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new su),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&jr(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(Dh(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=Fn(this.interceptors.preResolution.getAll(t)),l=a.next();!l.done;l=a.next()){var c=l.value;c.options.frequency!="Once"&&s.push(c),c.callback(t,r)}}catch(d){i={error:d}}finally{try{l&&!l.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 l=Fn(this.interceptors.postResolution.getAll(t)),c=l.next();!c.done;c=l.next()){var d=c.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){o={error:y}}finally{try{c&&!c.done&&(s=l.return)&&s.call(l)}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 Kn(t.provider)?a=t.provider.useValue:qn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):iu(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):oa(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 su),this.ensureNotDisposed();var o=this.getAllRegistrations(t);if(!o&&jr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),o){var s=o.map(function(l){return i.resolveRegistration(l,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=Fn(this._registry.entries()),o=i.next();!o.done;o=i.next()){var s=Hn(o.value,2),a=s[0],l=s[1];this._registry.setAll(a,l.filter(function(c){return!Kn(c.provider)}).map(function(c){return c.instance=void 0,c}))}}catch(c){t={error:c}}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=Fn(this._registry.entries()),s=o.next();!s.done;s=o.next()){var a=Hn(s.value,2),l=a[0],c=a[1];c.some(function(d){var y=d.options;return y.lifecycle===qe.ContainerScoped})&&i._registry.setAll(l,c.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 _h(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 nu)return t.createProxy(function(s){return i.resolve(s,r)});var o=function(){var s=au.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,or([void 0],a)))}();return Lh(o)&&this.disposables.add(o),o},e.prototype.resolveParams=function(t,r){var i=this;return function(o,s){var a,l,c;try{return jh(o)?ou(o)?o.multiple?(a=i.resolve(o.transform)).transform.apply(a,or([i.resolveAll(o.token)],o.transformArgs)):(l=i.resolve(o.transform)).transform.apply(l,or([i.resolve(o.token,t)],o.transformArgs)):o.multiple?i.resolveAll(o.token):i.resolve(o.token,t):ou(o)?(c=i.resolve(o.transform,t)).transform.apply(c,or([i.resolve(o.token,t)],o.transformArgs)):i.resolve(o,t)}catch(d){throw new Error(Uh(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}(),rt=new Kh;function aa(){return function(e){au.set(e,Th(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 la;class zn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],zn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],zn.prototype,"attrValues",void 0);let lu=la=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};lu=la=u([j({type:V.Sequence,itemType:zn})],lu);var ca;let cu=ca=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};cu=ca=u([j({type:V.Sequence,itemType:Ir})],cu);class uu{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],uu.prototype,"certId",void 0),u([f({type:m.Any,context:0})],uu.prototype,"certValue",void 0);class du{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],du.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],du.prototype,"crltValue",void 0);class fu extends ae{}let Gn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new fu,Object.assign(this,t)}};u([f({type:H})],Gn.prototype,"encryptionAlgorithm",void 0),u([f({type:fu})],Gn.prototype,"encryptedData",void 0);var ua,da;(function(e){e[e.v1=0]="v1"})(da||(da={}));class pu extends ae{}let fa=ua=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};fa=ua=u([j({type:V.Sequence,itemType:Et})],fa);class wi{constructor(t={}){this.version=da.v1,this.privateKeyAlgorithm=new H,this.privateKey=new pu,Object.assign(this,t)}}u([f({type:m.Integer})],wi.prototype,"version",void 0),u([f({type:H})],wi.prototype,"privateKeyAlgorithm",void 0),u([f({type:pu})],wi.prototype,"privateKey",void 0),u([f({type:fa,implicit:!0,context:0,optional:!0})],wi.prototype,"attributes",void 0);let hu=class extends wi{};hu=u([j({type:V.Sequence})],hu);let yu=class extends Gn{};yu=u([j({type:V.Sequence})],yu);class gu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],gu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],gu.prototype,"secretValue",void 0);class vi{constructor(t={}){this.mac=new Un,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Un})],vi.prototype,"mac",void 0),u([f({type:ae})],vi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],vi.prototype,"iterations",void 0);class Wn{constructor(t={}){this.version=3,this.authSafe=new Ir,this.macData=new vi,Object.assign(this,t)}}u([f({type:m.Integer})],Wn.prototype,"version",void 0),u([f({type:Ir})],Wn.prototype,"authSafe",void 0),u([f({type:vi,optional:!0})],Wn.prototype,"macData",void 0);var pa;class Jn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Jn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Jn.prototype,"bagValue",void 0),u([f({type:zn,repeated:"set",optional:!0})],Jn.prototype,"bagAttributes",void 0);let mu=pa=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};mu=pa=u([j({type:V.Sequence,itemType:Jn})],mu);var ha,ya,ga;const bu="1.2.840.113549.1.9",wu=`${bu}.7`,ma=`${bu}.14`;let Yn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Yn.prototype,"ia5String",void 0),Yn=u([j({type:V.Choice})],Yn);let vu=class extends Ir{};vu=u([j({type:V.Sequence})],vu);let ku=class extends Wn{};ku=u([j({type:V.Sequence})],ku);let Cu=class extends Gn{};Cu=u([j({type:V.Sequence})],Cu);let ba=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],ba.prototype,"value",void 0),ba=u([j({type:V.Choice})],ba);let Su=class extends Yn{};Su=u([j({type:V.Choice})],Su);let xu=class extends Oe{};xu=u([j({type:V.Choice})],xu);let wa=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],wa.prototype,"value",void 0),wa=u([j({type:V.Choice})],wa);let Au=class extends Oe{};Au=u([j({type:V.Choice})],Au);let va=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],va.prototype,"value",void 0),va=u([j({type:V.Choice})],va);let Zn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Zn.prototype,"value",void 0),Zn=u([j({type:V.Choice})],Zn);let Bu=class extends Zn{};Bu=u([j({type:V.Choice})],Bu);let Iu=class extends Oe{};Iu=u([j({type:V.Choice})],Iu);let ka=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],ka.prototype,"value",void 0),ka=u([j({type:V.Choice})],ka);let Eu=class extends _e{};Eu=u([j({type:V.Choice})],Eu);let Ca=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],Ca.prototype,"value",void 0),Ca=u([j({type:V.Choice})],Ca);let Nu=class extends yt{};Nu=u([j({type:V.Sequence})],Nu);let Qn=class extends Oe{};Qn=u([j({type:V.Choice})],Qn);let Ou=ha=class extends er{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};Ou=ha=u([j({type:V.Sequence})],Ou);let _u=ya=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ya.prototype)}};_u=ya=u([j({type:V.Set,itemType:Sr})],_u);let Sa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],Sa.prototype,"value",void 0),Sa=u([j({type:V.Choice})],Sa);let xa=class extends H{};xa=u([j({type:V.Sequence})],xa);let Vu=ga=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,ga.prototype)}};Vu=ga=u([j({type:V.Sequence,itemType:xa})],Vu);var Aa;let Xn=Aa=class extends ce{constructor(t){super(t),Object.setPrototypeOf(this,Aa.prototype)}};Xn=Aa=u([j({type:V.Sequence,itemType:Et})],Xn);class Dr{constructor(t={}){this.version=0,this.subject=new we,this.subjectPKInfo=new Nt,this.attributes=new Xn,Object.assign(this,t)}}u([f({type:m.Integer})],Dr.prototype,"version",void 0),u([f({type:we})],Dr.prototype,"subject",void 0),u([f({type:Nt})],Dr.prototype,"subjectPKInfo",void 0),u([f({type:Xn,implicit:!0,context:0})],Dr.prototype,"attributes",void 0);class ki{constructor(t={}){this.certificationRequestInfo=new Dr,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Dr})],ki.prototype,"certificationRequestInfo",void 0),u([f({type:H})],ki.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ki.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 eo="crypto.algorithm";class
|
|
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[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.NAME]}:${s}`),o=this.pad(r);for(const l in t){if(typeof l=="symbol")continue;const c=t[l],d=l?`${l}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")i.push(`${o}${d}${c}`);else if(c instanceof Date)i.push(`${o}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(const y of c)y[ue.NAME]=l,i.push(...this.serializeObj(y,r));else if(c instanceof ue)c[ue.NAME]=l,i.push(...this.serializeObj(c,r));else if(P.isBufferSource(c))l?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(c,r+1))):i.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){const y=c.toTextObject();y[ue.NAME]=l,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=P.toUint8Array(t),s=[];for(let a=0;a<o.length;){const l=[];for(let c=0;c<16&&a<o.length;c++){c===8&&l.push("");const d=o[a++].toString(16).padStart(2,"0");l.push(d)}s.push(`${i}${l.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}sr.oidSerializer=Rt,sr.algorithmSerializer=
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=l:Lt.isPrintableString(l)?y.value.printableString=l:y.value.utf8String=l}s==="+"?r[r.length-1].push(y):r.push(new gr([y])),s=d}return r}fromJSON(t){const r=new we;for(const i of t){const o=new gr;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 l=i[s];for(const c of l){const d=new ei({type:a});if(typeof c=="object")for(const y in c)switch(y){case"ia5String":d.value.ia5String=c[y];break;case"utf8String":d.value.utf8String=c[y];break;case"universalString":d.value.universalString=c[y];break;case"bmpString":d.value.bmpString=c[y];break;case"printableString":d.value.printableString=c[y];break}else c[0]==="#"?d.value.anyValue=L.FromHex(c.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=c:d.value.printableString=c;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return G.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]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const dd="Cannot initialize GeneralName from ASN.1 data.",fd=`${dd} Unsupported string format in use.`,
|
|
113
|
+
*/const eo="crypto.algorithm";class zh{getAlgorithms(){return rt.resolveAll(eo)}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 H({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 to="crypto.algorithmProvider";rt.registerSingleton(to,zh);var ro;const Ke="1.3.36.3.3.2.8.1.1",Tu=`${Ke}.1`,ju=`${Ke}.2`,Du=`${Ke}.3`,$u=`${Ke}.4`,Mu=`${Ke}.5`,Pu=`${Ke}.6`,Ru=`${Ke}.7`,Uu=`${Ke}.8`,Lu=`${Ke}.9`,Fu=`${Ke}.10`,Hu=`${Ke}.11`,qu=`${Ke}.12`,Ku=`${Ke}.13`,zu=`${Ke}.14`,Gu="brainpoolP160r1",Wu="brainpoolP160t1",Ju="brainpoolP192r1",Yu="brainpoolP192t1",Zu="brainpoolP224r1",Qu="brainpoolP224t1",Xu="brainpoolP256r1",ed="brainpoolP256t1",td="brainpoolP320r1",rd="brainpoolP320t1",id="brainpoolP384r1",nd="brainpoolP384t1",od="brainpoolP512r1",sd="brainpoolP512t1",ye="ECDSA";let Ci=ro=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case ye.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return gh;case"sha-256":return mh;case"sha-384":return bh;case"sha-512":return wh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Kc;break;case"K-256":r=ro.SECP256K1;break;case"P-384":r=zc;break;case"P-521":r=Gc;break;case Gu:r=Tu;break;case Wu:r=ju;break;case Ju:r=Du;break;case Yu:r=$u;break;case Zu:r=Mu;break;case Qu:r=Pu;break;case Xu:r=Ru;break;case ed:r=Uu;break;case td:r=Lu;break;case rd:r=Fu;break;case id:r=Hu;break;case nd:r=qu;break;case od:r=Ku;break;case sd:r=zu;break}if(r)return new H({algorithm:gi,parameters:G.serialize(new Vr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Gs:return{name:ye,hash:{name:"SHA-1"}};case Ws:return{name:ye,hash:{name:"SHA-256"}};case Js:return{name:ye,hash:{name:"SHA-384"}};case Ys:return{name:ye,hash:{name:"SHA-512"}};case gi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(G.parse(t.parameters,Vr).namedCurve){case Kc:return{name:ye,namedCurve:"P-256"};case ro.SECP256K1:return{name:ye,namedCurve:"K-256"};case zc:return{name:ye,namedCurve:"P-384"};case Gc:return{name:ye,namedCurve:"P-521"};case Tu:return{name:ye,namedCurve:Gu};case ju:return{name:ye,namedCurve:Wu};case Du:return{name:ye,namedCurve:Ju};case $u:return{name:ye,namedCurve:Yu};case Mu:return{name:ye,namedCurve:Zu};case Pu:return{name:ye,namedCurve:Qu};case Ru:return{name:ye,namedCurve:Xu};case Uu:return{name:ye,namedCurve:ed};case Lu:return{name:ye,namedCurve:td};case Fu:return{name:ye,namedCurve:rd};case Hu:return{name:ye,namedCurve:id};case qu:return{name:ye,namedCurve:nd};case Ku:return{name:ye,namedCurve:od};case zu:return{name:ye,namedCurve:sd}}}}return null}};Ci.SECP256K1="1.3.132.0.10",Ci=ro=u([aa()],Ci),rt.registerSingleton(eo,Ci);const ad=Symbol("name"),ld=Symbol("value");class ue{constructor(t,r={},i=""){this[ad]=t,this[ld]=i;for(const o in r)this[o]=r[o]}}ue.NAME=ad,ue.VALUE=ld;class Gh{static toTextObject(t){const r=new ue("Algorithm Identifier",{},Rt.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case gi:{const i=new Ci().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Rt{static toString(t){const r=this.items[t];return r||t}}Rt.items={[Yc]:"sha1",[Zc]:"sha224",[Qc]:"sha256",[Xc]:"sha384",[eu]:"sha512",[Tr]:"rsaEncryption",[$n]:"sha1WithRSAEncryption",[Ah]:"sha224WithRSAEncryption",[Zs]:"sha256WithRSAEncryption",[Mn]:"sha384WithRSAEncryption",[Pn]:"sha512WithRSAEncryption",[gi]:"ecPublicKey",[Gs]:"ecdsaWithSHA1",[qc]:"ecdsaWithSHA224",[Ws]:"ecdsaWithSHA256",[Js]:"ecdsaWithSHA384",[Ys]:"ecdsaWithSHA512",[ch]:"TLS WWW server authentication",[uh]:"TLS WWW client authentication",[dh]:"Code Signing",[fh]:"E-mail Protection",[ph]:"Time Stamping",[hh]:"OCSP Signing",[yh]:"Signed Data"};class sr{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[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.NAME]}:${s}`),o=this.pad(r);for(const l in t){if(typeof l=="symbol")continue;const c=t[l],d=l?`${l}: `:"";if(typeof c=="string"||typeof c=="number"||typeof c=="boolean")i.push(`${o}${d}${c}`);else if(c instanceof Date)i.push(`${o}${d}${c.toUTCString()}`);else if(Array.isArray(c))for(const y of c)y[ue.NAME]=l,i.push(...this.serializeObj(y,r));else if(c instanceof ue)c[ue.NAME]=l,i.push(...this.serializeObj(c,r));else if(P.isBufferSource(c))l?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(c,r+1))):i.push(...this.serializeBufferSource(c,r));else if("toTextObject"in c){const y=c.toTextObject();y[ue.NAME]=l,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=P.toUint8Array(t),s=[];for(let a=0;a<o.length;){const l=[];for(let c=0;c<16&&a<o.length;c++){c===8&&l.push("");const d=o[a++].toString(16).padStart(2,"0");l.push(d)}s.push(`${i}${l.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}sr.oidSerializer=Rt,sr.algorithmSerializer=Gh;class Ut{constructor(...t){if(t.length===1){const r=t[0];this.rawData=G.serialize(r),this.onInit(r)}else{const r=G.parse(t[0],t[1]);this.rawData=P.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Ut?ul(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return G.toString(this.rawData);case"text":return sr.serialize(this.toTextObject());case"hex":return L.ToHex(this.rawData);case"base64":return L.ToBase64(this.rawData);case"base64url":return L.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 ue(this.getTextName(),{},t)}}Ut.NAME="ASN";class mt extends Ut{constructor(...t){let r;P.isBufferSource(t[0])?r=P.toArrayBuffer(t[0]):r=G.serialize(new at({extnID:t[0],critical:t[1],extnValue:new ae(P.toArrayBuffer(t[2]))})),super(r,at)}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[ue.NAME]===mt.NAME&&(t[ue.NAME]=Rt.toString(this.type)),t}}var cd;class ar{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[cd]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(ar.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=ar.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(ar.DEFAULT,t);return this}}cd=Symbol.toStringTag,ar.DEFAULT="default";const Ye=new ar,Wh=/^[0-2](?:\.[1-9][0-9]*)+$/;function Jh(e){return new RegExp(Wh).test(e)}class ud{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Jh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const ze=new ud;ze.register("CN","2.5.4.3"),ze.register("L","2.5.4.7"),ze.register("ST","2.5.4.8"),ze.register("O","2.5.4.10"),ze.register("OU","2.5.4.11"),ze.register("C","2.5.4.6"),ze.register("DC","0.9.2342.19200300.100.1.25"),ze.register("E","1.2.840.113549.1.9.1"),ze.register("G","2.5.4.42"),ze.register("I","2.5.4.43"),ze.register("SN","2.5.4.4"),ze.register("T","2.5.4.12");function Yh(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function Zh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Yh)}class Lt{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}static isPrintableString(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(t)}constructor(t,r={}){this.extraNames=new ud,this.asn=new we;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 we?this.asn=t:P.isBufferSource(t)?this.asn=G.parse(t,we):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||ze.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)||ze.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,o=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:Zh(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?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new we,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,l]=o;const c=l[l.length-1];(c===","||c==="+")&&(l=l.slice(0,l.length-1),o[3]=c);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 ei({type:a});if(l.charAt(0)==="#")y.value.anyValue=L.FromHex(l.slice(1));else{const p=/"(.*?[^\\])?"/.exec(l);p&&(l=p[1]),l=l.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=l:Lt.isPrintableString(l)?y.value.printableString=l:y.value.utf8String=l}s==="+"?r[r.length-1].push(y):r.push(new gr([y])),s=d}return r}fromJSON(t){const r=new we;for(const i of t){const o=new gr;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 l=i[s];for(const c of l){const d=new ei({type:a});if(typeof c=="object")for(const y in c)switch(y){case"ia5String":d.value.ia5String=c[y];break;case"utf8String":d.value.utf8String=c[y];break;case"universalString":d.value.universalString=c[y];break;case"bmpString":d.value.bmpString=c[y];break;case"printableString":d.value.printableString=c[y];break}else c[0]==="#"?d.value.anyValue=L.FromHex(c.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=c:d.value.printableString=c;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return G.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]||Ye.get()):i=t[0]||Ye.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const dd="Cannot initialize GeneralName from ASN.1 data.",fd=`${dd} Unsupported string format in use.`,Qh=`${dd} Value doesn't match to GUID regular expression.`,pd=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,hd="1.3.6.1.4.1.311.25.1",yd="1.3.6.1.4.1.311.20.2.3",Ba="dns",Ia="dn",Ea="email",Na="ip",Oa="url",_a="guid",Va="upn",io="id";class gd extends Ut{constructor(...t){let r;if(t.length===2)switch(t[0]){case Ia:{const i=new Lt(t[1]).toArrayBuffer(),o=G.parse(i,we);r=new ie({directoryName:o});break}case Ba:r=new ie({dNSName:t[1]});break;case Ea:r=new ie({rfc822Name:t[1]});break;case _a:{const i=new RegExp(pd,"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?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ti({typeId:hd,value:G.serialize(new ae(L.FromHex(o)))})});break}case Na:r=new ie({iPAddress:t[1]});break;case io:r=new ie({registeredID:t[1]});break;case Va:{r=new ie({otherName:new ti({typeId:yd,value:G.serialize(fc.toASN(t[1]))})});break}case Oa:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else P.isBufferSource(t[0])?r=G.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=Ba,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=Ea,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=Na,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Oa,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=io,this.value=t.registeredID;else if(t.directoryName!=null)this.type=Ia,this.value=new Lt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===hd){this.type=_a;const r=G.parse(t.otherName.value,ae),i=new RegExp(pd,"i").exec(L.ToHex(r));if(!i)throw new Error(Qh);this.value=i.slice(1).map((o,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===yd)this.type=Va,this.value=G.parse(t.otherName.value,Oe).toString();else throw new Error(fd);else throw new Error(fd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Ia:case Ba:case _a:case Na:case io:case Va:case Oa:t=this.type.toUpperCase();break;case Ea:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===io&&(r=Rt.toString(r)),new ue(t,void 0,r)}}class Si extends Ut{constructor(t){let r;if(t instanceof Pe)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof ie)i.push(o);else{const s=G.parse(new gd(o.type,o.value).rawData,ie);i.push(s)}r=new Pe(i)}else if(P.isBufferSource(t))r=G.parse(t,Pe);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 gd(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[ue.NAME]];Array.isArray(o)||(o=[],t[i[ue.NAME]]=o),o.push(i)}return t}}Si.NAME="GeneralNames";const xi="-{5}",Ai="\\n",Xh=`[^${Ai}]+`,ey=`${xi}BEGIN (${Xh}(?=${xi}))${xi}`,ty=`${xi}END \\1${xi}`,$r="\\n",ry=`[^:${Ai}]+`,iy=`(?:[^${Ai}]+${$r}(?: +[^${Ai}]+${$r})*)`,ny=`(?:[a-zA-Z0-9=+/]+${$r})+`,md=`${ey}${$r}(?:((?:${ry}: ${iy})+))?${$r}?(${ny})${ty}`;class Ze{static isPem(t){return typeof t=="string"&&new RegExp(md,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(md,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${Ai}]+`,"g"),""),a={type:o[1],headers:[],rawData:L.FromBase64(s)},l=o[2];if(l){const c=l.split(new RegExp($r,"g"));let d=null;for(const y of c){const[p,I]=y.split(/:(.*)/);if(I===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:I.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(!P.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:P.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
116
|
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:P.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=L.ToBase64(t.rawData);let a,l=0;const c=Array();for(;l<s.length&&(s.length-l<64?a=s.substring(l):(a=s.substring(l,l+64),l+=64),a.length!==0);)if(c.push(a),a.length<64)break;return o.push(...c),o.push(`-----END ${i}-----`),o.join(`
|
|
117
|
-
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Vt extends Ut{static isAsnEncoded(t){return P.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):P.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 Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class lr extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Nt):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=rt.resolve(to),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const o=G.parse(t.subjectPublicKey,ta),s=P.toUint8Array(o.modulus);i.publicExponent=P.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=G.parse(this.rawData,Nt);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Nt);switch(t.Algorithm=sr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class bt{static register(t,r){this.items.set(t,r)}static create(t){const r=new mt(t),i=this.items.get(r.type);return i?new i(t):r}}bt.items=new Map;const no="crypto.signatureFormatter";class sy{toAsnSignature(t,r){return P.toArrayBuffer(r)}toWebSignature(t,r){return P.toArrayBuffer(r)}}class oo extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Lt(r.subject),this.subject=new Lt(r.subject).toString(),this.issuerName=new Lt(r.issuer),this.issuer=this.issuerName.toString();const i=rt.resolve(to);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=>bt.create(G.serialize(a)))),this.publicKey=new lr(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 lr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(P.isBufferSource(s)){const d=new lr(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=rt.resolveAll(no).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(i,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&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=G.parse(this.rawData,vr),i=r.tbsCertificate,o=new ue("",{Version:`${wr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":sr.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 l=a.toTextObject();s[l[ue.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}oo.NAME="Certificate";class Bi extends mt{static async create(t,r=!1,i=Ye.get()){if(t instanceof oo||ar.isCryptoKey(t)){const o=t instanceof oo?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),l=await new lr(s).getKeyIdentifier(i);return new Bi(L.ToHex(l),r)}else return new Bi(t,r)}constructor(...t){if(P.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Xt({keyIdentifier:new Yo(L.FromHex(t[0]))});super(Jo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Si?G.parse(r.name.rawData,Pe):r.name,o=new Xt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Jo,t[1],G.serialize(o))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Xt);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Xt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class bd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,on);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new on({cA:t[0],pathLenConstraint:t[1]});super(wc,t[2],G.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}}bd.NAME="Basic Constraints";var wd;(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"})(wd||(wd={}));class vd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,un);this.usages=r.map(i=>i)}else{const r=new un(t[0]);super(Ac,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Rt.toString(r)).join(", "),t}}vd.NAME="Extended Key Usages";var Ta;(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"})(Ta||(Ta={}));class ja extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ds);this.usages=r.toNumber()}else{const r=new ds(t[0]);super(Ic,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ds);return t[""]=r.toJSON().join(", "),t}}ja.NAME="Key Usages";class so extends mt{static async create(t,r=!1,i=Ye.get()){let o;t instanceof lr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:P.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new lr(o).getKeyIdentifier(i);return new so(L.ToHex(a),r)}constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Mt(r);super(Tc,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Mt);return t[""]=r,t}}so.NAME="Subject Key Identifier";class Da extends mt{constructor(...t){P.isBufferSource(t[0])?super(t[0]):super(_c,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,gs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Da.NAME="Subject Alternative Name";class kd extends mt{constructor(...t){var r;if(P.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,ln);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new ln(i.map(a=>new an({policyIdentifier:a})));super(kc,o,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Rt.toString(r))),t}}kd.NAME="Certificate Policies",bt.register(kc,kd);class Mr extends Ut{constructor(...t){let r;if(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>P.toArrayBuffer(s)):[];r=G.serialize(new Et({type:i,values:o}))}super(r,Et)}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]===Mr.NAME&&(t[ue.NAME]=Rt.toString(this.type)),t}}Mr.NAME="Attribute";class Cd extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=new Qn({printableString:t[0]});super(wu,[G.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Qn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}Cd.NAME="Challenge Password";class $a extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new er;for(const s of i)o.push(G.parse(s.rawData,at));super(ma,[G.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],er);this.items=r.map(i=>bt.create(G.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}}$a.NAME="Extensions";class ao{static register(t,r){this.items.set(t,r)}static create(t){const r=new Mr(t),i=this.items.get(r.type);return i?new i(t):r}}ao.items=new Map;let Ma=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 H({algorithm:$n,parameters:null});case"sha-256":return new H({algorithm:Zs,parameters:null});case"sha-384":return new H({algorithm:Mn,parameters:null});case"sha-512":return new H({algorithm:Pn,parameters:null})}}else return new H({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case $n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Zs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ma=u([aa()],Ma),rt.registerSingleton(eo,Ma);class it{addPadding(t,r){const i=P.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=P.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=it.namedCurveSize.get(i)||it.defaultNamedCurveSize,s=new Dn,a=P.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Dn),o=t.namedCurve,s=it.namedCurveSize.get(o)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),l=this.addPadding(s,this.removePadding(i.s));return Cp(a,l)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const Sd="1.3.101.110",xd="1.3.101.111",Ad="1.3.101.112",Bd="1.3.101.113";let Pa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Ad;break;case"ed448":r=Bd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=Sd;break;case"x448":r=xd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Ad:return{name:"EdDSA",namedCurve:"Ed25519"};case Bd:return{name:"EdDSA",namedCurve:"Ed448"};case Sd:return{name:"ECDH-ES",namedCurve:"X25519"};case xd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Pa=u([aa()],Pa),rt.registerSingleton(eo,Pa);class ay extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new lr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(to);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>ao.create(G.serialize(o)));const i=this.getAttribute(ma);this.extensions=[],i instanceof $a&&(this.extensions=i.items),this.subjectName=new Lt(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=rt.resolveAll(no).reverse();let s=null;for(const l of o)if(s=l.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=G.parse(this.rawData,ki),i=r.certificationRequestInfo,o=new ue("",{Version:`${wr[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 l=a.toTextObject();s[l[ue.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}ay.NAME="PKCS#10 Certificate Request";var Id;(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"})(Id||(Id={})),bt.register(wc,bd),bt.register(Ac,vd),bt.register(Ic,ja),bt.register(Tc,so),bt.register(Jo,Bi),bt.register(_c,Da),ao.register(wu,Cd),ao.register(ma,$a),rt.registerSingleton(no,sy),rt.registerSingleton(no,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Ed(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new oo(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Da){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,p=c[y]??[];return{...c,[y]:[...p,d.value]}},{});for(const c in l)i.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof ja){const s=Object.values(Ta),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];l.push(p)}return l},[]);i.keyUsage=a}return i}}}function ly(){const e=Ed(),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 cy={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 uy(){const e=$i.createI18n("en-us",cy);return{i18n:e,i18nT:$i.i18nTComponent(e)}}const wt={useCertificate:ly,useI18n:uy,useX509:Ed},lo="/v2/control-planes/{controlPlaneId}/core-entities",co="/{workspace}",Ii={list:{konnect:`${lo}/certificates`,kongManager:`${co}/certificates`},form:{konnect:{create:`${lo}/certificates`,edit:`${lo}/certificates/{id}`,validate:`${lo}/v1/schemas/json/certificate/validate`},kongManager:{create:`${co}/certificates`,edit:`${co}/certificates/{id}`,validate:`${co}/schemas/certificates/validate`}}};var Ra=(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))(Ra||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),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||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function dy(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):ol.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),ol.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function fy(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ua="khcp-user-table-preferences",py={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function hy(){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(Ua));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(Ua,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||py},deleteAllTablePreferences:()=>{localStorage.removeItem(Ua)}}}function La(e={}){const{getAxiosInstance:t}=dy();return{axiosInstance:t(e)}}const yy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},gy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},my={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},by={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},wy={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},vy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},ky={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Cy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Sy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},xy={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"}},Ay={global:yy,deleteModal:gy,baseForm:my,baseTable:by,baseConfigCard:wy,filter:vy,debouncedFilter:ky,errors:Cy,validationErrors:Sy,toggleModal:xy};function uo(){const e=$i.createI18n("en-us",Ay);return{i18n:e,i18nT:$i.i18nTComponent(e)}}function Nd(){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(c=>c===s).length,l=i.filter(c=>c===s).length;if(a!==l)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 By(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=La(e.axiosRequestConfig),{i18n:{t:s}}=uo(),{debounce:a}=fy(),l=a(async k=>{await E(k)},200),c=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),I=n.ref([]),w=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:b}=Nd(),v=async()=>{try{c.value=!0;const{data:k}=await o.get(`${g}?size=${r}`);k!=null&&k.next||(w.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=n.ref(""),E=async k=>{var B,S,T;if(x.value!==k)if(x.value=k||"",w.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){let O=g+"";k&&(O+=`/${k}`);const{data:N}=await o.get(`${O}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(k){const O=[];b(k)&&i.searchKeys.includes("id")?O.push((async()=>{const{data:q}=await o.get(`${g}/${k}`);return[q[i.fetchedItemsKey]??q]})()):O.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:D}=await o.get(`${g}?${q}=${k}`);return D[i.fetchedItemsKey]}));const N=await Promise.all(O),re=new Set;p.value=[],(B=N==null?void 0:N.forEach)==null||B.call(N,q=>{var D;(D=q==null?void 0:q.forEach)==null||D.call(q,Q=>{re.has(Q.id)||(re.add(Q.id),p.value.push(Q))})})}else p.value=I.value}catch(O){((S=O==null?void 0:O.response)==null?void 0:S.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",k?(p.value=(T=w.value)==null?void 0:T.filter(O=>{var N;let re=!1;for(const q of i.searchKeys){const D=typeof O[q]=="string"?(N=O[q])==null?void 0:N.toLowerCase():O[q];D!=null&&D.includes(k.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,c.value=!1};return{loading:c,error:d,validationError:y,results:p,allRecords:w,loadItems:v,debouncedQueryChange:l}}function Iy(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 Ey(){const{i18n:{t:e}}=uo();return{getMessageFromError:t=>{var r,i,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Ny(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 Od(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:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return o.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(o.value||new URLSearchParams(I).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(c))),d&&l!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function Oy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=La(e.axiosRequestConfig),s=Od(e,i),a=n.ref({status:Ft.Idle});return{fetcher:async l=>{var c;try{a.value={status:Ft.Loading};let d=s(l);d.includes("filter[name]")&&(d=`${d}&page[size]=${l.pageSize}&page[number]=${l.page}`);const y=await o.get(d);if(y.status>=400)throw y;const p=y.data,I=r&&r.replace(/[^\w-_]/gi,"");let w;p[I]&&Array.isArray(p[I])?w=p[I]:Array.isArray(p)?w=p:w=Object.keys(p).length?[p]:[];const h={data:w,total:w.length,...p.offset?{pagination:{offset:p.offset}}:null};return a.value={status:Ft.Idle,response:h},h}catch(d){const y={data:[],total:0};return l.query&&(((c=d.response)==null?void 0:c.status)===404||d.status===404)?(a.value={status:Ft.NoResults,response:y,error:d.response?d:{response:d}},y):(a.value={status:Ft.Error,response:y,error:d.response?d:{response:d}},y)}},fetcherState:a}}function _y(){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 _d=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Vd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(_d);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Td=e=>e==="*"||e==="x"||e==="X",jd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Vy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Ty=(e,t)=>{if(Td(e)||Td(t))return 0;const[r,i]=Vy(jd(e),jd(t));return r>i?1:r<i?-1:0},Dd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Ty(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},jy=(e,t)=>{const r=Vd(e),i=Vd(t),o=r.pop(),s=i.pop(),a=Dd(r,i);return a!==0?a:o&&s?Dd(o.split("."),s.split(".")):o||s?o?-1:1:0},$d=(e,t,r)=>{Dy(r);const i=jy(e,t);return Md[r].includes(i)},Md={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Pd=Object.keys(Md),Dy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Pd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Pd.join("|")}`)},$y=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_d.test(e);function My(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!$y(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,l]=s;return!(a&&$d(o,a,"<")||l&&$d(o,l,">"))}function Py(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)}}function Ry(){const{i18n:{t:e}}=uo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Be={useAxios:La,useDebouncedFilter:By,useDeleteUrlBuilder:Iy,useErrors:Ey,useExternalLinkCreator:Ny,useFetcher:Oy,useFetchUrlBuilder:Od,useHelpers:Nd,useStringHelpers:_y,useI18n:uo,useGatewayFeatureSupported:My,useTruncationDetector:Py,useValidators:Ry},Uy={key:0,class:"config-card-fieldset-title"},Ly=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}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=n.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,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",Uy,[n.createElementVNode("b",null,n.toDisplayString(l.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(fo,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ct=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Rd=ct(Ly,[["__scopeId","data-v-68ca83ec"]]),Fy=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.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})])}}}),Hy=ct(Fy,[["__scopeId","data-v-c96811e5"]]),qy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.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"])}}}),Ky="#0044f4",zy="#e0e4ea",Gy="#afb7c5",Wy="1px",Jy="20px",Yy={class:"config-card-details-row"},Zy=["data-testid"],Qy=["data-testid"],Xy=["data-testid"],eg=["data-testid"],tg={key:1},rg=["data-testid"],ig=["data-testid"],ng=["data-testid"],og=["data-testid"],sg={name:"ConfigCardItem",components:{JsonCardItem:Rd,StatusBadge:qy,InternalLinkItem:Hy}},ag=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=>({dc1d91a8:y.value?"none":`solid ${n.unref(Wy)} ${n.unref(zy)}`,"59ccec5f":d.value&&l.value?"block":"flex","29318fbe":d.value&&l.value?"100%":r.slim?"50%":"25%","292d0408":d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),l=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=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:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case le.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case le.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case le.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};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}}}),I=n.ref(),{isTruncated:w}=Be.useTruncationDetector(I);return(h,g)=>{const b=n.resolveComponent("KLabel"),v=n.resolveComponent("KBadge"),x=n.resolveComponent("KCopy"),E=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",Yy,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[c.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,Qy)]),key:"0"}:void 0]),1024)],!0)],8,Zy),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},()=>[l.value?(n.openBlock(),n.createElementBlock("div",tg,[(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,(k,B)=>(n.openBlock(),n.createBlock(v,{key:`${e.item.key}-badge-tag-${B}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${B}`,tooltip:k,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,rg)):n.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(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,(k,B)=>(n.openBlock(),n.createBlock(x,n.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${B}`,"data-testid":`${e.item.key}-copy-uuid-${B}`,text:k}),null,16,["data-testid","text"]))),128))],8,ig)):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,(k,B)=>(n.openBlock(),n.createBlock(v,{key:`${e.item.key}-badge-method-${B}`,appearance:Object.values(n.unref(dp.BadgeMethodAppearances)).includes(k.toLowerCase())?k.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${B}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,ng)):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,(k,B)=>(n.openBlock(),n.createBlock(Rd,{key:`json-array-item-${B}`,index:B,"is-array-item":"",item:k},null,8,["index","item"]))),128))],8,og)):(n.openBlock(),n.createBlock(E,{key:4,text:n.unref(w)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:I,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,eg))],!0)],8,Xy)])}}}),fo=ct(ag,[["__scopeId","data-v-d268261c"]]),lg={class:"json-config"},cg={key:0,class:"json-endpoint"},Ud=n.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){n.useCssVars(o=>({"4520e3ec":`${i.value}ch`}));const t=e,r=n.computed(()=>t.jsonRecord),i=n.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{const a=n.resolveComponent("KBadge"),l=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",lg,[t.fetcherUrl?(n.openBlock(),n.createElementBlock("div",cg,[n.createVNode(a,{appearance:t.requestMethod},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),n.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),t.jsonRecord?(n.openBlock(),n.createBlock(l,{key:1,id:"json-codeblock",class:n.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):n.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ld(e){return typeof e>"u"||e===null}function ug(e){return typeof e=="object"&&e!==null}function dg(e){return Array.isArray(e)?e:Ld(e)?[]:[e]}function fg(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 pg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function hg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var yg=Ld,gg=ug,mg=dg,bg=pg,wg=hg,vg=fg,ke={isNothing:yg,isObject:gg,toArray:mg,repeat:bg,isNegativeZero:wg,extend:vg};function Fd(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+=`
|
|
117
|
+
`)}}Ze.CertificateTag="CERTIFICATE",Ze.CrlTag="CRL",Ze.CertificateRequestTag="CERTIFICATE REQUEST",Ze.PublicKeyTag="PUBLIC KEY",Ze.PrivateKeyTag="PRIVATE KEY";class Vt extends Ut{static isAsnEncoded(t){return P.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ze.isPem(t))return Ze.decode(t)[0];if(L.isHex(t))return L.FromHex(t);if(L.isBase64(t))return L.FromBase64(t);if(L.isBase64Url(t))return L.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=L.ToBinary(t);return Ze.isPem(r)?Ze.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):P.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 Ze.encode(this.rawData,this.tag);default:return super.toString(t)}}}class lr extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Nt):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=rt.resolve(to),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const o=G.parse(t.subjectPublicKey,ta),s=P.toUint8Array(o.modulus);i.publicExponent=P.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=G.parse(this.rawData,Nt);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,Nt);switch(t.Algorithm=sr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case gi:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class bt{static register(t,r){this.items.set(t,r)}static create(t){const r=new mt(t),i=this.items.get(r.type);return i?new i(t):r}}bt.items=new Map;const no="crypto.signatureFormatter";class oy{toAsnSignature(t,r){return P.toArrayBuffer(r)}toWebSignature(t,r){return P.toArrayBuffer(r)}}class oo extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vr):super(t),this.tag=Ze.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Lt(r.subject),this.subject=new Lt(r.subject).toString(),this.issuerName=new Lt(r.issuer),this.issuer=this.issuerName.toString();const i=rt.resolve(to);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=>bt.create(G.serialize(a)))),this.publicKey=new lr(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 lr)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(P.isBufferSource(s)){const d=new lr(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=rt.resolveAll(no).reverse();let l=null;for(const d of a)if(l=d.toWebSignature(i,this.signature),l)break;if(!l)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const c=await r.subtle.verify(this.signatureAlgorithm,o,l,this.tbs);if(t.signatureOnly)return c;{const y=(t.date||new Date).getTime();return c&&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=G.parse(this.rawData,vr),i=r.tbsCertificate,o=new ue("",{Version:`${wr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":sr.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 l=a.toTextObject();s[l[ue.NAME]]=l}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}oo.NAME="Certificate";class Bi extends mt{static async create(t,r=!1,i=Ye.get()){if(t instanceof oo||ar.isCryptoKey(t)){const o=t instanceof oo?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),l=await new lr(s).getKeyIdentifier(i);return new Bi(L.ToHex(l),r)}else return new Bi(t,r)}constructor(...t){if(P.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Xt({keyIdentifier:new Yo(L.FromHex(t[0]))});super(Jo,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Si?G.parse(r.name.rawData,Pe):r.name,o=new Xt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Jo,t[1],G.serialize(o))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Xt);r.keyIdentifier&&(this.keyId=L.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:L.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Xt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Si(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Bi.NAME="Authority Key Identifier";class bd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,on);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new on({cA:t[0],pathLenConstraint:t[1]});super(wc,t[2],G.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}}bd.NAME="Basic Constraints";var wd;(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"})(wd||(wd={}));class vd extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,un);this.usages=r.map(i=>i)}else{const r=new un(t[0]);super(Ac,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Rt.toString(r)).join(", "),t}}vd.NAME="Extended Key Usages";var Ta;(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"})(Ta||(Ta={}));class ja extends mt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ds);this.usages=r.toNumber()}else{const r=new ds(t[0]);super(Ic,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ds);return t[""]=r.toJSON().join(", "),t}}ja.NAME="Key Usages";class so extends mt{static async create(t,r=!1,i=Ye.get()){let o;t instanceof lr?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:P.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new lr(o).getKeyIdentifier(i);return new so(L.ToHex(a),r)}constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Mt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Mt(r);super(Tc,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Mt);return t[""]=r,t}}so.NAME="Subject Key Identifier";class Da extends mt{constructor(...t){P.isBufferSource(t[0])?super(t[0]):super(_c,t[1],new Si(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,gs);this.names=new Si(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Da.NAME="Subject Alternative Name";class kd extends mt{constructor(...t){var r;if(P.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,ln);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new ln(i.map(a=>new an({policyIdentifier:a})));super(kc,o,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Rt.toString(r))),t}}kd.NAME="Certificate Policies",bt.register(kc,kd);class Mr extends Ut{constructor(...t){let r;if(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>P.toArrayBuffer(s)):[];r=G.serialize(new Et({type:i,values:o}))}super(r,Et)}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]===Mr.NAME&&(t[ue.NAME]=Rt.toString(this.type)),t}}Mr.NAME="Attribute";class Cd extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=new Qn({printableString:t[0]});super(wu,[G.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],Qn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}Cd.NAME="Challenge Password";class $a extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new er;for(const s of i)o.push(G.parse(s.rawData,at));super(ma,[G.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=G.parse(this.values[0],er);this.items=r.map(i=>bt.create(G.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}}$a.NAME="Extensions";class ao{static register(t,r){this.items.set(t,r)}static create(t){const r=new Mr(t),i=this.items.get(r.type);return i?new i(t):r}}ao.items=new Map;let Ma=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 H({algorithm:$n,parameters:null});case"sha-256":return new H({algorithm:Zs,parameters:null});case"sha-384":return new H({algorithm:Mn,parameters:null});case"sha-512":return new H({algorithm:Pn,parameters:null})}}else return new H({algorithm:Tr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Tr:return{name:"RSASSA-PKCS1-v1_5"};case $n:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Zs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Pn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ma=u([aa()],Ma),rt.registerSingleton(eo,Ma);class it{addPadding(t,r){const i=P.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=P.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=it.namedCurveSize.get(i)||it.defaultNamedCurveSize,s=new Dn,a=P.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Dn),o=t.namedCurve,s=it.namedCurveSize.get(o)||it.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),l=this.addPadding(s,this.removePadding(i.s));return kp(a,l)}return null}}it.namedCurveSize=new Map,it.defaultNamedCurveSize=32;const Sd="1.3.101.110",xd="1.3.101.111",Ad="1.3.101.112",Bd="1.3.101.113";let Pa=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=Ad;break;case"ed448":r=Bd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=Sd;break;case"x448":r=xd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case Ad:return{name:"EdDSA",namedCurve:"Ed25519"};case Bd:return{name:"EdDSA",namedCurve:"Ed448"};case Sd:return{name:"ECDH-ES",namedCurve:"X25519"};case xd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Pa=u([aa()],Pa),rt.registerSingleton(eo,Pa);class sy extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,ki):super(t),this.tag=Ze.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new lr(t.certificationRequestInfo.subjectPKInfo);const r=rt.resolve(to);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>ao.create(G.serialize(o)));const i=this.getAttribute(ma);this.extensions=[],i instanceof $a&&(this.extensions=i.items),this.subjectName=new Lt(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=rt.resolveAll(no).reverse();let s=null;for(const l of o)if(s=l.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=G.parse(this.rawData,ki),i=r.certificationRequestInfo,o=new ue("",{Version:`${wr[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 l=a.toTextObject();s[l[ue.NAME]]=l}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{Algorithm:sr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}sy.NAME="PKCS#10 Certificate Request";var Id;(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"})(Id||(Id={})),bt.register(wc,bd),bt.register(Ac,vd),bt.register(Ic,ja),bt.register(Tc,so),bt.register(Jo,Bi),bt.register(_c,Da),ao.register(wu,Cd),ao.register(ma,$a),rt.registerSingleton(no,oy),rt.registerSingleton(no,it),it.namedCurveSize.set("P-256",32),it.namedCurveSize.set("K-256",32),it.namedCurveSize.set("P-384",48),it.namedCurveSize.set("P-521",66);function Ed(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new oo(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Da){const s=o.names.toJSON(),l=Object.entries(s).map(c=>({type:c[1].type,value:c[1].value})).reduce((c,d)=>{const y=d.type,p=c[y]??[];return{...c,[y]:[...p,d.value]}},{});for(const c in l)i.subjectAltName=`${c}=${l[c].join(", ")}`}else if(o instanceof ja){const s=Object.values(Ta),a=Array(s.length/2).fill(null).reduce((l,c,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];l.push(p)}return l},[]);i.keyUsage=a}return i}}}function ay(){const e=Ed(),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 ly={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 cy(){const e=$i.createI18n("en-us",ly);return{i18n:e,i18nT:$i.i18nTComponent(e)}}const wt={useCertificate:ay,useI18n:cy,useX509:Ed},lo="/v2/control-planes/{controlPlaneId}/core-entities",co="/{workspace}",Ii={list:{konnect:`${lo}/certificates`,kongManager:`${co}/certificates`},form:{konnect:{create:`${lo}/certificates`,edit:`${lo}/certificates/{id}`,validate:`${lo}/v1/schemas/json/certificate/validate`},kongManager:{create:`${co}/certificates`,edit:`${co}/certificates/{id}`,validate:`${co}/schemas/certificates/validate`}}};var Ra=(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))(Ra||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),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||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function uy(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):ol.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),ol.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var t;return((t=e==null?void 0:e.response)==null?void 0:t.headers["x-datadog-trace-id"])||""}}}function dy(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Ua="khcp-user-table-preferences",fy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function py(){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(Ua));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(Ua,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||fy},deleteAllTablePreferences:()=>{localStorage.removeItem(Ua)}}}function La(e={}){const{getAxiosInstance:t}=uy();return{axiosInstance:t(e)}}const hy={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},yy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},gy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},my={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},by={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},wy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},vy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ky={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Cy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Sy={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"}},xy={global:hy,deleteModal:yy,baseForm:gy,baseTable:my,baseConfigCard:by,filter:wy,debouncedFilter:vy,errors:ky,validationErrors:Cy,toggleModal:Sy};function uo(){const e=$i.createI18n("en-us",xy);return{i18n:e,i18nT:$i.i18nTComponent(e)}}function Nd(){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(c=>c===s).length,l=i.filter(c=>c===s).length;if(a!==l)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 Ay(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:o}=La(e.axiosRequestConfig),{i18n:{t:s}}=uo(),{debounce:a}=dy(),l=a(async k=>{await E(k)},200),c=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),I=n.ref([]),w=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:b}=Nd(),v=async()=>{try{c.value=!0;const{data:k}=await o.get(`${g}?size=${r}`);k!=null&&k.next||(w.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in k?k[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=n.ref(""),E=async k=>{var B,S,T;if(x.value!==k)if(x.value=k||"",w.value===void 0)try{if(c.value=!0,d.value="",y.value="",e.app==="konnect"){let O=g+"";k&&(O+=`/${k}`);const{data:N}=await o.get(`${O}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(k){const O=[];b(k)&&i.searchKeys.includes("id")?O.push((async()=>{const{data:q}=await o.get(`${g}/${k}`);return[q[i.fetchedItemsKey]??q]})()):O.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:D}=await o.get(`${g}?${q}=${k}`);return D[i.fetchedItemsKey]}));const N=await Promise.all(O),re=new Set;p.value=[],(B=N==null?void 0:N.forEach)==null||B.call(N,q=>{var D;(D=q==null?void 0:q.forEach)==null||D.call(q,Q=>{re.has(Q.id)||(re.add(Q.id),p.value.push(Q))})})}else p.value=I.value}catch(O){((S=O==null?void 0:O.response)==null?void 0:S.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,y.value="",k?(p.value=(T=w.value)==null?void 0:T.filter(O=>{var N;let re=!1;for(const q of i.searchKeys){const D=typeof O[q]=="string"?(N=O[q])==null?void 0:N.toLowerCase():O[q];D!=null&&D.includes(k.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,c.value=!1};return{loading:c,error:d,validationError:y,results:p,allRecords:w,loadItems:v,debouncedQueryChange:l}}function By(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 Iy(){const{i18n:{t:e}}=uo();return{getMessageFromError:t=>{var r,i,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let l=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(l=a.messages.join(", ")),a.field?`${a.field} - ${l}`:l}).join("; ");if(t.response.data.message){const{message:a}=t.response.data;return Array.isArray(a)?(s=a[0])!=null&&s.constraints?Object.values(a[0].constraints)[0]:a[0]:a}if(typeof t.response.data=="string")return t.response.data;if(typeof t.response.data=="object")return Object.keys(t.response.data).map(a=>`${a} ${t.response.data[a]}`).join(", ")}return t.message||e("errors.unexpected")}}}function Ey(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 Od(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:l,pageSize:c,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return o.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(o.value||new URLSearchParams(I).forEach((h,g)=>{w.searchParams.append(g,h)}),y&&w.searchParams.append("sort_by",y),p==="desc"&&w.searchParams.append("sort_desc","1"),w.searchParams.append("size",String(c))),d&&l!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function Ny(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=La(e.axiosRequestConfig),s=Od(e,i),a=n.ref({status:Ft.Idle});return{fetcher:async l=>{var c;try{a.value={status:Ft.Loading};let d=s(l);d.includes("filter[name]")&&(d=`${d}&page[size]=${l.pageSize}&page[number]=${l.page}`);const y=await o.get(d);if(y.status>=400)throw y;const p=y.data,I=r&&r.replace(/[^\w-_]/gi,"");let w;p[I]&&Array.isArray(p[I])?w=p[I]:Array.isArray(p)?w=p:w=Object.keys(p).length?[p]:[];const h={data:w,total:w.length,...p.offset?{pagination:{offset:p.offset}}:null};return a.value={status:Ft.Idle,response:h},h}catch(d){const y={data:[],total:0};return l.query&&(((c=d.response)==null?void 0:c.status)===404||d.status===404)?(a.value={status:Ft.NoResults,response:y,error:d.response?d:{response:d}},y):(a.value={status:Ft.Error,response:y,error:d.response?d:{response:d}},y)}},fetcherState:a}}function Oy(){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 _d=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Vd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(_d);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Td=e=>e==="*"||e==="x"||e==="X",jd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},_y=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Vy=(e,t)=>{if(Td(e)||Td(t))return 0;const[r,i]=_y(jd(e),jd(t));return r>i?1:r<i?-1:0},Dd=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Vy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Ty=(e,t)=>{const r=Vd(e),i=Vd(t),o=r.pop(),s=i.pop(),a=Dd(r,i);return a!==0?a:o&&s?Dd(o.split("."),s.split(".")):o||s?o?-1:1:0},$d=(e,t,r)=>{jy(r);const i=Ty(e,t);return Md[r].includes(i)},Md={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Pd=Object.keys(Md),jy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Pd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Pd.join("|")}`)},Dy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_d.test(e);function $y(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Dy(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,l]=s;return!(a&&$d(o,a,"<")||l&&$d(o,l,">"))}function My(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)}}function Py(){const{i18n:{t:e}}=uo();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Be={useAxios:La,useDebouncedFilter:Ay,useDeleteUrlBuilder:By,useErrors:Iy,useExternalLinkCreator:Ey,useFetcher:Ny,useFetchUrlBuilder:Od,useHelpers:Nd,useStringHelpers:Oy,useI18n:uo,useGatewayFeatureSupported:$y,useTruncationDetector:My,useValidators:Py},Ry={key:0,class:"config-card-fieldset-title"},Uy=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}}=Be.useI18n(),{convertKeyToTitle:i}=Be.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const c=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete c.name,c}),l=n.computed(()=>{var c;return t.isArrayItem?(c=s.value)!=null&&c.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(c,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",Ry,[n.createElementVNode("b",null,n.toDisplayString(l.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(fo,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ct=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Rd=ct(Uy,[["__scopeId","data-v-68ca83ec"]]),Ly=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.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})])}}}),Fy=ct(Ly,[["__scopeId","data-v-c96811e5"]]),Hy=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.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"])}}}),qy="#0044f4",Ky="#e0e4ea",zy="#afb7c5",Gy="1px",Wy="20px",Jy={class:"config-card-details-row"},Yy=["data-testid"],Zy=["data-testid"],Qy=["data-testid"],Xy=["data-testid"],eg={key:1},tg=["data-testid"],rg=["data-testid"],ig=["data-testid"],ng=["data-testid"],og={name:"ConfigCardItem",components:{JsonCardItem:Rd,StatusBadge:Hy,InternalLinkItem:Fy}},sg=n.defineComponent({...og,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=>({dc1d91a8:y.value?"none":`solid ${n.unref(Gy)} ${n.unref(Ky)}`,"59ccec5f":d.value&&l.value?"block":"flex","29318fbe":d.value&&l.value?"100%":r.slim?"50%":"25%","292d0408":d.value&&l.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),l=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),c=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:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case le.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case le.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label}),text:r.item.value}};case le.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};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}}}),I=n.ref(),{isTruncated:w}=Be.useTruncationDetector(I);return(h,g)=>{const b=n.resolveComponent("KLabel"),v=n.resolveComponent("KBadge"),x=n.resolveComponent("KCopy"),E=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",Jy,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[c.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,Zy)]),key:"0"}:void 0]),1024)],!0)],8,Yy),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},()=>[l.value?(n.openBlock(),n.createElementBlock("div",eg,[(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,(k,B)=>(n.openBlock(),n.createBlock(v,{key:`${e.item.key}-badge-tag-${B}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${B}`,tooltip:k,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,tg)):n.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(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,(k,B)=>(n.openBlock(),n.createBlock(x,n.mergeProps({ref_for:!0},p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${B}`,"data-testid":`${e.item.key}-copy-uuid-${B}`,text:k}),null,16,["data-testid","text"]))),128))],8,rg)):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,(k,B)=>(n.openBlock(),n.createBlock(v,{key:`${e.item.key}-badge-method-${B}`,appearance:Object.values(n.unref(dp.BadgeMethodAppearances)).includes(k.toLowerCase())?k.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${B}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(k),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,ig)):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,(k,B)=>(n.openBlock(),n.createBlock(Rd,{key:`json-array-item-${B}`,index:B,"is-array-item":"",item:k},null,8,["index","item"]))),128))],8,ng)):(n.openBlock(),n.createBlock(E,{key:4,text:n.unref(w)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:I,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Xy))],!0)],8,Qy)])}}}),fo=ct(sg,[["__scopeId","data-v-d268261c"]]),ag={class:"json-config"},lg={key:0,class:"json-endpoint"},Ud=n.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){n.useCssVars(o=>({"4520e3ec":`${i.value}ch`}));const t=e,r=n.computed(()=>t.jsonRecord),i=n.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{const a=n.resolveComponent("KBadge"),l=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",ag,[t.fetcherUrl?(n.openBlock(),n.createElementBlock("div",lg,[n.createVNode(a,{appearance:t.requestMethod},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),n.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),t.jsonRecord?(n.openBlock(),n.createBlock(l,{key:1,id:"json-codeblock",class:n.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):n.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Ld(e){return typeof e>"u"||e===null}function cg(e){return typeof e=="object"&&e!==null}function ug(e){return Array.isArray(e)?e:Ld(e)?[]:[e]}function dg(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 fg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function pg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var hg=Ld,yg=cg,gg=ug,mg=fg,bg=pg,wg=dg,ke={isNothing:hg,isObject:yg,toArray:gg,repeat:mg,isNegativeZero:bg,extend:wg};function Fd(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 Ei(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Fd(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+": "+Fd(this,e)};var Re=Ei;function Fa(e,t,r,i,o){var s="",a="",l=Math.floor(o/2)-1;return i-t>l&&(s=" ... ",t=i-l+s.length),r-i>l&&(a=" ...",r=i+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ha(e,t){return ke.repeat(" ",t-e.length)+e}function
|
|
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=Fd(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+": "+Fd(this,e)};var Re=Ei;function Fa(e,t,r,i,o){var s="",a="",l=Math.floor(o/2)-1;return i-t>l&&(s=" ... ",t=i-l+s.length),r-i>l&&(a=" ...",r=i+l-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function Ha(e,t){return ke.repeat(" ",t-e.length)+e}function vg(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 l="",c,d,y=Math.min(e.line+t.linesAfter,o.length).toString().length,p=t.maxLength-(t.indent+y+3);for(c=1;c<=t.linesBefore&&!(a-c<0);c++)d=Fa(e.buffer,i[a-c],o[a-c],e.position-(i[a]-i[a-c]),p),l=ke.repeat(" ",t.indent)+Ha((e.line-c+1).toString(),y)+" | "+d.str+`
|
|
120
120
|
`+l;for(d=Fa(e.buffer,i[a],o[a],e.position,p),l+=ke.repeat(" ",t.indent)+Ha((e.line+1).toString(),y)+" | "+d.str+`
|
|
121
121
|
`,l+=ke.repeat("-",t.indent+y+3+d.pos)+`^
|
|
122
122
|
`,c=1;c<=t.linesAfter&&!(a+c>=o.length);c++)d=Fa(e.buffer,i[a+c],o[a+c],e.position-(i[a]-i[a+c]),p),l+=ke.repeat(" ",t.indent)+Ha((e.line+c+1).toString(),y)+" | "+d.str+`
|
|
123
|
-
`;return l.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
|
|
123
|
+
`;return l.replace(/\n$/,"")}var kg=vg,Cg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Sg=["scalar","sequence","mapping"];function xg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function Ag(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(Cg.indexOf(r)===-1)throw new Re('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=xg(t.styleAliases||null),Sg.indexOf(this.kind)===-1)throw new Re('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ve=Ag;function Hd(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 Bg(){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 qa(e){return this.extend(e)}qa.prototype.extend=function(e){var t=[],r=[];if(e instanceof Ve)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 Re("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof Ve))throw new Re("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Re("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 Re("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 Ve))throw new Re("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(qa.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Hd(i,"implicit"),i.compiledExplicit=Hd(i,"explicit"),i.compiledTypeMap=Bg(i.compiledImplicit,i.compiledExplicit),i};var qd=qa,Kd=new Ve("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),zd=new Ve("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Gd=new Ve("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Wd=new qd({explicit:[Kd,zd,Gd]});function Ig(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Eg(){return null}function Ng(e){return e===null}var Jd=new Ve("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ig,construct:Eg,predicate:Ng,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Og(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 _g(e){return e==="true"||e==="True"||e==="TRUE"}function Vg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Yd=new Ve("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Og,construct:_g,predicate:Vg,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 Tg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function jg(e){return 48<=e&&e<=55}function Dg(e){return 48<=e&&e<=57}function $g(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(!Tg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}if(o==="o"){for(r++;r<t;r++)if(o=e[r],o!=="_"){if(!jg(e.charCodeAt(r)))return!1;i=!0}return i&&o!=="_"}}if(o==="_")return!1;for(;r<t;r++)if(o=e[r],o!=="_"){if(!Dg(e.charCodeAt(r)))return!1;i=!0}return!(!i||o==="_")}function Mg(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 Pg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ke.isNegativeZero(e)}var Zd=new Ve("tag:yaml.org,2002:int",{kind:"scalar",resolve:$g,construct:Mg,predicate:Pg,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"]}}),Rg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ug(e){return!(e===null||!Rg.test(e)||e[e.length-1]==="_")}function Lg(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 Fg=/^[-+]?[0-9]+e/;function Hg(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(ke.isNegativeZero(e))return"-0.0";return r=e.toString(10),Fg.test(r)?r.replace("e",".e"):r}function qg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ke.isNegativeZero(e))}var Qd=new Ve("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ug,construct:Lg,predicate:qg,represent:Hg,defaultStyle:"lowercase"}),Xd=Wd.extend({implicit:[Jd,Yd,Zd,Qd]}),ef=Xd,tf=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),rf=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 Kg(e){return e===null?!1:tf.exec(e)!==null||rf.exec(e)!==null}function zg(e){var t,r,i,o,s,a,l,c=0,d=null,y,p,I;if(t=tf.exec(e),t===null&&(t=rf.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],l=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),I=new Date(Date.UTC(r,i,o,s,a,l,c)),d&&I.setTime(I.getTime()-d),I}function Gg(e){return e.toISOString()}var nf=new Ve("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Kg,construct:zg,instanceOf:Date,represent:Gg});function Wg(e){return e==="<<"||e===null}var of=new Ve("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Wg}),Ka=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function Jg(e){if(e===null)return!1;var t,r,i=0,o=e.length,s=Ka;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 Yg(e){var t,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=Ka,a=0,l=[];for(t=0;t<o;t++)t%4===0&&t&&(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=o%4*6,r===0?(l.push(a>>16&255),l.push(a>>8&255),l.push(a&255)):r===18?(l.push(a>>10&255),l.push(a>>2&255)):r===12&&l.push(a>>4&255),new Uint8Array(l)}function Zg(e){var t="",r=0,i,o,s=e.length,a=Ka;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 Qg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var sf=new Ve("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Jg,construct:Yg,predicate:Qg,represent:Zg}),Xg=Object.prototype.hasOwnProperty,em=Object.prototype.toString;function tm(e){if(e===null)return!0;var t=[],r,i,o,s,a,l=e;for(r=0,i=l.length;r<i;r+=1){if(o=l[r],a=!1,em.call(o)!=="[object Object]")return!1;for(s in o)if(Xg.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 rm(e){return e!==null?e:[]}var af=new Ve("tag:yaml.org,2002:omap",{kind:"sequence",resolve:tm,construct:rm}),im=Object.prototype.toString;function nm(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],im.call(i)!=="[object Object]"||(o=Object.keys(i),o.length!==1))return!1;s[t]=[o[0],i[o[0]]]}return!0}function om(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 lf=new Ve("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:nm,construct:om}),sm=Object.prototype.hasOwnProperty;function am(e){if(e===null)return!0;var t,r=e;for(t in r)if(sm.call(r,t)&&r[t]!==null)return!1;return!0}function lm(e){return e!==null?e:{}}var cf=new Ve("tag:yaml.org,2002:set",{kind:"mapping",resolve:am,construct:lm}),za=ef.extend({implicit:[nf,of],explicit:[sf,af,lf,cf]}),Ht=Object.prototype.hasOwnProperty,po=1,uf=2,df=3,ho=4,Ga=1,cm=2,ff=3,um=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,dm=/[\x85\u2028\u2029]/,fm=/[,\[\]\{\}]/,pf=/^(?:!|!!|![a-z\-]+!)$/i,hf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function yf(e){return Object.prototype.toString.call(e)}function vt(e){return e===10||e===13}function ur(e){return e===9||e===32}function Ge(e){return e===9||e===32||e===10||e===13}function Pr(e){return e===44||e===91||e===93||e===123||e===125}function pm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function hm(e){return e===120?2:e===117?4:e===85?8:0}function ym(e){return 48<=e&&e<=57?e-48:-1}function gf(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 gm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var mf=new Array(256),bf=new Array(256),Rr=0;Rr<256;Rr++)mf[Rr]=gf(Rr)?1:0,bf[Rr]=gf(Rr);function mm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||za,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 wf(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=kg(r),new Re(t,r)}function J(e,t){throw wf(e,t)}function yo(e,t){e.onWarning&&e.onWarning.call(null,wf(e,t))}var vf={YAML:function(e,t,r){var i,o,s;e.version!==null&&J(e,"duplication of %YAML directive"),r.length!==1&&J(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&J(e,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),s=parseInt(i[2],10),o!==1&&J(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&yo(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,o;r.length!==2&&J(e,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],pf.test(i)||J(e,"ill-formed tag handle (first argument) of the TAG directive"),Ht.call(e.tagMap,i)&&J(e,'there is a previously declared suffix for "'+i+'" tag handle'),hf.test(o)||J(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{J(e,"tag prefix is malformed: "+o)}e.tagMap[i]=o}};function qt(e,t,r,i){var o,s,a,l;if(t<r){if(l=e.input.slice(t,r),i)for(o=0,s=l.length;o<s;o+=1)a=l.charCodeAt(o),a===9||32<=a&&a<=1114111||J(e,"expected valid JSON character");else um.test(l)&&J(e,"the stream contains non-printable characters");e.result+=l}}function kf(e,t,r,i){var o,s,a,l;for(ke.isObject(r)||J(e,"cannot merge mappings; the provided source object is unacceptable"),o=Object.keys(r),a=0,l=o.length;a<l;a+=1)s=o[a],Ht.call(t,s)||(t[s]=r[s],i[s]=!0)}function Ur(e,t,r,i,o,s,a,l,c){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])&&J(e,"nested arrays are not supported inside keys"),typeof o=="object"&&yf(o[d])==="[object Object]"&&(o[d]="[object Object]");if(typeof o=="object"&&yf(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)kf(e,t,s[d],r);else kf(e,t,s,r);else!e.json&&!Ht.call(r,o)&&Ht.call(t,o)&&(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,J(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 Wa(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++):J(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function be(e,t,r){for(var i=0,o=e.input.charCodeAt(e.position);o!==0;){for(;ur(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(vt(o))for(Wa(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&&yo(e,"deficient indentation"),i}function go(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||Ge(r)))}function Ja(e,t){t===1?e.result+=" ":t>1&&(e.result+=ke.repeat(`
|
|
126
|
+
`,t-1))}function bm(e,t,r){var i,o,s,a,l,c,d,y,p=e.kind,I=e.result,w;if(w=e.input.charCodeAt(e.position),Ge(w)||Pr(w)||w===35||w===38||w===42||w===33||w===124||w===62||w===39||w===34||w===37||w===64||w===96||(w===63||w===45)&&(o=e.input.charCodeAt(e.position+1),Ge(o)||r&&Pr(o)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,l=!1;w!==0;){if(w===58){if(o=e.input.charCodeAt(e.position+1),Ge(o)||r&&Pr(o))break}else if(w===35){if(i=e.input.charCodeAt(e.position-1),Ge(i))break}else{if(e.position===e.lineStart&&go(e)||r&&Pr(w))break;if(vt(w))if(c=e.line,d=e.lineStart,y=e.lineIndent,be(e,!1,-1),e.lineIndent>=t){l=!0,w=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=c,e.lineStart=d,e.lineIndent=y;break}}l&&(qt(e,s,a,!1),Ja(e,e.line-c),s=a=e.position,l=!1),ur(w)||(a=e.position+1),w=e.input.charCodeAt(++e.position)}return qt(e,s,a,!1),e.result?!0:(e.kind=p,e.result=I,!1)}function wm(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(qt(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 vt(r)?(qt(e,i,o,!0),Ja(e,be(e,!1,t)),i=o=e.position):e.position===e.lineStart&&go(e)?J(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);J(e,"unexpected end of the stream within a single quoted scalar")}function vm(e,t){var r,i,o,s,a,l;if(l=e.input.charCodeAt(e.position),l!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(l=e.input.charCodeAt(e.position))!==0;){if(l===34)return qt(e,r,e.position,!0),e.position++,!0;if(l===92){if(qt(e,r,e.position,!0),l=e.input.charCodeAt(++e.position),vt(l))be(e,!1,t);else if(l<256&&mf[l])e.result+=bf[l],e.position++;else if((a=hm(l))>0){for(o=a,s=0;o>0;o--)l=e.input.charCodeAt(++e.position),(a=pm(l))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=gm(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else vt(l)?(qt(e,r,i,!0),Ja(e,be(e,!1,t)),r=i=e.position):e.position===e.lineStart&&go(e)?J(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}J(e,"unexpected end of the stream within a double quoted scalar")}function km(e,t){var r=!0,i,o,s,a=e.tag,l,c=e.anchor,d,y,p,I,w,h=Object.create(null),g,b,v,x;if(x=e.input.charCodeAt(e.position),x===91)y=93,w=!1,l=[];else if(x===123)y=125,w=!0,l={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),x=e.input.charCodeAt(++e.position);x!==0;){if(be(e,!0,t),x=e.input.charCodeAt(e.position),x===y)return e.position++,e.tag=a,e.anchor=c,e.kind=w?"mapping":"sequence",e.result=l,!0;r?x===44&&J(e,"expected the node content, but found ','"):J(e,"missed comma between flow collection entries"),b=g=v=null,p=I=!1,x===63&&(d=e.input.charCodeAt(e.position+1),Ge(d)&&(p=I=!0,e.position++,be(e,!0,t))),i=e.line,o=e.lineStart,s=e.position,Lr(e,t,po,!1,!0),b=e.tag,g=e.result,be(e,!0,t),x=e.input.charCodeAt(e.position),(I||e.line===i)&&x===58&&(p=!0,x=e.input.charCodeAt(++e.position),be(e,!0,t),Lr(e,t,po,!1,!0),v=e.result),w?Ur(e,l,h,b,g,v,i,o,s):p?l.push(Ur(e,null,h,b,g,v,i,o,s)):l.push(g),be(e,!0,t),x=e.input.charCodeAt(e.position),x===44?(r=!0,x=e.input.charCodeAt(++e.position)):r=!1}J(e,"unexpected end of the stream within a flow collection")}function Cm(e,t){var r,i,o=Ga,s=!1,a=!1,l=t,c=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)Ga===o?o=p===43?ff:cm:J(e,"repeat of a chomping mode identifier");else if((y=ym(p))>=0)y===0?J(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?J(e,"repeat of an indentation width identifier"):(l=t+y-1,a=!0);else break;if(ur(p)){do p=e.input.charCodeAt(++e.position);while(ur(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!vt(p)&&p!==0)}for(;p!==0;){for(Wa(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<l)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>l&&(l=e.lineIndent),vt(p)){c++;continue}if(e.lineIndent<l){o===ff?e.result+=ke.repeat(`
|
|
127
127
|
`,s?1+c:c):o===Ga&&s&&(e.result+=`
|
|
128
128
|
`);break}for(i?ur(p)?(d=!0,e.result+=ke.repeat(`
|
|
129
129
|
`,s?1+c:c)):d?(d=!1,e.result+=ke.repeat(`
|
|
130
130
|
`,c+1)):c===0?s&&(e.result+=" "):e.result+=ke.repeat(`
|
|
131
131
|
`,c):e.result+=ke.repeat(`
|
|
132
|
-
`,s?1+c:c),s=!0,a=!0,c=0,r=e.position;!vt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);qt(e,r,e.position,!1)}return!0}function Cf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,l=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!Ge(a))));){if(l=!0,e.position++,be(e,!0,-1)&&e.lineIndent<=t){s.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Lr(e,t,df,!1,!0),s.push(e.result),be(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)J(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
132
|
+
`,s?1+c:c),s=!0,a=!0,c=0,r=e.position;!vt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);qt(e,r,e.position,!1)}return!0}function Cf(e,t){var r,i=e.tag,o=e.anchor,s=[],a,l=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,"tab characters must not be used in indentation")),!(c!==45||(a=e.input.charCodeAt(e.position+1),!Ge(a))));){if(l=!0,e.position++,be(e,!0,-1)&&e.lineIndent<=t){s.push(null),c=e.input.charCodeAt(e.position);continue}if(r=e.line,Lr(e,t,df,!1,!0),s.push(e.result),be(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&c!==0)J(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return l?(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0):!1}function Sm(e,t,r){var i,o,s,a,l,c,d=e.tag,y=e.anchor,p={},I=Object.create(null),w=null,h=null,g=null,b=!1,v=!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(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),s=e.line,(x===63||x===58)&&Ge(i))x===63?(b&&(Ur(e,p,I,w,h,null,a,l,c),w=h=g=null),v=!0,b=!0,o=!0):b?(b=!1,o=!0):J(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,l=e.lineStart,c=e.position,!Lr(e,r,uf,!1,!0))break;if(e.line===s){for(x=e.input.charCodeAt(e.position);ur(x);)x=e.input.charCodeAt(++e.position);if(x===58)x=e.input.charCodeAt(++e.position),Ge(x)||J(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Ur(e,p,I,w,h,null,a,l,c),w=h=g=null),v=!0,b=!1,o=!1,w=e.tag,h=e.result;else if(v)J(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(v)J(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)&&(b&&(a=e.line,l=e.lineStart,c=e.position),Lr(e,t,ho,!0,o)&&(b?h=e.result:g=e.result),b||(Ur(e,p,I,w,h,g,a,l,c),w=h=g=null),be(e,!0,-1),x=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&x!==0)J(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Ur(e,p,I,w,h,null,a,l,c),v&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),v}function xm(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&&J(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)):J(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Ge(a);)a===33&&(i?J(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(t-1,e.position+1),pf.test(o)||J(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),fm.test(s)&&J(e,"tag suffix cannot contain flow indicator characters")}s&&!hf.test(s)&&J(e,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{J(e,"tag name is malformed: "+s)}return r?e.tag=s:Ht.call(e.tagMap,o)?e.tag=e.tagMap[o]+s:o==="!"?e.tag="!"+s:o==="!!"?e.tag="tag:yaml.org,2002:"+s:J(e,'undeclared tag handle "'+o+'"'),!0}function Am(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&J(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Ge(r)&&!Pr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Bm(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&&!Ge(i)&&!Pr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),Ht.call(e.anchorMap,r)||J(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],be(e,!0,-1),!0}function Lr(e,t,r,i,o){var s,a,l,c=1,d=!1,y=!1,p,I,w,h,g,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=a=l=ho===r||df===r,i&&be(e,!0,-1)&&(d=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;xm(e)||Am(e);)be(e,!0,-1)?(d=!0,l=s,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):l=!1;if(l&&(l=d||o),(c===1||ho===r)&&(po===r||uf===r?g=t:g=t+1,b=e.position-e.lineStart,c===1?l&&(Cf(e,b)||Sm(e,b,g))||km(e,g)?y=!0:(a&&Cm(e,g)||wm(e,g)||vm(e,g)?y=!0:Bm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&J(e,"alias node should not have any properties")):bm(e,g,po===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(y=l&&Cf(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&J(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),p=0,I=e.implicitTypes.length;p<I;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(Ht.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,w=e.typeMap.multi[e.kind||"fallback"],p=0,I=w.length;p<I;p+=1)if(e.tag.slice(0,w[p].tag.length)===w[p].tag){h=w[p];break}h||J(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&J(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)):J(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 Im(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&&(be(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&&!Ge(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),o=[],i.length<1&&J(e,"directive name must not be less than one character in length");a!==0;){for(;ur(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!vt(a));break}if(vt(a))break;for(r=e.position;a!==0&&!Ge(a);)a=e.input.charCodeAt(++e.position);o.push(e.input.slice(r,e.position))}a!==0&&Wa(e),Ht.call(vf,i)?vf[i](e,i,o):yo(e,'unknown document directive "'+i+'"')}if(be(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,be(e,!0,-1)):s&&J(e,"directives end mark is expected"),Lr(e,e.lineIndent-1,ho,!1,!0),be(e,!0,-1),e.checkLineBreaks&&dm.test(e.input.slice(t,e.position))&&yo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&go(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,be(e,!0,-1));return}if(e.position<e.length-1)J(e,"end of the stream or a document separator is expected");else return}function Sf(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 mm(e,t),i=e.indexOf("\0");for(i!==-1&&(r.position=i,J(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;)Im(r);return r.documents}function Em(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=Sf(e,r);if(typeof t!="function")return i;for(var o=0,s=i.length;o<s;o+=1)t(i[o])}function Nm(e,t){var r=Sf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Re("expected a single document in the stream, but found more")}}var Om=Em,_m=Nm,xf={loadAll:Om,load:_m},Af=Object.prototype.toString,Bf=Object.prototype.hasOwnProperty,Ya=65279,Vm=9,Ni=10,Tm=13,jm=32,Dm=33,$m=34,Za=35,Mm=37,Pm=38,Rm=39,Um=42,If=44,Lm=45,mo=58,Fm=61,Hm=62,qm=63,Km=64,Ef=91,Nf=93,zm=96,Of=123,Gm=124,_f=125,$e={};$e[0]="\\0",$e[7]="\\a",$e[8]="\\b",$e[9]="\\t",$e[10]="\\n",$e[11]="\\v",$e[12]="\\f",$e[13]="\\r",$e[27]="\\e",$e[34]='\\"',$e[92]="\\\\",$e[133]="\\N",$e[160]="\\_",$e[8232]="\\L",$e[8233]="\\P";var Wm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Jm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ym(e,t){var r,i,o,s,a,l,c;if(t===null)return{};for(r={},i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],l=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap.fallback[a],c&&Bf.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[a]=l;return r}function Zm(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 Re("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ke.repeat("0",i-t.length)+t}var Qm=1,Oi=2;function Xm(e){this.schema=e.schema||za,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ke.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Ym(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:Qm,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 Vf(e,t){for(var r=ke.repeat(" ",t),i=0,o=-1,s="",a,l=e.length;i<l;)o=e.indexOf(`
|
|
134
134
|
`,i),o===-1?(a=e.slice(i),i=l):(a=e.slice(i,o+1),i=o+1),a.length&&a!==`
|
|
135
135
|
`&&(s+=r),s+=a;return s}function Qa(e,t){return`
|
|
136
|
-
`+ke.repeat(" ",e.indent*t)}function
|
|
136
|
+
`+ke.repeat(" ",e.indent*t)}function e0(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 bo(e){return e===jm||e===Vm}function _i(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Ya||65536<=e&&e<=1114111}function Tf(e){return _i(e)&&e!==Ya&&e!==Tm&&e!==Ni}function jf(e,t,r){var i=Tf(e),o=i&&!bo(e);return(r?i:i&&e!==If&&e!==Ef&&e!==Nf&&e!==Of&&e!==_f)&&e!==Za&&!(t===mo&&!o)||Tf(t)&&!bo(t)&&e===Za||t===mo&&o}function t0(e){return _i(e)&&e!==Ya&&!bo(e)&&e!==Lm&&e!==qm&&e!==mo&&e!==If&&e!==Ef&&e!==Nf&&e!==Of&&e!==_f&&e!==Za&&e!==Pm&&e!==Um&&e!==Dm&&e!==Gm&&e!==Fm&&e!==Hm&&e!==Rm&&e!==$m&&e!==Mm&&e!==Km&&e!==zm}function r0(e){return!bo(e)&&e!==mo}function Vi(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 Df(e){var t=/^\n* /;return t.test(e)}var $f=1,Xa=2,Mf=3,Pf=4,Fr=5;function i0(e,t,r,i,o,s,a,l){var c,d=0,y=null,p=!1,I=!1,w=i!==-1,h=-1,g=t0(Vi(e,0))&&r0(Vi(e,e.length-1));if(t||a)for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=Vi(e,c),!_i(d))return Fr;g=g&&jf(d,y,l),y=d}else{for(c=0;c<e.length;d>=65536?c+=2:c++){if(d=Vi(e,c),d===Ni)p=!0,w&&(I=I||c-h-1>i&&e[h+1]!==" ",h=c);else if(!_i(d))return Fr;g=g&&jf(d,y,l),y=d}I=I||w&&c-h-1>i&&e[h+1]!==" "}return!p&&!I?g&&!a&&!o(e)?$f:s===Oi?Fr:Xa:r>9&&Df(e)?Fr:a?s===Oi?Fr:Xa:I?Pf:Mf}function n0(e,t,r,i,o){e.dump=function(){if(t.length===0)return e.quotingType===Oi?'""':"''";if(!e.noCompatMode&&(Wm.indexOf(t)!==-1||Jm.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),l=i||e.flowLevel>-1&&r>=e.flowLevel;function c(d){return e0(e,d)}switch(i0(t,l,e.indent,a,c,e.quotingType,e.forceQuotes&&!i,o)){case $f:return t;case Xa:return"'"+t.replace(/'/g,"''")+"'";case Mf:return"|"+Rf(t,e.indent)+Uf(Vf(t,s));case Pf:return">"+Rf(t,e.indent)+Uf(Vf(o0(t,a),s));case Fr:return'"'+s0(t)+'"';default:throw new Re("impossible error: invalid scalar style")}}()}function Rf(e,t){var r=Df(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
140
|
`}function Uf(e){return e[e.length-1]===`
|
|
141
|
-
`?e.slice(0,-1):e}function
|
|
141
|
+
`?e.slice(0,-1):e}function o0(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
|
|
142
142
|
`);return d=d!==-1?d:e.length,r.lastIndex=d,Lf(e.slice(0,d),t)}(),o=e[0]===`
|
|
143
143
|
`||e[0]===" ",s,a;a=r.exec(e);){var l=a[1],c=a[2];s=c[0]===" ",i+=l+(!o&&!s&&c!==""?`
|
|
144
144
|
`:"")+Lf(c,t),o=s}return i}function Lf(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,o=0,s,a=0,l=0,c="";i=r.exec(e);)l=i.index,l-o>t&&(s=a>o?a:l,c+=`
|
|
145
145
|
`+e.slice(o,s),o=s+1),a=l;return c+=`
|
|
146
146
|
`,e.length-o>t&&a>o?c+=e.slice(o,a)+`
|
|
147
|
-
`+e.slice(a+1):c+=e.slice(o),c.slice(1)}function
|
|
148
|
-
`:""}var p0=f0,h0={dump:p0};function tl(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 y0=Ve,g0=qd,m0=Wd,b0=Xd,w0=ef,v0=za,k0=xf.load,C0=xf.loadAll,S0=h0.dump,x0=Re,A0={binary:sf,float:Qd,map:Gd,null:Jd,pairs:lf,set:cf,timestamp:nf,bool:Yd,int:Zd,merge:of,omap:af,seq:zd,str:Kd},B0=tl("safeLoad","load"),I0=tl("safeLoadAll","loadAll"),E0=tl("safeDump","dump"),N0={Type:y0,Schema:g0,FAILSAFE_SCHEMA:m0,JSON_SCHEMA:b0,CORE_SCHEMA:w0,DEFAULT_SCHEMA:v0,load:k0,loadAll:C0,dump:S0,YAMLException:x0,types:A0,safeLoad:B0,safeLoadAll:I0,safeDump:E0};const O0={class:"yaml-config"},qf=n.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=n.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,o])=>o!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":N0.dump(i).trim()});return(i,o)=>{const s=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",O0,[t.yamlRecord?(n.openBlock(),n.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):n.createCommentVNode("",!0)])}}}),_0={key:0,class:"config-card-display-form"},V0=["data-testid"],T0={key:0,class:"config-card-prop-section-title"},j0=n.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},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:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Be.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=n.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",_0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,c=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${c}-props`,class:n.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(n.openBlock(),n.createElementBlock("div",T0,n.toDisplayString(c==="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[c],d=>(n.openBlock(),n.createBlock(fo,{key:d.key,item:d},n.createSlots({label:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:n.withCtx(({rowValue:y})=>[n.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,V0))),128))])):n.createCommentVNode("",!0),e.format==="json"&&t.record?(n.openBlock(),n.createBlock(Ud,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):n.createCommentVNode("",!0),e.format==="yaml"&&t.record?(n.openBlock(),n.createBlock(qf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):n.createCommentVNode("",!0)],64))}}),D0=ct(j0,[["__scopeId","data-v-2052238b"]]),kt="24px",Ti=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},$0=e=>(n.pushScopeId("data-v-f89f0eca"),e=e(),n.popScopeId(),e),M0=["aria-hidden"],P0={key:0,"data-testid":"kui-icon-svg-title"},R0=$0(()=>n.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),U0=n.defineComponent({__name:"AddIcon",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:kt,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 kt}),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 add-icon","data-testid":"kui-icon-wrapper-add-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-add-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",P0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),R0],8,M0))]),_:1},8,["aria-hidden","style"]))}}),L0=Ti(U0,[["__scopeId","data-v-f89f0eca"]]),F0=e=>(n.pushScopeId("data-v-04be5bd5"),e=e(),n.popScopeId(),e),H0=["aria-hidden"],q0={key:0,"data-testid":"kui-icon-svg-title"},K0=F0(()=>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)),z0=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:kt,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 kt}),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",q0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),K0],8,H0))]),_:1},8,["aria-hidden","style"]))}}),G0=Ti(z0,[["__scopeId","data-v-04be5bd5"]]),W0=e=>(n.pushScopeId("data-v-5cdeb7d0"),e=e(),n.popScopeId(),e),J0=["aria-hidden"],Y0={key:0,"data-testid":"kui-icon-svg-title"},Z0=W0(()=>n.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),Q0=n.defineComponent({__name:"ChevronDownIcon",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:kt,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 kt}),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 chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-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-chevron-down-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",Y0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Z0],8,J0))]),_:1},8,["aria-hidden","style"]))}}),X0=Ti(Q0,[["__scopeId","data-v-5cdeb7d0"]]),e1=e=>(n.pushScopeId("data-v-8d5fae6f"),e=e(),n.popScopeId(),e),t1=["aria-hidden"],r1={key:0,"data-testid":"kui-icon-svg-title"},i1=e1(()=>n.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),n1=n.defineComponent({__name:"CloseIcon",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:kt,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 kt}),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 close-icon","data-testid":"kui-icon-wrapper-close-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-close-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=Ti(n1,[["__scopeId","data-v-8d5fae6f"]]),s1=e=>(n.pushScopeId("data-v-032e3956"),e=e(),n.popScopeId(),e),a1=["aria-hidden"],l1={key:0,"data-testid":"kui-icon-svg-title"},c1=s1(()=>n.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),u1=n.defineComponent({__name:"MoreIcon",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:kt,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 kt}),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 more-icon","data-testid":"kui-icon-wrapper-more-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-more-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",l1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),c1],8,a1))]),_:1},8,["aria-hidden","style"]))}}),d1=Ti(u1,[["__scopeId","data-v-032e3956"]]),f1={class:"config-card-title","data-testid":"config-card-title"},p1={class:"config-card-actions"},h1=["href"],y1={class:"config-card-details-section"},g1=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},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const i=t,o=e,{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:l}=Be.useStringHelpers(),{axiosInstance:c}=Be.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=n.ref("structured"),p=S=>{y.value=S==null?void 0:S.value},I={id:{type:le.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:le.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:le.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:le.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:le.BadgeTag,order:-1,section:fe.Basic}},w=n.ref(!1),h=n.ref(!1),g=n.ref(""),b=n.ref({}),v=n.computed(()=>{var S,T,O;if(!b.value)return[];const N=[],re=Object.keys(b.value).length;for(const q in b.value){const D=(T=(S=o.configSchema)==null?void 0:S[q])==null?void 0:T.order,Q=(O=I[q])==null?void 0:O.order;let ne=re;(Q||Q===0)&&(ne=Q===-1?re+1:Q),D&&(ne=D===-1?re+1:D),N.push([q,ne])}return N.sort(function(q,D){return q[1]-D[1]}),N.map(q=>{var D,Q;const ne=q[0],Ie=(D=b.value)==null?void 0:D[ne],Ce=((Q=o.configSchema)==null?void 0:Q[ne])||{},Ee=I[ne];return{key:ne,value:Ie,hidden:Ce.hidden||!1,type:Ce.type??((Ee==null?void 0:Ee.type)||le.Text),label:Ce.label??((Ee==null?void 0:Ee.label)||l(ne)),tooltip:Ce.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:Ce.section??((Ee==null?void 0:Ee.section)||fe.Advanced)}}).filter(q=>!q.hidden&&q.key!==o.pluginConfigKey)}),x=n.computed(()=>{var S,T;if(!b.value||!o.pluginConfigKey)return[];const O=b.value[o.pluginConfigKey]||{},N=Object.keys(O).length,re=[];for(const q in O){const D=(T=(S=o.pluginConfigSchema)==null?void 0:S[q])==null?void 0:T.order,Q=O[q];let ne=Q!=null&&Q!==""?N-1:N;D&&(ne=D===-1?N+1:D),re.push([q,ne])}return re.sort(function(q,D){return q[1]-D[1]}),re.map(q=>{var D;const Q=q[0],ne=O[Q],Ie=((D=o.pluginConfigSchema)==null?void 0:D[Q])||{};return{key:Q,value:ne,hidden:Ie.hidden||!1,type:Ie.type??le.Text,label:Ie.label??l(Q),tooltip:Ie.tooltip??void 0,section:fe.Plugin}}).filter(q=>!q.hidden)}),E=n.computed(()=>{var S,T,O,N;return{basic:(S=v.value)==null?void 0:S.filter(re=>re.section===fe.Basic),advanced:(T=v.value)==null?void 0:T.filter(re=>re.section===fe.Advanced),plugin:(N=x.value)==null?void 0:N.concat((O=v.value)==null?void 0:O.filter(re=>re.section===fe.Plugin))}}),k=n.computed(()=>{const S=[];return E.value.basic.length&&S.push("basic"),E.value.advanced.length&&S.push("advanced"),E.value.plugin.length&&S.push("plugin"),S}),B=n.computed(()=>{var S,T;let O=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((S=o.config)==null?void 0:S.controlPlaneId)||""):o.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),O=O.replace(/{id}/gi,o.config.entityId),O});return n.watch(w,S=>{i("loading",S)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:S}=await c.get(B.value);if(o.dataKey)if(typeof S[o.dataKey]<"u")b.value={...S[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else b.value={...S};Object.keys(o.configSchema).filter(T=>o.configSchema[T].forceShow).forEach(T=>{b.value&&typeof b.value[T]>"u"&&(b.value[T]=null)}),i("fetch:success",S)}catch(S){const T=a(S);g.value=T.startsWith("code")?s("baseConfigCard.errors.load"):T,h.value=!0,i("fetch:error",S)}finally{w.value=!1}}),(S,T)=>{const O=n.resolveComponent("KLabel"),N=n.resolveComponent("KSelect"),re=n.resolveComponent("KButton"),q=n.resolveComponent("KSkeleton"),D=n.resolveComponent("KEmptyState"),Q=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(Q,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",p1,[n.renderSlot(S.$slots,"actions",{},void 0,!0),n.createVNode(O,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1}),n.createVNode(N,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(n.openBlock(),n.createBlock(re,{key:0,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(G0),{size:n.unref(Jy)},null,8,["size"])],8,h1)]),_:1})):n.createCommentVNode("",!0)])]),default:n.withCtx(()=>[w.value?(n.openBlock(),n.createBlock(q,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(D,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(g.value),1)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",y1,[n.createVNode(D0,{config:e.config,"fetcher-url":B.value,format:y.value,"prop-list-types":k.value,"property-collections":E.value,record:b.value},n.createSlots({_:2},[n.renderList(Object.keys(S.$slots),ne=>({name:ne,fn:n.withCtx(({row:Ie,rowValue:Ce})=>[n.renderSlot(S.$slots,ne,{row:Ie,rowValue:Ce},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("span",f1,[n.renderSlot(S.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Kf=ct(g1,[["__scopeId","data-v-f40a683b"]]),m1=["novalidate"],b1={class:"form-actions","data-testid":"form-actions"},w1=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:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,o=e,s=Wr.useRouter(),{i18n:{t:a}}=Be.useI18n(),{getMessageFromError:l}=Be.useErrors(),{axiosInstance:c}=Be.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),I=n.computed(()=>o.canSubmit===!1||o.isReadonly),w=n.ref(!1),h=n.computed(()=>{var k,B;let S=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((k=o.config)==null?void 0:k.controlPlaneId)||""):o.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(B=o.config)!=null&&B.workspace?`/${o.config.workspace}`:"")),o.editId?(S=S.replace(/{id}/gi,o.editId),S):(S=S.replace(/\/{id}/gi,""),S)}),g=()=>{w.value=!w.value},b=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):v()},v=()=>{i("cancel")},x=()=>{I.value||i("submit")},E=n.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return n.watch(()=>d.value,k=>{i("loading",k)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:k}=await c.get(h.value);i("fetch:success",k)}catch(k){const B=l(k);p.value=B.startsWith("code")?a("baseForm.errors.edit"):B,y.value=!0,i("fetch:error",k)}finally{d.value=!1}}),(k,B)=>{const S=n.resolveComponent("KSkeleton"),T=n.resolveComponent("KEmptyState"),O=n.resolveComponent("KAlert"),N=n.resolveComponent("KButton"),re=n.resolveComponent("KTabs"),q=n.resolveComponent("KSlideout");return n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(S,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(T,{key:1,"action-button-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:n.withModifiers(v,["prevent"]),onSubmit:n.withModifiers(x,["prevent"])},[n.renderSlot(k.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(O,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):n.createCommentVNode("",!0),n.createElementVNode("div",b1,[n.renderSlot(k.$slots,"form-actions",{},()=>[n.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:B[0]||(B[0]=D=>g())},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),n.createVNode(N,{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(N,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,m1)),n.createVNode(q,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:n.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:B[1]||(B[1]=D=>g())},{default:n.withCtx(()=>[n.createElementVNode("div",null,n.toDisplayString(n.unref(a)("baseForm.configuration.message")),1),n.createVNode(re,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:n.withCtx(()=>[n.createVNode(Ud,{config:e.config,"fetcher-url":h.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:n.withCtx(()=>[n.createVNode(qf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),zf=ct(w1,[["__scopeId","data-v-fd05df8e"]]),v1=["data-truncate"],k1=n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=n.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),o=n.computed(()=>{var b,v;const x=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return x?((v=x[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!1}),s=n.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,x;let E=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const k=window.getComputedStyle(r.value);E-=(parseFloat(k.paddingLeft)||0)+(parseFloat(k.paddingRight)||0)}y.value=((v=i.value)==null?void 0:v.getBoundingClientRect().width)||0,p.value=E,I.value=((x=d.value)==null?void 0:x.innerText)||""},d=n.ref({}),y=n.ref(0),p=n.ref(0),I=n.ref(""),w=n.computed(()=>[i.value,r.value]),h=n.watch(w,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=n.computed(()=>s.value?y.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{h()}),(b,v)=>{const x=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(n.openBlock(),n.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[n.createVNode(x,{"max-width":"300",placement:"bottomStart",text:g.value?I.value:""},{default:n.withCtx(()=>[n.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,v1)):n.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),C1=ct(k1,[["__scopeId","data-v-471ce76e"]]),S1={class:"toolbar-container"},x1={key:0,class:"toolbar-button-container"},A1=["data-testid"],B1=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},sortHandlerFunction:{type:Function,default:()=>({})},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:""},titleTag:{type:String,default:"h2"},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}}=Be.useI18n(),s=n.computed(()=>{var S,T;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(S=r.errorMessage)==null?void 0:S.title,message:(T=r.errorMessage)==null?void 0:T.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=S=>S.hasData||!!r.query,c=n.computed(()=>{const S=[];return Object.keys(r.tableHeaders).forEach(T=>{const O=r.tableHeaders[T];S.push({label:O.label??T,key:T,sortable:O.sortable??!1,hidable:!0})}),r.enableEntityActions&&S.push({key:"actions",hideLabel:!0}),S}),d=S=>({"data-rowid":S.id,"data-testid":S.name,...r.rowAttributes(S)}),y=n.ref({}),p=S=>{var T;return(T=y.value)==null?void 0:T.$el.querySelector(`[data-rowid="${S.id}"]`)},I=S=>{const T={"data-testid":S.headerKey,...r.cellAttributes(S)};return S.colIndex===0&&(T.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),T},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=n.computed(()=>r.disableRowClick?void 0:(S,T)=>{i("click:row",T)}),b=S=>{i("sort",S)},{setTablePreferences:v,getTablePreferences:x}=hy(),E=n.ref(x(a.value)),k=n.computed(()=>{const S=x(a.value);return{...r.initialFetcherParams,...S}}),B=S=>{E.value=S,a.value&&v(a.value,S)};return(S,T)=>{const O=n.resolveComponent("KButton"),N=n.resolveComponent("KDropdown"),re=n.resolveComponent("KTable"),q=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:n.withCtx(()=>[n.createVNode(re,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","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,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":k.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":E.value,onEmptyStateActionClick:w,"onRow:click":g.value,onSort:T[0]||(T[0]=D=>b(D)),"onUpdate:tablePreferences":B},n.createSlots({toolbar:n.withCtx(({state:D})=>[n.withDirectives(n.createElementVNode("div",S1,[n.renderSlot(S.$slots,"toolbar-filter",{},void 0,!0),S.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",x1,[n.renderSlot(S.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,l(D)]])]),actions:n.withCtx(({row:D,rowKey:Q,rowValue:ne})=>[n.createElementVNode("div",{class:"actions-container","data-testid":D.name},[n.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(S.$slots,"actions",{row:D,rowKey:Q,rowValue:ne},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(O,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:n.withCtx(()=>[n.createVNode(n.unref(d1))]),_:1})]),_:2},1032,["width"])],8,A1)]),_:2},[n.renderList(e.tableHeaders,(D,Q)=>({name:Q,fn:n.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[n.createVNode(C1,{"key-name":String(Q),"row-el":p(ne),tooltip:D.tooltip},{default:n.withCtx(()=>[n.renderSlot(S.$slots,Q,{row:ne,rowKey:Ie,rowValue:Ce},()=>[n.createTextVNode(n.toDisplayString(Ce),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:n.withCtx(()=>[n.createVNode(n.unref(L0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Gf=ct(B1,[["__scopeId","data-v-67bd29c7"]]),I1={key:0,class:"kong-ui-entity-delete-error"},E1={key:1,class:"description"},N1=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}=Be.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,d)=>{const y=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:l},{default:n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",I1,[n.createVNode(y,{appearance:"danger"},{default: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||c.$slots.description?(n.openBlock(),n.createElementBlock("div",E1,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Wf=ct(N1,[["__scopeId","data-v-4361d622"]]),O1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},_1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},V1=["fill"],T1={mask:"url(#mask0_180_20349)"},j1=["fill"],Jf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Ky})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",O1,[n.createElementVNode("mask",_1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,V1)]),n.createElementVNode("g",T1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,j1)])]))}}),D1={key:1,class:"kong-ui-entity-filter"},$1={class:"kong-ui-entity-filter-menu"},M1=["data-testid"],P1=["onClick","onKeydown"],R1={class:"menu-item-indicator"},U1={class:"menu-item-body"},L1=["for"],F1={class:"menu-item-buttons"},H1={class:"filter-clear-button-container"},q1=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}}=Be.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),l=n.ref(new Set),c=n.computed(()=>{const k=[];return new URLSearchParams(i.modelValue).forEach((B,S)=>{B!==""&&k.push(S)}),k}),d=n.computed(()=>{const k=i.config.fields;return Object.keys(k).filter(B=>{var S;return(S=k==null?void 0:k[B])==null?void 0:S.searchable}).map(B=>({label:k[B].label||B,value:B,expanded:!1}))});n.watch(()=>i.modelValue,k=>{a.value={},new URLSearchParams(k).forEach((B,S)=>{a.value[S]=B})});const y=()=>{s.value=!s.value},p=k=>{l.value.has(k)?l.value.delete(k):l.value.add(k)},I=k=>{o("update:modelValue",k)},w=()=>{I("")},h=k=>`filter-${k}`,g=k=>{var B,S;return(((S=(B=i.config.schema)==null?void 0:B[k])==null?void 0:S.values)??[]).map(T=>({value:T,label:T}))},b=k=>{var B,S;return((S=(B=i.config.schema)==null?void 0:B[k])==null?void 0:S.type)??"text"},v=k=>{a.value={...a.value,[k]:""},E()},x=()=>{a.value={},E(!0)},E=(k=!1)=>{const B=Object.keys(a.value).reduce((S,T)=>(a.value[T]&&(S[T]=`${a.value[T]}`),S),{});k&&(s.value=!1),o("update:modelValue",new URLSearchParams(B).toString())};return(k,B)=>{const S=n.resolveComponent("KInput"),T=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect");return e.config.isExactMatch?(n.openBlock(),n.createBlock(S,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":I},{before:n.withCtx(()=>[n.createVNode(Jf)]),after:n.withCtx(()=>[n.withDirectives(n.createVNode(n.unref(o1),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[n.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",D1,[n.createVNode(T,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{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:y},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createElementVNode("div",$1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,N=>{var re,q;return n.openBlock(),n.createElementBlock("div",{key:N.value,class:"kong-ui-entity-filter-menu-item","data-testid":N.value},[n.createElementVNode("span",{class:n.normalizeClass(["menu-item-title",{expanded:l.value.has(N.value)}]),role:"button",tabindex:"0",onClick:D=>p(N.value),onKeydown:n.withKeys(D=>p(N.value),["enter"])},[n.createTextVNode(n.toDisplayString(N.label)+" ",1),n.withDirectives(n.createElementVNode("span",R1,null,512),[[n.vShow,c.value.includes(N.value)]]),n.createVNode(n.unref(X0),{class:n.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(N.value)}]),color:n.unref(Gy)},null,8,["class","color"])],42,P1),n.withDirectives(n.createElementVNode("div",U1,[n.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,L1),((q=(re=e.config.schema)==null?void 0:re[N.value])==null?void 0:q.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":D=>a.value[N.value]=D,items:g(N.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(S,{key:1,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":D=>a.value[N.value]=D,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:b(N.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[n.vShow,l.value.has(N.value)]]),n.withDirectives(n.createElementVNode("div",F1,[n.createVNode(T,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:B[0]||(B[0]=D=>E(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(T,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:D=>v(N.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[n.vShow,l.value.has(N.value)]])],8,M1)}),128)),n.createElementVNode("div",H1,[n.createVNode(T,{appearance:"tertiary",size:"small",onClick:x},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[n.vShow,s.value]])]))}}}),Yf=ct(q1,[["__scopeId","data-v-94990087"]]),jt=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)}});let wo;const K1=new Uint8Array(16);function z1(){if(!wo&&(wo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wo(K1)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function G1(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const W1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Zf={randomUUID:W1};function J1(e,t,r){if(Zf.randomUUID&&!t&&!e)return Zf.randomUUID();e=e||{};const i=e.random||(e.rng||z1)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=i[o];return t}return G1(i)}const Y1=["aria-labelledby"],Z1={class:"form-section-wrapper"},Q1={key:1,class:"form-section-description"},X1={key:2,class:"form-section-footer"},eb={class:"form-section-content"},tb=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},titleTag:{type:String,default:"h2"}},setup(e){const t=n.useSlots(),r=J1();return(i,o)=>(n.openBlock(),n.createElementBlock("div",{"aria-labelledby":e.title?n.unref(r):void 0,class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[n.createElementVNode("div",Z1,[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.createBlock(n.resolveDynamicComponent(e.titleTag),{key:0,id:n.unref(r),class:"form-section-title"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1},8,["id"])):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",Q1,[n.renderSlot(i.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",X1,[n.renderSlot(i.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",eb,[n.renderSlot(i.$slots,"default",{},void 0,!0)])])],10,Y1))}}),vo=ct(tb,[["__scopeId","data-v-b1f74200"]]),{useAxios:ko,useDeleteUrlBuilder:Qf,useErrors:Xf,useExternalLinkCreator:Hb,useFetchUrlBuilder:qb,useFetcher:ep,useDebouncedFilter:Kb,useStringHelpers:tp,useHelpers:rp,useGatewayFeatureSupported:zb,useTruncationDetector:Gb,useValidators:Wb}=Be,rb={class:"kong-ui-entities-certificates-list"},ib={key:0},nb={key:1},ob={key:0},sb={key:1},ab={key:0},lb={key:1},cb={key:1},ub={key:1},db=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 ee;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=ko((ee=i.config)==null?void 0:ee.axiosRequestConfig),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={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}},w=n.computed(()=>{var K,de;let U=`${i.config.apiBaseUrl}${Ii.list[i.config.app]}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((K=i.config)==null?void 0:K.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(de=i.config)!=null&&de.workspace?`/${i.config.workspace}`:"")),U}),h=n.ref(""),g=n.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:v}=ep(i.config,w.value),x=()=>{h.value=""},E=()=>{d.value++},k=n.ref(null),B=(U,K)=>{const de=U.id;if(!K(de)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:de})})},S=(U,K)=>{const de=JSON.stringify(U);if(!K(de)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},T=async U=>{var de;await((de=i.canRetrieve)==null?void 0:de.call(i,U))&&l.push(i.config.getViewRoute(U.id))},O=U=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(U)}),N=U=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(U)}),re=U=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},q=n.ref(void 0),D=n.ref(!1),Q=n.ref(!1),ne=n.ref(""),Ie=Qf(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=wt.useCertificate(),qr=U=>{q.value=U,D.value=!0},Kr=()=>{D.value=!1},dr=async()=>{var U,K,de;if((U=q.value)!=null&&U.id){Q.value=!0;try{await c.delete(Ie(q.value.id)),Q.value=!1,D.value=!1,d.value++,r("delete:success",q.value)}catch(Ue){ne.value=((de=(K=Ue.response)==null?void 0:K.data)==null?void 0:de.message)||Ue.message||o("certificates.errors.delete"),r("error",Ue)}finally{Q.value=!1}}},Dt=n.ref(!0);n.watch(v,U=>{var K,de,Ue,Qe;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(Dt.value=U.response.data.length>0),U.status===Ft.Error){k.value={title:o("certificates.errors.general")},(Qe=(Ue=(de=U.error)==null?void 0:de.response)==null?void 0:Ue.data)!=null&&Qe.message&&(k.value.message=U.error.response.data.message),r("error",U.error);return}Ce.value={},k.value=null});const X=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(X.value.title=o("certificates.list.empty_state.title"),X.value.ctaText=o("certificates.actions.create"))}),(U,K)=>{const de=n.resolveComponent("KButton"),Ue=n.resolveComponent("KCopy"),Qe=n.resolveComponent("KBadge"),zr=n.resolveComponent("KTruncate"),te=n.resolveComponent("KDropdownItem"),Se=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",rb,[n.createVNode(n.unref(Gf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":k.value,fetcher:n.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":K[2]||(K[2]=Y=>T(Y)),onSort:E},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Yf),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(jt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(de,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:n.withCtx(()=>[n.createVNode(n.unref(al)),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Dt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:n.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",ib,n.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",nb,n.toDisplayString(n.unref(Ee)(Y).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",ob,n.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?n.unref(s)(Y.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",sb,n.toDisplayString(n.unref(Ee)(Y).schemaExpiry?n.unref(s)(n.unref(Ee)(Y).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",ab,n.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",lb,n.toDisplayString(n.unref(Ee)(Y).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:Y})=>[Y!=null&&Y.cert?(n.openBlock(),n.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Y.cert,truncate:""},null,8,["text"])):(n.openBlock(),n.createElementBlock("span",cb,"-"))]),tags:n.withCtx(({row:Y})=>{var xe;return[((xe=Y==null?void 0:Y.tags)==null?void 0:xe.length)>0?(n.openBlock(),n.createBlock(zr,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y==null?void 0:Y.tags,Gr=>(n.openBlock(),n.createBlock(Qe,{key:Gr,onClick:K[1]||(K[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",ub,"-"))]}),actions:n.withCtx(({row:Y})=>[n.createVNode(Se,null,{default:n.withCtx(({copyToClipboard:xe})=>[n.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:Gr=>B(Y,xe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Se,null,{default:n.withCtx(({copyToClipboard:xe})=>[n.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:Gr=>S(Y,xe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(jt),{"auth-function":()=>e.canRetrieve(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:O(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(jt),{"auth-function":()=>e.canEdit(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-edit",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(jt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-add-sni",item:re(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(jt),{"auth-function":()=>e.canDelete(Y)},{default:n.withCtx(()=>[n.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>qr(Y)},{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(Wf),{"action-pending":Q.value,"entity-type":n.unref(Ra).Certificate,error:ne.value,title:n.unref(o)("certificates.delete.title"),visible:D.value,onCancel:Kr,onProceed:dr},{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},fb=Hr(db,[["__scopeId","data-v-fcc46780"]]),pb={class:"kong-ui-entities-certificates-form"},hb=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 k;const r=t,i=e,o=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=wt.useI18n(),{getMessageFromError:l}=Xf(),{axiosInstance:c}=ko((k=i.config)==null?void 0:k.axiosRequestConfig),d=n.computed(()=>Ii.form[i.config.app].edit),y=n.computed(()=>i.certificateId?cr.Edit:cr.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),I=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=n.computed(()=>(y.value===cr.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=B=>{var S;p.fields.cert=(B==null?void 0:B.cert)||"",p.fields.key=(B==null?void 0:B.key)||"",p.fields.certAlt=(B==null?void 0:B.cert_alt)||"",p.fields.keyAlt=(B==null?void 0:B.key_alt)||"",p.fields.tags=((S=B==null?void 0:B.tags)==null?void 0:S.join(", "))||"",Object.assign(I,p.fields)},g=()=>{o.push(i.config.cancelRoute)},b=n.computed(()=>{var S,T;let B=`${i.config.apiBaseUrl}${Ii.form[i.config.app].validate}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((S=i.config)==null?void 0:S.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),v=n.computed(()=>{var S,T;let B=`${i.config.apiBaseUrl}${Ii.form[i.config.app][y.value]}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((S=i.config)==null?void 0:S.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),x=n.computed(()=>{var B,S;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(S=(B=p.fields.tags.split(","))==null?void 0:B.map(T=>String(T||"").trim()))==null?void 0:S.filter(T=>T!=="")}}),E=async()=>{var B,S,T,O,N,re,q;try{p.isReadonly=!0;let D;await c.post(b.value,x.value),y.value==="create"?D=await c.post(v.value,x.value):y.value==="edit"&&(D=((B=i.config)==null?void 0:B.app)==="konnect"?await c.put(v.value,x.value):await c.patch(v.value,x.value)),p.fields.cert=((S=D==null?void 0:D.data)==null?void 0:S.cert)||"",p.fields.key=((T=D==null?void 0:D.data)==null?void 0:T.key)||"",p.fields.certAlt=((O=D==null?void 0:D.data)==null?void 0:O.cert_alt)||"",p.fields.keyAlt=((N=D==null?void 0:D.data)==null?void 0:N.key_alt)||"",p.fields.tags=((q=(re=D==null?void 0:D.data)==null?void 0:re.tags)==null?void 0:q.join(", "))||"",Object.assign(I,p.fields),r("update",D==null?void 0:D.data)}catch(D){p.errorMessage=l(D),r("error",D)}finally{p.isReadonly=!1}};return(B,S)=>{const T=n.resolveComponent("KTextArea"),O=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",pb,[n.createVNode(n.unref(zf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":x.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":S[5]||(S[5]=N=>B.$emit("error",N)),"onFetch:success":h,onLoading:S[6]||(S[6]=N=>B.$emit("loading",N)),onSubmit:E},{default:n.withCtx(()=>[n.createVNode(n.unref(vo),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(T,{modelValue:p.fields.cert,"onUpdate:modelValue":S[0]||(S[0]=N=>p.fields.cert=N),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(T,{modelValue:p.fields.key,"onUpdate:modelValue":S[1]||(S[1]=N=>p.fields.key=N),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(T,{modelValue:p.fields.certAlt,"onUpdate:modelValue":S[2]||(S[2]=N=>p.fields.certAlt=N),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(T,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":S[3]||(S[3]=N=>p.fields.keyAlt=N),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(vo),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:p.fields.tags,"onUpdate:modelValue":S[4]||(S[4]=N=>p.fields.tags=N),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","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-cec1c591"]]),Co="/v2/control-planes/{controlPlaneId}/core-entities",So="/{workspace}",ji={list:{konnect:`${Co}/ca_certificates`,kongManager:`${So}/ca_certificates`},form:{konnect:{create:`${Co}/ca_certificates`,edit:`${Co}/ca_certificates/{id}`,validate:`${Co}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/schemas/ca_certificates/validate`}}},yb={class:"kong-ui-ca-certificate-entity-config-card"},gb={key:0},mb=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"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=wt.useI18n(),{convertKeyToTitle:l}=tp(),{getPropValue:c}=rp(),{getCertificateData:d}=wt.useCertificate(),y=n.computed(()=>ji.form[o.config.app].edit),p=n.ref(),I=n.computed(()=>{if(p.value)return d(p.value)}),w=n.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaIssuer)||""}),h=n.computed(()=>{var E,k;return(E=I.value)!=null&&E.schemaExpiry?a((k=I.value)==null?void 0:k.schemaExpiry):""}),g=n.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaKeyUsages)||[]}),b=(E,k)=>{const B=c("rowValue",k);if(E==="expiry")return h.value;if(E==="key_usages")return g.value;if(B)return B[E]},v=E=>{p.value=E,i("fetch:success",E)},x=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:le.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(E,k)=>{const B=n.resolveComponent("KCodeBlock"),S=n.resolveComponent("KLabel"),T=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",yb,[n.createVNode(n.unref(Kf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":k[0]||(k[0]=O=>E.$emit("fetch:error",O)),"onFetch:success":v,onLoading:k[1]||(k[1]=O=>E.$emit("loading",O))},{cert:n.withCtx(O=>[n.unref(c)("rowValue",O)?(n.openBlock(),n.createBlock(B,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",O),language:"plaintext","single-line":""},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(S,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(O=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",O)).filter(N=>!r.includes(N)),N=>(n.openBlock(),n.createBlock(n.unref(fo),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:n.unref(l)(N),value:b(N,O),type:N==="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(w.value||"–"),1)]),key_usages:n.withCtx(()=>[g.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",gb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(O,N)=>(n.openBlock(),n.createBlock(T,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:O,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(O),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),bb={class:"kong-ui-entities-ca-certificates-list"},wb={key:0},vb={key:1},kb={key:0},Cb={key:1},Sb={key:1},xb=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 X;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=ko((X=i.config)==null?void 0:X.axiosRequestConfig),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={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}},w=n.computed(()=>{var U,K;let ee=`${i.config.apiBaseUrl}${ji.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((U=i.config)==null?void 0:U.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(K=i.config)!=null&&K.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:b,fetcherState:v}=ep(i.config,w.value),x=()=>{h.value=""},E=()=>{d.value++},k=n.ref(null),B=(ee,U)=>{const K=ee.id;if(!U(K)){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:K})})},S=(ee,U)=>{const K=JSON.stringify(ee);if(!U(K)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},T=async ee=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,ee))&&l.push(i.config.getViewRoute(ee.id))},O=ee=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),re=n.ref(void 0),q=n.ref(!1),D=n.ref(!1),Q=n.ref(""),ne=Qf(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=wt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},qr=()=>{q.value=!1},Kr=async()=>{var ee,U,K;if((ee=re.value)!=null&&ee.id){D.value=!0;try{await c.delete(ne(re.value.id)),D.value=!1,q.value=!1,d.value++,r("delete:success",re.value)}catch(de){Q.value=((K=(U=de.response)==null?void 0:U.data)==null?void 0:K.message)||de.message||o("ca-certificates.errors.delete"),r("error",de)}finally{D.value=!1}}},dr=n.ref(!0);n.watch(v,ee=>{var U,K,de,Ue;if(Array.isArray((U=ee==null?void 0:ee.response)==null?void 0:U.data)&&(dr.value=ee.response.data.length>0),ee.status===Ft.Error){k.value={title:o("ca-certificates.errors.general")},(Ue=(de=(K=ee.error)==null?void 0:K.response)==null?void 0:de.data)!=null&&Ue.message&&(k.value.message=ee.error.response.data.message),r("error",ee.error);return}Ie.value={},k.value=null});const Dt=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(Dt.value.title=o("ca-certificates.list.empty_state.title"),Dt.value.ctaText=o("ca-certificates.actions.create"))}),(ee,U)=>{const K=n.resolveComponent("KButton"),de=n.resolveComponent("KBadge"),Ue=n.resolveComponent("KTruncate"),Qe=n.resolveComponent("KDropdownItem"),zr=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",bb,[n.createVNode(n.unref(Gf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Dt.value,"enable-entity-actions":"","error-message":k.value,fetcher:n.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":U[2]||(U[2]=te=>T(te)),onSort:E},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Yf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(jt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:n.withCtx(()=>[n.createVNode(n.unref(al)),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,dr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:n.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",wb,n.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.issuer?te.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",vb,n.toDisplayString(n.unref(Ce)(te).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",kb,n.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?n.unref(s)(te.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",Cb,n.toDisplayString(n.unref(Ce)(te).schemaExpiry?n.unref(s)(n.unref(Ce)(te).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:te})=>{var Se;return[((Se=te==null?void 0:te.tags)==null?void 0:Se.length)>0?(n.openBlock(),n.createBlock(Ue,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te==null?void 0:te.tags,Y=>(n.openBlock(),n.createBlock(de,{key:Y,onClick:U[1]||(U[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",Sb,"-"))]}),actions:n.withCtx(({row:te})=>[n.createVNode(zr,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Y=>B(te,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(zr,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Y=>S(te,Se)},{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(jt),{"auth-function":()=>e.canRetrieve(te)},{default:n.withCtx(()=>[n.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:O(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(jt),{"auth-function":()=>e.canEdit(te)},{default:n.withCtx(()=>[n.createVNode(Qe,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(jt),{"auth-function":()=>e.canDelete(te)},{default:n.withCtx(()=>[n.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>Ee(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(Wf),{"action-pending":D.value,"entity-type":n.unref(Ra).CACertificate,error:Q.value,title:n.unref(o)("ca-certificates.delete.title"),visible:q.value,onCancel:qr,onProceed:Kr},{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-7d03b211"]]),Ab={class:"kong-ui-entities-ca-certificates-form"},Bb=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 E;const r=t,i=e,o=Wr.useRouter(),{i18n:{t:s}}=wt.useI18n(),{getMessageFromError:a}=Xf(),{axiosInstance:l}=ko((E=i.config)==null?void 0:E.axiosRequestConfig),c=n.computed(()=>ji.form[i.config.app].edit),d=n.computed(()=>i.certificateId?cr.Edit:cr.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),I=n.computed(()=>(d.value===cr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=k=>{var B;y.fields.cert=(k==null?void 0:k.cert)||"",y.fields.certDigest=(k==null?void 0:k.cert_digest)||"",y.fields.tags=((B=k==null?void 0:k.tags)==null?void 0:B.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},g=n.computed(()=>{var B,S;let k=`${i.config.apiBaseUrl}${ji.form[i.config.app].validate}`;return i.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((B=i.config)==null?void 0:B.controlPlaneId)||""):i.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),k=k.replace(/{id}/gi,i.certificateId),k}),b=n.computed(()=>{var B,S;let k=`${i.config.apiBaseUrl}${ji.form[i.config.app][d.value]}`;return i.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((B=i.config)==null?void 0:B.controlPlaneId)||""):i.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),k=k.replace(/{id}/gi,i.certificateId),k}),v=n.computed(()=>{var k,B;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(B=(k=y.fields.tags.split(","))==null?void 0:k.map(S=>String(S||"").trim()))==null?void 0:B.filter(S=>S!=="")}}),x=async()=>{var k,B,S,T,O;try{y.isReadonly=!0;let N;await l.post(g.value,v.value),d.value==="create"?N=await l.post(b.value,v.value):d.value==="edit"&&(N=((k=i.config)==null?void 0:k.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((B=N==null?void 0:N.data)==null?void 0:B.cert)||"",y.fields.certDigest=((S=N==null?void 0:N.data)==null?void 0:S.cert_digest)||"",y.fields.tags=((O=(T=N==null?void 0:N.data)==null?void 0:T.tags)==null?void 0:O.join(", "))||"",Object.assign(p,y.fields),r("update",N==null?void 0:N.data)}catch(N){y.errorMessage=a(N),r("error",N)}finally{y.isReadonly=!1}};return(k,B)=>{const S=n.resolveComponent("KTextArea"),T=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",Ab,[n.createVNode(n.unref(zf),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":B[3]||(B[3]=O=>k.$emit("error",O)),"onFetch:success":w,onLoading:B[4]||(B[4]=O=>k.$emit("loading",O)),onSubmit:x},{default:n.withCtx(()=>[n.createVNode(n.unref(vo),{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(S,{modelValue:y.fields.cert,"onUpdate:modelValue":B[0]||(B[0]=O=>y.fields.cert=O),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(T,{modelValue:y.fields.certDigest,"onUpdate:modelValue":B[1]||(B[1]=O=>y.fields.certDigest=O),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(vo),{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(T,{modelValue:y.fields.tags,"onUpdate:modelValue":B[2]||(B[2]=O=>y.fields.tags=O),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","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-54396784"]]),Ib={class:"kong-ui-certificate-entity-config-card"},Eb={key:0},Nb=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"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),{convertKeyToTitle:l}=tp(),{getPropValue:c}=rp(),{getCertificateData:d}=wt.useCertificate(),y=n.computed(()=>Ii.form[i.config.app].edit),p=n.ref(),I=n.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:le.Redacted},metadata:{section:fe.Basic,type:le.Json},snis:{section:fe.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: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:le.Redacted}}),w=O=>{p.value=O,r("fetch:success",O)},h=(O,N)=>{const re=c("rowValue",N);if(O==="expiry")return b.value;if(O==="key_usages")return k.value;if(O==="san_names")return x.value;if(re)return re[O]},g=n.computed(()=>{if(p.value)return d(p.value)}),b=n.computed(()=>{var O,N;return(O=g.value)!=null&&O.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),v=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaIssuer)||""}),x=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSanNames)||""}),E=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSubject)||""}),k=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaKeyUsages)||[]}),B=n.computed(()=>{var O,N;return((N=(O=p==null?void 0:p.value)==null?void 0:O.snis)==null?void 0:N.length)>0}),S=n.computed(()=>{var O;return!!((O=p==null?void 0:p.value)!=null&&O.cert_alt)}),T=O=>{var N,re;return O==="san_names"?o("certificates.list.table_headers.san"):((re=(N=I.value)==null?void 0:N[O])==null?void 0:re.label)||l(O)};return(O,N)=>{const re=n.resolveComponent("KCodeBlock"),q=n.resolveComponent("KLabel"),D=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",Ib,[n.createVNode(n.unref(Kf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":I.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":N[0]||(N[0]=Q=>O.$emit("fetch:error",Q)),"onFetch:success":w,onLoading:N[1]||(N[1]=Q=>O.$emit("loading",Q))},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(Q=>[n.unref(c)("rowValue",Q)?(n.openBlock(),n.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",Q),language:"plaintext","single-line":""},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(q,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(Q=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",Q)),ne=>(n.openBlock(),n.createBlock(n.unref(fo),{key:ne,item:{key:ne,value:h(ne,Q),label:T(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(E.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(()=>[k.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Eb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,(Q,ne)=>(n.openBlock(),n.createBlock(D,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Q,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Q),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[B.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},S.value?{name:"cert_alt",fn:n.withCtx(Q=>[n.createTextVNode(" > "),n.unref(c)("rowValue",Q)?(n.openBlock(),n.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",Q),language:"plaintext","single-line":""},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-d40682b9"]]);je.CACertificateConfigCard=mb,je.CACertificateForm=Bb,je.CACertificateList=xb,je.CertificateConfigCard=Nb,je.CertificateForm=hb,je.CertificateList=fb,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`+e.slice(a+1):c+=e.slice(o),c.slice(1)}function s0(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Vi(e,o),i=$e[r],!i&&_i(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Zm(r);return t}function a0(e,t,r){var i="",o=e.tag,s,a,l;for(s=0,a=r.length;s<a;s+=1)l=r[s],e.replacer&&(l=e.replacer.call(r,String(s),l)),(Tt(e,t,l,!1,!1)||typeof l>"u"&&Tt(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Ff(e,t,r,i){var o="",s=e.tag,a,l,c;for(a=0,l=r.length;a<l;a+=1)c=r[a],e.replacer&&(c=e.replacer.call(r,String(a),c)),(Tt(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Tt(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 l0(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,l,c,d,y;for(a=0,l=s.length;a<l;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),c=s[a],d=r[c],e.replacer&&(d=e.replacer.call(r,c,d)),Tt(e,t,c,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Tt(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=o,e.dump="{"+i+"}"}function c0(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),l,c,d,y,p,I;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Re("sortKeys must be a boolean or a function");for(l=0,c=a.length;l<c;l+=1)I="",(!i||o!=="")&&(I+=Qa(e,t)),d=a[l],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),Tt(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)?I+="?":I+="? "),I+=e.dump,p&&(I+=Qa(e,t)),Tt(e,t+1,y,!0,p)&&(e.dump&&Ni===e.dump.charCodeAt(0)?I+=":":I+=": ",I+=e.dump,o+=I));e.tag=s,e.dump=o||"{}"}function Hf(e,t,r){var i,o,s,a,l,c;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(l=o[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof t=="object"&&t instanceof l.instanceOf)&&(!l.predicate||l.predicate(t))){if(r?l.multi&&l.representName?e.tag=l.representName(t):e.tag=l.tag:e.tag="?",l.represent){if(c=e.styleMap[l.tag]||l.defaultStyle,Af.call(l.represent)==="[object Function]")i=l.represent(t,c);else if(Bf.call(l.represent,c))i=l.represent[c](t,c);else throw new Re("!<"+l.tag+'> tag resolver accepts not "'+c+'" style');e.dump=i}return!0}return!1}function Tt(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Hf(e,r,!1)||Hf(e,r,!0);var l=Af.call(e.dump),c=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=l==="[object Object]"||l==="[object Array]",p,I;if(y&&(p=e.duplicates.indexOf(r),I=p!==-1),(e.tag!==null&&e.tag!=="?"||I||e.indent!==2&&t>0)&&(o=!1),I&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&I&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),l==="[object Object]")i&&Object.keys(e.dump).length!==0?(c0(e,t,e.dump,o),I&&(e.dump="&ref_"+p+e.dump)):(l0(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Ff(e,t-1,e.dump,o):Ff(e,t,e.dump,o),I&&(e.dump="&ref_"+p+e.dump)):(a0(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(l==="[object String]")e.tag!=="?"&&n0(e,e.dump,t,s,c);else{if(l==="[object Undefined]"||e.skipInvalid)return!1;throw new Re("unacceptable kind of an object to dump "+l)}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 u0(e,t){var r=[],i=[],o,s;for(el(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function el(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)el(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)el(e[i[o]],t,r)}function d0(e,t){t=t||{};var r=new Xm(t);r.noRefs||u0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),Tt(r,0,i,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var f0=d0,p0={dump:f0};function tl(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 h0=Ve,y0=qd,g0=Wd,m0=Xd,b0=ef,w0=za,v0=xf.load,k0=xf.loadAll,C0=p0.dump,S0=Re,x0={binary:sf,float:Qd,map:Gd,null:Jd,pairs:lf,set:cf,timestamp:nf,bool:Yd,int:Zd,merge:of,omap:af,seq:zd,str:Kd},A0=tl("safeLoad","load"),B0=tl("safeLoadAll","loadAll"),I0=tl("safeDump","dump"),E0={Type:h0,Schema:y0,FAILSAFE_SCHEMA:g0,JSON_SCHEMA:m0,CORE_SCHEMA:b0,DEFAULT_SCHEMA:w0,load:v0,loadAll:k0,dump:C0,YAMLException:S0,types:x0,safeLoad:A0,safeLoadAll:B0,safeDump:I0};const N0={class:"yaml-config"},qf=n.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=n.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,o])=>o!==null&&o!==""&&(Array.isArray(o)?o.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":E0.dump(i).trim()});return(i,o)=>{const s=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",N0,[t.yamlRecord?(n.openBlock(),n.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):n.createCommentVNode("",!0)])}}}),O0={key:0,class:"config-card-display-form"},_0=["data-testid"],V0={key:0,class:"config-card-prop-section-title"},T0=n.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},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:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Be.useI18n(),o=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=n.computed(()=>{if(!t.record)return t.record;const a=JSON.parse(JSON.stringify(t.record));return delete a.created_at,delete a.updated_at,a});return(a,l)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",O0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,c=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${c}-props`,class:n.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(n.openBlock(),n.createElementBlock("div",V0,n.toDisplayString(c==="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[c],d=>(n.openBlock(),n.createBlock(fo,{key:d.key,item:d},n.createSlots({label:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:n.withCtx(({rowValue:y})=>[n.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[o(d)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,_0))),128))])):n.createCommentVNode("",!0),e.format==="json"&&t.record?(n.openBlock(),n.createBlock(Ud,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):n.createCommentVNode("",!0),e.format==="yaml"&&t.record?(n.openBlock(),n.createBlock(qf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):n.createCommentVNode("",!0)],64))}}),j0=ct(T0,[["__scopeId","data-v-2052238b"]]),kt="24px",Ti=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},D0=e=>(n.pushScopeId("data-v-f68c7837"),e=e(),n.popScopeId(),e),$0=["aria-hidden"],M0={key:0,"data-testid":"kui-icon-svg-title"},P0=D0(()=>n.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),R0=n.defineComponent({__name:"AddIcon",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:kt,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 kt}),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 add-icon","data-testid":"kui-icon-wrapper-add-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-add-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",M0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),P0],8,$0))]),_:1},8,["aria-hidden","style"]))}}),U0=Ti(R0,[["__scopeId","data-v-f68c7837"]]),L0=e=>(n.pushScopeId("data-v-9af646cc"),e=e(),n.popScopeId(),e),F0=["aria-hidden"],H0={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:kt,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 kt}),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",H0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),q0],8,F0))]),_:1},8,["aria-hidden","style"]))}}),z0=Ti(K0,[["__scopeId","data-v-9af646cc"]]),G0=e=>(n.pushScopeId("data-v-84c4811e"),e=e(),n.popScopeId(),e),W0=["aria-hidden"],J0={key:0,"data-testid":"kui-icon-svg-title"},Y0=G0(()=>n.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),Z0=n.defineComponent({__name:"ChevronDownIcon",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:kt,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 kt}),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 chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-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-chevron-down-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",J0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Y0],8,W0))]),_:1},8,["aria-hidden","style"]))}}),Q0=Ti(Z0,[["__scopeId","data-v-84c4811e"]]),X0=e=>(n.pushScopeId("data-v-26ad8dc6"),e=e(),n.popScopeId(),e),e1=["aria-hidden"],t1={key:0,"data-testid":"kui-icon-svg-title"},r1=X0(()=>n.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),i1=n.defineComponent({__name:"CloseIcon",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:kt,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 kt}),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 close-icon","data-testid":"kui-icon-wrapper-close-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-close-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",t1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),r1],8,e1))]),_:1},8,["aria-hidden","style"]))}}),n1=Ti(i1,[["__scopeId","data-v-26ad8dc6"]]),o1=e=>(n.pushScopeId("data-v-d43c21f8"),e=e(),n.popScopeId(),e),s1=["aria-hidden"],a1={key:0,"data-testid":"kui-icon-svg-title"},l1=o1(()=>n.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),c1=n.defineComponent({__name:"MoreIcon",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:kt,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 kt}),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 more-icon","data-testid":"kui-icon-wrapper-more-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-more-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",a1,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),l1],8,s1))]),_:1},8,["aria-hidden","style"]))}}),u1=Ti(c1,[["__scopeId","data-v-d43c21f8"]]),d1={class:"config-card-title","data-testid":"config-card-title"},f1={class:"config-card-actions"},p1=["href"],h1={class:"config-card-details-section"},y1=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},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:t}){var r;const i=t,o=e,{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:l}=Be.useStringHelpers(),{axiosInstance:c}=Be.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=n.ref("structured"),p=S=>{y.value=S==null?void 0:S.value},I={id:{type:le.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:le.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:le.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:le.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:le.BadgeTag,order:-1,section:fe.Basic}},w=n.ref(!1),h=n.ref(!1),g=n.ref(""),b=n.ref({}),v=n.computed(()=>{var S,T,O;if(!b.value)return[];const N=[],re=Object.keys(b.value).length;for(const q in b.value){const D=(T=(S=o.configSchema)==null?void 0:S[q])==null?void 0:T.order,Q=(O=I[q])==null?void 0:O.order;let ne=re;(Q||Q===0)&&(ne=Q===-1?re+1:Q),D&&(ne=D===-1?re+1:D),N.push([q,ne])}return N.sort(function(q,D){return q[1]-D[1]}),N.map(q=>{var D,Q;const ne=q[0],Ie=(D=b.value)==null?void 0:D[ne],Ce=((Q=o.configSchema)==null?void 0:Q[ne])||{},Ee=I[ne];return{key:ne,value:Ie,hidden:Ce.hidden||!1,type:Ce.type??((Ee==null?void 0:Ee.type)||le.Text),label:Ce.label??((Ee==null?void 0:Ee.label)||l(ne)),tooltip:Ce.tooltip??((Ee==null?void 0:Ee.tooltip)||void 0),section:Ce.section??((Ee==null?void 0:Ee.section)||fe.Advanced)}}).filter(q=>!q.hidden&&q.key!==o.pluginConfigKey)}),x=n.computed(()=>{var S,T;if(!b.value||!o.pluginConfigKey)return[];const O=b.value[o.pluginConfigKey]||{},N=Object.keys(O).length,re=[];for(const q in O){const D=(T=(S=o.pluginConfigSchema)==null?void 0:S[q])==null?void 0:T.order,Q=O[q];let ne=Q!=null&&Q!==""?N-1:N;D&&(ne=D===-1?N+1:D),re.push([q,ne])}return re.sort(function(q,D){return q[1]-D[1]}),re.map(q=>{var D;const Q=q[0],ne=O[Q],Ie=((D=o.pluginConfigSchema)==null?void 0:D[Q])||{};return{key:Q,value:ne,hidden:Ie.hidden||!1,type:Ie.type??le.Text,label:Ie.label??l(Q),tooltip:Ie.tooltip??void 0,section:fe.Plugin}}).filter(q=>!q.hidden)}),E=n.computed(()=>{var S,T,O,N;return{basic:(S=v.value)==null?void 0:S.filter(re=>re.section===fe.Basic),advanced:(T=v.value)==null?void 0:T.filter(re=>re.section===fe.Advanced),plugin:(N=x.value)==null?void 0:N.concat((O=v.value)==null?void 0:O.filter(re=>re.section===fe.Plugin))}}),k=n.computed(()=>{const S=[];return E.value.basic.length&&S.push("basic"),E.value.advanced.length&&S.push("advanced"),E.value.plugin.length&&S.push("plugin"),S}),B=n.computed(()=>{var S,T;let O=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?O=O.replace(/{controlPlaneId}/gi,((S=o.config)==null?void 0:S.controlPlaneId)||""):o.config.app==="kongManager"&&(O=O.replace(/\/{workspace}/gi,(T=o.config)!=null&&T.workspace?`/${o.config.workspace}`:"")),O=O.replace(/{id}/gi,o.config.entityId),O});return n.watch(w,S=>{i("loading",S)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:S}=await c.get(B.value);if(o.dataKey)if(typeof S[o.dataKey]<"u")b.value={...S[o.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:o.dataKey}));else b.value={...S};Object.keys(o.configSchema).filter(T=>o.configSchema[T].forceShow).forEach(T=>{b.value&&typeof b.value[T]>"u"&&(b.value[T]=null)}),i("fetch:success",S)}catch(S){const T=a(S);g.value=T.startsWith("code")?s("baseConfigCard.errors.load"):T,h.value=!0,i("fetch:error",S)}finally{w.value=!1}}),(S,T)=>{const O=n.resolveComponent("KLabel"),N=n.resolveComponent("KSelect"),re=n.resolveComponent("KButton"),q=n.resolveComponent("KSkeleton"),D=n.resolveComponent("KEmptyState"),Q=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(Q,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",f1,[n.renderSlot(S.$slots,"actions",{},void 0,!0),n.createVNode(O,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1}),n.createVNode(N,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(n.openBlock(),n.createBlock(re,{key:0,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(Wy)},null,8,["size"])],8,p1)]),_:1})):n.createCommentVNode("",!0)])]),default:n.withCtx(()=>[w.value?(n.openBlock(),n.createBlock(q,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(D,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(g.value),1)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",h1,[n.createVNode(j0,{config:e.config,"fetcher-url":B.value,format:y.value,"prop-list-types":k.value,"property-collections":E.value,record:b.value},n.createSlots({_:2},[n.renderList(Object.keys(S.$slots),ne=>({name:ne,fn:n.withCtx(({row:Ie,rowValue:Ce})=>[n.renderSlot(S.$slots,ne,{row:Ie,rowValue:Ce},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("span",d1,[n.renderSlot(S.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Kf=ct(y1,[["__scopeId","data-v-f40a683b"]]),g1=["novalidate"],m1={class:"form-actions","data-testid":"form-actions"},b1=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:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,o=e,s=Wr.useRouter(),{i18n:{t:a}}=Be.useI18n(),{getMessageFromError:l}=Be.useErrors(),{axiosInstance:c}=Be.useAxios((r=o.config)==null?void 0:r.axiosRequestConfig),d=n.ref(!1),y=n.ref(!1),p=n.ref(""),I=n.computed(()=>o.canSubmit===!1||o.isReadonly),w=n.ref(!1),h=n.computed(()=>{var k,B;let S=`${o.config.apiBaseUrl}${o.fetchUrl}`;return o.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((k=o.config)==null?void 0:k.controlPlaneId)||""):o.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(B=o.config)!=null&&B.workspace?`/${o.config.workspace}`:"")),o.editId?(S=S.replace(/{id}/gi,o.editId),S):(S=S.replace(/\/{id}/gi,""),S)}),g=()=>{w.value=!w.value},b=()=>{o.config.cancelRoute?s.push(o.config.cancelRoute):v()},v=()=>{i("cancel")},x=()=>{I.value||i("submit")},E=n.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return n.watch(()=>d.value,k=>{i("loading",k)},{immediate:!0}),n.onBeforeMount(async()=>{if(o.editId)try{y.value=!1,d.value=!0;const{data:k}=await c.get(h.value);i("fetch:success",k)}catch(k){const B=l(k);p.value=B.startsWith("code")?a("baseForm.errors.edit"):B,y.value=!0,i("fetch:error",k)}finally{d.value=!1}}),(k,B)=>{const S=n.resolveComponent("KSkeleton"),T=n.resolveComponent("KEmptyState"),O=n.resolveComponent("KAlert"),N=n.resolveComponent("KButton"),re=n.resolveComponent("KTabs"),q=n.resolveComponent("KSlideout");return n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:n.withCtx(()=>[d.value?(n.openBlock(),n.createBlock(S,{key:0,type:"form"})):y.value?(n.openBlock(),n.createBlock(T,{key:1,"action-button-text":n.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:o.noValidate,onReset:n.withModifiers(v,["prevent"]),onSubmit:n.withModifiers(x,["prevent"])},[n.renderSlot(k.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(O,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):n.createCommentVNode("",!0),n.createElementVNode("div",m1,[n.renderSlot(k.$slots,"form-actions",{},()=>[n.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:B[0]||(B[0]=D=>g())},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),n.createVNode(N,{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(N,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,g1)),n.createVNode(q,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:n.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:B[1]||(B[1]=D=>g())},{default:n.withCtx(()=>[n.createElementVNode("div",null,n.toDisplayString(n.unref(a)("baseForm.configuration.message")),1),n.createVNode(re,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:n.withCtx(()=>[n.createVNode(Ud,{config:e.config,"fetcher-url":h.value,"json-record":o.formFields,"request-method":o.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:n.withCtx(()=>[n.createVNode(qf,{"yaml-record":o.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),zf=ct(b1,[["__scopeId","data-v-fd05df8e"]]),w1=["data-truncate"],v1=n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const t=e,r=n.computed(()=>{var b;return((b=t.rowEl)==null?void 0:b.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var b;return((b=r.value)==null?void 0:b.querySelector('[data-truncate="true"]'))||null}),o=n.computed(()=>{var b,v;const x=(b=t.rowEl)==null?void 0:b.querySelectorAll("td");return x?((v=x[0])==null?void 0:v.getAttribute("data-testid"))===t.keyName:!1}),s=n.computed(()=>o.value||t.tooltip);let a;const l=()=>{a&&(a.disconnect(),a=void 0)},c=()=>{var b,v,x;let E=((b=r.value)==null?void 0:b.clientWidth)||0;if(r.value&&"getComputedStyle"in window){const k=window.getComputedStyle(r.value);E-=(parseFloat(k.paddingLeft)||0)+(parseFloat(k.paddingRight)||0)}y.value=((v=i.value)==null?void 0:v.getBoundingClientRect().width)||0,p.value=E,I.value=((x=d.value)==null?void 0:x.innerText)||""},d=n.ref({}),y=n.ref(0),p=n.ref(0),I=n.ref(""),w=n.computed(()=>[i.value,r.value]),h=n.watch(w,b=>{if(s.value&&(l(),"ResizeObserver"in window&&window)){a=new ResizeObserver(v=>{window.requestAnimationFrame(()=>{!Array.isArray(v)||!v.length||c()})});for(const v of b)v&&a.observe(v)}},{immediate:!0,flush:"post",deep:!0}),g=n.computed(()=>s.value?y.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{h()}),(b,v)=>{const x=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:d,class:"content-wrapper"},[s.value?(n.openBlock(),n.createElementBlock("span",{key:0,"data-truncate":s.value||void 0},[n.createVNode(x,{"max-width":"300",placement:"bottomStart",text:g.value?I.value:""},{default:n.withCtx(()=>[n.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,w1)):n.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),k1=ct(v1,[["__scopeId","data-v-471ce76e"]]),C1={class:"toolbar-container"},S1={key:0,class:"toolbar-button-container"},x1=["data-testid"],A1=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},sortHandlerFunction:{type:Function,default:()=>({})},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:""},titleTag:{type:String,default:"h2"},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}}=Be.useI18n(),s=n.computed(()=>{var S,T;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(S=r.errorMessage)==null?void 0:S.title,message:(T=r.errorMessage)==null?void 0:T.message}}),a=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),l=S=>S.hasData||!!r.query,c=n.computed(()=>{const S=[];return Object.keys(r.tableHeaders).forEach(T=>{const O=r.tableHeaders[T];S.push({label:O.label??T,key:T,sortable:O.sortable??!1,hidable:!0})}),r.enableEntityActions&&S.push({key:"actions",hideLabel:!0}),S}),d=S=>({"data-rowid":S.id,"data-testid":S.name,...r.rowAttributes(S)}),y=n.ref({}),p=S=>{var T;return(T=y.value)==null?void 0:T.$el.querySelector(`[data-rowid="${S.id}"]`)},I=S=>{const T={"data-testid":S.headerKey,...r.cellAttributes(S)};return S.colIndex===0&&(T.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),T},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=n.computed(()=>r.disableRowClick?void 0:(S,T)=>{i("click:row",T)}),b=S=>{i("sort",S)},{setTablePreferences:v,getTablePreferences:x}=py(),E=n.ref(x(a.value)),k=n.computed(()=>{const S=x(a.value);return{...r.initialFetcherParams,...S}}),B=S=>{E.value=S,a.value&&v(a.value,S)};return(S,T)=>{const O=n.resolveComponent("KButton"),N=n.resolveComponent("KDropdown"),re=n.resolveComponent("KTable"),q=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:n.withCtx(()=>[n.createVNode(re,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?n.unref(o)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","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,error:s.value.hasError,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":k.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":d,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":E.value,onEmptyStateActionClick:w,"onRow:click":g.value,onSort:T[0]||(T[0]=D=>b(D)),"onUpdate:tablePreferences":B},n.createSlots({toolbar:n.withCtx(({state:D})=>[n.withDirectives(n.createElementVNode("div",C1,[n.renderSlot(S.$slots,"toolbar-filter",{},void 0,!0),S.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",S1,[n.renderSlot(S.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,l(D)]])]),actions:n.withCtx(({row:D,rowKey:Q,rowValue:ne})=>[n.createElementVNode("div",{class:"actions-container","data-testid":D.name},[n.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(S.$slots,"actions",{row:D,rowKey:Q,rowValue:ne},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(O,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:n.withCtx(()=>[n.createVNode(n.unref(u1))]),_:1})]),_:2},1032,["width"])],8,x1)]),_:2},[n.renderList(e.tableHeaders,(D,Q)=>({name:Q,fn:n.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[n.createVNode(k1,{"key-name":String(Q),"row-el":p(ne),tooltip:D.tooltip},{default:n.withCtx(()=>[n.renderSlot(S.$slots,Q,{row:ne,rowKey:Ie,rowValue:Ce},()=>[n.createTextVNode(n.toDisplayString(Ce),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:n.withCtx(()=>[n.createVNode(n.unref(U0))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Gf=ct(A1,[["__scopeId","data-v-67bd29c7"]]),B1={key:0,class:"kong-ui-entity-delete-error"},I1={key:1,class:"description"},E1=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}=Be.useI18n(),i=e,o=t,s=n.computed(()=>i.needConfirm?i.entityName:""),a=()=>{o("cancel")},l=()=>{o("proceed")};return(c,d)=>{const y=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":s.value,title:e.title,visible:e.visible,onCancel:a,onProceed:l},{default:n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",B1,[n.createVNode(y,{appearance:"danger"},{default: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||c.$slots.description?(n.openBlock(),n.createElementBlock("div",I1,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(i.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Wf=ct(E1,[["__scopeId","data-v-4361d622"]]),N1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},O1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},_1=["fill"],V1={mask:"url(#mask0_180_20349)"},T1=["fill"],Jf=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${qy})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",N1,[n.createElementVNode("mask",O1,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,_1)]),n.createElementVNode("g",V1,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,T1)])]))}}),j1={key:1,class:"kong-ui-entity-filter"},D1={class:"kong-ui-entity-filter-menu"},$1=["data-testid"],M1=["onClick","onKeydown"],P1={class:"menu-item-indicator"},R1={class:"menu-item-body"},U1=["for"],L1={class:"menu-item-buttons"},F1={class:"filter-clear-button-container"},H1=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}}=Be.useI18n(),i=e,o=t,s=n.ref(!1),a=n.ref({}),l=n.ref(new Set),c=n.computed(()=>{const k=[];return new URLSearchParams(i.modelValue).forEach((B,S)=>{B!==""&&k.push(S)}),k}),d=n.computed(()=>{const k=i.config.fields;return Object.keys(k).filter(B=>{var S;return(S=k==null?void 0:k[B])==null?void 0:S.searchable}).map(B=>({label:k[B].label||B,value:B,expanded:!1}))});n.watch(()=>i.modelValue,k=>{a.value={},new URLSearchParams(k).forEach((B,S)=>{a.value[S]=B})});const y=()=>{s.value=!s.value},p=k=>{l.value.has(k)?l.value.delete(k):l.value.add(k)},I=k=>{o("update:modelValue",k)},w=()=>{I("")},h=k=>`filter-${k}`,g=k=>{var B,S;return(((S=(B=i.config.schema)==null?void 0:B[k])==null?void 0:S.values)??[]).map(T=>({value:T,label:T}))},b=k=>{var B,S;return((S=(B=i.config.schema)==null?void 0:B[k])==null?void 0:S.type)??"text"},v=k=>{a.value={...a.value,[k]:""},E()},x=()=>{a.value={},E(!0)},E=(k=!1)=>{const B=Object.keys(a.value).reduce((S,T)=>(a.value[T]&&(S[T]=`${a.value[T]}`),S),{});k&&(s.value=!1),o("update:modelValue",new URLSearchParams(B).toString())};return(k,B)=>{const S=n.resolveComponent("KInput"),T=n.resolveComponent("KButton"),O=n.resolveComponent("KSelect");return e.config.isExactMatch?(n.openBlock(),n.createBlock(S,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":I},{before:n.withCtx(()=>[n.createVNode(Jf)]),after:n.withCtx(()=>[n.withDirectives(n.createVNode(n.unref(n1),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[n.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",j1,[n.createVNode(T,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{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:y},null,512),[[n.vShow,s.value]]),n.withDirectives(n.createElementVNode("div",D1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,N=>{var re,q;return n.openBlock(),n.createElementBlock("div",{key:N.value,class:"kong-ui-entity-filter-menu-item","data-testid":N.value},[n.createElementVNode("span",{class:n.normalizeClass(["menu-item-title",{expanded:l.value.has(N.value)}]),role:"button",tabindex:"0",onClick:D=>p(N.value),onKeydown:n.withKeys(D=>p(N.value),["enter"])},[n.createTextVNode(n.toDisplayString(N.label)+" ",1),n.withDirectives(n.createElementVNode("span",P1,null,512),[[n.vShow,c.value.includes(N.value)]]),n.createVNode(n.unref(Q0),{class:n.normalizeClass(["menu-item-expand-icon",{expanded:l.value.has(N.value)}]),color:n.unref(zy)},null,8,["class","color"])],42,M1),n.withDirectives(n.createElementVNode("div",R1,[n.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},n.toDisplayString(n.unref(r)("filter.fieldLabel")),9,U1),((q=(re=e.config.schema)==null?void 0:re[N.value])==null?void 0:q.type)==="select"?(n.openBlock(),n.createBlock(O,{key:0,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":D=>a.value[N.value]=D,items:g(N.value),placeholder:n.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(S,{key:1,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":D=>a.value[N.value]=D,autocomplete:"off",placeholder:n.unref(r)("filter.inputPlaceholder"),type:b(N.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[n.vShow,l.value.has(N.value)]]),n.withDirectives(n.createElementVNode("div",L1,[n.createVNode(T,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:B[0]||(B[0]=D=>E(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.applyButtonText")),1)]),_:1}),n.createVNode(T,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:D=>v(N.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[n.vShow,l.value.has(N.value)]])],8,$1)}),128)),n.createElementVNode("div",F1,[n.createVNode(T,{appearance:"tertiary",size:"small",onClick:x},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[n.vShow,s.value]])]))}}}),Yf=ct(H1,[["__scopeId","data-v-94990087"]]),jt=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)}});let wo;const q1=new Uint8Array(16);function K1(){if(!wo&&(wo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!wo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wo(q1)}const Te=[];for(let e=0;e<256;++e)Te.push((e+256).toString(16).slice(1));function z1(e,t=0){return Te[e[t+0]]+Te[e[t+1]]+Te[e[t+2]]+Te[e[t+3]]+"-"+Te[e[t+4]]+Te[e[t+5]]+"-"+Te[e[t+6]]+Te[e[t+7]]+"-"+Te[e[t+8]]+Te[e[t+9]]+"-"+Te[e[t+10]]+Te[e[t+11]]+Te[e[t+12]]+Te[e[t+13]]+Te[e[t+14]]+Te[e[t+15]]}const G1=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Zf={randomUUID:G1};function W1(e,t,r){if(Zf.randomUUID&&!t&&!e)return Zf.randomUUID();e=e||{};const i=e.random||(e.rng||K1)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=i[o];return t}return z1(i)}const J1=["aria-labelledby"],Y1={class:"form-section-wrapper"},Z1={key:1,class:"form-section-description"},Q1={key:2,class:"form-section-footer"},X1={class:"form-section-content"},eb=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},titleTag:{type:String,default:"h2"}},setup(e){const t=n.useSlots(),r=W1();return(i,o)=>(n.openBlock(),n.createElementBlock("div",{"aria-labelledby":e.title?n.unref(r):void 0,class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[n.createElementVNode("div",Y1,[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.createBlock(n.resolveDynamicComponent(e.titleTag),{key:0,id:n.unref(r),class:"form-section-title"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1},8,["id"])):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",Z1,[n.renderSlot(i.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",Q1,[n.renderSlot(i.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",X1,[n.renderSlot(i.$slots,"default",{},void 0,!0)])])],10,J1))}}),vo=ct(eb,[["__scopeId","data-v-b1f74200"]]),{useAxios:ko,useDeleteUrlBuilder:Qf,useErrors:Xf,useExternalLinkCreator:Hb,useFetchUrlBuilder:qb,useFetcher:ep,useDebouncedFilter:Kb,useStringHelpers:tp,useHelpers:rp,useGatewayFeatureSupported:zb,useTruncationDetector:Gb,useValidators:Wb}=Be,tb={class:"kong-ui-entities-certificates-list"},rb={key:0},ib={key:1},nb={key:0},ob={key:1},sb={key:0},ab={key:1},lb={key:1},cb={key:1},ub=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 ee;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=ko((ee=i.config)==null?void 0:ee.axiosRequestConfig),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={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}},w=n.computed(()=>{var K,de;let U=`${i.config.apiBaseUrl}${Ii.list[i.config.app]}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((K=i.config)==null?void 0:K.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(de=i.config)!=null&&de.workspace?`/${i.config.workspace}`:"")),U}),h=n.ref(""),g=n.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:o("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:v}=ep(i.config,w.value),x=()=>{h.value=""},E=()=>{d.value++},k=n.ref(null),B=(U,K)=>{const de=U.id;if(!K(de)){r("copy:error",{entity:U,field:"id",message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:o("certificates.copy.success",{val:de})})},S=(U,K)=>{const de=JSON.stringify(U);if(!K(de)){r("copy:error",{entity:U,message:o("certificates.errors.copy")});return}r("copy:success",{entity:U,message:o("certificates.copy.success_brief")})},T=async U=>{var de;await((de=i.canRetrieve)==null?void 0:de.call(i,U))&&l.push(i.config.getViewRoute(U.id))},O=U=>({label:o("certificates.actions.view"),to:i.config.getViewRoute(U)}),N=U=>({label:o("certificates.actions.edit"),to:i.config.getEditRoute(U)}),re=U=>{if(i.config.getCreateSniRoute)return{label:o("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},q=n.ref(void 0),D=n.ref(!1),Q=n.ref(!1),ne=n.ref(""),Ie=Qf(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=wt.useCertificate(),qr=U=>{q.value=U,D.value=!0},Kr=()=>{D.value=!1},dr=async()=>{var U,K,de;if((U=q.value)!=null&&U.id){Q.value=!0;try{await c.delete(Ie(q.value.id)),Q.value=!1,D.value=!1,d.value++,r("delete:success",q.value)}catch(Ue){ne.value=((de=(K=Ue.response)==null?void 0:K.data)==null?void 0:de.message)||Ue.message||o("certificates.errors.delete"),r("error",Ue)}finally{Q.value=!1}}},Dt=n.ref(!0);n.watch(v,U=>{var K,de,Ue,Qe;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(Dt.value=U.response.data.length>0),U.status===Ft.Error){k.value={title:o("certificates.errors.general")},(Qe=(Ue=(de=U.error)==null?void 0:de.response)==null?void 0:Ue.data)!=null&&Qe.message&&(k.value.message=U.error.response.data.message),r("error",U.error);return}Ce.value={},k.value=null});const X=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${o("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:o("certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(X.value.title=o("certificates.list.empty_state.title"),X.value.ctaText=o("certificates.actions.create"))}),(U,K)=>{const de=n.resolveComponent("KButton"),Ue=n.resolveComponent("KCopy"),Qe=n.resolveComponent("KBadge"),zr=n.resolveComponent("KTruncate"),te=n.resolveComponent("KDropdownItem"),Se=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",tb,[n.createVNode(n.unref(Gf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":k.value,fetcher:n.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":n.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":K[2]||(K[2]=Y=>T(Y)),onSort:E},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Yf),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(jt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(de,{appearance:"primary","data-testid":"toolbar-add-certificate",size:"large",to:e.config.createRoute},{default:n.withCtx(()=>[n.createVNode(n.unref(al)),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[n.vShow,Dt.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),subject:n.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",rb,n.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",ib,n.toDisplayString(n.unref(Ee)(Y).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",nb,n.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?n.unref(s)(Y.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",ob,n.toDisplayString(n.unref(Ee)(Y).schemaExpiry?n.unref(s)(n.unref(Ee)(Y).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",sb,n.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",ab,n.toDisplayString(n.unref(Ee)(Y).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:Y})=>[Y!=null&&Y.cert?(n.openBlock(),n.createBlock(Ue,{key:0,"data-testid":"copy-certificate-cert",text:Y.cert,truncate:""},null,8,["text"])):(n.openBlock(),n.createElementBlock("span",lb,"-"))]),tags:n.withCtx(({row:Y})=>{var xe;return[((xe=Y==null?void 0:Y.tags)==null?void 0:xe.length)>0?(n.openBlock(),n.createBlock(zr,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y==null?void 0:Y.tags,Gr=>(n.openBlock(),n.createBlock(Qe,{key:Gr,onClick:K[1]||(K[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Gr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",cb,"-"))]}),actions:n.withCtx(({row:Y})=>[n.createVNode(Se,null,{default:n.withCtx(({copyToClipboard:xe})=>[n.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:Gr=>B(Y,xe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Se,null,{default:n.withCtx(({copyToClipboard:xe})=>[n.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:Gr=>S(Y,xe)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(jt),{"auth-function":()=>e.canRetrieve(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:O(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(jt),{"auth-function":()=>e.canEdit(Y)},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-edit",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(jt),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(te,{"data-testid":"action-entity-add-sni",item:re(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(jt),{"auth-function":()=>e.canDelete(Y)},{default:n.withCtx(()=>[n.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>qr(Y)},{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(Wf),{"action-pending":Q.value,"entity-type":n.unref(Ra).Certificate,error:ne.value,title:n.unref(o)("certificates.delete.title"),visible:D.value,onCancel:Kr,onProceed:dr},{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},db=Hr(ub,[["__scopeId","data-v-fcc46780"]]),fb={class:"kong-ui-entities-certificates-form"},pb=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 k;const r=t,i=e,o=Wr.useRouter(),{i18nT:s,i18n:{t:a}}=wt.useI18n(),{getMessageFromError:l}=Xf(),{axiosInstance:c}=ko((k=i.config)==null?void 0:k.axiosRequestConfig),d=n.computed(()=>Ii.form[i.config.app].edit),y=n.computed(()=>i.certificateId?cr.Edit:cr.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),I=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=n.computed(()=>(y.value===cr.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=B=>{var S;p.fields.cert=(B==null?void 0:B.cert)||"",p.fields.key=(B==null?void 0:B.key)||"",p.fields.certAlt=(B==null?void 0:B.cert_alt)||"",p.fields.keyAlt=(B==null?void 0:B.key_alt)||"",p.fields.tags=((S=B==null?void 0:B.tags)==null?void 0:S.join(", "))||"",Object.assign(I,p.fields)},g=()=>{o.push(i.config.cancelRoute)},b=n.computed(()=>{var S,T;let B=`${i.config.apiBaseUrl}${Ii.form[i.config.app].validate}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((S=i.config)==null?void 0:S.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),v=n.computed(()=>{var S,T;let B=`${i.config.apiBaseUrl}${Ii.form[i.config.app][y.value]}`;return i.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((S=i.config)==null?void 0:S.controlPlaneId)||""):i.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(T=i.config)!=null&&T.workspace?`/${i.config.workspace}`:"")),B=B.replace(/{id}/gi,i.certificateId),B}),x=n.computed(()=>{var B,S;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(S=(B=p.fields.tags.split(","))==null?void 0:B.map(T=>String(T||"").trim()))==null?void 0:S.filter(T=>T!=="")}}),E=async()=>{var B,S,T,O,N,re,q;try{p.isReadonly=!0;let D;await c.post(b.value,x.value),y.value==="create"?D=await c.post(v.value,x.value):y.value==="edit"&&(D=((B=i.config)==null?void 0:B.app)==="konnect"?await c.put(v.value,x.value):await c.patch(v.value,x.value)),p.fields.cert=((S=D==null?void 0:D.data)==null?void 0:S.cert)||"",p.fields.key=((T=D==null?void 0:D.data)==null?void 0:T.key)||"",p.fields.certAlt=((O=D==null?void 0:D.data)==null?void 0:O.cert_alt)||"",p.fields.keyAlt=((N=D==null?void 0:D.data)==null?void 0:N.key_alt)||"",p.fields.tags=((q=(re=D==null?void 0:D.data)==null?void 0:re.tags)==null?void 0:q.join(", "))||"",Object.assign(I,p.fields),r("update",D==null?void 0:D.data)}catch(D){p.errorMessage=l(D),r("error",D)}finally{p.isReadonly=!1}};return(B,S)=>{const T=n.resolveComponent("KTextArea"),O=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",fb,[n.createVNode(n.unref(zf),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":x.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":S[5]||(S[5]=N=>B.$emit("error",N)),"onFetch:success":h,onLoading:S[6]||(S[6]=N=>B.$emit("loading",N)),onSubmit:E},{default:n.withCtx(()=>[n.createVNode(n.unref(vo),{description:n.unref(a)("certificates.form.sections.ssl.description"),title:n.unref(a)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(T,{modelValue:p.fields.cert,"onUpdate:modelValue":S[0]||(S[0]=N=>p.fields.cert=N),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(T,{modelValue:p.fields.key,"onUpdate:modelValue":S[1]||(S[1]=N=>p.fields.key=N),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(T,{modelValue:p.fields.certAlt,"onUpdate:modelValue":S[2]||(S[2]=N=>p.fields.certAlt=N),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(T,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":S[3]||(S[3]=N=>p.fields.keyAlt=N),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(vo),{description:n.unref(a)("certificates.form.sections.general.description"),title:n.unref(a)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(O,{modelValue:p.fields.tags,"onUpdate:modelValue":S[4]||(S[4]=N=>p.fields.tags=N),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","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-cec1c591"]]),Co="/v2/control-planes/{controlPlaneId}/core-entities",So="/{workspace}",ji={list:{konnect:`${Co}/ca_certificates`,kongManager:`${So}/ca_certificates`},form:{konnect:{create:`${Co}/ca_certificates`,edit:`${Co}/ca_certificates/{id}`,validate:`${Co}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${So}/ca_certificates`,edit:`${So}/ca_certificates/{id}`,validate:`${So}/schemas/ca_certificates/validate`}}},hb={class:"kong-ui-ca-certificate-entity-config-card"},yb={key:0},gb=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"],setup(e,{emit:t}){const r=["dns_names","san_names","subject"],i=t,o=e,{i18n:{t:s,formatUnixTimeStamp:a}}=wt.useI18n(),{convertKeyToTitle:l}=tp(),{getPropValue:c}=rp(),{getCertificateData:d}=wt.useCertificate(),y=n.computed(()=>ji.form[o.config.app].edit),p=n.ref(),I=n.computed(()=>{if(p.value)return d(p.value)}),w=n.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaIssuer)||""}),h=n.computed(()=>{var E,k;return(E=I.value)!=null&&E.schemaExpiry?a((k=I.value)==null?void 0:k.schemaExpiry):""}),g=n.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaKeyUsages)||[]}),b=(E,k)=>{const B=c("rowValue",k);if(E==="expiry")return h.value;if(E==="key_usages")return g.value;if(B)return B[E]},v=E=>{p.value=E,i("fetch:success",E)},x=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:le.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(E,k)=>{const B=n.resolveComponent("KCodeBlock"),S=n.resolveComponent("KLabel"),T=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",hb,[n.createVNode(n.unref(Kf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":x.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":k[0]||(k[0]=O=>E.$emit("fetch:error",O)),"onFetch:success":v,onLoading:k[1]||(k[1]=O=>E.$emit("loading",O))},{cert:n.withCtx(O=>[n.unref(c)("rowValue",O)?(n.openBlock(),n.createBlock(B,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",O),language:"plaintext","single-line":""},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(S,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(O=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",O)).filter(N=>!r.includes(N)),N=>(n.openBlock(),n.createBlock(n.unref(fo),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:n.unref(l)(N),value:b(N,O),type:N==="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(w.value||"–"),1)]),key_usages:n.withCtx(()=>[g.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",yb,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(O,N)=>(n.openBlock(),n.createBlock(T,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:O,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(O),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-b34eea10"]]),mb={class:"kong-ui-entities-ca-certificates-list"},bb={key:0},wb={key:1},vb={key:0},kb={key:1},Cb={key:1},Sb=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 X;const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),l=Wr.useRouter(),{axiosInstance:c}=ko((X=i.config)==null?void 0:X.axiosRequestConfig),d=n.ref(1),y=n.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={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}},w=n.computed(()=>{var U,K;let ee=`${i.config.apiBaseUrl}${ji.list[i.config.app]}`;return i.config.app==="konnect"?ee=ee.replace(/{controlPlaneId}/gi,((U=i.config)==null?void 0:U.controlPlaneId)||""):i.config.app==="kongManager"&&(ee=ee.replace(/\/{workspace}/gi,(K=i.config)!=null&&K.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:b,fetcherState:v}=ep(i.config,w.value),x=()=>{h.value=""},E=()=>{d.value++},k=n.ref(null),B=(ee,U)=>{const K=ee.id;if(!U(K)){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:K})})},S=(ee,U)=>{const K=JSON.stringify(ee);if(!U(K)){r("copy:error",{entity:ee,message:o("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:o("ca-certificates.copy.success_brief")})},T=async ee=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,ee))&&l.push(i.config.getViewRoute(ee.id))},O=ee=>({label:o("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:o("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),re=n.ref(void 0),q=n.ref(!1),D=n.ref(!1),Q=n.ref(""),ne=Qf(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=wt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},qr=()=>{q.value=!1},Kr=async()=>{var ee,U,K;if((ee=re.value)!=null&&ee.id){D.value=!0;try{await c.delete(ne(re.value.id)),D.value=!1,q.value=!1,d.value++,r("delete:success",re.value)}catch(de){Q.value=((K=(U=de.response)==null?void 0:U.data)==null?void 0:K.message)||de.message||o("ca-certificates.errors.delete"),r("error",de)}finally{D.value=!1}}},dr=n.ref(!0);n.watch(v,ee=>{var U,K,de,Ue;if(Array.isArray((U=ee==null?void 0:ee.response)==null?void 0:U.data)&&(dr.value=ee.response.data.length>0),ee.status===Ft.Error){k.value={title:o("ca-certificates.errors.general")},(Ue=(de=(K=ee.error)==null?void 0:K.response)==null?void 0:de.data)!=null&&Ue.message&&(k.value.message=ee.error.response.data.message),r("error",ee.error);return}Ie.value={},k.value=null});const Dt=n.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${o("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:o("ca-certificates.title")});return n.onBeforeMount(async()=>{await i.canCreate()&&(Dt.value.title=o("ca-certificates.list.empty_state.title"),Dt.value.ctaText=o("ca-certificates.actions.create"))}),(ee,U)=>{const K=n.resolveComponent("KButton"),de=n.resolveComponent("KBadge"),Ue=n.resolveComponent("KTruncate"),Qe=n.resolveComponent("KDropdownItem"),zr=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",mb,[n.createVNode(n.unref(Gf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Dt.value,"enable-entity-actions":"","error-message":k.value,fetcher:n.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":n.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:x,"onClick:row":U[2]||(U[2]=te=>T(te)),onSort:E},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Yf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[(n.openBlock(),n.createBlock(n.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[n.createVNode(n.unref(jt),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.withDirectives(n.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",size:"large",to:e.config.createRoute},{default:n.withCtx(()=>[n.createVNode(n.unref(al)),n.createTextVNode(" "+n.toDisplayString(n.unref(o)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[n.vShow,dr.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),issuer:n.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",bb,n.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.issuer?te.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",wb,n.toDisplayString(n.unref(Ce)(te).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",vb,n.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?n.unref(s)(te.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",kb,n.toDisplayString(n.unref(Ce)(te).schemaExpiry?n.unref(s)(n.unref(Ce)(te).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:te})=>{var Se;return[((Se=te==null?void 0:te.tags)==null?void 0:Se.length)>0?(n.openBlock(),n.createBlock(Ue,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(te==null?void 0:te.tags,Y=>(n.openBlock(),n.createBlock(de,{key:Y,onClick:U[1]||(U[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",Cb,"-"))]}),actions:n.withCtx(({row:te})=>[n.createVNode(zr,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(Qe,{"data-testid":"action-entity-copy-id",onClick:Y=>B(te,Se)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(o)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(zr,null,{default:n.withCtx(({copyToClipboard:Se})=>[n.createVNode(Qe,{"data-testid":"action-entity-copy-json",onClick:Y=>S(te,Se)},{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(jt),{"auth-function":()=>e.canRetrieve(te)},{default:n.withCtx(()=>[n.createVNode(Qe,{"data-testid":"action-entity-view","has-divider":"",item:O(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(jt),{"auth-function":()=>e.canEdit(te)},{default:n.withCtx(()=>[n.createVNode(Qe,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(jt),{"auth-function":()=>e.canDelete(te)},{default:n.withCtx(()=>[n.createVNode(Qe,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>Ee(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(Wf),{"action-pending":D.value,"entity-type":n.unref(Ra).CACertificate,error:Q.value,title:n.unref(o)("ca-certificates.delete.title"),visible:q.value,onCancel:qr,onProceed:Kr},{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-7d03b211"]]),xb={class:"kong-ui-entities-ca-certificates-form"},Ab=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 E;const r=t,i=e,o=Wr.useRouter(),{i18n:{t:s}}=wt.useI18n(),{getMessageFromError:a}=Xf(),{axiosInstance:l}=ko((E=i.config)==null?void 0:E.axiosRequestConfig),c=n.computed(()=>ji.form[i.config.app].edit),d=n.computed(()=>i.certificateId?cr.Edit:cr.Create),y=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),I=n.computed(()=>(d.value===cr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=k=>{var B;y.fields.cert=(k==null?void 0:k.cert)||"",y.fields.certDigest=(k==null?void 0:k.cert_digest)||"",y.fields.tags=((B=k==null?void 0:k.tags)==null?void 0:B.join(", "))||"",Object.assign(p,y.fields)},h=()=>{o.push(i.config.cancelRoute)},g=n.computed(()=>{var B,S;let k=`${i.config.apiBaseUrl}${ji.form[i.config.app].validate}`;return i.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((B=i.config)==null?void 0:B.controlPlaneId)||""):i.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),k=k.replace(/{id}/gi,i.certificateId),k}),b=n.computed(()=>{var B,S;let k=`${i.config.apiBaseUrl}${ji.form[i.config.app][d.value]}`;return i.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((B=i.config)==null?void 0:B.controlPlaneId)||""):i.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(S=i.config)!=null&&S.workspace?`/${i.config.workspace}`:"")),k=k.replace(/{id}/gi,i.certificateId),k}),v=n.computed(()=>{var k,B;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(B=(k=y.fields.tags.split(","))==null?void 0:k.map(S=>String(S||"").trim()))==null?void 0:B.filter(S=>S!=="")}}),x=async()=>{var k,B,S,T,O;try{y.isReadonly=!0;let N;await l.post(g.value,v.value),d.value==="create"?N=await l.post(b.value,v.value):d.value==="edit"&&(N=((k=i.config)==null?void 0:k.app)==="konnect"?await l.put(b.value,v.value):await l.patch(b.value,v.value)),y.fields.cert=((B=N==null?void 0:N.data)==null?void 0:B.cert)||"",y.fields.certDigest=((S=N==null?void 0:N.data)==null?void 0:S.cert_digest)||"",y.fields.tags=((O=(T=N==null?void 0:N.data)==null?void 0:T.tags)==null?void 0:O.join(", "))||"",Object.assign(p,y.fields),r("update",N==null?void 0:N.data)}catch(N){y.errorMessage=a(N),r("error",N)}finally{y.isReadonly=!1}};return(k,B)=>{const S=n.resolveComponent("KTextArea"),T=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",xb,[n.createVNode(n.unref(zf),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":c.value,"form-fields":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":B[3]||(B[3]=O=>k.$emit("error",O)),"onFetch:success":w,onLoading:B[4]||(B[4]=O=>k.$emit("loading",O)),onSubmit:x},{default:n.withCtx(()=>[n.createVNode(n.unref(vo),{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(S,{modelValue:y.fields.cert,"onUpdate:modelValue":B[0]||(B[0]=O=>y.fields.cert=O),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(T,{modelValue:y.fields.certDigest,"onUpdate:modelValue":B[1]||(B[1]=O=>y.fields.certDigest=O),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(vo),{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(T,{modelValue:y.fields.tags,"onUpdate:modelValue":B[2]||(B[2]=O=>y.fields.tags=O),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","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-54396784"]]),Bb={class:"kong-ui-certificate-entity-config-card"},Ib={key:0},Eb=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"],setup(e,{emit:t}){const r=t,i=e,{i18n:{t:o,formatUnixTimeStamp:s},i18nT:a}=wt.useI18n(),{convertKeyToTitle:l}=tp(),{getPropValue:c}=rp(),{getCertificateData:d}=wt.useCertificate(),y=n.computed(()=>Ii.form[i.config.app].edit),p=n.ref(),I=n.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:le.Redacted},metadata:{section:fe.Basic,type:le.Json},snis:{section:fe.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: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:le.Redacted}}),w=O=>{p.value=O,r("fetch:success",O)},h=(O,N)=>{const re=c("rowValue",N);if(O==="expiry")return b.value;if(O==="key_usages")return k.value;if(O==="san_names")return x.value;if(re)return re[O]},g=n.computed(()=>{if(p.value)return d(p.value)}),b=n.computed(()=>{var O,N;return(O=g.value)!=null&&O.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),v=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaIssuer)||""}),x=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSanNames)||""}),E=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaSubject)||""}),k=n.computed(()=>{var O;return((O=g.value)==null?void 0:O.schemaKeyUsages)||[]}),B=n.computed(()=>{var O,N;return((N=(O=p==null?void 0:p.value)==null?void 0:O.snis)==null?void 0:N.length)>0}),S=n.computed(()=>{var O;return!!((O=p==null?void 0:p.value)!=null&&O.cert_alt)}),T=O=>{var N,re;return O==="san_names"?o("certificates.list.table_headers.san"):((re=(N=I.value)==null?void 0:N[O])==null?void 0:re.label)||l(O)};return(O,N)=>{const re=n.resolveComponent("KCodeBlock"),q=n.resolveComponent("KLabel"),D=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",Bb,[n.createVNode(n.unref(Kf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":I.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":N[0]||(N[0]=Q=>O.$emit("fetch:error",Q)),"onFetch:success":w,onLoading:N[1]||(N[1]=Q=>O.$emit("loading",Q))},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(Q=>[n.unref(c)("rowValue",Q)?(n.openBlock(),n.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",Q),language:"plaintext","single-line":""},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(q,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(Q=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",Q)),ne=>(n.openBlock(),n.createBlock(n.unref(fo),{key:ne,item:{key:ne,value:h(ne,Q),label:T(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?n.unref(le).BadgeTag:n.unref(le).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(E.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(()=>[k.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Ib,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,(Q,ne)=>(n.openBlock(),n.createBlock(D,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Q,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Q),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[B.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},S.value?{name:"cert_alt",fn:n.withCtx(Q=>[n.createTextVNode(" > "),n.unref(c)("rowValue",Q)?(n.openBlock(),n.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",Q),language:"plaintext","single-line":""},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-d40682b9"]]);je.CACertificateConfigCard=gb,je.CACertificateForm=Ab,je.CACertificateList=Sb,je.CertificateConfigCard=Eb,je.CertificateForm=pb,je.CertificateList=db,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
|