@kong-ui-public/entities-upstreams-targets 3.5.0 → 3.5.1
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 +1 @@
|
|
|
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"})});
|
|
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,Ne=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,N,f,D,M,G,J,I,S,P,K,b,x,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,Nt,xt,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?(N=(V=o.healthchecks.active)==null?void 0:V.concurrency)==null?void 0:N.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=(x=(b=o.healthchecks.active)==null?void 0:b.healthy)==null?void 0:x.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=((xt=(Nt=o.healthchecks.passive)==null?void 0:Nt.unhealthy)==null?void 0:xt.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 x,F;let b=`${l.config.apiBaseUrl}${le.list[l.config.app]}`;return l.config.app==="konnect"?b=b.replace(/{controlPlaneId}/gi,((x=l.config)==null?void 0:x.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:x,slots:F}=d;return{isExactMatch:b,fields:{name:x,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,x)=>{const F=b.id;if(!x(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,x)=>{const F=JSON.stringify(b);if(!x(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),N=e.ref(!1),f=e.ref(!1),D=e.ref(""),M=m.useDeleteUrlBuilder(l.config,C.value),G=b=>{V.value=b,N.value=!0},J=()=>{N.value=!1},I=async()=>{var b,x,F;if((b=V.value)!=null&&b.id){f.value=!0;try{await g.delete(M(V.value.id)),f.value=!1,N.value=!1,q.value++,s("delete:success",V.value)}catch(n){D.value=((F=(x=n.response)==null?void 0:x.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 x,F,n,r;if(Array.isArray((x=b==null?void 0:b.response)==null?void 0:x.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,x)=>{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":x[1]||(x[1]=T=>R(T)),onSort:_},{"toolbar-filter":e.withCtx(()=>[e.createVNode(e.unref(m.EntityFilter),{modelValue:p.value,"onUpdate:modelValue":x[0]||(x[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:N.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"},xe=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,N,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,(N=l.config)!=null&&N.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(N=>String(N||"").trim()))==null?void 0:V.filter(N=>N!==""),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:N}=V;c.fields.target=(N==null?void 0:N.name)||"",c.fields.weight=(N==null?void 0:N.weight)??100,c.fields.tags=((w=N==null?void 0:N.tags)==null?void 0:w.join(", "))||"",s("update",N),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"),N=e.resolveComponent("KPrompt");return e.openBlock(),e.createBlock(N,{"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"),tooltipAttributes:{maxWidth:"400"}},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"),tooltipAttributes:{maxWidth:"400"}},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-6a64b86e"]]),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(""),N=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(N(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=()=>{x(),g.value++},x=()=>{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(xe,{config:I.value,"is-visible":P.value,"target-id":S.value,onCancel:x,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:""}},N=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":"400"}},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":N},{"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]=x=>k("update:host-header",x))},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:"400"}},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]=x=>k("update:client-certificate",x))},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:"400"}},"model-value":a.tags,placeholder:e.unref(l)("upstreams.form.fields.tags.placeholder"),readonly:a.readonly,type:"text","onUpdate:modelValue":S[2]||(S[2]=x=>k("update:tags",x))},null,8,["help","label","label-attributes","model-value","placeholder","readonly"])]))]),_:1},8,["description","title"])}}}),[["__scopeId","data-v-626ed41f"]]),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":"400"}},"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-d662db8e"]]),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"},Na=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 N;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),((N=a.config)==null?void 0:N.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(Ne),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(Ne),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"]]),xa={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",xa,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),N=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&&N.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},x=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:x},{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(Na,{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=xe,W.TargetsList=oa,W.UpstreamsConfigCard=Da,W.UpstreamsForm=qa,W.UpstreamsList=ea,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|