@kong-ui-public/entities-upstreams-targets 2.3.2 → 2.3.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.
|
@@ -502,7 +502,7 @@ const he = {
|
|
|
502
502
|
for (const [a, s] of l)
|
|
503
503
|
t[a] = s;
|
|
504
504
|
return t;
|
|
505
|
-
}, Tr = (e) => (Kl("data-v-
|
|
505
|
+
}, Tr = (e) => (Kl("data-v-92e928de"), e = e(), El(), e), Or = ["aria-hidden"], qr = {
|
|
506
506
|
key: 0,
|
|
507
507
|
"data-testid": "kui-icon-svg-title"
|
|
508
508
|
}, Fr = /* @__PURE__ */ Tr(() => /* @__PURE__ */ A("path", {
|
|
@@ -601,7 +601,7 @@ const he = {
|
|
|
601
601
|
_: 1
|
|
602
602
|
}, 8, ["aria-hidden", "style"]));
|
|
603
603
|
}
|
|
604
|
-
}), $r = /* @__PURE__ */ Hr(Ur, [["__scopeId", "data-v-
|
|
604
|
+
}), $r = /* @__PURE__ */ Hr(Ur, [["__scopeId", "data-v-92e928de"]]), Mr = "16px", jr = { class: "kong-ui-copy-uuid" }, Nr = ["onClick"], gl = 15, Kr = /* @__PURE__ */ ae({
|
|
605
605
|
__name: "CopyUuid",
|
|
606
606
|
props: {
|
|
607
607
|
uuid: {
|
|
@@ -2668,7 +2668,7 @@ const Fo = { class: "yaml-config" }, Ms = /* @__PURE__ */ ae({
|
|
|
2668
2668
|
for (const [a, s] of l)
|
|
2669
2669
|
t[a] = s;
|
|
2670
2670
|
return t;
|
|
2671
|
-
}, Eo = (e) => (Kl("data-v-
|
|
2671
|
+
}, Eo = (e) => (Kl("data-v-c90ebabf"), e = e(), El(), e), Bo = ["aria-hidden"], Po = {
|
|
2672
2672
|
key: 0,
|
|
2673
2673
|
"data-testid": "kui-icon-svg-title"
|
|
2674
2674
|
}, Vo = /* @__PURE__ */ Eo(() => /* @__PURE__ */ A("path", {
|
|
@@ -2767,7 +2767,7 @@ const Fo = { class: "yaml-config" }, Ms = /* @__PURE__ */ ae({
|
|
|
2767
2767
|
_: 1
|
|
2768
2768
|
}, 8, ["aria-hidden", "style"]));
|
|
2769
2769
|
}
|
|
2770
|
-
}), Ro = /* @__PURE__ */ Ko(Lo, [["__scopeId", "data-v-
|
|
2770
|
+
}), Ro = /* @__PURE__ */ Ko(Lo, [["__scopeId", "data-v-c90ebabf"]]), Do = { "data-testid": "config-card-title" }, zo = { class: "config-card-actions" }, Jo = ["href"], Wo = {
|
|
2771
2771
|
key: 2,
|
|
2772
2772
|
class: "config-card-details-section"
|
|
2773
2773
|
}, Qo = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ae,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-entities-upstreams-targets"]={},ae.Vue,ae.axios,ae["kong-ui-public-i18n"],ae.Kongponents,ae.VueRouter))})(this,function(ae,t,fr,Ie,mr,Je){"use strict";var We=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(We||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),W=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(W||{});function Qe(e={}){return{axiosInstance:fr.create({withCredentials:!0,timeout:3e4,...e})}}function gr(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const Ye="khcp-user-table-preferences",yr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function kr(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(Ye));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(Ye,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||yr},deleteAllTablePreferences:()=>{localStorage.removeItem(Ye)}}}const br={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Cr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},wr={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Configuring your API has never been easier. Use YAML for human-friendly simplicity or JSON for machine-readability. Streamline your settings effortlessly.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},_r={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sr={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},xr={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Nr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Vr={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Br={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ir={global:br,deleteModal:Cr,baseForm:wr,baseTable:_r,baseConfigCard:Sr,filter:xr,debouncedFilter:Nr,errors:Vr,toggleModal:Br};function Ze(){const e=Ie.createI18n("en-us",Ir);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function Ct(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function Tr(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:n}=Qe({headers:e.requestHeaders}),{i18n:{t:i}}=Ze(),{debounce:o}=gr(),d=o(async N=>{await H(N)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),S=t.unref(r);let b=`${e.apiBaseUrl}${S}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=Ct(),k=async()=>{try{c.value=!0;const{data:N}=await n.get(`${b}?size=${a}`);N!=null&&N.next||(s.value=l.fetchedItemsKey in N?N[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in N?N[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=t.ref(""),H=async N=>{var A,F,I;if(x.value!==N)if(x.value=N||"",s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let V=b+"";N&&(V+=`/${N}`);const{data:_}=await n.get(`${V}?size=${a}`);l.fetchedItemsKey in _?u.value=_[l.fetchedItemsKey]:_!=null&&_.id?u.value=[_]:u.value=[]}else if(N){const V=[];m(N)&&l.searchKeys.includes("id")?V.push((async()=>{const{data:w}=await n.get(`${b}/${N}`);return[w[l.fetchedItemsKey]??w]})()):V.push(...l.searchKeys.filter(w=>w!=="id").map(async w=>{const{data:E}=await n.get(`${b}?${w}=${N}`);return E[l.fetchedItemsKey]}));const _=await Promise.all(V),T=new Set;u.value=[],(A=_==null?void 0:_.forEach)==null||A.call(_,w=>{var E;(E=w==null?void 0:w.forEach)==null||E.call(w,$=>{T.has($.id)||(T.add($.id),u.value.push($))})})}else u.value=f.value}catch(V){((F=V==null?void 0:V.response)==null?void 0:F.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",N?(u.value=(I=s.value)==null?void 0:I.filter(V=>{var _;let T=!1;for(const w of l.searchKeys){const E=typeof V[w]=="string"?(_=V[w])==null?void 0:_.toLowerCase():V[w];E!=null&&E.includes(N.toLowerCase())&&(T=!0)}return T}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=s.value,c.value=!1};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:k,debouncedQueryChange:d}}function Ar(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Hr(){const{i18n:{t:e}}=Ze();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Er(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function wt(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=o;try{let s=new URL(i.value.href);return n.value&&f?(s.search="",s=a.value.app==="konnect"?new URL(`${s.href}?filter[name][contains]=${f}`):new URL(`${s.href}/${f}/`)):(n.value||new URLSearchParams(f).forEach((S,b)=>{s.searchParams.append(b,S)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function Fr(e,r,a="data"){const l=t.unref(r),{axiosInstance:n}=Qe({headers:e.requestHeaders}),i=wt(e,l),o=t.ref({status:pe.Idle});return{fetcher:async d=>{try{o.value={status:pe.Loading};let c=i(d);c.includes("filter[name]")&&(c=`${c}&page[size]=${d.pageSize}&page[number]=${d.page}`);const{data:h}=await n.get(c),p=a&&a.replace(/[^\w-_]/gi,"");let u;h[p]&&Array.isArray(h[p])?u=h[p]:Array.isArray(h)?u=h:u=Object.keys(h).length?[h]:[];const f={data:u,total:u.length,...h.offset?{pagination:{offset:h.offset}}:null};return o.value={status:pe.Idle,response:f},f}catch(c){const h={data:[],total:0};return d.query&&c.response.status===404?(o.value={status:pe.NoResults,response:h,error:c},h):(o.value={status:pe.Error,response:h,error:c},h)}},fetcherState:o}}function Or(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const _t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,St=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(_t);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},xt=e=>e==="*"||e==="x"||e==="X",Nt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},qr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Ur=(e,r)=>{if(xt(e)||xt(r))return 0;const[a,l]=qr(Nt(e),Nt(r));return a>l?1:a<l?-1:0},Vt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Ur(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},vr=(e,r)=>{const a=St(e),l=St(r),n=a.pop(),i=l.pop(),o=Vt(a,l);return o!==0?o:n&&i?Vt(n.split("."),i.split(".")):n||i?n?-1:1:0},Bt=(e,r,a)=>{$r(a);const l=vr(e,r);return It[a].includes(l)},It={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Tt=Object.keys(It),$r=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Tt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Tt.join("|")}`)},Dr=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_t.test(e);function Mr(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Dr(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&Bt(n,o,"<")||d&&Bt(n,d,">"))}function jr(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}const Z={useAxios:Qe,useDebouncedFilter:Tr,useDeleteUrlBuilder:Ar,useErrors:Hr,useExternalLinkCreator:Er,useFetcher:Fr,useFetchUrlBuilder:wt,useHelpers:Ct,useStringHelpers:Or,useI18n:Ze,useGatewayFeatureSupported:Mr,useTruncationDetector:jr},Kr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Pr="Copy to clipboard",Lr={message:Kr,iconTitle:Pr},Rr="kong-ui-copy-uuid-notify",At="24px",zr=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Jr=e=>(t.pushScopeId("data-v-89becf03"),e=e(),t.popScopeId(),e),Wr=["aria-hidden"],Qr={key:0,"data-testid":"kui-icon-svg-title"},Yr=Jr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Zr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:At,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return At}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Qr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Yr],8,Wr))]),_:1},8,["aria-hidden","style"]))}}),Gr=zr(Zr,[["__scopeId","data-v-89becf03"]]),Xr="16px",en={class:"kong-ui-copy-uuid"},tn=["onClick"],Ht=15,an=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:r}){const{t:a}=Ie.createI18n("en-us",Lr),l=e,n=r,i=l.notify||t.inject(Rr,()=>{}),o=t.computed(()=>l.idTooltip?{label:l.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:l.uuid}),d=t.computed(()=>!!(l.tooltip&&l.successTooltip)),c=t.ref(l.tooltip),h=t.computed(()=>l.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var s;return l.format==="redacted"?"*****":l.format==="deleted"?`*${(s=l.uuid)==null?void 0:s.substring(0,5)}`:l.uuid}),u=s=>{c.value=s,setTimeout(()=>{c.value=l.tooltip},1800)},f=s=>{var S,b;if(!s(l.uuid)){typeof i=="function"&&i({type:"error",message:a("message.fail")}),d.value?u(a("message.fail")):n("error",l.uuid);return}const m=((S=l.uuid)==null?void 0:S.length)>Ht,k=l.format==="hidden"||l.format==="redacted"?a("message.success.prefix"):`"${((b=l.uuid)==null?void 0:b.substring(0,Ht))+(m?"...":"")}"`;typeof i=="function"&&i({type:"success",message:`${k}${a("message.success.content")}`}),d.value?u(l.successTooltip):n("success",l.uuid)};return(s,S)=>{const b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",en,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},o.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(h.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:m})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(k=>f(m),["stop"])},[t.createVNode(t.unref(Gr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(Xr),title:t.unref(a)("iconTitle")},null,8,["color","decorative","size","title"])],8,tn)]),_:1})]),_:1},16))])}}}),ln=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Et=ln(an,[["__scopeId","data-v-0c07874b"]]),rn={key:0,class:"config-card-fieldset-title"},nn=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:l}=Z.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",rn,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(Ge,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ne=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ft=ne(nn,[["__scopeId","data-v-68ca83ec"]]),on=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),sn=ne(on,[["__scopeId","data-v-c96811e5"]]),cn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),dn="#0044f4",hn="#e0e4ea",pn="#3a3f51",un="1px",fn="20px",mn={class:"config-card-details-row"},gn=["data-testid"],yn=["data-testid"],kn=["data-testid"],bn=["data-testid"],Cn={key:1},wn=["data-testid"],_n=["data-testid"],Sn=["data-testid"],xn=["data-testid"],Nn={name:"ConfigCardItem",components:{CopyUuid:Et,JsonCardItem:Ft,StatusBadge:cn,InternalLinkItem:sn}},Vn=t.defineComponent({...Nn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(S=>({"0da74440":p.value?"none":`solid ${t.unref(un)} ${t.unref(hn)}`,"02a039da":h.value&&d.value?"block":"flex","690f3ced":h.value&&d.value?"100%":a.slim?"50%":"25%","691182c8":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:S=>{l("navigation-click",S)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(S,b)=>{const m=t.resolveComponent("KLabel"),k=t.resolveComponent("KBadge"),x=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",mn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$slots,"label",{item:e.item},()=>[t.createVNode(m,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,yn)]),key:"0"}:void 0]),1024)],!0)],8,gn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",Cn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-tag-${N}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${N}`,tooltip:H,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(H),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,wn)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(t.unref(Et),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${N}`,"data-testid":`${e.item.key}-copy-uuid-${N}`,uuid:H}),null,16,["data-testid","uuid"]))),128))],8,_n)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-method-${N}`,appearance:Object.values(t.unref(mr.BadgeMethodAppearances)).includes(H.toLowerCase())?H.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${N}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(H),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Sn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(Ft,{key:`json-array-item-${N}`,index:N,"is-array-item":"",item:H},null,8,["index","item"]))),128))],8,xn)):(t.openBlock(),t.createBlock(x,{key:4,label:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:f,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,bn))],!0)],8,kn)])}}}),Ge=ne(Vn,[["__scopeId","data-v-9c87856b"]]),Bn={class:"json-config"},In={key:0,class:"json-endpoint"},Ot=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"2d178975":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{var o;const d=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Bn,[r.fetcherUrl&&(o=r.config)!=null&&o.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",In,[t.createVNode(d,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function qt(e){return typeof e>"u"||e===null}function Tn(e){return typeof e=="object"&&e!==null}function An(e){return Array.isArray(e)?e:qt(e)?[]:[e]}function Hn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function En(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Fn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var On=qt,qn=Tn,Un=An,vn=En,$n=Fn,Dn=Hn,Y={isNothing:On,isObject:qn,toArray:Un,repeat:vn,isNegativeZero:$n,extend:Dn};function Ut(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
|
|
1
|
+
(function(ae,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("axios"),require("@kong-ui-public/i18n"),require("@kong/kongponents"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","axios","@kong-ui-public/i18n","@kong/kongponents","vue-router"],t):(ae=typeof globalThis<"u"?globalThis:ae||self,t(ae["kong-ui-entities-upstreams-targets"]={},ae.Vue,ae.axios,ae["kong-ui-public-i18n"],ae.Kongponents,ae.VueRouter))})(this,function(ae,t,fr,Ie,mr,Je){"use strict";var We=(e=>(e.GatewayService="service",e.Route="route",e.Consumer="consumer",e.ConsumerGroup="consumer group",e.Plugin="plugin",e.Upstream="upstream",e.Certificate="certificate",e.CACertificate="ca certificate",e.SNI="SNI",e.Key="key",e.KeySet="key set",e.Vault="vault",e.Application="application",e.Developer="developer",e.acls="ACL Credential",e["basic-auth"]="Basic Auth Credential",e["key-auth"]="Key Auth Credential",e["key-auth-enc"]="Key Auth Encrypted Credential",e.oauth2="OAuth 2.0 Credential",e["hmac-auth"]="HMAC Credential",e.jwt="JWT Credential",e.Target="target",e.Policy="policy",e))(We||{}),oe=(e=>(e.Edit="edit",e.Create="create",e))(oe||{}),pe=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(pe||{}),L=(e=>(e.ID="id",e.IdArray="id-array",e.Text="plain-text",e.Date="date",e.Redacted="redacted",e.RedactedArray="redacted-array",e.Json="json",e.JsonArray="json-array",e.BadgeTag="badge-tag",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),W=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(W||{});function Qe(e={}){return{axiosInstance:fr.create({withCredentials:!0,timeout:3e4,...e})}}function gr(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const Ye="khcp-user-table-preferences",yr={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0};function kr(){const e=a=>{if(typeof a=="string")try{return JSON.parse(a)}catch(l){console.error("useTablePreferences(tryParseJson)",l);return}},r=()=>{const a=e(localStorage.getItem(Ye));return!a||!Object.keys(a).length?new Map:new Map(Object.entries(a))};return{setTablePreferences:(a,l)=>{try{const n=r();n.set(a,l),localStorage.setItem(Ye,JSON.stringify(Object.fromEntries(n.entries())))}catch(n){console.error("useTablePreferences(setTablePreferences)",n)}},getTablePreferences:a=>{const l=r();return(l==null?void 0:l.get(a))||void 0||yr},deleteAllTablePreferences:()=>{localStorage.removeItem(Ye)}}}const br={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},Cr={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},wr={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Configuring your API has never been easier. Use YAML for human-friendly simplicity or JSON for machine-readability. Streamline your settings effortlessly.",yaml:"YAML",json:"JSON"},errors:{edit:"The entity could not be edited at this time."}},_r={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},Sr={title:"Configuration",actions:{copy:"Copy JSON"},sections:{advanced:"Advanced",plugin:"Plugin Specific Configuration"},commonFields:{id_label:"ID",name_label:"Name",enabled_label:"Enabled",enabled_tooltip:"Enabled is FTW",updated_at_label:"Last Updated",created_at_label:"Created",tags_label:"Tags",link:"Link"},statusBadge:{enabledLabel:"Enabled",disabledLabel:"Disabled"},copy:{tooltip:"Copy {label}",success:"Copied!"},errors:{load:"The entity configuration data could not be loaded at this time.",copy:"Failed to copy to clipboard"},general:{entryTitle:"Entry {index}",structuredFormat:"Structured"}},xr={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Nr={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Vr={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Br={enable:{title:"Enable {entityType}",message:"Are you sure you want to enable the {entityType} {entityName}?",confirmText:"Yes, enable"},disable:{title:"Disable {entityType}",message:"Are you sure you want to disable the {entityType} {entityName}?",confirmText:"Yes, disable"}},Ir={global:br,deleteModal:Cr,baseForm:wr,baseTable:_r,baseConfigCard:Sr,filter:xr,debouncedFilter:Nr,errors:Vr,toggleModal:Br};function Ze(){const e=Ie.createI18n("en-us",Ir);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function Ct(){const e=(a,l)=>(l==null?void 0:l[a])??void 0,r=(a,l)=>{if(a.length!==l.length)return!1;const n=new Set([...a,...l]);for(const i of n){const o=a.filter(c=>c===i).length,d=l.filter(c=>c===i).length;if(o!==d)return!1}return!0};return{getPropValue:e,objectsAreEqual:(a,l,n)=>{if(n){if(Object.keys(a).length===Object.keys(l).length)for(const i in a)if(Array.isArray(a[i])&&Array.isArray(l[i])){if(r(a[i],l[i]))continue;return!1}else{if(a[i]===l[i])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let i=l[a]===void 0||l[a]===null?"":l[a],o=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(i=l[a][0]),Array.isArray(n[a])&&(o=n[a][0]),i.localeCompare(o)},isValidUuid:a=>a?/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(a):!1}}function Tr(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="100");const{axiosInstance:n}=Qe({headers:e.requestHeaders}),{i18n:{t:i}}=Ze(),{debounce:o}=gr(),d=o(async N=>{await H(N)},200),c=t.ref(!1),h=t.ref(""),p=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),S=t.unref(r);let b=`${e.apiBaseUrl}${S}`;e.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""));const{isValidUuid:m}=Ct(),k=async()=>{try{c.value=!0;const{data:N}=await n.get(`${b}?size=${a}`);N!=null&&N.next||(s.value=l.fetchedItemsKey in N?N[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in N?N[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],h.value=i("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=t.ref(""),H=async N=>{var A,F,I;if(x.value!==N)if(x.value=N||"",s.value===void 0)try{if(c.value=!0,h.value="",p.value="",e.app==="konnect"){let V=b+"";N&&(V+=`/${N}`);const{data:_}=await n.get(`${V}?size=${a}`);l.fetchedItemsKey in _?u.value=_[l.fetchedItemsKey]:_!=null&&_.id?u.value=[_]:u.value=[]}else if(N){const V=[];m(N)&&l.searchKeys.includes("id")?V.push((async()=>{const{data:w}=await n.get(`${b}/${N}`);return[w[l.fetchedItemsKey]??w]})()):V.push(...l.searchKeys.filter(w=>w!=="id").map(async w=>{const{data:E}=await n.get(`${b}?${w}=${N}`);return E[l.fetchedItemsKey]}));const _=await Promise.all(V),T=new Set;u.value=[],(A=_==null?void 0:_.forEach)==null||A.call(_,w=>{var E;(E=w==null?void 0:w.forEach)==null||E.call(w,$=>{T.has($.id)||(T.add($.id),u.value.push($))})})}else u.value=f.value}catch(V){((F=V==null?void 0:V.response)==null?void 0:F.status)===404?p.value=i("debouncedFilter.errors.invalid"):(u.value=[],h.value=i("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,p.value="",N?(u.value=(I=s.value)==null?void 0:I.filter(V=>{var _;let T=!1;for(const w of l.searchKeys){const E=typeof V[w]=="string"?(_=V[w])==null?void 0:_.toLowerCase():V[w];E!=null&&E.includes(N.toLowerCase())&&(T=!0)}return T}),(!u.value||!u.value.length)&&(p.value=i("debouncedFilter.errors.invalid"))):u.value=s.value,c.value=!1};return{loading:c,error:h,validationError:p,results:u,allRecords:s,loadItems:k,debouncedQueryChange:d}}function Ar(e,r){const a=t.unref(r),l=t.computed(()=>e.apiBaseUrl.startsWith("/")?new URL(`${window.location.origin}${a}`):new URL(a));return l.value.search="",n=>`${l.value.href}/${n}`}function Hr(){const{i18n:{t:e}}=Ze();return{getMessageFromError:r=>{var a,l,n,i;if(!r)return e("errors.unexpected");if(((a=r==null?void 0:r.response)==null?void 0:a.status)===401)return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."),"";if((l=r==null?void 0:r.response)!=null&&l.data){if(r.response.data.detail)return r.response.data.detail;if((n=r.response.data.details)!=null&&n.length)return r.response.data.details.map(o=>{let d=e("errors.unexpected");return o.messages&&typeof o.messages=="object"&&o.messages.length&&(d=o.messages.join(", ")),o.field?`${o.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:o}=r.response.data;return Array.isArray(o)?(i=o[0])!=null&&i.constraints?Object.values(o[0].constraints)[0]:o[0]:o}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(o=>`${o} ${r.response.data[o]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Er(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,i=e.some(o=>o.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!i&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function wt(e,r){const a=t.ref(t.unref(e)),l=t.ref(t.unref(r)),n=t.computed(()=>!!(a.value.app==="konnect"||a.value.isExactMatch)),i=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return o=>{const{page:d,pageSize:c,offset:h,sortColumnKey:p,sortColumnOrder:u,query:f}=o;try{let s=new URL(i.value.href);return n.value&&f?(s.search="",s=a.value.app==="konnect"?new URL(`${s.href}?filter[name][contains]=${f}`):new URL(`${s.href}/${f}/`)):(n.value||new URLSearchParams(f).forEach((S,b)=>{s.searchParams.append(b,S)}),p&&s.searchParams.append("sort_by",p),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),h&&d!==1&&s.searchParams.append("offset",String(h)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function Fr(e,r,a="data"){const l=t.unref(r),{axiosInstance:n}=Qe({headers:e.requestHeaders}),i=wt(e,l),o=t.ref({status:pe.Idle});return{fetcher:async d=>{try{o.value={status:pe.Loading};let c=i(d);c.includes("filter[name]")&&(c=`${c}&page[size]=${d.pageSize}&page[number]=${d.page}`);const{data:h}=await n.get(c),p=a&&a.replace(/[^\w-_]/gi,"");let u;h[p]&&Array.isArray(h[p])?u=h[p]:Array.isArray(h)?u=h:u=Object.keys(h).length?[h]:[];const f={data:u,total:u.length,...h.offset?{pagination:{offset:h.offset}}:null};return o.value={status:pe.Idle,response:f},f}catch(c){const h={data:[],total:0};return d.query&&c.response.status===404?(o.value={status:pe.NoResults,response:h,error:c},h):(o.value={status:pe.Error,response:h,error:c},h)}},fetcherState:o}}function Or(){const e=(a,l="_")=>a?a.split(l).map(n=>n.toLowerCase()==="id"?n.toUpperCase():n.charAt(0).toUpperCase()+n.substring(1)).join(" "):"",r=/(?:^|[\s-:'"])\w/g;return{capitalize:a=>a?a.replace(r,l=>l.toUpperCase()):"",convertKeyToTitle:e}}const _t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,St=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(_t);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},xt=e=>e==="*"||e==="x"||e==="X",Nt=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},qr=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Ur=(e,r)=>{if(xt(e)||xt(r))return 0;const[a,l]=qr(Nt(e),Nt(r));return a>l?1:a<l?-1:0},Vt=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Ur(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},vr=(e,r)=>{const a=St(e),l=St(r),n=a.pop(),i=l.pop(),o=Vt(a,l);return o!==0?o:n&&i?Vt(n.split("."),i.split(".")):n||i?n?-1:1:0},Bt=(e,r,a)=>{$r(a);const l=vr(e,r);return It[a].includes(l)},It={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Tt=Object.keys(It),$r=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Tt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Tt.join("|")}`)},Dr=e=>typeof e=="string"&&/^[v\d]/.test(e)&&_t.test(e);function Mr(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Dr(n))return console.error("Invalid version"),!1;const i=a[l];if(!i)return!1;const[o,d]=i;return!(o&&Bt(n,o,"<")||d&&Bt(n,d,">"))}function jr(e){const r=t.ref(0),a=t.ref(0),l=t.ref(!1);return t.watch(e,n=>{n&&!l.value&&(r.value=n.offsetWidth,a.value=n.scrollWidth,l.value=!0)}),{isTruncated:t.computed(()=>r.value<a.value)}}const Z={useAxios:Qe,useDebouncedFilter:Tr,useDeleteUrlBuilder:Ar,useErrors:Hr,useExternalLinkCreator:Er,useFetcher:Fr,useFetchUrlBuilder:wt,useHelpers:Ct,useStringHelpers:Or,useI18n:Ze,useGatewayFeatureSupported:Mr,useTruncationDetector:jr},Kr={fail:"Failed to copy id to clipboard",success:{prefix:"Successfully",content:" copied to clipboard"}},Pr="Copy to clipboard",Lr={message:Kr,iconTitle:Pr},Rr="kong-ui-copy-uuid-notify",At="24px",zr=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Jr=e=>(t.pushScopeId("data-v-92e928de"),e=e(),t.popScopeId(),e),Wr=["aria-hidden"],Qr={key:0,"data-testid":"kui-icon-svg-title"},Yr=Jr(()=>t.createElementVNode("path",{d:"M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",fill:"currentColor"},null,-1)),Zr=t.defineComponent({__name:"CopyIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:At,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return At}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,i)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon copy-icon","data-testid":"kui-icon-wrapper-copy-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-copy-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Qr,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Yr],8,Wr))]),_:1},8,["aria-hidden","style"]))}}),Gr=zr(Zr,[["__scopeId","data-v-92e928de"]]),Xr="16px",en={class:"kong-ui-copy-uuid"},tn=["onClick"],Ht=15,an=t.defineComponent({__name:"CopyUuid",props:{uuid:{type:String,required:!0},idTooltip:{type:String,default:""},truncated:{type:Boolean,default:!0},useMono:{type:Boolean,default:!0},notify:{type:Function,default:void 0},iconColor:{type:String,default:"rgba(0, 0, 0, 0.45)"},tooltip:{type:String,default:""},successTooltip:{type:String,default:""},format:{type:String,required:!1,default:"uuid",validator:e=>["uuid","hidden","redacted","deleted"].includes(e)}},emits:["success","error"],setup(e,{emit:r}){const{t:a}=Ie.createI18n("en-us",Lr),l=e,n=r,i=l.notify||t.inject(Rr,()=>{}),o=t.computed(()=>l.idTooltip?{label:l.idTooltip,positionFixed:!0,placement:"bottomStart"}:{title:l.uuid}),d=t.computed(()=>!!(l.tooltip&&l.successTooltip)),c=t.ref(l.tooltip),h=t.computed(()=>l.tooltip?{label:c.value,positionFixed:!0,maxWidth:"500px",placement:"bottomStart"}:{}),p=t.computed(()=>{var s;return l.format==="redacted"?"*****":l.format==="deleted"?`*${(s=l.uuid)==null?void 0:s.substring(0,5)}`:l.uuid}),u=s=>{c.value=s,setTimeout(()=>{c.value=l.tooltip},1800)},f=s=>{var S,b;if(!s(l.uuid)){typeof i=="function"&&i({type:"error",message:a("message.fail")}),d.value?u(a("message.fail")):n("error",l.uuid);return}const m=((S=l.uuid)==null?void 0:S.length)>Ht,k=l.format==="hidden"||l.format==="redacted"?a("message.success.prefix"):`"${((b=l.uuid)==null?void 0:b.substring(0,Ht))+(m?"...":"")}"`;typeof i=="function"&&i({type:"success",message:`${k}${a("message.success.content")}`}),d.value?u(l.successTooltip):n("success",l.uuid)};return(s,S)=>{const b=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",en,[e.format!=="hidden"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.idTooltip?"KTooltip":"div"),t.mergeProps({key:0},o.value,{"data-testid":"copy-id"}),{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["uuid-container",e.truncated?"truncated-uuid":null,e.useMono?"mono":null])},t.toDisplayString(p.value),3)]),_:1},16)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tooltip?"KTooltip":"div"),t.mergeProps(h.value,{class:"uuid-icon-wrapper"}),{default:t.withCtx(()=>[t.createVNode(b,null,{default:t.withCtx(({copyToClipboard:m})=>[t.createElementVNode("span",{"data-testid":"copy-to-clipboard",role:"button",tabindex:"0",onClick:t.withModifiers(k=>f(m),["stop"])},[t.createVNode(t.unref(Gr),{class:"uuid-icon",color:e.iconColor,decorative:!!e.tooltip,size:t.unref(Xr),title:t.unref(a)("iconTitle")},null,8,["color","decorative","size","title"])],8,tn)]),_:1})]),_:1},16))])}}}),ln=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Et=ln(an,[["__scopeId","data-v-0c07874b"]]),rn={key:0,class:"config-card-fieldset-title"},nn=t.defineComponent({__name:"JsonCardItem",props:{item:{type:Object,required:!0},index:{type:Number,default:-1},isArrayItem:{type:Boolean,default:!1}},setup(e){const r=e,{i18n:{t:a}}=Z.useI18n(),{convertKeyToTitle:l}=Z.useStringHelpers(),n=t.computed(()=>r.item.key??"json-array-item"),i=t.computed(()=>r.item.value??r.item),o=t.computed(()=>{const c=JSON.parse(JSON.stringify(i.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=i.value)!=null&&c.name?l(i.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,h)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isArrayItem?"fieldset":"div"),{class:t.normalizeClass(e.isArrayItem?"config-card-fieldset":"config-card-json-item")},{default:t.withCtx(()=>[e.isArrayItem?(t.openBlock(),t.createElementBlock("legend",rn,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(o.value),(p,u)=>(t.openBlock(),t.createBlock(Ge,{key:`${n.value}-property-${u}`,item:{key:p,label:t.unref(l)(p),value:o.value[p]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ne=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Ft=ne(nn,[["__scopeId","data-v-68ca83ec"]]),on=t.defineComponent({__name:"InternalLinkItem",props:{item:{type:Object,required:!0}},emits:["navigation-click"],setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(n,{appearance:"tertiary",class:"navigation-button",onClick:l[0]||(l[0]=i=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),sn=ne(on,[["__scopeId","data-v-c96811e5"]]),cn=t.defineComponent({__name:"StatusBadge",props:{status:{type:Boolean,default:!1}},setup(e){const{i18n:{t:r}}=Z.useI18n();return(a,l)=>{const n=t.resolveComponent("KBadge");return t.openBlock(),t.createBlock(n,{appearance:e.status?"success":"neutral"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.status?t.unref(r)("baseConfigCard.statusBadge.enabledLabel"):t.unref(r)("baseConfigCard.statusBadge.disabledLabel")),1)]),_:1},8,["appearance"])}}}),dn="#0044f4",hn="#e0e4ea",pn="#3a3f51",un="1px",fn="20px",mn={class:"config-card-details-row"},gn=["data-testid"],yn=["data-testid"],kn=["data-testid"],bn=["data-testid"],Cn={key:1},wn=["data-testid"],_n=["data-testid"],Sn=["data-testid"],xn=["data-testid"],Nn={name:"ConfigCardItem",components:{CopyUuid:Et,JsonCardItem:Ft,StatusBadge:cn,InternalLinkItem:sn}},Vn=t.defineComponent({...Nn,props:{item:{type:Object,required:!0},slim:{type:Boolean,required:!1,default:!1},truncated:{type:Boolean,required:!1,default:!1}},emits:["navigation-click"],setup(e,{emit:r}){t.useCssVars(S=>({"0da74440":p.value?"none":`solid ${t.unref(un)} ${t.unref(hn)}`,"02a039da":h.value&&d.value?"block":"flex","690f3ced":h.value&&d.value?"100%":a.slim?"50%":"25%","691182c8":h.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:i,formatUnixTimeStamp:o}}=Z.useI18n(),d=t.computed(()=>a.item.value!==void 0&&a.item.value!==null&&a.item.value!==""),c=t.computed(()=>!!(a.item.tooltip||n["label-tooltip"])),h=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),p=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.IdArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{"success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Redacted:return{tag:"CopyUuid",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,uuid:a.item.value,notify:()=>{}}};case L.RedactedArray:return{tag:"div",additionalComponent:"CopyUuid",childAttrs:{format:"redacted","success-tooltip":i("baseConfigCard.copy.success"),tooltip:i("baseConfigCard.copy.tooltip",{label:a.item.label}),truncated:!1,notify:()=>{}}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:o(a.item.value)};case L.BadgeStatus:return{tag:"StatusBadge",attrs:{"data-testid":`${a.item.key}-badge-status`,status:a.item.value}};case L.BadgeTag:return{tag:"div",additionalComponent:"KBadge"};case L.BadgeMethod:return{tag:"div",additionalComponent:"KMethodBadge"};case L.LinkInternal:return{tag:"InternalLinkItem",attrs:{"data-testid":`${a.item.key}-internal-link`,item:a.item,onNavigationClick:S=>{l("navigation-click",S)}}};case L.LinkExternal:return{tag:"KExternalLink",attrs:{"data-testid":`${a.item.key}-external-link`,href:a.item.value},text:a.item.value};case L.Json:return{tag:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-content`,item:a.item}};case L.JsonArray:return{tag:"div",additionalComponent:"JsonCardItem",attrs:{"data-testid":`${a.item.key}-json-array-content`,item:a.item}};default:return{tag:"div",attrs:{"data-testid":`${a.item.key}-plain-text`},text:a.item.value}}}),f=t.ref(),{isTruncated:s}=Z.useTruncationDetector(f);return(S,b)=>{const m=t.resolveComponent("KLabel"),k=t.resolveComponent("KBadge"),x=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",mn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(S.$slots,"label",{item:e.item},()=>[t.createVNode(m,{"tooltip-attributes":{maxWidth:"500px"}},t.createSlots({default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.label)+" ",1)]),_:2},[c.value?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{"data-testid":`${e.item.key}-label-tooltip`},[t.renderSlot(S.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,yn)]),key:"0"}:void 0]),1024)],!0)],8,gn),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(S.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",Cn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.value.tag),t.normalizeProps(t.guardReactiveProps(u.value.attrs)),{default:t.withCtx(()=>[u.value.additionalComponent==="KBadge"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-badge-tags`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-tag-${N}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${N}`,tooltip:H,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(H),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,wn)):t.createCommentVNode("",!0),u.value.additionalComponent==="CopyUuid"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"copy-uuid-array","data-testid":`${e.item.key}-copy-uuid-array`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(t.unref(Et),t.mergeProps(u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${N}`,"data-testid":`${e.item.key}-copy-uuid-${N}`,uuid:H}),null,16,["data-testid","uuid"]))),128))],8,_n)):u.value.additionalComponent==="KMethodBadge"?(t.openBlock(),t.createElementBlock("div",{key:2,class:"method-badge-array","data-testid":`${e.item.key}-badge-methods`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(k,{key:`${e.item.key}-badge-method-${N}`,appearance:Object.values(t.unref(mr.BadgeMethodAppearances)).includes(H.toLowerCase())?H.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${N}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(H),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Sn)):t.createCommentVNode("",!0),u.value.additionalComponent==="JsonCardItem"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-testid":`${a.item.key}-json-array-content`},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.value,(H,N)=>(t.openBlock(),t.createBlock(Ft,{key:`json-array-item-${N}`,index:N,"is-array-item":"",item:H},null,8,["index","item"]))),128))],8,xn)):(t.openBlock(),t.createBlock(x,{key:4,label:t.unref(s)?e.item.value:""},{default:t.withCtx(()=>[t.createElementVNode("span",{ref_key:"textContent",ref:f,class:t.normalizeClass(["attrs-data-text",{truncated:e.truncated}])},t.toDisplayString(u.value.text),3)]),_:1},8,["label"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,bn))],!0)],8,kn)])}}}),Ge=ne(Vn,[["__scopeId","data-v-9c87856b"]]),Bn={class:"json-config"},In={key:0,class:"json-endpoint"},Ot=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},jsonRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"2d178975":`${l.value}ch`}));const r=e,a=t.computed(()=>r.jsonRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const i=(n=r.fetcherUrl)==null?void 0:n.split("/");return i.length<2?0:41+(r.requestMethod==="post"?i[i.length-1]:i[i.length-2]).length});return(n,i)=>{var o;const d=t.resolveComponent("KBadge"),c=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Bn,[r.fetcherUrl&&(o=r.config)!=null&&o.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",In,[t.createVNode(d,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(c,{id:"json-endpoint-codeblock",code:r.fetcherUrl,"is-single-line":"",language:"json",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.jsonRecord?(t.openBlock(),t.createBlock(c,{key:1,id:"json-codeblock",class:t.normalizeClass({"json-content":r.fetcherUrl}),code:JSON.stringify(a.value,null,2),language:"json",theme:"dark"},null,8,["class","code"])):t.createCommentVNode("",!0)])}}});/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function qt(e){return typeof e>"u"||e===null}function Tn(e){return typeof e=="object"&&e!==null}function An(e){return Array.isArray(e)?e:qt(e)?[]:[e]}function Hn(e,r){var a,l,n,i;if(r)for(i=Object.keys(r),a=0,l=i.length;a<l;a+=1)n=i[a],e[n]=r[n];return e}function En(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function Fn(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var On=qt,qn=Tn,Un=An,vn=En,$n=Fn,Dn=Hn,Y={isNothing:On,isObject:qn,toArray:Un,repeat:vn,isNegativeZero:$n,extend:Dn};function Ut(e,r){var a="",l=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(a+='in "'+e.mark.name+'" '),a+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!r&&e.mark.snippet&&(a+=`
|
|
2
2
|
|
|
3
3
|
`+e.mark.snippet),l+" "+a):l}function Te(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Ut(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Te.prototype=Object.create(Error.prototype),Te.prototype.constructor=Te,Te.prototype.toString=function(e){return this.name+": "+Ut(this,e)};var le=Te;function Xe(e,r,a,l,n){var i="",o="",d=Math.floor(n/2)-1;return l-r>d&&(i=" ... ",r=l-d+i.length),a-l>d&&(o=" ...",a=l+d-o.length),{str:i+e.slice(r,a).replace(/\t/g,"→")+o,pos:l-r+i.length}}function et(e,r){return Y.repeat(" ",r-e.length)+e}function Mn(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var a=/\r?\n|\r|\0/g,l=[0],n=[],i,o=-1;i=a.exec(e.buffer);)n.push(i.index),l.push(i.index+i[0].length),e.position<=i.index&&o<0&&(o=l.length-2);o<0&&(o=l.length-1);var d="",c,h,p=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+p+3);for(c=1;c<=r.linesBefore&&!(o-c<0);c++)h=Xe(e.buffer,l[o-c],n[o-c],e.position-(l[o]-l[o-c]),u),d=Y.repeat(" ",r.indent)+et((e.line-c+1).toString(),p)+" | "+h.str+`
|
|
4
4
|
`+d;for(h=Xe(e.buffer,l[o],n[o],e.position,u),d+=Y.repeat(" ",r.indent)+et((e.line+1).toString(),p)+" | "+h.str+`
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
`+e.slice(n,i),n=i+1),o=d;return c+=`
|
|
30
30
|
`,e.length-n>r&&o>n?c+=e.slice(n,o)+`
|
|
31
31
|
`+e.slice(o+1):c+=e.slice(n),c.slice(1)}function Bi(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=Fe(e,n),l=ee[a],!l&&Ee(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||ki(a);return r}function Ii(e,r,a){var l="",n=e.tag,i,o,d;for(i=0,o=a.length;i<o;i+=1)d=a[i],e.replacer&&(d=e.replacer.call(a,String(i),d)),(se(e,r,d,!1,!1)||typeof d>"u"&&se(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function qa(e,r,a,l){var n="",i=e.tag,o,d,c;for(o=0,d=a.length;o<d;o+=1)c=a[o],e.replacer&&(c=e.replacer.call(a,String(o),c)),(se(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&se(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=ct(e,r)),e.dump&&Ae===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=i,e.dump=n||"[]"}function Ti(e,r,a){var l="",n=e.tag,i=Object.keys(a),o,d,c,h,p;for(o=0,d=i.length;o<d;o+=1)p="",l!==""&&(p+=", "),e.condenseFlow&&(p+='"'),c=i[o],h=a[c],e.replacer&&(h=e.replacer.call(a,c,h)),se(e,r,c,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),se(e,r,h,!1,!1)&&(p+=e.dump,l+=p));e.tag=n,e.dump="{"+l+"}"}function Ai(e,r,a,l){var n="",i=e.tag,o=Object.keys(a),d,c,h,p,u,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new le("sortKeys must be a boolean or a function");for(d=0,c=o.length;d<c;d+=1)f="",(!l||n!=="")&&(f+=ct(e,r)),h=o[d],p=a[h],e.replacer&&(p=e.replacer.call(a,h,p)),se(e,r+1,h,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Ae===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=ct(e,r)),se(e,r+1,p,!0,u)&&(e.dump&&Ae===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=i,e.dump=n||"{}"}function Ua(e,r,a){var l,n,i,o,d,c;for(n=a?e.explicitTypes:e.implicitTypes,i=0,o=n.length;i<o;i+=1)if(d=n[i],(d.instanceOf||d.predicate)&&(!d.instanceOf||typeof r=="object"&&r instanceof d.instanceOf)&&(!d.predicate||d.predicate(r))){if(a?d.multi&&d.representName?e.tag=d.representName(r):e.tag=d.tag:e.tag="?",d.represent){if(c=e.styleMap[d.tag]||d.defaultStyle,ka.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(ba.call(d.represent,c))l=d.represent[c](r,c);else throw new le("!<"+d.tag+'> tag resolver accepts not "'+c+'" style');e.dump=l}return!0}return!1}function se(e,r,a,l,n,i,o){e.tag=null,e.dump=a,Ua(e,a,!1)||Ua(e,a,!0);var d=ka.call(e.dump),c=l,h;l&&(l=e.flowLevel<0||e.flowLevel>r);var p=d==="[object Object]"||d==="[object Array]",u,f;if(p&&(u=e.duplicates.indexOf(a),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&r>0)&&(n=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(Ai(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Ti(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!o&&r>0?qa(e,r-1,e.dump,n):qa(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Ii(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&Ni(e,e.dump,r,i,c);else{if(d==="[object Undefined]"||e.skipInvalid)return!1;throw new le("unacceptable kind of an object to dump "+d)}e.tag!==null&&e.tag!=="?"&&(h=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",e.dump=h+" "+e.dump)}return!0}function Hi(e,r){var a=[],l=[],n,i;for(ht(e,a,l),n=0,i=l.length;n<i;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(i)}function ht(e,r,a){var l,n,i;if(e!==null&&typeof e=="object")if(n=r.indexOf(e),n!==-1)a.indexOf(n)===-1&&a.push(n);else if(r.push(e),Array.isArray(e))for(n=0,i=e.length;n<i;n+=1)ht(e[n],r,a);else for(l=Object.keys(e),n=0,i=l.length;n<i;n+=1)ht(e[l[n]],r,a)}function Ei(e,r){r=r||{};var a=new Ci(r);a.noRefs||Hi(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),se(a,0,l,!0,!0)?a.dump+`
|
|
32
|
-
`:""}var Fi=Ei,Oi={dump:Fi};function pt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var qi=G,Ui=$t,vi=Kt,$i=Jt,Di=Wt,Mi=lt,ji=ya.load,Ki=ya.loadAll,Pi=Oi.dump,Li=le,Ri={binary:Xt,float:zt,map:jt,null:Pt,pairs:ta,set:aa,timestamp:Zt,bool:Lt,int:Rt,merge:Gt,omap:ea,seq:Mt,str:Dt},zi=pt("safeLoad","load"),Ji=pt("safeLoadAll","loadAll"),Wi=pt("safeDump","dump"),Qi={Type:qi,Schema:Ui,FAILSAFE_SCHEMA:vi,JSON_SCHEMA:$i,CORE_SCHEMA:Di,DEFAULT_SCHEMA:Mi,load:ji,loadAll:Ki,dump:Pi,YAMLException:Li,types:Ri,safeLoad:zi,safeLoadAll:Ji,safeDump:Wi};const Yi={class:"yaml-config"},va=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>r.yamlRecord);return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Yi,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:t.unref(Qi).dump(a.value),language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Zi={key:0,class:"config-card-display-form"},Gi=["data-testid"],Xi={key:0,class:"config-card-prop-section-title"},es=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 r=e,a=t.useSlots(),{i18n:{t:l}}=Z.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Zi,[(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",Xi,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(Ge,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Gi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Ot,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(va,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),ts=ne(es,[["__scopeId","data-v-2b74ac63"]]),$a="24px",as=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},ls=e=>(t.pushScopeId("data-v-0cc5a4d3"),e=e(),t.popScopeId(),e),rs=["aria-hidden"],ns={key:0,"data-testid":"kui-icon-svg-title"},os=ls(()=>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)),is=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:$a,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $a}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,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(l.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",ns,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),os],8,rs))]),_:1},8,["aria-hidden","style"]))}}),ss=as(is,[["__scopeId","data-v-0cc5a4d3"]]),cs={"data-testid":"config-card-title"},ds={class:"config-card-actions"},hs=["href"],ps={key:2,class:"config-card-details-section"},us={key:3,class:"config-card-details-section"},fs=["data-testid"],ms={key:0,class:"config-card-prop-section-title"},gs=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}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:r}){var a;const l=r,n=e,i=t.useSlots(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{convertKeyToTitle:c}=Z.useStringHelpers(),{axiosInstance:h}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),p=[{label:o("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),f=_=>{u.value=_==null?void 0:_.value},s={id:{type:L.ID,label:o("baseConfigCard.commonFields.id_label"),order:0,section:W.Basic},name:{order:1,section:W.Basic},enabled:{type:L.BadgeStatus,order:2,section:W.Basic},updated_at:{type:L.Date,label:o("baseConfigCard.commonFields.updated_at_label"),order:3,section:W.Basic},created_at:{type:L.Date,label:o("baseConfigCard.commonFields.created_at_label"),order:4,section:W.Basic},tags:{type:L.BadgeTag,order:-1,section:W.Basic}},S=t.ref(!1),b=t.ref(!1),m=t.ref(""),k=t.ref({}),x=t.computed(()=>{var _,T,w;if(!k.value)return[];const E=[],$=Object.keys(k.value).length;for(const D in k.value){const U=(T=(_=n.configSchema)==null?void 0:_[D])==null?void 0:T.order,q=(w=s[D])==null?void 0:w.order;let M=$;(q||q===0)&&(M=q===-1?$+1:q),U&&(M=U===-1?$+1:U),E.push([D,M])}return E.sort(function(D,U){return D[1]-U[1]}),E.map(D=>{var U,q;const M=D[0],j=(U=k.value)==null?void 0:U[M],B=((q=n.configSchema)==null?void 0:q[M])||{},v=s[M];return{key:M,value:j,hidden:B.hidden||!1,type:B.type??((v==null?void 0:v.type)||L.Text),label:B.label??((v==null?void 0:v.label)||c(M)),tooltip:B.tooltip??((v==null?void 0:v.tooltip)||void 0),section:B.section??((v==null?void 0:v.section)||W.Advanced)}}).filter(D=>!D.hidden&&D.key!==n.pluginConfigKey)}),H=t.computed(()=>{var _,T;if(!k.value||!n.pluginConfigKey)return[];const w=k.value[n.pluginConfigKey]||{},E=Object.keys(w).length,$=[];for(const D in w){const U=(T=(_=n.pluginConfigSchema)==null?void 0:_[D])==null?void 0:T.order,q=w[D];let M=q!=null&&q!==""?E-1:E;U&&(M=U===-1?E+1:U),$.push([D,M])}return $.sort(function(D,U){return D[1]-U[1]}),$.map(D=>{var U;const q=D[0],M=w[q],j=((U=n.pluginConfigSchema)==null?void 0:U[q])||{};return{key:q,value:M,hidden:j.hidden||!1,type:j.type??L.Text,label:j.label??c(q),tooltip:j.tooltip??void 0,section:W.Plugin}}).filter(D=>!D.hidden)}),N=t.computed(()=>{var _,T,w,E;return{basic:(_=x.value)==null?void 0:_.filter($=>$.section===W.Basic),advanced:(T=x.value)==null?void 0:T.filter($=>$.section===W.Advanced),plugin:(E=H.value)==null?void 0:E.concat((w=x.value)==null?void 0:w.filter($=>$.section===W.Plugin))}}),A=t.computed(()=>{const _=[];return N.value.basic.length&&_.push("basic"),N.value.advanced.length&&_.push("advanced"),N.value.plugin.length&&_.push("plugin"),_}),F=_=>!!(_.tooltip||i[`${_.key}-label-tooltip`]),I=t.computed(()=>{var _,T;let w=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((_=n.config)==null?void 0:_.controlPlaneId)||""):n.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(T=n.config)!=null&&T.workspace?`/${n.config.workspace}`:"")),w=w.replace(/{id}/gi,n.config.entityId),w}),V=_=>{k.value&&_(JSON.stringify(k.value))?l("copy:success",k.value):l("copy:error")};return t.watch(S,_=>{l("loading",_)},{immediate:!0}),t.onBeforeMount(async()=>{b.value=!1,S.value=!0;try{const{data:_}=await h.get(I.value);if(n.dataKey)if(typeof _[n.dataKey]<"u")k.value={..._[n.dataKey]};else throw new Error(o("errors.dataKeyUndefined",{dataKey:n.dataKey}));else k.value={..._};Object.keys(n.configSchema).filter(T=>n.configSchema[T].forceShow).forEach(T=>{k.value&&typeof k.value[T]>"u"&&(k.value[T]=null)}),l("fetch:success",_)}catch(_){const T=d(_);m.value=T.startsWith("code")?o("baseConfigCard.errors.load"):T,b.value=!0,l("fetch:error",_)}finally{S.value=!1}}),(_,T)=>{const w=t.resolveComponent("KLabel"),E=t.resolveComponent("KSelect"),$=t.resolveComponent("KButton"),D=t.resolveComponent("KClipboardProvider"),U=t.resolveComponent("KSkeleton"),q=t.resolveComponent("KEmptyState"),M=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(M,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",ds,[t.renderSlot(_.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(w,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(E,{key:1,"data-testid":"select-config-format",items:p,onChange:f})):t.createCommentVNode("",!0),n.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock($,{key:2,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(ss),{size:t.unref(fn)},null,8,["size"])],8,hs)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(D,{key:3},{default:t.withCtx(({copyToClipboard:j})=>[!S.value&&!b.value?(t.openBlock(),t.createBlock($,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:B=>V(j)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),default:t.withCtx(()=>[S.value?(t.openBlock(),t.createBlock(U,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):b.value?(t.openBlock(),t.createBlock(q,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(m.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",ps,[t.createVNode(ts,{config:e.config,"fetcher-url":I.value,format:u.value,"prop-list-types":A.value,"property-collections":N.value,record:k.value},t.createSlots({_:2},[t.renderList(Object.keys(_.$slots),j=>({name:j,fn:t.withCtx(({row:B,rowValue:v})=>[t.renderSlot(_.$slots,j,{row:B,rowValue:v},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",us,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(A.value,j=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${j}-props`,class:t.normalizeClass(`config-card-details-${j}-props`),"data-testid":`config-card-details-${j}-props`},[j!=="basic"?(t.openBlock(),t.createElementBlock("div",ms,t.toDisplayString(j==="advanced"?t.unref(o)("baseConfigCard.sections.advanced"):t.unref(o)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.value[j],B=>(t.openBlock(),t.createBlock(Ge,{key:B.key,item:B},t.createSlots({label:t.withCtx(()=>[t.renderSlot(_.$slots,`${B.key}-label`,{row:B},void 0,!0)]),[B.key]:t.withCtx(({rowValue:v})=>[t.renderSlot(_.$slots,B.key,{row:B,rowValue:v},void 0,!0)]),_:2},[F(B)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(_.$slots,`${B.key}-label-tooltip`,{row:B},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,fs))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",cs,[t.renderSlot(_.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),ys=ne(gs,[["__scopeId","data-v-3fd4a3a4"]]),ks={class:"form-actions","data-testid":"form-actions"},bs={key:0},Cs=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}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=Je.useRouter(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),S=t.computed(()=>{var N,A;let F=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((N=n.config)==null?void 0:N.controlPlaneId)||""):n.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(A=n.config)!=null&&A.workspace?`/${n.config.workspace}`:"")),n.editId?(F=F.replace(/{id}/gi,n.editId),F):(F=F.replace(/\/{id}/gi,""),F)}),b=()=>{s.value=!s.value},m=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):k()},k=()=>{l("cancel")},x=()=>{f.value||l("submit")},H=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,N=>{l("loading",N)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:N}=await c.get(S.value);l("fetch:success",N)}catch(N){const A=d(N);u.value=A.startsWith("code")?o("baseForm.errors.edit"):A,p.value=!0,l("fetch:error",N)}finally{h.value=!1}}),(N,A)=>{const F=t.resolveComponent("KSkeleton"),I=t.resolveComponent("KEmptyState"),V=t.resolveComponent("KAlert"),_=t.resolveComponent("KButton"),T=t.resolveComponent("KTabs"),w=t.resolveComponent("KSlideout"),E=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(E,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(F,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(I,{key:1,"cta-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(k,["prevent"]),onSubmit:t.withModifiers(x,["prevent"])},[t.renderSlot(N.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(V,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",ks,[t.renderSlot(N.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",bs,[t.createVNode(_,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:A[0]||(A[0]=$=>b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(_,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(_,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),t.createVNode(w,{"close-button-alignment":"end","data-testid":"form-view-configuration-slideout","has-overlay":!1,"is-visible":s.value,"prevent-close-on-blur":"",title:t.unref(o)("baseForm.configuration.title"),onClose:A[1]||(A[1]=$=>b())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(T,{"data-testid":"form-view-configuration-slideout-tabs",tabs:H.value},{json:t.withCtx(()=>[t.createVNode(Ot,{config:e.config,"fetcher-url":S.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(va,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["is-visible","title"])]),_:3})}}}),Da=ne(Cs,[["__scopeId","data-v-4ef70725"]]),ws={key:0,"data-testid":"first-col"},_s=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const r=e,a=t.computed(()=>{var b;return((b=r.rowEl)==null?void 0:b.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var b;return((b=a.value)==null?void 0:b.querySelector('[data-testid="first-col"]'))||null}),n=t.computed(()=>{var b,m;const k=(b=r.rowEl)==null?void 0:b.querySelectorAll("td");return k?((m=k[0])==null?void 0:m.getAttribute("data-testid"))===r.keyName:!1});let i;const o=()=>{i&&(i.disconnect(),i=void 0)},d=()=>{var b,m,k;h.value=((b=l.value)==null?void 0:b.getBoundingClientRect().width)||0,p.value=((m=a.value)==null?void 0:m.clientWidth)||0,u.value=((k=c.value)==null?void 0:k.innerText)||""},c=t.ref({}),h=t.ref(0),p=t.ref(0),u=t.ref(""),f=t.computed(()=>[l.value,a.value]),s=t.watch(f,b=>{if(n.value&&(o(),"ResizeObserver"in window&&window)){i=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||d()})});for(const m of b)m&&i.observe(m)}},{immediate:!0,flush:"post",deep:!0}),S=t.computed(()=>n.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{s()}),(b,m)=>{const k=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[n.value?(t.openBlock(),t.createElementBlock("span",ws,[t.createVNode(k,{label:S.value?u.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),Ss=ne(_s,[["__scopeId","data-v-e42a20c9"]]),xs={class:"toolbar-container"},Ns={key:0,class:"toolbar-button-container"},Vs=["data-testid"],Bs=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:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),i=t.computed(()=>{var A,F;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(A=a.errorMessage)==null?void 0:A.title,message:(F=a.errorMessage)==null?void 0:F.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=A=>A.hasData||!!a.query,c=t.computed(()=>{const A=[];return Object.keys(a.tableHeaders).forEach(F=>{const I=a.tableHeaders[F];A.push({label:I.label??F,key:F,sortable:I.sortable??!1})}),a.enableEntityActions&&A.push({key:"actions",hideLabel:!0}),A}),h=A=>({"data-rowid":A.id,"data-testid":A.name,...a.rowAttributes(A)}),p=t.ref({}),u=A=>{var F;return(F=p.value)==null?void 0:F.$el.querySelector(`[data-rowid="${A.id}"]`)},f=A=>{const F={"data-testid":A.headerKey,...a.cellAttributes(A)};return A.colIndex===0&&(F.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),F},s=()=>{l("empty-state-cta-clicked"),S()},S=()=>{l("clear-search-input")},b=t.computed(()=>a.disableRowClick?void 0:(A,F)=>{l("click:row",F)}),m=A=>{l("sort",A)},{setTablePreferences:k,getTablePreferences:x}=kr(),H=t.computed(()=>{const A=x(a.preferencesStorageKey);return{...a.initialFetcherParams,...A}}),N=A=>{a.preferencesStorageKey&&k(a.preferencesStorageKey,A)};return(A,F)=>{const I=t.resolveComponent("KIcon"),V=t.resolveComponent("KButton"),_=t.resolveComponent("KDropdown"),T=t.resolveComponent("KTable"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(w,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(T,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("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":H.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:s,"onRow:click":b.value,onSort:F[0]||(F[0]=E=>m(E)),"onUpdate:tablePreferences":N},t.createSlots({toolbar:t.withCtx(({state:E})=>[t.withDirectives(t.createElementVNode("div",xs,[t.renderSlot(A.$slots,"toolbar-filter",{},void 0,!0),A.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ns,[t.renderSlot(A.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(E)]])]),actions:t.withCtx(({row:E,rowKey:$,rowValue:D})=>[t.createElementVNode("div",{class:"actions-container","data-testid":E.name},[t.createVNode(_,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(A.$slots,"actions",{row:E,rowKey:$,rowValue:D},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(V,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(I,{color:t.unref(pn),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Vs)]),_:2},[t.renderList(e.tableHeaders,(E,$)=>({name:$,fn:t.withCtx(({row:D,rowKey:U,rowValue:q})=>[t.createVNode(Ss,{"key-name":String($),"row-el":u(D)},{default:t.withCtx(()=>[t.renderSlot(A.$slots,$,{row:D,rowKey:U,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-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"])}}}),Ma=ne(Bs,[["__scopeId","data-v-2b9bf3dd"]]),Is={key:0,class:"kong-ui-entity-delete-error"},Ts={key:1,class:"description"},As=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:r}){const{i18nT:a}=Z.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":i.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:o,onProceed:d},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Is,[t.createVNode(p,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Ts,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),ja=ne(As,[["__scopeId","data-v-1c9a2a07"]]),Hs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Es={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Fs=["fill"],Os={mask:"url(#mask0_180_20349)"},qs=["fill"],Ka=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${dn})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Hs,[t.createElementVNode("mask",Es,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Fs)]),t.createElementVNode("g",Os,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,qs)])]))}}),Us={key:1,class:"kong-ui-entity-filter"},vs={class:"menu-item-title"},$s={class:"menu-item-indicator"},Ds={class:"menu-item-body"},Ms=["for"],js={class:"menu-item-buttons"},Ks={class:"filter-clear-button-container"},Ps=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:r}){const{i18n:{t:a}}=Z.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.computed(()=>{const k=[];return new URLSearchParams(l.modelValue).forEach((x,H)=>{x!==""&&k.push(H)}),k}),c=t.computed(()=>{const k=l.config.fields;return Object.keys(k).filter(x=>k[x].searchable).map(x=>({label:k[x].label||x,value:x}))});t.watch(()=>l.modelValue,k=>{o.value={},new URLSearchParams(k).forEach((x,H)=>{o.value[H]=x})});const h=()=>{i.value=!i.value},p=k=>{n("update:modelValue",k)},u=k=>`filter-${k}`,f=k=>{var x,H;return(((H=(x=l.config.schema)==null?void 0:x[k])==null?void 0:H.values)??[]).map(N=>({value:N,label:N}))},s=k=>{var x,H;return((H=(x=l.config.schema)==null?void 0:x[k])==null?void 0:H.type)??"text"},S=k=>{o.value={...o.value,[k]:""},m()},b=()=>{o.value={},m(!0)},m=(k=!1)=>{const x=Object.keys(o.value).reduce((H,N)=>(o.value[N]&&(H[N]=`${o.value[N]}`),H),{});k&&(i.value=!1),n("update:modelValue",new URLSearchParams(x).toString())};return(k,x)=>{const H=t.resolveComponent("KInput"),N=t.resolveComponent("KButton"),A=t.resolveComponent("KSelect"),F=t.resolveComponent("KMenuItem"),I=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(H,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":p},{before:t.withCtx(()=>[t.createVNode(Ka)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Us,[t.createVNode(N,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(Ka),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(d.value.length>0?`(${d.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createVNode(I,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(V,_)=>(t.openBlock(),t.createBlock(F,{key:V.value,"data-testid":V.value,expandable:"","last-menu-item":_===c.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",vs,[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",$s,null,512),[[t.vShow,d.value.includes(V.value)]])])]),itemBody:t.withCtx(()=>{var T,w;return[t.createElementVNode("div",Ds,[t.createElementVNode("label",{class:"menu-item-label",for:u(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Ms),((w=(T=e.config.schema)==null?void 0:T[V.value])==null?void 0:w.type)==="select"?(t.openBlock(),t.createBlock(A,{key:0,id:u(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":E=>o.value[V.value]=E,items:f(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(H,{key:1,id:u(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":E=>o.value[V.value]=E,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:s(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",js,[t.createVNode(N,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:x[0]||(x[0]=E=>m(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(N,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:E=>S(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Ks,[t.createVNode(N,{appearance:"tertiary",size:"small",onClick:b},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,i.value]])]))}}}),Ls=ne(Ps,[["__scopeId","data-v-e9512e8f"]]),ce=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Rs={class:"form-section-wrapper"},zs={key:0,class:"form-section-title"},Js={key:1,class:"form-section-description"},Ws={key:2,class:"form-section-footer"},Qs={class:"form-section-content"},Ys=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}},setup(e){const r=t.useSlots();return(a,l)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Rs,[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.createElementBlock("h4",zs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",Js,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",Ws,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Qs,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Oe=ne(Ys,[["__scopeId","data-v-3565daa7"]]),{useAxios:Ke,useDeleteUrlBuilder:Pa,useErrors:La,useExternalLinkCreator:zc,useFetchUrlBuilder:Jc,useFetcher:Ra,useDebouncedFilter:za,useStringHelpers:Wc,useHelpers:Zs,useGatewayFeatureSupported:Qc,useTruncationDetector:Yc}=Z,Gs={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Xs(){const e=Ie.createI18n("en-us",Gs);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function qe(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Pe=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],ut=10,ft=65536,ec=0,tc=65535,_e=0,Se=255,Ja=0,Wa=255,ac=0,lc=65535,Qa=0,Ya=65535,rc=0,nc=2**31,mt=["200","302"],gt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],yt=["429","404","500","501","502","503","504","505"],kt=["429","500","503"];function Le(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:mt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:yt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:gt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:kt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,f,s,S,b,m,k,x,H,N,A,F,I,V,_,T,w,E,$,D,U,q,M,j,B,v,P,y,g,C,z,K,J,X,R,te,ge,Be,Ga,Xa,el,tl,al,ll,rl,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,_l,Sl,xl,Nl,Vl,Bl,Il,Tl,Al,Hl,El,Fl,Ol,ql,Ul,vl,$l,Dl,Ml,jl,Kl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Zl,Gl,Xl,er,tr,ar,lr,rr,nr,or,ir,sr,cr,dr,hr,pr,ur;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:s.interval)!==0||((b=(S=c.healthchecks.active)==null?void 0:S.unhealthy)==null?void 0:b.interval)!==0,h.activeHealthCheck.type=((m=c.healthchecks.active)==null?void 0:m.type)||"http",h.activeHealthCheck.httpPath=((k=c.healthchecks.active)==null?void 0:k.http_path)||"/",h.activeHealthCheck.timeout=((x=c.healthchecks.active)==null?void 0:x.timeout)!==null&&((H=c.healthchecks.active)==null?void 0:H.timeout)!==void 0?(A=(N=c.healthchecks.active)==null?void 0:N.timeout)==null?void 0:A.toString():"",h.activeHealthCheck.concurrency=((F=c.healthchecks.active)==null?void 0:F.concurrency)!==null&&((I=c.healthchecks.active)==null?void 0:I.concurrency)!==void 0?(_=(V=c.healthchecks.active)==null?void 0:V.concurrency)==null?void 0:_.toString():"",h.activeHealthCheck.httpsSni=((T=c.healthchecks.active)==null?void 0:T.https_sni)||"",h.activeHealthCheck.verifySsl=((w=c.healthchecks.active)==null?void 0:w.https_verify_certificate)||!1,h.activeHealthCheck.headers=(E=c.healthchecks.active)!=null&&E.headers&&Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((D=c.healthchecks.active)==null?void 0:D.headers).map(([Rc,bt])=>({key:Rc,values:bt==null?void 0:bt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((q=(U=c.healthchecks.active)==null?void 0:U.healthy)==null?void 0:q.interval)!==null&&((j=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:j.interval)!==void 0?(P=(v=(B=c.healthchecks.active)==null?void 0:B.healthy)==null?void 0:v.interval)==null?void 0:P.toString():"0",h.activeHealthCheck.interval=((g=(y=c.healthchecks.active)==null?void 0:y.healthy)==null?void 0:g.interval)!==null&&((z=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:z.interval)!==void 0?(X=(J=(K=c.healthchecks.active)==null?void 0:K.healthy)==null?void 0:J.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(R=c.healthchecks.active)==null?void 0:R.healthy)==null?void 0:te.successes)!==null&&((Be=(ge=c.healthchecks.active)==null?void 0:ge.healthy)==null?void 0:Be.successes)!==void 0?(el=(Xa=(Ga=c.healthchecks.active)==null?void 0:Ga.healthy)==null?void 0:Xa.successes)==null?void 0:el.toString():"0",h.activeHealthCheck.httpStatuses=(al=(tl=c.healthchecks.active)==null?void 0:tl.healthy)!=null&&al.http_statuses?l(((rl=(ll=c.healthchecks.active)==null?void 0:ll.healthy)==null?void 0:rl.http_statuses)||[]):mt,h.activeHealthCheck.unhealthyInterval=((ol=(nl=c.healthchecks.active)==null?void 0:nl.unhealthy)==null?void 0:ol.interval)!==null&&((sl=(il=c.healthchecks.active)==null?void 0:il.unhealthy)==null?void 0:sl.interval)!==void 0?(hl=(dl=(cl=c.healthchecks.active)==null?void 0:cl.unhealthy)==null?void 0:dl.interval)==null?void 0:hl.toString():"0",h.activeHealthCheck.httpFailures=((ul=(pl=c.healthchecks.active)==null?void 0:pl.unhealthy)==null?void 0:ul.http_failures)!==null&&((ml=(fl=c.healthchecks.active)==null?void 0:fl.unhealthy)==null?void 0:ml.http_failures)!==void 0?(kl=(yl=(gl=c.healthchecks.active)==null?void 0:gl.unhealthy)==null?void 0:yl.http_failures)==null?void 0:kl.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((Cl=(bl=c.healthchecks.active)==null?void 0:bl.unhealthy)==null?void 0:Cl.timeouts)!==null&&((_l=(wl=c.healthchecks.active)==null?void 0:wl.unhealthy)==null?void 0:_l.timeouts)!==void 0?(Nl=(xl=(Sl=c.healthchecks.active)==null?void 0:Sl.unhealthy)==null?void 0:xl.timeouts)==null?void 0:Nl.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Bl=(Vl=c.healthchecks.active)==null?void 0:Vl.unhealthy)!=null&&Bl.http_statuses?l(((Tl=(Il=c.healthchecks.active)==null?void 0:Il.unhealthy)==null?void 0:Tl.http_statuses)||[]):yt,h.passiveHealthSwitch=((Hl=(Al=c.healthchecks.passive)==null?void 0:Al.healthy)==null?void 0:Hl.successes)!==0||((Fl=(El=c.healthchecks.passive)==null?void 0:El.unhealthy)==null?void 0:Fl.timeouts)!==0||((ql=(Ol=c.healthchecks.passive)==null?void 0:Ol.unhealthy)==null?void 0:ql.tcp_failures)!==0||((vl=(Ul=c.healthchecks.passive)==null?void 0:Ul.unhealthy)==null?void 0:vl.http_failures)!==0,h.passiveHealthCheck.type=(($l=c.healthchecks.passive)==null?void 0:$l.type)||"http",h.passiveHealthCheck.successes=((Ml=(Dl=c.healthchecks.passive)==null?void 0:Dl.healthy)==null?void 0:Ml.successes)!==null&&((Kl=(jl=c.healthchecks.passive)==null?void 0:jl.healthy)==null?void 0:Kl.successes)!==void 0?(Rl=(Ll=(Pl=c.healthchecks.passive)==null?void 0:Pl.healthy)==null?void 0:Ll.successes)==null?void 0:Rl.toString():"0",h.passiveHealthCheck.httpStatuses=(Jl=(zl=c.healthchecks.passive)==null?void 0:zl.healthy)!=null&&Jl.http_statuses?l(((Ql=(Wl=c.healthchecks.passive)==null?void 0:Wl.healthy)==null?void 0:Ql.http_statuses)||[]):gt,h.passiveHealthCheck.timeouts=((Zl=(Yl=c.healthchecks.passive)==null?void 0:Yl.unhealthy)==null?void 0:Zl.timeouts)!==null&&((Xl=(Gl=c.healthchecks.passive)==null?void 0:Gl.unhealthy)==null?void 0:Xl.timeouts)!==void 0?(ar=(tr=(er=c.healthchecks.passive)==null?void 0:er.unhealthy)==null?void 0:tr.timeouts)==null?void 0:ar.toString():"0",h.passiveHealthCheck.tcpFailures=((rr=(lr=c.healthchecks.passive)==null?void 0:lr.unhealthy)==null?void 0:rr.tcp_failures)!==null&&((or=(nr=c.healthchecks.passive)==null?void 0:nr.unhealthy)==null?void 0:or.tcp_failures)!==void 0?(cr=(sr=(ir=c.healthchecks.passive)==null?void 0:ir.unhealthy)==null?void 0:sr.tcp_failures)==null?void 0:cr.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(hr=(dr=c.healthchecks.passive)==null?void 0:dr.unhealthy)!=null&&hr.http_statuses?l(((ur=(pr=c.healthchecks.passive)==null?void 0:pr.unhealthy)==null?void 0:ur.http_statuses)||[]):kt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:Xs,useMultiselectCreation:qe,useHelpers:Le},xe="/api/runtime_groups/{controlPlaneId}",Ne="/{workspace}",Ve={list:{konnect:`${xe}/upstreams`,kongManager:`${Ne}/upstreams`},form:{konnect:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/v1/schemas/json/upstream/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`},kongManager:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/schemas/upstreams/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`}}},oc={class:"kong-ui-entities-upstreams-list"},ic={class:"upstream-name"},sc=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var j;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),i=Je.useRouter(),{axiosInstance:o}=Ke({headers:(j=l.config)==null?void 0:j.requestHeaders}),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var v,P;let B=`${l.config.apiBaseUrl}${Ve.list[l.config.app]}`;return l.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((v=l.config)==null?void 0:v.controlPlaneId)||""):l.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(P=l.config)!=null&&P.workspace?`/${l.config.workspace}`:"")),B}),f=t.ref(""),s=t.computed(()=>{const B=l.config.app==="konnect"||l.config.isExactMatch;if(B)return{isExactMatch:B,placeholder:n("upstreams.search.placeholder")};const{name:v,slots:P}=h;return{isExactMatch:B,fields:{name:v,slots:P},schema:l.config.filterSchema}}),{fetcher:S,fetcherState:b}=Ra(l.config,u.value),m=()=>{f.value=""},k=()=>{d.value++},x=t.ref(null),H=(B,v)=>{const P=B.id;if(!v(P)){a("copy:error",{entity:B,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:B,field:"id",message:n("upstreams.copy.success",{val:P})})},N=(B,v)=>{const P=JSON.stringify(B);if(!v(P)){a("copy:error",{entity:B,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:B,message:n("upstreams.copy.success_brief")})},A=async B=>{var P;await((P=l.canRetrieve)==null?void 0:P.call(l,B))&&i.push(l.config.getViewRoute(B.id))},F=B=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(B)}),I=B=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(B)}),V=t.ref(void 0),_=t.ref(!1),T=t.ref(!1),w=t.ref(""),E=Pa(l.config,u.value),$=B=>{V.value=B,_.value=!0},D=()=>{_.value=!1},U=async()=>{var B,v,P;if((B=V.value)!=null&&B.id){T.value=!0;try{await o.delete(E(V.value.id)),T.value=!1,_.value=!1,d.value++,a("delete:success",V.value)}catch(y){w.value=((P=(v=y.response)==null?void 0:v.data)==null?void 0:P.message)||y.message||n("upstreams.errors.delete"),a("error",y)}finally{T.value=!1}}},q=t.ref(!0);t.watch(b,B=>{var v,P,y,g;if(Array.isArray((v=B==null?void 0:B.response)==null?void 0:v.data)&&(q.value=B.response.data.length>0),B.status===pe.Error){x.value={title:n("upstreams.errors.general")},(g=(y=(P=B.error)==null?void 0:P.response)==null?void 0:y.data)!=null&&g.message&&(x.value.message=B.error.response.data.message),a("error",B.error);return}x.value=null});const M=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:n("upstreams.list.empty_state.description"),title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(M.value.title=n("upstreams.list.empty_state.title"),M.value.ctaText=n("upstreams.actions.create"))}),(B,v)=>{const P=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",oc,[t.createVNode(t.unref(Ma),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":M.value,"enable-entity-actions":"","error-message":x.value,fetcher:t.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:m,"onClick:row":v[1]||(v[1]=K=>A(K)),onSort:k},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Ls),{modelValue:f.value,"onUpdate:modelValue":v[0]||(v[0]=K=>f.value=K),config:s.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(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(P,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),name:t.withCtx(({rowValue:K})=>[t.createElementVNode("span",ic,t.toDisplayString(K),1)]),tags:t.withCtx(({rowValue:K})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(K,J=>(t.openBlock(),t.createBlock(y,{key:J,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(J),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:K})=>[t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:X=>H(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:X=>N(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:F(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:I(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(K)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:J=>$(K)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(ja),{"action-pending":T.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":V.value&&(V.value.name||V.value.id),"entity-type":t.unref(We).Upstream,error:w.value,title:t.unref(n)("upstreams.delete.title"),visible:_.value,onCancel:D,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),he=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},cc=he(sc,[["__scopeId","data-v-40e65380"]]),Re={list:{konnect:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",kongManager:"/{workspace}/upstreams/{upstreamId}/targets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",edit:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/target/validate"},kongManager:{create:"/{workspace}/upstreams/{upstreamId}/targets",edit:"/{workspace}/upstreams/{upstreamId}/targets/{id}",validate:"/{workspace}/schemas/targets/validate"}}},dc={class:"kong-ui-entities-target-form"},hc={class:"target-form-container"},pc={key:0,class:"target-form-info"},Za=he(t.defineComponent({__name:"TargetForm",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.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var F;t.useCssVars(I=>({20454403:A.value}));const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{getMessageFromError:i}=La(),{axiosInstance:o}=Ke({headers:(F=l.config)==null?void 0:F.requestHeaders}),d=t.computed(()=>{var I;return Re.form[l.config.app].edit.replace(/{upstreamId}/gi,((I=l.config)==null?void 0:I.upstreamId)||"")}),c=t.computed(()=>l.targetId?oe.Edit:oe.Create),h=t.computed(()=>c.value===oe.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),f={target:"",weight:100,tags:""},s=t.computed(()=>{const I=parseInt(p.fields.weight.toString(),10);return I<0||I>65535}),S=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),b=I=>{var V;p.fields.target=(I==null?void 0:I.target)||"",p.fields.weight=(I==null?void 0:I.weight)??"",p.fields.tags=((V=I==null?void 0:I.tags)==null?void 0:V.join(", "))||"",Object.assign(u,p.fields)},m=()=>{p.errorMessage="",a("cancel")},k=t.computed(()=>{var V,_;let I=`${l.config.apiBaseUrl}${Re.form[l.config.app].validate}`;return l.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||""):l.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(_=l.config)!=null&&_.workspace?`/${l.config.workspace}`:"")),I=I.replace(/{id}/gi,l.targetId),I}),x=t.computed(()=>{var V,_,T,w;let I=`${l.config.apiBaseUrl}${Re.form[l.config.app][c.value]}`;return l.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||"").replace(/{upstreamId}/gi,((_=l.config)==null?void 0:_.upstreamId)||""):l.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(T=l.config)!=null&&T.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||"")),I=I.replace(/{id}/gi,l.targetId),I}),H=t.computed(()=>{var I,V,_;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(_=(V=(I=p.fields.tags)==null?void 0:I.split(","))==null?void 0:V.map(T=>String(T||"").trim()))==null?void 0:_.filter(T=>T!==""),upstream:{id:l.config.upstreamId}}}),N=async()=>{var I,V;try{p.isReadonly=!0,p.errorMessage="";let _;if(await o.post(k.value,H.value),c.value==="create"?_=await o.post(x.value,H.value):c.value==="edit"&&(_=((I=l.config)==null?void 0:I.app)==="konnect"?await o.put(x.value,H.value):await o.patch(x.value,H.value)),_){const{data:T}=_;p.fields.target=(T==null?void 0:T.name)||"",p.fields.weight=(T==null?void 0:T.weight)??100,p.fields.tags=((V=T==null?void 0:T.tags)==null?void 0:V.join(", "))||"",a("update",T),Object.assign(p.fields,f)}}catch(_){p.errorMessage=i(_),a("error",_)}finally{p.isReadonly=!1}},A=t.computed(()=>p.isReadonly?"inline-flex":"none");return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,f)}),(I,V)=>{const _=t.resolveComponent("KInput"),T=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(T,{"action-button-text":t.unref(n)("targets.form.buttons.save"),"action-pending":!S.value||p.isReadonly,"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),"is-visible":e.isVisible,title:h.value,onCanceled:m,onProceed:N},{"body-content":t.withCtx(()=>[t.createElementVNode("div",dc,[t.createVNode(t.unref(Da),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":H.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":V[3]||(V[3]=w=>I.$emit("error",w)),"onFetch:success":b,onLoading:V[4]||(V[4]=w=>I.$emit("loading",w))},{default:t.withCtx(()=>[t.createElementVNode("div",hc,[I.$slots.info?(t.openBlock(),t.createElementBlock("div",pc,[t.renderSlot(I.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(_,{modelValue:p.fields.target,"onUpdate:modelValue":V[0]||(V[0]=w=>p.fields.target=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(_,{modelValue:p.fields.weight,"onUpdate:modelValue":V[1]||(V[1]=w=>p.fields.weight=w),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":V[2]||(V[2]=w=>p.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-text","action-pending","cancel-button-text","is-visible","title"])}}}),[["__scopeId","data-v-6947a9f4"]]),uc={class:"kong-ui-entities-targets-list"},fc={class:"target-address"},mc=he(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var P;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{axiosInstance:i}=Ke({headers:(P=l.config)==null?void 0:P.requestHeaders}),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var g,C,z,K;let y=`${l.config.apiBaseUrl}${Re.list[l.config.app]}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=l.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(z=l.config)!=null&&z.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((K=l.config)==null?void 0:K.upstreamId)||"")),y}),{fetcher:u,fetcherState:f}=Ra(l.config,p.value),s=()=>{o.value++},S=t.ref(null),b=()=>{M.value=!0},m=(y,g)=>{const C=y.id;if(!g(C)){a("copy:error",{entity:y,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:y,field:"id",message:n("targets.copy.success",{val:C})})},k=(y,g)=>{const C=JSON.stringify(y);if(!g(C)){a("copy:error",{entity:y,message:n("targets.errors.copy")});return}a("copy:success",{entity:y,message:n("targets.copy.success_brief")})},x=y=>{q.value=y,M.value=!0},H=y=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(y),N=y=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(y),A=t.ref(void 0),F=t.ref(!1),I=t.ref(!1),V=t.ref(""),_=Pa(l.config,p.value),T=y=>{A.value=y,F.value=!0},w=()=>{F.value=!1},E=async()=>{var y,g,C;if((y=A.value)!=null&&y.id){I.value=!0;try{await i.delete(_(A.value.id)),I.value=!1,F.value=!1,o.value++,a("delete:success",A.value)}catch(z){V.value=((C=(g=z.response)==null?void 0:g.data)==null?void 0:C.message)||z.message||n("targets.errors.delete"),a("error",z)}finally{I.value=!1}}},$=t.ref(!0);t.watch(f,y=>{var g,C,z,K;if(Array.isArray((g=y==null?void 0:y.response)==null?void 0:g.data)&&($.value=y.response.data.length>0),y.status===pe.Error){S.value={title:n("targets.errors.general")},(K=(z=(C=y.error)==null?void 0:C.response)==null?void 0:z.data)!=null&&K.message&&(S.value.message=y.error.response.data.message),a("error",y.error);return}S.value=null});const D=t.ref({ctaText:void 0,message:n("targets.list.empty_state.description"),title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(D.value.title=n("targets.list.empty_state.title"),D.value.ctaText=n("targets.actions.create"))});const U=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace,requestHeaders:l.config.requestHeaders}})),q=t.ref(""),M=t.ref(!1),j=y=>{q.value?a("update:target",y):a("create:target",y),B()},B=()=>{v(),o.value++},v=()=>{M.value=!1,q.value=""};return(y,g)=>{const C=t.resolveComponent("KButton"),z=t.resolveComponent("KBadge"),K=t.resolveComponent("KTruncate"),J=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",uc,[t.createVNode(t.unref(Ma),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":S.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>l.config.createRoute?void 0:b()),onSort:s},{"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(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(C,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:l.config.createRoute?l.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>l.config.createRoute?void 0:b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,$.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),target:t.withCtx(({rowValue:R})=>[t.createElementVNode("span",fc,t.toDisplayString(R),1)]),tags:t.withCtx(({rowValue:R})=>[t.createVNode(K,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R,te=>(t.openBlock(),t.createBlock(z,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:R})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:ge=>m(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:ge=>k(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>x(R.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>H(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>N(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(R)},{default:t.withCtx(()=>[t.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>T(R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(ja),{"action-pending":I.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(We).Target,error:V.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:F.value,onCancel:w,onProceed:E},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Za,{config:U.value,"is-visible":M.value,"target-id":q.value,onCancel:v,onUpdate:j},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-6e346906"]]),gc={key:1},yc=he(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var w,E,$,D;const{i18nT:a,i18n:{t:l}}=de.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=za(n.config,(E=Ve.form[(w=n.config)==null?void 0:w.app])==null?void 0:E.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:S}=za(n.config,(D=Ve.form[($=n.config)==null?void 0:$.app])==null?void 0:D.getCertificates),b=t.ref(""),m=t.computed(()=>{var U;return!!n.name&&!((U=p.value)!=null&&U.some(q=>q.host===n.name))}),k=t.computed(()=>{var q,M,j;const U=m.value&&n.name.includes((q=b.value)==null?void 0:q.toLowerCase());return(j=h.value)==null?void 0:j.map(B=>({label:B.host,value:B.id})).concat(U?[{label:n.name,value:((M=N.value)==null?void 0:M.value)||n.name}]:[])}),x=t.computed(()=>{var U;return(U=S.value)==null?void 0:U.map(q=>({label:q.id,value:q.id}))}),H=t.ref(""),N=t.ref({value:"",label:""}),A=t.computed(()=>{var U,q;return((U=k.value.find(M=>M.value===H.value))==null?void 0:U.label)||((q=N.value)==null?void 0:q.label)}),F=U=>{b.value=U,o(U)},I=U=>{N.value=U},V=()=>{N.value={value:"",label:""}},_=U=>{H.value=U,i("update:name",A.value)},T=t.ref(!1);return t.onBeforeMount(async()=>{var U,q;try{T.value=!0,await c(),n.name&&(H.value=((q=(U=k.value.find(M=>M.label===n.name))==null?void 0:U.value)==null?void 0:q.toString())||n.name),await s()}finally{T.value=!1}}),(U,q)=>{const M=t.resolveComponent("KSkeleton"),j=t.resolveComponent("KSelect"),B=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[T.value?(t.openBlock(),t.createBlock(M,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",gc,[t.createVNode(j,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:k.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":H.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:I,onItemRemoved:V,onQueryChange:F,"onUpdate:modelValue":_},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=v=>i("update:host-header",v))},null,8,["label","model-value","readonly"]),t.createVNode(j,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:x.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":q[1]||(q[1]=v=>i("update:client-certificate",v))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(B,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=v=>i("update:tags",v))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),ze={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},kc={class:"fields-group-title"},bc={class:"fields-group-text"},Cc={class:"fields-group-title"},wc={class:"fields-group-text"},_c=he(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=de.useI18n(),{inRange:n}=Le(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,f)=>{f==="header"&&u!==f&&o("update:hash-on-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,f)=>{f==="header"&&u!==f&&o("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,ut,ft)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),S=t.resolveComponent("KSelect"),b=t.resolveComponent("KInput"),m=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(S,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=k=>o("update:algorithm",k))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(ft),min:t.unref(ut),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=k=>o("update:slots",k))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",kc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",bc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(S,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=k=>o("update:hash-on",k))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=k=>o("update:hash-on-header",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=k=>o("update:hash-on-cookie",k))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=k=>o("update:hash-on-cookie-path",k))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=k=>o("update:hash-on-query-argument",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=k=>o("update:hash-on-uri-capture",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Cc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",wc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(S,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[8]||(f[8]=k=>o("update:hash-fallback",k))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=k=>o("update:hash-fallback-header",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=k=>o("update:hash-on-cookie",k))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=k=>o("update:hash-on-cookie-path",k))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=k=>o("update:hash-fallback-query-argument",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=k=>o("update:hash-fallback-uri-capture",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Sc={class:"fields-group-title"},xc={class:"fields-group-text"},Nc={class:"fields-group-title"},Vc={class:"fields-group-text"},Bc=he(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(o,{"hide-icon":"",href:t.unref(ze).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Sc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Nc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Vc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(tc),min:t.unref(ec),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),Ic={key:2},Tc={class:"fields-group-title"},Ac={class:"fields-group-text"},Hc={class:"fields-group-title"},Ec={class:"fields-group-text"},Fc=he(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),{objectsAreEqual:l}=Le(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=qe({replaceId:!0}),{trackNewItems:p}=qe({replaceId:!0});t.watch(()=>n.type,(b,m)=>{m==="tcp"&&b!==m&&i("update:tcp-failures","5"),(m==="https"||m==="grpcs")&&b!==m&&(i("update:https-sni",""),i("update:verify-ssl",!1)),m!=="tcp"&&b==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",mt),i("update:unhealthy-http-statuses",yt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,b=>{l(u.value,b)||(u.value=[...b])},{immediate:!0,deep:!0});const f=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},S=b=>{b===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(b,1),f()};return(b,m)=>{const k=t.resolveComponent("KExternalLink"),x=t.resolveComponent("KSelect"),H=t.resolveComponent("KInput"),N=t.resolveComponent("KCheckbox"),A=t.resolveComponent("KLabel"),F=t.resolveComponent("KIcon"),I=t.resolveComponent("KButton"),V=t.resolveComponent("KMultiselect"),_=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(k,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var T;return[t.createVNode(x,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=w=>i("update:type",w))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(H,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":m[1]||(m[1]=w=>i("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(lc),min:t.unref(ac),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":m[2]||(m[2]=w=>i("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(nc),min:t.unref(rc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":m[3]||(m[3]=w=>i("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":m[4]||(m[4]=w=>i("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(N,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":m[5]||(m[5]=w=>i("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((T=e.config)==null?void 0:T.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",Ic,[t.createVNode(A,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(w,E)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${E}`,class:t.normalizeClass(["headers-row",{"margin-top-6":E>0}])},[t.createVNode(H,{modelValue:u.value[E].key,"onUpdate:modelValue":$=>u.value[E].key=$,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${E+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(H,{modelValue:u.value[E].values,"onUpdate:modelValue":$=>u.value[E].values=$,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${E+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(I,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:$=>S(E)},{icon:t.withCtx(()=>[t.createVNode(F,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&E===u.value.length-1?(t.openBlock(),t.createBlock(I,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:s},{icon:t.withCtx(()=>[t.createVNode(F,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Tc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Ac,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Ya),min:t.unref(Qa),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[6]||(m[6]=w=>i("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":m[7]||(m[7]=w=>i("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(V,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[8]||(m[8]=w=>t.unref(h)(w,!0)),onItemRemoved:m[9]||(m[9]=w=>t.unref(h)(w,!1)),"onUpdate:modelValue":m[10]||(m[10]=w=>i("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Ya),min:t.unref(Qa),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[11]||(m[11]=w=>i("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(H,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[12]||(m[12]=w=>i("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[13]||(m[13]=w=>i("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(V,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[14]||(m[14]=w=>t.unref(p)(w,!0)),onItemRemoved:m[15]||(m[15]=w=>t.unref(p)(w,!1)),"onUpdate:modelValue":m[16]||(m[16]=w=>i("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Wa),min:t.unref(Ja),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":m[17]||(m[17]=w=>i("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-9e6394cf"]]),Oc={class:"fields-group-title"},qc={class:"fields-group-text"},Uc={class:"fields-group-title"},vc={class:"fields-group-text"},$c=he(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=qe({replaceId:!0}),{trackNewItems:c}=qe({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",gt),n("update:unhealthy-http-statuses",kt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),S=t.resolveComponent("KMultiselect"),b=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(f,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=m=>n("update:type",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Oc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",qc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>n("update:successes",m))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=m=>t.unref(d)(m,!0)),onItemRemoved:p[3]||(p[3]=m=>t.unref(d)(m,!1)),"onUpdate:modelValue":p[4]||(p[4]=m=>n("update:http-statuses",m))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Uc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",vc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Wa),min:t.unref(Ja),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=m=>n("update:timeouts",m))},null,8,["label","max","min","model-value","readonly"]),o.value?(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=m=>n("update:tcp-failures",m))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=m=>n("update:http-failures",m))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(S,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=m=>t.unref(c)(m,!0)),onItemRemoved:p[9]||(p[9]=m=>t.unref(c)(m,!1)),"onUpdate:modelValue":p[10]||(p[10]=m=>n("update:unhealthy-http-statuses",m))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cca8adae"]]),Dc={class:"kong-ui-entities-upstreams-form"},Mc=he(t.defineComponent({__name:"UpstreamsForm",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))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var P;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Le(),{axiosInstance:p}=Ke({headers:(P=a.config)==null?void 0:P.requestHeaders}),{getMessageFromError:u}=La(),f=Je.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),S=t.reactive(d()),b=t.computed(()=>!c(s.fields,S)),m=y=>{s.fields.activeHealthCheck.interval=y?"5":"0",s.fields.activeHealthCheck.successes=y?"5":"0",s.fields.activeHealthCheck.httpFailures=y?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},k=y=>{s.fields.passiveHealthCheck.timeouts=y?"5":"0",s.fields.passiveHealthCheck.successes=y?"80":"0"},x=t.computed(()=>s.fields.slots?n(s.fields.slots,ut,ft):!0),H=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),N=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),F=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),I=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),V=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),_=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),T=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),w=t.computed(()=>!!s.fields.name&&x.value&&H.value&&N.value&&A.value&&F.value&&I.value&&V.value&&_.value&&T.value),E=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),$=t.computed(()=>{var y,g;return(g=Ve.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),D=y=>{Object.assign(s.fields,o(y)),Object.assign(S,h(s.fields))},U=()=>{var y;f.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},q=y=>{l("loading",y)},M=y=>{l("error",y)},j=t.computed(()=>{var g,C,z,K,J;const y={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(y.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(y.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(y.tags=(C=(g=s.fields.tags.split(","))==null?void 0:g.map(X=>String(X||"").trim()))==null?void 0:C.filter(X=>X!=="")),s.fields.hashOn==="header"&&(y.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(y.hash_on_cookie=s.fields.hashOnCookie,y.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(y.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(y.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((z=a.config)==null?void 0:z.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((X,R)=>{var te,ge;return R.key?{...X,[R.key]:(ge=(te=R.values.split(","))==null?void 0:te.map(Be=>String(Be||"").trim()))==null?void 0:ge.filter(Be=>Be!=="")}:{...X}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.type==="tcp"&&s.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((K=a.config)==null?void 0:K.app)==="kongManager"&&E.value===oe.Edit&&(y.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),s.fields.passiveHealthSwitch?(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.type==="tcp"&&s.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((J=a.config)==null?void 0:J.app)==="kongManager"&&E.value===oe.Edit&&(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y}),B=y=>{var C,z,K,J,X,R;let g=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ve.form[(z=a.config)==null?void 0:z.app][y]}`;return((K=a.config)==null?void 0:K.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((J=a.config)==null?void 0:J.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},v=async()=>{var y;try{s.readonly=!0,await p.post(B("validate"),j.value);let g;E.value===oe.Create?g=await p.post(B("create"),j.value):E.value===oe.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await p.put(B("edit"),j.value):await p.patch(B("edit"),j.value)),l("update",g==null?void 0:g.data)}catch(g){s.errorMessage=u(g),l("error",g)}finally{s.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",Dc,[t.createVNode(t.unref(Da),{"can-submit":w.value&&b.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":$.value,"form-fields":j.value,"is-readonly":s.readonly,onCancel:U,"onFetch:error":M,"onFetch:success":D,onLoading:q,onSubmit:v},{default:t.withCtx(()=>[t.createVNode(yc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":g[2]||(g[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":g[3]||(g[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(_c,{algorithm:s.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":g[15]||(g[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Bc,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=C=>s.fields.activeHealthSwitch=C),m],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=C=>s.fields.passiveHealthSwitch=C),k],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Fc,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock($c,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-05687a98"]]),jc=t.createElementVNode("code",null,"10",-1),Kc=t.createElementVNode("code",null,"65536",-1),Pc={"data-testid":"client_certificate-plain-text"},Lc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=de.useI18n(),{getPropValue:n}=Zs(),i=t.computed(()=>Ve.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:W.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:W.Basic},hash_on:{order:7,section:W.Basic},hash_on_header:{order:8,section:W.Basic},hash_on_uri_capture:{order:9,section:W.Basic},hash_on_query_arg:{order:10,section:W.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:W.Basic},hash_on_cookie_path:{order:12,section:W.Basic},healthchecks:{order:13,section:W.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(ys),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onCopy:success":c[0]||(c[0]=h=>d.$emit("copy:success",h)),"onFetch:error":c[1]||(c[1]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[2]||(c[2]=h=>d.$emit("fetch:success",h)),onLoading:c[3]||(c[3]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[jc]),max:t.withCtx(()=>[Kc]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",Pc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Za,ae.TargetsList=mc,ae.UpstreamsConfigCard=Lc,ae.UpstreamsForm=Mc,ae.UpstreamsList=cc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
|
|
32
|
+
`:""}var Fi=Ei,Oi={dump:Fi};function pt(e,r){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+r+" instead, which is now safe by default.")}}var qi=G,Ui=$t,vi=Kt,$i=Jt,Di=Wt,Mi=lt,ji=ya.load,Ki=ya.loadAll,Pi=Oi.dump,Li=le,Ri={binary:Xt,float:zt,map:jt,null:Pt,pairs:ta,set:aa,timestamp:Zt,bool:Lt,int:Rt,merge:Gt,omap:ea,seq:Mt,str:Dt},zi=pt("safeLoad","load"),Ji=pt("safeLoadAll","loadAll"),Wi=pt("safeDump","dump"),Qi={Type:qi,Schema:Ui,FAILSAFE_SCHEMA:vi,JSON_SCHEMA:$i,CORE_SCHEMA:Di,DEFAULT_SCHEMA:Mi,load:ji,loadAll:Ki,dump:Pi,YAMLException:Li,types:Ri,safeLoad:zi,safeLoadAll:Ji,safeDump:Wi};const Yi={class:"yaml-config"},va=t.defineComponent({__name:"YamlCodeBlock",props:{yamlRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>r.yamlRecord);return(l,n)=>{const i=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Yi,[r.yamlRecord?(t.openBlock(),t.createBlock(i,{key:0,id:"yaml-codeblock",code:t.unref(Qi).dump(a.value),language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Zi={key:0,class:"config-card-display-form"},Gi=["data-testid"],Xi={key:0,class:"config-card-prop-section-title"},es=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 r=e,a=t.useSlots(),{i18n:{t:l}}=Z.useI18n(),n=o=>!!(o.tooltip||a[`${o.key}-label-tooltip`]),i=t.computed(()=>{if(!r.record)return r.record;const o=JSON.parse(JSON.stringify(r.record));return delete o.created_at,delete o.updated_at,o});return(o,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Zi,[(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",Xi,t.toDisplayString(c==="advanced"?t.unref(l)("baseConfigCard.sections.advanced"):t.unref(l)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.propertyCollections[c],h=>(t.openBlock(),t.createBlock(Ge,{key:h.key,item:h},t.createSlots({label:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label`,{row:h},void 0,!0)]),[h.key]:t.withCtx(({rowValue:p})=>[t.renderSlot(o.$slots,h.key,{row:h,rowValue:p},void 0,!0)]),_:2},[n(h)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(o.$slots,`${h.key}-label-tooltip`,{row:h},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Gi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&r.record?(t.openBlock(),t.createBlock(Ot,{key:1,config:r.config,"fetcher-url":r.fetcherUrl,"json-record":i.value,"request-method":"get"},null,8,["config","fetcher-url","json-record"])):t.createCommentVNode("",!0),e.format==="yaml"&&r.record?(t.openBlock(),t.createBlock(va,{key:2,"yaml-record":i.value},null,8,["yaml-record"])):t.createCommentVNode("",!0)],64))}}),ts=ne(es,[["__scopeId","data-v-2b74ac63"]]),$a="24px",as=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},ls=e=>(t.pushScopeId("data-v-c90ebabf"),e=e(),t.popScopeId(),e),rs=["aria-hidden"],ns={key:0,"data-testid":"kui-icon-svg-title"},os=ls(()=>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)),is=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:$a,validator:e=>{if(typeof e=="number"&&e>0)return!0;if(typeof e=="string"){const r=String(e).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(e){const r=e,a=t.computed(()=>{if(typeof r.size=="number"&&r.size>0)return`${r.size}px`;if(typeof r.size=="string"){const n=String(r.size).replace(/px/gi,""),i=Number(n);if(i&&!isNaN(i)&&Number.isInteger(i)&&i>0)return`${i}px`}return $a}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,height:a.value,lineHeight:"0",width:a.value}));return(n,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(l.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",ns,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),os],8,rs))]),_:1},8,["aria-hidden","style"]))}}),ss=as(is,[["__scopeId","data-v-c90ebabf"]]),cs={"data-testid":"config-card-title"},ds={class:"config-card-actions"},hs=["href"],ps={key:2,class:"config-card-details-section"},us={key:3,class:"config-card-details-section"},fs=["data-testid"],ms={key:0,class:"config-card-prop-section-title"},gs=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}},emits:["loading","fetch:success","fetch:error","copy:success","copy:error"],setup(e,{emit:r}){var a;const l=r,n=e,i=t.useSlots(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{convertKeyToTitle:c}=Z.useStringHelpers(),{axiosInstance:h}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),p=[{label:o("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"}],u=t.ref("structured"),f=_=>{u.value=_==null?void 0:_.value},s={id:{type:L.ID,label:o("baseConfigCard.commonFields.id_label"),order:0,section:W.Basic},name:{order:1,section:W.Basic},enabled:{type:L.BadgeStatus,order:2,section:W.Basic},updated_at:{type:L.Date,label:o("baseConfigCard.commonFields.updated_at_label"),order:3,section:W.Basic},created_at:{type:L.Date,label:o("baseConfigCard.commonFields.created_at_label"),order:4,section:W.Basic},tags:{type:L.BadgeTag,order:-1,section:W.Basic}},S=t.ref(!1),b=t.ref(!1),m=t.ref(""),k=t.ref({}),x=t.computed(()=>{var _,T,w;if(!k.value)return[];const E=[],$=Object.keys(k.value).length;for(const D in k.value){const U=(T=(_=n.configSchema)==null?void 0:_[D])==null?void 0:T.order,q=(w=s[D])==null?void 0:w.order;let M=$;(q||q===0)&&(M=q===-1?$+1:q),U&&(M=U===-1?$+1:U),E.push([D,M])}return E.sort(function(D,U){return D[1]-U[1]}),E.map(D=>{var U,q;const M=D[0],j=(U=k.value)==null?void 0:U[M],B=((q=n.configSchema)==null?void 0:q[M])||{},v=s[M];return{key:M,value:j,hidden:B.hidden||!1,type:B.type??((v==null?void 0:v.type)||L.Text),label:B.label??((v==null?void 0:v.label)||c(M)),tooltip:B.tooltip??((v==null?void 0:v.tooltip)||void 0),section:B.section??((v==null?void 0:v.section)||W.Advanced)}}).filter(D=>!D.hidden&&D.key!==n.pluginConfigKey)}),H=t.computed(()=>{var _,T;if(!k.value||!n.pluginConfigKey)return[];const w=k.value[n.pluginConfigKey]||{},E=Object.keys(w).length,$=[];for(const D in w){const U=(T=(_=n.pluginConfigSchema)==null?void 0:_[D])==null?void 0:T.order,q=w[D];let M=q!=null&&q!==""?E-1:E;U&&(M=U===-1?E+1:U),$.push([D,M])}return $.sort(function(D,U){return D[1]-U[1]}),$.map(D=>{var U;const q=D[0],M=w[q],j=((U=n.pluginConfigSchema)==null?void 0:U[q])||{};return{key:q,value:M,hidden:j.hidden||!1,type:j.type??L.Text,label:j.label??c(q),tooltip:j.tooltip??void 0,section:W.Plugin}}).filter(D=>!D.hidden)}),N=t.computed(()=>{var _,T,w,E;return{basic:(_=x.value)==null?void 0:_.filter($=>$.section===W.Basic),advanced:(T=x.value)==null?void 0:T.filter($=>$.section===W.Advanced),plugin:(E=H.value)==null?void 0:E.concat((w=x.value)==null?void 0:w.filter($=>$.section===W.Plugin))}}),A=t.computed(()=>{const _=[];return N.value.basic.length&&_.push("basic"),N.value.advanced.length&&_.push("advanced"),N.value.plugin.length&&_.push("plugin"),_}),F=_=>!!(_.tooltip||i[`${_.key}-label-tooltip`]),I=t.computed(()=>{var _,T;let w=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?w=w.replace(/{controlPlaneId}/gi,((_=n.config)==null?void 0:_.controlPlaneId)||""):n.config.app==="kongManager"&&(w=w.replace(/\/{workspace}/gi,(T=n.config)!=null&&T.workspace?`/${n.config.workspace}`:"")),w=w.replace(/{id}/gi,n.config.entityId),w}),V=_=>{k.value&&_(JSON.stringify(k.value))?l("copy:success",k.value):l("copy:error")};return t.watch(S,_=>{l("loading",_)},{immediate:!0}),t.onBeforeMount(async()=>{b.value=!1,S.value=!0;try{const{data:_}=await h.get(I.value);if(n.dataKey)if(typeof _[n.dataKey]<"u")k.value={..._[n.dataKey]};else throw new Error(o("errors.dataKeyUndefined",{dataKey:n.dataKey}));else k.value={..._};Object.keys(n.configSchema).filter(T=>n.configSchema[T].forceShow).forEach(T=>{k.value&&typeof k.value[T]>"u"&&(k.value[T]=null)}),l("fetch:success",_)}catch(_){const T=d(_);m.value=T.startsWith("code")?o("baseConfigCard.errors.load"):T,b.value=!0,l("fetch:error",_)}finally{S.value=!1}}),(_,T)=>{const w=t.resolveComponent("KLabel"),E=t.resolveComponent("KSelect"),$=t.resolveComponent("KButton"),D=t.resolveComponent("KClipboardProvider"),U=t.resolveComponent("KSkeleton"),q=t.resolveComponent("KEmptyState"),M=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(M,{class:"kong-ui-entity-base-config-card"},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",ds,[t.renderSlot(_.$slots,"actions",{},void 0,!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(w,{key:0,class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createBlock(E,{key:1,"data-testid":"select-config-format",items:p,onChange:f})):t.createCommentVNode("",!0),n.config.jsonYamlEnabled&&e.configCardDoc?(t.openBlock(),t.createBlock($,{key:2,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(ss),{size:t.unref(fn)},null,8,["size"])],8,hs)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(D,{key:3},{default:t.withCtx(({copyToClipboard:j})=>[!S.value&&!b.value?(t.openBlock(),t.createBlock($,{key:0,appearance:"tertiary","data-testid":"json-copy-button",onClick:B=>V(j)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.actions.copy")),1)]),_:2},1032,["onClick"])):t.createCommentVNode("",!0)]),_:1}))])]),default:t.withCtx(()=>[S.value?(t.openBlock(),t.createBlock(U,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):b.value?(t.openBlock(),t.createBlock(q,{key:1,"data-testid":"config-card-fetch-error","is-error":""},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(m.value),1)]),_:1})):t.createCommentVNode("",!0),e.config.jsonYamlEnabled?(t.openBlock(),t.createElementBlock("div",ps,[t.createVNode(ts,{config:e.config,"fetcher-url":I.value,format:u.value,"prop-list-types":A.value,"property-collections":N.value,record:k.value},t.createSlots({_:2},[t.renderList(Object.keys(_.$slots),j=>({name:j,fn:t.withCtx(({row:B,rowValue:v})=>[t.renderSlot(_.$slots,j,{row:B,rowValue:v},void 0,!0)])}))]),1032,["config","fetcher-url","format","prop-list-types","property-collections","record"])])):(t.openBlock(),t.createElementBlock("div",us,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(A.value,j=>(t.openBlock(),t.createElementBlock("div",{key:`config-card-details-${j}-props`,class:t.normalizeClass(`config-card-details-${j}-props`),"data-testid":`config-card-details-${j}-props`},[j!=="basic"?(t.openBlock(),t.createElementBlock("div",ms,t.toDisplayString(j==="advanced"?t.unref(o)("baseConfigCard.sections.advanced"):t.unref(o)("baseConfigCard.sections.plugin")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.value[j],B=>(t.openBlock(),t.createBlock(Ge,{key:B.key,item:B},t.createSlots({label:t.withCtx(()=>[t.renderSlot(_.$slots,`${B.key}-label`,{row:B},void 0,!0)]),[B.key]:t.withCtx(({rowValue:v})=>[t.renderSlot(_.$slots,B.key,{row:B,rowValue:v},void 0,!0)]),_:2},[F(B)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(_.$slots,`${B.key}-label-tooltip`,{row:B},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,fs))),128))]))]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("div",cs,[t.renderSlot(_.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1024)}}}),ys=ne(gs,[["__scopeId","data-v-3fd4a3a4"]]),ks={class:"form-actions","data-testid":"form-actions"},bs={key:0},Cs=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}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,i=Je.useRouter(),{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios({headers:(a=n.config)==null?void 0:a.requestHeaders}),h=t.ref(!1),p=t.ref(!1),u=t.ref(""),f=t.computed(()=>n.canSubmit===!1||n.isReadonly),s=t.ref(!1),S=t.computed(()=>{var N,A;let F=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?F=F.replace(/{controlPlaneId}/gi,((N=n.config)==null?void 0:N.controlPlaneId)||""):n.config.app==="kongManager"&&(F=F.replace(/\/{workspace}/gi,(A=n.config)!=null&&A.workspace?`/${n.config.workspace}`:"")),n.editId?(F=F.replace(/{id}/gi,n.editId),F):(F=F.replace(/\/{id}/gi,""),F)}),b=()=>{s.value=!s.value},m=()=>{n.config.cancelRoute?i.push(n.config.cancelRoute):k()},k=()=>{l("cancel")},x=()=>{f.value||l("submit")},H=t.ref([{title:o("baseForm.configuration.yaml"),hash:"#yaml"},{title:o("baseForm.configuration.json"),hash:"#json"}]);return t.watch(()=>h.value,N=>{l("loading",N)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{p.value=!1,h.value=!0;const{data:N}=await c.get(S.value);l("fetch:success",N)}catch(N){const A=d(N);u.value=A.startsWith("code")?o("baseForm.errors.edit"):A,p.value=!0,l("fetch:error",N)}finally{h.value=!1}}),(N,A)=>{const F=t.resolveComponent("KSkeleton"),I=t.resolveComponent("KEmptyState"),V=t.resolveComponent("KAlert"),_=t.resolveComponent("KButton"),T=t.resolveComponent("KTabs"),w=t.resolveComponent("KSlideout"),E=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(E,{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[h.value?(t.openBlock(),t.createBlock(F,{key:0,type:"form"})):p.value?(t.openBlock(),t.createBlock(I,{key:1,"cta-text":t.unref(o)("baseForm.actions.back"),"data-testid":"form-fetch-error","handle-click":m,"is-error":!0},{message:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(u.value),1)]),_:1},8,["cta-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",onReset:t.withModifiers(k,["prevent"]),onSubmit:t.withModifiers(x,["prevent"])},[t.renderSlot(N.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(V,{key:0,"alert-message":e.errorMessage,appearance:"danger","data-testid":"form-error"},null,8,["alert-message"])):t.createCommentVNode("",!0),t.createElementVNode("div",ks,[t.renderSlot(N.$slots,"form-actions",{},()=>[e.config.jsonYamlFormsEnabled?(t.openBlock(),t.createElementBlock("div",bs,[t.createVNode(_,{appearance:"tertiary","data-testid":"form-view-configuration",onClick:A[0]||(A[0]=$=>b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.viewConfiguration")),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(_,{appearance:"secondary","data-testid":"form-cancel",disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.cancel")),1)]),_:1},8,["disabled"]),t.createVNode(_,{appearance:"primary","data-testid":"form-submit",disabled:f.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseForm.actions.save")),1)]),_:1},8,["disabled"])],!0)])],32)),t.createVNode(w,{"close-button-alignment":"end","data-testid":"form-view-configuration-slideout","has-overlay":!1,"is-visible":s.value,"prevent-close-on-blur":"",title:t.unref(o)("baseForm.configuration.title"),onClose:A[1]||(A[1]=$=>b())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(o)("baseForm.configuration.message")),1),t.createVNode(T,{"data-testid":"form-view-configuration-slideout-tabs",tabs:H.value},{json:t.withCtx(()=>[t.createVNode(Ot,{config:e.config,"fetcher-url":S.value,"json-record":n.formFields,"request-method":n.editId?"put":"post"},null,8,["config","fetcher-url","json-record","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(va,{"yaml-record":n.formFields},null,8,["yaml-record"])]),_:1},8,["tabs"])]),_:1},8,["is-visible","title"])]),_:3})}}}),Da=ne(Cs,[["__scopeId","data-v-4ef70725"]]),ws={key:0,"data-testid":"first-col"},_s=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0}},setup(e){const r=e,a=t.computed(()=>{var b;return((b=r.rowEl)==null?void 0:b.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var b;return((b=a.value)==null?void 0:b.querySelector('[data-testid="first-col"]'))||null}),n=t.computed(()=>{var b,m;const k=(b=r.rowEl)==null?void 0:b.querySelectorAll("td");return k?((m=k[0])==null?void 0:m.getAttribute("data-testid"))===r.keyName:!1});let i;const o=()=>{i&&(i.disconnect(),i=void 0)},d=()=>{var b,m,k;h.value=((b=l.value)==null?void 0:b.getBoundingClientRect().width)||0,p.value=((m=a.value)==null?void 0:m.clientWidth)||0,u.value=((k=c.value)==null?void 0:k.innerText)||""},c=t.ref({}),h=t.ref(0),p=t.ref(0),u=t.ref(""),f=t.computed(()=>[l.value,a.value]),s=t.watch(f,b=>{if(n.value&&(o(),"ResizeObserver"in window&&window)){i=new ResizeObserver(m=>{window.requestAnimationFrame(()=>{!Array.isArray(m)||!m.length||d()})});for(const m of b)m&&i.observe(m)}},{immediate:!0,flush:"post",deep:!0}),S=t.computed(()=>n.value?h.value>p.value:!1);return t.onMounted(()=>{d()}),t.onUnmounted(()=>{s()}),(b,m)=>{const k=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:c,class:"content-wrapper"},[n.value?(t.openBlock(),t.createElementBlock("span",ws,[t.createVNode(k,{label:S.value?u.value:"","max-width":"300",placement:"bottomStart"},{default:t.withCtx(()=>[t.renderSlot(b.$slots,"default",{},void 0,!0)]),_:3},8,["label"])])):t.renderSlot(b.$slots,"default",{key:1},void 0,!0)],512)}}}),Ss=ne(_s,[["__scopeId","data-v-e42a20c9"]]),xs={class:"toolbar-container"},Ns={key:0,class:"toolbar-button-container"},Vs=["data-testid"],Bs=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:""},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),i=t.computed(()=>{var A,F;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(A=a.errorMessage)==null?void 0:A.title,message:(F=a.errorMessage)==null?void 0:F.message}}),o=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=A=>A.hasData||!!a.query,c=t.computed(()=>{const A=[];return Object.keys(a.tableHeaders).forEach(F=>{const I=a.tableHeaders[F];A.push({label:I.label??F,key:F,sortable:I.sortable??!1})}),a.enableEntityActions&&A.push({key:"actions",hideLabel:!0}),A}),h=A=>({"data-rowid":A.id,"data-testid":A.name,...a.rowAttributes(A)}),p=t.ref({}),u=A=>{var F;return(F=p.value)==null?void 0:F.$el.querySelector(`[data-rowid="${A.id}"]`)},f=A=>{const F={"data-testid":A.headerKey,...a.cellAttributes(A)};return A.colIndex===0&&(F.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),F},s=()=>{l("empty-state-cta-clicked"),S()},S=()=>{l("clear-search-input")},b=t.computed(()=>a.disableRowClick?void 0:(A,F)=>{l("click:row",F)}),m=A=>{l("sort",A)},{setTablePreferences:k,getTablePreferences:x}=kr(),H=t.computed(()=>{const A=x(a.preferencesStorageKey);return{...a.initialFetcherParams,...A}}),N=A=>{a.preferencesStorageKey&&k(a.preferencesStorageKey,A)};return(A,F)=>{const I=t.resolveComponent("KIcon"),V=t.resolveComponent("KButton"),_=t.resolveComponent("KDropdown"),T=t.resolveComponent("KTable"),w=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(w,{class:"kong-ui-entity-base-table",title:e.title},{default:t.withCtx(()=>[t.createVNode(T,{ref_key:"tableRefs",ref:p,"cache-identifier":o.value,"cell-attrs":f,"disable-pagination-page-jump":e.disablePaginationPageJump,"disable-sorting":e.disableSorting,"empty-state-action-button-icon":e.query?"":"plus","empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?"":e.emptyStateOptions.ctaPath,"empty-state-icon":e.query?"stateNoSearchResults":"stateGruceo","empty-state-icon-size":"96","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("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":H.value,"is-loading":e.isLoading,"pagination-type":e.paginationType,"row-attrs":h,"search-input":e.query,onKtableEmptyStateCtaClicked:s,"onRow:click":b.value,onSort:F[0]||(F[0]=E=>m(E)),"onUpdate:tablePreferences":N},t.createSlots({toolbar:t.withCtx(({state:E})=>[t.withDirectives(t.createElementVNode("div",xs,[t.renderSlot(A.$slots,"toolbar-filter",{},void 0,!0),A.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ns,[t.renderSlot(A.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(E)]])]),actions:t.withCtx(({row:E,rowKey:$,rowValue:D})=>[t.createElementVNode("div",{class:"actions-container","data-testid":E.name},[t.createVNode(_,{"kpop-attributes":{placement:"bottomEnd"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(A.$slots,"actions",{row:E,rowKey:$,rowValue:D},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(V,{class:"actions-trigger","data-testid":"overflow-actions-button",size:"small"},{icon:t.withCtx(()=>[t.createVNode(I,{color:t.unref(pn),icon:"more",size:"16"},null,8,["color"])]),_:1})]),_:2},1032,["width"])],8,Vs)]),_:2},[t.renderList(e.tableHeaders,(E,$)=>({name:$,fn:t.withCtx(({row:D,rowKey:U,rowValue:q})=>[t.createVNode(Ss,{"key-name":String($),"row-el":u(D)},{default:t.withCtx(()=>[t.renderSlot(A.$slots,$,{row:D,rowKey:U,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el"])])}))]),1032,["cache-identifier","disable-pagination-page-jump","disable-sorting","empty-state-action-button-icon","empty-state-action-message","empty-state-action-route","empty-state-icon","empty-state-message","empty-state-title","enable-client-sort","error-state-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"])}}}),Ma=ne(Bs,[["__scopeId","data-v-2b9bf3dd"]]),Is={key:0,class:"kong-ui-entity-delete-error"},Ts={key:1,class:"description"},As=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:r}){const{i18nT:a}=Z.useI18n(),l=e,n=r,i=t.computed(()=>l.needConfirm?l.entityName:""),o=()=>{n("cancel")},d=()=>{n("proceed")};return(c,h)=>{const p=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-text":"Yes, delete","action-pending":e.actionPending,class:"kong-ui-entity-delete-modal","confirmation-text":i.value,"is-visible":e.visible,title:e.title,type:"danger",onCanceled:o,onProceed:d},{"body-content":t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",Is,[t.createVNode(p,{appearance:"danger"},{alertMessage:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.error),1)]),_:1})])):t.createCommentVNode("",!0),t.createVNode(t.unref(a),{class:"message",keypath:l.entityName?"deleteModal.messageWithName":"deleteModal.message",tag:"p"},t.createSlots({entityType:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.entityType),1)]),_:2},[l.entityName?{name:"entityName",fn:t.withCtx(()=>[t.createElementVNode("strong",null,t.toDisplayString(l.entityName),1)]),key:"0"}:void 0]),1032,["keypath"]),l.description||c.$slots.description?(t.openBlock(),t.createElementBlock("div",Ts,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-pending","confirmation-text","is-visible","title"])}}}),ja=ne(As,[["__scopeId","data-v-1c9a2a07"]]),Hs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Es={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Fs=["fill"],Os={mask:"url(#mask0_180_20349)"},qs=["fill"],Ka=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${dn})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Hs,[t.createElementVNode("mask",Es,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Fs)]),t.createElementVNode("g",Os,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,qs)])]))}}),Us={key:1,class:"kong-ui-entity-filter"},vs={class:"menu-item-title"},$s={class:"menu-item-indicator"},Ds={class:"menu-item-body"},Ms=["for"],js={class:"menu-item-buttons"},Ks={class:"filter-clear-button-container"},Ps=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:r}){const{i18n:{t:a}}=Z.useI18n(),l=e,n=r,i=t.ref(!1),o=t.ref({}),d=t.computed(()=>{const k=[];return new URLSearchParams(l.modelValue).forEach((x,H)=>{x!==""&&k.push(H)}),k}),c=t.computed(()=>{const k=l.config.fields;return Object.keys(k).filter(x=>k[x].searchable).map(x=>({label:k[x].label||x,value:x}))});t.watch(()=>l.modelValue,k=>{o.value={},new URLSearchParams(k).forEach((x,H)=>{o.value[H]=x})});const h=()=>{i.value=!i.value},p=k=>{n("update:modelValue",k)},u=k=>`filter-${k}`,f=k=>{var x,H;return(((H=(x=l.config.schema)==null?void 0:x[k])==null?void 0:H.values)??[]).map(N=>({value:N,label:N}))},s=k=>{var x,H;return((H=(x=l.config.schema)==null?void 0:x[k])==null?void 0:H.type)??"text"},S=k=>{o.value={...o.value,[k]:""},m()},b=()=>{o.value={},m(!0)},m=(k=!1)=>{const x=Object.keys(o.value).reduce((H,N)=>(o.value[N]&&(H[N]=`${o.value[N]}`),H),{});k&&(i.value=!1),n("update:modelValue",new URLSearchParams(x).toString())};return(k,x)=>{const H=t.resolveComponent("KInput"),N=t.resolveComponent("KButton"),A=t.resolveComponent("KSelect"),F=t.resolveComponent("KMenuItem"),I=t.resolveComponent("KMenu");return e.config.isExactMatch?(t.openBlock(),t.createBlock(H,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":p},{before:t.withCtx(()=>[t.createVNode(Ka)]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",Us,[t.createVNode(N,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(Ka),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(d.value.length>0?`(${d.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,i.value]]),t.withDirectives(t.createVNode(I,{class:"kong-ui-entity-filter-menu"},{body:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(V,_)=>(t.openBlock(),t.createBlock(F,{key:V.value,"data-testid":V.value,expandable:"","last-menu-item":_===c.value.length-1},{itemTitle:t.withCtx(()=>[t.createElementVNode("span",vs,[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",$s,null,512),[[t.vShow,d.value.includes(V.value)]])])]),itemBody:t.withCtx(()=>{var T,w;return[t.createElementVNode("div",Ds,[t.createElementVNode("label",{class:"menu-item-label",for:u(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,Ms),((w=(T=e.config.schema)==null?void 0:T[V.value])==null?void 0:w.type)==="select"?(t.openBlock(),t.createBlock(A,{key:0,id:u(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":E=>o.value[V.value]=E,items:f(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(H,{key:1,id:u(V.value),modelValue:o.value[V.value],"onUpdate:modelValue":E=>o.value[V.value]=E,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:s(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))]),t.createElementVNode("div",js,[t.createVNode(N,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:x[0]||(x[0]=E=>m(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(N,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:E=>S(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])])]}),_:2},1032,["data-testid","last-menu-item"]))),128))]),actionButton:t.withCtx(()=>[t.createElementVNode("div",Ks,[t.createVNode(N,{appearance:"tertiary",size:"small",onClick:b},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])]),_:1},512),[[t.vShow,i.value]])]))}}}),Ls=ne(Ps,[["__scopeId","data-v-e9512e8f"]]),ce=t.defineComponent({__name:"PermissionsWrapper",props:{authFunction:{type:Function,required:!0,default:async()=>!0},forceShow:{type:Boolean,default:!1}},setup(e){const r=e,a=t.ref(void 0),l=t.computed(()=>a.value===!0||a.value!==void 0&&r.forceShow===!0);return t.watch(()=>r.authFunction,async()=>{a.value=await r.authFunction()},{immediate:!0}),(n,i)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}}),Rs={class:"form-section-wrapper"},zs={key:0,class:"form-section-title"},Js={key:1,class:"form-section-description"},Ws={key:2,class:"form-section-footer"},Qs={class:"form-section-content"},Ys=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}},setup(e){const r=t.useSlots();return(a,l)=>(t.openBlock(),t.createElementBlock("fieldset",{class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}])},[t.createElementVNode("div",Rs,[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.createElementBlock("h4",zs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",Js,[t.renderSlot(a.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",Ws,[t.renderSlot(a.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Qs,[t.renderSlot(a.$slots,"default",{},void 0,!0)])])],2))}}),Oe=ne(Ys,[["__scopeId","data-v-3565daa7"]]),{useAxios:Ke,useDeleteUrlBuilder:Pa,useErrors:La,useExternalLinkCreator:zc,useFetchUrlBuilder:Jc,useFetcher:Ra,useDebouncedFilter:za,useStringHelpers:Wc,useHelpers:Zs,useGatewayFeatureSupported:Qc,useTruncationDetector:Yc}=Z,Gs={upstreams:{list:{table_headers:{id:"ID",name:"Name",slots:"Slots",tags:"Tags"},empty_state:{title:"Configure a New Upstream",description:"Upstreams are used to load balance incoming requests."},toolbar_actions:{new_upstream:"New Upstream"}},title:"Upstreams",search:{placeholder:"Filter by exact name or ID"},actions:{create:"New Upstream",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",view:"View Details"},delete:{title:"Delete an Upstream",description:"This action cannot be reversed so make sure to check upstream usage before deleting."},errors:{general:"Upstreams could not be retrieved",delete:"The upstream could not be deleted at this time.",copy:"Failed to copy to clipboard"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{errors:{name_required:"Name is required",should_be_integer:"Field should contain an integer",in_range:"Accepts an integer in the range of 10 - 65536"},general_info:{title:"General Information",help:"General information will help identify and manage this Upstream."},load_balancing:{title:"Load Balancing",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},health_check:{title:"Health Checks & Circuit Breakers",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},active_health_check:{title:"Active Health Checks",help:"Active health checks actively probe targets for their health. Currently only support HTTP/HTTPS targets."},passive_health_check:{title:"Passive Health Checks",help:"Passive health checks, also known as circuit breakers, are checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},buttons:{view_documentation:"View documentation"},algorithms:{round_robin_label:"Round Robin",least_connections_label:"Least Connections",consistent_hashing_label:"Consistent Hashing",latency_label:"Latency"},hash_labels:{none:"None",consumer:"Consumer",ip:"IP",header:"Header",cookie:"Cookie",path:"Path",query_argument:"Query Argument",uri_capture:"URI Capture"},hash_tooltips:{hash_on_header:{text:"The header name to take the value from as hash input. Only required when {hash_on} is set to {header}",hash_on:"hash_on",header:"header"},hash_on_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_on} is set to {uri_capture}",hash_on:"hash_on",uri_capture:"uri_capture"},hash_on_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_on} is set to {query_arg}",hash_on:"hash_on",query_arg:"query_arg"},hash_on_cookie:{text:"The cookie name to take the value from as hash input. Only required when {hash_on} or {hash_fallback} is set to {cookie}. If the specified cookie is not in the request, Kong will generate a value and set the cookie in the response.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},hash_on_cookie_path:{text:"The cookie path to set in the response headers. Only required when {hash_on} or {hash_fallback} is set to {cookie}.",hash_on:"hash_on",hash_fallback:"hash_fallback",cookie:"cookie"},slots:{text:"The number of slots in the load balancer algorithm. If {algorithm} is set to {round_robin}, this setting determines the maximum number of slots. If {algorithm} is set to {consistent_hashing}, this setting determines the actual number of slots in the algorithm. Accepts an integer in the range {min}-{max}",algorithm:"algorithm",round_robin:"round-robin",consistent_hashing:"consistent-hashing"},tags:"An optional set of strings associated with the Upstream for grouping and filtering.",hash_fallback:{text:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}",hash_on:"hash_on",cookie:"cookie"},hash_fallback_header:{text:"The header name to take the value from as hash input. Only required when {hash_fallback} is set to {header}",hash_fallback:"hash_fallback",header:"header"},hash_fallback_query_arg:{text:"The name of the query string argument to take the value from as hash input. Only required when {hash_fallback} is set to {query_arg}",hash_fallback:"hash_fallback",query_arg:"query_arg"},hash_fallback_uri_capture:{text:"The name of the route URI capture to take the value from as hash input. Only required when {hash_fallback} is set to {uri_capture}",hash_fallback:"hash_fallback",uri_capture:"uri_capture"},host_header:{text:"The hostname to be used as {host} header when proxying requests through Kong.",host:"Host"},client_certificate:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},healthcheck_type_labels:{http:"HTTP",https:"HTTPS",tcp:"TCP",grsp:"gRPC",grsps:"gRPCs"},healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},passive_healthy:{label:"Healthy",help:"The counter thresholds to determine whether targets are healthy."},passive_unhealthy:{label:"Unhealthy",help:"The counter thresholds to determine whether targets are unhealthy."},fields:{name:{label:"Name",placeholder:"Enter or select a host",tooltip:"This is a hostname, which must be equal to the {host} of a Service.",host:"host"},host_header:{label:"Host Header"},client_certificate:{label:"Client Certificate",placeholder:"Select or enter a Certificate ID",tooltip:"If set, the certificate to be used as client certificate while TLS handshaking to the upstream server."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3",tooltip:"An optional set of strings associated with the Upstream for grouping and filtering."},algorithm:{label:"Algorithm",tooltip:"Which load balancing algorithm to use."},slots:{label:"Slots",help:"Accepts an integer in the range of 10 - 65536"},hash_on:{label:"Hash on",help:"What to use as hashing input.",tooltip:"What to use as hashing input. Using {result} results in a weighted-round-robin scheme with no hashing."},hash_fallback:{label:"Hash Fallback",help:"What to use as hashing input if the primary hash_on does not return a hash",tooltip:"What to use as hashing input if the primary {hash_on} does not return a hash (eg. header is missing, or no Consumer identified). Not available if {hash_on} is set to {cookie}.",hash_on:"hash_on",cookie:"cookie"},active_health_checks:{label:"Active Health Checks",help:"Actively probe the targets for their health."},passive_health_checks:{label:"Passive Health Checks / Circuit Breakers",help:"Checks performed based on the requests being proxied by Kong (HTTP/HTTPS/TCP), with no additional traffic being generated."},healthchecks_threshold:{label:"Healthchecks Threshold"},header:{label:"Header"},headers:{label:"Headers",tooltip_active:"Header values can be separated by commas (value1, value2, value3)."},cookie:{label:"Cookie"},cookie_path:{label:"Cookie Path"},query_argument:{label:"Query Argument"},uri_capture:{label:"URI Capture"},active_healthcheck_type:{label:"Active Health Check Type"},http_path:{label:"HTTP Path"},timeout:{label:"Timeout"},concurrency:{label:"Concurrency"},https_sni:{label:"HTTPS SNI"},verify_ssl:{label:"Verify the SSL certificate when performing active health checks using HTTPS"},interval:{label:"Interval",help:"A value of zero indicates that active probes for healthy targets are disabled."},successes:{label:"Successes"},http_statuses:{label:"HTTP Statuses"},http_failures:{label:"HTTP Failures"},tcp_failures:{label:"TCP Failures"},timeouts:{label:"Timeouts"},passive_health_check_type:{label:"Passive Health Check Type"}}},labels:{created_at:"Created at"}},targets:{list:{table_headers:{id:"ID",target_address:"Target Address",weight:"Weight",tags:"Tags"},empty_state:{title:"Configure a New Target",description:"A target is an IP address/hostname with a port that identifies an instance of a backend service."},toolbar_actions:{new_target:"New Target"}},title:"Targets",actions:{create:"New Target",copy_id:"Copy ID",copy_json:"Copy JSON",edit:"Edit",delete:"Delete",mark_healthy:"Mark Healthy",mark_unhealthy:"Mark Unhealthy"},delete:{title:"Delete a Target",description:"This action cannot be reversed so make sure to check target usage before deleting."},errors:{general:"Targets could not be retrieved",delete:"The target could not be deleted at this time.",copy:"Failed to copy to clipboard",weight:"Value must be in range 0 to 65535"},copy:{success:"Copied {val} to clipboard",success_brief:"Successfully copied to clipboard"},form:{create:{title:"New Target"},edit:{title:"Edit Target"},buttons:{save:"Save",cancel:"Cancel"},fields:{target:{label:"Target Address",placeholder:"Enter IP/hostname and port",tooltip:"The target address (IP or hostname) and port. If omitted the port defaults to 8000."},weight:{label:"Weight",tooltip:"The weight of this target in relation to other targets in the upstream. Value must be in range 0 to 65535, defaults to 100."},tags:{label:"Tags",placeholder:"Enter a list of tags separated by comma",help:"e.g. tag1, tag2, tag3"}}}}};function Xs(){const e=Ie.createI18n("en-us",Gs);return{i18n:e,i18nT:Ie.i18nTComponent(e)}}function qe(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,i)=>{if(i){const o={...n};r&&(o.value=n.label),a.value.push(o)}else a.value=a.value.filter(o=>o.value!==n.value)}}}const Pe=[{label:"100",value:"100"},{label:"101",value:"101"},{label:"102",value:"102"},{label:"103",value:"103"},{label:"200",value:"200"},{label:"201",value:"201"},{label:"202",value:"202"},{label:"203",value:"203"},{label:"204",value:"204"},{label:"205",value:"205"},{label:"206",value:"206"},{label:"207",value:"207"},{label:"208",value:"208"},{label:"226",value:"226"},{label:"300",value:"300"},{label:"301",value:"301"},{label:"302",value:"302"},{label:"303",value:"303"},{label:"304",value:"304"},{label:"305",value:"305"},{label:"306",value:"306"},{label:"307",value:"307"},{label:"308",value:"308"},{label:"400",value:"400"},{label:"401",value:"401"},{label:"402",value:"402"},{label:"403",value:"403"},{label:"404",value:"404"},{label:"405",value:"405"},{label:"406",value:"406"},{label:"407",value:"407"},{label:"408",value:"408"},{label:"409",value:"409"},{label:"410",value:"410"},{label:"411",value:"411"},{label:"412",value:"412"},{label:"413",value:"413"},{label:"414",value:"414"},{label:"415",value:"415"},{label:"416",value:"416"},{label:"417",value:"417"},{label:"418",value:"418"},{label:"419",value:"419"},{label:"420",value:"420"},{label:"421",value:"421"},{label:"422",value:"422"},{label:"423",value:"423"},{label:"424",value:"424"},{label:"425",value:"425"},{label:"426",value:"426"},{label:"428",value:"428"},{label:"429",value:"429"},{label:"430",value:"430"},{label:"431",value:"431"},{label:"440",value:"440"},{label:"444",value:"444"},{label:"449",value:"449"},{label:"450",value:"450"},{label:"451",value:"451"},{label:"460",value:"460"},{label:"463",value:"463"},{label:"494",value:"494"},{label:"495",value:"495"},{label:"496",value:"496"},{label:"497",value:"497"},{label:"498",value:"498"},{label:"499",value:"499"},{label:"500",value:"500"},{label:"501",value:"501"},{label:"502",value:"502"},{label:"503",value:"503"},{label:"504",value:"504"},{label:"505",value:"505"},{label:"506",value:"506"},{label:"507",value:"507"},{label:"508",value:"508"},{label:"509",value:"509"},{label:"510",value:"510"},{label:"511",value:"511"},{label:"520",value:"520"},{label:"521",value:"521"},{label:"522",value:"522"},{label:"523",value:"523"},{label:"524",value:"524"},{label:"525",value:"525"},{label:"526",value:"526"},{label:"527",value:"527"},{label:"529",value:"529"},{label:"530",value:"530"},{label:"561",value:"561"},{label:"598",value:"598"},{label:"599",value:"599"}],ut=10,ft=65536,ec=0,tc=65535,_e=0,Se=255,Ja=0,Wa=255,ac=0,lc=65535,Qa=0,Ya=65535,rc=0,nc=2**31,mt=["200","302"],gt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],yt=["429","404","500","501","502","503","504","505"],kt=["429","500","503"];function Le(){const e=c=>/^\d+$/.test(c),r=(c,h,p)=>{if(e(c)){const u=Number(c);return u>=h&&u<=p}else return!1},a=c=>c.map(h=>Number(h)),l=c=>c.map(h=>h.toString()),n=()=>({name:"",hostHeader:"",clientCertificate:"",tags:"",algorithm:"round-robin",slots:"10000",hashOn:"none",hashFallback:"none",hashOnHeader:"",hashOnCookie:"",hashOnCookiePath:"/",hashOnQueryArgument:"",hashOnUriCapture:"",hashFallbackHeader:"",hashFallbackQueryArgument:"",hashFallbackUriCapture:"",activeHealthSwitch:!1,passiveHealthSwitch:!1,healthchecksThreshold:"0",activeHealthCheck:{type:"http",httpPath:"/",timeout:"1",concurrency:"10",httpsSni:"",verifySsl:!1,headers:[{key:"",values:""}],interval:"0",successes:"5",httpStatuses:mt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:yt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:gt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:kt,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var p,u,f,s,S,b,m,k,x,H,N,A,F,I,V,_,T,w,E,$,D,U,q,M,j,B,v,P,y,g,C,z,K,J,X,R,te,ge,Be,Ga,Xa,el,tl,al,ll,rl,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,_l,Sl,xl,Nl,Vl,Bl,Il,Tl,Al,Hl,El,Fl,Ol,ql,Ul,vl,$l,Dl,Ml,jl,Kl,Pl,Ll,Rl,zl,Jl,Wl,Ql,Yl,Zl,Gl,Xl,er,tr,ar,lr,rr,nr,or,ir,sr,cr,dr,hr,pr,ur;const h=n();return h.name=c.name||"",h.algorithm=c.algorithm||"round-robin",h.hostHeader=c.host_header||"",h.clientCertificate=c.client_certificate?(p=c.client_certificate)==null?void 0:p.id:"",h.tags=((u=c.tags)==null?void 0:u.join(", "))||"",h.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",h.hashOn=c.hash_on||"none",h.hashFallback=c.hash_fallback||"none",h.hashOnHeader=c.hash_on_header||"",h.hashOnCookie=c.hash_on_cookie||"",h.hashOnCookiePath=c.hash_on_cookie_path||"/",h.hashOnQueryArgument=c.hash_on_query_arg||"",h.hashOnUriCapture=c.hash_on_uri_capture||"",h.hashFallbackHeader=c.hash_fallback_header||"",h.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",h.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",h.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",h.activeHealthSwitch=((s=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:s.interval)!==0||((b=(S=c.healthchecks.active)==null?void 0:S.unhealthy)==null?void 0:b.interval)!==0,h.activeHealthCheck.type=((m=c.healthchecks.active)==null?void 0:m.type)||"http",h.activeHealthCheck.httpPath=((k=c.healthchecks.active)==null?void 0:k.http_path)||"/",h.activeHealthCheck.timeout=((x=c.healthchecks.active)==null?void 0:x.timeout)!==null&&((H=c.healthchecks.active)==null?void 0:H.timeout)!==void 0?(A=(N=c.healthchecks.active)==null?void 0:N.timeout)==null?void 0:A.toString():"",h.activeHealthCheck.concurrency=((F=c.healthchecks.active)==null?void 0:F.concurrency)!==null&&((I=c.healthchecks.active)==null?void 0:I.concurrency)!==void 0?(_=(V=c.healthchecks.active)==null?void 0:V.concurrency)==null?void 0:_.toString():"",h.activeHealthCheck.httpsSni=((T=c.healthchecks.active)==null?void 0:T.https_sni)||"",h.activeHealthCheck.verifySsl=((w=c.healthchecks.active)==null?void 0:w.https_verify_certificate)||!1,h.activeHealthCheck.headers=(E=c.healthchecks.active)!=null&&E.headers&&Object.entries(($=c.healthchecks.active)==null?void 0:$.headers).length>0?Object.entries((D=c.healthchecks.active)==null?void 0:D.headers).map(([Rc,bt])=>({key:Rc,values:bt==null?void 0:bt.join(", ")})):[{key:"",values:""}],h.activeHealthCheck.interval=((q=(U=c.healthchecks.active)==null?void 0:U.healthy)==null?void 0:q.interval)!==null&&((j=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:j.interval)!==void 0?(P=(v=(B=c.healthchecks.active)==null?void 0:B.healthy)==null?void 0:v.interval)==null?void 0:P.toString():"0",h.activeHealthCheck.interval=((g=(y=c.healthchecks.active)==null?void 0:y.healthy)==null?void 0:g.interval)!==null&&((z=(C=c.healthchecks.active)==null?void 0:C.healthy)==null?void 0:z.interval)!==void 0?(X=(J=(K=c.healthchecks.active)==null?void 0:K.healthy)==null?void 0:J.interval)==null?void 0:X.toString():"0",h.activeHealthCheck.successes=((te=(R=c.healthchecks.active)==null?void 0:R.healthy)==null?void 0:te.successes)!==null&&((Be=(ge=c.healthchecks.active)==null?void 0:ge.healthy)==null?void 0:Be.successes)!==void 0?(el=(Xa=(Ga=c.healthchecks.active)==null?void 0:Ga.healthy)==null?void 0:Xa.successes)==null?void 0:el.toString():"0",h.activeHealthCheck.httpStatuses=(al=(tl=c.healthchecks.active)==null?void 0:tl.healthy)!=null&&al.http_statuses?l(((rl=(ll=c.healthchecks.active)==null?void 0:ll.healthy)==null?void 0:rl.http_statuses)||[]):mt,h.activeHealthCheck.unhealthyInterval=((ol=(nl=c.healthchecks.active)==null?void 0:nl.unhealthy)==null?void 0:ol.interval)!==null&&((sl=(il=c.healthchecks.active)==null?void 0:il.unhealthy)==null?void 0:sl.interval)!==void 0?(hl=(dl=(cl=c.healthchecks.active)==null?void 0:cl.unhealthy)==null?void 0:dl.interval)==null?void 0:hl.toString():"0",h.activeHealthCheck.httpFailures=((ul=(pl=c.healthchecks.active)==null?void 0:pl.unhealthy)==null?void 0:ul.http_failures)!==null&&((ml=(fl=c.healthchecks.active)==null?void 0:fl.unhealthy)==null?void 0:ml.http_failures)!==void 0?(kl=(yl=(gl=c.healthchecks.active)==null?void 0:gl.unhealthy)==null?void 0:yl.http_failures)==null?void 0:kl.toString():"0",h.activeHealthCheck.unhealthyTimeouts=((Cl=(bl=c.healthchecks.active)==null?void 0:bl.unhealthy)==null?void 0:Cl.timeouts)!==null&&((_l=(wl=c.healthchecks.active)==null?void 0:wl.unhealthy)==null?void 0:_l.timeouts)!==void 0?(Nl=(xl=(Sl=c.healthchecks.active)==null?void 0:Sl.unhealthy)==null?void 0:xl.timeouts)==null?void 0:Nl.toString():"0",h.activeHealthCheck.unhealthyHttpStatuses=(Bl=(Vl=c.healthchecks.active)==null?void 0:Vl.unhealthy)!=null&&Bl.http_statuses?l(((Tl=(Il=c.healthchecks.active)==null?void 0:Il.unhealthy)==null?void 0:Tl.http_statuses)||[]):yt,h.passiveHealthSwitch=((Hl=(Al=c.healthchecks.passive)==null?void 0:Al.healthy)==null?void 0:Hl.successes)!==0||((Fl=(El=c.healthchecks.passive)==null?void 0:El.unhealthy)==null?void 0:Fl.timeouts)!==0||((ql=(Ol=c.healthchecks.passive)==null?void 0:Ol.unhealthy)==null?void 0:ql.tcp_failures)!==0||((vl=(Ul=c.healthchecks.passive)==null?void 0:Ul.unhealthy)==null?void 0:vl.http_failures)!==0,h.passiveHealthCheck.type=(($l=c.healthchecks.passive)==null?void 0:$l.type)||"http",h.passiveHealthCheck.successes=((Ml=(Dl=c.healthchecks.passive)==null?void 0:Dl.healthy)==null?void 0:Ml.successes)!==null&&((Kl=(jl=c.healthchecks.passive)==null?void 0:jl.healthy)==null?void 0:Kl.successes)!==void 0?(Rl=(Ll=(Pl=c.healthchecks.passive)==null?void 0:Pl.healthy)==null?void 0:Ll.successes)==null?void 0:Rl.toString():"0",h.passiveHealthCheck.httpStatuses=(Jl=(zl=c.healthchecks.passive)==null?void 0:zl.healthy)!=null&&Jl.http_statuses?l(((Ql=(Wl=c.healthchecks.passive)==null?void 0:Wl.healthy)==null?void 0:Ql.http_statuses)||[]):gt,h.passiveHealthCheck.timeouts=((Zl=(Yl=c.healthchecks.passive)==null?void 0:Yl.unhealthy)==null?void 0:Zl.timeouts)!==null&&((Xl=(Gl=c.healthchecks.passive)==null?void 0:Gl.unhealthy)==null?void 0:Xl.timeouts)!==void 0?(ar=(tr=(er=c.healthchecks.passive)==null?void 0:er.unhealthy)==null?void 0:tr.timeouts)==null?void 0:ar.toString():"0",h.passiveHealthCheck.tcpFailures=((rr=(lr=c.healthchecks.passive)==null?void 0:lr.unhealthy)==null?void 0:rr.tcp_failures)!==null&&((or=(nr=c.healthchecks.passive)==null?void 0:nr.unhealthy)==null?void 0:or.tcp_failures)!==void 0?(cr=(sr=(ir=c.healthchecks.passive)==null?void 0:ir.unhealthy)==null?void 0:sr.tcp_failures)==null?void 0:cr.toString():"",h.passiveHealthCheck.unhealthyHttpStatuses=(hr=(dr=c.healthchecks.passive)==null?void 0:dr.unhealthy)!=null&&hr.http_statuses?l(((ur=(pr=c.healthchecks.passive)==null?void 0:pr.unhealthy)==null?void 0:ur.http_statuses)||[]):kt,h},getDefaultUpstreamFields:n,objectsAreEqual:(c,h)=>{try{return JSON.stringify(c)===JSON.stringify(h)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const de={useI18n:Xs,useMultiselectCreation:qe,useHelpers:Le},xe="/api/runtime_groups/{controlPlaneId}",Ne="/{workspace}",Ve={list:{konnect:`${xe}/upstreams`,kongManager:`${Ne}/upstreams`},form:{konnect:{getServices:`${xe}/services`,getCertificates:`${xe}/certificates`,validate:`${xe}/v1/schemas/json/upstream/validate`,create:`${xe}/upstreams`,edit:`${xe}/upstreams/{id}`},kongManager:{getServices:`${Ne}/services`,getCertificates:`${Ne}/certificates`,validate:`${Ne}/schemas/upstreams/validate`,create:`${Ne}/upstreams`,edit:`${Ne}/upstreams/{id}`}}},oc={class:"kong-ui-entities-upstreams-list"},ic={class:"upstream-name"},sc=t.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.createRoute||!e.getViewRoute||!e.getEditRoute||e.app==="kongManager"&&!e.isExactMatch&&!e.filterSchema)},cacheIdentifier:{type:String,default:""},canCreate:{type:Function,required:!1,default:async()=>!0},canDelete:{type:Function,required:!1,default:async()=>!0},canEdit:{type:Function,required:!1,default:async()=>!0},canRetrieve:{type:Function,required:!1,default:async()=>!0},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success"],setup(e,{emit:r}){var j;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),i=Je.useRouter(),{axiosInstance:o}=Ke({headers:(j=l.config)==null?void 0:j.requestHeaders}),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},p=h,u=t.computed(()=>{var v,P;let B=`${l.config.apiBaseUrl}${Ve.list[l.config.app]}`;return l.config.app==="konnect"?B=B.replace(/{controlPlaneId}/gi,((v=l.config)==null?void 0:v.controlPlaneId)||""):l.config.app==="kongManager"&&(B=B.replace(/\/{workspace}/gi,(P=l.config)!=null&&P.workspace?`/${l.config.workspace}`:"")),B}),f=t.ref(""),s=t.computed(()=>{const B=l.config.app==="konnect"||l.config.isExactMatch;if(B)return{isExactMatch:B,placeholder:n("upstreams.search.placeholder")};const{name:v,slots:P}=h;return{isExactMatch:B,fields:{name:v,slots:P},schema:l.config.filterSchema}}),{fetcher:S,fetcherState:b}=Ra(l.config,u.value),m=()=>{f.value=""},k=()=>{d.value++},x=t.ref(null),H=(B,v)=>{const P=B.id;if(!v(P)){a("copy:error",{entity:B,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:B,field:"id",message:n("upstreams.copy.success",{val:P})})},N=(B,v)=>{const P=JSON.stringify(B);if(!v(P)){a("copy:error",{entity:B,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:B,message:n("upstreams.copy.success_brief")})},A=async B=>{var P;await((P=l.canRetrieve)==null?void 0:P.call(l,B))&&i.push(l.config.getViewRoute(B.id))},F=B=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute(B)}),I=B=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute(B)}),V=t.ref(void 0),_=t.ref(!1),T=t.ref(!1),w=t.ref(""),E=Pa(l.config,u.value),$=B=>{V.value=B,_.value=!0},D=()=>{_.value=!1},U=async()=>{var B,v,P;if((B=V.value)!=null&&B.id){T.value=!0;try{await o.delete(E(V.value.id)),T.value=!1,_.value=!1,d.value++,a("delete:success",V.value)}catch(y){w.value=((P=(v=y.response)==null?void 0:v.data)==null?void 0:P.message)||y.message||n("upstreams.errors.delete"),a("error",y)}finally{T.value=!1}}},q=t.ref(!0);t.watch(b,B=>{var v,P,y,g;if(Array.isArray((v=B==null?void 0:B.response)==null?void 0:v.data)&&(q.value=B.response.data.length>0),B.status===pe.Error){x.value={title:n("upstreams.errors.general")},(g=(y=(P=B.error)==null?void 0:P.response)==null?void 0:y.data)!=null&&g.message&&(x.value.message=B.error.response.data.message),a("error",B.error);return}x.value=null});const M=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:n("upstreams.list.empty_state.description"),title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(M.value.title=n("upstreams.list.empty_state.title"),M.value.ctaText=n("upstreams.actions.create"))}),(B,v)=>{const P=t.resolveComponent("KButton"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KTruncate"),C=t.resolveComponent("KDropdownItem"),z=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",oc,[t.createVNode(t.unref(Ma),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":M.value,"enable-entity-actions":"","error-message":x.value,fetcher:t.unref(S),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onClearSearchInput:m,"onClick:row":v[1]||(v[1]=K=>A(K)),onSort:k},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(Ls),{modelValue:f.value,"onUpdate:modelValue":v[0]||(v[0]=K=>f.value=K),config:s.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(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(P,{appearance:"primary","data-testid":"toolbar-add-upstream",icon:"plus",to:e.config.createRoute},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[t.vShow,q.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),name:t.withCtx(({rowValue:K})=>[t.createElementVNode("span",ic,t.toDisplayString(K),1)]),tags:t.withCtx(({rowValue:K})=>[t.createVNode(g,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(K,J=>(t.openBlock(),t.createBlock(y,{key:J,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(J),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:K})=>[t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-id",onClick:X=>H(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(z,null,{default:t.withCtx(({copyToClipboard:J})=>[t.createVNode(C,{"data-testid":"action-entity-copy-json",onClick:X=>N(K,J)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canRetrieve(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-view","has-divider":"",item:F(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(K)},{default:t.withCtx(()=>[t.createVNode(C,{"data-testid":"action-entity-edit",item:I(K.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(K)},{default:t.withCtx(()=>[t.createVNode(C,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:J=>$(K)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","query","table-headers","use-action-outside"]),t.createVNode(t.unref(ja),{"action-pending":T.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":V.value&&(V.value.name||V.value.id),"entity-type":t.unref(We).Upstream,error:w.value,title:t.unref(n)("upstreams.delete.title"),visible:_.value,onCancel:D,onProceed:U},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),he=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},cc=he(sc,[["__scopeId","data-v-40e65380"]]),Re={list:{konnect:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",kongManager:"/{workspace}/upstreams/{upstreamId}/targets"},form:{konnect:{create:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets",edit:"/api/runtime_groups/{controlPlaneId}/upstreams/{upstreamId}/targets/{id}",validate:"/api/runtime_groups/{controlPlaneId}/v1/schemas/json/target/validate"},kongManager:{create:"/{workspace}/upstreams/{upstreamId}/targets",edit:"/{workspace}/upstreams/{upstreamId}/targets/{id}",validate:"/{workspace}/schemas/targets/validate"}}},dc={class:"kong-ui-entities-target-form"},hc={class:"target-form-container"},pc={key:0,class:"target-form-info"},Za=he(t.defineComponent({__name:"TargetForm",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.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(e,{emit:r}){var F;t.useCssVars(I=>({20454403:A.value}));const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{getMessageFromError:i}=La(),{axiosInstance:o}=Ke({headers:(F=l.config)==null?void 0:F.requestHeaders}),d=t.computed(()=>{var I;return Re.form[l.config.app].edit.replace(/{upstreamId}/gi,((I=l.config)==null?void 0:I.upstreamId)||"")}),c=t.computed(()=>l.targetId?oe.Edit:oe.Create),h=t.computed(()=>c.value===oe.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),p=t.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),u=t.reactive({target:"",weight:100,tags:""}),f={target:"",weight:100,tags:""},s=t.computed(()=>{const I=parseInt(p.fields.weight.toString(),10);return I<0||I>65535}),S=t.computed(()=>JSON.stringify(p.fields)!==JSON.stringify(u)&&!!p.fields.target&&!!p.fields.weight&&!s.value),b=I=>{var V;p.fields.target=(I==null?void 0:I.target)||"",p.fields.weight=(I==null?void 0:I.weight)??"",p.fields.tags=((V=I==null?void 0:I.tags)==null?void 0:V.join(", "))||"",Object.assign(u,p.fields)},m=()=>{p.errorMessage="",a("cancel")},k=t.computed(()=>{var V,_;let I=`${l.config.apiBaseUrl}${Re.form[l.config.app].validate}`;return l.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||""):l.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(_=l.config)!=null&&_.workspace?`/${l.config.workspace}`:"")),I=I.replace(/{id}/gi,l.targetId),I}),x=t.computed(()=>{var V,_,T,w;let I=`${l.config.apiBaseUrl}${Re.form[l.config.app][c.value]}`;return l.config.app==="konnect"?I=I.replace(/{controlPlaneId}/gi,((V=l.config)==null?void 0:V.controlPlaneId)||"").replace(/{upstreamId}/gi,((_=l.config)==null?void 0:_.upstreamId)||""):l.config.app==="kongManager"&&(I=I.replace(/\/{workspace}/gi,(T=l.config)!=null&&T.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||"")),I=I.replace(/{id}/gi,l.targetId),I}),H=t.computed(()=>{var I,V,_;return{target:p.fields.target,weight:parseInt(p.fields.weight),tags:(_=(V=(I=p.fields.tags)==null?void 0:I.split(","))==null?void 0:V.map(T=>String(T||"").trim()))==null?void 0:_.filter(T=>T!==""),upstream:{id:l.config.upstreamId}}}),N=async()=>{var I,V;try{p.isReadonly=!0,p.errorMessage="";let _;if(await o.post(k.value,H.value),c.value==="create"?_=await o.post(x.value,H.value):c.value==="edit"&&(_=((I=l.config)==null?void 0:I.app)==="konnect"?await o.put(x.value,H.value):await o.patch(x.value,H.value)),_){const{data:T}=_;p.fields.target=(T==null?void 0:T.name)||"",p.fields.weight=(T==null?void 0:T.weight)??100,p.fields.tags=((V=T==null?void 0:T.tags)==null?void 0:V.join(", "))||"",a("update",T),Object.assign(p.fields,f)}}catch(_){p.errorMessage=i(_),a("error",_)}finally{p.isReadonly=!1}},A=t.computed(()=>p.isReadonly?"inline-flex":"none");return t.watch(()=>l.targetId,()=>{Object.assign(p.fields,f)}),(I,V)=>{const _=t.resolveComponent("KInput"),T=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(T,{"action-button-text":t.unref(n)("targets.form.buttons.save"),"action-pending":!S.value||p.isReadonly,"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),"is-visible":e.isVisible,title:h.value,onCanceled:m,onProceed:N},{"body-content":t.withCtx(()=>[t.createElementVNode("div",dc,[t.createVNode(t.unref(Da),{config:e.config,"edit-id":e.targetId,"error-message":p.errorMessage,"fetch-url":d.value,"form-fields":H.value,"is-readonly":p.isReadonly,onCancel:m,"onFetch:error":V[3]||(V[3]=w=>I.$emit("error",w)),"onFetch:success":b,onLoading:V[4]||(V[4]=w=>I.$emit("loading",w))},{default:t.withCtx(()=>[t.createElementVNode("div",hc,[I.$slots.info?(t.openBlock(),t.createElementBlock("div",pc,[t.renderSlot(I.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(_,{modelValue:p.fields.target,"onUpdate:modelValue":V[0]||(V[0]=w=>p.fields.target=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:t.unref(n)("targets.form.fields.target.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.target.tooltip")},placeholder:t.unref(n)("targets.form.fields.target.placeholder"),readonly:p.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(_,{modelValue:p.fields.weight,"onUpdate:modelValue":V[1]||(V[1]=w=>p.fields.weight=w),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:s.value,"error-message":t.unref(n)("targets.errors.weight"),label:t.unref(n)("targets.form.fields.weight.label"),"label-attributes":{info:t.unref(n)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:p.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(_,{modelValue:p.fields.tags,"onUpdate:modelValue":V[2]||(V[2]=w=>p.fields.tags=w),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:t.unref(n)("targets.form.fields.tags.help"),label:t.unref(n)("targets.form.fields.tags.label"),placeholder:t.unref(n)("targets.form.fields.tags.placeholder"),readonly:p.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-text","action-pending","cancel-button-text","is-visible","title"])}}}),[["__scopeId","data-v-6947a9f4"]]),uc={class:"kong-ui-entities-targets-list"},fc={class:"target-address"},mc=he(t.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||!e.upstreamId||e.app==="kongManager"&&(typeof e.canMarkHealthy>"u"||typeof e.canMarkUnhealthy>"u"))},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},useActionOutside:{type:Boolean,default:!1}},emits:["error","copy:success","copy:error","delete:success","health-actions:healthy","health-actions:unhealthy","create:target","update:target"],setup(e,{emit:r}){var P;const a=r,l=e,{i18n:{t:n}}=de.useI18n(),{axiosInstance:i}=Ke({headers:(P=l.config)==null?void 0:P.requestHeaders}),o=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),h={target:{label:n("targets.list.table_headers.target_address"),sortable:!0},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},p=t.computed(()=>{var g,C,z,K;let y=`${l.config.apiBaseUrl}${Re.list[l.config.app]}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((g=l.config)==null?void 0:g.controlPlaneId)||"").replace(/{upstreamId}/gi,((C=l.config)==null?void 0:C.upstreamId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(z=l.config)!=null&&z.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((K=l.config)==null?void 0:K.upstreamId)||"")),y}),{fetcher:u,fetcherState:f}=Ra(l.config,p.value),s=()=>{o.value++},S=t.ref(null),b=()=>{M.value=!0},m=(y,g)=>{const C=y.id;if(!g(C)){a("copy:error",{entity:y,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:y,field:"id",message:n("targets.copy.success",{val:C})})},k=(y,g)=>{const C=JSON.stringify(y);if(!g(C)){a("copy:error",{entity:y,message:n("targets.errors.copy")});return}a("copy:success",{entity:y,message:n("targets.copy.success_brief")})},x=y=>{q.value=y,M.value=!0},H=y=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(y),N=y=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(y),A=t.ref(void 0),F=t.ref(!1),I=t.ref(!1),V=t.ref(""),_=Pa(l.config,p.value),T=y=>{A.value=y,F.value=!0},w=()=>{F.value=!1},E=async()=>{var y,g,C;if((y=A.value)!=null&&y.id){I.value=!0;try{await i.delete(_(A.value.id)),I.value=!1,F.value=!1,o.value++,a("delete:success",A.value)}catch(z){V.value=((C=(g=z.response)==null?void 0:g.data)==null?void 0:C.message)||z.message||n("targets.errors.delete"),a("error",z)}finally{I.value=!1}}},$=t.ref(!0);t.watch(f,y=>{var g,C,z,K;if(Array.isArray((g=y==null?void 0:y.response)==null?void 0:g.data)&&($.value=y.response.data.length>0),y.status===pe.Error){S.value={title:n("targets.errors.general")},(K=(z=(C=y.error)==null?void 0:C.response)==null?void 0:z.data)!=null&&K.message&&(S.value.message=y.error.response.data.message),a("error",y.error);return}S.value=null});const D=t.ref({ctaText:void 0,message:n("targets.list.empty_state.description"),title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(D.value.title=n("targets.list.empty_state.title"),D.value.ctaText=n("targets.actions.create"))});const U=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace,requestHeaders:l.config.requestHeaders}})),q=t.ref(""),M=t.ref(!1),j=y=>{q.value?a("update:target",y):a("create:target",y),B()},B=()=>{v(),o.value++},v=()=>{M.value=!1,q.value=""};return(y,g)=>{const C=t.resolveComponent("KButton"),z=t.resolveComponent("KBadge"),K=t.resolveComponent("KTruncate"),J=t.resolveComponent("KDropdownItem"),X=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",uc,[t.createVNode(t.unref(Ma),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":D.value,"enable-entity-actions":"","error-message":S.value,fetcher:t.unref(u),"fetcher-cache-key":o.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:g[1]||(g[1]=()=>l.config.createRoute?void 0:b()),onSort:s},{"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(ce),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(C,{appearance:"primary","data-testid":"toolbar-new-target",icon:"plus",to:l.config.createRoute?l.config.createRoute:void 0,onClick:g[0]||(g[0]=()=>l.config.createRoute?void 0:b())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,$.value]])]),_:1},8,["auth-function"])]),_:1},8,["to"]))]),target:t.withCtx(({rowValue:R})=>[t.createElementVNode("span",fc,t.toDisplayString(R),1)]),tags:t.withCtx(({rowValue:R})=>[t.createVNode(K,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(R,te=>(t.openBlock(),t.createBlock(z,{key:te,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(te),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:R})=>[t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-id",onClick:ge=>m(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(X,null,{default:t.withCtx(({copyToClipboard:te})=>[t.createVNode(J,{"data-testid":"action-entity-copy-json",onClick:ge=>k(R,te)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(ce),{"auth-function":()=>e.canEdit(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-entity-edit","has-divider":"",onClick:te=>x(R.id)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>H(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-healthy",onClick:te=>a("health-actions:healthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>N(R)},{default:t.withCtx(()=>[t.createVNode(J,{"data-testid":"action-target-mark-unhealthy",onClick:te=>a("health-actions:unhealthy",R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(ce),{"auth-function":()=>e.canDelete(R)},{default:t.withCtx(()=>[t.createVNode(J,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:te=>T(R)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.delete")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"])]),_:1},8,["cache-identifier","disable-sorting","empty-state-options","error-message","fetcher","fetcher-cache-key","table-headers","use-action-outside"]),t.createVNode(t.unref(ja),{"action-pending":I.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(We).Target,error:V.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:F.value,onCancel:w,onProceed:E},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(Za,{config:U.value,"is-visible":M.value,"target-id":q.value,onCancel:v,onUpdate:j},t.createSlots({_:2},[y.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-6e346906"]]),gc={key:1},yc=he(t.defineComponent({__name:"UpstreamsFormGeneralInfo",props:{config:{type:Object,required:!0},name:{type:String,required:!0},hostHeader:{type:String,required:!0},clientCertificate:{type:String,required:!0},tags:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:name","update:host-header","update:client-certificate","update:tags"],setup(e,{emit:r}){var w,E,$,D;const{i18nT:a,i18n:{t:l}}=de.useI18n(),n=e,i=r,{debouncedQueryChange:o,loading:d,loadItems:c,results:h,allRecords:p}=za(n.config,(E=Ve.form[(w=n.config)==null?void 0:w.app])==null?void 0:E.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:S}=za(n.config,(D=Ve.form[($=n.config)==null?void 0:$.app])==null?void 0:D.getCertificates),b=t.ref(""),m=t.computed(()=>{var U;return!!n.name&&!((U=p.value)!=null&&U.some(q=>q.host===n.name))}),k=t.computed(()=>{var q,M,j;const U=m.value&&n.name.includes((q=b.value)==null?void 0:q.toLowerCase());return(j=h.value)==null?void 0:j.map(B=>({label:B.host,value:B.id})).concat(U?[{label:n.name,value:((M=N.value)==null?void 0:M.value)||n.name}]:[])}),x=t.computed(()=>{var U;return(U=S.value)==null?void 0:U.map(q=>({label:q.id,value:q.id}))}),H=t.ref(""),N=t.ref({value:"",label:""}),A=t.computed(()=>{var U,q;return((U=k.value.find(M=>M.value===H.value))==null?void 0:U.label)||((q=N.value)==null?void 0:q.label)}),F=U=>{b.value=U,o(U)},I=U=>{N.value=U},V=()=>{N.value={value:"",label:""}},_=U=>{H.value=U,i("update:name",A.value)},T=t.ref(!1);return t.onBeforeMount(async()=>{var U,q;try{T.value=!0,await c(),n.name&&(H.value=((q=(U=k.value.find(M=>M.label===n.name))==null?void 0:U.value)==null?void 0:q.toString())||n.name),await s()}finally{T.value=!1}}),(U,q)=>{const M=t.resolveComponent("KSkeleton"),j=t.resolveComponent("KSelect"),B=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-general-info",description:t.unref(l)("upstreams.form.general_info.help"),title:t.unref(l)("upstreams.form.general_info.title")},{default:t.withCtx(()=>[T.value?(t.openBlock(),t.createBlock(M,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",gc,[t.createVNode(j,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:k.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":H.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:I,onItemRemoved:V,onQueryChange:F,"onUpdate:modelValue":_},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),t.createVNode(B,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:t.unref(l)("upstreams.form.fields.host_header.label"),"model-value":e.hostHeader,readonly:e.readonly,type:"text","onUpdate:modelValue":q[0]||(q[0]=v=>i("update:host-header",v))},null,8,["label","model-value","readonly"]),t.createVNode(j,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:x.value,label:t.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:t.unref(f),"model-value":e.clientCertificate,placeholder:t.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:e.readonly,width:"100%",onQueryChange:t.unref(u),"onUpdate:modelValue":q[1]||(q[1]=v=>i("update:client-certificate",v))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode(B,{autocomplete:"off","data-testid":"upstreams-form-tags",help:t.unref(l)("upstreams.form.fields.tags.help"),label:t.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:t.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":e.tags,placeholder:t.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:e.readonly,type:"text","onUpdate:modelValue":q[2]||(q[2]=v=>i("update:tags",v))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),ze={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},kc={class:"fields-group-title"},bc={class:"fields-group-text"},Cc={class:"fields-group-title"},wc={class:"fields-group-text"},_c=he(t.defineComponent({__name:"UpstreamsFormLoadBalancing",props:{algorithm:{type:String,required:!0},slots:{type:String,required:!0},hashOn:{type:String,required:!0},hashFallback:{type:String,required:!0},hashOnHeader:{type:String,required:!0},hashOnCookie:{type:String,required:!0},hashOnCookiePath:{type:String,required:!0},hashOnQueryArgument:{type:String,required:!0},hashOnUriCapture:{type:String,required:!0},hashFallbackHeader:{type:String,required:!0},hashFallbackQueryArgument:{type:String,required:!0},hashFallbackUriCapture:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:algorithm","update:slots","update:hash-on","update:hash-fallback","update:hash-on-header","update:hash-on-cookie","update:hash-on-cookie-path","update:hash-on-query-argument","update:hash-on-uri-capture","update:hash-fallback-header","update:hash-fallback-query-argument","update:hash-fallback-uri-capture"],setup(e,{emit:r}){const{i18nT:a,i18n:{t:l}}=de.useI18n(),{inRange:n}=Le(),i=e,o=r,d=t.ref([{label:l("upstreams.form.algorithms.round_robin_label"),value:"round-robin",selected:!1},{label:l("upstreams.form.algorithms.least_connections_label"),value:"least-connections",selected:!1},{label:l("upstreams.form.algorithms.consistent_hashing_label"),value:"consistent-hashing",selected:!1},{label:l("upstreams.form.algorithms.latency_label"),value:"latency",selected:!1}]),c=t.ref([{label:l("upstreams.form.hash_labels.none"),value:"none",selected:!1},{label:l("upstreams.form.hash_labels.consumer"),value:"consumer",selected:!1},{label:l("upstreams.form.hash_labels.ip"),value:"ip",selected:!1},{label:l("upstreams.form.hash_labels.header"),value:"header",selected:!1},{label:l("upstreams.form.hash_labels.cookie"),value:"cookie",selected:!1},{label:l("upstreams.form.hash_labels.path"),value:"path",selected:!1},{label:l("upstreams.form.hash_labels.query_argument"),value:"query_arg",selected:!1},{label:l("upstreams.form.hash_labels.uri_capture"),value:"uri_capture",selected:!1}]);t.watch(()=>i.hashOn,(u,f)=>{f==="header"&&u!==f&&o("update:hash-on-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(o("update:hash-fallback","none"),o("update:hash-fallback-header",""),o("update:hash-fallback-query-argument",""),o("update:hash-fallback-uri-capture",""))}),t.watch(()=>i.hashFallback,(u,f)=>{f==="header"&&u!==f&&o("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(o("update:hash-on-cookie",""),o("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&o("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&o("update:hash-fallback-uri-capture","")});const h=t.computed(()=>i.hashOn==="cookie"||i.hashOn==="none"),p=t.computed(()=>i.slots?n(i.slots,ut,ft)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),S=t.resolveComponent("KSelect"),b=t.resolveComponent("KInput"),m=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-load-balancing",title:t.unref(l)("upstreams.form.load_balancing.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.load_balancing.help"))+" ",1),t.createVNode(s,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(S,{class:"algorithm-select",items:d.value,label:t.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":e.algorithm,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[0]||(f[0]=k=>o("update:algorithm",k))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!p.value,"error-message":p.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(ft),min:t.unref(ut),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=k=>o("update:slots",k))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",kc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",bc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(S,{class:"hash-on-select",items:c.value,label:t.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":e.hashOn,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[2]||(f[2]=k=>o("update:hash-on",k))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashOnHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[3]||(f[3]=k=>o("update:hash-on-header",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[4]||(f[4]=k=>o("update:hash-on-cookie",k))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[5]||(f[5]=k=>o("update:hash-on-cookie-path",k))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashOnQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[6]||(f[6]=k=>o("update:hash-on-query-argument",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashOnUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[7]||(f[7]=k=>o("update:hash-on-uri-capture",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(m,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Cc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",wc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(S,{class:"hash-fallback-select",disabled:h.value,items:c.value,label:t.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":e.hashFallback,readonly:e.readonly,width:"100%","onUpdate:modelValue":f[8]||(f[8]=k=>o("update:hash-fallback",k))},{"label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(a),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),e.hashFallback==="header"?(t.openBlock(),t.createBlock(b,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:t.unref(l)("upstreams.form.fields.header.label"),"model-value":e.hashFallbackHeader,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[9]||(f[9]=k=>o("update:hash-fallback-header",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:t.unref(l)("upstreams.form.fields.cookie.label"),"model-value":e.hashOnCookie,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[10]||(f[10]=k=>o("update:hash-on-cookie",k))},null,8,["label","model-value","readonly"]),t.createVNode(b,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:t.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":e.hashOnCookiePath,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[11]||(f[11]=k=>o("update:hash-on-cookie-path",k))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(b,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:t.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":e.hashFallbackQueryArgument,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[12]||(f[12]=k=>o("update:hash-fallback-query-argument",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(b,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:t.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":e.hashFallbackUriCapture,readonly:e.readonly,required:"",type:"text","onUpdate:modelValue":f[13]||(f[13]=k=>o("update:hash-fallback-uri-capture",k))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),Sc={class:"fields-group-title"},xc={class:"fields-group-text"},Nc={class:"fields-group-title"},Vc={class:"fields-group-text"},Bc=he(t.defineComponent({__name:"UpstreamsFormHealthChecks",props:{activeHealthSwitch:{type:Boolean,required:!0},passiveHealthSwitch:{type:Boolean,required:!0},healthchecksThreshold:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:active-health-switch","update:passive-health-switch","update:healthchecks-threshold"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=r;return(n,i)=>{const o=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),h=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-healthchecks",title:t.unref(a)("upstreams.form.health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.health_check.help"))+" ",1),t.createVNode(o,{"hide-icon":"",href:t.unref(ze).loadBalancing},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Sc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",xc,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.help")),1),t.createVNode(d,{class:"active-health-switch","data-testid":"active-health-switch",disabled:e.readonly,"model-value":e.activeHealthSwitch,onChange:i[0]||(i[0]=p=>l("update:active-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Nc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",Vc,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.help")),1),t.createVNode(d,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:e.readonly,"model-value":e.passiveHealthSwitch,onChange:i[1]||(i[1]=p=>l("update:passive-health-switch",p))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(h,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(tc),min:t.unref(ec),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":i[2]||(i[2]=p=>l("update:healthchecks-threshold",p))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),Ic={key:2},Tc={class:"fields-group-title"},Ac={class:"fields-group-text"},Hc={class:"fields-group-title"},Ec={class:"fields-group-text"},Fc=he(t.defineComponent({__name:"UpstreamsFormActiveHealthCheck",props:{config:{type:Object,required:!0},type:{type:String,required:!0},httpPath:{type:String,required:!0},timeout:{type:String,required:!0},concurrency:{type:String,required:!0},httpsSni:{type:String,required:!0},verifySsl:{type:Boolean,required:!0},headers:{type:Array,required:!0},interval:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},unhealthyInterval:{type:String,required:!0},httpFailures:{type:String,required:!0},tcpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},unhealthyTimeouts:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:http-path","update:timeout","update:concurrency","update:https-sni","update:verify-ssl","update:headers","update:interval","update:successes","update:http-statuses","update:unhealthy-interval","update:http-failures","update:tcp-failures","update:unhealthy-http-statuses","update:unhealthy-timeouts"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),{objectsAreEqual:l}=Le(),n=e,i=r,o=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:h}=qe({replaceId:!0}),{trackNewItems:p}=qe({replaceId:!0});t.watch(()=>n.type,(b,m)=>{m==="tcp"&&b!==m&&i("update:tcp-failures","5"),(m==="https"||m==="grpcs")&&b!==m&&(i("update:https-sni",""),i("update:verify-ssl",!1)),m!=="tcp"&&b==="tcp"&&(i("update:http-path","/"),i("update:http-statuses",mt),i("update:unhealthy-http-statuses",yt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,b=>{l(u.value,b)||(u.value=[...b])},{immediate:!0,deep:!0});const f=()=>{i("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},S=b=>{b===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(b,1),f()};return(b,m)=>{const k=t.resolveComponent("KExternalLink"),x=t.resolveComponent("KSelect"),H=t.resolveComponent("KInput"),N=t.resolveComponent("KCheckbox"),A=t.resolveComponent("KLabel"),F=t.resolveComponent("KIcon"),I=t.resolveComponent("KButton"),V=t.resolveComponent("KMultiselect"),_=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-active-healthcheck",title:t.unref(a)("upstreams.form.active_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.active_health_check.help"))+" ",1),t.createVNode(k,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var T;return[t.createVNode(x,{class:"active-healthcheck-type-select",items:o.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":m[0]||(m[0]=w=>i("update:type",w))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(H,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:t.unref(a)("upstreams.form.fields.http_path.label"),"model-value":e.httpPath,readonly:e.readonly,type:"text","onUpdate:modelValue":m[1]||(m[1]=w=>i("update:http-path",w))},null,8,["label","model-value","readonly"])),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(lc),min:t.unref(ac),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":m[2]||(m[2]=w=>i("update:timeout",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(nc),min:t.unref(rc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":m[3]||(m[3]=w=>i("update:concurrency",w))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:t.unref(a)("upstreams.form.fields.https_sni.label"),"model-value":e.httpsSni,readonly:e.readonly,type:"text","onUpdate:modelValue":m[4]||(m[4]=w=>i("update:https-sni",w))},null,8,["label","model-value","readonly"]),t.createVNode(N,{"data-testid":"active-healthcheck-verify-ssl",disabled:e.readonly,label:t.unref(a)("upstreams.form.fields.verify_ssl.label"),"model-value":e.verifySsl,"onUpdate:modelValue":m[5]||(m[5]=w=>i("update:verify-ssl",w))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((T=e.config)==null?void 0:T.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",Ic,[t.createVNode(A,{info:t.unref(a)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(w,E)=>(t.openBlock(),t.createElementBlock("div",{key:`${w.header}_${E}`,class:t.normalizeClass(["headers-row",{"margin-top-6":E>0}])},[t.createVNode(H,{modelValue:u.value[E].key,"onUpdate:modelValue":$=>u.value[E].key=$,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${E+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(H,{modelValue:u.value[E].values,"onUpdate:modelValue":$=>u.value[E].values=$,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${E+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(I,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",onClick:$=>S(E)},{icon:t.withCtx(()=>[t.createVNode(F,{class:"delete-item",icon:"trash"})]),_:2},1032,["onClick"]),u.value&&E===u.value.length-1?(t.openBlock(),t.createBlock(I,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",onClick:s},{icon:t.withCtx(()=>[t.createVNode(F,{color:"$kui-color-text-primary-strong",icon:"plus",size:"22"})]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Tc,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",Ac,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Ya),min:t.unref(Qa),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[6]||(m[6]=w=>i("update:interval",w))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":m[7]||(m[7]=w=>i("update:successes",w))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(V,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[8]||(m[8]=w=>t.unref(h)(w,!0)),onItemRemoved:m[9]||(m[9]=w=>t.unref(h)(w,!1)),"onUpdate:modelValue":m[10]||(m[10]=w=>i("update:http-statuses",w))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Hc,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",Ec,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:t.unref(a)("upstreams.form.fields.interval.help"),label:t.unref(a)("upstreams.form.fields.interval.label"),max:t.unref(Ya),min:t.unref(Qa),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":m[11]||(m[11]=w=>i("update:unhealthy-interval",w))},null,8,["help","label","max","min","model-value","readonly"]),c.value?(t.openBlock(),t.createBlock(H,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[12]||(m[12]=w=>i("update:tcp-failures",w))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(H,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":m[13]||(m[13]=w=>i("update:http-failures",w))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(V,{autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:m[14]||(m[14]=w=>t.unref(p)(w,!0)),onItemRemoved:m[15]||(m[15]=w=>t.unref(p)(w,!1)),"onUpdate:modelValue":m[16]||(m[16]=w=>i("update:unhealthy-http-statuses",w))},null,8,["items","label","model-value","readonly"])],64)),t.createVNode(H,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Wa),min:t.unref(Ja),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":m[17]||(m[17]=w=>i("update:unhealthy-timeouts",w))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-9e6394cf"]]),Oc={class:"fields-group-title"},qc={class:"fields-group-text"},Uc={class:"fields-group-title"},vc={class:"fields-group-text"},$c=he(t.defineComponent({__name:"UpstreamsFormPassiveHealthCheck",props:{type:{type:String,required:!0},successes:{type:String,required:!0},httpStatuses:{type:Array,required:!0},timeouts:{type:String,required:!0},httpFailures:{type:String,required:!0},unhealthyHttpStatuses:{type:Array,required:!0},tcpFailures:{type:String,required:!0},readonly:{type:Boolean,required:!1,default:!1}},emits:["update:type","update:successes","update:http-statuses","update:timeouts","update:http-failures","update:unhealthy-http-statuses","update:tcp-failures"],setup(e,{emit:r}){const{i18n:{t:a}}=de.useI18n(),l=e,n=r,i=t.ref([{label:a("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:a("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),o=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=qe({replaceId:!0}),{trackNewItems:c}=qe({replaceId:!0});return t.watch(()=>l.type,(h,p)=>{p==="tcp"&&h!==p&&n("update:tcp-failures","5"),p!=="tcp"&&h==="tcp"&&(n("update:http-statuses",gt),n("update:unhealthy-http-statuses",kt))}),(h,p)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),S=t.resolveComponent("KMultiselect"),b=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Oe),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:t.unref(a)("upstreams.form.passive_health_check.title")},{description:t.withCtx(()=>[t.createElementVNode("p",null,[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.passive_health_check.help"))+" ",1),t.createVNode(u,{"hide-icon":"",href:t.unref(ze).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>[t.createVNode(f,{class:"passive-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=m=>n("update:type",m))},null,8,["items","label","model-value","readonly"]),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Oc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",qc,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=m=>n("update:successes",m))},null,8,["label","max","min","model-value","readonly"]),o.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(S,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[2]||(p[2]=m=>t.unref(d)(m,!0)),onItemRemoved:p[3]||(p[3]=m=>t.unref(d)(m,!1)),"onUpdate:modelValue":p[4]||(p[4]=m=>n("update:http-statuses",m))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(b,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Uc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",vc,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.help")),1),t.createVNode(s,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(Wa),min:t.unref(Ja),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":p[5]||(p[5]=m=>n("update:timeouts",m))},null,8,["label","max","min","model-value","readonly"]),o.value?(t.openBlock(),t.createBlock(s,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:t.unref(a)("upstreams.form.fields.tcp_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[6]||(p[6]=m=>n("update:tcp-failures",m))},null,8,["label","max","min","model-value","readonly"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(s,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:t.unref(a)("upstreams.form.fields.http_failures.label"),max:t.unref(Se),min:t.unref(_e),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":p[7]||(p[7]=m=>n("update:http-failures",m))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(S,{autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Pe),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:p[8]||(p[8]=m=>t.unref(c)(m,!0)),onItemRemoved:p[9]||(p[9]=m=>t.unref(c)(m,!1)),"onUpdate:modelValue":p[10]||(p[10]=m=>n("update:unhealthy-http-statuses",m))},null,8,["items","label","model-value","readonly"])],64))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-cca8adae"]]),Dc={class:"kong-ui-entities-upstreams-form"},Mc=he(t.defineComponent({__name:"UpstreamsForm",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))},upstreamId:{type:String,required:!1,default:""}},emits:["update","error","loading"],setup(e,{emit:r}){var P;const a=e,l=r,{inRange:n,stringToNumberArray:i,upstreamsResponseToFields:o,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:h}=Le(),{axiosInstance:p}=Ke({headers:(P=a.config)==null?void 0:P.requestHeaders}),{getMessageFromError:u}=La(),f=Je.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),S=t.reactive(d()),b=t.computed(()=>!c(s.fields,S)),m=y=>{s.fields.activeHealthCheck.interval=y?"5":"0",s.fields.activeHealthCheck.successes=y?"5":"0",s.fields.activeHealthCheck.httpFailures=y?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=y?"5":"0"},k=y=>{s.fields.passiveHealthCheck.timeouts=y?"5":"0",s.fields.passiveHealthCheck.successes=y?"80":"0"},x=t.computed(()=>s.fields.slots?n(s.fields.slots,ut,ft):!0),H=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),N=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),F=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),I=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),V=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),_=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),T=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),w=t.computed(()=>!!s.fields.name&&x.value&&H.value&&N.value&&A.value&&F.value&&I.value&&V.value&&_.value&&T.value),E=t.computed(()=>a.upstreamId?oe.Edit:oe.Create),$=t.computed(()=>{var y,g;return(g=Ve.form[(y=a.config)==null?void 0:y.app])==null?void 0:g.edit}),D=y=>{Object.assign(s.fields,o(y)),Object.assign(S,h(s.fields))},U=()=>{var y;f.push(((y=a.config)==null?void 0:y.cancelRoute)||{name:"upstreams-list"})},q=y=>{l("loading",y)},M=y=>{l("error",y)},j=t.computed(()=>{var g,C,z,K,J;const y={name:s.fields.name,slots:Number(s.fields.slots),algorithm:s.fields.algorithm,hash_on:s.fields.hashOn,hash_fallback:s.fields.hashFallback,healthchecks:{}};return s.fields.hostHeader&&(y.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(y.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(y.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(y.tags=(C=(g=s.fields.tags.split(","))==null?void 0:g.map(X=>String(X||"").trim()))==null?void 0:C.filter(X=>X!=="")),s.fields.hashOn==="header"&&(y.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(y.hash_on_cookie=s.fields.hashOnCookie,y.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(y.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(y.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(y.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(y.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(y.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(y.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(y.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(y.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(y.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((z=a.config)==null?void 0:z.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?y.healthchecks.active.headers=[]:y.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((X,R)=>{var te,ge;return R.key?{...X,[R.key]:(ge=(te=R.values.split(","))==null?void 0:te.map(Be=>String(Be||"").trim()))==null?void 0:ge.filter(Be=>Be!=="")}:{...X}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(y.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(y.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(y.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(y.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(y.healthchecks.active.healthy.http_statuses=i(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(y.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(y.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.active.unhealthy.http_statuses=i(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(y.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.type==="tcp"&&s.fields.activeHealthCheck.tcpFailures&&(y.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((K=a.config)==null?void 0:K.app)==="kongManager"&&E.value===oe.Edit&&(y.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0},unhealthy:{interval:0}}),s.fields.passiveHealthSwitch?(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(y.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(y.healthchecks.passive.healthy.http_statuses=i(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(y.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(y.healthchecks.passive.unhealthy.http_statuses=i(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(y.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.type==="tcp"&&s.fields.passiveHealthCheck.tcpFailures&&(y.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((J=a.config)==null?void 0:J.app)==="kongManager"&&E.value===oe.Edit&&(y.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),y}),B=y=>{var C,z,K,J,X,R;let g=`${(C=a.config)==null?void 0:C.apiBaseUrl}${Ve.form[(z=a.config)==null?void 0:z.app][y]}`;return((K=a.config)==null?void 0:K.app)==="konnect"?g=g.replace(/{controlPlaneId}/gi,((J=a.config)==null?void 0:J.controlPlaneId)||""):((X=a.config)==null?void 0:X.app)==="kongManager"&&(g=g.replace(/\/{workspace}/gi,(R=a.config)!=null&&R.workspace?`/${a.config.workspace}`:"")),g=g.replace(/{id}/gi,a.upstreamId),g},v=async()=>{var y;try{s.readonly=!0,await p.post(B("validate"),j.value);let g;E.value===oe.Create?g=await p.post(B("create"),j.value):E.value===oe.Edit&&(g=((y=a.config)==null?void 0:y.app)==="konnect"?await p.put(B("edit"),j.value):await p.patch(B("edit"),j.value)),l("update",g==null?void 0:g.data)}catch(g){s.errorMessage=u(g),l("error",g)}finally{s.readonly=!1}};return(y,g)=>(t.openBlock(),t.createElementBlock("div",Dc,[t.createVNode(t.unref(Da),{"can-submit":w.value&&b.value,config:e.config,"edit-id":e.upstreamId,"error-message":s.errorMessage,"fetch-url":$.value,"form-fields":j.value,"is-readonly":s.readonly,onCancel:U,"onFetch:error":M,"onFetch:success":D,onLoading:q,onSubmit:v},{default:t.withCtx(()=>[t.createVNode(yc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":g[0]||(g[0]=C=>s.fields.clientCertificate=C),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":g[1]||(g[1]=C=>s.fields.hostHeader=C),name:s.fields.name,"onUpdate:name":g[2]||(g[2]=C=>s.fields.name=C),tags:s.fields.tags,"onUpdate:tags":g[3]||(g[3]=C=>s.fields.tags=C),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(_c,{algorithm:s.fields.algorithm,"onUpdate:algorithm":g[4]||(g[4]=C=>s.fields.algorithm=C),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":g[5]||(g[5]=C=>s.fields.hashFallback=C),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":g[6]||(g[6]=C=>s.fields.hashFallbackHeader=C),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":g[7]||(g[7]=C=>s.fields.hashFallbackQueryArgument=C),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":g[8]||(g[8]=C=>s.fields.hashFallbackUriCapture=C),"hash-on":s.fields.hashOn,"onUpdate:hashOn":g[9]||(g[9]=C=>s.fields.hashOn=C),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":g[10]||(g[10]=C=>s.fields.hashOnCookie=C),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":g[11]||(g[11]=C=>s.fields.hashOnCookiePath=C),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":g[12]||(g[12]=C=>s.fields.hashOnHeader=C),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":g[13]||(g[13]=C=>s.fields.hashOnQueryArgument=C),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":g[14]||(g[14]=C=>s.fields.hashOnUriCapture=C),slots:s.fields.slots,"onUpdate:slots":g[15]||(g[15]=C=>s.fields.slots=C),readonly:s.readonly},null,8,["algorithm","hash-fallback","hash-fallback-header","hash-fallback-query-argument","hash-fallback-uri-capture","hash-on","hash-on-cookie","hash-on-cookie-path","hash-on-header","hash-on-query-argument","hash-on-uri-capture","slots","readonly"]),t.createVNode(Bc,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[g[16]||(g[16]=C=>s.fields.activeHealthSwitch=C),m],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":g[17]||(g[17]=C=>s.fields.healthchecksThreshold=C),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[g[18]||(g[18]=C=>s.fields.passiveHealthSwitch=C),k],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(Fc,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":g[19]||(g[19]=C=>s.fields.activeHealthCheck.concurrency=C),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":g[20]||(g[20]=C=>s.fields.activeHealthCheck.headers=C),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":g[21]||(g[21]=C=>s.fields.activeHealthCheck.httpFailures=C),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":g[22]||(g[22]=C=>s.fields.activeHealthCheck.httpPath=C),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[23]||(g[23]=C=>s.fields.activeHealthCheck.httpStatuses=C),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":g[24]||(g[24]=C=>s.fields.activeHealthCheck.httpsSni=C),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":g[25]||(g[25]=C=>s.fields.activeHealthCheck.interval=C),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":g[26]||(g[26]=C=>s.fields.activeHealthCheck.successes=C),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[27]||(g[27]=C=>s.fields.activeHealthCheck.tcpFailures=C),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":g[28]||(g[28]=C=>s.fields.activeHealthCheck.timeout=C),type:s.fields.activeHealthCheck.type,"onUpdate:type":g[29]||(g[29]=C=>s.fields.activeHealthCheck.type=C),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[30]||(g[30]=C=>s.fields.activeHealthCheck.unhealthyHttpStatuses=C),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":g[31]||(g[31]=C=>s.fields.activeHealthCheck.unhealthyInterval=C),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":g[32]||(g[32]=C=>s.fields.activeHealthCheck.unhealthyTimeouts=C),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":g[33]||(g[33]=C=>s.fields.activeHealthCheck.verifySsl=C),config:e.config,readonly:s.readonly},null,8,["concurrency","headers","http-failures","http-path","http-statuses","https-sni","interval","successes","tcp-failures","timeout","type","unhealthy-http-statuses","unhealthy-interval","unhealthy-timeouts","verify-ssl","config","readonly"])):t.createCommentVNode("",!0),s.fields.passiveHealthSwitch?(t.openBlock(),t.createBlock($c,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":g[34]||(g[34]=C=>s.fields.passiveHealthCheck.httpFailures=C),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":g[35]||(g[35]=C=>s.fields.passiveHealthCheck.httpStatuses=C),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":g[36]||(g[36]=C=>s.fields.passiveHealthCheck.successes=C),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":g[37]||(g[37]=C=>s.fields.passiveHealthCheck.tcpFailures=C),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":g[38]||(g[38]=C=>s.fields.passiveHealthCheck.timeouts=C),type:s.fields.passiveHealthCheck.type,"onUpdate:type":g[39]||(g[39]=C=>s.fields.passiveHealthCheck.type=C),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":g[40]||(g[40]=C=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=C),readonly:s.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):t.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-05687a98"]]),jc=t.createElementVNode("code",null,"10",-1),Kc=t.createElementVNode("code",null,"65536",-1),Pc={"data-testid":"client_certificate-plain-text"},Lc=t.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:e=>!(!e||!["konnect","kongManager"].includes(e==null?void 0:e.app)||e.app==="konnect"&&!e.controlPlaneId||e.app==="kongManager"&&typeof e.workspace!="string"||!e.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success","copy:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=de.useI18n(),{getPropValue:n}=Zs(),i=t.computed(()=>Ve.form[r.config.app].edit),o=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:W.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:W.Basic},hash_on:{order:7,section:W.Basic},hash_on_header:{order:8,section:W.Basic},hash_on_uri_capture:{order:9,section:W.Basic},hash_on_query_arg:{order:10,section:W.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:W.Basic},hash_on_cookie_path:{order:12,section:W.Basic},healthchecks:{order:13,section:W.Basic,type:L.Json},tags:{order:14,tooltip:a("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${a("upstreams.form.fields.hash_fallback.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_fallback_uri_capture:{order:4},host_header:{order:5},use_srv_name:{order:6},client_certificate:{order:7,tooltip:a("upstreams.form.hash_tooltips.client_certificate")}});return(d,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(t.unref(ys),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":o.value,"fetch-url":i.value,"hide-title":e.hideTitle,"onCopy:success":c[0]||(c[0]=h=>d.$emit("copy:success",h)),"onFetch:error":c[1]||(c[1]=h=>d.$emit("fetch:error",h)),"onFetch:success":c[2]||(c[2]=h=>d.$emit("fetch:success",h)),onLoading:c[3]||(c[3]=h=>d.$emit("loading",h))},{"name-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":t.withCtx(({row:h})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(h.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:t.withCtx(()=>[jc]),max:t.withCtx(()=>[Kc]),_:1})]),"hash_fallback-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":t.withCtx(()=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(t.unref(a)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:t.withCtx(h=>{var p;return[t.createElementVNode("div",null,[t.createElementVNode("div",Pc,[t.createElementVNode("span",null,t.toDisplayString((p=t.unref(n)("rowValue",h))==null?void 0:p.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","fetch-url","hide-title"])]))}});ae.TargetForm=Za,ae.TargetsList=mc,ae.UpstreamsConfigCard=Lc,ae.UpstreamsForm=Mc,ae.UpstreamsList=cc,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-upstreams-targets",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-upstreams-targets.umd.js",
|
|
6
6
|
"module": "./dist/entities-upstreams-targets.es.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"errorLimit": "900KB"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@kong-ui-public/entities-shared": "^2.5.
|
|
53
|
+
"@kong-ui-public/entities-shared": "^2.5.3"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "cross-env USE_SANDBOX=true vite",
|