@kong-ui-public/entities-certificates 2.5.9 → 2.5.10
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(Ve,o){typeof exports=="object"&&typeof module<"u"?o(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"],o):(Ve=typeof globalThis<"u"?globalThis:Ve||self,o(Ve["kong-ui-public-entities-certificates"]={},Ve.Vue,Ve.VueRouter,Ve["kong-ui-public-i18n"],Ve.axios,Ve.Kongponents))})(this,function(Ve,o,Gr,ji,
|
|
1
|
+
(function(Ve,o){typeof exports=="object"&&typeof module<"u"?o(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"],o):(Ve=typeof globalThis<"u"?globalThis:Ve||self,o(Ve["kong-ui-public-entities-certificates"]={},Ve.Vue,Ve.VueRouter,Ve["kong-ui-public-i18n"],Ve.axios,Ve.Kongponents))})(this,function(Ve,o,Gr,ji,ic,sp){"use strict";var Co=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 ec;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof bo=="object"?bo:typeof self=="object"?self:typeof this=="object"?this:c(),i=n(e);typeof r.Reflect<"u"&&(i=n(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function n(l,d){return function(y,p){Object.defineProperty(l,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function c(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,d=!c&&!l,y={create:c?function(){return Qa(Object.create(null))}:l?function(){return Qa({__proto__:null})}:function(){return Qa({})},has:d?function(v,x){return i.call(v,x)}:function(v,x){return x in v},get:d?function(v,x){return i.call(v,x)?v[x]:void 0}:function(v,x){return v[x]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ab(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:cb(),h=typeof WeakMap=="function"?WeakMap:lb(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,b=nb(),k=ob(b);function B(v,x,O,D){if(X(O)){if(!Se(v))throw new TypeError;if(!xe(x))throw new TypeError;return j(v,x)}else{if(!Se(v))throw new TypeError;if(!K(x))throw new TypeError;if(!K(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),O=te(O),Z(v,x,O,D)}}t("decorate",B);function E(v,x){function O(D,Q){if(!K(D))throw new TypeError;if(!X(Q)&&!zr(Q))throw new TypeError;Hr(v,x,D,Q)}return O}t("metadata",E);function S(v,x,O,D){if(!K(O))throw new TypeError;return X(D)||(D=te(D)),Hr(v,x,O,D)}t("defineMetadata",S);function C(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),ne(v,x,O)}t("hasMetadata",C);function A(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ie(v,x,O)}t("hasOwnMetadata",A);function M(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ce(v,x,O)}t("getMetadata",M);function _(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ee(v,x,O)}t("getOwnMetadata",_);function N(v,x){if(!K(v))throw new TypeError;return X(x)||(x=te(x)),qr(v,x)}t("getMetadataKeys",N);function re(v,x){if(!K(v))throw new TypeError;return X(x)||(x=te(x)),ur(v,x)}t("getOwnMetadataKeys",re);function q(v,x,O){if(!K(x))throw new TypeError;if(X(O)||(O=te(O)),!K(x))throw new TypeError;X(O)||(O=te(O));var D=Vi(x,O,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(v,x,O)}t("deleteMetadata",q);function j(v,x){for(var O=v.length-1;O>=0;--O){var D=v[O],Q=D(x);if(!X(Q)&&!ee(Q)){if(!xe(Q))throw new TypeError;x=Q}}return x}function Z(v,x,O,D){for(var Q=v.length-1;Q>=0;--Q){var ge=v[Q],Ae=ge(x,O,D);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;D=Ae}}return D}function ne(v,x,O){var D=Ie(v,x,O);if(D)return!0;var Q=Za(x);return ee(Q)?!1:ne(v,Q,O)}function Ie(v,x,O){var D=Vi(x,O,!1);return X(D)?!1:Ze(D.OrdinaryHasOwnMetadata(v,x,O))}function Ce(v,x,O){var D=Ie(v,x,O);if(D)return Ee(v,x,O);var Q=Za(x);if(!ee(Q))return Ce(v,Q,O)}function Ee(v,x,O){var D=Vi(x,O,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(v,x,O)}function Hr(v,x,O,D){var Q=Vi(O,D,!0);Q.OrdinaryDefineOwnMetadata(v,x,O,D)}function qr(v,x){var O=ur(v,x),D=Za(v);if(D===null)return O;var Q=qr(D,x);if(Q.length<=0)return O;if(O.length<=0)return Q;for(var ge=new w,Ae=[],oe=0,P=O;oe<P.length;oe++){var z=P[oe],F=ge.has(z);F||(ge.add(z),Ae.push(z))}for(var W=0,se=Q;W<se.length;W++){var z=se[W],F=ge.has(z);F||(ge.add(z),Ae.push(z))}return Ae}function ur(v,x){var O=Vi(v,x,!1);return O?O.OrdinaryOwnMetadataKeys(v,x):[]}function Vt(v){if(v===null)return 1;switch(typeof v){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return v===null?1:6;default:return 6}}function X(v){return v===void 0}function ee(v){return v===null}function U(v){return typeof v=="symbol"}function K(v){return typeof v=="object"?v!==null:typeof v=="function"}function de(v,x){switch(Vt(v)){case 0:return v;case 1:return v;case 2:return v;case 3:return v;case 4:return v;case 5:return v}var O=x===3?"string":x===5?"number":"default",D=Wf(v,s);if(D!==void 0){var Q=D.call(v,O);if(K(Q))throw new TypeError;return Q}return Re(v,O==="default"?"number":O)}function Re(v,x){if(x==="string"){var O=v.toString;if(Y(O)){var D=O.call(v);if(!K(D))return D}var Q=v.valueOf;if(Y(Q)){var D=Q.call(v);if(!K(D))return D}}else{var Q=v.valueOf;if(Y(Q)){var D=Q.call(v);if(!K(D))return D}var ge=v.toString;if(Y(ge)){var D=ge.call(v);if(!K(D))return D}}throw new TypeError}function Ze(v){return!!v}function Kr(v){return""+v}function te(v){var x=de(v,3);return U(x)?x:Kr(x)}function Se(v){return Array.isArray?Array.isArray(v):v instanceof Object?v instanceof Array:Object.prototype.toString.call(v)==="[object Array]"}function Y(v){return typeof v=="function"}function xe(v){return typeof v=="function"}function zr(v){switch(Vt(v)){case 3:return!0;case 4:return!0;default:return!1}}function Ya(v,x){return v===x||v!==v&&x!==x}function Wf(v,x){var O=v[x];if(O!=null){if(!Y(O))throw new TypeError;return O}}function Jf(v){var x=Wf(v,a);if(!Y(x))throw new TypeError;var O=x.call(v);if(!K(O))throw new TypeError;return O}function Yf(v){return v.value}function Zf(v){var x=v.next();return x.done?!1:x}function Qf(v){var x=v.return;x&&x.call(v)}function Za(v){var x=Object.getPrototypeOf(v);if(typeof v!="function"||v===p||x!==p)return x;var O=v.prototype,D=O&&Object.getPrototypeOf(O);if(D==null||D===Object.prototype)return x;var Q=D.constructor;return typeof Q!="function"||Q===v?x:Q}function ib(){var v;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(v=sb(r.Reflect));var x,O,D,Q=new h,ge={registerProvider:Ae,getProvider:P,setProvider:F};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case v===W:break;case X(x):x=W;break;case x===W:break;case X(O):O=W;break;case O===W:break;default:D===void 0&&(D=new w),D.add(W);break}}function oe(W,se){if(!X(x)){if(x.isProviderFor(W,se))return x;if(!X(O)){if(O.isProviderFor(W,se))return x;if(!X(D))for(var pe=Jf(D);;){var me=Zf(pe);if(!me)return;var lt=Yf(me);if(lt.isProviderFor(W,se))return Qf(pe),lt}}}if(!X(v)&&v.isProviderFor(W,se))return v}function P(W,se){var pe=Q.get(W),me;return X(pe)||(me=pe.get(se)),X(me)&&(me=oe(W,se),X(me)||(X(pe)&&(pe=new I,Q.set(W,pe)),pe.set(se,me))),me}function z(W){if(X(W))throw new TypeError;return x===W||O===W||!X(D)&&D.has(W)}function F(W,se,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var me=P(W,se);if(me!==pe){if(!X(me))return!1;var lt=Q.get(W);X(lt)&&(lt=new I,Q.set(W,lt)),lt.set(se,pe)}return!0}}function nb(){var v;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(v=r.Reflect[g]),X(v)&&(v=ib()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:v}),v}function ob(v){var x=new h,O={isProviderFor:function(z,F){var W=x.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:P};return b.registerProvider(O),O;function D(z,F,W){var se=x.get(z),pe=!1;if(X(se)){if(!W)return;se=new I,x.set(z,se),pe=!0}var me=se.get(F);if(X(me)){if(!W)return;if(me=new I,se.set(F,me),!v.setProvider(z,F,O))throw se.delete(F),pe&&x.delete(z),new Error("Wrong provider for target.")}return me}function Q(z,F,W){var se=D(F,W,!1);return X(se)?!1:Ze(se.has(z))}function ge(z,F,W){var se=D(F,W,!1);if(!X(se))return se.get(z)}function Ae(z,F,W,se){var pe=D(W,se,!0);pe.set(z,F)}function oe(z,F){var W=[],se=D(z,F,!1);if(X(se))return W;for(var pe=se.keys(),me=Jf(pe),lt=0;;){var Xf=Zf(me);if(!Xf)return W.length=lt,W;var ub=Yf(Xf);try{W[lt]=ub}catch(db){try{Qf(me)}finally{throw db}}lt++}}function P(z,F,W){var se=D(F,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=x.get(F);X(pe)||(pe.delete(W),pe.size===0&&x.delete(pe))}return!0}}function sb(v){var x=v.defineMetadata,O=v.hasOwnMetadata,D=v.getOwnMetadata,Q=v.getOwnMetadataKeys,ge=v.deleteMetadata,Ae=new h,oe={isProviderFor:function(P,z){var F=Ae.get(P);return X(F)?Q(P,z).length?(X(F)&&(F=new w,Ae.set(P,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:O,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:ge};return oe}function Vi(v,x,O){var D=b.getProvider(v,x);if(!X(D))return D;if(O){if(b.setProvider(v,x,k))return k;throw new Error("Illegal state.")}}function ab(){var v={},x=[],O=function(){function oe(P,z,F){this._index=0,this._keys=P,this._values=z,this._selector=F}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[a]=function(){return this},oe.prototype.next=function(){var P=this._index;if(P>=0&&P<this._keys.length){var z=this._selector(this._keys[P],this._values[P]);return P+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function(P){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),P},oe.prototype.return=function(P){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:P,done:!0}},oe}(),D=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=v,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function(P){return this._find(P,!1)>=0},oe.prototype.get=function(P){var z=this._find(P,!1);return z>=0?this._values[z]:void 0},oe.prototype.set=function(P,z){var F=this._find(P,!0);return this._values[F]=z,this},oe.prototype.delete=function(P){var z=this._find(P,!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--,Ya(P,this._cacheKey)&&(this._cacheKey=v,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=v,this._cacheIndex=-2},oe.prototype.keys=function(){return new O(this._keys,this._values,Q)},oe.prototype.values=function(){return new O(this._keys,this._values,ge)},oe.prototype.entries=function(){return new O(this._keys,this._values,Ae)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[a]=function(){return this.entries()},oe.prototype._find=function(P,z){if(!Ya(this._cacheKey,P)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(Ya(this._keys[F],P)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(P),this._values.push(void 0)),this._cacheIndex},oe}();return D;function Q(oe,P){return oe}function ge(oe,P){return P}function Ae(oe,P){return[oe,P]}}function cb(){var v=function(){function x(){this._map=new I}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(O){return this._map.has(O)},x.prototype.add=function(O){return this._map.set(O,O),this},x.prototype.delete=function(O){return this._map.delete(O)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return v}function lb(){var v=16,x=y.create(),O=D();return function(){function P(){this._key=D()}return P.prototype.has=function(z){var F=Q(z,!1);return F!==void 0?y.has(F,this._key):!1},P.prototype.get=function(z){var F=Q(z,!1);return F!==void 0?y.get(F,this._key):void 0},P.prototype.set=function(z,F){var W=Q(z,!0);return W[this._key]=F,this},P.prototype.delete=function(z){var F=Q(z,!1);return F!==void 0?delete F[this._key]:!1},P.prototype.clear=function(){this._key=D()},P}();function D(){var P;do P="@@WeakMap@@"+oe();while(y.has(x,P));return x[P]=!0,P}function Q(P,z){if(!i.call(P,O)){if(!z)return;Object.defineProperty(P,O,{value:y.create()})}return P[O]}function ge(P,z){for(var F=0;F<z;++F)P[F]=Math.random()*255|0;return P}function Ae(P){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array(P)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array(P)):ge(new Uint8Array(P),P):ge(new Array(P),P)}function oe(){var P=Ae(v);P[6]=P[6]&79|64,P[8]=P[8]&191|128;for(var z="",F=0;F<v;++F){var W=P[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function Qa(v){return v.__=void 0,delete v.__,v}})})(ec||(ec={}));/*!
|
|
14
|
+
***************************************************************************** */var nc;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof Co=="object"?Co:typeof self=="object"?self:typeof this=="object"?this:c(),i=n(e);typeof r.Reflect<"u"&&(i=n(r.Reflect,i)),t(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function n(l,d){return function(y,p){Object.defineProperty(l,y,{configurable:!0,writable:!0,value:p}),d&&d(y,p)}}function s(){try{return Function("return this;")()}catch{}}function a(){try{return(0,eval)("(function() { return this; })()")}catch{}}function c(){return s()||a()}})(function(t,r){var i=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",s=n&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,d=!c&&!l,y={create:c?function(){return rc(Object.create(null))}:l?function(){return rc({__proto__:null})}:function(){return rc({})},has:d?function(v,x){return i.call(v,x)}:function(v,x){return x in v},get:d?function(v,x){return i.call(v,x)?v[x]:void 0}:function(v,x){return v[x]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:db(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:fb(),h=typeof WeakMap=="function"?WeakMap:pb(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,b=cb(),k=lb(b);function B(v,x,O,D){if(X(O)){if(!Se(v))throw new TypeError;if(!xe(x))throw new TypeError;return j(v,x)}else{if(!Se(v))throw new TypeError;if(!K(x))throw new TypeError;if(!K(D)&&!X(D)&&!ee(D))throw new TypeError;return ee(D)&&(D=void 0),O=te(O),Z(v,x,O,D)}}t("decorate",B);function E(v,x){function O(D,Q){if(!K(D))throw new TypeError;if(!X(Q)&&!zr(Q))throw new TypeError;Hr(v,x,D,Q)}return O}t("metadata",E);function S(v,x,O,D){if(!K(O))throw new TypeError;return X(D)||(D=te(D)),Hr(v,x,O,D)}t("defineMetadata",S);function C(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),ne(v,x,O)}t("hasMetadata",C);function A(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ie(v,x,O)}t("hasOwnMetadata",A);function M(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ce(v,x,O)}t("getMetadata",M);function _(v,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ee(v,x,O)}t("getOwnMetadata",_);function N(v,x){if(!K(v))throw new TypeError;return X(x)||(x=te(x)),qr(v,x)}t("getMetadataKeys",N);function re(v,x){if(!K(v))throw new TypeError;return X(x)||(x=te(x)),ur(v,x)}t("getOwnMetadataKeys",re);function q(v,x,O){if(!K(x))throw new TypeError;if(X(O)||(O=te(O)),!K(x))throw new TypeError;X(O)||(O=te(O));var D=Vi(x,O,!1);return X(D)?!1:D.OrdinaryDeleteMetadata(v,x,O)}t("deleteMetadata",q);function j(v,x){for(var O=v.length-1;O>=0;--O){var D=v[O],Q=D(x);if(!X(Q)&&!ee(Q)){if(!xe(Q))throw new TypeError;x=Q}}return x}function Z(v,x,O,D){for(var Q=v.length-1;Q>=0;--Q){var ge=v[Q],Ae=ge(x,O,D);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;D=Ae}}return D}function ne(v,x,O){var D=Ie(v,x,O);if(D)return!0;var Q=tc(x);return ee(Q)?!1:ne(v,Q,O)}function Ie(v,x,O){var D=Vi(x,O,!1);return X(D)?!1:Ze(D.OrdinaryHasOwnMetadata(v,x,O))}function Ce(v,x,O){var D=Ie(v,x,O);if(D)return Ee(v,x,O);var Q=tc(x);if(!ee(Q))return Ce(v,Q,O)}function Ee(v,x,O){var D=Vi(x,O,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(v,x,O)}function Hr(v,x,O,D){var Q=Vi(O,D,!0);Q.OrdinaryDefineOwnMetadata(v,x,O,D)}function qr(v,x){var O=ur(v,x),D=tc(v);if(D===null)return O;var Q=qr(D,x);if(Q.length<=0)return O;if(O.length<=0)return Q;for(var ge=new w,Ae=[],oe=0,$=O;oe<$.length;oe++){var z=$[oe],F=ge.has(z);F||(ge.add(z),Ae.push(z))}for(var W=0,se=Q;W<se.length;W++){var z=se[W],F=ge.has(z);F||(ge.add(z),Ae.push(z))}return Ae}function ur(v,x){var O=Vi(v,x,!1);return O?O.OrdinaryOwnMetadataKeys(v,x):[]}function Vt(v){if(v===null)return 1;switch(typeof v){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return v===null?1:6;default:return 6}}function X(v){return v===void 0}function ee(v){return v===null}function U(v){return typeof v=="symbol"}function K(v){return typeof v=="object"?v!==null:typeof v=="function"}function de(v,x){switch(Vt(v)){case 0:return v;case 1:return v;case 2:return v;case 3:return v;case 4:return v;case 5:return v}var O=x===3?"string":x===5?"number":"default",D=Qf(v,s);if(D!==void 0){var Q=D.call(v,O);if(K(Q))throw new TypeError;return Q}return Re(v,O==="default"?"number":O)}function Re(v,x){if(x==="string"){var O=v.toString;if(Y(O)){var D=O.call(v);if(!K(D))return D}var Q=v.valueOf;if(Y(Q)){var D=Q.call(v);if(!K(D))return D}}else{var Q=v.valueOf;if(Y(Q)){var D=Q.call(v);if(!K(D))return D}var ge=v.toString;if(Y(ge)){var D=ge.call(v);if(!K(D))return D}}throw new TypeError}function Ze(v){return!!v}function Kr(v){return""+v}function te(v){var x=de(v,3);return U(x)?x:Kr(x)}function Se(v){return Array.isArray?Array.isArray(v):v instanceof Object?v instanceof Array:Object.prototype.toString.call(v)==="[object Array]"}function Y(v){return typeof v=="function"}function xe(v){return typeof v=="function"}function zr(v){switch(Vt(v)){case 3:return!0;case 4:return!0;default:return!1}}function ec(v,x){return v===x||v!==v&&x!==x}function Qf(v,x){var O=v[x];if(O!=null){if(!Y(O))throw new TypeError;return O}}function Xf(v){var x=Qf(v,a);if(!Y(x))throw new TypeError;var O=x.call(v);if(!K(O))throw new TypeError;return O}function ep(v){return v.value}function tp(v){var x=v.next();return x.done?!1:x}function rp(v){var x=v.return;x&&x.call(v)}function tc(v){var x=Object.getPrototypeOf(v);if(typeof v!="function"||v===p||x!==p)return x;var O=v.prototype,D=O&&Object.getPrototypeOf(O);if(D==null||D===Object.prototype)return x;var Q=D.constructor;return typeof Q!="function"||Q===v?x:Q}function ab(){var v;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(v=ub(r.Reflect));var x,O,D,Q=new h,ge={registerProvider:Ae,getProvider:$,setProvider:F};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case v===W:break;case X(x):x=W;break;case x===W:break;case X(O):O=W;break;case O===W:break;default:D===void 0&&(D=new w),D.add(W);break}}function oe(W,se){if(!X(x)){if(x.isProviderFor(W,se))return x;if(!X(O)){if(O.isProviderFor(W,se))return x;if(!X(D))for(var pe=Xf(D);;){var me=tp(pe);if(!me)return;var lt=ep(me);if(lt.isProviderFor(W,se))return rp(pe),lt}}}if(!X(v)&&v.isProviderFor(W,se))return v}function $(W,se){var pe=Q.get(W),me;return X(pe)||(me=pe.get(se)),X(me)&&(me=oe(W,se),X(me)||(X(pe)&&(pe=new I,Q.set(W,pe)),pe.set(se,me))),me}function z(W){if(X(W))throw new TypeError;return x===W||O===W||!X(D)&&D.has(W)}function F(W,se,pe){if(!z(pe))throw new Error("Metadata provider not registered.");var me=$(W,se);if(me!==pe){if(!X(me))return!1;var lt=Q.get(W);X(lt)&&(lt=new I,Q.set(W,lt)),lt.set(se,pe)}return!0}}function cb(){var v;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(v=r.Reflect[g]),X(v)&&(v=ab()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:v}),v}function lb(v){var x=new h,O={isProviderFor:function(z,F){var W=x.get(z);return X(W)?!1:W.has(F)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:$};return b.registerProvider(O),O;function D(z,F,W){var se=x.get(z),pe=!1;if(X(se)){if(!W)return;se=new I,x.set(z,se),pe=!0}var me=se.get(F);if(X(me)){if(!W)return;if(me=new I,se.set(F,me),!v.setProvider(z,F,O))throw se.delete(F),pe&&x.delete(z),new Error("Wrong provider for target.")}return me}function Q(z,F,W){var se=D(F,W,!1);return X(se)?!1:Ze(se.has(z))}function ge(z,F,W){var se=D(F,W,!1);if(!X(se))return se.get(z)}function Ae(z,F,W,se){var pe=D(W,se,!0);pe.set(z,F)}function oe(z,F){var W=[],se=D(z,F,!1);if(X(se))return W;for(var pe=se.keys(),me=Xf(pe),lt=0;;){var ip=tp(me);if(!ip)return W.length=lt,W;var hb=ep(ip);try{W[lt]=hb}catch(yb){try{rp(me)}finally{throw yb}}lt++}}function $(z,F,W){var se=D(F,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=x.get(F);X(pe)||(pe.delete(W),pe.size===0&&x.delete(pe))}return!0}}function ub(v){var x=v.defineMetadata,O=v.hasOwnMetadata,D=v.getOwnMetadata,Q=v.getOwnMetadataKeys,ge=v.deleteMetadata,Ae=new h,oe={isProviderFor:function($,z){var F=Ae.get($);return X(F)?Q($,z).length?(X(F)&&(F=new w,Ae.set($,F)),F.add(z),!0):!1:F.has(z)},OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:O,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:ge};return oe}function Vi(v,x,O){var D=b.getProvider(v,x);if(!X(D))return D;if(O){if(b.setProvider(v,x,k))return k;throw new Error("Illegal state.")}}function db(){var v={},x=[],O=function(){function oe($,z,F){this._index=0,this._keys=$,this._values=z,this._selector=F}return oe.prototype["@@iterator"]=function(){return this},oe.prototype[a]=function(){return this},oe.prototype.next=function(){var $=this._index;if($>=0&&$<this._keys.length){var z=this._selector(this._keys[$],this._values[$]);return $+1>=this._keys.length?(this._index=-1,this._keys=x,this._values=x):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},oe.prototype.throw=function($){throw this._index>=0&&(this._index=-1,this._keys=x,this._values=x),$},oe.prototype.return=function($){return this._index>=0&&(this._index=-1,this._keys=x,this._values=x),{value:$,done:!0}},oe}(),D=function(){function oe(){this._keys=[],this._values=[],this._cacheKey=v,this._cacheIndex=-2}return Object.defineProperty(oe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),oe.prototype.has=function($){return this._find($,!1)>=0},oe.prototype.get=function($){var z=this._find($,!1);return z>=0?this._values[z]:void 0},oe.prototype.set=function($,z){var F=this._find($,!0);return this._values[F]=z,this},oe.prototype.delete=function($){var z=this._find($,!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--,ec($,this._cacheKey)&&(this._cacheKey=v,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=v,this._cacheIndex=-2},oe.prototype.keys=function(){return new O(this._keys,this._values,Q)},oe.prototype.values=function(){return new O(this._keys,this._values,ge)},oe.prototype.entries=function(){return new O(this._keys,this._values,Ae)},oe.prototype["@@iterator"]=function(){return this.entries()},oe.prototype[a]=function(){return this.entries()},oe.prototype._find=function($,z){if(!ec(this._cacheKey,$)){this._cacheIndex=-1;for(var F=0;F<this._keys.length;F++)if(ec(this._keys[F],$)){this._cacheIndex=F;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push($),this._values.push(void 0)),this._cacheIndex},oe}();return D;function Q(oe,$){return oe}function ge(oe,$){return $}function Ae(oe,$){return[oe,$]}}function fb(){var v=function(){function x(){this._map=new I}return Object.defineProperty(x.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),x.prototype.has=function(O){return this._map.has(O)},x.prototype.add=function(O){return this._map.set(O,O),this},x.prototype.delete=function(O){return this._map.delete(O)},x.prototype.clear=function(){this._map.clear()},x.prototype.keys=function(){return this._map.keys()},x.prototype.values=function(){return this._map.keys()},x.prototype.entries=function(){return this._map.entries()},x.prototype["@@iterator"]=function(){return this.keys()},x.prototype[a]=function(){return this.keys()},x}();return v}function pb(){var v=16,x=y.create(),O=D();return function(){function $(){this._key=D()}return $.prototype.has=function(z){var F=Q(z,!1);return F!==void 0?y.has(F,this._key):!1},$.prototype.get=function(z){var F=Q(z,!1);return F!==void 0?y.get(F,this._key):void 0},$.prototype.set=function(z,F){var W=Q(z,!0);return W[this._key]=F,this},$.prototype.delete=function(z){var F=Q(z,!1);return F!==void 0?delete F[this._key]:!1},$.prototype.clear=function(){this._key=D()},$}();function D(){var $;do $="@@WeakMap@@"+oe();while(y.has(x,$));return x[$]=!0,$}function Q($,z){if(!i.call($,O)){if(!z)return;Object.defineProperty($,O,{value:y.create()})}return $[O]}function ge($,z){for(var F=0;F<z;++F)$[F]=Math.random()*255|0;return $}function Ae($){return typeof Uint8Array=="function"?typeof crypto<"u"?crypto.getRandomValues(new Uint8Array($)):typeof msCrypto<"u"?msCrypto.getRandomValues(new Uint8Array($)):ge(new Uint8Array($),$):ge(new Array($),$)}function oe(){var $=Ae(v);$[6]=$[6]&79|64,$[8]=$[8]&191|128;for(var z="",F=0;F<v;++F){var W=$[F];(F===4||F===6||F===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function rc(v){return v.__=void 0,delete v.__,v}})})(nc||(nc={}));/*!
|
|
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 ap="[object ArrayBuffer]";class P{static isArrayBuffer(t){return Object.prototype.toString.call(t)===ap}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),n=P.toUint8Array(r);if(i.length!==n.byteLength)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static concat(...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 n=new Uint8Array(i);let s=0;for(const a of r){const c=this.toUint8Array(a);n.set(c,s),s+=c.length}return t[t.length-1]instanceof Function?this.toView(n,t[t.length-1]):n.buffer}}const So="string",cp=/^[0-9a-f]+$/i,lp=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,up=/^[a-zA-Z0-9-_]+$/;class oc{static fromString(t){const r=unescape(encodeURIComponent(t)),i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n);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 ut{static toString(t,r=!1){const i=P.toArrayBuffer(t),n=new DataView(i);let s="";for(let a=0;a<i.byteLength;a+=2){const c=n.getUint16(a,r);s+=String.fromCharCode(c)}return s}static fromString(t,r=!1){const i=new ArrayBuffer(t.length*2),n=new DataView(i);for(let s=0;s<t.length;s++)n.setUint16(s*2,t.charCodeAt(s),r);return i}}class L{static isHex(t){return typeof t===So&&cp.test(t)}static isBase64(t){return typeof t===So&&lp.test(t)}static isBase64Url(t){return typeof t===So&&up.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 ut.toString(i,!0);case"utf16":case"utf16be":return ut.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 ut.fromString(t,!0);case"utf16":case"utf16be":return ut.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 oc.fromString(t);case"utf16":case"utf16be":return ut.fromString(t);case"utf16le":case"usc2":return ut.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 oc.toString(t);case"utf16":case"utf16be":return ut.toString(t);case"utf16le":case"usc2":return ut.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 n=0;n<r;n++)i[n]=t.charCodeAt(n);return i.buffer}static ToBinary(t){const r=P.toUint8Array(t);let i="";for(let n=0;n<r.length;n++)i+=String.fromCharCode(r[n]);return i}static ToHex(t){const r=P.toUint8Array(t);let i="";const n=r.length;for(let s=0;s<n;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 n=0;n<r.length;n=n+2){const s=r.slice(n,n+2);i[n/2]=parseInt(s,16)}return i.buffer}static ToUtf16String(t,r=!1){return ut.toString(t,r)}static FromUtf16String(t,r=!1){return ut.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 dp(...e){const t=e.map(n=>n.byteLength).reduce((n,s)=>n+s),r=new Uint8Array(t);let i=0;return e.map(n=>new Uint8Array(n)).forEach(n=>{for(const s of n)r[i++]=s}),r.buffer}function sc(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<e.byteLength;n++)if(r[n]!==i[n])return!1;return!0}/*!
|
|
38
38
|
Copyright (c) Peculiar Ventures, LLC
|
|
39
|
-
*/function dr(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 qt(e,t,r=-1){const i=r;let n=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let y=c-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(n/p),n-=d[s-y-1]*p}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function
|
|
39
|
+
*/function dr(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 qt(e,t,r=-1){const i=r;let n=e,s=0,a=Math.pow(2,t);for(let c=1;c<8;c++){if(e<a){let l;if(i<0)l=new ArrayBuffer(c),s=c;else{if(i<c)return new ArrayBuffer(0);l=new ArrayBuffer(i),s=i}const d=new Uint8Array(l);for(let y=c-1;y>=0;y--){const p=Math.pow(2,y*t);d[s-y-1]=Math.floor(n/p),n-=d[s-y-1]*p}return l}a*=Math.pow(2,t)}return new ArrayBuffer(0)}function xo(...e){let t=0,r=0;for(const s of e)t+=s.length;const i=new ArrayBuffer(t),n=new Uint8Array(i);for(const s of e)n.set(s,r),r+=s.length;return n}function ac(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=e[0]===255&&e[1]&128,l=e[0]===0&&(e[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let c=0;c<this.valueHex.byteLength;c++)r[c]=0;r[0]=e[0]&128;const i=dr(r,8),n=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(n);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=e[c];return s[0]&=127,dr(s,8)-i}function fp(e){const t=e<0?e*-1:e;let r=128;for(let i=1;i<8;i++){if(t<=r){if(e<0){const a=r-t,c=qt(a,8,i),l=new Uint8Array(c);return l[0]|=128,c}let n=qt(t,8,i),s=new Uint8Array(n);if(s[0]&128){const a=n.slice(0),c=new Uint8Array(a);n=new ArrayBuffer(n.byteLength+1),s=new Uint8Array(n);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return n}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function pp(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<r.length;n++)if(r[n]!==i[n])return!1;return!0}function Ge(e,t){const r=e.toString(10);if(t<r.length)return"";const i=t-r.length,n=new Array(i);for(let a=0;a<i;a++)n[a]="0";return n.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 Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function ko(e){let t=0,r=0;for(let n=0;n<e.length;n++){const s=e[n];t+=s.byteLength}const i=new Uint8Array(t);for(let n=0;n<e.length;n++){const s=e[n];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function vt(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 Mi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return ko(this.items)}}const Wr=[new Uint8Array([1])],nc="0123456789",Co="name",oc="valueHexView",up="isHexOnly",dp="idBlock",fp="tagClass",pp="tagNumber",hp="isConstructed",yp="fromBER",gp="toBER",mp="local",Ue="",it=new ArrayBuffer(0),Pi=new Uint8Array(0),Jr="EndOfContent",sc="OCTET STRING",ac="BIT STRING";function dt(e){var t;return t=class extends e{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?$.toUint8Array(s.valueHex):Pi}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!vt(this,a,n,s))return-1;const c=n+s;return this.valueHexView=a.subarray(n,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",it)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Kt{constructor({blockLength:t=0,error:r=Ue,warnings:i=[],valueBeforeDecode:n=Pi}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=$.toUint8Array(n)}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)}}}Kt.NAME="baseBlock";class Me extends Kt{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 cc extends dt(Kt){constructor({idBlock:t={}}={}){var r,i,n,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?$.toUint8Array(t.valueHex):Pi,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=t.tagNumber)!==null&&n!==void 0?n:-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",it}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,n[0]=r}return n.buffer}if(!this.isHexOnly){const n=qt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(t,r,i){const n=$.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let I=0;I<l;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=dr(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}cc.NAME="identificationBlock";class lc extends Kt{constructor({lenBlock:t={}}={}){var r,i,n;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=(n=t.length)!==null&&n!==void 0?n:0}fromBER(t,r,i){const n=$.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=n.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=dr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const n=qt(this.length,8);if(n.byteLength>127)return this.error="Too big length",it;if(r=new ArrayBuffer(n.byteLength+1),t)return r;const s=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let a=0;a<n.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}}}lc.NAME="lengthBlock";const R={};class Ne extends Kt{constructor({name:t=Ue,optional:r=!1,primitiveSchema:i,...n}={},s){super(n),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new cc(n),this.lenBlock=new lc(n),this.valueBlock=s?new s(n):new Me(n)}fromBER(t,r,i){const n=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}toBER(t,r){const i=r||new Mi;r||uc(this);const n=this.idBlock.toBER(t);if(i.write(n),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?it: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 lp(r,i)}}Ne.NAME="BaseBlock";function uc(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)uc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class So extends Ne{constructor({value:t=Ue,...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 n=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}So.NAME="BaseStringBlock";class dc extends dt(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}dc.NAME="PrimitiveValueBlock";var fc;class Yr extends Ne{constructor(t={}){super(t,dc),this.idBlock.isConstructed=!1}}fc=Yr,R.Primitive=fc,Yr.NAME="PRIMITIVE";function bp(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function fr(e,t=0,r=e.length){const i=t;let n=new Ne({},Me);const s=new Kt;if(!vt(s,e,t,r))return n.error=s.error,{offset:-1,result:n};if(!e.subarray(t,t+r).length)return n.error="Zero buffer length",{offset:-1,result:n};let c=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),c===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(t=c,r-=n.idBlock.blockLength,c=n.lenBlock.fromBER(e,t,r),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),c===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(t=c,r-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let l=Ne;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};l=R.EndOfContent;break;case 1:l=R.Boolean;break;case 2:l=R.Integer;break;case 3:l=R.BitString;break;case 4:l=R.OctetString;break;case 5:l=R.Null;break;case 6:l=R.ObjectIdentifier;break;case 10:l=R.Enumerated;break;case 12:l=R.Utf8String;break;case 13:l=R.RelativeObjectIdentifier;break;case 14:l=R.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:l=R.Sequence;break;case 17:l=R.Set;break;case 18:l=R.NumericString;break;case 19:l=R.PrintableString;break;case 20:l=R.TeletexString;break;case 21:l=R.VideotexString;break;case 22:l=R.IA5String;break;case 23:l=R.UTCTime;break;case 24:l=R.GeneralizedTime;break;case 25:l=R.GraphicString;break;case 26:l=R.VisibleString;break;case 27:l=R.GeneralString;break;case 28:l=R.UniversalString;break;case 29:l=R.CharacterString;break;case 30:l=R.BmpString;break;case 31:l=R.DATE;break;case 32:l=R.TimeOfDay;break;case 33:l=R.DateTime;break;case 34:l=R.Duration;break;default:{const d=n.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:l=n.idBlock.isConstructed?R.Constructed:R.Primitive}return n=bp(n,l),c=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length),n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength),{offset:c,result:n}}function pr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return fr($.toUint8Array(e).slice(),0,e.byteLength)}function wp(e,t){return e?1:t}class jt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const n=$.toUint8Array(t);if(!vt(this,n,r,i))return-1;if(this.valueBeforeDecodeView=n.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;wp(this.isIndefiniteForm,i)>0;){const a=fr(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Mi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(t,i);return r?it:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}jt.NAME="ConstructedValueBlock";var pc;class Le extends Ne{constructor(t={}){super(t,jt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
71
|
+
*/function Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Ao(e){let t=0,r=0;for(let n=0;n<e.length;n++){const s=e[n];t+=s.byteLength}const i=new Uint8Array(t);for(let n=0;n<e.length;n++){const s=e[n];i.set(new Uint8Array(s),r),r+=s.byteLength}return i.buffer}function vt(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 Mi{constructor(){this.items=[]}write(t){this.items.push(t)}final(){return Ao(this.items)}}const Wr=[new Uint8Array([1])],cc="0123456789",Bo="name",lc="valueHexView",hp="isHexOnly",yp="idBlock",gp="tagClass",mp="tagNumber",bp="isConstructed",wp="fromBER",vp="toBER",kp="local",Ue="",it=new ArrayBuffer(0),$i=new Uint8Array(0),Jr="EndOfContent",uc="OCTET STRING",dc="BIT STRING";function dt(e){var t;return t=class extends e{constructor(...i){var n;super(...i);const s=i[0]||{};this.isHexOnly=(n=s.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=s.valueHex?P.toUint8Array(s.valueHex):$i}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(i){this.valueHexView=new Uint8Array(i)}fromBER(i,n,s){const a=i instanceof ArrayBuffer?new Uint8Array(i):i;if(!vt(this,a,n,s))return-1;const c=n+s;return this.valueHexView=a.subarray(n,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),n)}toBER(i=!1){return this.isHexOnly?i?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",it)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:L.ToHex(this.valueHexView)}}},t.NAME="hexBlock",t}class Kt{constructor({blockLength:t=0,error:r=Ue,warnings:i=[],valueBeforeDecode:n=$i}={}){this.blockLength=t,this.error=r,this.warnings=i,this.valueBeforeDecodeView=P.toUint8Array(n)}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)}}}Kt.NAME="baseBlock";class Me extends Kt{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 fc extends dt(Kt){constructor({idBlock:t={}}={}){var r,i,n,s;super(),t?(this.isHexOnly=(r=t.isHexOnly)!==null&&r!==void 0?r:!1,this.valueHexView=t.valueHex?P.toUint8Array(t.valueHex):$i,this.tagClass=(i=t.tagClass)!==null&&i!==void 0?i:-1,this.tagNumber=(n=t.tagNumber)!==null&&n!==void 0?n:-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",it}if(this.isConstructed&&(r|=32),this.tagNumber<31&&!this.isHexOnly){const n=new Uint8Array(1);if(!t){let s=this.tagNumber;s&=31,r|=s,n[0]=r}return n.buffer}if(!this.isHexOnly){const n=qt(this.tagNumber,7),s=new Uint8Array(n),a=n.byteLength,c=new Uint8Array(a+1);if(c[0]=r|31,!t){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const i=new Uint8Array(this.valueHexView.byteLength+1);if(i[0]=r|31,!t){const n=this.valueHexView;for(let s=0;s<n.length-1;s++)i[s+1]=n[s]|128;i[this.valueHexView.byteLength]=n[n.length-1]}return i.buffer}fromBER(t,r,i){const n=P.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,d=this.valueHexView=new Uint8Array(255),y=255;for(;s[l]&128;){if(d[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===y){y+=255;const I=new Uint8Array(y);for(let w=0;w<d.length;w++)I[w]=d[w];d=this.valueHexView=new Uint8Array(y)}}this.blockLength=l+1,d[l-1]=s[l]&127;const p=new Uint8Array(l);for(let I=0;I<l;I++)p[I]=d[I];d=this.valueHexView=new Uint8Array(l),d.set(p),this.blockLength<=9?this.tagNumber=dr(d,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return r+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}fc.NAME="identificationBlock";class pc extends Kt{constructor({lenBlock:t={}}={}){var r,i,n;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=(n=t.length)!==null&&n!==void 0?n:0}fromBER(t,r,i){const n=P.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,r+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,r+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=r+1,l=n.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=dr(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,r+this.blockLength}toBER(t=!1){let r,i;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return r=new ArrayBuffer(1),t===!1&&(i=new Uint8Array(r),i[0]=128),r;if(this.longFormUsed){const n=qt(this.length,8);if(n.byteLength>127)return this.error="Too big length",it;if(r=new ArrayBuffer(n.byteLength+1),t)return r;const s=new Uint8Array(n);i=new Uint8Array(r),i[0]=n.byteLength|128;for(let a=0;a<n.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}}}pc.NAME="lengthBlock";const R={};class Ne extends Kt{constructor({name:t=Ue,optional:r=!1,primitiveSchema:i,...n}={},s){super(n),this.name=t,this.optional=r,i&&(this.primitiveSchema=i),this.idBlock=new fc(n),this.lenBlock=new pc(n),this.valueBlock=s?new s(n):new Me(n)}fromBER(t,r,i){const n=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}toBER(t,r){const i=r||new Mi;r||hc(this);const n=this.idBlock.toBER(t);if(i.write(n),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?it: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 pp(r,i)}}Ne.NAME="BaseBlock";function hc(e){if(e instanceof R.Constructed)for(const t of e.valueBlock.value)hc(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}class Io extends Ne{constructor({value:t=Ue,...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 n=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}Io.NAME="BaseStringBlock";class yc extends dt(Me){constructor({isHexOnly:t=!0,...r}={}){super(r),this.isHexOnly=t}}yc.NAME="PrimitiveValueBlock";var gc;class Yr extends Ne{constructor(t={}){super(t,yc),this.idBlock.isConstructed=!1}}gc=Yr,R.Primitive=gc,Yr.NAME="PRIMITIVE";function Cp(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function fr(e,t=0,r=e.length){const i=t;let n=new Ne({},Me);const s=new Kt;if(!vt(s,e,t,r))return n.error=s.error,{offset:-1,result:n};if(!e.subarray(t,t+r).length)return n.error="Zero buffer length",{offset:-1,result:n};let c=n.idBlock.fromBER(e,t,r);if(n.idBlock.warnings.length&&n.warnings.concat(n.idBlock.warnings),c===-1)return n.error=n.idBlock.error,{offset:-1,result:n};if(t=c,r-=n.idBlock.blockLength,c=n.lenBlock.fromBER(e,t,r),n.lenBlock.warnings.length&&n.warnings.concat(n.lenBlock.warnings),c===-1)return n.error=n.lenBlock.error,{offset:-1,result:n};if(t=c,r-=n.lenBlock.blockLength,!n.idBlock.isConstructed&&n.lenBlock.isIndefiniteForm)return n.error="Indefinite length form used for primitive encoding form",{offset:-1,result:n};let l=Ne;switch(n.idBlock.tagClass){case 1:if(n.idBlock.tagNumber>=37&&n.idBlock.isHexOnly===!1)return n.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:n};switch(n.idBlock.tagNumber){case 0:if(n.idBlock.isConstructed&&n.lenBlock.length>0)return n.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:n};l=R.EndOfContent;break;case 1:l=R.Boolean;break;case 2:l=R.Integer;break;case 3:l=R.BitString;break;case 4:l=R.OctetString;break;case 5:l=R.Null;break;case 6:l=R.ObjectIdentifier;break;case 10:l=R.Enumerated;break;case 12:l=R.Utf8String;break;case 13:l=R.RelativeObjectIdentifier;break;case 14:l=R.TIME;break;case 15:return n.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:n};case 16:l=R.Sequence;break;case 17:l=R.Set;break;case 18:l=R.NumericString;break;case 19:l=R.PrintableString;break;case 20:l=R.TeletexString;break;case 21:l=R.VideotexString;break;case 22:l=R.IA5String;break;case 23:l=R.UTCTime;break;case 24:l=R.GeneralizedTime;break;case 25:l=R.GraphicString;break;case 26:l=R.VisibleString;break;case 27:l=R.GeneralString;break;case 28:l=R.UniversalString;break;case 29:l=R.CharacterString;break;case 30:l=R.BmpString;break;case 31:l=R.DATE;break;case 32:l=R.TimeOfDay;break;case 33:l=R.DateTime;break;case 34:l=R.Duration;break;default:{const d=n.idBlock.isConstructed?new R.Constructed:new R.Primitive;d.idBlock=n.idBlock,d.lenBlock=n.lenBlock,d.warnings=n.warnings,n=d}}break;case 2:case 3:case 4:default:l=n.idBlock.isConstructed?R.Constructed:R.Primitive}return n=Cp(n,l),c=n.fromBER(e,t,n.lenBlock.isIndefiniteForm?r:n.lenBlock.length),n.valueBeforeDecodeView=e.subarray(i,i+n.blockLength),{offset:c,result:n}}function pr(e){if(!e.byteLength){const t=new Ne({},Me);return t.error="Input buffer has zero length",{offset:-1,result:t}}return fr(P.toUint8Array(e).slice(),0,e.byteLength)}function Sp(e,t){return e?1:t}class jt extends Me{constructor({value:t=[],isIndefiniteForm:r=!1,...i}={}){super(i),this.value=t,this.isIndefiniteForm=r}fromBER(t,r,i){const n=P.toUint8Array(t);if(!vt(this,n,r,i))return-1;if(this.valueBeforeDecodeView=n.subarray(r,r+i),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),r;let s=r;for(;Sp(this.isIndefiniteForm,i)>0;){const a=fr(n,s,i);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,i-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Jr)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Jr?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(t,r){const i=r||new Mi;for(let n=0;n<this.value.length;n++)this.value[n].toBER(t,i);return r?it:i.final()}toJSON(){const t={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const r of this.value)t.value.push(r.toJSON());return t}}jt.NAME="ConstructedValueBlock";var mc;class Le extends Ne{constructor(t={}){super(t,jt),this.idBlock.isConstructed=!0}fromBER(t,r,i){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(t,r,this.lenBlock.isIndefiniteForm?i:this.lenBlock.length);return n===-1?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){const t=[];for(const i of this.valueBlock.value)t.push(i.toString("ascii").split(`
|
|
72
72
|
`).map(n=>` ${n}`).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} :`}}pc=Le,R.Constructed=pc,Le.NAME="CONSTRUCTED";class hc extends Me{fromBER(t,r,i){return r}toBER(t){return it}}hc.override="EndOfContentValueBlock";var yc;class xo extends Ne{constructor(t={}){super(t,hc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}yc=xo,R.EndOfContent=yc,xo.NAME=Jr;var gc;class zt 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 n=new Uint8Array(i);n[0]=5,n[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}gc=zt,R.Null=gc,zt.NAME="NULL";class mc extends dt(Me){constructor({value:t,...r}={}){super(r),r.valueHex?this.valueHexView=$.toUint8Array(r.valueHex):this.valueHexView=new Uint8Array(1),t&&(this.value=t)}get value(){for(const t of this.valueHexView)if(t>0)return!0;return!1}set value(t){this.valueHexView[0]=t?255:0}fromBER(t,r,i){const n=$.toUint8Array(t);return vt(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ic.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}mc.NAME="BooleanValueBlock";var bc;let $i=class extends Ne{constructor(t={}){super(t,mc),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}`}};bc=$i,R.Boolean=bc,$i.NAME="BOOLEAN";class wc extends dt(jt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=jt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==sc)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(t,r,i),this.blockLength=i;return n}toBER(t,r){return this.isConstructed?jt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}wc.NAME="OctetStringValueBlock";var vc;let Gt=class ep extends Ne{constructor({idBlock:t={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},wc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=fr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Le.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 ep&&t.push(r.valueBlock.valueHexView);return $.concat(t)}};vc=Gt,R.OctetString=vc,Gt.NAME=sc;class kc extends dt(jt){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 n=-1;if(this.isConstructed){if(n=jt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(const c of this.value){const l=c.constructor.NAME;if(l===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==ac)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=$.toUint8Array(t);if(!vt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=fr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return jt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return it;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}}}kc.NAME="BitStringValueBlock";var Cc;let Wt=class extends Ne{constructor({idBlock:t={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},kc),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 Le.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const n of r)t.push(n.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};Cc=Wt,R.BitString=Cc,Wt.NAME=ac;var Sc;function vp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),n=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=n.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=vo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=vo(r,s)),s}function xc(e){if(e>=Wr.length)for(let t=Wr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Wr[t-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=s[0]/10,i[n]=s[0]%10}r[0]>0&&(i=vo(r,i)),Wr.push(i)}return Wr[e]}function kp(e,t){let r=0;const i=new Uint8Array(e),n=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=n.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class Ao extends dt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=ic.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,n=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):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-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 n=super.fromBER(t,r,i);return n===-1||this.setValueHex(),n}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,n;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){n=s[l];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case t:r=kp(xc(i),r),a="-";break;default:r=vp(r,xc(i))}i++,n>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=nc.charAt(r[l]));return c===!1&&(a+=nc.charAt(0)),a}}Sc=Ao,Ao.NAME="IntegerValueBlock",Object.defineProperty(Sc.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ac;class ft extends Ne{constructor(t={}){super(t,Ao),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Di(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Di();const r=BigInt(t),i=new Mi,n=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${L.ToHex(c)}`)+r,y=$.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 ft({valueHex:i.final()})}convertToDER(){const t=new ft({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ft({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ac=ft,R.Integer=Ac,ft.NAME="INTEGER";var Bc;class Ri extends ft{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Bc=Ri,R.Enumerated=Bc,Ri.NAME="ENUMERATED";class Bo extends dt(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const n=$.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Di();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+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 n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=qt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",it;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[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}}}Bo.NAME="sidBlock";class Ic extends Me{constructor({value:t=Ue,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new Bo;if(n=s.fromBER(t,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(t);if(n.byteLength===0)return this.error=this.value[i].error,it;r.push(n)}return ko(r)}fromString(t){this.value=[];let r=0,i=0,n="",s=!1;do if(i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(n,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new Bo;if(n>Number.MAX_SAFE_INTEGER){Di();const c=BigInt(n);a.valueBigInt=c}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(t=`${t}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?t=`2.{${n} - 80}`:t+=n):t+=n}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}}Ic.NAME="ObjectIdentifierValueBlock";var Ec;class Ui extends Ne{constructor(t={}){super(t,Ic),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()}}}Ec=Ui,R.ObjectIdentifier=Ec,Ui.NAME="OBJECT IDENTIFIER";class Io extends dt(Kt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const n=$.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=qt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",it;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[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}}}Io.NAME="relativeSidBlock";class Nc extends Me{constructor({value:t=Ue,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new Io;if(n=s.fromBER(t,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(t,r){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(t);if(s.byteLength===0)return this.error=this.value[n].error,it;i.push(s)}return ko(i)}fromString(t){this.value=[];let r=0,i=0,n="";do{i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1;const s=new Io;if(s.valueDec=parseInt(n,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 n=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(n=`{${n}}`),t+=n}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}}Nc.NAME="RelativeObjectIdentifierValueBlock";var Oc;class Eo extends Ne{constructor(t={}){super(t,Nc),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()}}}Oc=Eo,R.RelativeObjectIdentifier=Oc,Eo.NAME="RelativeObjectIdentifier";var _c;class kt extends Le{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}_c=kt,R.Sequence=_c,kt.NAME="SEQUENCE";var Tc;let Ct=class extends Le{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Tc=Ct,R.Set=Tc,Ct.NAME="SET";class Vc extends dt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Ue}toJSON(){return{...super.toJSON(),value:this.value}}}Vc.NAME="StringValueBlock";class jc extends Vc{}jc.NAME="SimpleStringValueBlock";class We extends So{constructor({...t}={}){super(t,jc)}fromBuffer(t){this.valueBlock.value=String.fromCharCode.apply(null,$.toUint8Array(t))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r);for(let n=0;n<r;n++)i[n]=t.charCodeAt(n);this.valueBlock.value=t}}We.NAME="SIMPLE STRING";class Dc extends We{fromBuffer(t){this.valueBlock.valueHexView=$.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}}Dc.NAME="Utf8StringValueBlock";var Mc;class St extends Dc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Mc=St,R.Utf8String=Mc,St.NAME="UTF8String";class Pc extends We{fromBuffer(t){this.valueBlock.value=L.ToUtf16String(t),this.valueBlock.valueHexView=$.toUint8Array(t)}fromString(t){this.valueBlock.value=t,this.valueBlock.valueHexView=new Uint8Array(L.FromUtf16String(t))}}Pc.NAME="BmpStringValueBlock";var $c;class Li extends Pc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}$c=Li,R.BmpString=$c,Li.NAME="BMPString";class Rc extends We{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){const s=qt(t.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[n*4+l+c]=a[l]}this.valueBlock.value=t}}Rc.NAME="UniversalStringValueBlock";var Uc;class Fi extends Rc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Uc=Fi,R.UniversalString=Uc,Fi.NAME="UniversalString";var Lc;class Hi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Lc=Hi,R.NumericString=Lc,Hi.NAME="NumericString";var Fc;class qi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Fc=qi,R.PrintableString=Fc,qi.NAME="PrintableString";var Hc;class Ki extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Hc=Ki,R.TeletexString=Hc,Ki.NAME="TeletexString";var qc;class zi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}qc=zi,R.VideotexString=qc,zi.NAME="VideotexString";var Kc;class Gi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Kc=Gi,R.IA5String=Kc,Gi.NAME="IA5String";var zc;class Wi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}zc=Wi,R.GraphicString=zc,Wi.NAME="GraphicString";var Gc;class Zr extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Gc=Zr,R.VisibleString=Gc,Zr.NAME="VisibleString";var Wc;class Ji extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Wc=Ji,R.GeneralString=Wc,Ji.NAME="GeneralString";var Jc;class Yi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Jc=Yi,R.CharacterString=Jc,Yi.NAME="CharacterString";var Yc;class Qr extends Zr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let n=0;n<t.length;n++)this.valueBlock.valueHexView[n]=t.charCodeAt(n)}r&&(this.fromDate(r),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(t){this.fromString(String.fromCharCode.apply(null,$.toUint8Array(t)))}toBuffer(){const t=this.toString(),r=new ArrayBuffer(t.length),i=new Uint8Array(r);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);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 n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ge(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ge(this.month,2),r[2]=Ge(this.day,2),r[3]=Ge(this.hour,2),r[4]=Ge(this.minute,2),r[5]=Ge(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}}}Yc=Qr,R.UTCTime=Yc,Qr.NAME="UTCTime";var Zc;class Zi extends Qr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",n="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,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(c=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let 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 n.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 n.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(n);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ge(this.year,4)),r.push(Ge(this.month,2)),r.push(Ge(this.day,2)),r.push(Ge(this.hour,2)),r.push(Ge(this.minute,2)),r.push(Ge(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ge(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}Zc=Zi,R.GeneralizedTime=Zc,Zi.NAME="GeneralizedTime";var Qc;class No extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Qc=No,R.DATE=Qc,No.NAME="DATE";var Xc;class Oo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Xc=Oo,R.TimeOfDay=Xc,Oo.NAME="TimeOfDay";var el;class _o extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}el=_o,R.DateTime=el,_o.NAME="DateTime";var tl;class To extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}tl=To,R.Duration=tl,To.NAME="Duration";var rl;class Vo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}rl=Vo,R.TIME=rl,Vo.NAME="TIME";class Jt{constructor({name:t=Ue,optional:r=!1}={}){this.name=t,this.optional=r}}class jo extends Jt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Qi extends Jt{constructor({value:t=new Jt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Cp{constructor({data:t=Pi}={}){this.dataView=$.toUint8Array(t)}get data(){return this.dataView.slice().buffer}set data(t){this.dataView=$.toUint8Array(t)}fromBER(t,r,i){const n=r+i;return this.dataView=$.toUint8Array(t).subarray(r,n),n}toBER(t){return this.dataView.slice().buffer}}function Yt(e,t,r){if(r instanceof jo){for(let s=0;s<r.value.length;s++)if(Yt(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(Co)&&(s.name=r.name),s}}if(r instanceof Jt)return r.hasOwnProperty(Co)&&(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(!(dp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(yp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(gp 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(fp)===!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(pp)===!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(hp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(up 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(!(oc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(e[r.name]=t)),r instanceof R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Qi){if(a=Yt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&delete e[r.name]),a;if(Co in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};mp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Yt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&oc in t.valueBlock){const s=fr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(delete e[r.name],a.name=r.name)),a}return Yt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Sp(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=fr($.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Yt(r.result,r.result,t)}const il=Object.freeze(Object.defineProperty({__proto__:null,Any:Jt,BaseBlock:Ne,BaseStringBlock:So,BitString:Wt,BmpString:Li,Boolean:$i,CharacterString:Yi,Choice:jo,Constructed:Le,DATE:No,DateTime:_o,Duration:To,EndOfContent:xo,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:dt,IA5String:Gi,Integer:ft,Null:zt,NumericString:Hi,ObjectIdentifier:Ui,OctetString:Gt,Primitive:Yr,PrintableString:qi,RawData:Cp,RelativeObjectIdentifier:Eo,Repeated:Qi,Sequence:kt,Set:Ct,TIME:Vo,TeletexString:Ki,TimeOfDay:Oo,UTCTime:Qr,UniversalString:Fi,Utf8String:St,ValueBlock:Me,VideotexString:zi,ViewWriter:Mi,VisibleString:Zr,compareSchema:Yt,fromBER:pr,verifySchema:Sp},Symbol.toStringTag,{value:"Module"}));var T;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(T||(T={}));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 Xi{constructor(t,r=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),t)if(typeof t=="number")this.fromNumber(t);else if($.isBufferSource(t))this.unusedBits=r,this.value=$.toArrayBuffer(t);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(t){if(!(t instanceof Wt))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 Wt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Wt({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 n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=n.buffer}}class ae{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(t){typeof t=="number"?this.buffer=new ArrayBuffer(t):$.isBufferSource(t)?this.buffer=$.toArrayBuffer(t):Array.isArray(t)?this.buffer=new Uint8Array(t):this.buffer=new ArrayBuffer(0)}fromASN(t){if(!(t instanceof Gt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Gt({valueHex:this.buffer})}toSchema(t){return new Gt({name:t})}}const xp={fromASN:e=>e instanceof zt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new zt;const t=pr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Ap={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ft({value:+e})},Bp={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ri({value:e})},he={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ft({valueHex:e})},Ip={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Wt({valueHex:e})},Ep={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ui({value:e})},Np={fromASN:e=>e.valueBlock.value,toASN:e=>new $i({value:e})},en={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Gt({valueHex:e})},Op={fromASN:e=>new ae(e.getValue()),toASN:e=>e.toASN()};function Qe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const nl=Qe(St),_p=Qe(Li),Tp=Qe(Fi),Vp=Qe(Hi),jp=Qe(qi),Dp=Qe(Ki),Mp=Qe(zi),Pp=Qe(Gi),$p=Qe(Wi),Rp=Qe(Zr),Up=Qe(Ji),Lp=Qe(Yi),Fp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Hp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},qp={fromASN:()=>null,toASN:()=>new zt};function Do(e){switch(e){case m.Any:return xp;case m.BitString:return Ip;case m.BmpString:return _p;case m.Boolean:return Np;case m.CharacterString:return Lp;case m.Enumerated:return Bp;case m.GeneralString:return Up;case m.GeneralizedTime:return Hp;case m.GraphicString:return $p;case m.IA5String:return Pp;case m.Integer:return Ap;case m.Null:return qp;case m.NumericString:return Vp;case m.ObjectIdentifier:return Ep;case m.OctetString:return en;case m.PrintableString:return jp;case m.TeletexString:return Dp;case m.UTCTime:return Fp;case m.UniversalString:return Tp;case m.Utf8String:return nl;case m.VideotexString:return Mp;case m.VisibleString:return Rp;default:return null}}function xt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:xt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function ol(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:ol(r)}return!1}function Kp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<e.byteLength;n++)if(r[n]!==i[n])return!1;return!0}class zp{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:T.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),n=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=m[a.type],p=il[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else xt(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===T.Choice?l=new Jt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Jt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?Ct:kt;l=new y({name:"",value:[new Qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||xt(a.type)){const y=a.repeated?Le:Yr;n.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,n.push(new Le({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else n.push(new Le({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,n.push(l)}switch(i.type){case T.Sequence:return new kt({value:n,name:""});case T.Set:return new Ct({value:n,name:""});case T.Choice:return new jo({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const Xe=new zp,V=e=>t=>{let r;Xe.has(t)?r=Xe.get(t):(r=Xe.createDefault(t),Xe.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Xe.has(t.constructor)?i=Xe.get(t.constructor):(i=Xe.createDefault(t.constructor),Xe.set(t.constructor,i));const n=Object.assign({},e);if(typeof n.type=="number"&&!n.converter){const s=Do(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);n.converter=s}i.items[r]=n};class sl extends Error{constructor(){super(...arguments),this.schemas=[]}}class Gp{static parse(t,r){const i=pr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(xt(r))return new r().fromASN(t);const n=Xe.get(r);Xe.cache(r);let s=n.schema;if(t.constructor===Le&&n.type!==T.Choice){s=new Le({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const l in n.items)delete t[l]}const a=Yt({},t,s);if(!a.verified)throw new sl(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(ol(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=n.itemType;if(typeof l=="number"){const d=Do(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in n.items){const d=a.result[l];if(!d)continue;const y=n.items[l],p=y.type;if(typeof p=="number"||xt(p)){const I=(i=y.converter)!==null&&i!==void 0?i:xt(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?kt:Ct,h=new w;h.valueBlock=d.valueBlock;const g=pr(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;c[l]=Array.from(b,k=>I.fromASN(k))}else c[l]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(xt(p))h=new p().toSchema("");else{const g=m[p],b=il[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=pr(h.toBER(!1)).result}c[l]=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.");c[l]=Array.from(d,I=>this.fromASN(I,p))}else c[l]=this.fromASN(d,p)}return c}catch(n){throw n instanceof sl&&n.schemas.push(r.name),n}}}class Mo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&xt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Xe.get(r);Xe.cache(r);let n=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Do(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=t.map(c=>a.toASN(c))}else n=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Kp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Mo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||xt(c.type))){const y={};y.valueHex=d instanceof zt?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Yr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else n.push(new Le({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else n.push(new Le({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case T.Sequence:s=new kt({value:n});break;case T.Set:s=new Ct({value:n});break;case T.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(t,r,i,n){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(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,d=>a.toASN(d)),l=t.repeated==="sequence"?kt:Ct;s=new l({value:c})}else s=a.toASN(n)}else if(t.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,l=>this.toASN(l)),c=t.repeated==="sequence"?kt:Ct;s=new c({value:a})}else s=this.toASN(n);return s}}class le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Mo.serialize(t)}static parse(t,r){return Gp.parse(t,r)}static toString(t){const r=$.isBufferSource(t)?$.toArrayBuffer(t):G.serialize(t),i=pr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var n=arguments.length,s=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(n<3?a(s):n>3?a(t,r,s):a(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var al={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")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,k=-1,B=(h.match(l.zoneIndex)||[])[0],E,S;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(k=h.indexOf(":",k+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(S=g-b,E=":";S--;)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 C=h.split(":"),A=[];for(let M=0;M<C.length;M++)A.push(parseInt(C[M],16));return A}(),{parts:g,zoneId:B}}function y(h,g,b,k){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,E;for(;k>0;){if(E=b-k,E<0&&(E=0),h[B]>>E!==g[B]>>E)return!1;k-=b,B+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.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,k;for(b=0;b<g.length;b++)if(k=g[b],!(0<=k&&k<=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 k;if(b===void 0&&(k=g,g=k[0],b=k[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 k={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,E,S;for(B=3;B>=0;B-=1)if(E=this.octets[B],E in k){if(S=k[E],b&&S!==0)return null;S!==8&&(b=!0),g+=S}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(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<4;)B.push(parseInt(b[E],10)|parseInt(k[E],10)^255),E++;return new this(B)}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,k,B,E;try{for(g=this.parseCIDR(h),k=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(k[b],10)&parseInt(E[b],10)),b++;return new this(B)}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 k=[this.parse(g[1]),b];return Object.defineProperty(k,"toString",{value:function(){return this.join("/")}}),k}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,k;if(g=h.match(i.fourOctet))return function(){const B=g.slice(1,6),E=[];for(let S=0;S<B.length;S++)b=B[S],E.push(p(b));return E}();if(g=h.match(i.longValue)){if(k=p(g[1]),k>4294967295||k<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let E;for(E=0;E<=24;E+=8)B.push(k>>E&255);return B}().reverse()}else return(g=h.match(i.twoOctet))?function(){const B=g.slice(1,4),E=[];if(k=p(B[1]),k>16777215||k<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(k>>16&255),E.push(k>>8&255),E.push(k&255),E}():(g=h.match(i.threeOctet))?function(){const B=g.slice(1,5),E=[];if(k=p(B[2]),k>65535||k<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(p(B[1])),E.push(k>>8&255),E.push(k&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 k=Math.floor(h/8);for(;b<k;)g[b]=255,b++;return k<4&&(g[k]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let k,B;if(g.length===16)for(this.parts=[],k=0;k<=14;k+=2)this.parts.push(g[k]<<8|g[k+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(k=0;k<this.parts.length;k++)if(B=this.parts[k],!(0<=B&&B<=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 k;if(b===void 0&&(k=g,g=k[0],b=k[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 k={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 B,E;for(let S=7;S>=0;S-=1)if(B=this.parts[S],B in k){if(E=k[B],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=[],k=this.parts;for(let B=0;B<k.length;B++)g=k[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const k=[];for(let B=0;B<this.parts.length;B++)k.push(I(this.parts[B].toString(16),4));return k}).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],k=g[1];return new w.IPv4([b>>8,b&255,k>>8,k&255])},h.prototype.toNormalizedString=function(){const g=(function(){const k=[];for(let B=0;B<this.parts.length;B++)k.push(this.parts[B].toString(16));return k}).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 k=0,B=-1,E;for(;E=g.exec(b);)E[0].length>B&&(k=E.index,B=E[0].length);return B<0?b:`${b.substring(0,k)}::${b.substring(k+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<16;)B.push(parseInt(b[E],10)|parseInt(k[E],10)^255),E++;return new this(B)}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,k,B,E;try{for(g=this.parseCIDR(h),k=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(k[b],10)&parseInt(E[b],10)),b++;return new this(B)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},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,k;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return k=[this.parse(b[1]),g],Object.defineProperty(k,"toString",{value:function(){return this.join("/")}}),k;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,k,B,E,S;if(k=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${k[1]}`);if(l.native.test(h))return d(h,8);if((k=h.match(l.transitional))&&(S=k[6]||"",g=d(k[1].slice(0,-1)+S,6),g.parts)){for(E=[parseInt(k[2]),parseInt(k[3]),parseInt(k[4]),parseInt(k[5])],b=0;b<E.length;b++)if(B=E[b],!(0<=B&&B<=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 k=Math.floor(h/8);for(;b<k;)g[b]=255,b++;return k<16&&(g[k]=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 k,B,E,S;b==null&&(b="unicast");for(B in g)if(Object.prototype.hasOwnProperty.call(g,B)){for(E=g[B],E[0]&&!(E[0]instanceof Array)&&(E=[E]),k=0;k<E.length;k++)if(S=E[k],h.kind()===S[0].kind()&&h.match.apply(h,S))return B}return b},e.exports?e.exports=w:t.ipaddr=w})(bo)})(al);var cl=al.exports;class ll{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((n,s)=>n+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,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 cl.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=cl.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Po,$o,Ro;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([V({type:T.Choice})],Oe);let hr=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})],hr.prototype,"ia5String",void 0),u([f({type:m.Any})],hr.prototype,"anyValue",void 0),hr=u([V({type:T.Choice})],hr);class Xr{constructor(t={}){this.type="",this.value=new hr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Xr.prototype,"type",void 0),u([f({type:hr})],Xr.prototype,"value",void 0);let yr=Po=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};yr=Po=u([V({type:T.Set,itemType:Xr})],yr);let Uo=$o=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};Uo=$o=u([V({type:T.Sequence,itemType:yr})],Uo);let we=Ro=class extends Uo{constructor(t){super(t),Object.setPrototypeOf(this,Ro.prototype)}};we=Ro=u([V({type:T.Sequence})],we);const Wp={fromASN:e=>ll.toString(en.fromASN(e)),toASN:e=>en.toASN(ll.fromString(e))};class ei{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ei.prototype,"value",void 0);class Lo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Lo.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Lo.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ei,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type: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:Lo,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:Wp})],ie.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([V({type:T.Choice})],ie);const gr="1.3.6.1.5.5.7.3",Zt="2.5.29";var Fo;class tn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],tn.prototype,"accessMethod",void 0),u([f({type:ie})],tn.prototype,"accessLocation",void 0);let ul=Fo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};ul=Fo=u([V({type:T.Sequence,itemType:tn})],ul);const Ho=`${Zt}.35`;class qo extends ae{}class Qt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:qo,context:0,optional:!0,implicit:!0})],Qt.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Qt.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:he})],Qt.prototype,"authorityCertSerialNumber",void 0);const dl=`${Zt}.19`;class rn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],rn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],rn.prototype,"pathLenConstraint",void 0);var Ko;let Pe=Ko=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};Pe=Ko=u([V({type:T.Sequence,itemType:ie})],Pe);var zo;let fl=zo=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,zo.prototype)}};fl=zo=u([V({type:T.Sequence})],fl);var Go;const pl=`${Zt}.32`;let At=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],At.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],At.prototype,"visibleString",void 0),u([f({type:m.BmpString})],At.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],At.prototype,"utf8String",void 0),At=u([V({type:T.Choice})],At);class Wo{constructor(t={}){this.organization=new At,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:At})],Wo.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],Wo.prototype,"noticeNumbers",void 0);class Jo{constructor(t={}){Object.assign(this,t)}}u([f({type:Wo,optional:!0})],Jo.prototype,"noticeRef",void 0),u([f({type:At,optional:!0})],Jo.prototype,"explicitText",void 0);let nn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],nn.prototype,"cPSuri",void 0),u([f({type:Jo})],nn.prototype,"userNotice",void 0),nn=u([V({type:T.Choice})],nn);class Yo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Yo.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],Yo.prototype,"qualifier",void 0);class on{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],on.prototype,"policyIdentifier",void 0),u([f({type:Yo,repeated:"sequence",optional:!0})],on.prototype,"policyQualifiers",void 0);let sn=Go=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Go.prototype)}};sn=Go=u([V({type:T.Sequence,itemType:on})],sn);let an=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],an.prototype,"value",void 0),an=u([V({type:T.Choice})],an);let hl=class extends an{};hl=u([V({type:T.Choice})],hl);var Zo,nt;(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"})(nt||(nt={}));class yl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&nt.aACompromise&&t.push("aACompromise"),r&nt.affiliationChanged&&t.push("affiliationChanged"),r&nt.cACompromise&&t.push("cACompromise"),r&nt.certificateHold&&t.push("certificateHold"),r&nt.cessationOfOperation&&t.push("cessationOfOperation"),r&nt.keyCompromise&&t.push("keyCompromise"),r&nt.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&nt.superseded&&t.push("superseded"),r&nt.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let mr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],mr.prototype,"fullName",void 0),u([f({type:yr,context:1,implicit:!0})],mr.prototype,"nameRelativeToCRLIssuer",void 0),mr=u([V({type:T.Choice})],mr);class ti{constructor(t={}){Object.assign(this,t)}}u([f({type:mr,context:0,optional:!0})],ti.prototype,"distributionPoint",void 0),u([f({type:yl,context:1,optional:!0,implicit:!0})],ti.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ti.prototype,"cRLIssuer",void 0);let Qo=Zo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};Qo=Zo=u([V({type:T.Sequence,itemType:ti})],Qo);var Xo;let gl=Xo=class extends Qo{constructor(t){super(t),Object.setPrototypeOf(this,Xo.prototype)}};gl=Xo=u([V({type:T.Sequence,itemType:ti})],gl);class je{constructor(t={}){this.onlyContainsUserCerts=je.ONLY,this.onlyContainsCACerts=je.ONLY,this.indirectCRL=je.ONLY,this.onlyContainsAttributeCerts=je.ONLY,Object.assign(this,t)}}je.ONLY=!1,u([f({type:mr,context:0,optional:!0})],je.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsCACerts",void 0),u([f({type:yl,context:3,optional:!0,implicit:!0})],je.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:je.ONLY,implicit:!0})],je.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsAttributeCerts",void 0);var ri;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ri||(ri={}));let es=class{constructor(t=ri.unspecified){this.reason=ri.unspecified,this.reason=t}toJSON(){return ri[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],es.prototype,"reason",void 0),es=u([V({type:T.Choice})],es);var ts;const ml=`${Zt}.37`;let cn=ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};cn=ts=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],cn);const Jp=`${gr}.1`,Yp=`${gr}.2`,Zp=`${gr}.3`,Qp=`${gr}.4`,Xp=`${gr}.8`,eh=`${gr}.9`;let rs=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],rs.prototype,"value",void 0),rs=u([V({type:T.Choice})],rs);let is=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],is.prototype,"value",void 0),is=u([V({type:T.Choice})],is);var ns;let bl=ns=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,ns.prototype)}};bl=ns=u([V({type:T.Sequence})],bl);const wl=`${Zt}.15`;var ot;(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"})(ot||(ot={}));class os extends Xi{toJSON(){const t=this.toNumber(),r=[];return t&ot.cRLSign&&r.push("crlSign"),t&ot.dataEncipherment&&r.push("dataEncipherment"),t&ot.decipherOnly&&r.push("decipherOnly"),t&ot.digitalSignature&&r.push("digitalSignature"),t&ot.encipherOnly&&r.push("encipherOnly"),t&ot.keyAgreement&&r.push("keyAgreement"),t&ot.keyCertSign&&r.push("keyCertSign"),t&ot.keyEncipherment&&r.push("keyEncipherment"),t&ot.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var ss;class ln{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],ln.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],ln.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],ln.prototype,"maximum",void 0);let un=ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};un=ss=u([V({type:T.Sequence,itemType:ln})],un);class vl{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],vl.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],vl.prototype,"excludedSubtrees",void 0);class kl{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:he})],kl.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:he})],kl.prototype,"inhibitPolicyMapping",void 0);var as;class cs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],cs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],cs.prototype,"subjectDomainPolicy",void 0);let Cl=as=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,as.prototype)}};Cl=as=u([V({type:T.Sequence,itemType:cs})],Cl);var ls;const Sl=`${Zt}.17`;let us=ls=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,ls.prototype)}};us=ls=u([V({type:T.Sequence})],us);let Bt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Bt.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Bt.prototype,"values",void 0);var ds;let xl=ds=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ds.prototype)}};xl=ds=u([V({type:T.Sequence,itemType:Bt})],xl);const Al=`${Zt}.14`;class Dt extends qo{}class Bl{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],Bl.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],Bl.prototype,"notAfter",void 0);var ii;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ii||(ii={}));class Il extends Xi{toJSON(){const t=[],r=this.toNumber();return r&ii.pKIXCertificate&&t.push("pKIXCertificate"),r&ii.newExtensions&&t.push("newExtensions"),r&ii.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class El{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new Il,Object.assign(this,t)}}u([f({type:m.GeneralString})],El.prototype,"entrustVers",void 0),u([f({type:Il})],El.prototype,"entrustInfoFlags",void 0);var fs;let Nl=fs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};Nl=fs=u([V({type:T.Sequence,itemType:tn})],Nl);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&rc(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 It{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],It.prototype,"algorithm",void 0),u([f({type:m.BitString})],It.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([V({type:T.Choice})],_e);class dn{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})],dn.prototype,"notBefore",void 0),u([f({type:_e})],dn.prototype,"notAfter",void 0);var ps;let st=class tp{constructor(t={}){this.extnID="",this.critical=tp.CRITICAL,this.extnValue=new ae,Object.assign(this,t)}};st.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],st.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:st.CRITICAL})],st.prototype,"critical",void 0),u([f({type:ae})],st.prototype,"extnValue",void 0);let Xt=ps=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};Xt=ps=u([V({type:T.Sequence,itemType:st})],Xt);var br;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(br||(br={}));class et{constructor(t={}){this.version=br.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new H,this.issuer=new we,this.validity=new dn,this.subject=new we,this.subjectPublicKeyInfo=new It,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:br.v1})],et.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],et.prototype,"serialNumber",void 0),u([f({type:H})],et.prototype,"signature",void 0),u([f({type:we})],et.prototype,"issuer",void 0),u([f({type:dn})],et.prototype,"validity",void 0),u([f({type:we})],et.prototype,"subject",void 0),u([f({type:It})],et.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],et.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],et.prototype,"subjectUniqueID",void 0),u([f({type:Xt,context:3,optional:!0})],et.prototype,"extensions",void 0);class wr{constructor(t={}){this.tbsCertificate=new et,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:H})],wr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],wr.prototype,"signatureValue",void 0);class fn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],fn.prototype,"userCertificate",void 0),u([f({type:_e})],fn.prototype,"revocationDate",void 0),u([f({type:st,optional:!0,repeated:"sequence"})],fn.prototype,"crlEntryExtensions",void 0);class Et{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})],Et.prototype,"version",void 0),u([f({type:H})],Et.prototype,"signature",void 0),u([f({type:we})],Et.prototype,"issuer",void 0),u([f({type:_e})],Et.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Et.prototype,"nextUpdate",void 0),u([f({type:fn,repeated:"sequence",optional:!0})],Et.prototype,"revokedCertificates",void 0),u([f({type:st,optional:!0,context:0,repeated:"sequence"})],Et.prototype,"crlExtensions",void 0);let hs=class{constructor(t={}){this.tbsCertList=new Et,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Et})],hs.prototype,"tbsCertList",void 0),u([f({type:H})],hs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],hs.prototype,"signature",void 0);class vr{constructor(t={}){this.issuer=new we,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:we})],vr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],vr.prototype,"serialNumber",void 0);let kr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Dt,context:0,implicit:!0})],kr.prototype,"subjectKeyIdentifier",void 0),u([f({type:vr})],kr.prototype,"issuerAndSerialNumber",void 0),kr=u([V({type:T.Choice})],kr);var Nt;(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"})(Nt||(Nt={}));let ni=class extends H{};ni=u([V({type:T.Sequence})],ni);let pn=class extends H{};pn=u([V({type:T.Sequence})],pn);let pt=class extends H{};pt=u([V({type:T.Sequence})],pt);let hn=class extends H{};hn=u([V({type:T.Sequence})],hn);let Ol=class extends H{};Ol=u([V({type:T.Sequence})],Ol);let ys=class extends H{};ys=u([V({type:T.Sequence})],ys);let Cr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Cr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],Cr.prototype,"attrValues",void 0);var gs;class ht{constructor(t={}){this.version=Nt.v0,this.sid=new kr,this.digestAlgorithm=new ni,this.signatureAlgorithm=new pn,this.signature=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],ht.prototype,"version",void 0),u([f({type:kr})],ht.prototype,"sid",void 0),u([f({type:ni})],ht.prototype,"digestAlgorithm",void 0),u([f({type:Cr,repeated:"set",context:0,implicit:!0,optional:!0})],ht.prototype,"signedAttrs",void 0),u([f({type:pn})],ht.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],ht.prototype,"signature",void 0),u([f({type:Cr,repeated:"set",context:1,implicit:!0,optional:!0})],ht.prototype,"unsignedAttrs",void 0);let yn=gs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,gs.prototype)}};yn=gs=u([V({type:T.Set,itemType:ht})],yn);let _l=class extends _e{};_l=u([V({type:T.Choice})],_l);let Tl=class extends ht{};Tl=u([V({type:T.Sequence})],Tl);class ms{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],ms.prototype,"acIssuer",void 0),u([f({type:m.Integer})],ms.prototype,"acSerial",void 0),u([f({type:Bt,repeated:"sequence"})],ms.prototype,"attrs",void 0);var bs;let gn=bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,bs.prototype)}};gn=bs=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],gn);class mn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],mn.prototype,"pathLenConstraint",void 0),u([f({type:gn,implicit:!0,context:0,optional:!0})],mn.prototype,"permittedAttrs",void 0),u([f({type:gn,implicit:!0,context:1,optional:!0})],mn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],mn.prototype,"permitUnSpecified",void 0);class er{constructor(t={}){this.issuer=new Pe,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:Pe})],er.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],er.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],er.prototype,"issuerUID",void 0);var ws;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(ws||(ws={}));class tr{constructor(t={}){this.digestedObjectType=ws.publicKey,this.digestAlgorithm=new H,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],tr.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],tr.prototype,"otherObjectTypeID",void 0),u([f({type:H})],tr.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],tr.prototype,"objectDigest",void 0);class bn{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,optional:!0})],bn.prototype,"issuerName",void 0),u([f({type:er,context:0,implicit:!0,optional:!0})],bn.prototype,"baseCertificateID",void 0),u([f({type:tr,context:1,implicit:!0,optional:!0})],bn.prototype,"objectDigestInfo",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],Sr.prototype,"v1Form",void 0),u([f({type:bn,context:0,implicit:!0})],Sr.prototype,"v2Form",void 0),Sr=u([V({type:T.Choice})],Sr);class wn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],wn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],wn.prototype,"notAfterTime",void 0);class oi{constructor(t={}){Object.assign(this,t)}}u([f({type:er,implicit:!0,context:0,optional:!0})],oi.prototype,"baseCertificateID",void 0),u([f({type:Pe,implicit:!0,context:1,optional:!0})],oi.prototype,"entityName",void 0),u([f({type:tr,implicit:!0,context:2,optional:!0})],oi.prototype,"objectDigestInfo",void 0);var vs;(function(e){e[e.v2=1]="v2"})(vs||(vs={}));class at{constructor(t={}){this.version=vs.v2,this.holder=new oi,this.issuer=new Sr,this.signature=new H,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new wn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],at.prototype,"version",void 0),u([f({type:oi})],at.prototype,"holder",void 0),u([f({type:Sr})],at.prototype,"issuer",void 0),u([f({type:H})],at.prototype,"signature",void 0),u([f({type:m.Integer,converter:he})],at.prototype,"serialNumber",void 0),u([f({type:wn})],at.prototype,"attrCertValidityPeriod",void 0),u([f({type:Bt,repeated:"sequence"})],at.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],at.prototype,"issuerUniqueID",void 0),u([f({type:Xt,optional:!0})],at.prototype,"extensions",void 0);class vn{constructor(t={}){this.acinfo=new at,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:at})],vn.prototype,"acinfo",void 0),u([f({type:H})],vn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vn.prototype,"signatureValue",void 0);var kn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(kn||(kn={}));class ks extends Xi{}class Cs{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Cs.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Cs.prototype,"value",void 0);class Ss{constructor(t={}){this.policyId="",this.classList=new ks(kn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ss.prototype,"policyId",void 0),u([f({type:ks,defaultValue:new ks(kn.unclassified)})],Ss.prototype,"classList",void 0),u([f({type:Cs,repeated:"set"})],Ss.prototype,"securityCategories",void 0);class Cn{constructor(t={}){Object.assign(this,t)}}u([f({type:ae})],Cn.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],Cn.prototype,"oid",void 0),u([f({type:m.Utf8String})],Cn.prototype,"string",void 0);class Vl{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Vl.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],Vl.prototype,"values",void 0);var xs;class Sn{constructor(t={}){this.targetCertificate=new er,Object.assign(this,t)}}u([f({type:er})],Sn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],Sn.prototype,"targetName",void 0),u([f({type:tr,optional:!0})],Sn.prototype,"certDigestInfo",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],xr.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],xr.prototype,"targetGroup",void 0),u([f({type:Sn,context:2,implicit:!0})],xr.prototype,"targetCert",void 0),xr=u([V({type:T.Choice})],xr);let As=xs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,xs.prototype)}};As=xs=u([V({type:T.Sequence,itemType:xr})],As);var Bs;let jl=Bs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Bs.prototype)}};jl=Bs=u([V({type:T.Sequence,itemType:As})],jl);class Dl{constructor(t={}){Object.assign(this,t)}}u([f({type:Pe,implicit:!0,context:0,optional:!0})],Dl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Dl.prototype,"roleName",void 0);class Is{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Is.prototype,"service",void 0),u([f({type:ie})],Is.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Is.prototype,"authInfo",void 0);var Es;class Ns{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ns.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Ns.prototype,"otherCert",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wr})],Ar.prototype,"certificate",void 0),u([f({type:vn,context:2,implicit:!0})],Ar.prototype,"v2AttrCert",void 0),u([f({type:Ns,context:3,implicit:!0})],Ar.prototype,"other",void 0),Ar=u([V({type:T.Choice})],Ar);let xn=Es=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Es.prototype)}};xn=Es=u([V({type:T.Set,itemType:Ar})],xn);class Br{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Br.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Br.prototype,"content",void 0);let si=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae})],si.prototype,"single",void 0),u([f({type:m.Any})],si.prototype,"any",void 0),si=u([V({type:T.Choice})],si);class An{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],An.prototype,"eContentType",void 0),u([f({type:si,context:0,optional:!0})],An.prototype,"eContent",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ae,converter:Op,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([V({type:T.Choice})],ai);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new hn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:hn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ai,optional:!0})],ci.prototype,"encryptedContent",void 0);class Bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Bn.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],Bn.prototype,"keyAttr",void 0);var Os;class In{constructor(t={}){this.subjectKeyIdentifier=new Dt,Object.assign(this,t)}}u([f({type:Dt})],In.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],In.prototype,"date",void 0),u([f({type:Bn,optional:!0})],In.prototype,"other",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:In,context:0,implicit:!0,optional:!0})],Ir.prototype,"rKeyId",void 0),u([f({type:vr,optional:!0})],Ir.prototype,"issuerAndSerialNumber",void 0),Ir=u([V({type:T.Choice})],Ir);class _s{constructor(t={}){this.rid=new Ir,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Ir})],_s.prototype,"rid",void 0),u([f({type:ae})],_s.prototype,"encryptedKey",void 0);let En=Os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};En=Os=u([V({type:T.Sequence,itemType:_s})],En);class Ts{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Ts.prototype,"algorithm",void 0),u([f({type:m.BitString})],Ts.prototype,"publicKey",void 0);let rr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Dt,context:0,implicit:!0,optional:!0})],rr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ts,context:1,implicit:!0,optional:!0})],rr.prototype,"originatorKey",void 0),u([f({type:vr,optional:!0})],rr.prototype,"issuerAndSerialNumber",void 0),rr=u([V({type:T.Choice})],rr);class Er{constructor(t={}){this.version=Nt.v3,this.originator=new rr,this.keyEncryptionAlgorithm=new pt,this.recipientEncryptedKeys=new En,Object.assign(this,t)}}u([f({type:m.Integer})],Er.prototype,"version",void 0),u([f({type:rr,context:0})],Er.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],Er.prototype,"ukm",void 0),u([f({type:pt})],Er.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:En})],Er.prototype,"recipientEncryptedKeys",void 0);let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Dt,context:0,implicit:!0})],Nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:vr})],Nr.prototype,"issuerAndSerialNumber",void 0),Nr=u([V({type:T.Choice})],Nr);class li{constructor(t={}){this.version=Nt.v0,this.rid=new Nr,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],li.prototype,"version",void 0),u([f({type:Nr})],li.prototype,"rid",void 0),u([f({type:pt})],li.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],ui.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],ui.prototype,"date",void 0),u([f({type:Bn,optional:!0})],ui.prototype,"other",void 0);class di{constructor(t={}){this.version=Nt.v4,this.kekid=new ui,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],di.prototype,"version",void 0),u([f({type:ui})],di.prototype,"kekid",void 0),u([f({type:pt})],di.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Nt.v0,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:ys,context:0,optional:!0})],fi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:pt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class Vs{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Vs.prototype,"oriType",void 0),u([f({type:m.Any})],Vs.prototype,"oriValue",void 0);let Mt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:li,optional:!0})],Mt.prototype,"ktri",void 0),u([f({type:Er,context:1,implicit:!0,optional:!0})],Mt.prototype,"kari",void 0),u([f({type:di,context:2,implicit:!0,optional:!0})],Mt.prototype,"kekri",void 0),u([f({type:fi,context:3,implicit:!0,optional:!0})],Mt.prototype,"pwri",void 0),u([f({type:Vs,context:4,implicit:!0,optional:!0})],Mt.prototype,"ori",void 0),Mt=u([V({type:T.Choice})],Mt);var js;let Nn=js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Nn=js=u([V({type:T.Set,itemType:Mt})],Nn);var Ds;class On{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],On.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],On.prototype,"otherRevInfo",void 0);let pi=class{constructor(t={}){this.other=new On,Object.assign(this,t)}};u([f({type:On,context:1,implicit:!0})],pi.prototype,"other",void 0),pi=u([V({type:T.Choice})],pi);let Ms=Ds=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ds.prototype)}};Ms=Ds=u([V({type:T.Set,itemType:pi})],Ms);class Ps{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],Ps.prototype,"certs",void 0),u([f({type:Ms,context:1,implicit:!0,optional:!0})],Ps.prototype,"crls",void 0);var $s;let Rs=$s=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,$s.prototype)}};Rs=$s=u([V({type:T.Set,itemType:Cr})],Rs);class hi{constructor(t={}){this.version=Nt.v0,this.recipientInfos=new Nn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],hi.prototype,"version",void 0),u([f({type:Ps,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:Rs,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const th="1.2.840.113549.1.7.2";var Us;let _n=Us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Us.prototype)}};_n=Us=u([V({type:T.Set,itemType:ni})],_n);class Or{constructor(t={}){this.version=Nt.v0,this.digestAlgorithms=new _n,this.encapContentInfo=new An,this.signerInfos=new yn,Object.assign(this,t)}}u([f({type:m.Integer})],Or.prototype,"version",void 0),u([f({type:_n})],Or.prototype,"digestAlgorithms",void 0),u([f({type:An})],Or.prototype,"encapContentInfo",void 0),u([f({type:xn,context:0,implicit:!0,optional:!0})],Or.prototype,"certificates",void 0),u([f({type:pi,context:1,implicit:!0,optional:!0})],Or.prototype,"crls",void 0),u([f({type:yn})],Or.prototype,"signerInfos",void 0);const yi="1.2.840.10045.2.1",Ls="1.2.840.10045.4.1",Ml="1.2.840.10045.4.3.1",Fs="1.2.840.10045.4.3.2",Hs="1.2.840.10045.4.3.3",qs="1.2.840.10045.4.3.4",Pl="1.2.840.10045.3.1.7",$l="1.3.132.0.34",Rl="1.3.132.0.35";function gi(e){return new H({algorithm:e})}const rh=gi(Ls);gi(Ml);const ih=gi(Fs),nh=gi(Hs),oh=gi(qs);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],_r.prototype,"namedCurve",void 0),_r=u([V({type:T.Choice})],_r);class Tn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],Tn.prototype,"version",void 0),u([f({type:ae})],Tn.prototype,"privateKey",void 0),u([f({type:_r,context:0,optional:!0})],Tn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],Tn.prototype,"publicKey",void 0);class Vn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Vn.prototype,"r",void 0),u([f({type:m.Integer,converter:he})],Vn.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",Tr=`${Fe}.1`,sh=`${Fe}.7`,ah=`${Fe}.9`,ch=`${Fe}.10`,lh=`${Fe}.2`,uh=`${Fe}.4`,jn=`${Fe}.5`,dh=`${Fe}.14`,Ks=`${Fe}.11`,Dn=`${Fe}.12`,Mn=`${Fe}.13`,Ul=`${Fe}.15`,Ll=`${Fe}.16`,Fl="1.3.14.3.2.26",Hl="2.16.840.1.101.3.4.2.4",ql="2.16.840.1.101.3.4.2.1",Kl="2.16.840.1.101.3.4.2.2",zl="2.16.840.1.101.3.4.2.3",fh="2.16.840.1.101.3.4.2.5",ph="2.16.840.1.101.3.4.2.6",hh="1.2.840.113549.2.2",yh="1.2.840.113549.2.5",zs=`${Fe}.8`;function ve(e){return new H({algorithm:e,parameters:null})}ve(hh),ve(yh);const ir=ve(Fl);ve(Hl),ve(ql),ve(Kl),ve(zl),ve(fh),ve(ph);const Gl=new H({algorithm:zs,parameters:G.serialize(ir)}),Wl=new H({algorithm:ah,parameters:G.serialize(en.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ve(Tr),ve(lh),ve(uh),ve(jn),ve(Ul),ve(Ll),ve(Dn),ve(Mn),ve(Ul),ve(Ll);class Pn{constructor(t={}){this.hashAlgorithm=new H(ir),this.maskGenAlgorithm=new H({algorithm:zs,parameters:G.serialize(ir)}),this.pSourceAlgorithm=new H(Wl),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:ir})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Gl})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:Wl})],Pn.prototype,"pSourceAlgorithm",void 0),new H({algorithm:sh,parameters:G.serialize(new Pn)});class mi{constructor(t={}){this.hashAlgorithm=new H(ir),this.maskGenAlgorithm=new H({algorithm:zs,parameters:G.serialize(ir)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:ir})],mi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Gl})],mi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],mi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],mi.prototype,"trailerField",void 0),new H({algorithm:ch,parameters:G.serialize(new mi)});class $n{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ae})],$n.prototype,"digest",void 0);var Gs;class Rn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Rn.prototype,"prime",void 0),u([f({type:m.Integer,converter:he})],Rn.prototype,"exponent",void 0),u([f({type:m.Integer,converter:he})],Rn.prototype,"coefficient",void 0);let Ws=Gs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Gs.prototype)}};Ws=Gs=u([V({type:T.Sequence,itemType:Rn})],Ws);class yt{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})],yt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"coefficient",void 0),u([f({type:Ws,optional:!0})],yt.prototype,"otherPrimeInfos",void 0);class Js{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Js.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],Js.prototype,"publicExponent",void 0);var Ys;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Ys||(Ys={}));const He=Ys;/*! *****************************************************************************
|
|
75
|
+
`)}`:`${r} :`}}mc=Le,R.Constructed=mc,Le.NAME="CONSTRUCTED";class bc extends Me{fromBER(t,r,i){return r}toBER(t){return it}}bc.override="EndOfContentValueBlock";var wc;class Eo extends Ne{constructor(t={}){super(t,bc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}wc=Eo,R.EndOfContent=wc,Eo.NAME=Jr;var vc;class zt 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 n=new Uint8Array(i);n[0]=5,n[1]=0}return r&&r.write(i),i}onAsciiEncoding(){return`${this.constructor.NAME}`}}vc=zt,R.Null=vc,zt.NAME="NULL";class kc extends dt(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 n=P.toUint8Array(t);return vt(this,n,r,i)?(this.valueHexView=n.subarray(r,r+i),i>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,ac.call(this),this.blockLength=i,r+i):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}kc.NAME="BooleanValueBlock";var Cc;let Pi=class extends Ne{constructor(t={}){super(t,kc),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}`}};Cc=Pi,R.Boolean=Cc,Pi.NAME="BOOLEAN";class Sc extends dt(jt){constructor({isConstructed:t=!1,...r}={}){super(r),this.isConstructed=t}fromBER(t,r,i){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=jt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==uc)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(t,r,i),this.blockLength=i;return n}toBER(t,r){return this.isConstructed?jt.prototype.toBER.call(this,t,r):t?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}Sc.NAME="OctetStringValueBlock";var xc;let Gt=class np extends Ne{constructor({idBlock:t={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},Sc),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(t,r,i){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,i===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),r;if(!this.valueBlock.isConstructed){const s=(t instanceof ArrayBuffer?new Uint8Array(t):t).subarray(r,r+i);try{if(s.byteLength){const a=fr(s,0,s.byteLength);a.offset!==-1&&a.offset===i&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(t,r,i)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Le.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 np&&t.push(r.valueBlock.valueHexView);return P.concat(t)}};xc=Gt,R.OctetString=xc,Gt.NAME=uc;class Ac extends dt(jt){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 n=-1;if(this.isConstructed){if(n=jt.prototype.fromBER.call(this,t,r,i),n===-1)return n;for(const c of this.value){const l=c.constructor.NAME;if(l===Jr){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==dc)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const d=c.valueBlock;if(this.unusedBits>0&&d.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=d.unusedBits}return n}const s=P.toUint8Array(t);if(!vt(this,s,r,i))return-1;const a=s.subarray(r,r+i);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=fr(c,0,c.byteLength);l.offset!==-1&&l.offset===i-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,r+i}toBER(t,r){if(this.isConstructed)return jt.prototype.toBER.call(this,t,r);if(t)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return it;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}}}Ac.NAME="BitStringValueBlock";var Bc;let Wt=class extends Ne{constructor({idBlock:t={},lenBlock:r={},...i}={}){var n,s;(n=i.isConstructed)!==null&&n!==void 0||(i.isConstructed=!!(!((s=i.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:i.isConstructed,...t},lenBlock:{...r,isIndefiniteForm:!!i.isIndefiniteForm},...i},Ac),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 Le.prototype.onAsciiEncoding.call(this);{const t=[],r=this.valueBlock.valueHexView;for(const n of r)t.push(n.toString(2).padStart(8,"0"));const i=t.join("");return`${this.constructor.NAME} : ${i.substring(0,i.length-this.valueBlock.unusedBits)}`}}};Bc=Wt,R.BitString=Bc,Wt.NAME=dc;var Ic;function xp(e,t){const r=new Uint8Array([0]),i=new Uint8Array(e),n=new Uint8Array(t);let s=i.slice(0);const a=s.length-1,c=n.slice(0),l=c.length-1;let d=0;const y=l<a?a:l;let p=0;for(let I=y;I>=0;I--,p++){switch(!0){case p<c.length:d=s[a-p]+c[l-p]+r[0];break;default:d=s[a-p]+r[0]}switch(r[0]=d/10,!0){case p>=s.length:s=xo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=xo(r,s)),s}function Ec(e){if(e>=Wr.length)for(let t=Wr.length;t<=e;t++){const r=new Uint8Array([0]);let i=Wr[t-1].slice(0);for(let n=i.length-1;n>=0;n--){const s=new Uint8Array([(i[n]<<1)+r[0]]);r[0]=s[0]/10,i[n]=s[0]%10}r[0]>0&&(i=xo(r,i)),Wr.push(i)}return Wr[e]}function Ap(e,t){let r=0;const i=new Uint8Array(e),n=new Uint8Array(t),s=i.slice(0),a=s.length-1,c=n.slice(0),l=c.length-1;let d,y=0;for(let p=l;p>=0;p--,y++)switch(d=s[a-y]-c[l-y]-r,!0){case d<0:r=1,s[a-y]=d+10;break;default:r=0,s[a-y]=d}if(r>0)for(let p=a-l+1;p>=0;p--,y++)if(d=s[a-y]-r,d<0)r=1,s[a-y]=d+10;else{r=0,s[a-y]=d;break}return s.slice()}class No extends dt(Me){constructor({value:t,...r}={}){super(r),this._valueDec=0,r.valueHex&&this.setValueHex(),t!==void 0&&(this.valueDec=t)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=ac.call(this)))}set valueDec(t){this._valueDec=t,this.isHexOnly=!1,this.valueHexView=new Uint8Array(fp(t))}get valueDec(){return this._valueDec}fromDER(t,r,i,n=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):n!==0&&a.length<n&&(n-a.length>1&&(n=a.length+1),this.valueHexView=a.subarray(n-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 n=super.fromBER(t,r,i);return n===-1||this.setValueHex(),n}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,n;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){n=s[l];for(let d=0;d<8;d++){if((n&1)===1)switch(i){case t:r=Ap(Ec(i),r),a="-";break;default:r=xp(r,Ec(i))}i++,n>>=1}}for(let l=0;l<r.length;l++)r[l]&&(c=!0),c&&(a+=cc.charAt(r[l]));return c===!1&&(a+=cc.charAt(0)),a}}Ic=No,No.NAME="IntegerValueBlock",Object.defineProperty(Ic.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Nc;class ft extends Ne{constructor(t={}){super(t,No),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Di(),BigInt(this.valueBlock.toString())}static fromBigInt(t){Di();const r=BigInt(t),i=new Mi,n=r.toString(16).replace(/^-/,""),s=new Uint8Array(L.FromHex(n));if(r<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const d=BigInt(`0x${L.ToHex(c)}`)+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 ft({valueHex:i.final()})}convertToDER(){const t=new ft({valueHex:this.valueBlock.valueHexView});return t.valueBlock.toDER(),t}convertFromDER(){return new ft({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Nc=ft,R.Integer=Nc,ft.NAME="INTEGER";var Oc;class Ri extends ft{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}Oc=Ri,R.Enumerated=Oc,Ri.NAME="ENUMERATED";class Oo extends dt(Me){constructor({valueDec:t=-1,isFirstSid:r=!1,...i}={}){super(i),this.valueDec=t,this.isFirstSid=r}fromBER(t,r,i){if(!i)return r;const n=P.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}set valueBigInt(t){Di();let r=BigInt(t).toString(2);for(;r.length%7;)r="0"+r;const i=new Uint8Array(r.length/7);for(let n=0;n<i.length;n++)i[n]=parseInt(r.slice(n*7,n*7+7),2)+(n+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 n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=qt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",it;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[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}}}Oo.NAME="sidBlock";class _c extends Me{constructor({value:t=Ue,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new Oo;if(n=s.fromBER(t,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(t){const r=[];for(let i=0;i<this.value.length;i++){const n=this.value[i].toBER(t);if(n.byteLength===0)return this.error=this.value[i].error,it;r.push(n)}return Ao(r)}fromString(t){this.value=[];let r=0,i=0,n="",s=!1;do if(i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(n,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new Oo;if(n>Number.MAX_SAFE_INTEGER){Di();const c=BigInt(n);a.valueBigInt=c}else if(a.valueDec=parseInt(n,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(i!==-1)}toString(){let t="",r=!1;for(let i=0;i<this.value.length;i++){r=this.value[i].isHexOnly;let n=this.value[i].toString();i!==0&&(t=`${t}.`),r?(n=`{${n}}`,this.value[i].isFirstSid?t=`2.{${n} - 80}`:t+=n):t+=n}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}}_c.NAME="ObjectIdentifierValueBlock";var Tc;class Ui extends Ne{constructor(t={}){super(t,_c),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()}}}Tc=Ui,R.ObjectIdentifier=Tc,Ui.NAME="OBJECT IDENTIFIER";class _o extends dt(Kt){constructor({valueDec:t=0,...r}={}){super(r),this.valueDec=t}fromBER(t,r,i){if(i===0)return r;const n=P.toUint8Array(t);if(!vt(this,n,r,i))return-1;const s=n.subarray(r,r+i);this.valueHexView=new Uint8Array(i);for(let c=0;c<i&&(this.valueHexView[c]=s[c]&127,this.blockLength++,!!(s[c]&128));c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,s[this.blockLength-1]&128?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=dr(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),r+this.blockLength)}toBER(t){if(this.isHexOnly){if(t)return new ArrayBuffer(this.valueHexView.byteLength);const n=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=n[a]|128;return s[this.blockLength-1]=n[this.blockLength-1],s.buffer}const r=qt(this.valueDec,7);if(r.byteLength===0)return this.error="Error during encoding SID value",it;const i=new Uint8Array(r.byteLength);if(!t){const n=new Uint8Array(r),s=r.byteLength-1;for(let a=0;a<s;a++)i[a]=n[a]|128;i[s]=n[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}}}_o.NAME="relativeSidBlock";class Vc extends Me{constructor({value:t=Ue,...r}={}){super(r),this.value=[],t&&this.fromString(t)}fromBER(t,r,i){let n=r;for(;i>0;){const s=new _o;if(n=s.fromBER(t,n,i),n===-1)return this.blockLength=0,this.error=s.error,n;this.blockLength+=s.blockLength,i-=s.blockLength,this.value.push(s)}return n}toBER(t,r){const i=[];for(let n=0;n<this.value.length;n++){const s=this.value[n].toBER(t);if(s.byteLength===0)return this.error=this.value[n].error,it;i.push(s)}return Ao(i)}fromString(t){this.value=[];let r=0,i=0,n="";do{i=t.indexOf(".",r),i===-1?n=t.substring(r):n=t.substring(r,i),r=i+1;const s=new _o;if(s.valueDec=parseInt(n,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 n=this.value[i].toString();i!==0&&(t=`${t}.`),r&&(n=`{${n}}`),t+=n}return t}toJSON(){const t={...super.toJSON(),value:this.toString(),sidArray:[]};for(let r=0;r<this.value.length;r++)t.sidArray.push(this.value[r].toJSON());return t}}Vc.NAME="RelativeObjectIdentifierValueBlock";var jc;class To extends Ne{constructor(t={}){super(t,Vc),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(t){this.valueBlock.fromString(t)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}jc=To,R.RelativeObjectIdentifier=jc,To.NAME="RelativeObjectIdentifier";var Dc;class kt extends Le{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}Dc=kt,R.Sequence=Dc,kt.NAME="SEQUENCE";var Mc;let Ct=class extends Le{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};Mc=Ct,R.Set=Mc,Ct.NAME="SET";class $c extends dt(Me){constructor({...t}={}){super(t),this.isHexOnly=!0,this.value=Ue}toJSON(){return{...super.toJSON(),value:this.value}}}$c.NAME="StringValueBlock";class Pc extends $c{}Pc.NAME="SimpleStringValueBlock";class We extends Io{constructor({...t}={}){super(t,Pc)}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 n=0;n<r;n++)i[n]=t.charCodeAt(n);this.valueBlock.value=t}}We.NAME="SIMPLE STRING";class Rc extends We{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}}Rc.NAME="Utf8StringValueBlock";var Uc;class St extends Rc{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}Uc=St,R.Utf8String=Uc,St.NAME="UTF8String";class Lc extends We{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))}}Lc.NAME="BmpStringValueBlock";var Fc;class Li extends Lc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}Fc=Li,R.BmpString=Fc,Li.NAME="BMPString";class Hc extends We{fromBuffer(t){const r=ArrayBuffer.isView(t)?t.slice().buffer:t.slice(0),i=new Uint8Array(r);for(let n=0;n<i.length;n+=4)i[n]=i[n+3],i[n+1]=i[n+2],i[n+2]=0,i[n+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(r))}fromString(t){const r=t.length,i=this.valueBlock.valueHexView=new Uint8Array(r*4);for(let n=0;n<r;n++){const s=qt(t.charCodeAt(n),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)i[n*4+l+c]=a[l]}this.valueBlock.value=t}}Hc.NAME="UniversalStringValueBlock";var qc;class Fi extends Hc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}qc=Fi,R.UniversalString=qc,Fi.NAME="UniversalString";var Kc;class Hi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Kc=Hi,R.NumericString=Kc,Hi.NAME="NumericString";var zc;class qi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}zc=qi,R.PrintableString=zc,qi.NAME="PrintableString";var Gc;class Ki extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Gc=Ki,R.TeletexString=Gc,Ki.NAME="TeletexString";var Wc;class zi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}Wc=zi,R.VideotexString=Wc,zi.NAME="VideotexString";var Jc;class Gi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}Jc=Gi,R.IA5String=Jc,Gi.NAME="IA5String";var Yc;class Wi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}Yc=Wi,R.GraphicString=Yc,Wi.NAME="GraphicString";var Zc;class Zr extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}Zc=Zr,R.VisibleString=Zc,Zr.NAME="VisibleString";var Qc;class Ji extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}Qc=Ji,R.GeneralString=Qc,Ji.NAME="GeneralString";var Xc;class Yi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}Xc=Yi,R.CharacterString=Xc,Yi.NAME="CharacterString";var el;class Qr extends Zr{constructor({value:t,valueDate:r,...i}={}){if(super(i),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,t){this.fromString(t),this.valueBlock.valueHexView=new Uint8Array(t.length);for(let n=0;n<t.length;n++)this.valueBlock.valueHexView[n]=t.charCodeAt(n)}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 n=0;n<t.length;n++)i[n]=t.charCodeAt(n);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 n=parseInt(i[1],10);n>=50?this.year=1900+n:this.year=2e3+n,this.month=parseInt(i[2],10),this.day=parseInt(i[3],10),this.hour=parseInt(i[4],10),this.minute=parseInt(i[5],10),this.second=parseInt(i[6],10)}toString(t="iso"){if(t==="iso"){const r=new Array(7);return r[0]=Ge(this.year<2e3?this.year-1900:this.year-2e3,2),r[1]=Ge(this.month,2),r[2]=Ge(this.day,2),r[3]=Ge(this.hour,2),r[4]=Ge(this.minute,2),r[5]=Ge(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}}}el=Qr,R.UTCTime=el,Qr.NAME="UTCTime";var tl;class Zi extends Qr{constructor(t={}){var r;super(t),(r=this.millisecond)!==null&&r!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(t){super.fromDate(t),this.millisecond=t.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(t){let r=!1,i="",n="",s=0,a,c=0,l=0;if(t[t.length-1]==="Z")i=t.substring(0,t.length-1),r=!0;else{const p=new Number(t[t.length-1]);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");i=t}if(r){if(i.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(i.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let p=1,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(c=p*h,w.length===4){if(h=parseInt(w.substring(2,4),10),isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");l=p*h}}}let d=i.indexOf(".");if(d===-1&&(d=i.indexOf(",")),d!==-1){const p=new Number(`0${i.substring(d)}`);if(isNaN(p.valueOf()))throw new Error("Wrong input string for conversion");s=p.valueOf(),n=i.substring(0,d)}else n=i;switch(!0){case n.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,d!==-1)throw new Error("Wrong input string for conversion");break;case n.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,d!==-1){let 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 n.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 n.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(n);if(y===null)throw new Error("Wrong input string for conversion");for(let p=1;p<y.length;p++)switch(p){case 1:this.year=parseInt(y[p],10);break;case 2:this.month=parseInt(y[p],10);break;case 3:this.day=parseInt(y[p],10);break;case 4:this.hour=parseInt(y[p],10)+c;break;case 5:this.minute=parseInt(y[p],10)+l;break;case 6:this.second=parseInt(y[p],10);break;default:throw new Error("Wrong input string for conversion")}if(r===!1){const p=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=p.getUTCFullYear(),this.month=p.getUTCMonth(),this.day=p.getUTCDay(),this.hour=p.getUTCHours(),this.minute=p.getUTCMinutes(),this.second=p.getUTCSeconds(),this.millisecond=p.getUTCMilliseconds()}}toString(t="iso"){if(t==="iso"){const r=[];return r.push(Ge(this.year,4)),r.push(Ge(this.month,2)),r.push(Ge(this.day,2)),r.push(Ge(this.hour,2)),r.push(Ge(this.minute,2)),r.push(Ge(this.second,2)),this.millisecond!==0&&(r.push("."),r.push(Ge(this.millisecond,3))),r.push("Z"),r.join("")}return super.toString(t)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}tl=Zi,R.GeneralizedTime=tl,Zi.NAME="GeneralizedTime";var rl;class Vo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}rl=Vo,R.DATE=rl,Vo.NAME="DATE";var il;class jo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}il=jo,R.TimeOfDay=il,jo.NAME="TimeOfDay";var nl;class Do extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}nl=Do,R.DateTime=nl,Do.NAME="DateTime";var ol;class Mo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}ol=Mo,R.Duration=ol,Mo.NAME="Duration";var sl;class $o extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}sl=$o,R.TIME=sl,$o.NAME="TIME";class Jt{constructor({name:t=Ue,optional:r=!1}={}){this.name=t,this.optional=r}}class Po extends Jt{constructor({value:t=[],...r}={}){super(r),this.value=t}}class Qi extends Jt{constructor({value:t=new Jt,local:r=!1,...i}={}){super(i),this.value=t,this.local=r}}class Bp{constructor({data:t=$i}={}){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 n=r+i;return this.dataView=P.toUint8Array(t).subarray(r,n),n}toBER(t){return this.dataView.slice().buffer}}function Yt(e,t,r){if(r instanceof Po){for(let s=0;s<r.value.length;s++)if(Yt(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(Bo)&&(s.name=r.name),s}}if(r instanceof Jt)return r.hasOwnProperty(Bo)&&(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(!(yp in r))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(wp in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(vp 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(gp)===!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(mp)===!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(bp)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!(hp 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(!(lc in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=r.idBlock.valueHexView,a=t.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:e};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(e[r.name]=t)),r instanceof R.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=r.valueBlock.value.length;if(c>0&&r.valueBlock.value[0]instanceof Qi&&(c=t.valueBlock.value.length),c===0)return{verified:!0,result:e};if(t.valueBlock.value.length===0&&r.valueBlock.value.length!==0){let l=!0;for(let d=0;d<r.valueBlock.value.length;d++)l=l&&(r.valueBlock.value[d].optional||!1);return l?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let l=0;l<c;l++)if(l-s>=t.valueBlock.value.length){if(r.valueBlock.value[l].optional===!1){const d={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(delete e[r.name],d.name=r.name)),d}}else if(r.valueBlock.value[0]instanceof Qi){if(a=Yt(e,t.valueBlock.value[l],r.valueBlock.value[0].value),a.verified===!1)if(r.valueBlock.value[0].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&delete e[r.name]),a;if(Bo in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let d={};kp in r.valueBlock.value[0]&&r.valueBlock.value[0].local?d=t:d=e,typeof d[r.valueBlock.value[0].name]>"u"&&(d[r.valueBlock.value[0].name]=[]),d[r.valueBlock.value[0].name].push(t.valueBlock.value[l])}}else if(a=Yt(e,t.valueBlock.value[l-s],r.valueBlock.value[l]),a.verified===!1)if(r.valueBlock.value[l].optional)s++;else return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&delete e[r.name]),a;if(a.verified===!1){const l={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(delete e[r.name],l.name=r.name)),l}return{verified:!0,result:e}}if(r.primitiveSchema&&lc in t.valueBlock){const s=fr(t.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,Ue),r.name&&(delete e[r.name],a.name=r.name)),a}return Yt(e,s.result,r.primitiveSchema)}return{verified:!0,result:e}}function Ip(e,t){if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=fr(P.toUint8Array(e));return r.offset===-1?{verified:!1,result:r.result}:Yt(r.result,r.result,t)}const al=Object.freeze(Object.defineProperty({__proto__:null,Any:Jt,BaseBlock:Ne,BaseStringBlock:Io,BitString:Wt,BmpString:Li,Boolean:Pi,CharacterString:Yi,Choice:Po,Constructed:Le,DATE:Vo,DateTime:Do,Duration:Mo,EndOfContent:Eo,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:dt,IA5String:Gi,Integer:ft,Null:zt,NumericString:Hi,ObjectIdentifier:Ui,OctetString:Gt,Primitive:Yr,PrintableString:qi,RawData:Bp,RelativeObjectIdentifier:To,Repeated:Qi,Sequence:kt,Set:Ct,TIME:$o,TeletexString:Ki,TimeOfDay:jo,UTCTime:Qr,UniversalString:Fi,Utf8String:St,ValueBlock:Me,VideotexString:zi,ViewWriter:Mi,VisibleString:Zr,compareSchema:Yt,fromBER:pr,verifySchema:Ip},Symbol.toStringTag,{value:"Module"}));var T;(function(e){e[e.Sequence=0]="Sequence",e[e.Set=1]="Set",e[e.Choice=2]="Choice"})(T||(T={}));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 Xi{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 Wt))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 Wt({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(t){return new Wt({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 n=new Uint8Array(i);r=r.padStart(i<<3,"0").split("").reverse().join("");let s=0;for(;s<i;)n[s]=parseInt(r.slice(s<<3,(s<<3)+8),2),s++;this.value=n.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 Gt))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=t.valueBlock.valueHex,this}toASN(){return new Gt({valueHex:this.buffer})}toSchema(t){return new Gt({name:t})}}const Ep={fromASN:e=>e instanceof zt?null:e.valueBeforeDecodeView,toASN:e=>{if(e===null)return new zt;const t=pr(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Np={fromASN:e=>e.valueBlock.valueHexView.byteLength>=4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ft({value:+e})},Op={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new Ri({value:e})},he={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new ft({valueHex:e})},_p={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Wt({valueHex:e})},Tp={fromASN:e=>e.valueBlock.toString(),toASN:e=>new Ui({value:e})},Vp={fromASN:e=>e.valueBlock.value,toASN:e=>new Pi({value:e})},en={fromASN:e=>e.valueBlock.valueHexView,toASN:e=>new Gt({valueHex:e})},jp={fromASN:e=>new ae(e.getValue()),toASN:e=>e.toASN()};function Qe(e){return{fromASN:t=>t.valueBlock.value,toASN:t=>new e({value:t})}}const cl=Qe(St),Dp=Qe(Li),Mp=Qe(Fi),$p=Qe(Hi),Pp=Qe(qi),Rp=Qe(Ki),Up=Qe(zi),Lp=Qe(Gi),Fp=Qe(Wi),Hp=Qe(Zr),qp=Qe(Ji),Kp=Qe(Yi),zp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Gp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},Wp={fromASN:()=>null,toASN:()=>new zt};function Ro(e){switch(e){case m.Any:return Ep;case m.BitString:return _p;case m.BmpString:return Dp;case m.Boolean:return Vp;case m.CharacterString:return Kp;case m.Enumerated:return Op;case m.GeneralString:return qp;case m.GeneralizedTime:return Gp;case m.GraphicString:return Fp;case m.IA5String:return Lp;case m.Integer:return Np;case m.Null:return Wp;case m.NumericString:return $p;case m.ObjectIdentifier:return Tp;case m.OctetString:return en;case m.PrintableString:return Pp;case m.TeletexString:return Rp;case m.UTCTime:return zp;case m.UniversalString:return Mp;case m.Utf8String:return cl;case m.VideotexString:return Up;case m.VisibleString:return Hp;default:return null}}function xt(e){return typeof e=="function"&&e.prototype?e.prototype.toASN&&e.prototype.fromASN?!0:xt(e.prototype):!!(e&&typeof e=="object"&&"toASN"in e&&"fromASN"in e)}function ll(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:ll(r)}return!1}function Jp(e,t){if(!(e&&t)||e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),i=new Uint8Array(t);for(let n=0;n<e.byteLength;n++)if(r[n]!==i[n])return!1;return!0}class Yp{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:T.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),n=[];for(const s in i.items){const a=i.items[s],c=r?s:"";let l;if(typeof a.type=="number"){const y=m[a.type],p=al[y];if(!p)throw new Error(`Cannot get ASN1 class by name '${y}'`);l=new p({name:c})}else xt(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===T.Choice?l=new Jt({name:c}):(l=this.create(a.type,!1),l.name=c):l=new Jt({name:c});const d=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const y=a.repeated==="set"?Ct:kt;l=new y({name:"",value:[new Qi({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||xt(a.type)){const y=a.repeated?Le:Yr;n.push(new y({name:c,optional:d,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const y=!!a.repeated;let p=y?l:this.get(a.type,!0).schema;p="valueBlock"in p?p.valueBlock.value:p.value,n.push(new Le({name:y?"":c,optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:p}))}else n.push(new Le({optional:d,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=d,n.push(l)}switch(i.type){case T.Sequence:return new kt({value:n,name:""});case T.Set:return new Ct({value:n,name:""});case T.Choice:return new Po({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(t,r){return this.items.set(t,r),this}findParentSchema(t){const r=Object.getPrototypeOf(t);return r?this.items.get(r)||this.findParentSchema(r):null}}const Xe=new Yp,V=e=>t=>{let r;Xe.has(t)?r=Xe.get(t):(r=Xe.createDefault(t),Xe.set(t,r)),Object.assign(r,e)},f=e=>(t,r)=>{let i;Xe.has(t.constructor)?i=Xe.get(t.constructor):(i=Xe.createDefault(t.constructor),Xe.set(t.constructor,i));const n=Object.assign({},e);if(typeof n.type=="number"&&!n.converter){const s=Ro(e.type);if(!s)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);n.converter=s}i.items[r]=n};class ul extends Error{constructor(){super(...arguments),this.schemas=[]}}class Zp{static parse(t,r){const i=pr(t);if(i.result.error)throw new Error(i.result.error);return this.fromASN(i.result,r)}static fromASN(t,r){var i;try{if(xt(r))return new r().fromASN(t);const n=Xe.get(r);Xe.cache(r);let s=n.schema;if(t.constructor===Le&&n.type!==T.Choice){s=new Le({idBlock:{tagClass:3,tagNumber:t.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const l in n.items)delete t[l]}const a=Yt({},t,s);if(!a.verified)throw new ul(`Data does not match to ${r.name} ASN1 schema. ${a.result.error}`);const c=new r;if(ll(r)){if(!("value"in t.valueBlock&&Array.isArray(t.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const l=n.itemType;if(typeof l=="number"){const d=Ro(l);if(!d)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(t.valueBlock.value,y=>d.fromASN(y))}else return r.from(t.valueBlock.value,d=>this.fromASN(d,l))}for(const l in n.items){const d=a.result[l];if(!d)continue;const y=n.items[l],p=y.type;if(typeof p=="number"||xt(p)){const I=(i=y.converter)!==null&&i!==void 0?i:xt(p)?new p:null;if(!I)throw new Error("Converter is empty");if(y.repeated)if(y.implicit){const w=y.repeated==="sequence"?kt:Ct,h=new w;h.valueBlock=d.valueBlock;const g=pr(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;c[l]=Array.from(b,k=>I.fromASN(k))}else c[l]=Array.from(d,w=>I.fromASN(w));else{let w=d;if(y.implicit){let h;if(xt(p))h=new p().toSchema("");else{const g=m[p],b=al[g];if(!b)throw new Error(`Cannot get '${g}' class from asn1js module`);h=new b}h.valueBlock=w.valueBlock,w=pr(h.toBER(!1)).result}c[l]=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.");c[l]=Array.from(d,I=>this.fromASN(I,p))}else c[l]=this.fromASN(d,p)}return c}catch(n){throw n instanceof ul&&n.schemas.push(r.name),n}}}class Uo{static serialize(t){return t instanceof Ne?t.toBER(!1):this.toASN(t).toBER(!1)}static toASN(t){if(t&&typeof t=="object"&&xt(t))return t.toASN();if(!(t&&typeof t=="object"))throw new TypeError("Parameter 1 should be type of Object.");const r=t.constructor,i=Xe.get(r);Xe.cache(r);let n=[];if(i.itemType){if(!Array.isArray(t))throw new TypeError("Parameter 1 should be type of Array.");if(typeof i.itemType=="number"){const a=Ro(i.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);n=t.map(c=>a.toASN(c))}else n=t.map(a=>this.toAsnItem({type:i.itemType},"[]",r,a))}else for(const a in i.items){const c=i.items[a],l=t[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Jp(this.serialize(c.defaultValue),this.serialize(l)))continue;const d=Uo.toAsnItem(c,a,r,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||xt(c.type))){const y={};y.valueHex=d instanceof zt?d.valueBeforeDecodeView:d.valueBlock.toBER(),n.push(new Yr({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...y}))}else n.push(new Le({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:d.valueBlock.value}));else n.push(new Le({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[d]}));else c.repeated?n=n.concat(d):n.push(d)}let s;switch(i.type){case T.Sequence:s=new kt({value:n});break;case T.Set:s=new Ct({value:n});break;case T.Choice:if(!n[0])throw new Error(`Schema '${r.name}' has wrong data. Choice cannot be empty.`);s=n[0];break}return s}static toAsnItem(t,r,i,n){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(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(n,d=>a.toASN(d)),l=t.repeated==="sequence"?kt:Ct;s=new l({value:c})}else s=a.toASN(n)}else if(t.repeated){if(!Array.isArray(n))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(n,l=>this.toASN(l)),c=t.repeated==="sequence"?kt:Ct;s=new c({value:a})}else s=this.toASN(n);return s}}class le extends Array{constructor(t=[]){if(typeof t=="number")super(t);else{super();for(const r of t)this.push(r)}}}class G{static serialize(t){return Uo.serialize(t)}static parse(t,r){return Zp.parse(t,r)}static toString(t){const r=P.isBufferSource(t)?P.toArrayBuffer(t):G.serialize(t),i=pr(r);if(i.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${i.result.error}`);return i.result.toString()}}function u(e,t,r,i){var n=arguments.length,s=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(n<3?a(s):n>3?a(t,r,s):a(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s}typeof SuppressedError=="function"&&SuppressedError;var dl={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")},n=new RegExp("^0[0-7]+$","i"),s=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${r}\\.${r}\\.${r}\\.${r}(${a})?$`,"i")};function d(h,g){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let b=0,k=-1,B=(h.match(l.zoneIndex)||[])[0],E,S;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(k=h.indexOf(":",k+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(S=g-b,E=":";S--;)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 C=h.split(":"),A=[];for(let M=0;M<C.length;M++)A.push(parseInt(C[M],16));return A}(),{parts:g,zoneId:B}}function y(h,g,b,k){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,E;for(;k>0;){if(E=b-k,E<0&&(E=0),h[B]>>E!==g[B]>>E)return!1;k-=b,B+=1}return!0}function p(h){if(s.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.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,k;for(b=0;b<g.length;b++)if(k=g[b],!(0<=k&&k<=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 k;if(b===void 0&&(k=g,g=k[0],b=k[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 k={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,E,S;for(B=3;B>=0;B-=1)if(E=this.octets[B],E in k){if(S=k[E],b&&S!==0)return null;S!==8&&(b=!0),g+=S}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(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<4;)B.push(parseInt(b[E],10)|parseInt(k[E],10)^255),E++;return new this(B)}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,k,B,E;try{for(g=this.parseCIDR(h),k=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(k[b],10)&parseInt(E[b],10)),b++;return new this(B)}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 k=[this.parse(g[1]),b];return Object.defineProperty(k,"toString",{value:function(){return this.join("/")}}),k}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},w.IPv4.parser=function(h){let g,b,k;if(g=h.match(i.fourOctet))return function(){const B=g.slice(1,6),E=[];for(let S=0;S<B.length;S++)b=B[S],E.push(p(b));return E}();if(g=h.match(i.longValue)){if(k=p(g[1]),k>4294967295||k<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let E;for(E=0;E<=24;E+=8)B.push(k>>E&255);return B}().reverse()}else return(g=h.match(i.twoOctet))?function(){const B=g.slice(1,4),E=[];if(k=p(B[1]),k>16777215||k<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(k>>16&255),E.push(k>>8&255),E.push(k&255),E}():(g=h.match(i.threeOctet))?function(){const B=g.slice(1,5),E=[];if(k=p(B[2]),k>65535||k<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(p(B[1])),E.push(k>>8&255),E.push(k&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 k=Math.floor(h/8);for(;b<k;)g[b]=255,b++;return k<4&&(g[k]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},w.IPv6=function(){function h(g,b){let k,B;if(g.length===16)for(this.parts=[],k=0;k<=14;k+=2)this.parts.push(g[k]<<8|g[k+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(k=0;k<this.parts.length;k++)if(B=this.parts[k],!(0<=B&&B<=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 k;if(b===void 0&&(k=g,g=k[0],b=k[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 k={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 B,E;for(let S=7;S>=0;S-=1)if(B=this.parts[S],B in k){if(E=k[B],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=[],k=this.parts;for(let B=0;B<k.length;B++)g=k[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const k=[];for(let B=0;B<this.parts.length;B++)k.push(I(this.parts[B].toString(16),4));return k}).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],k=g[1];return new w.IPv4([b>>8,b&255,k>>8,k&255])},h.prototype.toNormalizedString=function(){const g=(function(){const k=[];for(let B=0;B<this.parts.length;B++)k.push(this.parts[B].toString(16));return k}).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 k=0,B=-1,E;for(;E=g.exec(b);)E[0].length>B&&(k=E.index,B=E[0].length);return B<0?b:`${b.substring(0,k)}::${b.substring(k+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),w.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),k=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<16;)B.push(parseInt(b[E],10)|parseInt(k[E],10)^255),E++;return new this(B)}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,k,B,E;try{for(g=this.parseCIDR(h),k=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(k[b],10)&parseInt(E[b],10)),b++;return new this(B)}catch(S){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${S})`)}},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,k;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return k=[this.parse(b[1]),g],Object.defineProperty(k,"toString",{value:function(){return this.join("/")}}),k;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},w.IPv6.parser=function(h){let g,b,k,B,E,S;if(k=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${k[1]}`);if(l.native.test(h))return d(h,8);if((k=h.match(l.transitional))&&(S=k[6]||"",g=d(k[1].slice(0,-1)+S,6),g.parts)){for(E=[parseInt(k[2]),parseInt(k[3]),parseInt(k[4]),parseInt(k[5])],b=0;b<E.length;b++)if(B=E[b],!(0<=B&&B<=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 k=Math.floor(h/8);for(;b<k;)g[b]=255,b++;return k<16&&(g[k]=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 k,B,E,S;b==null&&(b="unicast");for(B in g)if(Object.prototype.hasOwnProperty.call(g,B)){for(E=g[B],E[0]&&!(E[0]instanceof Array)&&(E=[E]),k=0;k<E.length;k++)if(S=E[k],h.kind()===S[0].kind()&&h.match.apply(h,S))return B}return b},e.exports?e.exports=w:t.ipaddr=w})(Co)})(dl);var fl=dl.exports;class pl{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((n,s)=>n+ +s,0);let i=t.slice(0,8).replace(/(.{2})/g,n=>`${parseInt(n,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 fl.fromByteArray(Array.from(r)).toString()}return this.decodeIP(L.ToHex(t))}static fromString(t){const r=fl.parse(t);return new Uint8Array(r.toByteArray()).buffer}}var Lo,Fo,Ho;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([V({type:T.Choice})],Oe);let hr=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})],hr.prototype,"ia5String",void 0),u([f({type:m.Any})],hr.prototype,"anyValue",void 0),hr=u([V({type:T.Choice})],hr);class Xr{constructor(t={}){this.type="",this.value=new hr,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Xr.prototype,"type",void 0),u([f({type:hr})],Xr.prototype,"value",void 0);let yr=Lo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Lo.prototype)}};yr=Lo=u([V({type:T.Set,itemType:Xr})],yr);let qo=Fo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fo.prototype)}};qo=Fo=u([V({type:T.Sequence,itemType:yr})],qo);let we=Ho=class extends qo{constructor(t){super(t),Object.setPrototypeOf(this,Ho.prototype)}};we=Ho=u([V({type:T.Sequence})],we);const Qp={fromASN:e=>pl.toString(en.fromASN(e)),toASN:e=>en.toASN(pl.fromString(e))};class ei{constructor(t={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ei.prototype,"typeId",void 0),u([f({type:m.Any,context:0})],ei.prototype,"value",void 0);class Ko{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Ko.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Ko.prototype,"partyName",void 0);let ie=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ei,context:0,implicit:!0})],ie.prototype,"otherName",void 0),u([f({type: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:Ko,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:Qp})],ie.prototype,"iPAddress",void 0),u([f({type:m.ObjectIdentifier,context:8,implicit:!0})],ie.prototype,"registeredID",void 0),ie=u([V({type:T.Choice})],ie);const gr="1.3.6.1.5.5.7.3",Zt="2.5.29";var zo;class tn{constructor(t={}){this.accessMethod="",this.accessLocation=new ie,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],tn.prototype,"accessMethod",void 0),u([f({type:ie})],tn.prototype,"accessLocation",void 0);let hl=zo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,zo.prototype)}};hl=zo=u([V({type:T.Sequence,itemType:tn})],hl);const Go=`${Zt}.35`;class Wo extends ae{}class Qt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Wo,context:0,optional:!0,implicit:!0})],Qt.prototype,"keyIdentifier",void 0),u([f({type:ie,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Qt.prototype,"authorityCertIssuer",void 0),u([f({type:m.Integer,context:2,optional:!0,implicit:!0,converter:he})],Qt.prototype,"authorityCertSerialNumber",void 0);const yl=`${Zt}.19`;class rn{constructor(t={}){this.cA=!1,Object.assign(this,t)}}u([f({type:m.Boolean,defaultValue:!1})],rn.prototype,"cA",void 0),u([f({type:m.Integer,optional:!0})],rn.prototype,"pathLenConstraint",void 0);var Jo;let $e=Jo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Jo.prototype)}};$e=Jo=u([V({type:T.Sequence,itemType:ie})],$e);var Yo;let gl=Yo=class extends $e{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};gl=Yo=u([V({type:T.Sequence})],gl);var Zo;const ml=`${Zt}.32`;let At=class{constructor(t={}){Object.assign(this,t)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};u([f({type:m.IA5String})],At.prototype,"ia5String",void 0),u([f({type:m.VisibleString})],At.prototype,"visibleString",void 0),u([f({type:m.BmpString})],At.prototype,"bmpString",void 0),u([f({type:m.Utf8String})],At.prototype,"utf8String",void 0),At=u([V({type:T.Choice})],At);class Qo{constructor(t={}){this.organization=new At,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:At})],Qo.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],Qo.prototype,"noticeNumbers",void 0);class Xo{constructor(t={}){Object.assign(this,t)}}u([f({type:Qo,optional:!0})],Xo.prototype,"noticeRef",void 0),u([f({type:At,optional:!0})],Xo.prototype,"explicitText",void 0);let nn=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.IA5String})],nn.prototype,"cPSuri",void 0),u([f({type:Xo})],nn.prototype,"userNotice",void 0),nn=u([V({type:T.Choice})],nn);class es{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],es.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],es.prototype,"qualifier",void 0);class on{constructor(t={}){this.policyIdentifier="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],on.prototype,"policyIdentifier",void 0),u([f({type:es,repeated:"sequence",optional:!0})],on.prototype,"policyQualifiers",void 0);let sn=Zo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Zo.prototype)}};sn=Zo=u([V({type:T.Sequence,itemType:on})],sn);let an=class{constructor(t=0){this.value=t}};u([f({type:m.Integer})],an.prototype,"value",void 0),an=u([V({type:T.Choice})],an);let bl=class extends an{};bl=u([V({type:T.Choice})],bl);var ts,nt;(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"})(nt||(nt={}));class wl extends Xi{toJSON(){const t=[],r=this.toNumber();return r&nt.aACompromise&&t.push("aACompromise"),r&nt.affiliationChanged&&t.push("affiliationChanged"),r&nt.cACompromise&&t.push("cACompromise"),r&nt.certificateHold&&t.push("certificateHold"),r&nt.cessationOfOperation&&t.push("cessationOfOperation"),r&nt.keyCompromise&&t.push("keyCompromise"),r&nt.privilegeWithdrawn&&t.push("privilegeWithdrawn"),r&nt.superseded&&t.push("superseded"),r&nt.unused&&t.push("unused"),t}toString(){return`[${this.toJSON().join(", ")}]`}}let mr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,repeated:"sequence",implicit:!0})],mr.prototype,"fullName",void 0),u([f({type:yr,context:1,implicit:!0})],mr.prototype,"nameRelativeToCRLIssuer",void 0),mr=u([V({type:T.Choice})],mr);class ti{constructor(t={}){Object.assign(this,t)}}u([f({type:mr,context:0,optional:!0})],ti.prototype,"distributionPoint",void 0),u([f({type:wl,context:1,optional:!0,implicit:!0})],ti.prototype,"reasons",void 0),u([f({type:ie,context:2,optional:!0,repeated:"sequence",implicit:!0})],ti.prototype,"cRLIssuer",void 0);let rs=ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ts.prototype)}};rs=ts=u([V({type:T.Sequence,itemType:ti})],rs);var is;let vl=is=class extends rs{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};vl=is=u([V({type:T.Sequence,itemType:ti})],vl);class je{constructor(t={}){this.onlyContainsUserCerts=je.ONLY,this.onlyContainsCACerts=je.ONLY,this.indirectCRL=je.ONLY,this.onlyContainsAttributeCerts=je.ONLY,Object.assign(this,t)}}je.ONLY=!1,u([f({type:mr,context:0,optional:!0})],je.prototype,"distributionPoint",void 0),u([f({type:m.Boolean,context:1,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsUserCerts",void 0),u([f({type:m.Boolean,context:2,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsCACerts",void 0),u([f({type:wl,context:3,optional:!0,implicit:!0})],je.prototype,"onlySomeReasons",void 0),u([f({type:m.Boolean,context:4,defaultValue:je.ONLY,implicit:!0})],je.prototype,"indirectCRL",void 0),u([f({type:m.Boolean,context:5,defaultValue:je.ONLY,implicit:!0})],je.prototype,"onlyContainsAttributeCerts",void 0);var ri;(function(e){e[e.unspecified=0]="unspecified",e[e.keyCompromise=1]="keyCompromise",e[e.cACompromise=2]="cACompromise",e[e.affiliationChanged=3]="affiliationChanged",e[e.superseded=4]="superseded",e[e.cessationOfOperation=5]="cessationOfOperation",e[e.certificateHold=6]="certificateHold",e[e.removeFromCRL=8]="removeFromCRL",e[e.privilegeWithdrawn=9]="privilegeWithdrawn",e[e.aACompromise=10]="aACompromise"})(ri||(ri={}));let ns=class{constructor(t=ri.unspecified){this.reason=ri.unspecified,this.reason=t}toJSON(){return ri[this.reason]}toString(){return this.toJSON()}};u([f({type:m.Enumerated})],ns.prototype,"reason",void 0),ns=u([V({type:T.Choice})],ns);var os;const kl=`${Zt}.37`;let cn=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};cn=os=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],cn);const Xp=`${gr}.1`,eh=`${gr}.2`,th=`${gr}.3`,rh=`${gr}.4`,ih=`${gr}.8`,nh=`${gr}.9`;let ss=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],ss.prototype,"value",void 0),ss=u([V({type:T.Choice})],ss);let as=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],as.prototype,"value",void 0),as=u([V({type:T.Choice})],as);var cs;let Cl=cs=class extends $e{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};Cl=cs=u([V({type:T.Sequence})],Cl);const Sl=`${Zt}.15`;var ot;(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"})(ot||(ot={}));class ls extends Xi{toJSON(){const t=this.toNumber(),r=[];return t&ot.cRLSign&&r.push("crlSign"),t&ot.dataEncipherment&&r.push("dataEncipherment"),t&ot.decipherOnly&&r.push("decipherOnly"),t&ot.digitalSignature&&r.push("digitalSignature"),t&ot.encipherOnly&&r.push("encipherOnly"),t&ot.keyAgreement&&r.push("keyAgreement"),t&ot.keyCertSign&&r.push("keyCertSign"),t&ot.keyEncipherment&&r.push("keyEncipherment"),t&ot.nonRepudiation&&r.push("nonRepudiation"),r}toString(){return`[${this.toJSON().join(", ")}]`}}var us;class ln{constructor(t={}){this.base=new ie,this.minimum=0,Object.assign(this,t)}}u([f({type:ie})],ln.prototype,"base",void 0),u([f({type:m.Integer,context:0,defaultValue:0,implicit:!0})],ln.prototype,"minimum",void 0),u([f({type:m.Integer,context:1,optional:!0,implicit:!0})],ln.prototype,"maximum",void 0);let un=us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};un=us=u([V({type:T.Sequence,itemType:ln})],un);class xl{constructor(t={}){Object.assign(this,t)}}u([f({type:un,context:0,optional:!0,implicit:!0})],xl.prototype,"permittedSubtrees",void 0),u([f({type:un,context:1,optional:!0,implicit:!0})],xl.prototype,"excludedSubtrees",void 0);class Al{constructor(t={}){Object.assign(this,t)}}u([f({type:m.Integer,context:0,implicit:!0,optional:!0,converter:he})],Al.prototype,"requireExplicitPolicy",void 0),u([f({type:m.Integer,context:1,implicit:!0,optional:!0,converter:he})],Al.prototype,"inhibitPolicyMapping",void 0);var ds;class fs{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],fs.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],fs.prototype,"subjectDomainPolicy",void 0);let Bl=ds=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ds.prototype)}};Bl=ds=u([V({type:T.Sequence,itemType:fs})],Bl);var ps;const Il=`${Zt}.17`;let hs=ps=class extends $e{constructor(t){super(t),Object.setPrototypeOf(this,ps.prototype)}};hs=ps=u([V({type:T.Sequence})],hs);let Bt=class{constructor(t={}){this.type="",this.values=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Bt.prototype,"type",void 0),u([f({type:m.Any,repeated:"set"})],Bt.prototype,"values",void 0);var ys;let El=ys=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};El=ys=u([V({type:T.Sequence,itemType:Bt})],El);const Nl=`${Zt}.14`;class Dt extends Wo{}class Ol{constructor(t={}){Object.assign(this,t)}}u([f({type:m.GeneralizedTime,context:0,implicit:!0,optional:!0})],Ol.prototype,"notBefore",void 0),u([f({type:m.GeneralizedTime,context:1,implicit:!0,optional:!0})],Ol.prototype,"notAfter",void 0);var ii;(function(e){e[e.keyUpdateAllowed=1]="keyUpdateAllowed",e[e.newExtensions=2]="newExtensions",e[e.pKIXCertificate=4]="pKIXCertificate"})(ii||(ii={}));class _l extends Xi{toJSON(){const t=[],r=this.toNumber();return r&ii.pKIXCertificate&&t.push("pKIXCertificate"),r&ii.newExtensions&&t.push("newExtensions"),r&ii.keyUpdateAllowed&&t.push("keyUpdateAllowed"),t}toString(){return`[${this.toJSON().join(", ")}]`}}class Tl{constructor(t={}){this.entrustVers="",this.entrustInfoFlags=new _l,Object.assign(this,t)}}u([f({type:m.GeneralString})],Tl.prototype,"entrustVers",void 0),u([f({type:_l})],Tl.prototype,"entrustInfoFlags",void 0);var gs;let Vl=gs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,gs.prototype)}};Vl=gs=u([V({type:T.Sequence,itemType:tn})],Vl);class H{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof H&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&sc(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 It{constructor(t={}){this.algorithm=new H,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],It.prototype,"algorithm",void 0),u([f({type:m.BitString})],It.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([V({type:T.Choice})],_e);class dn{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})],dn.prototype,"notBefore",void 0),u([f({type:_e})],dn.prototype,"notAfter",void 0);var ms;let st=class op{constructor(t={}){this.extnID="",this.critical=op.CRITICAL,this.extnValue=new ae,Object.assign(this,t)}};st.CRITICAL=!1,u([f({type:m.ObjectIdentifier})],st.prototype,"extnID",void 0),u([f({type:m.Boolean,defaultValue:st.CRITICAL})],st.prototype,"critical",void 0),u([f({type:ae})],st.prototype,"extnValue",void 0);let Xt=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};Xt=ms=u([V({type:T.Sequence,itemType:st})],Xt);var br;(function(e){e[e.v1=0]="v1",e[e.v2=1]="v2",e[e.v3=2]="v3"})(br||(br={}));class et{constructor(t={}){this.version=br.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new H,this.issuer=new we,this.validity=new dn,this.subject=new we,this.subjectPublicKeyInfo=new It,Object.assign(this,t)}}u([f({type:m.Integer,context:0,defaultValue:br.v1})],et.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],et.prototype,"serialNumber",void 0),u([f({type:H})],et.prototype,"signature",void 0),u([f({type:we})],et.prototype,"issuer",void 0),u([f({type:dn})],et.prototype,"validity",void 0),u([f({type:we})],et.prototype,"subject",void 0),u([f({type:It})],et.prototype,"subjectPublicKeyInfo",void 0),u([f({type:m.BitString,context:1,implicit:!0,optional:!0})],et.prototype,"issuerUniqueID",void 0),u([f({type:m.BitString,context:2,implicit:!0,optional:!0})],et.prototype,"subjectUniqueID",void 0),u([f({type:Xt,context:3,optional:!0})],et.prototype,"extensions",void 0);class wr{constructor(t={}){this.tbsCertificate=new et,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:H})],wr.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],wr.prototype,"signatureValue",void 0);class fn{constructor(t={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new _e,Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],fn.prototype,"userCertificate",void 0),u([f({type:_e})],fn.prototype,"revocationDate",void 0),u([f({type:st,optional:!0,repeated:"sequence"})],fn.prototype,"crlEntryExtensions",void 0);class Et{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})],Et.prototype,"version",void 0),u([f({type:H})],Et.prototype,"signature",void 0),u([f({type:we})],Et.prototype,"issuer",void 0),u([f({type:_e})],Et.prototype,"thisUpdate",void 0),u([f({type:_e,optional:!0})],Et.prototype,"nextUpdate",void 0),u([f({type:fn,repeated:"sequence",optional:!0})],Et.prototype,"revokedCertificates",void 0),u([f({type:st,optional:!0,context:0,repeated:"sequence"})],Et.prototype,"crlExtensions",void 0);let bs=class{constructor(t={}){this.tbsCertList=new Et,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Et})],bs.prototype,"tbsCertList",void 0),u([f({type:H})],bs.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],bs.prototype,"signature",void 0);class vr{constructor(t={}){this.issuer=new we,this.serialNumber=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:we})],vr.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],vr.prototype,"serialNumber",void 0);let kr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Dt,context:0,implicit:!0})],kr.prototype,"subjectKeyIdentifier",void 0),u([f({type:vr})],kr.prototype,"issuerAndSerialNumber",void 0),kr=u([V({type:T.Choice})],kr);var Nt;(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"})(Nt||(Nt={}));let ni=class extends H{};ni=u([V({type:T.Sequence})],ni);let pn=class extends H{};pn=u([V({type:T.Sequence})],pn);let pt=class extends H{};pt=u([V({type:T.Sequence})],pt);let hn=class extends H{};hn=u([V({type:T.Sequence})],hn);let jl=class extends H{};jl=u([V({type:T.Sequence})],jl);let ws=class extends H{};ws=u([V({type:T.Sequence})],ws);let Cr=class{constructor(t={}){this.attrType="",this.attrValues=[],Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],Cr.prototype,"attrType",void 0),u([f({type:m.Any,repeated:"set"})],Cr.prototype,"attrValues",void 0);var vs;class ht{constructor(t={}){this.version=Nt.v0,this.sid=new kr,this.digestAlgorithm=new ni,this.signatureAlgorithm=new pn,this.signature=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],ht.prototype,"version",void 0),u([f({type:kr})],ht.prototype,"sid",void 0),u([f({type:ni})],ht.prototype,"digestAlgorithm",void 0),u([f({type:Cr,repeated:"set",context:0,implicit:!0,optional:!0})],ht.prototype,"signedAttrs",void 0),u([f({type:pn})],ht.prototype,"signatureAlgorithm",void 0),u([f({type:ae})],ht.prototype,"signature",void 0),u([f({type:Cr,repeated:"set",context:1,implicit:!0,optional:!0})],ht.prototype,"unsignedAttrs",void 0);let yn=vs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,vs.prototype)}};yn=vs=u([V({type:T.Set,itemType:ht})],yn);let Dl=class extends _e{};Dl=u([V({type:T.Choice})],Dl);let Ml=class extends ht{};Ml=u([V({type:T.Sequence})],Ml);class ks{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],ks.prototype,"acIssuer",void 0),u([f({type:m.Integer})],ks.prototype,"acSerial",void 0),u([f({type:Bt,repeated:"sequence"})],ks.prototype,"attrs",void 0);var Cs;let gn=Cs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Cs.prototype)}};gn=Cs=u([V({type:T.Sequence,itemType:m.ObjectIdentifier})],gn);class mn{constructor(t={}){this.permitUnSpecified=!0,Object.assign(this,t)}}u([f({type:m.Integer,optional:!0})],mn.prototype,"pathLenConstraint",void 0),u([f({type:gn,implicit:!0,context:0,optional:!0})],mn.prototype,"permittedAttrs",void 0),u([f({type:gn,implicit:!0,context:1,optional:!0})],mn.prototype,"excludedAttrs",void 0),u([f({type:m.Boolean,defaultValue:!0})],mn.prototype,"permitUnSpecified",void 0);class er{constructor(t={}){this.issuer=new $e,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:$e})],er.prototype,"issuer",void 0),u([f({type:m.Integer,converter:he})],er.prototype,"serial",void 0),u([f({type:m.BitString,optional:!0})],er.prototype,"issuerUID",void 0);var Ss;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(Ss||(Ss={}));class tr{constructor(t={}){this.digestedObjectType=Ss.publicKey,this.digestAlgorithm=new H,this.objectDigest=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Enumerated})],tr.prototype,"digestedObjectType",void 0),u([f({type:m.ObjectIdentifier,optional:!0})],tr.prototype,"otherObjectTypeID",void 0),u([f({type:H})],tr.prototype,"digestAlgorithm",void 0),u([f({type:m.BitString})],tr.prototype,"objectDigest",void 0);class bn{constructor(t={}){Object.assign(this,t)}}u([f({type:$e,optional:!0})],bn.prototype,"issuerName",void 0),u([f({type:er,context:0,implicit:!0,optional:!0})],bn.prototype,"baseCertificateID",void 0),u([f({type:tr,context:1,implicit:!0,optional:!0})],bn.prototype,"objectDigestInfo",void 0);let Sr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,repeated:"sequence"})],Sr.prototype,"v1Form",void 0),u([f({type:bn,context:0,implicit:!0})],Sr.prototype,"v2Form",void 0),Sr=u([V({type:T.Choice})],Sr);class wn{constructor(t={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,t)}}u([f({type:m.GeneralizedTime})],wn.prototype,"notBeforeTime",void 0),u([f({type:m.GeneralizedTime})],wn.prototype,"notAfterTime",void 0);class oi{constructor(t={}){Object.assign(this,t)}}u([f({type:er,implicit:!0,context:0,optional:!0})],oi.prototype,"baseCertificateID",void 0),u([f({type:$e,implicit:!0,context:1,optional:!0})],oi.prototype,"entityName",void 0),u([f({type:tr,implicit:!0,context:2,optional:!0})],oi.prototype,"objectDigestInfo",void 0);var xs;(function(e){e[e.v2=1]="v2"})(xs||(xs={}));class at{constructor(t={}){this.version=xs.v2,this.holder=new oi,this.issuer=new Sr,this.signature=new H,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new wn,this.attributes=[],Object.assign(this,t)}}u([f({type:m.Integer})],at.prototype,"version",void 0),u([f({type:oi})],at.prototype,"holder",void 0),u([f({type:Sr})],at.prototype,"issuer",void 0),u([f({type:H})],at.prototype,"signature",void 0),u([f({type:m.Integer,converter:he})],at.prototype,"serialNumber",void 0),u([f({type:wn})],at.prototype,"attrCertValidityPeriod",void 0),u([f({type:Bt,repeated:"sequence"})],at.prototype,"attributes",void 0),u([f({type:m.BitString,optional:!0})],at.prototype,"issuerUniqueID",void 0),u([f({type:Xt,optional:!0})],at.prototype,"extensions",void 0);class vn{constructor(t={}){this.acinfo=new at,this.signatureAlgorithm=new H,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:at})],vn.prototype,"acinfo",void 0),u([f({type:H})],vn.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vn.prototype,"signatureValue",void 0);var kn;(function(e){e[e.unmarked=1]="unmarked",e[e.unclassified=2]="unclassified",e[e.restricted=4]="restricted",e[e.confidential=8]="confidential",e[e.secret=16]="secret",e[e.topSecret=32]="topSecret"})(kn||(kn={}));class As extends Xi{}class Bs{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],Bs.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],Bs.prototype,"value",void 0);class Is{constructor(t={}){this.policyId="",this.classList=new As(kn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Is.prototype,"policyId",void 0),u([f({type:As,defaultValue:new As(kn.unclassified)})],Is.prototype,"classList",void 0),u([f({type:Bs,repeated:"set"})],Is.prototype,"securityCategories",void 0);class Cn{constructor(t={}){Object.assign(this,t)}}u([f({type:ae})],Cn.prototype,"cotets",void 0),u([f({type:m.ObjectIdentifier})],Cn.prototype,"oid",void 0),u([f({type:m.Utf8String})],Cn.prototype,"string",void 0);class $l{constructor(t={}){this.values=[],Object.assign(this,t)}}u([f({type:$e,implicit:!0,context:0,optional:!0})],$l.prototype,"policyAuthority",void 0),u([f({type:Cn,repeated:"sequence"})],$l.prototype,"values",void 0);var Es;class Sn{constructor(t={}){this.targetCertificate=new er,Object.assign(this,t)}}u([f({type:er})],Sn.prototype,"targetCertificate",void 0),u([f({type:ie,optional:!0})],Sn.prototype,"targetName",void 0),u([f({type:tr,optional:!0})],Sn.prototype,"certDigestInfo",void 0);let xr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ie,context:0,implicit:!0})],xr.prototype,"targetName",void 0),u([f({type:ie,context:1,implicit:!0})],xr.prototype,"targetGroup",void 0),u([f({type:Sn,context:2,implicit:!0})],xr.prototype,"targetCert",void 0),xr=u([V({type:T.Choice})],xr);let Ns=Es=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Es.prototype)}};Ns=Es=u([V({type:T.Sequence,itemType:xr})],Ns);var Os;let Pl=Os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Os.prototype)}};Pl=Os=u([V({type:T.Sequence,itemType:Ns})],Pl);class Rl{constructor(t={}){Object.assign(this,t)}}u([f({type:$e,implicit:!0,context:0,optional:!0})],Rl.prototype,"roleAuthority",void 0),u([f({type:ie,implicit:!0,context:1})],Rl.prototype,"roleName",void 0);class _s{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],_s.prototype,"service",void 0),u([f({type:ie})],_s.prototype,"ident",void 0),u([f({type:ae,optional:!0})],_s.prototype,"authInfo",void 0);var Ts;class Vs{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Vs.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Vs.prototype,"otherCert",void 0);let Ar=class{constructor(t={}){Object.assign(this,t)}};u([f({type:wr})],Ar.prototype,"certificate",void 0),u([f({type:vn,context:2,implicit:!0})],Ar.prototype,"v2AttrCert",void 0),u([f({type:Vs,context:3,implicit:!0})],Ar.prototype,"other",void 0),Ar=u([V({type:T.Choice})],Ar);let xn=Ts=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ts.prototype)}};xn=Ts=u([V({type:T.Set,itemType:Ar})],xn);class Br{constructor(t={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Br.prototype,"contentType",void 0),u([f({type:m.Any,context:0})],Br.prototype,"content",void 0);let si=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae})],si.prototype,"single",void 0),u([f({type:m.Any})],si.prototype,"any",void 0),si=u([V({type:T.Choice})],si);class An{constructor(t={}){this.eContentType="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],An.prototype,"eContentType",void 0),u([f({type:si,context:0,optional:!0})],An.prototype,"eContent",void 0);let ai=class{constructor(t={}){Object.assign(this,t)}};u([f({type:ae,context:0,implicit:!0,optional:!0})],ai.prototype,"value",void 0),u([f({type:ae,converter:jp,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ai.prototype,"constructedValue",void 0),ai=u([V({type:T.Choice})],ai);class ci{constructor(t={}){this.contentType="",this.contentEncryptionAlgorithm=new hn,Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ci.prototype,"contentType",void 0),u([f({type:hn})],ci.prototype,"contentEncryptionAlgorithm",void 0),u([f({type:ai,optional:!0})],ci.prototype,"encryptedContent",void 0);class Bn{constructor(t={}){this.keyAttrId="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Bn.prototype,"keyAttrId",void 0),u([f({type:m.Any,optional:!0})],Bn.prototype,"keyAttr",void 0);var js;class In{constructor(t={}){this.subjectKeyIdentifier=new Dt,Object.assign(this,t)}}u([f({type:Dt})],In.prototype,"subjectKeyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],In.prototype,"date",void 0),u([f({type:Bn,optional:!0})],In.prototype,"other",void 0);let Ir=class{constructor(t={}){Object.assign(this,t)}};u([f({type:In,context:0,implicit:!0,optional:!0})],Ir.prototype,"rKeyId",void 0),u([f({type:vr,optional:!0})],Ir.prototype,"issuerAndSerialNumber",void 0),Ir=u([V({type:T.Choice})],Ir);class Ds{constructor(t={}){this.rid=new Ir,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Ir})],Ds.prototype,"rid",void 0),u([f({type:ae})],Ds.prototype,"encryptedKey",void 0);let En=js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};En=js=u([V({type:T.Sequence,itemType:Ds})],En);class Ms{constructor(t={}){this.algorithm=new H,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:H})],Ms.prototype,"algorithm",void 0),u([f({type:m.BitString})],Ms.prototype,"publicKey",void 0);let rr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Dt,context:0,implicit:!0,optional:!0})],rr.prototype,"subjectKeyIdentifier",void 0),u([f({type:Ms,context:1,implicit:!0,optional:!0})],rr.prototype,"originatorKey",void 0),u([f({type:vr,optional:!0})],rr.prototype,"issuerAndSerialNumber",void 0),rr=u([V({type:T.Choice})],rr);class Er{constructor(t={}){this.version=Nt.v3,this.originator=new rr,this.keyEncryptionAlgorithm=new pt,this.recipientEncryptedKeys=new En,Object.assign(this,t)}}u([f({type:m.Integer})],Er.prototype,"version",void 0),u([f({type:rr,context:0})],Er.prototype,"originator",void 0),u([f({type:ae,context:1,optional:!0})],Er.prototype,"ukm",void 0),u([f({type:pt})],Er.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:En})],Er.prototype,"recipientEncryptedKeys",void 0);let Nr=class{constructor(t={}){Object.assign(this,t)}};u([f({type:Dt,context:0,implicit:!0})],Nr.prototype,"subjectKeyIdentifier",void 0),u([f({type:vr})],Nr.prototype,"issuerAndSerialNumber",void 0),Nr=u([V({type:T.Choice})],Nr);class li{constructor(t={}){this.version=Nt.v0,this.rid=new Nr,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],li.prototype,"version",void 0),u([f({type:Nr})],li.prototype,"rid",void 0),u([f({type:pt})],li.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],li.prototype,"encryptedKey",void 0);class ui{constructor(t={}){this.keyIdentifier=new ae,Object.assign(this,t)}}u([f({type:ae})],ui.prototype,"keyIdentifier",void 0),u([f({type:m.GeneralizedTime,optional:!0})],ui.prototype,"date",void 0),u([f({type:Bn,optional:!0})],ui.prototype,"other",void 0);class di{constructor(t={}){this.version=Nt.v4,this.kekid=new ui,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],di.prototype,"version",void 0),u([f({type:ui})],di.prototype,"kekid",void 0),u([f({type:pt})],di.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],di.prototype,"encryptedKey",void 0);class fi{constructor(t={}){this.version=Nt.v0,this.keyEncryptionAlgorithm=new pt,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],fi.prototype,"version",void 0),u([f({type:ws,context:0,optional:!0})],fi.prototype,"keyDerivationAlgorithm",void 0),u([f({type:pt})],fi.prototype,"keyEncryptionAlgorithm",void 0),u([f({type:ae})],fi.prototype,"encryptedKey",void 0);class $s{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],$s.prototype,"oriType",void 0),u([f({type:m.Any})],$s.prototype,"oriValue",void 0);let Mt=class{constructor(t={}){Object.assign(this,t)}};u([f({type:li,optional:!0})],Mt.prototype,"ktri",void 0),u([f({type:Er,context:1,implicit:!0,optional:!0})],Mt.prototype,"kari",void 0),u([f({type:di,context:2,implicit:!0,optional:!0})],Mt.prototype,"kekri",void 0),u([f({type:fi,context:3,implicit:!0,optional:!0})],Mt.prototype,"pwri",void 0),u([f({type:$s,context:4,implicit:!0,optional:!0})],Mt.prototype,"ori",void 0),Mt=u([V({type:T.Choice})],Mt);var Ps;let Nn=Ps=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};Nn=Ps=u([V({type:T.Set,itemType:Mt})],Nn);var Rs;class On{constructor(t={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],On.prototype,"otherRevInfoFormat",void 0),u([f({type:m.Any})],On.prototype,"otherRevInfo",void 0);let pi=class{constructor(t={}){this.other=new On,Object.assign(this,t)}};u([f({type:On,context:1,implicit:!0})],pi.prototype,"other",void 0),pi=u([V({type:T.Choice})],pi);let Us=Rs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};Us=Rs=u([V({type:T.Set,itemType:pi})],Us);class Ls{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],Ls.prototype,"certs",void 0),u([f({type:Us,context:1,implicit:!0,optional:!0})],Ls.prototype,"crls",void 0);var Fs;let Hs=Fs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Fs.prototype)}};Hs=Fs=u([V({type:T.Set,itemType:Cr})],Hs);class hi{constructor(t={}){this.version=Nt.v0,this.recipientInfos=new Nn,this.encryptedContentInfo=new ci,Object.assign(this,t)}}u([f({type:m.Integer})],hi.prototype,"version",void 0),u([f({type:Ls,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:Hs,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const oh="1.2.840.113549.1.7.2";var qs;let _n=qs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,qs.prototype)}};_n=qs=u([V({type:T.Set,itemType:ni})],_n);class Or{constructor(t={}){this.version=Nt.v0,this.digestAlgorithms=new _n,this.encapContentInfo=new An,this.signerInfos=new yn,Object.assign(this,t)}}u([f({type:m.Integer})],Or.prototype,"version",void 0),u([f({type:_n})],Or.prototype,"digestAlgorithms",void 0),u([f({type:An})],Or.prototype,"encapContentInfo",void 0),u([f({type:xn,context:0,implicit:!0,optional:!0})],Or.prototype,"certificates",void 0),u([f({type:pi,context:1,implicit:!0,optional:!0})],Or.prototype,"crls",void 0),u([f({type:yn})],Or.prototype,"signerInfos",void 0);const yi="1.2.840.10045.2.1",Ks="1.2.840.10045.4.1",Ul="1.2.840.10045.4.3.1",zs="1.2.840.10045.4.3.2",Gs="1.2.840.10045.4.3.3",Ws="1.2.840.10045.4.3.4",Ll="1.2.840.10045.3.1.7",Fl="1.3.132.0.34",Hl="1.3.132.0.35";function gi(e){return new H({algorithm:e})}const sh=gi(Ks);gi(Ul);const ah=gi(zs),ch=gi(Gs),lh=gi(Ws);let _r=class{constructor(t={}){Object.assign(this,t)}};u([f({type:m.ObjectIdentifier})],_r.prototype,"namedCurve",void 0),_r=u([V({type:T.Choice})],_r);class Tn{constructor(t={}){this.version=1,this.privateKey=new ae,Object.assign(this,t)}}u([f({type:m.Integer})],Tn.prototype,"version",void 0),u([f({type:ae})],Tn.prototype,"privateKey",void 0),u([f({type:_r,context:0,optional:!0})],Tn.prototype,"parameters",void 0),u([f({type:m.BitString,context:1,optional:!0})],Tn.prototype,"publicKey",void 0);class Vn{constructor(t={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Vn.prototype,"r",void 0),u([f({type:m.Integer,converter:he})],Vn.prototype,"s",void 0);const Fe="1.2.840.113549.1.1",Tr=`${Fe}.1`,uh=`${Fe}.7`,dh=`${Fe}.9`,fh=`${Fe}.10`,ph=`${Fe}.2`,hh=`${Fe}.4`,jn=`${Fe}.5`,yh=`${Fe}.14`,Js=`${Fe}.11`,Dn=`${Fe}.12`,Mn=`${Fe}.13`,ql=`${Fe}.15`,Kl=`${Fe}.16`,zl="1.3.14.3.2.26",Gl="2.16.840.1.101.3.4.2.4",Wl="2.16.840.1.101.3.4.2.1",Jl="2.16.840.1.101.3.4.2.2",Yl="2.16.840.1.101.3.4.2.3",gh="2.16.840.1.101.3.4.2.5",mh="2.16.840.1.101.3.4.2.6",bh="1.2.840.113549.2.2",wh="1.2.840.113549.2.5",Ys=`${Fe}.8`;function ve(e){return new H({algorithm:e,parameters:null})}ve(bh),ve(wh);const ir=ve(zl);ve(Gl),ve(Wl),ve(Jl),ve(Yl),ve(gh),ve(mh);const Zl=new H({algorithm:Ys,parameters:G.serialize(ir)}),Ql=new H({algorithm:dh,parameters:G.serialize(en.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});ve(Tr),ve(ph),ve(hh),ve(jn),ve(ql),ve(Kl),ve(Dn),ve(Mn),ve(ql),ve(Kl);class $n{constructor(t={}){this.hashAlgorithm=new H(ir),this.maskGenAlgorithm=new H({algorithm:Ys,parameters:G.serialize(ir)}),this.pSourceAlgorithm=new H(Ql),Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:ir})],$n.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Zl})],$n.prototype,"maskGenAlgorithm",void 0),u([f({type:H,context:2,defaultValue:Ql})],$n.prototype,"pSourceAlgorithm",void 0),new H({algorithm:uh,parameters:G.serialize(new $n)});class mi{constructor(t={}){this.hashAlgorithm=new H(ir),this.maskGenAlgorithm=new H({algorithm:Ys,parameters:G.serialize(ir)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:H,context:0,defaultValue:ir})],mi.prototype,"hashAlgorithm",void 0),u([f({type:H,context:1,defaultValue:Zl})],mi.prototype,"maskGenAlgorithm",void 0),u([f({type:m.Integer,context:2,defaultValue:20})],mi.prototype,"saltLength",void 0),u([f({type:m.Integer,context:3,defaultValue:1})],mi.prototype,"trailerField",void 0),new H({algorithm:fh,parameters:G.serialize(new mi)});class Pn{constructor(t={}){this.digestAlgorithm=new H,this.digest=new ae,Object.assign(this,t)}}u([f({type:H})],Pn.prototype,"digestAlgorithm",void 0),u([f({type:ae})],Pn.prototype,"digest",void 0);var Zs;class Rn{constructor(t={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Rn.prototype,"prime",void 0),u([f({type:m.Integer,converter:he})],Rn.prototype,"exponent",void 0),u([f({type:m.Integer,converter:he})],Rn.prototype,"coefficient",void 0);let Qs=Zs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Zs.prototype)}};Qs=Zs=u([V({type:T.Sequence,itemType:Rn})],Qs);class yt{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})],yt.prototype,"version",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"publicExponent",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"privateExponent",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"prime1",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"prime2",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"exponent1",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"exponent2",void 0),u([f({type:m.Integer,converter:he})],yt.prototype,"coefficient",void 0),u([f({type:Qs,optional:!0})],yt.prototype,"otherPrimeInfos",void 0);class Xs{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Xs.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],Xs.prototype,"publicExponent",void 0);var ea;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(ea||(ea={}));const He=ea;/*! *****************************************************************************
|
|
76
76
|
Copyright (c) Microsoft Corporation.
|
|
77
77
|
|
|
78
78
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -85,9 +85,9 @@ ${t.join(`
|
|
|
85
85
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
86
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
87
|
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */var
|
|
88
|
+
***************************************************************************** */var ta=function(e,t){return ta=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},ta(e,t)};function ra(e,t){ta(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function vh(e,t,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function c(y){try{d(i.next(y))}catch(p){a(p)}}function l(y){try{d(i.throw(y))}catch(p){a(p)}}function d(y){y.done?s(y.value):n(y.value).then(c,l)}d((i=i.apply(e,t||[])).next())})}function kh(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(d){return function(y){return l([d,y])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,n=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],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function Un(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ln(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,s=[],a;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(c){a={error:c}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function nr(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ln(arguments[t]));return e}var Ch="injectionTokens";function Sh(e){var t=Reflect.getMetadata("design:paramtypes",e)||[],r=Reflect.getOwnMetadata(Ch,e)||{};return Object.keys(r).forEach(function(i){t[+i]=r[i]}),t}function Xl(e){return!!e.useClass}function ia(e){return!!e.useFactory}var eu=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={},n=!1,s,a=function(){return n||(s=t(r.wrap()),n=!0),s};return new Proxy(i,this.createHandler(a))},e.prototype.createHandler=function(t){var r={},i=function(n){r[n]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=t();var c=Reflect[n];return c.apply(void 0,nr(s))}};return this.reflectMethods.forEach(i),r},e}();function Vr(e){return typeof e=="string"||typeof e=="symbol"}function xh(e){return typeof e=="object"&&"token"in e&&"multiple"in e}function tu(e){return typeof e=="object"&&"token"in e&&"transform"in e}function Ah(e){return typeof e=="function"||e instanceof eu}function Fn(e){return!!e.useToken}function Hn(e){return e.useValue!=null}function Bh(e){return Xl(e)||Hn(e)||Fn(e)||ia(e)}var na=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}(),Ih=function(e){ra(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(na),ru=function(){function e(){this.scopedResolutions=new Map}return e}();function Eh(e,t){if(e===null)return"at position #"+t;var r=e.split(",")[t].trim();return'"'+r+'" at position #'+t}function Nh(e,t,r){return r===void 0&&(r=" "),nr([e],t.message.split(`
|
|
89
89
|
`).map(function(i){return r+i})).join(`
|
|
90
|
-
`)}function Bh(e,t,r){var i=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=xh(s,t);return Ah("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function Ih(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Eh=function(e){Qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ea),Nh=function(e){Qs(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(ea),Oh=function(){function e(){this.preResolution=new Eh,this.postResolution=new Nh}return e}(),Xl=new Map,_h=function(){function e(t){this.parent=t,this._registry=new Sh,this.interceptors=new Oh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:He.Transient}),this.ensureNotDisposed();var n;if(Ch(r)?n=r:n={useClass:r},Fn(n))for(var s=[t],a=n;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+nr(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Fn(l.provider)?a=l.provider:a=null}if((i.lifecycle===He.Singleton||i.lifecycle==He.ContainerScoped||i.lifecycle==He.ResolutionScoped)&&(Hn(n)||Xs(n)))throw new Error('Cannot use lifecycle "'+He[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:n,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),Vr(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),Vr(t)){if(Vr(r))return this.register(t,{useToken:r},{lifecycle:He.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:He.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Vr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:He.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new Ql),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Vr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var n=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}if(kh(t)){var n=this.construct(t,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}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,n;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Un(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var n,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Un(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){n={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===He.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===He.Singleton,n=t.options.lifecycle===He.ContainerScoped,s=i||n,a;return Hn(t.provider)?a=t.provider.useValue:Fn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):Jl(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):Xs(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===He.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new Ql),this.ensureNotDisposed();var n=this.getAllRegistrations(t);if(!n&&Vr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),n){var s=n.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Un(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Ln(n.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Hn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{n&&!n.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 n=Un(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Ln(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===He.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===He.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}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 gh(this,void 0,void 0,function(){var t;return mh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var n=i.dispose();n&&t.push(n)}),[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 Yl)return t.createProxy(function(s){return i.resolve(s,r)});var n=function(){var s=Xl.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,nr([void 0],a)))}();return Ih(n)&&this.disposables.add(n),n},e.prototype.resolveParams=function(t,r){var i=this;return function(n,s){var a,c,l;try{return vh(n)?Zl(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,nr([i.resolveAll(n.token)],n.transformArgs)):(c=i.resolve(n.transform)).transform.apply(c,nr([i.resolve(n.token,t)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,t):Zl(n)?(l=i.resolve(n.transform,t)).transform.apply(l,nr([i.resolve(n.token,t)],n.transformArgs)):i.resolve(n,t)}catch(d){throw new Error(Bh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),tt=new _h;function ta(){return function(e){Xl.set(e,wh(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 ra;class qn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],qn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],qn.prototype,"attrValues",void 0);let eu=ra=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ra.prototype)}};eu=ra=u([V({type:T.Sequence,itemType:qn})],eu);var ia;let tu=ia=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ia.prototype)}};tu=ia=u([V({type:T.Sequence,itemType:Br})],tu);class ru{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],ru.prototype,"certId",void 0),u([f({type:m.Any,context:0})],ru.prototype,"certValue",void 0);class iu{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],iu.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],iu.prototype,"crltValue",void 0);class nu extends ae{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new nu,Object.assign(this,t)}};u([f({type:H})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:nu})],Kn.prototype,"encryptedData",void 0);var na,oa;(function(e){e[e.v1=0]="v1"})(oa||(oa={}));class ou extends ae{}let sa=na=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,na.prototype)}};sa=na=u([V({type:T.Sequence,itemType:Bt})],sa);class bi{constructor(t={}){this.version=oa.v1,this.privateKeyAlgorithm=new H,this.privateKey=new ou,Object.assign(this,t)}}u([f({type:m.Integer})],bi.prototype,"version",void 0),u([f({type:H})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:ou})],bi.prototype,"privateKey",void 0),u([f({type:sa,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let su=class extends bi{};su=u([V({type:T.Sequence})],su);let au=class extends Kn{};au=u([V({type:T.Sequence})],au);class cu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],cu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],cu.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new $n,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:$n})],wi.prototype,"mac",void 0),u([f({type:ae})],wi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],wi.prototype,"iterations",void 0);class zn{constructor(t={}){this.version=3,this.authSafe=new Br,this.macData=new wi,Object.assign(this,t)}}u([f({type:m.Integer})],zn.prototype,"version",void 0),u([f({type:Br})],zn.prototype,"authSafe",void 0),u([f({type:wi,optional:!0})],zn.prototype,"macData",void 0);var aa;class Gn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Gn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Gn.prototype,"bagValue",void 0),u([f({type:qn,repeated:"set",optional:!0})],Gn.prototype,"bagAttributes",void 0);let lu=aa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};lu=aa=u([V({type:T.Sequence,itemType:Gn})],lu);var ca,la,ua;const uu="1.2.840.113549.1.9",du=`${uu}.7`,da=`${uu}.14`;let Wn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Wn.prototype,"ia5String",void 0),Wn=u([V({type:T.Choice})],Wn);let fu=class extends Br{};fu=u([V({type:T.Sequence})],fu);let pu=class extends zn{};pu=u([V({type:T.Sequence})],pu);let hu=class extends Kn{};hu=u([V({type:T.Sequence})],hu);let fa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],fa.prototype,"value",void 0),fa=u([V({type:T.Choice})],fa);let yu=class extends Wn{};yu=u([V({type:T.Choice})],yu);let gu=class extends Oe{};gu=u([V({type:T.Choice})],gu);let pa=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],pa.prototype,"value",void 0),pa=u([V({type:T.Choice})],pa);let mu=class extends Oe{};mu=u([V({type:T.Choice})],mu);let ha=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],ha.prototype,"value",void 0),ha=u([V({type:T.Choice})],ha);let Jn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Jn.prototype,"value",void 0),Jn=u([V({type:T.Choice})],Jn);let bu=class extends Jn{};bu=u([V({type:T.Choice})],bu);let wu=class extends Oe{};wu=u([V({type:T.Choice})],wu);let ya=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],ya.prototype,"value",void 0),ya=u([V({type:T.Choice})],ya);let vu=class extends _e{};vu=u([V({type:T.Choice})],vu);let ga=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],ga.prototype,"value",void 0),ga=u([V({type:T.Choice})],ga);let ku=class extends ht{};ku=u([V({type:T.Sequence})],ku);let Yn=class extends Oe{};Yn=u([V({type:T.Choice})],Yn);let Cu=ca=class extends Xt{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};Cu=ca=u([V({type:T.Sequence})],Cu);let Su=la=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,la.prototype)}};Su=la=u([V({type:T.Set,itemType:Cr})],Su);let ma=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],ma.prototype,"value",void 0),ma=u([V({type:T.Choice})],ma);let ba=class extends H{};ba=u([V({type:T.Sequence})],ba);let xu=ua=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ua.prototype)}};xu=ua=u([V({type:T.Sequence,itemType:ba})],xu);var wa;let Zn=wa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,wa.prototype)}};Zn=wa=u([V({type:T.Sequence,itemType:Bt})],Zn);class jr{constructor(t={}){this.version=0,this.subject=new we,this.subjectPKInfo=new It,this.attributes=new Zn,Object.assign(this,t)}}u([f({type:m.Integer})],jr.prototype,"version",void 0),u([f({type:we})],jr.prototype,"subject",void 0),u([f({type:It})],jr.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],jr.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new jr,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:jr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:H})],vi.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vi.prototype,"signature",void 0);/*!
|
|
90
|
+
`)}function Oh(e,t,r){var i=Ln(e.toString().match(/constructor\(([\w, ]+)\)/)||[],2),n=i[1],s=n===void 0?null:n,a=Eh(s,t);return Nh("Cannot inject the dependency "+a+' of "'+e.name+'" constructor. Reason:',r)}function _h(e){if(typeof e.dispose!="function")return!1;var t=e.dispose;return!(t.length>0)}var Th=function(e){ra(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(na),Vh=function(e){ra(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(na),jh=function(){function e(){this.preResolution=new Th,this.postResolution=new Vh}return e}(),iu=new Map,Dh=function(){function e(t){this.parent=t,this._registry=new Ih,this.interceptors=new jh,this.disposed=!1,this.disposables=new Set}return e.prototype.register=function(t,r,i){i===void 0&&(i={lifecycle:He.Transient}),this.ensureNotDisposed();var n;if(Bh(r)?n=r:n={useClass:r},Fn(n))for(var s=[t],a=n;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+nr(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Fn(l.provider)?a=l.provider:a=null}if((i.lifecycle===He.Singleton||i.lifecycle==He.ContainerScoped||i.lifecycle==He.ResolutionScoped)&&(Hn(n)||ia(n)))throw new Error('Cannot use lifecycle "'+He[i.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(t,{provider:n,options:i}),this},e.prototype.registerType=function(t,r){return this.ensureNotDisposed(),Vr(r)?this.register(t,{useToken:r}):this.register(t,{useClass:r})},e.prototype.registerInstance=function(t,r){return this.ensureNotDisposed(),this.register(t,{useValue:r})},e.prototype.registerSingleton=function(t,r){if(this.ensureNotDisposed(),Vr(t)){if(Vr(r))return this.register(t,{useToken:r},{lifecycle:He.Singleton});if(r)return this.register(t,{useClass:r},{lifecycle:He.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var i=t;return r&&!Vr(r)&&(i=r),this.register(t,{useClass:i},{lifecycle:He.Singleton})},e.prototype.resolve=function(t,r){r===void 0&&(r=new ru),this.ensureNotDisposed();var i=this.getRegistration(t);if(!i&&Vr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"Single"),i){var n=this.resolveRegistration(i,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}if(Ah(t)){var n=this.construct(t,r);return this.executePostResolutionInterceptor(t,n,"Single"),n}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,n;if(this.interceptors.preResolution.has(t)){var s=[];try{for(var a=Un(this.interceptors.preResolution.getAll(t)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(t,r)}}catch(d){i={error:d}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}this.interceptors.preResolution.setAll(t,s)}},e.prototype.executePostResolutionInterceptor=function(t,r,i){var n,s;if(this.interceptors.postResolution.has(t)){var a=[];try{for(var c=Un(this.interceptors.postResolution.getAll(t)),l=c.next();!l.done;l=c.next()){var d=l.value;d.options.frequency!="Once"&&a.push(d),d.callback(t,r,i)}}catch(y){n={error:y}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(n)throw n.error}}this.interceptors.postResolution.setAll(t,a)}},e.prototype.resolveRegistration=function(t,r){if(this.ensureNotDisposed(),t.options.lifecycle===He.ResolutionScoped&&r.scopedResolutions.has(t))return r.scopedResolutions.get(t);var i=t.options.lifecycle===He.Singleton,n=t.options.lifecycle===He.ContainerScoped,s=i||n,a;return Hn(t.provider)?a=t.provider.useValue:Fn(t.provider)?a=s?t.instance||(t.instance=this.resolve(t.provider.useToken,r)):this.resolve(t.provider.useToken,r):Xl(t.provider)?a=s?t.instance||(t.instance=this.construct(t.provider.useClass,r)):this.construct(t.provider.useClass,r):ia(t.provider)?a=t.provider.useFactory(this):a=this.construct(t.provider,r),t.options.lifecycle===He.ResolutionScoped&&r.scopedResolutions.set(t,a),a},e.prototype.resolveAll=function(t,r){var i=this;r===void 0&&(r=new ru),this.ensureNotDisposed();var n=this.getAllRegistrations(t);if(!n&&Vr(t))throw new Error('Attempted to resolve unregistered dependency token: "'+t.toString()+'"');if(this.executePreResolutionInterceptor(t,"All"),n){var s=n.map(function(c){return i.resolveRegistration(c,r)});return this.executePostResolutionInterceptor(t,s,"All"),s}var a=[this.construct(t,r)];return this.executePostResolutionInterceptor(t,a,"All"),a},e.prototype.isRegistered=function(t,r){return r===void 0&&(r=!1),this.ensureNotDisposed(),this._registry.has(t)||r&&(this.parent||!1)&&this.parent.isRegistered(t,!0)},e.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},e.prototype.clearInstances=function(){var t,r;this.ensureNotDisposed();try{for(var i=Un(this._registry.entries()),n=i.next();!n.done;n=i.next()){var s=Ln(n.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Hn(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){t={error:l}}finally{try{n&&!n.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 n=Un(this._registry.entries()),s=n.next();!s.done;s=n.next()){var a=Ln(s.value,2),c=a[0],l=a[1];l.some(function(d){var y=d.options;return y.lifecycle===He.ContainerScoped})&&i._registry.setAll(c,l.map(function(d){return d.options.lifecycle===He.ContainerScoped?{provider:d.provider,options:d.options}:d}))}}catch(d){t={error:d}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}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 vh(this,void 0,void 0,function(){var t;return kh(this,function(r){switch(r.label){case 0:return this.disposed=!0,t=[],this.disposables.forEach(function(i){var n=i.dispose();n&&t.push(n)}),[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 eu)return t.createProxy(function(s){return i.resolve(s,r)});var n=function(){var s=iu.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,nr([void 0],a)))}();return _h(n)&&this.disposables.add(n),n},e.prototype.resolveParams=function(t,r){var i=this;return function(n,s){var a,c,l;try{return xh(n)?tu(n)?n.multiple?(a=i.resolve(n.transform)).transform.apply(a,nr([i.resolveAll(n.token)],n.transformArgs)):(c=i.resolve(n.transform)).transform.apply(c,nr([i.resolve(n.token,t)],n.transformArgs)):n.multiple?i.resolveAll(n.token):i.resolve(n.token,t):tu(n)?(l=i.resolve(n.transform,t)).transform.apply(l,nr([i.resolve(n.token,t)],n.transformArgs)):i.resolve(n,t)}catch(d){throw new Error(Oh(r,s,d))}}},e.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},e}(),tt=new Dh;function oa(){return function(e){iu.set(e,Sh(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 sa;class qn{constructor(t={}){this.attrId="",this.attrValues=[],Object.assign(t)}}u([f({type:m.ObjectIdentifier})],qn.prototype,"attrId",void 0),u([f({type:m.Any,repeated:"set"})],qn.prototype,"attrValues",void 0);let nu=sa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,sa.prototype)}};nu=sa=u([V({type:T.Sequence,itemType:qn})],nu);var aa;let ou=aa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,aa.prototype)}};ou=aa=u([V({type:T.Sequence,itemType:Br})],ou);class su{constructor(t={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],su.prototype,"certId",void 0),u([f({type:m.Any,context:0})],su.prototype,"certValue",void 0);class au{constructor(t={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],au.prototype,"crlId",void 0),u([f({type:m.Any,context:0})],au.prototype,"crltValue",void 0);class cu extends ae{}let Kn=class{constructor(t={}){this.encryptionAlgorithm=new H,this.encryptedData=new cu,Object.assign(this,t)}};u([f({type:H})],Kn.prototype,"encryptionAlgorithm",void 0),u([f({type:cu})],Kn.prototype,"encryptedData",void 0);var ca,la;(function(e){e[e.v1=0]="v1"})(la||(la={}));class lu extends ae{}let ua=ca=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ca.prototype)}};ua=ca=u([V({type:T.Sequence,itemType:Bt})],ua);class bi{constructor(t={}){this.version=la.v1,this.privateKeyAlgorithm=new H,this.privateKey=new lu,Object.assign(this,t)}}u([f({type:m.Integer})],bi.prototype,"version",void 0),u([f({type:H})],bi.prototype,"privateKeyAlgorithm",void 0),u([f({type:lu})],bi.prototype,"privateKey",void 0),u([f({type:ua,implicit:!0,context:0,optional:!0})],bi.prototype,"attributes",void 0);let uu=class extends bi{};uu=u([V({type:T.Sequence})],uu);let du=class extends Kn{};du=u([V({type:T.Sequence})],du);class fu{constructor(t={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],fu.prototype,"secretTypeId",void 0),u([f({type:m.Any,context:0})],fu.prototype,"secretValue",void 0);class wi{constructor(t={}){this.mac=new Pn,this.macSalt=new ae,this.iterations=1,Object.assign(this,t)}}u([f({type:Pn})],wi.prototype,"mac",void 0),u([f({type:ae})],wi.prototype,"macSalt",void 0),u([f({type:m.Integer,defaultValue:1})],wi.prototype,"iterations",void 0);class zn{constructor(t={}){this.version=3,this.authSafe=new Br,this.macData=new wi,Object.assign(this,t)}}u([f({type:m.Integer})],zn.prototype,"version",void 0),u([f({type:Br})],zn.prototype,"authSafe",void 0),u([f({type:wi,optional:!0})],zn.prototype,"macData",void 0);var da;class Gn{constructor(t={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Gn.prototype,"bagId",void 0),u([f({type:m.Any,context:0})],Gn.prototype,"bagValue",void 0),u([f({type:qn,repeated:"set",optional:!0})],Gn.prototype,"bagAttributes",void 0);let pu=da=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,da.prototype)}};pu=da=u([V({type:T.Sequence,itemType:Gn})],pu);var fa,pa,ha;const hu="1.2.840.113549.1.9",yu=`${hu}.7`,ya=`${hu}.14`;let Wn=class extends Oe{constructor(t={}){super(t)}toString(){return this.ia5String||super.toString()}};u([f({type:m.IA5String})],Wn.prototype,"ia5String",void 0),Wn=u([V({type:T.Choice})],Wn);let gu=class extends Br{};gu=u([V({type:T.Sequence})],gu);let mu=class extends zn{};mu=u([V({type:T.Sequence})],mu);let bu=class extends Kn{};bu=u([V({type:T.Sequence})],bu);let ga=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.IA5String})],ga.prototype,"value",void 0),ga=u([V({type:T.Choice})],ga);let wu=class extends Wn{};wu=u([V({type:T.Choice})],wu);let vu=class extends Oe{};vu=u([V({type:T.Choice})],vu);let ma=class{constructor(t=new Date){this.value=t}};u([f({type:m.GeneralizedTime})],ma.prototype,"value",void 0),ma=u([V({type:T.Choice})],ma);let ku=class extends Oe{};ku=u([V({type:T.Choice})],ku);let ba=class{constructor(t="M"){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],ba.prototype,"value",void 0),ba=u([V({type:T.Choice})],ba);let Jn=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.PrintableString})],Jn.prototype,"value",void 0),Jn=u([V({type:T.Choice})],Jn);let Cu=class extends Jn{};Cu=u([V({type:T.Choice})],Cu);let Su=class extends Oe{};Su=u([V({type:T.Choice})],Su);let wa=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.ObjectIdentifier})],wa.prototype,"value",void 0),wa=u([V({type:T.Choice})],wa);let xu=class extends _e{};xu=u([V({type:T.Choice})],xu);let va=class{constructor(t=0){this.value=t}toString(){return this.value.toString()}};u([f({type:m.Integer})],va.prototype,"value",void 0),va=u([V({type:T.Choice})],va);let Au=class extends ht{};Au=u([V({type:T.Sequence})],Au);let Yn=class extends Oe{};Yn=u([V({type:T.Choice})],Yn);let Bu=fa=class extends Xt{constructor(t){super(t),Object.setPrototypeOf(this,fa.prototype)}};Bu=fa=u([V({type:T.Sequence})],Bu);let Iu=pa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,pa.prototype)}};Iu=pa=u([V({type:T.Set,itemType:Cr})],Iu);let ka=class{constructor(t=""){this.value=t}toString(){return this.value}};u([f({type:m.BmpString})],ka.prototype,"value",void 0),ka=u([V({type:T.Choice})],ka);let Ca=class extends H{};Ca=u([V({type:T.Sequence})],Ca);let Eu=ha=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ha.prototype)}};Eu=ha=u([V({type:T.Sequence,itemType:Ca})],Eu);var Sa;let Zn=Sa=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Sa.prototype)}};Zn=Sa=u([V({type:T.Sequence,itemType:Bt})],Zn);class jr{constructor(t={}){this.version=0,this.subject=new we,this.subjectPKInfo=new It,this.attributes=new Zn,Object.assign(this,t)}}u([f({type:m.Integer})],jr.prototype,"version",void 0),u([f({type:we})],jr.prototype,"subject",void 0),u([f({type:It})],jr.prototype,"subjectPKInfo",void 0),u([f({type:Zn,implicit:!0,context:0})],jr.prototype,"attributes",void 0);class vi{constructor(t={}){this.certificationRequestInfo=new jr,this.signatureAlgorithm=new H,this.signature=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:jr})],vi.prototype,"certificationRequestInfo",void 0),u([f({type:H})],vi.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],vi.prototype,"signature",void 0);/*!
|
|
91
91
|
* MIT License
|
|
92
92
|
*
|
|
93
93
|
* Copyright (c) Peculiar Ventures. All rights reserved.
|
|
@@ -110,39 +110,39 @@ ${t.join(`
|
|
|
110
110
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
111
111
|
* SOFTWARE.
|
|
112
112
|
*
|
|
113
|
-
*/const Qn="crypto.algorithm";class
|
|
114
|
-
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let n=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${n}${t[ue.NAME]}:${s}`),n=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${n}${d}${l}`);else if(l instanceof Date)i.push(`${n}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if(
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Rt.isPrintableString(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new yr([y])),s=d}return r}fromJSON(t){const r=new we;for(const i of t){const n=new yr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=L.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;n.push(d)}}r.push(n)}return r}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const
|
|
116
|
-
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData
|
|
117
|
-
`)}}Ye.CertificateTag="CERTIFICATE",Ye.CrlTag="CRL",Ye.CertificateRequestTag="CERTIFICATE REQUEST",Ye.PublicKeyTag="PUBLIC KEY",Ye.PrivateKeyTag="PRIVATE KEY";class Ot extends $t{static isAsnEncoded(t){return $.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ye.isPem(t))return Ye.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 Ye.isPem(r)?Ye.decode(r)[0]:L.isHex(r)?L.FromHex(r):L.isBase64(r)?L.FromBase64(r):L.isBase64Url(r)?L.FromBase64Url(r):$.toArrayBuffer(t)}}constructor(...t){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ye.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ar extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,It):super(t),this.tag=Ye.PublicKeyTag}async export(...t){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};return t.length>1?(n=t[0]||n,i=t[1]||i,r=t[2]||Je.get()):r=t[0]||Je.get(),r.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(t){const r=tt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const n=G.parse(t.subjectPublicKey,Js),s=$.toUint8Array(n.modulus);i.publicExponent=$.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(t){t||(t=Je.get());const r=G.parse(this.rawData,It);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,It);switch(t.Algorithm=or.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new gt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const ro="crypto.signatureFormatter";class Kh{toAsnSignature(t,r){return $.toArrayBuffer(r)}toWebSignature(t,r){return $.toArrayBuffer(r)}}class io extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ye.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Rt(r.subject),this.subject=new Rt(r.subject).toString(),this.issuerName=new Rt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const n=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>mt.create(G.serialize(a)))),this.publicKey=new ar(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=Je.get()){let i,n;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof ar)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if($.isBufferSource(s)){const d=new ar(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=tt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,n,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Je.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Je.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,wr),i=r.tbsCertificate,n=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":or.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&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Extensions=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends gt{static async create(t,r=!1,i=Je.get()){if(t instanceof io||sr.isCryptoKey(t)){const n=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",n),c=await new ar(s).getKeyIdentifier(i);return new Ai(L.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if($.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Qt({keyIdentifier:new qo(L.FromHex(t[0]))});super(Ho,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?G.parse(r.name.rawData,Pe):r.name,n=new Qt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Ho,t[1],G.serialize(n))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Qt);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,Qt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class ud extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(dl,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}}ud.NAME="Basic Constraints";var dd;(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"})(dd||(dd={}));class fd extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(ml,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Pt.toString(r)).join(", "),t}}fd.NAME="Extended Key Usages";var Ia;(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"})(Ia||(Ia={}));class Ea extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,os);this.usages=r.toNumber()}else{const r=new os(t[0]);super(wl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,os);return t[""]=r.toJSON().join(", "),t}}Ea.NAME="Key Usages";class no extends gt{static async create(t,r=!1,i=Je.get()){let n;t instanceof ar?n=t.rawData:"publicKey"in t?n=t.publicKey.rawData:$.isBufferSource(t)?n=t:n=await i.subtle.exportKey("spki",t);const a=await new ar(n).getKeyIdentifier(i);return new no(L.ToHex(a),r)}constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Dt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Dt(r);super(Al,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Dt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Na extends gt{constructor(...t){$.isBufferSource(t[0])?super(t[0]):super(Sl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,us);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Na.NAME="Subject Alternative Name";class pd extends gt{constructor(...t){var r;if($.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,sn);this.policies=i.map(n=>n.policyIdentifier)}else{const i=t[0],n=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(pl,n,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Pt.toString(r))),t}}pd.NAME="Certificate Policies",mt.register(pl,pd);class Mr extends $t{constructor(...t){let r;if($.isBufferSource(t[0]))r=$.toArrayBuffer(t[0]);else{const i=t[0],n=Array.isArray(t[1])?t[1].map(s=>$.toArrayBuffer(s)):[];r=G.serialize(new Bt({type:i,values:n}))}super(r,Bt)}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]=Pt.toString(this.type)),t}}Mr.NAME="Attribute";class hd extends Mr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(du,[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],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}hd.NAME="Challenge Password";class Oa extends Mr{constructor(...t){var r;if($.isBufferSource(t[0]))super(t[0]);else{const i=t[0],n=new Xt;for(const s of i)n.push(G.parse(s.rawData,st));super(da,[G.serialize(n)])}(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],Xt);this.items=r.map(i=>mt.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}}Oa.NAME="Extensions";class oo{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}}oo.items=new Map;let _a=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:jn,parameters:null});case"sha-256":return new H({algorithm:Ks,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,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 jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ks:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};_a=u([ta()],_a),tt.registerSingleton(Qn,_a);class rt{addPadding(t,r){const i=$.toUint8Array(r),n=new Uint8Array(t);return n.set(i,t-i.length),n}removePadding(t,r=!1){let i=$.toUint8Array(t);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,n=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new Vn,a=$.toUint8Array(r);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Vn),n=t.namedCurve,s=rt.namedCurveSize.get(n)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return ap(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const yd="1.3.101.110",gd="1.3.101.111",md="1.3.101.112",bd="1.3.101.113";let Ta=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=md;break;case"ed448":r=bd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=yd;break;case"x448":r=gd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case md:return{name:"EdDSA",namedCurve:"Ed25519"};case bd:return{name:"EdDSA",namedCurve:"Ed448"};case yd:return{name:"ECDH-ES",namedCurve:"X25519"};case gd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ta=u([ta()],Ta),tt.registerSingleton(Qn,Ta);class zh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,vi):super(t),this.tag=Ye.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ar(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(n=>oo.create(G.serialize(n)));const i=this.getAttribute(da);this.extensions=[],i instanceof Oa&&(this.extensions=i.items),this.subjectName=new Rt(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=Je.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),n=tt.resolveAll(ro).reverse();let s=null;for(const c of n)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vi),i=r.certificationRequestInfo,n=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Attributes=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}zh.NAME="PKCS#10 Certificate Request";var wd;(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"})(wd||(wd={})),mt.register(dl,ud),mt.register(ml,fd),mt.register(wl,Ea),mt.register(Al,no),mt.register(Ho,Ai),mt.register(Sl,Na),oo.register(du,hd),oo.register(da,Oa),tt.registerSingleton(ro,Kh),tt.registerSingleton(ro,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.namedCurveSize.set("P-521",66);function vd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const n of r.extensions)if(n instanceof Na){const s=n.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(n instanceof Ea){const s=Object.values(Ia),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(n.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Gh(){const e=vd(),t=o.ref({}),r=n=>{if(!(n.id in t.value))try{t.value[n.id]=e.parseMetaCertificateData(n.cert)}catch{t.value[n.id]=void 0}return t.value[n.id]};return{certificateDataCache:t,getCertificateData:n=>{const s=r(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Wh={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 Jh(){const e=ji.createI18n("en-us",Wh);return{i18n:e,i18nT:ji.i18nTComponent(e)}}const bt={useCertificate:Gh,useI18n:Jh,useX509:vd},Bi={list:{konnect:"/api/runtime_groups/{controlPlaneId}/certificates",kongManager:"/{workspace}/certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/certificates",edit:"/api/runtime_groups/{controlPlaneId}/certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/certificate/validate"},kongManager:{create:"/{workspace}/certificates",edit:"/{workspace}/certificates/{id}",validate:"/{workspace}/schemas/certificates/validate"}}};var Va=(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))(Va||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),Ut=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ut||{}),ce=(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))(ce||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function Yh(){return{getAxiosInstance:(e={})=>{try{const t=o.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):Xa.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Xa.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 Zh(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const ja="khcp-user-table-preferences",Qh={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function Xh(){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(ja));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const n=t();n.set(r,i),localStorage.setItem(ja,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||Qh},deleteAllTablePreferences:()=>{localStorage.removeItem(ja)}}}function Da(e={}){const{getAxiosInstance:t}=Yh();return{axiosInstance:t(e)}}const ey={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},ty={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},ry={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."}},iy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},ny={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"}},oy={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},sy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},ay={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},cy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},ly={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"}},uy={global:ey,deleteModal:ty,baseForm:ry,baseTable:iy,baseConfigCard:ny,filter:oy,debouncedFilter:sy,errors:ay,validationErrors:cy,toggleModal:ly};function so(){const e=ji.createI18n("en-us",uy);return{i18n:e,i18nT:ji.i18nTComponent(e)}}function kd(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const n=new Set([...r,...i]);for(const s of n){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,n)=>{if(n){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,n)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=n[r]===void 0||n[r]===null?"":n[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(n[r])&&(a=n[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 dy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:n}=Da({headers:e.requestHeaders}),{i18n:{t:s}}=so(),{debounce:a}=Zh(),c=a(async S=>{await E(S)},200),l=o.ref(!1),d=o.ref(""),y=o.ref(""),p=o.ref([]),I=o.ref([]),w=o.ref(void 0),h=o.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}=kd(),k=async()=>{try{l.value=!0;const{data:S}=await n.get(`${g}?size=${r}`);S!=null&&S.next||(w.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},B=o.ref(""),E=async S=>{var C,A,M;if(B.value!==S)if(B.value=S||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let _=g+"";S&&(_+=`/${S}`);const{data:N}=await n.get(`${_}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(S){const _=[];b(S)&&i.searchKeys.includes("id")?_.push((async()=>{const{data:q}=await n.get(`${g}/${S}`);return[q[i.fetchedItemsKey]??q]})()):_.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:j}=await n.get(`${g}?${q}=${S}`);return j[i.fetchedItemsKey]}));const N=await Promise.all(_),re=new Set;p.value=[],(C=N==null?void 0:N.forEach)==null||C.call(N,q=>{var j;(j=q==null?void 0:q.forEach)==null||j.call(q,Z=>{re.has(Z.id)||(re.add(Z.id),p.value.push(Z))})})}else p.value=I.value}catch(_){((A=_==null?void 0:_.response)==null?void 0:A.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",S?(p.value=(M=w.value)==null?void 0:M.filter(_=>{var N;let re=!1;for(const q of i.searchKeys){const j=typeof _[q]=="string"?(N=_[q])==null?void 0:N.toLowerCase():_[q];j!=null&&j.includes(S.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:w,loadItems:k,debouncedQueryChange:c}}function fy(e,t){const r=o.unref(t),i=o.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",n=>`${i.value.href}/${n}`}function py(){const{i18n:{t:e}}=so();return{getMessageFromError:t=>{var r,i,n,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((n=t.response.data.details)!=null&&n.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).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 hy(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),n=`${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(n)&&!s&&new URL(n))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Cd(e,t){const r=o.ref(o.unref(e)),i=o.ref(o.unref(t)),n=o.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=o.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return n.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(n.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(l))),d&&c!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function yy(e,t,r="data"){var i;const n=o.unref(t),{axiosInstance:s}=Da({...e.axiosRequestConfig,headers:{...(i=e.axiosRequestConfig)==null?void 0:i.headers,...e.requestHeaders}}),a=Cd(e,n),c=o.ref({status:Ut.Idle});return{fetcher:async l=>{var d;try{c.value={status:Ut.Loading};let y=a(l);y.includes("filter[name]")&&(y=`${y}&page[size]=${l.pageSize}&page[number]=${l.page}`);const p=await s.get(y);if(p.status>=400)throw p;const I=p.data,w=r&&r.replace(/[^\w-_]/gi,"");let h;I[w]&&Array.isArray(I[w])?h=I[w]:Array.isArray(I)?h=I:h=Object.keys(I).length?[I]:[];const g={data:h,total:h.length,...I.offset?{pagination:{offset:I.offset}}:null};return c.value={status:Ut.Idle,response:g},g}catch(y){const p={data:[],total:0};return l.query&&(((d=y.response)==null?void 0:d.status)===404||y.status===404)?(c.value={status:Ut.NoResults,response:p,error:y.response?y:{response:y}},p):(c.value={status:Ut.Error,response:p,error:y.response?y:{response:y}},p)}},fetcherState:c}}function gy(){const e=(r,i="_")=>r?r.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Sd=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,xd=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Sd);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Ad=e=>e==="*"||e==="x"||e==="X",Bd=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},my=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],by=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=my(Bd(e),Bd(t));return r>i?1:r<i?-1:0},Id=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=by(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},wy=(e,t)=>{const r=xd(e),i=xd(t),n=r.pop(),s=i.pop(),a=Id(r,i);return a!==0?a:n&&s?Id(n.split("."),s.split(".")):n||s?n?-1:1:0},Ed=(e,t,r)=>{vy(r);const i=wy(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),vy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Od.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Od.join("|")}`)},ky=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function Cy(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!ky(n))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Ed(n,a,"<")||c&&Ed(n,c,">"))}function Sy(e){const t=o.ref(0),r=o.ref(0),i=o.ref(!1);return o.watch(e,n=>{n&&!i.value&&(t.value=n.offsetWidth,r.value=n.scrollWidth,i.value=!0)}),{isTruncated:o.computed(()=>t.value<r.value)}}function xy(){const{i18n:{t:e}}=so();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Be={useAxios:Da,useDebouncedFilter:dy,useDeleteUrlBuilder:fy,useErrors:py,useExternalLinkCreator:hy,useFetcher:yy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:gy,useI18n:so,useGatewayFeatureSupported:Cy,useTruncationDetector:Sy,useValidators:xy},Ay={key:0,class:"config-card-fieldset-title"},By=o.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(),n=o.computed(()=>t.item.key??"json-array-item"),s=o.computed(()=>t.item.value??t.item),a=o.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=o.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:o.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:o.withCtx(()=>[e.isArrayItem?(o.openBlock(),o.createElementBlock("legend",Ay,[o.createElementVNode("b",null,o.toDisplayString(c.value),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(a.value),(y,p)=>(o.openBlock(),o.createBlock(ao,{key:`${n.value}-property-${p}`,item:{key:y,label:o.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,n]of t)r[i]=n;return r},_d=ct(By,[["__scopeId","data-v-68ca83ec"]]),Iy=o.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KButton");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.value||o.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Ey=ct(Iy,[["__scopeId","data-v-c96811e5"]]),Ny=o.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KBadge");return o.openBlock(),o.createBlock(n,{appearance:e.status?"success":"neutral"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.status?o.unref(t)("baseConfigCard.statusBadge.enabledLabel"):o.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),Oy="#0044f4",_y="#e0e4ea",Ty="#3a3f51",Vy="#afb7c5",jy="1px",Dy="20px",My={class:"config-card-details-row"},Py=["data-testid"],$y=["data-testid"],Ry=["data-testid"],Uy=["data-testid"],Ly={key:1},Fy=["data-testid"],Hy=["data-testid"],qy=["data-testid"],Ky=["data-testid"],zy={name:"ConfigCardItem",components:{JsonCardItem:_d,StatusBadge:Ny,InternalLinkItem:Ey}},Gy=o.defineComponent({...zy,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}){o.useCssVars(h=>({"07753575":y.value?"none":`solid ${o.unref(jy)} ${o.unref(_y)}`,"32d44ea8":d.value&&c.value?"block":"flex","5036b738":d.value&&c.value?"100%":r.slim?"50%":"25%","5038fd13":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,n=o.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),c=o.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=o.computed(()=>!!(r.item.tooltip||n["label-tooltip"])),d=o.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=o.computed(()=>r.item.type===ce.JsonArray),p=o.computed(()=>{switch(r.item.type){case ce.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 ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.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 ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.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=o.ref(),{isTruncated:w}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),k=o.resolveComponent("KBadge"),B=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",My,[o.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[o.renderSlot(h.$slots,"label",{item:e.item},()=>[o.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:o.withCtx(()=>[o.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[o.renderSlot(h.$slots,"label-tooltip",{},()=>[o.createTextVNode(o.toDisplayString(e.item.tooltip),1)],!0)],8,$y)]),key:"0"}:void 0]),1024)],!0)],8,Py),o.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[o.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(o.openBlock(),o.createElementBlock("div",Ly,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.value.tag),o.normalizeProps(o.guardReactiveProps(p.value.attrs)),{default:o.withCtx(()=>[p.value.additionalComponent==="KBadge"?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(k,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Fy)):o.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(B,o.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,text:S}),null,16,["data-testid","text"]))),128))],8,Hy)):p.value.additionalComponent==="KMethodBadge"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(k,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(o.unref(rp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,qy)):o.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(o.openBlock(),o.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(_d,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,Ky)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(w)?e.item.value:""},{default:o.withCtx(()=>[o.createElementVNode("span",{ref_key:"textContent",ref:I,class:o.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},o.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,Uy))],!0)],8,Ry)])}}}),ao=ct(Gy,[["__scopeId","data-v-d056663c"]]),Wy={class:"json-config"},Jy={key:0,class:"json-endpoint"},Td=o.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){o.useCssVars(n=>({"954d3eca":`${i.value}ch`}));const t=e,r=o.computed(()=>t.jsonRecord),i=o.computed(()=>{var n;if(!t.fetcherUrl)return 0;const s=(n=t.fetcherUrl)==null?void 0:n.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(n,s)=>{const a=o.resolveComponent("KBadge"),c=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",Wy,[t.fetcherUrl?(o.openBlock(),o.createElementBlock("div",Jy,[o.createVNode(a,{appearance:t.requestMethod},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),o.createVNode(c,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):o.createCommentVNode("",!0),t.jsonRecord?(o.openBlock(),o.createBlock(c,{key:1,id:"json-codeblock",class:o.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):o.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Vd(e){return typeof e>"u"||e===null}function Yy(e){return typeof e=="object"&&e!==null}function Zy(e){return Array.isArray(e)?e:Vd(e)?[]:[e]}function Qy(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}function Xy(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function eg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var tg=Vd,rg=Yy,ig=Zy,ng=Xy,og=eg,sg=Qy,ke={isNothing:tg,isObject:rg,toArray:ig,repeat:ng,isNegativeZero:og,extend:sg};function jd(e,t){var r="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(r+='in "'+e.mark.name+'" '),r+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(r+=`
|
|
113
|
+
*/const Qn="crypto.algorithm";class Mh{getAlgorithms(){return tt.resolveAll(Qn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new 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 n=i.toWebAlgorithm(t);if(n)return n}return{name:t.algorithm,parameters:t.parameters}}}const Xn="crypto.algorithmProvider";tt.registerSingleton(Xn,Mh);var eo;const qe="1.3.36.3.3.2.8.1.1",Nu=`${qe}.1`,Ou=`${qe}.2`,_u=`${qe}.3`,Tu=`${qe}.4`,Vu=`${qe}.5`,ju=`${qe}.6`,Du=`${qe}.7`,Mu=`${qe}.8`,$u=`${qe}.9`,Pu=`${qe}.10`,Ru=`${qe}.11`,Uu=`${qe}.12`,Lu=`${qe}.13`,Fu=`${qe}.14`,Hu="brainpoolP160r1",qu="brainpoolP160t1",Ku="brainpoolP192r1",zu="brainpoolP192t1",Gu="brainpoolP224r1",Wu="brainpoolP224t1",Ju="brainpoolP256r1",Yu="brainpoolP256t1",Zu="brainpoolP320r1",Qu="brainpoolP320t1",Xu="brainpoolP384r1",ed="brainpoolP384t1",td="brainpoolP512r1",rd="brainpoolP512t1",ye="ECDSA";let ki=eo=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 sh;case"sha-256":return ah;case"sha-384":return ch;case"sha-512":return lh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Ll;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Fl;break;case"P-521":r=Hl;break;case Hu:r=Nu;break;case qu:r=Ou;break;case Ku:r=_u;break;case zu:r=Tu;break;case Gu:r=Vu;break;case Wu:r=ju;break;case Ju:r=Du;break;case Yu:r=Mu;break;case Zu:r=$u;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}if(r)return new H({algorithm:yi,parameters:G.serialize(new _r({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Ks:return{name:ye,hash:{name:"SHA-1"}};case zs:return{name:ye,hash:{name:"SHA-256"}};case Gs:return{name:ye,hash:{name:"SHA-384"}};case Ws:return{name:ye,hash:{name:"SHA-512"}};case yi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(G.parse(t.parameters,_r).namedCurve){case Ll:return{name:ye,namedCurve:"P-256"};case eo.SECP256K1:return{name:ye,namedCurve:"K-256"};case Fl:return{name:ye,namedCurve:"P-384"};case Hl:return{name:ye,namedCurve:"P-521"};case Nu:return{name:ye,namedCurve:Hu};case Ou:return{name:ye,namedCurve:qu};case _u:return{name:ye,namedCurve:Ku};case Tu:return{name:ye,namedCurve:zu};case Vu:return{name:ye,namedCurve:Gu};case ju:return{name:ye,namedCurve:Wu};case Du:return{name:ye,namedCurve:Ju};case Mu:return{name:ye,namedCurve:Yu};case $u: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}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([oa()],ki),tt.registerSingleton(Qn,ki);const id=Symbol("name"),nd=Symbol("value");class ue{constructor(t,r={},i=""){this[id]=t,this[nd]=i;for(const n in r)this[n]=r[n]}}ue.NAME=id,ue.VALUE=nd;class $h{static toTextObject(t){const r=new ue("Algorithm Identifier",{},$t.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case yi:{const i=new ki().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class $t{static toString(t){const r=this.items[t];return r||t}}$t.items={[zl]:"sha1",[Gl]:"sha224",[Wl]:"sha256",[Jl]:"sha384",[Yl]:"sha512",[Tr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[yh]:"sha224WithRSAEncryption",[Js]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[Mn]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[Ks]:"ecdsaWithSHA1",[Ul]:"ecdsaWithSHA224",[zs]:"ecdsaWithSHA256",[Gs]:"ecdsaWithSHA384",[Ws]:"ecdsaWithSHA512",[Xp]:"TLS WWW server authentication",[eh]:"TLS WWW client authentication",[th]:"Code Signing",[rh]:"E-mail Protection",[ih]:"Time Stamping",[nh]:"OCSP Signing",[oh]:"Signed Data"};class or{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 n=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${n}${t[ue.NAME]}:${s}`),n=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${n}${d}${l}`);else if(l instanceof Date)i.push(`${n}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if(P.isBufferSource(l))c?(i.push(`${n}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[ue.NAME]=c,i.push(...this.serializeObj(y,r))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return i}static serializeBufferSource(t,r=0){const i=this.pad(r),n=P.toUint8Array(t),s=[];for(let a=0;a<n.length;){const c=[];for(let l=0;l<16&&a<n.length;l++){l===8&&c.push("");const d=n[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}or.oidSerializer=$t,or.algorithmSerializer=$h;class Pt{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 Pt?sc(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return G.toString(this.rawData);case"text":return or.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)}}Pt.NAME="ASN";class gt extends Pt{constructor(...t){let r;P.isBufferSource(t[0])?r=P.toArrayBuffer(t[0]):r=G.serialize(new st({extnID:t[0],critical:t[1],extnValue:new ae(P.toArrayBuffer(t[2]))})),super(r,st)}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]===gt.NAME&&(t[ue.NAME]=$t.toString(this.type)),t}}var od;class sr{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[od]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(sr.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=sr.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(sr.DEFAULT,t);return this}}od=Symbol.toStringTag,sr.DEFAULT="default";const Je=new sr,Ph=/^[0-2](?:\.[1-9][0-9]*)+$/;function Rh(e){return new RegExp(Ph).test(e)}class sd{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Rh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Ke=new sd;Ke.register("CN","2.5.4.3"),Ke.register("L","2.5.4.7"),Ke.register("ST","2.5.4.8"),Ke.register("O","2.5.4.10"),Ke.register("OU","2.5.4.11"),Ke.register("C","2.5.4.6"),Ke.register("DC","0.9.2342.19200300.100.1.25"),Ke.register("E","1.2.840.113549.1.9.1"),Ke.register("G","2.5.4.42"),Ke.register("I","2.5.4.43"),Ke.register("SN","2.5.4.4"),Ke.register("T","2.5.4.12");function Uh(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function Lh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Uh)}class Rt{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 sd,this.asn=new we;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const n=r[i];this.extraNames.register(i,n)}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)||Ke.findId(t),i=[];for(const n of this.asn)for(const s of n)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||Ke.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,n=r.value.anyValue?`#${L.ToHex(r.value.anyValue)}`:Lh(r.value.toString());return`${i}=${n}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const n={};for(const s of i){const a=this.getName(s.type)||s.type;(t=n[a])!==null&&t!==void 0||(n[a]=[]),n[a].push(s.value.anyValue?`#${L.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(n)}return r}fromString(t){const r=new we,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let n=null,s=",";for(;n=i.exec(`${t},`);){let[,a,c]=n;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),n[3]=l);const d=n[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new Xr({type:a});if(c.charAt(0)==="#")y.value.anyValue=L.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
|
|
115
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Rt.isPrintableString(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new yr([y])),s=d}return r}fromJSON(t){const r=new we;for(const i of t){const n=new yr;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=L.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;n.push(d)}}r.push(n)}return r}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.toArrayBuffer())}}const ad="Cannot initialize GeneralName from ASN.1 data.",cd=`${ad} Unsupported string format in use.`,Fh=`${ad} Value doesn't match to GUID regular expression.`,ld=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,ud="1.3.6.1.4.1.311.25.1",dd="1.3.6.1.4.1.311.20.2.3",xa="dns",Aa="dn",Ba="email",Ia="ip",Ea="url",Na="guid",Oa="upn",to="id";class fd extends Pt{constructor(...t){let r;if(t.length===2)switch(t[0]){case Aa:{const i=new Rt(t[1]).toArrayBuffer(),n=G.parse(i,we);r=new ie({directoryName:n});break}case xa:r=new ie({dNSName:t[1]});break;case Ba:r=new ie({rfc822Name:t[1]});break;case Na:{const i=new RegExp(ld,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const n=i.slice(1).map((s,a)=>a<3?L.ToHex(new Uint8Array(L.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:ud,value:G.serialize(new ae(L.FromHex(n)))})});break}case Ia:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Oa:{r=new ie({otherName:new ei({typeId:dd,value:G.serialize(cl.toASN(t[1]))})});break}case Ea: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=xa,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=Ba,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=Ia,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Ea,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=Aa,this.value=new Rt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===ud){this.type=Na;const r=G.parse(t.otherName.value,ae),i=new RegExp(ld,"i").exec(L.ToHex(r));if(!i)throw new Error(Fh);this.value=i.slice(1).map((n,s)=>s<3?L.ToHex(new Uint8Array(L.FromHex(n)).reverse()):n).join("-")}else if(t.otherName.typeId===dd)this.type=Oa,this.value=G.parse(t.otherName.value,Oe).toString();else throw new Error(cd);else throw new Error(cd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case Aa:case xa:case Na:case Ia:case to:case Oa:case Ea:t=this.type.toUpperCase();break;case Ba:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=$t.toString(r)),new ue(t,void 0,r)}}class Ci extends Pt{constructor(t){let r;if(t instanceof $e)r=t;else if(Array.isArray(t)){const i=[];for(const n of t)if(n instanceof ie)i.push(n);else{const s=G.parse(new fd(n.type,n.value).rawData,ie);i.push(s)}r=new $e(i)}else if(P.isBufferSource(t))r=G.parse(t,$e);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let n=null;try{n=new fd(i)}catch{continue}r.push(n)}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 n=t[i[ue.NAME]];Array.isArray(n)||(n=[],t[i[ue.NAME]]=n),n.push(i)}return t}}Ci.NAME="GeneralNames";const Si="-{5}",xi="\\n",Hh=`[^${xi}]+`,qh=`${Si}BEGIN (${Hh}(?=${Si}))${Si}`,Kh=`${Si}END \\1${Si}`,Dr="\\n",zh=`[^:${xi}]+`,Gh=`(?:[^${xi}]+${Dr}(?: +[^${xi}]+${Dr})*)`,Wh=`(?:[a-zA-Z0-9=+/]+${Dr})+`,pd=`${qh}${Dr}(?:((?:${zh}: ${Gh})+))?${Dr}?(${Wh})${Kh}`;class Ye{static isPem(t){return typeof t=="string"&&new RegExp(pd,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(pd,"g"),i=[];let n=null;for(;n=r.exec(t);){const s=n[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:n[1],headers:[],rawData:L.FromBase64(s)},c=n[2];if(c){const l=c.split(new RegExp(Dr,"g"));let d=null;for(const y of l){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(n=>{if(!P.isBufferSource(n))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:P.toArrayBuffer(n)}))}):t.forEach(n=>{if(!("type"in n))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(n))}),i.join(`
|
|
116
|
+
`)}else{if(!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(),n=[];if(n.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)n.push(`${d.key}: ${d.value}`);n.push("")}const s=L.ToBase64(t.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return n.push(...l),n.push(`-----END ${i}-----`),n.join(`
|
|
117
|
+
`)}}Ye.CertificateTag="CERTIFICATE",Ye.CrlTag="CRL",Ye.CertificateRequestTag="CERTIFICATE REQUEST",Ye.PublicKeyTag="PUBLIC KEY",Ye.PrivateKeyTag="PRIVATE KEY";class Ot extends Pt{static isAsnEncoded(t){return P.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(Ye.isPem(t))return Ye.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 Ye.isPem(r)?Ye.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){Ot.isAsnEncoded(t[0])?super(Ot.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return Ye.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ar extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,It):super(t),this.tag=Ye.PublicKeyTag}async export(...t){let r,i=["verify"],n={hash:"SHA-256",...this.algorithm};return t.length>1?(n=t[0]||n,i=t[1]||i,r=t[2]||Je.get()):r=t[0]||Je.get(),r.subtle.importKey("spki",this.rawData,n,!0,i)}onInit(t){const r=tt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Tr:{const n=G.parse(t.subjectPublicKey,Xs),s=P.toUint8Array(n.modulus);i.publicExponent=P.toUint8Array(n.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,n="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(n=t[0]||n,i=t[1]||Je.get()):i=t[0]||Je.get(),await i.subtle.digest(n,this.rawData)}async getKeyIdentifier(t){t||(t=Je.get());const r=G.parse(this.rawData,It);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,It);switch(t.Algorithm=or.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Tr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class mt{static register(t,r){this.items.set(t,r)}static create(t){const r=new gt(t),i=this.items.get(r.type);return i?new i(t):r}}mt.items=new Map;const ro="crypto.signatureFormatter";class Jh{toAsnSignature(t,r){return P.toArrayBuffer(r)}toWebSignature(t,r){return P.toArrayBuffer(r)}}class io extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,wr):super(t),this.tag=Ye.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=G.serialize(r),this.serialNumber=L.ToHex(r.serialNumber),this.subjectName=new Rt(r.subject),this.subject=new Rt(r.subject).toString(),this.issuerName=new Rt(r.issuer),this.issuer=this.issuerName.toString();const i=tt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const n=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!n)throw new Error("Cannot get 'notBefore' value");this.notBefore=n;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>mt.create(G.serialize(a)))),this.publicKey=new ar(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=Je.get()){let i,n;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},n=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},n=await s.publicKey.export(i,["verify"],r);else if(s instanceof ar)i={...s.algorithm,...this.signatureAlgorithm},n=await s.export(i,["verify"],r);else if(P.isBufferSource(s)){const d=new ar(s);i={...d.algorithm,...this.signatureAlgorithm},n=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},n=s}catch{return!1}const a=tt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,n,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Je.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Je.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,wr),i=r.tbsCertificate,n=new ue("",{Version:`${br[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":or.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&&(n["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(n["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Extensions=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends gt{static async create(t,r=!1,i=Je.get()){if(t instanceof io||sr.isCryptoKey(t)){const n=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",n),c=await new ar(s).getKeyIdentifier(i);return new Ai(L.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if(P.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new Qt({keyIdentifier:new Wo(L.FromHex(t[0]))});super(Go,t[1],G.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?G.parse(r.name.rawData,$e):r.name,n=new Qt({authorityCertIssuer:i,authorityCertSerialNumber:L.FromHex(r.serialNumber)});super(Go,t[1],G.serialize(n))}}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,Qt);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,Qt);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class hd extends gt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(yl,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}}hd.NAME="Basic Constraints";var yd;(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"})(yd||(yd={}));class gd extends gt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(kl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>$t.toString(r)).join(", "),t}}gd.NAME="Extended Key Usages";var _a;(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"})(_a||(_a={}));class Ta extends gt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ls);this.usages=r.toNumber()}else{const r=new ls(t[0]);super(Sl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ls);return t[""]=r.toJSON().join(", "),t}}Ta.NAME="Key Usages";class no extends gt{static async create(t,r=!1,i=Je.get()){let n;t instanceof ar?n=t.rawData:"publicKey"in t?n=t.publicKey.rawData:P.isBufferSource(t)?n=t:n=await i.subtle.exportKey("spki",t);const a=await new ar(n).getKeyIdentifier(i);return new no(L.ToHex(a),r)}constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,Dt);this.keyId=L.ToHex(r)}else{const r=typeof t[0]=="string"?L.FromHex(t[0]):t[0],i=new Dt(r);super(Nl,t[1],G.serialize(i)),this.keyId=L.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,Dt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Va extends gt{constructor(...t){P.isBufferSource(t[0])?super(t[0]):super(Il,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=G.parse(t.extnValue,hs);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Va.NAME="Subject Alternative Name";class md extends gt{constructor(...t){var r;if(P.isBufferSource(t[0])){super(t[0]);const i=G.parse(this.value,sn);this.policies=i.map(n=>n.policyIdentifier)}else{const i=t[0],n=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(ml,n,G.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},$t.toString(r))),t}}md.NAME="Certificate Policies",mt.register(ml,md);class Mr extends Pt{constructor(...t){let r;if(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],n=Array.isArray(t[1])?t[1].map(s=>P.toArrayBuffer(s)):[];r=G.serialize(new Bt({type:i,values:n}))}super(r,Bt)}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]=$t.toString(this.type)),t}}Mr.NAME="Attribute";class bd extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(yu,[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],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}bd.NAME="Challenge Password";class ja extends Mr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=t[0],n=new Xt;for(const s of i)n.push(G.parse(s.rawData,st));super(ya,[G.serialize(n)])}(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],Xt);this.items=r.map(i=>mt.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}}ja.NAME="Extensions";class oo{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}}oo.items=new Map;let Da=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:jn,parameters:null});case"sha-256":return new H({algorithm:Js,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,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 jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Js:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Da=u([oa()],Da),tt.registerSingleton(Qn,Da);class rt{addPadding(t,r){const i=P.toUint8Array(r),n=new Uint8Array(t);return n.set(i,t-i.length),n}removePadding(t,r=!1){let i=P.toUint8Array(t);for(let n=0;n<i.length;n++)if(i[n]){i=i.slice(n);break}if(r&&i[0]>127){const n=new Uint8Array(i.length+1);return n.set(i,1),n.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,n=rt.namedCurveSize.get(i)||rt.defaultNamedCurveSize,s=new Vn,a=P.toUint8Array(r);return s.r=this.removePadding(a.slice(0,n),!0),s.s=this.removePadding(a.slice(n,n+n),!0),G.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=G.parse(r,Vn),n=t.namedCurve,s=rt.namedCurveSize.get(n)||rt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return dp(a,c)}return null}}rt.namedCurveSize=new Map,rt.defaultNamedCurveSize=32;const wd="1.3.101.110",vd="1.3.101.111",kd="1.3.101.112",Cd="1.3.101.113";let Ma=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=kd;break;case"ed448":r=Cd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=wd;break;case"x448":r=vd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case kd:return{name:"EdDSA",namedCurve:"Ed25519"};case Cd:return{name:"EdDSA",namedCurve:"Ed448"};case wd:return{name:"ECDH-ES",namedCurve:"X25519"};case vd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Ma=u([oa()],Ma),tt.registerSingleton(Qn,Ma);class Yh extends Ot{constructor(t){Ot.isAsnEncoded(t)?super(t,vi):super(t),this.tag=Ye.CertificateRequestTag}onInit(t){this.tbs=G.serialize(t.certificationRequestInfo),this.publicKey=new ar(t.certificationRequestInfo.subjectPKInfo);const r=tt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(n=>oo.create(G.serialize(n)));const i=this.getAttribute(ya);this.extensions=[],i instanceof ja&&(this.extensions=i.items),this.subjectName=new Rt(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=Je.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),n=tt.resolveAll(ro).reverse();let s=null;for(const c of n)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=G.parse(this.rawData,vi),i=r.certificationRequestInfo,n=new ue("",{Version:`${br[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}n.Attributes=s}return t.Data=n,t.Signature=new ue("",{Algorithm:or.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Yh.NAME="PKCS#10 Certificate Request";var Sd;(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"})(Sd||(Sd={})),mt.register(yl,hd),mt.register(kl,gd),mt.register(Sl,Ta),mt.register(Nl,no),mt.register(Go,Ai),mt.register(Il,Va),oo.register(yu,bd),oo.register(ya,ja),tt.registerSingleton(ro,Jh),tt.registerSingleton(ro,rt),rt.namedCurveSize.set("P-256",32),rt.namedCurveSize.set("K-256",32),rt.namedCurveSize.set("P-384",48),rt.namedCurveSize.set("P-521",66);function xd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const n of r.extensions)if(n instanceof Va){const s=n.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(n instanceof Ta){const s=Object.values(_a),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(n.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Zh(){const e=xd(),t=o.ref({}),r=n=>{if(!(n.id in t.value))try{t.value[n.id]=e.parseMetaCertificateData(n.cert)}catch{t.value[n.id]=void 0}return t.value[n.id]};return{certificateDataCache:t,getCertificateData:n=>{const s=r(n);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Qh={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 Xh(){const e=ji.createI18n("en-us",Qh);return{i18n:e,i18nT:ji.i18nTComponent(e)}}const bt={useCertificate:Zh,useI18n:Xh,useX509:xd},so="/v2/control-planes/{controlPlaneId}/core-entities",ao="/{workspace}",Bi={list:{konnect:`${so}/certificates`,kongManager:`${ao}/certificates`},form:{konnect:{create:`${so}/certificates`,edit:`${so}/certificates/{id}`,validate:`${so}/v1/schemas/json/certificate/validate`},kongManager:{create:`${ao}/certificates`,edit:`${ao}/certificates/{id}`,validate:`${ao}/schemas/certificates/validate`}}};var $a=(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))($a||{}),cr=(e=>(e.Edit="edit",e.Create="create",e))(cr||{}),Ut=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ut||{}),ce=(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))(ce||{}),fe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(fe||{});function ey(){return{getAxiosInstance:(e={})=>{try{const t=o.inject("get-axios-instance",void 0);return typeof t=="function"?t(e):ic.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),ic.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 ty(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const Pa="khcp-user-table-preferences",ry={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function iy(){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(Pa));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const n=t();n.set(r,i),localStorage.setItem(Pa,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||ry},deleteAllTablePreferences:()=>{localStorage.removeItem(Pa)}}}function Ra(e={}){const{getAxiosInstance:t}=ey();return{axiosInstance:t(e)}}const ny={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},oy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},sy={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."}},ay={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},cy={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},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"}},ly={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},uy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},dy={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},fy={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},py={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},hy={global:ny,deleteModal:oy,baseForm:sy,baseTable:ay,baseConfigCard:cy,filter:ly,debouncedFilter:uy,errors:dy,validationErrors:fy,toggleModal:py};function co(){const e=ji.createI18n("en-us",hy);return{i18n:e,i18nT:ji.i18nTComponent(e)}}function Ad(){const e=(r,i)=>(i==null?void 0:i[r])??void 0,t=(r,i)=>{if(r.length!==i.length)return!1;const n=new Set([...r,...i]);for(const s of n){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,n)=>{if(n){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,n)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=n[r]===void 0||n[r]===null?"":n[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(n[r])&&(a=n[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function yy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="1000");const{axiosInstance:n}=Ra({headers:e.requestHeaders}),{i18n:{t:s}}=co(),{debounce:a}=ty(),c=a(async S=>{await E(S)},200),l=o.ref(!1),d=o.ref(""),y=o.ref(""),p=o.ref([]),I=o.ref([]),w=o.ref(void 0),h=o.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}=Ad(),k=async()=>{try{l.value=!0;const{data:S}=await n.get(`${g}?size=${r}`);S!=null&&S.next||(w.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),I.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=I.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},B=o.ref(""),E=async S=>{var C,A,M;if(B.value!==S)if(B.value=S||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let _=g+"";S&&(_+=`/${S}`);const{data:N}=await n.get(`${_}?size=${r}`);i.fetchedItemsKey in N?p.value=N[i.fetchedItemsKey]:N!=null&&N.id?p.value=[N]:p.value=[]}else if(S){const _=[];b(S)&&i.searchKeys.includes("id")?_.push((async()=>{const{data:q}=await n.get(`${g}/${S}`);return[q[i.fetchedItemsKey]??q]})()):_.push(...i.searchKeys.filter(q=>q!=="id").map(async q=>{const{data:j}=await n.get(`${g}?${q}=${S}`);return j[i.fetchedItemsKey]}));const N=await Promise.all(_),re=new Set;p.value=[],(C=N==null?void 0:N.forEach)==null||C.call(N,q=>{var j;(j=q==null?void 0:q.forEach)==null||j.call(q,Z=>{re.has(Z.id)||(re.add(Z.id),p.value.push(Z))})})}else p.value=I.value}catch(_){((A=_==null?void 0:_.response)==null?void 0:A.status)===404?y.value=s("debouncedFilter.errors.invalid"):(p.value=[],d.value=s("debouncedFilter.errors.fetch"))}finally{l.value=!1}else l.value=!0,y.value="",S?(p.value=(M=w.value)==null?void 0:M.filter(_=>{var N;let re=!1;for(const q of i.searchKeys){const j=typeof _[q]=="string"?(N=_[q])==null?void 0:N.toLowerCase():_[q];j!=null&&j.includes(S.toLowerCase())&&(re=!0)}return re}),(!p.value||!p.value.length)&&(y.value=s("debouncedFilter.errors.invalid"))):p.value=w.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:w,loadItems:k,debouncedQueryChange:c}}function gy(e,t){const r=o.unref(t),i=o.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",n=>`${i.value.href}/${n}`}function my(){const{i18n:{t:e}}=co();return{getMessageFromError:t=>{var r,i,n,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((n=t.response.data.details)!=null&&n.length)return t.response.data.details.map(a=>{let c=e("errors.unexpected");return a.messages&&typeof a.messages=="object"&&a.messages.length&&(c=a.messages.join(", ")),a.field?`${a.field} - ${c}`:c}).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 by(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),n=`${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(n)&&!s&&new URL(n))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Bd(e,t){const r=o.ref(o.unref(e)),i=o.ref(o.unref(t)),n=o.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=o.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:I}=a;try{let w=new URL(s.value.href);return n.value&&I?(w.search="",w=r.value.isExactMatch?new URL(`${w.href}/${I}/`):new URL(`${w.href}?filter[name][contains]=${I}`)):(n.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(l))),d&&c!==1&&w.searchParams.append("offset",String(d)),w.href}catch(w){return console.error("RouteList(fetcher)",w),i.value}}}function wy(e,t,r="data"){var i;const n=o.unref(t),{axiosInstance:s}=Ra({...e.axiosRequestConfig,headers:{...(i=e.axiosRequestConfig)==null?void 0:i.headers,...e.requestHeaders}}),a=Bd(e,n),c=o.ref({status:Ut.Idle});return{fetcher:async l=>{var d;try{c.value={status:Ut.Loading};let y=a(l);y.includes("filter[name]")&&(y=`${y}&page[size]=${l.pageSize}&page[number]=${l.page}`);const p=await s.get(y);if(p.status>=400)throw p;const I=p.data,w=r&&r.replace(/[^\w-_]/gi,"");let h;I[w]&&Array.isArray(I[w])?h=I[w]:Array.isArray(I)?h=I:h=Object.keys(I).length?[I]:[];const g={data:h,total:h.length,...I.offset?{pagination:{offset:I.offset}}:null};return c.value={status:Ut.Idle,response:g},g}catch(y){const p={data:[],total:0};return l.query&&(((d=y.response)==null?void 0:d.status)===404||y.status===404)?(c.value={status:Ut.NoResults,response:p,error:y.response?y:{response:y}},p):(c.value={status:Ut.Error,response:p,error:y.response?y:{response:y}},p)}},fetcherState:c}}function vy(){const e=(r,i="_")=>r?r.split(i).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const Id=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ed=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(Id);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Nd=e=>e==="*"||e==="x"||e==="X",Od=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},ky=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Cy=(e,t)=>{if(Nd(e)||Nd(t))return 0;const[r,i]=ky(Od(e),Od(t));return r>i?1:r<i?-1:0},_d=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const i=Cy(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Sy=(e,t)=>{const r=Ed(e),i=Ed(t),n=r.pop(),s=i.pop(),a=_d(r,i);return a!==0?a:n&&s?_d(n.split("."),s.split(".")):n||s?n?-1:1:0},Td=(e,t,r)=>{xy(r);const i=Sy(e,t);return Vd[r].includes(i)},Vd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},jd=Object.keys(Vd),xy=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(jd.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${jd.join("|")}`)},Ay=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Id.test(e);function By(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!Ay(n))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Td(n,a,"<")||c&&Td(n,c,">"))}function Iy(e){const t=o.ref(0),r=o.ref(0),i=o.ref(!1);return o.watch(e,n=>{n&&!i.value&&(t.value=n.offsetWidth,r.value=n.scrollWidth,i.value=!0)}),{isTruncated:o.computed(()=>t.value<r.value)}}function Ey(){const{i18n:{t:e}}=co();return{utf8Name:t=>/^[\p{N}\p{L}.\-_~]*$/u.test(t)?"":e("validationErrors.utf8Name")}}const Be={useAxios:Ra,useDebouncedFilter:yy,useDeleteUrlBuilder:gy,useErrors:my,useExternalLinkCreator:by,useFetcher:wy,useFetchUrlBuilder:Bd,useHelpers:Ad,useStringHelpers:vy,useI18n:co,useGatewayFeatureSupported:By,useTruncationDetector:Iy,useValidators:Ey},Ny={key:0,class:"config-card-fieldset-title"},Oy=o.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(),n=o.computed(()=>t.item.key??"json-array-item"),s=o.computed(()=>t.item.value??t.item),a=o.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=o.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:o.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:o.withCtx(()=>[e.isArrayItem?(o.openBlock(),o.createElementBlock("legend",Ny,[o.createElementVNode("b",null,o.toDisplayString(c.value),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(a.value),(y,p)=>(o.openBlock(),o.createBlock(lo,{key:`${n.value}-property-${p}`,item:{key:y,label:o.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,n]of t)r[i]=n;return r},Dd=ct(Oy,[["__scopeId","data-v-68ca83ec"]]),_y=o.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KButton");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.value||o.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),Ty=ct(_y,[["__scopeId","data-v-c96811e5"]]),Vy=o.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Be.useI18n();return(r,i)=>{const n=o.resolveComponent("KBadge");return o.openBlock(),o.createBlock(n,{appearance:e.status?"success":"neutral"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.status?o.unref(t)("baseConfigCard.statusBadge.enabledLabel"):o.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),jy="#0044f4",Dy="#e0e4ea",My="#3a3f51",$y="#afb7c5",Py="1px",Ry="20px",Uy={class:"config-card-details-row"},Ly=["data-testid"],Fy=["data-testid"],Hy=["data-testid"],qy=["data-testid"],Ky={key:1},zy=["data-testid"],Gy=["data-testid"],Wy=["data-testid"],Jy=["data-testid"],Yy={name:"ConfigCardItem",components:{JsonCardItem:Dd,StatusBadge:Vy,InternalLinkItem:Ty}},Zy=o.defineComponent({...Yy,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}){o.useCssVars(h=>({"07753575":y.value?"none":`solid ${o.unref(Py)} ${o.unref(Dy)}`,"32d44ea8":d.value&&c.value?"block":"flex","5036b738":d.value&&c.value?"100%":r.slim?"50%":"25%","5038fd13":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,n=o.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Be.useI18n(),c=o.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=o.computed(()=>!!(r.item.tooltip||n["label-tooltip"])),d=o.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=o.computed(()=>r.item.type===ce.JsonArray),p=o.computed(()=>{switch(r.item.type){case ce.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 ce.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.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 ce.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":s("baseConfigCard.copy.tooltip",{label:r.item.label})}};case ce.Date:return{tag:"div",attrs:{"data-testid":`${r.item.key}-date`},text:a(r.item.value)};case ce.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${r.item.key}-badge-status`,status:r.item.value}};case ce.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case ce.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case ce.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${r.item.key}-internal-link`,item:r.item,onNavigationClick:h=>{i("navigation-click",h)}}};case ce.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${r.item.key}-external-link`,href:r.item.value},text:r.item.value};case ce.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${r.item.key}-json-content`,item:r.item}};case ce.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=o.ref(),{isTruncated:w}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),k=o.resolveComponent("KBadge"),B=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",Uy,[o.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[o.renderSlot(h.$slots,"label",{item:e.item},()=>[o.createVNode(b,{"tooltip-attributes":{maxWidth:"500px"}},o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:o.withCtx(()=>[o.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[o.renderSlot(h.$slots,"label-tooltip",{},()=>[o.createTextVNode(o.toDisplayString(e.item.tooltip),1)],!0)],8,Fy)]),key:"0"}:void 0]),1024)],!0)],8,Ly),o.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[o.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(o.openBlock(),o.createElementBlock("div",Ky,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(p.value.tag),o.normalizeProps(o.guardReactiveProps(p.value.attrs)),{default:o.withCtx(()=>[p.value.additionalComponent==="KBadge"?(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(k,{key:`${e.item.key}-badge-tag-${C}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${C}`,tooltip:S,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,zy)):o.createCommentVNode("",!0),p.value.additionalComponent==="KCopy"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(B,o.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${C}`,"data-testid":`${e.item.key}-copy-uuid-${C}`,text:S}),null,16,["data-testid","text"]))),128))],8,Gy)):p.value.additionalComponent==="KMethodBadge"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(k,{key:`${e.item.key}-badge-method-${C}`,appearance:Object.values(o.unref(sp.BadgeMethodAppearances)).includes(S.toLowerCase())?S.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${C}`},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(S),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Wy)):o.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(o.openBlock(),o.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.value,(S,C)=>(o.openBlock(),o.createBlock(Dd,{key:`json-array-item-${C}`,index:C,"is-array-item":"",item:S},null,8,["index","item"]))),128))],8,Jy)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(w)?e.item.value:""},{default:o.withCtx(()=>[o.createElementVNode("span",{ref_key:"textContent",ref:I,class:o.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},o.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(o.openBlock(),o.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,qy))],!0)],8,Hy)])}}}),lo=ct(Zy,[["__scopeId","data-v-d056663c"]]),Qy={class:"json-config"},Xy={key:0,class:"json-endpoint"},Md=o.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){o.useCssVars(n=>({"954d3eca":`${i.value}ch`}));const t=e,r=o.computed(()=>t.jsonRecord),i=o.computed(()=>{var n;if(!t.fetcherUrl)return 0;const s=(n=t.fetcherUrl)==null?void 0:n.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(n,s)=>{const a=o.resolveComponent("KBadge"),c=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",Qy,[t.fetcherUrl?(o.openBlock(),o.createElementBlock("div",Xy,[o.createVNode(a,{appearance:t.requestMethod},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),o.createVNode(c,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):o.createCommentVNode("",!0),t.jsonRecord?(o.openBlock(),o.createBlock(c,{key:1,id:"json-codeblock",class:o.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):o.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function $d(e){return typeof e>"u"||e===null}function eg(e){return typeof e=="object"&&e!==null}function tg(e){return Array.isArray(e)?e:$d(e)?[]:[e]}function rg(e,t){var r,i,n,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)n=s[r],e[n]=t[n];return e}function ig(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function ng(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var og=$d,sg=eg,ag=tg,cg=ig,lg=ng,ug=rg,ke={isNothing:og,isObject:sg,toArray:ag,repeat:cg,isNegativeZero:lg,extend:ug};function Pd(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 Ii(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=
|
|
120
|
-
`+c;for(d=
|
|
119
|
+
`+e.mark.snippet),i+" "+r):i}function Ii(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Pd(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ii.prototype=Object.create(Error.prototype),Ii.prototype.constructor=Ii,Ii.prototype.toString=function(e){return this.name+": "+Pd(this,e)};var Pe=Ii;function Ua(e,t,r,i,n){var s="",a="",c=Math.floor(n/2)-1;return i-t>c&&(s=" ... ",t=i-c+s.length),r-i>c&&(a=" ...",r=i+c-a.length),{str:s+e.slice(t,r).replace(/\t/g,"→")+a,pos:i-t+s.length}}function La(e,t){return ke.repeat(" ",t-e.length)+e}function dg(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],n=[],s,a=-1;s=r.exec(e.buffer);)n.push(s.index),i.push(s.index+s[0].length),e.position<=s.index&&a<0&&(a=i.length-2);a<0&&(a=i.length-1);var c="",l,d,y=Math.min(e.line+t.linesAfter,n.length).toString().length,p=t.maxLength-(t.indent+y+3);for(l=1;l<=t.linesBefore&&!(a-l<0);l++)d=Ua(e.buffer,i[a-l],n[a-l],e.position-(i[a]-i[a-l]),p),c=ke.repeat(" ",t.indent)+La((e.line-l+1).toString(),y)+" | "+d.str+`
|
|
120
|
+
`+c;for(d=Ua(e.buffer,i[a],n[a],e.position,p),c+=ke.repeat(" ",t.indent)+La((e.line+1).toString(),y)+" | "+d.str+`
|
|
121
121
|
`,c+=ke.repeat("-",t.indent+y+3+d.pos)+`^
|
|
122
|
-
`,l=1;l<=t.linesAfter&&!(a+l>=n.length);l++)d=
|
|
123
|
-
`;return c.replace(/\n$/,"")}var
|
|
124
|
-
\r`;function
|
|
125
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function
|
|
126
|
-
`,t-1))}function
|
|
127
|
-
`,s?1+l:l):n===
|
|
122
|
+
`,l=1;l<=t.linesAfter&&!(a+l>=n.length);l++)d=Ua(e.buffer,i[a+l],n[a+l],e.position-(i[a]-i[a+l]),p),c+=ke.repeat(" ",t.indent)+La((e.line+l+1).toString(),y)+" | "+d.str+`
|
|
123
|
+
`;return c.replace(/\n$/,"")}var fg=dg,pg=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],hg=["scalar","sequence","mapping"];function yg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function gg(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(pg.indexOf(r)===-1)throw new Pe('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=yg(t.styleAliases||null),hg.indexOf(this.kind)===-1)throw new Pe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Te=gg;function Rd(e,t){var r=[];return e[t].forEach(function(i){var n=r.length;r.forEach(function(s,a){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(n=a)}),r[n]=i}),r}function mg(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,r;function i(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(i);return e}function Fa(e){return this.extend(e)}Fa.prototype.extend=function(e){var t=[],r=[];if(e instanceof Te)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 Pe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(n){if(!(n instanceof Te))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new Pe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new Pe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(n){if(!(n instanceof Te))throw new Pe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Fa.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Rd(i,"implicit"),i.compiledExplicit=Rd(i,"explicit"),i.compiledTypeMap=mg(i.compiledImplicit,i.compiledExplicit),i};var Ud=Fa,Ld=new Te("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Fd=new Te("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Hd=new Te("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),qd=new Ud({explicit:[Ld,Fd,Hd]});function bg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function wg(){return null}function vg(e){return e===null}var Kd=new Te("tag:yaml.org,2002:null",{kind:"scalar",resolve:bg,construct:wg,predicate:vg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function kg(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 Cg(e){return e==="true"||e==="True"||e==="TRUE"}function Sg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var zd=new Te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:kg,construct:Cg,predicate:Sg,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 xg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ag(e){return 48<=e&&e<=55}function Bg(e){return 48<=e&&e<=57}function Ig(e){if(e===null)return!1;var t=e.length,r=0,i=!1,n;if(!t)return!1;if(n=e[r],(n==="-"||n==="+")&&(n=e[++r]),n==="0"){if(r+1===t)return!0;if(n=e[++r],n==="b"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(n!=="0"&&n!=="1")return!1;i=!0}return i&&n!=="_"}if(n==="x"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!xg(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!Ag(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!Bg(e.charCodeAt(r)))return!1;i=!0}return!(!i||n==="_")}function Eg(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 Ng(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ke.isNegativeZero(e)}var Gd=new Te("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ig,construct:Eg,predicate:Ng,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"]}}),Og=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function _g(e){return!(e===null||!Og.test(e)||e[e.length-1]==="_")}function Tg(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 Vg=/^[-+]?[0-9]+e/;function jg(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),Vg.test(r)?r.replace("e",".e"):r}function Dg(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ke.isNegativeZero(e))}var Wd=new Te("tag:yaml.org,2002:float",{kind:"scalar",resolve:_g,construct:Tg,predicate:Dg,represent:jg,defaultStyle:"lowercase"}),Jd=qd.extend({implicit:[Kd,zd,Gd,Wd]}),Yd=Jd,Zd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Qd=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 Mg(e){return e===null?!1:Zd.exec(e)!==null||Qd.exec(e)!==null}function $g(e){var t,r,i,n,s,a,c,l=0,d=null,y,p,I;if(t=Zd.exec(e),t===null&&(t=Qd.exec(e)),t===null)throw new Error("Date resolve error");if(r=+t[1],i=+t[2]-1,n=+t[3],!t[4])return new Date(Date.UTC(r,i,n));if(s=+t[4],a=+t[5],c=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(y=+t[10],p=+(t[11]||0),d=(y*60+p)*6e4,t[9]==="-"&&(d=-d)),I=new Date(Date.UTC(r,i,n,s,a,c,l)),d&&I.setTime(I.getTime()-d),I}function Pg(e){return e.toISOString()}var Xd=new Te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Mg,construct:$g,instanceOf:Date,represent:Pg});function Rg(e){return e==="<<"||e===null}var ef=new Te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Rg}),Ha=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
124
|
+
\r`;function Ug(e){if(e===null)return!1;var t,r,i=0,n=e.length,s=Ha;for(r=0;r<n;r++)if(t=s.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;i+=6}return i%8===0}function Lg(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,s=Ha,a=0,c=[];for(t=0;t<n;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)),a=a<<6|s.indexOf(i.charAt(t));return r=n%4*6,r===0?(c.push(a>>16&255),c.push(a>>8&255),c.push(a&255)):r===18?(c.push(a>>10&255),c.push(a>>2&255)):r===12&&c.push(a>>4&255),new Uint8Array(c)}function Fg(e){var t="",r=0,i,n,s=e.length,a=Ha;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 n=s%3,n===0?(t+=a[r>>18&63],t+=a[r>>12&63],t+=a[r>>6&63],t+=a[r&63]):n===2?(t+=a[r>>10&63],t+=a[r>>4&63],t+=a[r<<2&63],t+=a[64]):n===1&&(t+=a[r>>2&63],t+=a[r<<4&63],t+=a[64],t+=a[64]),t}function Hg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var tf=new Te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ug,construct:Lg,predicate:Hg,represent:Fg}),qg=Object.prototype.hasOwnProperty,Kg=Object.prototype.toString;function zg(e){if(e===null)return!0;var t=[],r,i,n,s,a,c=e;for(r=0,i=c.length;r<i;r+=1){if(n=c[r],a=!1,Kg.call(n)!=="[object Object]")return!1;for(s in n)if(qg.call(n,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 Gg(e){return e!==null?e:[]}var rf=new Te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:zg,construct:Gg}),Wg=Object.prototype.toString;function Jg(e){if(e===null)return!0;var t,r,i,n,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1){if(i=a[t],Wg.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[t]=[n[0],i[n[0]]]}return!0}function Yg(e){if(e===null)return[];var t,r,i,n,s,a=e;for(s=new Array(a.length),t=0,r=a.length;t<r;t+=1)i=a[t],n=Object.keys(i),s[t]=[n[0],i[n[0]]];return s}var nf=new Te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Jg,construct:Yg}),Zg=Object.prototype.hasOwnProperty;function Qg(e){if(e===null)return!0;var t,r=e;for(t in r)if(Zg.call(r,t)&&r[t]!==null)return!1;return!0}function Xg(e){return e!==null?e:{}}var of=new Te("tag:yaml.org,2002:set",{kind:"mapping",resolve:Qg,construct:Xg}),qa=Yd.extend({implicit:[Xd,ef],explicit:[tf,rf,nf,of]}),Lt=Object.prototype.hasOwnProperty,uo=1,sf=2,af=3,fo=4,Ka=1,em=2,cf=3,tm=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,rm=/[\x85\u2028\u2029]/,im=/[,\[\]\{\}]/,lf=/^(?:!|!!|![a-z\-]+!)$/i,uf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function df(e){return Object.prototype.toString.call(e)}function wt(e){return e===10||e===13}function lr(e){return e===9||e===32}function ze(e){return e===9||e===32||e===10||e===13}function $r(e){return e===44||e===91||e===93||e===123||e===125}function nm(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function om(e){return e===120?2:e===117?4:e===85?8:0}function sm(e){return 48<=e&&e<=57?e-48:-1}function ff(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 am(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var pf=new Array(256),hf=new Array(256),Pr=0;Pr<256;Pr++)pf[Pr]=ff(Pr)?1:0,hf[Pr]=ff(Pr);function cm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||qa,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 yf(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=fg(r),new Pe(t,r)}function J(e,t){throw yf(e,t)}function po(e,t){e.onWarning&&e.onWarning.call(null,yf(e,t))}var gf={YAML:function(e,t,r){var i,n,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"),n=parseInt(i[1],10),s=parseInt(i[2],10),n!==1&&J(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=s<2,s!==1&&s!==2&&po(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var i,n;r.length!==2&&J(e,"TAG directive accepts exactly two arguments"),i=r[0],n=r[1],lf.test(i)||J(e,"ill-formed tag handle (first argument) of the TAG directive"),Lt.call(e.tagMap,i)&&J(e,'there is a previously declared suffix for "'+i+'" tag handle'),uf.test(n)||J(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{J(e,"tag prefix is malformed: "+n)}e.tagMap[i]=n}};function Ft(e,t,r,i){var n,s,a,c;if(t<r){if(c=e.input.slice(t,r),i)for(n=0,s=c.length;n<s;n+=1)a=c.charCodeAt(n),a===9||32<=a&&a<=1114111||J(e,"expected valid JSON character");else tm.test(c)&&J(e,"the stream contains non-printable characters");e.result+=c}}function mf(e,t,r,i){var n,s,a,c;for(ke.isObject(r)||J(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(r),a=0,c=n.length;a<c;a+=1)s=n[a],Lt.call(t,s)||(t[s]=r[s],i[s]=!0)}function Rr(e,t,r,i,n,s,a,c,l){var d,y;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),d=0,y=n.length;d<y;d+=1)Array.isArray(n[d])&&J(e,"nested arrays are not supported inside keys"),typeof n=="object"&&df(n[d])==="[object Object]"&&(n[d]="[object Object]");if(typeof n=="object"&&df(n)==="[object Object]"&&(n="[object Object]"),n=String(n),t===null&&(t={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(d=0,y=s.length;d<y;d+=1)mf(e,t,s[d],r);else mf(e,t,s,r);else!e.json&&!Lt.call(r,n)&&Lt.call(t,n)&&(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,J(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[n]=s,delete r[n];return t}function za(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,n=e.input.charCodeAt(e.position);n!==0;){for(;lr(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(t&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(wt(n))for(za(e),n=e.input.charCodeAt(e.position),i++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return r!==-1&&i!==0&&e.lineIndent<r&&po(e,"deficient indentation"),i}function ho(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||ze(r)))}function Ga(e,t){t===1?e.result+=" ":t>1&&(e.result+=ke.repeat(`
|
|
126
|
+
`,t-1))}function lm(e,t,r){var i,n,s,a,c,l,d,y,p=e.kind,I=e.result,w;if(w=e.input.charCodeAt(e.position),ze(w)||$r(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)&&(n=e.input.charCodeAt(e.position+1),ze(n)||r&&$r(n)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;w!==0;){if(w===58){if(n=e.input.charCodeAt(e.position+1),ze(n)||r&&$r(n))break}else if(w===35){if(i=e.input.charCodeAt(e.position-1),ze(i))break}else{if(e.position===e.lineStart&&ho(e)||r&&$r(w))break;if(wt(w))if(l=e.line,d=e.lineStart,y=e.lineIndent,be(e,!1,-1),e.lineIndent>=t){c=!0,w=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Ft(e,s,a,!1),Ga(e,e.line-l),s=a=e.position,c=!1),lr(w)||(a=e.position+1),w=e.input.charCodeAt(++e.position)}return Ft(e,s,a,!1),e.result?!0:(e.kind=p,e.result=I,!1)}function um(e,t){var r,i,n;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,i=n=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(Ft(e,i,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)i=e.position,e.position++,n=e.position;else return!0;else wt(r)?(Ft(e,i,n,!0),Ga(e,be(e,!1,t)),i=n=e.position):e.position===e.lineStart&&ho(e)?J(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);J(e,"unexpected end of the stream within a single quoted scalar")}function dm(e,t){var r,i,n,s,a,c;if(c=e.input.charCodeAt(e.position),c!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(c=e.input.charCodeAt(e.position))!==0;){if(c===34)return Ft(e,r,e.position,!0),e.position++,!0;if(c===92){if(Ft(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),wt(c))be(e,!1,t);else if(c<256&&pf[c])e.result+=hf[c],e.position++;else if((a=om(c))>0){for(n=a,s=0;n>0;n--)c=e.input.charCodeAt(++e.position),(a=nm(c))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=am(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else wt(c)?(Ft(e,r,i,!0),Ga(e,be(e,!1,t)),r=i=e.position):e.position===e.lineStart&&ho(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 fm(e,t){var r=!0,i,n,s,a=e.tag,c,l=e.anchor,d,y,p,I,w,h=Object.create(null),g,b,k,B;if(B=e.input.charCodeAt(e.position),B===91)y=93,w=!1,c=[];else if(B===123)y=125,w=!0,c={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=c),B=e.input.charCodeAt(++e.position);B!==0;){if(be(e,!0,t),B=e.input.charCodeAt(e.position),B===y)return e.position++,e.tag=a,e.anchor=l,e.kind=w?"mapping":"sequence",e.result=c,!0;r?B===44&&J(e,"expected the node content, but found ','"):J(e,"missed comma between flow collection entries"),b=g=k=null,p=I=!1,B===63&&(d=e.input.charCodeAt(e.position+1),ze(d)&&(p=I=!0,e.position++,be(e,!0,t))),i=e.line,n=e.lineStart,s=e.position,Ur(e,t,uo,!1,!0),b=e.tag,g=e.result,be(e,!0,t),B=e.input.charCodeAt(e.position),(I||e.line===i)&&B===58&&(p=!0,B=e.input.charCodeAt(++e.position),be(e,!0,t),Ur(e,t,uo,!1,!0),k=e.result),w?Rr(e,c,h,b,g,k,i,n,s):p?c.push(Rr(e,null,h,b,g,k,i,n,s)):c.push(g),be(e,!0,t),B=e.input.charCodeAt(e.position),B===44?(r=!0,B=e.input.charCodeAt(++e.position)):r=!1}J(e,"unexpected end of the stream within a flow collection")}function pm(e,t){var r,i,n=Ka,s=!1,a=!1,c=t,l=0,d=!1,y,p;if(p=e.input.charCodeAt(e.position),p===124)i=!1;else if(p===62)i=!0;else return!1;for(e.kind="scalar",e.result="";p!==0;)if(p=e.input.charCodeAt(++e.position),p===43||p===45)Ka===n?n=p===43?cf:em:J(e,"repeat of a chomping mode identifier");else if((y=sm(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"):(c=t+y-1,a=!0);else break;if(lr(p)){do p=e.input.charCodeAt(++e.position);while(lr(p));if(p===35)do p=e.input.charCodeAt(++e.position);while(!wt(p)&&p!==0)}for(;p!==0;){for(za(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!a||e.lineIndent<c)&&p===32;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>c&&(c=e.lineIndent),wt(p)){l++;continue}if(e.lineIndent<c){n===cf?e.result+=ke.repeat(`
|
|
127
|
+
`,s?1+l:l):n===Ka&&s&&(e.result+=`
|
|
128
128
|
`);break}for(i?lr(p)?(d=!0,e.result+=ke.repeat(`
|
|
129
129
|
`,s?1+l:l)):d?(d=!1,e.result+=ke.repeat(`
|
|
130
130
|
`,l+1)):l===0?s&&(e.result+=" "):e.result+=ke.repeat(`
|
|
131
131
|
`,l):e.result+=ke.repeat(`
|
|
132
|
-
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!wt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Ft(e,r,e.position,!1)}return!0}function
|
|
133
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new
|
|
132
|
+
`,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!wt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Ft(e,r,e.position,!1)}return!0}function bf(e,t){var r,i=e.tag,n=e.anchor,s=[],a,c=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,J(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!ze(a))));){if(c=!0,e.position++,be(e,!0,-1)&&e.lineIndent<=t){s.push(null),l=e.input.charCodeAt(e.position);continue}if(r=e.line,Ur(e,t,af,!1,!0),s.push(e.result),be(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&l!==0)J(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return c?(e.tag=i,e.anchor=n,e.kind="sequence",e.result=s,!0):!1}function hm(e,t,r){var i,n,s,a,c,l,d=e.tag,y=e.anchor,p={},I=Object.create(null),w=null,h=null,g=null,b=!1,k=!1,B;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=p),B=e.input.charCodeAt(e.position);B!==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,(B===63||B===58)&&ze(i))B===63?(b&&(Rr(e,p,I,w,h,null,a,c,l),w=h=g=null),k=!0,b=!0,n=!0):b?(b=!1,n=!0):J(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,B=i;else{if(a=e.line,c=e.lineStart,l=e.position,!Ur(e,r,sf,!1,!0))break;if(e.line===s){for(B=e.input.charCodeAt(e.position);lr(B);)B=e.input.charCodeAt(++e.position);if(B===58)B=e.input.charCodeAt(++e.position),ze(B)||J(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Rr(e,p,I,w,h,null,a,c,l),w=h=g=null),k=!0,b=!1,n=!1,w=e.tag,h=e.result;else if(k)J(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(k)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,c=e.lineStart,l=e.position),Ur(e,t,fo,!0,n)&&(b?h=e.result:g=e.result),b||(Rr(e,p,I,w,h,g,a,c,l),w=h=g=null),be(e,!0,-1),B=e.input.charCodeAt(e.position)),(e.line===s||e.lineIndent>t)&&B!==0)J(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return b&&Rr(e,p,I,w,h,null,a,c,l),k&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),k}function ym(e){var t,r=!1,i=!1,n,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,n="!!",a=e.input.charCodeAt(++e.position)):n="!",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&&!ze(a);)a===33&&(i?J(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),lf.test(n)||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),im.test(s)&&J(e,"tag suffix cannot contain flow indicator characters")}s&&!uf.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:Lt.call(e.tagMap,n)?e.tag=e.tagMap[n]+s:n==="!"?e.tag="!"+s:n==="!!"?e.tag="tag:yaml.org,2002:"+s:J(e,'undeclared tag handle "'+n+'"'),!0}function gm(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&&!ze(r)&&!$r(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 mm(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&&!ze(i)&&!$r(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),Lt.call(e.anchorMap,r)||J(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],be(e,!0,-1),!0}function Ur(e,t,r,i,n){var s,a,c,l=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=c=fo===r||af===r,i&&be(e,!0,-1)&&(d=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)),l===1)for(;ym(e)||gm(e);)be(e,!0,-1)?(d=!0,c=s,e.lineIndent>t?l=1:e.lineIndent===t?l=0:e.lineIndent<t&&(l=-1)):c=!1;if(c&&(c=d||n),(l===1||fo===r)&&(uo===r||sf===r?g=t:g=t+1,b=e.position-e.lineStart,l===1?c&&(bf(e,b)||hm(e,b,g))||fm(e,g)?y=!0:(a&&pm(e,g)||um(e,g)||dm(e,g)?y=!0:mm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&J(e,"alias node should not have any properties")):lm(e,g,uo===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&bf(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(Lt.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 bm(e){var t=e.position,r,i,n,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&&!ze(a);)a=e.input.charCodeAt(++e.position);for(i=e.input.slice(r,e.position),n=[],i.length<1&&J(e,"directive name must not be less than one character in length");a!==0;){for(;lr(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!wt(a));break}if(wt(a))break;for(r=e.position;a!==0&&!ze(a);)a=e.input.charCodeAt(++e.position);n.push(e.input.slice(r,e.position))}a!==0&&za(e),Lt.call(gf,i)?gf[i](e,i,n):po(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"),Ur(e,e.lineIndent-1,fo,!1,!0),be(e,!0,-1),e.checkLineBreaks&&rm.test(e.input.slice(t,e.position))&&po(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ho(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 wf(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 cm(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;)bm(r);return r.documents}function wm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=wf(e,r);if(typeof t!="function")return i;for(var n=0,s=i.length;n<s;n+=1)t(i[n])}function vm(e,t){var r=wf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new Pe("expected a single document in the stream, but found more")}}var km=wm,Cm=vm,vf={loadAll:km,load:Cm},kf=Object.prototype.toString,Cf=Object.prototype.hasOwnProperty,Wa=65279,Sm=9,Ei=10,xm=13,Am=32,Bm=33,Im=34,Ja=35,Em=37,Nm=38,Om=39,_m=42,Sf=44,Tm=45,yo=58,Vm=61,jm=62,Dm=63,Mm=64,xf=91,Af=93,$m=96,Bf=123,Pm=124,If=125,De={};De[0]="\\0",De[7]="\\a",De[8]="\\b",De[9]="\\t",De[10]="\\n",De[11]="\\v",De[12]="\\f",De[13]="\\r",De[27]="\\e",De[34]='\\"',De[92]="\\\\",De[133]="\\N",De[160]="\\_",De[8232]="\\L",De[8233]="\\P";var Rm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Um=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Lm(e,t){var r,i,n,s,a,c,l;if(t===null)return{};for(r={},i=Object.keys(t),n=0,s=i.length;n<s;n+=1)a=i[n],c=String(t[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&Cf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function Fm(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 Pe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ke.repeat("0",i-t.length)+t}var Hm=1,Ni=2;function qm(e){this.schema=e.schema||qa,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=Lm(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==='"'?Ni:Hm,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 Ef(e,t){for(var r=ke.repeat(" ",t),i=0,n=-1,s="",a,c=e.length;i<c;)n=e.indexOf(`
|
|
134
134
|
`,i),n===-1?(a=e.slice(i),i=c):(a=e.slice(i,n+1),i=n+1),a.length&&a!==`
|
|
135
|
-
`&&(s+=r),s+=a;return s}function
|
|
136
|
-
`+ke.repeat(" ",e.indent*t)}function
|
|
135
|
+
`&&(s+=r),s+=a;return s}function Ya(e,t){return`
|
|
136
|
+
`+ke.repeat(" ",e.indent*t)}function Km(e,t){var r,i,n;for(r=0,i=e.implicitTypes.length;r<i;r+=1)if(n=e.implicitTypes[r],n.resolve(t))return!0;return!1}function go(e){return e===Am||e===Sm}function Oi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Wa||65536<=e&&e<=1114111}function Nf(e){return Oi(e)&&e!==Wa&&e!==xm&&e!==Ei}function Of(e,t,r){var i=Nf(e),n=i&&!go(e);return(r?i:i&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf&&e!==If)&&e!==Ja&&!(t===yo&&!n)||Nf(t)&&!go(t)&&e===Ja||t===yo&&n}function zm(e){return Oi(e)&&e!==Wa&&!go(e)&&e!==Tm&&e!==Dm&&e!==yo&&e!==Sf&&e!==xf&&e!==Af&&e!==Bf&&e!==If&&e!==Ja&&e!==Nm&&e!==_m&&e!==Bm&&e!==Pm&&e!==Vm&&e!==jm&&e!==Om&&e!==Im&&e!==Em&&e!==Mm&&e!==$m}function Gm(e){return!go(e)&&e!==yo}function _i(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 _f(e){var t=/^\n* /;return t.test(e)}var Tf=1,Za=2,Vf=3,jf=4,Lr=5;function Wm(e,t,r,i,n,s,a,c){var l,d=0,y=null,p=!1,I=!1,w=i!==-1,h=-1,g=zm(_i(e,0))&&Gm(_i(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=_i(e,l),!Oi(d))return Lr;g=g&&Of(d,y,c),y=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=_i(e,l),d===Ei)p=!0,w&&(I=I||l-h-1>i&&e[h+1]!==" ",h=l);else if(!Oi(d))return Lr;g=g&&Of(d,y,c),y=d}I=I||w&&l-h-1>i&&e[h+1]!==" "}return!p&&!I?g&&!a&&!n(e)?Tf:s===Ni?Lr:Za:r>9&&_f(e)?Lr:a?s===Ni?Lr:Za:I?jf:Vf}function Jm(e,t,r,i,n){e.dump=function(){if(t.length===0)return e.quotingType===Ni?'""':"''";if(!e.noCompatMode&&(Rm.indexOf(t)!==-1||Um.test(t)))return e.quotingType===Ni?'"'+t+'"':"'"+t+"'";var s=e.indent*Math.max(1,r),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-s),c=i||e.flowLevel>-1&&r>=e.flowLevel;function l(d){return Km(e,d)}switch(Wm(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,n)){case Tf:return t;case Za:return"'"+t.replace(/'/g,"''")+"'";case Vf:return"|"+Df(t,e.indent)+Mf(Ef(t,s));case jf:return">"+Df(t,e.indent)+Mf(Ef(Ym(t,a),s));case Lr:return'"'+Zm(t)+'"';default:throw new Pe("impossible error: invalid scalar style")}}()}function Df(e,t){var r=_f(e)?String(t):"",i=e[e.length-1]===`
|
|
137
137
|
`,n=i&&(e[e.length-2]===`
|
|
138
138
|
`||e===`
|
|
139
139
|
`),s=n?"+":i?"":"-";return r+s+`
|
|
140
|
-
`}function
|
|
141
|
-
`?e.slice(0,-1):e}function
|
|
142
|
-
`);return d=d!==-1?d:e.length,r.lastIndex=d
|
|
140
|
+
`}function Mf(e){return e[e.length-1]===`
|
|
141
|
+
`?e.slice(0,-1):e}function Ym(e,t){for(var r=/(\n+)([^\n]*)/g,i=function(){var d=e.indexOf(`
|
|
142
|
+
`);return d=d!==-1?d:e.length,r.lastIndex=d,$f(e.slice(0,d),t)}(),n=e[0]===`
|
|
143
143
|
`||e[0]===" ",s,a;a=r.exec(e);){var c=a[1],l=a[2];s=l[0]===" ",i+=c+(!n&&!s&&l!==""?`
|
|
144
|
-
`:"")
|
|
144
|
+
`:"")+$f(l,t),n=s}return i}function $f(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,i,n=0,s,a=0,c=0,l="";i=r.exec(e);)c=i.index,c-n>t&&(s=a>n?a:c,l+=`
|
|
145
145
|
`+e.slice(n,s),n=s+1),a=c;return l+=`
|
|
146
146
|
`,e.length-n>t&&a>n?l+=e.slice(n,a)+`
|
|
147
|
-
`+e.slice(a+1):l+=e.slice(n),l.slice(1)}function
|
|
148
|
-
`:""}var Xm=Qm,e0={dump:Xm};function Ja(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 t0=Te,r0=Md,i0=Ud,n0=Kd,o0=zd,s0=Ua,a0=gf.load,c0=gf.loadAll,l0=e0.dump,u0=$e,d0={binary:Zd,float:qd,map:Rd,null:Ld,pairs:Xd,set:ef,timestamp:Jd,bool:Fd,int:Hd,merge:Yd,omap:Qd,seq:$d,str:Pd},f0=Ja("safeLoad","load"),p0=Ja("safeLoadAll","loadAll"),h0=Ja("safeDump","dump"),y0={Type:t0,Schema:r0,FAILSAFE_SCHEMA:i0,JSON_SCHEMA:n0,CORE_SCHEMA:o0,DEFAULT_SCHEMA:s0,load:a0,loadAll:c0,dump:l0,YAMLException:u0,types:d0,safeLoad:f0,safeLoadAll:p0,safeDump:h0};const g0={class:"yaml-config"},Mf=o.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=o.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,n])=>n&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":y0.dump(i).trim()});return(i,n)=>{const s=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",g0,[t.yamlRecord?(o.openBlock(),o.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):o.createCommentVNode("",!0)])}}}),m0={key:0,class:"config-card-display-form"},b0=["data-testid"],w0={key:0,class:"config-card-prop-section-title"},v0=o.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=o.useSlots(),{i18n:{t:i}}=Be.useI18n(),n=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=o.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,c)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[e.format==="structured"?(o.openBlock(),o.createElementBlock("div",m0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propListTypes,l=>(o.openBlock(),o.createElementBlock("div",{key:`config-card-details-${l}-props`,class:o.normalizeClass(`config-card-details-${l}-props`),"data-testid":`config-card-details-${l}-props`},[l!=="basic"?(o.openBlock(),o.createElementBlock("div",w0,o.toDisplayString(l==="advanced"?o.unref(i)("baseConfigCard.sections.advanced"):o.unref(i)("baseConfigCard.sections.plugin")),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propertyCollections[l],d=>(o.openBlock(),o.createBlock(ao,{key:d.key,item:d},o.createSlots({label:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:o.withCtx(({rowValue:y})=>[o.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[n(d)?{name:"label-tooltip",fn:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,b0))),128))])):o.createCommentVNode("",!0),e.format==="json"&&t.record?(o.openBlock(),o.createBlock(Td,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):o.createCommentVNode("",!0),e.format==="yaml"&&t.record?(o.openBlock(),o.createBlock(Mf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):o.createCommentVNode("",!0)],64))}}),k0=ct(v0,[["__scopeId","data-v-147a2f70"]]),Ht="24px",yo=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},C0=e=>(o.pushScopeId("data-v-2295e0fb"),e=e(),o.popScopeId(),e),S0=["aria-hidden"],x0={key:0,"data-testid":"kui-icon-svg-title"},A0=C0(()=>o.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),B0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",x0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),A0],8,S0))]),_:1},8,["aria-hidden","style"]))}}),I0=yo(B0,[["__scopeId","data-v-2295e0fb"]]),E0=e=>(o.pushScopeId("data-v-40a7f387"),e=e(),o.popScopeId(),e),N0=["aria-hidden"],O0={key:0,"data-testid":"kui-icon-svg-title"},_0=E0(()=>o.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)),T0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",O0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),_0],8,N0))]),_:1},8,["aria-hidden","style"]))}}),V0=yo(T0,[["__scopeId","data-v-40a7f387"]]),j0=e=>(o.pushScopeId("data-v-98c34919"),e=e(),o.popScopeId(),e),D0=["aria-hidden"],M0={key:0,"data-testid":"kui-icon-svg-title"},P0=j0(()=>o.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),$0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.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:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",M0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),P0],8,D0))]),_:1},8,["aria-hidden","style"]))}}),R0=yo($0,[["__scopeId","data-v-98c34919"]]),U0=e=>(o.pushScopeId("data-v-19f4cbbe"),e=e(),o.popScopeId(),e),L0=["aria-hidden"],F0={key:0,"data-testid":"kui-icon-svg-title"},H0=U0(()=>o.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)),q0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",F0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),H0],8,L0))]),_:1},8,["aria-hidden","style"]))}}),K0=yo(q0,[["__scopeId","data-v-19f4cbbe"]]),z0={class:"config-card-title","data-testid":"config-card-title"},G0={class:"config-card-actions"},W0=["href"],J0={class:"config-card-details-section"},Y0=o.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,n=e,{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:c}=Be.useStringHelpers(),{axiosInstance:l}=Be.useAxios({headers:(r=n.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=o.ref("structured"),p=A=>{y.value=A==null?void 0:A.value},I={id:{type:ce.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:ce.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:ce.BadgeTag,order:-1,section:fe.Basic}},w=o.ref(!1),h=o.ref(!1),g=o.ref(""),b=o.ref({}),k=o.computed(()=>{var A,M,_;if(!b.value)return[];const N=[],re=Object.keys(b.value).length;for(const q in b.value){const j=(M=(A=n.configSchema)==null?void 0:A[q])==null?void 0:M.order,Z=(_=I[q])==null?void 0:_.order;let ne=re;(Z||Z===0)&&(ne=Z===-1?re+1:Z),j&&(ne=j===-1?re+1:j),N.push([q,ne])}return N.sort(function(q,j){return q[1]-j[1]}),N.map(q=>{var j,Z;const ne=q[0],Ie=(j=b.value)==null?void 0:j[ne],Ce=((Z=n.configSchema)==null?void 0:Z[ne])||{},Ee=I[ne];return{key:ne,value:Ie,hidden:Ce.hidden||!1,type:Ce.type??((Ee==null?void 0:Ee.type)||ce.Text),label:Ce.label??((Ee==null?void 0:Ee.label)||c(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!==n.pluginConfigKey)}),B=o.computed(()=>{var A,M;if(!b.value||!n.pluginConfigKey)return[];const _=b.value[n.pluginConfigKey]||{},N=Object.keys(_).length,re=[];for(const q in _){const j=(M=(A=n.pluginConfigSchema)==null?void 0:A[q])==null?void 0:M.order,Z=_[q];let ne=Z!=null&&Z!==""?N-1:N;j&&(ne=j===-1?N+1:j),re.push([q,ne])}return re.sort(function(q,j){return q[1]-j[1]}),re.map(q=>{var j;const Z=q[0],ne=_[Z],Ie=((j=n.pluginConfigSchema)==null?void 0:j[Z])||{};return{key:Z,value:ne,hidden:Ie.hidden||!1,type:Ie.type??ce.Text,label:Ie.label??c(Z),tooltip:Ie.tooltip??void 0,section:fe.Plugin}}).filter(q=>!q.hidden)}),E=o.computed(()=>{var A,M,_,N;return{basic:(A=k.value)==null?void 0:A.filter(re=>re.section===fe.Basic),advanced:(M=k.value)==null?void 0:M.filter(re=>re.section===fe.Advanced),plugin:(N=B.value)==null?void 0:N.concat((_=k.value)==null?void 0:_.filter(re=>re.section===fe.Plugin))}}),S=o.computed(()=>{const A=[];return E.value.basic.length&&A.push("basic"),E.value.advanced.length&&A.push("advanced"),E.value.plugin.length&&A.push("plugin"),A}),C=o.computed(()=>{var A,M;let _=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((A=n.config)==null?void 0:A.controlPlaneId)||""):n.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(M=n.config)!=null&&M.workspace?`/${n.config.workspace}`:"")),_=_.replace(/{id}/gi,n.config.entityId),_});return o.watch(w,A=>{i("loading",A)},{immediate:!0}),o.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:A}=await l.get(C.value);if(n.dataKey)if(typeof A[n.dataKey]<"u")b.value={...A[n.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:n.dataKey}));else b.value={...A};Object.keys(n.configSchema).filter(M=>n.configSchema[M].forceShow).forEach(M=>{b.value&&typeof b.value[M]>"u"&&(b.value[M]=null)}),i("fetch:success",A)}catch(A){const M=a(A);g.value=M.startsWith("code")?s("baseConfigCard.errors.load"):M,h.value=!0,i("fetch:error",A)}finally{w.value=!1}}),(A,M)=>{const _=o.resolveComponent("KLabel"),N=o.resolveComponent("KSelect"),re=o.resolveComponent("KButton"),q=o.resolveComponent("KSkeleton"),j=o.resolveComponent("KEmptyState"),Z=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(Z,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},o.createSlots({actions:o.withCtx(()=>[o.createElementVNode("div",G0,[o.renderSlot(A.$slots,"actions",{},void 0,!0),o.createVNode(_,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1}),o.createVNode(N,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(o.openBlock(),o.createBlock(re,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:o.withCtx(()=>[o.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[o.createVNode(o.unref(V0),{size:o.unref(Dy)},null,8,["size"])],8,W0)]),_:1})):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[w.value?(o.openBlock(),o.createBlock(q,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(o.openBlock(),o.createBlock(j,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(g.value),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",J0,[o.createVNode(k0,{config:e.config,"fetcher-url":C.value,format:y.value,"prop-list-types":S.value,"property-collections":E.value,record:b.value},o.createSlots({_:2},[o.renderList(Object.keys(A.$slots),ne=>({name:ne,fn:o.withCtx(({row:Ie,rowValue:Ce})=>[o.renderSlot(A.$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:o.withCtx(()=>[o.createElementVNode("span",z0,[o.renderSlot(A.$slots,"title",{},()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Pf=ct(Y0,[["__scopeId","data-v-7c5b607d"]]),Z0={class:"form-actions","data-testid":"form-actions"},Q0=o.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}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,n=e,s=Gr.useRouter(),{i18n:{t:a}}=Be.useI18n(),{getMessageFromError:c}=Be.useErrors(),{axiosInstance:l}=Be.useAxios({headers:(r=n.config)==null?void 0:r.requestHeaders}),d=o.ref(!1),y=o.ref(!1),p=o.ref(""),I=o.computed(()=>n.canSubmit===!1||n.isReadonly),w=o.ref(!1),h=o.computed(()=>{var S,C;let A=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((S=n.config)==null?void 0:S.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(C=n.config)!=null&&C.workspace?`/${n.config.workspace}`:"")),n.editId?(A=A.replace(/{id}/gi,n.editId),A):(A=A.replace(/\/{id}/gi,""),A)}),g=()=>{w.value=!w.value},b=()=>{n.config.cancelRoute?s.push(n.config.cancelRoute):k()},k=()=>{i("cancel")},B=()=>{I.value||i("submit")},E=o.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return o.watch(()=>d.value,S=>{i("loading",S)},{immediate:!0}),o.onBeforeMount(async()=>{if(n.editId)try{y.value=!1,d.value=!0;const{data:S}=await l.get(h.value);i("fetch:success",S)}catch(S){const C=c(S);p.value=C.startsWith("code")?a("baseForm.errors.edit"):C,y.value=!0,i("fetch:error",S)}finally{d.value=!1}}),(S,C)=>{const A=o.resolveComponent("KSkeleton"),M=o.resolveComponent("KEmptyState"),_=o.resolveComponent("KAlert"),N=o.resolveComponent("KButton"),re=o.resolveComponent("KTabs"),q=o.resolveComponent("KSlideout"),j=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(j,{class:"kong-ui-entity-base-form"},{default:o.withCtx(()=>[d.value?(o.openBlock(),o.createBlock(A,{key:0,type:"form"})):y.value?(o.openBlock(),o.createBlock(M,{key:1,"action-button-text":o.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(o.openBlock(),o.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:o.withModifiers(k,["prevent"]),onSubmit:o.withModifiers(B,["prevent"])},[o.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(o.openBlock(),o.createBlock(_,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):o.createCommentVNode("",!0),o.createElementVNode("div",Z0,[o.renderSlot(S.$slots,"form-actions",{},()=>[o.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:C[0]||(C[0]=Z=>g())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),o.createVNode(N,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),o.createVNode(N,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),o.createVNode(q,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:o.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:C[1]||(C[1]=Z=>g())},{default:o.withCtx(()=>[o.createElementVNode("div",null,o.toDisplayString(o.unref(a)("baseForm.configuration.message")),1),o.createVNode(re,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:o.withCtx(()=>[o.createVNode(Td,{config:e.config,"fetcher-url":h.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:o.withCtx(()=>[o.createVNode(Mf,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),$f=ct(Q0,[["__scopeId","data-v-1d932d98"]]),X0={key:0,"data-testid":"first-col"},e1=o.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=o.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=o.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),n=o.computed(()=>{var g,b;const k=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return k?((b=k[0])==null?void 0:b.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,b,k;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((b=r.value)==null?void 0:b.clientWidth)||0,p.value=((k=l.value)==null?void 0:k.innerText)||""},l=o.ref({}),d=o.ref(0),y=o.ref(0),p=o.ref(""),I=o.computed(()=>[i.value,r.value]),w=o.watch(I,g=>{if(n.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(b=>{window.requestAnimationFrame(()=>{!Array.isArray(b)||!b.length||c()})});for(const b of g)b&&s.observe(b)}},{immediate:!0,flush:"post",deep:!0}),h=o.computed(()=>n.value?d.value>y.value:!1);return o.onMounted(()=>{c()}),o.onUnmounted(()=>{w()}),(g,b)=>{const k=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[n.value?(o.openBlock(),o.createElementBlock("span",X0,[o.createVNode(k,{"max-width":"300",placement:"bottomStart",text:h.value?p.value:""},{default:o.withCtx(()=>[o.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):o.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),t1=ct(e1,[["__scopeId","data-v-c4379fd4"]]),r1={class:"toolbar-container"},i1={key:0,class:"toolbar-button-container"},n1=["data-testid"],o1=o.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},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:n}}=Be.useI18n(),s=o.computed(()=>{var C,A;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(C=r.errorMessage)==null?void 0:C.title,message:(A=r.errorMessage)==null?void 0:A.message}}),a=o.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=C=>C.hasData||!!r.query,l=o.computed(()=>{const C=[];return Object.keys(r.tableHeaders).forEach(A=>{const M=r.tableHeaders[A];C.push({label:M.label??A,key:A,sortable:M.sortable??!1})}),r.enableEntityActions&&C.push({key:"actions",hideLabel:!0}),C}),d=C=>({"data-rowid":C.id,"data-testid":C.name,...r.rowAttributes(C)}),y=o.ref({}),p=C=>{var A;return(A=y.value)==null?void 0:A.$el.querySelector(`[data-rowid="${C.id}"]`)},I=C=>{const A={"data-testid":C.headerKey,...r.cellAttributes(C)};return C.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=o.computed(()=>r.disableRowClick?void 0:(C,A)=>{i("click:row",A)}),b=C=>{i("sort",C)},{setTablePreferences:k,getTablePreferences:B}=Xh(),E=o.computed(()=>{const C=B(r.preferencesStorageKey);return{...r.initialFetcherParams,...C}}),S=C=>{r.preferencesStorageKey&&k(r.preferencesStorageKey,C)};return(C,A)=>{const M=o.resolveComponent("KIcon"),_=o.resolveComponent("KButton"),N=o.resolveComponent("KDropdown"),re=o.resolveComponent("KTable"),q=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:o.withCtx(()=>[o.createVNode(re,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?o.unref(n)("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?o.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?o.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":E.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":g.value,onSort:A[0]||(A[0]=j=>b(j)),"onUpdate:tablePreferences":S},o.createSlots({toolbar:o.withCtx(({state:j})=>[o.withDirectives(o.createElementVNode("div",r1,[o.renderSlot(C.$slots,"toolbar-filter",{},void 0,!0),C.$slots["toolbar-button"]?(o.openBlock(),o.createElementBlock("div",i1,[o.renderSlot(C.$slots,"toolbar-button",{},void 0,!0)])):o.createCommentVNode("",!0)],512),[[o.vShow,c(j)]])]),actions:o.withCtx(({row:j,rowKey:Z,rowValue:ne})=>[o.createElementVNode("div",{class:"actions-container","data-testid":j.name},[o.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:o.withCtx(()=>[o.renderSlot(C.$slots,"actions",{row:j,rowKey:Z,rowValue:ne},void 0,!0)]),default:o.withCtx(()=>[o.createVNode(_,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:o.withCtx(()=>[o.createVNode(M,{color:o.unref(Ty),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,n1)]),_:2},[o.renderList(e.tableHeaders,(j,Z)=>({name:Z,fn:o.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[o.createVNode(t1,{"key-name":String(Z),"row-el":p(ne)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,Z,{row:ne,rowKey:Ie,rowValue:Ce},()=>[o.createTextVNode(o.toDisplayString(Ce),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:o.withCtx(()=>[o.createVNode(o.unref(I0))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Rf=ct(o1,[["__scopeId","data-v-99908c24"]]),s1={key:0,class:"kong-ui-entity-delete-error"},a1={key:1,class:"description"},c1=o.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,n=t,s=o.computed(()=>i.needConfirm?i.entityName:""),a=()=>{n("cancel")},c=()=>{n("proceed")};return(l,d)=>{const y=o.resolveComponent("KAlert"),p=o.resolveComponent("KPrompt");return o.openBlock(),o.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:c},{default:o.withCtx(()=>[e.error?(o.openBlock(),o.createElementBlock("div",s1,[o.createVNode(y,{appearance:"danger"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.error),1)]),_:1})])):o.createCommentVNode("",!0),o.createVNode(o.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},o.createSlots({entityType:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(o.openBlock(),o.createElementBlock("div",a1,[o.renderSlot(l.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(i.description),1)],!0)])):o.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Uf=ct(c1,[["__scopeId","data-v-4361d622"]]),l1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},u1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},d1=["fill"],f1={mask:"url(#mask0_180_20349)"},p1=["fill"],Lf=o.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Oy})`}},setup(e){return(t,r)=>(o.openBlock(),o.createElementBlock("svg",l1,[o.createElementVNode("mask",u1,[o.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,d1)]),o.createElementVNode("g",f1,[o.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,p1)])]))}}),h1={key:1,class:"kong-ui-entity-filter"},y1={class:"kong-ui-entity-filter-menu"},g1=["data-testid"],m1=["onClick","onKeydown"],b1={class:"menu-item-indicator"},w1={class:"menu-item-body"},v1=["for"],k1={class:"menu-item-buttons"},C1={class:"filter-clear-button-container"},S1=o.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,n=t,s=o.ref(!1),a=o.ref({}),c=o.ref(new Set),l=o.computed(()=>{const S=[];return new URLSearchParams(i.modelValue).forEach((C,A)=>{C!==""&&S.push(A)}),S}),d=o.computed(()=>{const S=i.config.fields;return Object.keys(S).filter(C=>S[C].searchable).map(C=>({label:S[C].label||C,value:C,expanded:!1}))});o.watch(()=>i.modelValue,S=>{a.value={},new URLSearchParams(S).forEach((C,A)=>{a.value[A]=C})});const y=()=>{s.value=!s.value},p=S=>{c.value.has(S)?c.value.delete(S):c.value.add(S)},I=S=>{n("update:modelValue",S)},w=()=>{I("")},h=S=>`filter-${S}`,g=S=>{var C,A;return(((A=(C=i.config.schema)==null?void 0:C[S])==null?void 0:A.values)??[]).map(M=>({value:M,label:M}))},b=S=>{var C,A;return((A=(C=i.config.schema)==null?void 0:C[S])==null?void 0:A.type)??"text"},k=S=>{a.value={...a.value,[S]:""},E()},B=()=>{a.value={},E(!0)},E=(S=!1)=>{const C=Object.keys(a.value).reduce((A,M)=>(a.value[M]&&(A[M]=`${a.value[M]}`),A),{});S&&(s.value=!1),n("update:modelValue",new URLSearchParams(C).toString())};return(S,C)=>{const A=o.resolveComponent("KInput"),M=o.resolveComponent("KButton"),_=o.resolveComponent("KSelect");return e.config.isExactMatch?(o.openBlock(),o.createBlock(A,{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:o.withCtx(()=>[o.createVNode(Lf)]),after:o.withCtx(()=>[o.withDirectives(o.createVNode(o.unref(K0),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[o.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(o.openBlock(),o.createElementBlock("div",h1,[o.createVNode(M,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:o.withCtx(()=>[o.createVNode(Lf),o.createTextVNode(" "+o.toDisplayString(o.unref(r)("filter.filterButtonText"))+" "+o.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),o.withDirectives(o.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[o.vShow,s.value]]),o.withDirectives(o.createElementVNode("div",y1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,N=>{var re,q;return o.openBlock(),o.createElementBlock("div",{key:N.value,class:"kong-ui-entity-filter-menu-item","data-testid":N.value},[o.createElementVNode("span",{class:o.normalizeClass(["menu-item-title",{expanded:c.value.has(N.value)}]),role:"button",tabindex:"0",onClick:j=>p(N.value),onKeydown:o.withKeys(j=>p(N.value),["enter"])},[o.createTextVNode(o.toDisplayString(N.label)+" ",1),o.withDirectives(o.createElementVNode("span",b1,null,512),[[o.vShow,l.value.includes(N.value)]]),o.createVNode(o.unref(R0),{class:o.normalizeClass(["menu-item-expand-icon",{expanded:c.value.has(N.value)}]),color:o.unref(Vy)},null,8,["class","color"])],42,m1),o.withDirectives(o.createElementVNode("div",w1,[o.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},o.toDisplayString(o.unref(r)("filter.fieldLabel")),9,v1),((q=(re=e.config.schema)==null?void 0:re[N.value])==null?void 0:q.type)==="select"?(o.openBlock(),o.createBlock(_,{key:0,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,items:g(N.value),placeholder:o.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(o.openBlock(),o.createBlock(A,{key:1,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,autocomplete:"off",placeholder:o.unref(r)("filter.inputPlaceholder"),type:b(N.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[o.vShow,c.value.has(N.value)]]),o.withDirectives(o.createElementVNode("div",k1,[o.createVNode(M,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:C[0]||(C[0]=j=>E(!0))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.applyButtonText")),1)]),_:1}),o.createVNode(M,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:j=>k(N.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[o.vShow,c.value.has(N.value)]])],8,g1)}),128)),o.createElementVNode("div",C1,[o.createVNode(M,{appearance:"tertiary",size:"small",onClick:B},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[o.vShow,s.value]])]))}}}),Ff=ct(S1,[["__scopeId","data-v-8cfadde3"]]),Tt=o.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=o.ref(void 0),i=o.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return o.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(n,s)=>i.value?o.renderSlot(n.$slots,"default",{key:0,isAllowed:r.value}):o.createCommentVNode("",!0)}}),x1={class:"form-section-wrapper"},A1={key:1,class:"form-section-description"},B1={key:2,class:"form-section-footer"},I1={class:"form-section-content"},E1=o.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=o.useSlots();return(r,i)=>(o.openBlock(),o.createElementBlock("fieldset",{class:o.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[o.createElementVNode("div",x1,[e.hideInfoHeader?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.titleTag),{key:0,class:"form-section-title"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1})):o.createCommentVNode("",!0),e.description||o.unref(t).description?(o.openBlock(),o.createElementBlock("div",A1,[o.renderSlot(r.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(e.description),1)],!0)])):o.createCommentVNode("",!0),o.unref(t).footer?(o.openBlock(),o.createElementBlock("div",B1,[o.renderSlot(r.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2)),o.createElementVNode("div",I1,[o.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),go=ct(E1,[["__scopeId","data-v-4bb31634"]]),{useAxios:mo,useDeleteUrlBuilder:Hf,useErrors:qf,useExternalLinkCreator:gb,useFetchUrlBuilder:mb,useFetcher:Kf,useDebouncedFilter:bb,useStringHelpers:zf,useHelpers:Gf,useGatewayFeatureSupported:wb,useTruncationDetector:vb,useValidators:kb}=Be,N1={class:"kong-ui-entities-certificates-list"},O1={key:0},_1={key:1},T1={key:0},V1={key:1},j1={key:0},D1={key:1},M1={key:1},P1={key:1},$1=o.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:n,formatUnixTimeStamp:s},i18nT:a}=bt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=mo({headers:(ee=i.config)==null?void 0:ee.requestHeaders}),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={subject:{label:n("certificates.list.table_headers.subject")},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},w=o.computed(()=>{var K,de;let U=`${i.config.apiBaseUrl}${Bi.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=o.ref(""),g=o.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:n("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:k}=Kf(i.config,w.value),B=()=>{h.value=""},E=()=>{d.value++},S=o.ref(null),C=(U,K)=>{const de=U.id;if(!K(de)){r("copy:error",{entity:U,field:"id",message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:n("certificates.copy.success",{val:de})})},A=(U,K)=>{const de=JSON.stringify(U);if(!K(de)){r("copy:error",{entity:U,message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,message:n("certificates.copy.success_brief")})},M=async U=>{var de;await((de=i.canRetrieve)==null?void 0:de.call(i,U))&&c.push(i.config.getViewRoute(U.id))},_=U=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(U)}),N=U=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(U)}),re=U=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},q=o.ref(void 0),j=o.ref(!1),Z=o.ref(!1),ne=o.ref(""),Ie=Hf(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=bt.useCertificate(),Hr=U=>{q.value=U,j.value=!0},qr=()=>{j.value=!1},ur=async()=>{var U,K,de;if((U=q.value)!=null&&U.id){Z.value=!0;try{await l.delete(Ie(q.value.id)),Z.value=!1,j.value=!1,d.value++,r("delete:success",q.value)}catch(Re){ne.value=((de=(K=Re.response)==null?void 0:K.data)==null?void 0:de.message)||Re.message||n("certificates.errors.delete"),r("error",Re)}finally{Z.value=!1}}},Vt=o.ref(!0);o.watch(k,U=>{var K,de,Re,Ze;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(Vt.value=U.response.data.length>0),U.status===Ut.Error){S.value={title:n("certificates.errors.general")},(Ze=(Re=(de=U.error)==null?void 0:de.response)==null?void 0:Re.data)!=null&&Ze.message&&(S.value.message=U.error.response.data.message),r("error",U.error);return}Ce.value={},S.value=null});const X=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(X.value.title=n("certificates.list.empty_state.title"),X.value.ctaText=n("certificates.actions.create"))}),(U,K)=>{const de=o.resolveComponent("KButton"),Re=o.resolveComponent("KCopy"),Ze=o.resolveComponent("KBadge"),Kr=o.resolveComponent("KTruncate"),te=o.resolveComponent("KDropdownItem"),Se=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",N1,[o.createVNode(o.unref(Rf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":S.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":K[2]||(K[2]=Y=>M(Y)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(Ff),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(de,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[o.vShow,Vt.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",O1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",_1,o.toDisplayString(o.unref(Ee)(Y).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",T1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",V1,o.toDisplayString(o.unref(Ee)(Y).schemaExpiry?o.unref(s)(o.unref(Ee)(Y).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",j1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",D1,o.toDisplayString(o.unref(Ee)(Y).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:Y})=>[Y!=null&&Y.cert?(o.openBlock(),o.createBlock(Re,{key:0,"data-testid":"copy-certificate-cert",text:Y.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",M1,"-"))]),tags:o.withCtx(({row:Y})=>{var xe;return[((xe=Y==null?void 0:Y.tags)==null?void 0:xe.length)>0?(o.openBlock(),o.createBlock(Kr,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,zr=>(o.openBlock(),o.createBlock(Ze,{key:zr,onClick:K[1]||(K[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",P1,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>C(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:zr=>A(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:_(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-edit",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(Tt),{key:0,"auth-function":()=>e.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-add-sni",item:re(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Hr(Y)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),o.createVNode(o.unref(Uf),{"action-pending":Z.value,"entity-type":o.unref(Va).Certificate,error:ne.value,title:o.unref(n)("certificates.delete.title"),visible:j.value,onCancel:qr,onProceed:ur},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Fr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},R1=Fr($1,[["__scopeId","data-v-f8690ed7"]]),U1={class:"kong-ui-entities-certificates-form"},L1=Fr(o.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 S;const r=t,i=e,n=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=bt.useI18n(),{getMessageFromError:c}=qf(),{axiosInstance:l}=mo({headers:(S=i.config)==null?void 0:S.requestHeaders}),d=o.computed(()=>Bi.form[i.config.app].edit),y=o.computed(()=>i.certificateId?cr.Edit:cr.Create),p=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),I=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=o.computed(()=>(y.value===cr.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var A;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((A=C==null?void 0:C.tags)==null?void 0:A.join(", "))||"",Object.assign(I,p.fields)},g=()=>{n.push(i.config.cancelRoute)},b=o.computed(()=>{var A,M;let C=`${i.config.apiBaseUrl}${Bi.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),k=o.computed(()=>{var A,M;let C=`${i.config.apiBaseUrl}${Bi.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),B=o.computed(()=>{var C,A;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(C=p.fields.tags.split(","))==null?void 0:C.map(M=>String(M||"").trim()))==null?void 0:A.filter(M=>M!=="")}}),E=async()=>{var C,A,M,_,N,re,q;try{p.isReadonly=!0;let j;await l.post(b.value,B.value),y.value==="create"?j=await l.post(k.value,B.value):y.value==="edit"&&(j=((C=i.config)==null?void 0:C.app)==="konnect"?await l.put(k.value,B.value):await l.patch(k.value,B.value)),p.fields.cert=((A=j==null?void 0:j.data)==null?void 0:A.cert)||"",p.fields.key=((M=j==null?void 0:j.data)==null?void 0:M.key)||"",p.fields.certAlt=((_=j==null?void 0:j.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((N=j==null?void 0:j.data)==null?void 0:N.key_alt)||"",p.fields.tags=((q=(re=j==null?void 0:j.data)==null?void 0:re.tags)==null?void 0:q.join(", "))||"",Object.assign(I,p.fields),r("update",j==null?void 0:j.data)}catch(j){p.errorMessage=c(j),r("error",j)}finally{p.isReadonly=!1}};return(C,A)=>{const M=o.resolveComponent("KTextArea"),_=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",U1,[o.createVNode(o.unref($f),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":B.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":A[5]||(A[5]=N=>C.$emit("error",N)),"onFetch:success":h,onLoading:A[6]||(A[6]=N=>C.$emit("loading",N)),onSubmit:E},{default:o.withCtx(()=>[o.createVNode(o.unref(go),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(M,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=N=>p.fields.cert=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=N=>p.fields.key=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=N=>p.fields.certAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=N=>p.fields.keyAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(go),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=N=>p.fields.tags=N),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:o.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-2c3ed6cc"]]),Ti={list:{konnect:"/api/runtime_groups/{controlPlaneId}/ca_certificates",kongManager:"/{workspace}/ca_certificates"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/ca_certificates",edit:"/api/runtime_groups/{controlPlaneId}/ca_certificates/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/ca-certificate/validate"},kongManager:{create:"/{workspace}/ca_certificates",edit:"/{workspace}/ca_certificates/{id}",validate:"/{workspace}/schemas/ca_certificates/validate"}}},F1={class:"kong-ui-ca-certificate-entity-config-card"},H1={key:0},q1=Fr(o.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,n=e,{i18n:{t:s,formatUnixTimeStamp:a}}=bt.useI18n(),{convertKeyToTitle:c}=zf(),{getPropValue:l}=Gf(),{getCertificateData:d}=bt.useCertificate(),y=o.computed(()=>Ti.form[n.config.app].edit),p=o.ref(),I=o.computed(()=>{if(p.value)return d(p.value)}),w=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaIssuer)||""}),h=o.computed(()=>{var E,S;return(E=I.value)!=null&&E.schemaExpiry?a((S=I.value)==null?void 0:S.schemaExpiry):""}),g=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaKeyUsages)||[]}),b=(E,S)=>{const C=l("rowValue",S);if(E==="expiry")return h.value;if(E==="key_usages")return g.value;if(C)return C[E]},k=E=>{p.value=E,i("fetch:success",E)},B=o.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:ce.Json,order:7},...n.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,S)=>{const C=o.resolveComponent("KCodeBlock"),A=o.resolveComponent("KLabel"),M=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",F1,[o.createVNode(o.unref(Pf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":S[0]||(S[0]=_=>E.$emit("fetch:error",_)),"onFetch:success":k,onLoading:S[1]||(S[1]=_=>E.$emit("loading",_))},{cert:o.withCtx(_=>[o.unref(l)("rowValue",_)?(o.openBlock(),o.createBlock(C,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:o.unref(l)("rowValue",_),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(A,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(_=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(l)("rowValue",_)).filter(N=>!r.includes(N)),N=>(o.openBlock(),o.createBlock(o.unref(ao),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:o.unref(c)(N),value:b(N,_),type:N==="key_usages"?o.unref(ce).BadgeTag:o.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",H1,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(_,N)=>(o.openBlock(),o.createBlock(M,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:_,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-935fca40"]]),K1={class:"kong-ui-entities-ca-certificates-list"},z1={key:0},G1={key:1},W1={key:0},J1={key:1},Y1={key:1},Z1=Fr(o.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:n,formatUnixTimeStamp:s},i18nT:a}=bt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=mo({headers:(X=i.config)==null?void 0:X.requestHeaders}),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={issuer:{label:n("ca-certificates.list.table_headers.issuer")},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},w=o.computed(()=>{var U,K;let ee=`${i.config.apiBaseUrl}${Ti.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=o.ref(""),g=o.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:k}=Kf(i.config,w.value),B=()=>{h.value=""},E=()=>{d.value++},S=o.ref(null),C=(ee,U)=>{const K=ee.id;if(!U(K)){r("copy:error",{entity:ee,field:"id",message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:n("ca-certificates.copy.success",{val:K})})},A=(ee,U)=>{const K=JSON.stringify(ee);if(!U(K)){r("copy:error",{entity:ee,message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:n("ca-certificates.copy.success_brief")})},M=async ee=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},_=ee=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),re=o.ref(void 0),q=o.ref(!1),j=o.ref(!1),Z=o.ref(""),ne=Hf(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=bt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},Hr=()=>{q.value=!1},qr=async()=>{var ee,U,K;if((ee=re.value)!=null&&ee.id){j.value=!0;try{await l.delete(ne(re.value.id)),j.value=!1,q.value=!1,d.value++,r("delete:success",re.value)}catch(de){Z.value=((K=(U=de.response)==null?void 0:U.data)==null?void 0:K.message)||de.message||n("ca-certificates.errors.delete"),r("error",de)}finally{j.value=!1}}},ur=o.ref(!0);o.watch(k,ee=>{var U,K,de,Re;if(Array.isArray((U=ee==null?void 0:ee.response)==null?void 0:U.data)&&(ur.value=ee.response.data.length>0),ee.status===Ut.Error){S.value={title:n("ca-certificates.errors.general")},(Re=(de=(K=ee.error)==null?void 0:K.response)==null?void 0:de.data)!=null&&Re.message&&(S.value.message=ee.error.response.data.message),r("error",ee.error);return}Ie.value={},S.value=null});const Vt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(Vt.value.title=n("ca-certificates.list.empty_state.title"),Vt.value.ctaText=n("ca-certificates.actions.create"))}),(ee,U)=>{const K=o.resolveComponent("KButton"),de=o.resolveComponent("KBadge"),Re=o.resolveComponent("KTruncate"),Ze=o.resolveComponent("KDropdownItem"),Kr=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",K1,[o.createVNode(o.unref(Rf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Vt.value,"enable-entity-actions":"","error-message":S.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":U[2]||(U[2]=te=>M(te)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(Ff),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[o.vShow,ur.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",z1,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.issuer?te.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",G1,o.toDisplayString(o.unref(Ce)(te).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",W1,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?o.unref(s)(te.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",J1,o.toDisplayString(o.unref(Ce)(te).schemaExpiry?o.unref(s)(o.unref(Ce)(te).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:te})=>{var Se;return[((Se=te==null?void 0:te.tags)==null?void 0:Se.length)>0?(o.openBlock(),o.createBlock(Re,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(te==null?void 0:te.tags,Y=>(o.openBlock(),o.createBlock(de,{key:Y,onClick:U[1]||(U[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",Y1,"-"))]}),actions:o.withCtx(({row:te})=>[o.createVNode(Kr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Ze,{"data-testid":"action-entity-copy-id",onClick:Y=>C(te,Se)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Kr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Ze,{"data-testid":"action-entity-copy-json",onClick:Y=>A(te,Se)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canRetrieve(te)},{default:o.withCtx(()=>[o.createVNode(Ze,{"data-testid":"action-entity-view","has-divider":"",item:_(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canEdit(te)},{default:o.withCtx(()=>[o.createVNode(Ze,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canDelete(te)},{default:o.withCtx(()=>[o.createVNode(Ze,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>Ee(te)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),o.createVNode(o.unref(Uf),{"action-pending":j.value,"entity-type":o.unref(Va).CACertificate,error:Z.value,title:o.unref(n)("ca-certificates.delete.title"),visible:q.value,onCancel:Hr,onProceed:qr},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f85adb44"]]),Q1={class:"kong-ui-entities-ca-certificates-form"},X1=Fr(o.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,n=Gr.useRouter(),{i18n:{t:s}}=bt.useI18n(),{getMessageFromError:a}=qf(),{axiosInstance:c}=mo({headers:(E=i.config)==null?void 0:E.requestHeaders}),l=o.computed(()=>Ti.form[i.config.app].edit),d=o.computed(()=>i.certificateId?cr.Edit:cr.Create),y=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=o.reactive({cert:"",certDigest:"",tags:""}),I=o.computed(()=>(d.value===cr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=S=>{var C;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((C=S==null?void 0:S.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var C,A;let S=`${i.config.apiBaseUrl}${Ti.form[i.config.app].validate}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),b=o.computed(()=>{var C,A;let S=`${i.config.apiBaseUrl}${Ti.form[i.config.app][d.value]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),k=o.computed(()=>{var S,C;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(S=y.fields.tags.split(","))==null?void 0:S.map(A=>String(A||"").trim()))==null?void 0:C.filter(A=>A!=="")}}),B=async()=>{var S,C,A,M,_;try{y.isReadonly=!0;let N;await c.post(g.value,k.value),d.value==="create"?N=await c.post(b.value,k.value):d.value==="edit"&&(N=((S=i.config)==null?void 0:S.app)==="konnect"?await c.put(b.value,k.value):await c.patch(b.value,k.value)),y.fields.cert=((C=N==null?void 0:N.data)==null?void 0:C.cert)||"",y.fields.certDigest=((A=N==null?void 0:N.data)==null?void 0:A.cert_digest)||"",y.fields.tags=((_=(M=N==null?void 0:N.data)==null?void 0:M.tags)==null?void 0:_.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(S,C)=>{const A=o.resolveComponent("KTextArea"),M=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",Q1,[o.createVNode(o.unref($f),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":k.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=_=>S.$emit("error",_)),"onFetch:success":w,onLoading:C[4]||(C[4]=_=>S.$emit("loading",_)),onSubmit:B},{default:o.withCtx(()=>[o.createVNode(o.unref(go),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(A,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=_=>y.fields.cert=_),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(M,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=_=>y.fields.certDigest=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(go),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(M,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=_=>y.fields.tags=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:o.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-6316d5b5"]]),eb={class:"kong-ui-certificate-entity-config-card"},tb={key:0},rb=Fr(o.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:n,formatUnixTimeStamp:s},i18nT:a}=bt.useI18n(),{convertKeyToTitle:c}=zf(),{getPropValue:l}=Gf(),{getCertificateData:d}=bt.useCertificate(),y=o.computed(()=>Bi.form[i.config.app].edit),p=o.ref(),I=o.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:ce.Redacted},metadata:{section:fe.Basic,type:ce.Json},snis:{section:fe.Basic,type:ce.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:fe.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:ce.Redacted}}),w=_=>{p.value=_,r("fetch:success",_)},h=(_,N)=>{const re=l("rowValue",N);if(_==="expiry")return b.value;if(_==="key_usages")return S.value;if(_==="san_names")return B.value;if(re)return re[_]},g=o.computed(()=>{if(p.value)return d(p.value)}),b=o.computed(()=>{var _,N;return(_=g.value)!=null&&_.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),k=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaIssuer)||""}),B=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSanNames)||""}),E=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSubject)||""}),S=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaKeyUsages)||[]}),C=o.computed(()=>{var _,N;return((N=(_=p==null?void 0:p.value)==null?void 0:_.snis)==null?void 0:N.length)>0}),A=o.computed(()=>{var _;return!!((_=p==null?void 0:p.value)!=null&&_.cert_alt)}),M=_=>{var N,re;return _==="san_names"?n("certificates.list.table_headers.san"):((re=(N=I.value)==null?void 0:N[_])==null?void 0:re.label)||c(_)};return(_,N)=>{const re=o.resolveComponent("KCodeBlock"),q=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",eb,[o.createVNode(o.unref(Pf),{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]=Z=>_.$emit("fetch:error",Z)),"onFetch:success":w,onLoading:N[1]||(N[1]=Z=>_.$emit("loading",Z))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(Z=>[o.unref(l)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:o.unref(l)("rowValue",Z),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(q,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(Z=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(l)("rowValue",Z)),ne=>(o.openBlock(),o.createBlock(o.unref(ao),{key:ne,item:{key:ne,value:h(ne,Z),label:M(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?o.unref(ce).BadgeTag:o.unref(ce).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(B.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(E.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[S.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",tb,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(S.value,(Z,ne)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Z,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Z),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[C.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},A.value?{name:"cert_alt",fn:o.withCtx(Z=>[o.createTextVNode(" > "),o.unref(l)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:o.unref(l)("rowValue",Z),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-993d1527"]]);Ve.CACertificateConfigCard=q1,Ve.CACertificateForm=X1,Ve.CACertificateList=Z1,Ve.CertificateConfigCard=rb,Ve.CertificateForm=L1,Ve.CertificateList=R1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|
|
147
|
+
`+e.slice(a+1):l+=e.slice(n),l.slice(1)}function Zm(e){for(var t="",r=0,i,n=0;n<e.length;r>=65536?n+=2:n++)r=_i(e,n),i=De[r],!i&&Oi(r)?(t+=e[n],r>=65536&&(t+=e[n+1])):t+=i||Fm(r);return t}function Qm(e,t,r){var i="",n=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(_t(e,t,c,!1,!1)||typeof c>"u"&&_t(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=n,e.dump="["+i+"]"}function Pf(e,t,r,i){var n="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(_t(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&_t(e,t+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=Ya(e,t)),e.dump&&Ei===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=s,e.dump=n||"[]"}function Xm(e,t,r){var i="",n=e.tag,s=Object.keys(r),a,c,l,d,y;for(a=0,c=s.length;a<c;a+=1)y="",i!==""&&(y+=", "),e.condenseFlow&&(y+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),_t(e,t,l,!1,!1)&&(e.dump.length>1024&&(y+="? "),y+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),_t(e,t,d,!1,!1)&&(y+=e.dump,i+=y));e.tag=n,e.dump="{"+i+"}"}function e0(e,t,r,i){var n="",s=e.tag,a=Object.keys(r),c,l,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 Pe("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)I="",(!i||n!=="")&&(I+=Ya(e,t)),d=a[c],y=r[d],e.replacer&&(y=e.replacer.call(r,d,y)),_t(e,t+1,d,!0,!0,!0)&&(p=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,p&&(e.dump&&Ei===e.dump.charCodeAt(0)?I+="?":I+="? "),I+=e.dump,p&&(I+=Ya(e,t)),_t(e,t+1,y,!0,p)&&(e.dump&&Ei===e.dump.charCodeAt(0)?I+=":":I+=": ",I+=e.dump,n+=I));e.tag=s,e.dump=n||"{}"}function Rf(e,t,r){var i,n,s,a,c,l;for(n=r?e.explicitTypes:e.implicitTypes,s=0,a=n.length;s<a;s+=1)if(c=n[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,kf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(Cf.call(c.represent,l))i=c.represent[l](t,l);else throw new Pe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function _t(e,t,r,i,n,s,a){e.tag=null,e.dump=r,Rf(e,r,!1)||Rf(e,r,!0);var c=kf.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var y=c==="[object Object]"||c==="[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)&&(n=!1),I&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(y&&I&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(e0(e,t,e.dump,n),I&&(e.dump="&ref_"+p+e.dump)):(Xm(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Pf(e,t-1,e.dump,n):Pf(e,t,e.dump,n),I&&(e.dump="&ref_"+p+e.dump)):(Qm(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&Jm(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Pe("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function t0(e,t){var r=[],i=[],n,s;for(Qa(e,r,i),n=0,s=i.length;n<s;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=new Array(s)}function Qa(e,t,r){var i,n,s;if(e!==null&&typeof e=="object")if(n=t.indexOf(e),n!==-1)r.indexOf(n)===-1&&r.push(n);else if(t.push(e),Array.isArray(e))for(n=0,s=e.length;n<s;n+=1)Qa(e[n],t,r);else for(i=Object.keys(e),n=0,s=i.length;n<s;n+=1)Qa(e[i[n]],t,r)}function r0(e,t){t=t||{};var r=new qm(t);r.noRefs||t0(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),_t(r,0,i,!0,!0)?r.dump+`
|
|
148
|
+
`:""}var i0=r0,n0={dump:i0};function Xa(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var o0=Te,s0=Ud,a0=qd,c0=Jd,l0=Yd,u0=qa,d0=vf.load,f0=vf.loadAll,p0=n0.dump,h0=Pe,y0={binary:tf,float:Wd,map:Hd,null:Kd,pairs:nf,set:of,timestamp:Xd,bool:zd,int:Gd,merge:ef,omap:rf,seq:Fd,str:Ld},g0=Xa("safeLoad","load"),m0=Xa("safeLoadAll","loadAll"),b0=Xa("safeDump","dump"),w0={Type:o0,Schema:s0,FAILSAFE_SCHEMA:a0,JSON_SCHEMA:c0,CORE_SCHEMA:l0,DEFAULT_SCHEMA:u0,load:d0,loadAll:f0,dump:p0,YAMLException:h0,types:y0,safeLoad:g0,safeLoadAll:m0,safeDump:b0};const v0={class:"yaml-config"},Uf=o.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const t=e,r=o.computed(()=>{const i=Object.fromEntries(Object.entries(t.yamlRecord).filter(([,n])=>n&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(i).length===0&&i.constructor===Object?"":w0.dump(i).trim()});return(i,n)=>{const s=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",v0,[t.yamlRecord?(o.openBlock(),o.createBlock(s,{key:0,id:"yaml-codeblock",code:r.value,language:"yaml",theme:"dark"},null,8,["code"])):o.createCommentVNode("",!0)])}}}),k0={key:0,class:"config-card-display-form"},C0=["data-testid"],S0={key:0,class:"config-card-prop-section-title"},x0=o.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=o.useSlots(),{i18n:{t:i}}=Be.useI18n(),n=a=>!!(a.tooltip||r[`${a.key}-label-tooltip`]),s=o.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,c)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[e.format==="structured"?(o.openBlock(),o.createElementBlock("div",k0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propListTypes,l=>(o.openBlock(),o.createElementBlock("div",{key:`config-card-details-${l}-props`,class:o.normalizeClass(`config-card-details-${l}-props`),"data-testid":`config-card-details-${l}-props`},[l!=="basic"?(o.openBlock(),o.createElementBlock("div",S0,o.toDisplayString(l==="advanced"?o.unref(i)("baseConfigCard.sections.advanced"):o.unref(i)("baseConfigCard.sections.plugin")),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.propertyCollections[l],d=>(o.openBlock(),o.createBlock(lo,{key:d.key,item:d},o.createSlots({label:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:o.withCtx(({rowValue:y})=>[o.renderSlot(a.$slots,d.key,{row:d,rowValue:y},void 0,!0)]),_:2},[n(d)?{name:"label-tooltip",fn:o.withCtx(()=>[o.renderSlot(a.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,C0))),128))])):o.createCommentVNode("",!0),e.format==="json"&&t.record?(o.openBlock(),o.createBlock(Md,{key:1,config:t.config,"fetcher-url":t.fetcherUrl,"json-record":s.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):o.createCommentVNode("",!0),e.format==="yaml"&&t.record?(o.openBlock(),o.createBlock(Uf,{key:2,"yaml-record":s.value},null,8,["yaml-record"])):o.createCommentVNode("",!0)],64))}}),A0=ct(x0,[["__scopeId","data-v-147a2f70"]]),Ht="24px",mo=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},B0=e=>(o.pushScopeId("data-v-2295e0fb"),e=e(),o.popScopeId(),e),I0=["aria-hidden"],E0={key:0,"data-testid":"kui-icon-svg-title"},N0=B0(()=>o.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),O0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",E0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),N0],8,I0))]),_:1},8,["aria-hidden","style"]))}}),_0=mo(O0,[["__scopeId","data-v-2295e0fb"]]),T0=e=>(o.pushScopeId("data-v-40a7f387"),e=e(),o.popScopeId(),e),V0=["aria-hidden"],j0={key:0,"data-testid":"kui-icon-svg-title"},D0=T0(()=>o.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)),M0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",j0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),D0],8,V0))]),_:1},8,["aria-hidden","style"]))}}),$0=mo(M0,[["__scopeId","data-v-40a7f387"]]),P0=e=>(o.pushScopeId("data-v-98c34919"),e=e(),o.popScopeId(),e),R0=["aria-hidden"],U0={key:0,"data-testid":"kui-icon-svg-title"},L0=P0(()=>o.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),F0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.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:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",U0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),L0],8,R0))]),_:1},8,["aria-hidden","style"]))}}),H0=mo(F0,[["__scopeId","data-v-98c34919"]]),q0=e=>(o.pushScopeId("data-v-19f4cbbe"),e=e(),o.popScopeId(),e),K0=["aria-hidden"],z0={key:0,"data-testid":"kui-icon-svg-title"},G0=q0(()=>o.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)),W0=o.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:Ht,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=o.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const n=String(t.size).replace(/px/gi,""),s=Number(n);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return Ht}),i=o.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(n,s)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:o.normalizeStyle(i.value)},{default:o.withCtx(()=>[(o.openBlock(),o.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?(o.openBlock(),o.createElementBlock("title",z0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),G0],8,K0))]),_:1},8,["aria-hidden","style"]))}}),J0=mo(W0,[["__scopeId","data-v-19f4cbbe"]]),Y0={class:"config-card-title","data-testid":"config-card-title"},Z0={class:"config-card-actions"},Q0=["href"],X0={class:"config-card-details-section"},e1=o.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,n=e,{i18n:{t:s}}=Be.useI18n(),{getMessageFromError:a}=Be.useErrors(),{convertKeyToTitle:c}=Be.useStringHelpers(),{axiosInstance:l}=Be.useAxios({headers:(r=n.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],y=o.ref("structured"),p=A=>{y.value=A==null?void 0:A.value},I={id:{type:ce.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:fe.Basic},name:{order:1,section:fe.Basic},enabled:{type:ce.BadgeStatus,order:2,section:fe.Basic},updated_at:{type:ce.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:fe.Basic},created_at:{type:ce.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:fe.Basic},tags:{type:ce.BadgeTag,order:-1,section:fe.Basic}},w=o.ref(!1),h=o.ref(!1),g=o.ref(""),b=o.ref({}),k=o.computed(()=>{var A,M,_;if(!b.value)return[];const N=[],re=Object.keys(b.value).length;for(const q in b.value){const j=(M=(A=n.configSchema)==null?void 0:A[q])==null?void 0:M.order,Z=(_=I[q])==null?void 0:_.order;let ne=re;(Z||Z===0)&&(ne=Z===-1?re+1:Z),j&&(ne=j===-1?re+1:j),N.push([q,ne])}return N.sort(function(q,j){return q[1]-j[1]}),N.map(q=>{var j,Z;const ne=q[0],Ie=(j=b.value)==null?void 0:j[ne],Ce=((Z=n.configSchema)==null?void 0:Z[ne])||{},Ee=I[ne];return{key:ne,value:Ie,hidden:Ce.hidden||!1,type:Ce.type??((Ee==null?void 0:Ee.type)||ce.Text),label:Ce.label??((Ee==null?void 0:Ee.label)||c(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!==n.pluginConfigKey)}),B=o.computed(()=>{var A,M;if(!b.value||!n.pluginConfigKey)return[];const _=b.value[n.pluginConfigKey]||{},N=Object.keys(_).length,re=[];for(const q in _){const j=(M=(A=n.pluginConfigSchema)==null?void 0:A[q])==null?void 0:M.order,Z=_[q];let ne=Z!=null&&Z!==""?N-1:N;j&&(ne=j===-1?N+1:j),re.push([q,ne])}return re.sort(function(q,j){return q[1]-j[1]}),re.map(q=>{var j;const Z=q[0],ne=_[Z],Ie=((j=n.pluginConfigSchema)==null?void 0:j[Z])||{};return{key:Z,value:ne,hidden:Ie.hidden||!1,type:Ie.type??ce.Text,label:Ie.label??c(Z),tooltip:Ie.tooltip??void 0,section:fe.Plugin}}).filter(q=>!q.hidden)}),E=o.computed(()=>{var A,M,_,N;return{basic:(A=k.value)==null?void 0:A.filter(re=>re.section===fe.Basic),advanced:(M=k.value)==null?void 0:M.filter(re=>re.section===fe.Advanced),plugin:(N=B.value)==null?void 0:N.concat((_=k.value)==null?void 0:_.filter(re=>re.section===fe.Plugin))}}),S=o.computed(()=>{const A=[];return E.value.basic.length&&A.push("basic"),E.value.advanced.length&&A.push("advanced"),E.value.plugin.length&&A.push("plugin"),A}),C=o.computed(()=>{var A,M;let _=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,((A=n.config)==null?void 0:A.controlPlaneId)||""):n.config.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,(M=n.config)!=null&&M.workspace?`/${n.config.workspace}`:"")),_=_.replace(/{id}/gi,n.config.entityId),_});return o.watch(w,A=>{i("loading",A)},{immediate:!0}),o.onBeforeMount(async()=>{h.value=!1,w.value=!0;try{const{data:A}=await l.get(C.value);if(n.dataKey)if(typeof A[n.dataKey]<"u")b.value={...A[n.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:n.dataKey}));else b.value={...A};Object.keys(n.configSchema).filter(M=>n.configSchema[M].forceShow).forEach(M=>{b.value&&typeof b.value[M]>"u"&&(b.value[M]=null)}),i("fetch:success",A)}catch(A){const M=a(A);g.value=M.startsWith("code")?s("baseConfigCard.errors.load"):M,h.value=!0,i("fetch:error",A)}finally{w.value=!1}}),(A,M)=>{const _=o.resolveComponent("KLabel"),N=o.resolveComponent("KSelect"),re=o.resolveComponent("KButton"),q=o.resolveComponent("KSkeleton"),j=o.resolveComponent("KEmptyState"),Z=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(Z,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},o.createSlots({actions:o.withCtx(()=>[o.createElementVNode("div",Z0,[o.renderSlot(A.$slots,"actions",{},void 0,!0),o.createVNode(_,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1}),o.createVNode(N,{"data-testid":"select-config-format",items:d,onChange:p}),e.configCardDoc?(o.openBlock(),o.createBlock(re,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:o.withCtx(()=>[o.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[o.createVNode(o.unref($0),{size:o.unref(Ry)},null,8,["size"])],8,Q0)]),_:1})):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[w.value?(o.openBlock(),o.createBlock(q,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(o.openBlock(),o.createBlock(j,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(g.value),1)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",X0,[o.createVNode(A0,{config:e.config,"fetcher-url":C.value,format:y.value,"prop-list-types":S.value,"property-collections":E.value,record:b.value},o.createSlots({_:2},[o.renderList(Object.keys(A.$slots),ne=>({name:ne,fn:o.withCtx(({row:Ie,rowValue:Ce})=>[o.renderSlot(A.$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:o.withCtx(()=>[o.createElementVNode("span",Y0,[o.renderSlot(A.$slots,"title",{},()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Lf=ct(e1,[["__scopeId","data-v-3c3b1eb5"]]),t1={class:"form-actions","data-testid":"form-actions"},r1=o.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}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=t,n=e,s=Gr.useRouter(),{i18n:{t:a}}=Be.useI18n(),{getMessageFromError:c}=Be.useErrors(),{axiosInstance:l}=Be.useAxios({headers:(r=n.config)==null?void 0:r.requestHeaders}),d=o.ref(!1),y=o.ref(!1),p=o.ref(""),I=o.computed(()=>n.canSubmit===!1||n.isReadonly),w=o.ref(!1),h=o.computed(()=>{var S,C;let A=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?A=A.replace(/{controlPlaneId}/gi,((S=n.config)==null?void 0:S.controlPlaneId)||""):n.config.app==="kongManager"&&(A=A.replace(/\/{workspace}/gi,(C=n.config)!=null&&C.workspace?`/${n.config.workspace}`:"")),n.editId?(A=A.replace(/{id}/gi,n.editId),A):(A=A.replace(/\/{id}/gi,""),A)}),g=()=>{w.value=!w.value},b=()=>{n.config.cancelRoute?s.push(n.config.cancelRoute):k()},k=()=>{i("cancel")},B=()=>{I.value||i("submit")},E=o.ref([{title:a("baseForm.configuration.yaml"),hash:"#yaml"},{title:a("baseForm.configuration.json"),hash:"#json"}]);return o.watch(()=>d.value,S=>{i("loading",S)},{immediate:!0}),o.onBeforeMount(async()=>{if(n.editId)try{y.value=!1,d.value=!0;const{data:S}=await l.get(h.value);i("fetch:success",S)}catch(S){const C=c(S);p.value=C.startsWith("code")?a("baseForm.errors.edit"):C,y.value=!0,i("fetch:error",S)}finally{d.value=!1}}),(S,C)=>{const A=o.resolveComponent("KSkeleton"),M=o.resolveComponent("KEmptyState"),_=o.resolveComponent("KAlert"),N=o.resolveComponent("KButton"),re=o.resolveComponent("KTabs"),q=o.resolveComponent("KSlideout"),j=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(j,{class:"kong-ui-entity-base-form"},{default:o.withCtx(()=>[d.value?(o.openBlock(),o.createBlock(A,{key:0,type:"form"})):y.value?(o.openBlock(),o.createBlock(M,{key:1,"action-button-text":o.unref(a)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:b},{default:o.withCtx(()=>[o.createElementVNode("h3",null,o.toDisplayString(p.value),1)]),_:1},8,["action-button-text"])):(o.openBlock(),o.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:o.withModifiers(k,["prevent"]),onSubmit:o.withModifiers(B,["prevent"])},[o.renderSlot(S.$slots,"default",{},void 0,!0),e.errorMessage?(o.openBlock(),o.createBlock(_,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):o.createCommentVNode("",!0),o.createElementVNode("div",t1,[o.renderSlot(S.$slots,"form-actions",{},()=>[o.createVNode(N,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:C[0]||(C[0]=Z=>g())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.viewConfiguration")),1)]),_:1}),o.createVNode(N,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),o.createVNode(N,{appearance:"primary","data-testid":"form-submit",disabled:I.value,type:"submit"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),o.createVNode(q,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:o.unref(a)("baseForm.configuration.title"),visible:w.value,onClose:C[1]||(C[1]=Z=>g())},{default:o.withCtx(()=>[o.createElementVNode("div",null,o.toDisplayString(o.unref(a)("baseForm.configuration.message")),1),o.createVNode(re,{"data-testid":"form-view-configuration-slideout-tabs",tabs:E.value},{json:o.withCtx(()=>[o.createVNode(Md,{config:e.config,"fetcher-url":h.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:o.withCtx(()=>[o.createVNode(Uf,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Ff=ct(r1,[["__scopeId","data-v-4c62c7d5"]]),i1={key:0,"data-testid":"first-col"},n1=o.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=o.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=o.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[data-testid="first-col"]'))||null}),n=o.computed(()=>{var g,b;const k=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return k?((b=k[0])==null?void 0:b.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,b,k;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,y.value=((b=r.value)==null?void 0:b.clientWidth)||0,p.value=((k=l.value)==null?void 0:k.innerText)||""},l=o.ref({}),d=o.ref(0),y=o.ref(0),p=o.ref(""),I=o.computed(()=>[i.value,r.value]),w=o.watch(I,g=>{if(n.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(b=>{window.requestAnimationFrame(()=>{!Array.isArray(b)||!b.length||c()})});for(const b of g)b&&s.observe(b)}},{immediate:!0,flush:"post",deep:!0}),h=o.computed(()=>n.value?d.value>y.value:!1);return o.onMounted(()=>{c()}),o.onUnmounted(()=>{w()}),(g,b)=>{const k=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[n.value?(o.openBlock(),o.createElementBlock("span",i1,[o.createVNode(k,{"max-width":"300",placement:"bottomStart",text:h.value?p.value:""},{default:o.withCtx(()=>[o.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):o.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),o1=ct(n1,[["__scopeId","data-v-c4379fd4"]]),s1={class:"toolbar-container"},a1={key:0,class:"toolbar-button-container"},c1=["data-testid"],l1=o.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},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:n}}=Be.useI18n(),s=o.computed(()=>{var C,A;return typeof r.errorMessage=="string"?{hasError:!!r.errorMessage,title:r.errorMessage,message:void 0}:{hasError:!!r.errorMessage,title:(C=r.errorMessage)==null?void 0:C.title,message:(A=r.errorMessage)==null?void 0:A.message}}),a=o.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),c=C=>C.hasData||!!r.query,l=o.computed(()=>{const C=[];return Object.keys(r.tableHeaders).forEach(A=>{const M=r.tableHeaders[A];C.push({label:M.label??A,key:A,sortable:M.sortable??!1})}),r.enableEntityActions&&C.push({key:"actions",hideLabel:!0}),C}),d=C=>({"data-rowid":C.id,"data-testid":C.name,...r.rowAttributes(C)}),y=o.ref({}),p=C=>{var A;return(A=y.value)==null?void 0:A.$el.querySelector(`[data-rowid="${C.id}"]`)},I=C=>{const A={"data-testid":C.headerKey,...r.cellAttributes(C)};return C.colIndex===0&&(A.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),A},w=()=>{i("empty-state-cta-clicked"),h()},h=()=>{i("clear-search-input")},g=o.computed(()=>r.disableRowClick?void 0:(C,A)=>{i("click:row",A)}),b=C=>{i("sort",C)},{setTablePreferences:k,getTablePreferences:B}=iy(),E=o.computed(()=>{const C=B(r.preferencesStorageKey);return{...r.initialFetcherParams,...C}}),S=C=>{r.preferencesStorageKey&&k(r.preferencesStorageKey,C)};return(C,A)=>{const M=o.resolveComponent("KIcon"),_=o.resolveComponent("KButton"),N=o.resolveComponent("KDropdown"),re=o.resolveComponent("KTable"),q=o.resolveComponent("KCard");return o.openBlock(),o.createBlock(q,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:o.withCtx(()=>[o.createVNode(re,{ref_key:"tableRefs",ref:y,"cache-identifier":a.value,"cell-attrs":I,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?o.unref(n)("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?o.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?o.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":s.value.message,"error-state-title":s.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":s.value.hasError,headers:l.value,"hide-pagination-when-optional":"","initial-fetcher-params":E.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:w,"onRow:click":g.value,onSort:A[0]||(A[0]=j=>b(j)),"onUpdate:tablePreferences":S},o.createSlots({toolbar:o.withCtx(({state:j})=>[o.withDirectives(o.createElementVNode("div",s1,[o.renderSlot(C.$slots,"toolbar-filter",{},void 0,!0),C.$slots["toolbar-button"]?(o.openBlock(),o.createElementBlock("div",a1,[o.renderSlot(C.$slots,"toolbar-button",{},void 0,!0)])):o.createCommentVNode("",!0)],512),[[o.vShow,c(j)]])]),actions:o.withCtx(({row:j,rowKey:Z,rowValue:ne})=>[o.createElementVNode("div",{class:"actions-container","data-testid":j.name},[o.createVNode(N,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:o.withCtx(()=>[o.renderSlot(C.$slots,"actions",{row:j,rowKey:Z,rowValue:ne},void 0,!0)]),default:o.withCtx(()=>[o.createVNode(_,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:o.withCtx(()=>[o.createVNode(M,{color:o.unref(My),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,c1)]),_:2},[o.renderList(e.tableHeaders,(j,Z)=>({name:Z,fn:o.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[o.createVNode(o1,{"key-name":String(Z),"row-el":p(ne)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,Z,{row:ne,rowKey:Ie,rowValue:Ce},()=>[o.createTextVNode(o.toDisplayString(Ce),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:o.withCtx(()=>[o.createVNode(o.unref(_0))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Hf=ct(l1,[["__scopeId","data-v-99908c24"]]),u1={key:0,class:"kong-ui-entity-delete-error"},d1={key:1,class:"description"},f1=o.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,n=t,s=o.computed(()=>i.needConfirm?i.entityName:""),a=()=>{n("cancel")},c=()=>{n("proceed")};return(l,d)=>{const y=o.resolveComponent("KAlert"),p=o.resolveComponent("KPrompt");return o.openBlock(),o.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:c},{default:o.withCtx(()=>[e.error?(o.openBlock(),o.createElementBlock("div",u1,[o.createVNode(y,{appearance:"danger"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.error),1)]),_:1})])):o.createCommentVNode("",!0),o.createVNode(o.unref(r),{class:"message",keypath:i.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},o.createSlots({entityType:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.entityType),1)]),_:2},[i.entityName?{name:"entityName",fn:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),i.description||l.$slots.description?(o.openBlock(),o.createElementBlock("div",d1,[o.renderSlot(l.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(i.description),1)],!0)])):o.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),qf=ct(f1,[["__scopeId","data-v-4361d622"]]),p1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},h1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},y1=["fill"],g1={mask:"url(#mask0_180_20349)"},m1=["fill"],Kf=o.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${jy})`}},setup(e){return(t,r)=>(o.openBlock(),o.createElementBlock("svg",p1,[o.createElementVNode("mask",h1,[o.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,y1)]),o.createElementVNode("g",g1,[o.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,m1)])]))}}),b1={key:1,class:"kong-ui-entity-filter"},w1={class:"kong-ui-entity-filter-menu"},v1=["data-testid"],k1=["onClick","onKeydown"],C1={class:"menu-item-indicator"},S1={class:"menu-item-body"},x1=["for"],A1={class:"menu-item-buttons"},B1={class:"filter-clear-button-container"},I1=o.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,n=t,s=o.ref(!1),a=o.ref({}),c=o.ref(new Set),l=o.computed(()=>{const S=[];return new URLSearchParams(i.modelValue).forEach((C,A)=>{C!==""&&S.push(A)}),S}),d=o.computed(()=>{const S=i.config.fields;return Object.keys(S).filter(C=>S[C].searchable).map(C=>({label:S[C].label||C,value:C,expanded:!1}))});o.watch(()=>i.modelValue,S=>{a.value={},new URLSearchParams(S).forEach((C,A)=>{a.value[A]=C})});const y=()=>{s.value=!s.value},p=S=>{c.value.has(S)?c.value.delete(S):c.value.add(S)},I=S=>{n("update:modelValue",S)},w=()=>{I("")},h=S=>`filter-${S}`,g=S=>{var C,A;return(((A=(C=i.config.schema)==null?void 0:C[S])==null?void 0:A.values)??[]).map(M=>({value:M,label:M}))},b=S=>{var C,A;return((A=(C=i.config.schema)==null?void 0:C[S])==null?void 0:A.type)??"text"},k=S=>{a.value={...a.value,[S]:""},E()},B=()=>{a.value={},E(!0)},E=(S=!1)=>{const C=Object.keys(a.value).reduce((A,M)=>(a.value[M]&&(A[M]=`${a.value[M]}`),A),{});S&&(s.value=!1),n("update:modelValue",new URLSearchParams(C).toString())};return(S,C)=>{const A=o.resolveComponent("KInput"),M=o.resolveComponent("KButton"),_=o.resolveComponent("KSelect");return e.config.isExactMatch?(o.openBlock(),o.createBlock(A,{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:o.withCtx(()=>[o.createVNode(Kf)]),after:o.withCtx(()=>[o.withDirectives(o.createVNode(o.unref(J0),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[o.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(o.openBlock(),o.createElementBlock("div",b1,[o.createVNode(M,{appearance:"tertiary","data-testid":"filter-button",onClick:y},{default:o.withCtx(()=>[o.createVNode(Kf),o.createTextVNode(" "+o.toDisplayString(o.unref(r)("filter.filterButtonText"))+" "+o.toDisplayString(l.value.length>0?`(${l.value.length})`:""),1)]),_:1}),o.withDirectives(o.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:y},null,512),[[o.vShow,s.value]]),o.withDirectives(o.createElementVNode("div",w1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,N=>{var re,q;return o.openBlock(),o.createElementBlock("div",{key:N.value,class:"kong-ui-entity-filter-menu-item","data-testid":N.value},[o.createElementVNode("span",{class:o.normalizeClass(["menu-item-title",{expanded:c.value.has(N.value)}]),role:"button",tabindex:"0",onClick:j=>p(N.value),onKeydown:o.withKeys(j=>p(N.value),["enter"])},[o.createTextVNode(o.toDisplayString(N.label)+" ",1),o.withDirectives(o.createElementVNode("span",C1,null,512),[[o.vShow,l.value.includes(N.value)]]),o.createVNode(o.unref(H0),{class:o.normalizeClass(["menu-item-expand-icon",{expanded:c.value.has(N.value)}]),color:o.unref($y)},null,8,["class","color"])],42,k1),o.withDirectives(o.createElementVNode("div",S1,[o.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},o.toDisplayString(o.unref(r)("filter.fieldLabel")),9,x1),((q=(re=e.config.schema)==null?void 0:re[N.value])==null?void 0:q.type)==="select"?(o.openBlock(),o.createBlock(_,{key:0,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,items:g(N.value),placeholder:o.unref(r)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(o.openBlock(),o.createBlock(A,{key:1,id:h(N.value),modelValue:a.value[N.value],"onUpdate:modelValue":j=>a.value[N.value]=j,autocomplete:"off",placeholder:o.unref(r)("filter.inputPlaceholder"),type:b(N.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[o.vShow,c.value.has(N.value)]]),o.withDirectives(o.createElementVNode("div",A1,[o.createVNode(M,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:C[0]||(C[0]=j=>E(!0))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.applyButtonText")),1)]),_:1}),o.createVNode(M,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:j=>k(N.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[o.vShow,c.value.has(N.value)]])],8,v1)}),128)),o.createElementVNode("div",B1,[o.createVNode(M,{appearance:"tertiary",size:"small",onClick:B},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(r)("filter.clearAllButtonText")),1)]),_:1})])],512),[[o.vShow,s.value]])]))}}}),zf=ct(I1,[["__scopeId","data-v-8cfadde3"]]),Tt=o.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=o.ref(void 0),i=o.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return o.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(n,s)=>i.value?o.renderSlot(n.$slots,"default",{key:0,isAllowed:r.value}):o.createCommentVNode("",!0)}}),E1={class:"form-section-wrapper"},N1={key:1,class:"form-section-description"},O1={key:2,class:"form-section-footer"},_1={class:"form-section-content"},T1=o.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=o.useSlots();return(r,i)=>(o.openBlock(),o.createElementBlock("fieldset",{class:o.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[o.createElementVNode("div",E1,[e.hideInfoHeader?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.titleTag),{key:0,class:"form-section-title"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1})):o.createCommentVNode("",!0),e.description||o.unref(t).description?(o.openBlock(),o.createElementBlock("div",N1,[o.renderSlot(r.$slots,"description",{},()=>[o.createElementVNode("p",null,o.toDisplayString(e.description),1)],!0)])):o.createCommentVNode("",!0),o.unref(t).footer?(o.openBlock(),o.createElementBlock("div",O1,[o.renderSlot(r.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2)),o.createElementVNode("div",_1,[o.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),bo=ct(T1,[["__scopeId","data-v-4bb31634"]]),{useAxios:wo,useDeleteUrlBuilder:Gf,useErrors:Wf,useExternalLinkCreator:vb,useFetchUrlBuilder:kb,useFetcher:Jf,useDebouncedFilter:Cb,useStringHelpers:Yf,useHelpers:Zf,useGatewayFeatureSupported:Sb,useTruncationDetector:xb,useValidators:Ab}=Be,V1={class:"kong-ui-entities-certificates-list"},j1={key:0},D1={key:1},M1={key:0},$1={key:1},P1={key:0},R1={key:1},U1={key:1},L1={key:1},F1=o.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:n,formatUnixTimeStamp:s},i18nT:a}=bt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=wo({headers:(ee=i.config)==null?void 0:ee.requestHeaders}),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={subject:{label:n("certificates.list.table_headers.subject")},expiry:{label:n("certificates.list.table_headers.expiry")},san:{label:n("certificates.list.table_headers.san")},cert:{label:n("certificates.list.table_headers.cert")},tags:{label:n("certificates.list.table_headers.tags"),sortable:!0}},w=o.computed(()=>{var K,de;let U=`${i.config.apiBaseUrl}${Bi.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=o.ref(""),g=o.computed(()=>{const U=i.config.app==="konnect"||i.config.isExactMatch;return U?{isExactMatch:U,placeholder:n("certificates.search.placeholder")}:{isExactMatch:U,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:k}=Jf(i.config,w.value),B=()=>{h.value=""},E=()=>{d.value++},S=o.ref(null),C=(U,K)=>{const de=U.id;if(!K(de)){r("copy:error",{entity:U,field:"id",message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,field:"id",message:n("certificates.copy.success",{val:de})})},A=(U,K)=>{const de=JSON.stringify(U);if(!K(de)){r("copy:error",{entity:U,message:n("certificates.errors.copy")});return}r("copy:success",{entity:U,message:n("certificates.copy.success_brief")})},M=async U=>{var de;await((de=i.canRetrieve)==null?void 0:de.call(i,U))&&c.push(i.config.getViewRoute(U.id))},_=U=>({label:n("certificates.actions.view"),to:i.config.getViewRoute(U)}),N=U=>({label:n("certificates.actions.edit"),to:i.config.getEditRoute(U)}),re=U=>{if(i.config.getCreateSniRoute)return{label:n("certificates.actions.addSni"),to:i.config.getCreateSniRoute(U)}},q=o.ref(void 0),j=o.ref(!1),Z=o.ref(!1),ne=o.ref(""),Ie=Gf(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=bt.useCertificate(),Hr=U=>{q.value=U,j.value=!0},qr=()=>{j.value=!1},ur=async()=>{var U,K,de;if((U=q.value)!=null&&U.id){Z.value=!0;try{await l.delete(Ie(q.value.id)),Z.value=!1,j.value=!1,d.value++,r("delete:success",q.value)}catch(Re){ne.value=((de=(K=Re.response)==null?void 0:K.data)==null?void 0:de.message)||Re.message||n("certificates.errors.delete"),r("error",Re)}finally{Z.value=!1}}},Vt=o.ref(!0);o.watch(k,U=>{var K,de,Re,Ze;if(Array.isArray((K=U==null?void 0:U.response)==null?void 0:K.data)&&(Vt.value=U.response.data.length>0),U.status===Ut.Error){S.value={title:n("certificates.errors.general")},(Ze=(Re=(de=U.error)==null?void 0:de.response)==null?void 0:Re.data)!=null&&Ze.message&&(S.value.message=U.error.response.data.message),r("error",U.error);return}Ce.value={},S.value=null});const X=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(X.value.title=n("certificates.list.empty_state.title"),X.value.ctaText=n("certificates.actions.create"))}),(U,K)=>{const de=o.resolveComponent("KButton"),Re=o.resolveComponent("KCopy"),Ze=o.resolveComponent("KBadge"),Kr=o.resolveComponent("KTruncate"),te=o.resolveComponent("KDropdownItem"),Se=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",V1,[o.createVNode(o.unref(Hf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":X.value,"enable-entity-actions":"","error-message":S.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":K[2]||(K[2]=Y=>M(Y)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(zf),{modelValue:h.value,"onUpdate:modelValue":K[0]||(K[0]=Y=>h.value=Y),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(de,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"]),[[o.vShow,Vt.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),subject:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",j1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",D1,o.toDisplayString(o.unref(Ee)(Y).schemaSubject||"-"),1))]}),expiry:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",M1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",$1,o.toDisplayString(o.unref(Ee)(Y).schemaExpiry?o.unref(s)(o.unref(Ee)(Y).schemaExpiry):"-"),1))]}),san:o.withCtx(({row:Y})=>{var xe;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",P1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.dns_names?`dns=${Y.metadata.dns_names.join(", ")}`:"-"),1)):(o.openBlock(),o.createElementBlock("span",R1,o.toDisplayString(o.unref(Ee)(Y).schemaSanNames||"-"),1))]}),cert:o.withCtx(({row:Y})=>[Y!=null&&Y.cert?(o.openBlock(),o.createBlock(Re,{key:0,"data-testid":"copy-certificate-cert",text:Y.cert,truncate:""},null,8,["text"])):(o.openBlock(),o.createElementBlock("span",U1,"-"))]),tags:o.withCtx(({row:Y})=>{var xe;return[((xe=Y==null?void 0:Y.tags)==null?void 0:xe.length)>0?(o.openBlock(),o.createBlock(Kr,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Y==null?void 0:Y.tags,zr=>(o.openBlock(),o.createBlock(Ze,{key:zr,onClick:K[1]||(K[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(zr),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",L1,"-"))]}),actions:o.withCtx(({row:Y})=>[o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-id",onClick:zr=>C(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Se,null,{default:o.withCtx(({copyToClipboard:xe})=>[o.createVNode(te,{"data-testid":"action-entity-copy-json",onClick:zr=>A(Y,xe)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canRetrieve(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-view","has-divider":"",item:_(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canEdit(Y)},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-edit",item:N(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(o.openBlock(),o.createBlock(o.unref(Tt),{key:0,"auth-function":()=>e.canCreateSni()},{default:o.withCtx(()=>[o.createVNode(te,{"data-testid":"action-entity-add-sni",item:re(Y.id)},null,8,["item"])]),_:2},1032,["auth-function"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canDelete(Y)},{default:o.withCtx(()=>[o.createVNode(te,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:xe=>Hr(Y)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),o.createVNode(o.unref(qf),{"action-pending":Z.value,"entity-type":o.unref($a).Certificate,error:ne.value,title:o.unref(n)("certificates.delete.title"),visible:j.value,onCancel:qr,onProceed:ur},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),Fr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},H1=Fr(F1,[["__scopeId","data-v-f8690ed7"]]),q1={class:"kong-ui-entities-certificates-form"},K1=Fr(o.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 S;const r=t,i=e,n=Gr.useRouter(),{i18nT:s,i18n:{t:a}}=bt.useI18n(),{getMessageFromError:c}=Wf(),{axiosInstance:l}=wo({headers:(S=i.config)==null?void 0:S.requestHeaders}),d=o.computed(()=>Bi.form[i.config.app].edit),y=o.computed(()=>i.certificateId?cr.Edit:cr.Create),p=o.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),I=o.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),w=o.computed(()=>(y.value===cr.Create||JSON.stringify(p.fields)!==JSON.stringify(I))&&!!p.fields.cert&&!!p.fields.key),h=C=>{var A;p.fields.cert=(C==null?void 0:C.cert)||"",p.fields.key=(C==null?void 0:C.key)||"",p.fields.certAlt=(C==null?void 0:C.cert_alt)||"",p.fields.keyAlt=(C==null?void 0:C.key_alt)||"",p.fields.tags=((A=C==null?void 0:C.tags)==null?void 0:A.join(", "))||"",Object.assign(I,p.fields)},g=()=>{n.push(i.config.cancelRoute)},b=o.computed(()=>{var A,M;let C=`${i.config.apiBaseUrl}${Bi.form[i.config.app].validate}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),k=o.computed(()=>{var A,M;let C=`${i.config.apiBaseUrl}${Bi.form[i.config.app][y.value]}`;return i.config.app==="konnect"?C=C.replace(/{controlPlaneId}/gi,((A=i.config)==null?void 0:A.controlPlaneId)||""):i.config.app==="kongManager"&&(C=C.replace(/\/{workspace}/gi,(M=i.config)!=null&&M.workspace?`/${i.config.workspace}`:"")),C=C.replace(/{id}/gi,i.certificateId),C}),B=o.computed(()=>{var C,A;return{cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(A=(C=p.fields.tags.split(","))==null?void 0:C.map(M=>String(M||"").trim()))==null?void 0:A.filter(M=>M!=="")}}),E=async()=>{var C,A,M,_,N,re,q;try{p.isReadonly=!0;let j;await l.post(b.value,B.value),y.value==="create"?j=await l.post(k.value,B.value):y.value==="edit"&&(j=((C=i.config)==null?void 0:C.app)==="konnect"?await l.put(k.value,B.value):await l.patch(k.value,B.value)),p.fields.cert=((A=j==null?void 0:j.data)==null?void 0:A.cert)||"",p.fields.key=((M=j==null?void 0:j.data)==null?void 0:M.key)||"",p.fields.certAlt=((_=j==null?void 0:j.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((N=j==null?void 0:j.data)==null?void 0:N.key_alt)||"",p.fields.tags=((q=(re=j==null?void 0:j.data)==null?void 0:re.tags)==null?void 0:q.join(", "))||"",Object.assign(I,p.fields),r("update",j==null?void 0:j.data)}catch(j){p.errorMessage=c(j),r("error",j)}finally{p.isReadonly=!1}};return(C,A)=>{const M=o.resolveComponent("KTextArea"),_=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",q1,[o.createVNode(o.unref(Ff),{"can-submit":w.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":B.value,"is-readonly":p.isReadonly,onCancel:g,"onFetch:error":A[5]||(A[5]=N=>C.$emit("error",N)),"onFetch:success":h,onLoading:A[6]||(A[6]=N=>C.$emit("loading",N)),onSubmit:E},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{description:o.unref(a)("certificates.form.sections.ssl.description"),title:o.unref(a)("certificates.form.sections.ssl.title")},{default:o.withCtx(()=>[o.createVNode(M,{modelValue:p.fields.cert,"onUpdate:modelValue":A[0]||(A[0]=N=>p.fields.cert=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert",label:o.unref(a)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.key,"onUpdate:modelValue":A[1]||(A[1]=N=>p.fields.key=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key",label:o.unref(a)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.certAlt,"onUpdate:modelValue":A[2]||(A[2]=N=>p.fields.certAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt",label:o.unref(a)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),o.createVNode(M,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":A[3]||(A[3]=N=>p.fields.keyAlt=N),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"certificate-form-key-alt",label:o.unref(a)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("em",null,o.toDisplayString(o.unref(a)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(bo),{description:o.unref(a)("certificates.form.sections.general.description"),title:o.unref(a)("certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":A[4]||(A[4]=N=>p.fields.tags=N),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:o.unref(a)("certificates.form.fields.tags.help"),label:o.unref(a)("certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(a)("certificates.form.fields.tags.tooltip")},placeholder:o.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-2c3ed6cc"]]),vo="/v2/control-planes/{controlPlaneId}/core-entities",ko="/{workspace}",Ti={list:{konnect:`${vo}/ca_certificates`,kongManager:`${ko}/ca_certificates`},form:{konnect:{create:`${vo}/ca_certificates`,edit:`${vo}/ca_certificates/{id}`,validate:`${vo}/v1/schemas/json/ca-certificate/validate`},kongManager:{create:`${ko}/ca_certificates`,edit:`${ko}/ca_certificates/{id}`,validate:`${ko}/schemas/ca_certificates/validate`}}},z1={class:"kong-ui-ca-certificate-entity-config-card"},G1={key:0},W1=Fr(o.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,n=e,{i18n:{t:s,formatUnixTimeStamp:a}}=bt.useI18n(),{convertKeyToTitle:c}=Yf(),{getPropValue:l}=Zf(),{getCertificateData:d}=bt.useCertificate(),y=o.computed(()=>Ti.form[n.config.app].edit),p=o.ref(),I=o.computed(()=>{if(p.value)return d(p.value)}),w=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaIssuer)||""}),h=o.computed(()=>{var E,S;return(E=I.value)!=null&&E.schemaExpiry?a((S=I.value)==null?void 0:S.schemaExpiry):""}),g=o.computed(()=>{var E;return((E=I.value)==null?void 0:E.schemaKeyUsages)||[]}),b=(E,S)=>{const C=l("rowValue",S);if(E==="expiry")return h.value;if(E==="key_usages")return g.value;if(C)return C[E]},k=E=>{p.value=E,i("fetch:success",E)},B=o.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:ce.Json,order:7},...n.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,S)=>{const C=o.resolveComponent("KCodeBlock"),A=o.resolveComponent("KLabel"),M=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",z1,[o.createVNode(o.unref(Lf),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":B.value,"fetch-url":y.value,"hide-title":e.hideTitle,"onFetch:error":S[0]||(S[0]=_=>E.$emit("fetch:error",_)),"onFetch:success":k,onLoading:S[1]||(S[1]=_=>E.$emit("loading",_))},{cert:o.withCtx(_=>[o.unref(l)("rowValue",_)?(o.openBlock(),o.createBlock(C,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:o.unref(l)("rowValue",_),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):o.createCommentVNode("",!0)]),"metadata-label":o.withCtx(()=>[o.createVNode(A,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(_=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(l)("rowValue",_)).filter(N=>!r.includes(N)),N=>(o.openBlock(),o.createBlock(o.unref(lo),{key:N,"data-testid":`ca-cert-metadata-${N}`,item:{key:N,label:o.unref(c)(N),value:b(N,_),type:N==="key_usages"?o.unref(ce).BadgeTag:o.unref(ce).Text}},null,8,["data-testid","item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(w.value||"–"),1)]),key_usages:o.withCtx(()=>[g.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",G1,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,(_,N)=>(o.openBlock(),o.createBlock(M,{key:`key_usages-badge-tag-${N}`,class:"config-badge","data-testid":`key_usages-badge-tag-${N}`,tooltip:_,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(_),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-935fca40"]]),J1={class:"kong-ui-entities-ca-certificates-list"},Y1={key:0},Z1={key:1},Q1={key:0},X1={key:1},eb={key:1},tb=Fr(o.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:n,formatUnixTimeStamp:s},i18nT:a}=bt.useI18n(),c=Gr.useRouter(),{axiosInstance:l}=wo({headers:(X=i.config)==null?void 0:X.requestHeaders}),d=o.ref(1),y=o.computed(()=>i.config.app!=="kongManager"||!!i.config.disableSorting),I={issuer:{label:n("ca-certificates.list.table_headers.issuer")},expiry:{label:n("ca-certificates.list.table_headers.expiry")},tags:{label:n("ca-certificates.list.table_headers.tags"),sortable:!0}},w=o.computed(()=>{var U,K;let ee=`${i.config.apiBaseUrl}${Ti.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=o.ref(""),g=o.computed(()=>{const ee=i.config.app==="konnect"||i.config.isExactMatch;return ee?{isExactMatch:ee,placeholder:n("ca-certificates.search.placeholder")}:{isExactMatch:ee,schema:i.config.filterSchema}}),{fetcher:b,fetcherState:k}=Jf(i.config,w.value),B=()=>{h.value=""},E=()=>{d.value++},S=o.ref(null),C=(ee,U)=>{const K=ee.id;if(!U(K)){r("copy:error",{entity:ee,field:"id",message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,field:"id",message:n("ca-certificates.copy.success",{val:K})})},A=(ee,U)=>{const K=JSON.stringify(ee);if(!U(K)){r("copy:error",{entity:ee,message:n("ca-certificates.errors.copy")});return}r("copy:success",{entity:ee,message:n("ca-certificates.copy.success_brief")})},M=async ee=>{var K;await((K=i.canRetrieve)==null?void 0:K.call(i,ee))&&c.push(i.config.getViewRoute(ee.id))},_=ee=>({label:n("ca-certificates.actions.view"),to:i.config.getViewRoute(ee)}),N=ee=>({label:n("ca-certificates.actions.edit"),to:i.config.getEditRoute(ee)}),re=o.ref(void 0),q=o.ref(!1),j=o.ref(!1),Z=o.ref(""),ne=Gf(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=bt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},Hr=()=>{q.value=!1},qr=async()=>{var ee,U,K;if((ee=re.value)!=null&&ee.id){j.value=!0;try{await l.delete(ne(re.value.id)),j.value=!1,q.value=!1,d.value++,r("delete:success",re.value)}catch(de){Z.value=((K=(U=de.response)==null?void 0:U.data)==null?void 0:K.message)||de.message||n("ca-certificates.errors.delete"),r("error",de)}finally{j.value=!1}}},ur=o.ref(!0);o.watch(k,ee=>{var U,K,de,Re;if(Array.isArray((U=ee==null?void 0:ee.response)==null?void 0:U.data)&&(ur.value=ee.response.data.length>0),ee.status===Ut.Error){S.value={title:n("ca-certificates.errors.general")},(Re=(de=(K=ee.error)==null?void 0:K.response)==null?void 0:de.data)!=null&&Re.message&&(S.value.message=ee.error.response.data.message),r("error",ee.error);return}Ie.value={},S.value=null});const Vt=o.ref({ctaPath:i.config.createRoute,ctaText:void 0,message:`${n("ca-certificates.list.empty_state.description")}${i.config.additionMessageForEmptyState?` ${i.config.additionMessageForEmptyState}`:""}`,title:n("ca-certificates.title")});return o.onBeforeMount(async()=>{await i.canCreate()&&(Vt.value.title=n("ca-certificates.list.empty_state.title"),Vt.value.ctaText=n("ca-certificates.actions.create"))}),(ee,U)=>{const K=o.resolveComponent("KButton"),de=o.resolveComponent("KBadge"),Re=o.resolveComponent("KTruncate"),Ze=o.resolveComponent("KDropdownItem"),Kr=o.resolveComponent("KClipboardProvider");return o.openBlock(),o.createElementBlock("div",J1,[o.createVNode(o.unref(Hf),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":y.value,"empty-state-options":Vt.value,"enable-entity-actions":"","error-message":S.value,fetcher:o.unref(b),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:h.value,"table-headers":o.unref(I),"use-action-outside":e.useActionOutside,onClearSearchInput:B,"onClick:row":U[2]||(U[2]=te=>M(te)),onSort:E},{"toolbar-filter":o.withCtx(()=>[o.createVNode(o.unref(zf),{modelValue:h.value,"onUpdate:modelValue":U[0]||(U[0]=te=>h.value=te),config:g.value},null,8,["modelValue","config"])]),"toolbar-button":o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:o.withCtx(()=>[o.createVNode(o.unref(Tt),{"auth-function":()=>e.canCreate()},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",size:"large",to:e.config.createRoute},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"]),[[o.vShow,ur.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),issuer:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("b",Y1,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.issuer?te.metadata.issuer:"-"),1)):(o.openBlock(),o.createElementBlock("b",Z1,o.toDisplayString(o.unref(Ce)(te).schemaIssuer||"-"),1))]}),expiry:o.withCtx(({row:te})=>{var Se;return[e.config.app==="konnect"?(o.openBlock(),o.createElementBlock("span",Q1,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?o.unref(s)(te.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",X1,o.toDisplayString(o.unref(Ce)(te).schemaExpiry?o.unref(s)(o.unref(Ce)(te).schemaExpiry):"-"),1))]}),tags:o.withCtx(({row:te})=>{var Se;return[((Se=te==null?void 0:te.tags)==null?void 0:Se.length)>0?(o.openBlock(),o.createBlock(Re,{key:0},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(te==null?void 0:te.tags,Y=>(o.openBlock(),o.createBlock(de,{key:Y,onClick:U[1]||(U[1]=o.withModifiers(()=>{},["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y),1)]),_:2},1024))),128))]),_:2},1024)):(o.openBlock(),o.createElementBlock("span",eb,"-"))]}),actions:o.withCtx(({row:te})=>[o.createVNode(Kr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Ze,{"data-testid":"action-entity-copy-id",onClick:Y=>C(te,Se)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(Kr,null,{default:o.withCtx(({copyToClipboard:Se})=>[o.createVNode(Ze,{"data-testid":"action-entity-copy-json",onClick:Y=>A(te,Se)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canRetrieve(te)},{default:o.withCtx(()=>[o.createVNode(Ze,{"data-testid":"action-entity-view","has-divider":"",item:_(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canEdit(te)},{default:o.withCtx(()=>[o.createVNode(Ze,{"data-testid":"action-entity-edit",item:N(te.id)},null,8,["item"])]),_:2},1032,["auth-function"]),o.createVNode(o.unref(Tt),{"auth-function":()=>e.canDelete(te)},{default:o.withCtx(()=>[o.createVNode(Ze,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Se=>Ee(te)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(n)("ca-certificates.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),o.createVNode(o.unref(qf),{"action-pending":j.value,"entity-type":o.unref($a).CACertificate,error:Z.value,title:o.unref(n)("ca-certificates.delete.title"),visible:q.value,onCancel:Hr,onProceed:qr},{description:o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":o.withCtx(()=>[o.createElementVNode("b",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.boldedText")),1)]),_:1}),o.createElementVNode("p",null,o.toDisplayString(o.unref(n)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),[["__scopeId","data-v-f85adb44"]]),rb={class:"kong-ui-entities-ca-certificates-form"},ib=Fr(o.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,n=Gr.useRouter(),{i18n:{t:s}}=bt.useI18n(),{getMessageFromError:a}=Wf(),{axiosInstance:c}=wo({headers:(E=i.config)==null?void 0:E.requestHeaders}),l=o.computed(()=>Ti.form[i.config.app].edit),d=o.computed(()=>i.certificateId?cr.Edit:cr.Create),y=o.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=o.reactive({cert:"",certDigest:"",tags:""}),I=o.computed(()=>(d.value===cr.Create||JSON.stringify(y.fields)!==JSON.stringify(p))&&!!y.fields.cert),w=S=>{var C;y.fields.cert=(S==null?void 0:S.cert)||"",y.fields.certDigest=(S==null?void 0:S.cert_digest)||"",y.fields.tags=((C=S==null?void 0:S.tags)==null?void 0:C.join(", "))||"",Object.assign(p,y.fields)},h=()=>{n.push(i.config.cancelRoute)},g=o.computed(()=>{var C,A;let S=`${i.config.apiBaseUrl}${Ti.form[i.config.app].validate}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),b=o.computed(()=>{var C,A;let S=`${i.config.apiBaseUrl}${Ti.form[i.config.app][d.value]}`;return i.config.app==="konnect"?S=S.replace(/{controlPlaneId}/gi,((C=i.config)==null?void 0:C.controlPlaneId)||""):i.config.app==="kongManager"&&(S=S.replace(/\/{workspace}/gi,(A=i.config)!=null&&A.workspace?`/${i.config.workspace}`:"")),S=S.replace(/{id}/gi,i.certificateId),S}),k=o.computed(()=>{var S,C;return{cert:y.fields.cert,cert_digest:y.fields.certDigest||null,tags:(C=(S=y.fields.tags.split(","))==null?void 0:S.map(A=>String(A||"").trim()))==null?void 0:C.filter(A=>A!=="")}}),B=async()=>{var S,C,A,M,_;try{y.isReadonly=!0;let N;await c.post(g.value,k.value),d.value==="create"?N=await c.post(b.value,k.value):d.value==="edit"&&(N=((S=i.config)==null?void 0:S.app)==="konnect"?await c.put(b.value,k.value):await c.patch(b.value,k.value)),y.fields.cert=((C=N==null?void 0:N.data)==null?void 0:C.cert)||"",y.fields.certDigest=((A=N==null?void 0:N.data)==null?void 0:A.cert_digest)||"",y.fields.tags=((_=(M=N==null?void 0:N.data)==null?void 0:M.tags)==null?void 0:_.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(S,C)=>{const A=o.resolveComponent("KTextArea"),M=o.resolveComponent("KInput");return o.openBlock(),o.createElementBlock("div",rb,[o.createVNode(o.unref(Ff),{"can-submit":I.value,config:e.config,"edit-id":e.certificateId,"error-message":y.errorMessage,"fetch-url":l.value,"form-fields":k.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=_=>S.$emit("error",_)),"onFetch:success":w,onLoading:C[4]||(C[4]=_=>S.$emit("loading",_)),onSubmit:B},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{description:o.unref(s)("ca-certificates.form.sections.cert.description"),title:o.unref(s)("ca-certificates.form.sections.cert.title")},{default:o.withCtx(()=>[o.createVNode(A,{modelValue:y.fields.cert,"onUpdate:modelValue":C[0]||(C[0]=_=>y.fields.cert=_),modelModifiers:{trim:!0},"character-limit":!1,class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert",label:o.unref(s)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.cert.tooltip")},readonly:y.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),o.createVNode(M,{modelValue:y.fields.certDigest,"onUpdate:modelValue":C[1]||(C[1]=_=>y.fields.certDigest=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:o.unref(s)("ca-certificates.form.fields.cert_digest.label"),readonly:y.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),o.createVNode(o.unref(bo),{description:o.unref(s)("ca-certificates.form.sections.general.description"),title:o.unref(s)("ca-certificates.form.sections.general.title")},{default:o.withCtx(()=>[o.createVNode(M,{modelValue:y.fields.tags,"onUpdate:modelValue":C[2]||(C[2]=_=>y.fields.tags=_),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:o.unref(s)("ca-certificates.form.fields.tags.help"),label:o.unref(s)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:o.unref(s)("ca-certificates.form.fields.tags.tooltip")},placeholder:o.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-6316d5b5"]]),nb={class:"kong-ui-certificate-entity-config-card"},ob={key:0},sb=Fr(o.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:n,formatUnixTimeStamp:s},i18nT:a}=bt.useI18n(),{convertKeyToTitle:c}=Yf(),{getPropValue:l}=Zf(),{getCertificateData:d}=bt.useCertificate(),y=o.computed(()=>Bi.form[i.config.app].edit),p=o.ref(),I=o.ref({id:{},cert:{section:fe.Basic},key:{section:fe.Basic,type:ce.Redacted},metadata:{section:fe.Basic,type:ce.Json},snis:{section:fe.Basic,type:ce.BadgeTag,label:n("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:n("certificates.form.fields.tags.tooltip")},...i.config.app==="kongManager"&&{expiry:{section:fe.Basic,label:n("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:fe.Basic,label:n("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:fe.Basic,label:n("certificates.list.table_headers.san"),forceShow:!0},subject:{section:fe.Basic,label:n("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:fe.Advanced},key_alt:{section:fe.Advanced,type:ce.Redacted}}),w=_=>{p.value=_,r("fetch:success",_)},h=(_,N)=>{const re=l("rowValue",N);if(_==="expiry")return b.value;if(_==="key_usages")return S.value;if(_==="san_names")return B.value;if(re)return re[_]},g=o.computed(()=>{if(p.value)return d(p.value)}),b=o.computed(()=>{var _,N;return(_=g.value)!=null&&_.schemaExpiry?s((N=g.value)==null?void 0:N.schemaExpiry):""}),k=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaIssuer)||""}),B=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSanNames)||""}),E=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaSubject)||""}),S=o.computed(()=>{var _;return((_=g.value)==null?void 0:_.schemaKeyUsages)||[]}),C=o.computed(()=>{var _,N;return((N=(_=p==null?void 0:p.value)==null?void 0:_.snis)==null?void 0:N.length)>0}),A=o.computed(()=>{var _;return!!((_=p==null?void 0:p.value)!=null&&_.cert_alt)}),M=_=>{var N,re;return _==="san_names"?n("certificates.list.table_headers.san"):((re=(N=I.value)==null?void 0:N[_])==null?void 0:re.label)||c(_)};return(_,N)=>{const re=o.resolveComponent("KCodeBlock"),q=o.resolveComponent("KLabel"),j=o.resolveComponent("KBadge");return o.openBlock(),o.createElementBlock("div",nb,[o.createVNode(o.unref(Lf),{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]=Z=>_.$emit("fetch:error",Z)),"onFetch:success":w,onLoading:N[1]||(N[1]=Z=>_.$emit("loading",Z))},o.createSlots({"cert-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:o.withCtx(Z=>[o.unref(l)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:o.unref(l)("rowValue",Z),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):o.createCommentVNode("",!0)]),"key-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":o.withCtx(()=>[o.createVNode(q,{class:"metadata-label"},{default:o.withCtx(()=>[o.createTextVNode(" Metadata ")]),_:1})]),metadata:o.withCtx(Z=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(o.unref(l)("rowValue",Z)),ne=>(o.openBlock(),o.createBlock(o.unref(lo),{key:ne,item:{key:ne,value:h(ne,Z),label:M(ne),type:ne==="key_usages"||ne==="snis"||ne==="dns_names"?o.unref(ce).BadgeTag:o.unref(ce).Text}},null,8,["item"]))),128))]),expiry:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(b.value||"–"),1)]),issuer:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value||"–"),1)]),san_names:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(B.value||"–"),1)]),subject:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(E.value||"–"),1)]),"cert_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":o.withCtx(()=>[o.createVNode(o.unref(a),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:o.withCtx(()=>[o.createElementVNode("i",null,o.toDisplayString(o.unref(n)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:o.withCtx(()=>[S.value.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",ob,o.toDisplayString("–"))),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(S.value,(Z,ne)=>(o.openBlock(),o.createBlock(j,{key:`key_usages-badge-tag-${ne}`,class:"config-badge","data-testid":`key_usages-badge-tag-${ne}`,tooltip:Z,"truncation-tooltip":""},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Z),1)]),_:2},1032,["data-testid","tooltip"]))),128))]),_:2},[C.value?void 0:{name:"snis",fn:o.withCtx(()=>[o.createTextVNode(" – ")]),key:"0"},A.value?{name:"cert_alt",fn:o.withCtx(Z=>[o.createTextVNode(" > "),o.unref(l)("rowValue",Z)?(o.openBlock(),o.createBlock(re,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:o.unref(l)("rowValue",Z),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):o.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),[["__scopeId","data-v-993d1527"]]);Ve.CACertificateConfigCard=W1,Ve.CACertificateForm=ib,Ve.CACertificateList=tb,Ve.CertificateConfigCard=sb,Ve.CertificateForm=K1,Ve.CertificateList=H1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
|