@kong-ui-public/entities-certificates 2.5.0 → 2.5.1

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.
@@ -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 mo=="object"?mo: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(w,x){return i.call(w,x)}:function(w,x){return x in w},get:d?function(w,x){return i.call(w,x)?w[x]:void 0}:function(w,x){return w[x]}},p=Object.getPrototypeOf(Function),I=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:sb(),k=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:ab(),h=typeof WeakMap=="function"?WeakMap:cb(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,b=ib(),v=nb(b);function B(w,x,O,D){if(X(O)){if(!Se(w))throw new TypeError;if(!xe(x))throw new TypeError;return j(w,x)}else{if(!Se(w))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(w,x,O,D)}}t("decorate",B);function E(w,x){function O(D,Q){if(!K(D))throw new TypeError;if(!X(Q)&&!zr(Q))throw new TypeError;Fr(w,x,D,Q)}return O}t("metadata",E);function S(w,x,O,D){if(!K(O))throw new TypeError;return X(D)||(D=te(D)),Fr(w,x,O,D)}t("defineMetadata",S);function C(w,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),ne(w,x,O)}t("hasMetadata",C);function A(w,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ie(w,x,O)}t("hasOwnMetadata",A);function M(w,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ce(w,x,O)}t("getMetadata",M);function _(w,x,O){if(!K(x))throw new TypeError;return X(O)||(O=te(O)),Ee(w,x,O)}t("getOwnMetadata",_);function N(w,x){if(!K(w))throw new TypeError;return X(x)||(x=te(x)),qr(w,x)}t("getMetadataKeys",N);function re(w,x){if(!K(w))throw new TypeError;return X(x)||(x=te(x)),ur(w,x)}t("getOwnMetadataKeys",re);function q(w,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(w,x,O)}t("deleteMetadata",q);function j(w,x){for(var O=w.length-1;O>=0;--O){var D=w[O],Q=D(x);if(!X(Q)&&!ee(Q)){if(!xe(Q))throw new TypeError;x=Q}}return x}function Z(w,x,O,D){for(var Q=w.length-1;Q>=0;--Q){var ge=w[Q],Ae=ge(x,O,D);if(!X(Ae)&&!ee(Ae)){if(!K(Ae))throw new TypeError;D=Ae}}return D}function ne(w,x,O){var D=Ie(w,x,O);if(D)return!0;var Q=Za(x);return ee(Q)?!1:ne(w,Q,O)}function Ie(w,x,O){var D=Vi(x,O,!1);return X(D)?!1:Ze(D.OrdinaryHasOwnMetadata(w,x,O))}function Ce(w,x,O){var D=Ie(w,x,O);if(D)return Ee(w,x,O);var Q=Za(x);if(!ee(Q))return Ce(w,Q,O)}function Ee(w,x,O){var D=Vi(x,O,!1);if(!X(D))return D.OrdinaryGetOwnMetadata(w,x,O)}function Fr(w,x,O,D){var Q=Vi(O,D,!0);Q.OrdinaryDefineOwnMetadata(w,x,O,D)}function qr(w,x){var O=ur(w,x),D=Za(w);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 k,Ae=[],oe=0,P=O;oe<P.length;oe++){var z=P[oe],H=ge.has(z);H||(ge.add(z),Ae.push(z))}for(var W=0,se=Q;W<se.length;W++){var z=se[W],H=ge.has(z);H||(ge.add(z),Ae.push(z))}return Ae}function ur(w,x){var O=Vi(w,x,!1);return O?O.OrdinaryOwnMetadataKeys(w,x):[]}function Vt(w){if(w===null)return 1;switch(typeof w){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return w===null?1:6;default:return 6}}function X(w){return w===void 0}function ee(w){return w===null}function U(w){return typeof w=="symbol"}function K(w){return typeof w=="object"?w!==null:typeof w=="function"}function de(w,x){switch(Vt(w)){case 0:return w;case 1:return w;case 2:return w;case 3:return w;case 4:return w;case 5:return w}var O=x===3?"string":x===5?"number":"default",D=Wf(w,s);if(D!==void 0){var Q=D.call(w,O);if(K(Q))throw new TypeError;return Q}return Re(w,O==="default"?"number":O)}function Re(w,x){if(x==="string"){var O=w.toString;if(Y(O)){var D=O.call(w);if(!K(D))return D}var Q=w.valueOf;if(Y(Q)){var D=Q.call(w);if(!K(D))return D}}else{var Q=w.valueOf;if(Y(Q)){var D=Q.call(w);if(!K(D))return D}var ge=w.toString;if(Y(ge)){var D=ge.call(w);if(!K(D))return D}}throw new TypeError}function Ze(w){return!!w}function Kr(w){return""+w}function te(w){var x=de(w,3);return U(x)?x:Kr(x)}function Se(w){return Array.isArray?Array.isArray(w):w instanceof Object?w instanceof Array:Object.prototype.toString.call(w)==="[object Array]"}function Y(w){return typeof w=="function"}function xe(w){return typeof w=="function"}function zr(w){switch(Vt(w)){case 3:return!0;case 4:return!0;default:return!1}}function Ya(w,x){return w===x||w!==w&&x!==x}function Wf(w,x){var O=w[x];if(O!=null){if(!Y(O))throw new TypeError;return O}}function Jf(w){var x=Wf(w,a);if(!Y(x))throw new TypeError;var O=x.call(w);if(!K(O))throw new TypeError;return O}function Yf(w){return w.value}function Zf(w){var x=w.next();return x.done?!1:x}function Qf(w){var x=w.return;x&&x.call(w)}function Za(w){var x=Object.getPrototypeOf(w);if(typeof w!="function"||w===p||x!==p)return x;var O=w.prototype,D=O&&Object.getPrototypeOf(O);if(D==null||D===Object.prototype)return x;var Q=D.constructor;return typeof Q!="function"||Q===w?x:Q}function rb(){var w;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(w=ob(r.Reflect));var x,O,D,Q=new h,ge={registerProvider:Ae,getProvider:P,setProvider:H};return ge;function Ae(W){if(!Object.isExtensible(ge))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case w===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 k),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(w)&&w.isProviderFor(W,se))return w}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 H(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 ib(){var w;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(w=r.Reflect[g]),X(w)&&(w=rb()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:w}),w}function nb(w){var x=new h,O={isProviderFor:function(z,H){var W=x.get(z);return X(W)?!1:W.has(H)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:P};return b.registerProvider(O),O;function D(z,H,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(H);if(X(me)){if(!W)return;if(me=new I,se.set(H,me),!w.setProvider(z,H,O))throw se.delete(H),pe&&x.delete(z),new Error("Wrong provider for target.")}return me}function Q(z,H,W){var se=D(H,W,!1);return X(se)?!1:Ze(se.has(z))}function ge(z,H,W){var se=D(H,W,!1);if(!X(se))return se.get(z)}function Ae(z,H,W,se){var pe=D(W,se,!0);pe.set(z,H)}function oe(z,H){var W=[],se=D(z,H,!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 lb=Yf(Xf);try{W[lt]=lb}catch(ub){try{Qf(me)}finally{throw ub}}lt++}}function P(z,H,W){var se=D(H,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=x.get(H);X(pe)||(pe.delete(W),pe.size===0&&x.delete(pe))}return!0}}function ob(w){var x=w.defineMetadata,O=w.hasOwnMetadata,D=w.getOwnMetadata,Q=w.getOwnMetadataKeys,ge=w.deleteMetadata,Ae=new h,oe={isProviderFor:function(P,z){var H=Ae.get(P);return X(H)?Q(P,z).length?(X(H)&&(H=new k,Ae.set(P,H)),H.add(z),!0):!1:H.has(z)},OrdinaryDefineOwnMetadata:x,OrdinaryHasOwnMetadata:O,OrdinaryGetOwnMetadata:D,OrdinaryOwnMetadataKeys:Q,OrdinaryDeleteMetadata:ge};return oe}function Vi(w,x,O){var D=b.getProvider(w,x);if(!X(D))return D;if(O){if(b.setProvider(w,x,v))return v;throw new Error("Illegal state.")}}function sb(){var w={},x=[],O=function(){function oe(P,z,H){this._index=0,this._keys=P,this._values=z,this._selector=H}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=w,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 H=this._find(P,!0);return this._values[H]=z,this},oe.prototype.delete=function(P){var z=this._find(P,!1);if(z>=0){for(var H=this._keys.length,W=z+1;W<H;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=w,this._cacheIndex=-2),!0}return!1},oe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=w,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 H=0;H<this._keys.length;H++)if(Ya(this._keys[H],P)){this._cacheIndex=H;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 ab(){var w=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 w}function cb(){var w=16,x=y.create(),O=D();return function(){function P(){this._key=D()}return P.prototype.has=function(z){var H=Q(z,!1);return H!==void 0?y.has(H,this._key):!1},P.prototype.get=function(z){var H=Q(z,!1);return H!==void 0?y.get(H,this._key):void 0},P.prototype.set=function(z,H){var W=Q(z,!0);return W[this._key]=H,this},P.prototype.delete=function(z){var H=Q(z,!1);return H!==void 0?delete H[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 H=0;H<z;++H)P[H]=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(w);P[6]=P[6]&79|64,P[8]=P[8]&191|128;for(var z="",H=0;H<w;++H){var W=P[H];(H===4||H===6||H===8)&&(z+="-"),W<16&&(z+="0"),z+=W.toString(16).toLowerCase()}return z}}function Qa(w){return w.__=void 0,delete w.__,w}})})(ec||(ec={}));/*!
14
+ ***************************************************************************** */var ec;(function(e){(function(t){var r=typeof globalThis=="object"?globalThis:typeof mo=="object"?mo: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:sb(),w=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:ab(),h=typeof WeakMap=="function"?WeakMap:cb(),g=n?Symbol.for("@reflect-metadata:registry"):void 0,b=ib(),k=nb(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;Fr(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)),Fr(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 Fr(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],H=ge.has(z);H||(ge.add(z),Ae.push(z))}for(var W=0,se=Q;W<se.length;W++){var z=se[W],H=ge.has(z);H||(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 rb(){var v;!X(g)&&typeof r.Reflect<"u"&&!(g in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(v=ob(r.Reflect));var x,O,D,Q=new h,ge={registerProvider:Ae,getProvider:P,setProvider:H};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 H(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 ib(){var v;return!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&(v=r.Reflect[g]),X(v)&&(v=rb()),!X(g)&&K(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,g,{enumerable:!1,configurable:!1,writable:!1,value:v}),v}function nb(v){var x=new h,O={isProviderFor:function(z,H){var W=x.get(z);return X(W)?!1:W.has(H)},OrdinaryDefineOwnMetadata:Ae,OrdinaryHasOwnMetadata:Q,OrdinaryGetOwnMetadata:ge,OrdinaryOwnMetadataKeys:oe,OrdinaryDeleteMetadata:P};return b.registerProvider(O),O;function D(z,H,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(H);if(X(me)){if(!W)return;if(me=new I,se.set(H,me),!v.setProvider(z,H,O))throw se.delete(H),pe&&x.delete(z),new Error("Wrong provider for target.")}return me}function Q(z,H,W){var se=D(H,W,!1);return X(se)?!1:Ze(se.has(z))}function ge(z,H,W){var se=D(H,W,!1);if(!X(se))return se.get(z)}function Ae(z,H,W,se){var pe=D(W,se,!0);pe.set(z,H)}function oe(z,H){var W=[],se=D(z,H,!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 lb=Yf(Xf);try{W[lt]=lb}catch(ub){try{Qf(me)}finally{throw ub}}lt++}}function P(z,H,W){var se=D(H,W,!1);if(X(se)||!se.delete(z))return!1;if(se.size===0){var pe=x.get(H);X(pe)||(pe.delete(W),pe.size===0&&x.delete(pe))}return!0}}function ob(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 H=Ae.get(P);return X(H)?Q(P,z).length?(X(H)&&(H=new w,Ae.set(P,H)),H.add(z),!0):!1:H.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 sb(){var v={},x=[],O=function(){function oe(P,z,H){this._index=0,this._keys=P,this._values=z,this._selector=H}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 H=this._find(P,!0);return this._values[H]=z,this},oe.prototype.delete=function(P){var z=this._find(P,!1);if(z>=0){for(var H=this._keys.length,W=z+1;W<H;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 H=0;H<this._keys.length;H++)if(Ya(this._keys[H],P)){this._cacheIndex=H;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 ab(){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 cb(){var v=16,x=y.create(),O=D();return function(){function P(){this._key=D()}return P.prototype.has=function(z){var H=Q(z,!1);return H!==void 0?y.has(H,this._key):!1},P.prototype.get=function(z){var H=Q(z,!1);return H!==void 0?y.get(H,this._key):void 0},P.prototype.set=function(z,H){var W=Q(z,!0);return W[this._key]=H,this},P.prototype.delete=function(z){var H=Q(z,!1);return H!==void 0?delete H[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 H=0;H<z;++H)P[H]=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="",H=0;H<v;++H){var W=P[H];(H===4||H===6||H===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={}));/*!
15
15
  * MIT License
16
16
  *
17
17
  * Copyright (c) 2017-2022 Peculiar Ventures, LLC
@@ -68,11 +68,11 @@
68
68
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
69
69
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70
70
  *
71
- */function Di(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function vo(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 vo(this.items)}}const Wr=[new Uint8Array([1])],nc="0123456789",ko="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 k=0;k<d.length;k++)I[k]=d[k];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 Co 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}'`}}Co.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 vo(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 vo(this.items)}}const Wr=[new Uint8Array([1])],nc="0123456789",ko="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 Co 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}'`}}Co.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(`
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 So extends Ne{constructor(t={}){super(t,hc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}yc=So,R.EndOfContent=yc,So.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=wo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=wo(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=wo(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 xo 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=xo,xo.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,xo),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 Ao 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}}}Ao.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 Ao;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 vo(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 Ao;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 Bo 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}}}Bo.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 Bo;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 vo(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 Bo;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 Io 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=Io,R.RelativeObjectIdentifier=Oc,Io.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 Co{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 Hi extends Rc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Uc=Hi,R.UniversalString=Uc,Hi.NAME="UniversalString";var Lc;class Fi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Lc=Fi,R.NumericString=Lc,Fi.NAME="NumericString";var Hc;class qi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Hc=qi,R.PrintableString=Hc,qi.NAME="PrintableString";var Fc;class Ki extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Fc=Ki,R.TeletexString=Fc,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("+"),k="";if(I===-1&&(I=i.indexOf("-"),p=-1),I!==-1){if(k=i.substring(I+1),i=i.substring(0,I),k.length!==2&&k.length!==4)throw new Error("Wrong input string for conversion");let h=parseInt(k.substring(0,2),10);if(isNaN(h.valueOf()))throw new Error("Wrong input string for conversion");if(c=p*h,k.length===4){if(h=parseInt(k.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 Eo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Qc=Eo,R.DATE=Qc,Eo.NAME="DATE";var Xc;class No extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Xc=No,R.TimeOfDay=Xc,No.NAME="TimeOfDay";var el;class Oo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}el=Oo,R.DateTime=el,Oo.NAME="DateTime";var tl;class _o extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}tl=_o,R.Duration=tl,_o.NAME="Duration";var rl;class To extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}rl=To,R.TIME=rl,To.NAME="TIME";class Jt{constructor({name:t=Ue,optional:r=!1}={}){this.name=t,this.optional=r}}class Vo 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 Vo){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(ko)&&(s.name=r.name),s}}if(r instanceof Jt)return r.hasOwnProperty(ko)&&(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(ko 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:Co,BitString:Wt,BmpString:Li,Boolean:$i,CharacterString:Yi,Choice:Vo,Constructed:Le,DATE:Eo,DateTime:Oo,Duration:_o,EndOfContent:So,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:dt,IA5String:Gi,Integer:ft,Null:zt,NumericString:Fi,ObjectIdentifier:Ui,OctetString:Gt,Primitive:Yr,PrintableString:qi,RawData:Cp,RelativeObjectIdentifier:Io,Repeated:Qi,Sequence:kt,Set:Ct,TIME:To,TeletexString:Ki,TimeOfDay:No,UTCTime:Qr,UniversalString:Hi,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(Hi),Vp=Qe(Fi),jp=Qe(qi),Dp=Qe(Ki),Mp=Qe(zi),Pp=Qe(Gi),$p=Qe(Wi),Rp=Qe(Zr),Up=Qe(Ji),Lp=Qe(Yi),Hp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Fp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},qp={fromASN:()=>null,toASN:()=>new zt};function jo(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 Fp;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 Hp;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 Vo({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=jo(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=jo(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 k=y.repeated==="sequence"?kt:Ct,h=new k;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,v=>I.fromASN(v))}else c[l]=Array.from(d,k=>I.fromASN(k));else{let k=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=k.valueBlock,k=pr(h.toBER(!1)).result}c[l]=I.fromASN(k)}}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 Do{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=jo(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=Do.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 Do.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,v=-1,B=(h.match(l.zoneIndex)||[])[0],E,S;for(B&&(B=B.substring(1),h=h.replace(/%.+$/,""));(v=h.indexOf(":",v+1))>=0;)b++;if(h.substr(0,2)==="::"&&b--,h.substr(-2,2)==="::"&&b--,b>g)return null;for(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,v){if(h.length!==g.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let B=0,E;for(;v>0;){if(E=b-v,E<0&&(E=0),h[B]>>E!==g[B]>>E)return!1;v-=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 k={};k.IPv4=function(){function h(g){if(g.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,v;for(b=0;b<g.length;b++)if(v=g[b],!(0<=v&&v<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=g}return h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(g,b){let v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,g.octets,8,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let B,E,S;for(B=3;B>=0;B-=1)if(E=this.octets[B],E in v){if(S=v[E],b&&S!==0)return null;S!==8&&(b=!0),g+=S}else return null;return 32-g},h.prototype.range=function(){return k.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return k.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h}(),k.IPv4.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<4;)B.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},k.IPv4.isIPv4=function(h){return this.parser(h)!==null},k.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},k.IPv4.isValidFourPartDecimal=function(h){return!!(k.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},k.IPv4.networkAddressFromCIDR=function(h){let g,b,v,B,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<4;)B.push(parseInt(v[b],10)&parseInt(E[b],10)),b++;return new this(B)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},k.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)},k.IPv4.parseCIDR=function(h){let g;if(g=h.match(/^(.+)\/(\d+)$/)){const b=parseInt(g[2]);if(b>=0&&b<=32){const v=[this.parse(g[1]),b];return Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},k.IPv4.parser=function(h){let g,b,v;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(v=p(g[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){const B=[];let E;for(E=0;E<=24;E+=8)B.push(v>>E&255);return B}().reverse()}else return(g=h.match(i.twoOctet))?function(){const B=g.slice(1,4),E=[];if(v=p(B[1]),v>16777215||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(v>>16&255),E.push(v>>8&255),E.push(v&255),E}():(g=h.match(i.threeOctet))?function(){const B=g.slice(1,5),E=[];if(v=p(B[2]),v>65535||v<0)throw new Error("ipaddr: address outside defined range");return E.push(p(B[0])),E.push(p(B[1])),E.push(v>>8&255),E.push(v&255),E}():null},k.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");const g=[0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<4&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},k.IPv6=function(){function h(g,b){let v,B;if(g.length===16)for(this.parts=[],v=0;v<=14;v+=2)this.parts.push(g[v]<<8|g[v+1]);else if(g.length===8)this.parts=g;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(v=0;v<this.parts.length;v++)if(B=this.parts[v],!(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 v;if(b===void 0&&(v=g,g=v[0],b=v[1]),g.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,g.parts,16,b)},h.prototype.prefixLengthFromSubnetMask=function(){let g=0,b=!1;const v={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let B,E;for(let S=7;S>=0;S-=1)if(B=this.parts[S],B in v){if(E=v[B],b&&E!==0)return null;E!==16&&(b=!0),g+=E}else return null;return 128-g},h.prototype.range=function(){return k.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let g;const b=[],v=this.parts;for(let B=0;B<v.length;B++)g=v[B],b.push(g>>8),b.push(g&255);return b},h.prototype.toFixedLengthString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(I(this.parts[B].toString(16),4));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const g=this.parts.slice(-2),b=g[0],v=g[1];return new k.IPv4([b>>8,b&255,v>>8,v&255])},h.prototype.toNormalizedString=function(){const g=(function(){const v=[];for(let B=0;B<this.parts.length;B++)v.push(this.parts[B].toString(16));return v}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),g+b},h.prototype.toRFC5952String=function(){const g=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let v=0,B=-1,E;for(;E=g.exec(b);)E[0].length>B&&(v=E.index,B=E[0].length);return B<0?b:`${b.substring(0,v)}::${b.substring(v+B)}`},h.prototype.toString=function(){return this.toRFC5952String()},h}(),k.IPv6.broadcastAddressFromCIDR=function(h){try{const g=this.parseCIDR(h),b=g[0].toByteArray(),v=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[];let E=0;for(;E<16;)B.push(parseInt(b[E],10)|parseInt(v[E],10)^255),E++;return new this(B)}catch(g){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${g})`)}},k.IPv6.isIPv6=function(h){return this.parser(h)!==null},k.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}},k.IPv6.networkAddressFromCIDR=function(h){let g,b,v,B,E;try{for(g=this.parseCIDR(h),v=g[0].toByteArray(),E=this.subnetMaskFromPrefixLength(g[1]).toByteArray(),B=[],b=0;b<16;)B.push(parseInt(v[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})`)}},k.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)},k.IPv6.parseCIDR=function(h){let g,b,v;if((b=h.match(/^(.+)\/(\d+)$/))&&(g=parseInt(b[2]),g>=0&&g<=128))return v=[this.parse(b[1]),g],Object.defineProperty(v,"toString",{value:function(){return this.join("/")}}),v;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},k.IPv6.parser=function(h){let g,b,v,B,E,S;if(v=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${v[1]}`);if(l.native.test(h))return d(h,8);if((v=h.match(l.transitional))&&(S=v[6]||"",g=d(v[1].slice(0,-1)+S,6),g.parts)){for(E=[parseInt(v[2]),parseInt(v[3]),parseInt(v[4]),parseInt(v[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},k.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");const g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const v=Math.floor(h/8);for(;b<v;)g[b]=255,b++;return v<16&&(g[v]=Math.pow(2,h%8)-1<<8-h%8),new this(g)},k.fromByteArray=function(h){const g=h.length;if(g===4)return new k.IPv4(h);if(g===16)return new k.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},k.isValid=function(h){return k.IPv6.isValid(h)||k.IPv4.isValid(h)},k.parse=function(h){if(k.IPv6.isValid(h))return k.IPv6.parse(h);if(k.IPv4.isValid(h))return k.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},k.parseCIDR=function(h){try{return k.IPv6.parseCIDR(h)}catch{try{return k.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},k.process=function(h){const g=this.parse(h);return g.kind()==="ipv6"&&g.isIPv4MappedAddress()?g.toIPv4Address():g},k.subnetMatch=function(h,g,b){let v,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]),v=0;v<E.length;v++)if(S=E[v],h.kind()===S[0].kind()&&h.match.apply(h,S))return B}return b},e.exports?e.exports=k:t.ipaddr=k})(mo)})(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 Mo,Po,$o;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=Mo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};yr=Mo=u([V({type:T.Set,itemType:Xr})],yr);let Ro=Po=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};Ro=Po=u([V({type:T.Sequence,itemType:yr})],Ro);let we=$o=class extends Ro{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};we=$o=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 Uo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Uo.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Uo.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:Uo,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 Lo;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=Lo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Lo.prototype)}};ul=Lo=u([V({type:T.Sequence,itemType:tn})],ul);const Ho=`${Zt}.35`;class Fo extends ae{}class Qt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Fo,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 qo;let Pe=qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};Pe=qo=u([V({type:T.Sequence,itemType:ie})],Pe);var Ko;let fl=Ko=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};fl=Ko=u([V({type:T.Sequence})],fl);var zo;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 Go{constructor(t={}){this.organization=new At,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:At})],Go.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],Go.prototype,"noticeNumbers",void 0);class Wo{constructor(t={}){Object.assign(this,t)}}u([f({type:Go,optional:!0})],Wo.prototype,"noticeRef",void 0),u([f({type:At,optional:!0})],Wo.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:Wo})],nn.prototype,"userNotice",void 0),nn=u([V({type:T.Choice})],nn);class Jo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Jo.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],Jo.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:Jo,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 hl=class extends an{};hl=u([V({type:T.Choice})],hl);var Yo,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 Zo=Yo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};Zo=Yo=u([V({type:T.Sequence,itemType:ti})],Zo);var Qo;let gl=Qo=class extends Zo{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};gl=Qo=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 Xo=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})],Xo.prototype,"reason",void 0),Xo=u([V({type:T.Choice})],Xo);var es;const ml=`${Zt}.37`;let cn=es=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,es.prototype)}};cn=es=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 ts=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],ts.prototype,"value",void 0),ts=u([V({type:T.Choice})],ts);let rs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],rs.prototype,"value",void 0),rs=u([V({type:T.Choice})],rs);var is;let bl=is=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};bl=is=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 ns 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 os;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=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};un=os=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 ss;class as{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],as.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],as.prototype,"subjectDomainPolicy",void 0);let Cl=ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};Cl=ss=u([V({type:T.Sequence,itemType:as})],Cl);var cs;const Sl=`${Zt}.17`;let ls=cs=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};ls=cs=u([V({type:T.Sequence})],ls);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 us;let xl=us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};xl=us=u([V({type:T.Sequence,itemType:Bt})],xl);const Al=`${Zt}.14`;class Dt extends Fo{}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 ds;let Nl=ds=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ds.prototype)}};Nl=ds=u([V({type:T.Sequence,itemType:tn})],Nl);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&rc(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],F.prototype,"parameters",void 0);class It{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],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 fs;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=fs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};Xt=fs=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 F,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:F})],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 F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:F})],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 F,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:F})],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 ps=class{constructor(t={}){this.tbsCertList=new Et,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Et})],ps.prototype,"tbsCertList",void 0),u([f({type:F})],ps.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ps.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 F{};ni=u([V({type:T.Sequence})],ni);let pn=class extends F{};pn=u([V({type:T.Sequence})],pn);let pt=class extends F{};pt=u([V({type:T.Sequence})],pt);let hn=class extends F{};hn=u([V({type:T.Sequence})],hn);let Ol=class extends F{};Ol=u([V({type:T.Sequence})],Ol);let hs=class extends F{};hs=u([V({type:T.Sequence})],hs);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 ys;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=ys=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};yn=ys=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 gs{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],gs.prototype,"acIssuer",void 0),u([f({type:m.Integer})],gs.prototype,"acSerial",void 0),u([f({type:Bt,repeated:"sequence"})],gs.prototype,"attrs",void 0);var ms;let gn=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};gn=ms=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 bs;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(bs||(bs={}));class tr{constructor(t={}){this.digestedObjectType=bs.publicKey,this.digestAlgorithm=new F,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:F})],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 ws;(function(e){e[e.v2=1]="v2"})(ws||(ws={}));class at{constructor(t={}){this.version=ws.v2,this.holder=new oi,this.issuer=new Sr,this.signature=new F,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:F})],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 F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:at})],vn.prototype,"acinfo",void 0),u([f({type:F})],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 vs extends Xi{}class ks{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],ks.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],ks.prototype,"value",void 0);class Cs{constructor(t={}){this.policyId="",this.classList=new vs(kn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Cs.prototype,"policyId",void 0),u([f({type:vs,defaultValue:new vs(kn.unclassified)})],Cs.prototype,"classList",void 0),u([f({type:ks,repeated:"set"})],Cs.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 Ss;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 xs=Ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};xs=Ss=u([V({type:T.Sequence,itemType:xr})],xs);var As;let jl=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};jl=As=u([V({type:T.Sequence,itemType:xs})],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 Bs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Bs.prototype,"service",void 0),u([f({type:ie})],Bs.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Bs.prototype,"authInfo",void 0);var Is;class Es{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Es.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Es.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:Es,context:3,implicit:!0})],Ar.prototype,"other",void 0),Ar=u([V({type:T.Choice})],Ar);let xn=Is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};xn=Is=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 Ns;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 Os{constructor(t={}){this.rid=new Ir,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Ir})],Os.prototype,"rid",void 0),u([f({type:ae})],Os.prototype,"encryptedKey",void 0);let En=Ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};En=Ns=u([V({type:T.Sequence,itemType:Os})],En);class _s{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],_s.prototype,"algorithm",void 0),u([f({type:m.BitString})],_s.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:_s,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:hs,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 Ts{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ts.prototype,"oriType",void 0),u([f({type:m.Any})],Ts.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:Ts,context:4,implicit:!0,optional:!0})],Mt.prototype,"ori",void 0),Mt=u([V({type:T.Choice})],Mt);var Vs;let Nn=Vs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Nn=Vs=u([V({type:T.Set,itemType:Mt})],Nn);var js;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 Ds=js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Ds=js=u([V({type:T.Set,itemType:pi})],Ds);class Ms{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],Ms.prototype,"certs",void 0),u([f({type:Ds,context:1,implicit:!0,optional:!0})],Ms.prototype,"crls",void 0);var Ps;let $s=Ps=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};$s=Ps=u([V({type:T.Set,itemType:Cr})],$s);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:Ms,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:$s,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const th="1.2.840.113549.1.7.2";var Rs;let _n=Rs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};_n=Rs=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",Us="1.2.840.10045.4.1",Ml="1.2.840.10045.4.3.1",Ls="1.2.840.10045.4.3.2",Hs="1.2.840.10045.4.3.3",Fs="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 F({algorithm:e})}const rh=gi(Us);gi(Ml);const ih=gi(Ls),nh=gi(Hs),oh=gi(Fs);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 He="1.2.840.113549.1.1",Tr=`${He}.1`,sh=`${He}.7`,ah=`${He}.9`,ch=`${He}.10`,lh=`${He}.2`,uh=`${He}.4`,jn=`${He}.5`,dh=`${He}.14`,qs=`${He}.11`,Dn=`${He}.12`,Mn=`${He}.13`,Ul=`${He}.15`,Ll=`${He}.16`,Hl="1.3.14.3.2.26",Fl="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",Ks=`${He}.8`;function ve(e){return new F({algorithm:e,parameters:null})}ve(hh),ve(yh);const ir=ve(Hl);ve(Fl),ve(ql),ve(Kl),ve(zl),ve(fh),ve(ph);const Gl=new F({algorithm:Ks,parameters:G.serialize(ir)}),Wl=new F({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 F(ir),this.maskGenAlgorithm=new F({algorithm:Ks,parameters:G.serialize(ir)}),this.pSourceAlgorithm=new F(Wl),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:ir})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:Gl})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:Wl})],Pn.prototype,"pSourceAlgorithm",void 0),new F({algorithm:sh,parameters:G.serialize(new Pn)});class mi{constructor(t={}){this.hashAlgorithm=new F(ir),this.maskGenAlgorithm=new F({algorithm:Ks,parameters:G.serialize(ir)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:ir})],mi.prototype,"hashAlgorithm",void 0),u([f({type:F,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 F({algorithm:ch,parameters:G.serialize(new mi)});class $n{constructor(t={}){this.digestAlgorithm=new F,this.digest=new ae,Object.assign(this,t)}}u([f({type:F})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ae})],$n.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 Gs=zs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([V({type:T.Sequence,itemType:Rn})],Gs);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:Gs,optional:!0})],yt.prototype,"otherPrimeInfos",void 0);class Ws{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Ws.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],Ws.prototype,"publicExponent",void 0);var Js;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Js||(Js={}));const Fe=Js;/*! *****************************************************************************
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 So extends Ne{constructor(t={}){super(t,hc),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}yc=So,R.EndOfContent=yc,So.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=wo(new Uint8Array([d%10]),s);break;default:s[a-p]=d%10}}return r[0]>0&&(s=wo(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=wo(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 xo 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=xo,xo.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,xo),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 Ao 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}}}Ao.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 Ao;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 vo(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 Ao;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 Bo 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}}}Bo.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 Bo;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 vo(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 Bo;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 Io 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=Io,R.RelativeObjectIdentifier=Oc,Io.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 Co{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 Hi extends Rc{constructor({...t}={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}Uc=Hi,R.UniversalString=Uc,Hi.NAME="UniversalString";var Lc;class Fi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}Lc=Fi,R.NumericString=Lc,Fi.NAME="NumericString";var Hc;class qi extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}Hc=qi,R.PrintableString=Hc,qi.NAME="PrintableString";var Fc;class Ki extends We{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}Fc=Ki,R.TeletexString=Fc,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 Eo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}Qc=Eo,R.DATE=Qc,Eo.NAME="DATE";var Xc;class No extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}Xc=No,R.TimeOfDay=Xc,No.NAME="TimeOfDay";var el;class Oo extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}el=Oo,R.DateTime=el,Oo.NAME="DateTime";var tl;class _o extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}tl=_o,R.Duration=tl,_o.NAME="Duration";var rl;class To extends St{constructor(t={}){super(t),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}rl=To,R.TIME=rl,To.NAME="TIME";class Jt{constructor({name:t=Ue,optional:r=!1}={}){this.name=t,this.optional=r}}class Vo 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 Vo){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(ko)&&(s.name=r.name),s}}if(r instanceof Jt)return r.hasOwnProperty(ko)&&(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(ko 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:Co,BitString:Wt,BmpString:Li,Boolean:$i,CharacterString:Yi,Choice:Vo,Constructed:Le,DATE:Eo,DateTime:Oo,Duration:_o,EndOfContent:So,Enumerated:Ri,GeneralString:Ji,GeneralizedTime:Zi,GraphicString:Wi,HexBlock:dt,IA5String:Gi,Integer:ft,Null:zt,NumericString:Fi,ObjectIdentifier:Ui,OctetString:Gt,Primitive:Yr,PrintableString:qi,RawData:Cp,RelativeObjectIdentifier:Io,Repeated:Qi,Sequence:kt,Set:Ct,TIME:To,TeletexString:Ki,TimeOfDay:No,UTCTime:Qr,UniversalString:Hi,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(Hi),Vp=Qe(Fi),jp=Qe(qi),Dp=Qe(Ki),Mp=Qe(zi),Pp=Qe(Gi),$p=Qe(Wi),Rp=Qe(Zr),Up=Qe(Ji),Lp=Qe(Yi),Hp={fromASN:e=>e.toDate(),toASN:e=>new Qr({valueDate:e})},Fp={fromASN:e=>e.toDate(),toASN:e=>new Zi({valueDate:e})},qp={fromASN:()=>null,toASN:()=>new zt};function jo(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 Fp;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 Hp;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 Vo({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=jo(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=jo(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 Do{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=jo(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=Do.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 Do.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})(mo)})(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 Mo,Po,$o;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=Mo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Mo.prototype)}};yr=Mo=u([V({type:T.Set,itemType:Xr})],yr);let Ro=Po=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Po.prototype)}};Ro=Po=u([V({type:T.Sequence,itemType:yr})],Ro);let we=$o=class extends Ro{constructor(t){super(t),Object.setPrototypeOf(this,$o.prototype)}};we=$o=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 Uo{constructor(t={}){this.partyName=new Oe,Object.assign(this,t)}}u([f({type:Oe,optional:!0,context:0,implicit:!0})],Uo.prototype,"nameAssigner",void 0),u([f({type:Oe,context:1,implicit:!0})],Uo.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:Uo,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 Lo;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=Lo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Lo.prototype)}};ul=Lo=u([V({type:T.Sequence,itemType:tn})],ul);const Ho=`${Zt}.35`;class Fo extends ae{}class Qt{constructor(t={}){t&&Object.assign(this,t)}}u([f({type:Fo,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 qo;let Pe=qo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,qo.prototype)}};Pe=qo=u([V({type:T.Sequence,itemType:ie})],Pe);var Ko;let fl=Ko=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,Ko.prototype)}};fl=Ko=u([V({type:T.Sequence})],fl);var zo;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 Go{constructor(t={}){this.organization=new At,this.noticeNumbers=[],Object.assign(this,t)}}u([f({type:At})],Go.prototype,"organization",void 0),u([f({type:m.Integer,repeated:"sequence"})],Go.prototype,"noticeNumbers",void 0);class Wo{constructor(t={}){Object.assign(this,t)}}u([f({type:Go,optional:!0})],Wo.prototype,"noticeRef",void 0),u([f({type:At,optional:!0})],Wo.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:Wo})],nn.prototype,"userNotice",void 0),nn=u([V({type:T.Choice})],nn);class Jo{constructor(t={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Jo.prototype,"policyQualifierId",void 0),u([f({type:m.Any})],Jo.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:Jo,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 hl=class extends an{};hl=u([V({type:T.Choice})],hl);var Yo,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 Zo=Yo=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Yo.prototype)}};Zo=Yo=u([V({type:T.Sequence,itemType:ti})],Zo);var Qo;let gl=Qo=class extends Zo{constructor(t){super(t),Object.setPrototypeOf(this,Qo.prototype)}};gl=Qo=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 Xo=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})],Xo.prototype,"reason",void 0),Xo=u([V({type:T.Choice})],Xo);var es;const ml=`${Zt}.37`;let cn=es=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,es.prototype)}};cn=es=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 ts=class{constructor(t=new ArrayBuffer(0)){this.value=t}};u([f({type:m.Integer,converter:he})],ts.prototype,"value",void 0),ts=u([V({type:T.Choice})],ts);let rs=class{constructor(t){this.value=new Date,t&&(this.value=t)}};u([f({type:m.GeneralizedTime})],rs.prototype,"value",void 0),rs=u([V({type:T.Choice})],rs);var is;let bl=is=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,is.prototype)}};bl=is=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 ns 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 os;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=os=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};un=os=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 ss;class as{constructor(t={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],as.prototype,"issuerDomainPolicy",void 0),u([f({type:m.ObjectIdentifier})],as.prototype,"subjectDomainPolicy",void 0);let Cl=ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ss.prototype)}};Cl=ss=u([V({type:T.Sequence,itemType:as})],Cl);var cs;const Sl=`${Zt}.17`;let ls=cs=class extends Pe{constructor(t){super(t),Object.setPrototypeOf(this,cs.prototype)}};ls=cs=u([V({type:T.Sequence})],ls);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 us;let xl=us=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,us.prototype)}};xl=us=u([V({type:T.Sequence,itemType:Bt})],xl);const Al=`${Zt}.14`;class Dt extends Fo{}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 ds;let Nl=ds=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ds.prototype)}};Nl=ds=u([V({type:T.Sequence,itemType:tn})],Nl);class F{constructor(t={}){this.algorithm="",Object.assign(this,t)}isEqual(t){return t instanceof F&&t.algorithm==this.algorithm&&(t.parameters&&this.parameters&&rc(t.parameters,this.parameters)||t.parameters===this.parameters)}}u([f({type:m.ObjectIdentifier})],F.prototype,"algorithm",void 0),u([f({type:m.Any,optional:!0})],F.prototype,"parameters",void 0);class It{constructor(t={}){this.algorithm=new F,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],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 fs;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=fs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,fs.prototype)}};Xt=fs=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 F,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:F})],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 F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:et})],wr.prototype,"tbsCertificate",void 0),u([f({type:F})],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 F,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:F})],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 ps=class{constructor(t={}){this.tbsCertList=new Et,this.signatureAlgorithm=new F,this.signature=new ArrayBuffer(0),Object.assign(this,t)}};u([f({type:Et})],ps.prototype,"tbsCertList",void 0),u([f({type:F})],ps.prototype,"signatureAlgorithm",void 0),u([f({type:m.BitString})],ps.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 F{};ni=u([V({type:T.Sequence})],ni);let pn=class extends F{};pn=u([V({type:T.Sequence})],pn);let pt=class extends F{};pt=u([V({type:T.Sequence})],pt);let hn=class extends F{};hn=u([V({type:T.Sequence})],hn);let Ol=class extends F{};Ol=u([V({type:T.Sequence})],Ol);let hs=class extends F{};hs=u([V({type:T.Sequence})],hs);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 ys;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=ys=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ys.prototype)}};yn=ys=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 gs{constructor(t={}){this.acIssuer=new ie,this.acSerial=0,this.attrs=[],Object.assign(this,t)}}u([f({type:ie})],gs.prototype,"acIssuer",void 0),u([f({type:m.Integer})],gs.prototype,"acSerial",void 0),u([f({type:Bt,repeated:"sequence"})],gs.prototype,"attrs",void 0);var ms;let gn=ms=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,ms.prototype)}};gn=ms=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 bs;(function(e){e[e.publicKey=0]="publicKey",e[e.publicKeyCert=1]="publicKeyCert",e[e.otherObjectTypes=2]="otherObjectTypes"})(bs||(bs={}));class tr{constructor(t={}){this.digestedObjectType=bs.publicKey,this.digestAlgorithm=new F,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:F})],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 ws;(function(e){e[e.v2=1]="v2"})(ws||(ws={}));class at{constructor(t={}){this.version=ws.v2,this.holder=new oi,this.issuer=new Sr,this.signature=new F,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:F})],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 F,this.signatureValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:at})],vn.prototype,"acinfo",void 0),u([f({type:F})],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 vs extends Xi{}class ks{constructor(t={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier,implicit:!0,context:0})],ks.prototype,"type",void 0),u([f({type:m.Any,implicit:!0,context:1})],ks.prototype,"value",void 0);class Cs{constructor(t={}){this.policyId="",this.classList=new vs(kn.unclassified),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Cs.prototype,"policyId",void 0),u([f({type:vs,defaultValue:new vs(kn.unclassified)})],Cs.prototype,"classList",void 0),u([f({type:ks,repeated:"set"})],Cs.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 Ss;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 xs=Ss=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ss.prototype)}};xs=Ss=u([V({type:T.Sequence,itemType:xr})],xs);var As;let jl=As=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,As.prototype)}};jl=As=u([V({type:T.Sequence,itemType:xs})],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 Bs{constructor(t={}){this.service=new ie,this.ident=new ie,Object.assign(this,t)}}u([f({type:ie})],Bs.prototype,"service",void 0),u([f({type:ie})],Bs.prototype,"ident",void 0),u([f({type:ae,optional:!0})],Bs.prototype,"authInfo",void 0);var Is;class Es{constructor(t={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Es.prototype,"otherCertFormat",void 0),u([f({type:m.Any})],Es.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:Es,context:3,implicit:!0})],Ar.prototype,"other",void 0),Ar=u([V({type:T.Choice})],Ar);let xn=Is=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Is.prototype)}};xn=Is=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 Ns;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 Os{constructor(t={}){this.rid=new Ir,this.encryptedKey=new ae,Object.assign(this,t)}}u([f({type:Ir})],Os.prototype,"rid",void 0),u([f({type:ae})],Os.prototype,"encryptedKey",void 0);let En=Ns=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ns.prototype)}};En=Ns=u([V({type:T.Sequence,itemType:Os})],En);class _s{constructor(t={}){this.algorithm=new F,this.publicKey=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:F})],_s.prototype,"algorithm",void 0),u([f({type:m.BitString})],_s.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:_s,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:hs,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 Ts{constructor(t={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.ObjectIdentifier})],Ts.prototype,"oriType",void 0),u([f({type:m.Any})],Ts.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:Ts,context:4,implicit:!0,optional:!0})],Mt.prototype,"ori",void 0),Mt=u([V({type:T.Choice})],Mt);var Vs;let Nn=Vs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Vs.prototype)}};Nn=Vs=u([V({type:T.Set,itemType:Mt})],Nn);var js;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 Ds=js=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,js.prototype)}};Ds=js=u([V({type:T.Set,itemType:pi})],Ds);class Ms{constructor(t={}){Object.assign(this,t)}}u([f({type:xn,context:0,implicit:!0,optional:!0})],Ms.prototype,"certs",void 0),u([f({type:Ds,context:1,implicit:!0,optional:!0})],Ms.prototype,"crls",void 0);var Ps;let $s=Ps=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Ps.prototype)}};$s=Ps=u([V({type:T.Set,itemType:Cr})],$s);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:Ms,context:0,implicit:!0,optional:!0})],hi.prototype,"originatorInfo",void 0),u([f({type:Nn})],hi.prototype,"recipientInfos",void 0),u([f({type:ci})],hi.prototype,"encryptedContentInfo",void 0),u([f({type:$s,context:1,implicit:!0,optional:!0})],hi.prototype,"unprotectedAttrs",void 0);const th="1.2.840.113549.1.7.2";var Rs;let _n=Rs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,Rs.prototype)}};_n=Rs=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",Us="1.2.840.10045.4.1",Ml="1.2.840.10045.4.3.1",Ls="1.2.840.10045.4.3.2",Hs="1.2.840.10045.4.3.3",Fs="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 F({algorithm:e})}const rh=gi(Us);gi(Ml);const ih=gi(Ls),nh=gi(Hs),oh=gi(Fs);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 He="1.2.840.113549.1.1",Tr=`${He}.1`,sh=`${He}.7`,ah=`${He}.9`,ch=`${He}.10`,lh=`${He}.2`,uh=`${He}.4`,jn=`${He}.5`,dh=`${He}.14`,qs=`${He}.11`,Dn=`${He}.12`,Mn=`${He}.13`,Ul=`${He}.15`,Ll=`${He}.16`,Hl="1.3.14.3.2.26",Fl="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",Ks=`${He}.8`;function ve(e){return new F({algorithm:e,parameters:null})}ve(hh),ve(yh);const ir=ve(Hl);ve(Fl),ve(ql),ve(Kl),ve(zl),ve(fh),ve(ph);const Gl=new F({algorithm:Ks,parameters:G.serialize(ir)}),Wl=new F({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 F(ir),this.maskGenAlgorithm=new F({algorithm:Ks,parameters:G.serialize(ir)}),this.pSourceAlgorithm=new F(Wl),Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:ir})],Pn.prototype,"hashAlgorithm",void 0),u([f({type:F,context:1,defaultValue:Gl})],Pn.prototype,"maskGenAlgorithm",void 0),u([f({type:F,context:2,defaultValue:Wl})],Pn.prototype,"pSourceAlgorithm",void 0),new F({algorithm:sh,parameters:G.serialize(new Pn)});class mi{constructor(t={}){this.hashAlgorithm=new F(ir),this.maskGenAlgorithm=new F({algorithm:Ks,parameters:G.serialize(ir)}),this.saltLength=20,this.trailerField=1,Object.assign(this,t)}}u([f({type:F,context:0,defaultValue:ir})],mi.prototype,"hashAlgorithm",void 0),u([f({type:F,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 F({algorithm:ch,parameters:G.serialize(new mi)});class $n{constructor(t={}){this.digestAlgorithm=new F,this.digest=new ae,Object.assign(this,t)}}u([f({type:F})],$n.prototype,"digestAlgorithm",void 0),u([f({type:ae})],$n.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 Gs=zs=class extends le{constructor(t){super(t),Object.setPrototypeOf(this,zs.prototype)}};Gs=zs=u([V({type:T.Sequence,itemType:Rn})],Gs);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:Gs,optional:!0})],yt.prototype,"otherPrimeInfos",void 0);class Ws{constructor(t={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,t)}}u([f({type:m.Integer,converter:he})],Ws.prototype,"modulus",void 0),u([f({type:m.Integer,converter:he})],Ws.prototype,"publicExponent",void 0);var Js;(function(e){e[e.Transient=0]="Transient",e[e.Singleton=1]="Singleton",e[e.ResolutionScoped=2]="ResolutionScoped",e[e.ContainerScoped=3]="ContainerScoped"})(Js||(Js={}));const Fe=Js;/*! *****************************************************************************
76
76
  Copyright (c) Microsoft Corporation.
77
77
 
78
78
  Permission to use, copy, modify, and/or distribute this software for any
@@ -114,7 +114,7 @@ ${t.join(`
114
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($.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=$.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=Pt,or.algorithmSerializer=Vh;class $t{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=$.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof $t?rc(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)}}$t.NAME="ASN";class gt extends $t{constructor(...t){let r;$.isBufferSource(t[0])?r=$.toArrayBuffer(t[0]):r=G.serialize(new st({extnID:t[0],critical:t[1],extnValue:new ae($.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]=Pt.toString(this.type)),t}}var td;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[td]="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}}td=Symbol.toStringTag,sr.DEFAULT="default";const Je=new sr,jh=/^[0-2](?:\.[1-9][0-9]*)+$/;function Dh(e){return new RegExp(jh).test(e)}class rd{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Dh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Ke=new rd;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 Mh(e,t){return`\\${L.ToHex(L.FromUtf8String(t)).toUpperCase()}`}function Ph(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Mh)}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 rd,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:$.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)}`:Ph(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
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 id="Cannot initialize GeneralName from ASN.1 data.",nd=`${id} Unsupported string format in use.`,$h=`${id} Value doesn't match to GUID regular expression.`,od=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,sd="1.3.6.1.4.1.311.25.1",ad="1.3.6.1.4.1.311.20.2.3",wa="dns",va="dn",ka="email",Ca="ip",Sa="url",xa="guid",Aa="upn",to="id";class cd extends $t{constructor(...t){let r;if(t.length===2)switch(t[0]){case va:{const i=new Rt(t[1]).toArrayBuffer(),n=G.parse(i,we);r=new ie({directoryName:n});break}case wa:r=new ie({dNSName:t[1]});break;case ka:r=new ie({rfc822Name:t[1]});break;case xa:{const i=new RegExp(od,"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:sd,value:G.serialize(new ae(L.FromHex(n)))})});break}case Ca:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Aa:{r=new ie({otherName:new ei({typeId:ad,value:G.serialize(nl.toASN(t[1]))})});break}case Sa:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else $.isBufferSource(t[0])?r=G.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=wa,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=ka,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=Ca,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=Sa,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=va,this.value=new Rt(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===sd){this.type=xa;const r=G.parse(t.otherName.value,ae),i=new RegExp(od,"i").exec(L.ToHex(r));if(!i)throw new Error($h);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===ad)this.type=Aa,this.value=G.parse(t.otherName.value,Oe).toString();else throw new Error(nd);else throw new Error(nd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case va:case wa:case xa:case Ca:case to:case Aa:case Sa:t=this.type.toUpperCase();break;case ka:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=Pt.toString(r)),new ue(t,void 0,r)}}class Ci extends $t{constructor(t){let r;if(t instanceof Pe)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 cd(n.type,n.value).rawData,ie);i.push(s)}r=new Pe(i)}else if($.isBufferSource(t))r=G.parse(t,Pe);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let n=null;try{n=new cd(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",Rh=`[^${xi}]+`,Uh=`${Si}BEGIN (${Rh}(?=${Si}))${Si}`,Lh=`${Si}END \\1${Si}`,Dr="\\n",Hh=`[^:${xi}]+`,Fh=`(?:[^${xi}]+${Dr}(?: +[^${xi}]+${Dr})*)`,qh=`(?:[a-zA-Z0-9=+/]+${Dr})+`,ld=`${Uh}${Dr}(?:((?:${Hh}: ${Fh})+))?${Dr}?(${qh})${Lh}`;class Ye{static isPem(t){return typeof t=="string"&&new RegExp(ld,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(ld,"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(!$.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:$.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
116
  `)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:$.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),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 $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,Ws),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 Fo(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 Ba;(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"})(Ba||(Ba={}));class Ia extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ns);this.usages=r.toNumber()}else{const r=new ns(t[0]);super(wl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ns);return t[""]=r.toJSON().join(", "),t}}Ia.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 Ea 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,ls);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}}Ea.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 Na 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(ua,[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}}Na.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 Oa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new F({algorithm:jn,parameters:null});case"sha-256":return new F({algorithm:qs,parameters:null});case"sha-384":return new F({algorithm:Dn,parameters:null});case"sha-512":return new F({algorithm:Mn,parameters:null})}}else return new F({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 qs: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}};Oa=u([ea()],Oa),tt.registerSingleton(Qn,Oa);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 _a=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 F({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}};_a=u([ea()],_a),tt.registerSingleton(Qn,_a);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(ua);this.extensions=[],i instanceof Na&&(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,Ia),mt.register(Al,no),mt.register(Ho,Ai),mt.register(Sl,Ea),oo.register(du,hd),oo.register(ua,Na),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 Ea){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 Ia){const s=Object.values(Ba),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 Ta=(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))(Ta||{}),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 Va="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(Va));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(Va,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(Va)}}}function ja(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={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"}},ly={global:ey,deleteModal:ty,baseForm:ry,baseTable:iy,baseConfigCard:ny,filter:oy,debouncedFilter:sy,errors:ay,toggleModal:cy};function Da(){const e=ji.createI18n("en-us",ly);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 uy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:n}=ja({headers:e.requestHeaders}),{i18n:{t:s}}=Da(),{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([]),k=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(),v=async()=>{try{l.value=!0;const{data:S}=await n.get(`${g}?size=${r}`);S!=null&&S.next||(k.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||"",k.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=k.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=k.value,l.value=!1};return{loading:l,error:d,validationError:y,results:p,allRecords:k,loadItems:v,debouncedQueryChange:c}}function dy(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 fy(){const{i18n:{t:e}}=Da();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 py(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 k=new URL(s.value.href);return n.value&&I?(k.search="",k=r.value.isExactMatch?new URL(`${k.href}/${I}/`):new URL(`${k.href}?filter[name][contains]=${I}`)):(n.value||new URLSearchParams(I).forEach((h,g)=>{k.searchParams.append(g,h)}),y&&k.searchParams.append("sort_by",y),p==="desc"&&k.searchParams.append("sort_desc","1"),k.searchParams.append("size",String(l))),d&&c!==1&&k.searchParams.append("offset",String(d)),k.href}catch(k){return console.error("RouteList(fetcher)",k),i.value}}}function hy(e,t,r="data"){const i=o.unref(t),{axiosInstance:n}=ja({headers:e.requestHeaders}),s=Cd(e,i),a=o.ref({status:Ut.Idle});return{fetcher:async c=>{try{a.value={status:Ut.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await n.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const I={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ut.Idle,response:I},I}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ut.NoResults,response:d,error:l},d):(a.value={status:Ut.Error,response:d,error:l},d)}},fetcherState:a}}function yy(){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},gy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],my=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=gy(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=my(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},by=(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)=>{wy(r);const i=by(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),wy=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("|")}`)},vy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function ky(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!vy(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 Cy(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)}}const Be={useAxios:ja,useDebouncedFilter:uy,useDeleteUrlBuilder:dy,useErrors:fy,useExternalLinkCreator:py,useFetcher:hy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:yy,useI18n:Da,useGatewayFeatureSupported:ky,useTruncationDetector:Cy},Sy={key:0,class:"config-card-fieldset-title"},xy=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",Sy,[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(so,{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(xy,[["__scopeId","data-v-68ca83ec"]]),Ay=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})])}}}),By=ct(Ay,[["__scopeId","data-v-c96811e5"]]),Iy=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"])}}}),Ey="#0044f4",Ny="#e0e4ea",Oy="#3a3f51",_y="#afb7c5",Ty="1px",Vy="20px",jy={class:"config-card-details-row"},Dy=["data-testid"],My=["data-testid"],Py=["data-testid"],$y=["data-testid"],Ry={key:1},Uy=["data-testid"],Ly=["data-testid"],Hy=["data-testid"],Fy=["data-testid"],qy={name:"ConfigCardItem",components:{JsonCardItem:_d,StatusBadge:Iy,InternalLinkItem:By}},Ky=o.defineComponent({...qy,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(Ty)} ${o.unref(Ny)}`,"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:k}=Be.useTruncationDetector(I);return(h,g)=>{const b=o.resolveComponent("KLabel"),v=o.resolveComponent("KBadge"),B=o.resolveComponent("KCopy"),E=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("div",jy,[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,My)]),key:"0"}:void 0]),1024)],!0)],8,Dy),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",Ry,[(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(v,{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,Uy)):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,Ly)):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(v,{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,Hy)):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,Fy)):(o.openBlock(),o.createBlock(E,{key:4,text:o.unref(k)?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,$y))],!0)],8,Py)])}}}),so=ct(Ky,[["__scopeId","data-v-d056663c"]]),zy={class:"json-config"},Gy={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",zy,[t.fetcherUrl?(o.openBlock(),o.createElementBlock("div",Gy,[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 Wy(e){return typeof e=="object"&&e!==null}function Jy(e){return Array.isArray(e)?e:Vd(e)?[]:[e]}function Yy(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 Zy(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Qy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xy=Vd,eg=Wy,tg=Jy,rg=Zy,ig=Qy,ng=Yy,ke={isNothing:Xy,isObject:eg,toArray:tg,repeat:rg,isNegativeZero:ig,extend:ng};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+=`
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,Ws),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 Fo(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 Ba;(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"})(Ba||(Ba={}));class Ia extends gt{constructor(...t){if($.isBufferSource(t[0])){super(t[0]);const r=G.parse(this.value,ns);this.usages=r.toNumber()}else{const r=new ns(t[0]);super(wl,t[1],G.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=G.parse(this.value,ns);return t[""]=r.toJSON().join(", "),t}}Ia.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 Ea 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,ls);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}}Ea.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 Na 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(ua,[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}}Na.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 Oa=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new F({algorithm:jn,parameters:null});case"sha-256":return new F({algorithm:qs,parameters:null});case"sha-384":return new F({algorithm:Dn,parameters:null});case"sha-512":return new F({algorithm:Mn,parameters:null})}}else return new F({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 qs: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}};Oa=u([ea()],Oa),tt.registerSingleton(Qn,Oa);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 _a=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 F({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}};_a=u([ea()],_a),tt.registerSingleton(Qn,_a);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(ua);this.extensions=[],i instanceof Na&&(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,Ia),mt.register(Al,no),mt.register(Ho,Ai),mt.register(Sl,Ea),oo.register(du,hd),oo.register(ua,Na),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 Ea){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 Ia){const s=Object.values(Ba),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 Ta=(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))(Ta||{}),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 Va="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(Va));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(Va,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(Va)}}}function ja(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={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"}},ly={global:ey,deleteModal:ty,baseForm:ry,baseTable:iy,baseConfigCard:ny,filter:oy,debouncedFilter:sy,errors:ay,toggleModal:cy};function Da(){const e=ji.createI18n("en-us",ly);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 uy(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:n}=ja({headers:e.requestHeaders}),{i18n:{t:s}}=Da(),{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 dy(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 fy(){const{i18n:{t:e}}=Da();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 py(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 hy(e,t,r="data"){var i;const n=o.unref(t),{axiosInstance:s}=ja({...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 yy(){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},gy=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],my=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=gy(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=my(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},by=(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)=>{wy(r);const i=by(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),wy=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("|")}`)},vy=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function ky(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:n}=t;if(!vy(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 Cy(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)}}const Be={useAxios:ja,useDebouncedFilter:uy,useDeleteUrlBuilder:dy,useErrors:fy,useExternalLinkCreator:py,useFetcher:hy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:yy,useI18n:Da,useGatewayFeatureSupported:ky,useTruncationDetector:Cy},Sy={key:0,class:"config-card-fieldset-title"},xy=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",Sy,[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(so,{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(xy,[["__scopeId","data-v-68ca83ec"]]),Ay=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})])}}}),By=ct(Ay,[["__scopeId","data-v-c96811e5"]]),Iy=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"])}}}),Ey="#0044f4",Ny="#e0e4ea",Oy="#3a3f51",_y="#afb7c5",Ty="1px",Vy="20px",jy={class:"config-card-details-row"},Dy=["data-testid"],My=["data-testid"],Py=["data-testid"],$y=["data-testid"],Ry={key:1},Uy=["data-testid"],Ly=["data-testid"],Hy=["data-testid"],Fy=["data-testid"],qy={name:"ConfigCardItem",components:{JsonCardItem:_d,StatusBadge:Iy,InternalLinkItem:By}},Ky=o.defineComponent({...qy,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(Ty)} ${o.unref(Ny)}`,"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",jy,[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,My)]),key:"0"}:void 0]),1024)],!0)],8,Dy),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",Ry,[(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,Uy)):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,Ly)):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,Hy)):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,Fy)):(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,$y))],!0)],8,Py)])}}}),so=ct(Ky,[["__scopeId","data-v-d056663c"]]),zy={class:"json-config"},Gy={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",zy,[t.fetcherUrl?(o.openBlock(),o.createElementBlock("div",Gy,[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 Wy(e){return typeof e=="object"&&e!==null}function Jy(e){return Array.isArray(e)?e:Vd(e)?[]:[e]}function Yy(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 Zy(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function Qy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Xy=Vd,eg=Wy,tg=Jy,rg=Zy,ig=Qy,ng=Yy,ke={isNothing:Xy,isObject:eg,toArray:tg,repeat:rg,isNegativeZero:ig,extend:ng};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+=`
118
118
 
119
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=jd(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+": "+jd(this,e)};var $e=Ii;function Ma(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 Pa(e,t){return ke.repeat(" ",t-e.length)+e}function og(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=Ma(e.buffer,i[a-l],n[a-l],e.position-(i[a]-i[a-l]),p),c=ke.repeat(" ",t.indent)+Pa((e.line-l+1).toString(),y)+" | "+d.str+`
120
120
  `+c;for(d=Ma(e.buffer,i[a],n[a],e.position,p),c+=ke.repeat(" ",t.indent)+Pa((e.line+1).toString(),y)+" | "+d.str+`
@@ -123,17 +123,17 @@ ${t.join(`
123
123
  `;return c.replace(/\n$/,"")}var sg=og,ag=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],cg=["scalar","sequence","mapping"];function lg(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(i){t[String(i)]=r})}),t}function ug(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(ag.indexOf(r)===-1)throw new $e('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=lg(t.styleAliases||null),cg.indexOf(this.kind)===-1)throw new $e('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Te=ug;function Dd(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 dg(){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 $a(e){return this.extend(e)}$a.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 $e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(n){if(!(n instanceof Te))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new $e("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 $e("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 $e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create($a.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Dd(i,"implicit"),i.compiledExplicit=Dd(i,"explicit"),i.compiledTypeMap=dg(i.compiledImplicit,i.compiledExplicit),i};var Md=$a,Pd=new Te("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),$d=new Te("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Rd=new Te("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Ud=new Md({explicit:[Pd,$d,Rd]});function fg(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function pg(){return null}function hg(e){return e===null}var Ld=new Te("tag:yaml.org,2002:null",{kind:"scalar",resolve:fg,construct:pg,predicate:hg,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function yg(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function gg(e){return e==="true"||e==="True"||e==="TRUE"}function mg(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Hd=new Te("tag:yaml.org,2002:bool",{kind:"scalar",resolve:yg,construct:gg,predicate:mg,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 bg(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function wg(e){return 48<=e&&e<=55}function vg(e){return 48<=e&&e<=57}function kg(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(!bg(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}if(n==="o"){for(r++;r<t;r++)if(n=e[r],n!=="_"){if(!wg(e.charCodeAt(r)))return!1;i=!0}return i&&n!=="_"}}if(n==="_")return!1;for(;r<t;r++)if(n=e[r],n!=="_"){if(!vg(e.charCodeAt(r)))return!1;i=!0}return!(!i||n==="_")}function Cg(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 Sg(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ke.isNegativeZero(e)}var Fd=new Te("tag:yaml.org,2002:int",{kind:"scalar",resolve:kg,construct:Cg,predicate:Sg,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"]}}),xg=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Ag(e){return!(e===null||!xg.test(e)||e[e.length-1]==="_")}function Bg(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 Ig=/^[-+]?[0-9]+e/;function Eg(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),Ig.test(r)?r.replace("e",".e"):r}function Ng(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ke.isNegativeZero(e))}var qd=new Te("tag:yaml.org,2002:float",{kind:"scalar",resolve:Ag,construct:Bg,predicate:Ng,represent:Eg,defaultStyle:"lowercase"}),Kd=Ud.extend({implicit:[Ld,Hd,Fd,qd]}),zd=Kd,Gd=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wd=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 Og(e){return e===null?!1:Gd.exec(e)!==null||Wd.exec(e)!==null}function _g(e){var t,r,i,n,s,a,c,l=0,d=null,y,p,I;if(t=Gd.exec(e),t===null&&(t=Wd.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 Tg(e){return e.toISOString()}var Jd=new Te("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Og,construct:_g,instanceOf:Date,represent:Tg});function Vg(e){return e==="<<"||e===null}var Yd=new Te("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Vg}),Ra=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
124
124
  \r`;function jg(e){if(e===null)return!1;var t,r,i=0,n=e.length,s=Ra;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 Dg(e){var t,r,i=e.replace(/[\r\n=]/g,""),n=i.length,s=Ra,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 Mg(e){var t="",r=0,i,n,s=e.length,a=Ra;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 Pg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Zd=new Te("tag:yaml.org,2002:binary",{kind:"scalar",resolve:jg,construct:Dg,predicate:Pg,represent:Mg}),$g=Object.prototype.hasOwnProperty,Rg=Object.prototype.toString;function Ug(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,Rg.call(n)!=="[object Object]")return!1;for(s in n)if($g.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 Lg(e){return e!==null?e:[]}var Qd=new Te("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Ug,construct:Lg}),Hg=Object.prototype.toString;function Fg(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],Hg.call(i)!=="[object Object]"||(n=Object.keys(i),n.length!==1))return!1;s[t]=[n[0],i[n[0]]]}return!0}function qg(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 Xd=new Te("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Fg,construct:qg}),Kg=Object.prototype.hasOwnProperty;function zg(e){if(e===null)return!0;var t,r=e;for(t in r)if(Kg.call(r,t)&&r[t]!==null)return!1;return!0}function Gg(e){return e!==null?e:{}}var ef=new Te("tag:yaml.org,2002:set",{kind:"mapping",resolve:zg,construct:Gg}),Ua=zd.extend({implicit:[Jd,Yd],explicit:[Zd,Qd,Xd,ef]}),Lt=Object.prototype.hasOwnProperty,ao=1,tf=2,rf=3,co=4,La=1,Wg=2,nf=3,Jg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Yg=/[\x85\u2028\u2029]/,Zg=/[,\[\]\{\}]/,of=/^(?:!|!!|![a-z\-]+!)$/i,sf=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function af(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 Pr(e){return e===44||e===91||e===93||e===123||e===125}function Qg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Xg(e){return e===120?2:e===117?4:e===85?8:0}function em(e){return 48<=e&&e<=57?e-48:-1}function cf(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
125
125
  `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function tm(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var lf=new Array(256),uf=new Array(256),$r=0;$r<256;$r++)lf[$r]=cf($r)?1:0,uf[$r]=cf($r);function rm(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Ua,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 df(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=sg(r),new $e(t,r)}function J(e,t){throw df(e,t)}function lo(e,t){e.onWarning&&e.onWarning.call(null,df(e,t))}var ff={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&&lo(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],of.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'),sf.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 Ht(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 Jg.test(c)&&J(e,"the stream contains non-printable characters");e.result+=c}}function pf(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"&&af(n[d])==="[object Object]"&&(n[d]="[object Object]");if(typeof n=="object"&&af(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)pf(e,t,s[d],r);else pf(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 Ha(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(Ha(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&&lo(e,"deficient indentation"),i}function uo(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 Fa(e,t){t===1?e.result+=" ":t>1&&(e.result+=ke.repeat(`
126
- `,t-1))}function im(e,t,r){var i,n,s,a,c,l,d,y,p=e.kind,I=e.result,k;if(k=e.input.charCodeAt(e.position),ze(k)||Pr(k)||k===35||k===38||k===42||k===33||k===124||k===62||k===39||k===34||k===37||k===64||k===96||(k===63||k===45)&&(n=e.input.charCodeAt(e.position+1),ze(n)||r&&Pr(n)))return!1;for(e.kind="scalar",e.result="",s=a=e.position,c=!1;k!==0;){if(k===58){if(n=e.input.charCodeAt(e.position+1),ze(n)||r&&Pr(n))break}else if(k===35){if(i=e.input.charCodeAt(e.position-1),ze(i))break}else{if(e.position===e.lineStart&&uo(e)||r&&Pr(k))break;if(wt(k))if(l=e.line,d=e.lineStart,y=e.lineIndent,be(e,!1,-1),e.lineIndent>=t){c=!0,k=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=d,e.lineIndent=y;break}}c&&(Ht(e,s,a,!1),Fa(e,e.line-l),s=a=e.position,c=!1),lr(k)||(a=e.position+1),k=e.input.charCodeAt(++e.position)}return Ht(e,s,a,!1),e.result?!0:(e.kind=p,e.result=I,!1)}function nm(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(Ht(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)?(Ht(e,i,n,!0),Fa(e,be(e,!1,t)),i=n=e.position):e.position===e.lineStart&&uo(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 om(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 Ht(e,r,e.position,!0),e.position++,!0;if(c===92){if(Ht(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),wt(c))be(e,!1,t);else if(c<256&&lf[c])e.result+=uf[c],e.position++;else if((a=Xg(c))>0){for(n=a,s=0;n>0;n--)c=e.input.charCodeAt(++e.position),(a=Qg(c))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=tm(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else wt(c)?(Ht(e,r,i,!0),Fa(e,be(e,!1,t)),r=i=e.position):e.position===e.lineStart&&uo(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 sm(e,t){var r=!0,i,n,s,a=e.tag,c,l=e.anchor,d,y,p,I,k,h=Object.create(null),g,b,v,B;if(B=e.input.charCodeAt(e.position),B===91)y=93,k=!1,c=[];else if(B===123)y=125,k=!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=k?"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=v=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,ao,!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,ao,!1,!0),v=e.result),k?Rr(e,c,h,b,g,v,i,n,s):p?c.push(Rr(e,null,h,b,g,v,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 am(e,t){var r,i,n=La,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)La===n?n=p===43?nf:Wg:J(e,"repeat of a chomping mode identifier");else if((y=em(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(Ha(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===nf?e.result+=ke.repeat(`
126
+ `,t-1))}function im(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)||Pr(w)||w===35||w===38||w===42||w===33||w===124||w===62||w===39||w===34||w===37||w===64||w===96||(w===63||w===45)&&(n=e.input.charCodeAt(e.position+1),ze(n)||r&&Pr(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&&Pr(n))break}else if(w===35){if(i=e.input.charCodeAt(e.position-1),ze(i))break}else{if(e.position===e.lineStart&&uo(e)||r&&Pr(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&&(Ht(e,s,a,!1),Fa(e,e.line-l),s=a=e.position,c=!1),lr(w)||(a=e.position+1),w=e.input.charCodeAt(++e.position)}return Ht(e,s,a,!1),e.result?!0:(e.kind=p,e.result=I,!1)}function nm(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(Ht(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)?(Ht(e,i,n,!0),Fa(e,be(e,!1,t)),i=n=e.position):e.position===e.lineStart&&uo(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 om(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 Ht(e,r,e.position,!0),e.position++,!0;if(c===92){if(Ht(e,r,e.position,!0),c=e.input.charCodeAt(++e.position),wt(c))be(e,!1,t);else if(c<256&&lf[c])e.result+=uf[c],e.position++;else if((a=Xg(c))>0){for(n=a,s=0;n>0;n--)c=e.input.charCodeAt(++e.position),(a=Qg(c))>=0?s=(s<<4)+a:J(e,"expected hexadecimal character");e.result+=tm(s),e.position++}else J(e,"unknown escape sequence");r=i=e.position}else wt(c)?(Ht(e,r,i,!0),Fa(e,be(e,!1,t)),r=i=e.position):e.position===e.lineStart&&uo(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 sm(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,ao,!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,ao,!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 am(e,t){var r,i,n=La,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)La===n?n=p===43?nf:Wg:J(e,"repeat of a chomping mode identifier");else if((y=em(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(Ha(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===nf?e.result+=ke.repeat(`
127
127
  `,s?1+l:l):n===La&&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);Ht(e,r,e.position,!1)}return!0}function hf(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,rf,!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 cm(e,t,r){var i,n,s,a,c,l,d=e.tag,y=e.anchor,p={},I=Object.create(null),k=null,h=null,g=null,b=!1,v=!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,k,h,null,a,c,l),k=h=g=null),v=!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,tf,!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,k,h,null,a,c,l),k=h=g=null),v=!0,b=!1,n=!1,k=e.tag,h=e.result;else if(v)J(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=y,!0}else if(v)J(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=y,!0}if((e.line===s||e.lineIndent>t)&&(b&&(a=e.line,c=e.lineStart,l=e.position),Ur(e,t,co,!0,n)&&(b?h=e.result:g=e.result),b||(Rr(e,p,I,k,h,g,a,c,l),k=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,k,h,null,a,c,l),v&&(e.tag=d,e.anchor=y,e.kind="mapping",e.result=p),v}function lm(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),of.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),Zg.test(s)&&J(e,"tag suffix cannot contain flow indicator characters")}s&&!sf.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 um(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)&&!Pr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function dm(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)&&!Pr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),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,k,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=co===r||rf===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(;lm(e)||um(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||co===r)&&(ao===r||tf===r?g=t:g=t+1,b=e.position-e.lineStart,l===1?c&&(hf(e,b)||cm(e,b,g))||sm(e,g)?y=!0:(a&&am(e,g)||nm(e,g)||om(e,g)?y=!0:dm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&J(e,"alias node should not have any properties")):im(e,g,ao===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&hf(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,k=e.typeMap.multi[e.kind||"fallback"],p=0,I=k.length;p<I;p+=1)if(e.tag.slice(0,k[p].tag.length)===k[p].tag){h=k[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 fm(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&&Ha(e),Lt.call(ff,i)?ff[i](e,i,n):lo(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,co,!1,!0),be(e,!0,-1),e.checkLineBreaks&&Yg.test(e.input.slice(t,e.position))&&lo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&uo(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 yf(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
132
+ `,s?1+l:l),s=!0,a=!0,l=0,r=e.position;!wt(p)&&p!==0;)p=e.input.charCodeAt(++e.position);Ht(e,r,e.position,!1)}return!0}function hf(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,rf,!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 cm(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,tf,!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,co,!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 lm(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),of.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),Zg.test(s)&&J(e,"tag suffix cannot contain flow indicator characters")}s&&!sf.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 um(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)&&!Pr(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function dm(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)&&!Pr(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&J(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),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=co===r||rf===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(;lm(e)||um(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||co===r)&&(ao===r||tf===r?g=t:g=t+1,b=e.position-e.lineStart,l===1?c&&(hf(e,b)||cm(e,b,g))||sm(e,g)?y=!0:(a&&am(e,g)||nm(e,g)||om(e,g)?y=!0:dm(e)?(y=!0,(e.tag!==null||e.anchor!==null)&&J(e,"alias node should not have any properties")):im(e,g,ao===r)&&(y=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(y=c&&hf(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 fm(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&&Ha(e),Lt.call(ff,i)?ff[i](e,i,n):lo(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,co,!1,!0),be(e,!0,-1),e.checkLineBreaks&&Yg.test(e.input.slice(t,e.position))&&lo(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&uo(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 yf(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
133
133
  `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new rm(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;)fm(r);return r.documents}function pm(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var i=yf(e,r);if(typeof t!="function")return i;for(var n=0,s=i.length;n<s;n+=1)t(i[n])}function hm(e,t){var r=yf(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new $e("expected a single document in the stream, but found more")}}var ym=pm,gm=hm,gf={loadAll:ym,load:gm},mf=Object.prototype.toString,bf=Object.prototype.hasOwnProperty,qa=65279,mm=9,Ei=10,bm=13,wm=32,vm=33,km=34,Ka=35,Cm=37,Sm=38,xm=39,Am=42,wf=44,Bm=45,fo=58,Im=61,Em=62,Nm=63,Om=64,vf=91,kf=93,_m=96,Cf=123,Tm=124,Sf=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 Vm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],jm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Dm(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&&bf.call(l.styleAliases,c)&&(c=l.styleAliases[c]),r[a]=c;return r}function Mm(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 $e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+ke.repeat("0",i-t.length)+t}var Pm=1,Ni=2;function $m(e){this.schema=e.schema||Ua,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=Dm(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:Pm,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 xf(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
135
  `&&(s+=r),s+=a;return s}function za(e,t){return`
136
- `+ke.repeat(" ",e.indent*t)}function Rm(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 po(e){return e===wm||e===mm}function Oi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==qa||65536<=e&&e<=1114111}function Af(e){return Oi(e)&&e!==qa&&e!==bm&&e!==Ei}function Bf(e,t,r){var i=Af(e),n=i&&!po(e);return(r?i:i&&e!==wf&&e!==vf&&e!==kf&&e!==Cf&&e!==Sf)&&e!==Ka&&!(t===fo&&!n)||Af(t)&&!po(t)&&e===Ka||t===fo&&n}function Um(e){return Oi(e)&&e!==qa&&!po(e)&&e!==Bm&&e!==Nm&&e!==fo&&e!==wf&&e!==vf&&e!==kf&&e!==Cf&&e!==Sf&&e!==Ka&&e!==Sm&&e!==Am&&e!==vm&&e!==Tm&&e!==Im&&e!==Em&&e!==xm&&e!==km&&e!==Cm&&e!==Om&&e!==_m}function Lm(e){return!po(e)&&e!==fo}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 If(e){var t=/^\n* /;return t.test(e)}var Ef=1,Ga=2,Nf=3,Of=4,Lr=5;function Hm(e,t,r,i,n,s,a,c){var l,d=0,y=null,p=!1,I=!1,k=i!==-1,h=-1,g=Um(_i(e,0))&&Lm(_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&&Bf(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,k&&(I=I||l-h-1>i&&e[h+1]!==" ",h=l);else if(!Oi(d))return Lr;g=g&&Bf(d,y,c),y=d}I=I||k&&l-h-1>i&&e[h+1]!==" "}return!p&&!I?g&&!a&&!n(e)?Ef:s===Ni?Lr:Ga:r>9&&If(e)?Lr:a?s===Ni?Lr:Ga:I?Of:Nf}function Fm(e,t,r,i,n){e.dump=function(){if(t.length===0)return e.quotingType===Ni?'""':"''";if(!e.noCompatMode&&(Vm.indexOf(t)!==-1||jm.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 Rm(e,d)}switch(Hm(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,n)){case Ef:return t;case Ga:return"'"+t.replace(/'/g,"''")+"'";case Nf:return"|"+_f(t,e.indent)+Tf(xf(t,s));case Of:return">"+_f(t,e.indent)+Tf(xf(qm(t,a),s));case Lr:return'"'+Km(t)+'"';default:throw new $e("impossible error: invalid scalar style")}}()}function _f(e,t){var r=If(e)?String(t):"",i=e[e.length-1]===`
136
+ `+ke.repeat(" ",e.indent*t)}function Rm(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 po(e){return e===wm||e===mm}function Oi(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==qa||65536<=e&&e<=1114111}function Af(e){return Oi(e)&&e!==qa&&e!==bm&&e!==Ei}function Bf(e,t,r){var i=Af(e),n=i&&!po(e);return(r?i:i&&e!==wf&&e!==vf&&e!==kf&&e!==Cf&&e!==Sf)&&e!==Ka&&!(t===fo&&!n)||Af(t)&&!po(t)&&e===Ka||t===fo&&n}function Um(e){return Oi(e)&&e!==qa&&!po(e)&&e!==Bm&&e!==Nm&&e!==fo&&e!==wf&&e!==vf&&e!==kf&&e!==Cf&&e!==Sf&&e!==Ka&&e!==Sm&&e!==Am&&e!==vm&&e!==Tm&&e!==Im&&e!==Em&&e!==xm&&e!==km&&e!==Cm&&e!==Om&&e!==_m}function Lm(e){return!po(e)&&e!==fo}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 If(e){var t=/^\n* /;return t.test(e)}var Ef=1,Ga=2,Nf=3,Of=4,Lr=5;function Hm(e,t,r,i,n,s,a,c){var l,d=0,y=null,p=!1,I=!1,w=i!==-1,h=-1,g=Um(_i(e,0))&&Lm(_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&&Bf(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&&Bf(d,y,c),y=d}I=I||w&&l-h-1>i&&e[h+1]!==" "}return!p&&!I?g&&!a&&!n(e)?Ef:s===Ni?Lr:Ga:r>9&&If(e)?Lr:a?s===Ni?Lr:Ga:I?Of:Nf}function Fm(e,t,r,i,n){e.dump=function(){if(t.length===0)return e.quotingType===Ni?'""':"''";if(!e.noCompatMode&&(Vm.indexOf(t)!==-1||jm.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 Rm(e,d)}switch(Hm(t,c,e.indent,a,l,e.quotingType,e.forceQuotes&&!i,n)){case Ef:return t;case Ga:return"'"+t.replace(/'/g,"''")+"'";case Nf:return"|"+_f(t,e.indent)+Tf(xf(t,s));case Of:return">"+_f(t,e.indent)+Tf(xf(qm(t,a),s));case Lr:return'"'+Km(t)+'"';default:throw new $e("impossible error: invalid scalar style")}}()}function _f(e,t){var r=If(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+`
@@ -145,4 +145,4 @@ ${t.join(`
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
147
  `+e.slice(a+1):l+=e.slice(n),l.slice(1)}function Km(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||Mm(r);return t}function zm(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 jf(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+=za(e,t)),e.dump&&Ei===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=s,e.dump=n||"[]"}function Gm(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 Wm(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 $e("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)I="",(!i||n!=="")&&(I+=za(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+=za(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 Df(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,mf.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(bf.call(c.represent,l))i=c.represent[l](t,l);else throw new $e("!<"+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,Df(e,r,!1)||Df(e,r,!0);var c=mf.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?(Wm(e,t,e.dump,n),I&&(e.dump="&ref_"+p+e.dump)):(Gm(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?jf(e,t-1,e.dump,n):jf(e,t,e.dump,n),I&&(e.dump="&ref_"+p+e.dump)):(zm(e,t,e.dump),I&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&Fm(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new $e("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 Jm(e,t){var r=[],i=[],n,s;for(Wa(e,r,i),n=0,s=i.length;n<s;n+=1)t.duplicates.push(r[i[n]]);t.usedDuplicates=new Array(s)}function Wa(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)Wa(e[n],t,r);else for(i=Object.keys(e),n=0,s=i.length;n<s;n+=1)Wa(e[i[n]],t,r)}function Ym(e,t){t=t||{};var r=new $m(t);r.noRefs||Jm(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),_t(r,0,i,!0,!0)?r.dump+`
148
- `:""}var Zm=Ym,Qm={dump:Zm};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 Xm=Te,e0=Md,t0=Ud,r0=Kd,i0=zd,n0=Ua,o0=gf.load,s0=gf.loadAll,a0=Qm.dump,c0=$e,l0={binary:Zd,float:qd,map:Rd,null:Ld,pairs:Xd,set:ef,timestamp:Jd,bool:Hd,int:Fd,merge:Yd,omap:Qd,seq:$d,str:Pd},u0=Ja("safeLoad","load"),d0=Ja("safeLoadAll","loadAll"),f0=Ja("safeDump","dump"),p0={Type:Xm,Schema:e0,FAILSAFE_SCHEMA:t0,JSON_SCHEMA:r0,CORE_SCHEMA:i0,DEFAULT_SCHEMA:n0,load:o0,loadAll:s0,dump:a0,YAMLException:c0,types:l0,safeLoad:u0,safeLoadAll:d0,safeDump:f0};const h0={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?"":p0.dump(i).trim()});return(i,n)=>{const s=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",h0,[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)])}}}),y0={key:0,class:"config-card-display-form"},g0=["data-testid"],m0={key:0,class:"config-card-prop-section-title"},b0=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",y0,[(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",m0,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(so,{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,g0))),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))}}),w0=ct(b0,[["__scopeId","data-v-147a2f70"]]),Ft="24px",ho=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},v0=e=>(o.pushScopeId("data-v-2295e0fb"),e=e(),o.popScopeId(),e),k0=["aria-hidden"],C0={key:0,"data-testid":"kui-icon-svg-title"},S0=v0(()=>o.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),x0=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:Ft,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 Ft}),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",C0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),S0],8,k0))]),_:1},8,["aria-hidden","style"]))}}),A0=ho(x0,[["__scopeId","data-v-2295e0fb"]]),B0=e=>(o.pushScopeId("data-v-40a7f387"),e=e(),o.popScopeId(),e),I0=["aria-hidden"],E0={key:0,"data-testid":"kui-icon-svg-title"},N0=B0(()=>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)),O0=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:Ft,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 Ft}),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",E0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),N0],8,I0))]),_:1},8,["aria-hidden","style"]))}}),_0=ho(O0,[["__scopeId","data-v-40a7f387"]]),T0=e=>(o.pushScopeId("data-v-98c34919"),e=e(),o.popScopeId(),e),V0=["aria-hidden"],j0={key:0,"data-testid":"kui-icon-svg-title"},D0=T0(()=>o.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),M0=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:Ft,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 Ft}),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",j0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),D0],8,V0))]),_:1},8,["aria-hidden","style"]))}}),P0=ho(M0,[["__scopeId","data-v-98c34919"]]),$0=e=>(o.pushScopeId("data-v-19f4cbbe"),e=e(),o.popScopeId(),e),R0=["aria-hidden"],U0={key:0,"data-testid":"kui-icon-svg-title"},L0=$0(()=>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)),H0=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:Ft,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 Ft}),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",U0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),L0],8,R0))]),_:1},8,["aria-hidden","style"]))}}),F0=ho(H0,[["__scopeId","data-v-19f4cbbe"]]),q0={"data-testid":"config-card-title"},K0={class:"config-card-actions"},z0=["href"],G0={class:"config-card-details-section"},W0=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}},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}},k=o.ref(!1),h=o.ref(!1),g=o.ref(""),b=o.ref({}),v=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=v.value)==null?void 0:A.filter(re=>re.section===fe.Basic),advanced:(M=v.value)==null?void 0:M.filter(re=>re.section===fe.Advanced),plugin:(N=B.value)==null?void 0:N.concat((_=v.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(k,A=>{i("loading",A)},{immediate:!0}),o.onBeforeMount(async()=>{h.value=!1,k.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{k.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"},o.createSlots({actions:o.withCtx(()=>[o.createElementVNode("div",K0,[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(Vy)},null,8,["size"])],8,z0)]),_:1})):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[k.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",G0,[o.createVNode(w0,{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("div",q0,[o.renderSlot(A.$slots,"title",{},()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Pf=ct(W0,[["__scopeId","data-v-491f1797"]]),J0={class:"form-actions","data-testid":"form-actions"},Y0=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),k=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=()=>{k.value=!k.value},b=()=>{n.config.cancelRoute?s.push(n.config.cancelRoute):v()},v=()=>{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(v,["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",J0,[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:k.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(Y0,[["__scopeId","data-v-1d932d98"]]),Z0={key:0,"data-testid":"first-col"},Q0=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 v=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return v?((b=v[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,v;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=((v=l.value)==null?void 0:v.innerText)||""},l=o.ref({}),d=o.ref(0),y=o.ref(0),p=o.ref(""),I=o.computed(()=>[i.value,r.value]),k=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(()=>{k()}),(g,b)=>{const v=o.resolveComponent("KTooltip");return o.openBlock(),o.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[n.value?(o.openBlock(),o.createElementBlock("span",Z0,[o.createVNode(v,{"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)}}}),X0=ct(Q0,[["__scopeId","data-v-c4379fd4"]]),e1={class:"toolbar-container"},t1={key:0,class:"toolbar-button-container"},r1=["data-testid"],i1=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:""},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},k=()=>{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:v,getTablePreferences:B}=Xh(),E=o.computed(()=>{const C=B(r.preferencesStorageKey);return{...r.initialFetcherParams,...C}}),S=C=>{r.preferencesStorageKey&&v(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},{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:k,"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",e1,[o.renderSlot(C.$slots,"toolbar-filter",{},void 0,!0),C.$slots["toolbar-button"]?(o.openBlock(),o.createElementBlock("div",t1,[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(Oy),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,r1)]),_:2},[o.renderList(e.tableHeaders,(j,Z)=>({name:Z,fn:o.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[o.createVNode(X0,{"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(A0))]),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"])}}}),Rf=ct(i1,[["__scopeId","data-v-273124cf"]]),n1={key:0,class:"kong-ui-entity-delete-error"},o1={key:1,class:"description"},s1=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",n1,[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",o1,[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(s1,[["__scopeId","data-v-4361d622"]]),a1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},c1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},l1=["fill"],u1={mask:"url(#mask0_180_20349)"},d1=["fill"],Lf=o.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Ey})`}},setup(e){return(t,r)=>(o.openBlock(),o.createElementBlock("svg",a1,[o.createElementVNode("mask",c1,[o.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,l1)]),o.createElementVNode("g",u1,[o.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,d1)])]))}}),f1={key:1,class:"kong-ui-entity-filter"},p1={class:"kong-ui-entity-filter-menu"},h1=["data-testid"],y1=["onClick","onKeydown"],g1={class:"menu-item-indicator"},m1={class:"menu-item-body"},b1=["for"],w1={class:"menu-item-buttons"},v1={class:"filter-clear-button-container"},k1=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)},k=()=>{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"},v=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(F0),{class:"kong-ui-entity-filter-clear",onClick:k},null,512),[[o.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(o.openBlock(),o.createElementBlock("div",f1,[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",p1,[(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",g1,null,512),[[o.vShow,l.value.includes(N.value)]]),o.createVNode(o.unref(P0),{class:o.normalizeClass(["menu-item-expand-icon",{expanded:c.value.has(N.value)}]),color:o.unref(_y)},null,8,["class","color"])],42,y1),o.withDirectives(o.createElementVNode("div",m1,[o.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},o.toDisplayString(o.unref(r)("filter.fieldLabel")),9,b1),((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",w1,[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=>v(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,h1)}),128)),o.createElementVNode("div",v1,[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]])]))}}}),Hf=ct(k1,[["__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)}}),C1={class:"form-section-wrapper"},S1={key:0,class:"form-section-title"},x1={key:1,class:"form-section-description"},A1={key:2,class:"form-section-footer"},B1={class:"form-section-content"},I1=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}},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",C1,[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.createElementBlock("h4",S1,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),e.description||o.unref(t).description?(o.openBlock(),o.createElementBlock("div",x1,[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",A1,[o.renderSlot(r.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2)),o.createElementVNode("div",B1,[o.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),yo=ct(I1,[["__scopeId","data-v-3565daa7"]]),{useAxios:go,useDeleteUrlBuilder:Ff,useErrors:qf,useExternalLinkCreator:yb,useFetchUrlBuilder:gb,useFetcher:Kf,useDebouncedFilter:mb,useStringHelpers:zf,useHelpers:Gf,useGatewayFeatureSupported:bb,useTruncationDetector:wb}=Be,E1={class:"kong-ui-entities-certificates-list"},N1={key:0},O1={key:1},_1={key:0},T1={key:1},V1={key:0},j1={key:1},D1={key:1},M1={key:1},P1=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}=go({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}},k=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:v}=Kf(i.config,k.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=Ff(i.config,k.value),{certificateDataCache:Ce,getCertificateData:Ee}=bt.useCertificate(),Fr=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(v,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",E1,[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(Hf),{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",N1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",O1,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",_1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",T1,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",V1,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",j1,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",D1,"-"))]),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",M1,"-"))]}),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=>Fr(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(Ta).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"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},$1=Hr(P1,[["__scopeId","data-v-f8690ed7"]]),R1={class:"kong-ui-entities-certificates-form"},U1=Hr(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}=go({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:""}),k=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}),v=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(v.value,B.value):y.value==="edit"&&(j=((C=i.config)==null?void 0:C.app)==="konnect"?await l.put(v.value,B.value):await l.patch(v.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",R1,[o.createVNode(o.unref($f),{"can-submit":k.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(yo),{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(yo),{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"}}},L1={class:"kong-ui-ca-certificate-entity-config-card"},H1={key:0},F1=Hr(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)}),k=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]},v=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",L1,[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":v,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(so),{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(k.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"]]),q1={class:"kong-ui-entities-ca-certificates-list"},K1={key:0},z1={key:1},G1={key:0},W1={key:1},J1={key:1},Y1=Hr(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}=go({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}},k=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:v}=Kf(i.config,k.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=Ff(i.config,k.value),{certificateDataCache:Ie,getCertificateData:Ce}=bt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},Fr=()=>{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(v,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",q1,[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(Hf),{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",K1,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",G1,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?o.unref(s)(te.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",W1,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",J1,"-"))]}),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(Ta).CACertificate,error:Z.value,title:o.unref(n)("ca-certificates.delete.title"),visible:q.value,onCancel:Fr,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"]]),Z1={class:"kong-ui-entities-ca-certificates-form"},Q1=Hr(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}=go({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),k=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}),v=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,v.value),d.value==="create"?N=await c.post(b.value,v.value):d.value==="edit"&&(N=((S=i.config)==null?void 0:S.app)==="konnect"?await c.put(b.value,v.value):await c.patch(b.value,v.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",Z1,[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":v.value,"is-readonly":y.isReadonly,onCancel:h,"onFetch:error":C[3]||(C[3]=_=>S.$emit("error",_)),"onFetch:success":k,onLoading:C[4]||(C[4]=_=>S.$emit("loading",_)),onSubmit:B},{default:o.withCtx(()=>[o.createVNode(o.unref(yo),{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(yo),{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"]]),X1={class:"kong-ui-certificate-entity-config-card"},eb={key:0},tb=Hr(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}}),k=_=>{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):""}),v=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",X1,[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":k,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(so),{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(v.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",eb,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=F1,Ve.CACertificateForm=Q1,Ve.CACertificateList=Y1,Ve.CertificateConfigCard=tb,Ve.CertificateForm=U1,Ve.CertificateList=$1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});
148
+ `:""}var Zm=Ym,Qm={dump:Zm};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 Xm=Te,e0=Md,t0=Ud,r0=Kd,i0=zd,n0=Ua,o0=gf.load,s0=gf.loadAll,a0=Qm.dump,c0=$e,l0={binary:Zd,float:qd,map:Rd,null:Ld,pairs:Xd,set:ef,timestamp:Jd,bool:Hd,int:Fd,merge:Yd,omap:Qd,seq:$d,str:Pd},u0=Ja("safeLoad","load"),d0=Ja("safeLoadAll","loadAll"),f0=Ja("safeDump","dump"),p0={Type:Xm,Schema:e0,FAILSAFE_SCHEMA:t0,JSON_SCHEMA:r0,CORE_SCHEMA:i0,DEFAULT_SCHEMA:n0,load:o0,loadAll:s0,dump:a0,YAMLException:c0,types:l0,safeLoad:u0,safeLoadAll:d0,safeDump:f0};const h0={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?"":p0.dump(i).trim()});return(i,n)=>{const s=o.resolveComponent("KCodeBlock");return o.openBlock(),o.createElementBlock("div",h0,[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)])}}}),y0={key:0,class:"config-card-display-form"},g0=["data-testid"],m0={key:0,class:"config-card-prop-section-title"},b0=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",y0,[(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",m0,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(so,{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,g0))),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))}}),w0=ct(b0,[["__scopeId","data-v-147a2f70"]]),Ft="24px",ho=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},v0=e=>(o.pushScopeId("data-v-2295e0fb"),e=e(),o.popScopeId(),e),k0=["aria-hidden"],C0={key:0,"data-testid":"kui-icon-svg-title"},S0=v0(()=>o.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),x0=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:Ft,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 Ft}),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",C0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),S0],8,k0))]),_:1},8,["aria-hidden","style"]))}}),A0=ho(x0,[["__scopeId","data-v-2295e0fb"]]),B0=e=>(o.pushScopeId("data-v-40a7f387"),e=e(),o.popScopeId(),e),I0=["aria-hidden"],E0={key:0,"data-testid":"kui-icon-svg-title"},N0=B0(()=>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)),O0=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:Ft,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 Ft}),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",E0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),N0],8,I0))]),_:1},8,["aria-hidden","style"]))}}),_0=ho(O0,[["__scopeId","data-v-40a7f387"]]),T0=e=>(o.pushScopeId("data-v-98c34919"),e=e(),o.popScopeId(),e),V0=["aria-hidden"],j0={key:0,"data-testid":"kui-icon-svg-title"},D0=T0(()=>o.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),M0=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:Ft,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 Ft}),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",j0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),D0],8,V0))]),_:1},8,["aria-hidden","style"]))}}),P0=ho(M0,[["__scopeId","data-v-98c34919"]]),$0=e=>(o.pushScopeId("data-v-19f4cbbe"),e=e(),o.popScopeId(),e),R0=["aria-hidden"],U0={key:0,"data-testid":"kui-icon-svg-title"},L0=$0(()=>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)),H0=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:Ft,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 Ft}),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",U0,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),L0],8,R0))]),_:1},8,["aria-hidden","style"]))}}),F0=ho(H0,[["__scopeId","data-v-19f4cbbe"]]),q0={"data-testid":"config-card-title"},K0={class:"config-card-actions"},z0=["href"],G0={class:"config-card-details-section"},W0=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}},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"},o.createSlots({actions:o.withCtx(()=>[o.createElementVNode("div",K0,[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(Vy)},null,8,["size"])],8,z0)]),_: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",G0,[o.createVNode(w0,{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("div",q0,[o.renderSlot(A.$slots,"title",{},()=>[o.createTextVNode(o.toDisplayString(o.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),Pf=ct(W0,[["__scopeId","data-v-491f1797"]]),J0={class:"form-actions","data-testid":"form-actions"},Y0=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",J0,[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(Y0,[["__scopeId","data-v-1d932d98"]]),Z0={key:0,"data-testid":"first-col"},Q0=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",Z0,[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)}}}),X0=ct(Q0,[["__scopeId","data-v-c4379fd4"]]),e1={class:"toolbar-container"},t1={key:0,class:"toolbar-button-container"},r1=["data-testid"],i1=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:""},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},{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",e1,[o.renderSlot(C.$slots,"toolbar-filter",{},void 0,!0),C.$slots["toolbar-button"]?(o.openBlock(),o.createElementBlock("div",t1,[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(Oy),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,r1)]),_:2},[o.renderList(e.tableHeaders,(j,Z)=>({name:Z,fn:o.withCtx(({row:ne,rowKey:Ie,rowValue:Ce})=>[o.createVNode(X0,{"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(A0))]),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"])}}}),Rf=ct(i1,[["__scopeId","data-v-273124cf"]]),n1={key:0,class:"kong-ui-entity-delete-error"},o1={key:1,class:"description"},s1=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",n1,[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",o1,[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(s1,[["__scopeId","data-v-4361d622"]]),a1={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},c1={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},l1=["fill"],u1={mask:"url(#mask0_180_20349)"},d1=["fill"],Lf=o.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${Ey})`}},setup(e){return(t,r)=>(o.openBlock(),o.createElementBlock("svg",a1,[o.createElementVNode("mask",c1,[o.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,l1)]),o.createElementVNode("g",u1,[o.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,d1)])]))}}),f1={key:1,class:"kong-ui-entity-filter"},p1={class:"kong-ui-entity-filter-menu"},h1=["data-testid"],y1=["onClick","onKeydown"],g1={class:"menu-item-indicator"},m1={class:"menu-item-body"},b1=["for"],w1={class:"menu-item-buttons"},v1={class:"filter-clear-button-container"},k1=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(F0),{class:"kong-ui-entity-filter-clear",onClick:w},null,512),[[o.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(o.openBlock(),o.createElementBlock("div",f1,[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",p1,[(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",g1,null,512),[[o.vShow,l.value.includes(N.value)]]),o.createVNode(o.unref(P0),{class:o.normalizeClass(["menu-item-expand-icon",{expanded:c.value.has(N.value)}]),color:o.unref(_y)},null,8,["class","color"])],42,y1),o.withDirectives(o.createElementVNode("div",m1,[o.createElementVNode("label",{class:"menu-item-label",for:h(N.value)},o.toDisplayString(o.unref(r)("filter.fieldLabel")),9,b1),((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",w1,[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,h1)}),128)),o.createElementVNode("div",v1,[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]])]))}}}),Hf=ct(k1,[["__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)}}),C1={class:"form-section-wrapper"},S1={key:0,class:"form-section-title"},x1={key:1,class:"form-section-description"},A1={key:2,class:"form-section-footer"},B1={class:"form-section-content"},I1=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}},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",C1,[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.createElementBlock("h4",S1,o.toDisplayString(e.title),1)):o.createCommentVNode("",!0),e.description||o.unref(t).description?(o.openBlock(),o.createElementBlock("div",x1,[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",A1,[o.renderSlot(r.$slots,"footer",{},void 0,!0)])):o.createCommentVNode("",!0)],2)),o.createElementVNode("div",B1,[o.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),yo=ct(I1,[["__scopeId","data-v-3565daa7"]]),{useAxios:go,useDeleteUrlBuilder:Ff,useErrors:qf,useExternalLinkCreator:yb,useFetchUrlBuilder:gb,useFetcher:Kf,useDebouncedFilter:mb,useStringHelpers:zf,useHelpers:Gf,useGatewayFeatureSupported:bb,useTruncationDetector:wb}=Be,E1={class:"kong-ui-entities-certificates-list"},N1={key:0},O1={key:1},_1={key:0},T1={key:1},V1={key:0},j1={key:1},D1={key:1},M1={key:1},P1=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}=go({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=Ff(i.config,w.value),{certificateDataCache:Ce,getCertificateData:Ee}=bt.useCertificate(),Fr=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",E1,[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(Hf),{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",N1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.subject?Y.metadata.subject:"-"),1)):(o.openBlock(),o.createElementBlock("b",O1,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",_1,o.toDisplayString((xe=Y==null?void 0:Y.metadata)!=null&&xe.expiry?o.unref(s)(Y.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",T1,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",V1,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",j1,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",D1,"-"))]),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",M1,"-"))]}),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=>Fr(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(Ta).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"])])}}}),Hr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,n]of t)r[i]=n;return r},$1=Hr(P1,[["__scopeId","data-v-f8690ed7"]]),R1={class:"kong-ui-entities-certificates-form"},U1=Hr(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}=go({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",R1,[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(yo),{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(yo),{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"}}},L1={class:"kong-ui-ca-certificate-entity-config-card"},H1={key:0},F1=Hr(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",L1,[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(so),{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"]]),q1={class:"kong-ui-entities-ca-certificates-list"},K1={key:0},z1={key:1},G1={key:0},W1={key:1},J1={key:1},Y1=Hr(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}=go({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=Ff(i.config,w.value),{certificateDataCache:Ie,getCertificateData:Ce}=bt.useCertificate(),Ee=ee=>{re.value=ee,q.value=!0},Fr=()=>{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",q1,[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(Hf),{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",K1,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",G1,o.toDisplayString((Se=te==null?void 0:te.metadata)!=null&&Se.expiry?o.unref(s)(te.metadata.expiry):"-"),1)):(o.openBlock(),o.createElementBlock("span",W1,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",J1,"-"))]}),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(Ta).CACertificate,error:Z.value,title:o.unref(n)("ca-certificates.delete.title"),visible:q.value,onCancel:Fr,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"]]),Z1={class:"kong-ui-entities-ca-certificates-form"},Q1=Hr(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}=go({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",Z1,[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(yo),{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(yo),{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"]]),X1={class:"kong-ui-certificate-entity-config-card"},eb={key:0},tb=Hr(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",X1,[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(so),{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",eb,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=F1,Ve.CACertificateForm=Q1,Ve.CACertificateList=Y1,Ve.CertificateConfigCard=tb,Ve.CertificateForm=U1,Ve.CertificateList=$1,Object.defineProperty(Ve,Symbol.toStringTag,{value:"Module"})});