@kong-ui-public/entities-certificates 2.3.22 → 2.3.23
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.
|
@@ -7714,6 +7714,9 @@ class or {
|
|
|
7714
7714
|
return !1;
|
|
7715
7715
|
return !0;
|
|
7716
7716
|
}
|
|
7717
|
+
static isPrintableString(t) {
|
|
7718
|
+
return /^[A-Za-z0-9 '()+,-./:=?]*$/g.test(t);
|
|
7719
|
+
}
|
|
7717
7720
|
constructor(t, r = {}) {
|
|
7718
7721
|
this.extraNames = new If(), this.asn = new Fe();
|
|
7719
7722
|
for (const i in r)
|
|
@@ -7768,7 +7771,7 @@ class or {
|
|
|
7768
7771
|
else {
|
|
7769
7772
|
const f = /"(.*?[^\\])?"/.exec(a);
|
|
7770
7773
|
f && (a = f[1]), a = a.replace(/\\0a/ig, `
|
|
7771
|
-
`).replace(/\\0d/ig, "\r").replace(/\\0g/ig, " ").replace(/\\(.)/g, "$1"), s === this.getName("E") || s === this.getName("DC") ? h.value.ia5String = a : or.
|
|
7774
|
+
`).replace(/\\0d/ig, "\r").replace(/\\0g/ig, " ").replace(/\\(.)/g, "$1"), s === this.getName("E") || s === this.getName("DC") ? h.value.ia5String = a : or.isPrintableString(a) ? h.value.printableString = a : h.value.utf8String = a;
|
|
7772
7775
|
}
|
|
7773
7776
|
o === "+" ? r[r.length - 1].push(h) : r.push(new qr([h])), o = u;
|
|
7774
7777
|
}
|
|
@@ -111,8 +111,8 @@ ${t.join(`
|
|
|
111
111
|
* SOFTWARE.
|
|
112
112
|
*
|
|
113
113
|
*/const Qn="crypto.algorithm";class Mh{getAlgorithms(){return nt.resolveAll(Qn)}toAsnAlgorithm(t){({...t});for(const r of this.getAlgorithms()){const i=r.toAsnAlgorithm(t);if(i)return i}if(/^[0-9.]+$/.test(t.name)){const r=new H({algorithm:t.name});if("parameters"in t){const i=t;r.parameters=i.parameters}return r}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(t){for(const i of this.getAlgorithms()){const o=i.toWebAlgorithm(t);if(o)return o}return{name:t.algorithm,parameters:t.parameters}}}const Xn="crypto.algorithmProvider";nt.registerSingleton(Xn,Mh);var eo;const We="1.3.36.3.3.2.8.1.1",Su=`${We}.1`,xu=`${We}.2`,Au=`${We}.3`,Bu=`${We}.4`,Iu=`${We}.5`,Eu=`${We}.6`,Nu=`${We}.7`,Ou=`${We}.8`,_u=`${We}.9`,Tu=`${We}.10`,Vu=`${We}.11`,ju=`${We}.12`,Du=`${We}.13`,Mu=`${We}.14`,$u="brainpoolP160r1",Pu="brainpoolP160t1",Ru="brainpoolP192r1",Uu="brainpoolP192t1",Lu="brainpoolP224r1",Hu="brainpoolP224t1",Fu="brainpoolP256r1",qu="brainpoolP256t1",Ku="brainpoolP320r1",zu="brainpoolP320t1",Gu="brainpoolP384r1",Wu="brainpoolP384t1",Ju="brainpoolP512r1",Yu="brainpoolP512t1",ve="ECDSA";let ki=eo=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case ve.toLowerCase():if("hash"in t)switch((typeof t.hash=="string"?t.hash:t.hash.name).toLowerCase()){case"sha-1":return sh;case"sha-256":return ah;case"sha-384":return ch;case"sha-512":return lh}else if("namedCurve"in t){let r="";switch(t.namedCurve){case"P-256":r=Dl;break;case"K-256":r=eo.SECP256K1;break;case"P-384":r=Ml;break;case"P-521":r=$l;break;case $u:r=Su;break;case Pu:r=xu;break;case Ru:r=Au;break;case Uu:r=Bu;break;case Lu:r=Iu;break;case Hu:r=Eu;break;case Fu:r=Nu;break;case qu:r=Ou;break;case Ku:r=_u;break;case zu:r=Tu;break;case Gu:r=Vu;break;case Wu:r=ju;break;case Ju:r=Du;break;case Yu:r=Mu;break}if(r)return new H({algorithm:yi,parameters:q.serialize(new jr({namedCurve:r}))})}}return null}toWebAlgorithm(t){switch(t.algorithm){case Ps:return{name:ve,hash:{name:"SHA-1"}};case Rs:return{name:ve,hash:{name:"SHA-256"}};case Us:return{name:ve,hash:{name:"SHA-384"}};case Ls:return{name:ve,hash:{name:"SHA-512"}};case yi:{if(!t.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(q.parse(t.parameters,jr).namedCurve){case Dl:return{name:ve,namedCurve:"P-256"};case eo.SECP256K1:return{name:ve,namedCurve:"K-256"};case Ml:return{name:ve,namedCurve:"P-384"};case $l:return{name:ve,namedCurve:"P-521"};case Su:return{name:ve,namedCurve:$u};case xu:return{name:ve,namedCurve:Pu};case Au:return{name:ve,namedCurve:Ru};case Bu:return{name:ve,namedCurve:Uu};case Iu:return{name:ve,namedCurve:Lu};case Eu:return{name:ve,namedCurve:Hu};case Nu:return{name:ve,namedCurve:Fu};case Ou:return{name:ve,namedCurve:qu};case _u:return{name:ve,namedCurve:Ku};case Tu:return{name:ve,namedCurve:zu};case Vu:return{name:ve,namedCurve:Gu};case ju:return{name:ve,namedCurve:Wu};case Du:return{name:ve,namedCurve:Ju};case Mu:return{name:ve,namedCurve:Yu}}}}return null}};ki.SECP256K1="1.3.132.0.10",ki=eo=u([Qs()],ki),nt.registerSingleton(Qn,ki);const Zu=Symbol("name"),Qu=Symbol("value");class ue{constructor(t,r={},i=""){this[Zu]=t,this[Qu]=i;for(const o in r)this[o]=r[o]}}ue.NAME=Zu,ue.VALUE=Qu;class $h{static toTextObject(t){const r=new ue("Algorithm Identifier",{},Ut.toString(t.algorithm));if(t.parameters)switch(t.algorithm){case yi:{const i=new ki().toWebAlgorithm(t);i&&"namedCurve"in i?r["Named Curve"]=i.namedCurve:r.Parameters=t.parameters;break}default:r.Parameters=t.parameters}return r}}class Ut{static toString(t){const r=this.items[t];return r||t}}Ut.items={[Ul]:"sha1",[Ll]:"sha224",[Hl]:"sha256",[Fl]:"sha384",[ql]:"sha512",[Dr]:"rsaEncryption",[jn]:"sha1WithRSAEncryption",[yh]:"sha224WithRSAEncryption",[Hs]:"sha256WithRSAEncryption",[Dn]:"sha384WithRSAEncryption",[Mn]:"sha512WithRSAEncryption",[yi]:"ecPublicKey",[Ps]:"ecdsaWithSHA1",[jl]:"ecdsaWithSHA224",[Rs]:"ecdsaWithSHA256",[Us]:"ecdsaWithSHA384",[Ls]:"ecdsaWithSHA512",[Xp]:"TLS WWW server authentication",[eh]:"TLS WWW client authentication",[th]:"Code Signing",[rh]:"E-mail Protection",[ih]:"Time Stamping",[nh]:"OCSP Signing",[oh]:"Signed Data"};class cr{static serialize(t){return this.serializeObj(t).join(`
|
|
114
|
-
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if(P.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[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),o=P.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}cr.oidSerializer=Ut,cr.algorithmSerializer=$h;class Lt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=q.serialize(r),this.onInit(r)}else{const r=q.parse(t[0],t[1]);this.rawData=P.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?ec(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return q.toString(this.rawData);case"text":return cr.serialize(this.toTextObject());case"hex":return U.ToHex(this.rawData);case"base64":return U.ToBase64(this.rawData);case"base64url":return U.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new ue(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;P.isBufferSource(t[0])?r=P.toArrayBuffer(t[0]):r=q.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ae(P.toArrayBuffer(t[2]))})),super(r,lt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===wt.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}var Xu;class lr{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[Xu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(lr.DEFAULT,crypto)}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,r){return this.items.forEach(t,r)}has(t){return this.items.has(t)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(t=lr.DEFAULT){const r=this.items.get(t.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${t}'`);return r}set(t,r){if(typeof t=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),r)}else this.items.set(lr.DEFAULT,t);return this}}Xu=Symbol.toStringTag,lr.DEFAULT="default";const Xe=new lr,Ph=/^[0-2](?:\.[1-9][0-9]*)+$/;function Rh(e){return new RegExp(Ph).test(e)}class ed{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Rh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Je=new ed;Je.register("CN","2.5.4.3"),Je.register("L","2.5.4.7"),Je.register("ST","2.5.4.8"),Je.register("O","2.5.4.10"),Je.register("OU","2.5.4.11"),Je.register("C","2.5.4.6"),Je.register("DC","0.9.2342.19200300.100.1.25"),Je.register("E","1.2.840.113549.1.9.1"),Je.register("G","2.5.4.42"),Je.register("I","2.5.4.43"),Je.register("SN","2.5.4.4"),Je.register("T","2.5.4.12");function Uh(e,t){return`\\${U.ToHex(U.FromUtf8String(t)).toUpperCase()}`}function Lh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Uh)}class Ht{static isASCII(t){for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return!1;return!0}constructor(t,r={}){this.extraNames=new ed,this.asn=new Ie;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const o=r[i];this.extraNames.register(i,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof Ie?this.asn=t:P.isBufferSource(t)?this.asn=q.parse(t,Ie):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Je.findId(t),i=[];for(const o of this.asn)for(const s of o)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||Je.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,o=r.value.anyValue?`#${U.ToHex(r.value.anyValue)}`:Lh(r.value.toString());return`${i}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const o={};for(const s of i){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${U.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new Ie,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,c]=o;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),o[3]=l);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new Xr({type:a});if(c.charAt(0)==="#")y.value.anyValue=U.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
|
|
115
|
-
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Ht.
|
|
114
|
+
`)}static pad(t=0){return"".padStart(2*t," ")}static serializeObj(t,r=0){const i=[];let o=this.pad(r++),s="";const a=t[ue.VALUE];a&&(s=` ${a}`),i.push(`${o}${t[ue.NAME]}:${s}`),o=this.pad(r);for(const c in t){if(typeof c=="symbol")continue;const l=t[c],d=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")i.push(`${o}${d}${l}`);else if(l instanceof Date)i.push(`${o}${d}${l.toUTCString()}`);else if(Array.isArray(l))for(const y of l)y[ue.NAME]=c,i.push(...this.serializeObj(y,r));else if(l instanceof ue)l[ue.NAME]=c,i.push(...this.serializeObj(l,r));else if(P.isBufferSource(l))c?(i.push(`${o}${d}`),i.push(...this.serializeBufferSource(l,r+1))):i.push(...this.serializeBufferSource(l,r));else if("toTextObject"in l){const y=l.toTextObject();y[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),o=P.toUint8Array(t),s=[];for(let a=0;a<o.length;){const c=[];for(let l=0;l<16&&a<o.length;l++){l===8&&c.push("");const d=o[a++].toString(16).padStart(2,"0");c.push(d)}s.push(`${i}${c.join(" ")}`)}return s}static serializeAlgorithm(t){return this.algorithmSerializer.toTextObject(t)}}cr.oidSerializer=Ut,cr.algorithmSerializer=$h;class Lt{constructor(...t){if(t.length===1){const r=t[0];this.rawData=q.serialize(r),this.onInit(r)}else{const r=q.parse(t[0],t[1]);this.rawData=P.toArrayBuffer(t[0]),this.onInit(r)}}equal(t){return t instanceof Lt?ec(t.rawData,this.rawData):!1}toString(t="text"){switch(t){case"asn":return q.toString(this.rawData);case"text":return cr.serialize(this.toTextObject());case"hex":return U.ToHex(this.rawData);case"base64":return U.ToBase64(this.rawData);case"base64url":return U.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const t=this.toTextObjectEmpty();return t[""]=this.rawData,t}toTextObjectEmpty(t){return new ue(this.getTextName(),{},t)}}Lt.NAME="ASN";class wt extends Lt{constructor(...t){let r;P.isBufferSource(t[0])?r=P.toArrayBuffer(t[0]):r=q.serialize(new lt({extnID:t[0],critical:t[1],extnValue:new ae(P.toArrayBuffer(t[2]))})),super(r,lt)}onInit(t){this.type=t.extnID,this.critical=t.critical,this.value=t.extnValue.buffer}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.value,t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty(this.critical?"critical":void 0);return t[ue.NAME]===wt.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}var Xu;class lr{static isCryptoKeyPair(t){return t&&t.privateKey&&t.publicKey}static isCryptoKey(t){return t&&t.usages&&t.type&&t.algorithm&&t.extractable!==void 0}constructor(){this.items=new Map,this[Xu]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"&&this.set(lr.DEFAULT,crypto)}clear(){this.items.clear()}delete(t){return this.items.delete(t)}forEach(t,r){return this.items.forEach(t,r)}has(t){return this.items.has(t)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(t=lr.DEFAULT){const r=this.items.get(t.toLowerCase());if(!r)throw new Error(`Cannot get Crypto by name '${t}'`);return r}set(t,r){if(typeof t=="string"){if(!r)throw new TypeError("Argument 'value' is required");this.items.set(t.toLowerCase(),r)}else this.items.set(lr.DEFAULT,t);return this}}Xu=Symbol.toStringTag,lr.DEFAULT="default";const Xe=new lr,Ph=/^[0-2](?:\.[1-9][0-9]*)+$/;function Rh(e){return new RegExp(Ph).test(e)}class ed{constructor(t={}){this.items={};for(const r in t)this.register(r,t[r])}get(t){return this.items[t]||null}findId(t){return Rh(t)?t:this.get(t)}register(t,r){this.items[t]=r,this.items[r]=t}}const Je=new ed;Je.register("CN","2.5.4.3"),Je.register("L","2.5.4.7"),Je.register("ST","2.5.4.8"),Je.register("O","2.5.4.10"),Je.register("OU","2.5.4.11"),Je.register("C","2.5.4.6"),Je.register("DC","0.9.2342.19200300.100.1.25"),Je.register("E","1.2.840.113549.1.9.1"),Je.register("G","2.5.4.42"),Je.register("I","2.5.4.43"),Je.register("SN","2.5.4.4"),Je.register("T","2.5.4.12");function Uh(e,t){return`\\${U.ToHex(U.FromUtf8String(t)).toUpperCase()}`}function Lh(e){return e.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Uh)}class Ht{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 ed,this.asn=new Ie;for(const i in r)if(Object.prototype.hasOwnProperty.call(r,i)){const o=r[i];this.extraNames.register(i,o)}typeof t=="string"?this.asn=this.fromString(t):t instanceof Ie?this.asn=t:P.isBufferSource(t)?this.asn=q.parse(t,Ie):this.asn=this.fromJSON(t)}getField(t){const r=this.extraNames.findId(t)||Je.findId(t),i=[];for(const o of this.asn)for(const s of o)s.type===r&&i.push(s.value.toString());return i}getName(t){return this.extraNames.get(t)||Je.get(t)}toString(){return this.asn.map(t=>t.map(r=>{const i=this.getName(r.type)||r.type,o=r.value.anyValue?`#${U.ToHex(r.value.anyValue)}`:Lh(r.value.toString());return`${i}=${o}`}).join("+")).join(", ")}toJSON(){var t;const r=[];for(const i of this.asn){const o={};for(const s of i){const a=this.getName(s.type)||s.type;(t=o[a])!==null&&t!==void 0||(o[a]=[]),o[a].push(s.value.anyValue?`#${U.ToHex(s.value.anyValue)}`:s.value.toString())}r.push(o)}return r}fromString(t){const r=new Ie,i=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let o=null,s=",";for(;o=i.exec(`${t},`);){let[,a,c]=o;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),o[3]=l);const d=o[3];if(/[\d.]+/.test(a)||(a=this.getName(a)||""),!a)throw new Error(`Cannot get OID for name type '${a}'`);const y=new Xr({type:a});if(c.charAt(0)==="#")y.value.anyValue=U.FromHex(c.slice(1));else{const p=/"(.*?[^\\])?"/.exec(c);p&&(c=p[1]),c=c.replace(/\\0a/ig,`
|
|
115
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1"),a===this.getName("E")||a===this.getName("DC")?y.value.ia5String=c:Ht.isPrintableString(c)?y.value.printableString=c:y.value.utf8String=c}s==="+"?r[r.length-1].push(y):r.push(new br([y])),s=d}return r}fromJSON(t){const r=new Ie;for(const i of t){const o=new br;for(const s in i){let a=s;if(/[\d.]+/.test(s)||(a=this.getName(s)||""),!a)throw new Error(`Cannot get OID for name type '${s}'`);const c=i[s];for(const l of c){const d=new Xr({type:a});if(typeof l=="object")for(const y in l)switch(y){case"ia5String":d.value.ia5String=l[y];break;case"utf8String":d.value.utf8String=l[y];break;case"universalString":d.value.universalString=l[y];break;case"bmpString":d.value.bmpString=l[y];break;case"printableString":d.value.printableString=l[y];break}else l[0]==="#"?d.value.anyValue=U.FromHex(l.slice(1)):a===this.getName("E")||a===this.getName("DC")?d.value.ia5String=l:d.value.printableString=l;o.push(d)}}r.push(o)}return r}toArrayBuffer(){return q.serialize(this.asn)}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.toArrayBuffer())}}const td="Cannot initialize GeneralName from ASN.1 data.",rd=`${td} Unsupported string format in use.`,Hh=`${td} Value doesn't match to GUID regular expression.`,id=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,nd="1.3.6.1.4.1.311.25.1",od="1.3.6.1.4.1.311.20.2.3",ma="dns",ba="dn",wa="email",va="ip",ka="url",Ca="guid",Sa="upn",to="id";class sd extends Lt{constructor(...t){let r;if(t.length===2)switch(t[0]){case ba:{const i=new Ht(t[1]).toArrayBuffer(),o=q.parse(i,Ie);r=new ie({directoryName:o});break}case ma:r=new ie({dNSName:t[1]});break;case wa:r=new ie({rfc822Name:t[1]});break;case Ca:{const i=new RegExp(id,"i").exec(t[1]);if(!i)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const o=i.slice(1).map((s,a)=>a<3?U.ToHex(new Uint8Array(U.FromHex(s)).reverse()):s).join("");r=new ie({otherName:new ei({typeId:nd,value:q.serialize(new ae(U.FromHex(o)))})});break}case va:r=new ie({iPAddress:t[1]});break;case to:r=new ie({registeredID:t[1]});break;case Sa:{r=new ie({otherName:new ei({typeId:od,value:q.serialize(rl.toASN(t[1]))})});break}case ka:r=new ie({uniformResourceIdentifier:t[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else P.isBufferSource(t[0])?r=q.parse(t[0],ie):r=t[0];super(r)}onInit(t){if(t.dNSName!=null)this.type=ma,this.value=t.dNSName;else if(t.rfc822Name!=null)this.type=wa,this.value=t.rfc822Name;else if(t.iPAddress!=null)this.type=va,this.value=t.iPAddress;else if(t.uniformResourceIdentifier!=null)this.type=ka,this.value=t.uniformResourceIdentifier;else if(t.registeredID!=null)this.type=to,this.value=t.registeredID;else if(t.directoryName!=null)this.type=ba,this.value=new Ht(t.directoryName).toString();else if(t.otherName!=null)if(t.otherName.typeId===nd){this.type=Ca;const r=q.parse(t.otherName.value,ae),i=new RegExp(id,"i").exec(U.ToHex(r));if(!i)throw new Error(Hh);this.value=i.slice(1).map((o,s)=>s<3?U.ToHex(new Uint8Array(U.FromHex(o)).reverse()):o).join("-")}else if(t.otherName.typeId===od)this.type=Sa,this.value=q.parse(t.otherName.value,je).toString();else throw new Error(rd);else throw new Error(rd)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let t;switch(this.type){case ba:case ma:case Ca:case va:case to:case Sa:case ka:t=this.type.toUpperCase();break;case wa:t="Email";break;default:throw new Error("Unsupported GeneralName type")}let r=this.value;return this.type===to&&(r=Ut.toString(r)),new ue(t,void 0,r)}}class Ci extends Lt{constructor(t){let r;if(t instanceof He)r=t;else if(Array.isArray(t)){const i=[];for(const o of t)if(o instanceof ie)i.push(o);else{const s=q.parse(new sd(o.type,o.value).rawData,ie);i.push(s)}r=new He(i)}else if(P.isBufferSource(t))r=q.parse(t,He);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(r)}onInit(t){const r=[];for(const i of t){let o=null;try{o=new sd(i)}catch{continue}r.push(o)}this.items=r}toJSON(){return this.items.map(t=>t.toJSON())}toTextObject(){const t=super.toTextObjectEmpty();for(const r of this.items){const i=r.toTextObject();let o=t[i[ue.NAME]];Array.isArray(o)||(o=[],t[i[ue.NAME]]=o),o.push(i)}return t}}Ci.NAME="GeneralNames";const Si="-{5}",xi="\\n",Fh=`[^${xi}]+`,qh=`${Si}BEGIN (${Fh}(?=${Si}))${Si}`,Kh=`${Si}END \\1${Si}`,Pr="\\n",zh=`[^:${xi}]+`,Gh=`(?:[^${xi}]+${Pr}(?: +[^${xi}]+${Pr})*)`,Wh=`(?:[a-zA-Z0-9=+/]+${Pr})+`,ad=`${qh}${Pr}(?:((?:${zh}: ${Gh})+))?${Pr}?(${Wh})${Kh}`;class et{static isPem(t){return typeof t=="string"&&new RegExp(ad,"g").test(t)}static decodeWithHeaders(t){t=t.replace(/\r/g,"");const r=new RegExp(ad,"g"),i=[];let o=null;for(;o=r.exec(t);){const s=o[3].replace(new RegExp(`[${xi}]+`,"g"),""),a={type:o[1],headers:[],rawData:U.FromBase64(s)},c=o[2];if(c){const l=c.split(new RegExp(Pr,"g"));let d=null;for(const y of l){const[p,E]=y.split(/:(.*)/);if(E===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:E.trim()}}d&&a.headers.push(d)}i.push(a)}return i}static decode(t){return this.decodeWithHeaders(t).map(i=>i.rawData)}static decodeFirst(t){const r=this.decode(t);if(!r.length)throw new RangeError("PEM string doesn't contain any objects");return r[0]}static encode(t,r){if(Array.isArray(t)){const i=new Array;return r?t.forEach(o=>{if(!P.isBufferSource(o))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");i.push(this.encodeStruct({type:r,rawData:P.toArrayBuffer(o)}))}):t.forEach(o=>{if(!("type"in o))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");i.push(this.encodeStruct(o))}),i.join(`
|
|
116
116
|
`)}else{if(!r)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:r,rawData:P.toArrayBuffer(t)})}}static encodeStruct(t){var r;const i=t.type.toLocaleUpperCase(),o=[];if(o.push(`-----BEGIN ${i}-----`),!((r=t.headers)===null||r===void 0)&&r.length){for(const d of t.headers)o.push(`${d.key}: ${d.value}`);o.push("")}const s=U.ToBase64(t.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return o.push(...l),o.push(`-----END ${i}-----`),o.join(`
|
|
117
117
|
`)}}et.CertificateTag="CERTIFICATE",et.CrlTag="CRL",et.CertificateRequestTag="CERTIFICATE REQUEST",et.PublicKeyTag="PUBLIC KEY",et.PrivateKeyTag="PRIVATE KEY";class Vt extends Lt{static isAsnEncoded(t){return P.isBufferSource(t)||typeof t=="string"}static toArrayBuffer(t){if(typeof t=="string"){if(et.isPem(t))return et.decode(t)[0];if(U.isHex(t))return U.FromHex(t);if(U.isBase64(t))return U.FromBase64(t);if(U.isBase64Url(t))return U.FromBase64Url(t);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const r=U.ToBinary(t);return et.isPem(r)?et.decode(r)[0]:U.isHex(r)?U.FromHex(r):U.isBase64(r)?U.FromBase64(r):U.isBase64Url(r)?U.FromBase64Url(r):P.toArrayBuffer(t)}}constructor(...t){Vt.isAsnEncoded(t[0])?super(Vt.toArrayBuffer(t[0]),t[1]):super(t[0])}toString(t="pem"){switch(t){case"pem":return et.encode(this.rawData,this.tag);default:return super.toString(t)}}}class ur extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Ot):super(t),this.tag=et.PublicKeyTag}async export(...t){let r,i=["verify"],o={hash:"SHA-256",...this.algorithm};return t.length>1?(o=t[0]||o,i=t[1]||i,r=t[2]||Xe.get()):r=t[0]||Xe.get(),r.subtle.importKey("spki",this.rawData,o,!0,i)}onInit(t){const r=nt.resolve(Xn),i=this.algorithm=r.toWebAlgorithm(t.algorithm);switch(t.algorithm.algorithm){case Dr:{const o=q.parse(t.subjectPublicKey,zs),s=P.toUint8Array(o.modulus);i.publicExponent=P.toUint8Array(o.publicExponent),i.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3;break}}}async getThumbprint(...t){var r;let i,o="SHA-1";return t.length>=1&&!(!((r=t[0])===null||r===void 0)&&r.subtle)?(o=t[0]||o,i=t[1]||Xe.get()):i=t[0]||Xe.get(),await i.subtle.digest(o,this.rawData)}async getKeyIdentifier(t){t||(t=Xe.get());const r=q.parse(this.rawData,Ot);return await t.subtle.digest("SHA-1",r.subjectPublicKey)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.parse(this.rawData,Ot);switch(t.Algorithm=cr.serializeAlgorithm(r.algorithm),r.algorithm.algorithm){case yi:t["EC Point"]=r.subjectPublicKey;break;case Dr:default:t["Raw Data"]=r.subjectPublicKey}return t}}class vt{static register(t,r){this.items.set(t,r)}static create(t){const r=new wt(t),i=this.items.get(r.type);return i?new i(t):r}}vt.items=new Map;const ro="crypto.signatureFormatter";class Jh{toAsnSignature(t,r){return P.toArrayBuffer(r)}toWebSignature(t,r){return P.toArrayBuffer(r)}}class io extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,Cr):super(t),this.tag=et.CertificateTag}onInit(t){const r=t.tbsCertificate;this.tbs=q.serialize(r),this.serialNumber=U.ToHex(r.serialNumber),this.subjectName=new Ht(r.subject),this.subject=new Ht(r.subject).toString(),this.issuerName=new Ht(r.issuer),this.issuer=this.issuerName.toString();const i=nt.resolve(Xn);this.signatureAlgorithm=i.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signatureValue;const o=r.validity.notBefore.utcTime||r.validity.notBefore.generalTime;if(!o)throw new Error("Cannot get 'notBefore' value");this.notBefore=o;const s=r.validity.notAfter.utcTime||r.validity.notAfter.generalTime;if(!s)throw new Error("Cannot get 'notAfter' value");this.notAfter=s,this.extensions=[],r.extensions&&(this.extensions=r.extensions.map(a=>vt.create(q.serialize(a)))),this.publicKey=new ur(r.subjectPublicKeyInfo)}getExtension(t){for(const r of this.extensions)if(typeof t=="string"){if(r.type===t)return r}else if(r instanceof t)return r;return null}getExtensions(t){return this.extensions.filter(r=>typeof t=="string"?r.type===t:r instanceof t)}async verify(t={},r=Xe.get()){let i,o;const s=t.publicKey;try{if(!s)i={...this.publicKey.algorithm,...this.signatureAlgorithm},o=await this.publicKey.export(i,["verify"],r);else if("publicKey"in s)i={...s.publicKey.algorithm,...this.signatureAlgorithm},o=await s.publicKey.export(i,["verify"],r);else if(s instanceof ur)i={...s.algorithm,...this.signatureAlgorithm},o=await s.export(i,["verify"],r);else if(P.isBufferSource(s)){const d=new ur(s);i={...d.algorithm,...this.signatureAlgorithm},o=await d.export(i,["verify"],r)}else i={...s.algorithm,...this.signatureAlgorithm},o=s}catch{return!1}const a=nt.resolveAll(ro).reverse();let c=null;for(const d of a)if(c=d.toWebSignature(i,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await r.subtle.verify(this.signatureAlgorithm,o,c,this.tbs);if(t.signatureOnly)return l;{const y=(t.date||new Date).getTime();return l&&this.notBefore.getTime()<y&&y<this.notAfter.getTime()}}async getThumbprint(...t){let r,i="SHA-1";return t[0]&&(t[0].subtle?r=t[0]:(i=t[0]||i,r=t[1])),r??(r=Xe.get()),await r.subtle.digest(i,this.rawData)}async isSelfSigned(t=Xe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},t)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.parse(this.rawData,Cr),i=r.tbsCertificate,o=new ue("",{Version:`${kr[i.version]} (${i.version})`,"Serial Number":i.serialNumber,"Signature Algorithm":cr.serializeAlgorithm(i.signature),Issuer:this.issuer,Validity:new ue("",{"Not Before":i.validity.notBefore.getTime(),"Not After":i.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(i.issuerUniqueID&&(o["Issuer Unique ID"]=i.issuerUniqueID),i.subjectUniqueID&&(o["Subject Unique ID"]=i.subjectUniqueID),this.extensions.length){const s=new ue("");for(const a of this.extensions){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Extensions=s}return t.Data=o,t.Signature=new ue("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signatureValue}),t}}io.NAME="Certificate";class Ai extends wt{static async create(t,r=!1,i=Xe.get()){if(t instanceof io||lr.isCryptoKey(t)){const o=t instanceof io?await t.publicKey.export(i):t,s=await i.subtle.exportKey("spki",o),c=await new ur(s).getKeyIdentifier(i);return new Ai(U.ToHex(c),r)}else return new Ai(t,r)}constructor(...t){if(P.isBufferSource(t[0]))super(t[0]);else if(typeof t[0]=="string"){const r=new tr({keyIdentifier:new Lo(U.FromHex(t[0]))});super(Uo,t[1],q.serialize(r))}else{const r=t[0],i=r.name instanceof Ci?q.parse(r.name.rawData,He):r.name,o=new tr({authorityCertIssuer:i,authorityCertSerialNumber:U.FromHex(r.serialNumber)});super(Uo,t[1],q.serialize(o))}}onInit(t){super.onInit(t);const r=q.parse(t.extnValue,tr);r.keyIdentifier&&(this.keyId=U.ToHex(r.keyIdentifier)),r.authorityCertIssuer&&r.authorityCertSerialNumber&&(this.certId={name:r.authorityCertIssuer,serialNumber:U.ToHex(r.authorityCertSerialNumber)})}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,tr);return r.authorityCertIssuer&&(t["Authority Issuer"]=new Ci(r.authorityCertIssuer).toTextObject()),r.authorityCertSerialNumber&&(t["Authority Serial Number"]=r.authorityCertSerialNumber),r.keyIdentifier&&(t[""]=r.keyIdentifier),t}}Ai.NAME="Authority Key Identifier";class cd extends wt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,rn);this.ca=r.cA,this.pathLength=r.pathLenConstraint}else{const r=new rn({cA:t[0],pathLenConstraint:t[1]});super(ll,t[2],q.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}}cd.NAME="Basic Constraints";var ld;(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"})(ld||(ld={}));class ud extends wt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,cn);this.usages=r.map(i=>i)}else{const r=new cn(t[0]);super(yl,t[1],q.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[""]=this.usages.map(r=>Ut.toString(r)).join(", "),t}}ud.NAME="Extended Key Usages";var xa;(function(e){e[e.digitalSignature=1]="digitalSignature",e[e.nonRepudiation=2]="nonRepudiation",e[e.keyEncipherment=4]="keyEncipherment",e[e.dataEncipherment=8]="dataEncipherment",e[e.keyAgreement=16]="keyAgreement",e[e.keyCertSign=32]="keyCertSign",e[e.cRLSign=64]="cRLSign",e[e.encipherOnly=128]="encipherOnly",e[e.decipherOnly=256]="decipherOnly"})(xa||(xa={}));class Aa extends wt{constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,rs);this.usages=r.toNumber()}else{const r=new rs(t[0]);super(ml,t[1],q.serialize(r)),this.usages=t[0]}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,rs);return t[""]=r.toJSON().join(", "),t}}Aa.NAME="Key Usages";class no extends wt{static async create(t,r=!1,i=Xe.get()){let o;t instanceof ur?o=t.rawData:"publicKey"in t?o=t.publicKey.rawData:P.isBufferSource(t)?o=t:o=await i.subtle.exportKey("spki",t);const a=await new ur(o).getKeyIdentifier(i);return new no(U.ToHex(a),r)}constructor(...t){if(P.isBufferSource(t[0])){super(t[0]);const r=q.parse(this.value,Pt);this.keyId=U.ToHex(r)}else{const r=typeof t[0]=="string"?U.FromHex(t[0]):t[0],i=new Pt(r);super(Sl,t[1],q.serialize(i)),this.keyId=U.ToHex(r)}}toTextObject(){const t=this.toTextObjectWithoutValue(),r=q.parse(this.value,Pt);return t[""]=r,t}}no.NAME="Subject Key Identifier";class Ba extends wt{constructor(...t){P.isBufferSource(t[0])?super(t[0]):super(kl,t[1],new Ci(t[0]||[]).rawData)}onInit(t){super.onInit(t);const r=q.parse(t.extnValue,as);this.names=new Ci(r)}toTextObject(){const t=this.toTextObjectWithoutValue(),r=this.names.toTextObject();for(const i in r)t[i]=r[i];return t}}Ba.NAME="Subject Alternative Name";class dd extends wt{constructor(...t){var r;if(P.isBufferSource(t[0])){super(t[0]);const i=q.parse(this.value,sn);this.policies=i.map(o=>o.policyIdentifier)}else{const i=t[0],o=(r=t[1])!==null&&r!==void 0?r:!1,s=new sn(i.map(a=>new on({policyIdentifier:a})));super(dl,o,q.serialize(s)),this.policies=i}}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Policy=this.policies.map(r=>new ue("",{},Ut.toString(r))),t}}dd.NAME="Certificate Policies",vt.register(dl,dd);class Rr extends Lt{constructor(...t){let r;if(P.isBufferSource(t[0]))r=P.toArrayBuffer(t[0]);else{const i=t[0],o=Array.isArray(t[1])?t[1].map(s=>P.toArrayBuffer(s)):[];r=q.serialize(new Nt({type:i,values:o}))}super(r,Nt)}onInit(t){this.type=t.type,this.values=t.values}toTextObject(){const t=this.toTextObjectWithoutValue();return t.Value=this.values.map(r=>new ue("",{"":r})),t}toTextObjectWithoutValue(){const t=this.toTextObjectEmpty();return t[ue.NAME]===Rr.NAME&&(t[ue.NAME]=Ut.toString(this.type)),t}}Rr.NAME="Attribute";class fd extends Rr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=new Yn({printableString:t[0]});super(lu,[q.serialize(i)])}(r=this.password)!==null&&r!==void 0||(this.password="")}onInit(t){if(super.onInit(t),this.values[0]){const r=q.parse(this.values[0],Yn);this.password=r.toString()}}toTextObject(){const t=this.toTextObjectWithoutValue();return t[ue.VALUE]=this.password,t}}fd.NAME="Challenge Password";class Ia extends Rr{constructor(...t){var r;if(P.isBufferSource(t[0]))super(t[0]);else{const i=t[0],o=new rr;for(const s of i)o.push(q.parse(s.rawData,lt));super(ca,[q.serialize(o)])}(r=this.items)!==null&&r!==void 0||(this.items=[])}onInit(t){if(super.onInit(t),this.values[0]){const r=q.parse(this.values[0],rr);this.items=r.map(i=>vt.create(q.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}}Ia.NAME="Extensions";class oo{static register(t,r){this.items.set(t,r)}static create(t){const r=new Rr(t),i=this.items.get(r.type);return i?new i(t):r}}oo.items=new Map;let Ea=class{toAsnAlgorithm(t){switch(t.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in t){let r;if(typeof t.hash=="string")r=t.hash;else if(t.hash&&typeof t.hash=="object"&&"name"in t.hash&&typeof t.hash.name=="string")r=t.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(r.toLowerCase()){case"sha-1":return new H({algorithm:jn,parameters:null});case"sha-256":return new H({algorithm:Hs,parameters:null});case"sha-384":return new H({algorithm:Dn,parameters:null});case"sha-512":return new H({algorithm:Mn,parameters:null})}}else return new H({algorithm:Dr,parameters:null})}return null}toWebAlgorithm(t){switch(t.algorithm){case Dr:return{name:"RSASSA-PKCS1-v1_5"};case jn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Hs:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Dn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Mn:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}}}return null}};Ea=u([Qs()],Ea),nt.registerSingleton(Qn,Ea);class ot{addPadding(t,r){const i=P.toUint8Array(r),o=new Uint8Array(t);return o.set(i,t-i.length),o}removePadding(t,r=!1){let i=P.toUint8Array(t);for(let o=0;o<i.length;o++)if(i[o]){i=i.slice(o);break}if(r&&i[0]>127){const o=new Uint8Array(i.length+1);return o.set(i,1),o.buffer}return i.buffer}toAsnSignature(t,r){if(t.name==="ECDSA"){const i=t.namedCurve,o=ot.namedCurveSize.get(i)||ot.defaultNamedCurveSize,s=new Vn,a=P.toUint8Array(r);return s.r=this.removePadding(a.slice(0,o),!0),s.s=this.removePadding(a.slice(o,o+o),!0),q.serialize(s)}return null}toWebSignature(t,r){if(t.name==="ECDSA"){const i=q.parse(r,Vn),o=t.namedCurve,s=ot.namedCurveSize.get(o)||ot.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(i.r)),c=this.addPadding(s,this.removePadding(i.s));return dp(a,c)}return null}}ot.namedCurveSize=new Map,ot.defaultNamedCurveSize=32;const pd="1.3.101.110",hd="1.3.101.111",yd="1.3.101.112",gd="1.3.101.113";let Na=class{toAsnAlgorithm(t){let r=null;switch(t.name.toLowerCase()){case"eddsa":switch(t.namedCurve.toLowerCase()){case"ed25519":r=yd;break;case"ed448":r=gd;break}break;case"ecdh-es":switch(t.namedCurve.toLowerCase()){case"x25519":r=pd;break;case"x448":r=hd;break}}return r?new H({algorithm:r}):null}toWebAlgorithm(t){switch(t.algorithm){case yd:return{name:"EdDSA",namedCurve:"Ed25519"};case gd:return{name:"EdDSA",namedCurve:"Ed448"};case pd:return{name:"ECDH-ES",namedCurve:"X25519"};case hd:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Na=u([Qs()],Na),nt.registerSingleton(Qn,Na);class Yh extends Vt{constructor(t){Vt.isAsnEncoded(t)?super(t,vi):super(t),this.tag=et.CertificateRequestTag}onInit(t){this.tbs=q.serialize(t.certificationRequestInfo),this.publicKey=new ur(t.certificationRequestInfo.subjectPKInfo);const r=nt.resolve(Xn);this.signatureAlgorithm=r.toWebAlgorithm(t.signatureAlgorithm),this.signature=t.signature,this.attributes=t.certificationRequestInfo.attributes.map(o=>oo.create(q.serialize(o)));const i=this.getAttribute(ca);this.extensions=[],i instanceof Ia&&(this.extensions=i.items),this.subjectName=new Ht(t.certificationRequestInfo.subject),this.subject=this.subjectName.toString()}getAttribute(t){for(const r of this.attributes)if(r.type===t)return r;return null}getAttributes(t){return this.attributes.filter(r=>r.type===t)}getExtension(t){for(const r of this.extensions)if(r.type===t)return r;return null}getExtensions(t){return this.extensions.filter(r=>r.type===t)}async verify(t=Xe.get()){const r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],t),o=nt.resolveAll(ro).reverse();let s=null;for(const c of o)if(s=c.toWebSignature(r,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await t.subtle.verify(this.signatureAlgorithm,i,s,this.tbs)}toTextObject(){const t=this.toTextObjectEmpty(),r=q.parse(this.rawData,vi),i=r.certificationRequestInfo,o=new ue("",{Version:`${kr[i.version]} (${i.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new ue("");for(const a of this.attributes){const c=a.toTextObject();s[c[ue.NAME]]=c}o.Attributes=s}return t.Data=o,t.Signature=new ue("",{Algorithm:cr.serializeAlgorithm(r.signatureAlgorithm),"":r.signature}),t}}Yh.NAME="PKCS#10 Certificate Request";var md;(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"})(md||(md={})),vt.register(ll,cd),vt.register(yl,ud),vt.register(ml,Aa),vt.register(Sl,no),vt.register(Uo,Ai),vt.register(kl,Ba),oo.register(lu,fd),oo.register(ca,Ia),nt.registerSingleton(ro,Jh),nt.registerSingleton(ro,ot),ot.namedCurveSize.set("P-256",32),ot.namedCurveSize.set("K-256",32),ot.namedCurveSize.set("P-384",48),ot.namedCurveSize.set("P-521",66);function bd(){return{parseMetaCertificateData:t=>{if(/{vault:\/\/.*}/g.test(t))throw new Error("not a X.509 certificate");const r=new io(t),i={subject:r.subjectName.toString(),issuer:r.issuer,notAfter:r.notAfter};for(const o of r.extensions)if(o instanceof Ba){const s=o.names.toJSON(),c=Object.entries(s).map(l=>({type:l[1].type,value:l[1].value})).reduce((l,d)=>{const y=d.type,p=l[y]??[];return{...l,[y]:[...p,d.value]}},{});for(const l in c)i.subjectAltName=`${l}=${c[l].join(", ")}`}else if(o instanceof Aa){const s=Object.values(xa),a=Array(s.length/2).fill(null).reduce((c,l,d)=>{const y=s[s.length/2+d];if(o.usages&y){const p=s[d];c.push(p)}return c},[]);i.keyUsage=a}return i}}}function Zh(){const e=bd(),t=n.ref({}),r=o=>{if(!(o.id in t.value))try{t.value[o.id]=e.parseMetaCertificateData(o.cert)}catch{t.value[o.id]=void 0}return t.value[o.id]};return{certificateDataCache:t,getCertificateData:o=>{const s=r(o);return{schemaIssuer:(s==null?void 0:s.issuer)||"",schemaSubject:(s==null?void 0:s.subject)||"",schemaExpiry:(s==null?void 0:s.notAfter)instanceof Date?s.notAfter.getTime()/1e3:0,schemaSanNames:(s==null?void 0:s.subjectAltName)||"",schemaKeyUsages:(s==null?void 0:s.keyUsage)||[]}}}}const Qh={certificates:{title:"Certificates",list:{toolbar_actions:{new_certificate:"New Certificate"},table_headers:{subject:"Subject",expiry:"Expiry",san:"SAN",cert:"Cert",tags:"Tags",issuer:"Issuer",snis:"SNIs"},empty_state:{title:"Configure a New Certificate",description:"Certificates handle SSL/TLS termination for encrypted requests."}},form:{sections:{ssl:{title:"SSL Key Pair",description:"The PEM-encoded public certificate chain and private key of the SSL key pair and the alternate."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate chain of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key:{label:"Key",tooltip:"PEM-encoded private key of the SSL key pair. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},cert_alt:{label:"Cert Alt",tooltip:"PEM-encoded public certificate chain of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},key_alt:{label:"Key Alt",tooltip:"PEM-encoded private key of the alternate SSL key pair. This should only be set if you have both RSA and ECDSA types of certificate available and would like Kong to prefer serving using ECDSA certs when client advertises support for it. This field is {emphasis}, which means it can be securely stored as a secret in a vault. References must follow a specific format.",emphasis:"referenceable"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",addSni:"Add to New SNI",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"Certificates could not be retrieved",delete:"The certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},"ca-certificates":{title:"CA Certificates",list:{toolbar_actions:{new_ca_certificate:"New CA Certificate"},table_headers:{issuer:"Issuer",expiry:"Expiry",tags:"Tags"},empty_state:{title:"Configure a New CA Certificate",description:"CA certificates validate client or server certificates."}},form:{sections:{cert:{title:"Public Certificate",description:"The PEM-encoded public certificate of the CA and it’s SHA256 hex digest."},general:{title:"General Information",description:"General information will help identify and manage this key."}},fields:{cert:{label:"Cert",tooltip:"PEM-encoded public certificate of the CA."},cert_digest:{label:"Cert Digest",tooltip:"SHA256 hex digest of the public certificate"},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings for grouping and filtering, separated by commas."}}},actions:{create:"New CA Certificate",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",clear:"Clear",view:"View Details"},search:{placeholder:"Filter by exact ID"},delete:{title:"Delete a CA Certificate",description:"Your organization's original certificate {bolded-text}.",boldedText:"will not be affected",description2:"This action cannot be reversed so make sure to check the certificate usage before deleting."},errors:{general:"CA Certificates could not be retrieved",delete:"The CA Certificate could not be deleted at this time",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"}},general:{"key-usages":{KEY_USAGE_TYPE_KEY_CERT_SIGN:"keyCertSign",KEY_USAGE_TYPE_CRL_SIGN:"cRLSign",KEY_USAGE_TYPE_ENCIPHER_ONLY:"encipherOnly",KEY_USAGE_TYPE_DIGITAL_SIGNATURE:"digitalSignature",KEY_USAGE_TYPE_KEY_ENCIPHERMENT:"keyEncipherment",KEY_USAGE_TYPE_DATA_ENCIPHERMENT:"dataEncipherment",KEY_USAGE_TYPE_KEY_AGREEMENT:"keyAgreement",KEY_USAGE_TYPE_CONTENT_COMMITMENT:"nonRepudiation"}}};function Xh(){const e=pr.createI18n("en-us",Qh);return{i18n:e,i18nT:pr.i18nTComponent(e)}}const kt={useCertificate:Zh,useI18n:Xh,useX509:bd},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"}}},ey={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},ty="Copy to clipboard",ry={message:ey,iconTitle:ty},iy="kong-ui-copy-uuid-notify",wd="24px",ny=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},oy=e=>(n.pushScopeId("data-v-13f41aa3"),e=e(),n.popScopeId(),e),sy=["aria-hidden"],ay={key:0,"data-testid":"kui-icon-svg-title"},cy=oy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),ly=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:wd,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return wd}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",ay,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),cy],8,sy))]),_:1},8,["aria-hidden","style"]))}}),uy=ny(ly,[["__scopeId","data-v-13f41aa3"]]),dy="16px",fy={class:"kong-ui-copy-uuid"},py=["onClick"],vd=15,hy=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",ry),i=e,o=t,s=i.notify||n.inject(iy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var w;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(w=i.uuid)==null?void 0:w.substring(0,5)}`:i.uuid}),p=w=>{l.value=w,setTimeout(()=>{l.value=i.tooltip},1800)},E=w=>{var h,g;if(!w(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const v=((h=i.uuid)==null?void 0:h.length)>vd,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,vd))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(w,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",fy,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(g,null,{default:n.withCtx(({copyToClipboard:v})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>E(v),["stop"])},[n.createVNode(n.unref(uy),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(dy),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,py)]),_:1})]),_:1},16))])}}}),yy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},gy=yy(hy,[["__scopeId","data-v-0c07874b"]]);var Oa=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(Oa||{}),dr=(e=>(e.Edit="edit",e.Create="create",e))(dr||{}),Ft=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(Ft||{}),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||{}),pe=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(pe||{});function my(){return{getAxiosInstance:(e={})=>{try{const t=n.inject("get-axios-instance");return typeof t=="function"?t(e):Za.create({withCredentials:!0,timeout:3e4,...e})}catch(t){return console.warn("getAxiosInstance:",t.message||t),Za.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 by(){return{debounce:(e,t)=>{let r;return(...i)=>{clearTimeout(r),r=window==null?void 0:window.setTimeout(()=>{e(...i)},t)}}}}const _a="khcp-user-table-preferences",wy={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function vy(){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(_a));return!r||!Object.keys(r).length?new Map:new Map(Object.entries(r))};return{setTablePreferences:(r,i)=>{try{const o=t();o.set(r,i),localStorage.setItem(_a,JSON.stringify(Object.fromEntries(o.entries())))}catch(o){console.error("useTablePreferences(setTablePreferences)",o)}},getTablePreferences:r=>{const i=t();return(i==null?void 0:i.get(r))||void 0||wy},deleteAllTablePreferences:()=>{localStorage.removeItem(_a)}}}function Ta(e={}){const{getAxiosInstance:t}=my();return{axiosInstance:t(e)}}const ky={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Cy={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Sy={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},xy={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Ay={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"}},By={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Iy={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ey={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ny={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"}},Oy={global:ky,deleteModal:Cy,baseForm:Sy,baseTable:xy,baseConfigCard:Ay,filter:By,debouncedFilter:Iy,errors:Ey,toggleModal:Ny};function Va(){const e=pr.createI18n("en-us",Oy);return{i18n:e,i18nT:pr.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 o=new Set([...r,...i]);for(const s of o){const a=r.filter(l=>l===s).length,c=i.filter(l=>l===s).length;if(a!==c)return!1}return!0};return{getPropValue:e,objectsAreEqual:(r,i,o)=>{if(o){if(Object.keys(r).length===Object.keys(i).length)for(const s in r)if(Array.isArray(r[s])&&Array.isArray(i[s])){if(t(r[s],i[s]))continue;return!1}else{if(r[s]===i[s])continue;return!1}else return!1;return!0}try{return JSON.stringify(r)===JSON.stringify(i)}catch{return!1}},sortAlpha:r=>(i,o)=>{let s=i[r]===void 0||i[r]===null?"":i[r],a=o[r]===void 0||o[r]===null?"":o[r];return Array.isArray(i[r])&&(s=i[r][0]),Array.isArray(o[r])&&(a=o[r][0]),s.localeCompare(a)},isValidUuid:r=>r?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r):!1}}function _y(e,t,r,i={fetchedItemsKey:"data",searchKeys:["id"]}){r||(r="100");const{axiosInstance:o}=Ta({headers:e.requestHeaders}),{i18n:{t:s}}=Va(),{debounce:a}=by(),c=a(async S=>{await A(S)},200),l=n.ref(!1),d=n.ref(""),y=n.ref(""),p=n.ref([]),E=n.ref([]),w=n.ref(void 0),h=n.unref(t);let g=`${e.apiBaseUrl}${h}`;e.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:v}=kd(),m=async()=>{try{l.value=!0;const{data:S}=await o.get(`${g}?size=${r}`);S!=null&&S.next||(w.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[]),E.value=i.fetchedItemsKey in S?S[i.fetchedItemsKey]:[],p.value=E.value}catch{p.value=[],d.value=s("debouncedFilter.errors.fetch")}finally{l.value=!1}},C=n.ref(""),A=async S=>{var I,T,Q;if(C.value!==S)if(C.value=S||"",w.value===void 0)try{if(l.value=!0,d.value="",y.value="",e.app==="konnect"){let O=g+"";S&&(O+=`/${S}`);const{data:B}=await o.get(`${O}?size=${r}`);i.fetchedItemsKey in B?p.value=B[i.fetchedItemsKey]:B!=null&&B.id?p.value=[B]:p.value=[]}else if(S){const O=[];v(S)&&i.searchKeys.includes("id")?O.push((async()=>{const{data:W}=await o.get(`${g}/${S}`);return[W[i.fetchedItemsKey]??W]})()):O.push(...i.searchKeys.filter(W=>W!=="id").map(async W=>{const{data:M}=await o.get(`${g}?${W}=${S}`);return M[i.fetchedItemsKey]}));const B=await Promise.all(O),Y=new Set;p.value=[],(I=B==null?void 0:B.forEach)==null||I.call(B,W=>{var M;(M=W==null?void 0:W.forEach)==null||M.call(W,J=>{Y.has(J.id)||(Y.add(J.id),p.value.push(J))})})}else p.value=E.value}catch(O){((T=O==null?void 0:O.response)==null?void 0:T.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=(Q=w.value)==null?void 0:Q.filter(O=>{var B;let Y=!1;for(const W of i.searchKeys){const M=typeof O[W]=="string"?(B=O[W])==null?void 0:B.toLowerCase():O[W];M!=null&&M.includes(S.toLowerCase())&&(Y=!0)}return Y}),(!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:m,debouncedQueryChange:c}}function Ty(e,t){const r=n.unref(t),i=n.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${r}`):new URL(r));return i.value.search="",o=>`${i.value.href}/${o}`}function Vy(){const{i18n:{t:e}}=Va();return{getMessageFromError:t=>{var r,i,o,s;if(!t)return e("errors.unexpected");if(((r=t==null?void 0:t.response)==null?void 0:r.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((i=t==null?void 0:t.response)!=null&&i.data){if(t.response.data.detail)return t.response.data.detail;if((o=t.response.data.details)!=null&&o.length)return t.response.data.details.map(a=>{let 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 jy(e){const t=window.location.origin,r=t.endsWith("/")?t:`${t}/`;try{const i=e.join("/"),o=`${r}${i}`,s=e.some(a=>a.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(o)&&!s&&new URL(o))return`${r}${i}`;throw new Error("Invalid url")}catch(i){return console.warn("Failed to build valid URL:",i),""}}function Cd(e,t){const r=n.ref(n.unref(e)),i=n.ref(n.unref(t)),o=n.computed(()=>!!(r.value.app==="konnect"||r.value.isExactMatch)),s=n.computed(()=>i.value.startsWith("/")?new URL(`${window.location.origin}${i.value}`):new URL(i.value));return a=>{const{page:c,pageSize:l,offset:d,sortColumnKey:y,sortColumnOrder:p,query:E}=a;try{let w=new URL(s.value.href);return o.value&&E?(w.search="",w=r.value.app==="konnect"?new URL(`${w.href}?filter[name][contains]=${E}`):new URL(`${w.href}/${E}/`)):(o.value||new URLSearchParams(E).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 Dy(e,t,r="data"){const i=n.unref(t),{axiosInstance:o}=Ta({headers:e.requestHeaders}),s=Cd(e,i),a=n.ref({status:Ft.Idle});return{fetcher:async c=>{try{a.value={status:Ft.Loading};let l=s(c);l.includes("filter[name]")&&(l=`${l}&page[size]=${c.pageSize}&page[number]=${c.page}`);const{data:d}=await o.get(l),y=r&&r.replace(/[^\w-_]/gi,"");let p;d[y]&&Array.isArray(d[y])?p=d[y]:Array.isArray(d)?p=d:p=Object.keys(d).length?[d]:[];const E={data:p,total:p.length,...d.offset?{pagination:{offset:d.offset}}:null};return a.value={status:Ft.Idle,response:E},E}catch(l){const d={data:[],total:0};return c.query&&l.response.status===404?(a.value={status:Ft.NoResults,response:d,error:l},d):(a.value={status:Ft.Error,response:d,error:l},d)}},fetcherState:a}}function My(){const e=(r,i="_")=>r?r.split(i).map(o=>o.toLowerCase()==="id"?o.toUpperCase():o.charAt(0).toUpperCase()+o.substring(1)).join(" "):"",t=/(?:^|[\s-:'"])\w/g;return{capitalize:r=>r?r.replace(t,i=>i.toUpperCase()):"",convertKeyToTitle:e}}const 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},$y=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Py=(e,t)=>{if(Ad(e)||Ad(t))return 0;const[r,i]=$y(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=Py(e[r]||"0",t[r]||"0");if(i!==0)return i}return 0},Ry=(e,t)=>{const r=xd(e),i=xd(t),o=r.pop(),s=i.pop(),a=Id(r,i);return a!==0?a:o&&s?Id(o.split("."),s.split(".")):o||s?o?-1:1:0},Ed=(e,t,r)=>{Uy(r);const i=Ry(e,t);return Nd[r].includes(i)},Nd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Od=Object.keys(Nd),Uy=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("|")}`)},Ly=e=>typeof e=="string"&&/^[v\d]/.test(e)&&Sd.test(e);function Hy(e){const{gatewayInfo:t,supportedRange:r}=e;if(!t)return!0;const{edition:i,version:o}=t;if(!Ly(o))return console.error("Invalid version"),!1;const s=r[i];if(!s)return!1;const[a,c]=s;return!(a&&Ed(o,a,"<")||c&&Ed(o,c,">"))}function Fy(e){const t=n.ref(0),r=n.ref(0),i=n.ref(!1);return n.watch(e,o=>{o&&!i.value&&(t.value=o.offsetWidth,r.value=o.scrollWidth,i.value=!0)}),{isTruncated:n.computed(()=>t.value<r.value)}}const Te={useAxios:Ta,useDebouncedFilter:_y,useDeleteUrlBuilder:Ty,useErrors:Vy,useExternalLinkCreator:jy,useFetcher:Dy,useFetchUrlBuilder:Cd,useHelpers:kd,useStringHelpers:My,useI18n:Va,useGatewayFeatureSupported:Hy,useTruncationDetector:Fy},qy={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Ky="Copy to clipboard",zy={message:qy,iconTitle:Ky},Gy="kong-ui-copy-uuid-notify",_d="24px",Wy=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Jy=e=>(n.pushScopeId("data-v-13f41aa3"),e=e(),n.popScopeId(),e),Yy=["aria-hidden"],Zy={key:0,"data-testid":"kui-icon-svg-title"},Qy=Jy(()=>n.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Xy=n.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:_d,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const t=String(e).replace(/px/gi,""),r=Number(t);if(r&&!isNaN(r)&&Number.isInteger(r)&&r>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const t=e,r=n.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const o=String(t.size).replace(/px/gi,""),s=Number(o);if(s&&!isNaN(s)&&Number.isInteger(s)&&s>0)return`${s}px`}return _d}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",Zy,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),Qy],8,Yy))]),_:1},8,["aria-hidden","style"]))}}),eg=Wy(Xy,[["__scopeId","data-v-13f41aa3"]]),tg="16px",rg={class:"kong-ui-copy-uuid"},ig=["onClick"],Td=15,ng=n.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:t}){const{t:r}=pr.createI18n("en-us",zy),i=e,o=t,s=i.notify||n.inject(Gy,()=>{}),a=n.computed(()=>i.idTooltip?{label:i.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:i.uuid}),c=n.computed(()=>!!(i.tooltip&&i.successTooltip)),l=n.ref(i.tooltip),d=n.computed(()=>i.tooltip?{label:l.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),y=n.computed(()=>{var w;return i.format==="redacted"?"*****":i.format==="deleted"?`*${(w=i.uuid)==null?void 0:w.substring(0,5)}`:i.uuid}),p=w=>{l.value=w,setTimeout(()=>{l.value=i.tooltip},1800)},E=w=>{var h,g;if(!w(i.uuid)){typeof s=="function"&&s({type:"error",message:r("message.fail")}),c.value?p(r("message.fail")):o("error",i.uuid);return}const v=((h=i.uuid)==null?void 0:h.length)>Td,m=i.format==="hidden"||i.format==="redacted"?r("message.success.prefix"):`"${((g=i.uuid)==null?void 0:g.substring(0,Td))+(v?"...":"")}"`;typeof s=="function"&&s({type:"success",message:`${m}${r("message.success.content")}`}),c.value?p(i.successTooltip):o("success",i.uuid)};return(w,h)=>{const g=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",rg,[e.format!=="hidden"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),n.mergeProps({key:0},a.value,{"data-testid":"copy-id"}),{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},n.toDisplayString(y.value),3)]),_:1},16)):n.createCommentVNode("",!0),(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),n.mergeProps(d.value,{class:"uuid-icon-wrapper"}),{default:n.withCtx(()=>[n.createVNode(g,null,{default:n.withCtx(({copyToClipboard:v})=>[n.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:n.withModifiers(m=>E(v),["stop"])},[n.createVNode(n.unref(eg),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:n.unref(tg),title:n.unref(r)("iconTitle")},null,8,["color","decorative","size","title"])],8,ig)]),_:1})]),_:1},16))])}}}),og=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Vd=og(ng,[["__scopeId","data-v-0c07874b"]]),sg={key:0,class:"config-card-fieldset-title"},ag=n.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const t=e,{i18n:{t:r}}=Te.useI18n(),{convertKeyToTitle:i}=Te.useStringHelpers(),o=n.computed(()=>t.item.key??"json-array-item"),s=n.computed(()=>t.item.value??t.item),a=n.computed(()=>{const l=JSON.parse(JSON.stringify(s.value));return t.isArrayItem&&delete l.name,l}),c=n.computed(()=>{var l;return t.isArrayItem?(l=s.value)!=null&&l.name?i(s.value.name,"_"):r("baseConfigCard.general.entryTitle",{index:t.index}):""});return(l,d)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:n.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:n.withCtx(()=>[e.isArrayItem?(n.openBlock(),n.createElementBlock("legend",sg,[n.createElementVNode("b",null,n.toDisplayString(c.value),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(a.value),(y,p)=>(n.openBlock(),n.createBlock(Ii,{key:`${o.value}-property-${p}`,item:{key:y,label:n.unref(i)(y),value:a.value[y]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),dt=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},jd=dt(ag,[["__scopeId","data-v-68ca83ec"]]),cg=n.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KButton");return n.openBlock(),n.createElementBlock("div",null,[n.createVNode(o,{appearance:"tertiary",class:"navigation-button",onClick:i[0]||(i[0]=s=>r.$emit("navigation-click",e.item))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.value||n.unref(t)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),lg=dt(cg,[["__scopeId","data-v-c96811e5"]]),ug=n.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t}}=Te.useI18n();return(r,i)=>{const o=n.resolveComponent("KBadge");return n.openBlock(),n.createBlock(o,{appearance:e.status?"success":"neutral"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.status?n.unref(t)("baseConfigCard.statusBadge.enabledLabel"):n.unref(t)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),dg="#0044f4",fg="#e0e4ea",pg="#3a3f51",hg="1px",yg="20px",gg={class:"config-card-details-row"},mg=["data-testid"],bg=["data-testid"],wg=["data-testid"],vg=["data-testid"],kg={key:1},Cg=["data-testid"],Sg=["data-testid"],xg=["data-testid"],Ag=["data-testid"],Bg={name:"ConfigCardItem",components:{CopyUuid:Vd,JsonCardItem:jd,StatusBadge:ug,InternalLinkItem:lg}},Ig=n.defineComponent({...Bg,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:t}){n.useCssVars(h=>({"5ae2770e":y.value?"none":`solid ${n.unref(hg)} ${n.unref(fg)}`,"4db3977e":d.value&&c.value?"block":"flex","1a7c5e02":d.value&&c.value?"100%":r.slim?"50%":"25%","1a77d24c":d.value&&c.value?"100%":r.slim?"50%":"75%"}));const r=e,i=t,o=n.useSlots(),{i18n:{t:s,formatUnixTimeStamp:a}}=Te.useI18n(),c=n.computed(()=>r.item.value!==void 0&&r.item.value!==null&&r.item.value!==""),l=n.computed(()=>!!(r.item.tooltip||o["label-tooltip"])),d=n.computed(()=>r.item.type===ce.Json||r.item.type===ce.JsonArray),y=n.computed(()=>r.item.type===ce.JsonArray),p=n.computed(()=>{switch(r.item.type){case ce.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid`,"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ce.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case ce.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${r.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,uuid:r.item.value,notify:()=>{}}};case ce.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":s("baseConfigCard.copy.success"),tooltip:s("baseConfigCard.copy.tooltip",{label:r.item.label}),truncated:!1,notify:()=>{}}};case 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}}}),E=n.ref(),{isTruncated:w}=Te.useTruncationDetector(E);return(h,g)=>{const v=n.resolveComponent("KLabel"),m=n.resolveComponent("KBadge"),C=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("div",gg,[n.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[n.renderSlot(h.$slots,"label",{item:e.item},()=>[n.createVNode(v,{"tooltip-attributes":{maxWidth:"500px"}},n.createSlots({default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.item.label)+" ",1)]),_:2},[l.value?{name:"tooltip",fn:n.withCtx(()=>[n.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[n.renderSlot(h.$slots,"label-tooltip",{},()=>[n.createTextVNode(n.toDisplayString(e.item.tooltip),1)],!0)],8,bg)]),key:"0"}:void 0]),1024)],!0)],8,mg),n.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[n.renderSlot(h.$slots,e.item.key,{rowValue:e.item.value},()=>[c.value?(n.openBlock(),n.createElementBlock("div",kg,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(p.value.tag),n.normalizeProps(n.guardReactiveProps(p.value.attrs)),{default:n.withCtx(()=>[p.value.additionalComponent==="KBadge"?(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(A,S)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-tag-${S}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${S}`,tooltip:A,"truncation-tooltip":""},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,Cg)):n.createCommentVNode("",!0),p.value.additionalComponent==="CopyUuid"?(n.openBlock(),n.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(A,S)=>(n.openBlock(),n.createBlock(n.unref(Vd),n.mergeProps(p.value.childAttrs,{key:`${e.item.key}-copy-uuid-${S}`,"data-testid":`${e.item.key}-copy-uuid-${S}`,uuid:A}),null,16,["data-testid","uuid"]))),128))],8,Sg)):p.value.additionalComponent==="KMethodBadge"?(n.openBlock(),n.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(A,S)=>(n.openBlock(),n.createBlock(m,{key:`${e.item.key}-badge-method-${S}`,appearance:Object.values(n.unref(sp.BadgeMethodAppearances)).includes(A.toLowerCase())?A.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${S}`},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(A),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,xg)):n.createCommentVNode("",!0),p.value.additionalComponent==="JsonCardItem"?(n.openBlock(),n.createElementBlock("div",{key:3,"data-testid":`${r.item.key}-json-array-content`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.item.value,(A,S)=>(n.openBlock(),n.createBlock(jd,{key:`json-array-item-${S}`,index:S,"is-array-item":"",item:A},null,8,["index","item"]))),128))],8,Ag)):(n.openBlock(),n.createBlock(C,{key:4,text:n.unref(w)?e.item.value:""},{default:n.withCtx(()=>[n.createElementVNode("span",{ref_key:"textContent",ref:E,class:n.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},n.toDisplayString(p.value.text),3)]),_:1},8,["text"]))]),_:1},16))])):(n.openBlock(),n.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,vg))],!0)],8,wg)])}}}),Ii=dt(Ig,[["__scopeId","data-v-f65fc52c"]]),Eg={class:"json-config"},Ng={key:0,class:"json-endpoint"},Dd=n.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){n.useCssVars(o=>({"2d178975":`${i.value}ch`}));const t=e,r=n.computed(()=>t.jsonRecord),i=n.computed(()=>{var o;if(!t.fetcherUrl)return 0;const s=(o=t.fetcherUrl)==null?void 0:o.split("/");return s.length<2?0:41+(t.requestMethod==="post"?s[s.length-1]:s[s.length-2]).length});return(o,s)=>{var a;const c=n.resolveComponent("KBadge"),l=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock("div",Eg,[t.fetcherUrl&&(a=t.config)!=null&&a.jsonYamlFormsEnabled?(n.openBlock(),n.createElementBlock("div",Ng,[n.createVNode(c,{appearance:t.requestMethod},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(t.requestMethod),1)]),_:1},8,["appearance"]),n.createVNode(l,{id:"json-endpoint-codeblock",code:t.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),t.jsonRecord?(n.openBlock(),n.createBlock(l,{key:1,id:"json-codeblock",class:n.normalizeClass({"json-content":t.fetcherUrl}),code:JSON.stringify(r.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):n.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Md(e){return typeof e>"u"||e===null}function Og(e){return typeof e=="object"&&e!==null}function _g(e){return Array.isArray(e)?e:Md(e)?[]:[e]}function Tg(e,t){var r,i,o,s;if(t)for(s=Object.keys(t),r=0,i=s.length;r<i;r+=1)o=s[r],e[o]=t[o];return e}function Vg(e,t){var r="",i;for(i=0;i<t;i+=1)r+=e;return r}function jg(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Dg=Md,Mg=Og,$g=_g,Pg=Vg,Rg=jg,Ug=Tg,Ne={isNothing:Dg,isObject:Mg,toArray:$g,repeat:Pg,isNegativeZero:Rg,extend:Ug};function $d(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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-certificates",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-certificates.umd.js",
|
|
6
6
|
"module": "./dist/entities-certificates.es.js",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@kong/kongponents": "9.0.0-alpha.105",
|
|
25
|
-
"axios": "^1.6.
|
|
25
|
+
"axios": "^1.6.7",
|
|
26
26
|
"vue": ">= 3.3.13 < 4",
|
|
27
27
|
"vue-router": "^4.2.5",
|
|
28
|
-
"@kong-ui-public/i18n": "^2.1.
|
|
28
|
+
"@kong-ui-public/i18n": "^2.1.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@kong/design-tokens": "1.12.7",
|
|
32
32
|
"@kong/kongponents": "9.0.0-alpha.105",
|
|
33
|
-
"axios": "^1.6.
|
|
34
|
-
"vue": "^3.4.
|
|
33
|
+
"axios": "^1.6.7",
|
|
34
|
+
"vue": "^3.4.18",
|
|
35
35
|
"vue-router": "^4.2.5",
|
|
36
|
-
"@kong-ui-public/i18n": "^2.1.
|
|
36
|
+
"@kong-ui-public/i18n": "^2.1.3"
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"extends": "../../../package.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@peculiar/x509": "^1.9.
|
|
51
|
-
"@kong-ui-public/copy-uuid": "^2.0.
|
|
52
|
-
"@kong-ui-public/entities-shared": "^2.7.
|
|
50
|
+
"@peculiar/x509": "^1.9.7",
|
|
51
|
+
"@kong-ui-public/copy-uuid": "^2.0.38",
|
|
52
|
+
"@kong-ui-public/entities-shared": "^2.7.2"
|
|
53
53
|
},
|
|
54
54
|
"distSizeChecker": {
|
|
55
55
|
"errorLimit": "1.5MB"
|