@kong-ui-public/entities-consumers 3.0.2 → 3.0.3
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.
|
@@ -2581,7 +2581,7 @@ const Qo = { class: "yaml-config" }, cr = /* @__PURE__ */ Y({
|
|
|
2581
2581
|
for (const [r, a] of t)
|
|
2582
2582
|
n[r] = a;
|
|
2583
2583
|
return n;
|
|
2584
|
-
}, al = (e) => (Xe("data-v-
|
|
2584
|
+
}, al = (e) => (Xe("data-v-a81be499"), e = e(), et(), e), il = ["aria-hidden"], ol = {
|
|
2585
2585
|
key: 0,
|
|
2586
2586
|
"data-testid": "kui-icon-svg-title"
|
|
2587
2587
|
}, ll = /* @__PURE__ */ al(() => /* @__PURE__ */ F("path", {
|
|
@@ -2680,7 +2680,7 @@ const Qo = { class: "yaml-config" }, cr = /* @__PURE__ */ Y({
|
|
|
2680
2680
|
_: 1
|
|
2681
2681
|
}, 8, ["aria-hidden", "style"]));
|
|
2682
2682
|
}
|
|
2683
|
-
}), ul = /* @__PURE__ */ at(sl, [["__scopeId", "data-v-
|
|
2683
|
+
}), ul = /* @__PURE__ */ at(sl, [["__scopeId", "data-v-a81be499"]]), cl = (e) => (Xe("data-v-82729631"), e = e(), et(), e), dl = ["aria-hidden"], pl = {
|
|
2684
2684
|
key: 0,
|
|
2685
2685
|
"data-testid": "kui-icon-svg-title"
|
|
2686
2686
|
}, fl = /* @__PURE__ */ cl(() => /* @__PURE__ */ F("path", {
|
|
@@ -2779,7 +2779,7 @@ const Qo = { class: "yaml-config" }, cr = /* @__PURE__ */ Y({
|
|
|
2779
2779
|
_: 1
|
|
2780
2780
|
}, 8, ["aria-hidden", "style"]));
|
|
2781
2781
|
}
|
|
2782
|
-
}), gl = /* @__PURE__ */ at(ml, [["__scopeId", "data-v-
|
|
2782
|
+
}), gl = /* @__PURE__ */ at(ml, [["__scopeId", "data-v-82729631"]]), hl = (e) => (Xe("data-v-c0f10e09"), e = e(), et(), e), yl = ["aria-hidden"], vl = {
|
|
2783
2783
|
key: 0,
|
|
2784
2784
|
"data-testid": "kui-icon-svg-title"
|
|
2785
2785
|
}, bl = /* @__PURE__ */ hl(() => /* @__PURE__ */ F("path", {
|
|
@@ -2878,7 +2878,7 @@ const Qo = { class: "yaml-config" }, cr = /* @__PURE__ */ Y({
|
|
|
2878
2878
|
_: 1
|
|
2879
2879
|
}, 8, ["aria-hidden", "style"]));
|
|
2880
2880
|
}
|
|
2881
|
-
}), Cl = /* @__PURE__ */ at(kl, [["__scopeId", "data-v-
|
|
2881
|
+
}), Cl = /* @__PURE__ */ at(kl, [["__scopeId", "data-v-c0f10e09"]]), wl = (e) => (Xe("data-v-79c90e9e"), e = e(), et(), e), Il = ["aria-hidden"], Al = {
|
|
2882
2882
|
key: 0,
|
|
2883
2883
|
"data-testid": "kui-icon-svg-title"
|
|
2884
2884
|
}, Sl = /* @__PURE__ */ wl(() => /* @__PURE__ */ F("path", {
|
|
@@ -2977,7 +2977,7 @@ const Qo = { class: "yaml-config" }, cr = /* @__PURE__ */ Y({
|
|
|
2977
2977
|
_: 1
|
|
2978
2978
|
}, 8, ["aria-hidden", "style"]));
|
|
2979
2979
|
}
|
|
2980
|
-
}), _l = /* @__PURE__ */ at(xl, [["__scopeId", "data-v-
|
|
2980
|
+
}), _l = /* @__PURE__ */ at(xl, [["__scopeId", "data-v-79c90e9e"]]), $l = {
|
|
2981
2981
|
class: "config-card-title",
|
|
2982
2982
|
"data-testid": "config-card-title"
|
|
2983
2983
|
}, Tl = { class: "config-card-actions" }, jl = ["href"], Ml = { class: "config-card-details-section" }, Ol = /* @__PURE__ */ Y({
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
`+e.slice(a,i),a=i+1),l=s;return c+=`
|
|
30
30
|
`,e.length-a>n&&l>a?c+=e.slice(a,l)+`
|
|
31
31
|
`+e.slice(l+1):c+=e.slice(a),c.slice(1)}function Da(e){for(var n="",o=0,r,a=0;a<e.length;o>=65536?a+=2:a++)o=xe(e,a),r=z[o],!r&&we(o)?(n+=e[a],o>=65536&&(n+=e[a+1])):n+=r||Aa(o);return n}function Fa(e,n,o){var r="",a=e.tag,i,l,s;for(i=0,l=o.length;i<l;i+=1)s=o[i],e.replacer&&(s=e.replacer.call(o,String(i),s)),(ne(e,n,s,!1,!1)||typeof s>"u"&&ne(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=a,e.dump="["+r+"]"}function xn(e,n,o,r){var a="",i=e.tag,l,s,c;for(l=0,s=o.length;l<s;l+=1)c=o[l],e.replacer&&(c=e.replacer.call(o,String(l),c)),(ne(e,n+1,c,!0,!0,!1,!0)||typeof c>"u"&&ne(e,n+1,null,!0,!0,!1,!0))&&((!r||a!=="")&&(a+=We(e,n)),e.dump&&ke===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=i,e.dump=a||"[]"}function va(e,n,o){var r="",a=e.tag,i=Object.keys(o),l,s,c,d,p;for(l=0,s=i.length;l<s;l+=1)p="",r!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[l],d=o[c],e.replacer&&(d=e.replacer.call(o,c,d)),ne(e,n,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ne(e,n,d,!1,!1)&&(p+=e.dump,r+=p));e.tag=a,e.dump="{"+r+"}"}function qa(e,n,o,r){var a="",i=e.tag,l=Object.keys(o),s,c,d,p,u,y;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new J("sortKeys must be a boolean or a function");for(s=0,c=l.length;s<c;s+=1)y="",(!r||a!=="")&&(y+=We(e,n)),d=l[s],p=o[d],e.replacer&&(p=e.replacer.call(o,d,p)),ne(e,n+1,d,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&ke===e.dump.charCodeAt(0)?y+="?":y+="? "),y+=e.dump,u&&(y+=We(e,n)),ne(e,n+1,p,!0,u)&&(e.dump&&ke===e.dump.charCodeAt(0)?y+=":":y+=": ",y+=e.dump,a+=y));e.tag=i,e.dump=a||"{}"}function Sn(e,n,o){var r,a,i,l,s,c;for(a=o?e.explicitTypes:e.implicitTypes,i=0,l=a.length;i<l;i+=1)if(s=a[i],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(o?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,rn.call(s.represent)==="[object Function]")r=s.represent(n,c);else if(an.call(s.represent,c))r=s.represent[c](n,c);else throw new J("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function ne(e,n,o,r,a,i,l){e.tag=null,e.dump=o,Sn(e,o,!1)||Sn(e,o,!0);var s=rn.call(e.dump),c=r,d;r&&(r=e.flowLevel<0||e.flowLevel>n);var p=s==="[object Object]"||s==="[object Array]",u,y;if(p&&(u=e.duplicates.indexOf(o),y=u!==-1),(e.tag!==null&&e.tag!=="?"||y||e.indent!==2&&n>0)&&(a=!1),y&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&y&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(qa(e,n,e.dump,a),y&&(e.dump="&ref_"+u+e.dump)):(va(e,n,e.dump),y&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!l&&n>0?xn(e,n-1,e.dump,a):xn(e,n,e.dump,a),y&&(e.dump="&ref_"+u+e.dump)):(Fa(e,n,e.dump),y&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&Ma(e,e.dump,n,i,c);else{if(s==="[object Undefined]"||e.skipInvalid)return!1;throw new J("unacceptable kind of an object to dump "+s)}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 La(e,n){var o=[],r=[],a,i;for(Qe(e,o,r),a=0,i=r.length;a<i;a+=1)n.duplicates.push(o[r[a]]);n.usedDuplicates=new Array(i)}function Qe(e,n,o){var r,a,i;if(e!==null&&typeof e=="object")if(a=n.indexOf(e),a!==-1)o.indexOf(a)===-1&&o.push(a);else if(n.push(e),Array.isArray(e))for(a=0,i=e.length;a<i;a+=1)Qe(e[a],n,o);else for(r=Object.keys(e),a=0,i=r.length;a<i;a+=1)Qe(e[r[a]],n,o)}function Ka(e,n){n=n||{};var o=new Va(n);o.noRefs||La(e,o);var r=e;return o.replacer&&(r=o.replacer.call({"":r},"",r)),ne(o,0,r,!0,!0)?o.dump+`
|
|
32
|
-
`:""}var Ua=Ka,Ra={dump:Ua};function Xe(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Pa=R,za=Nt,Ga=_t,Ja=jt,Ha=Mt,Ya=Pe,Wa=on.load,Za=on.loadAll,Qa=Ra.dump,Xa=J,ei={binary:qt,float:$t,map:At,null:Vt,pairs:Kt,set:Ut,timestamp:Ft,bool:Et,int:Tt,merge:vt,omap:Lt,seq:Bt,str:It},ti=Xe("safeLoad","load"),ni=Xe("safeLoadAll","loadAll"),oi=Xe("safeDump","dump"),ri={Type:Pa,Schema:za,FAILSAFE_SCHEMA:Ga,JSON_SCHEMA:Ja,CORE_SCHEMA:Ha,DEFAULT_SCHEMA:Ya,load:Wa,loadAll:Za,dump:Qa,YAMLException:Xa,types:ei,safeLoad:ti,safeLoadAll:ni,safeDump:oi};const ai={class:"yaml-config"},Nn=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const n=e,o=t.computed(()=>{const r=Object.fromEntries(Object.entries(n.yamlRecord).filter(([,a])=>a&&(Array.isArray(a)?a.length!==0:!0)));return Object.keys(r).length===0&&r.constructor===Object?"":ri.dump(r).trim()});return(r,a)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",ai,[n.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:o.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),ii={key:0,class:"config-card-display-form"},li=["data-testid"],si={key:0,class:"config-card-prop-section-title"},ci=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const n=e,o=t.useSlots(),{i18n:{t:r}}=U.useI18n(),a=l=>!!(l.tooltip||o[`${l.key}-label-tooltip`]),i=t.computed(()=>{if(!n.record)return n.record;const l=JSON.parse(JSON.stringify(n.record));return delete l.created_at,delete l.updated_at,l});return(l,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",ii,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",si,t.toDisplayString(c==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],d=>(t.openBlock(),t.createBlock(kt,{key:d.key,item:d},t.createSlots({label:t.withCtx(()=>[t.renderSlot(l.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(l.$slots,d.key,{row:d,rowValue:p},void 0,!0)]),_:2},[a(d)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(l.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,li))),128))])):t.createCommentVNode("",!0),e.format==="json"&&n.record?(t.openBlock(),t.createBlock(Ct,{key:1,config:n.config,"fetcher-url":n.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&n.record?(t.openBlock(),t.createBlock(Nn,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),di=Q(ci,[["__scopeId","data-v-147a2f70"]]),ie="24px",je=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},ui=e=>(t.pushScopeId("data-v-89afc35c"),e=e(),t.popScopeId(),e),pi=["aria-hidden"],fi={key:0,"data-testid":"kui-icon-svg-title"},mi=ui(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),gi=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",fi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),mi],8,pi))]),_:1},8,["aria-hidden","style"]))}}),hi=je(gi,[["__scopeId","data-v-89afc35c"]]),yi=e=>(t.pushScopeId("data-v-ae268f21"),e=e(),t.popScopeId(),e),bi=["aria-hidden"],ki={key:0,"data-testid":"kui-icon-svg-title"},Ci=yi(()=>t.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)),wi=t.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:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.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?(t.openBlock(),t.createElementBlock("title",ki,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ci],8,bi))]),_:1},8,["aria-hidden","style"]))}}),xi=je(wi,[["__scopeId","data-v-ae268f21"]]),Si=e=>(t.pushScopeId("data-v-b2c75f11"),e=e(),t.popScopeId(),e),Ni=["aria-hidden"],Ii={key:0,"data-testid":"kui-icon-svg-title"},Bi=Si(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),Ai=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Ii,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Bi],8,Ni))]),_:1},8,["aria-hidden","style"]))}}),_i=je(Ai,[["__scopeId","data-v-b2c75f11"]]),Vi=e=>(t.pushScopeId("data-v-f8cd1668"),e=e(),t.popScopeId(),e),Ei=["aria-hidden"],Ti={key:0,"data-testid":"kui-icon-svg-title"},$i=Vi(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ji=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Ti,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),$i],8,Ei))]),_:1},8,["aria-hidden","style"]))}}),Mi=je(ji,[["__scopeId","data-v-f8cd1668"]]),Oi={class:"config-card-title","data-testid":"config-card-title"},Di={class:"config-card-actions"},Fi=["href"],vi={class:"config-card-details-section"},qi=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:n}){var o;const r=n,a=e,{i18n:{t:i}}=U.useI18n(),{getMessageFromError:l}=U.useErrors(),{convertKeyToTitle:s}=U.useStringHelpers(),{axiosInstance:c}=U.useAxios((o=a.config)==null?void 0:o.axiosRequestConfig),d=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=g=>{p.value=g==null?void 0:g.value},y={id:{type:F.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:H.Basic},name:{order:1,section:H.Basic},enabled:{type:F.BadgeStatus,order:2,section:H.Basic},updated_at:{type:F.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:H.Basic},created_at:{type:F.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:H.Basic},tags:{type:F.BadgeTag,order:-1,section:H.Basic}},m=t.ref(!1),x=t.ref(!1),C=t.ref(""),w=t.ref({}),$=t.computed(()=>{var g,T,b;if(!w.value)return[];const f=[],V=Object.keys(w.value).length;for(const A in w.value){const S=(T=(g=a.configSchema)==null?void 0:g[A])==null?void 0:T.order,N=(b=y[A])==null?void 0:b.order;let E=V;(N||N===0)&&(E=N===-1?V+1:N),S&&(E=S===-1?V+1:S),f.push([A,E])}return f.sort(function(A,S){return A[1]-S[1]}),f.map(A=>{var S,N;const E=A[0],j=(S=w.value)==null?void 0:S[E],M=((N=a.configSchema)==null?void 0:N[E])||{},G=y[E];return{key:E,value:j,hidden:M.hidden||!1,type:M.type??((G==null?void 0:G.type)||F.Text),label:M.label??((G==null?void 0:G.label)||s(E)),tooltip:M.tooltip??((G==null?void 0:G.tooltip)||void 0),section:M.section??((G==null?void 0:G.section)||H.Advanced)}}).filter(A=>!A.hidden&&A.key!==a.pluginConfigKey)}),_=t.computed(()=>{var g,T;if(!w.value||!a.pluginConfigKey)return[];const b=w.value[a.pluginConfigKey]||{},f=Object.keys(b).length,V=[];for(const A in b){const S=(T=(g=a.pluginConfigSchema)==null?void 0:g[A])==null?void 0:T.order,N=b[A];let E=N!=null&&N!==""?f-1:f;S&&(E=S===-1?f+1:S),V.push([A,E])}return V.sort(function(A,S){return A[1]-S[1]}),V.map(A=>{var S;const N=A[0],E=b[N],j=((S=a.pluginConfigSchema)==null?void 0:S[N])||{};return{key:N,value:E,hidden:j.hidden||!1,type:j.type??F.Text,label:j.label??s(N),tooltip:j.tooltip??void 0,section:H.Plugin}}).filter(A=>!A.hidden)}),v=t.computed(()=>{var g,T,b,f;return{basic:(g=$.value)==null?void 0:g.filter(V=>V.section===H.Basic),advanced:(T=$.value)==null?void 0:T.filter(V=>V.section===H.Advanced),plugin:(f=_.value)==null?void 0:f.concat((b=$.value)==null?void 0:b.filter(V=>V.section===H.Plugin))}}),k=t.computed(()=>{const g=[];return v.value.basic.length&&g.push("basic"),v.value.advanced.length&&g.push("advanced"),v.value.plugin.length&&g.push("plugin"),g}),h=t.computed(()=>{var g,T;let b=`${a.config.apiBaseUrl}${a.fetchUrl}`;return a.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((g=a.config)==null?void 0:g.controlPlaneId)||""):a.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(T=a.config)!=null&&T.workspace?`/${a.config.workspace}`:"")),b=b.replace(/{id}/gi,a.config.entityId),b});return t.watch(m,g=>{r("loading",g)},{immediate:!0}),t.onBeforeMount(async()=>{x.value=!1,m.value=!0;try{const{data:g}=await c.get(h.value);if(a.dataKey)if(typeof g[a.dataKey]<"u")w.value={...g[a.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:a.dataKey}));else w.value={...g};Object.keys(a.configSchema).filter(T=>a.configSchema[T].forceShow).forEach(T=>{w.value&&typeof w.value[T]>"u"&&(w.value[T]=null)}),r("fetch:success",g)}catch(g){const T=l(g);C.value=T.startsWith("code")?i("baseConfigCard.errors.load"):T,x.value=!0,r("fetch:error",g)}finally{m.value=!1}}),(g,T)=>{const b=t.resolveComponent("KLabel"),f=t.resolveComponent("KSelect"),V=t.resolveComponent("KButton"),A=t.resolveComponent("KSkeleton"),S=t.resolveComponent("KEmptyState"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(N,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Di,[t.renderSlot(g.$slots,"actions",{},void 0,!0),t.createVNode(b,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(f,{"data-testid":"select-config-format",items:d,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(V,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(xi),{size:t.unref(No)},null,8,["size"])],8,Fi)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[m.value?(t.openBlock(),t.createBlock(A,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):x.value?(t.openBlock(),t.createBlock(S,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",vi,[t.createVNode(di,{config:e.config,"fetcher-url":h.value,format:p.value,"prop-list-types":k.value,"property-collections":v.value,record:w.value},t.createSlots({_:2},[t.renderList(Object.keys(g.$slots),E=>({name:E,fn:t.withCtx(({row:j,rowValue:M})=>[t.renderSlot(g.$slots,E,{row:j,rowValue:M},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",Oi,[t.renderSlot(g.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Li=Q(qi,[["__scopeId","data-v-f40a683b"]]),Ki=["novalidate"],Ui={class:"form-actions","data-testid":"form-actions"},Ri=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:n}){var o;const r=n,a=e,i=De.useRouter(),{i18n:{t:l}}=U.useI18n(),{getMessageFromError:s}=U.useErrors(),{axiosInstance:c}=U.useAxios((o=a.config)==null?void 0:o.axiosRequestConfig),d=t.ref(!1),p=t.ref(!1),u=t.ref(""),y=t.computed(()=>a.canSubmit===!1||a.isReadonly),m=t.ref(!1),x=t.computed(()=>{var k,h;let g=`${a.config.apiBaseUrl}${a.fetchUrl}`;return a.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((k=a.config)==null?void 0:k.controlPlaneId)||""):a.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(h=a.config)!=null&&h.workspace?`/${a.config.workspace}`:"")),a.editId?(g=g.replace(/{id}/gi,a.editId),g):(g=g.replace(/\/{id}/gi,""),g)}),C=()=>{m.value=!m.value},w=()=>{a.config.cancelRoute?i.push(a.config.cancelRoute):$()},$=()=>{r("cancel")},_=()=>{y.value||r("submit")},v=t.ref([{title:l("baseForm.configuration.yaml"),hash:"#yaml"},{title:l("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>d.value,k=>{r("loading",k)},{immediate:!0}),t.onBeforeMount(async()=>{if(a.editId)try{p.value=!1,d.value=!0;const{data:k}=await c.get(x.value);r("fetch:success",k)}catch(k){const h=s(k);u.value=h.startsWith("code")?l("baseForm.errors.edit"):h,p.value=!0,r("fetch:error",k)}finally{d.value=!1}}),(k,h)=>{const g=t.resolveComponent("KSkeleton"),T=t.resolveComponent("KEmptyState"),b=t.resolveComponent("KAlert"),f=t.resolveComponent("KButton"),V=t.resolveComponent("KTabs"),A=t.resolveComponent("KSlideout"),S=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(S,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[d.value?(t.openBlock(),t.createBlock(g,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(T,{key:1,"action-button-text":t.unref(l)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:w},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:a.noValidate,onReset:t.withModifiers($,["prevent"]),onSubmit:t.withModifiers(_,["prevent"])},[t.renderSlot(k.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(b,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Ui,[t.renderSlot(k.$slots,"form-actions",{},()=>[t.createVNode(f,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:h[0]||(h[0]=N=>C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(f,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(f,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,Ki)),t.createVNode(A,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(l)("baseForm.configuration.title"),visible:m.value,onClose:h[1]||(h[1]=N=>C())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(l)("baseForm.configuration.message")),1),t.createVNode(V,{"data-testid":"form-view-configuration-slideout-tabs",tabs:v.value},{json:t.withCtx(()=>[t.createVNode(Ct,{config:e.config,"fetcher-url":x.value,"json-record":a.formFields,"request-method":a.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(Nn,{"yaml-record":a.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Pi=Q(Ri,[["__scopeId","data-v-3def74fe"]]),zi={key:0,"data-testid":"first-col"},Gi=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const n=e,o=t.computed(()=>{var C;return((C=n.rowEl)==null?void 0:C.querySelector(`[data-testid="${n.keyName}"]`))||null}),r=t.computed(()=>{var C;return((C=o.value)==null?void 0:C.querySelector('[data-testid="first-col"]'))||null}),a=t.computed(()=>{var C,w;const $=(C=n.rowEl)==null?void 0:C.querySelectorAll("td");return $?((w=$[0])==null?void 0:w.getAttribute("data-testid"))===n.keyName:!1});let i;const l=()=>{i&&(i.disconnect(),i=void 0)},s=()=>{var C,w,$;d.value=((C=r.value)==null?void 0:C.getBoundingClientRect().width)||0,p.value=((w=o.value)==null?void 0:w.clientWidth)||0,u.value=(($=c.value)==null?void 0:$.innerText)||""},c=t.ref({}),d=t.ref(0),p=t.ref(0),u=t.ref(""),y=t.computed(()=>[r.value,o.value]),m=t.watch(y,C=>{if(a.value&&(l(),"ResizeObserver"in window&&window)){i=new ResizeObserver(w=>{window.requestAnimationFrame(()=>{!Array.isArray(w)||!w.length||s()})});for(const w of C)w&&i.observe(w)}},{immediate:!0,flush:"post",deep:!0}),x=t.computed(()=>a.value?d.value>p.value:!1);return t.onMounted(()=>{s()}),t.onUnmounted(()=>{m()}),(C,w)=>{const $=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[a.value?(t.openBlock(),t.createElementBlock("span",zi,[t.createVNode($,{"max-width":"300",placement:"bottomStart",text:x.value?u.value:""},{default:t.withCtx(()=>[t.renderSlot(C.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):t.renderSlot(C.$slots,"default",{key:1},void 0,!0)],512)}}}),Ji=Q(Gi,[["__scopeId","data-v-c4379fd4"]]),Hi={class:"toolbar-container"},Yi={key:0,class:"toolbar-button-container"},Wi=["data-testid"],Zi=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:n}){const o=e,r=n,{i18n:{t:a}}=U.useI18n(),i=t.computed(()=>{var h,g;return typeof o.errorMessage=="string"?{hasError:!!o.errorMessage,title:o.errorMessage,message:void 0}:{hasError:!!o.errorMessage,title:(h=o.errorMessage)==null?void 0:h.title,message:(g=o.errorMessage)==null?void 0:g.message}}),l=t.computed(()=>o.cacheIdentifier||o.preferencesStorageKey),s=h=>h.hasData||!!o.query,c=t.computed(()=>{const h=[];return Object.keys(o.tableHeaders).forEach(g=>{const T=o.tableHeaders[g];h.push({label:T.label??g,key:g,sortable:T.sortable??!1})}),o.enableEntityActions&&h.push({key:"actions",hideLabel:!0}),h}),d=h=>({"data-rowid":h.id,"data-testid":h.name,...o.rowAttributes(h)}),p=t.ref({}),u=h=>{var g;return(g=p.value)==null?void 0:g.$el.querySelector(`[data-rowid="${h.id}"]`)},y=h=>{const g={"data-testid":h.headerKey,...o.cellAttributes(h)};return h.colIndex===0&&(g.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),g},m=()=>{r("empty-state-cta-clicked"),x()},x=()=>{r("clear-search-input")},C=t.computed(()=>o.disableRowClick?void 0:(h,g)=>{r("click:row",g)}),w=h=>{r("sort",h)},{setTablePreferences:$,getTablePreferences:_}=Kn(),v=t.computed(()=>{const h=_(o.preferencesStorageKey);return{...o.initialFetcherParams,...h}}),k=h=>{o.preferencesStorageKey&&$(o.preferencesStorageKey,h)};return(h,g)=>{const T=t.resolveComponent("KIcon"),b=t.resolveComponent("KButton"),f=t.resolveComponent("KDropdown"),V=t.resolveComponent("KTable"),A=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(A,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(V,{ref_key:"tableRefs",ref:p,"cache-identifier":l.value,"cell-attrs":y,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?t.unref(a)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(a)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(a)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":i.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:m,"onRow:click":C.value,onSort:g[0]||(g[0]=S=>w(S)),"onUpdate:tablePreferences":k},t.createSlots({toolbar:t.withCtx(({state:S})=>[t.withDirectives(t.createElementVNode("div",Hi,[t.renderSlot(h.$slots,"toolbar-filter",{},void 0,!0),h.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Yi,[t.renderSlot(h.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,s(S)]])]),actions:t.withCtx(({row:S,rowKey:N,rowValue:E})=>[t.createElementVNode("div",{class:"actions-container","data-testid":S.name},[t.createVNode(f,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(h.$slots,"actions",{row:S,rowKey:N,rowValue:E},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(b,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(T,{color:t.unref(wo),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Wi)]),_:2},[t.renderList(e.tableHeaders,(S,N)=>({name:N,fn:t.withCtx(({row:E,rowKey:j,rowValue:M})=>[t.createVNode(Ji,{"key-name":String(N),"row-el":u(E)},{default:t.withCtx(()=>[t.renderSlot(h.$slots,N,{row:E,rowKey:j,rowValue:M},()=>[t.createTextVNode(t.toDisplayString(M),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(hi))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Qi=Q(Zi,[["__scopeId","data-v-99908c24"]]),Xi={key:0,class:"kong-ui-entity-delete-error"},el={key:1,class:"description"},tl=t.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:n}){const{i18nT:o}=U.useI18n(),r=e,a=n,i=t.computed(()=>r.needConfirm?r.entityName:""),l=()=>{a("cancel")},s=()=>{a("proceed")};return(c,d)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:l,onProceed:s},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Xi,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(o),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",el,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(r.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),nl=Q(tl,[["__scopeId","data-v-4361d622"]]),ol={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},rl={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},al=["fill"],il={mask:"url(#mask0_180_20349)"},ll=["fill"],In=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${ko})`}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("svg",ol,[t.createElementVNode("mask",rl,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,al)]),t.createElementVNode("g",il,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,ll)])]))}}),sl={key:1,class:"kong-ui-entity-filter"},cl={class:"kong-ui-entity-filter-menu"},dl=["data-testid"],ul=["onClick","onKeydown"],pl={class:"menu-item-indicator"},fl={class:"menu-item-body"},ml=["for"],gl={class:"menu-item-buttons"},hl={class:"filter-clear-button-container"},yl=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:n}){const{i18n:{t:o}}=U.useI18n(),r=e,a=n,i=t.ref(!1),l=t.ref({}),s=t.ref(new Set),c=t.computed(()=>{const k=[];return new URLSearchParams(r.modelValue).forEach((h,g)=>{h!==""&&k.push(g)}),k}),d=t.computed(()=>{const k=r.config.fields;return Object.keys(k).filter(h=>k[h].searchable).map(h=>({label:k[h].label||h,value:h,expanded:!1}))});t.watch(()=>r.modelValue,k=>{l.value={},new URLSearchParams(k).forEach((h,g)=>{l.value[g]=h})});const p=()=>{i.value=!i.value},u=k=>{s.value.has(k)?s.value.delete(k):s.value.add(k)},y=k=>{a("update:modelValue",k)},m=()=>{y("")},x=k=>`filter-${k}`,C=k=>{var h,g;return(((g=(h=r.config.schema)==null?void 0:h[k])==null?void 0:g.values)??[]).map(T=>({value:T,label:T}))},w=k=>{var h,g;return((g=(h=r.config.schema)==null?void 0:h[k])==null?void 0:g.type)??"text"},$=k=>{l.value={...l.value,[k]:""},v()},_=()=>{l.value={},v(!0)},v=(k=!1)=>{const h=Object.keys(l.value).reduce((g,T)=>(l.value[T]&&(g[T]=`${l.value[T]}`),g),{});k&&(i.value=!1),a("update:modelValue",new URLSearchParams(h).toString())};return(k,h)=>{const g=t.resolveComponent("KInput"),T=t.resolveComponent("KButton"),b=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(g,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:t.withCtx(()=>[t.createVNode(In)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(Mi),{class:"kong-ui-entity-filter-clear",onClick:m},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",sl,[t.createVNode(T,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(In),t.createTextVNode(" "+t.toDisplayString(t.unref(o)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,f=>{var V,A;return t.openBlock(),t.createElementBlock("div",{key:f.value,class:"kong-ui-entity-filter-menu-item","data-testid":f.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:s.value.has(f.value)}]),role:"button",tabindex:"0",onClick:S=>u(f.value),onKeydown:t.withKeys(S=>u(f.value),["enter"])},[t.createTextVNode(t.toDisplayString(f.label)+" ",1),t.withDirectives(t.createElementVNode("span",pl,null,512),[[t.vShow,c.value.includes(f.value)]]),t.createVNode(t.unref(_i),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:s.value.has(f.value)}]),color:t.unref(xo)},null,8,["class","color"])],42,ul),t.withDirectives(t.createElementVNode("div",fl,[t.createElementVNode("label",{class:"menu-item-label",for:x(f.value)},t.toDisplayString(t.unref(o)("filter.fieldLabel")),9,ml),((A=(V=e.config.schema)==null?void 0:V[f.value])==null?void 0:A.type)==="select"?(t.openBlock(),t.createBlock(b,{key:0,id:x(f.value),modelValue:l.value[f.value],"onUpdate:modelValue":S=>l.value[f.value]=S,items:C(f.value),placeholder:t.unref(o)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(g,{key:1,id:x(f.value),modelValue:l.value[f.value],"onUpdate:modelValue":S=>l.value[f.value]=S,autocomplete:"off",placeholder:t.unref(o)("filter.inputPlaceholder"),type:w(f.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,s.value.has(f.value)]]),t.withDirectives(t.createElementVNode("div",gl,[t.createVNode(T,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:h[0]||(h[0]=S=>v(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("filter.applyButtonText")),1)]),_:1}),t.createVNode(T,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:S=>$(f.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,s.value.has(f.value)]])],8,dl)}),128)),t.createElementVNode("div",hl,[t.createVNode(T,{appearance:"tertiary",size:"small",onClick:_},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),bl=Q(yl,[["__scopeId","data-v-8cfadde3"]]),Me=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const n=e,o=t.ref(void 0),r=t.computed(()=>o.value===!0||o.value!==void 0&&n.forceShow===!0);return t.watch(()=>n.authFunction,async()=>{o.value=await n.authFunction()},{immediate:!0}),(a,i)=>r.value?t.renderSlot(a.$slots,"default",{key:0,isAllowed:o.value}):t.createCommentVNode("",!0)}}),kl={class:"form-section-wrapper"},Cl={key:1,class:"form-section-description"},wl={key:2,class:"form-section-footer"},xl={class:"form-section-content"},Sl=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const n=t.useSlots();return(o,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",kl,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1})):t.createCommentVNode("",!0),e.description||t.unref(n).description?(t.openBlock(),t.createElementBlock("div",Cl,[t.renderSlot(o.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(n).footer?(t.openBlock(),t.createElementBlock("div",wl,[t.renderSlot(o.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",xl,[t.renderSlot(o.$slots,"default",{},void 0,!0)])])],2))}}),Nl=Q(Sl,[["__scopeId","data-v-4bb31634"]]),{useAxios:et,useDeleteUrlBuilder:Il,useErrors:Bl,useExternalLinkCreator:ls,useFetchUrlBuilder:ss,useFetcher:Al,useDebouncedFilter:_l,useStringHelpers:cs,useHelpers:ds,useGatewayFeatureSupported:us,useTruncationDetector:ps,useValidators:fs}=U,Vl={class:"add-consumer-form-container"},El={class:"add-consumer-form-cta"},Tl={class:"select-item-label"},$l={key:0,class:"select-item-desc"},jl={key:0,class:"kong-ui-entity-add-consumers-error"},Ml={key:0},Ol=t.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(e,{emit:n}){var S;const{i18n:{t:o}}=Ie.useI18n(),r=e,a=n,{axiosInstance:i}=et((S=r.config)==null?void 0:S.axiosRequestConfig),l=t.ref([]),{debouncedQueryChange:s,loading:c,allRecords:d,error:p,loadItems:u,results:y}=_l(r.config,le.list[r.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),m=N=>N,x=t.computed(()=>p.value?o("consumers.errors.general"):""),C=t.ref(0),w=t.computed(()=>d.value===void 0),$=t.computed(()=>y.value.map(N=>({label:N.username||N.customId,value:N.id,selected:l.value.includes(N.id),data:N}))),_=N=>{var j;const E=w.value?y.value.find(M=>M.id===N):(j=d.value)==null?void 0:j.find(M=>M.id===N);return E?E.username||E.custom_id:N},v=()=>{g.value="",k.value=[],V.value=[],a("cancel")},k=t.ref([]),h=t.ref(!1),g=t.ref(""),T=async()=>{if(!l.value.length){g.value="",V.value=[],a("cancel");return}h.value=!0,g.value="",k.value=[],V.value=[];try{const N=l.value.map(M=>f(M)),E=await Promise.allSettled(N);let j=!0;E.forEach(M=>{M.status!=="fulfilled"&&(j=!1)}),j?(k.value=[],V.value=[],a("add:success",l.value),l.value=[]):(k.value.length&&a("add:partial-success",k.value),l.value=[],A(E))}catch{g.value=o("consumers.errors.add"),a("error",g.value)}finally{h.value=!1}},b=t.computed(()=>{var E,j,M,G;let N=`${r.config.apiBaseUrl}${le.list[r.config.app].forConsumerGroup}`;return r.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((E=r.config)==null?void 0:E.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((j=r.config)==null?void 0:j.consumerGroupId)||""):r.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(M=r.config)!=null&&M.workspace?`/${r.config.workspace}`:"").replace(/{consumerGroupId}/gi,((G=r.config)==null?void 0:G.consumerGroupId)||"")),N}),f=async N=>{const E={consumer:N};try{const j=await i.post(b.value,E);return k.value.push(N),j}catch(j){let M=`${_(N)} - ${j.message}`;return j.response.status===409&&(M=`${_(N)} - ${o("consumers.errors.already_added")}`),Promise.reject(Error(M))}},V=t.ref([]),A=N=>{V.value=N.map(E=>{var j;return(j=E.reason)==null?void 0:j.message}).filter(Boolean)};return t.watch($,()=>{C.value++},{immediate:!0,deep:!0}),t.watch(()=>r.visible,()=>{r.visible&&u()},{immediate:!0}),(N,E)=>{const j=t.resolveComponent("KMultiselect"),M=t.resolveComponent("KAlert"),G=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(G,{"action-button-disabled":h.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:t.unref(o)("consumers.consumer_groups.add.title"),visible:e.visible,onCancel:v,onProceed:T},{default:t.withCtx(()=>[t.createElementVNode("div",Vl,[t.createElementVNode("p",El,t.toDisplayString(t.unref(o)("consumers.consumer_groups.add.ctaText")),1),t.createVNode(j,{modelValue:l.value,"onUpdate:modelValue":E[0]||(E[0]=ee=>l.value=ee),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":w.value?t.unref(o)("consumers.consumer_groups.add.footer"):void 0,items:$.value,label:t.unref(o)("consumers.consumer_groups.add.consumers_label"),loading:t.unref(c),placeholder:t.unref(o)("consumers.consumer_groups.add.consumer_placeholder"),readonly:h.value,required:"",width:"100%",onQueryChange:t.unref(s)},{"item-template":t.withCtx(({item:ee})=>[t.createElementVNode("div",Tl,t.toDisplayString(ee.label),1),m(ee).data.username&&m(ee).data.custom_id?(t.openBlock(),t.createElementBlock("div",$l,t.toDisplayString(m(ee).data.custom_id),1)):t.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),g.value||x.value||V.value.length?(t.openBlock(),t.createElementBlock("div",jl,[t.createVNode(M,{appearance:"danger"},{default:t.withCtx(()=>[t.createElementVNode("p",null,t.toDisplayString(t.unref(o)("consumers.errors.add")),1),V.value.length?(t.openBlock(),t.createElementBlock("ul",Ml,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value,(ee,nt)=>(t.openBlock(),t.createElementBlock("li",{key:nt},t.toDisplayString(ee),1))),128))])):t.createCommentVNode("",!0),t.createElementVNode("div",null,t.toDisplayString(g.value||x.value),1)]),_:1})])):t.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),tt=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},Dl=tt(Ol,[["__scopeId","data-v-d54468ab"]]),Fl={class:"kong-ui-entities-consumers-list"},vl={key:1},ql=tt(t.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(e,{emit:n}){var jn;const o=n,r=e,{i18nT:a,i18n:{t:i}}=Ie.useI18n(),l=De.useRouter(),{axiosInstance:s}=et((jn=r.config)==null?void 0:jn.axiosRequestConfig),c=t.ref(1),d=t.computed(()=>!!r.config.consumerGroupId),p=t.computed(()=>d.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),u=t.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={username:{label:i("consumers.list.table_headers.username"),searchable:!0,sortable:!0},custom_id:{label:i("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:i("consumers.list.table_headers.tags"),sortable:!1}},m=y,x=I=>({"data-testid":I.username??I.custom_id??I.id}),C=t.computed(()=>{var O,q,W,te;let I=`${r.config.apiBaseUrl}${le.list[r.config.app][d.value?"forConsumerGroup":"all"]}`;return r.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((O=r.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((q=r.config)==null?void 0:q.consumerGroupId)||""):r.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(W=r.config)!=null&&W.workspace?`/${r.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=r.config)==null?void 0:te.consumerGroupId)||"")),I}),w=t.ref(""),$=t.computed(()=>{const I=r.config.app==="konnect"||r.config.isExactMatch;return I?{isExactMatch:I,placeholder:i(`consumers.search.placeholder.${r.config.app}`)}:{isExactMatch:I,fields:{username:y.username,custom_id:y.custom_id},schema:r.config.filterSchema}}),_=t.computed(()=>d.value&&!r.config.paginatedEndpoint?"consumers":void 0),{fetcher:v,fetcherState:k}=Al(r.config,C.value,_.value),h=()=>{w.value=""},g=()=>{c.value++},T=I=>I??"-",b=t.ref(null),f=(I,O)=>{const q=I.id;if(!O(q)){o("copy:error",{entity:I,field:"id",message:i("consumers.errors.copy")});return}o("copy:success",{entity:I,field:"id",message:i("consumers.copy.success",{val:q})})},V=(I,O)=>{const q=JSON.stringify(I);if(!O(q)){o("copy:error",{entity:I,message:i("consumers.errors.copy")});return}o("copy:success",{entity:I,message:i("consumers.copy.success_brief")})},A=async I=>{var q;await((q=r.canRetrieve)==null?void 0:q.call(r,I))&&l.push(r.config.getViewRoute(I.id))},S=I=>({label:i("consumers.actions.view"),to:r.config.getViewRoute(I)}),N=I=>({label:i("consumers.actions.edit"),to:r.config.getEditRoute(I)}),E=t.ref(void 0),j=t.ref(!1),M=t.ref(!1),G=t.ref(""),ee=Il(r.config,C.value),nt=I=>{E.value=I,j.value=!0},Zl=()=>{j.value=!1},Ql=async()=>{var I,O,q;if((I=E.value)!=null&&I.id){M.value=!0;try{await s.delete(ee(E.value.id)),M.value=!1,j.value=!1,c.value++,o("delete:success",E.value)}catch(W){G.value=((q=(O=W.response)==null?void 0:O.data)==null?void 0:q.message)||W.message||i("consumers.errors.delete"),o("error",W)}finally{M.value=!1}}},ot=t.ref(!1),An=()=>{ot.value=!0},_n=()=>{ot.value=!1},Vn=(I,O)=>{O||_n(),c.value++,o("add:success",I)},Xl=()=>{d.value&&An()},oe=t.ref(void 0),rt=t.ref(!1),es=t.ref(""),ts=I=>{oe.value=I,rt.value=!0},En=()=>{rt.value=!1,oe.value=void 0},ns=t.computed(()=>{var O,q,W,te;let I=`${r.config.apiBaseUrl}${le.list[r.config.app].oneForConsumerGroup}`;return r.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((O=r.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((q=r.config)==null?void 0:q.consumerGroupId)||""):r.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(W=r.config)!=null&&W.workspace?`/${r.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=r.config)==null?void 0:te.consumerGroupId)||"")),I}),Tn=t.ref(!1),os=async()=>{if(oe.value){Tn.value=!0;try{const I=ns.value.replace(/{consumerId}/gi,oe.value.id);await s.delete(I),o("remove:success",oe.value),En(),c.value++}catch(I){es.value=I.message||i("consumers.errors.delete"),o("error",I)}finally{Tn.value=!1}}},$n=t.ref(!0);t.watch(k,I=>{var O,q,W,te;if(Array.isArray((O=I==null?void 0:I.response)==null?void 0:O.data)&&($n.value=I.response.data.length>0),I.status===se.Error){b.value={title:i("consumers.errors.general")},(te=(W=(q=I.error)==null?void 0:q.response)==null?void 0:W.data)!=null&&te.message&&(b.value.message=I.error.response.data.message),o("error",I.error);return}b.value=null});const at=t.ref({ctaPath:d.value?void 0:r.config.createRoute,ctaText:void 0,message:`${i("consumers.list.empty_state.description")}${r.config.additionMessageForEmptyState?` ${r.config.additionMessageForEmptyState}`:""}`,title:i("consumers.title")});return t.onBeforeMount(async()=>{await r.canCreate()&&(at.value.title=d.value?i("consumers.list.empty_state.title_for_consumer_group"):i("consumers.list.empty_state.title"),at.value.ctaText=d.value?i("consumers.actions.add_consumer"):i("consumers.actions.create"))}),(I,O)=>{const q=t.resolveComponent("KButton"),W=t.resolveComponent("KBadge"),te=t.resolveComponent("KTruncate"),Se=t.resolveComponent("KDropdownItem"),Mn=t.resolveComponent("KClipboardProvider"),rs=t.resolveComponent("KPrompt");return t.openBlock(),t.createElementBlock("div",Fl,[t.createVNode(t.unref(Qi),{"cache-identifier":e.cacheIdentifier,"disable-pagination":d.value&&!e.config.paginatedEndpoint,"disable-pagination-page-jump":"","disable-sorting":u.value,"empty-state-options":at.value,"enable-entity-actions":"","error-message":b.value,fetcher:t.unref(v),"fetcher-cache-key":c.value,"pagination-type":"offset","preferences-storage-key":p.value,query:w.value,"row-attributes":x,"table-headers":t.unref(m),"use-action-outside":e.useActionOutside,onClearSearchInput:h,"onClick:row":O[3]||(O[3]=D=>A(D)),onEmptyStateCtaClicked:Xl,onSort:g},{"toolbar-filter":t.withCtx(()=>[d.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(bl),{key:0,modelValue:w.value,"onUpdate:modelValue":O[0]||(O[0]=D=>w.value=D),config:$.value},null,8,["modelValue","config"]))]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:t.withCtx(()=>[t.createVNode(t.unref(Me),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-consumer",icon:"plus",size:"large",to:e.config.consumerGroupId?void 0:e.config.createRoute,onClick:O[1]||(O[1]=()=>e.config.consumerGroupId?An():void 0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(i)("consumers.actions.add_consumer"):t.unref(i)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["to"]),[[t.vShow,$n.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),username:t.withCtx(({rowValue:D})=>[t.createElementVNode("b",null,t.toDisplayString(T(D)),1)]),custom_id:t.withCtx(({rowValue:D})=>[t.createTextVNode(t.toDisplayString(T(D)),1)]),tags:t.withCtx(({rowValue:D})=>[D&&D.length>0?(t.openBlock(),t.createBlock(te,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(D,ye=>(t.openBlock(),t.createBlock(W,{key:ye,onClick:O[2]||(O[2]=t.withModifiers(()=>{},["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ye),1)]),_:2},1024))),128))]),_:2},1024)):(t.openBlock(),t.createElementBlock("span",vl,"-"))]),actions:t.withCtx(({row:D})=>[t.createVNode(Mn,null,{default:t.withCtx(({copyToClipboard:ye})=>[t.createVNode(Se,{"data-testid":"action-entity-copy-id",onClick:as=>f(D,ye)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(Mn,null,{default:t.withCtx(({copyToClipboard:ye})=>[t.createVNode(Se,{"data-testid":"action-entity-copy-json",onClick:as=>V(D,ye)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(Me),{"auth-function":()=>e.canRetrieve(D)},{default:t.withCtx(()=>[t.createVNode(Se,{"data-testid":"action-entity-view","has-divider":"",item:S(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Me),{"auth-function":()=>e.canEdit(D)},{default:t.withCtx(()=>[t.createVNode(Se,{"data-testid":"action-entity-edit",item:N(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Me),{"auth-function":()=>e.canDelete(D)},{default:t.withCtx(()=>[t.createVNode(Se,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>e.config.consumerGroupId?ts(D):nt(D)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(i)("consumers.actions.remove"):t.unref(i)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(nl),{"action-button-disabled":M.value,"data-testid":"delete-consumer-modal",description:t.unref(i)("consumers.delete.description"),"entity-name":E.value&&(E.value.username||E.value.custom_id||E.value.id),"entity-type":t.unref(lt).Consumer,error:G.value,title:t.unref(i)("consumers.delete.title"),visible:j.value,onCancel:Zl,onProceed:Ql},null,8,["action-button-disabled","description","entity-name","entity-type","error","title","visible"]),e.config.consumerGroupId?(t.openBlock(),t.createBlock(Dl,{key:0,config:e.config,"data-testid":"add-consumer-modal",visible:ot.value,"onAdd:partialSuccess":O[4]||(O[4]=D=>Vn(D,!0)),"onAdd:success":O[5]||(O[5]=D=>Vn(D)),onCancel:_n},null,8,["config","visible"])):t.createCommentVNode("",!0),e.config.consumerGroupId&&oe.value?(t.openBlock(),t.createBlock(rs,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:t.unref(i)("consumers.consumer_groups.remove.title"),visible:rt.value,onCancel:En,onProceed:os},{default:t.withCtx(()=>[t.createVNode(t.unref(a),{class:"message",keypath:e.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},t.createSlots({consumer:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(oe.value.username||oe.value.custom_id||oe.value.id),1)]),_:2},[e.config.consumerGroupName?{name:"consumerGroup",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(e.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),t.createElementVNode("p",null,t.toDisplayString(t.unref(i)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):t.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-7bf00df6"]]);let Oe;const Ll=new Uint8Array(16);function Kl(){if(!Oe&&(Oe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oe(Ll)}const P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));function Ul(e,n=0){return P[e[n+0]]+P[e[n+1]]+P[e[n+2]]+P[e[n+3]]+"-"+P[e[n+4]]+P[e[n+5]]+"-"+P[e[n+6]]+P[e[n+7]]+"-"+P[e[n+8]]+P[e[n+9]]+"-"+P[e[n+10]]+P[e[n+11]]+P[e[n+12]]+P[e[n+13]]+P[e[n+14]]+P[e[n+15]]}const Bn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Rl(e,n,o){if(Bn.randomUUID&&!n&&!e)return Bn.randomUUID();e=e||{};const r=e.random||(e.rng||Kl)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,n){o=o||0;for(let a=0;a<16;++a)n[o+a]=r[a];return n}return Ul(r)}const Pl={class:"kong-ui-entities-consumer-form"},zl=["id"],Gl={class:"fields-group-text"},Jl=["aria-labelledby"],Hl=tt(t.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:n}){var T;const o=e,r=n,{i18nT:a,i18n:{t:i}}=Ie.useI18n(),l=De.useRouter(),{axiosInstance:s}=et((T=o.config)==null?void 0:T.axiosRequestConfig),{getMessageFromError:c}=Bl(),d=Rl(),p=t.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),u=t.reactive({username:"",customId:"",tags:""}),y=t.computed(()=>{var b,f;return(f=le.form[(b=o.config)==null?void 0:b.app])==null?void 0:f.edit}),m=()=>{var b;l.push(((b=o.config)==null?void 0:b.cancelRoute)||{name:"consumer-list"})},x=b=>{r("loading",b)},C=b=>{r("error",b)},w=b=>{var V,A,S;p.fields.username=((V=b==null?void 0:b.item)==null?void 0:V.username)||(b==null?void 0:b.username)||"",p.fields.customId=((A=b==null?void 0:b.item)==null?void 0:A.custom_id)||(b==null?void 0:b.custom_id)||"";const f=((S=b==null?void 0:b.item)==null?void 0:S.tags)||(b==null?void 0:b.tags)||[];p.fields.tags=(f==null?void 0:f.join(", "))||"",Object.assign(u,p.fields)},$=t.computed(()=>o.consumerId?Fe.Edit:Fe.Create),_=b=>{var V,A,S,N,E,j;let f=`${(V=o.config)==null?void 0:V.apiBaseUrl}${le.form[(A=o.config)==null?void 0:A.app][b]}`;return((S=o.config)==null?void 0:S.app)==="konnect"?f=f.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):((E=o.config)==null?void 0:E.app)==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(j=o.config)!=null&&j.workspace?`/${o.config.workspace}`:"")),f=f.replace(/{id}/gi,o.consumerId),f},v=t.computed(()=>!!p.fields.username||!!p.fields.customId),k=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)),h=t.computed(()=>{var b,f;return{username:p.fields.username||null,custom_id:p.fields.customId||null,tags:(f=(b=p.fields.tags.split(","))==null?void 0:b.map(V=>String(V||"").trim()))==null?void 0:f.filter(V=>V!=="")}}),g=async()=>{var b;try{p.readonly=!0;let f;await s.post(_("validate"),h.value),$.value==="create"?f=await s.post(_("create"),h.value):$.value==="edit"&&(f=((b=o.config)==null?void 0:b.app)==="konnect"?await s.put(_("edit"),h.value):await s.patch(_("edit"),h.value)),w(f==null?void 0:f.data),r("update",f==null?void 0:f.data)}catch(f){p.errorMessage=c(f),r("error",f)}finally{p.readonly=!1}};return(b,f)=>{const V=t.resolveComponent("KInput"),A=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",Pl,[t.createVNode(t.unref(Pi),{"can-submit":v.value&&k.value,config:e.config,"edit-id":e.consumerId,"error-message":p.errorMessage,"fetch-url":y.value,"form-fields":h.value,"is-readonly":p.readonly,onCancel:m,"onFetch:error":f[3]||(f[3]=S=>C(S)),"onFetch:success":w,onLoading:f[4]||(f[4]=S=>x(S)),onSubmit:g},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(Nl),{description:t.unref(i)("consumers.form.info.description"),"has-divider":"",title:t.unref(i)("consumers.form.info.title")},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createElementVNode("h3",{id:`fields-group-title-${t.unref(d)}`,class:"fields-group-title"},t.toDisplayString(t.unref(i)("consumers.form.consumer_identification.title"))+"* ",9,zl),t.createElementVNode("p",Gl,t.toDisplayString(t.unref(i)("consumers.form.consumer_identification.description")),1)]),t.createVNode(A,null,{default:t.withCtx(()=>[t.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${t.unref(d)}`},[t.createVNode(V,{modelValue:p.fields.username,"onUpdate:modelValue":f[0]||(f[0]=S=>p.fields.username=S),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:t.unref(i)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(i)("consumers.fields.username.placeholder"),readonly:p.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(i)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),t.createVNode(V,{modelValue:p.fields.customId,"onUpdate:modelValue":f[1]||(f[1]=S=>p.fields.customId=S),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:t.unref(i)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(i)("consumers.fields.custom_id.placeholder"),readonly:p.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(i)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Jl)]),_:1}),t.createVNode(V,{modelValue:p.fields.tags,"onUpdate:modelValue":f[2]||(f[2]=S=>p.fields.tags=S),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:t.unref(i)("consumers.fields.tags.help"),label:t.unref(i)("consumers.fields.tags.label"),"label-attributes":{info:t.unref(i)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(i)("consumers.fields.tags.placeholder"),readonly:p.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-d3813a74"]]),Yl={class:"kong-ui-consumer-entity-config-card"},Wl=t.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const n=e,{i18n:{t:o},i18nT:r}=Ie.useI18n(),a=t.computed(()=>le.form[n.config.app].edit),i=t.ref({id:{},username:{section:H.Basic,tooltip:o("consumers.fields.username.tooltip"),order:1},custom_id:{section:H.Basic,tooltip:o("consumers.fields.custom_id.tooltip"),label:o("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:o("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(l,s)=>(t.openBlock(),t.createElementBlock("div",Yl,[t.createVNode(t.unref(Li),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":i.value,"fetch-url":a.value,"hide-title":e.hideTitle,"onFetch:error":s[0]||(s[0]=c=>l.$emit("fetch:error",c)),"onFetch:success":s[1]||(s[1]=c=>l.$emit("fetch:success",c)),onLoading:s[2]||(s[2]=c=>l.$emit("loading",c))},{"username-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});Z.ConsumerConfigCard=Wl,Z.ConsumerForm=Hl,Z.ConsumerList=ql,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
|
32
|
+
`:""}var Ua=Ka,Ra={dump:Ua};function Xe(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Pa=R,za=Nt,Ga=_t,Ja=jt,Ha=Mt,Ya=Pe,Wa=on.load,Za=on.loadAll,Qa=Ra.dump,Xa=J,ei={binary:qt,float:$t,map:At,null:Vt,pairs:Kt,set:Ut,timestamp:Ft,bool:Et,int:Tt,merge:vt,omap:Lt,seq:Bt,str:It},ti=Xe("safeLoad","load"),ni=Xe("safeLoadAll","loadAll"),oi=Xe("safeDump","dump"),ri={Type:Pa,Schema:za,FAILSAFE_SCHEMA:Ga,JSON_SCHEMA:Ja,CORE_SCHEMA:Ha,DEFAULT_SCHEMA:Ya,load:Wa,loadAll:Za,dump:Qa,YAMLException:Xa,types:ei,safeLoad:ti,safeLoadAll:ni,safeDump:oi};const ai={class:"yaml-config"},Nn=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const n=e,o=t.computed(()=>{const r=Object.fromEntries(Object.entries(n.yamlRecord).filter(([,a])=>a&&(Array.isArray(a)?a.length!==0:!0)));return Object.keys(r).length===0&&r.constructor===Object?"":ri.dump(r).trim()});return(r,a)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",ai,[n.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:o.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),ii={key:0,class:"config-card-display-form"},li=["data-testid"],si={key:0,class:"config-card-prop-section-title"},ci=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json"].includes(e)},propListTypes:{type:Array,required:!1,default:()=>[]},record:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""}},setup(e){const n=e,o=t.useSlots(),{i18n:{t:r}}=U.useI18n(),a=l=>!!(l.tooltip||o[`${l.key}-label-tooltip`]),i=t.computed(()=>{if(!n.record)return n.record;const l=JSON.parse(JSON.stringify(n.record));return delete l.created_at,delete l.updated_at,l});return(l,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",ii,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propListTypes,c=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${c}-props`,class:t.normalizeClass(`config-card-details-${c}-props`),"data-testid":`config-card-details-${c}-props`},[c!=="basic"?(t.openBlock(),t.createElementBlock("div",si,t.toDisplayString(c==="advanced"?t.unref(r)("baseConfigCard.sections.advanced"):t.unref(r)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],d=>(t.openBlock(),t.createBlock(kt,{key:d.key,item:d},t.createSlots({label:t.withCtx(()=>[t.renderSlot(l.$slots,`${d.key}-label`,{row:d},void 0,!0)]),[d.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(l.$slots,d.key,{row:d,rowValue:p},void 0,!0)]),_:2},[a(d)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(l.$slots,`${d.key}-label-tooltip`,{row:d},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,li))),128))])):t.createCommentVNode("",!0),e.format==="json"&&n.record?(t.openBlock(),t.createBlock(Ct,{key:1,config:n.config,"fetcher-url":n.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&n.record?(t.openBlock(),t.createBlock(Nn,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),di=Q(ci,[["__scopeId","data-v-147a2f70"]]),ie="24px",je=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},ui=e=>(t.pushScopeId("data-v-a81be499"),e=e(),t.popScopeId(),e),pi=["aria-hidden"],fi={key:0,"data-testid":"kui-icon-svg-title"},mi=ui(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),gi=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",fi,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),mi],8,pi))]),_:1},8,["aria-hidden","style"]))}}),hi=je(gi,[["__scopeId","data-v-a81be499"]]),yi=e=>(t.pushScopeId("data-v-82729631"),e=e(),t.popScopeId(),e),bi=["aria-hidden"],ki={key:0,"data-testid":"kui-icon-svg-title"},Ci=yi(()=>t.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)),wi=t.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:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon book-icon","data-testid":"kui-icon-wrapper-book-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.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?(t.openBlock(),t.createElementBlock("title",ki,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ci],8,bi))]),_:1},8,["aria-hidden","style"]))}}),xi=je(wi,[["__scopeId","data-v-82729631"]]),Si=e=>(t.pushScopeId("data-v-c0f10e09"),e=e(),t.popScopeId(),e),Ni=["aria-hidden"],Ii={key:0,"data-testid":"kui-icon-svg-title"},Bi=Si(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),Ai=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Ii,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Bi],8,Ni))]),_:1},8,["aria-hidden","style"]))}}),_i=je(Ai,[["__scopeId","data-v-c0f10e09"]]),Vi=e=>(t.pushScopeId("data-v-79c90e9e"),e=e(),t.popScopeId(),e),Ei=["aria-hidden"],Ti={key:0,"data-testid":"kui-icon-svg-title"},$i=Vi(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),ji=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ie,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const n=String(e).replace(/px/gi,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const n=e,o=t.computed(()=>{if(typeof n.size=="number"&&n.size>0)return`${n.size}px`;if(typeof n.size=="string"){const a=String(n.size).replace(/px/gi,""),i=Number(a);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return ie}),r=t.computed(()=>({boxSizing:"border-box",color:n.color,display:n.display,height:o.value,lineHeight:"0",width:o.value}));return(a,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(r.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Ti,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),$i],8,Ei))]),_:1},8,["aria-hidden","style"]))}}),Mi=je(ji,[["__scopeId","data-v-79c90e9e"]]),Oi={class:"config-card-title","data-testid":"config-card-title"},Di={class:"config-card-actions"},Fi=["href"],vi={class:"config-card-details-section"},qi=t.defineComponent({__name:"EntityBaseConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configSchema:{type:Object,required:!1,default:()=>({})},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:n}){var o;const r=n,a=e,{i18n:{t:i}}=U.useI18n(),{getMessageFromError:l}=U.useErrors(),{convertKeyToTitle:s}=U.useStringHelpers(),{axiosInstance:c}=U.useAxios((o=a.config)==null?void 0:o.axiosRequestConfig),d=[{label:i("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],p=t.ref("structured"),u=g=>{p.value=g==null?void 0:g.value},y={id:{type:F.ID,label:i("baseConfigCard.commonFields.id_label"),order:0,section:H.Basic},name:{order:1,section:H.Basic},enabled:{type:F.BadgeStatus,order:2,section:H.Basic},updated_at:{type:F.Date,label:i("baseConfigCard.commonFields.updated_at_label"),order:3,section:H.Basic},created_at:{type:F.Date,label:i("baseConfigCard.commonFields.created_at_label"),order:4,section:H.Basic},tags:{type:F.BadgeTag,order:-1,section:H.Basic}},m=t.ref(!1),x=t.ref(!1),C=t.ref(""),w=t.ref({}),$=t.computed(()=>{var g,T,b;if(!w.value)return[];const f=[],V=Object.keys(w.value).length;for(const A in w.value){const S=(T=(g=a.configSchema)==null?void 0:g[A])==null?void 0:T.order,N=(b=y[A])==null?void 0:b.order;let E=V;(N||N===0)&&(E=N===-1?V+1:N),S&&(E=S===-1?V+1:S),f.push([A,E])}return f.sort(function(A,S){return A[1]-S[1]}),f.map(A=>{var S,N;const E=A[0],j=(S=w.value)==null?void 0:S[E],M=((N=a.configSchema)==null?void 0:N[E])||{},G=y[E];return{key:E,value:j,hidden:M.hidden||!1,type:M.type??((G==null?void 0:G.type)||F.Text),label:M.label??((G==null?void 0:G.label)||s(E)),tooltip:M.tooltip??((G==null?void 0:G.tooltip)||void 0),section:M.section??((G==null?void 0:G.section)||H.Advanced)}}).filter(A=>!A.hidden&&A.key!==a.pluginConfigKey)}),_=t.computed(()=>{var g,T;if(!w.value||!a.pluginConfigKey)return[];const b=w.value[a.pluginConfigKey]||{},f=Object.keys(b).length,V=[];for(const A in b){const S=(T=(g=a.pluginConfigSchema)==null?void 0:g[A])==null?void 0:T.order,N=b[A];let E=N!=null&&N!==""?f-1:f;S&&(E=S===-1?f+1:S),V.push([A,E])}return V.sort(function(A,S){return A[1]-S[1]}),V.map(A=>{var S;const N=A[0],E=b[N],j=((S=a.pluginConfigSchema)==null?void 0:S[N])||{};return{key:N,value:E,hidden:j.hidden||!1,type:j.type??F.Text,label:j.label??s(N),tooltip:j.tooltip??void 0,section:H.Plugin}}).filter(A=>!A.hidden)}),v=t.computed(()=>{var g,T,b,f;return{basic:(g=$.value)==null?void 0:g.filter(V=>V.section===H.Basic),advanced:(T=$.value)==null?void 0:T.filter(V=>V.section===H.Advanced),plugin:(f=_.value)==null?void 0:f.concat((b=$.value)==null?void 0:b.filter(V=>V.section===H.Plugin))}}),k=t.computed(()=>{const g=[];return v.value.basic.length&&g.push("basic"),v.value.advanced.length&&g.push("advanced"),v.value.plugin.length&&g.push("plugin"),g}),h=t.computed(()=>{var g,T;let b=`${a.config.apiBaseUrl}${a.fetchUrl}`;return a.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((g=a.config)==null?void 0:g.controlPlaneId)||""):a.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(T=a.config)!=null&&T.workspace?`/${a.config.workspace}`:"")),b=b.replace(/{id}/gi,a.config.entityId),b});return t.watch(m,g=>{r("loading",g)},{immediate:!0}),t.onBeforeMount(async()=>{x.value=!1,m.value=!0;try{const{data:g}=await c.get(h.value);if(a.dataKey)if(typeof g[a.dataKey]<"u")w.value={...g[a.dataKey]};else throw new Error(i("errors.dataKeyUndefined",{dataKey:a.dataKey}));else w.value={...g};Object.keys(a.configSchema).filter(T=>a.configSchema[T].forceShow).forEach(T=>{w.value&&typeof w.value[T]>"u"&&(w.value[T]=null)}),r("fetch:success",g)}catch(g){const T=l(g);C.value=T.startsWith("code")?i("baseConfigCard.errors.load"):T,x.value=!0,r("fetch:error",g)}finally{m.value=!1}}),(g,T)=>{const b=t.resolveComponent("KLabel"),f=t.resolveComponent("KSelect"),V=t.resolveComponent("KButton"),A=t.resolveComponent("KSkeleton"),S=t.resolveComponent("KEmptyState"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(N,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Di,[t.renderSlot(g.$slots,"actions",{},void 0,!0),t.createVNode(b,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(f,{"data-testid":"select-config-format",items:d,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(V,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(xi),{size:t.unref(No)},null,8,["size"])],8,Fi)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[m.value?(t.openBlock(),t.createBlock(A,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):x.value?(t.openBlock(),t.createBlock(S,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(C.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",vi,[t.createVNode(di,{config:e.config,"fetcher-url":h.value,format:p.value,"prop-list-types":k.value,"property-collections":v.value,record:w.value},t.createSlots({_:2},[t.renderList(Object.keys(g.$slots),E=>({name:E,fn:t.withCtx(({row:j,rowValue:M})=>[t.renderSlot(g.$slots,E,{row:j,rowValue:M},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",Oi,[t.renderSlot(g.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),Li=Q(qi,[["__scopeId","data-v-f40a683b"]]),Ki=["novalidate"],Ui={class:"form-actions","data-testid":"form-actions"},Ri=t.defineComponent({__name:"EntityBaseForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string")},editId:{type:String,required:!1,default:""},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:n}){var o;const r=n,a=e,i=De.useRouter(),{i18n:{t:l}}=U.useI18n(),{getMessageFromError:s}=U.useErrors(),{axiosInstance:c}=U.useAxios((o=a.config)==null?void 0:o.axiosRequestConfig),d=t.ref(!1),p=t.ref(!1),u=t.ref(""),y=t.computed(()=>a.canSubmit===!1||a.isReadonly),m=t.ref(!1),x=t.computed(()=>{var k,h;let g=`${a.config.apiBaseUrl}${a.fetchUrl}`;return a.config.app==="konnect"?g=g.replace(/{controlPlaneId}/gi,((k=a.config)==null?void 0:k.controlPlaneId)||""):a.config.app==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(h=a.config)!=null&&h.workspace?`/${a.config.workspace}`:"")),a.editId?(g=g.replace(/{id}/gi,a.editId),g):(g=g.replace(/\/{id}/gi,""),g)}),C=()=>{m.value=!m.value},w=()=>{a.config.cancelRoute?i.push(a.config.cancelRoute):$()},$=()=>{r("cancel")},_=()=>{y.value||r("submit")},v=t.ref([{title:l("baseForm.configuration.yaml"),hash:"#yaml"},{title:l("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>d.value,k=>{r("loading",k)},{immediate:!0}),t.onBeforeMount(async()=>{if(a.editId)try{p.value=!1,d.value=!0;const{data:k}=await c.get(x.value);r("fetch:success",k)}catch(k){const h=s(k);u.value=h.startsWith("code")?l("baseForm.errors.edit"):h,p.value=!0,r("fetch:error",k)}finally{d.value=!1}}),(k,h)=>{const g=t.resolveComponent("KSkeleton"),T=t.resolveComponent("KEmptyState"),b=t.resolveComponent("KAlert"),f=t.resolveComponent("KButton"),V=t.resolveComponent("KTabs"),A=t.resolveComponent("KSlideout"),S=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(S,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[d.value?(t.openBlock(),t.createBlock(g,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(T,{key:1,"action-button-text":t.unref(l)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:w},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:a.noValidate,onReset:t.withModifiers($,["prevent"]),onSubmit:t.withModifiers(_,["prevent"])},[t.renderSlot(k.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(b,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Ui,[t.renderSlot(k.$slots,"form-actions",{},()=>[t.createVNode(f,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:h[0]||(h[0]=N=>C())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("baseForm.actions.viewConfiguration")),1)]),_:1}),t.createVNode(f,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(f,{appearance:"primary","data-testid":"form-submit",disabled:y.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],40,Ki)),t.createVNode(A,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(l)("baseForm.configuration.title"),visible:m.value,onClose:h[1]||(h[1]=N=>C())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(l)("baseForm.configuration.message")),1),t.createVNode(V,{"data-testid":"form-view-configuration-slideout-tabs",tabs:v.value},{json:t.withCtx(()=>[t.createVNode(Ct,{config:e.config,"fetcher-url":x.value,"json-record":a.formFields,"request-method":a.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(Nn,{"yaml-record":a.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Pi=Q(Ri,[["__scopeId","data-v-3def74fe"]]),zi={key:0,"data-testid":"first-col"},Gi=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const n=e,o=t.computed(()=>{var C;return((C=n.rowEl)==null?void 0:C.querySelector(`[data-testid="${n.keyName}"]`))||null}),r=t.computed(()=>{var C;return((C=o.value)==null?void 0:C.querySelector('[data-testid="first-col"]'))||null}),a=t.computed(()=>{var C,w;const $=(C=n.rowEl)==null?void 0:C.querySelectorAll("td");return $?((w=$[0])==null?void 0:w.getAttribute("data-testid"))===n.keyName:!1});let i;const l=()=>{i&&(i.disconnect(),i=void 0)},s=()=>{var C,w,$;d.value=((C=r.value)==null?void 0:C.getBoundingClientRect().width)||0,p.value=((w=o.value)==null?void 0:w.clientWidth)||0,u.value=(($=c.value)==null?void 0:$.innerText)||""},c=t.ref({}),d=t.ref(0),p=t.ref(0),u=t.ref(""),y=t.computed(()=>[r.value,o.value]),m=t.watch(y,C=>{if(a.value&&(l(),"ResizeObserver"in window&&window)){i=new ResizeObserver(w=>{window.requestAnimationFrame(()=>{!Array.isArray(w)||!w.length||s()})});for(const w of C)w&&i.observe(w)}},{immediate:!0,flush:"post",deep:!0}),x=t.computed(()=>a.value?d.value>p.value:!1);return t.onMounted(()=>{s()}),t.onUnmounted(()=>{m()}),(C,w)=>{const $=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[a.value?(t.openBlock(),t.createElementBlock("span",zi,[t.createVNode($,{"max-width":"300",placement:"bottomStart",text:x.value?u.value:""},{default:t.withCtx(()=>[t.renderSlot(C.$slots,"default",{},void 0,!0)]),_:3},8,["text"])])):t.renderSlot(C.$slots,"default",{key:1},void 0,!0)],512)}}}),Ji=Q(Gi,[["__scopeId","data-v-c4379fd4"]]),Hi={class:"toolbar-container"},Yi={key:0,class:"toolbar-button-container"},Wi=["data-testid"],Zi=t.defineComponent({__name:"EntityBaseTable",props:{tableHeaders:{type:Object,required:!0,default:()=>({})},fetcher:{type:Function,required:!0,default:async()=>({data:[],total:0})},initialFetcherParams:{type:Object,default:null},cacheIdentifier:{type:String,default:""},fetcherCacheKey:{type:Number,default:1},isLoading:{type:Boolean,default:!1},query:{type:String,default:""},enableClientSort:{type:Boolean,default:!1},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:n}){const o=e,r=n,{i18n:{t:a}}=U.useI18n(),i=t.computed(()=>{var h,g;return typeof o.errorMessage=="string"?{hasError:!!o.errorMessage,title:o.errorMessage,message:void 0}:{hasError:!!o.errorMessage,title:(h=o.errorMessage)==null?void 0:h.title,message:(g=o.errorMessage)==null?void 0:g.message}}),l=t.computed(()=>o.cacheIdentifier||o.preferencesStorageKey),s=h=>h.hasData||!!o.query,c=t.computed(()=>{const h=[];return Object.keys(o.tableHeaders).forEach(g=>{const T=o.tableHeaders[g];h.push({label:T.label??g,key:g,sortable:T.sortable??!1})}),o.enableEntityActions&&h.push({key:"actions",hideLabel:!0}),h}),d=h=>({"data-rowid":h.id,"data-testid":h.name,...o.rowAttributes(h)}),p=t.ref({}),u=h=>{var g;return(g=p.value)==null?void 0:g.$el.querySelector(`[data-rowid="${h.id}"]`)},y=h=>{const g={"data-testid":h.headerKey,...o.cellAttributes(h)};return h.colIndex===0&&(g.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),g},m=()=>{r("empty-state-cta-clicked"),x()},x=()=>{r("clear-search-input")},C=t.computed(()=>o.disableRowClick?void 0:(h,g)=>{r("click:row",g)}),w=h=>{r("sort",h)},{setTablePreferences:$,getTablePreferences:_}=Kn(),v=t.computed(()=>{const h=_(o.preferencesStorageKey);return{...o.initialFetcherParams,...h}}),k=h=>{o.preferencesStorageKey&&$(o.preferencesStorageKey,h)};return(h,g)=>{const T=t.resolveComponent("KIcon"),b=t.resolveComponent("KButton"),f=t.resolveComponent("KDropdown"),V=t.resolveComponent("KTable"),A=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(A,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(V,{ref_key:"tableRefs",ref:p,"cache-identifier":l.value,"cell-attrs":y,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-message":e.query?t.unref(a)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(a)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(a)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,"enable-client-sort":e.enableClientSort,"error-state-message":i.value.message,"error-state-title":i.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),"has-error":i.value.hasError,headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":v.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":d,"search-input":e.query,onKtableEmptyStateCtaClicked:m,"onRow:click":C.value,onSort:g[0]||(g[0]=S=>w(S)),"onUpdate:tablePreferences":k},t.createSlots({toolbar:t.withCtx(({state:S})=>[t.withDirectives(t.createElementVNode("div",Hi,[t.renderSlot(h.$slots,"toolbar-filter",{},void 0,!0),h.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Yi,[t.renderSlot(h.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,s(S)]])]),actions:t.withCtx(({row:S,rowKey:N,rowValue:E})=>[t.createElementVNode("div",{class:"actions-container","data-testid":S.name},[t.createVNode(f,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(h.$slots,"actions",{row:S,rowKey:N,rowValue:E},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(b,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(T,{color:t.unref(wo),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Wi)]),_:2},[t.renderList(e.tableHeaders,(S,N)=>({name:N,fn:t.withCtx(({row:E,rowKey:j,rowValue:M})=>[t.createVNode(Ji,{"key-name":String(N),"row-el":u(E)},{default:t.withCtx(()=>[t.renderSlot(h.$slots,N,{row:E,rowKey:j,rowValue:M},()=>[t.createTextVNode(t.toDisplayString(M),1)],!0)]),_:2},1032,["key-name","row-el"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(hi))]),key:"0"}]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","enable-client-sort","error-state-message","error-state-title","fetcher","fetcher-cache-key","has-error","headers","initial-fetcher-params","is-loading","pagination-type","search-input","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Qi=Q(Zi,[["__scopeId","data-v-99908c24"]]),Xi={key:0,class:"kong-ui-entity-delete-error"},el={key:1,class:"description"},tl=t.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:n}){const{i18nT:o}=U.useI18n(),r=e,a=n,i=t.computed(()=>r.needConfirm?r.entityName:""),l=()=>{a("cancel")},s=()=>{a("proceed")};return(c,d)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":i.value,title:e.title,visible:e.visible,onCancel:l,onProceed:s},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Xi,[t.createVNode(p,{appearance:"danger"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(o),{class:"message",keypath:r.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.entityType),1)]),_:2},[r.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(r.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),r.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",el,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(r.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),nl=Q(tl,[["__scopeId","data-v-4361d622"]]),ol={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},rl={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},al=["fill"],il={mask:"url(#mask0_180_20349)"},ll=["fill"],In=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${ko})`}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("svg",ol,[t.createElementVNode("mask",rl,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,al)]),t.createElementVNode("g",il,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,ll)])]))}}),sl={key:1,class:"kong-ui-entity-filter"},cl={class:"kong-ui-entity-filter-menu"},dl=["data-testid"],ul=["onClick","onKeydown"],pl={class:"menu-item-indicator"},fl={class:"menu-item-body"},ml=["for"],gl={class:"menu-item-buttons"},hl={class:"filter-clear-button-container"},yl=t.defineComponent({__name:"EntityFilter",props:{config:{type:Object,required:!0,default:()=>({isExactMatch:!0,placeholder:""})},modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:n}){const{i18n:{t:o}}=U.useI18n(),r=e,a=n,i=t.ref(!1),l=t.ref({}),s=t.ref(new Set),c=t.computed(()=>{const k=[];return new URLSearchParams(r.modelValue).forEach((h,g)=>{h!==""&&k.push(g)}),k}),d=t.computed(()=>{const k=r.config.fields;return Object.keys(k).filter(h=>k[h].searchable).map(h=>({label:k[h].label||h,value:h,expanded:!1}))});t.watch(()=>r.modelValue,k=>{l.value={},new URLSearchParams(k).forEach((h,g)=>{l.value[g]=h})});const p=()=>{i.value=!i.value},u=k=>{s.value.has(k)?s.value.delete(k):s.value.add(k)},y=k=>{a("update:modelValue",k)},m=()=>{y("")},x=k=>`filter-${k}`,C=k=>{var h,g;return(((g=(h=r.config.schema)==null?void 0:h[k])==null?void 0:g.values)??[]).map(T=>({value:T,label:T}))},w=k=>{var h,g;return((g=(h=r.config.schema)==null?void 0:h[k])==null?void 0:g.type)??"text"},$=k=>{l.value={...l.value,[k]:""},v()},_=()=>{l.value={},v(!0)},v=(k=!1)=>{const h=Object.keys(l.value).reduce((g,T)=>(l.value[T]&&(g[T]=`${l.value[T]}`),g),{});k&&(i.value=!1),a("update:modelValue",new URLSearchParams(h).toString())};return(k,h)=>{const g=t.resolveComponent("KInput"),T=t.resolveComponent("KButton"),b=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(g,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":y},{before:t.withCtx(()=>[t.createVNode(In)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(Mi),{class:"kong-ui-entity-filter-clear",onClick:m},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",sl,[t.createVNode(T,{appearance:"tertiary","data-testid":"filter-button",onClick:p},{default:t.withCtx(()=>[t.createVNode(In),t.createTextVNode(" "+t.toDisplayString(t.unref(o)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:p},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createElementVNode("div",cl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,f=>{var V,A;return t.openBlock(),t.createElementBlock("div",{key:f.value,class:"kong-ui-entity-filter-menu-item","data-testid":f.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:s.value.has(f.value)}]),role:"button",tabindex:"0",onClick:S=>u(f.value),onKeydown:t.withKeys(S=>u(f.value),["enter"])},[t.createTextVNode(t.toDisplayString(f.label)+" ",1),t.withDirectives(t.createElementVNode("span",pl,null,512),[[t.vShow,c.value.includes(f.value)]]),t.createVNode(t.unref(_i),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:s.value.has(f.value)}]),color:t.unref(xo)},null,8,["class","color"])],42,ul),t.withDirectives(t.createElementVNode("div",fl,[t.createElementVNode("label",{class:"menu-item-label",for:x(f.value)},t.toDisplayString(t.unref(o)("filter.fieldLabel")),9,ml),((A=(V=e.config.schema)==null?void 0:V[f.value])==null?void 0:A.type)==="select"?(t.openBlock(),t.createBlock(b,{key:0,id:x(f.value),modelValue:l.value[f.value],"onUpdate:modelValue":S=>l.value[f.value]=S,items:C(f.value),placeholder:t.unref(o)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(g,{key:1,id:x(f.value),modelValue:l.value[f.value],"onUpdate:modelValue":S=>l.value[f.value]=S,autocomplete:"off",placeholder:t.unref(o)("filter.inputPlaceholder"),type:w(f.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,s.value.has(f.value)]]),t.withDirectives(t.createElementVNode("div",gl,[t.createVNode(T,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:h[0]||(h[0]=S=>v(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("filter.applyButtonText")),1)]),_:1}),t.createVNode(T,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:S=>$(f.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,s.value.has(f.value)]])],8,dl)}),128)),t.createElementVNode("div",hl,[t.createVNode(T,{appearance:"tertiary",size:"small",onClick:_},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,i.value]])]))}}}),bl=Q(yl,[["__scopeId","data-v-8cfadde3"]]),Me=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const n=e,o=t.ref(void 0),r=t.computed(()=>o.value===!0||o.value!==void 0&&n.forceShow===!0);return t.watch(()=>n.authFunction,async()=>{o.value=await n.authFunction()},{immediate:!0}),(a,i)=>r.value?t.renderSlot(a.$slots,"default",{key:0,isAllowed:o.value}):t.createCommentVNode("",!0)}}),kl={class:"form-section-wrapper"},Cl={key:1,class:"form-section-description"},wl={key:2,class:"form-section-footer"},xl={class:"form-section-content"},Sl=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const n=t.useSlots();return(o,r)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",kl,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1})):t.createCommentVNode("",!0),e.description||t.unref(n).description?(t.openBlock(),t.createElementBlock("div",Cl,[t.renderSlot(o.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(n).footer?(t.openBlock(),t.createElementBlock("div",wl,[t.renderSlot(o.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",xl,[t.renderSlot(o.$slots,"default",{},void 0,!0)])])],2))}}),Nl=Q(Sl,[["__scopeId","data-v-4bb31634"]]),{useAxios:et,useDeleteUrlBuilder:Il,useErrors:Bl,useExternalLinkCreator:ls,useFetchUrlBuilder:ss,useFetcher:Al,useDebouncedFilter:_l,useStringHelpers:cs,useHelpers:ds,useGatewayFeatureSupported:us,useTruncationDetector:ps,useValidators:fs}=U,Vl={class:"add-consumer-form-container"},El={class:"add-consumer-form-cta"},Tl={class:"select-item-label"},$l={key:0,class:"select-item-desc"},jl={key:0,class:"kong-ui-entity-add-consumers-error"},Ml={key:0},Ol=t.defineComponent({__name:"AddConsumerModal",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.consumerGroupId)},visible:{type:Boolean,required:!0,default:!1}},emits:["cancel","add:success","add:partial-success","error"],setup(e,{emit:n}){var S;const{i18n:{t:o}}=Ie.useI18n(),r=e,a=n,{axiosInstance:i}=et((S=r.config)==null?void 0:S.axiosRequestConfig),l=t.ref([]),{debouncedQueryChange:s,loading:c,allRecords:d,error:p,loadItems:u,results:y}=_l(r.config,le.list[r.config.app].all,"",{fetchedItemsKey:"data",searchKeys:["username","id"]}),m=N=>N,x=t.computed(()=>p.value?o("consumers.errors.general"):""),C=t.ref(0),w=t.computed(()=>d.value===void 0),$=t.computed(()=>y.value.map(N=>({label:N.username||N.customId,value:N.id,selected:l.value.includes(N.id),data:N}))),_=N=>{var j;const E=w.value?y.value.find(M=>M.id===N):(j=d.value)==null?void 0:j.find(M=>M.id===N);return E?E.username||E.custom_id:N},v=()=>{g.value="",k.value=[],V.value=[],a("cancel")},k=t.ref([]),h=t.ref(!1),g=t.ref(""),T=async()=>{if(!l.value.length){g.value="",V.value=[],a("cancel");return}h.value=!0,g.value="",k.value=[],V.value=[];try{const N=l.value.map(M=>f(M)),E=await Promise.allSettled(N);let j=!0;E.forEach(M=>{M.status!=="fulfilled"&&(j=!1)}),j?(k.value=[],V.value=[],a("add:success",l.value),l.value=[]):(k.value.length&&a("add:partial-success",k.value),l.value=[],A(E))}catch{g.value=o("consumers.errors.add"),a("error",g.value)}finally{h.value=!1}},b=t.computed(()=>{var E,j,M,G;let N=`${r.config.apiBaseUrl}${le.list[r.config.app].forConsumerGroup}`;return r.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((E=r.config)==null?void 0:E.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((j=r.config)==null?void 0:j.consumerGroupId)||""):r.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(M=r.config)!=null&&M.workspace?`/${r.config.workspace}`:"").replace(/{consumerGroupId}/gi,((G=r.config)==null?void 0:G.consumerGroupId)||"")),N}),f=async N=>{const E={consumer:N};try{const j=await i.post(b.value,E);return k.value.push(N),j}catch(j){let M=`${_(N)} - ${j.message}`;return j.response.status===409&&(M=`${_(N)} - ${o("consumers.errors.already_added")}`),Promise.reject(Error(M))}},V=t.ref([]),A=N=>{V.value=N.map(E=>{var j;return(j=E.reason)==null?void 0:j.message}).filter(Boolean)};return t.watch($,()=>{C.value++},{immediate:!0,deep:!0}),t.watch(()=>r.visible,()=>{r.visible&&u()},{immediate:!0}),(N,E)=>{const j=t.resolveComponent("KMultiselect"),M=t.resolveComponent("KAlert"),G=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(G,{"action-button-disabled":h.value,class:"kong-ui-entities-add-consumers-modal","data-testid":"add-consumer-modal",title:t.unref(o)("consumers.consumer_groups.add.title"),visible:e.visible,onCancel:v,onProceed:T},{default:t.withCtx(()=>[t.createElementVNode("div",Vl,[t.createElementVNode("p",El,t.toDisplayString(t.unref(o)("consumers.consumer_groups.add.ctaText")),1),t.createVNode(j,{modelValue:l.value,"onUpdate:modelValue":E[0]||(E[0]=ee=>l.value=ee),autosuggest:"","data-testid":"add-consumers-multiselect","dropdown-footer-text":w.value?t.unref(o)("consumers.consumer_groups.add.footer"):void 0,items:$.value,label:t.unref(o)("consumers.consumer_groups.add.consumers_label"),loading:t.unref(c),placeholder:t.unref(o)("consumers.consumer_groups.add.consumer_placeholder"),readonly:h.value,required:"",width:"100%",onQueryChange:t.unref(s)},{"item-template":t.withCtx(({item:ee})=>[t.createElementVNode("div",Tl,t.toDisplayString(ee.label),1),m(ee).data.username&&m(ee).data.custom_id?(t.openBlock(),t.createElementBlock("div",$l,t.toDisplayString(m(ee).data.custom_id),1)):t.createCommentVNode("",!0)]),_:1},8,["modelValue","dropdown-footer-text","items","label","loading","placeholder","readonly","onQueryChange"]),g.value||x.value||V.value.length?(t.openBlock(),t.createElementBlock("div",jl,[t.createVNode(M,{appearance:"danger"},{default:t.withCtx(()=>[t.createElementVNode("p",null,t.toDisplayString(t.unref(o)("consumers.errors.add")),1),V.value.length?(t.openBlock(),t.createElementBlock("ul",Ml,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.value,(ee,nt)=>(t.openBlock(),t.createElementBlock("li",{key:nt},t.toDisplayString(ee),1))),128))])):t.createCommentVNode("",!0),t.createElementVNode("div",null,t.toDisplayString(g.value||x.value),1)]),_:1})])):t.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","title","visible"])}}}),tt=(e,n)=>{const o=e.__vccOpts||e;for(const[r,a]of n)o[r]=a;return o},Dl=tt(Ol,[["__scopeId","data-v-d54468ab"]]),Fl={class:"kong-ui-entities-consumers-list"},vl={key:1},ql=tt(t.defineComponent({__name:"ConsumerList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","add:success","remove:success"],setup(e,{emit:n}){var jn;const o=n,r=e,{i18nT:a,i18n:{t:i}}=Ie.useI18n(),l=De.useRouter(),{axiosInstance:s}=et((jn=r.config)==null?void 0:jn.axiosRequestConfig),c=t.ref(1),d=t.computed(()=>!!r.config.consumerGroupId),p=t.computed(()=>d.value?"kong-ui-entities-consumers-list-in-group-page":"kong-ui-entities-consumers-list"),u=t.computed(()=>r.config.app!=="kongManager"||!!r.config.disableSorting),y={username:{label:i("consumers.list.table_headers.username"),searchable:!0,sortable:!0},custom_id:{label:i("consumers.list.table_headers.custom_id"),searchable:!0,sortable:!0},tags:{label:i("consumers.list.table_headers.tags"),sortable:!1}},m=y,x=I=>({"data-testid":I.username??I.custom_id??I.id}),C=t.computed(()=>{var O,q,W,te;let I=`${r.config.apiBaseUrl}${le.list[r.config.app][d.value?"forConsumerGroup":"all"]}`;return r.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((O=r.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((q=r.config)==null?void 0:q.consumerGroupId)||""):r.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(W=r.config)!=null&&W.workspace?`/${r.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=r.config)==null?void 0:te.consumerGroupId)||"")),I}),w=t.ref(""),$=t.computed(()=>{const I=r.config.app==="konnect"||r.config.isExactMatch;return I?{isExactMatch:I,placeholder:i(`consumers.search.placeholder.${r.config.app}`)}:{isExactMatch:I,fields:{username:y.username,custom_id:y.custom_id},schema:r.config.filterSchema}}),_=t.computed(()=>d.value&&!r.config.paginatedEndpoint?"consumers":void 0),{fetcher:v,fetcherState:k}=Al(r.config,C.value,_.value),h=()=>{w.value=""},g=()=>{c.value++},T=I=>I??"-",b=t.ref(null),f=(I,O)=>{const q=I.id;if(!O(q)){o("copy:error",{entity:I,field:"id",message:i("consumers.errors.copy")});return}o("copy:success",{entity:I,field:"id",message:i("consumers.copy.success",{val:q})})},V=(I,O)=>{const q=JSON.stringify(I);if(!O(q)){o("copy:error",{entity:I,message:i("consumers.errors.copy")});return}o("copy:success",{entity:I,message:i("consumers.copy.success_brief")})},A=async I=>{var q;await((q=r.canRetrieve)==null?void 0:q.call(r,I))&&l.push(r.config.getViewRoute(I.id))},S=I=>({label:i("consumers.actions.view"),to:r.config.getViewRoute(I)}),N=I=>({label:i("consumers.actions.edit"),to:r.config.getEditRoute(I)}),E=t.ref(void 0),j=t.ref(!1),M=t.ref(!1),G=t.ref(""),ee=Il(r.config,C.value),nt=I=>{E.value=I,j.value=!0},Zl=()=>{j.value=!1},Ql=async()=>{var I,O,q;if((I=E.value)!=null&&I.id){M.value=!0;try{await s.delete(ee(E.value.id)),M.value=!1,j.value=!1,c.value++,o("delete:success",E.value)}catch(W){G.value=((q=(O=W.response)==null?void 0:O.data)==null?void 0:q.message)||W.message||i("consumers.errors.delete"),o("error",W)}finally{M.value=!1}}},ot=t.ref(!1),An=()=>{ot.value=!0},_n=()=>{ot.value=!1},Vn=(I,O)=>{O||_n(),c.value++,o("add:success",I)},Xl=()=>{d.value&&An()},oe=t.ref(void 0),rt=t.ref(!1),es=t.ref(""),ts=I=>{oe.value=I,rt.value=!0},En=()=>{rt.value=!1,oe.value=void 0},ns=t.computed(()=>{var O,q,W,te;let I=`${r.config.apiBaseUrl}${le.list[r.config.app].oneForConsumerGroup}`;return r.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((O=r.config)==null?void 0:O.controlPlaneId)||"").replace(/{consumerGroupId}/gi,((q=r.config)==null?void 0:q.consumerGroupId)||""):r.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(W=r.config)!=null&&W.workspace?`/${r.config.workspace}`:"").replace(/{consumerGroupId}/gi,((te=r.config)==null?void 0:te.consumerGroupId)||"")),I}),Tn=t.ref(!1),os=async()=>{if(oe.value){Tn.value=!0;try{const I=ns.value.replace(/{consumerId}/gi,oe.value.id);await s.delete(I),o("remove:success",oe.value),En(),c.value++}catch(I){es.value=I.message||i("consumers.errors.delete"),o("error",I)}finally{Tn.value=!1}}},$n=t.ref(!0);t.watch(k,I=>{var O,q,W,te;if(Array.isArray((O=I==null?void 0:I.response)==null?void 0:O.data)&&($n.value=I.response.data.length>0),I.status===se.Error){b.value={title:i("consumers.errors.general")},(te=(W=(q=I.error)==null?void 0:q.response)==null?void 0:W.data)!=null&&te.message&&(b.value.message=I.error.response.data.message),o("error",I.error);return}b.value=null});const at=t.ref({ctaPath:d.value?void 0:r.config.createRoute,ctaText:void 0,message:`${i("consumers.list.empty_state.description")}${r.config.additionMessageForEmptyState?` ${r.config.additionMessageForEmptyState}`:""}`,title:i("consumers.title")});return t.onBeforeMount(async()=>{await r.canCreate()&&(at.value.title=d.value?i("consumers.list.empty_state.title_for_consumer_group"):i("consumers.list.empty_state.title"),at.value.ctaText=d.value?i("consumers.actions.add_consumer"):i("consumers.actions.create"))}),(I,O)=>{const q=t.resolveComponent("KButton"),W=t.resolveComponent("KBadge"),te=t.resolveComponent("KTruncate"),Se=t.resolveComponent("KDropdownItem"),Mn=t.resolveComponent("KClipboardProvider"),rs=t.resolveComponent("KPrompt");return t.openBlock(),t.createElementBlock("div",Fl,[t.createVNode(t.unref(Qi),{"cache-identifier":e.cacheIdentifier,"disable-pagination":d.value&&!e.config.paginatedEndpoint,"disable-pagination-page-jump":"","disable-sorting":u.value,"empty-state-options":at.value,"enable-entity-actions":"","error-message":b.value,fetcher:t.unref(v),"fetcher-cache-key":c.value,"pagination-type":"offset","preferences-storage-key":p.value,query:w.value,"row-attributes":x,"table-headers":t.unref(m),"use-action-outside":e.useActionOutside,onClearSearchInput:h,"onClick:row":O[3]||(O[3]=D=>A(D)),onEmptyStateCtaClicked:Xl,onSort:g},{"toolbar-filter":t.withCtx(()=>[d.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(bl),{key:0,modelValue:w.value,"onUpdate:modelValue":O[0]||(O[0]=D=>w.value=D),config:$.value},null,8,["modelValue","config"]))]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useActionOutside?"Teleport":"div"),{to:e.useActionOutside?"#kong-ui-app-page-header-action-button":void 0},{default:t.withCtx(()=>[t.createVNode(t.unref(Me),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(q,{appearance:"primary","data-testid":"toolbar-add-consumer",icon:"plus",size:"large",to:e.config.consumerGroupId?void 0:e.config.createRoute,onClick:O[1]||(O[1]=()=>e.config.consumerGroupId?An():void 0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(i)("consumers.actions.add_consumer"):t.unref(i)("consumers.list.toolbar_actions.new_consumer")),1)]),_:1},8,["to"]),[[t.vShow,$n.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),username:t.withCtx(({rowValue:D})=>[t.createElementVNode("b",null,t.toDisplayString(T(D)),1)]),custom_id:t.withCtx(({rowValue:D})=>[t.createTextVNode(t.toDisplayString(T(D)),1)]),tags:t.withCtx(({rowValue:D})=>[D&&D.length>0?(t.openBlock(),t.createBlock(te,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(D,ye=>(t.openBlock(),t.createBlock(W,{key:ye,onClick:O[2]||(O[2]=t.withModifiers(()=>{},["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ye),1)]),_:2},1024))),128))]),_:2},1024)):(t.openBlock(),t.createElementBlock("span",vl,"-"))]),actions:t.withCtx(({row:D})=>[t.createVNode(Mn,null,{default:t.withCtx(({copyToClipboard:ye})=>[t.createVNode(Se,{"data-testid":"action-entity-copy-id",onClick:as=>f(D,ye)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("consumers.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(Mn,null,{default:t.withCtx(({copyToClipboard:ye})=>[t.createVNode(Se,{"data-testid":"action-entity-copy-json",onClick:as=>V(D,ye)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("consumers.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(Me),{"auth-function":()=>e.canRetrieve(D)},{default:t.withCtx(()=>[t.createVNode(Se,{"data-testid":"action-entity-view","has-divider":"",item:S(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Me),{"auth-function":()=>e.canEdit(D)},{default:t.withCtx(()=>[t.createVNode(Se,{"data-testid":"action-entity-edit",item:N(D.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(Me),{"auth-function":()=>e.canDelete(D)},{default:t.withCtx(()=>[t.createVNode(Se,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:()=>e.config.consumerGroupId?ts(D):nt(D)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.config.consumerGroupId?t.unref(i)("consumers.actions.remove"):t.unref(i)("consumers.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-pagination","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","preferences-storage-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(nl),{"action-button-disabled":M.value,"data-testid":"delete-consumer-modal",description:t.unref(i)("consumers.delete.description"),"entity-name":E.value&&(E.value.username||E.value.custom_id||E.value.id),"entity-type":t.unref(lt).Consumer,error:G.value,title:t.unref(i)("consumers.delete.title"),visible:j.value,onCancel:Zl,onProceed:Ql},null,8,["action-button-disabled","description","entity-name","entity-type","error","title","visible"]),e.config.consumerGroupId?(t.openBlock(),t.createBlock(Dl,{key:0,config:e.config,"data-testid":"add-consumer-modal",visible:ot.value,"onAdd:partialSuccess":O[4]||(O[4]=D=>Vn(D,!0)),"onAdd:success":O[5]||(O[5]=D=>Vn(D)),onCancel:_n},null,8,["config","visible"])):t.createCommentVNode("",!0),e.config.consumerGroupId&&oe.value?(t.openBlock(),t.createBlock(rs,{key:1,"action-button-appearance":"danger","data-testid":"remove-consumer-modal",title:t.unref(i)("consumers.consumer_groups.remove.title"),visible:rt.value,onCancel:En,onProceed:os},{default:t.withCtx(()=>[t.createVNode(t.unref(a),{class:"message",keypath:e.config.consumerGroupName?"consumers.consumer_groups.remove.confirmation":"consumers.consumer_groups.remove.confirmationNoCG",tag:"p"},t.createSlots({consumer:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(oe.value.username||oe.value.custom_id||oe.value.id),1)]),_:2},[e.config.consumerGroupName?{name:"consumerGroup",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(e.config.consumerGroupName),1)]),key:"0"}:void 0]),1032,["keypath"]),t.createElementVNode("p",null,t.toDisplayString(t.unref(i)("consumers.consumer_groups.remove.description")),1)]),_:1},8,["title","visible"])):t.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-7bf00df6"]]);let Oe;const Ll=new Uint8Array(16);function Kl(){if(!Oe&&(Oe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oe(Ll)}const P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));function Ul(e,n=0){return P[e[n+0]]+P[e[n+1]]+P[e[n+2]]+P[e[n+3]]+"-"+P[e[n+4]]+P[e[n+5]]+"-"+P[e[n+6]]+P[e[n+7]]+"-"+P[e[n+8]]+P[e[n+9]]+"-"+P[e[n+10]]+P[e[n+11]]+P[e[n+12]]+P[e[n+13]]+P[e[n+14]]+P[e[n+15]]}const Bn={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Rl(e,n,o){if(Bn.randomUUID&&!n&&!e)return Bn.randomUUID();e=e||{};const r=e.random||(e.rng||Kl)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,n){o=o||0;for(let a=0;a<16;++a)n[o+a]=r[a];return n}return Ul(r)}const Pl={class:"kong-ui-entities-consumer-form"},zl=["id"],Gl={class:"fields-group-text"},Jl=["aria-labelledby"],Hl=tt(t.defineComponent({__name:"ConsumerForm",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||(e==null?void 0:e.app)==="konnect"&&!(e!=null&&e.controlPlaneId)||(e==null?void 0:e.app)==="kongManager"&&typeof(e==null?void 0:e.workspace)!="string"||!(e!=null&&e.cancelRoute))},consumerId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:n}){var T;const o=e,r=n,{i18nT:a,i18n:{t:i}}=Ie.useI18n(),l=De.useRouter(),{axiosInstance:s}=et((T=o.config)==null?void 0:T.axiosRequestConfig),{getMessageFromError:c}=Bl(),d=Rl(),p=t.reactive({fields:{username:"",customId:"",tags:""},readonly:!1,errorMessage:""}),u=t.reactive({username:"",customId:"",tags:""}),y=t.computed(()=>{var b,f;return(f=le.form[(b=o.config)==null?void 0:b.app])==null?void 0:f.edit}),m=()=>{var b;l.push(((b=o.config)==null?void 0:b.cancelRoute)||{name:"consumer-list"})},x=b=>{r("loading",b)},C=b=>{r("error",b)},w=b=>{var V,A,S;p.fields.username=((V=b==null?void 0:b.item)==null?void 0:V.username)||(b==null?void 0:b.username)||"",p.fields.customId=((A=b==null?void 0:b.item)==null?void 0:A.custom_id)||(b==null?void 0:b.custom_id)||"";const f=((S=b==null?void 0:b.item)==null?void 0:S.tags)||(b==null?void 0:b.tags)||[];p.fields.tags=(f==null?void 0:f.join(", "))||"",Object.assign(u,p.fields)},$=t.computed(()=>o.consumerId?Fe.Edit:Fe.Create),_=b=>{var V,A,S,N,E,j;let f=`${(V=o.config)==null?void 0:V.apiBaseUrl}${le.form[(A=o.config)==null?void 0:A.app][b]}`;return((S=o.config)==null?void 0:S.app)==="konnect"?f=f.replace(/{controlPlaneId}/gi,((N=o.config)==null?void 0:N.controlPlaneId)||""):((E=o.config)==null?void 0:E.app)==="kongManager"&&(f=f.replace(/\/{workspace}/gi,(j=o.config)!=null&&j.workspace?`/${o.config.workspace}`:"")),f=f.replace(/{id}/gi,o.consumerId),f},v=t.computed(()=>!!p.fields.username||!!p.fields.customId),k=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)),h=t.computed(()=>{var b,f;return{username:p.fields.username||null,custom_id:p.fields.customId||null,tags:(f=(b=p.fields.tags.split(","))==null?void 0:b.map(V=>String(V||"").trim()))==null?void 0:f.filter(V=>V!=="")}}),g=async()=>{var b;try{p.readonly=!0;let f;await s.post(_("validate"),h.value),$.value==="create"?f=await s.post(_("create"),h.value):$.value==="edit"&&(f=((b=o.config)==null?void 0:b.app)==="konnect"?await s.put(_("edit"),h.value):await s.patch(_("edit"),h.value)),w(f==null?void 0:f.data),r("update",f==null?void 0:f.data)}catch(f){p.errorMessage=c(f),r("error",f)}finally{p.readonly=!1}};return(b,f)=>{const V=t.resolveComponent("KInput"),A=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",Pl,[t.createVNode(t.unref(Pi),{"can-submit":v.value&&k.value,config:e.config,"edit-id":e.consumerId,"error-message":p.errorMessage,"fetch-url":y.value,"form-fields":h.value,"is-readonly":p.readonly,onCancel:m,"onFetch:error":f[3]||(f[3]=S=>C(S)),"onFetch:success":w,onLoading:f[4]||(f[4]=S=>x(S)),onSubmit:g},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(Nl),{description:t.unref(i)("consumers.form.info.description"),"has-divider":"",title:t.unref(i)("consumers.form.info.title")},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createElementVNode("h3",{id:`fields-group-title-${t.unref(d)}`,class:"fields-group-title"},t.toDisplayString(t.unref(i)("consumers.form.consumer_identification.title"))+"* ",9,zl),t.createElementVNode("p",Gl,t.toDisplayString(t.unref(i)("consumers.form.consumer_identification.description")),1)]),t.createVNode(A,null,{default:t.withCtx(()=>[t.createElementVNode("fieldset",{"aria-labelledby":`fields-group-title-${t.unref(d)}`},[t.createVNode(V,{modelValue:p.fields.username,"onUpdate:modelValue":f[0]||(f[0]=S=>p.fields.username=S),modelModifiers:{trim:!0},autocomplete:"off",class:"username-field","data-testid":"consumer-form-username",label:t.unref(i)("consumers.fields.username.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(i)("consumers.fields.username.placeholder"),readonly:p.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(i)("consumers.fields.username.custom_id")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"]),t.createVNode(V,{modelValue:p.fields.customId,"onUpdate:modelValue":f[1]||(f[1]=S=>p.fields.customId=S),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-custom-id",label:t.unref(i)("consumers.fields.custom_id.label"),"label-attributes":{tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(i)("consumers.fields.custom_id.placeholder"),readonly:p.readonly,type:"text"},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(i)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["modelValue","label","placeholder","readonly"])],8,Jl)]),_:1}),t.createVNode(V,{modelValue:p.fields.tags,"onUpdate:modelValue":f[2]||(f[2]=S=>p.fields.tags=S),modelModifiers:{trim:!0},autocomplete:"off","data-testid":"consumer-form-tags",help:t.unref(i)("consumers.fields.tags.help"),label:t.unref(i)("consumers.fields.tags.label"),"label-attributes":{info:t.unref(i)("consumers.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250"}},placeholder:t.unref(i)("consumers.fields.tags.placeholder"),readonly:p.readonly,type:"text"},null,8,["modelValue","help","label","label-attributes","placeholder","readonly"])]),_:1},8,["description","title"])])]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])}}}),[["__scopeId","data-v-d3813a74"]]),Yl={class:"kong-ui-consumer-entity-config-card"},Wl=t.defineComponent({__name:"ConsumerConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const n=e,{i18n:{t:o},i18nT:r}=Ie.useI18n(),a=t.computed(()=>le.form[n.config.app].edit),i=t.ref({id:{},username:{section:H.Basic,tooltip:o("consumers.fields.username.tooltip"),order:1},custom_id:{section:H.Basic,tooltip:o("consumers.fields.custom_id.tooltip"),label:o("consumers.fields.custom_id.label"),order:2},updated_at:{},created_at:{},tags:{tooltip:o("consumers.fields.tags.tooltip")},username_lower:{hidden:!0},type:{hidden:!0}});return(l,s)=>(t.openBlock(),t.createElementBlock("div",Yl,[t.createVNode(t.unref(Li),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":i.value,"fetch-url":a.value,"hide-title":e.hideTitle,"onFetch:error":s[0]||(s[0]=c=>l.$emit("fetch:error",c)),"onFetch:success":s[1]||(s[1]=c=>l.$emit("fetch:success",c)),onLoading:s[2]||(s[2]=c=>l.$emit("loading",c))},{"username-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.username.tooltip",scope:"global"},{custom_id:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.username.custom_id")),1)]),_:1})]),"custom_id-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(r),{keypath:"consumers.fields.custom_id.tooltip",scope:"global"},{username:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(o)("consumers.fields.custom_id.username")),1)]),_:1})]),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});Z.ConsumerConfigCard=Wl,Z.ConsumerForm=Hl,Z.ConsumerList=ql,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-consumers",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-consumers.umd.js",
|
|
6
6
|
"module": "./dist/entities-consumers.es.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@kong-ui-public/i18n": "^2.1.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@kong/design-tokens": "1.12.
|
|
31
|
+
"@kong/design-tokens": "1.12.11",
|
|
32
32
|
"@kong/kongponents": "9.0.0-alpha.124",
|
|
33
33
|
"axios": "^1.6.8",
|
|
34
34
|
"vue": "^3.4.21",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"errorLimit": "500KB"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kong-ui-public/entities-shared": "^3.0.
|
|
53
|
+
"@kong-ui-public/entities-shared": "^3.0.3"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "cross-env USE_SANDBOX=true vite",
|