@kong-ui-public/entities-upstreams-targets 3.4.8 → 3.5.0
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.
|
@@ -1,51 +1 @@
|
|
|
1
|
-
(function(re,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):(re=typeof globalThis<"u"?globalThis:re||self,t(re["kong-ui-entities-upstreams-targets"]={},re.Vue,re.axios,re["kong-ui-public-i18n"],re.Kongponents,re.VueRouter))})(this,function(re,t,At,Me,Nl,lt){"use strict";var nt=(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.Secret="secret",e))(nt||{}),se=(e=>(e.Edit="edit",e.Create="create",e))(se||{}),me=(e=>(e[e.Loading=0]="Loading",e[e.Idle=1]="Idle",e[e.NoResults=2]="NoResults",e[e.Error=3]="Error",e))(me||{}),Ce=(e=>(e.CaCertificate="ca_certificate",e.Certificate="certificate",e.Consumer="consumer",e.ConsumerGroup="consumer_group",e.GatewayService="service",e.Key="key",e.KeySet="set",e.Plugin="plugin",e.Route="route",e.SNI="sni",e.Upstream="upstream",e.Target="target",e.Vault="vault",e.Other="other",e))(Ce||{});const je=Object.values(Ce);var 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.CopyBadge="copy-badge",e.BadgeStatus="badge-status",e.BadgeMethod="badge-method",e.LinkInternal="link-internal",e.LinkExternal="link-external",e))(L||{}),J=(e=>(e.Basic="basic",e.Advanced="advanced",e.Plugin="plugin",e))(J||{});function Vl(){return{getAxiosInstance:(e={})=>{try{const r=t.inject("get-axios-instance",void 0);return typeof r=="function"?r(e):At.create({withCredentials:!0,timeout:3e4,...e})}catch(r){return console.warn("getAxiosInstance:",r.message||r),At.create({withCredentials:!0,timeout:3e4,...e})}},getTraceIdFromError:e=>{var r;return((r=e==null?void 0:e.response)==null?void 0:r.headers["x-datadog-trace-id"])||""}}}function Bl(){return{debounce:(e,r)=>{let a;return(...l)=>{clearTimeout(a),a=window==null?void 0:window.setTimeout(()=>{e(...l)},r)}}}}const ot="khcp-user-table-preferences",Il={pageSize:30,sortColumnKey:void 0,sortColumnOrder:void 0,columnWidths:{},columnVisibility:{}};function Tl(){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(ot));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(ot,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||Il},deleteAllTablePreferences:()=>{localStorage.removeItem(ot)}}}function it(e={}){const{getAxiosInstance:r}=Vl();return{axiosInstance:r(e)}}const Al={actions:{copyId:"Copy ID",copied_id:'Copied "{id}" to the clipboard',copyToClipboard:"Copied successfully!",copyToClipboardFailed:"Failed to copy to the clipboard"}},El={message:"Are you sure you want to delete this {entityType}?",messageWithName:"Are you sure you want to delete this {entityType} {entityName}?"},Hl={actions:{viewConfiguration:"View Configuration",save:"Save",cancel:"Cancel",back:"Back"},configuration:{title:"Configuration",message:"Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",yaml:"YAML",json:"JSON",terraform:"Terraform"},errors:{edit:"The entity could not be edited at this time."}},vl={emptyState:{noSearchResultsTitle:"No results found",noSearchResultsMessage:"Please adjust the criteria and try again.",noSearchResultsCtaText:"Clear"}},$l={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"}},ql={filterButtonText:"Filter",fieldLabel:"Filter by:",inputPlaceholder:"Enter a value",selectPlaceholder:"Select an item",applyButtonText:"Apply",clearButtonText:"Clear",clearAllButtonText:"Clear all filters"},Fl={errors:{fetch:"Could not fetch available items",invalid:"Please select a valid value"}},Ol={unexpected:"An unexpected error has occurred",dataKeyUndefined:'The data key "{dataKey}" does not exist in the response.'},Ul={utf8Name:"The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."},Dl={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"}},Ml={global:Al,deleteModal:El,baseForm:Hl,baseTable:vl,baseConfigCard:$l,filter:ql,debouncedFilter:Fl,errors:Ol,validationErrors:Ul,toggleModal:Dl};function Ke(){const e=Me.createI18n("en-us",Ml);return{i18n:e,i18nT:Me.i18nTComponent(e)}}function Et(){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 o of n){const i=a.filter(c=>c===o).length,d=l.filter(c=>c===o).length;if(i!==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 o in a)if(Array.isArray(a[o])&&Array.isArray(l[o])){if(r(a[o],l[o]))continue;return!1}else{if(a[o]===l[o])continue;return!1}else return!1;return!0}try{return JSON.stringify(a)===JSON.stringify(l)}catch{return!1}},sortAlpha:a=>(l,n)=>{let o=l[a]===void 0||l[a]===null?"":l[a],i=n[a]===void 0||n[a]===null?"":n[a];return Array.isArray(l[a])&&(o=l[a][0]),Array.isArray(n[a])&&(i=n[a][0]),o.localeCompare(i)},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 jl(e,r,a,l={fetchedItemsKey:"data",searchKeys:["id"]}){a||(a="1000");const{axiosInstance:n}=it(e.axiosRequestConfig),{i18n:{t:o}}=Ke(),{debounce:i}=Bl(),d=i(async I=>{await B(I)},200),c=t.ref(!1),p=t.ref(""),h=t.ref(""),u=t.ref([]),f=t.ref([]),s=t.ref(void 0),C=t.computed(()=>{const I=`${e.apiBaseUrl}${t.unref(r)}`;return e.app==="konnect"?I.replace(/{controlPlaneId}/gi,(e==null?void 0:e.controlPlaneId)||""):e.app==="kongManager"?I.replace(/\/{workspace}/gi,e!=null&&e.workspace?`/${e.workspace}`:""):I}),{isValidUuid:_}=Et(),g=async()=>{try{c.value=!0;const{data:I}=await n.get(`${C.value}?size=${a}`);I!=null&&I.next||(s.value=l.fetchedItemsKey in I?I[l.fetchedItemsKey]:[]),f.value=l.fetchedItemsKey in I?I[l.fetchedItemsKey]:[],u.value=f.value}catch{u.value=[],p.value=o("debouncedFilter.errors.fetch")}finally{c.value=!1}},x=t.ref(""),B=async I=>{var A,T,m;if(x.value!==I){if(x.value=I??"",!I){u.value=f.value;return}if(s.value===void 0)try{if(c.value=!0,p.value="",h.value="",e.app==="konnect"){const k=`${C.value}/${I}`,{data:N}=await n.get(`${k}?size=${a}`);l.fetchedItemsKey in N?u.value=N[l.fetchedItemsKey]:N!=null&&N[l.exactMatchKey??"id"]?u.value=[N]:u.value=[]}else{const k=[];_(I)&&l.searchKeys.includes("id")?k.push((async()=>{const{data:S}=await n.get(`${C.value}/${I}`);return[S[l.fetchedItemsKey]??S]})()):k.push(...l.searchKeys.filter(S=>S!=="id").map(async S=>{const{data:H}=await n.get(`${C.value}?${S}=${I}`);return H[l.fetchedItemsKey]}));const N=await Promise.all(k),V=new Set;u.value=[],(A=N==null?void 0:N.forEach)==null||A.call(N,S=>{var H;(H=S==null?void 0:S.forEach)==null||H.call(S,E=>{V.has(E.id)||(V.add(E.id),u.value.push(E))})})}}catch(k){((T=k==null?void 0:k.response)==null?void 0:T.status)===404?h.value=o("debouncedFilter.errors.invalid"):(u.value=[],p.value=o("debouncedFilter.errors.fetch"))}finally{c.value=!1}else c.value=!0,h.value="",u.value=(m=s.value)==null?void 0:m.filter(k=>{var N;let V=!1;for(const S of l.searchKeys){const H=typeof k[S]=="string"?(N=k[S])==null?void 0:N.toLowerCase():k[S];H!=null&&H.includes(I.toLowerCase())&&(V=!0)}return V}),(!u.value||!u.value.length)&&(h.value=o("debouncedFilter.errors.invalid")),c.value=!1}};return{loading:c,error:p,validationError:h,results:u,allRecords:s,loadItems:g,debouncedQueryChange:d}}function Kl(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 Ll(){const{i18n:{t:e}}=Ke();return{getMessageFromError:r=>{var a,l,n,o;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(i=>{let d=e("errors.unexpected");return i.messages&&typeof i.messages=="object"&&i.messages.length&&(d=i.messages.join(", ")),i.field?`${i.field} - ${d}`:d}).join("; ");if(r.response.data.message){const{message:i}=r.response.data;return Array.isArray(i)?(o=i[0])!=null&&o.constraints?Object.values(i[0].constraints)[0]:i[0]:i}if(typeof r.response.data=="string")return r.response.data;if(typeof r.response.data=="object")return Object.keys(r.response.data).map(i=>`${i} ${r.response.data[i]}`).join(", ")}return r.message||e("errors.unexpected")}}}function Pl(e){const r=window.location.origin,a=r.endsWith("/")?r:`${r}/`;try{const l=e.join("/"),n=`${a}${l}`,o=e.some(i=>i.trim()==="");if(/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n)&&!o&&new URL(n))return`${a}${l}`;throw new Error("Invalid url")}catch(l){return console.warn("Failed to build valid URL:",l),""}}function Ht(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)),o=t.computed(()=>l.value.startsWith("/")?new URL(`${window.location.origin}${l.value}`):new URL(l.value));return i=>{const{page:d,pageSize:c,offset:p,sortColumnKey:h,sortColumnOrder:u,query:f}=i;try{let s=new URL(o.value.href);return n.value&&f?(s.search="",s=a.value.isExactMatch?new URL(`${s.href}/${f}/`):new URL(`${s.href}?filter[name][contains]=${f}`)):(n.value||new URLSearchParams(f).forEach((C,_)=>{s.searchParams.append(_,C)}),h&&s.searchParams.append("sort_by",h),u==="desc"&&s.searchParams.append("sort_desc","1"),s.searchParams.append("size",String(c))),p&&d!==1&&s.searchParams.append("offset",String(p)),s.href}catch(s){return console.error("RouteList(fetcher)",s),l.value}}}function Rl(e,r,a){const l=t.unref(r),{axiosInstance:n}=it(e.axiosRequestConfig),o=Ht(e,l),i=t.ref({status:me.Idle});return{fetcher:async d=>{var c;const p=t.toValue(a)||"data";try{i.value={status:me.Loading};let h=o(d);h.includes("filter[name]")&&(h=`${h}&page[size]=${d.pageSize}&page[number]=${d.page}`);const u=await n.get(h);if(u.status>=400)throw u;const f=u.data,s=p&&p.replace(/[^\w-_]/gi,"");let C;f[s]?C=Array.isArray(f[s])?f[s]:[f[s]]:Array.isArray(f)?C=f:C=Object.keys(f).length?[f]:[];const _={data:C,total:C.length,...f.offset?{pagination:{offset:f.offset}}:null};return i.value={status:me.Idle,response:_},_}catch(h){const u={data:[],total:0};return d.query&&(((c=h.response)==null?void 0:c.status)===404||h.status===404)?(i.value={status:me.NoResults,response:u,error:h.response?h:{response:h}},u):(i.value={status:me.Error,response:u,error:h.response?h:{response:h}},u)}},fetcherState:i}}function zl(){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 vt=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,$t=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(vt);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},qt=e=>e==="*"||e==="x"||e==="X",Ft=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},Jl=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],Wl=(e,r)=>{if(qt(e)||qt(r))return 0;const[a,l]=Jl(Ft(e),Ft(r));return a>l?1:a<l?-1:0},Ot=(e,r)=>{for(let a=0;a<Math.max(e.length,r.length);a++){const l=Wl(e[a]||"0",r[a]||"0");if(l!==0)return l}return 0},Ql=(e,r)=>{const a=$t(e),l=$t(r),n=a.pop(),o=l.pop(),i=Ot(a,l);return i!==0?i:n&&o?Ot(n.split("."),o.split(".")):n||o?n?-1:1:0},Ut=(e,r,a)=>{Yl(a);const l=Ql(e,r);return Dt[a].includes(l)},Dt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Mt=Object.keys(Dt),Yl=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Mt.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Mt.join("|")}`)},Zl=e=>typeof e=="string"&&/^[v\d]/.test(e)&&vt.test(e);function Gl(e){const{gatewayInfo:r,supportedRange:a}=e;if(!r)return!0;const{edition:l,version:n}=r;if(!Zl(n))return console.error("Invalid version"),!1;const o=a[l];if(!o)return!1;const[i,d]=o;return!(i&&Ut(n,i,"<")||d&&Ut(n,d,">"))}function Xl(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)}}function en(){const{i18n:{t:e}}=Ke();return{utf8Name:r=>/^[\p{N}\p{L}.\-_~]*$/u.test(r)?"":e("validationErrors.utf8Name")}}const Z={useAxios:it,useDebouncedFilter:jl,useDeleteUrlBuilder:Kl,useErrors:Ll,useExternalLinkCreator:Pl,useFetcher:Rl,useFetchUrlBuilder:Ht,useHelpers:Et,useStringHelpers:zl,useI18n:Ke,useGatewayFeatureSupported:Gl,useTruncationDetector:Xl,useValidators:en},tn={key:0,class:"config-card-fieldset-title"},an=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"),o=t.computed(()=>r.item.value??r.item),i=t.computed(()=>{const c=JSON.parse(JSON.stringify(o.value));return r.isArrayItem&&delete c.name,c}),d=t.computed(()=>{var c;return r.isArrayItem?(c=o.value)!=null&&c.name?l(o.value.name,"_"):a("baseConfigCard.general.entryTitle",{index:r.index}):""});return(c,p)=>(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",tn,[t.createElementVNode("b",null,t.toDisplayString(d.value),1)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Object.keys(i.value),(h,u)=>(t.openBlock(),t.createBlock(Kt,{key:`${n.value}-property-${u}`,item:{key:h,label:t.unref(l)(h),value:i.value[h]}},null,8,["item"]))),128))]),_:1},8,["class"]))}}),ie=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},jt=ie(an,[["__scopeId","data-v-68ca83ec"]]),rn=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]=o=>a.$emit("navigation-click",e.item))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.item.value||t.unref(r)("baseConfigCard.commonFields.link")),1)]),_:1})])}}}),ln=ie(rn,[["__scopeId","data-v-c96811e5"]]),nn=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"])}}}),on="#0044f4",sn="#e0e4ea",cn="#afb7c5",dn="1px",hn="20px",pn={class:"config-card-details-row"},un=["data-testid"],fn=["data-testid"],mn=["data-testid"],gn=["data-testid"],yn={key:1},kn=["data-testid"],bn=["data-testid"],Cn=["data-testid"],wn=["data-testid"],Sn={name:"ConfigCardItem",components:{JsonCardItem:jt,StatusBadge:nn,InternalLinkItem:ln}},_n=t.defineComponent({...Sn,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(C=>({"2f5b0492":h.value?"none":`solid ${t.unref(dn)} ${t.unref(sn)}`,"5d59c22c":p.value&&d.value?"block":"flex",aa41a894:p.value&&d.value?"100%":a.slim?"50%":"25%",aa3d1cde:p.value&&d.value?"100%":a.slim?"50%":"75%"}));const a=e,l=r,n=t.useSlots(),{i18n:{t:o,formatUnixTimeStamp:i}}=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"])),p=t.computed(()=>a.item.type===L.Json||a.item.type===L.JsonArray),h=t.computed(()=>a.item.type===L.JsonArray),u=t.computed(()=>{switch(a.item.type){case L.ID:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid`,"copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.IdArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{"copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Redacted:return{tag:"KCopy",attrs:{"data-testid":`${a.item.key}-copy-uuid-redacted`,format:"redacted","copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label}),text:a.item.value}};case L.RedactedArray:return{tag:"div",additionalComponent:"KCopy",childAttrs:{format:"redacted","copy-tooltip":o("baseConfigCard.copy.tooltip",{label:a.item.label})}};case L.Date:return{tag:"div",attrs:{"data-testid":`${a.item.key}-date`},text:i(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.CopyBadge:return{tag:"div",additionalComponent:"KCopy",childAttrs:{badge:!0,truncate:!0,truncationLimit:"auto",text:a.item.value}};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:C=>{l("navigation-click",C)}}};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(C,_)=>{const g=t.resolveComponent("KLabel"),x=t.resolveComponent("KBadge"),B=t.resolveComponent("KCopy"),I=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("div",pn,[t.createElementVNode("div",{class:"config-card-details-label","data-testid":`${e.item.key}-label`},[t.renderSlot(C.$slots,"label",{item:e.item},()=>[t.createVNode(g,{"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(C.$slots,"label-tooltip",{},()=>[t.createTextVNode(t.toDisplayString(e.item.tooltip),1)],!0)],8,fn)]),key:"0"}:void 0]),1024)],!0)],8,un),t.createElementVNode("div",{class:"config-card-details-value","data-testid":`${e.item.key}-property-value`},[t.renderSlot(C.$slots,e.item.key,{rowValue:e.item.value},()=>[d.value?(t.openBlock(),t.createElementBlock("div",yn,[(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,(A,T)=>(t.openBlock(),t.createBlock(x,{key:`${e.item.key}-badge-tag-${T}`,class:"config-badge","data-testid":`${e.item.key}-badge-tag-${T}`,tooltip:A,"truncation-tooltip":""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(A),1)]),_:2},1032,["data-testid","tooltip"]))),128))],8,kn)):t.createCommentVNode("",!0),u.value.additionalComponent==="KCopy"?(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,(A,T)=>(t.openBlock(),t.createBlock(B,t.mergeProps({ref_for:!0},u.value.childAttrs,{key:`${e.item.key}-copy-uuid-${T}`,"data-testid":`${e.item.key}-copy-uuid-${T}`,text:A}),null,16,["data-testid","text"]))),128))],8,bn)):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,(A,T)=>(t.openBlock(),t.createBlock(x,{key:`${e.item.key}-badge-method-${T}`,appearance:Object.values(t.unref(Nl.BadgeMethodAppearances)).includes(A.toLowerCase())?A.toLowerCase():"custom",class:"config-badge","data-testid":`${e.item.key}-badge-method-${T}`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(A),1)]),_:2},1032,["appearance","data-testid"]))),128))],8,Cn)):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,(A,T)=>(t.openBlock(),t.createBlock(jt,{key:`json-array-item-${T}`,index:T,"is-array-item":"",item:A},null,8,["index","item"]))),128))],8,wn)):(t.openBlock(),t.createBlock(I,{key:4,text: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,["text"]))]),_:1},16))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${e.item.key}-no-value`}," – ",8,gn))],!0)],8,mn)])}}}),Kt=ie(_n,[["__scopeId","data-v-711ebcf2"]]),xn={class:"json-config"},Nn={key:0,class:"json-endpoint"},Lt=t.defineComponent({__name:"JsonCodeBlock",props:{config:{type:Object,required:!1,default:()=>({})},fetcherUrl:{type:String,required:!1,default:""},entityRecord:{type:Object,required:!0},requestMethod:{type:String,required:!1,default:""}},setup(e){t.useCssVars(n=>({"454fa8c4":`${l.value}ch`}));const r=e,a=t.computed(()=>r.entityRecord),l=t.computed(()=>{var n;if(!r.fetcherUrl)return 0;const o=(n=r.fetcherUrl)==null?void 0:n.split("/");return o.length<2?0:41+(r.requestMethod==="post"?o[o.length-1]:o[o.length-2]).length});return(n,o)=>{const i=t.resolveComponent("KBadge"),d=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",xn,[r.fetcherUrl?(t.openBlock(),t.createElementBlock("div",Nn,[t.createVNode(i,{appearance:r.requestMethod},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.requestMethod),1)]),_:1},8,["appearance"]),t.createVNode(d,{id:"json-endpoint-codeblock",code:r.fetcherUrl,language:"json","single-line":"",theme:"dark"},null,8,["code"])])):t.createCommentVNode("",!0),r.entityRecord?(t.openBlock(),t.createBlock(d,{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 Pt(e){return typeof e>"u"||e===null}function Vn(e){return typeof e=="object"&&e!==null}function Bn(e){return Array.isArray(e)?e:Pt(e)?[]:[e]}function In(e,r){var a,l,n,o;if(r)for(o=Object.keys(r),a=0,l=o.length;a<l;a+=1)n=o[a],e[n]=r[n];return e}function Tn(e,r){var a="",l;for(l=0;l<r;l+=1)a+=e;return a}function An(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var En=Pt,Hn=Vn,vn=Bn,$n=Tn,qn=An,Fn=In,Q={isNothing:En,isObject:Hn,toArray:vn,repeat:$n,isNegativeZero:qn,extend:Fn};function Rt(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
|
-
|
|
3
|
-
`+e.mark.snippet),l+" "+a):l}function He(e,r){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=r,this.message=Rt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}He.prototype=Object.create(Error.prototype),He.prototype.constructor=He,He.prototype.toString=function(e){return this.name+": "+Rt(this,e)};var le=He;function st(e,r,a,l,n){var o="",i="",d=Math.floor(n/2)-1;return l-r>d&&(o=" ... ",r=l-d+o.length),a-l>d&&(i=" ...",a=l+d-i.length),{str:o+e.slice(r,a).replace(/\t/g,"→")+i,pos:l-r+o.length}}function ct(e,r){return Q.repeat(" ",r-e.length)+e}function On(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=[],o,i=-1;o=a.exec(e.buffer);)n.push(o.index),l.push(o.index+o[0].length),e.position<=o.index&&i<0&&(i=l.length-2);i<0&&(i=l.length-1);var d="",c,p,h=Math.min(e.line+r.linesAfter,n.length).toString().length,u=r.maxLength-(r.indent+h+3);for(c=1;c<=r.linesBefore&&!(i-c<0);c++)p=st(e.buffer,l[i-c],n[i-c],e.position-(l[i]-l[i-c]),u),d=Q.repeat(" ",r.indent)+ct((e.line-c+1).toString(),h)+" | "+p.str+`
|
|
4
|
-
`+d;for(p=st(e.buffer,l[i],n[i],e.position,u),d+=Q.repeat(" ",r.indent)+ct((e.line+1).toString(),h)+" | "+p.str+`
|
|
5
|
-
`,d+=Q.repeat("-",r.indent+h+3+p.pos)+`^
|
|
6
|
-
`,c=1;c<=r.linesAfter&&!(i+c>=n.length);c++)p=st(e.buffer,l[i+c],n[i+c],e.position-(l[i]-l[i+c]),u),d+=Q.repeat(" ",r.indent)+ct((e.line+c+1).toString(),h)+" | "+p.str+`
|
|
7
|
-
`;return d.replace(/\n$/,"")}var Un=On,Dn=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Mn=["scalar","sequence","mapping"];function jn(e){var r={};return e!==null&&Object.keys(e).forEach(function(a){e[a].forEach(function(l){r[String(l)]=a})}),r}function Kn(e,r){if(r=r||{},Object.keys(r).forEach(function(a){if(Dn.indexOf(a)===-1)throw new le('Unknown option "'+a+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(a){return a},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=jn(r.styleAliases||null),Mn.indexOf(this.kind)===-1)throw new le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var G=Kn;function zt(e,r){var a=[];return e[r].forEach(function(l){var n=a.length;a.forEach(function(o,i){o.tag===l.tag&&o.kind===l.kind&&o.multi===l.multi&&(n=i)}),a[n]=l}),a}function Ln(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,a;function l(n){n.multi?(e.multi[n.kind].push(n),e.multi.fallback.push(n)):e[n.kind][n.tag]=e.fallback[n.tag]=n}for(r=0,a=arguments.length;r<a;r+=1)arguments[r].forEach(l);return e}function dt(e){return this.extend(e)}dt.prototype.extend=function(e){var r=[],a=[];if(e instanceof G)a.push(e);else if(Array.isArray(e))a=a.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(a=a.concat(e.explicit));else throw new le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&n.loadKind!=="scalar")throw new le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),a.forEach(function(n){if(!(n instanceof G))throw new le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(dt.prototype);return l.implicit=(this.implicit||[]).concat(r),l.explicit=(this.explicit||[]).concat(a),l.compiledImplicit=zt(l,"implicit"),l.compiledExplicit=zt(l,"explicit"),l.compiledTypeMap=Ln(l.compiledImplicit,l.compiledExplicit),l};var Jt=dt,Wt=new G("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Qt=new G("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Yt=new G("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Zt=new Jt({explicit:[Wt,Qt,Yt]});function Pn(e){if(e===null)return!0;var r=e.length;return r===1&&e==="~"||r===4&&(e==="null"||e==="Null"||e==="NULL")}function Rn(){return null}function zn(e){return e===null}var Gt=new G("tag:yaml.org,2002:null",{kind:"scalar",resolve:Pn,construct:Rn,predicate:zn,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Jn(e){if(e===null)return!1;var r=e.length;return r===4&&(e==="true"||e==="True"||e==="TRUE")||r===5&&(e==="false"||e==="False"||e==="FALSE")}function Wn(e){return e==="true"||e==="True"||e==="TRUE"}function Qn(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Xt=new G("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Jn,construct:Wn,predicate:Qn,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Yn(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Zn(e){return 48<=e&&e<=55}function Gn(e){return 48<=e&&e<=57}function Xn(e){if(e===null)return!1;var r=e.length,a=0,l=!1,n;if(!r)return!1;if(n=e[a],(n==="-"||n==="+")&&(n=e[++a]),n==="0"){if(a+1===r)return!0;if(n=e[++a],n==="b"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(n!=="0"&&n!=="1")return!1;l=!0}return l&&n!=="_"}if(n==="x"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Yn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}if(n==="o"){for(a++;a<r;a++)if(n=e[a],n!=="_"){if(!Zn(e.charCodeAt(a)))return!1;l=!0}return l&&n!=="_"}}if(n==="_")return!1;for(;a<r;a++)if(n=e[a],n!=="_"){if(!Gn(e.charCodeAt(a)))return!1;l=!0}return!(!l||n==="_")}function eo(e){var r=e,a=1,l;if(r.indexOf("_")!==-1&&(r=r.replace(/_/g,"")),l=r[0],(l==="-"||l==="+")&&(l==="-"&&(a=-1),r=r.slice(1),l=r[0]),r==="0")return 0;if(l==="0"){if(r[1]==="b")return a*parseInt(r.slice(2),2);if(r[1]==="x")return a*parseInt(r.slice(2),16);if(r[1]==="o")return a*parseInt(r.slice(2),8)}return a*parseInt(r,10)}function to(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Q.isNegativeZero(e)}var ea=new G("tag:yaml.org,2002:int",{kind:"scalar",resolve:Xn,construct:eo,predicate:to,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ao=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ro(e){return!(e===null||!ao.test(e)||e[e.length-1]==="_")}function lo(e){var r,a;return r=e.replace(/_/g,"").toLowerCase(),a=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?a===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:a*parseFloat(r,10)}var no=/^[-+]?[0-9]+e/;function oo(e,r){var a;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Q.isNegativeZero(e))return"-0.0";return a=e.toString(10),no.test(a)?a.replace("e",".e"):a}function io(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Q.isNegativeZero(e))}var ta=new G("tag:yaml.org,2002:float",{kind:"scalar",resolve:ro,construct:lo,predicate:io,represent:oo,defaultStyle:"lowercase"}),aa=Zt.extend({implicit:[Gt,Xt,ea,ta]}),ra=aa,la=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),na=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function so(e){return e===null?!1:la.exec(e)!==null||na.exec(e)!==null}function co(e){var r,a,l,n,o,i,d,c=0,p=null,h,u,f;if(r=la.exec(e),r===null&&(r=na.exec(e)),r===null)throw new Error("Date resolve error");if(a=+r[1],l=+r[2]-1,n=+r[3],!r[4])return new Date(Date.UTC(a,l,n));if(o=+r[4],i=+r[5],d=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(h=+r[10],u=+(r[11]||0),p=(h*60+u)*6e4,r[9]==="-"&&(p=-p)),f=new Date(Date.UTC(a,l,n,o,i,d,c)),p&&f.setTime(f.getTime()-p),f}function ho(e){return e.toISOString()}var oa=new G("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:so,construct:co,instanceOf:Date,represent:ho});function po(e){return e==="<<"||e===null}var ia=new G("tag:yaml.org,2002:merge",{kind:"scalar",resolve:po}),ht=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
-
\r`;function uo(e){if(e===null)return!1;var r,a,l=0,n=e.length,o=ht;for(a=0;a<n;a++)if(r=o.indexOf(e.charAt(a)),!(r>64)){if(r<0)return!1;l+=6}return l%8===0}function fo(e){var r,a,l=e.replace(/[\r\n=]/g,""),n=l.length,o=ht,i=0,d=[];for(r=0;r<n;r++)r%4===0&&r&&(d.push(i>>16&255),d.push(i>>8&255),d.push(i&255)),i=i<<6|o.indexOf(l.charAt(r));return a=n%4*6,a===0?(d.push(i>>16&255),d.push(i>>8&255),d.push(i&255)):a===18?(d.push(i>>10&255),d.push(i>>2&255)):a===12&&d.push(i>>4&255),new Uint8Array(d)}function mo(e){var r="",a=0,l,n,o=e.length,i=ht;for(l=0;l<o;l++)l%3===0&&l&&(r+=i[a>>18&63],r+=i[a>>12&63],r+=i[a>>6&63],r+=i[a&63]),a=(a<<8)+e[l];return n=o%3,n===0?(r+=i[a>>18&63],r+=i[a>>12&63],r+=i[a>>6&63],r+=i[a&63]):n===2?(r+=i[a>>10&63],r+=i[a>>4&63],r+=i[a<<2&63],r+=i[64]):n===1&&(r+=i[a>>2&63],r+=i[a<<4&63],r+=i[64],r+=i[64]),r}function go(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var sa=new G("tag:yaml.org,2002:binary",{kind:"scalar",resolve:uo,construct:fo,predicate:go,represent:mo}),yo=Object.prototype.hasOwnProperty,ko=Object.prototype.toString;function bo(e){if(e===null)return!0;var r=[],a,l,n,o,i,d=e;for(a=0,l=d.length;a<l;a+=1){if(n=d[a],i=!1,ko.call(n)!=="[object Object]")return!1;for(o in n)if(yo.call(n,o))if(!i)i=!0;else return!1;if(!i)return!1;if(r.indexOf(o)===-1)r.push(o);else return!1}return!0}function Co(e){return e!==null?e:[]}var ca=new G("tag:yaml.org,2002:omap",{kind:"sequence",resolve:bo,construct:Co}),wo=Object.prototype.toString;function So(e){if(e===null)return!0;var r,a,l,n,o,i=e;for(o=new Array(i.length),r=0,a=i.length;r<a;r+=1){if(l=i[r],wo.call(l)!=="[object Object]"||(n=Object.keys(l),n.length!==1))return!1;o[r]=[n[0],l[n[0]]]}return!0}function _o(e){if(e===null)return[];var r,a,l,n,o,i=e;for(o=new Array(i.length),r=0,a=i.length;r<a;r+=1)l=i[r],n=Object.keys(l),o[r]=[n[0],l[n[0]]];return o}var da=new G("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:So,construct:_o}),xo=Object.prototype.hasOwnProperty;function No(e){if(e===null)return!0;var r,a=e;for(r in a)if(xo.call(a,r)&&a[r]!==null)return!1;return!0}function Vo(e){return e!==null?e:{}}var ha=new G("tag:yaml.org,2002:set",{kind:"mapping",resolve:No,construct:Vo}),pt=ra.extend({implicit:[oa,ia],explicit:[sa,ca,da,ha]}),ge=Object.prototype.hasOwnProperty,Le=1,pa=2,ua=3,Pe=4,ut=1,Bo=2,fa=3,Io=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,To=/[\x85\u2028\u2029]/,Ao=/[,\[\]\{\}]/,ma=/^(?:!|!!|![a-z\-]+!)$/i,ga=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ya(e){return Object.prototype.toString.call(e)}function ce(e){return e===10||e===13}function ke(e){return e===9||e===32}function oe(e){return e===9||e===32||e===10||e===13}function we(e){return e===44||e===91||e===93||e===123||e===125}function Eo(e){var r;return 48<=e&&e<=57?e-48:(r=e|32,97<=r&&r<=102?r-97+10:-1)}function Ho(e){return e===120?2:e===117?4:e===85?8:0}function vo(e){return 48<=e&&e<=57?e-48:-1}function ka(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
9
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function $o(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var ba=new Array(256),Ca=new Array(256),Se=0;Se<256;Se++)ba[Se]=ka(Se)?1:0,Ca[Se]=ka(Se);function qo(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||pt,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function wa(e,r){var a={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return a.snippet=Un(a),new le(r,a)}function v(e,r){throw wa(e,r)}function Re(e,r){e.onWarning&&e.onWarning.call(null,wa(e,r))}var Sa={YAML:function(e,r,a){var l,n,o;e.version!==null&&v(e,"duplication of %YAML directive"),a.length!==1&&v(e,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\.([0-9]+)$/.exec(a[0]),l===null&&v(e,"ill-formed argument of the YAML directive"),n=parseInt(l[1],10),o=parseInt(l[2],10),n!==1&&v(e,"unacceptable YAML version of the document"),e.version=a[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Re(e,"unsupported YAML version of the document")},TAG:function(e,r,a){var l,n;a.length!==2&&v(e,"TAG directive accepts exactly two arguments"),l=a[0],n=a[1],ma.test(l)||v(e,"ill-formed tag handle (first argument) of the TAG directive"),ge.call(e.tagMap,l)&&v(e,'there is a previously declared suffix for "'+l+'" tag handle'),ga.test(n)||v(e,"ill-formed tag prefix (second argument) of the TAG directive");try{n=decodeURIComponent(n)}catch{v(e,"tag prefix is malformed: "+n)}e.tagMap[l]=n}};function ye(e,r,a,l){var n,o,i,d;if(r<a){if(d=e.input.slice(r,a),l)for(n=0,o=d.length;n<o;n+=1)i=d.charCodeAt(n),i===9||32<=i&&i<=1114111||v(e,"expected valid JSON character");else Io.test(d)&&v(e,"the stream contains non-printable characters");e.result+=d}}function _a(e,r,a,l){var n,o,i,d;for(Q.isObject(a)||v(e,"cannot merge mappings; the provided source object is unacceptable"),n=Object.keys(a),i=0,d=n.length;i<d;i+=1)o=n[i],ge.call(r,o)||(r[o]=a[o],l[o]=!0)}function _e(e,r,a,l,n,o,i,d,c){var p,h;if(Array.isArray(n))for(n=Array.prototype.slice.call(n),p=0,h=n.length;p<h;p+=1)Array.isArray(n[p])&&v(e,"nested arrays are not supported inside keys"),typeof n=="object"&&ya(n[p])==="[object Object]"&&(n[p]="[object Object]");if(typeof n=="object"&&ya(n)==="[object Object]"&&(n="[object Object]"),n=String(n),r===null&&(r={}),l==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(p=0,h=o.length;p<h;p+=1)_a(e,r,o[p],a);else _a(e,r,o,a);else!e.json&&!ge.call(a,n)&&ge.call(r,n)&&(e.line=i||e.line,e.lineStart=d||e.lineStart,e.position=c||e.position,v(e,"duplicated mapping key")),n==="__proto__"?Object.defineProperty(r,n,{configurable:!0,enumerable:!0,writable:!0,value:o}):r[n]=o,delete a[n];return r}function ft(e){var r;r=e.input.charCodeAt(e.position),r===10?e.position++:r===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):v(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function W(e,r,a){for(var l=0,n=e.input.charCodeAt(e.position);n!==0;){for(;ke(n);)n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(r&&n===35)do n=e.input.charCodeAt(++e.position);while(n!==10&&n!==13&&n!==0);if(ce(n))for(ft(e),n=e.input.charCodeAt(e.position),l++,e.lineIndent=0;n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position);else break}return a!==-1&&l!==0&&e.lineIndent<a&&Re(e,"deficient indentation"),l}function ze(e){var r=e.position,a;return a=e.input.charCodeAt(r),!!((a===45||a===46)&&a===e.input.charCodeAt(r+1)&&a===e.input.charCodeAt(r+2)&&(r+=3,a=e.input.charCodeAt(r),a===0||oe(a)))}function mt(e,r){r===1?e.result+=" ":r>1&&(e.result+=Q.repeat(`
|
|
10
|
-
`,r-1))}function Fo(e,r,a){var l,n,o,i,d,c,p,h,u=e.kind,f=e.result,s;if(s=e.input.charCodeAt(e.position),oe(s)||we(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(n=e.input.charCodeAt(e.position+1),oe(n)||a&&we(n)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,d=!1;s!==0;){if(s===58){if(n=e.input.charCodeAt(e.position+1),oe(n)||a&&we(n))break}else if(s===35){if(l=e.input.charCodeAt(e.position-1),oe(l))break}else{if(e.position===e.lineStart&&ze(e)||a&&we(s))break;if(ce(s))if(c=e.line,p=e.lineStart,h=e.lineIndent,W(e,!1,-1),e.lineIndent>=r){d=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=i,e.line=c,e.lineStart=p,e.lineIndent=h;break}}d&&(ye(e,o,i,!1),mt(e,e.line-c),o=i=e.position,d=!1),ke(s)||(i=e.position+1),s=e.input.charCodeAt(++e.position)}return ye(e,o,i,!1),e.result?!0:(e.kind=u,e.result=f,!1)}function Oo(e,r){var a,l,n;if(a=e.input.charCodeAt(e.position),a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,l=n=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(ye(e,l,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)l=e.position,e.position++,n=e.position;else return!0;else ce(a)?(ye(e,l,n,!0),mt(e,W(e,!1,r)),l=n=e.position):e.position===e.lineStart&&ze(e)?v(e,"unexpected end of the document within a single quoted scalar"):(e.position++,n=e.position);v(e,"unexpected end of the stream within a single quoted scalar")}function Uo(e,r){var a,l,n,o,i,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,a=l=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return ye(e,a,e.position,!0),e.position++,!0;if(d===92){if(ye(e,a,e.position,!0),d=e.input.charCodeAt(++e.position),ce(d))W(e,!1,r);else if(d<256&&ba[d])e.result+=Ca[d],e.position++;else if((i=Ho(d))>0){for(n=i,o=0;n>0;n--)d=e.input.charCodeAt(++e.position),(i=Eo(d))>=0?o=(o<<4)+i:v(e,"expected hexadecimal character");e.result+=$o(o),e.position++}else v(e,"unknown escape sequence");a=l=e.position}else ce(d)?(ye(e,a,l,!0),mt(e,W(e,!1,r)),a=l=e.position):e.position===e.lineStart&&ze(e)?v(e,"unexpected end of the document within a double quoted scalar"):(e.position++,l=e.position)}v(e,"unexpected end of the stream within a double quoted scalar")}function Do(e,r){var a=!0,l,n,o,i=e.tag,d,c=e.anchor,p,h,u,f,s,C=Object.create(null),_,g,x,B;if(B=e.input.charCodeAt(e.position),B===91)h=93,s=!1,d=[];else if(B===123)h=125,s=!0,d={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),B=e.input.charCodeAt(++e.position);B!==0;){if(W(e,!0,r),B=e.input.charCodeAt(e.position),B===h)return e.position++,e.tag=i,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=d,!0;a?B===44&&v(e,"expected the node content, but found ','"):v(e,"missed comma between flow collection entries"),g=_=x=null,u=f=!1,B===63&&(p=e.input.charCodeAt(e.position+1),oe(p)&&(u=f=!0,e.position++,W(e,!0,r))),l=e.line,n=e.lineStart,o=e.position,xe(e,r,Le,!1,!0),g=e.tag,_=e.result,W(e,!0,r),B=e.input.charCodeAt(e.position),(f||e.line===l)&&B===58&&(u=!0,B=e.input.charCodeAt(++e.position),W(e,!0,r),xe(e,r,Le,!1,!0),x=e.result),s?_e(e,d,C,g,_,x,l,n,o):u?d.push(_e(e,null,C,g,_,x,l,n,o)):d.push(_),W(e,!0,r),B=e.input.charCodeAt(e.position),B===44?(a=!0,B=e.input.charCodeAt(++e.position)):a=!1}v(e,"unexpected end of the stream within a flow collection")}function Mo(e,r){var a,l,n=ut,o=!1,i=!1,d=r,c=0,p=!1,h,u;if(u=e.input.charCodeAt(e.position),u===124)l=!1;else if(u===62)l=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)ut===n?n=u===43?fa:Bo:v(e,"repeat of a chomping mode identifier");else if((h=vo(u))>=0)h===0?v(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):i?v(e,"repeat of an indentation width identifier"):(d=r+h-1,i=!0);else break;if(ke(u)){do u=e.input.charCodeAt(++e.position);while(ke(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!ce(u)&&u!==0)}for(;u!==0;){for(ft(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!i||e.lineIndent<d)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!i&&e.lineIndent>d&&(d=e.lineIndent),ce(u)){c++;continue}if(e.lineIndent<d){n===fa?e.result+=Q.repeat(`
|
|
11
|
-
`,o?1+c:c):n===ut&&o&&(e.result+=`
|
|
12
|
-
`);break}for(l?ke(u)?(p=!0,e.result+=Q.repeat(`
|
|
13
|
-
`,o?1+c:c)):p?(p=!1,e.result+=Q.repeat(`
|
|
14
|
-
`,c+1)):c===0?o&&(e.result+=" "):e.result+=Q.repeat(`
|
|
15
|
-
`,c):e.result+=Q.repeat(`
|
|
16
|
-
`,o?1+c:c),o=!0,i=!0,c=0,a=e.position;!ce(u)&&u!==0;)u=e.input.charCodeAt(++e.position);ye(e,a,e.position,!1)}return!0}function xa(e,r){var a,l=e.tag,n=e.anchor,o=[],i,d=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),!(c!==45||(i=e.input.charCodeAt(e.position+1),!oe(i))));){if(d=!0,e.position++,W(e,!0,-1)&&e.lineIndent<=r){o.push(null),c=e.input.charCodeAt(e.position);continue}if(a=e.line,xe(e,r,ua,!1,!0),o.push(e.result),W(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>r)&&c!==0)v(e,"bad indentation of a sequence entry");else if(e.lineIndent<r)break}return d?(e.tag=l,e.anchor=n,e.kind="sequence",e.result=o,!0):!1}function jo(e,r,a){var l,n,o,i,d,c,p=e.tag,h=e.anchor,u={},f=Object.create(null),s=null,C=null,_=null,g=!1,x=!1,B;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),B=e.input.charCodeAt(e.position);B!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),l=e.input.charCodeAt(e.position+1),o=e.line,(B===63||B===58)&&oe(l))B===63?(g&&(_e(e,u,f,s,C,null,i,d,c),s=C=_=null),x=!0,g=!0,n=!0):g?(g=!1,n=!0):v(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,B=l;else{if(i=e.line,d=e.lineStart,c=e.position,!xe(e,a,pa,!1,!0))break;if(e.line===o){for(B=e.input.charCodeAt(e.position);ke(B);)B=e.input.charCodeAt(++e.position);if(B===58)B=e.input.charCodeAt(++e.position),oe(B)||v(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(_e(e,u,f,s,C,null,i,d,c),s=C=_=null),x=!0,g=!1,n=!1,s=e.tag,C=e.result;else if(x)v(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=p,e.anchor=h,!0}else if(x)v(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=p,e.anchor=h,!0}if((e.line===o||e.lineIndent>r)&&(g&&(i=e.line,d=e.lineStart,c=e.position),xe(e,r,Pe,!0,n)&&(g?C=e.result:_=e.result),g||(_e(e,u,f,s,C,_,i,d,c),s=C=_=null),W(e,!0,-1),B=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>r)&&B!==0)v(e,"bad indentation of a mapping entry");else if(e.lineIndent<r)break}return g&&_e(e,u,f,s,C,null,i,d,c),x&&(e.tag=p,e.anchor=h,e.kind="mapping",e.result=u),x}function Ko(e){var r,a=!1,l=!1,n,o,i;if(i=e.input.charCodeAt(e.position),i!==33)return!1;if(e.tag!==null&&v(e,"duplication of a tag property"),i=e.input.charCodeAt(++e.position),i===60?(a=!0,i=e.input.charCodeAt(++e.position)):i===33?(l=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",r=e.position,a){do i=e.input.charCodeAt(++e.position);while(i!==0&&i!==62);e.position<e.length?(o=e.input.slice(r,e.position),i=e.input.charCodeAt(++e.position)):v(e,"unexpected end of the stream within a verbatim tag")}else{for(;i!==0&&!oe(i);)i===33&&(l?v(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(r-1,e.position+1),ma.test(n)||v(e,"named tag handle cannot contain such characters"),l=!0,r=e.position+1)),i=e.input.charCodeAt(++e.position);o=e.input.slice(r,e.position),Ao.test(o)&&v(e,"tag suffix cannot contain flow indicator characters")}o&&!ga.test(o)&&v(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{v(e,"tag name is malformed: "+o)}return a?e.tag=o:ge.call(e.tagMap,n)?e.tag=e.tagMap[n]+o:n==="!"?e.tag="!"+o:n==="!!"?e.tag="tag:yaml.org,2002:"+o:v(e,'undeclared tag handle "'+n+'"'),!0}function Lo(e){var r,a;if(a=e.input.charCodeAt(e.position),a!==38)return!1;for(e.anchor!==null&&v(e,"duplication of an anchor property"),a=e.input.charCodeAt(++e.position),r=e.position;a!==0&&!oe(a)&&!we(a);)a=e.input.charCodeAt(++e.position);return e.position===r&&v(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(r,e.position),!0}function Po(e){var r,a,l;if(l=e.input.charCodeAt(e.position),l!==42)return!1;for(l=e.input.charCodeAt(++e.position),r=e.position;l!==0&&!oe(l)&&!we(l);)l=e.input.charCodeAt(++e.position);return e.position===r&&v(e,"name of an alias node must contain at least one character"),a=e.input.slice(r,e.position),ge.call(e.anchorMap,a)||v(e,'unidentified alias "'+a+'"'),e.result=e.anchorMap[a],W(e,!0,-1),!0}function xe(e,r,a,l,n){var o,i,d,c=1,p=!1,h=!1,u,f,s,C,_,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=i=d=Pe===a||ua===a,l&&W(e,!0,-1)&&(p=!0,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)),c===1)for(;Ko(e)||Lo(e);)W(e,!0,-1)?(p=!0,d=o,e.lineIndent>r?c=1:e.lineIndent===r?c=0:e.lineIndent<r&&(c=-1)):d=!1;if(d&&(d=p||n),(c===1||Pe===a)&&(Le===a||pa===a?_=r:_=r+1,g=e.position-e.lineStart,c===1?d&&(xa(e,g)||jo(e,g,_))||Do(e,_)?h=!0:(i&&Mo(e,_)||Oo(e,_)||Uo(e,_)?h=!0:Po(e)?(h=!0,(e.tag!==null||e.anchor!==null)&&v(e,"alias node should not have any properties")):Fo(e,_,Le===a)&&(h=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(h=d&&xa(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&v(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,f=e.implicitTypes.length;u<f;u+=1)if(C=e.implicitTypes[u],C.resolve(e.result)){e.result=C.construct(e.result),e.tag=C.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(ge.call(e.typeMap[e.kind||"fallback"],e.tag))C=e.typeMap[e.kind||"fallback"][e.tag];else for(C=null,s=e.typeMap.multi[e.kind||"fallback"],u=0,f=s.length;u<f;u+=1)if(e.tag.slice(0,s[u].tag.length)===s[u].tag){C=s[u];break}C||v(e,"unknown tag !<"+e.tag+">"),e.result!==null&&C.kind!==e.kind&&v(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+C.kind+'", not "'+e.kind+'"'),C.resolve(e.result,e.tag)?(e.result=C.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):v(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}function Ro(e){var r=e.position,a,l,n,o=!1,i;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(i=e.input.charCodeAt(e.position))!==0&&(W(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||i!==37));){for(o=!0,i=e.input.charCodeAt(++e.position),a=e.position;i!==0&&!oe(i);)i=e.input.charCodeAt(++e.position);for(l=e.input.slice(a,e.position),n=[],l.length<1&&v(e,"directive name must not be less than one character in length");i!==0;){for(;ke(i);)i=e.input.charCodeAt(++e.position);if(i===35){do i=e.input.charCodeAt(++e.position);while(i!==0&&!ce(i));break}if(ce(i))break;for(a=e.position;i!==0&&!oe(i);)i=e.input.charCodeAt(++e.position);n.push(e.input.slice(a,e.position))}i!==0&&ft(e),ge.call(Sa,l)?Sa[l](e,l,n):Re(e,'unknown document directive "'+l+'"')}if(W(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,W(e,!0,-1)):o&&v(e,"directives end mark is expected"),xe(e,e.lineIndent-1,Pe,!1,!0),W(e,!0,-1),e.checkLineBreaks&&To.test(e.input.slice(r,e.position))&&Re(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ze(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,W(e,!0,-1));return}if(e.position<e.length-1)v(e,"end of the stream or a document separator is expected");else return}function Na(e,r){e=String(e),r=r||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
17
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var a=new qo(e,r),l=e.indexOf("\0");for(l!==-1&&(a.position=l,v(a,"null byte is not allowed in input")),a.input+="\0";a.input.charCodeAt(a.position)===32;)a.lineIndent+=1,a.position+=1;for(;a.position<a.length-1;)Ro(a);return a.documents}function zo(e,r,a){r!==null&&typeof r=="object"&&typeof a>"u"&&(a=r,r=null);var l=Na(e,a);if(typeof r!="function")return l;for(var n=0,o=l.length;n<o;n+=1)r(l[n])}function Jo(e,r){var a=Na(e,r);if(a.length!==0){if(a.length===1)return a[0];throw new le("expected a single document in the stream, but found more")}}var Wo=zo,Qo=Jo,Va={loadAll:Wo,load:Qo},Ba=Object.prototype.toString,Ia=Object.prototype.hasOwnProperty,gt=65279,Yo=9,ve=10,Zo=13,Go=32,Xo=33,ei=34,yt=35,ti=37,ai=38,ri=39,li=42,Ta=44,ni=45,Je=58,oi=61,ii=62,si=63,ci=64,Aa=91,Ea=93,di=96,Ha=123,hi=124,va=125,te={};te[0]="\\0",te[7]="\\a",te[8]="\\b",te[9]="\\t",te[10]="\\n",te[11]="\\v",te[12]="\\f",te[13]="\\r",te[27]="\\e",te[34]='\\"',te[92]="\\\\",te[133]="\\N",te[160]="\\_",te[8232]="\\L",te[8233]="\\P";var pi=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ui=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function fi(e,r){var a,l,n,o,i,d,c;if(r===null)return{};for(a={},l=Object.keys(r),n=0,o=l.length;n<o;n+=1)i=l[n],d=String(r[i]),i.slice(0,2)==="!!"&&(i="tag:yaml.org,2002:"+i.slice(2)),c=e.compiledTypeMap.fallback[i],c&&Ia.call(c.styleAliases,d)&&(d=c.styleAliases[d]),a[i]=d;return a}function mi(e){var r,a,l;if(r=e.toString(16).toUpperCase(),e<=255)a="x",l=2;else if(e<=65535)a="u",l=4;else if(e<=4294967295)a="U",l=8;else throw new le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+a+Q.repeat("0",l-r.length)+r}var gi=1,$e=2;function yi(e){this.schema=e.schema||pt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Q.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=fi(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?$e:gi,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function $a(e,r){for(var a=Q.repeat(" ",r),l=0,n=-1,o="",i,d=e.length;l<d;)n=e.indexOf(`
|
|
18
|
-
`,l),n===-1?(i=e.slice(l),l=d):(i=e.slice(l,n+1),l=n+1),i.length&&i!==`
|
|
19
|
-
`&&(o+=a),o+=i;return o}function kt(e,r){return`
|
|
20
|
-
`+Q.repeat(" ",e.indent*r)}function ki(e,r){var a,l,n;for(a=0,l=e.implicitTypes.length;a<l;a+=1)if(n=e.implicitTypes[a],n.resolve(r))return!0;return!1}function We(e){return e===Go||e===Yo}function qe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==gt||65536<=e&&e<=1114111}function qa(e){return qe(e)&&e!==gt&&e!==Zo&&e!==ve}function Fa(e,r,a){var l=qa(e),n=l&&!We(e);return(a?l:l&&e!==Ta&&e!==Aa&&e!==Ea&&e!==Ha&&e!==va)&&e!==yt&&!(r===Je&&!n)||qa(r)&&!We(r)&&e===yt||r===Je&&n}function bi(e){return qe(e)&&e!==gt&&!We(e)&&e!==ni&&e!==si&&e!==Je&&e!==Ta&&e!==Aa&&e!==Ea&&e!==Ha&&e!==va&&e!==yt&&e!==ai&&e!==li&&e!==Xo&&e!==hi&&e!==oi&&e!==ii&&e!==ri&&e!==ei&&e!==ti&&e!==ci&&e!==di}function Ci(e){return!We(e)&&e!==Je}function Fe(e,r){var a=e.charCodeAt(r),l;return a>=55296&&a<=56319&&r+1<e.length&&(l=e.charCodeAt(r+1),l>=56320&&l<=57343)?(a-55296)*1024+l-56320+65536:a}function Oa(e){var r=/^\n* /;return r.test(e)}var Ua=1,bt=2,Da=3,Ma=4,Ne=5;function wi(e,r,a,l,n,o,i,d){var c,p=0,h=null,u=!1,f=!1,s=l!==-1,C=-1,_=bi(Fe(e,0))&&Ci(Fe(e,e.length-1));if(r||i)for(c=0;c<e.length;p>=65536?c+=2:c++){if(p=Fe(e,c),!qe(p))return Ne;_=_&&Fa(p,h,d),h=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(p=Fe(e,c),p===ve)u=!0,s&&(f=f||c-C-1>l&&e[C+1]!==" ",C=c);else if(!qe(p))return Ne;_=_&&Fa(p,h,d),h=p}f=f||s&&c-C-1>l&&e[C+1]!==" "}return!u&&!f?_&&!i&&!n(e)?Ua:o===$e?Ne:bt:a>9&&Oa(e)?Ne:i?o===$e?Ne:bt:f?Ma:Da}function Si(e,r,a,l,n){e.dump=function(){if(r.length===0)return e.quotingType===$e?'""':"''";if(!e.noCompatMode&&(pi.indexOf(r)!==-1||ui.test(r)))return e.quotingType===$e?'"'+r+'"':"'"+r+"'";var o=e.indent*Math.max(1,a),i=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),d=l||e.flowLevel>-1&&a>=e.flowLevel;function c(p){return ki(e,p)}switch(wi(r,d,e.indent,i,c,e.quotingType,e.forceQuotes&&!l,n)){case Ua:return r;case bt:return"'"+r.replace(/'/g,"''")+"'";case Da:return"|"+ja(r,e.indent)+Ka($a(r,o));case Ma:return">"+ja(r,e.indent)+Ka($a(_i(r,i),o));case Ne:return'"'+xi(r)+'"';default:throw new le("impossible error: invalid scalar style")}}()}function ja(e,r){var a=Oa(e)?String(r):"",l=e[e.length-1]===`
|
|
21
|
-
`,n=l&&(e[e.length-2]===`
|
|
22
|
-
`||e===`
|
|
23
|
-
`),o=n?"+":l?"":"-";return a+o+`
|
|
24
|
-
`}function Ka(e){return e[e.length-1]===`
|
|
25
|
-
`?e.slice(0,-1):e}function _i(e,r){for(var a=/(\n+)([^\n]*)/g,l=function(){var p=e.indexOf(`
|
|
26
|
-
`);return p=p!==-1?p:e.length,a.lastIndex=p,La(e.slice(0,p),r)}(),n=e[0]===`
|
|
27
|
-
`||e[0]===" ",o,i;i=a.exec(e);){var d=i[1],c=i[2];o=c[0]===" ",l+=d+(!n&&!o&&c!==""?`
|
|
28
|
-
`:"")+La(c,r),n=o}return l}function La(e,r){if(e===""||e[0]===" ")return e;for(var a=/ [^ ]/g,l,n=0,o,i=0,d=0,c="";l=a.exec(e);)d=l.index,d-n>r&&(o=i>n?i:d,c+=`
|
|
29
|
-
`+e.slice(n,o),n=o+1),i=d;return c+=`
|
|
30
|
-
`,e.length-n>r&&i>n?c+=e.slice(n,i)+`
|
|
31
|
-
`+e.slice(i+1):c+=e.slice(n),c.slice(1)}function xi(e){for(var r="",a=0,l,n=0;n<e.length;a>=65536?n+=2:n++)a=Fe(e,n),l=te[a],!l&&qe(a)?(r+=e[n],a>=65536&&(r+=e[n+1])):r+=l||mi(a);return r}function Ni(e,r,a){var l="",n=e.tag,o,i,d;for(o=0,i=a.length;o<i;o+=1)d=a[o],e.replacer&&(d=e.replacer.call(a,String(o),d)),(he(e,r,d,!1,!1)||typeof d>"u"&&he(e,r,null,!1,!1))&&(l!==""&&(l+=","+(e.condenseFlow?"":" ")),l+=e.dump);e.tag=n,e.dump="["+l+"]"}function Pa(e,r,a,l){var n="",o=e.tag,i,d,c;for(i=0,d=a.length;i<d;i+=1)c=a[i],e.replacer&&(c=e.replacer.call(a,String(i),c)),(he(e,r+1,c,!0,!0,!1,!0)||typeof c>"u"&&he(e,r+1,null,!0,!0,!1,!0))&&((!l||n!=="")&&(n+=kt(e,r)),e.dump&&ve===e.dump.charCodeAt(0)?n+="-":n+="- ",n+=e.dump);e.tag=o,e.dump=n||"[]"}function Vi(e,r,a){var l="",n=e.tag,o=Object.keys(a),i,d,c,p,h;for(i=0,d=o.length;i<d;i+=1)h="",l!==""&&(h+=", "),e.condenseFlow&&(h+='"'),c=o[i],p=a[c],e.replacer&&(p=e.replacer.call(a,c,p)),he(e,r,c,!1,!1)&&(e.dump.length>1024&&(h+="? "),h+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),he(e,r,p,!1,!1)&&(h+=e.dump,l+=h));e.tag=n,e.dump="{"+l+"}"}function Bi(e,r,a,l){var n="",o=e.tag,i=Object.keys(a),d,c,p,h,u,f;if(e.sortKeys===!0)i.sort();else if(typeof e.sortKeys=="function")i.sort(e.sortKeys);else if(e.sortKeys)throw new le("sortKeys must be a boolean or a function");for(d=0,c=i.length;d<c;d+=1)f="",(!l||n!=="")&&(f+=kt(e,r)),p=i[d],h=a[p],e.replacer&&(h=e.replacer.call(a,p,h)),he(e,r+1,p,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&ve===e.dump.charCodeAt(0)?f+="?":f+="? "),f+=e.dump,u&&(f+=kt(e,r)),he(e,r+1,h,!0,u)&&(e.dump&&ve===e.dump.charCodeAt(0)?f+=":":f+=": ",f+=e.dump,n+=f));e.tag=o,e.dump=n||"{}"}function Ra(e,r,a){var l,n,o,i,d,c;for(n=a?e.explicitTypes:e.implicitTypes,o=0,i=n.length;o<i;o+=1)if(d=n[o],(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,Ba.call(d.represent)==="[object Function]")l=d.represent(r,c);else if(Ia.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 he(e,r,a,l,n,o,i){e.tag=null,e.dump=a,Ra(e,a,!1)||Ra(e,a,!0);var d=Ba.call(e.dump),c=l,p;l&&(l=e.flowLevel<0||e.flowLevel>r);var h=d==="[object Object]"||d==="[object Array]",u,f;if(h&&(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(h&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),d==="[object Object]")l&&Object.keys(e.dump).length!==0?(Bi(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Vi(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object Array]")l&&e.dump.length!==0?(e.noArrayIndent&&!i&&r>0?Pa(e,r-1,e.dump,n):Pa(e,r,e.dump,n),f&&(e.dump="&ref_"+u+e.dump)):(Ni(e,r,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(d==="[object String]")e.tag!=="?"&&Si(e,e.dump,r,o,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!=="?"&&(p=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?p="!"+p:p.slice(0,18)==="tag:yaml.org,2002:"?p="!!"+p.slice(18):p="!<"+p+">",e.dump=p+" "+e.dump)}return!0}function Ii(e,r){var a=[],l=[],n,o;for(Ct(e,a,l),n=0,o=l.length;n<o;n+=1)r.duplicates.push(a[l[n]]);r.usedDuplicates=new Array(o)}function Ct(e,r,a){var l,n,o;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,o=e.length;n<o;n+=1)Ct(e[n],r,a);else for(l=Object.keys(e),n=0,o=l.length;n<o;n+=1)Ct(e[l[n]],r,a)}function Ti(e,r){r=r||{};var a=new yi(r);a.noRefs||Ii(e,a);var l=e;return a.replacer&&(l=a.replacer.call({"":l},"",l)),he(a,0,l,!0,!0)?a.dump+`
|
|
32
|
-
`:""}var Ai=Ti,Ei={dump:Ai};function wt(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 Hi=G,vi=Jt,$i=Zt,qi=aa,Fi=ra,Oi=pt,Ui=Va.load,Di=Va.loadAll,Mi=Ei.dump,ji=le,Ki={binary:sa,float:ta,map:Yt,null:Gt,pairs:da,set:ha,timestamp:oa,bool:Xt,int:ea,merge:ia,omap:ca,seq:Qt,str:Wt},Li=wt("safeLoad","load"),Pi=wt("safeLoadAll","loadAll"),Ri=wt("safeDump","dump"),zi={Type:Hi,Schema:vi,FAILSAFE_SCHEMA:$i,JSON_SCHEMA:qi,CORE_SCHEMA:Fi,DEFAULT_SCHEMA:Oi,load:Ui,loadAll:Di,dump:Mi,YAMLException:ji,types:Ki,safeLoad:Li,safeLoadAll:Pi,safeDump:Ri};const Ji={class:"yaml-config"},za=t.defineComponent({__name:"YamlCodeBlock",props:{entityRecord:{type:Object,required:!0}},setup(e){const r=e,a=t.computed(()=>{const l=Object.fromEntries(Object.entries(r.entityRecord).filter(([,n])=>n!==null&&n!==""&&(Array.isArray(n)?n.length!==0:!0)));return Object.keys(l).length===0&&l.constructor===Object?"":zi.dump(l).trim()});return(l,n)=>{const o=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Ji,[r.entityRecord?(t.openBlock(),t.createBlock(o,{key:0,id:"yaml-codeblock",code:a.value,language:"yaml",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Wi={class:"terraform-config"},ne=" ",Ja=t.defineComponent({__name:"TerraformCodeBlock",props:{entityRecord:{type:Object,required:!0},entityType:{type:String,required:!0,validator:e=>je.includes(e)},credentialType:{type:String,default:""}},setup(e){const r=e,a=(d,c)=>{const p=ne;let h="";return typeof d=="string"?h+=`${p}${c} = "${d}"
|
|
33
|
-
`:h+=`${p}${c} = ${String(d??"")}
|
|
34
|
-
`,h},l=(d,c,p="")=>{if(typeof d!="object")return"Invalid object";const h=ne+p;let u="";if(c&&(u+=`${h}${c} = {
|
|
35
|
-
`),d===null)return c?u+=`${h}}`:u="{}",u;const f=Object.fromEntries(Object.entries(d).filter(([,C])=>C!==null));let s="";for(const[C,_]of Object.entries(f))Array.isArray(_)?_.length===0?s="[]":(s=`[
|
|
36
|
-
`,s+=n(_,void 0,h),s+=`${h}${ne}]`):_&&typeof _=="object"?(s=`{
|
|
37
|
-
`,s+=l(_,void 0,h),s+=`${h}${ne}}`):s=String(_??""),typeof _=="string"&&(s=`"${s}"`),u+=`${h}${ne}${C} = ${s}
|
|
38
|
-
`;return c?u+=`${h}}
|
|
39
|
-
`:u},n=(d,c,p="")=>{if(!Array.isArray(d))return"Invalid array";const h=ne+p;let u="";c&&(d.length===0?u+=`${h}${c} = [`:u+=`${h}${c} = [
|
|
40
|
-
`);for(let f=0;f<d.length;f++){const s=d[f];typeof s=="object"?(u+=`${h}${ne}{
|
|
41
|
-
`,u+=l(s,void 0,h),u+=`${h}${ne}}`):typeof s=="string"?u+=`${h}${ne}"${s}"`:u+=`${h}${ne}${String(s??"")}`,f<d.length-1&&(u+=","),u+=`
|
|
42
|
-
`}return c&&(d.length===0?u+=`]
|
|
43
|
-
`:u+=`${h}]
|
|
44
|
-
`),u},o=d=>{let c="";for(const[p,h]of Object.entries(d))Array.isArray(h)?c+=n(h,p):typeof h=="object"?c+=l(h,p):c+=a(h,p);return c},i=t.computed(()=>{var d,c,p,h,u,f,s;const C=Object.fromEntries(Object.entries(r.entityRecord).filter(([,B])=>B!=null)),_=r.entityRecord.config?Object.fromEntries(Object.entries((d=r.entityRecord)==null?void 0:d.config).filter(([,B])=>B!=null)):void 0;if(_&&(C.config=_),Object.keys(C).length===0)return"";delete C.id;let g="",x="";if((c=C.service)!=null&&c.id?(x="service",delete C.service):(p=C.route)!=null&&p.id?(x="route",delete C.route):(h=C.consumer)!=null&&h.id?(x="consumer",delete C.consumer):(u=C.consumer_group)!=null&&u.id?(x="consumer_group",delete C.consumer_group):(f=C.certificate)!=null&&f.id?(x="certificate",delete C.certificate):(s=C.set)!=null&&s.id&&(x="set",delete C.set),r.entityType==="plugin"){const B=r.credentialType.replace(/-/g,"_")||(C.name+"").replace(/-/g,"_");delete C.name,g+=`resource "konnect_gateway_plugin_${B}" "my_${B}" {
|
|
45
|
-
`}else g+=`resource "konnect_gateway_${r.entityType}" "my_${r.entityType}" {
|
|
46
|
-
`;return g+=o(C),g+=`${ne}control_plane_id = konnect_gateway_control_plane.my_konnect_cp.id
|
|
47
|
-
`,x&&(g+=`${ne}${x} = {
|
|
48
|
-
`,g+=`${ne}${ne}id = konnect_gateway_${x}.my_${x}.id
|
|
49
|
-
`,g+=`${ne}}
|
|
50
|
-
`),g+=`}
|
|
51
|
-
`,g});return(d,c)=>{const p=t.resolveComponent("KCodeBlock");return t.openBlock(),t.createElementBlock("div",Wi,[r.entityRecord?(t.openBlock(),t.createBlock(p,{key:0,id:"terraform-codeblock",code:i.value,language:"terraform",theme:"dark"},null,8,["code"])):t.createCommentVNode("",!0)])}}}),Qi={key:0,class:"config-card-display-form"},Yi=["data-testid"],Zi={key:0,class:"config-card-prop-section-title"},Gi=t.defineComponent({__name:"ConfigCardDisplay",props:{config:{type:Object,required:!1,default:()=>({})},entityType:{type:String,required:!0,validator:e=>je.includes(e)},propertyCollections:{type:Object,required:!1,default:()=>null},format:{type:String,required:!1,default:"structured",validator:e=>["structured","yaml","json","terraform"].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=i=>!!(i.tooltip||a[`${i.key}-label-tooltip`]),o=t.computed(()=>{if(!r.record)return r.record;const i=JSON.parse(JSON.stringify(r.record));return delete i.created_at,delete i.updated_at,i});return(i,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[e.format==="structured"?(t.openBlock(),t.createElementBlock("div",Qi,[(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",Zi,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],p=>(t.openBlock(),t.createBlock(Kt,{key:p.key,item:p},t.createSlots({label:t.withCtx(()=>[t.renderSlot(i.$slots,`${p.key}-label`,{row:p},void 0,!0)]),[p.key]:t.withCtx(({rowValue:h})=>[t.renderSlot(i.$slots,p.key,{row:p,rowValue:h},void 0,!0)]),_:2},[n(p)?{name:"label-tooltip",fn:t.withCtx(()=>[t.renderSlot(i.$slots,`${p.key}-label-tooltip`,{row:p},void 0,!0)]),key:"0"}:void 0]),1032,["item"]))),128))],10,Yi))),128))])):t.createCommentVNode("",!0),e.format==="json"&&o.value?(t.openBlock(),t.createBlock(Lt,{key:1,config:r.config,"entity-record":o.value,"fetcher-url":r.fetcherUrl,"request-method":"get"},null,8,["config","entity-record","fetcher-url"])):t.createCommentVNode("",!0),e.format==="yaml"&&o.value?(t.openBlock(),t.createBlock(za,{key:2,"entity-record":o.value},null,8,["entity-record"])):t.createCommentVNode("",!0),e.format==="terraform"&&o.value?(t.openBlock(),t.createBlock(Ja,{key:3,"entity-record":o.value,"entity-type":r.entityType},null,8,["entity-record","entity-type"])):t.createCommentVNode("",!0)],64))}}),Xi=ie(Gi,[["__scopeId","data-v-d15be7fe"]]),de="24px",Oe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},es=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),ts=["aria-hidden"],as={key:0,"data-testid":"kui-icon-svg-title"},rs=es(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),ls=t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:de,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",as,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),rs],8,ts))]),_:1},8,["aria-hidden","style"]))}}),ns=Oe(ls,[["__scopeId","data-v-c1f7c39c"]]),os=e=>(t.pushScopeId("data-v-fbe6ddff"),e=e(),t.popScopeId(),e),is=["aria-hidden"],ss={key:0,"data-testid":"kui-icon-svg-title"},cs=os(()=>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)),ds=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:de,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(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",ss,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),cs],8,is))]),_:1},8,["aria-hidden","style"]))}}),hs=Oe(ds,[["__scopeId","data-v-fbe6ddff"]]),ps=e=>(t.pushScopeId("data-v-745761f6"),e=e(),t.popScopeId(),e),us=["aria-hidden"],fs={key:0,"data-testid":"kui-icon-svg-title"},ms=ps(()=>t.createElementVNode("path",{d:"M12 15.4L6 9.4L7.4 8L12 12.6L16.6 8L18 9.4L12 15.4Z",fill:"currentColor"},null,-1)),gs=t.defineComponent({__name:"ChevronDownIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:de,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon chevron-down-icon","data-testid":"kui-icon-wrapper-chevron-down-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-chevron-down-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",fs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ms],8,us))]),_:1},8,["aria-hidden","style"]))}}),ys=Oe(gs,[["__scopeId","data-v-745761f6"]]),ks=e=>(t.pushScopeId("data-v-863d10eb"),e=e(),t.popScopeId(),e),bs=["aria-hidden"],Cs={key:0,"data-testid":"kui-icon-svg-title"},ws=ks(()=>t.createElementVNode("path",{d:"M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",fill:"currentColor"},null,-1)),Ss=t.defineComponent({__name:"CloseIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:de,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon close-icon","data-testid":"kui-icon-wrapper-close-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-close-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Cs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),ws],8,bs))]),_:1},8,["aria-hidden","style"]))}}),_s=Oe(Ss,[["__scopeId","data-v-863d10eb"]]),xs=e=>(t.pushScopeId("data-v-d9894a05"),e=e(),t.popScopeId(),e),Ns=["aria-hidden"],Vs={key:0,"data-testid":"kui-icon-svg-title"},Bs=xs(()=>t.createElementVNode("path",{d:"M12 20C11.45 20 10.9792 19.8042 10.5875 19.4125C10.1958 19.0208 10 18.55 10 18C10 17.45 10.1958 16.9792 10.5875 16.5875C10.9792 16.1958 11.45 16 12 16C12.55 16 13.0208 16.1958 13.4125 16.5875C13.8042 16.9792 14 17.45 14 18C14 18.55 13.8042 19.0208 13.4125 19.4125C13.0208 19.8042 12.55 20 12 20ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.45 10.1958 10.9792 10.5875 10.5875C10.9792 10.1958 11.45 10 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14ZM12 8C11.45 8 10.9792 7.80417 10.5875 7.4125C10.1958 7.02083 10 6.55 10 6C10 5.45 10.1958 4.97917 10.5875 4.5875C10.9792 4.19583 11.45 4 12 4C12.55 4 13.0208 4.19583 13.4125 4.5875C13.8042 4.97917 14 5.45 14 6C14 6.55 13.8042 7.02083 13.4125 7.4125C13.0208 7.80417 12.55 8 12 8Z",fill:"currentColor"},null,-1)),Is=t.defineComponent({__name:"MoreIcon",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:de,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return de}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon more-icon","data-testid":"kui-icon-wrapper-more-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-more-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",Vs,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Bs],8,Ns))]),_:1},8,["aria-hidden","style"]))}}),Ts=Oe(Is,[["__scopeId","data-v-d9894a05"]]),As={class:"config-card-title","data-testid":"config-card-title"},Es={class:"config-card-actions"},Hs=["href"],vs={class:"config-card-details-section"},$s=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:()=>({})},entityType:{type:String,required:!0,validator:e=>je.includes(e)},pluginConfigKey:{type:String,required:!1,default:""},pluginConfigSchema:{type:Object,required:!1,default:()=>({})},fetchUrl:{type:String,required:!0},dataKey:{type:String,required:!1,default:""},hideTitle:{type:Boolean,default:!1},label:{type:String,default:"Format: ",required:!1},configCardDoc:{type:String,default:"",required:!1},titleTag:{type:String,default:"h2"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error"],setup(e,{emit:r}){var a;const l=r,n=e,{i18n:{t:o}}=Z.useI18n(),{getMessageFromError:i}=Z.useErrors(),{convertKeyToTitle:d}=Z.useStringHelpers(),{axiosInstance:c}=Z.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),p=[{label:o("baseConfigCard.general.structuredFormat"),value:"structured",selected:!0},{label:o("baseForm.configuration.json"),value:"json"},{label:o("baseForm.configuration.yaml"),value:"yaml"}];n.enableTerraform&&p.splice(2,0,{label:o("baseForm.configuration.terraform"),value:"terraform"});const h=t.ref("structured"),u=m=>{h.value=m==null?void 0:m.value},f={id:{type:L.ID,label:o("baseConfigCard.commonFields.id_label"),order:0,section:J.Basic},name:{order:1,section:J.Basic},enabled:{type:L.BadgeStatus,order:2,section:J.Basic},updated_at:{type:L.Date,label:o("baseConfigCard.commonFields.updated_at_label"),order:3,section:J.Basic},created_at:{type:L.Date,label:o("baseConfigCard.commonFields.created_at_label"),order:4,section:J.Basic},tags:{type:L.BadgeTag,order:-1,section:J.Basic}},s=t.ref(!1),C=t.ref(!1),_=t.ref(""),g=t.ref({}),x=t.computed(()=>{var m,k,N;if(!g.value)return[];const V=[],S=Object.keys(g.value).length;for(const H in g.value){const E=(k=(m=n.configSchema)==null?void 0:m[H])==null?void 0:k.order,O=(N=f[H])==null?void 0:N.order;let U=S;(O||O===0)&&(U=O===-1?S+1:O),E&&(U=E===-1?S+1:E),V.push([H,U])}return V.sort(function(H,E){return H[1]-E[1]}),V.map(H=>{var E,O;const U=H[0],F=(E=g.value)==null?void 0:E[U],q=((O=n.configSchema)==null?void 0:O[U])||{},j=f[U];return{key:U,value:F,hidden:q.hidden||!1,type:q.type??((j==null?void 0:j.type)||L.Text),label:q.label??((j==null?void 0:j.label)||d(U)),tooltip:q.tooltip??((j==null?void 0:j.tooltip)||void 0),section:q.section??((j==null?void 0:j.section)||J.Advanced)}}).filter(H=>!H.hidden&&H.key!==n.pluginConfigKey)}),B=t.computed(()=>{var m,k;if(!g.value||!n.pluginConfigKey)return[];const N=g.value[n.pluginConfigKey]||{},V=Object.keys(N).length,S=[];for(const H in N){const E=(k=(m=n.pluginConfigSchema)==null?void 0:m[H])==null?void 0:k.order,O=N[H];let U=O!=null&&O!==""?V-1:V;E&&(U=E===-1?V+1:E),S.push([H,U])}return S.sort(function(H,E){return H[1]-E[1]}),S.map(H=>{var E;const O=H[0],U=N[O],F=((E=n.pluginConfigSchema)==null?void 0:E[O])||{};return{key:O,value:U,hidden:F.hidden||!1,type:F.type??L.Text,label:F.label??d(O),tooltip:F.tooltip??void 0,section:J.Plugin}}).filter(H=>!H.hidden)}),I=t.computed(()=>{var m,k,N,V;return{basic:(m=x.value)==null?void 0:m.filter(S=>S.section===J.Basic),advanced:(k=x.value)==null?void 0:k.filter(S=>S.section===J.Advanced),plugin:(V=B.value)==null?void 0:V.concat((N=x.value)==null?void 0:N.filter(S=>S.section===J.Plugin))}}),A=t.computed(()=>{const m=[];return I.value.basic.length&&m.push("basic"),I.value.advanced.length&&m.push("advanced"),I.value.plugin.length&&m.push("plugin"),m}),T=t.computed(()=>{var m,k;let N=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?N=N.replace(/{controlPlaneId}/gi,((m=n.config)==null?void 0:m.controlPlaneId)||""):n.config.app==="kongManager"&&(N=N.replace(/\/{workspace}/gi,(k=n.config)!=null&&k.workspace?`/${n.config.workspace}`:"")),N=N.replace(/{id}/gi,n.config.entityId),N});return t.watch(s,m=>{l("loading",m)},{immediate:!0}),t.onBeforeMount(async()=>{C.value=!1,s.value=!0;try{const{data:m}=await c.get(T.value);if(n.dataKey)if(typeof m[n.dataKey]<"u")g.value={...m[n.dataKey]};else throw new Error(o("errors.dataKeyUndefined",{dataKey:n.dataKey}));else g.value={...m};Object.keys(n.configSchema).filter(k=>n.configSchema[k].forceShow).forEach(k=>{g.value&&typeof g.value[k]>"u"&&(g.value[k]=null)}),l("fetch:success",m)}catch(m){const k=i(m);_.value=k.startsWith("code")?o("baseConfigCard.errors.load"):k,C.value=!0,l("fetch:error",m)}finally{s.value=!1}}),(m,k)=>{const N=t.resolveComponent("KLabel"),V=t.resolveComponent("KSelect"),S=t.resolveComponent("KButton"),H=t.resolveComponent("KSkeleton"),E=t.resolveComponent("KEmptyState"),O=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(O,{class:"kong-ui-entity-base-config-card","title-tag":e.titleTag},t.createSlots({actions:t.withCtx(()=>[t.createElementVNode("div",Es,[t.renderSlot(m.$slots,"actions",{},void 0,!0),t.createVNode(N,{class:"config-format-select-label","data-testid":"config-format-select-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.label),1)]),_:1}),t.createVNode(V,{"data-testid":"select-config-format",items:p,onChange:u}),e.configCardDoc?(t.openBlock(),t.createBlock(S,{key:0,appearance:"tertiary",class:"book-icon","data-testid":"book-icon"},{default:t.withCtx(()=>[t.createElementVNode("a",{href:e.configCardDoc,rel:"noopener",target:"_blank"},[t.createVNode(t.unref(hs),{size:t.unref(hn)},null,8,["size"])],8,Hs)]),_:1})):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[s.value?(t.openBlock(),t.createBlock(H,{key:0,"data-testid":"config-card-loader","table-columns":2,type:"table"})):C.value?(t.openBlock(),t.createBlock(E,{key:1,"data-testid":"config-card-fetch-error","icon-variant":"error"},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(_.value),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",vs,[t.createVNode(Xi,{config:e.config,"entity-type":e.entityType,"fetcher-url":T.value,format:h.value,"prop-list-types":A.value,"property-collections":I.value,record:g.value},t.createSlots({_:2},[t.renderList(Object.keys(m.$slots),U=>({name:U,fn:t.withCtx(({row:F,rowValue:q})=>[t.renderSlot(m.$slots,U,{row:F,rowValue:q},void 0,!0)])}))]),1032,["config","entity-type","fetcher-url","format","prop-list-types","property-collections","record"])])]),_:2},[e.hideTitle?void 0:{name:"title",fn:t.withCtx(()=>[t.createElementVNode("span",As,[t.renderSlot(m.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(t.unref(o)("baseConfigCard.title")),1)],!0)])]),key:"0"}]),1032,["title-tag"])}}}),qs=ie($s,[["__scopeId","data-v-85381f68"]]),Fs=["novalidate"],Os={class:"form-actions","data-testid":"form-actions"},Us=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:""},entityType:{type:String,required:!0,validator:e=>je.includes(e)},fetchUrl:{type:String,required:!1,default:""},isReadonly:{type:Boolean,required:!1,default:!1},canSubmit:{type:Boolean,required:!1,default:void 0},errorMessage:{type:String,required:!1,default:""},formFields:{type:Object,required:!0},noValidate:{type:Boolean,default:!1},wrapperComponent:{type:String,default:"KCard"},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:success","fetch:error","submit","cancel"],setup(e,{emit:r}){var a;const l=r,n=e,o=lt.useRouter(),{i18n:{t:i}}=Z.useI18n(),{getMessageFromError:d}=Z.useErrors(),{axiosInstance:c}=Z.useAxios((a=n.config)==null?void 0:a.axiosRequestConfig),p=t.ref(!1),h=t.computed(()=>!!n.editId),u=t.ref(!1),f=t.ref(""),s=t.computed(()=>n.canSubmit===!1||n.isReadonly),C=t.ref(!1),_=t.computed(()=>{var T,m;let k=`${n.config.apiBaseUrl}${n.fetchUrl}`;return n.config.app==="konnect"?k=k.replace(/{controlPlaneId}/gi,((T=n.config)==null?void 0:T.controlPlaneId)||""):n.config.app==="kongManager"&&(k=k.replace(/\/{workspace}/gi,(m=n.config)!=null&&m.workspace?`/${n.config.workspace}`:"")),n.editId?(k=k.replace(/{id}/gi,n.editId),k):(k=k.replace(/\/{id}/gi,""),k)}),g=()=>{C.value=!C.value},x=()=>{n.config.cancelRoute?o.push(n.config.cancelRoute):B()},B=()=>{l("cancel")},I=()=>{s.value||l("submit")},A=t.ref([{title:i("baseForm.configuration.json"),hash:"#json"},{title:i("baseForm.configuration.yaml"),hash:"#yaml"}]);return n.enableTerraform&&n.entityType!==Ce.Other&&A.value.splice(1,0,{title:i("baseForm.configuration.terraform"),hash:"#terraform"}),t.watch(()=>p.value,T=>{l("loading",T)},{immediate:!0}),t.onBeforeMount(async()=>{if(n.editId)try{u.value=!1,p.value=!0;const{data:T}=await c.get(_.value);l("fetch:success",T)}catch(T){const m=d(T);f.value=m.startsWith("code")?i("baseForm.errors.edit"):m,u.value=!0,l("fetch:error",T)}finally{p.value=!1}}),(T,m)=>{const k=t.resolveComponent("KSkeleton"),N=t.resolveComponent("KEmptyState"),V=t.resolveComponent("KAlert"),S=t.resolveComponent("KButton"),H=t.resolveComponent("KTabs"),E=t.resolveComponent("KSlideout");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.wrapperComponent),{class:"kong-ui-entity-base-form"},{default:t.withCtx(()=>[p.value?(t.openBlock(),t.createBlock(k,{key:0,type:"form"})):u.value?(t.openBlock(),t.createBlock(N,{key:1,"action-button-text":t.unref(i)("baseForm.actions.back"),"data-testid":"form-fetch-error","icon-variant":"error",onClickAction:x},{default:t.withCtx(()=>[t.createElementVNode("h3",null,t.toDisplayString(f.value),1)]),_:1},8,["action-button-text"])):(t.openBlock(),t.createElementBlock("form",{key:2,"data-testid":"form-content",novalidate:n.noValidate,onReset:t.withModifiers(B,["prevent"]),onSubmit:t.withModifiers(I,["prevent"])},[t.renderSlot(T.$slots,"default",{},void 0,!0),e.errorMessage?(t.openBlock(),t.createBlock(V,{key:0,appearance:"danger","data-testid":"form-error",message:e.errorMessage},null,8,["message"])):t.createCommentVNode("",!0),t.createElementVNode("div",Os,[t.renderSlot(T.$slots,"form-actions",{},()=>[t.createVNode(S,{appearance:"tertiary","data-testid":`${e.entityType}-${h.value?"edit":"create"}-form-view-configuration`,onClick:m[0]||(m[0]=O=>g())},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.viewConfiguration")),1)]),_:1},8,["data-testid"]),t.createVNode(S,{appearance:"secondary","data-testid":`${e.entityType}-${h.value?"edit":"create"}-form-cancel`,disabled:e.isReadonly,type:"reset"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.cancel")),1)]),_:1},8,["data-testid","disabled"]),t.createVNode(S,{appearance:"primary","data-testid":`${e.entityType}-${h.value?"edit":"create"}-form-submit`,disabled:s.value,type:"submit"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("baseForm.actions.save")),1)]),_:1},8,["data-testid","disabled"])],!0)])],40,Fs)),t.createVNode(E,{"close-on-blur":!1,"data-testid":"form-view-configuration-slideout","has-overlay":!1,"offset-top":60,title:t.unref(i)("baseForm.configuration.title"),visible:C.value,onClose:m[1]||(m[1]=O=>g())},{default:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("baseForm.configuration.message")),1),t.createVNode(H,{"data-testid":"form-view-configuration-slideout-tabs",tabs:A.value},{json:t.withCtx(()=>[t.createVNode(Lt,{config:e.config,"entity-record":n.formFields,"fetcher-url":_.value,"request-method":n.editId?"put":"post"},null,8,["config","entity-record","fetcher-url","request-method"])]),yaml:t.withCtx(()=>[t.createVNode(za,{"entity-record":n.formFields},null,8,["entity-record"])]),terraform:t.withCtx(()=>[t.createVNode(Ja,{"entity-record":n.formFields,"entity-type":e.entityType},null,8,["entity-record","entity-type"])]),_:1},8,["tabs"])]),_:1},8,["title","visible"])]),_:3})}}}),Wa=ie(Us,[["__scopeId","data-v-94d27e50"]]),Ds=["data-truncate"],Ms=t.defineComponent({__name:"EntityBaseTableCell",props:{keyName:{type:String,required:!0},rowEl:{type:[Object,null],required:!0},tooltip:{type:Boolean,default:!1}},setup(e){const r=e,a=t.computed(()=>{var g;return((g=r.rowEl)==null?void 0:g.querySelector(`[data-testid="${r.keyName}"]`))||null}),l=t.computed(()=>{var g;return((g=a.value)==null?void 0:g.querySelector('[data-truncate="true"]'))||null}),n=t.computed(()=>{var g,x;const B=(g=r.rowEl)==null?void 0:g.querySelectorAll("td");return B?((x=B[0])==null?void 0:x.getAttribute("data-testid"))===r.keyName:!0}),o=t.computed(()=>n.value||r.tooltip);let i;const d=()=>{i&&(i.disconnect(),i=void 0)},c=()=>{var g,x,B;let I=((g=a.value)==null?void 0:g.clientWidth)||0;if(a.value&&"getComputedStyle"in window){const A=window.getComputedStyle(a.value);I-=(parseFloat(A.paddingLeft)||0)+(parseFloat(A.paddingRight)||0)}h.value=((x=l.value)==null?void 0:x.getBoundingClientRect().width)||0,u.value=I,f.value=((B=p.value)==null?void 0:B.innerText)||""},p=t.ref({}),h=t.ref(0),u=t.ref(0),f=t.ref(""),s=t.computed(()=>[l.value,a.value]),C=t.watch(s,g=>{if(o.value&&(d(),"ResizeObserver"in window&&window)){i=new ResizeObserver(x=>{window.requestAnimationFrame(()=>{!Array.isArray(x)||!x.length||c()})});for(const x of g)x&&i.observe(x)}},{immediate:!0,flush:"post",deep:!0}),_=t.computed(()=>o.value?h.value>u.value:!1);return t.onMounted(()=>{c()}),t.onUnmounted(()=>{C()}),(g,x)=>{const B=t.resolveComponent("KTooltip");return t.openBlock(),t.createElementBlock("span",{ref_key:"contentRef",ref:p,class:"content-wrapper"},[o.value?(t.openBlock(),t.createElementBlock("span",{key:0,"data-truncate":o.value||void 0},[t.createVNode(B,{"max-width":"300",placement:"bottom-start",text:_.value?f.value:""},{default:t.withCtx(()=>[t.renderSlot(g.$slots,"default",{},void 0,!0)]),_:3},8,["text"])],8,Ds)):t.renderSlot(g.$slots,"default",{key:1},void 0,!0)],512)}}}),js=ie(Ms,[["__scopeId","data-v-b252463e"]]),Ks={class:"toolbar-container"},Ls={key:0,class:"toolbar-button-container"},Ps=["data-testid"],Rs=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},sortHandlerFunction:{type:Function,default:()=>({})},enableEntityActions:{type:Boolean,default:!0},emptyStateOptions:{type:Object,default:()=>({})},errorMessage:{type:[String,Object],default:null},disablePaginationPageJump:{type:Boolean,default:void 0},disableSorting:{type:Boolean,default:void 0},paginationType:{type:String,default:void 0},cellAttributes:{type:Function,default:()=>({})},rowAttributes:{type:Function,default:()=>({})},preferencesStorageKey:{type:String,default:"",required:!0},dropdownMenuWidth:{type:String,default:"",required:!1},title:{type:String,default:""},titleTag:{type:String,default:"h2"},disableRowClick:{type:Boolean,default:!1}},emits:["click:row","sort","clear-search-input","empty-state-cta-clicked"],setup(e,{emit:r}){const a=e,l=r,{i18n:{t:n}}=Z.useI18n(),o=t.computed(()=>{var m,k;return typeof a.errorMessage=="string"?{hasError:!!a.errorMessage,title:a.errorMessage,message:void 0}:{hasError:!!a.errorMessage,title:(m=a.errorMessage)==null?void 0:m.title,message:(k=a.errorMessage)==null?void 0:k.message}}),i=t.computed(()=>a.cacheIdentifier||a.preferencesStorageKey),d=m=>m.hasData||!!a.query,c=t.computed(()=>{const m=[];return Object.keys(a.tableHeaders).forEach(k=>{const N=a.tableHeaders[k];m.push({label:N.label??k,key:k,sortable:N.sortable??!1,hidable:N.hidable??!0})}),a.enableEntityActions&&m.push({key:"actions",hideLabel:!0}),m}),p=m=>({"data-rowid":m.id,"data-testid":m.name,...a.rowAttributes(m)}),h=t.ref({}),u=m=>{var k;return(k=h.value)==null?void 0:k.$el.querySelector(`[data-rowid="${m.id}"]`)},f=m=>{const k={"data-testid":m.headerKey,...a.cellAttributes(m)};return m.colIndex===0&&(k.style={maxWidth:"250px",overflowX:"hidden",textOverflow:"ellipsis"}),k},s=()=>{l("empty-state-cta-clicked"),C()},C=()=>{l("clear-search-input")},_=t.computed(()=>a.disableRowClick?void 0:(m,k)=>{l("click:row",k)}),g=m=>{l("sort",m)},{setTablePreferences:x,getTablePreferences:B}=Tl(),I=t.ref(B(i.value)),A=t.computed(()=>{const m=B(i.value);return{...a.initialFetcherParams,...m}}),T=m=>{I.value=m,c.value.forEach(k=>{!("hidable"in k)||!I.value.columnVisibility||k.hidable===!1&&(I.value.columnVisibility[k.key]=!0)}),i.value&&x(i.value,m)};return(m,k)=>{const N=t.resolveComponent("KButton"),V=t.resolveComponent("KDropdown"),S=t.resolveComponent("KTable"),H=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(H,{class:"kong-ui-entity-base-table",title:e.title,"title-tag":e.titleTag},{default:t.withCtx(()=>[t.createVNode(S,{ref_key:"tableRefs",ref:h,"cache-identifier":i.value,"cell-attrs":f,"client-sort":e.enableClientSort,"disable-pagination-page-jump":e.disablePaginationPageJump,"empty-state-action-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsCtaText"):e.emptyStateOptions.ctaText,"empty-state-action-route":e.query?void 0:e.emptyStateOptions.ctaPath,"empty-state-icon-variant":e.query?"search":"kong","empty-state-message":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsMessage"):e.emptyStateOptions.message,"empty-state-title":e.query?t.unref(n)("baseTable.emptyState.noSearchResultsTitle"):e.emptyStateOptions.title,error:o.value.hasError,"error-state-message":o.value.message,"error-state-title":o.value.title,fetcher:e.fetcher,"fetcher-cache-key":String(e.fetcherCacheKey),headers:c.value,"hide-pagination-when-optional":"","initial-fetcher-params":A.value,loading:e.isLoading,"pagination-offset":e.paginationType==="offset","resize-columns":"","row-attrs":p,"search-input":e.query,"sort-handler-function":e.enableClientSort?e.sortHandlerFunction:void 0,sortable:!e.disableSorting,"table-preferences":I.value,onEmptyStateActionClick:s,"onRow:click":_.value,onSort:k[0]||(k[0]=E=>g(E)),"onUpdate:tablePreferences":T},t.createSlots({toolbar:t.withCtx(({state:E})=>[t.withDirectives(t.createElementVNode("div",Ks,[t.renderSlot(m.$slots,"toolbar-filter",{},void 0,!0),m.$slots["toolbar-button"]?(t.openBlock(),t.createElementBlock("div",Ls,[t.renderSlot(m.$slots,"toolbar-button",{},void 0,!0)])):t.createCommentVNode("",!0)],512),[[t.vShow,d(E)]])]),actions:t.withCtx(({row:E,rowKey:O,rowValue:U})=>[t.createElementVNode("div",{class:"actions-container","data-testid":E.name},[t.createVNode(V,{"kpop-attributes":{placement:"bottom-end"},width:e.dropdownMenuWidth},{items:t.withCtx(()=>[t.renderSlot(m.$slots,"actions",{row:E,rowKey:O,rowValue:U},void 0,!0)]),default:t.withCtx(()=>[t.createVNode(N,{appearance:"tertiary",class:"actions-trigger","data-testid":"overflow-actions-button",icon:"",size:"small"},{default:t.withCtx(()=>[t.createVNode(t.unref(Ts))]),_:1})]),_:2},1032,["width"])],8,Ps)]),_:2},[t.renderList(e.tableHeaders,(E,O)=>({name:O,fn:t.withCtx(({row:U,rowKey:F,rowValue:q})=>[t.createVNode(js,{"key-name":String(O),"row-el":u(U),tooltip:E.tooltip},{default:t.withCtx(()=>[t.renderSlot(m.$slots,O,{row:U,rowKey:F,rowValue:q},()=>[t.createTextVNode(t.toDisplayString(q),1)],!0)]),_:2},1032,["key-name","row-el","tooltip"])])})),e.query?void 0:{name:"empty-state-action-icon",fn:t.withCtx(()=>[t.createVNode(t.unref(ns))]),key:"0"}]),1032,["cache-identifier","client-sort","disable-pagination-page-jump","empty-state-action-message","empty-state-action-route","empty-state-icon-variant","empty-state-message","empty-state-title","error","error-state-message","error-state-title","fetcher","fetcher-cache-key","headers","initial-fetcher-params","loading","pagination-offset","search-input","sort-handler-function","sortable","table-preferences","onRow:click"])]),_:3},8,["title","title-tag"])}}}),Qa=ie(Rs,[["__scopeId","data-v-71b4425a"]]),zs={key:0,class:"kong-ui-entity-delete-error"},Js={key:1,class:"description"},Ws=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,o=t.computed(()=>l.needConfirm?l.entityName:""),i=()=>{n("cancel")},d=()=>{n("proceed")};return(c,p)=>{const h=t.resolveComponent("KAlert"),u=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(u,{"action-button-appearance":"danger","action-button-disabled":e.actionPending,"action-button-text":"Yes, delete",class:"kong-ui-entity-delete-modal","confirmation-text":o.value,title:e.title,visible:e.visible,onCancel:i,onProceed:d},{default:t.withCtx(()=>[e.error?(t.openBlock(),t.createElementBlock("div",zs,[t.createVNode(h,{appearance:"danger"},{default: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",Js,[t.renderSlot(c.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(l.description),1)],!0)])):t.createCommentVNode("",!0)]),_:3},8,["action-button-disabled","confirmation-text","title","visible"])}}}),Ya=ie(Ws,[["__scopeId","data-v-4361d622"]]),Qs={fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},Ys={id:"mask0_180_20349",height:"20",maskUnits:"userSpaceOnUse",style:{"mask-type":"alpha"},width:"20",x:"0",y:"0"},Zs=["fill"],Gs={mask:"url(#mask0_180_20349)"},Xs=["fill"],Za=t.defineComponent({__name:"IconFilter",props:{color:{type:String,default:`var(--kong-ui-entity-filter-color, ${on})`}},setup(e){return(r,a)=>(t.openBlock(),t.createElementBlock("svg",Qs,[t.createElementVNode("mask",Ys,[t.createElementVNode("rect",{fill:e.color,height:"20",width:"20"},null,8,Zs)]),t.createElementVNode("g",Gs,[t.createElementVNode("path",{d:"M8 14.5V13H12V14.5H8ZM5 10.75V9.25H15V10.75H5ZM3 7V5.5H17V7H3Z",fill:e.color},null,8,Xs)])]))}}),ec={key:1,class:"kong-ui-entity-filter"},tc={class:"kong-ui-entity-filter-menu"},ac=["data-testid"],rc=["onClick","onKeydown"],lc={class:"menu-item-indicator"},nc={class:"menu-item-body"},oc=["for"],ic={class:"menu-item-buttons"},sc={class:"filter-clear-button-container"},cc=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,o=t.ref(!1),i=t.ref({}),d=t.ref(new Set),c=t.computed(()=>{const A=[];return new URLSearchParams(l.modelValue).forEach((T,m)=>{T!==""&&A.push(m)}),A}),p=t.computed(()=>{const A=l.config.fields;return Object.keys(A).filter(T=>{var m;return(m=A==null?void 0:A[T])==null?void 0:m.searchable}).map(T=>({label:A[T].label||T,value:T,expanded:!1}))});t.watch(()=>l.modelValue,A=>{i.value={},new URLSearchParams(A).forEach((T,m)=>{i.value[m]=T})});const h=()=>{o.value=!o.value},u=A=>{d.value.has(A)?d.value.delete(A):d.value.add(A)},f=A=>{n("update:modelValue",A)},s=()=>{f("")},C=A=>`filter-${A}`,_=A=>{var T,m;return(((m=(T=l.config.schema)==null?void 0:T[A])==null?void 0:m.values)??[]).map(k=>({value:k,label:k}))},g=A=>{var T,m;return((m=(T=l.config.schema)==null?void 0:T[A])==null?void 0:m.type)??"text"},x=A=>{i.value={...i.value,[A]:""},I()},B=()=>{i.value={},I(!0)},I=(A=!1)=>{const T=Object.keys(i.value).reduce((m,k)=>(i.value[k]&&(m[k]=`${i.value[k]}`),m),{});A&&(o.value=!1),n("update:modelValue",new URLSearchParams(T).toString())};return(A,T)=>{const m=t.resolveComponent("KInput"),k=t.resolveComponent("KButton"),N=t.resolveComponent("KSelect");return e.config.isExactMatch?(t.openBlock(),t.createBlock(m,{key:0,autocomplete:"off",class:"kong-ui-entity-filter-input","data-testid":"search-input","model-value":e.modelValue,placeholder:e.config.placeholder,"onUpdate:modelValue":f},{before:t.withCtx(()=>[t.createVNode(Za)]),after:t.withCtx(()=>[t.withDirectives(t.createVNode(t.unref(_s),{class:"kong-ui-entity-filter-clear",onClick:s},null,512),[[t.vShow,e.modelValue!==""]])]),_:1},8,["model-value","placeholder"])):(t.openBlock(),t.createElementBlock("div",ec,[t.createVNode(k,{appearance:"tertiary","data-testid":"filter-button",onClick:h},{default:t.withCtx(()=>[t.createVNode(Za),t.createTextVNode(" "+t.toDisplayString(t.unref(a)("filter.filterButtonText"))+" "+t.toDisplayString(c.value.length>0?`(${c.value.length})`:""),1)]),_:1}),t.withDirectives(t.createElementVNode("div",{class:"kong-ui-entity-filter-backdrop",onClick:h},null,512),[[t.vShow,o.value]]),t.withDirectives(t.createElementVNode("div",tc,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,V=>{var S,H;return t.openBlock(),t.createElementBlock("div",{key:V.value,class:"kong-ui-entity-filter-menu-item","data-testid":V.value},[t.createElementVNode("span",{class:t.normalizeClass(["menu-item-title",{expanded:d.value.has(V.value)}]),role:"button",tabindex:"0",onClick:E=>u(V.value),onKeydown:t.withKeys(E=>u(V.value),["enter"])},[t.createTextVNode(t.toDisplayString(V.label)+" ",1),t.withDirectives(t.createElementVNode("span",lc,null,512),[[t.vShow,c.value.includes(V.value)]]),t.createVNode(t.unref(ys),{class:t.normalizeClass(["menu-item-expand-icon",{expanded:d.value.has(V.value)}]),color:t.unref(cn)},null,8,["class","color"])],42,rc),t.withDirectives(t.createElementVNode("div",nc,[t.createElementVNode("label",{class:"menu-item-label",for:C(V.value)},t.toDisplayString(t.unref(a)("filter.fieldLabel")),9,oc),((H=(S=e.config.schema)==null?void 0:S[V.value])==null?void 0:H.type)==="select"?(t.openBlock(),t.createBlock(N,{key:0,id:C(V.value),modelValue:i.value[V.value],"onUpdate:modelValue":E=>i.value[V.value]=E,items:_(V.value),placeholder:t.unref(a)("filter.selectPlaceholder")},null,8,["id","modelValue","onUpdate:modelValue","items","placeholder"])):(t.openBlock(),t.createBlock(m,{key:1,id:C(V.value),modelValue:i.value[V.value],"onUpdate:modelValue":E=>i.value[V.value]=E,autocomplete:"off",placeholder:t.unref(a)("filter.inputPlaceholder"),type:g(V.value)},null,8,["id","modelValue","onUpdate:modelValue","placeholder","type"]))],512),[[t.vShow,d.value.has(V.value)]]),t.withDirectives(t.createElementVNode("div",ic,[t.createVNode(k,{appearance:"tertiary","data-testid":"apply-filter",size:"small",onClick:T[0]||(T[0]=E=>I(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.applyButtonText")),1)]),_:1}),t.createVNode(k,{appearance:"tertiary","data-testid":"clear-filter",size:"small",onClick:E=>x(V.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearButtonText")),1)]),_:2},1032,["onClick"])],512),[[t.vShow,d.value.has(V.value)]])],8,ac)}),128)),t.createElementVNode("div",sc,[t.createVNode(k,{appearance:"tertiary",size:"small",onClick:B},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("filter.clearAllButtonText")),1)]),_:1})])],512),[[t.vShow,o.value]])]))}}}),dc=ie(cc,[["__scopeId","data-v-94990087"]]),pe=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,o)=>l.value?t.renderSlot(n.$slots,"default",{key:0,isAllowed:a.value}):t.createCommentVNode("",!0)}});let Qe;const hc=new Uint8Array(16);function pc(){if(!Qe&&(Qe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qe(hc)}const X=[];for(let e=0;e<256;++e)X.push((e+256).toString(16).slice(1));function uc(e,r=0){return X[e[r+0]]+X[e[r+1]]+X[e[r+2]]+X[e[r+3]]+"-"+X[e[r+4]]+X[e[r+5]]+"-"+X[e[r+6]]+X[e[r+7]]+"-"+X[e[r+8]]+X[e[r+9]]+"-"+X[e[r+10]]+X[e[r+11]]+X[e[r+12]]+X[e[r+13]]+X[e[r+14]]+X[e[r+15]]}const fc=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ga={randomUUID:fc};function mc(e,r,a){if(Ga.randomUUID&&!r&&!e)return Ga.randomUUID();e=e||{};const l=e.random||(e.rng||pc)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,r){a=a||0;for(let n=0;n<16;++n)r[a+n]=l[n];return r}return uc(l)}const gc=["aria-labelledby"],yc={class:"form-section-wrapper"},kc={key:1,class:"form-section-description"},bc={key:2,class:"form-section-footer"},Cc={class:"form-section-content"},wc=t.defineComponent({__name:"EntityFormSection",props:{title:{type:String,default:""},description:{type:String,default:""},hasDivider:{type:Boolean,default:!1},stickyInfoHeader:{type:Boolean,default:!0},hideInfoHeader:{type:Boolean,default:!1},titleTag:{type:String,default:"h2"}},setup(e){const r=t.useSlots(),a=mc();return(l,n)=>(t.openBlock(),t.createElementBlock("div",{"aria-labelledby":e.title?t.unref(a):void 0,class:t.normalizeClass(["kong-ui-entity-form-section",{"has-divider":e.hasDivider}]),role:"group"},[t.createElementVNode("div",yc,[e.hideInfoHeader?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["form-section-info",{sticky:e.stickyInfoHeader}])},[e.title?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.titleTag),{key:0,id:t.unref(a),class:"form-section-title"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.title),1)]),_:1},8,["id"])):t.createCommentVNode("",!0),e.description||t.unref(r).description?(t.openBlock(),t.createElementBlock("div",kc,[t.renderSlot(l.$slots,"description",{},()=>[t.createElementVNode("p",null,t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),t.unref(r).footer?(t.openBlock(),t.createElementBlock("div",bc,[t.renderSlot(l.$slots,"footer",{},void 0,!0)])):t.createCommentVNode("",!0)],2)),t.createElementVNode("div",Cc,[t.renderSlot(l.$slots,"default",{},void 0,!0)])])],10,gc))}}),Ue=ie(wc,[["__scopeId","data-v-b1f74200"]]),{useAxios:Ye,useDeleteUrlBuilder:Xa,useErrors:er,useExternalLinkCreator:Bd,useFetchUrlBuilder:Id,useFetcher:tr,useDebouncedFilter:ar,useStringHelpers:Td,useHelpers:Sc,useGatewayFeatureSupported:Ad,useTruncationDetector:Ed,useValidators:Hd}=Z,Ze="24px",rr=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},_c=e=>(t.pushScopeId("data-v-c1f7c39c"),e=e(),t.popScopeId(),e),xc=["aria-hidden"],Nc={key:0,"data-testid":"kui-icon-svg-title"},Vc=_c(()=>t.createElementVNode("path",{d:"M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",fill:"currentColor"},null,-1)),St=rr(t.defineComponent({__name:"AddIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:Ze,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return Ze}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon add-icon","data-testid":"kui-icon-wrapper-add-icon",style:t.normalizeStyle(l.value)},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{"aria-hidden":e.decorative?"true":void 0,"data-testid":"kui-icon-svg-add-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[e.title?(t.openBlock(),t.createElementBlock("title",Nc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Vc],8,xc))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c1f7c39c"]]),Bc=e=>(t.pushScopeId("data-v-c73ebbaa"),e=e(),t.popScopeId(),e),Ic=["aria-hidden"],Tc={key:0,"data-testid":"kui-icon-svg-title"},Ac=Bc(()=>t.createElementVNode("path",{d:"M7 21C6.45 21 5.97917 20.8042 5.5875 20.4125C5.19583 20.0208 5 19.55 5 19V6H4V4H9V3H15V4H20V6H19V19C19 19.55 18.8042 20.0208 18.4125 20.4125C18.0208 20.8042 17.55 21 17 21H7ZM17 6H7V19H17V6ZM9 17H11V8H9V17ZM13 17H15V8H13V17Z",fill:"currentColor"},null,-1)),Ec=rr(t.defineComponent({__name:"TrashIcon",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:Ze,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,""),o=Number(n);if(o&&!isNaN(o)&&Number.isInteger(o)&&o>0)return`${o}px`}return Ze}),l=t.computed(()=>({boxSizing:"border-box",color:r.color,display:r.display,flexShrink:"0",height:a.value,lineHeight:"0",width:a.value}));return(n,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.as),{"aria-hidden":e.decorative?"true":void 0,class:"kui-icon trash-icon","data-testid":"kui-icon-wrapper-trash-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-trash-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",Tc,t.toDisplayString(e.title),1)):t.createCommentVNode("",!0),Ac],8,Ic))]),_:1},8,["aria-hidden","style"]))}}),[["__scopeId","data-v-c73ebbaa"]]),Hc={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 vc(){const e=Me.createI18n("en-us",Hc);return{i18n:e,i18nT:Me.i18nTComponent(e)}}function De(e){const{replaceId:r=!1}=e,a=t.ref([]);return{addedItems:a,trackNewItems:(n,o)=>{if(o){const i={...n};r&&(i.value=n.label),a.value.push(i)}else a.value=a.value.filter(i=>i.value!==n.value)}}}const Ge=[{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"}],_t=10,xt=65536,$c=0,qc=65535,Ve=0,Be=255,lr=0,nr=255,Fc=0,Oc=65535,or=0,ir=65535,Uc=0,Dc=2**31,Nt=["200","302"],Vt=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],Bt=["429","404","500","501","502","503","504","505"],It=["429","500","503"];function Xe(){const e=c=>/^\d+$/.test(c),r=(c,p,h)=>{if(e(c)){const u=Number(c);return u>=p&&u<=h}else return!1},a=c=>c.map(p=>Number(p)),l=c=>c.map(p=>p.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:Nt,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:Bt,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:Vt,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:It,tcpFailures:"5"}});return{isInteger:e,inRange:r,stringToNumberArray:a,numberToStringArray:l,upstreamsResponseToFields:c=>{var h,u,f,s,C,_,g,x,B,I,A,T,m,k,N,V,S,H,E,O,U,F,q,j,Y,$,D,K,b,y,w,R,M,z,ee,P,ae,be,Ee,cr,dr,hr,pr,ur,fr,mr,gr,yr,kr,br,Cr,wr,Sr,_r,xr,Nr,Vr,Br,Ir,Tr,Ar,Er,Hr,vr,$r,qr,Fr,Or,Ur,Dr,Mr,jr,Kr,Lr,Pr,Rr,zr,Jr,Wr,Qr,Yr,Zr,Gr,Xr,el,tl,al,rl,ll,nl,ol,il,sl,cl,dl,hl,pl,ul,fl,ml,gl,yl,kl,bl,Cl,wl,Sl,_l,xl;const p=n();return p.name=c.name||"",p.algorithm=c.algorithm||"round-robin",p.hostHeader=c.host_header||"",p.clientCertificate=c.client_certificate?(h=c.client_certificate)==null?void 0:h.id:"",p.tags=((u=c.tags)==null?void 0:u.join(", "))||"",p.slots=c.slots!==null&&c.slots!==void 0?c.slots.toString():"10000",p.hashOn=c.hash_on||"none",p.hashFallback=c.hash_fallback||"none",p.hashOnHeader=c.hash_on_header||"",p.hashOnCookie=c.hash_on_cookie||"",p.hashOnCookiePath=c.hash_on_cookie_path||"/",p.hashOnQueryArgument=c.hash_on_query_arg||"",p.hashOnUriCapture=c.hash_on_uri_capture||"",p.hashFallbackHeader=c.hash_fallback_header||"",p.hashFallbackQueryArgument=c.hash_fallback_query_arg||"",p.hashFallbackUriCapture=c.hash_fallback_uri_capture||"",p.healthchecksThreshold=c.healthchecks.threshold!==null&&c.healthchecks.threshold!==void 0?c.healthchecks.threshold.toString():"",p.activeHealthSwitch=((s=(f=c.healthchecks.active)==null?void 0:f.healthy)==null?void 0:s.interval)!==0||((_=(C=c.healthchecks.active)==null?void 0:C.unhealthy)==null?void 0:_.interval)!==0,p.activeHealthCheck.type=((g=c.healthchecks.active)==null?void 0:g.type)||"http",p.activeHealthCheck.httpPath=((x=c.healthchecks.active)==null?void 0:x.http_path)||"/",p.activeHealthCheck.timeout=((B=c.healthchecks.active)==null?void 0:B.timeout)!==null&&((I=c.healthchecks.active)==null?void 0:I.timeout)!==void 0?(T=(A=c.healthchecks.active)==null?void 0:A.timeout)==null?void 0:T.toString():"",p.activeHealthCheck.concurrency=((m=c.healthchecks.active)==null?void 0:m.concurrency)!==null&&((k=c.healthchecks.active)==null?void 0:k.concurrency)!==void 0?(V=(N=c.healthchecks.active)==null?void 0:N.concurrency)==null?void 0:V.toString():"",p.activeHealthCheck.httpsSni=((S=c.healthchecks.active)==null?void 0:S.https_sni)||"",p.activeHealthCheck.verifySsl=((H=c.healthchecks.active)==null?void 0:H.https_verify_certificate)||!1,p.activeHealthCheck.headers=(E=c.healthchecks.active)!=null&&E.headers&&Object.entries((O=c.healthchecks.active)==null?void 0:O.headers).length>0?Object.entries((U=c.healthchecks.active)==null?void 0:U.headers).map(([Vd,Tt])=>({key:Vd,values:Tt==null?void 0:Tt.join(", ")})):[{key:"",values:""}],p.activeHealthCheck.interval=((q=(F=c.healthchecks.active)==null?void 0:F.healthy)==null?void 0:q.interval)!==null&&((Y=(j=c.healthchecks.active)==null?void 0:j.healthy)==null?void 0:Y.interval)!==void 0?(K=(D=($=c.healthchecks.active)==null?void 0:$.healthy)==null?void 0:D.interval)==null?void 0:K.toString():"0",p.activeHealthCheck.interval=((y=(b=c.healthchecks.active)==null?void 0:b.healthy)==null?void 0:y.interval)!==null&&((R=(w=c.healthchecks.active)==null?void 0:w.healthy)==null?void 0:R.interval)!==void 0?(ee=(z=(M=c.healthchecks.active)==null?void 0:M.healthy)==null?void 0:z.interval)==null?void 0:ee.toString():"0",p.activeHealthCheck.successes=((ae=(P=c.healthchecks.active)==null?void 0:P.healthy)==null?void 0:ae.successes)!==null&&((Ee=(be=c.healthchecks.active)==null?void 0:be.healthy)==null?void 0:Ee.successes)!==void 0?(hr=(dr=(cr=c.healthchecks.active)==null?void 0:cr.healthy)==null?void 0:dr.successes)==null?void 0:hr.toString():"0",p.activeHealthCheck.httpStatuses=(ur=(pr=c.healthchecks.active)==null?void 0:pr.healthy)!=null&&ur.http_statuses?l(((mr=(fr=c.healthchecks.active)==null?void 0:fr.healthy)==null?void 0:mr.http_statuses)||[]):Nt,p.activeHealthCheck.unhealthyInterval=((yr=(gr=c.healthchecks.active)==null?void 0:gr.unhealthy)==null?void 0:yr.interval)!==null&&((br=(kr=c.healthchecks.active)==null?void 0:kr.unhealthy)==null?void 0:br.interval)!==void 0?(Sr=(wr=(Cr=c.healthchecks.active)==null?void 0:Cr.unhealthy)==null?void 0:wr.interval)==null?void 0:Sr.toString():"0",p.activeHealthCheck.httpFailures=((xr=(_r=c.healthchecks.active)==null?void 0:_r.unhealthy)==null?void 0:xr.http_failures)!==null&&((Vr=(Nr=c.healthchecks.active)==null?void 0:Nr.unhealthy)==null?void 0:Vr.http_failures)!==void 0?(Tr=(Ir=(Br=c.healthchecks.active)==null?void 0:Br.unhealthy)==null?void 0:Ir.http_failures)==null?void 0:Tr.toString():"0",p.activeHealthCheck.unhealthyTimeouts=((Er=(Ar=c.healthchecks.active)==null?void 0:Ar.unhealthy)==null?void 0:Er.timeouts)!==null&&((vr=(Hr=c.healthchecks.active)==null?void 0:Hr.unhealthy)==null?void 0:vr.timeouts)!==void 0?(Fr=(qr=($r=c.healthchecks.active)==null?void 0:$r.unhealthy)==null?void 0:qr.timeouts)==null?void 0:Fr.toString():"0",p.activeHealthCheck.unhealthyHttpStatuses=(Ur=(Or=c.healthchecks.active)==null?void 0:Or.unhealthy)!=null&&Ur.http_statuses?l(((Mr=(Dr=c.healthchecks.active)==null?void 0:Dr.unhealthy)==null?void 0:Mr.http_statuses)||[]):Bt,p.passiveHealthSwitch=((Kr=(jr=c.healthchecks.passive)==null?void 0:jr.healthy)==null?void 0:Kr.successes)!==0||((Pr=(Lr=c.healthchecks.passive)==null?void 0:Lr.unhealthy)==null?void 0:Pr.timeouts)!==0||((zr=(Rr=c.healthchecks.passive)==null?void 0:Rr.unhealthy)==null?void 0:zr.tcp_failures)!==0||((Wr=(Jr=c.healthchecks.passive)==null?void 0:Jr.unhealthy)==null?void 0:Wr.http_failures)!==0,p.passiveHealthCheck.type=((Qr=c.healthchecks.passive)==null?void 0:Qr.type)||"http",p.passiveHealthCheck.successes=((Zr=(Yr=c.healthchecks.passive)==null?void 0:Yr.healthy)==null?void 0:Zr.successes)!==null&&((Xr=(Gr=c.healthchecks.passive)==null?void 0:Gr.healthy)==null?void 0:Xr.successes)!==void 0?(al=(tl=(el=c.healthchecks.passive)==null?void 0:el.healthy)==null?void 0:tl.successes)==null?void 0:al.toString():"0",p.passiveHealthCheck.httpStatuses=(ll=(rl=c.healthchecks.passive)==null?void 0:rl.healthy)!=null&&ll.http_statuses?l(((ol=(nl=c.healthchecks.passive)==null?void 0:nl.healthy)==null?void 0:ol.http_statuses)||[]):Vt,p.passiveHealthCheck.timeouts=((sl=(il=c.healthchecks.passive)==null?void 0:il.unhealthy)==null?void 0:sl.timeouts)!==null&&((dl=(cl=c.healthchecks.passive)==null?void 0:cl.unhealthy)==null?void 0:dl.timeouts)!==void 0?(ul=(pl=(hl=c.healthchecks.passive)==null?void 0:hl.unhealthy)==null?void 0:pl.timeouts)==null?void 0:ul.toString():"0",p.passiveHealthCheck.tcpFailures=((ml=(fl=c.healthchecks.passive)==null?void 0:fl.unhealthy)==null?void 0:ml.tcp_failures)!==null&&((yl=(gl=c.healthchecks.passive)==null?void 0:gl.unhealthy)==null?void 0:yl.tcp_failures)!==void 0?(Cl=(bl=(kl=c.healthchecks.passive)==null?void 0:kl.unhealthy)==null?void 0:bl.tcp_failures)==null?void 0:Cl.toString():"",p.passiveHealthCheck.unhealthyHttpStatuses=(Sl=(wl=c.healthchecks.passive)==null?void 0:wl.unhealthy)!=null&&Sl.http_statuses?l(((xl=(_l=c.healthchecks.passive)==null?void 0:_l.unhealthy)==null?void 0:xl.http_statuses)||[]):It,p},getDefaultUpstreamFields:n,objectsAreEqual:(c,p)=>{try{return JSON.stringify(c)===JSON.stringify(p)}catch{return!1}},cloneDeep:c=>JSON.parse(JSON.stringify(c))}}const ue={useI18n:vc,useMultiselectCreation:De,useHelpers:Xe},Ie="/v2/control-planes/{controlPlaneId}/core-entities",Te="/{workspace}",Ae={list:{konnect:`${Ie}/upstreams`,kongManager:`${Te}/upstreams`},form:{konnect:{getServices:`${Ie}/services`,getCertificates:`${Ie}/certificates`,validate:`${Ie}/v1/schemas/json/upstream/validate`,create:`${Ie}/upstreams`,edit:`${Ie}/upstreams/{id}`},kongManager:{getServices:`${Te}/services`,getCertificates:`${Te}/certificates`,validate:`${Te}/schemas/upstreams/validate`,create:`${Te}/upstreams`,edit:`${Te}/upstreams/{id}`}}},Mc={class:"kong-ui-entities-upstreams-list"},jc={class:"upstream-name"},Kc=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 Y;const a=r,l=e,{i18n:{t:n}}=ue.useI18n(),o=lt.useRouter(),{axiosInstance:i}=Ye((Y=l.config)==null?void 0:Y.axiosRequestConfig),d=t.ref(1),c=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),p={name:{label:n("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:n("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:n("upstreams.list.table_headers.tags"),sortable:!1}},h=p,u=t.computed(()=>{var D,K;let $=`${l.config.apiBaseUrl}${Ae.list[l.config.app]}`;return l.config.app==="konnect"?$=$.replace(/{controlPlaneId}/gi,((D=l.config)==null?void 0:D.controlPlaneId)||""):l.config.app==="kongManager"&&($=$.replace(/\/{workspace}/gi,(K=l.config)!=null&&K.workspace?`/${l.config.workspace}`:"")),$}),f=t.ref(""),s=t.computed(()=>{const $=l.config.app==="konnect"||l.config.isExactMatch;if($)return{isExactMatch:$,placeholder:n("upstreams.search.placeholder")};const{name:D,slots:K}=p;return{isExactMatch:$,fields:{name:D,slots:K},schema:l.config.filterSchema}}),{fetcher:C,fetcherState:_}=tr(l.config,u.value),g=()=>{f.value=""},x=()=>{d.value++},B=t.ref(null),I=($,D)=>{const K=$.id;if(!D(K)){a("copy:error",{entity:$,field:"id",message:n("upstreams.errors.copy")});return}a("copy:success",{entity:$,field:"id",message:n("upstreams.copy.success",{val:K})})},A=($,D)=>{const K=JSON.stringify($);if(!D(K)){a("copy:error",{entity:$,message:n("upstreams.errors.copy")});return}a("copy:success",{entity:$,message:n("upstreams.copy.success_brief")})},T=async $=>{var K;await((K=l.canRetrieve)==null?void 0:K.call(l,$))&&o.push(l.config.getViewRoute($.id))},m=$=>({label:n("upstreams.actions.view"),to:l.config.getViewRoute($)}),k=$=>({label:n("upstreams.actions.edit"),to:l.config.getEditRoute($)}),N=t.ref(void 0),V=t.ref(!1),S=t.ref(!1),H=t.ref(""),E=Xa(l.config,u.value),O=$=>{N.value=$,V.value=!0},U=()=>{V.value=!1},F=async()=>{var $,D,K;if(($=N.value)!=null&&$.id){S.value=!0;try{await i.delete(E(N.value.id)),S.value=!1,V.value=!1,d.value++,a("delete:success",N.value)}catch(b){H.value=((K=(D=b.response)==null?void 0:D.data)==null?void 0:K.message)||b.message||n("upstreams.errors.delete"),a("error",b)}finally{S.value=!1}}},q=t.ref(!1);t.watch(_,$=>{var D,K,b,y;if(Array.isArray((D=$==null?void 0:$.response)==null?void 0:D.data)&&(q.value=$.response.data.length>0),$.status===me.Error){B.value={title:n("upstreams.errors.general")},(y=(b=(K=$.error)==null?void 0:K.response)==null?void 0:b.data)!=null&&y.message&&(B.value.message=$.error.response.data.message),a("error",$.error);return}B.value=null});const j=t.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${n("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("upstreams.title")});return t.onBeforeMount(async()=>{await l.canCreate()&&(j.value.title=n("upstreams.list.empty_state.title"),j.value.ctaText=n("upstreams.actions.create"))}),($,D)=>{const K=t.resolveComponent("KButton"),b=t.resolveComponent("KBadge"),y=t.resolveComponent("KTruncate"),w=t.resolveComponent("KDropdownItem"),R=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Mc,[t.createVNode(t.unref(Qa),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":c.value,"empty-state-options":j.value,"enable-entity-actions":"","error-message":B.value,fetcher:t.unref(C),"fetcher-cache-key":d.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:f.value,"table-headers":t.unref(h),"use-action-outside":e.useActionOutside,onClearSearchInput:g,"onClick:row":D[1]||(D[1]=M=>T(M)),onSort:x},{"toolbar-filter":t.withCtx(()=>[t.createVNode(t.unref(dc),{modelValue:f.value,"onUpdate:modelValue":D[0]||(D[0]=M=>f.value=M),config:s.value},null,8,["modelValue","config"])]),"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(pe),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(K,{appearance:"primary","data-testid":"toolbar-add-upstream",size:"large",to:e.config.createRoute},{default:t.withCtx(()=>[t.createVNode(t.unref(St)),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"])],8,["disabled"]))]),name:t.withCtx(({rowValue:M})=>[t.createElementVNode("span",jc,t.toDisplayString(M),1)]),tags:t.withCtx(({rowValue:M})=>[t.createVNode(y,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M,z=>(t.openBlock(),t.createBlock(b,{key:z,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(z),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:M})=>[t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(w,{"data-testid":"action-entity-copy-id",onClick:ee=>I(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(R,null,{default:t.withCtx(({copyToClipboard:z})=>[t.createVNode(w,{"data-testid":"action-entity-copy-json",onClick:ee=>A(M,z)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(pe),{"auth-function":()=>e.canRetrieve(M)},{default:t.withCtx(()=>[t.createVNode(w,{"data-testid":"action-entity-view","has-divider":"",item:m(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>e.canEdit(M)},{default:t.withCtx(()=>[t.createVNode(w,{"data-testid":"action-entity-edit",item:k(M.id)},null,8,["item"])]),_:2},1032,["auth-function"]),t.createVNode(t.unref(pe),{"auth-function":()=>e.canDelete(M)},{default:t.withCtx(()=>[t.createVNode(w,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:z=>O(M)},{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(Ya),{"action-pending":S.value,description:t.unref(n)("upstreams.delete.description"),"entity-name":N.value&&(N.value.name||N.value.id),"entity-type":t.unref(nt).Upstream,error:H.value,title:t.unref(n)("upstreams.delete.title"),visible:V.value,onCancel:U,onProceed:F},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),fe=(e,r)=>{const a=e.__vccOpts||e;for(const[l,n]of r)a[l]=n;return a},Lc=fe(Kc,[["__scopeId","data-v-9f2efb47"]]),et="/v2/control-planes/{controlPlaneId}/core-entities",tt="/{workspace}",at={list:{konnect:`${et}/upstreams/{upstreamId}/targets`,kongManager:`${tt}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${et}/upstreams/{upstreamId}/targets`,edit:`${et}/upstreams/{upstreamId}/targets/{id}`,validate:`${et}/v1/schemas/json/target/validate`},kongManager:{create:`${tt}/upstreams/{upstreamId}/targets`,edit:`${tt}/upstreams/{upstreamId}/targets/{id}`,validate:`${tt}/schemas/targets/validate`}}},Pc={class:"kong-ui-entities-target-form"},Rc={class:"target-form-container"},zc={key:0,class:"target-form-info"},sr=fe(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 T;const a=r,l=e,{i18n:{t:n}}=ue.useI18n(),{getMessageFromError:o}=er(),{axiosInstance:i}=Ye((T=l.config)==null?void 0:T.axiosRequestConfig),d=t.computed(()=>{var m;return at.form[l.config.app].edit.replace(/{upstreamId}/gi,((m=l.config)==null?void 0:m.upstreamId)||"")}),c=t.computed(()=>l.targetId?se.Edit:se.Create),p=t.computed(()=>c.value===se.Edit?n("targets.form.edit.title"):n("targets.form.create.title")),h=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 m=parseInt(h.fields.weight.toString(),10);return m<0||m>65535}),C=t.computed(()=>JSON.stringify(h.fields)!==JSON.stringify(u)&&!!h.fields.target&&!!h.fields.weight&&!s.value),_=m=>{var k;h.fields.target=(m==null?void 0:m.target)||"",h.fields.weight=(m==null?void 0:m.weight)??"",h.fields.tags=((k=m==null?void 0:m.tags)==null?void 0:k.join(", "))||"",Object.assign(u,h.fields)},g=()=>{h.errorMessage="",a("cancel")},x=t.computed(()=>{var k,N;let m=`${l.config.apiBaseUrl}${at.form[l.config.app].validate}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((k=l.config)==null?void 0:k.controlPlaneId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(N=l.config)!=null&&N.workspace?`/${l.config.workspace}`:"")),m=m.replace(/{id}/gi,l.targetId),m}),B=t.computed(()=>{var k,N,V,S;let m=`${l.config.apiBaseUrl}${at.form[l.config.app][c.value]}`;return l.config.app==="konnect"?m=m.replace(/{controlPlaneId}/gi,((k=l.config)==null?void 0:k.controlPlaneId)||"").replace(/{upstreamId}/gi,((N=l.config)==null?void 0:N.upstreamId)||""):l.config.app==="kongManager"&&(m=m.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((S=l.config)==null?void 0:S.upstreamId)||"")),m=m.replace(/{id}/gi,l.targetId),m}),I=t.computed(()=>{var m,k,N;return{target:h.fields.target,weight:parseInt(h.fields.weight),tags:(N=(k=(m=h.fields.tags)==null?void 0:m.split(","))==null?void 0:k.map(V=>String(V||"").trim()))==null?void 0:N.filter(V=>V!==""),upstream:{id:l.config.upstreamId}}}),A=async()=>{var m,k;try{h.isReadonly=!0,h.errorMessage="";let N;if(await i.post(x.value,I.value),c.value==="create"?N=await i.post(B.value,I.value):c.value==="edit"&&(N=((m=l.config)==null?void 0:m.app)==="konnect"?await i.put(B.value,I.value):await i.patch(B.value,I.value)),N){const{data:V}=N;h.fields.target=(V==null?void 0:V.name)||"",h.fields.weight=(V==null?void 0:V.weight)??100,h.fields.tags=((k=V==null?void 0:V.tags)==null?void 0:k.join(", "))||"",a("update",V),Object.assign(h.fields,f)}}catch(N){h.errorMessage=o(N),a("error",N)}finally{h.isReadonly=!1}};return t.watch(()=>l.targetId,()=>{Object.assign(h.fields,f)}),(m,k)=>{const N=t.resolveComponent("KInput"),V=t.resolveComponent("KPrompt");return t.openBlock(),t.createBlock(V,{"action-button-disabled":!C.value||h.isReadonly,"action-button-text":t.unref(n)("targets.form.buttons.save"),"cancel-button-text":t.unref(n)("targets.form.buttons.cancel"),title:p.value,visible:e.isVisible,onCancel:g,onProceed:A},{default:t.withCtx(()=>[t.createElementVNode("div",Pc,[t.createVNode(t.unref(Wa),{config:e.config,"edit-id":e.targetId,"entity-type":t.unref(Ce).Target,"error-message":h.errorMessage,"fetch-url":d.value,"form-fields":I.value,"is-readonly":h.isReadonly,onCancel:g,"onFetch:error":k[3]||(k[3]=S=>m.$emit("error",S)),"onFetch:success":_,onLoading:k[4]||(k[4]=S=>m.$emit("loading",S))},{default:t.withCtx(()=>[t.createElementVNode("div",Rc,[m.$slots.info?(t.openBlock(),t.createElementBlock("div",zc,[t.renderSlot(m.$slots,"info",{},void 0,!0)])):t.createCommentVNode("",!0),t.createVNode(N,{modelValue:h.fields.target,"onUpdate:modelValue":k[0]||(k[0]=S=>h.fields.target=S),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:h.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),t.createVNode(N,{modelValue:h.fields.weight,"onUpdate:modelValue":k[1]||(k[1]=S=>h.fields.weight=S),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:h.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),t.createVNode(N,{modelValue:h.fields.tags,"onUpdate:modelValue":k[2]||(k[2]=S=>h.fields.tags=S),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:h.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-77947aef"]]),Jc={class:"kong-ui-entities-targets-list"},Wc={class:"target-address"},Qc=fe(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 K;const a=r,l=e,{i18n:{t:n}}=ue.useI18n(),{axiosInstance:o}=Ye((K=l.config)==null?void 0:K.axiosRequestConfig),i=t.ref(1),d=t.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),p={target:{label:n("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:n("targets.list.table_headers.weight"),sortable:!0},tags:{label:n("targets.list.table_headers.tags"),sortable:!1}},h=t.computed(()=>{var y,w,R,M;let b=`${l.config.apiBaseUrl}${at.list[l.config.app]}`;return l.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((y=l.config)==null?void 0:y.controlPlaneId)||"").replace(/{upstreamId}/gi,((w=l.config)==null?void 0:w.upstreamId)||""):l.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(R=l.config)!=null&&R.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((M=l.config)==null?void 0:M.upstreamId)||"")),b}),{fetcher:u,fetcherState:f}=tr(l.config,h.value),s=()=>{i.value++},C=t.ref(null),_=()=>{j.value=!0},g=(b,y)=>{const w=b.id;if(!y(w)){a("copy:error",{entity:b,field:"id",message:n("targets.errors.copy")});return}a("copy:success",{entity:b,field:"id",message:n("targets.copy.success",{val:w})})},x=(b,y)=>{const w=JSON.stringify(b);if(!y(w)){a("copy:error",{entity:b,message:n("targets.errors.copy")});return}a("copy:success",{entity:b,message:n("targets.copy.success_brief")})},B=b=>{q.value=b,j.value=!0},I=b=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(b),A=b=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(b),T=t.ref(void 0),m=t.ref(!1),k=t.ref(!1),N=t.ref(""),V=Xa(l.config,h.value),S=b=>{T.value=b,m.value=!0},H=()=>{m.value=!1},E=async()=>{var b,y,w;if((b=T.value)!=null&&b.id){k.value=!0;try{await o.delete(V(T.value.id)),k.value=!1,m.value=!1,i.value++,a("delete:success",T.value)}catch(R){N.value=((w=(y=R.response)==null?void 0:y.data)==null?void 0:w.message)||R.message||n("targets.errors.delete"),a("error",R)}finally{k.value=!1}}},O=t.ref(!1);t.watch(f,b=>{var y,w,R,M;if(Array.isArray((y=b==null?void 0:b.response)==null?void 0:y.data)&&(O.value=b.response.data.length>0),b.status===me.Error){C.value={title:n("targets.errors.general")},(M=(R=(w=b.error)==null?void 0:w.response)==null?void 0:R.data)!=null&&M.message&&(C.value.message=b.error.response.data.message),a("error",b.error);return}C.value=null});const U=t.ref({ctaText:void 0,message:`${n("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:n("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});t.onBeforeMount(async()=>{await l.canCreate()&&(U.value.title=n("targets.list.empty_state.title"),U.value.ctaText=n("targets.actions.create"))});const F=t.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),q=t.ref(""),j=t.ref(!1),Y=b=>{q.value?a("update:target",b):a("create:target",b),$()},$=()=>{D(),i.value++},D=()=>{j.value=!1,q.value=""};return(b,y)=>{const w=t.resolveComponent("KButton"),R=t.resolveComponent("KBadge"),M=t.resolveComponent("KTruncate"),z=t.resolveComponent("KDropdownItem"),ee=t.resolveComponent("KClipboardProvider");return t.openBlock(),t.createElementBlock("div",Jc,[t.createVNode(t.unref(Qa),{"cache-identifier":e.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":d.value,"empty-state-options":U.value,"enable-entity-actions":"","error-message":C.value,fetcher:t.unref(u),"fetcher-cache-key":i.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":t.unref(p),"use-action-outside":e.useActionOutside,onEmptyStateCtaClicked:y[1]||(y[1]=()=>l.config.createRoute?void 0:_()),onSort:s},{"toolbar-button":t.withCtx(()=>[(t.openBlock(),t.createBlock(t.Teleport,{disabled:!e.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[t.createVNode(t.unref(pe),{"auth-function":()=>e.canCreate()},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(w,{appearance:"primary","data-testid":"toolbar-new-target",to:l.config.createRoute?l.config.createRoute:void 0,onClick:y[0]||(y[0]=()=>l.config.createRoute?void 0:_())},{default:t.withCtx(()=>[t.createVNode(t.unref(St)),t.createTextVNode(" "+t.toDisplayString(t.unref(n)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[t.vShow,O.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:t.withCtx(({rowValue:P})=>[t.createElementVNode("span",Wc,t.toDisplayString(P),1)]),tags:t.withCtx(({rowValue:P})=>[t.createVNode(M,null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P,ae=>(t.openBlock(),t.createBlock(R,{key:ae,"max-width":"auto"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(ae),1)]),_:2},1024))),128))]),_:2},1024)]),actions:t.withCtx(({row:P})=>[t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-id",onClick:be=>g(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(ee,null,{default:t.withCtx(({copyToClipboard:ae})=>[t.createVNode(z,{"data-testid":"action-entity-copy-json",onClick:be=>x(P,ae)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),t.createVNode(t.unref(pe),{"auth-function":()=>e.canEdit(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-entity-edit","has-divider":"",onClick:ae=>B(P.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(pe),{"auth-function":()=>I(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-healthy",onClick:ae=>a("health-actions:healthy",P)},{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(pe),{"auth-function":()=>A(P)},{default:t.withCtx(()=>[t.createVNode(z,{"data-testid":"action-target-mark-unhealthy",onClick:ae=>a("health-actions:unhealthy",P)},{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(pe),{"auth-function":()=>e.canDelete(P)},{default:t.withCtx(()=>[t.createVNode(z,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:ae=>S(P)},{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(Ya),{"action-pending":k.value,description:t.unref(n)("targets.delete.description"),"entity-type":t.unref(nt).Target,error:N.value,"need-confirm":!1,title:t.unref(n)("targets.delete.title"),visible:m.value,onCancel:H,onProceed:E},null,8,["action-pending","description","entity-type","error","title","visible"]),t.createVNode(sr,{config:F.value,"is-visible":j.value,"target-id":q.value,onCancel:D,onUpdate:Y},t.createSlots({_:2},[b.$slots["form-info"]?{name:"info",fn:t.withCtx(()=>[t.renderSlot(b.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-e6ed1cfb"]]),Yc={key:1},Zc=fe(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 H,E,O,U;const{i18nT:a,i18n:{t:l}}=ue.useI18n(),n=e,o=r,{debouncedQueryChange:i,loading:d,loadItems:c,results:p,allRecords:h}=ar(n.config,(E=Ae.form[(H=n.config)==null?void 0:H.app])==null?void 0:E.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:u,loading:f,loadItems:s,results:C}=ar(n.config,(U=Ae.form[(O=n.config)==null?void 0:O.app])==null?void 0:U.getCertificates),_=t.ref(""),g=t.computed(()=>{var F;return!!n.name&&!((F=h.value)!=null&&F.some(q=>q.host===n.name))}),x=t.computed(()=>{var q,j,Y;const F=g.value&&n.name.includes((q=_.value)==null?void 0:q.toLowerCase());return(Y=p.value)==null?void 0:Y.map($=>({label:$.host,value:$.id})).concat(F?[{label:n.name,value:((j=A.value)==null?void 0:j.value)||n.name}]:[])}),B=t.computed(()=>{var F;return(F=C.value)==null?void 0:F.map(q=>({label:q.id,value:q.id}))}),I=t.ref(""),A=t.ref({value:"",label:""}),T=t.computed(()=>{var F,q;return((F=x.value.find(j=>j.value===I.value))==null?void 0:F.label)||((q=A.value)==null?void 0:q.label)}),m=F=>{_.value=F,i(F)},k=F=>{A.value=F},N=()=>{A.value={value:"",label:""}},V=F=>{I.value=F,o("update:name",T.value)},S=t.ref(!1);return t.onBeforeMount(async()=>{var F,q;try{S.value=!0,await c(),n.name&&(I.value=((q=(F=x.value.find(j=>j.label===n.name))==null?void 0:F.value)==null?void 0:q.toString())||n.name),await s()}finally{S.value=!1}}),(F,q)=>{const j=t.resolveComponent("KSkeleton"),Y=t.resolveComponent("KSelect"),$=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Ue),{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(()=>[S.value?(t.openBlock(),t.createBlock(j,{key:0,type:"form"})):(t.openBlock(),t.createElementBlock("div",Yc,[t.createVNode(Y,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:x.value,label:t.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:t.unref(d),"model-value":I.value,placeholder:t.unref(l)("upstreams.form.fields.name.placeholder"),readonly:e.readonly,required:"",width:"100%",onItemAdded:k,onItemRemoved:N,onQueryChange:m,"onUpdate:modelValue":V},{"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($,{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]=D=>o("update:host-header",D))},null,8,["label","model-value","readonly"]),t.createVNode(Y,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:B.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]=D=>o("update:client-certificate",D))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),t.createVNode($,{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]=D=>o("update:tags",D))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),rt={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},Gc={class:"fields-group-title"},Xc={class:"fields-group-text"},ed={class:"fields-group-title"},td={class:"fields-group-text"},ad=fe(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}}=ue.useI18n(),{inRange:n}=Xe(),o=e,i=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(()=>o.hashOn,(u,f)=>{f==="header"&&u!==f&&i("update:hash-on-header",""),f==="cookie"&&u!==f&&(i("update:hash-on-cookie",""),i("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&i("update:hash-on-query-argument",""),f==="uri_capture"&&u!==f&&i("update:hash-on-uri-capture",""),(u==="cookie"||u==="none")&&(i("update:hash-fallback","none"),i("update:hash-fallback-header",""),i("update:hash-fallback-query-argument",""),i("update:hash-fallback-uri-capture",""))}),t.watch(()=>o.hashFallback,(u,f)=>{f==="header"&&u!==f&&i("update:hash-fallback-header",""),f==="cookie"&&u!==f&&(i("update:hash-on-cookie",""),i("update:hash-on-cookie-path","/")),f==="query_arg"&&u!==f&&i("update:hash-fallback-query-argument",""),f==="uri_capture"&&u!==f&&i("update:hash-fallback-uri-capture","")});const p=t.computed(()=>o.hashOn==="cookie"||o.hashOn==="none"),h=t.computed(()=>o.slots?n(o.slots,_t,xt)?"":l("upstreams.form.errors.in_range"):"");return(u,f)=>{const s=t.resolveComponent("KExternalLink"),C=t.resolveComponent("KSelect"),_=t.resolveComponent("KInput"),g=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Ue),{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(rt).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(C,{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]=x=>i("update:algorithm",x))},null,8,["items","label","model-value","readonly"]),t.createVNode(_,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!h.value,"error-message":h.value,help:t.unref(l)("upstreams.form.fields.slots.help"),label:t.unref(l)("upstreams.form.fields.slots.label"),max:t.unref(xt),min:t.unref(_t),"model-value":e.slots,readonly:e.readonly,type:"number","onUpdate:modelValue":f[1]||(f[1]=x=>i("update:slots",x))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",Gc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.label")),1),t.createElementVNode("p",Xc,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_on.help")),1),t.createVNode(C,{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]=x=>i("update:hash-on",x))},null,8,["items","label","model-value","readonly"]),e.hashOn==="header"?(t.openBlock(),t.createBlock(_,{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]=x=>i("update:hash-on-header",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{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]=x=>i("update:hash-on-cookie",x))},null,8,["label","model-value","readonly"]),t.createVNode(_,{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]=x=>i("update:hash-on-cookie-path",x))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashOn==="query_arg"?(t.openBlock(),t.createBlock(_,{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]=x=>i("update:hash-on-query-argument",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashOn==="uri_capture"?(t.openBlock(),t.createBlock(_,{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]=x=>i("update:hash-on-uri-capture",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(g,null,{default:t.withCtx(()=>[t.createElementVNode("h5",ed,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.label")),1),t.createElementVNode("p",td,t.toDisplayString(t.unref(l)("upstreams.form.fields.hash_fallback.help")),1),t.createVNode(C,{class:"hash-fallback-select",disabled:p.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]=x=>i("update:hash-fallback",x))},{"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(_,{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]=x=>i("update:hash-fallback-header",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="cookie"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(_,{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]=x=>i("update:hash-on-cookie",x))},null,8,["label","model-value","readonly"]),t.createVNode(_,{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]=x=>i("update:hash-on-cookie-path",x))},null,8,["label","model-value","readonly"])],64)):t.createCommentVNode("",!0),e.hashFallback==="query_arg"?(t.openBlock(),t.createBlock(_,{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]=x=>i("update:hash-fallback-query-argument",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0),e.hashFallback==="uri_capture"?(t.openBlock(),t.createBlock(_,{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]=x=>i("update:hash-fallback-uri-capture",x))},null,8,["label","model-value","readonly"])):t.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),rd={class:"fields-group-title"},ld={class:"fields-group-text"},nd={class:"fields-group-title"},od={class:"fields-group-text"},id=fe(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}}=ue.useI18n(),l=r;return(n,o)=>{const i=t.resolveComponent("KExternalLink"),d=t.resolveComponent("KInputSwitch"),c=t.resolveComponent("KCard"),p=t.resolveComponent("KInput");return t.openBlock(),t.createBlock(t.unref(Ue),{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(i,{"hide-icon":"",href:t.unref(rt).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",rd,t.toDisplayString(t.unref(a)("upstreams.form.fields.active_health_checks.label")),1),t.createElementVNode("p",ld,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:o[0]||(o[0]=h=>l("update:active-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(c,null,{default:t.withCtx(()=>[t.createElementVNode("h5",nd,t.toDisplayString(t.unref(a)("upstreams.form.fields.passive_health_checks.label")),1),t.createElementVNode("p",od,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:o[1]||(o[1]=h=>l("update:passive-health-switch",h))},null,8,["disabled","model-value"])]),_:1}),t.createVNode(p,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:t.unref(a)("upstreams.form.fields.healthchecks_threshold.label"),max:t.unref(qc),min:t.unref($c),"model-value":e.healthchecksThreshold,readonly:e.readonly,type:"number","onUpdate:modelValue":o[2]||(o[2]=h=>l("update:healthchecks-threshold",h))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),sd="#d60027",cd={key:2},dd={class:"fields-group-title"},hd={class:"fields-group-text"},pd={class:"fields-group-title"},ud={class:"fields-group-text"},fd=fe(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}}=ue.useI18n(),{objectsAreEqual:l}=Xe(),n=e,o=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}]),d=t.computed(()=>n.type==="https"||n.type==="grpcs"),c=t.computed(()=>n.type==="tcp"),{trackNewItems:p}=De({replaceId:!0}),{trackNewItems:h}=De({replaceId:!0});t.watch(()=>n.type,(_,g)=>{g==="tcp"&&_!==g&&o("update:tcp-failures","5"),(g==="https"||g==="grpcs")&&_!==g&&(o("update:https-sni",""),o("update:verify-ssl",!1)),g!=="tcp"&&_==="tcp"&&(o("update:http-path","/"),o("update:http-statuses",Nt),o("update:unhealthy-http-statuses",Bt))});const u=t.ref([{key:"",values:""}]);t.watch(()=>n.headers,_=>{l(u.value,_)||(u.value=[..._])},{immediate:!0,deep:!0});const f=()=>{o("update:headers",u.value)},s=()=>{u.value.push({key:"",values:""}),f()},C=_=>{_===0&&u.value.length===1?u.value[0]={key:"",values:""}:u.value.splice(_,1),f()};return(_,g)=>{const x=t.resolveComponent("KExternalLink"),B=t.resolveComponent("KSelect"),I=t.resolveComponent("KInput"),A=t.resolveComponent("KCheckbox"),T=t.resolveComponent("KLabel"),m=t.resolveComponent("KButton"),k=t.resolveComponent("KMultiselect"),N=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Ue),{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(x,{"hide-icon":"",href:t.unref(rt).upstreamObject},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(a)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:t.withCtx(()=>{var V;return[t.createVNode(B,{class:"active-healthcheck-type-select",items:i.value,label:t.unref(a)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":g[0]||(g[0]=S=>o("update:type",S))},null,8,["items","label","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{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":g[1]||(g[1]=S=>o("update:http-path",S))},null,8,["label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:t.unref(a)("upstreams.form.fields.timeout.label"),max:t.unref(Oc),min:t.unref(Fc),"model-value":e.timeout,readonly:e.readonly,type:"number","onUpdate:modelValue":g[2]||(g[2]=S=>o("update:timeout",S))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:t.unref(a)("upstreams.form.fields.concurrency.label"),max:t.unref(Dc),min:t.unref(Uc),"model-value":e.concurrency,readonly:e.readonly,type:"number","onUpdate:modelValue":g[3]||(g[3]=S=>o("update:concurrency",S))},null,8,["label","max","min","model-value","readonly"]),d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(I,{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":g[4]||(g[4]=S=>o("update:https-sni",S))},null,8,["label","model-value","readonly"]),t.createVNode(A,{"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":g[5]||(g[5]=S=>o("update:verify-ssl",S))},null,8,["disabled","label","model-value"])],64)):t.createCommentVNode("",!0),((V=e.config)==null?void 0:V.app)==="kongManager"?(t.openBlock(),t.createElementBlock("div",cd,[t.createVNode(T,{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,(S,H)=>(t.openBlock(),t.createElementBlock("div",{key:`${S.header}_${H}`,class:t.normalizeClass(["headers-row",{"margin-top-6":H>0}])},[t.createVNode(I,{modelValue:u.value[H].key,"onUpdate:modelValue":E=>u.value[H].key=E,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(I,{modelValue:u.value[H].values,"onUpdate:modelValue":E=>u.value[H].values=E,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${H+1}`,readonly:e.readonly,type:"text",onBlur:f},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),t.createVNode(m,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:u.value.length===1,icon:"",onClick:E=>C(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Ec),{class:"delete-item",color:u.value.length>1?t.unref(sd):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),u.value&&H===u.value.length-1?(t.openBlock(),t.createBlock(m,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:s},{default:t.withCtx(()=>[t.createVNode(t.unref(St))]),_:1})):t.createCommentVNode("",!0)],2))),128))])])):t.createCommentVNode("",!0),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",dd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.label")),1),t.createElementVNode("p",hd,t.toDisplayString(t.unref(a)("upstreams.form.healthy.help")),1),t.createVNode(I,{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(ir),min:t.unref(or),"model-value":e.interval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[6]||(g[6]=S=>o("update:interval",S))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:t.unref(a)("upstreams.form.fields.successes.label"),max:t.unref(Be),min:t.unref(Ve),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":g[7]||(g[7]=S=>o("update:successes",S))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(k,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[8]||(g[8]=S=>t.unref(p)(S,!0)),onItemRemoved:g[9]||(g[9]=S=>t.unref(p)(S,!1)),"onUpdate:modelValue":g[10]||(g[10]=S=>o("update:http-statuses",S))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(N,null,{default:t.withCtx(()=>[t.createElementVNode("h5",pd,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.label")),1),t.createElementVNode("p",ud,t.toDisplayString(t.unref(a)("upstreams.form.unhealthy.help")),1),t.createVNode(I,{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(ir),min:t.unref(or),"model-value":e.unhealthyInterval,readonly:e.readonly,type:"number","onUpdate:modelValue":g[11]||(g[11]=S=>o("update:unhealthy-interval",S))},null,8,["help","label","max","min","model-value","readonly"]),t.createVNode(I,{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(Be),min:t.unref(Ve),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[12]||(g[12]=S=>o("update:tcp-failures",S))},null,8,["label","max","min","model-value","readonly"]),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:0,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(Be),min:t.unref(Ve),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":g[13]||(g[13]=S=>o("update:http-failures",S))},null,8,["label","max","min","model-value","readonly"])),c.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(k,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:g[14]||(g[14]=S=>t.unref(h)(S,!0)),onItemRemoved:g[15]||(g[15]=S=>t.unref(h)(S,!1)),"onUpdate:modelValue":g[16]||(g[16]=S=>o("update:unhealthy-http-statuses",S))},null,8,["items","label","model-value","readonly"])),t.createVNode(I,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:t.unref(a)("upstreams.form.fields.timeouts.label"),max:t.unref(nr),min:t.unref(lr),"model-value":e.unhealthyTimeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":g[17]||(g[17]=S=>o("update:unhealthy-timeouts",S))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-efccf560"]]),md={class:"fields-group-title"},gd={class:"fields-group-text"},yd={class:"fields-group-title"},kd={class:"fields-group-text"},bd=fe(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}}=ue.useI18n(),l=e,n=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}]),i=t.computed(()=>l.type==="tcp"),{trackNewItems:d}=De({replaceId:!0}),{trackNewItems:c}=De({replaceId:!0});return t.watch(()=>l.type,(p,h)=>{h==="tcp"&&p!==h&&n("update:tcp-failures","5"),h!=="tcp"&&p==="tcp"&&(n("update:http-statuses",Vt),n("update:unhealthy-http-statuses",It))}),(p,h)=>{const u=t.resolveComponent("KExternalLink"),f=t.resolveComponent("KSelect"),s=t.resolveComponent("KInput"),C=t.resolveComponent("KMultiselect"),_=t.resolveComponent("KCard");return t.openBlock(),t.createBlock(t.unref(Ue),{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(rt).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:o.value,label:t.unref(a)("upstreams.form.fields.passive_health_check_type.label"),"model-value":e.type,readonly:e.readonly,width:"100%","onUpdate:modelValue":h[0]||(h[0]=g=>n("update:type",g))},null,8,["items","label","model-value","readonly"]),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",md,t.toDisplayString(t.unref(a)("upstreams.form.passive_healthy.label")),1),t.createElementVNode("p",gd,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(Be),min:t.unref(Ve),"model-value":e.successes,readonly:e.readonly,type:"number","onUpdate:modelValue":h[1]||(h[1]=g=>n("update:successes",g))},null,8,["label","max","min","model-value","readonly"]),i.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(C,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.httpStatuses,readonly:e.readonly,width:"100%",onItemAdded:h[2]||(h[2]=g=>t.unref(d)(g,!0)),onItemRemoved:h[3]||(h[3]=g=>t.unref(d)(g,!1)),"onUpdate:modelValue":h[4]||(h[4]=g=>n("update:http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1}),t.createVNode(_,null,{default:t.withCtx(()=>[t.createElementVNode("h5",yd,t.toDisplayString(t.unref(a)("upstreams.form.passive_unhealthy.label")),1),t.createElementVNode("p",kd,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(nr),min:t.unref(lr),"model-value":e.timeouts,readonly:e.readonly,type:"number","onUpdate:modelValue":h[5]||(h[5]=g=>n("update:timeouts",g))},null,8,["label","max","min","model-value","readonly"]),t.createVNode(s,{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(Be),min:t.unref(Ve),"model-value":e.tcpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":h[6]||(h[6]=g=>n("update:tcp-failures",g))},null,8,["label","max","min","model-value","readonly"]),i.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(s,{key:0,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(Be),min:t.unref(Ve),"model-value":e.httpFailures,readonly:e.readonly,type:"number","onUpdate:modelValue":h[7]||(h[7]=g=>n("update:http-failures",g))},null,8,["label","max","min","model-value","readonly"])),i.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(C,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:t.unref(Ge),label:t.unref(a)("upstreams.form.fields.http_statuses.label"),"model-value":e.unhealthyHttpStatuses,readonly:e.readonly,width:"100%",onItemAdded:h[8]||(h[8]=g=>t.unref(c)(g,!0)),onItemRemoved:h[9]||(h[9]=g=>t.unref(c)(g,!1)),"onUpdate:modelValue":h[10]||(h[10]=g=>n("update:unhealthy-http-statuses",g))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-5bd9952e"]]),Cd={class:"kong-ui-entities-upstreams-form"},wd=fe(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:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(e,{emit:r}){var K;const a=e,l=r,{inRange:n,stringToNumberArray:o,upstreamsResponseToFields:i,getDefaultUpstreamFields:d,objectsAreEqual:c,cloneDeep:p}=Xe(),{axiosInstance:h}=Ye((K=a.config)==null?void 0:K.axiosRequestConfig),{getMessageFromError:u}=er(),f=lt.useRouter(),s=t.reactive({fields:d(),readonly:!1,errorMessage:""}),C=t.reactive(d()),_=t.computed(()=>!c(s.fields,C)),g=b=>{s.fields.activeHealthCheck.interval=b?"5":"0",s.fields.activeHealthCheck.successes=b?"5":"0",s.fields.activeHealthCheck.httpFailures=b?"5":"0",s.fields.activeHealthCheck.unhealthyInterval=b?"5":"0",s.fields.activeHealthCheck.tcpFailures=b?"5":"0"},x=b=>{s.fields.passiveHealthCheck.timeouts=b?"5":"0",s.fields.passiveHealthCheck.successes=b?"80":"0",s.fields.passiveHealthCheck.tcpFailures=b?"5":"0",s.fields.passiveHealthCheck.httpFailures=b?"5":"0"},B=t.computed(()=>s.fields.slots?n(s.fields.slots,_t,xt):!0),I=t.computed(()=>s.fields.hashOn==="header"?!!s.fields.hashOnHeader:!0),A=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookie:!0),T=t.computed(()=>s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie"?!!s.fields.hashOnCookiePath:!0),m=t.computed(()=>s.fields.hashOn==="query_arg"?!!s.fields.hashOnQueryArgument:!0),k=t.computed(()=>s.fields.hashOn==="uri_capture"?!!s.fields.hashOnUriCapture:!0),N=t.computed(()=>s.fields.hashFallback==="header"?!!s.fields.hashFallbackHeader:!0),V=t.computed(()=>s.fields.hashFallback==="query_arg"?!!s.fields.hashFallbackQueryArgument:!0),S=t.computed(()=>s.fields.hashFallback==="uri_capture"?!!s.fields.hashFallbackUriCapture:!0),H=t.computed(()=>!!s.fields.name&&B.value&&I.value&&A.value&&T.value&&m.value&&k.value&&N.value&&V.value&&S.value),E=t.computed(()=>a.upstreamId?se.Edit:se.Create),O=t.computed(()=>{var b,y;return(y=Ae.form[(b=a.config)==null?void 0:b.app])==null?void 0:y.edit}),U=b=>{Object.assign(s.fields,i(b)),Object.assign(C,p(s.fields))},F=()=>{var b;f.push(((b=a.config)==null?void 0:b.cancelRoute)||{name:"upstreams-list"})},q=b=>{l("loading",b)},j=b=>{l("error",b)},Y=t.computed(()=>{var y,w,R,M,z;const b={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&&(b.host_header=s.fields.hostHeader),s.fields.clientCertificate&&(b.client_certificate={id:s.fields.clientCertificate}),s.fields.healthchecksThreshold&&(b.healthchecks.threshold=Number(s.fields.healthchecksThreshold)),s.fields.tags&&(b.tags=(w=(y=s.fields.tags.split(","))==null?void 0:y.map(ee=>String(ee||"").trim()))==null?void 0:w.filter(ee=>ee!=="")),s.fields.hashOn==="header"&&(b.hash_on_header=s.fields.hashOnHeader),(s.fields.hashOn==="cookie"||s.fields.hashFallback==="cookie")&&(b.hash_on_cookie=s.fields.hashOnCookie,b.hash_on_cookie_path=s.fields.hashOnCookiePath),s.fields.hashOn==="query_arg"&&(b.hash_on_query_arg=s.fields.hashOnQueryArgument),s.fields.hashOn==="uri_capture"&&(b.hash_on_uri_capture=s.fields.hashOnUriCapture),s.fields.hashFallback==="header"&&(b.hash_fallback_header=s.fields.hashFallbackHeader),s.fields.hashFallback==="query_arg"&&(b.hash_fallback_query_arg=s.fields.hashFallbackQueryArgument),s.fields.hashFallback==="uri_capture"&&(b.hash_fallback_uri_capture=s.fields.hashFallbackUriCapture),s.fields.activeHealthSwitch?(b.healthchecks.active={type:s.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},s.fields.activeHealthCheck.timeout&&(b.healthchecks.active.timeout=Number(s.fields.activeHealthCheck.timeout)),s.fields.activeHealthCheck.concurrency&&(b.healthchecks.active.concurrency=Number(s.fields.activeHealthCheck.concurrency)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpPath&&(b.healthchecks.active.http_path=s.fields.activeHealthCheck.httpPath),((R=a.config)==null?void 0:R.app)==="kongManager"&&(s.fields.activeHealthCheck.headers.length===0?b.healthchecks.active.headers=[]:b.healthchecks.active.headers=s.fields.activeHealthCheck.headers.reduce((ee,P)=>{var ae,be;return P.key?{...ee,[P.key]:(be=(ae=P.values.split(","))==null?void 0:ae.map(Ee=>String(Ee||"").trim()))==null?void 0:be.filter(Ee=>Ee!=="")}:{...ee}},{})),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&s.fields.activeHealthCheck.httpsSni&&(b.healthchecks.active.https_sni=s.fields.activeHealthCheck.httpsSni),(s.fields.activeHealthCheck.type==="https"||s.fields.activeHealthCheck.type==="grpcs")&&(b.healthchecks.active.https_verify_certificate=s.fields.activeHealthCheck.verifySsl),s.fields.activeHealthCheck.interval&&(b.healthchecks.active.healthy.interval=Number(s.fields.activeHealthCheck.interval)),s.fields.activeHealthCheck.successes&&(b.healthchecks.active.healthy.successes=Number(s.fields.activeHealthCheck.successes)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpStatuses&&(b.healthchecks.active.healthy.http_statuses=o(s.fields.activeHealthCheck.httpStatuses)),s.fields.activeHealthCheck.unhealthyInterval&&(b.healthchecks.active.unhealthy.interval=Number(s.fields.activeHealthCheck.unhealthyInterval)),s.fields.activeHealthCheck.unhealthyTimeouts&&(b.healthchecks.active.unhealthy.timeouts=Number(s.fields.activeHealthCheck.unhealthyTimeouts)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.unhealthyHttpStatuses&&(b.healthchecks.active.unhealthy.http_statuses=o(s.fields.activeHealthCheck.unhealthyHttpStatuses)),s.fields.activeHealthCheck.type!=="tcp"&&s.fields.activeHealthCheck.httpFailures&&(b.healthchecks.active.unhealthy.http_failures=Number(s.fields.activeHealthCheck.httpFailures)),s.fields.activeHealthCheck.tcpFailures&&(b.healthchecks.active.unhealthy.tcp_failures=Number(s.fields.activeHealthCheck.tcpFailures))):((M=a.config)==null?void 0:M.app)==="kongManager"&&E.value===se.Edit&&(b.healthchecks.active={type:s.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0}}),s.fields.passiveHealthSwitch?(b.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},s.fields.passiveHealthCheck.successes&&(b.healthchecks.passive.healthy.successes=Number(s.fields.passiveHealthCheck.successes)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpStatuses&&(b.healthchecks.passive.healthy.http_statuses=o(s.fields.passiveHealthCheck.httpStatuses)),s.fields.passiveHealthCheck.timeouts&&(b.healthchecks.passive.unhealthy.timeouts=Number(s.fields.passiveHealthCheck.timeouts)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.unhealthyHttpStatuses&&(b.healthchecks.passive.unhealthy.http_statuses=o(s.fields.passiveHealthCheck.unhealthyHttpStatuses)),s.fields.passiveHealthCheck.type!=="tcp"&&s.fields.passiveHealthCheck.httpFailures&&(b.healthchecks.passive.unhealthy.http_failures=Number(s.fields.passiveHealthCheck.httpFailures)),s.fields.passiveHealthCheck.tcpFailures&&(b.healthchecks.passive.unhealthy.tcp_failures=Number(s.fields.passiveHealthCheck.tcpFailures))):((z=a.config)==null?void 0:z.app)==="kongManager"&&E.value===se.Edit&&(b.healthchecks.passive={type:s.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),b}),$=b=>{var w,R,M,z,ee,P;let y=`${(w=a.config)==null?void 0:w.apiBaseUrl}${Ae.form[(R=a.config)==null?void 0:R.app][b]}`;return((M=a.config)==null?void 0:M.app)==="konnect"?y=y.replace(/{controlPlaneId}/gi,((z=a.config)==null?void 0:z.controlPlaneId)||""):((ee=a.config)==null?void 0:ee.app)==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(P=a.config)!=null&&P.workspace?`/${a.config.workspace}`:"")),y=y.replace(/{id}/gi,a.upstreamId),y},D=async()=>{var b;try{s.readonly=!0,await h.post($("validate"),Y.value);let y;E.value===se.Create?y=await h.post($("create"),Y.value):E.value===se.Edit&&(y=((b=a.config)==null?void 0:b.app)==="konnect"?await h.put($("edit"),Y.value):await h.patch($("edit"),Y.value)),l("update",y==null?void 0:y.data)}catch(y){s.errorMessage=u(y),l("error",y)}finally{s.readonly=!1}};return(b,y)=>(t.openBlock(),t.createElementBlock("div",Cd,[t.createVNode(t.unref(Wa),{"can-submit":H.value&&_.value,config:e.config,"edit-id":e.upstreamId,"enable-terraform":e.enableTerraform,"entity-type":t.unref(Ce).Upstream,"error-message":s.errorMessage,"fetch-url":O.value,"form-fields":Y.value,"is-readonly":s.readonly,onCancel:F,"onFetch:error":j,"onFetch:success":U,onLoading:q,onSubmit:D},{default:t.withCtx(()=>[t.createVNode(Zc,{"client-certificate":s.fields.clientCertificate,"onUpdate:clientCertificate":y[0]||(y[0]=w=>s.fields.clientCertificate=w),"host-header":s.fields.hostHeader,"onUpdate:hostHeader":y[1]||(y[1]=w=>s.fields.hostHeader=w),name:s.fields.name,"onUpdate:name":y[2]||(y[2]=w=>s.fields.name=w),tags:s.fields.tags,"onUpdate:tags":y[3]||(y[3]=w=>s.fields.tags=w),config:e.config,readonly:s.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),t.createVNode(ad,{algorithm:s.fields.algorithm,"onUpdate:algorithm":y[4]||(y[4]=w=>s.fields.algorithm=w),"hash-fallback":s.fields.hashFallback,"onUpdate:hashFallback":y[5]||(y[5]=w=>s.fields.hashFallback=w),"hash-fallback-header":s.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":y[6]||(y[6]=w=>s.fields.hashFallbackHeader=w),"hash-fallback-query-argument":s.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":y[7]||(y[7]=w=>s.fields.hashFallbackQueryArgument=w),"hash-fallback-uri-capture":s.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":y[8]||(y[8]=w=>s.fields.hashFallbackUriCapture=w),"hash-on":s.fields.hashOn,"onUpdate:hashOn":y[9]||(y[9]=w=>s.fields.hashOn=w),"hash-on-cookie":s.fields.hashOnCookie,"onUpdate:hashOnCookie":y[10]||(y[10]=w=>s.fields.hashOnCookie=w),"hash-on-cookie-path":s.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":y[11]||(y[11]=w=>s.fields.hashOnCookiePath=w),"hash-on-header":s.fields.hashOnHeader,"onUpdate:hashOnHeader":y[12]||(y[12]=w=>s.fields.hashOnHeader=w),"hash-on-query-argument":s.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":y[13]||(y[13]=w=>s.fields.hashOnQueryArgument=w),"hash-on-uri-capture":s.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":y[14]||(y[14]=w=>s.fields.hashOnUriCapture=w),slots:s.fields.slots,"onUpdate:slots":y[15]||(y[15]=w=>s.fields.slots=w),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(id,{"active-health-switch":s.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[y[16]||(y[16]=w=>s.fields.activeHealthSwitch=w),g],"healthchecks-threshold":s.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":y[17]||(y[17]=w=>s.fields.healthchecksThreshold=w),"passive-health-switch":s.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[y[18]||(y[18]=w=>s.fields.passiveHealthSwitch=w),x],readonly:s.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),s.fields.activeHealthSwitch?(t.openBlock(),t.createBlock(fd,{key:0,concurrency:s.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":y[19]||(y[19]=w=>s.fields.activeHealthCheck.concurrency=w),headers:s.fields.activeHealthCheck.headers,"onUpdate:headers":y[20]||(y[20]=w=>s.fields.activeHealthCheck.headers=w),"http-failures":s.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":y[21]||(y[21]=w=>s.fields.activeHealthCheck.httpFailures=w),"http-path":s.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":y[22]||(y[22]=w=>s.fields.activeHealthCheck.httpPath=w),"http-statuses":s.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[23]||(y[23]=w=>s.fields.activeHealthCheck.httpStatuses=w),"https-sni":s.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":y[24]||(y[24]=w=>s.fields.activeHealthCheck.httpsSni=w),interval:s.fields.activeHealthCheck.interval,"onUpdate:interval":y[25]||(y[25]=w=>s.fields.activeHealthCheck.interval=w),successes:s.fields.activeHealthCheck.successes,"onUpdate:successes":y[26]||(y[26]=w=>s.fields.activeHealthCheck.successes=w),"tcp-failures":s.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[27]||(y[27]=w=>s.fields.activeHealthCheck.tcpFailures=w),timeout:s.fields.activeHealthCheck.timeout,"onUpdate:timeout":y[28]||(y[28]=w=>s.fields.activeHealthCheck.timeout=w),type:s.fields.activeHealthCheck.type,"onUpdate:type":y[29]||(y[29]=w=>s.fields.activeHealthCheck.type=w),"unhealthy-http-statuses":s.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[30]||(y[30]=w=>s.fields.activeHealthCheck.unhealthyHttpStatuses=w),"unhealthy-interval":s.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":y[31]||(y[31]=w=>s.fields.activeHealthCheck.unhealthyInterval=w),"unhealthy-timeouts":s.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":y[32]||(y[32]=w=>s.fields.activeHealthCheck.unhealthyTimeouts=w),"verify-ssl":s.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":y[33]||(y[33]=w=>s.fields.activeHealthCheck.verifySsl=w),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(bd,{key:1,"http-failures":s.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":y[34]||(y[34]=w=>s.fields.passiveHealthCheck.httpFailures=w),"http-statuses":s.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":y[35]||(y[35]=w=>s.fields.passiveHealthCheck.httpStatuses=w),successes:s.fields.passiveHealthCheck.successes,"onUpdate:successes":y[36]||(y[36]=w=>s.fields.passiveHealthCheck.successes=w),"tcp-failures":s.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":y[37]||(y[37]=w=>s.fields.passiveHealthCheck.tcpFailures=w),timeouts:s.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":y[38]||(y[38]=w=>s.fields.passiveHealthCheck.timeouts=w),type:s.fields.passiveHealthCheck.type,"onUpdate:type":y[39]||(y[39]=w=>s.fields.passiveHealthCheck.type=w),"unhealthy-http-statuses":s.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":y[40]||(y[40]=w=>s.fields.passiveHealthCheck.unhealthyHttpStatuses=w),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","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-ebffe769"]]),Sd=t.createElementVNode("code",null,"10",-1),_d=t.createElementVNode("code",null,"65536",-1),xd={"data-testid":"client_certificate-plain-text"},Nd=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},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(e){const r=e,{i18n:{t:a},i18nT:l}=ue.useI18n(),{getPropValue:n}=Sc(),o=t.computed(()=>Ae.form[r.config.app].edit),i=t.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:J.Basic,tooltip:a("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:J.Basic},hash_on:{order:7,section:J.Basic},hash_on_header:{order:8,section:J.Basic},hash_on_uri_capture:{order:9,section:J.Basic},hash_on_query_arg:{order:10,section:J.Basic,label:`${a("upstreams.form.fields.hash_on.label")} ${a("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:J.Basic},hash_on_cookie_path:{order:12,section:J.Basic},healthchecks:{order:13,section:J.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(qs),{config:e.config,"config-card-doc":e.configCardDoc,"config-schema":i.value,"enable-terraform":e.enableTerraform,"entity-type":t.unref(Ce).Upstream,"fetch-url":o.value,"hide-title":e.hideTitle,"onFetch:error":c[0]||(c[0]=p=>d.$emit("fetch:error",p)),"onFetch:success":c[1]||(c[1]=p=>d.$emit("fetch:success",p)),onLoading:c[2]||(c[2]=p=>d.$emit("loading",p))},{"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:p})=>[t.createVNode(t.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:t.withCtx(()=>[t.createElementVNode("code",null,t.toDisplayString(p.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(()=>[Sd]),max:t.withCtx(()=>[_d]),_: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(p=>{var h;return[t.createElementVNode("div",null,[t.createElementVNode("div",xd,[t.createElementVNode("span",null,t.toDisplayString((h=t.unref(n)("rowValue",p))==null?void 0:h.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});re.TargetForm=sr,re.TargetsList=Qc,re.UpstreamsConfigCard=Nd,re.UpstreamsForm=wd,re.UpstreamsList=Lc,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(W,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/entities-shared"),require("vue-router"),require("@kong/icons"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/entities-shared","vue-router","@kong/icons","@kong-ui-public/i18n"],e):(W=typeof globalThis<"u"?globalThis:W||self,e(W["kong-ui-entities-upstreams-targets"]={},W.Vue,W["kong-ui-public-entities-shared"],W.VueRouter,W.KongIcons,W["kong-ui-public-i18n"]))})(this,function(W,e,m,Ce,oe,_e){"use strict";const Rt={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 jt(){const a=_e.createI18n("en-us",Rt);return{i18n:a,i18nT:_e.i18nTComponent(a)}}function re(a){const{replaceId:B=!1}=a,s=e.ref([]);return{addedItems:s,trackNewItems:(h,k)=>{if(k){const g={...h};B&&(g.value=h.label),s.value.push(g)}else s.value=s.value.filter(g=>g.value!==h.value)}}}const ne=[{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"}],pe=10,fe=65536,Lt=0,Qt=65535,Z=0,ee=255,we=0,Ve=255,Wt=0,Jt=65535,He=0,xe=65535,Gt=0,zt=2**31,me=["200","302"],ge=["200","201","202","203","204","205","206","207","208","226","300","301","302","303","304","305","306","307","308"],ye=["429","404","500","501","502","503","504","505"],ke=["429","500","503"];function ie(){const a=o=>/^\d+$/.test(o),B=(o,d,c)=>{if(a(o)){const C=Number(o);return C>=d&&C<=c}else return!1},s=o=>o.map(d=>Number(d)),l=o=>o.map(d=>d.toString()),h=()=>({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:me,unhealthyInterval:"0",httpFailures:"5",tcpFailures:"5",unhealthyHttpStatuses:ye,unhealthyTimeouts:"0"},passiveHealthCheck:{type:"http",successes:"0",httpStatuses:ge,timeouts:"0",httpFailures:"5",unhealthyHttpStatuses:ke,tcpFailures:"5"}});return{isInteger:a,inRange:B,stringToNumberArray:s,numberToStringArray:l,upstreamsResponseToFields:o=>{var c,C,p,t,E,H,u,_,A,U,j,R,y,w,V,x,f,D,M,G,J,I,S,P,K,b,N,F,n,r,i,$,T,v,L,O,Q,Y,se,Se,Te,Ue,Ie,Fe,qe,Be,Ee,Oe,De,$e,ve,Pe,Ae,Me,Ke,Re,je,Le,Qe,We,Je,Ge,ze,Xe,Ye,Ze,et,tt,at,lt,st,rt,ot,nt,it,ht,ct,dt,ut,pt,ft,mt,gt,yt,kt,bt,Ct,_t,wt,Vt,Ht,xt,Nt,St,Tt,Ut,It,Ft,qt,Bt,Et,Ot,Dt,$t,vt,Pt,At,Mt,Kt;const d=h();return d.name=o.name||"",d.algorithm=o.algorithm||"round-robin",d.hostHeader=o.host_header||"",d.clientCertificate=o.client_certificate?(c=o.client_certificate)==null?void 0:c.id:"",d.tags=((C=o.tags)==null?void 0:C.join(", "))||"",d.slots=o.slots!==null&&o.slots!==void 0?o.slots.toString():"10000",d.hashOn=o.hash_on||"none",d.hashFallback=o.hash_fallback||"none",d.hashOnHeader=o.hash_on_header||"",d.hashOnCookie=o.hash_on_cookie||"",d.hashOnCookiePath=o.hash_on_cookie_path||"/",d.hashOnQueryArgument=o.hash_on_query_arg||"",d.hashOnUriCapture=o.hash_on_uri_capture||"",d.hashFallbackHeader=o.hash_fallback_header||"",d.hashFallbackQueryArgument=o.hash_fallback_query_arg||"",d.hashFallbackUriCapture=o.hash_fallback_uri_capture||"",d.healthchecksThreshold=o.healthchecks.threshold!==null&&o.healthchecks.threshold!==void 0?o.healthchecks.threshold.toString():"",d.activeHealthSwitch=((t=(p=o.healthchecks.active)==null?void 0:p.healthy)==null?void 0:t.interval)!==0||((H=(E=o.healthchecks.active)==null?void 0:E.unhealthy)==null?void 0:H.interval)!==0,d.activeHealthCheck.type=((u=o.healthchecks.active)==null?void 0:u.type)||"http",d.activeHealthCheck.httpPath=((_=o.healthchecks.active)==null?void 0:_.http_path)||"/",d.activeHealthCheck.timeout=((A=o.healthchecks.active)==null?void 0:A.timeout)!==null&&((U=o.healthchecks.active)==null?void 0:U.timeout)!==void 0?(R=(j=o.healthchecks.active)==null?void 0:j.timeout)==null?void 0:R.toString():"",d.activeHealthCheck.concurrency=((y=o.healthchecks.active)==null?void 0:y.concurrency)!==null&&((w=o.healthchecks.active)==null?void 0:w.concurrency)!==void 0?(x=(V=o.healthchecks.active)==null?void 0:V.concurrency)==null?void 0:x.toString():"",d.activeHealthCheck.httpsSni=((f=o.healthchecks.active)==null?void 0:f.https_sni)||"",d.activeHealthCheck.verifySsl=((D=o.healthchecks.active)==null?void 0:D.https_verify_certificate)||!1,d.activeHealthCheck.headers=(M=o.healthchecks.active)!=null&&M.headers&&Object.entries((G=o.healthchecks.active)==null?void 0:G.headers).length>0?Object.entries((J=o.healthchecks.active)==null?void 0:J.headers).map(([$a,be])=>({key:$a,values:be==null?void 0:be.join(", ")})):[{key:"",values:""}],d.activeHealthCheck.interval=((S=(I=o.healthchecks.active)==null?void 0:I.healthy)==null?void 0:S.interval)!==null&&((K=(P=o.healthchecks.active)==null?void 0:P.healthy)==null?void 0:K.interval)!==void 0?(F=(N=(b=o.healthchecks.active)==null?void 0:b.healthy)==null?void 0:N.interval)==null?void 0:F.toString():"0",d.activeHealthCheck.interval=((r=(n=o.healthchecks.active)==null?void 0:n.healthy)==null?void 0:r.interval)!==null&&(($=(i=o.healthchecks.active)==null?void 0:i.healthy)==null?void 0:$.interval)!==void 0?(L=(v=(T=o.healthchecks.active)==null?void 0:T.healthy)==null?void 0:v.interval)==null?void 0:L.toString():"0",d.activeHealthCheck.successes=((Q=(O=o.healthchecks.active)==null?void 0:O.healthy)==null?void 0:Q.successes)!==null&&((se=(Y=o.healthchecks.active)==null?void 0:Y.healthy)==null?void 0:se.successes)!==void 0?(Ue=(Te=(Se=o.healthchecks.active)==null?void 0:Se.healthy)==null?void 0:Te.successes)==null?void 0:Ue.toString():"0",d.activeHealthCheck.httpStatuses=(Fe=(Ie=o.healthchecks.active)==null?void 0:Ie.healthy)!=null&&Fe.http_statuses?l(((Be=(qe=o.healthchecks.active)==null?void 0:qe.healthy)==null?void 0:Be.http_statuses)||[]):me,d.activeHealthCheck.unhealthyInterval=((Oe=(Ee=o.healthchecks.active)==null?void 0:Ee.unhealthy)==null?void 0:Oe.interval)!==null&&(($e=(De=o.healthchecks.active)==null?void 0:De.unhealthy)==null?void 0:$e.interval)!==void 0?(Ae=(Pe=(ve=o.healthchecks.active)==null?void 0:ve.unhealthy)==null?void 0:Pe.interval)==null?void 0:Ae.toString():"0",d.activeHealthCheck.httpFailures=((Ke=(Me=o.healthchecks.active)==null?void 0:Me.unhealthy)==null?void 0:Ke.http_failures)!==null&&((je=(Re=o.healthchecks.active)==null?void 0:Re.unhealthy)==null?void 0:je.http_failures)!==void 0?(We=(Qe=(Le=o.healthchecks.active)==null?void 0:Le.unhealthy)==null?void 0:Qe.http_failures)==null?void 0:We.toString():"0",d.activeHealthCheck.unhealthyTimeouts=((Ge=(Je=o.healthchecks.active)==null?void 0:Je.unhealthy)==null?void 0:Ge.timeouts)!==null&&((Xe=(ze=o.healthchecks.active)==null?void 0:ze.unhealthy)==null?void 0:Xe.timeouts)!==void 0?(et=(Ze=(Ye=o.healthchecks.active)==null?void 0:Ye.unhealthy)==null?void 0:Ze.timeouts)==null?void 0:et.toString():"0",d.activeHealthCheck.unhealthyHttpStatuses=(at=(tt=o.healthchecks.active)==null?void 0:tt.unhealthy)!=null&&at.http_statuses?l(((st=(lt=o.healthchecks.active)==null?void 0:lt.unhealthy)==null?void 0:st.http_statuses)||[]):ye,d.passiveHealthSwitch=((ot=(rt=o.healthchecks.passive)==null?void 0:rt.healthy)==null?void 0:ot.successes)!==0||((it=(nt=o.healthchecks.passive)==null?void 0:nt.unhealthy)==null?void 0:it.timeouts)!==0||((ct=(ht=o.healthchecks.passive)==null?void 0:ht.unhealthy)==null?void 0:ct.tcp_failures)!==0||((ut=(dt=o.healthchecks.passive)==null?void 0:dt.unhealthy)==null?void 0:ut.http_failures)!==0,d.passiveHealthCheck.type=((pt=o.healthchecks.passive)==null?void 0:pt.type)||"http",d.passiveHealthCheck.successes=((mt=(ft=o.healthchecks.passive)==null?void 0:ft.healthy)==null?void 0:mt.successes)!==null&&((yt=(gt=o.healthchecks.passive)==null?void 0:gt.healthy)==null?void 0:yt.successes)!==void 0?(Ct=(bt=(kt=o.healthchecks.passive)==null?void 0:kt.healthy)==null?void 0:bt.successes)==null?void 0:Ct.toString():"0",d.passiveHealthCheck.httpStatuses=(wt=(_t=o.healthchecks.passive)==null?void 0:_t.healthy)!=null&&wt.http_statuses?l(((Ht=(Vt=o.healthchecks.passive)==null?void 0:Vt.healthy)==null?void 0:Ht.http_statuses)||[]):ge,d.passiveHealthCheck.timeouts=((Nt=(xt=o.healthchecks.passive)==null?void 0:xt.unhealthy)==null?void 0:Nt.timeouts)!==null&&((Tt=(St=o.healthchecks.passive)==null?void 0:St.unhealthy)==null?void 0:Tt.timeouts)!==void 0?(Ft=(It=(Ut=o.healthchecks.passive)==null?void 0:Ut.unhealthy)==null?void 0:It.timeouts)==null?void 0:Ft.toString():"0",d.passiveHealthCheck.tcpFailures=((Bt=(qt=o.healthchecks.passive)==null?void 0:qt.unhealthy)==null?void 0:Bt.tcp_failures)!==null&&((Ot=(Et=o.healthchecks.passive)==null?void 0:Et.unhealthy)==null?void 0:Ot.tcp_failures)!==void 0?(vt=($t=(Dt=o.healthchecks.passive)==null?void 0:Dt.unhealthy)==null?void 0:$t.tcp_failures)==null?void 0:vt.toString():"",d.passiveHealthCheck.unhealthyHttpStatuses=(At=(Pt=o.healthchecks.passive)==null?void 0:Pt.unhealthy)!=null&&At.http_statuses?l(((Kt=(Mt=o.healthchecks.passive)==null?void 0:Mt.unhealthy)==null?void 0:Kt.http_statuses)||[]):ke,d},getDefaultUpstreamFields:h,objectsAreEqual:(o,d)=>{try{return JSON.stringify(o)===JSON.stringify(d)}catch{return!1}},cloneDeep:o=>JSON.parse(JSON.stringify(o))}}const z={useI18n:jt,useMultiselectCreation:re,useHelpers:ie},te="/v2/control-planes/{controlPlaneId}/core-entities",ae="/{workspace}",le={list:{konnect:`${te}/upstreams`,kongManager:`${ae}/upstreams`},form:{konnect:{getServices:`${te}/services`,getCertificates:`${te}/certificates`,validate:`${te}/v1/schemas/json/upstream/validate`,create:`${te}/upstreams`,edit:`${te}/upstreams/{id}`},kongManager:{getServices:`${ae}/services`,getCertificates:`${ae}/certificates`,validate:`${ae}/schemas/upstreams/validate`,create:`${ae}/upstreams`,edit:`${ae}/upstreams/{id}`}}},Xt={class:"kong-ui-entities-upstreams-list"},Yt={class:"upstream-name"},Zt=e.defineComponent({__name:"UpstreamsList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.createRoute||!a.getViewRoute||!a.getEditRoute||a.app==="kongManager"&&!a.isExactMatch&&!a.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(a,{emit:B}){var K;const s=B,l=a,{i18n:{t:h}}=z.useI18n(),k=Ce.useRouter(),{axiosInstance:g}=m.useAxios((K=l.config)==null?void 0:K.axiosRequestConfig),q=e.ref(1),o=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),d={name:{label:h("upstreams.list.table_headers.name"),searchable:!0,sortable:!0,hidable:!1},slots:{label:h("upstreams.list.table_headers.slots"),searchable:!0,sortable:!0},tags:{label:h("upstreams.list.table_headers.tags"),sortable:!1}},c=d,C=e.computed(()=>{var N,F;let b=`${l.config.apiBaseUrl}${le.list[l.config.app]}`;return l.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((N=l.config)==null?void 0:N.controlPlaneId)||""):l.config.app==="kongManager"&&(b=b.replace(/\/{workspace}/gi,(F=l.config)!=null&&F.workspace?`/${l.config.workspace}`:"")),b}),p=e.ref(""),t=e.computed(()=>{const b=l.config.app==="konnect"||l.config.isExactMatch;if(b)return{isExactMatch:b,placeholder:h("upstreams.search.placeholder")};const{name:N,slots:F}=d;return{isExactMatch:b,fields:{name:N,slots:F},schema:l.config.filterSchema}}),{fetcher:E,fetcherState:H}=m.useFetcher(l.config,C.value),u=()=>{p.value=""},_=()=>{q.value++},A=e.ref(null),U=(b,N)=>{const F=b.id;if(!N(F)){s("copy:error",{entity:b,field:"id",message:h("upstreams.errors.copy")});return}s("copy:success",{entity:b,field:"id",message:h("upstreams.copy.success",{val:F})})},j=(b,N)=>{const F=JSON.stringify(b);if(!N(F)){s("copy:error",{entity:b,message:h("upstreams.errors.copy")});return}s("copy:success",{entity:b,message:h("upstreams.copy.success_brief")})},R=async b=>{var F;await((F=l.canRetrieve)==null?void 0:F.call(l,b))&&k.push(l.config.getViewRoute(b.id))},y=b=>({label:h("upstreams.actions.view"),to:l.config.getViewRoute(b)}),w=b=>({label:h("upstreams.actions.edit"),to:l.config.getEditRoute(b)}),V=e.ref(void 0),x=e.ref(!1),f=e.ref(!1),D=e.ref(""),M=m.useDeleteUrlBuilder(l.config,C.value),G=b=>{V.value=b,x.value=!0},J=()=>{x.value=!1},I=async()=>{var b,N,F;if((b=V.value)!=null&&b.id){f.value=!0;try{await g.delete(M(V.value.id)),f.value=!1,x.value=!1,q.value++,s("delete:success",V.value)}catch(n){D.value=((F=(N=n.response)==null?void 0:N.data)==null?void 0:F.message)||n.message||h("upstreams.errors.delete"),s("error",n)}finally{f.value=!1}}},S=e.ref(!1);e.watch(H,b=>{var N,F,n,r;if(Array.isArray((N=b==null?void 0:b.response)==null?void 0:N.data)&&(S.value=b.response.data.length>0),b.status===m.FetcherStatus.Error){A.value={title:h("upstreams.errors.general")},(r=(n=(F=b.error)==null?void 0:F.response)==null?void 0:n.data)!=null&&r.message&&(A.value.message=b.error.response.data.message),s("error",b.error);return}A.value=null});const P=e.ref({ctaPath:l.config.createRoute,ctaText:void 0,message:`${h("upstreams.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:h("upstreams.title")});return e.onBeforeMount(async()=>{await l.canCreate()&&(P.value.title=h("upstreams.list.empty_state.title"),P.value.ctaText=h("upstreams.actions.create"))}),(b,N)=>{const F=e.resolveComponent("KButton"),n=e.resolveComponent("KBadge"),r=e.resolveComponent("KTruncate"),i=e.resolveComponent("KDropdownItem"),$=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",Xt,[e.createVNode(e.unref(m.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":o.value,"empty-state-options":P.value,"enable-entity-actions":"","error-message":A.value,fetcher:e.unref(E),"fetcher-cache-key":q.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-upstreams-list",query:p.value,"table-headers":e.unref(c),"use-action-outside":a.useActionOutside,onClearSearchInput:u,"onClick:row":N[1]||(N[1]=T=>R(T)),onSort:_},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(m.EntityFilter),{modelValue:p.value,"onUpdate:modelValue":N[0]||(N[0]=T=>p.value=T),config:t.value},null,8,["modelValue","config"])]),"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(F,{appearance:"primary","data-testid":"toolbar-add-upstream",size:"large",to:a.config.createRoute},{default:e.withCtx(()=>[e.createVNode(e.unref(oe.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(h)("upstreams.list.toolbar_actions.new_upstream")),1)]),_:1},8,["to"]),[[e.vShow,S.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),name:e.withCtx(({rowValue:T})=>[e.createElementVNode("span",Yt,e.toDisplayString(T),1)]),tags:e.withCtx(({rowValue:T})=>[e.createVNode(r,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T,v=>(e.openBlock(),e.createBlock(n,{key:v,"max-width":"auto"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v),1)]),_:2},1024))),128))]),_:2},1024)]),actions:e.withCtx(({row:T})=>[e.createVNode($,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(i,{"data-testid":"action-entity-copy-id",onClick:L=>U(T,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("upstreams.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode($,null,{default:e.withCtx(({copyToClipboard:v})=>[e.createVNode(i,{"data-testid":"action-entity-copy-json",onClick:L=>j(T,v)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("upstreams.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canRetrieve(T)},{default:e.withCtx(()=>[e.createVNode(i,{"data-testid":"action-entity-view","has-divider":"",item:y(T.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canEdit(T)},{default:e.withCtx(()=>[e.createVNode(i,{"data-testid":"action-entity-edit",item:w(T.id)},null,8,["item"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canDelete(T)},{default:e.withCtx(()=>[e.createVNode(i,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:v=>G(T)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("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"]),e.createVNode(e.unref(m.EntityDeleteModal),{"action-pending":f.value,description:e.unref(h)("upstreams.delete.description"),"entity-name":V.value&&(V.value.name||V.value.id),"entity-type":e.unref(m.EntityTypes).Upstream,error:D.value,title:e.unref(h)("upstreams.delete.title"),visible:x.value,onCancel:J,onProceed:I},null,8,["action-pending","description","entity-name","entity-type","error","title","visible"])])}}}),X=(a,B)=>{const s=a.__vccOpts||a;for(const[l,h]of B)s[l]=h;return s},ea=X(Zt,[["__scopeId","data-v-9f2efb47"]]),he="/v2/control-planes/{controlPlaneId}/core-entities",ce="/{workspace}",de={list:{konnect:`${he}/upstreams/{upstreamId}/targets`,kongManager:`${ce}/upstreams/{upstreamId}/targets`},form:{konnect:{create:`${he}/upstreams/{upstreamId}/targets`,edit:`${he}/upstreams/{upstreamId}/targets/{id}`,validate:`${he}/v1/schemas/json/target/validate`},kongManager:{create:`${ce}/upstreams/{upstreamId}/targets`,edit:`${ce}/upstreams/{upstreamId}/targets/{id}`,validate:`${ce}/schemas/targets/validate`}}},ta={class:"kong-ui-entities-target-form"},aa={class:"target-form-container"},la={key:0,class:"target-form-info"},Ne=X(e.defineComponent({__name:"TargetForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.upstreamId)},isVisible:{type:Boolean,required:!0,default:!1},targetId:{type:String,required:!1,default:""}},emits:["update","error","loading","cancel"],setup(a,{emit:B}){var R;const s=B,l=a,{i18n:{t:h}}=z.useI18n(),{getMessageFromError:k}=m.useErrors(),{axiosInstance:g}=m.useAxios((R=l.config)==null?void 0:R.axiosRequestConfig),q=e.computed(()=>{var y;return de.form[l.config.app].edit.replace(/{upstreamId}/gi,((y=l.config)==null?void 0:y.upstreamId)||"")}),o=e.computed(()=>l.targetId?m.EntityBaseFormType.Edit:m.EntityBaseFormType.Create),d=e.computed(()=>o.value===m.EntityBaseFormType.Edit?h("targets.form.edit.title"):h("targets.form.create.title")),c=e.reactive({fields:{target:"",weight:100,tags:""},isReadonly:!1,errorMessage:""}),C=e.reactive({target:"",weight:100,tags:""}),p={target:"",weight:100,tags:""},t=e.computed(()=>{const y=parseInt(c.fields.weight.toString(),10);return y<0||y>65535}),E=e.computed(()=>JSON.stringify(c.fields)!==JSON.stringify(C)&&!!c.fields.target&&!!c.fields.weight&&!t.value),H=y=>{var w;c.fields.target=(y==null?void 0:y.target)||"",c.fields.weight=(y==null?void 0:y.weight)??"",c.fields.tags=((w=y==null?void 0:y.tags)==null?void 0:w.join(", "))||"",Object.assign(C,c.fields)},u=()=>{c.errorMessage="",s("cancel")},_=e.computed(()=>{var w,V;let y=`${l.config.apiBaseUrl}${de.form[l.config.app].validate}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((w=l.config)==null?void 0:w.controlPlaneId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(V=l.config)!=null&&V.workspace?`/${l.config.workspace}`:"")),y=y.replace(/{id}/gi,l.targetId),y}),A=e.computed(()=>{var w,V,x,f;let y=`${l.config.apiBaseUrl}${de.form[l.config.app][o.value]}`;return l.config.app==="konnect"?y=y.replace(/{controlPlaneId}/gi,((w=l.config)==null?void 0:w.controlPlaneId)||"").replace(/{upstreamId}/gi,((V=l.config)==null?void 0:V.upstreamId)||""):l.config.app==="kongManager"&&(y=y.replace(/\/{workspace}/gi,(x=l.config)!=null&&x.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((f=l.config)==null?void 0:f.upstreamId)||"")),y=y.replace(/{id}/gi,l.targetId),y}),U=e.computed(()=>{var y,w,V;return{target:c.fields.target,weight:parseInt(c.fields.weight),tags:(V=(w=(y=c.fields.tags)==null?void 0:y.split(","))==null?void 0:w.map(x=>String(x||"").trim()))==null?void 0:V.filter(x=>x!==""),upstream:{id:l.config.upstreamId}}}),j=async()=>{var y,w;try{c.isReadonly=!0,c.errorMessage="";let V;if(await g.post(_.value,U.value),o.value==="create"?V=await g.post(A.value,U.value):o.value==="edit"&&(V=((y=l.config)==null?void 0:y.app)==="konnect"?await g.put(A.value,U.value):await g.patch(A.value,U.value)),V){const{data:x}=V;c.fields.target=(x==null?void 0:x.name)||"",c.fields.weight=(x==null?void 0:x.weight)??100,c.fields.tags=((w=x==null?void 0:x.tags)==null?void 0:w.join(", "))||"",s("update",x),Object.assign(c.fields,p)}}catch(V){c.errorMessage=k(V),s("error",V)}finally{c.isReadonly=!1}};return e.watch(()=>l.targetId,()=>{Object.assign(c.fields,p)}),(y,w)=>{const V=e.resolveComponent("KInput"),x=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(x,{"action-button-disabled":!E.value||c.isReadonly,"action-button-text":e.unref(h)("targets.form.buttons.save"),"cancel-button-text":e.unref(h)("targets.form.buttons.cancel"),title:d.value,visible:a.isVisible,onCancel:u,onProceed:j},{default:e.withCtx(()=>[e.createElementVNode("div",ta,[e.createVNode(e.unref(m.EntityBaseForm),{config:a.config,"edit-id":a.targetId,"entity-type":e.unref(m.SupportedEntityType).Target,"error-message":c.errorMessage,"fetch-url":q.value,"form-fields":U.value,"is-readonly":c.isReadonly,onCancel:u,"onFetch:error":w[3]||(w[3]=f=>y.$emit("error",f)),"onFetch:success":H,onLoading:w[4]||(w[4]=f=>y.$emit("loading",f))},{default:e.withCtx(()=>[e.createElementVNode("div",aa,[y.$slots.info?(e.openBlock(),e.createElementBlock("div",la,[e.renderSlot(y.$slots,"info",{},void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(V,{modelValue:c.fields.target,"onUpdate:modelValue":w[0]||(w[0]=f=>c.fields.target=f),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-target",label:e.unref(h)("targets.form.fields.target.label"),"label-attributes":{info:e.unref(h)("targets.form.fields.target.tooltip")},placeholder:e.unref(h)("targets.form.fields.target.placeholder"),readonly:c.isReadonly,required:"",type:"text"},null,8,["modelValue","label","label-attributes","placeholder","readonly"]),e.createVNode(V,{modelValue:c.fields.weight,"onUpdate:modelValue":w[1]||(w[1]=f=>c.fields.weight=f),autocomplete:"off",class:"target-form-input","data-testid":"target-form-weight",error:t.value,"error-message":e.unref(h)("targets.errors.weight"),label:e.unref(h)("targets.form.fields.weight.label"),"label-attributes":{info:e.unref(h)("targets.form.fields.weight.tooltip")},max:"65535",min:"0",readonly:c.isReadonly,required:"",type:"number"},null,8,["modelValue","error","error-message","label","label-attributes","readonly"]),e.createVNode(V,{modelValue:c.fields.tags,"onUpdate:modelValue":w[2]||(w[2]=f=>c.fields.tags=f),modelModifiers:{trim:!0},autocomplete:"off",class:"target-form-input","data-testid":"target-form-tags",help:e.unref(h)("targets.form.fields.tags.help"),label:e.unref(h)("targets.form.fields.tags.label"),placeholder:e.unref(h)("targets.form.fields.tags.placeholder"),readonly:c.isReadonly,type:"text"},null,8,["modelValue","help","label","placeholder","readonly"])])]),_:3},8,["config","edit-id","entity-type","error-message","fetch-url","form-fields","is-readonly"])])]),_:3},8,["action-button-disabled","action-button-text","cancel-button-text","title","visible"])}}}),[["__scopeId","data-v-77947aef"]]),sa={class:"kong-ui-entities-targets-list"},ra={class:"target-address"},oa=X(e.defineComponent({__name:"TargetsList",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||!a.upstreamId||a.app==="kongManager"&&(typeof a.canMarkHealthy>"u"||typeof a.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(a,{emit:B}){var F;const s=B,l=a,{i18n:{t:h}}=z.useI18n(),{axiosInstance:k}=m.useAxios((F=l.config)==null?void 0:F.axiosRequestConfig),g=e.ref(1),q=e.computed(()=>l.config.app!=="kongManager"||!!l.config.disableSorting),d={target:{label:h("targets.list.table_headers.target_address"),sortable:!0,hidable:!1},weight:{label:h("targets.list.table_headers.weight"),sortable:!0},tags:{label:h("targets.list.table_headers.tags"),sortable:!1}},c=e.computed(()=>{var r,i,$,T;let n=`${l.config.apiBaseUrl}${de.list[l.config.app]}`;return l.config.app==="konnect"?n=n.replace(/{controlPlaneId}/gi,((r=l.config)==null?void 0:r.controlPlaneId)||"").replace(/{upstreamId}/gi,((i=l.config)==null?void 0:i.upstreamId)||""):l.config.app==="kongManager"&&(n=n.replace(/\/{workspace}/gi,($=l.config)!=null&&$.workspace?`/${l.config.workspace}`:"").replace(/{upstreamId}/gi,((T=l.config)==null?void 0:T.upstreamId)||"")),n}),{fetcher:C,fetcherState:p}=m.useFetcher(l.config,c.value),t=()=>{g.value++},E=e.ref(null),H=()=>{P.value=!0},u=(n,r)=>{const i=n.id;if(!r(i)){s("copy:error",{entity:n,field:"id",message:h("targets.errors.copy")});return}s("copy:success",{entity:n,field:"id",message:h("targets.copy.success",{val:i})})},_=(n,r)=>{const i=JSON.stringify(n);if(!r(i)){s("copy:error",{entity:n,message:h("targets.errors.copy")});return}s("copy:success",{entity:n,message:h("targets.copy.success_brief")})},A=n=>{S.value=n,P.value=!0},U=n=>l.config.app==="konnect"?!1:l.config.canMarkHealthy(n),j=n=>l.config.app==="konnect"?!1:l.config.canMarkUnhealthy(n),R=e.ref(void 0),y=e.ref(!1),w=e.ref(!1),V=e.ref(""),x=m.useDeleteUrlBuilder(l.config,c.value),f=n=>{R.value=n,y.value=!0},D=()=>{y.value=!1},M=async()=>{var n,r,i;if((n=R.value)!=null&&n.id){w.value=!0;try{await k.delete(x(R.value.id)),w.value=!1,y.value=!1,g.value++,s("delete:success",R.value)}catch($){V.value=((i=(r=$.response)==null?void 0:r.data)==null?void 0:i.message)||$.message||h("targets.errors.delete"),s("error",$)}finally{w.value=!1}}},G=e.ref(!1);e.watch(p,n=>{var r,i,$,T;if(Array.isArray((r=n==null?void 0:n.response)==null?void 0:r.data)&&(G.value=n.response.data.length>0),n.status===m.FetcherStatus.Error){E.value={title:h("targets.errors.general")},(T=($=(i=n.error)==null?void 0:i.response)==null?void 0:$.data)!=null&&T.message&&(E.value.message=n.error.response.data.message),s("error",n.error);return}E.value=null});const J=e.ref({ctaText:void 0,message:`${h("targets.list.empty_state.description")}${l.config.additionMessageForEmptyState?` ${l.config.additionMessageForEmptyState}`:""}`,title:h("targets.title"),...l.config.createRoute&&{ctaPath:l.config.createRoute}});e.onBeforeMount(async()=>{await l.canCreate()&&(J.value.title=h("targets.list.empty_state.title"),J.value.ctaText=h("targets.actions.create"))});const I=e.computed(()=>({app:l.config.app,apiBaseUrl:l.config.apiBaseUrl,upstreamId:l.config.upstreamId,axiosRequestConfig:l.config.axiosRequestConfig,...l.config.app==="konnect"&&{controlPlaneId:l.config.controlPlaneId},...l.config.app==="kongManager"&&{workspace:l.config.workspace}})),S=e.ref(""),P=e.ref(!1),K=n=>{S.value?s("update:target",n):s("create:target",n),b()},b=()=>{N(),g.value++},N=()=>{P.value=!1,S.value=""};return(n,r)=>{const i=e.resolveComponent("KButton"),$=e.resolveComponent("KBadge"),T=e.resolveComponent("KTruncate"),v=e.resolveComponent("KDropdownItem"),L=e.resolveComponent("KClipboardProvider");return e.openBlock(),e.createElementBlock("div",sa,[e.createVNode(e.unref(m.EntityBaseTable),{"cache-identifier":a.cacheIdentifier,"disable-pagination-page-jump":"","disable-sorting":q.value,"empty-state-options":J.value,"enable-entity-actions":"","error-message":E.value,fetcher:e.unref(C),"fetcher-cache-key":g.value,"pagination-type":"offset","preferences-storage-key":"kong-ui-entities-targets-list","table-headers":e.unref(d),"use-action-outside":a.useActionOutside,onEmptyStateCtaClicked:r[1]||(r[1]=()=>l.config.createRoute?void 0:H()),onSort:t},{"toolbar-button":e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!a.useActionOutside,to:"#kong-ui-app-page-header-action-button"},[e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canCreate()},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(i,{appearance:"primary","data-testid":"toolbar-new-target",to:l.config.createRoute?l.config.createRoute:void 0,onClick:r[0]||(r[0]=()=>l.config.createRoute?void 0:H())},{default:e.withCtx(()=>[e.createVNode(e.unref(oe.AddIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(h)("targets.list.toolbar_actions.new_target")),1)]),_:1},8,["to"]),[[e.vShow,G.value]])]),_:1},8,["auth-function"])],8,["disabled"]))]),target:e.withCtx(({rowValue:O})=>[e.createElementVNode("span",ra,e.toDisplayString(O),1)]),tags:e.withCtx(({rowValue:O})=>[e.createVNode(T,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O,Q=>(e.openBlock(),e.createBlock($,{key:Q,"max-width":"auto"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Q),1)]),_:2},1024))),128))]),_:2},1024)]),actions:e.withCtx(({row:O})=>[e.createVNode(L,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(v,{"data-testid":"action-entity-copy-id",onClick:Y=>u(O,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("targets.actions.copy_id")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(L,null,{default:e.withCtx(({copyToClipboard:Q})=>[e.createVNode(v,{"data-testid":"action-entity-copy-json",onClick:Y=>_(O,Q)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("targets.actions.copy_json")),1)]),_:2},1032,["onClick"])]),_:2},1024),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canEdit(O)},{default:e.withCtx(()=>[e.createVNode(v,{"data-testid":"action-entity-edit","has-divider":"",onClick:Q=>A(O.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("targets.actions.edit")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>U(O)},{default:e.withCtx(()=>[e.createVNode(v,{"data-testid":"action-target-mark-healthy",onClick:Q=>s("health-actions:healthy",O)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("targets.actions.mark_healthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>j(O)},{default:e.withCtx(()=>[e.createVNode(v,{"data-testid":"action-target-mark-unhealthy",onClick:Q=>s("health-actions:unhealthy",O)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("targets.actions.mark_unhealthy")),1)]),_:2},1032,["onClick"])]),_:2},1032,["auth-function"]),e.createVNode(e.unref(m.PermissionsWrapper),{"auth-function":()=>a.canDelete(O)},{default:e.withCtx(()=>[e.createVNode(v,{danger:"","data-testid":"action-entity-delete","has-divider":"",onClick:Q=>f(O)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(h)("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"]),e.createVNode(e.unref(m.EntityDeleteModal),{"action-pending":w.value,description:e.unref(h)("targets.delete.description"),"entity-type":e.unref(m.EntityTypes).Target,error:V.value,"need-confirm":!1,title:e.unref(h)("targets.delete.title"),visible:y.value,onCancel:D,onProceed:M},null,8,["action-pending","description","entity-type","error","title","visible"]),e.createVNode(Ne,{config:I.value,"is-visible":P.value,"target-id":S.value,onCancel:N,onUpdate:K},e.createSlots({_:2},[n.$slots["form-info"]?{name:"info",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"form-info",{},void 0,!0)]),key:"0"}:void 0]),1032,["config","is-visible","target-id"])])}}}),[["__scopeId","data-v-e6ed1cfb"]]),na={key:1},ia=X(e.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(a,{emit:B}){var D,M,G,J;const{i18nT:s,i18n:{t:l}}=z.useI18n(),h=a,k=B,{debouncedQueryChange:g,loading:q,loadItems:o,results:d,allRecords:c}=m.useDebouncedFilter(h.config,(M=le.form[(D=h.config)==null?void 0:D.app])==null?void 0:M.getServices,"",{fetchedItemsKey:"data",searchKeys:["host"]}),{debouncedQueryChange:C,loading:p,loadItems:t,results:E}=m.useDebouncedFilter(h.config,(J=le.form[(G=h.config)==null?void 0:G.app])==null?void 0:J.getCertificates),H=e.ref(""),u=e.computed(()=>{var I;return!!h.name&&!((I=c.value)!=null&&I.some(S=>S.host===h.name))}),_=e.computed(()=>{var S,P,K;const I=u.value&&h.name.includes((S=H.value)==null?void 0:S.toLowerCase());return(K=d.value)==null?void 0:K.map(b=>({label:b.host,value:b.id})).concat(I?[{label:h.name,value:((P=j.value)==null?void 0:P.value)||h.name}]:[])}),A=e.computed(()=>{var I;return(I=E.value)==null?void 0:I.map(S=>({label:S.id,value:S.id}))}),U=e.ref(""),j=e.ref({value:"",label:""}),R=e.computed(()=>{var I,S;return((I=_.value.find(P=>P.value===U.value))==null?void 0:I.label)||((S=j.value)==null?void 0:S.label)}),y=I=>{H.value=I,g(I)},w=I=>{j.value=I},V=()=>{j.value={value:"",label:""}},x=I=>{U.value=I,k("update:name",R.value)},f=e.ref(!1);return e.onBeforeMount(async()=>{var I,S;try{f.value=!0,await o(),h.name&&(U.value=((S=(I=_.value.find(P=>P.label===h.name))==null?void 0:I.value)==null?void 0:S.toString())||h.name),await t()}finally{f.value=!1}}),(I,S)=>{const P=e.resolveComponent("KSkeleton"),K=e.resolveComponent("KSelect"),b=e.resolveComponent("KInput");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-general-info",description:e.unref(l)("upstreams.form.general_info.help"),title:e.unref(l)("upstreams.form.general_info.title")},{default:e.withCtx(()=>[f.value?(e.openBlock(),e.createBlock(P,{key:0,type:"form"})):(e.openBlock(),e.createElementBlock("div",na,[e.createVNode(K,{class:"name-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-name","enable-filtering":"","enable-item-creation":"","filter-function":()=>!0,items:_.value,label:e.unref(l)("upstreams.form.fields.name.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},loading:e.unref(q),"model-value":U.value,placeholder:e.unref(l)("upstreams.form.fields.name.placeholder"),readonly:a.readonly,required:"",width:"100%",onItemAdded:w,onItemRemoved:V,onQueryChange:y,"onUpdate:modelValue":x},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(l)("upstreams.form.fields.name.host")),1)]),_:1})]),_:1},8,["items","label","loading","model-value","placeholder","readonly","onUpdate:modelValue"]),e.createVNode(b,{autocomplete:"off",class:"margin-bottom-6","data-testid":"upstreams-form-host-header",label:e.unref(l)("upstreams.form.fields.host_header.label"),"model-value":a.hostHeader,readonly:a.readonly,type:"text","onUpdate:modelValue":S[0]||(S[0]=N=>k("update:host-header",N))},null,8,["label","model-value","readonly"]),e.createVNode(K,{class:"certificate-select margin-bottom-6",clearable:"","data-testid":"upstreams-form-client-certificate","enable-filtering":"","filter-function":()=>!0,items:A.value,label:e.unref(l)("upstreams.form.fields.client_certificate.label"),"label-attributes":{info:e.unref(l)("upstreams.form.fields.client_certificate.tooltip"),tooltipAttributes:{maxWidth:"250px"}},loading:e.unref(p),"model-value":a.clientCertificate,placeholder:e.unref(l)("upstreams.form.fields.client_certificate.placeholder"),readonly:a.readonly,width:"100%",onQueryChange:e.unref(C),"onUpdate:modelValue":S[1]||(S[1]=N=>k("update:client-certificate",N))},null,8,["items","label","label-attributes","loading","model-value","placeholder","readonly","onQueryChange"]),e.createVNode(b,{autocomplete:"off","data-testid":"upstreams-form-tags",help:e.unref(l)("upstreams.form.fields.tags.help"),label:e.unref(l)("upstreams.form.fields.tags.label"),"label-attributes":{info:e.unref(l)("upstreams.form.fields.tags.tooltip"),tooltipAttributes:{maxWidth:"250px"}},"model-value":a.tags,placeholder:e.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:a.readonly,type:"text","onUpdate:modelValue":S[2]||(S[2]=N=>k("update:tags",N))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-e33bdb7f"]]),ue={upstreamObject:"https://docs.konghq.com/gateway/latest/admin-api/#upstream-object",loadBalancing:"https://docs.konghq.com/gateway/latest/how-kong-works/load-balancing/#main"},ha={class:"fields-group-title"},ca={class:"fields-group-text"},da={class:"fields-group-title"},ua={class:"fields-group-text"},pa=X(e.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(a,{emit:B}){const{i18nT:s,i18n:{t:l}}=z.useI18n(),{inRange:h}=ie(),k=a,g=B,q=e.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}]),o=e.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}]);e.watch(()=>k.hashOn,(C,p)=>{p==="header"&&C!==p&&g("update:hash-on-header",""),p==="cookie"&&C!==p&&(g("update:hash-on-cookie",""),g("update:hash-on-cookie-path","/")),p==="query_arg"&&C!==p&&g("update:hash-on-query-argument",""),p==="uri_capture"&&C!==p&&g("update:hash-on-uri-capture",""),(C==="cookie"||C==="none")&&(g("update:hash-fallback","none"),g("update:hash-fallback-header",""),g("update:hash-fallback-query-argument",""),g("update:hash-fallback-uri-capture",""))}),e.watch(()=>k.hashFallback,(C,p)=>{p==="header"&&C!==p&&g("update:hash-fallback-header",""),p==="cookie"&&C!==p&&(g("update:hash-on-cookie",""),g("update:hash-on-cookie-path","/")),p==="query_arg"&&C!==p&&g("update:hash-fallback-query-argument",""),p==="uri_capture"&&C!==p&&g("update:hash-fallback-uri-capture","")});const d=e.computed(()=>k.hashOn==="cookie"||k.hashOn==="none"),c=e.computed(()=>k.slots?h(k.slots,pe,fe)?"":l("upstreams.form.errors.in_range"):"");return(C,p)=>{const t=e.resolveComponent("KExternalLink"),E=e.resolveComponent("KSelect"),H=e.resolveComponent("KInput"),u=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-load-balancing",title:e.unref(l)("upstreams.form.load_balancing.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(l)("upstreams.form.load_balancing.help"))+" ",1),e.createVNode(t,{"hide-icon":"",href:e.unref(ue).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(E,{class:"algorithm-select",items:q.value,label:e.unref(l)("upstreams.form.fields.algorithm.label"),"model-value":a.algorithm,readonly:a.readonly,width:"100%","onUpdate:modelValue":p[0]||(p[0]=_=>g("update:algorithm",_))},null,8,["items","label","model-value","readonly"]),e.createVNode(H,{autocomplete:"off","data-testid":"upstreams-form-slots",error:!!c.value,"error-message":c.value,help:e.unref(l)("upstreams.form.fields.slots.help"),label:e.unref(l)("upstreams.form.fields.slots.label"),max:e.unref(fe),min:e.unref(pe),"model-value":a.slots,readonly:a.readonly,type:"number","onUpdate:modelValue":p[1]||(p[1]=_=>g("update:slots",_))},null,8,["error","error-message","help","label","max","min","model-value","readonly"]),e.createVNode(u,null,{default:e.withCtx(()=>[e.createElementVNode("h5",ha,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_on.label")),1),e.createElementVNode("p",ca,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_on.help")),1),e.createVNode(E,{class:"hash-on-select",items:o.value,label:e.unref(l)("upstreams.form.fields.hash_on.label"),"model-value":a.hashOn,readonly:a.readonly,width:"100%","onUpdate:modelValue":p[2]||(p[2]=_=>g("update:hash-on",_))},null,8,["items","label","model-value","readonly"]),a.hashOn==="header"?(e.openBlock(),e.createBlock(H,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-header",label:e.unref(l)("upstreams.form.fields.header.label"),"model-value":a.hashOnHeader,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[3]||(p[3]=_=>g("update:hash-on-header",_))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashOn==="cookie"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(H,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:e.unref(l)("upstreams.form.fields.cookie.label"),"model-value":a.hashOnCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[4]||(p[4]=_=>g("update:hash-on-cookie",_))},null,8,["label","model-value","readonly"]),e.createVNode(H,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:e.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":a.hashOnCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[5]||(p[5]=_=>g("update:hash-on-cookie-path",_))},null,8,["label","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.hashOn==="query_arg"?(e.openBlock(),e.createBlock(H,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-query-argument",label:e.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":a.hashOnQueryArgument,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[6]||(p[6]=_=>g("update:hash-on-query-argument",_))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashOn==="uri_capture"?(e.openBlock(),e.createBlock(H,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-uri-capture",label:e.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":a.hashOnUriCapture,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[7]||(p[7]=_=>g("update:hash-on-uri-capture",_))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(u,null,{default:e.withCtx(()=>[e.createElementVNode("h5",da,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.label")),1),e.createElementVNode("p",ua,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.help")),1),e.createVNode(E,{class:"hash-fallback-select",disabled:d.value,items:o.value,label:e.unref(l)("upstreams.form.fields.hash_fallback.label"),"label-attributes":{tooltipAttributes:{"max-width":"250px"}},"model-value":a.hashFallback,readonly:a.readonly,width:"100%","onUpdate:modelValue":p[8]||(p[8]=_=>g("update:hash-fallback",_))},{"label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(s),{keypath:"upstreams.form.fields.hash_fallback.tooltip",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.hash_on")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(l)("upstreams.form.fields.hash_fallback.cookie")),1)]),_:1})]),_:1},8,["disabled","items","label","model-value","readonly"]),a.hashFallback==="header"?(e.openBlock(),e.createBlock(H,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-header",label:e.unref(l)("upstreams.form.fields.header.label"),"model-value":a.hashFallbackHeader,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[9]||(p[9]=_=>g("update:hash-fallback-header",_))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashFallback==="cookie"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(H,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie",label:e.unref(l)("upstreams.form.fields.cookie.label"),"model-value":a.hashOnCookie,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[10]||(p[10]=_=>g("update:hash-on-cookie",_))},null,8,["label","model-value","readonly"]),e.createVNode(H,{autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-on-cookie-path",label:e.unref(l)("upstreams.form.fields.cookie_path.label"),"model-value":a.hashOnCookiePath,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[11]||(p[11]=_=>g("update:hash-on-cookie-path",_))},null,8,["label","model-value","readonly"])],64)):e.createCommentVNode("",!0),a.hashFallback==="query_arg"?(e.openBlock(),e.createBlock(H,{key:2,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-query-argument",label:e.unref(l)("upstreams.form.fields.query_argument.label"),"model-value":a.hashFallbackQueryArgument,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[12]||(p[12]=_=>g("update:hash-fallback-query-argument",_))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0),a.hashFallback==="uri_capture"?(e.openBlock(),e.createBlock(H,{key:3,autocomplete:"off",class:"margin-top-6","data-testid":"upstreams-form-hash-fallback-uri-capture",label:e.unref(l)("upstreams.form.fields.uri_capture.label"),"model-value":a.hashFallbackUriCapture,readonly:a.readonly,required:"",type:"text","onUpdate:modelValue":p[13]||(p[13]=_=>g("update:hash-fallback-uri-capture",_))},null,8,["label","model-value","readonly"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-928fd562"]]),fa={class:"fields-group-title"},ma={class:"fields-group-text"},ga={class:"fields-group-title"},ya={class:"fields-group-text"},ka=X(e.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(a,{emit:B}){const{i18n:{t:s}}=z.useI18n(),l=B;return(h,k)=>{const g=e.resolveComponent("KExternalLink"),q=e.resolveComponent("KInputSwitch"),o=e.resolveComponent("KCard"),d=e.resolveComponent("KInput");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-healthchecks",title:e.unref(s)("upstreams.form.health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.health_check.help"))+" ",1),e.createVNode(g,{"hide-icon":"",href:e.unref(ue).loadBalancing},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(o,null,{default:e.withCtx(()=>[e.createElementVNode("h5",fa,e.toDisplayString(e.unref(s)("upstreams.form.fields.active_health_checks.label")),1),e.createElementVNode("p",ma,e.toDisplayString(e.unref(s)("upstreams.form.fields.active_health_checks.help")),1),e.createVNode(q,{class:"active-health-switch","data-testid":"active-health-switch",disabled:a.readonly,"model-value":a.activeHealthSwitch,onChange:k[0]||(k[0]=c=>l("update:active-health-switch",c))},null,8,["disabled","model-value"])]),_:1}),e.createVNode(o,null,{default:e.withCtx(()=>[e.createElementVNode("h5",ga,e.toDisplayString(e.unref(s)("upstreams.form.fields.passive_health_checks.label")),1),e.createElementVNode("p",ya,e.toDisplayString(e.unref(s)("upstreams.form.fields.passive_health_checks.help")),1),e.createVNode(q,{class:"passive-health-switch","data-testid":"passive-health-switch",disabled:a.readonly,"model-value":a.passiveHealthSwitch,onChange:k[1]||(k[1]=c=>l("update:passive-health-switch",c))},null,8,["disabled","model-value"])]),_:1}),e.createVNode(d,{autocomplete:"off","data-testid":"upstreams-form-healthchecks-threshold",label:e.unref(s)("upstreams.form.fields.healthchecks_threshold.label"),max:e.unref(Qt),min:e.unref(Lt),"model-value":a.healthchecksThreshold,readonly:a.readonly,type:"number","onUpdate:modelValue":k[2]||(k[2]=c=>l("update:healthchecks-threshold",c))},null,8,["label","max","min","model-value","readonly"])]),_:1},8,["title"])}}}),[["__scopeId","data-v-bfdc5a59"]]),ba="#d60027",Ca={key:2},_a={class:"fields-group-title"},wa={class:"fields-group-text"},Va={class:"fields-group-title"},Ha={class:"fields-group-text"},xa=X(e.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(a,{emit:B}){const{i18n:{t:s}}=z.useI18n(),{objectsAreEqual:l}=ie(),h=a,k=B,g=e.ref([{label:s("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),q=e.computed(()=>h.type==="https"||h.type==="grpcs"),o=e.computed(()=>h.type==="tcp"),{trackNewItems:d}=re({replaceId:!0}),{trackNewItems:c}=re({replaceId:!0});e.watch(()=>h.type,(H,u)=>{u==="tcp"&&H!==u&&k("update:tcp-failures","5"),(u==="https"||u==="grpcs")&&H!==u&&(k("update:https-sni",""),k("update:verify-ssl",!1)),u!=="tcp"&&H==="tcp"&&(k("update:http-path","/"),k("update:http-statuses",me),k("update:unhealthy-http-statuses",ye))});const C=e.ref([{key:"",values:""}]);e.watch(()=>h.headers,H=>{l(C.value,H)||(C.value=[...H])},{immediate:!0,deep:!0});const p=()=>{k("update:headers",C.value)},t=()=>{C.value.push({key:"",values:""}),p()},E=H=>{H===0&&C.value.length===1?C.value[0]={key:"",values:""}:C.value.splice(H,1),p()};return(H,u)=>{const _=e.resolveComponent("KExternalLink"),A=e.resolveComponent("KSelect"),U=e.resolveComponent("KInput"),j=e.resolveComponent("KCheckbox"),R=e.resolveComponent("KLabel"),y=e.resolveComponent("KButton"),w=e.resolveComponent("KMultiselect"),V=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-active-healthcheck",title:e.unref(s)("upstreams.form.active_health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.active_health_check.help"))+" ",1),e.createVNode(_,{"hide-icon":"",href:e.unref(ue).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>{var x;return[e.createVNode(A,{class:"active-healthcheck-type-select",items:g.value,label:e.unref(s)("upstreams.form.fields.active_healthcheck_type.label"),"model-value":a.type,readonly:a.readonly,width:"100%","onUpdate:modelValue":u[0]||(u[0]=f=>k("update:type",f))},null,8,["items","label","model-value","readonly"]),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U,{key:0,autocomplete:"off","data-testid":"active-healthcheck-http-path",label:e.unref(s)("upstreams.form.fields.http_path.label"),"model-value":a.httpPath,readonly:a.readonly,type:"text","onUpdate:modelValue":u[1]||(u[1]=f=>k("update:http-path",f))},null,8,["label","model-value","readonly"])),e.createVNode(U,{autocomplete:"off","data-testid":"active-healthcheck-timeout",label:e.unref(s)("upstreams.form.fields.timeout.label"),max:e.unref(Jt),min:e.unref(Wt),"model-value":a.timeout,readonly:a.readonly,type:"number","onUpdate:modelValue":u[2]||(u[2]=f=>k("update:timeout",f))},null,8,["label","max","min","model-value","readonly"]),e.createVNode(U,{autocomplete:"off","data-testid":"active-healthcheck-concurrency",label:e.unref(s)("upstreams.form.fields.concurrency.label"),max:e.unref(zt),min:e.unref(Gt),"model-value":a.concurrency,readonly:a.readonly,type:"number","onUpdate:modelValue":u[3]||(u[3]=f=>k("update:concurrency",f))},null,8,["label","max","min","model-value","readonly"]),q.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(U,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-https-sni",label:e.unref(s)("upstreams.form.fields.https_sni.label"),"model-value":a.httpsSni,readonly:a.readonly,type:"text","onUpdate:modelValue":u[4]||(u[4]=f=>k("update:https-sni",f))},null,8,["label","model-value","readonly"]),e.createVNode(j,{"data-testid":"active-healthcheck-verify-ssl",disabled:a.readonly,label:e.unref(s)("upstreams.form.fields.verify_ssl.label"),"model-value":a.verifySsl,"onUpdate:modelValue":u[5]||(u[5]=f=>k("update:verify-ssl",f))},null,8,["disabled","label","model-value"])],64)):e.createCommentVNode("",!0),((x=a.config)==null?void 0:x.app)==="kongManager"?(e.openBlock(),e.createElementBlock("div",Ca,[e.createVNode(R,{info:e.unref(s)("upstreams.form.fields.headers.tooltip_active"),"tooltip-attributes":{maxWidth:"250px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.fields.headers.label")),1)]),_:1},8,["info"]),e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(f,D)=>(e.openBlock(),e.createElementBlock("div",{key:`${f.header}_${D}`,class:e.normalizeClass(["headers-row",{"margin-top-6":D>0}])},[e.createVNode(U,{modelValue:C.value[D].key,"onUpdate:modelValue":M=>C.value[D].key=M,autocomplete:"off","data-testid":`active-healthcheck-headers-header-${D+1}`,readonly:a.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),e.createVNode(U,{modelValue:C.value[D].values,"onUpdate:modelValue":M=>C.value[D].values=M,autocomplete:"off","data-testid":`active-healthcheck-headers-value-${D+1}`,readonly:a.readonly,type:"text",onBlur:p},null,8,["modelValue","onUpdate:modelValue","data-testid","readonly"]),e.createVNode(y,{appearance:"tertiary",class:"btn-remove","data-testid":"btn-remove-header",disabled:C.value.length===1,icon:"",onClick:M=>E(D)},{default:e.withCtx(()=>[e.createVNode(e.unref(oe.TrashIcon),{class:"delete-item",color:C.value.length>1?e.unref(ba):void 0},null,8,["color"])]),_:2},1032,["disabled","onClick"]),C.value&&D===C.value.length-1?(e.openBlock(),e.createBlock(y,{key:0,appearance:"tertiary",class:"btn-add-header","data-testid":"btn-add-header",icon:"",onClick:t},{default:e.withCtx(()=>[e.createVNode(e.unref(oe.AddIcon))]),_:1})):e.createCommentVNode("",!0)],2))),128))])])):e.createCommentVNode("",!0),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("h5",_a,e.toDisplayString(e.unref(s)("upstreams.form.healthy.label")),1),e.createElementVNode("p",wa,e.toDisplayString(e.unref(s)("upstreams.form.healthy.help")),1),e.createVNode(U,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-interval",help:e.unref(s)("upstreams.form.fields.interval.help"),label:e.unref(s)("upstreams.form.fields.interval.label"),max:e.unref(xe),min:e.unref(He),"model-value":a.interval,readonly:a.readonly,type:"number","onUpdate:modelValue":u[6]||(u[6]=f=>k("update:interval",f))},null,8,["help","label","max","min","model-value","readonly"]),e.createVNode(U,{autocomplete:"off","data-testid":"active-healthcheck-successes",label:e.unref(s)("upstreams.form.fields.successes.label"),max:e.unref(ee),min:e.unref(Z),"model-value":a.successes,readonly:a.readonly,type:"number","onUpdate:modelValue":u[7]||(u[7]=f=>k("update:successes",f))},null,8,["label","max","min","model-value","readonly"]),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(w,{key:0,autocomplete:"off",class:"margin-top-6 active-healthcheck-http-statuses","enable-item-creation":"",items:e.unref(ne),label:e.unref(s)("upstreams.form.fields.http_statuses.label"),"model-value":a.httpStatuses,readonly:a.readonly,width:"100%",onItemAdded:u[8]||(u[8]=f=>e.unref(d)(f,!0)),onItemRemoved:u[9]||(u[9]=f=>e.unref(d)(f,!1)),"onUpdate:modelValue":u[10]||(u[10]=f=>k("update:http-statuses",f))},null,8,["items","label","model-value","readonly"]))]),_:1}),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Va,e.toDisplayString(e.unref(s)("upstreams.form.unhealthy.label")),1),e.createElementVNode("p",Ha,e.toDisplayString(e.unref(s)("upstreams.form.unhealthy.help")),1),e.createVNode(U,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-unhealthy-interval",help:e.unref(s)("upstreams.form.fields.interval.help"),label:e.unref(s)("upstreams.form.fields.interval.label"),max:e.unref(xe),min:e.unref(He),"model-value":a.unhealthyInterval,readonly:a.readonly,type:"number","onUpdate:modelValue":u[11]||(u[11]=f=>k("update:unhealthy-interval",f))},null,8,["help","label","max","min","model-value","readonly"]),e.createVNode(U,{autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-tcp-failures",label:e.unref(s)("upstreams.form.fields.tcp_failures.label"),max:e.unref(ee),min:e.unref(Z),"model-value":a.tcpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":u[12]||(u[12]=f=>k("update:tcp-failures",f))},null,8,["label","max","min","model-value","readonly"]),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(U,{key:0,autocomplete:"off",class:"margin-bottom-6","data-testid":"active-healthcheck-http-failures",label:e.unref(s)("upstreams.form.fields.http_failures.label"),max:e.unref(ee),min:e.unref(Z),"model-value":a.httpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":u[13]||(u[13]=f=>k("update:http-failures",f))},null,8,["label","max","min","model-value","readonly"])),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(w,{key:1,autocomplete:"off",class:"margin-bottom-6 active-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:e.unref(ne),label:e.unref(s)("upstreams.form.fields.http_statuses.label"),"model-value":a.unhealthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:u[14]||(u[14]=f=>e.unref(c)(f,!0)),onItemRemoved:u[15]||(u[15]=f=>e.unref(c)(f,!1)),"onUpdate:modelValue":u[16]||(u[16]=f=>k("update:unhealthy-http-statuses",f))},null,8,["items","label","model-value","readonly"])),e.createVNode(U,{autocomplete:"off","data-testid":"active-healthcheck-unhealthy-timeouts",label:e.unref(s)("upstreams.form.fields.timeouts.label"),max:e.unref(Ve),min:e.unref(we),"model-value":a.unhealthyTimeouts,readonly:a.readonly,type:"number","onUpdate:modelValue":u[17]||(u[17]=f=>k("update:unhealthy-timeouts",f))},null,8,["label","max","min","model-value","readonly"])]),_:1})]}),_:1},8,["title"])}}}),[["__scopeId","data-v-efccf560"]]),Na={class:"fields-group-title"},Sa={class:"fields-group-text"},Ta={class:"fields-group-title"},Ua={class:"fields-group-text"},Ia=X(e.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(a,{emit:B}){const{i18n:{t:s}}=z.useI18n(),l=a,h=B,k=e.ref([{label:s("upstreams.form.healthcheck_type_labels.http"),value:"http",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.https"),value:"https",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.tcp"),value:"tcp",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.grsp"),value:"grpc",selected:!1},{label:s("upstreams.form.healthcheck_type_labels.grsps"),value:"grpcs",selected:!1}]),g=e.computed(()=>l.type==="tcp"),{trackNewItems:q}=re({replaceId:!0}),{trackNewItems:o}=re({replaceId:!0});return e.watch(()=>l.type,(d,c)=>{c==="tcp"&&d!==c&&h("update:tcp-failures","5"),c!=="tcp"&&d==="tcp"&&(h("update:http-statuses",ge),h("update:unhealthy-http-statuses",ke))}),(d,c)=>{const C=e.resolveComponent("KExternalLink"),p=e.resolveComponent("KSelect"),t=e.resolveComponent("KInput"),E=e.resolveComponent("KMultiselect"),H=e.resolveComponent("KCard");return e.openBlock(),e.createBlock(e.unref(m.EntityFormSection),{class:"kong-ui-entities-upstreams-passive-healthcheck",title:e.unref(s)("upstreams.form.passive_health_check.title")},{description:e.withCtx(()=>[e.createElementVNode("p",null,[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.passive_health_check.help"))+" ",1),e.createVNode(C,{"hide-icon":"",href:e.unref(ue).upstreamObject},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("upstreams.form.buttons.view_documentation")),1)]),_:1},8,["href"])])]),default:e.withCtx(()=>[e.createVNode(p,{class:"passive-healthcheck-type-select",items:k.value,label:e.unref(s)("upstreams.form.fields.passive_health_check_type.label"),"model-value":a.type,readonly:a.readonly,width:"100%","onUpdate:modelValue":c[0]||(c[0]=u=>h("update:type",u))},null,8,["items","label","model-value","readonly"]),e.createVNode(H,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Na,e.toDisplayString(e.unref(s)("upstreams.form.passive_healthy.label")),1),e.createElementVNode("p",Sa,e.toDisplayString(e.unref(s)("upstreams.form.passive_healthy.help")),1),e.createVNode(t,{autocomplete:"off","data-testid":"passive-healthcheck-successes",label:e.unref(s)("upstreams.form.fields.successes.label"),max:e.unref(ee),min:e.unref(Z),"model-value":a.successes,readonly:a.readonly,type:"number","onUpdate:modelValue":c[1]||(c[1]=u=>h("update:successes",u))},null,8,["label","max","min","model-value","readonly"]),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:0,class:"margin-top-6 passive-healthcheck-http-statuses","enable-item-creation":"",items:e.unref(ne),label:e.unref(s)("upstreams.form.fields.http_statuses.label"),"model-value":a.httpStatuses,readonly:a.readonly,width:"100%",onItemAdded:c[2]||(c[2]=u=>e.unref(q)(u,!0)),onItemRemoved:c[3]||(c[3]=u=>e.unref(q)(u,!1)),"onUpdate:modelValue":c[4]||(c[4]=u=>h("update:http-statuses",u))},null,8,["items","label","model-value","readonly"]))]),_:1}),e.createVNode(H,null,{default:e.withCtx(()=>[e.createElementVNode("h5",Ta,e.toDisplayString(e.unref(s)("upstreams.form.passive_unhealthy.label")),1),e.createElementVNode("p",Ua,e.toDisplayString(e.unref(s)("upstreams.form.passive_unhealthy.help")),1),e.createVNode(t,{autocomplete:"off","data-testid":"passive-healthcheck-timeouts",label:e.unref(s)("upstreams.form.fields.timeouts.label"),max:e.unref(Ve),min:e.unref(we),"model-value":a.timeouts,readonly:a.readonly,type:"number","onUpdate:modelValue":c[5]||(c[5]=u=>h("update:timeouts",u))},null,8,["label","max","min","model-value","readonly"]),e.createVNode(t,{autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-tcp-failures",label:e.unref(s)("upstreams.form.fields.tcp_failures.label"),max:e.unref(ee),min:e.unref(Z),"model-value":a.tcpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":c[6]||(c[6]=u=>h("update:tcp-failures",u))},null,8,["label","max","min","model-value","readonly"]),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(t,{key:0,autocomplete:"off",class:"margin-top-6","data-testid":"passive-healthcheck-http-failures",label:e.unref(s)("upstreams.form.fields.http_failures.label"),max:e.unref(ee),min:e.unref(Z),"model-value":a.httpFailures,readonly:a.readonly,type:"number","onUpdate:modelValue":c[7]||(c[7]=u=>h("update:http-failures",u))},null,8,["label","max","min","model-value","readonly"])),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:1,autocomplete:"off",class:"margin-top-6 passive-healthcheck-unhealthy-http-statuses","enable-item-creation":"",items:e.unref(ne),label:e.unref(s)("upstreams.form.fields.http_statuses.label"),"model-value":a.unhealthyHttpStatuses,readonly:a.readonly,width:"100%",onItemAdded:c[8]||(c[8]=u=>e.unref(o)(u,!0)),onItemRemoved:c[9]||(c[9]=u=>e.unref(o)(u,!1)),"onUpdate:modelValue":c[10]||(c[10]=u=>h("update:unhealthy-http-statuses",u))},null,8,["items","label","model-value","readonly"]))]),_:1})]),_:1},8,["title"])}}}),[["__scopeId","data-v-5bd9952e"]]),Fa={class:"kong-ui-entities-upstreams-form"},qa=X(e.defineComponent({__name:"UpstreamsForm",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||(a==null?void 0:a.app)==="konnect"&&!(a!=null&&a.controlPlaneId)||(a==null?void 0:a.app)==="kongManager"&&typeof(a==null?void 0:a.workspace)!="string"||!(a!=null&&a.cancelRoute))},upstreamId:{type:String,required:!1,default:""},enableTerraform:{type:Boolean,default:!1}},emits:["update","error","loading"],setup(a,{emit:B}){var F;const s=a,l=B,{inRange:h,stringToNumberArray:k,upstreamsResponseToFields:g,getDefaultUpstreamFields:q,objectsAreEqual:o,cloneDeep:d}=ie(),{axiosInstance:c}=m.useAxios((F=s.config)==null?void 0:F.axiosRequestConfig),{getMessageFromError:C}=m.useErrors(),p=Ce.useRouter(),t=e.reactive({fields:q(),readonly:!1,errorMessage:""}),E=e.reactive(q()),H=e.computed(()=>!o(t.fields,E)),u=n=>{t.fields.activeHealthCheck.interval=n?"5":"0",t.fields.activeHealthCheck.successes=n?"5":"0",t.fields.activeHealthCheck.httpFailures=n?"5":"0",t.fields.activeHealthCheck.unhealthyInterval=n?"5":"0",t.fields.activeHealthCheck.tcpFailures=n?"5":"0"},_=n=>{t.fields.passiveHealthCheck.timeouts=n?"5":"0",t.fields.passiveHealthCheck.successes=n?"80":"0",t.fields.passiveHealthCheck.tcpFailures=n?"5":"0",t.fields.passiveHealthCheck.httpFailures=n?"5":"0"},A=e.computed(()=>t.fields.slots?h(t.fields.slots,pe,fe):!0),U=e.computed(()=>t.fields.hashOn==="header"?!!t.fields.hashOnHeader:!0),j=e.computed(()=>t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie"?!!t.fields.hashOnCookie:!0),R=e.computed(()=>t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie"?!!t.fields.hashOnCookiePath:!0),y=e.computed(()=>t.fields.hashOn==="query_arg"?!!t.fields.hashOnQueryArgument:!0),w=e.computed(()=>t.fields.hashOn==="uri_capture"?!!t.fields.hashOnUriCapture:!0),V=e.computed(()=>t.fields.hashFallback==="header"?!!t.fields.hashFallbackHeader:!0),x=e.computed(()=>t.fields.hashFallback==="query_arg"?!!t.fields.hashFallbackQueryArgument:!0),f=e.computed(()=>t.fields.hashFallback==="uri_capture"?!!t.fields.hashFallbackUriCapture:!0),D=e.computed(()=>!!t.fields.name&&A.value&&U.value&&j.value&&R.value&&y.value&&w.value&&V.value&&x.value&&f.value),M=e.computed(()=>s.upstreamId?m.EntityBaseFormType.Edit:m.EntityBaseFormType.Create),G=e.computed(()=>{var n,r;return(r=le.form[(n=s.config)==null?void 0:n.app])==null?void 0:r.edit}),J=n=>{Object.assign(t.fields,g(n)),Object.assign(E,d(t.fields))},I=()=>{var n;p.push(((n=s.config)==null?void 0:n.cancelRoute)||{name:"upstreams-list"})},S=n=>{l("loading",n)},P=n=>{l("error",n)},K=e.computed(()=>{var r,i,$,T,v;const n={name:t.fields.name,slots:Number(t.fields.slots),algorithm:t.fields.algorithm,hash_on:t.fields.hashOn,hash_fallback:t.fields.hashFallback,healthchecks:{}};return t.fields.hostHeader&&(n.host_header=t.fields.hostHeader),t.fields.clientCertificate&&(n.client_certificate={id:t.fields.clientCertificate}),t.fields.healthchecksThreshold&&(n.healthchecks.threshold=Number(t.fields.healthchecksThreshold)),t.fields.tags&&(n.tags=(i=(r=t.fields.tags.split(","))==null?void 0:r.map(L=>String(L||"").trim()))==null?void 0:i.filter(L=>L!=="")),t.fields.hashOn==="header"&&(n.hash_on_header=t.fields.hashOnHeader),(t.fields.hashOn==="cookie"||t.fields.hashFallback==="cookie")&&(n.hash_on_cookie=t.fields.hashOnCookie,n.hash_on_cookie_path=t.fields.hashOnCookiePath),t.fields.hashOn==="query_arg"&&(n.hash_on_query_arg=t.fields.hashOnQueryArgument),t.fields.hashOn==="uri_capture"&&(n.hash_on_uri_capture=t.fields.hashOnUriCapture),t.fields.hashFallback==="header"&&(n.hash_fallback_header=t.fields.hashFallbackHeader),t.fields.hashFallback==="query_arg"&&(n.hash_fallback_query_arg=t.fields.hashFallbackQueryArgument),t.fields.hashFallback==="uri_capture"&&(n.hash_fallback_uri_capture=t.fields.hashFallbackUriCapture),t.fields.activeHealthSwitch?(n.healthchecks.active={type:t.fields.activeHealthCheck.type,healthy:{},unhealthy:{}},t.fields.activeHealthCheck.timeout&&(n.healthchecks.active.timeout=Number(t.fields.activeHealthCheck.timeout)),t.fields.activeHealthCheck.concurrency&&(n.healthchecks.active.concurrency=Number(t.fields.activeHealthCheck.concurrency)),t.fields.activeHealthCheck.type!=="tcp"&&t.fields.activeHealthCheck.httpPath&&(n.healthchecks.active.http_path=t.fields.activeHealthCheck.httpPath),(($=s.config)==null?void 0:$.app)==="kongManager"&&(t.fields.activeHealthCheck.headers.length===0?n.healthchecks.active.headers=[]:n.healthchecks.active.headers=t.fields.activeHealthCheck.headers.reduce((L,O)=>{var Q,Y;return O.key?{...L,[O.key]:(Y=(Q=O.values.split(","))==null?void 0:Q.map(se=>String(se||"").trim()))==null?void 0:Y.filter(se=>se!=="")}:{...L}},{})),(t.fields.activeHealthCheck.type==="https"||t.fields.activeHealthCheck.type==="grpcs")&&t.fields.activeHealthCheck.httpsSni&&(n.healthchecks.active.https_sni=t.fields.activeHealthCheck.httpsSni),(t.fields.activeHealthCheck.type==="https"||t.fields.activeHealthCheck.type==="grpcs")&&(n.healthchecks.active.https_verify_certificate=t.fields.activeHealthCheck.verifySsl),t.fields.activeHealthCheck.interval&&(n.healthchecks.active.healthy.interval=Number(t.fields.activeHealthCheck.interval)),t.fields.activeHealthCheck.successes&&(n.healthchecks.active.healthy.successes=Number(t.fields.activeHealthCheck.successes)),t.fields.activeHealthCheck.type!=="tcp"&&t.fields.activeHealthCheck.httpStatuses&&(n.healthchecks.active.healthy.http_statuses=k(t.fields.activeHealthCheck.httpStatuses)),t.fields.activeHealthCheck.unhealthyInterval&&(n.healthchecks.active.unhealthy.interval=Number(t.fields.activeHealthCheck.unhealthyInterval)),t.fields.activeHealthCheck.unhealthyTimeouts&&(n.healthchecks.active.unhealthy.timeouts=Number(t.fields.activeHealthCheck.unhealthyTimeouts)),t.fields.activeHealthCheck.type!=="tcp"&&t.fields.activeHealthCheck.unhealthyHttpStatuses&&(n.healthchecks.active.unhealthy.http_statuses=k(t.fields.activeHealthCheck.unhealthyHttpStatuses)),t.fields.activeHealthCheck.type!=="tcp"&&t.fields.activeHealthCheck.httpFailures&&(n.healthchecks.active.unhealthy.http_failures=Number(t.fields.activeHealthCheck.httpFailures)),t.fields.activeHealthCheck.tcpFailures&&(n.healthchecks.active.unhealthy.tcp_failures=Number(t.fields.activeHealthCheck.tcpFailures))):((T=s.config)==null?void 0:T.app)==="kongManager"&&M.value===m.EntityBaseFormType.Edit&&(n.healthchecks.active={type:t.fields.activeHealthCheck.type,headers:{},healthy:{interval:0,successes:0},unhealthy:{interval:0,http_failures:0,tcp_failures:0}}),t.fields.passiveHealthSwitch?(n.healthchecks.passive={type:t.fields.passiveHealthCheck.type,healthy:{},unhealthy:{}},t.fields.passiveHealthCheck.successes&&(n.healthchecks.passive.healthy.successes=Number(t.fields.passiveHealthCheck.successes)),t.fields.passiveHealthCheck.type!=="tcp"&&t.fields.passiveHealthCheck.httpStatuses&&(n.healthchecks.passive.healthy.http_statuses=k(t.fields.passiveHealthCheck.httpStatuses)),t.fields.passiveHealthCheck.timeouts&&(n.healthchecks.passive.unhealthy.timeouts=Number(t.fields.passiveHealthCheck.timeouts)),t.fields.passiveHealthCheck.type!=="tcp"&&t.fields.passiveHealthCheck.unhealthyHttpStatuses&&(n.healthchecks.passive.unhealthy.http_statuses=k(t.fields.passiveHealthCheck.unhealthyHttpStatuses)),t.fields.passiveHealthCheck.type!=="tcp"&&t.fields.passiveHealthCheck.httpFailures&&(n.healthchecks.passive.unhealthy.http_failures=Number(t.fields.passiveHealthCheck.httpFailures)),t.fields.passiveHealthCheck.tcpFailures&&(n.healthchecks.passive.unhealthy.tcp_failures=Number(t.fields.passiveHealthCheck.tcpFailures))):((v=s.config)==null?void 0:v.app)==="kongManager"&&M.value===m.EntityBaseFormType.Edit&&(n.healthchecks.passive={type:t.fields.passiveHealthCheck.type,healthy:{successes:0},unhealthy:{timeouts:0,tcp_failures:0,http_failures:0}}),n}),b=n=>{var i,$,T,v,L,O;let r=`${(i=s.config)==null?void 0:i.apiBaseUrl}${le.form[($=s.config)==null?void 0:$.app][n]}`;return((T=s.config)==null?void 0:T.app)==="konnect"?r=r.replace(/{controlPlaneId}/gi,((v=s.config)==null?void 0:v.controlPlaneId)||""):((L=s.config)==null?void 0:L.app)==="kongManager"&&(r=r.replace(/\/{workspace}/gi,(O=s.config)!=null&&O.workspace?`/${s.config.workspace}`:"")),r=r.replace(/{id}/gi,s.upstreamId),r},N=async()=>{var n;try{t.readonly=!0,await c.post(b("validate"),K.value);let r;M.value===m.EntityBaseFormType.Create?r=await c.post(b("create"),K.value):M.value===m.EntityBaseFormType.Edit&&(r=((n=s.config)==null?void 0:n.app)==="konnect"?await c.put(b("edit"),K.value):await c.patch(b("edit"),K.value)),l("update",r==null?void 0:r.data)}catch(r){t.errorMessage=C(r),l("error",r)}finally{t.readonly=!1}};return(n,r)=>(e.openBlock(),e.createElementBlock("div",Fa,[e.createVNode(e.unref(m.EntityBaseForm),{"can-submit":D.value&&H.value,config:a.config,"edit-id":a.upstreamId,"enable-terraform":a.enableTerraform,"entity-type":e.unref(m.SupportedEntityType).Upstream,"error-message":t.errorMessage,"fetch-url":G.value,"form-fields":K.value,"is-readonly":t.readonly,onCancel:I,"onFetch:error":P,"onFetch:success":J,onLoading:S,onSubmit:N},{default:e.withCtx(()=>[e.createVNode(ia,{"client-certificate":t.fields.clientCertificate,"onUpdate:clientCertificate":r[0]||(r[0]=i=>t.fields.clientCertificate=i),"host-header":t.fields.hostHeader,"onUpdate:hostHeader":r[1]||(r[1]=i=>t.fields.hostHeader=i),name:t.fields.name,"onUpdate:name":r[2]||(r[2]=i=>t.fields.name=i),tags:t.fields.tags,"onUpdate:tags":r[3]||(r[3]=i=>t.fields.tags=i),config:a.config,readonly:t.readonly},null,8,["client-certificate","host-header","name","tags","config","readonly"]),e.createVNode(pa,{algorithm:t.fields.algorithm,"onUpdate:algorithm":r[4]||(r[4]=i=>t.fields.algorithm=i),"hash-fallback":t.fields.hashFallback,"onUpdate:hashFallback":r[5]||(r[5]=i=>t.fields.hashFallback=i),"hash-fallback-header":t.fields.hashFallbackHeader,"onUpdate:hashFallbackHeader":r[6]||(r[6]=i=>t.fields.hashFallbackHeader=i),"hash-fallback-query-argument":t.fields.hashFallbackQueryArgument,"onUpdate:hashFallbackQueryArgument":r[7]||(r[7]=i=>t.fields.hashFallbackQueryArgument=i),"hash-fallback-uri-capture":t.fields.hashFallbackUriCapture,"onUpdate:hashFallbackUriCapture":r[8]||(r[8]=i=>t.fields.hashFallbackUriCapture=i),"hash-on":t.fields.hashOn,"onUpdate:hashOn":r[9]||(r[9]=i=>t.fields.hashOn=i),"hash-on-cookie":t.fields.hashOnCookie,"onUpdate:hashOnCookie":r[10]||(r[10]=i=>t.fields.hashOnCookie=i),"hash-on-cookie-path":t.fields.hashOnCookiePath,"onUpdate:hashOnCookiePath":r[11]||(r[11]=i=>t.fields.hashOnCookiePath=i),"hash-on-header":t.fields.hashOnHeader,"onUpdate:hashOnHeader":r[12]||(r[12]=i=>t.fields.hashOnHeader=i),"hash-on-query-argument":t.fields.hashOnQueryArgument,"onUpdate:hashOnQueryArgument":r[13]||(r[13]=i=>t.fields.hashOnQueryArgument=i),"hash-on-uri-capture":t.fields.hashOnUriCapture,"onUpdate:hashOnUriCapture":r[14]||(r[14]=i=>t.fields.hashOnUriCapture=i),slots:t.fields.slots,"onUpdate:slots":r[15]||(r[15]=i=>t.fields.slots=i),readonly:t.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"]),e.createVNode(ka,{"active-health-switch":t.fields.activeHealthSwitch,"onUpdate:activeHealthSwitch":[r[16]||(r[16]=i=>t.fields.activeHealthSwitch=i),u],"healthchecks-threshold":t.fields.healthchecksThreshold,"onUpdate:healthchecksThreshold":r[17]||(r[17]=i=>t.fields.healthchecksThreshold=i),"passive-health-switch":t.fields.passiveHealthSwitch,"onUpdate:passiveHealthSwitch":[r[18]||(r[18]=i=>t.fields.passiveHealthSwitch=i),_],readonly:t.readonly},null,8,["active-health-switch","healthchecks-threshold","passive-health-switch","readonly"]),t.fields.activeHealthSwitch?(e.openBlock(),e.createBlock(xa,{key:0,concurrency:t.fields.activeHealthCheck.concurrency,"onUpdate:concurrency":r[19]||(r[19]=i=>t.fields.activeHealthCheck.concurrency=i),headers:t.fields.activeHealthCheck.headers,"onUpdate:headers":r[20]||(r[20]=i=>t.fields.activeHealthCheck.headers=i),"http-failures":t.fields.activeHealthCheck.httpFailures,"onUpdate:httpFailures":r[21]||(r[21]=i=>t.fields.activeHealthCheck.httpFailures=i),"http-path":t.fields.activeHealthCheck.httpPath,"onUpdate:httpPath":r[22]||(r[22]=i=>t.fields.activeHealthCheck.httpPath=i),"http-statuses":t.fields.activeHealthCheck.httpStatuses,"onUpdate:httpStatuses":r[23]||(r[23]=i=>t.fields.activeHealthCheck.httpStatuses=i),"https-sni":t.fields.activeHealthCheck.httpsSni,"onUpdate:httpsSni":r[24]||(r[24]=i=>t.fields.activeHealthCheck.httpsSni=i),interval:t.fields.activeHealthCheck.interval,"onUpdate:interval":r[25]||(r[25]=i=>t.fields.activeHealthCheck.interval=i),successes:t.fields.activeHealthCheck.successes,"onUpdate:successes":r[26]||(r[26]=i=>t.fields.activeHealthCheck.successes=i),"tcp-failures":t.fields.activeHealthCheck.tcpFailures,"onUpdate:tcpFailures":r[27]||(r[27]=i=>t.fields.activeHealthCheck.tcpFailures=i),timeout:t.fields.activeHealthCheck.timeout,"onUpdate:timeout":r[28]||(r[28]=i=>t.fields.activeHealthCheck.timeout=i),type:t.fields.activeHealthCheck.type,"onUpdate:type":r[29]||(r[29]=i=>t.fields.activeHealthCheck.type=i),"unhealthy-http-statuses":t.fields.activeHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":r[30]||(r[30]=i=>t.fields.activeHealthCheck.unhealthyHttpStatuses=i),"unhealthy-interval":t.fields.activeHealthCheck.unhealthyInterval,"onUpdate:unhealthyInterval":r[31]||(r[31]=i=>t.fields.activeHealthCheck.unhealthyInterval=i),"unhealthy-timeouts":t.fields.activeHealthCheck.unhealthyTimeouts,"onUpdate:unhealthyTimeouts":r[32]||(r[32]=i=>t.fields.activeHealthCheck.unhealthyTimeouts=i),"verify-ssl":t.fields.activeHealthCheck.verifySsl,"onUpdate:verifySsl":r[33]||(r[33]=i=>t.fields.activeHealthCheck.verifySsl=i),config:a.config,readonly:t.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"])):e.createCommentVNode("",!0),t.fields.passiveHealthSwitch?(e.openBlock(),e.createBlock(Ia,{key:1,"http-failures":t.fields.passiveHealthCheck.httpFailures,"onUpdate:httpFailures":r[34]||(r[34]=i=>t.fields.passiveHealthCheck.httpFailures=i),"http-statuses":t.fields.passiveHealthCheck.httpStatuses,"onUpdate:httpStatuses":r[35]||(r[35]=i=>t.fields.passiveHealthCheck.httpStatuses=i),successes:t.fields.passiveHealthCheck.successes,"onUpdate:successes":r[36]||(r[36]=i=>t.fields.passiveHealthCheck.successes=i),"tcp-failures":t.fields.passiveHealthCheck.tcpFailures,"onUpdate:tcpFailures":r[37]||(r[37]=i=>t.fields.passiveHealthCheck.tcpFailures=i),timeouts:t.fields.passiveHealthCheck.timeouts,"onUpdate:timeouts":r[38]||(r[38]=i=>t.fields.passiveHealthCheck.timeouts=i),type:t.fields.passiveHealthCheck.type,"onUpdate:type":r[39]||(r[39]=i=>t.fields.passiveHealthCheck.type=i),"unhealthy-http-statuses":t.fields.passiveHealthCheck.unhealthyHttpStatuses,"onUpdate:unhealthyHttpStatuses":r[40]||(r[40]=i=>t.fields.passiveHealthCheck.unhealthyHttpStatuses=i),readonly:t.readonly},null,8,["http-failures","http-statuses","successes","tcp-failures","timeouts","type","unhealthy-http-statuses","readonly"])):e.createCommentVNode("",!0)]),_:1},8,["can-submit","config","edit-id","enable-terraform","entity-type","error-message","fetch-url","form-fields","is-readonly"])]))}}),[["__scopeId","data-v-ebffe769"]]),Ba=e.createElementVNode("code",null,"10",-1),Ea=e.createElementVNode("code",null,"65536",-1),Oa={"data-testid":"client_certificate-plain-text"},Da=e.defineComponent({__name:"UpstreamsConfigCard",props:{config:{type:Object,required:!0,validator:a=>!(!a||!["konnect","kongManager"].includes(a==null?void 0:a.app)||a.app==="konnect"&&!a.controlPlaneId||a.app==="kongManager"&&typeof a.workspace!="string"||!a.entityId)},configCardDoc:{type:String,default:"",required:!1},hideTitle:{type:Boolean,default:!1},enableTerraform:{type:Boolean,default:!1}},emits:["loading","fetch:error","fetch:success"],setup(a){const B=a,{i18n:{t:s},i18nT:l}=z.useI18n(),{getPropValue:h}=m.useHelpers(),k=e.computed(()=>le.form[B.config.app].edit),g=e.ref({id:{},name:{},created_at:{},updated_at:{},algorithm:{order:5,section:m.ConfigurationSchemaSection.Basic,tooltip:s("upstreams.form.fields.algorithm.tooltip")},slots:{order:6,section:m.ConfigurationSchemaSection.Basic},hash_on:{order:7,section:m.ConfigurationSchemaSection.Basic},hash_on_header:{order:8,section:m.ConfigurationSchemaSection.Basic},hash_on_uri_capture:{order:9,section:m.ConfigurationSchemaSection.Basic},hash_on_query_arg:{order:10,section:m.ConfigurationSchemaSection.Basic,label:`${s("upstreams.form.fields.hash_on.label")} ${s("upstreams.form.hash_labels.query_argument")}`},hash_on_cookie:{order:11,section:m.ConfigurationSchemaSection.Basic},hash_on_cookie_path:{order:12,section:m.ConfigurationSchemaSection.Basic},healthchecks:{order:13,section:m.ConfigurationSchemaSection.Basic,type:m.ConfigurationSchemaType.Json},tags:{order:14,tooltip:s("upstreams.form.hash_tooltips.tags")},hash_fallback:{order:1},hash_fallback_header:{order:2},hash_fallback_query_arg:{order:3,label:`${s("upstreams.form.fields.hash_fallback.label")} ${s("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:s("upstreams.form.hash_tooltips.client_certificate")}});return(q,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(m.EntityBaseConfigCard),{config:a.config,"config-card-doc":a.configCardDoc,"config-schema":g.value,"enable-terraform":a.enableTerraform,"entity-type":e.unref(m.SupportedEntityType).Upstream,"fetch-url":k.value,"hide-title":a.hideTitle,"onFetch:error":o[0]||(o[0]=d=>q.$emit("fetch:error",d)),"onFetch:success":o[1]||(o[1]=d=>q.$emit("fetch:success",d)),onLoading:o[2]||(o[2]=d=>q.$emit("loading",d))},{"name-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.fields.name.tooltip",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.fields.name.host")),1)]),_:1})]),"hash_on-label-tooltip":e.withCtx(({row:d})=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.fields.hash_on.tooltip",scope:"global"},{result:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(d.value),1)]),_:2},1024)]),"hash_on_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_header.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_header.hash_on")),1)]),header:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_header.header")),1)]),_:1})]),"hash_on_uri_capture-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_uri_capture.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_uri_capture.hash_on")),1)]),uri_capture:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_uri_capture.uri_capture")),1)]),_:1})]),"hash_on_query_arg-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_query_arg.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_query_arg.hash_on")),1)]),query_arg:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_query_arg.query_arg")),1)]),_:1})]),"hash_on_cookie-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_cookie.hash_on")),1)]),hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_cookie.hash_fallback")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_cookie.cookie")),1)]),_:1})]),"hash_on_cookie_path-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_on_cookie_path.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_on")),1)]),hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_cookie_path.hash_fallback")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_on_cookie_path.cookie")),1)]),_:1})]),"slots-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.slots.text",scope:"global"},{algorithm:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.slots.algorithm")),1)]),round_robin:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.slots.round_robin")),1)]),consistent_hashing:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.slots.consistent_hashing")),1)]),min:e.withCtx(()=>[Ba]),max:e.withCtx(()=>[Ea]),_:1})]),"hash_fallback-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback.text",scope:"global"},{hash_on:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback.hash_on")),1)]),cookie:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback.cookie")),1)]),_:1})]),"hash_fallback_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_header.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback_header.hash_fallback")),1)]),header:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback_header.header")),1)]),_:1})]),"hash_fallback_query_arg-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_query_arg.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback_query_arg.hash_fallback")),1)]),query_arg:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback_query_arg.query_arg")),1)]),_:1})]),"hash_fallback_uri_capture-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.hash_fallback_uri_capture.text",scope:"global"},{hash_fallback:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.hash_fallback")),1)]),uri_capture:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.hash_fallback_uri_capture.uri_capture")),1)]),_:1})]),"host_header-label-tooltip":e.withCtx(()=>[e.createVNode(e.unref(l),{keypath:"upstreams.form.hash_tooltips.host_header.text",scope:"global"},{host:e.withCtx(()=>[e.createElementVNode("code",null,e.toDisplayString(e.unref(s)("upstreams.form.hash_tooltips.host_header.host")),1)]),_:1})]),client_certificate:e.withCtx(d=>{var c;return[e.createElementVNode("div",null,[e.createElementVNode("div",Oa,[e.createElementVNode("span",null,e.toDisplayString((c=e.unref(h)("rowValue",d))==null?void 0:c.id),1)])])]}),_:1},8,["config","config-card-doc","config-schema","enable-terraform","entity-type","fetch-url","hide-title"])]))}});W.TargetForm=Ne,W.TargetsList=oa,W.UpstreamsConfigCard=Da,W.UpstreamsForm=qa,W.UpstreamsList=ea,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|