@kong-ui-public/entities-certificates 1.3.10 → 1.3.12

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.
@@ -11267,7 +11267,7 @@ const n0 = {
11267
11267
  for (const [i, n] of t)
11268
11268
  r[i] = n;
11269
11269
  return r;
11270
- }, d0 = (e) => (Bp("data-v-877a88b1"), e = e(), Ep(), e), p0 = ["aria-hidden"], h0 = {
11270
+ }, d0 = (e) => (Bp("data-v-37e959c8"), e = e(), Ep(), e), p0 = ["aria-hidden"], h0 = {
11271
11271
  key: 0,
11272
11272
  "data-testid": "kui-icon-svg-title"
11273
11273
  }, y0 = /* @__PURE__ */ d0(() => /* @__PURE__ */ ae("path", {
@@ -11366,7 +11366,7 @@ const n0 = {
11366
11366
  _: 1
11367
11367
  }, 8, ["aria-hidden", "style"]));
11368
11368
  }
11369
- }), m0 = /* @__PURE__ */ f0(g0, [["__scopeId", "data-v-877a88b1"]]), v0 = { "data-testid": "config-card-title" }, b0 = { class: "config-card-actions" }, w0 = ["href"], k0 = {
11369
+ }), m0 = /* @__PURE__ */ f0(g0, [["__scopeId", "data-v-37e959c8"]]), v0 = { "data-testid": "config-card-title" }, b0 = { class: "config-card-actions" }, w0 = ["href"], k0 = {
11370
11370
  key: 2,
11371
11371
  class: "config-card-details-section"
11372
11372
  }, A0 = {
@@ -145,4 +145,4 @@ ${t.join(`
145
145
  `+e.slice(o,s),o=s+1),a=c;return l+=`
146
146
  `,e.length-o>t&&a>o?l+=e.slice(o,a)+`
147
147
  `+e.slice(a+1):l+=e.slice(o),l.slice(1)}function Ug(e){for(var t="",r=0,i,o=0;o<e.length;r>=65536?o+=2:o++)r=Bi(e,o),i=Ve[r],!i&&Ai(r)?(t+=e[o],r>=65536&&(t+=e[o+1])):t+=i||Og(r);return t}function Lg(e,t,r){var i="",o=e.tag,s,a,c;for(s=0,a=r.length;s<a;s+=1)c=r[s],e.replacer&&(c=e.replacer.call(r,String(s),c)),(It(e,t,c,!1,!1)||typeof c>"u"&&It(e,t,null,!1,!1))&&(i!==""&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=o,e.dump="["+i+"]"}function Cf(e,t,r,i){var o="",s=e.tag,a,c,l;for(a=0,c=r.length;a<c;a+=1)l=r[a],e.replacer&&(l=e.replacer.call(r,String(a),l)),(It(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&It(e,t+1,null,!0,!0,!1,!0))&&((!i||o!=="")&&(o+=$a(e,t)),e.dump&&Si===e.dump.charCodeAt(0)?o+="-":o+="- ",o+=e.dump);e.tag=s,e.dump=o||"[]"}function Hg(e,t,r){var i="",o=e.tag,s=Object.keys(r),a,c,l,d,p;for(a=0,c=s.length;a<c;a+=1)p="",i!==""&&(p+=", "),e.condenseFlow&&(p+='"'),l=s[a],d=r[l],e.replacer&&(d=e.replacer.call(r,l,d)),It(e,t,l,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),It(e,t,d,!1,!1)&&(p+=e.dump,i+=p));e.tag=o,e.dump="{"+i+"}"}function Fg(e,t,r,i){var o="",s=e.tag,a=Object.keys(r),c,l,d,p,y,x;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new Pe("sortKeys must be a boolean or a function");for(c=0,l=a.length;c<l;c+=1)x="",(!i||o!=="")&&(x+=$a(e,t)),d=a[c],p=r[d],e.replacer&&(p=e.replacer.call(r,d,p)),It(e,t+1,d,!0,!0,!0)&&(y=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,y&&(e.dump&&Si===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,y&&(x+=$a(e,t)),It(e,t+1,p,!0,y)&&(e.dump&&Si===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,o+=x));e.tag=s,e.dump=o||"{}"}function Sf(e,t,r){var i,o,s,a,c,l;for(o=r?e.explicitTypes:e.implicitTypes,s=0,a=o.length;s<a;s+=1)if(c=o[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof t=="object"&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(r?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(l=e.styleMap[c.tag]||c.defaultStyle,of.call(c.represent)==="[object Function]")i=c.represent(t,l);else if(sf.call(c.represent,l))i=c.represent[l](t,l);else throw new Pe("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');e.dump=i}return!0}return!1}function It(e,t,r,i,o,s,a){e.tag=null,e.dump=r,Sf(e,r,!1)||Sf(e,r,!0);var c=of.call(e.dump),l=i,d;i&&(i=e.flowLevel<0||e.flowLevel>t);var p=c==="[object Object]"||c==="[object Array]",y,x;if(p&&(y=e.duplicates.indexOf(r),x=y!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(o=!1),x&&e.usedDuplicates[y])e.dump="*ref_"+y;else{if(p&&x&&!e.usedDuplicates[y]&&(e.usedDuplicates[y]=!0),c==="[object Object]")i&&Object.keys(e.dump).length!==0?(Fg(e,t,e.dump,o),x&&(e.dump="&ref_"+y+e.dump)):(Hg(e,t,e.dump),x&&(e.dump="&ref_"+y+" "+e.dump));else if(c==="[object Array]")i&&e.dump.length!==0?(e.noArrayIndent&&!a&&t>0?Cf(e,t-1,e.dump,o):Cf(e,t,e.dump,o),x&&(e.dump="&ref_"+y+e.dump)):(Lg(e,t,e.dump),x&&(e.dump="&ref_"+y+" "+e.dump));else if(c==="[object String]")e.tag!=="?"&&Rg(e,e.dump,t,s,l);else{if(c==="[object Undefined]"||e.skipInvalid)return!1;throw new Pe("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",e.dump=d+" "+e.dump)}return!0}function Kg(e,t){var r=[],i=[],o,s;for(Ma(e,r,i),o=0,s=i.length;o<s;o+=1)t.duplicates.push(r[i[o]]);t.usedDuplicates=new Array(s)}function Ma(e,t,r){var i,o,s;if(e!==null&&typeof e=="object")if(o=t.indexOf(e),o!==-1)r.indexOf(o)===-1&&r.push(o);else if(t.push(e),Array.isArray(e))for(o=0,s=e.length;o<s;o+=1)Ma(e[o],t,r);else for(i=Object.keys(e),o=0,s=i.length;o<s;o+=1)Ma(e[i[o]],t,r)}function qg(e,t){t=t||{};var r=new Vg(t);r.noRefs||Kg(e,r);var i=e;return r.replacer&&(i=r.replacer.call({"":i},"",i)),It(r,0,i,!0,!0)?r.dump+`
148
- `:""}var zg=qg,Gg={dump:zg};function Ua(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 Wg=Ee,Jg=xd,Yg=Ed,Zg=Vd,Qg=jd,Xg=Oa,e0=nf.load,t0=nf.loadAll,r0=Gg.dump,i0=Pe,n0={binary:Md,float:Td,map:Id,null:Nd,pairs:Ld,set:Hd,timestamp:$d,bool:_d,int:Od,merge:Rd,omap:Ud,seq:Bd,str:Ad},o0=Ua("safeLoad","load"),s0=Ua("safeLoadAll","loadAll"),a0=Ua("safeDump","dump"),c0={Type:Wg,Schema:Jg,FAILSAFE_SCHEMA:Yg,JSON_SCHEMA:Zg,CORE_SCHEMA:Qg,DEFAULT_SCHEMA:Xg,load:e0,loadAll:t0,dump:r0,YAMLException:i0,types:n0,safeLoad:o0,safeLoadAll:s0,safeDump:a0};const l0={key:0,class:"config-card-display-form"},u0=["data-testid"],d0={key:0,class:"config-card-prop-section-title"},f0={key:1,class:"config-card-display-json"},p0={key:2,class:"config-card-display-yaml"},h0=ot(n.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Ae.useI18n(),o=c=>!!(c.tooltip||r[`${c.key}-label-tooltip`]),s=n.ref(""),a=n.ref("");return n.watch(()=>t.format,c=>{c==="json"?s.value=JSON.stringify(t.record,null,2):c==="yaml"&&(a.value=c0.dump(t.record))},{immediate:!0}),(c,l)=>{const d=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",l0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,p=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${p}-props`,class:n.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(n.openBlock(),n.createElementBlock("div",d0,n.toDisplayString(p==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[p],y=>(n.openBlock(),n.createBlock(ki,{key:y.key,item:y},n.createSlots({label:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label`,{row:y},void 0,!0)]),[y.key]:n.withCtx(({rowValue:x})=>[n.renderSlot(c.$slots,y.key,{row:y,rowValue:x},void 0,!0)]),_:2},[o(y)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label-tooltip`,{row:y},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,u0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",f0,[n.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",p0,[n.createVNode(d,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-6c45e9e4"]]),xf="24px",y0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},m0=e=>(n.pushScopeId("data-v-877a88b1"),e=e(),n.popScopeId(),e),g0=["aria-hidden"],b0={key:0,"data-testid":"kui-icon-svg-title"},w0=m0(()=>n.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),v0=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:xf,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 xf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",b0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),w0],8,g0))]),_:1},8,["aria-hidden","style"]))}}),k0=y0(v0,[["__scopeId","data-v-877a88b1"]]),C0={"data-testid":"config-card-title"},S0={class:"config-card-actions"},x0=["href"],A0={key:2,class:"config-card-details-section"},B0={key:3,class:"config-card-details-section"},I0=["data-testid"],E0={key:0,class:"config-card-prop-section-title"},Af=ot(n.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=e,o=n.useSlots(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{convertKeyToTitle:c}=Ae.useStringHelpers(),{axiosInstance:l}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),y=_=>{p.value=_==null?void 0:_.value},x={id:{type:ne.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:le.Basic},name:{order:1,section:le.Basic},enabled:{type:ne.BadgeStatus,order:2,section:le.Basic},updated_at:{type:ne.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:le.Basic},created_at:{type:ne.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:le.Basic},tags:{type:ne.BadgeTag,order:-1,section:le.Basic}},C=n.ref(!1),h=n.ref(!1),g=n.ref(""),w=n.ref(),v=n.computed(()=>{var _,H,U;if(!w.value)return[];const Y=[],R=Object.keys(w.value).length;for(const D in w.value){const re=(H=(_=i.configSchema)==null?void 0:_[D])==null?void 0:H.order,fe=(U=x[D])==null?void 0:U.order;let be=R;(fe||fe===0)&&(be=fe===-1?R+1:fe),re&&(be=re===-1?R+1:re),Y.push([D,be])}return Y.sort(function(D,re){return D[1]-re[1]}),Y.map(D=>{var re,fe;const be=D[0],ue=(re=w.value)==null?void 0:re[be],pe=((fe=i.configSchema)==null?void 0:fe[be])||{},we=x[be];return{key:be,value:ue,hidden:pe.hidden||!1,type:pe.type??((we==null?void 0:we.type)||ne.Text),label:pe.label??((we==null?void 0:we.label)||c(be)),tooltip:pe.tooltip??((we==null?void 0:we.tooltip)||void 0),section:pe.section??((we==null?void 0:we.section)||le.Advanced)}}).filter(D=>!D.hidden&&D.key!==i.pluginConfigKey)}),b=n.computed(()=>{var _,H;if(!w.value||!i.pluginConfigKey)return[];const U=w.value[i.pluginConfigKey]||{},Y=Object.keys(U).length,R=[];for(const D in U){const re=(H=(_=i.pluginConfigSchema)==null?void 0:_[D])==null?void 0:H.order,fe=U[D];let be=fe!=null&&fe!==""?Y-1:Y;re&&(be=re===-1?Y+1:re),R.push([D,be])}return R.sort(function(D,re){return D[1]-re[1]}),R.map(D=>{var re;const fe=D[0],be=U[fe],ue=((re=i.pluginConfigSchema)==null?void 0:re[fe])||{};return{key:fe,value:be,hidden:ue.hidden||!1,type:ue.type??ne.Text,label:ue.label??c(fe),tooltip:ue.tooltip??void 0,section:le.Plugin}}).filter(D=>!D.hidden)}),m=n.computed(()=>{var _,H,U,Y;return{basic:(_=v.value)==null?void 0:_.filter(R=>R.section===le.Basic),advanced:(H=v.value)==null?void 0:H.filter(R=>R.section===le.Advanced),plugin:(Y=b.value)==null?void 0:Y.concat((U=v.value)==null?void 0:U.filter(R=>R.section===le.Plugin))}}),B=n.computed(()=>{const _=[];return m.value.basic.length&&_.push("basic"),m.value.advanced.length&&_.push("advanced"),m.value.plugin.length&&_.push("plugin"),_}),q=_=>!!(_.tooltip||o[`${_.key}-label-tooltip`]),J=n.computed(()=>{var _,H;let U=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((_=i.config)==null?void 0:_.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),U=U.replace(/{id}/gi,i.config.entityId),U}),I=_=>{w.value&&_(JSON.stringify(w.value))?t("copy:success",w.value):t("copy:error")};return n.watch(C,_=>{t("loading",_)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,C.value=!0;try{const{data:_}=await l.get(J.value);if(i.dataKey)if(typeof _[i.dataKey]<"u")w.value={..._[i.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:i.dataKey}));else w.value={..._};Object.keys(i.configSchema).filter(H=>i.configSchema[H].forceShow).forEach(H=>{w.value&&typeof w.value[H]>"u"&&(w.value[H]=null)}),t("fetch:success",_)}catch(_){const H=a(_);g.value=H.startsWith("code")?s("baseConfigCard.errors.load"):H,h.value=!0,t("fetch:error",_)}finally{C.value=!1}}),(_,H)=>{const U=n.resolveComponent("KLabel"),Y=n.resolveComponent("KSelect"),R=n.resolveComponent("KButton"),D=n.resolveComponent("KClipboardProvider"),re=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),be=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(be,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",S0,[n.renderSlot(_.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(U,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(Y,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:y})):n.createCommentVNode("",!0),i.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(R,{key:2,appearance:"btn-link",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(k0),{size:n.unref(_y)},null,8,["size"])],8,x0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(D,{key:3},{default:n.withCtx(({copyToClipboard:ue})=>[!C.value&&!h.value?(n.openBlock(),n.createBlock(R,{key:0,appearance:"btn-link","data-testid":"json-copy-button",onClick:pe=>I(ue)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),body:n.withCtx(()=>[C.value?(n.openBlock(),n.createBlock(re,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(g.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",A0,[n.createVNode(h0,{format:p.value,"prop-list-types":B.value,"property-collections":m.value,record:w.value},n.createSlots({_:2},[n.renderList(Object.keys(_.$slots),ue=>({name:ue,fn:n.withCtx(({row:pe,rowValue:we})=>[n.renderSlot(_.$slots,ue,{row:pe,rowValue:we},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",B0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(B.value,ue=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${ue}-props`,class:n.normalizeClass(`config-card-details-${ue}-props`),"data-testid":`config-card-details-${ue}-props`},[ue!=="basic"?(n.openBlock(),n.createElementBlock("div",E0,n.toDisplayString(ue==="advanced"?n.unref(s)("baseConfigCard.sections.advanced"):n.unref(s)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value[ue],pe=>(n.openBlock(),n.createBlock(ki,{key:pe.key,item:pe},n.createSlots({label:n.withCtx(()=>[n.renderSlot(_.$slots,`${pe.key}-label`,{row:pe},void 0,!0)]),[pe.key]:n.withCtx(({rowValue:we})=>[n.renderSlot(_.$slots,pe.key,{row:pe,rowValue:we},void 0,!0)]),_:2},[q(pe)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(_.$slots,`${pe.key}-label-tooltip`,{row:pe},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,I0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",C0,[n.renderSlot(_.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-64349aa2"]]),N0=["onReset","onSubmit"],_0={class:"form-actions","data-testid":"form-actions"},Bf=ot(n.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=e,o=Lr.useRouter(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{axiosInstance:c}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),l=n.ref(!1),d=n.ref(!1),p=n.ref(""),y=n.computed(()=>i.canSubmit===!1||i.isReadonly),x=n.computed(()=>{var w,v;if(!i.editId)return"";let b=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(v=i.config)!=null&&v.workspace?`/${i.config.workspace}`:"")),b=b.replace(/{id}/gi,i.editId),b}),C=()=>{i.config.cancelRoute?o.push(i.config.cancelRoute):h()},h=()=>{t("cancel")},g=()=>{y.value||t("submit")};return n.watch(()=>l.value,w=>{t("loading",w)},{immediate:!0}),n.onBeforeMount(async()=>{if(i.editId)try{d.value=!1,l.value=!0;const{data:w}=await c.get(x.value);t("fetch:success",w)}catch(w){const v=a(w);p.value=v.startsWith("code")?s("baseForm.errors.edit"):v,d.value=!0,t("fetch:error",w)}finally{l.value=!1}}),(w,v)=>{const b=n.resolveComponent("KSkeleton"),m=n.resolveComponent("KEmptyState"),B=n.resolveComponent("KAlert"),q=n.resolveComponent("KButton"),J=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(J,{class:"kong-ui-entity-base-form"},{body:n.withCtx(()=>[l.value?(n.openBlock(),n.createBlock(b,{key:0,type:"form"})):d.value?(n.openBlock(),n.createBlock(m,{key:1,"cta-text":n.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(h,["prevent"]),onSubmit:n.withModifiers(g,["prevent"])},[n.renderSlot(w.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(B,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",_0,[n.renderSlot(w.$slots,"form-actions",{},()=>[n.createVNode(q,{appearance:"outline","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(q,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,N0))]),_:3})}}}),[["__scopeId","data-v-44a90aae"]]),O0={key:0},T0=ot(n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[role="button"]'))||null}),o=n.computed(()=>{var g,w;const v=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return v?((w=v[0])==null?void 0:w.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,w,v;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,p.value=((w=r.value)==null?void 0:w.clientWidth)||0,y.value=((v=l.value)==null?void 0:v.innerText)||""},l=n.ref({}),d=n.ref(0),p=n.ref(0),y=n.ref(""),x=n.computed(()=>[i.value,r.value]),C=n.watch(x,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(w=>{window.requestAnimationFrame(()=>{!Array.isArray(w)||!w.length||c()})});for(const w of g)w&&s.observe(w)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{C()}),(g,w)=>{const v=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",O0,[n.createVNode(v,{disabled:!h.value,label:y.value,"max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["disabled","label"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-f8a220e9"]]),V0={class:"toolbar-container"},j0={key:0,class:"toolbar-button-container"},D0=["data-testid"],If=ot(n.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},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,{i18n:{t:i}}=Ae.useI18n(),o=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),s=m=>m.hasData||!!r.query,a=n.computed(()=>{const m=[];return Object.keys(r.tableHeaders).forEach(B=>{const q=r.tableHeaders[B];m.push({label:q.label??B,key:B,sortable:q.sortable??!1})}),r.enableEntityActions&&m.push({key:"actions",hideLabel:!0}),m}),c=m=>({"data-rowid":m.id,"data-testid":m.name,...r.rowAttributes(m)}),l=n.ref({}),d=m=>{var B;return(B=l.value)==null?void 0:B.$el.querySelector(`[data-rowid="${m.id}"]`)},p=m=>{const B={"data-testid":m.headerKey,...r.cellAttributes(m)};return m.colIndex===0&&(B.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),B},y=()=>{t("empty-state-cta-clicked"),x()},x=()=>{t("clear-search-input")},C=n.computed(()=>r.disableRowClick?void 0:(m,B)=>{t("click:row",B)}),h=m=>{t("sort",m)},{setTablePreferences:g,getTablePreferences:w}=qh(),v=n.computed(()=>{const m=w(r.preferencesStorageKey);return{...r.initialFetcherParams,...m}}),b=m=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,m)};return(m,B)=>{const q=n.resolveComponent("KIcon"),J=n.resolveComponent("KButton"),I=n.resolveComponent("KDropdownMenu"),_=n.resolveComponent("KTable"),H=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(H,{class:"kong-ui-entity-base-table",title:e.title},{body:n.withCtx(()=>[n.createVNode(_,{ref_key:"tableRefs",ref:l,"cache-identifier":o.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-title":e.errorMessage,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":!!e.errorMessage,headers:a.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":c,"search-input":e.query,onKtableEmptyStateCtaClicked:y,"onRow:click":C.value,onSort:B[0]||(B[0]=U=>h(U)),"onUpdate:tablePreferences":b},n.createSlots({toolbar:n.withCtx(({state:U})=>[n.withDirectives(n.createElementVNode("div",V0,[n.renderSlot(m.$slots,"toolbar-filter",{},void 0,!0),m.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",j0,[n.renderSlot(m.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,s(U)]])]),actions:n.withCtx(({row:U,rowKey:Y,rowValue:R})=>[n.createElementVNode("div",{class:"actions-container","data-testid":U.name},[n.createVNode(I,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(m.$slots,"actions",{row:U,rowKey:Y,rowValue:R},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(J,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(q,{color:n.unref(Ey),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,D0)]),_:2},[n.renderList(e.tableHeaders,(U,Y)=>({name:Y,fn:n.withCtx(({row:R,rowKey:D,rowValue:re})=>[n.createVNode(T0,{"key-name":String(Y),"row-el":d(R)},{default:n.withCtx(()=>[n.renderSlot(m.$slots,Y,{row:R,rowKey:D,rowValue:re},()=>[n.createTextVNode(n.toDisplayString(re),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-6bf92df6"]]),P0={key:0,class:"kong-ui-entity-delete-error"},$0={key:1,class:"description"},Ef=ot(n.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const r=e,{i18nT:i}=Ae.useI18n(),o=n.computed(()=>r.needConfirm?r.entityName:""),s=()=>{t("cancel")},a=()=>{t("proceed")};return(c,l)=>{const d=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:a},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",P0,[n.createVNode(d,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(i),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(n.openBlock(),n.createElementBlock("div",$0,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(r.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),R0={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},M0={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},U0=["fill"],L0={mask:"url(#mask0_180_20349)"},H0=["fill"],F0=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${By})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",R0,[n.createElementVNode("mask",M0,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,U0)]),n.createElementVNode("g",L0,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,H0)])]))}}),K0={key:1,class:"kong-ui-entity-filter"},q0={class:"menu-item-title"},z0={class:"menu-item-indicator"},G0={class:"menu-item-body"},W0=["for"],J0={class:"menu-item-buttons"},Nf=ot(n.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,{i18n:{t:i}}=Ae.useI18n(),o=n.ref(!1),s=n.ref({}),a=n.computed(()=>{const w=[];return new URLSearchParams(r.modelValue).forEach((v,b)=>{v!==""&&w.push(b)}),w}),c=n.computed(()=>{const w=r.config.fields;return Object.keys(w).filter(v=>w[v].searchable).map(v=>({label:w[v].label||v,value:v}))});n.watch(()=>r.modelValue,w=>{s.value={},new URLSearchParams(w).forEach((v,b)=>{s.value[b]=v})});const l=()=>{o.value=!o.value},d=w=>{t("update:modelValue",w)},p=w=>`filter-${w}`,y=w=>{var v,b;return(((b=(v=r.config.schema)==null?void 0:v[w])==null?void 0:b.values)??[]).map(m=>({value:m,label:m}))},x=w=>{var v,b;return((b=(v=r.config.schema)==null?void 0:v[w])==null?void 0:b.type)??"text"},C=w=>{s.value={...s.value,[w]:""},g()},h=()=>{s.value={},g(!0)},g=(w=!1)=>{const v=Object.keys(s.value).reduce((b,m)=>(s.value[m]&&(b[m]=`${s.value[m]}`),b),{});w&&(o.value=!1),t("update:modelValue",new URLSearchParams(v).toString())};return(w,v)=>{const b=n.resolveComponent("KInput"),m=n.resolveComponent("KButton"),B=n.resolveComponent("KSelect"),q=n.resolveComponent("KMenuItem"),J=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(b,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{icon:n.withCtx(()=>[n.createVNode(F0)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",K0,[n.createVNode(m,{appearance:"btn-link","data-testid":"filter-button",icon:"filter",onClick:l},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.filterButtonText"))+" "+n.toDisplayString(a.value.length>0?`(${a.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:l},null,512),[[n.vShow,o.value]]),n.withDirectives(n.createVNode(J,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(I,_)=>(n.openBlock(),n.createBlock(q,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":_===c.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",q0,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",z0,null,512),[[n.vShow,a.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var H,U;return[n.createElementVNode("div",G0,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(i)("filter.fieldLabel")),9,W0),((U=(H=e.config.schema)==null?void 0:H[I.value])==null?void 0:U.type)==="select"?(n.openBlock(),n.createBlock(B,{key:0,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":Y=>s.value[I.value]=Y,appearance:"select",items:y(I.value),placeholder:n.unref(i)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(b,{key:1,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":Y=>s.value[I.value]=Y,autocomplete:"off",placeholder:n.unref(i)("filter.inputPlaceholder"),size:"small",type:x(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",J0,[n.createVNode(m,{appearance:"btn-link","data-testid":"apply-filter",size:"small",onClick:v[0]||(v[0]=Y=>g(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.applyButtonText")),1)]),_:1}),n.createVNode(m,{appearance:"btn-link","data-testid":"clear-filter",size:"small",onClick:Y=>C(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createVNode(m,{onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearAllButtonText")),1)]),_:1})]),_:1},512),[[n.vShow,o.value]])]))}}}),[["__scopeId","data-v-745f38c0"]]),Et=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),Y0={class:"form-section-wrapper"},Z0={key:0,class:"form-section-title"},Q0={key:1,class:"form-section-description"},X0={key:2,class:"form-section-footer"},e1={class:"form-section-content"},oo=ot(n.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",Y0,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",Z0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",Q0,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",X0,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",e1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:so,useDeleteUrlBuilder:_f,useErrors:Of,useFetchUrlBuilder:tb,useFetcher:Tf,useDebouncedFilter:rb,useStringHelpers:Vf,useHelpers:jf,useGatewayFeatureSupported:ib,useTruncationDetector:nb}=Ae,ob="",sb="",t1={class:"kong-ui-entities-certificates-list"},r1={key:0},i1={key:1},n1={key:0},o1={key:1},s1={key:0},a1={key:1},c1={key:1},l1={key:1},u1=n.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var de;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(de=r.config)==null?void 0:de.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={subject:{label:i("certificates.list.table_headers.subject")},expiry:{label:i("certificates.list.table_headers.expiry")},san:{label:i("certificates.list.table_headers.san")},cert:{label:i("certificates.list.table_headers.cert")},tags:{label:i("certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var Z,xe;let K=`${r.config.apiBaseUrl}${vi.list[r.config.app]}`;return r.config.app==="konnect"?K=K.replace(/{controlPlaneId}/gi,((Z=r.config)==null?void 0:Z.controlPlaneId)||""):r.config.app==="kongManager"&&(K=K.replace(/\/{workspace}/gi,(xe=r.config)!=null&&xe.workspace?`/${r.config.workspace}`:"")),K}),C=n.ref(""),h=n.computed(()=>{const K=r.config.app==="konnect"||r.config.isExactMatch;return K?{isExactMatch:K,placeholder:i("certificates.search.placeholder")}:{isExactMatch:K,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:w}=Tf(r.config,x.value),v=()=>{C.value=""},b=()=>{l.value++},m=n.ref(""),B=(K,Z)=>{const xe=K.id;if(!Z(xe)){t("copy:error",{entity:K,field:"id",message:i("certificates.errors.copy")});return}t("copy:success",{entity:K,field:"id",message:i("certificates.copy.success",{val:xe})})},q=(K,Z)=>{const xe=JSON.stringify(K);if(!Z(xe)){t("copy:error",{entity:K,message:i("certificates.errors.copy")});return}t("copy:success",{entity:K,message:i("certificates.copy.success_brief")})},J=(K,Z)=>{K.type==="error"?t("copy:error",{entity:Z,field:"cert",message:i("certificates.errors.copy")}):t("copy:success",{entity:Z,field:"cert",message:i("certificates.copy.success_brief")})},I=async K=>{var xe;await((xe=r.canRetrieve)==null?void 0:xe.call(r,K))&&a.push(r.config.getViewRoute(K.id))},_=K=>({label:i("certificates.actions.view"),to:r.config.getViewRoute(K)}),H=K=>({label:i("certificates.actions.edit"),to:r.config.getEditRoute(K)}),U=K=>{if(r.config.getCreateSniRoute)return{label:i("certificates.actions.addSni"),to:r.config.getCreateSniRoute(K)}},Y=n.ref(void 0),R=n.ref(!1),D=n.ref(!1),re=n.ref(""),fe=_f(r.config,x.value),{certificateDataCache:be,getCertificateData:ue}=pt.useCertificate(),pe=K=>{Y.value=K,R.value=!0},we=()=>{R.value=!1},or=async()=>{var K,Z,xe;if((K=Y.value)!=null&&K.id){D.value=!0;try{await c.delete(fe(Y.value.id)),D.value=!1,R.value=!1,l.value++,t("delete:success",Y.value)}catch(We){re.value=((xe=(Z=We.response)==null?void 0:Z.data)==null?void 0:xe.message)||We.message||i("certificates.errors.delete"),t("error",We)}finally{D.value=!1}}};n.watch(w,K=>{if(K.status===Dt.Error){m.value=i("certificates.errors.general"),t("error",K.error);return}be.value={},m.value=""});const L=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("certificates.list.empty_state.description"),title:i("certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(L.value.title=i("certificates.list.empty_state.title"),L.value.ctaText=i("certificates.actions.create"))}),(K,Z)=>{const xe=n.resolveComponent("KButton"),We=n.resolveComponent("KBadge"),Ur=n.resolveComponent("KTruncate"),X=n.resolveComponent("KDropdownItem"),he=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",t1,[n.createVNode(n.unref(If),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":L.value,"enable-entity-actions":"","error-message":m.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":Z[2]||(Z[2]=G=>I(G)),onSort:b},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Nf),{modelValue:C.value,"onUpdate:modelValue":Z[0]||(Z[0]=G=>C.value=G),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(xe,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),subject:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",r1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.subject?G.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",i1,n.toDisplayString(n.unref(ue)(G).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",n1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.expiry?n.unref(o)(G.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",o1,n.toDisplayString(n.unref(ue)(G).schemaExpiry?n.unref(o)(n.unref(ue)(G).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",s1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.dns_names?`dns=${G.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",a1,n.toDisplayString(n.unref(ue)(G).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:G})=>[G!=null&&G.cert?(n.openBlock(),n.createBlock(n.unref(Hh),{key:0,"data-testid":"copy-certificate-cert",notify:ye=>J(ye,G),truncated:!0,uuid:G.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",c1,"-"))]),tags:n.withCtx(({row:G})=>{var ye;return[((ye=G==null?void 0:G.tags)==null?void 0:ye.length)>0?(n.openBlock(),n.createBlock(Ur,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G==null?void 0:G.tags,sr=>(n.openBlock(),n.createBlock(We,{key:sr,onClick:Z[1]||(Z[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(sr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",l1,"-"))]}),actions:n.withCtx(({row:G})=>[n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(X,{"data-testid":"action-entity-copy-id",onClick:sr=>B(G,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(X,{"data-testid":"action-entity-copy-json",onClick:sr=>q(G,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(G)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-view","has-divider":"",item:_(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(G)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-edit",item:H(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Et),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-add-sni",item:U(G.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(G)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:ye=>pe(G)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(Ef),{"action-pending":D.value,"entity-type":n.unref(Sa).Certificate,error:re.value,title:n.unref(i)("certificates.delete.title"),visible:R.value,onCancel:we,onProceed:or},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),ab="",Mr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},d1=Mr(u1,[["__scopeId","data-v-7079e57f"]]),f1={class:"kong-ui-entities-certificates-form"},p1=n.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var b;const r=e,i=Lr.useRouter(),{i18nT:o,i18n:{t:s}}=pt.useI18n(),{getMessageFromError:a}=Of(),{axiosInstance:c}=so({headers:(b=r.config)==null?void 0:b.requestHeaders}),l=n.computed(()=>vi.form[r.config.app].edit),d=n.computed(()=>r.certificateId?ir.Edit:ir.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),y=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),x=n.computed(()=>(d.value===ir.Create||JSON.stringify(p.fields)!==JSON.stringify(y))&&!!p.fields.cert&&!!p.fields.key),C=m=>{var B;p.fields.cert=(m==null?void 0:m.cert)||"",p.fields.key=(m==null?void 0:m.key)||"",p.fields.certAlt=(m==null?void 0:m.cert_alt)||"",p.fields.keyAlt=(m==null?void 0:m.key_alt)||"",p.fields.tags=((B=m==null?void 0:m.tags)==null?void 0:B.join(", "))||"",Object.assign(y,p.fields)},h=()=>{i.push(r.config.cancelRoute)},g=n.computed(()=>{var B,q;let m=`${r.config.apiBaseUrl}${vi.form[r.config.app].validate}`;return r.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((B=r.config)==null?void 0:B.controlPlaneId)||""):r.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(q=r.config)!=null&&q.workspace?`/${r.config.workspace}`:"")),m=m.replace(/{id}/gi,r.certificateId),m}),w=n.computed(()=>{var B,q;let m=`${r.config.apiBaseUrl}${vi.form[r.config.app][d.value]}`;return r.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((B=r.config)==null?void 0:B.controlPlaneId)||""):r.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(q=r.config)!=null&&q.workspace?`/${r.config.workspace}`:"")),m=m.replace(/{id}/gi,r.certificateId),m}),v=async()=>{var m,B,q,J,I,_,H,U,Y;try{p.isReadonly=!0;const R={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(B=(m=p.fields.tags.split(","))==null?void 0:m.map(re=>String(re||"").trim()))==null?void 0:B.filter(re=>re!=="")};let D;await c.post(g.value,R),d.value==="create"?D=await c.post(w.value,R):d.value==="edit"&&(D=((q=r.config)==null?void 0:q.app)==="konnect"?await c.put(w.value,R):await c.patch(w.value,R)),p.fields.cert=((J=D==null?void 0:D.data)==null?void 0:J.cert)||"",p.fields.key=((I=D==null?void 0:D.data)==null?void 0:I.key)||"",p.fields.certAlt=((_=D==null?void 0:D.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((H=D==null?void 0:D.data)==null?void 0:H.key_alt)||"",p.fields.tags=((Y=(U=D==null?void 0:D.data)==null?void 0:U.tags)==null?void 0:Y.join(", "))||"",Object.assign(y,p.fields),t("update",D==null?void 0:D.data)}catch(R){p.errorMessage=a(R),t("error",R)}finally{p.isReadonly=!1}};return(m,B)=>{const q=n.resolveComponent("KTextArea"),J=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",f1,[n.createVNode(n.unref(Bf),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":l.value,"is-readonly":p.isReadonly,onCancel:h,"onFetch:error":B[5]||(B[5]=I=>m.$emit("error",I)),"onFetch:success":C,onLoading:B[6]||(B[6]=I=>m.$emit("loading",I)),onSubmit:v},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.ssl.description"),title:n.unref(s)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(q,{modelValue:p.fields.cert,"onUpdate:modelValue":B[0]||(B[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(q,{modelValue:p.fields.key,"onUpdate:modelValue":B[1]||(B[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(q,{modelValue:p.fields.certAlt,"onUpdate:modelValue":B[2]||(B[2]=I=>p.fields.certAlt=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(q,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":B[3]||(B[3]=I=>p.fields.keyAlt=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key-alt","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.general.description"),title:n.unref(s)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(J,{modelValue:p.fields.tags,"onUpdate:modelValue":B[4]||(B[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(s)("certificates.form.fields.tags.help"),label:n.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),cb="",h1=Mr(p1,[["__scopeId","data-v-ba62e0cc"]]),Ii={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"}}},y1={class:"kong-ui-ca-certificate-entity-config-card"},m1={key:0},g1=n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=e,i=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=pt.useI18n(),{convertKeyToTitle:a}=Vf(),{getPropValue:c}=jf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>Ii.form[r.config.app].edit),p=n.ref(),y=n.computed(()=>{if(p.value)return l(p.value)}),x=n.computed(()=>{var b;return((b=y.value)==null?void 0:b.schemaIssuer)||""}),C=n.computed(()=>{var b,m;return(b=y.value)!=null&&b.schemaExpiry?s((m=y.value)==null?void 0:m.schemaExpiry):""}),h=n.computed(()=>{var b;return((b=y.value)==null?void 0:b.schemaKeyUsages)||[]}),g=(b,m)=>{const B=c("rowValue",m);if(b==="expiry")return C.value;if(b==="key_usages")return h.value;if(B)return B[b]},w=b=>{p.value=b,t("fetch:success",b)},v=n.ref({id:{},updated_at:{},created_at:{},cert:{section:le.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:le.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:le.Basic,type:ne.Json,order:7},...r.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:le.Basic,order:1.7,forceShow:!0},issuer:{section:le.Basic,order:1.5,forceShow:!0},key_usages:{section:le.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(b,m)=>{const B=n.resolveComponent("KCodeBlock"),q=n.resolveComponent("KLabel"),J=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",y1,[n.createVNode(n.unref(Af),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":v.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":m[0]||(m[0]=I=>b.$emit("copy:success",I)),"onFetch:error":m[1]||(m[1]=I=>b.$emit("fetch:error",I)),"onFetch:success":w,onLoading:m[2]||(m[2]=I=>b.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(c)("rowValue",I)?(n.openBlock(),n.createBlock(B,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(q,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(I=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",I)).filter(_=>!i.includes(_)),_=>(n.openBlock(),n.createBlock(n.unref(ki),{key:_,"data-testid":`ca-cert-metadata-${_}`,item:{key:_,label:n.unref(a)(_),value:g(_,I),type:_==="key_usages"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),key_usages:n.withCtx(()=>[h.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",m1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(I,_)=>(n.openBlock(),n.createBlock(J,{key:`key_usages-badge-tag-${_}`,class:"config-badge","data-testid":`key_usages-badge-tag-${_}`,"truncation-tooltip":I},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),lb="",b1=Mr(g1,[["__scopeId","data-v-5110105b"]]),w1={class:"kong-ui-entities-ca-certificates-list"},v1={key:0},k1={key:1},C1={key:0},S1={key:1},x1={key:1},A1=n.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var or;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(or=r.config)==null?void 0:or.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={issuer:{label:i("ca-certificates.list.table_headers.issuer")},expiry:{label:i("ca-certificates.list.table_headers.expiry")},tags:{label:i("ca-certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var de,K;let L=`${r.config.apiBaseUrl}${Ii.list[r.config.app]}`;return r.config.app==="konnect"?L=L.replace(/{controlPlaneId}/gi,((de=r.config)==null?void 0:de.controlPlaneId)||""):r.config.app==="kongManager"&&(L=L.replace(/\/{workspace}/gi,(K=r.config)!=null&&K.workspace?`/${r.config.workspace}`:"")),L}),C=n.ref(""),h=n.computed(()=>{const L=r.config.app==="konnect"||r.config.isExactMatch;return L?{isExactMatch:L,placeholder:i("ca-certificates.search.placeholder")}:{isExactMatch:L,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:w}=Tf(r.config,x.value),v=()=>{C.value=""},b=()=>{l.value++},m=n.ref(""),B=(L,de)=>{const K=L.id;if(!de(K)){t("copy:error",{entity:L,field:"id",message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:L,field:"id",message:i("ca-certificates.copy.success",{val:K})})},q=(L,de)=>{const K=JSON.stringify(L);if(!de(K)){t("copy:error",{entity:L,message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:L,message:i("ca-certificates.copy.success_brief")})},J=async L=>{var K;await((K=r.canRetrieve)==null?void 0:K.call(r,L))&&a.push(r.config.getViewRoute(L.id))},I=L=>({label:i("ca-certificates.actions.view"),to:r.config.getViewRoute(L)}),_=L=>({label:i("ca-certificates.actions.edit"),to:r.config.getEditRoute(L)}),H=n.ref(void 0),U=n.ref(!1),Y=n.ref(!1),R=n.ref(""),D=_f(r.config,x.value),{certificateDataCache:re,getCertificateData:fe}=pt.useCertificate(),be=L=>{H.value=L,U.value=!0},ue=()=>{U.value=!1},pe=async()=>{var L,de,K;if((L=H.value)!=null&&L.id){Y.value=!0;try{await c.delete(D(H.value.id)),Y.value=!1,U.value=!1,l.value++,t("delete:success",H.value)}catch(Z){R.value=((K=(de=Z.response)==null?void 0:de.data)==null?void 0:K.message)||Z.message||i("ca-certificates.errors.delete"),t("error",Z)}finally{Y.value=!1}}};n.watch(w,L=>{if(L.status===Dt.Error){m.value=i("ca-certificates.errors.general"),t("error",L.error);return}re.value={},m.value=""});const we=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("ca-certificates.list.empty_state.description"),title:i("ca-certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(we.value.title=i("ca-certificates.list.empty_state.title"),we.value.ctaText=i("ca-certificates.actions.create"))}),(L,de)=>{const K=n.resolveComponent("KButton"),Z=n.resolveComponent("KBadge"),xe=n.resolveComponent("KTruncate"),We=n.resolveComponent("KDropdownItem"),Ur=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",w1,[n.createVNode(n.unref(If),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":we.value,"enable-entity-actions":"","error-message":m.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":de[2]||(de[2]=X=>J(X)),onSort:b},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Nf),{modelValue:C.value,"onUpdate:modelValue":de[0]||(de[0]=X=>C.value=X),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),issuer:n.withCtx(({row:X})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",v1,n.toDisplayString((he=X==null?void 0:X.metadata)!=null&&he.issuer?X.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",k1,n.toDisplayString(n.unref(fe)(X).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:X})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",C1,n.toDisplayString((he=X==null?void 0:X.metadata)!=null&&he.expiry?n.unref(o)(X.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",S1,n.toDisplayString(n.unref(fe)(X).schemaExpiry?n.unref(o)(n.unref(fe)(X).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:X})=>{var he;return[((he=X==null?void 0:X.tags)==null?void 0:he.length)>0?(n.openBlock(),n.createBlock(xe,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X==null?void 0:X.tags,G=>(n.openBlock(),n.createBlock(Z,{key:G,onClick:de[1]||(de[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(G),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",x1,"-"))]}),actions:n.withCtx(({row:X})=>[n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(We,{"data-testid":"action-entity-copy-id",onClick:G=>B(X,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(We,{"data-testid":"action-entity-copy-json",onClick:G=>q(X,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(X)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-view","has-divider":"",item:I(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(X)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-edit",item:_(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(X)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:he=>be(X)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(Ef),{"action-pending":Y.value,"entity-type":n.unref(Sa).CACertificate,error:R.value,title:n.unref(i)("ca-certificates.delete.title"),visible:U.value,onCancel:ue,onProceed:pe},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),ub="",B1=Mr(A1,[["__scopeId","data-v-d539b808"]]),I1={class:"kong-ui-entities-ca-certificates-form"},E1=n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var v;const r=e,i=Lr.useRouter(),{i18n:{t:o}}=pt.useI18n(),{getMessageFromError:s}=Of(),{axiosInstance:a}=so({headers:(v=r.config)==null?void 0:v.requestHeaders}),c=n.computed(()=>Ii.form[r.config.app].edit),l=n.computed(()=>r.certificateId?ir.Edit:ir.Create),d=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),y=n.computed(()=>(l.value===ir.Create||JSON.stringify(d.fields)!==JSON.stringify(p))&&!!d.fields.cert),x=b=>{var m;d.fields.cert=(b==null?void 0:b.cert)||"",d.fields.certDigest=(b==null?void 0:b.cert_digest)||"",d.fields.tags=((m=b==null?void 0:b.tags)==null?void 0:m.join(", "))||"",Object.assign(p,d.fields)},C=()=>{i.push(r.config.cancelRoute)},h=n.computed(()=>{var m,B;let b=`${r.config.apiBaseUrl}${Ii.form[r.config.app].validate}`;return r.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(B=r.config)!=null&&B.workspace?`/${r.config.workspace}`:"")),b=b.replace(/{id}/gi,r.certificateId),b}),g=n.computed(()=>{var m,B;let b=`${r.config.apiBaseUrl}${Ii.form[r.config.app][l.value]}`;return r.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(B=r.config)!=null&&B.workspace?`/${r.config.workspace}`:"")),b=b.replace(/{id}/gi,r.certificateId),b}),w=async()=>{var b,m,B,q,J,I,_;try{d.isReadonly=!0;const H={cert:d.fields.cert,cert_digest:d.fields.certDigest||null,tags:(m=(b=d.fields.tags.split(","))==null?void 0:b.map(Y=>String(Y||"").trim()))==null?void 0:m.filter(Y=>Y!=="")};let U;await a.post(h.value,H),l.value==="create"?U=await a.post(g.value,H):l.value==="edit"&&(U=((B=r.config)==null?void 0:B.app)==="konnect"?await a.put(g.value,H):await a.patch(g.value,H)),d.fields.cert=((q=U==null?void 0:U.data)==null?void 0:q.cert)||"",d.fields.certDigest=((J=U==null?void 0:U.data)==null?void 0:J.cert_digest)||"",d.fields.tags=((_=(I=U==null?void 0:U.data)==null?void 0:I.tags)==null?void 0:_.join(", "))||"",Object.assign(p,d.fields),t("update",U==null?void 0:U.data)}catch(H){d.errorMessage=s(H),t("error",H)}finally{d.isReadonly=!1}};return(b,m)=>{const B=n.resolveComponent("KTextArea"),q=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",I1,[n.createVNode(n.unref(Bf),{"can-submit":y.value,config:e.config,"edit-id":e.certificateId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:C,"onFetch:error":m[3]||(m[3]=J=>b.$emit("error",J)),"onFetch:success":x,onLoading:m[4]||(m[4]=J=>b.$emit("loading",J)),onSubmit:w},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.cert.description"),title:n.unref(o)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(B,{modelValue:d.fields.cert,"onUpdate:modelValue":m[0]||(m[0]=J=>d.fields.cert=J),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert","disable-character-limit":"",label:n.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:d.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(q,{modelValue:d.fields.certDigest,"onUpdate:modelValue":m[1]||(m[1]=J=>d.fields.certDigest=J),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.general.description"),title:n.unref(o)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(q,{modelValue:d.fields.tags,"onUpdate:modelValue":m[2]||(m[2]=J=>d.fields.tags=J),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(o)("ca-certificates.form.fields.tags.help"),label:n.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),db="",N1=Mr(E1,[["__scopeId","data-v-a1cf8ed1"]]),_1={class:"kong-ui-certificate-entity-config-card"},O1={key:0},T1=n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),{convertKeyToTitle:a}=Vf(),{getPropValue:c}=jf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>vi.form[r.config.app].edit),p=n.ref(),y=n.ref({id:{},cert:{section:le.Basic},key:{section:le.Basic,type:ne.Redacted},metadata:{section:le.Basic,type:ne.Json},snis:{section:le.Basic,type:ne.BadgeTag,label:i("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:i("certificates.form.fields.tags.tooltip")},...r.config.app==="kongManager"&&{expiry:{section:le.Basic,label:i("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:le.Basic,label:i("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:le.Basic,label:i("certificates.list.table_headers.san"),forceShow:!0},subject:{section:le.Basic,label:i("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:le.Advanced},key_alt:{section:le.Advanced,type:ne.Redacted}}),x=I=>{p.value=I,t("fetch:success",I)},C=(I,_)=>{const H=c("rowValue",_);if(I==="expiry")return g.value;if(I==="key_usages")return m.value;if(I==="san_names")return v.value;if(H)return H[I]},h=n.computed(()=>{if(p.value)return l(p.value)}),g=n.computed(()=>{var I,_;return(I=h.value)!=null&&I.schemaExpiry?o((_=h.value)==null?void 0:_.schemaExpiry):""}),w=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaIssuer)||""}),v=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSanNames)||""}),b=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSubject)||""}),m=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaKeyUsages)||[]}),B=n.computed(()=>{var I,_;return((_=(I=p==null?void 0:p.value)==null?void 0:I.snis)==null?void 0:_.length)>0}),q=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),J=I=>{var _,H;return I==="san_names"?i("certificates.list.table_headers.san"):((H=(_=y.value)==null?void 0:_[I])==null?void 0:H.label)||a(I)};return(I,_)=>{const H=n.resolveComponent("KCodeBlock"),U=n.resolveComponent("KLabel"),Y=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",_1,[n.createVNode(n.unref(Af),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":y.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":_[0]||(_[0]=R=>I.$emit("copy:success",R)),"onFetch:error":_[1]||(_[1]=R=>I.$emit("fetch:error",R)),"onFetch:success":x,onLoading:_[2]||(_[2]=R=>I.$emit("loading",R))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(R=>[n.unref(c)("rowValue",R)?(n.openBlock(),n.createBlock(H,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",R),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(U,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(R=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",R)),D=>(n.openBlock(),n.createBlock(n.unref(ki),{key:D,item:{key:D,value:C(D,R),label:J(D),type:D==="key_usages"||D==="snis"||D==="dns_names"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",O1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(R,D)=>(n.openBlock(),n.createBlock(Y,{key:`key_usages-badge-tag-${D}`,class:"config-badge","data-testid":`key_usages-badge-tag-${D}`,"truncation-tooltip":R},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(R),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:2},[B.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},q.value?{name:"cert_alt",fn:n.withCtx(R=>[n.createTextVNode(" > "),n.unref(c)("rowValue",R)?(n.openBlock(),n.createBlock(H,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",R),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),fb="",V1=Mr(T1,[["__scopeId","data-v-69ded264"]]);_e.CACertificateConfigCard=b1,_e.CACertificateForm=N1,_e.CACertificateList=B1,_e.CertificateConfigCard=V1,_e.CertificateForm=h1,_e.CertificateList=d1,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
148
+ `:""}var zg=qg,Gg={dump:zg};function Ua(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 Wg=Ee,Jg=xd,Yg=Ed,Zg=Vd,Qg=jd,Xg=Oa,e0=nf.load,t0=nf.loadAll,r0=Gg.dump,i0=Pe,n0={binary:Md,float:Td,map:Id,null:Nd,pairs:Ld,set:Hd,timestamp:$d,bool:_d,int:Od,merge:Rd,omap:Ud,seq:Bd,str:Ad},o0=Ua("safeLoad","load"),s0=Ua("safeLoadAll","loadAll"),a0=Ua("safeDump","dump"),c0={Type:Wg,Schema:Jg,FAILSAFE_SCHEMA:Yg,JSON_SCHEMA:Zg,CORE_SCHEMA:Qg,DEFAULT_SCHEMA:Xg,load:e0,loadAll:t0,dump:r0,YAMLException:i0,types:n0,safeLoad:o0,safeLoadAll:s0,safeDump:a0};const l0={key:0,class:"config-card-display-form"},u0=["data-testid"],d0={key:0,class:"config-card-prop-section-title"},f0={key:1,class:"config-card-display-json"},p0={key:2,class:"config-card-display-yaml"},h0=ot(n.defineComponent({__name:"ConfigCardDisplay",props:{propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,r=n.useSlots(),{i18n:{t:i}}=Ae.useI18n(),o=c=>!!(c.tooltip||r[`${c.key}-label-tooltip`]),s=n.ref(""),a=n.ref("");return n.watch(()=>t.format,c=>{c==="json"?s.value=JSON.stringify(t.record,null,2):c==="yaml"&&(a.value=c0.dump(t.record))},{immediate:!0}),(c,l)=>{const d=n.resolveComponent("KCodeBlock");return n.openBlock(),n.createElementBlock(n.Fragment,null,[e.format==="structured"?(n.openBlock(),n.createElementBlock("div",l0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propListTypes,p=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${p}-props`,class:n.normalizeClass(`config-card-details-${p}-props`),"data-testid":`config-card-details-${p}-props`},[p!=="basic"?(n.openBlock(),n.createElementBlock("div",d0,n.toDisplayString(p==="advanced"?n.unref(i)("baseConfigCard.sections.advanced"):n.unref(i)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.propertyCollections[p],y=>(n.openBlock(),n.createBlock(ki,{key:y.key,item:y},n.createSlots({label:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label`,{row:y},void 0,!0)]),[y.key]:n.withCtx(({rowValue:x})=>[n.renderSlot(c.$slots,y.key,{row:y,rowValue:x},void 0,!0)]),_:2},[o(y)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(c.$slots,`${y.key}-label-tooltip`,{row:y},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,u0))),128))])):n.createCommentVNode("",!0),e.format==="json"?(n.openBlock(),n.createElementBlock("div",f0,[n.createVNode(d,{id:"config-card-codeblock",code:s.value,language:"json",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0),e.format==="yaml"?(n.openBlock(),n.createElementBlock("div",p0,[n.createVNode(d,{id:"config-card-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])])):n.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-6c45e9e4"]]),xf="24px",y0=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},m0=e=>(n.pushScopeId("data-v-37e959c8"),e=e(),n.popScopeId(),e),g0=["aria-hidden"],b0={key:0,"data-testid":"kui-icon-svg-title"},w0=m0(()=>n.createElementVNode("path",{d:"M14 9.9V8.2C14.55 7.96667 15.1125 7.79167 15.6875 7.675C16.2625 7.55833 16.8667 7.5 17.5 7.5C17.9333 7.5 18.3583 7.53333 18.775 7.6C19.1917 7.66667 19.6 7.75 20 7.85V9.45C19.6 9.3 19.1958 9.1875 18.7875 9.1125C18.3792 9.0375 17.95 9 17.5 9C16.8667 9 16.2583 9.07917 15.675 9.2375C15.0917 9.39583 14.5333 9.61667 14 9.9ZM14 15.4V13.7C14.55 13.4667 15.1125 13.2917 15.6875 13.175C16.2625 13.0583 16.8667 13 17.5 13C17.9333 13 18.3583 13.0333 18.775 13.1C19.1917 13.1667 19.6 13.25 20 13.35V14.95C19.6 14.8 19.1958 14.6875 18.7875 14.6125C18.3792 14.5375 17.95 14.5 17.5 14.5C16.8667 14.5 16.2583 14.575 15.675 14.725C15.0917 14.875 14.5333 15.1 14 15.4ZM14 12.65V10.95C14.55 10.7167 15.1125 10.5417 15.6875 10.425C16.2625 10.3083 16.8667 10.25 17.5 10.25C17.9333 10.25 18.3583 10.2833 18.775 10.35C19.1917 10.4167 19.6 10.5 20 10.6V12.2C19.6 12.05 19.1958 11.9375 18.7875 11.8625C18.3792 11.7875 17.95 11.75 17.5 11.75C16.8667 11.75 16.2583 11.8292 15.675 11.9875C15.0917 12.1458 14.5333 12.3667 14 12.65ZM6.5 16C7.28333 16 8.04583 16.0875 8.7875 16.2625C9.52917 16.4375 10.2667 16.7 11 17.05V7.2C10.3167 6.8 9.59167 6.5 8.825 6.3C8.05833 6.1 7.28333 6 6.5 6C5.9 6 5.30417 6.05833 4.7125 6.175C4.12083 6.29167 3.55 6.46667 3 6.7V16.6C3.58333 16.4 4.1625 16.25 4.7375 16.15C5.3125 16.05 5.9 16 6.5 16ZM13 17.05C13.7333 16.7 14.4708 16.4375 15.2125 16.2625C15.9542 16.0875 16.7167 16 17.5 16C18.1 16 18.6875 16.05 19.2625 16.15C19.8375 16.25 20.4167 16.4 21 16.6V6.7C20.45 6.46667 19.8792 6.29167 19.2875 6.175C18.6958 6.05833 18.1 6 17.5 6C16.7167 6 15.9417 6.1 15.175 6.3C14.4083 6.5 13.6833 6.8 13 7.2V17.05ZM12 20C11.2 19.3667 10.3333 18.875 9.4 18.525C8.46667 18.175 7.5 18 6.5 18C5.8 18 5.1125 18.0917 4.4375 18.275C3.7625 18.4583 3.11667 18.7167 2.5 19.05C2.15 19.2333 1.8125 19.225 1.4875 19.025C1.1625 18.825 1 18.5333 1 18.15V6.1C1 5.91667 1.04583 5.74167 1.1375 5.575C1.22917 5.40833 1.36667 5.28333 1.55 5.2C2.31667 4.8 3.11667 4.5 3.95 4.3C4.78333 4.1 5.63333 4 6.5 4C7.46667 4 8.4125 4.125 9.3375 4.375C10.2625 4.625 11.15 5 12 5.5C12.85 5 13.7375 4.625 14.6625 4.375C15.5875 4.125 16.5333 4 17.5 4C18.3667 4 19.2167 4.1 20.05 4.3C20.8833 4.5 21.6833 4.8 22.45 5.2C22.6333 5.28333 22.7708 5.40833 22.8625 5.575C22.9542 5.74167 23 5.91667 23 6.1V18.15C23 18.5333 22.8375 18.825 22.5125 19.025C22.1875 19.225 21.85 19.2333 21.5 19.05C20.8833 18.7167 20.2375 18.4583 19.5625 18.275C18.8875 18.0917 18.2 18 17.5 18C16.5 18 15.5333 18.175 14.6 18.525C13.6667 18.875 12.8 19.3667 12 20Z",fill:"currentColor"},null,-1)),v0=n.defineComponent({__name:"BookIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:xf,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 xf}),i=n.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:r.value,lineHeight:"0",width:r.value}));return(o,s)=>(n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:n.normalizeStyle(i.value)},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-book-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(n.openBlock(),n.createElementBlock("title",b0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),w0],8,g0))]),_:1},8,["aria-hidden","style"]))}}),k0=y0(v0,[["__scopeId","data-v-37e959c8"]]),C0={"data-testid":"config-card-title"},S0={class:"config-card-actions"},x0=["href"],A0={key:2,class:"config-card-details-section"},B0={key:3,class:"config-card-details-section"},I0=["data-testid"],E0={key:0,class:"config-card-prop-section-title"},Af=ot(n.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:t}){var r;const i=e,o=n.useSlots(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{convertKeyToTitle:c}=Ae.useStringHelpers(),{axiosInstance:l}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),d=[{label:s("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=n.ref("structured"),y=_=>{p.value=_==null?void 0:_.value},x={id:{type:ne.ID,label:s("baseConfigCard.commonFields.id_label"),order:0,section:le.Basic},name:{order:1,section:le.Basic},enabled:{type:ne.BadgeStatus,order:2,section:le.Basic},updated_at:{type:ne.Date,label:s("baseConfigCard.commonFields.updated_at_label"),order:3,section:le.Basic},created_at:{type:ne.Date,label:s("baseConfigCard.commonFields.created_at_label"),order:4,section:le.Basic},tags:{type:ne.BadgeTag,order:-1,section:le.Basic}},C=n.ref(!1),h=n.ref(!1),g=n.ref(""),w=n.ref(),v=n.computed(()=>{var _,H,U;if(!w.value)return[];const Y=[],R=Object.keys(w.value).length;for(const D in w.value){const re=(H=(_=i.configSchema)==null?void 0:_[D])==null?void 0:H.order,fe=(U=x[D])==null?void 0:U.order;let be=R;(fe||fe===0)&&(be=fe===-1?R+1:fe),re&&(be=re===-1?R+1:re),Y.push([D,be])}return Y.sort(function(D,re){return D[1]-re[1]}),Y.map(D=>{var re,fe;const be=D[0],ue=(re=w.value)==null?void 0:re[be],pe=((fe=i.configSchema)==null?void 0:fe[be])||{},we=x[be];return{key:be,value:ue,hidden:pe.hidden||!1,type:pe.type??((we==null?void 0:we.type)||ne.Text),label:pe.label??((we==null?void 0:we.label)||c(be)),tooltip:pe.tooltip??((we==null?void 0:we.tooltip)||void 0),section:pe.section??((we==null?void 0:we.section)||le.Advanced)}}).filter(D=>!D.hidden&&D.key!==i.pluginConfigKey)}),b=n.computed(()=>{var _,H;if(!w.value||!i.pluginConfigKey)return[];const U=w.value[i.pluginConfigKey]||{},Y=Object.keys(U).length,R=[];for(const D in U){const re=(H=(_=i.pluginConfigSchema)==null?void 0:_[D])==null?void 0:H.order,fe=U[D];let be=fe!=null&&fe!==""?Y-1:Y;re&&(be=re===-1?Y+1:re),R.push([D,be])}return R.sort(function(D,re){return D[1]-re[1]}),R.map(D=>{var re;const fe=D[0],be=U[fe],ue=((re=i.pluginConfigSchema)==null?void 0:re[fe])||{};return{key:fe,value:be,hidden:ue.hidden||!1,type:ue.type??ne.Text,label:ue.label??c(fe),tooltip:ue.tooltip??void 0,section:le.Plugin}}).filter(D=>!D.hidden)}),m=n.computed(()=>{var _,H,U,Y;return{basic:(_=v.value)==null?void 0:_.filter(R=>R.section===le.Basic),advanced:(H=v.value)==null?void 0:H.filter(R=>R.section===le.Advanced),plugin:(Y=b.value)==null?void 0:Y.concat((U=v.value)==null?void 0:U.filter(R=>R.section===le.Plugin))}}),B=n.computed(()=>{const _=[];return m.value.basic.length&&_.push("basic"),m.value.advanced.length&&_.push("advanced"),m.value.plugin.length&&_.push("plugin"),_}),q=_=>!!(_.tooltip||o[`${_.key}-label-tooltip`]),J=n.computed(()=>{var _,H;let U=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?U=U.replace(/{controlPlaneId}/gi,((_=i.config)==null?void 0:_.controlPlaneId)||""):i.config.app==="kongManager"&&(U=U.replace(/\/{workspace}/gi,(H=i.config)!=null&&H.workspace?`/${i.config.workspace}`:"")),U=U.replace(/{id}/gi,i.config.entityId),U}),I=_=>{w.value&&_(JSON.stringify(w.value))?t("copy:success",w.value):t("copy:error")};return n.watch(C,_=>{t("loading",_)},{immediate:!0}),n.onBeforeMount(async()=>{h.value=!1,C.value=!0;try{const{data:_}=await l.get(J.value);if(i.dataKey)if(typeof _[i.dataKey]<"u")w.value={..._[i.dataKey]};else throw new Error(s("errors.dataKeyUndefined",{dataKey:i.dataKey}));else w.value={..._};Object.keys(i.configSchema).filter(H=>i.configSchema[H].forceShow).forEach(H=>{w.value&&typeof w.value[H]>"u"&&(w.value[H]=null)}),t("fetch:success",_)}catch(_){const H=a(_);g.value=H.startsWith("code")?s("baseConfigCard.errors.load"):H,h.value=!0,t("fetch:error",_)}finally{C.value=!1}}),(_,H)=>{const U=n.resolveComponent("KLabel"),Y=n.resolveComponent("KSelect"),R=n.resolveComponent("KButton"),D=n.resolveComponent("KClipboardProvider"),re=n.resolveComponent("KSkeleton"),fe=n.resolveComponent("KEmptyState"),be=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(be,{class:"kong-ui-entity-base-config-card"},n.createSlots({actions:n.withCtx(()=>[n.createElementVNode("div",S0,[n.renderSlot(_.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(U,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createBlock(Y,{key:1,appearance:"select","data-testid":"select-config-format",items:d,onChange:y})):n.createCommentVNode("",!0),i.config.jsonYamlEnabled&&e.configCardDoc?(n.openBlock(),n.createBlock(R,{key:2,appearance:"btn-link",class:"book-icon","data-testid":"book-icon"},{default:n.withCtx(()=>[n.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[n.createVNode(n.unref(k0),{size:n.unref(_y)},null,8,["size"])],8,x0)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(D,{key:3},{default:n.withCtx(({copyToClipboard:ue})=>[!C.value&&!h.value?(n.openBlock(),n.createBlock(R,{key:0,appearance:"btn-link","data-testid":"json-copy-button",onClick:pe=>I(ue)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)]),_:1}))])]),body:n.withCtx(()=>[C.value?(n.openBlock(),n.createBlock(re,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):h.value?(n.openBlock(),n.createBlock(fe,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(g.value),1)]),_:1})):n.createCommentVNode("",!0),e.config.jsonYamlEnabled?(n.openBlock(),n.createElementBlock("div",A0,[n.createVNode(h0,{format:p.value,"prop-list-types":B.value,"property-collections":m.value,record:w.value},n.createSlots({_:2},[n.renderList(Object.keys(_.$slots),ue=>({name:ue,fn:n.withCtx(({row:pe,rowValue:we})=>[n.renderSlot(_.$slots,ue,{row:pe,rowValue:we},void 0,!0)])}))]),1032,["format","prop-list-types","property-collections","record"])])):(n.openBlock(),n.createElementBlock("div",B0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(B.value,ue=>(n.openBlock(),n.createElementBlock("div",{key:`config-card-details-${ue}-props`,class:n.normalizeClass(`config-card-details-${ue}-props`),"data-testid":`config-card-details-${ue}-props`},[ue!=="basic"?(n.openBlock(),n.createElementBlock("div",E0,n.toDisplayString(ue==="advanced"?n.unref(s)("baseConfigCard.sections.advanced"):n.unref(s)("baseConfigCard.sections.plugin")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value[ue],pe=>(n.openBlock(),n.createBlock(ki,{key:pe.key,item:pe},n.createSlots({label:n.withCtx(()=>[n.renderSlot(_.$slots,`${pe.key}-label`,{row:pe},void 0,!0)]),[pe.key]:n.withCtx(({rowValue:we})=>[n.renderSlot(_.$slots,pe.key,{row:pe,rowValue:we},void 0,!0)]),_:2},[q(pe)?{name:"label-tooltip",fn:n.withCtx(()=>[n.renderSlot(_.$slots,`${pe.key}-label-tooltip`,{row:pe},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,I0))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:n.withCtx(()=>[n.createElementVNode("div",C0,[n.renderSlot(_.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),[["__scopeId","data-v-64349aa2"]]),N0=["onReset","onSubmit"],_0={class:"form-actions","data-testid":"form-actions"},Bf=ot(n.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:t}){var r;const i=e,o=Lr.useRouter(),{i18n:{t:s}}=Ae.useI18n(),{getMessageFromError:a}=Ae.useErrors(),{axiosInstance:c}=Ae.useAxios({headers:(r=i.config)==null?void 0:r.requestHeaders}),l=n.ref(!1),d=n.ref(!1),p=n.ref(""),y=n.computed(()=>i.canSubmit===!1||i.isReadonly),x=n.computed(()=>{var w,v;if(!i.editId)return"";let b=`${i.config.apiBaseUrl}${i.fetchUrl}`;return i.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((w=i.config)==null?void 0:w.controlPlaneId)||""):i.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(v=i.config)!=null&&v.workspace?`/${i.config.workspace}`:"")),b=b.replace(/{id}/gi,i.editId),b}),C=()=>{i.config.cancelRoute?o.push(i.config.cancelRoute):h()},h=()=>{t("cancel")},g=()=>{y.value||t("submit")};return n.watch(()=>l.value,w=>{t("loading",w)},{immediate:!0}),n.onBeforeMount(async()=>{if(i.editId)try{d.value=!1,l.value=!0;const{data:w}=await c.get(x.value);t("fetch:success",w)}catch(w){const v=a(w);p.value=v.startsWith("code")?s("baseForm.errors.edit"):v,d.value=!0,t("fetch:error",w)}finally{l.value=!1}}),(w,v)=>{const b=n.resolveComponent("KSkeleton"),m=n.resolveComponent("KEmptyState"),B=n.resolveComponent("KAlert"),q=n.resolveComponent("KButton"),J=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(J,{class:"kong-ui-entity-base-form"},{body:n.withCtx(()=>[l.value?(n.openBlock(),n.createBlock(b,{key:0,type:"form"})):d.value?(n.openBlock(),n.createBlock(m,{key:1,"cta-text":n.unref(s)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":C,"is-error":!0},{message:n.withCtx(()=>[n.createElementVNode("h3",null,n.toDisplayString(p.value),1)]),_:1},8,["cta-text"])):(n.openBlock(),n.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:n.withModifiers(h,["prevent"]),onSubmit:n.withModifiers(g,["prevent"])},[n.renderSlot(w.$slots,"default",{},void 0,!0),e.errorMessage?(n.openBlock(),n.createBlock(B,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):n.createCommentVNode("",!0),n.createElementVNode("div",_0,[n.renderSlot(w.$slots,"form-actions",{},()=>[n.createVNode(q,{appearance:"outline","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),n.createVNode(q,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(s)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,N0))]),_:3})}}}),[["__scopeId","data-v-44a90aae"]]),O0={key:0},T0=ot(n.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const t=e,r=n.computed(()=>{var g;return((g=t.rowEl)==null?void 0:g.querySelector(`[data-testid="${t.keyName}"]`))||null}),i=n.computed(()=>{var g;return((g=r.value)==null?void 0:g.querySelector('[role="button"]'))||null}),o=n.computed(()=>{var g,w;const v=(g=t.rowEl)==null?void 0:g.querySelectorAll("td");return v?((w=v[0])==null?void 0:w.getAttribute("data-testid"))===t.keyName:!1});let s;const a=()=>{s&&(s.disconnect(),s=void 0)},c=()=>{var g,w,v;d.value=((g=i.value)==null?void 0:g.getBoundingClientRect().width)||0,p.value=((w=r.value)==null?void 0:w.clientWidth)||0,y.value=((v=l.value)==null?void 0:v.innerText)||""},l=n.ref({}),d=n.ref(0),p=n.ref(0),y=n.ref(""),x=n.computed(()=>[i.value,r.value]),C=n.watch(x,g=>{if(o.value&&(a(),"ResizeObserver"in window&&window)){s=new ResizeObserver(w=>{window.requestAnimationFrame(()=>{!Array.isArray(w)||!w.length||c()})});for(const w of g)w&&s.observe(w)}},{immediate:!0,flush:"post",deep:!0}),h=n.computed(()=>o.value?d.value>p.value:!1);return n.onMounted(()=>{c()}),n.onUnmounted(()=>{C()}),(g,w)=>{const v=n.resolveComponent("KTooltip");return n.openBlock(),n.createElementBlock("span",{ref_key:"contentRef",ref:l,class:"content-wrapper"},[o.value?(n.openBlock(),n.createElementBlock("span",O0,[n.createVNode(v,{disabled:!h.value,label:y.value,"max-width":"300",placement:"bottomStart"},{default:n.withCtx(()=>[n.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["disabled","label"])])):n.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),[["__scopeId","data-v-f8a220e9"]]),V0={class:"toolbar-container"},j0={key:0,class:"toolbar-button-container"},D0=["data-testid"],If=ot(n.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:String,default:""},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,{i18n:{t:i}}=Ae.useI18n(),o=n.computed(()=>r.cacheIdentifier||r.preferencesStorageKey),s=m=>m.hasData||!!r.query,a=n.computed(()=>{const m=[];return Object.keys(r.tableHeaders).forEach(B=>{const q=r.tableHeaders[B];m.push({label:q.label??B,key:B,sortable:q.sortable??!1})}),r.enableEntityActions&&m.push({key:"actions",hideLabel:!0}),m}),c=m=>({"data-rowid":m.id,"data-testid":m.name,...r.rowAttributes(m)}),l=n.ref({}),d=m=>{var B;return(B=l.value)==null?void 0:B.$el.querySelector(`[data-rowid="${m.id}"]`)},p=m=>{const B={"data-testid":m.headerKey,...r.cellAttributes(m)};return m.colIndex===0&&(B.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),B},y=()=>{t("empty-state-cta-clicked"),x()},x=()=>{t("clear-search-input")},C=n.computed(()=>r.disableRowClick?void 0:(m,B)=>{t("click:row",B)}),h=m=>{t("sort",m)},{setTablePreferences:g,getTablePreferences:w}=qh(),v=n.computed(()=>{const m=w(r.preferencesStorageKey);return{...r.initialFetcherParams,...m}}),b=m=>{r.preferencesStorageKey&&g(r.preferencesStorageKey,m)};return(m,B)=>{const q=n.resolveComponent("KIcon"),J=n.resolveComponent("KButton"),I=n.resolveComponent("KDropdownMenu"),_=n.resolveComponent("KTable"),H=n.resolveComponent("KCard");return n.openBlock(),n.createBlock(H,{class:"kong-ui-entity-base-table",title:e.title},{body:n.withCtx(()=>[n.createVNode(_,{ref_key:"tableRefs",ref:l,"cache-identifier":o.value,"cell-attrs":p,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?n.unref(i)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-title":e.errorMessage,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":!!e.errorMessage,headers:a.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":c,"search-input":e.query,onKtableEmptyStateCtaClicked:y,"onRow:click":C.value,onSort:B[0]||(B[0]=U=>h(U)),"onUpdate:tablePreferences":b},n.createSlots({toolbar:n.withCtx(({state:U})=>[n.withDirectives(n.createElementVNode("div",V0,[n.renderSlot(m.$slots,"toolbar-filter",{},void 0,!0),m.$slots["toolbar-button"]?(n.openBlock(),n.createElementBlock("div",j0,[n.renderSlot(m.$slots,"toolbar-button",{},void 0,!0)])):n.createCommentVNode("",!0)],512),[[n.vShow,s(U)]])]),actions:n.withCtx(({row:U,rowKey:Y,rowValue:R})=>[n.createElementVNode("div",{class:"actions-container","data-testid":U.name},[n.createVNode(I,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:n.withCtx(()=>[n.renderSlot(m.$slots,"actions",{row:U,rowKey:Y,rowValue:R},void 0,!0)]),default:n.withCtx(()=>[n.createVNode(J,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:n.withCtx(()=>[n.createVNode(q,{color:n.unref(Ey),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,D0)]),_:2},[n.renderList(e.tableHeaders,(U,Y)=>({name:Y,fn:n.withCtx(({row:R,rowKey:D,rowValue:re})=>[n.createVNode(T0,{"key-name":String(Y),"row-el":d(R)},{default:n.withCtx(()=>[n.renderSlot(m.$slots,Y,{row:R,rowKey:D,rowValue:re},()=>[n.createTextVNode(n.toDisplayString(re),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title"])}}}),[["__scopeId","data-v-6bf92df6"]]),P0={key:0,class:"kong-ui-entity-delete-error"},$0={key:1,class:"description"},Ef=ot(n.defineComponent({__name:"EntityDeleteModal",props:{visible:{type:Boolean,required:!0,default:!1},title:{type:String,default:"Delete"},entityType:{type:String,required:!0},entityName:{type:String,default:""},needConfirm:{type:Boolean,default:!0},description:{type:String,default:""},actionPending:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["cancel","proceed"],setup(e,{emit:t}){const r=e,{i18nT:i}=Ae.useI18n(),o=n.computed(()=>r.needConfirm?r.entityName:""),s=()=>{t("cancel")},a=()=>{t("proceed")};return(c,l)=>{const d=n.resolveComponent("KAlert"),p=n.resolveComponent("KPrompt");return n.openBlock(),n.createBlock(p,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":o.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:s,onProceed:a},{"body-content":n.withCtx(()=>[e.error?(n.openBlock(),n.createElementBlock("div",P0,[n.createVNode(d,{appearance:"danger"},{alertMessage:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.error),1)]),_:1})])):n.createCommentVNode("",!0),n.createVNode(n.unref(i),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},n.createSlots({entityType:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:n.withCtx(()=>[n.createElementVNode("strong",null,n.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(n.openBlock(),n.createElementBlock("div",$0,[n.renderSlot(c.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(r.description),1)],!0)])):n.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),[["__scopeId","data-v-1c9a2a07"]]),R0={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},M0={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},U0=["fill"],L0={mask:"url(#mask0_180_20349)"},H0=["fill"],F0=n.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${By})`}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",R0,[n.createElementVNode("mask",M0,[n.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,U0)]),n.createElementVNode("g",L0,[n.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,H0)])]))}}),K0={key:1,class:"kong-ui-entity-filter"},q0={class:"menu-item-title"},z0={class:"menu-item-indicator"},G0={class:"menu-item-body"},W0=["for"],J0={class:"menu-item-buttons"},Nf=ot(n.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){const r=e,{i18n:{t:i}}=Ae.useI18n(),o=n.ref(!1),s=n.ref({}),a=n.computed(()=>{const w=[];return new URLSearchParams(r.modelValue).forEach((v,b)=>{v!==""&&w.push(b)}),w}),c=n.computed(()=>{const w=r.config.fields;return Object.keys(w).filter(v=>w[v].searchable).map(v=>({label:w[v].label||v,value:v}))});n.watch(()=>r.modelValue,w=>{s.value={},new URLSearchParams(w).forEach((v,b)=>{s.value[b]=v})});const l=()=>{o.value=!o.value},d=w=>{t("update:modelValue",w)},p=w=>`filter-${w}`,y=w=>{var v,b;return(((b=(v=r.config.schema)==null?void 0:v[w])==null?void 0:b.values)??[]).map(m=>({value:m,label:m}))},x=w=>{var v,b;return((b=(v=r.config.schema)==null?void 0:v[w])==null?void 0:b.type)??"text"},C=w=>{s.value={...s.value,[w]:""},g()},h=()=>{s.value={},g(!0)},g=(w=!1)=>{const v=Object.keys(s.value).reduce((b,m)=>(s.value[m]&&(b[m]=`${s.value[m]}`),b),{});w&&(o.value=!1),t("update:modelValue",new URLSearchParams(v).toString())};return(w,v)=>{const b=n.resolveComponent("KInput"),m=n.resolveComponent("KButton"),B=n.resolveComponent("KSelect"),q=n.resolveComponent("KMenuItem"),J=n.resolveComponent("KMenu");return e.config.isExactMatch?(n.openBlock(),n.createBlock(b,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":d},{icon:n.withCtx(()=>[n.createVNode(F0)]),_:1},8,["model-value","placeholder"])):(n.openBlock(),n.createElementBlock("div",K0,[n.createVNode(m,{appearance:"btn-link","data-testid":"filter-button",icon:"filter",onClick:l},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.filterButtonText"))+" "+n.toDisplayString(a.value.length>0?`(${a.value.length})`:""),1)]),_:1}),n.withDirectives(n.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:l},null,512),[[n.vShow,o.value]]),n.withDirectives(n.createVNode(J,{class:"kong-ui-entity-filter-menu"},{body:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(I,_)=>(n.openBlock(),n.createBlock(q,{key:I.value,"data-testid":I.value,expandable:"","last-menu-item":_===c.value.length-1},{itemTitle:n.withCtx(()=>[n.createElementVNode("span",q0,[n.createTextVNode(n.toDisplayString(I.label)+" ",1),n.withDirectives(n.createElementVNode("span",z0,null,512),[[n.vShow,a.value.includes(I.value)]])])]),itemBody:n.withCtx(()=>{var H,U;return[n.createElementVNode("div",G0,[n.createElementVNode("label",{class:"menu-item-label",for:p(I.value)},n.toDisplayString(n.unref(i)("filter.fieldLabel")),9,W0),((U=(H=e.config.schema)==null?void 0:H[I.value])==null?void 0:U.type)==="select"?(n.openBlock(),n.createBlock(B,{key:0,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":Y=>s.value[I.value]=Y,appearance:"select",items:y(I.value),placeholder:n.unref(i)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(n.openBlock(),n.createBlock(b,{key:1,id:p(I.value),modelValue:s.value[I.value],"onUpdate:modelValue":Y=>s.value[I.value]=Y,autocomplete:"off",placeholder:n.unref(i)("filter.inputPlaceholder"),size:"small",type:x(I.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),n.createElementVNode("div",J0,[n.createVNode(m,{appearance:"btn-link","data-testid":"apply-filter",size:"small",onClick:v[0]||(v[0]=Y=>g(!0))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.applyButtonText")),1)]),_:1}),n.createVNode(m,{appearance:"btn-link","data-testid":"clear-filter",size:"small",onClick:Y=>C(I.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:n.withCtx(()=>[n.createVNode(m,{onClick:h},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("filter.clearAllButtonText")),1)]),_:1})]),_:1},512),[[n.vShow,o.value]])]))}}}),[["__scopeId","data-v-745f38c0"]]),Et=n.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const t=e,r=n.ref(void 0),i=n.computed(()=>r.value===!0||r.value!==void 0&&t.forceShow===!0);return n.watch(()=>t.authFunction,async()=>{r.value=await t.authFunction()},{immediate:!0}),(o,s)=>i.value?n.renderSlot(o.$slots,"default",{key:0,isAllowed:r.value}):n.createCommentVNode("",!0)}}),Y0={class:"form-section-wrapper"},Z0={key:0,class:"form-section-title"},Q0={key:1,class:"form-section-description"},X0={key:2,class:"form-section-footer"},e1={class:"form-section-content"},oo=ot(n.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1}},setup(e){const t=n.useSlots();return(r,i)=>(n.openBlock(),n.createElementBlock("fieldset",{class:n.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[n.createElementVNode("div",Y0,[e.hideInfoHeader?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(n.openBlock(),n.createElementBlock("h4",Z0,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.description||n.unref(t).description?(n.openBlock(),n.createElementBlock("div",Q0,[n.renderSlot(r.$slots,"description",{},()=>[n.createElementVNode("p",null,n.toDisplayString(e.description),1)],!0)])):n.createCommentVNode("",!0),n.unref(t).footer?(n.openBlock(),n.createElementBlock("div",X0,[n.renderSlot(r.$slots,"footer",{},void 0,!0)])):n.createCommentVNode("",!0)],2)),n.createElementVNode("div",e1,[n.renderSlot(r.$slots,"default",{},void 0,!0)])])],2))}}),[["__scopeId","data-v-8b6dc312"]]),{useAxios:so,useDeleteUrlBuilder:_f,useErrors:Of,useFetchUrlBuilder:tb,useFetcher:Tf,useDebouncedFilter:rb,useStringHelpers:Vf,useHelpers:jf,useGatewayFeatureSupported:ib,useTruncationDetector:nb}=Ae,ob="",sb="",t1={class:"kong-ui-entities-certificates-list"},r1={key:0},i1={key:1},n1={key:0},o1={key:1},s1={key:0},a1={key:1},c1={key:1},l1={key:1},u1=n.defineComponent({__name:"CertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canCreateSni:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var de;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(de=r.config)==null?void 0:de.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={subject:{label:i("certificates.list.table_headers.subject")},expiry:{label:i("certificates.list.table_headers.expiry")},san:{label:i("certificates.list.table_headers.san")},cert:{label:i("certificates.list.table_headers.cert")},tags:{label:i("certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var Z,xe;let K=`${r.config.apiBaseUrl}${vi.list[r.config.app]}`;return r.config.app==="konnect"?K=K.replace(/{controlPlaneId}/gi,((Z=r.config)==null?void 0:Z.controlPlaneId)||""):r.config.app==="kongManager"&&(K=K.replace(/\/{workspace}/gi,(xe=r.config)!=null&&xe.workspace?`/${r.config.workspace}`:"")),K}),C=n.ref(""),h=n.computed(()=>{const K=r.config.app==="konnect"||r.config.isExactMatch;return K?{isExactMatch:K,placeholder:i("certificates.search.placeholder")}:{isExactMatch:K,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:w}=Tf(r.config,x.value),v=()=>{C.value=""},b=()=>{l.value++},m=n.ref(""),B=(K,Z)=>{const xe=K.id;if(!Z(xe)){t("copy:error",{entity:K,field:"id",message:i("certificates.errors.copy")});return}t("copy:success",{entity:K,field:"id",message:i("certificates.copy.success",{val:xe})})},q=(K,Z)=>{const xe=JSON.stringify(K);if(!Z(xe)){t("copy:error",{entity:K,message:i("certificates.errors.copy")});return}t("copy:success",{entity:K,message:i("certificates.copy.success_brief")})},J=(K,Z)=>{K.type==="error"?t("copy:error",{entity:Z,field:"cert",message:i("certificates.errors.copy")}):t("copy:success",{entity:Z,field:"cert",message:i("certificates.copy.success_brief")})},I=async K=>{var xe;await((xe=r.canRetrieve)==null?void 0:xe.call(r,K))&&a.push(r.config.getViewRoute(K.id))},_=K=>({label:i("certificates.actions.view"),to:r.config.getViewRoute(K)}),H=K=>({label:i("certificates.actions.edit"),to:r.config.getEditRoute(K)}),U=K=>{if(r.config.getCreateSniRoute)return{label:i("certificates.actions.addSni"),to:r.config.getCreateSniRoute(K)}},Y=n.ref(void 0),R=n.ref(!1),D=n.ref(!1),re=n.ref(""),fe=_f(r.config,x.value),{certificateDataCache:be,getCertificateData:ue}=pt.useCertificate(),pe=K=>{Y.value=K,R.value=!0},we=()=>{R.value=!1},or=async()=>{var K,Z,xe;if((K=Y.value)!=null&&K.id){D.value=!0;try{await c.delete(fe(Y.value.id)),D.value=!1,R.value=!1,l.value++,t("delete:success",Y.value)}catch(We){re.value=((xe=(Z=We.response)==null?void 0:Z.data)==null?void 0:xe.message)||We.message||i("certificates.errors.delete"),t("error",We)}finally{D.value=!1}}};n.watch(w,K=>{if(K.status===Dt.Error){m.value=i("certificates.errors.general"),t("error",K.error);return}be.value={},m.value=""});const L=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("certificates.list.empty_state.description"),title:i("certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(L.value.title=i("certificates.list.empty_state.title"),L.value.ctaText=i("certificates.actions.create"))}),(K,Z)=>{const xe=n.resolveComponent("KButton"),We=n.resolveComponent("KBadge"),Ur=n.resolveComponent("KTruncate"),X=n.resolveComponent("KDropdownItem"),he=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",t1,[n.createVNode(n.unref(If),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":L.value,"enable-entity-actions":"","error-message":m.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":Z[2]||(Z[2]=G=>I(G)),onSort:b},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Nf),{modelValue:C.value,"onUpdate:modelValue":Z[0]||(Z[0]=G=>C.value=G),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(xe,{appearance:"primary","data-testid":"toolbar-add-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.list.toolbar_actions.new_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),subject:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",r1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.subject?G.metadata.subject:"-"),1)):(n.openBlock(),n.createElementBlock("b",i1,n.toDisplayString(n.unref(ue)(G).schemaSubject||"-"),1))]}),expiry:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",n1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.expiry?n.unref(o)(G.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",o1,n.toDisplayString(n.unref(ue)(G).schemaExpiry?n.unref(o)(n.unref(ue)(G).schemaExpiry):"-"),1))]}),san:n.withCtx(({row:G})=>{var ye;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",s1,n.toDisplayString((ye=G==null?void 0:G.metadata)!=null&&ye.dns_names?`dns=${G.metadata.dns_names.join(", ")}`:"-"),1)):(n.openBlock(),n.createElementBlock("span",a1,n.toDisplayString(n.unref(ue)(G).schemaSanNames||"-"),1))]}),cert:n.withCtx(({row:G})=>[G!=null&&G.cert?(n.openBlock(),n.createBlock(n.unref(Hh),{key:0,"data-testid":"copy-certificate-cert",notify:ye=>J(ye,G),truncated:!0,uuid:G.cert},null,8,["notify","uuid"])):(n.openBlock(),n.createElementBlock("span",c1,"-"))]),tags:n.withCtx(({row:G})=>{var ye;return[((ye=G==null?void 0:G.tags)==null?void 0:ye.length)>0?(n.openBlock(),n.createBlock(Ur,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G==null?void 0:G.tags,sr=>(n.openBlock(),n.createBlock(We,{key:sr,onClick:Z[1]||(Z[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(sr),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",l1,"-"))]}),actions:n.withCtx(({row:G})=>[n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(X,{"data-testid":"action-entity-copy-id",onClick:sr=>B(G,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(he,null,{default:n.withCtx(({copyToClipboard:ye})=>[n.createVNode(X,{"data-testid":"action-entity-copy-json",onClick:sr=>q(G,ye)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(G)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-view","has-divider":"",item:_(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(G)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-edit",item:H(G.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.config.getCreateSniRoute?(n.openBlock(),n.createBlock(n.unref(Et),{key:0,"auth-function":()=>e.canCreateSni()},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-add-sni",item:U(G.id)},null,8,["item"])]),_:2},1032,["auth-function"])):n.createCommentVNode("",!0),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(G)},{default:n.withCtx(()=>[n.createVNode(X,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:ye=>pe(G)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(Ef),{"action-pending":D.value,"entity-type":n.unref(Sa).Certificate,error:re.value,title:n.unref(i)("certificates.delete.title"),visible:R.value,onCancel:we,onProceed:or},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),ab="",Mr=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},d1=Mr(u1,[["__scopeId","data-v-7079e57f"]]),f1={class:"kong-ui-entities-certificates-form"},p1=n.defineComponent({__name:"CertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var b;const r=e,i=Lr.useRouter(),{i18nT:o,i18n:{t:s}}=pt.useI18n(),{getMessageFromError:a}=Of(),{axiosInstance:c}=so({headers:(b=r.config)==null?void 0:b.requestHeaders}),l=n.computed(()=>vi.form[r.config.app].edit),d=n.computed(()=>r.certificateId?ir.Edit:ir.Create),p=n.reactive({fields:{cert:"",key:"",certAlt:"",keyAlt:"",tags:""},isReadonly:!1,errorMessage:""}),y=n.reactive({cert:"",key:"",certAlt:"",keyAlt:"",tags:""}),x=n.computed(()=>(d.value===ir.Create||JSON.stringify(p.fields)!==JSON.stringify(y))&&!!p.fields.cert&&!!p.fields.key),C=m=>{var B;p.fields.cert=(m==null?void 0:m.cert)||"",p.fields.key=(m==null?void 0:m.key)||"",p.fields.certAlt=(m==null?void 0:m.cert_alt)||"",p.fields.keyAlt=(m==null?void 0:m.key_alt)||"",p.fields.tags=((B=m==null?void 0:m.tags)==null?void 0:B.join(", "))||"",Object.assign(y,p.fields)},h=()=>{i.push(r.config.cancelRoute)},g=n.computed(()=>{var B,q;let m=`${r.config.apiBaseUrl}${vi.form[r.config.app].validate}`;return r.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((B=r.config)==null?void 0:B.controlPlaneId)||""):r.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(q=r.config)!=null&&q.workspace?`/${r.config.workspace}`:"")),m=m.replace(/{id}/gi,r.certificateId),m}),w=n.computed(()=>{var B,q;let m=`${r.config.apiBaseUrl}${vi.form[r.config.app][d.value]}`;return r.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((B=r.config)==null?void 0:B.controlPlaneId)||""):r.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(q=r.config)!=null&&q.workspace?`/${r.config.workspace}`:"")),m=m.replace(/{id}/gi,r.certificateId),m}),v=async()=>{var m,B,q,J,I,_,H,U,Y;try{p.isReadonly=!0;const R={cert:p.fields.cert,key:p.fields.key,cert_alt:p.fields.certAlt||null,key_alt:p.fields.keyAlt||null,tags:(B=(m=p.fields.tags.split(","))==null?void 0:m.map(re=>String(re||"").trim()))==null?void 0:B.filter(re=>re!=="")};let D;await c.post(g.value,R),d.value==="create"?D=await c.post(w.value,R):d.value==="edit"&&(D=((q=r.config)==null?void 0:q.app)==="konnect"?await c.put(w.value,R):await c.patch(w.value,R)),p.fields.cert=((J=D==null?void 0:D.data)==null?void 0:J.cert)||"",p.fields.key=((I=D==null?void 0:D.data)==null?void 0:I.key)||"",p.fields.certAlt=((_=D==null?void 0:D.data)==null?void 0:_.cert_alt)||"",p.fields.keyAlt=((H=D==null?void 0:D.data)==null?void 0:H.key_alt)||"",p.fields.tags=((Y=(U=D==null?void 0:D.data)==null?void 0:U.tags)==null?void 0:Y.join(", "))||"",Object.assign(y,p.fields),t("update",D==null?void 0:D.data)}catch(R){p.errorMessage=a(R),t("error",R)}finally{p.isReadonly=!1}};return(m,B)=>{const q=n.resolveComponent("KTextArea"),J=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",f1,[n.createVNode(n.unref(Bf),{"can-submit":x.value,config:e.config,"edit-id":e.certificateId,"error-message":p.errorMessage,"fetch-url":l.value,"is-readonly":p.isReadonly,onCancel:h,"onFetch:error":B[5]||(B[5]=I=>m.$emit("error",I)),"onFetch:success":C,onLoading:B[6]||(B[6]=I=>m.$emit("loading",I)),onSubmit:v},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.ssl.description"),title:n.unref(s)("certificates.form.sections.ssl.title")},{default:n.withCtx(()=>[n.createVNode(q,{modelValue:p.fields.cert,"onUpdate:modelValue":B[0]||(B[0]=I=>p.fields.cert=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.cert.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(q,{modelValue:p.fields.key,"onUpdate:modelValue":B[1]||(B[1]=I=>p.fields.key=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.key.label"),readonly:p.isReadonly,required:""},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(q,{modelValue:p.fields.certAlt,"onUpdate:modelValue":B[2]||(B[2]=I=>p.fields.certAlt=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-cert-alt","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.cert_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"]),n.createVNode(q,{modelValue:p.fields.keyAlt,"onUpdate:modelValue":B[3]||(B[3]=I=>p.fields.keyAlt=I),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"certificate-form-key-alt","disable-character-limit":"",label:n.unref(s)("certificates.form.fields.key_alt.label"),readonly:p.isReadonly},{"label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(o),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("em",null,n.toDisplayString(n.unref(s)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),_:1},8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(s)("certificates.form.sections.general.description"),title:n.unref(s)("certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(J,{modelValue:p.fields.tags,"onUpdate:modelValue":B[4]||(B[4]=I=>p.fields.tags=I),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"certificate-form-tags",help:n.unref(s)("certificates.form.fields.tags.help"),label:n.unref(s)("certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(s)("certificates.form.fields.tags.tooltip")},placeholder:n.unref(s)("certificates.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),cb="",h1=Mr(p1,[["__scopeId","data-v-ba62e0cc"]]),Ii={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"}}},y1={class:"kong-ui-ca-certificate-entity-config-card"},m1={key:0},g1=n.defineComponent({__name:"CACertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=e,i=["dns_names","san_names","subject"],{i18n:{t:o,formatUnixTimeStamp:s}}=pt.useI18n(),{convertKeyToTitle:a}=Vf(),{getPropValue:c}=jf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>Ii.form[r.config.app].edit),p=n.ref(),y=n.computed(()=>{if(p.value)return l(p.value)}),x=n.computed(()=>{var b;return((b=y.value)==null?void 0:b.schemaIssuer)||""}),C=n.computed(()=>{var b,m;return(b=y.value)!=null&&b.schemaExpiry?s((m=y.value)==null?void 0:m.schemaExpiry):""}),h=n.computed(()=>{var b;return((b=y.value)==null?void 0:b.schemaKeyUsages)||[]}),g=(b,m)=>{const B=c("rowValue",m);if(b==="expiry")return C.value;if(b==="key_usages")return h.value;if(B)return B[b]},w=b=>{p.value=b,t("fetch:success",b)},v=n.ref({id:{},updated_at:{},created_at:{},cert:{section:le.Basic,label:o("ca-certificates.form.fields.cert.label"),tooltip:o("ca-certificates.form.fields.cert.tooltip"),order:5},cert_digest:{section:le.Basic,label:o("ca-certificates.form.fields.cert_digest.label"),tooltip:o("ca-certificates.form.fields.cert_digest.tooltip"),order:6},metadata:{section:le.Basic,type:ne.Json,order:7},...r.config.app==="kongManager"&&{expiry:{label:o("certificates.list.table_headers.expiry"),section:le.Basic,order:1.7,forceShow:!0},issuer:{section:le.Basic,order:1.5,forceShow:!0},key_usages:{section:le.Basic,forceShow:!0}},tags:{tooltip:o("ca-certificates.form.fields.tags.tooltip")}});return(b,m)=>{const B=n.resolveComponent("KCodeBlock"),q=n.resolveComponent("KLabel"),J=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",y1,[n.createVNode(n.unref(Af),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":v.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":m[0]||(m[0]=I=>b.$emit("copy:success",I)),"onFetch:error":m[1]||(m[1]=I=>b.$emit("fetch:error",I)),"onFetch:success":w,onLoading:m[2]||(m[2]=I=>b.$emit("loading",I))},{cert:n.withCtx(I=>[n.unref(c)("rowValue",I)?(n.openBlock(),n.createBlock(B,{key:0,id:`ca-cert-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",I),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"metadata-label":n.withCtx(()=>[n.createVNode(q,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(I=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",I)).filter(_=>!i.includes(_)),_=>(n.openBlock(),n.createBlock(n.unref(ki),{key:_,"data-testid":`ca-cert-metadata-${_}`,item:{key:_,label:n.unref(a)(_),value:g(_,I),type:_==="key_usages"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["data-testid","item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(C.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(x.value||"–"),1)]),key_usages:n.withCtx(()=>[h.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",m1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,(I,_)=>(n.openBlock(),n.createBlock(J,{key:`key_usages-badge-tag-${_}`,class:"config-badge","data-testid":`key_usages-badge-tag-${_}`,"truncation-tooltip":I},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),lb="",b1=Mr(g1,[["__scopeId","data-v-5110105b"]]),w1={class:"kong-ui-entities-ca-certificates-list"},v1={key:0},k1={key:1},C1={key:0},S1={key:1},x1={key:1},A1=n.defineComponent({__name:"CACertificateList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:t}){var or;const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),a=Lr.useRouter(),{axiosInstance:c}=so({headers:(or=r.config)==null?void 0:or.requestHeaders}),l=n.ref(1),d=n.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={issuer:{label:i("ca-certificates.list.table_headers.issuer")},expiry:{label:i("ca-certificates.list.table_headers.expiry")},tags:{label:i("ca-certificates.list.table_headers.tags"),sortable:!0}},x=n.computed(()=>{var de,K;let L=`${r.config.apiBaseUrl}${Ii.list[r.config.app]}`;return r.config.app==="konnect"?L=L.replace(/{controlPlaneId}/gi,((de=r.config)==null?void 0:de.controlPlaneId)||""):r.config.app==="kongManager"&&(L=L.replace(/\/{workspace}/gi,(K=r.config)!=null&&K.workspace?`/${r.config.workspace}`:"")),L}),C=n.ref(""),h=n.computed(()=>{const L=r.config.app==="konnect"||r.config.isExactMatch;return L?{isExactMatch:L,placeholder:i("ca-certificates.search.placeholder")}:{isExactMatch:L,schema:r.config.filterSchema}}),{fetcher:g,fetcherState:w}=Tf(r.config,x.value),v=()=>{C.value=""},b=()=>{l.value++},m=n.ref(""),B=(L,de)=>{const K=L.id;if(!de(K)){t("copy:error",{entity:L,field:"id",message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:L,field:"id",message:i("ca-certificates.copy.success",{val:K})})},q=(L,de)=>{const K=JSON.stringify(L);if(!de(K)){t("copy:error",{entity:L,message:i("ca-certificates.errors.copy")});return}t("copy:success",{entity:L,message:i("ca-certificates.copy.success_brief")})},J=async L=>{var K;await((K=r.canRetrieve)==null?void 0:K.call(r,L))&&a.push(r.config.getViewRoute(L.id))},I=L=>({label:i("ca-certificates.actions.view"),to:r.config.getViewRoute(L)}),_=L=>({label:i("ca-certificates.actions.edit"),to:r.config.getEditRoute(L)}),H=n.ref(void 0),U=n.ref(!1),Y=n.ref(!1),R=n.ref(""),D=_f(r.config,x.value),{certificateDataCache:re,getCertificateData:fe}=pt.useCertificate(),be=L=>{H.value=L,U.value=!0},ue=()=>{U.value=!1},pe=async()=>{var L,de,K;if((L=H.value)!=null&&L.id){Y.value=!0;try{await c.delete(D(H.value.id)),Y.value=!1,U.value=!1,l.value++,t("delete:success",H.value)}catch(Z){R.value=((K=(de=Z.response)==null?void 0:de.data)==null?void 0:K.message)||Z.message||i("ca-certificates.errors.delete"),t("error",Z)}finally{Y.value=!1}}};n.watch(w,L=>{if(L.status===Dt.Error){m.value=i("ca-certificates.errors.general"),t("error",L.error);return}re.value={},m.value=""});const we=n.ref({ctaPath:r.config.createRoute,ctaText:void 0,message:i("ca-certificates.list.empty_state.description"),title:i("ca-certificates.title")});return n.onBeforeMount(async()=>{await r.canCreate()&&(we.value.title=i("ca-certificates.list.empty_state.title"),we.value.ctaText=i("ca-certificates.actions.create"))}),(L,de)=>{const K=n.resolveComponent("KButton"),Z=n.resolveComponent("KBadge"),xe=n.resolveComponent("KTruncate"),We=n.resolveComponent("KDropdownItem"),Ur=n.resolveComponent("KClipboardProvider");return n.openBlock(),n.createElementBlock("div",w1,[n.createVNode(n.unref(If),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":we.value,"enable-entity-actions":"","error-message":m.value,fetcher:n.unref(g),"fetcher-cache-key":l.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-ca-certificates-list",query:C.value,"table-headers":n.unref(y),onClearSearchInput:v,"onClick:row":de[2]||(de[2]=X=>J(X)),onSort:b},{"toolbar-filter":n.withCtx(()=>[n.createVNode(n.unref(Nf),{modelValue:C.value,"onUpdate:modelValue":de[0]||(de[0]=X=>C.value=X),config:h.value},null,8,["modelValue","config"])]),"toolbar-button":n.withCtx(()=>[n.createVNode(n.unref(Et),{"auth-function":()=>e.canCreate()},{default:n.withCtx(()=>[n.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-ca-certificate",icon:"plus",to:e.config.createRoute},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.list.toolbar_actions.new_ca_certificate")),1)]),_:1},8,["to"])]),_:1},8,["auth-function"])]),issuer:n.withCtx(({row:X})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("b",v1,n.toDisplayString((he=X==null?void 0:X.metadata)!=null&&he.issuer?X.metadata.issuer:"-"),1)):(n.openBlock(),n.createElementBlock("b",k1,n.toDisplayString(n.unref(fe)(X).schemaIssuer||"-"),1))]}),expiry:n.withCtx(({row:X})=>{var he;return[e.config.app==="konnect"?(n.openBlock(),n.createElementBlock("span",C1,n.toDisplayString((he=X==null?void 0:X.metadata)!=null&&he.expiry?n.unref(o)(X.metadata.expiry):"-"),1)):(n.openBlock(),n.createElementBlock("span",S1,n.toDisplayString(n.unref(fe)(X).schemaExpiry?n.unref(o)(n.unref(fe)(X).schemaExpiry):"-"),1))]}),tags:n.withCtx(({row:X})=>{var he;return[((he=X==null?void 0:X.tags)==null?void 0:he.length)>0?(n.openBlock(),n.createBlock(xe,{key:0},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X==null?void 0:X.tags,G=>(n.openBlock(),n.createBlock(Z,{key:G,onClick:de[1]||(de[1]=n.withModifiers(()=>{},["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(G),1)]),_:2},1024))),128))]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",x1,"-"))]}),actions:n.withCtx(({row:X})=>[n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(We,{"data-testid":"action-entity-copy-id",onClick:G=>B(X,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(Ur,null,{default:n.withCtx(({copyToClipboard:he})=>[n.createVNode(We,{"data-testid":"action-entity-copy-json",onClick:G=>q(X,he)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("ca-certificates.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),n.createVNode(n.unref(Et),{"auth-function":()=>e.canRetrieve(X)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-view","has-divider":"",item:I(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canEdit(X)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-edit",item:_(X.id)},null,8,["item"])]),_:2},1032,["auth-function"]),n.createVNode(n.unref(Et),{"auth-function":()=>e.canDelete(X)},{default:n.withCtx(()=>[n.createVNode(We,{"data-testid":"action-entity-delete","has-divider":"","is-dangerous":"",onClick:he=>be(X)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(n.unref(i)("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"]),n.createVNode(n.unref(Ef),{"action-pending":Y.value,"entity-type":n.unref(Sa).CACertificate,error:R.value,title:n.unref(i)("ca-certificates.delete.title"),visible:U.value,onCancel:ue,onProceed:pe},{description:n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"ca-certificates.delete.description",scope:"global"},{"bolded-text":n.withCtx(()=>[n.createElementVNode("b",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.boldedText")),1)]),_:1}),n.createElementVNode("p",null,n.toDisplayString(n.unref(i)("ca-certificates.delete.description2")),1)]),_:1},8,["action-pending","entity-type","error","title","visible"])])}}}),ub="",B1=Mr(A1,[["__scopeId","data-v-d539b808"]]),I1={class:"kong-ui-entities-ca-certificates-form"},E1=n.defineComponent({__name:"CACertificateForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.cancelRoute)},certificateId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:t}){var v;const r=e,i=Lr.useRouter(),{i18n:{t:o}}=pt.useI18n(),{getMessageFromError:s}=Of(),{axiosInstance:a}=so({headers:(v=r.config)==null?void 0:v.requestHeaders}),c=n.computed(()=>Ii.form[r.config.app].edit),l=n.computed(()=>r.certificateId?ir.Edit:ir.Create),d=n.reactive({fields:{cert:"",certDigest:"",tags:""},isReadonly:!1,errorMessage:""}),p=n.reactive({cert:"",certDigest:"",tags:""}),y=n.computed(()=>(l.value===ir.Create||JSON.stringify(d.fields)!==JSON.stringify(p))&&!!d.fields.cert),x=b=>{var m;d.fields.cert=(b==null?void 0:b.cert)||"",d.fields.certDigest=(b==null?void 0:b.cert_digest)||"",d.fields.tags=((m=b==null?void 0:b.tags)==null?void 0:m.join(", "))||"",Object.assign(p,d.fields)},C=()=>{i.push(r.config.cancelRoute)},h=n.computed(()=>{var m,B;let b=`${r.config.apiBaseUrl}${Ii.form[r.config.app].validate}`;return r.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(B=r.config)!=null&&B.workspace?`/${r.config.workspace}`:"")),b=b.replace(/{id}/gi,r.certificateId),b}),g=n.computed(()=>{var m,B;let b=`${r.config.apiBaseUrl}${Ii.form[r.config.app][l.value]}`;return r.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((m=r.config)==null?void 0:m.controlPlaneId)||""):r.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(B=r.config)!=null&&B.workspace?`/${r.config.workspace}`:"")),b=b.replace(/{id}/gi,r.certificateId),b}),w=async()=>{var b,m,B,q,J,I,_;try{d.isReadonly=!0;const H={cert:d.fields.cert,cert_digest:d.fields.certDigest||null,tags:(m=(b=d.fields.tags.split(","))==null?void 0:b.map(Y=>String(Y||"").trim()))==null?void 0:m.filter(Y=>Y!=="")};let U;await a.post(h.value,H),l.value==="create"?U=await a.post(g.value,H):l.value==="edit"&&(U=((B=r.config)==null?void 0:B.app)==="konnect"?await a.put(g.value,H):await a.patch(g.value,H)),d.fields.cert=((q=U==null?void 0:U.data)==null?void 0:q.cert)||"",d.fields.certDigest=((J=U==null?void 0:U.data)==null?void 0:J.cert_digest)||"",d.fields.tags=((_=(I=U==null?void 0:U.data)==null?void 0:I.tags)==null?void 0:_.join(", "))||"",Object.assign(p,d.fields),t("update",U==null?void 0:U.data)}catch(H){d.errorMessage=s(H),t("error",H)}finally{d.isReadonly=!1}};return(b,m)=>{const B=n.resolveComponent("KTextArea"),q=n.resolveComponent("KInput");return n.openBlock(),n.createElementBlock("div",I1,[n.createVNode(n.unref(Bf),{"can-submit":y.value,config:e.config,"edit-id":e.certificateId,"error-message":d.errorMessage,"fetch-url":c.value,"is-readonly":d.isReadonly,onCancel:C,"onFetch:error":m[3]||(m[3]=J=>b.$emit("error",J)),"onFetch:success":x,onLoading:m[4]||(m[4]=J=>b.$emit("loading",J)),onSubmit:w},{default:n.withCtx(()=>[n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.cert.description"),title:n.unref(o)("ca-certificates.form.sections.cert.title")},{default:n.withCtx(()=>[n.createVNode(B,{modelValue:d.fields.cert,"onUpdate:modelValue":m[0]||(m[0]=J=>d.fields.cert=J),modelModifiers:{trim:!0},class:"certificate-form-textarea","data-testid":"ca-certificate-form-cert","disable-character-limit":"",label:n.unref(o)("ca-certificates.form.fields.cert.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.cert.tooltip")},readonly:d.isReadonly,required:""},null,8,["modelValue","label","label-attributes","readonly"]),n.createVNode(q,{modelValue:d.fields.certDigest,"onUpdate:modelValue":m[1]||(m[1]=J=>d.fields.certDigest=J),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-cert-digest",label:n.unref(o)("ca-certificates.form.fields.cert_digest.label"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","label","readonly"])]),_:1},8,["description","title"]),n.createVNode(n.unref(oo),{description:n.unref(o)("ca-certificates.form.sections.general.description"),title:n.unref(o)("ca-certificates.form.sections.general.title")},{default:n.withCtx(()=>[n.createVNode(q,{modelValue:d.fields.tags,"onUpdate:modelValue":m[2]||(m[2]=J=>d.fields.tags=J),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"ca-certificate-form-tags",help:n.unref(o)("ca-certificates.form.fields.tags.help"),label:n.unref(o)("ca-certificates.form.fields.tags.label"),"label-attributes":{info:n.unref(o)("ca-certificates.form.fields.tags.tooltip")},placeholder:n.unref(o)("ca-certificates.form.fields.tags.placeholder"),readonly:d.isReadonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","is-readonly"])])}}}),db="",N1=Mr(E1,[["__scopeId","data-v-a1cf8ed1"]]),_1={class:"kong-ui-certificate-entity-config-card"},O1={key:0},T1=n.defineComponent({__name:"CertificateConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e,{emit:t}){const r=e,{i18n:{t:i,formatUnixTimeStamp:o},i18nT:s}=pt.useI18n(),{convertKeyToTitle:a}=Vf(),{getPropValue:c}=jf(),{getCertificateData:l}=pt.useCertificate(),d=n.computed(()=>vi.form[r.config.app].edit),p=n.ref(),y=n.ref({id:{},cert:{section:le.Basic},key:{section:le.Basic,type:ne.Redacted},metadata:{section:le.Basic,type:ne.Json},snis:{section:le.Basic,type:ne.BadgeTag,label:i("certificates.list.table_headers.snis")},updated_at:{},created_at:{},tags:{tooltip:i("certificates.form.fields.tags.tooltip")},...r.config.app==="kongManager"&&{expiry:{section:le.Basic,label:i("certificates.list.table_headers.expiry"),forceShow:!0},issuer:{section:le.Basic,label:i("certificates.list.table_headers.issuer"),forceShow:!0},san_names:{section:le.Basic,label:i("certificates.list.table_headers.san"),forceShow:!0},subject:{section:le.Basic,label:i("certificates.list.table_headers.subject"),forceShow:!0},key_usages:{forceShow:!0}},cert_alt:{section:le.Advanced},key_alt:{section:le.Advanced,type:ne.Redacted}}),x=I=>{p.value=I,t("fetch:success",I)},C=(I,_)=>{const H=c("rowValue",_);if(I==="expiry")return g.value;if(I==="key_usages")return m.value;if(I==="san_names")return v.value;if(H)return H[I]},h=n.computed(()=>{if(p.value)return l(p.value)}),g=n.computed(()=>{var I,_;return(I=h.value)!=null&&I.schemaExpiry?o((_=h.value)==null?void 0:_.schemaExpiry):""}),w=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaIssuer)||""}),v=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSanNames)||""}),b=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaSubject)||""}),m=n.computed(()=>{var I;return((I=h.value)==null?void 0:I.schemaKeyUsages)||[]}),B=n.computed(()=>{var I,_;return((_=(I=p==null?void 0:p.value)==null?void 0:I.snis)==null?void 0:_.length)>0}),q=n.computed(()=>{var I;return!!((I=p==null?void 0:p.value)!=null&&I.cert_alt)}),J=I=>{var _,H;return I==="san_names"?i("certificates.list.table_headers.san"):((H=(_=y.value)==null?void 0:_[I])==null?void 0:H.label)||a(I)};return(I,_)=>{const H=n.resolveComponent("KCodeBlock"),U=n.resolveComponent("KLabel"),Y=n.resolveComponent("KBadge");return n.openBlock(),n.createElementBlock("div",_1,[n.createVNode(n.unref(Af),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":y.value,"fetch-url":d.value,"hide-title":e.hideTitle,"onCopy:success":_[0]||(_[0]=R=>I.$emit("copy:success",R)),"onFetch:error":_[1]||(_[1]=R=>I.$emit("fetch:error",R)),"onFetch:success":x,onLoading:_[2]||(_[2]=R=>I.$emit("loading",R))},n.createSlots({"cert-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert.emphasis")),1)]),_:1})]),cert:n.withCtx(R=>[n.unref(c)("rowValue",R)?(n.openBlock(),n.createBlock(H,{key:0,id:`certificate-${e.config.entityId}-cert-codeblock`,code:n.unref(c)("rowValue",R),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),"key-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key.emphasis")),1)]),_:1})]),"metadata-label":n.withCtx(()=>[n.createVNode(U,{class:"metadata-label"},{default:n.withCtx(()=>[n.createTextVNode(" Metadata ")]),_:1})]),metadata:n.withCtx(R=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Object.keys(n.unref(c)("rowValue",R)),D=>(n.openBlock(),n.createBlock(n.unref(ki),{key:D,item:{key:D,value:C(D,R),label:J(D),type:D==="key_usages"||D==="snis"||D==="dns_names"?n.unref(ne).BadgeTag:n.unref(ne).Text}},null,8,["item"]))),128))]),expiry:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.value||"–"),1)]),issuer:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value||"–"),1)]),san_names:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.value||"–"),1)]),subject:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(b.value||"–"),1)]),"cert_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.cert_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.cert_alt.emphasis")),1)]),_:1})]),"key_alt-label-tooltip":n.withCtx(()=>[n.createVNode(n.unref(s),{keypath:"certificates.form.fields.key_alt.tooltip",scope:"global"},{emphasis:n.withCtx(()=>[n.createElementVNode("i",null,n.toDisplayString(n.unref(i)("certificates.form.fields.key_alt.emphasis")),1)]),_:1})]),key_usages:n.withCtx(()=>[m.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",O1,n.toDisplayString("–"))),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(R,D)=>(n.openBlock(),n.createBlock(Y,{key:`key_usages-badge-tag-${D}`,class:"config-badge","data-testid":`key_usages-badge-tag-${D}`,"truncation-tooltip":R},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(R),1)]),_:2},1032,["data-testid","truncation-tooltip"]))),128))]),_:2},[B.value?void 0:{name:"snis",fn:n.withCtx(()=>[n.createTextVNode(" – ")]),key:"0"},q.value?{name:"cert_alt",fn:n.withCtx(R=>[n.createTextVNode(" > "),n.unref(c)("rowValue",R)?(n.openBlock(),n.createBlock(H,{key:0,id:`certificate-${e.config.entityId}-cert-alt-codeblock`,code:n.unref(c)("rowValue",R),"is-single-line":"",language:"plaintext"},null,8,["id","code"])):n.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["config","config-card-doc","config-schema","fetch-url","hide-title"])])}}}),fb="",V1=Mr(T1,[["__scopeId","data-v-69ded264"]]);_e.CACertificateConfigCard=b1,_e.CACertificateForm=N1,_e.CACertificateList=B1,_e.CertificateConfigCard=V1,_e.CertificateForm=h1,_e.CertificateList=d1,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/entities-certificates",
3
- "version": "1.3.10",
3
+ "version": "1.3.12",
4
4
  "type": "module",
5
5
  "main": "./dist/entities-certificates.umd.js",
6
6
  "module": "./dist/entities-certificates.es.js",
@@ -24,7 +24,7 @@
24
24
  "axios": "^1.5.1",
25
25
  "vue": "^3.3.4",
26
26
  "vue-router": "^4.2.5",
27
- "@kong-ui-public/i18n": "^0.8.5"
27
+ "@kong-ui-public/i18n": "^0.8.6"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@kong/design-tokens": "^1.11.6",
@@ -32,7 +32,7 @@
32
32
  "axios": "^1.5.1",
33
33
  "vue": "^3.3.4",
34
34
  "vue-router": "^4.2.5",
35
- "@kong-ui-public/i18n": "^0.8.5"
35
+ "@kong-ui-public/i18n": "^0.8.6"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -47,8 +47,8 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@peculiar/x509": "^1.9.5",
50
- "@kong-ui-public/copy-uuid": "^1.3.4",
51
- "@kong-ui-public/entities-shared": "^1.6.8"
50
+ "@kong-ui-public/copy-uuid": "^1.3.5",
51
+ "@kong-ui-public/entities-shared": "^1.6.10"
52
52
  },
53
53
  "distSizeChecker": {
54
54
  "errorLimit": "1.5MB"