@kong-ui-public/forms 4.20.14 → 4.20.15
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.
- package/dist/forms.es.js +352 -352
- package/dist/forms.umd.js +3 -3
- package/package.json +7 -7
package/dist/forms.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(D,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("axios"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","axios","@kong-ui-public/entities-shared"],t):(D=typeof globalThis<"u"?globalThis:D||self,t(D["kong-ui-public-forms"]={},D.Vue,D["kong-ui-public-i18n"],D.KongIcons,D.axios,D["kong-ui-public-entities-shared"]))})(this,function(D,t,ue,Se,ei,kt){"use strict";function Dn(e,n){for(var o=-1,a=e==null?0:e.length;++o<a&&n(e[o],o,e)!==!1;);return e}function ti(e){return function(n,o,a){for(var i=-1,r=Object(n),s=a(n),l=s.length;l--;){var c=s[++i];if(o(r[c],c,r)===!1)break}return n}}var ni=ti();function oi(e,n){for(var o=-1,a=Array(e);++o<e;)a[o]=n(o);return a}var Ln=typeof global=="object"&&global&&global.Object===Object&&global,ai=typeof self=="object"&&self&&self.Object===Object&&self,ge=Ln||ai||Function("return this")(),De=ge.Symbol,Un=Object.prototype,ii=Un.hasOwnProperty,ri=Un.toString,dt=De?De.toStringTag:void 0;function li(e){var n=ii.call(e,dt),o=e[dt];try{e[dt]=void 0;var a=!0}catch{}var i=ri.call(e);return a&&(n?e[dt]=o:delete e[dt]),i}var si=Object.prototype,di=si.toString;function ci(e){return di.call(e)}var mi="[object Null]",ui="[object Undefined]",Pn=De?De.toStringTag:void 0;function Le(e){return e==null?e===void 0?ui:mi:Pn&&Pn in Object(e)?li(e):ci(e)}function Ue(e){return e!=null&&typeof e=="object"}var fi="[object Arguments]";function $n(e){return Ue(e)&&Le(e)==fi}var xn=Object.prototype,hi=xn.hasOwnProperty,pi=xn.propertyIsEnumerable,gi=$n(function(){return arguments}())?$n:function(e){return Ue(e)&&hi.call(e,"callee")&&!pi.call(e,"callee")},Pe=Array.isArray;function yi(){return!1}var vn=typeof D=="object"&&D&&!D.nodeType&&D,jn=vn&&typeof module=="object"&&module&&!module.nodeType&&module,bi=jn&&jn.exports===vn,qn=bi?ge.Buffer:void 0,_i=qn?qn.isBuffer:void 0,zn=_i||yi,Ei=9007199254740991,Ti=/^(?:0|[1-9]\d*)$/;function Kn(e,n){var o=typeof e;return n=n??Ei,!!n&&(o=="number"||o!="symbol"&&Ti.test(e))&&e>-1&&e%1==0&&e<n}var Ci=9007199254740991;function Hn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ci}var Si="[object Arguments]",wi="[object Array]",ki="[object Boolean]",Ai="[object Date]",Mi="[object Error]",Ni="[object Function]",Ii="[object Map]",Oi="[object Number]",Vi="[object Object]",Bi="[object RegExp]",Fi="[object Set]",Ri="[object String]",Di="[object WeakMap]",Li="[object ArrayBuffer]",Ui="[object DataView]",Pi="[object Float32Array]",$i="[object Float64Array]",xi="[object Int8Array]",vi="[object Int16Array]",ji="[object Int32Array]",qi="[object Uint8Array]",zi="[object Uint8ClampedArray]",Ki="[object Uint16Array]",Hi="[object Uint32Array]",q={};q[Pi]=q[$i]=q[xi]=q[vi]=q[ji]=q[qi]=q[zi]=q[Ki]=q[Hi]=!0,q[Si]=q[wi]=q[Li]=q[ki]=q[Ui]=q[Ai]=q[Mi]=q[Ni]=q[Ii]=q[Oi]=q[Vi]=q[Bi]=q[Fi]=q[Ri]=q[Di]=!1;function Yi(e){return Ue(e)&&Hn(e.length)&&!!q[Le(e)]}function Wt(e){return function(n){return e(n)}}var Yn=typeof D=="object"&&D&&!D.nodeType&&D,ct=Yn&&typeof module=="object"&&module&&!module.nodeType&&module,Gi=ct&&ct.exports===Yn,Zt=Gi&&Ln.process,Ze=function(){try{var e=ct&&ct.require&&ct.require("util").types;return e||Zt&&Zt.binding&&Zt.binding("util")}catch{}}(),Gn=Ze&&Ze.isTypedArray,Wi=Gn?Wt(Gn):Yi,Zi=Object.prototype,Xi=Zi.hasOwnProperty;function Wn(e,n){var o=Pe(e),a=!o&&gi(e),i=!o&&!a&&zn(e),r=!o&&!a&&!i&&Wi(e),s=o||a||i||r,l=s?oi(e.length,String):[],c=l.length;for(var m in e)(n||Xi.call(e,m))&&!(s&&(m=="length"||i&&(m=="offset"||m=="parent")||r&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Kn(m,c)))&&l.push(m);return l}var Ji=Object.prototype;function Xt(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||Ji;return e===o}function Zn(e,n){return function(o){return e(n(o))}}var Qi=Zn(Object.keys,Object),er=Object.prototype,tr=er.hasOwnProperty;function nr(e){if(!Xt(e))return Qi(e);var n=[];for(var o in Object(e))tr.call(e,o)&&o!="constructor"&&n.push(o);return n}function fe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var or="[object AsyncFunction]",ar="[object Function]",ir="[object GeneratorFunction]",rr="[object Proxy]";function x(e){if(!fe(e))return!1;var n=Le(e);return n==ar||n==ir||n==or||n==rr}function At(e){return e!=null&&Hn(e.length)&&!x(e)}function Mt(e){return At(e)?Wn(e):nr(e)}function lr(e,n){return e&&ni(e,n,Mt)}function sr(e,n){return function(o,a){if(o==null)return o;if(!At(o))return e(o,a);for(var i=o.length,r=-1,s=Object(o);++r<i&&a(s[r],r,s)!==!1;);return o}}var dr=sr(lr);function Jt(e){return e}function cr(e){return typeof e=="function"?e:Jt}function ie(e,n){var o=Pe(e)?Dn:dr;return o(e,cr(n))}var mr="[object Symbol]";function Nt(e){return typeof e=="symbol"||Ue(e)&&Le(e)==mr}var ur=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fr=/^\w*$/;function hr(e,n){if(Pe(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||Nt(e)?!0:fr.test(e)||!ur.test(e)||n!=null&&e in Object(n)}var Qt=ge["__core-js_shared__"],Xn=function(){var e=/[^.]+$/.exec(Qt&&Qt.keys&&Qt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function pr(e){return!!Xn&&Xn in e}var gr=Function.prototype,yr=gr.toString;function ve(e){if(e!=null){try{return yr.call(e)}catch{}try{return e+""}catch{}}return""}var br=/[\\^$.*+?()[\]{}|]/g,_r=/^\[object .+?Constructor\]$/,Er=Function.prototype,Tr=Object.prototype,Cr=Er.toString,Sr=Tr.hasOwnProperty,wr=RegExp("^"+Cr.call(Sr).replace(br,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kr(e){if(!fe(e)||pr(e))return!1;var n=x(e)?wr:_r;return n.test(ve(e))}function Ar(e,n){return e==null?void 0:e[n]}function je(e,n){var o=Ar(e,n);return kr(o)?o:void 0}var mt=je(Object,"create");function Mr(){this.__data__=mt?mt(null):{},this.size=0}function Nr(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Ir="__lodash_hash_undefined__",Or=Object.prototype,Vr=Or.hasOwnProperty;function Br(e){var n=this.__data__;if(mt){var o=n[e];return o===Ir?void 0:o}return Vr.call(n,e)?n[e]:void 0}var Fr=Object.prototype,Rr=Fr.hasOwnProperty;function Dr(e){var n=this.__data__;return mt?n[e]!==void 0:Rr.call(n,e)}var Lr="__lodash_hash_undefined__";function Ur(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=mt&&n===void 0?Lr:n,this}function qe(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}qe.prototype.clear=Mr,qe.prototype.delete=Nr,qe.prototype.get=Br,qe.prototype.has=Dr,qe.prototype.set=Ur;function Pr(){this.__data__=[],this.size=0}function It(e,n){return e===n||e!==e&&n!==n}function Ot(e,n){for(var o=e.length;o--;)if(It(e[o][0],n))return o;return-1}var $r=Array.prototype,xr=$r.splice;function vr(e){var n=this.__data__,o=Ot(n,e);if(o<0)return!1;var a=n.length-1;return o==a?n.pop():xr.call(n,o,1),--this.size,!0}function jr(e){var n=this.__data__,o=Ot(n,e);return o<0?void 0:n[o][1]}function qr(e){return Ot(this.__data__,e)>-1}function zr(e,n){var o=this.__data__,a=Ot(o,e);return a<0?(++this.size,o.push([e,n])):o[a][1]=n,this}function ke(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}ke.prototype.clear=Pr,ke.prototype.delete=vr,ke.prototype.get=jr,ke.prototype.has=qr,ke.prototype.set=zr;var ut=je(ge,"Map");function Kr(){this.size=0,this.__data__={hash:new qe,map:new(ut||ke),string:new qe}}function Hr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Vt(e,n){var o=e.__data__;return Hr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function Yr(e){var n=Vt(this,e).delete(e);return this.size-=n?1:0,n}function Gr(e){return Vt(this,e).get(e)}function Wr(e){return Vt(this,e).has(e)}function Zr(e,n){var o=Vt(this,e),a=o.size;return o.set(e,n),this.size+=o.size==a?0:1,this}function Ae(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}Ae.prototype.clear=Kr,Ae.prototype.delete=Yr,Ae.prototype.get=Gr,Ae.prototype.has=Wr,Ae.prototype.set=Zr;var Xr="Expected a function";function en(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Xr);var o=function(){var a=arguments,i=n?n.apply(this,a):a[0],r=o.cache;if(r.has(i))return r.get(i);var s=e.apply(this,a);return o.cache=r.set(i,s)||r,s};return o.cache=new(en.Cache||Ae),o}en.Cache=Ae;var Jr=500;function Qr(e){var n=en(e,function(a){return o.size===Jr&&o.clear(),a}),o=n.cache;return n}var el=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tl=/\\(\\)?/g,nl=Qr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(el,function(o,a,i,r){n.push(i?r.replace(tl,"$1"):a||o)}),n});function ol(e,n){for(var o=-1,a=e==null?0:e.length,i=Array(a);++o<a;)i[o]=n(e[o],o,e);return i}var Jn=De?De.prototype:void 0,Qn=Jn?Jn.toString:void 0;function eo(e){if(typeof e=="string")return e;if(Pe(e))return ol(e,eo)+"";if(Nt(e))return Qn?Qn.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function to(e){return e==null?"":eo(e)}function al(e,n){return Pe(e)?e:hr(e,n)?[e]:nl(to(e))}function il(e){if(typeof e=="string"||Nt(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function rl(e,n){n=al(n,e);for(var o=0,a=n.length;e!=null&&o<a;)e=e[il(n[o++])];return o&&o==a?e:void 0}function P(e,n,o){var a=e==null?void 0:rl(e,n);return a===void 0?o:a}function G(e){return e==null}const re="kong-ui-forms-api",no="kong-ui-forms-config",oo="redis-partial-list-fetcher-key",ll="redis-partial-info",ze="autofill",he="autofillSlot",_e={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"},ao="—";/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:io,setPrototypeOf:ro,isFrozen:sl,getPrototypeOf:dl,getOwnPropertyDescriptor:cl}=Object;let{freeze:le,seal:ye,create:tn}=Object,{apply:nn,construct:on}=typeof Reflect<"u"&&Reflect;le||(le=function(n){return n}),ye||(ye=function(n){return n}),nn||(nn=function(n,o){for(var a=arguments.length,i=new Array(a>2?a-2:0),r=2;r<a;r++)i[r-2]=arguments[r];return n.apply(o,i)}),on||(on=function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return new n(...a)});const Bt=de(Array.prototype.forEach),ml=de(Array.prototype.lastIndexOf),lo=de(Array.prototype.pop),ft=de(Array.prototype.push),ul=de(Array.prototype.splice),Ft=de(String.prototype.toLowerCase),an=de(String.prototype.toString),rn=de(String.prototype.match),ht=de(String.prototype.replace),fl=de(String.prototype.indexOf),hl=de(String.prototype.trim),Ee=de(Object.prototype.hasOwnProperty),se=de(RegExp.prototype.test),pt=pl(TypeError);function de(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return nn(e,n,a)}}function pl(e){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return on(e,o)}}function L(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ft;ro&&ro(e,null);let a=n.length;for(;a--;){let i=n[a];if(typeof i=="string"){const r=o(i);r!==i&&(sl(n)||(n[a]=r),i=r)}e[i]=!0}return e}function gl(e){for(let n=0;n<e.length;n++)Ee(e,n)||(e[n]=null);return e}function Me(e){const n=tn(null);for(const[o,a]of io(e))Ee(e,o)&&(Array.isArray(a)?n[o]=gl(a):a&&typeof a=="object"&&a.constructor===Object?n[o]=Me(a):n[o]=a);return n}function gt(e,n){for(;e!==null;){const a=cl(e,n);if(a){if(a.get)return de(a.get);if(typeof a.value=="function")return de(a.value)}e=dl(e)}function o(){return null}return o}const so=le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ln=le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sn=le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yl=le(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dn=le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bl=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),co=le(["#text"]),mo=le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),cn=le(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),uo=le(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rt=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_l=ye(/\{\{[\w\W]*|[\w\W]*\}\}/gm),El=ye(/<%[\w\W]*|[\w\W]*%>/gm),Tl=ye(/\$\{[\w\W]*/gm),Cl=ye(/^data-[\-\w.\u00B7-\uFFFF]+$/),Sl=ye(/^aria-[\-\w]+$/),fo=ye(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wl=ye(/^(?:\w+script|data):/i),kl=ye(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ho=ye(/^html$/i),Al=ye(/^[a-z][.\w]*(-[.\w]+)+$/i);var po=Object.freeze({__proto__:null,ARIA_ATTR:Sl,ATTR_WHITESPACE:kl,CUSTOM_ELEMENT:Al,DATA_ATTR:Cl,DOCTYPE_NAME:ho,ERB_EXPR:El,IS_ALLOWED_URI:fo,IS_SCRIPT_OR_DATA:wl,MUSTACHE_EXPR:_l,TMPLIT_EXPR:Tl});const yt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ml=function(){return typeof window>"u"?null:window},Nl=function(n,o){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(a=o.getAttribute(i));const r="dompurify"+(a?"#"+a:"");try{return n.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},go=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function yo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ml();const n=I=>yo(I);if(n.version="3.3.0",n.removed=[],!e||!e.document||e.document.nodeType!==yt.document||!e.Element)return n.isSupported=!1,n;let{document:o}=e;const a=o,i=a.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:m,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:b,trustedTypes:A}=e,F=c.prototype,u=gt(F,"cloneNode"),C=gt(F,"remove"),S=gt(F,"nextSibling"),N=gt(F,"childNodes"),_=gt(F,"parentNode");if(typeof s=="function"){const I=o.createElement("template");I.content&&I.content.ownerDocument&&(o=I.content.ownerDocument)}let w,y="";const{implementation:g,createNodeIterator:p,createDocumentFragment:V,getElementsByTagName:v}=o,{importNode:M}=a;let T=go();n.isSupported=typeof io=="function"&&typeof _=="function"&&g&&g.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:R,TMPLIT_EXPR:U,DATA_ATTR:ee,ARIA_ATTR:Oe,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Ve,CUSTOM_ELEMENT:Sn}=po;let{IS_ALLOWED_URI:vt}=po,O=null;const H=L({},[...so,...ln,...sn,...dn,...co]);let Z=null;const Ba=L({},[...mo,...cn,...uo,...Rt]);let X=Object.seal(tn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ct=null,wn=null;const tt=Object.seal(tn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Fa=!0,kn=!0,Ra=!1,Da=!0,nt=!1,jt=!0,Ge=!1,An=!1,Mn=!1,ot=!1,qt=!1,zt=!1,La=!0,Ua=!1;const Lf="user-content-";let Nn=!0,St=!1,at={},it=null;const Pa=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $a=null;const xa=L({},["audio","video","img","source","image","track"]);let In=null;const va=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";let rt=Be,On=!1,Vn=null;const Uf=L({},[Kt,Ht,Be],an);let Yt=L({},["mi","mo","mn","ms","mtext"]),Gt=L({},["annotation-xml"]);const Pf=L({},["title","style","font","a","script"]);let wt=null;const $f=["application/xhtml+xml","text/html"],xf="text/html";let te=null,lt=null;const vf=o.createElement("form"),ja=function(d){return d instanceof RegExp||d instanceof Function},Bn=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(lt&<===d)){if((!d||typeof d!="object")&&(d={}),d=Me(d),wt=$f.indexOf(d.PARSER_MEDIA_TYPE)===-1?xf:d.PARSER_MEDIA_TYPE,te=wt==="application/xhtml+xml"?an:Ft,O=Ee(d,"ALLOWED_TAGS")?L({},d.ALLOWED_TAGS,te):H,Z=Ee(d,"ALLOWED_ATTR")?L({},d.ALLOWED_ATTR,te):Ba,Vn=Ee(d,"ALLOWED_NAMESPACES")?L({},d.ALLOWED_NAMESPACES,an):Uf,In=Ee(d,"ADD_URI_SAFE_ATTR")?L(Me(va),d.ADD_URI_SAFE_ATTR,te):va,$a=Ee(d,"ADD_DATA_URI_TAGS")?L(Me(xa),d.ADD_DATA_URI_TAGS,te):xa,it=Ee(d,"FORBID_CONTENTS")?L({},d.FORBID_CONTENTS,te):Pa,Ct=Ee(d,"FORBID_TAGS")?L({},d.FORBID_TAGS,te):Me({}),wn=Ee(d,"FORBID_ATTR")?L({},d.FORBID_ATTR,te):Me({}),at=Ee(d,"USE_PROFILES")?d.USE_PROFILES:!1,Fa=d.ALLOW_ARIA_ATTR!==!1,kn=d.ALLOW_DATA_ATTR!==!1,Ra=d.ALLOW_UNKNOWN_PROTOCOLS||!1,Da=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=d.SAFE_FOR_TEMPLATES||!1,jt=d.SAFE_FOR_XML!==!1,Ge=d.WHOLE_DOCUMENT||!1,ot=d.RETURN_DOM||!1,qt=d.RETURN_DOM_FRAGMENT||!1,zt=d.RETURN_TRUSTED_TYPE||!1,Mn=d.FORCE_BODY||!1,La=d.SANITIZE_DOM!==!1,Ua=d.SANITIZE_NAMED_PROPS||!1,Nn=d.KEEP_CONTENT!==!1,St=d.IN_PLACE||!1,vt=d.ALLOWED_URI_REGEXP||fo,rt=d.NAMESPACE||Be,Yt=d.MATHML_TEXT_INTEGRATION_POINTS||Yt,Gt=d.HTML_INTEGRATION_POINTS||Gt,X=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&ja(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&ja(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),nt&&(kn=!1),qt&&(ot=!0),at&&(O=L({},co),Z=[],at.html===!0&&(L(O,so),L(Z,mo)),at.svg===!0&&(L(O,ln),L(Z,cn),L(Z,Rt)),at.svgFilters===!0&&(L(O,sn),L(Z,cn),L(Z,Rt)),at.mathMl===!0&&(L(O,dn),L(Z,uo),L(Z,Rt))),d.ADD_TAGS&&(typeof d.ADD_TAGS=="function"?tt.tagCheck=d.ADD_TAGS:(O===H&&(O=Me(O)),L(O,d.ADD_TAGS,te))),d.ADD_ATTR&&(typeof d.ADD_ATTR=="function"?tt.attributeCheck=d.ADD_ATTR:(Z===Ba&&(Z=Me(Z)),L(Z,d.ADD_ATTR,te))),d.ADD_URI_SAFE_ATTR&&L(In,d.ADD_URI_SAFE_ATTR,te),d.FORBID_CONTENTS&&(it===Pa&&(it=Me(it)),L(it,d.FORBID_CONTENTS,te)),Nn&&(O["#text"]=!0),Ge&&L(O,["html","head","body"]),O.table&&(L(O,["tbody"]),delete Ct.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=d.TRUSTED_TYPES_POLICY,y=w.createHTML("")}else w===void 0&&(w=Nl(A,i)),w!==null&&typeof y=="string"&&(y=w.createHTML(""));le&&le(d),lt=d}},qa=L({},[...ln,...sn,...yl]),za=L({},[...dn,...bl]),jf=function(d){let E=_(d);(!E||!E.tagName)&&(E={namespaceURI:rt,tagName:"template"});const k=Ft(d.tagName),z=Ft(E.tagName);return Vn[d.namespaceURI]?d.namespaceURI===Ht?E.namespaceURI===Be?k==="svg":E.namespaceURI===Kt?k==="svg"&&(z==="annotation-xml"||Yt[z]):!!qa[k]:d.namespaceURI===Kt?E.namespaceURI===Be?k==="math":E.namespaceURI===Ht?k==="math"&&Gt[z]:!!za[k]:d.namespaceURI===Be?E.namespaceURI===Ht&&!Gt[z]||E.namespaceURI===Kt&&!Yt[z]?!1:!za[k]&&(Pf[k]||!qa[k]):!!(wt==="application/xhtml+xml"&&Vn[d.namespaceURI]):!1},we=function(d){ft(n.removed,{element:d});try{_(d).removeChild(d)}catch{C(d)}},We=function(d,E){try{ft(n.removed,{attribute:E.getAttributeNode(d),from:E})}catch{ft(n.removed,{attribute:null,from:E})}if(E.removeAttribute(d),d==="is")if(ot||qt)try{we(E)}catch{}else try{E.setAttribute(d,"")}catch{}},Ka=function(d){let E=null,k=null;if(Mn)d="<remove></remove>"+d;else{const Q=rn(d,/^[\r\n\t ]+/);k=Q&&Q[0]}wt==="application/xhtml+xml"&&rt===Be&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");const z=w?w.createHTML(d):d;if(rt===Be)try{E=new b().parseFromString(z,wt)}catch{}if(!E||!E.documentElement){E=g.createDocument(rt,"template",null);try{E.documentElement.innerHTML=On?y:z}catch{}}const ae=E.body||E.documentElement;return d&&k&&ae.insertBefore(o.createTextNode(k),ae.childNodes[0]||null),rt===Be?v.call(E,Ge?"html":"body")[0]:Ge?E.documentElement:ae},Ha=function(d){return p.call(d.ownerDocument||d,d,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Fn=function(d){return d instanceof h&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},Ya=function(d){return typeof l=="function"&&d instanceof l};function Fe(I,d,E){Bt(I,k=>{k.call(n,d,E,lt)})}const Ga=function(d){let E=null;if(Fe(T.beforeSanitizeElements,d,null),Fn(d))return we(d),!0;const k=te(d.nodeName);if(Fe(T.uponSanitizeElement,d,{tagName:k,allowedTags:O}),jt&&d.hasChildNodes()&&!Ya(d.firstElementChild)&&se(/<[/\w!]/g,d.innerHTML)&&se(/<[/\w!]/g,d.textContent)||d.nodeType===yt.progressingInstruction||jt&&d.nodeType===yt.comment&&se(/<[/\w]/g,d.data))return we(d),!0;if(!(tt.tagCheck instanceof Function&&tt.tagCheck(k))&&(!O[k]||Ct[k])){if(!Ct[k]&&Za(k)&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,k)||X.tagNameCheck instanceof Function&&X.tagNameCheck(k)))return!1;if(Nn&&!it[k]){const z=_(d)||d.parentNode,ae=N(d)||d.childNodes;if(ae&&z){const Q=ae.length;for(let me=Q-1;me>=0;--me){const Re=u(ae[me],!0);Re.__removalCount=(d.__removalCount||0)+1,z.insertBefore(Re,S(d))}}}return we(d),!0}return d instanceof c&&!jf(d)||(k==="noscript"||k==="noembed"||k==="noframes")&&se(/<\/no(script|embed|frames)/i,d.innerHTML)?(we(d),!0):(nt&&d.nodeType===yt.text&&(E=d.textContent,Bt([B,R,U],z=>{E=ht(E,z," ")}),d.textContent!==E&&(ft(n.removed,{element:d.cloneNode()}),d.textContent=E)),Fe(T.afterSanitizeElements,d,null),!1)},Wa=function(d,E,k){if(La&&(E==="id"||E==="name")&&(k in o||k in vf))return!1;if(!(kn&&!wn[E]&&se(ee,E))){if(!(Fa&&se(Oe,E))){if(!(tt.attributeCheck instanceof Function&&tt.attributeCheck(E,d))){if(!Z[E]||wn[E]){if(!(Za(d)&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,d)||X.tagNameCheck instanceof Function&&X.tagNameCheck(d))&&(X.attributeNameCheck instanceof RegExp&&se(X.attributeNameCheck,E)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(E,d))||E==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,k)||X.tagNameCheck instanceof Function&&X.tagNameCheck(k))))return!1}else if(!In[E]){if(!se(vt,ht(k,Ve,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&d!=="script"&&fl(k,"data:")===0&&$a[d])){if(!(Ra&&!se(J,ht(k,Ve,"")))){if(k)return!1}}}}}}}return!0},Za=function(d){return d!=="annotation-xml"&&rn(d,Sn)},Xa=function(d){Fe(T.beforeSanitizeAttributes,d,null);const{attributes:E}=d;if(!E||Fn(d))return;const k={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let z=E.length;for(;z--;){const ae=E[z],{name:Q,namespaceURI:me,value:Re}=ae,st=te(Q),Rn=Re;let oe=Q==="value"?Rn:hl(Rn);if(k.attrName=st,k.attrValue=oe,k.keepAttr=!0,k.forceKeepAttr=void 0,Fe(T.uponSanitizeAttribute,d,k),oe=k.attrValue,Ua&&(st==="id"||st==="name")&&(We(Q,d),oe=Lf+oe),jt&&se(/((--!?|])>)|<\/(style|title|textarea)/i,oe)){We(Q,d);continue}if(st==="attributename"&&rn(oe,"href")){We(Q,d);continue}if(k.forceKeepAttr)continue;if(!k.keepAttr){We(Q,d);continue}if(!Da&&se(/\/>/i,oe)){We(Q,d);continue}nt&&Bt([B,R,U],Qa=>{oe=ht(oe,Qa," ")});const Ja=te(d.nodeName);if(!Wa(Ja,st,oe)){We(Q,d);continue}if(w&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!me)switch(A.getAttributeType(Ja,st)){case"TrustedHTML":{oe=w.createHTML(oe);break}case"TrustedScriptURL":{oe=w.createScriptURL(oe);break}}if(oe!==Rn)try{me?d.setAttributeNS(me,Q,oe):d.setAttribute(Q,oe),Fn(d)?we(d):lo(n.removed)}catch{We(Q,d)}}Fe(T.afterSanitizeAttributes,d,null)},qf=function I(d){let E=null;const k=Ha(d);for(Fe(T.beforeSanitizeShadowDOM,d,null);E=k.nextNode();)Fe(T.uponSanitizeShadowNode,E,null),Ga(E),Xa(E),E.content instanceof r&&I(E.content);Fe(T.afterSanitizeShadowDOM,d,null)};return n.sanitize=function(I){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,k=null,z=null,ae=null;if(On=!I,On&&(I="<!-->"),typeof I!="string"&&!Ya(I))if(typeof I.toString=="function"){if(I=I.toString(),typeof I!="string")throw pt("dirty is not a string, aborting")}else throw pt("toString is not a function");if(!n.isSupported)return I;if(An||Bn(d),n.removed=[],typeof I=="string"&&(St=!1),St){if(I.nodeName){const Re=te(I.nodeName);if(!O[Re]||Ct[Re])throw pt("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof l)E=Ka("<!---->"),k=E.ownerDocument.importNode(I,!0),k.nodeType===yt.element&&k.nodeName==="BODY"||k.nodeName==="HTML"?E=k:E.appendChild(k);else{if(!ot&&!nt&&!Ge&&I.indexOf("<")===-1)return w&&zt?w.createHTML(I):I;if(E=Ka(I),!E)return ot?null:zt?y:""}E&&Mn&&we(E.firstChild);const Q=Ha(St?I:E);for(;z=Q.nextNode();)Ga(z),Xa(z),z.content instanceof r&&qf(z.content);if(St)return I;if(ot){if(qt)for(ae=V.call(E.ownerDocument);E.firstChild;)ae.appendChild(E.firstChild);else ae=E;return(Z.shadowroot||Z.shadowrootmode)&&(ae=M.call(a,ae,!0)),ae}let me=Ge?E.outerHTML:E.innerHTML;return Ge&&O["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&se(ho,E.ownerDocument.doctype.name)&&(me="<!DOCTYPE "+E.ownerDocument.doctype.name+`>
|
|
2
|
-
`+me),nt&&Bt([B,R,U],Re=>{me=ht(me,Re," ")}),w&&zt?w.createHTML(me):me},n.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bn(I),An=!0},n.clearConfig=function(){lt=null,An=!1},n.isValidAttribute=function(I,d,E){lt||Bn({});const k=te(I),z=te(d);return Wa(k,z,E)},n.addHook=function(I,d){typeof d=="function"&&ft(T[I],d)},n.removeHook=function(I,d){if(d!==void 0){const E=ml(T[I],d);return E===-1?void 0:ul(T[I],E,1)[0]}return lo(T[I])},n.removeHooks=function(I){T[I]=[]},n.removeAllHooks=function(){T=go()},n}var Il=yo();function Ol(){this.__data__=new ke,this.size=0}function Vl(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Bl(e){return this.__data__.get(e)}function Fl(e){return this.__data__.has(e)}var Rl=200;function Dl(e,n){var o=this.__data__;if(o instanceof ke){var a=o.__data__;if(!ut||a.length<Rl-1)return a.push([e,n]),this.size=++o.size,this;o=this.__data__=new Ae(a)}return o.set(e,n),this.size=o.size,this}function Xe(e){var n=this.__data__=new ke(e);this.size=n.size}Xe.prototype.clear=Ol,Xe.prototype.delete=Vl,Xe.prototype.get=Bl,Xe.prototype.has=Fl,Xe.prototype.set=Dl;var Dt=function(){try{var e=je(Object,"defineProperty");return e({},"",{}),e}catch{}}();function bo(e,n,o){n=="__proto__"&&Dt?Dt(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Ll=Object.prototype,Ul=Ll.hasOwnProperty;function _o(e,n,o){var a=e[n];(!(Ul.call(e,n)&&It(a,o))||o===void 0&&!(n in e))&&bo(e,n,o)}function Lt(e,n,o,a){var i=!o;o||(o={});for(var r=-1,s=n.length;++r<s;){var l=n[r],c=void 0;c===void 0&&(c=e[l]),i?bo(o,l,c):_o(o,l,c)}return o}function Pl(e,n){return e&&Lt(n,Mt(n),e)}function $l(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var xl=Object.prototype,vl=xl.hasOwnProperty;function jl(e){if(!fe(e))return $l(e);var n=Xt(e),o=[];for(var a in e)a=="constructor"&&(n||!vl.call(e,a))||o.push(a);return o}function Ut(e){return At(e)?Wn(e,!0):jl(e)}function ql(e,n){return e&&Lt(n,Ut(n),e)}var Eo=typeof D=="object"&&D&&!D.nodeType&&D,To=Eo&&typeof module=="object"&&module&&!module.nodeType&&module,zl=To&&To.exports===Eo,Co=zl?ge.Buffer:void 0,So=Co?Co.allocUnsafe:void 0;function Kl(e,n){if(n)return e.slice();var o=e.length,a=So?So(o):new e.constructor(o);return e.copy(a),a}function Hl(e,n){var o=-1,a=e.length;for(n||(n=Array(a));++o<a;)n[o]=e[o];return n}function Yl(e,n){for(var o=-1,a=e==null?0:e.length,i=0,r=[];++o<a;){var s=e[o];n(s,o,e)&&(r[i++]=s)}return r}function wo(){return[]}var Gl=Object.prototype,Wl=Gl.propertyIsEnumerable,ko=Object.getOwnPropertySymbols,mn=ko?function(e){return e==null?[]:(e=Object(e),Yl(ko(e),function(n){return Wl.call(e,n)}))}:wo;function Zl(e,n){return Lt(e,mn(e),n)}function Ao(e,n){for(var o=-1,a=n.length,i=e.length;++o<a;)e[i+o]=n[o];return e}var Mo=Zn(Object.getPrototypeOf,Object),Xl=Object.getOwnPropertySymbols,No=Xl?function(e){for(var n=[];e;)Ao(n,mn(e)),e=Mo(e);return n}:wo;function Jl(e,n){return Lt(e,No(e),n)}function Io(e,n,o){var a=n(e);return Pe(e)?a:Ao(a,o(e))}function Ql(e){return Io(e,Mt,mn)}function es(e){return Io(e,Ut,No)}var un=je(ge,"DataView"),fn=je(ge,"Promise"),Je=je(ge,"Set"),hn=je(ge,"WeakMap"),Oo="[object Map]",ts="[object Object]",Vo="[object Promise]",Bo="[object Set]",Fo="[object WeakMap]",Ro="[object DataView]",ns=ve(un),os=ve(ut),as=ve(fn),is=ve(Je),rs=ve(hn),Ne=Le;(un&&Ne(new un(new ArrayBuffer(1)))!=Ro||ut&&Ne(new ut)!=Oo||fn&&Ne(fn.resolve())!=Vo||Je&&Ne(new Je)!=Bo||hn&&Ne(new hn)!=Fo)&&(Ne=function(e){var n=Le(e),o=n==ts?e.constructor:void 0,a=o?ve(o):"";if(a)switch(a){case ns:return Ro;case os:return Oo;case as:return Vo;case is:return Bo;case rs:return Fo}return n});var ls=Object.prototype,ss=ls.hasOwnProperty;function ds(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&ss.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var Do=ge.Uint8Array;function pn(e){var n=new e.constructor(e.byteLength);return new Do(n).set(new Do(e)),n}function cs(e,n){var o=n?pn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ms=/\w*$/;function us(e){var n=new e.constructor(e.source,ms.exec(e));return n.lastIndex=e.lastIndex,n}var Lo=De?De.prototype:void 0,Uo=Lo?Lo.valueOf:void 0;function fs(e){return Uo?Object(Uo.call(e)):{}}function hs(e,n){var o=n?pn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var ps="[object Boolean]",gs="[object Date]",ys="[object Map]",bs="[object Number]",_s="[object RegExp]",Es="[object Set]",Ts="[object String]",Cs="[object Symbol]",Ss="[object ArrayBuffer]",ws="[object DataView]",ks="[object Float32Array]",As="[object Float64Array]",Ms="[object Int8Array]",Ns="[object Int16Array]",Is="[object Int32Array]",Os="[object Uint8Array]",Vs="[object Uint8ClampedArray]",Bs="[object Uint16Array]",Fs="[object Uint32Array]";function Rs(e,n,o){var a=e.constructor;switch(n){case Ss:return pn(e);case ps:case gs:return new a(+e);case ws:return cs(e,o);case ks:case As:case Ms:case Ns:case Is:case Os:case Vs:case Bs:case Fs:return hs(e,o);case ys:return new a;case bs:case Ts:return new a(e);case _s:return us(e);case Es:return new a;case Cs:return fs(e)}}var Po=Object.create,Ds=function(){function e(){}return function(n){if(!fe(n))return{};if(Po)return Po(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Ls(e){return typeof e.constructor=="function"&&!Xt(e)?Ds(Mo(e)):{}}var Us="[object Map]";function Ps(e){return Ue(e)&&Ne(e)==Us}var $o=Ze&&Ze.isMap,$s=$o?Wt($o):Ps,xs="[object Set]";function vs(e){return Ue(e)&&Ne(e)==xs}var xo=Ze&&Ze.isSet,js=xo?Wt(xo):vs,qs=1,zs=2,Ks=4,vo="[object Arguments]",Hs="[object Array]",Ys="[object Boolean]",Gs="[object Date]",Ws="[object Error]",jo="[object Function]",Zs="[object GeneratorFunction]",Xs="[object Map]",Js="[object Number]",qo="[object Object]",Qs="[object RegExp]",ed="[object Set]",td="[object String]",nd="[object Symbol]",od="[object WeakMap]",ad="[object ArrayBuffer]",id="[object DataView]",rd="[object Float32Array]",ld="[object Float64Array]",sd="[object Int8Array]",dd="[object Int16Array]",cd="[object Int32Array]",md="[object Uint8Array]",ud="[object Uint8ClampedArray]",fd="[object Uint16Array]",hd="[object Uint32Array]",j={};j[vo]=j[Hs]=j[ad]=j[id]=j[Ys]=j[Gs]=j[rd]=j[ld]=j[sd]=j[dd]=j[cd]=j[Xs]=j[Js]=j[qo]=j[Qs]=j[ed]=j[td]=j[nd]=j[md]=j[ud]=j[fd]=j[hd]=!0,j[Ws]=j[jo]=j[od]=!1;function bt(e,n,o,a,i,r){var s,l=n&qs,c=n&zs,m=n&Ks;if(s!==void 0)return s;if(!fe(e))return e;var f=Pe(e);if(f){if(s=ds(e),!l)return Hl(e,s)}else{var h=Ne(e),b=h==jo||h==Zs;if(zn(e))return Kl(e,l);if(h==qo||h==vo||b&&!i){if(s=c||b?{}:Ls(e),!l)return c?Jl(e,ql(s,e)):Zl(e,Pl(s,e))}else{if(!j[h])return i?e:{};s=Rs(e,h,l)}}r||(r=new Xe);var A=r.get(e);if(A)return A;r.set(e,s),js(e)?e.forEach(function(C){s.add(bt(C,n,o,C,e,r))}):$s(e)&&e.forEach(function(C,S){s.set(S,bt(C,n,o,S,e,r))});var F=m?c?es:Ql:c?Ut:Mt,u=f?void 0:F(e);return Dn(u||e,function(C,S){u&&(S=C,C=e[S]),_o(s,S,bt(C,n,o,S,e,r))}),s}var pd=1,gd=4;function Ie(e){return bt(e,pd|gd)}const gn=(e,n="")=>typeof e.id<"u"?n+e.id+"":n+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),zo=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var yd="[object String]";function Ke(e){return typeof e=="string"||!Pe(e)&&Ue(e)&&Le(e)==yd}const Ko={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[P(this.options,"validationErrorClass","error")]:n,[P(this.options,"validationSuccessClass","valid")]:!n,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?ie(e.styleClasses,a=>o[a]=!0):Ke(e.styleClasses)&&(o[e.styleClasses]=!0),G(e.type)||(o["field-"+e.type]=!0),o},fieldErrors(e){return this.errors.filter(o=>o.field.fieldName===e.fieldName).map(o=>o.error)},fieldDisabled(e){return x(e.disabled)?e.disabled.call(this,this.model,e,this):G(e.disabled)?!1:e.disabled},fieldReadonly(e){return x(e.readonly)?e.readonly.call(this,this.model,e,this):G(e.readonly)?!1:e.readonly},fieldFeatured(e){return x(e.featured)?e.featured.call(this,this.model,e,this):G(e.featured)?!1:e.featured},fieldRequired(e){return x(e.required)?e.required.call(this,this.model,e,this):G(e.required)?!1:e.required}}};var yn=function(){return ge.Date.now()},bd=/\s/;function _d(e){for(var n=e.length;n--&&bd.test(e.charAt(n)););return n}var Ed=/^\s+/;function Td(e){return e&&e.slice(0,_d(e)+1).replace(Ed,"")}var Ho=NaN,Cd=/^[-+]0x[0-9a-f]+$/i,Sd=/^0b[01]+$/i,wd=/^0o[0-7]+$/i,kd=parseInt;function bn(e){if(typeof e=="number")return e;if(Nt(e))return Ho;if(fe(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=fe(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Td(e);var o=Sd.test(e);return o||wd.test(e)?kd(e.slice(2),o?2:8):Cd.test(e)?Ho:+e}var Ad="Expected a function",Md=Math.max,Nd=Math.min;function Qe(e,n,o){var a,i,r,s,l,c,m=0,f=!1,h=!1,b=!0;if(typeof e!="function")throw new TypeError(Ad);n=bn(n)||0,fe(o)&&(f=!!o.leading,h="maxWait"in o,r=h?Md(bn(o.maxWait)||0,n):r,b="trailing"in o?!!o.trailing:b);function A(g){var p=a,V=i;return a=i=void 0,m=g,s=e.apply(V,p),s}function F(g){return m=g,l=setTimeout(S,n),f?A(g):s}function u(g){var p=g-c,V=g-m,v=n-p;return h?Nd(v,r-V):v}function C(g){var p=g-c,V=g-m;return c===void 0||p>=n||p<0||h&&V>=r}function S(){var g=yn();if(C(g))return N(g);l=setTimeout(S,u(g))}function N(g){return l=void 0,b&&a?A(g):(a=i=void 0,s)}function _(){l!==void 0&&clearTimeout(l),m=0,a=c=i=l=void 0}function w(){return l===void 0?s:N(yn())}function y(){var g=yn(),p=C(g);if(a=arguments,i=this,c=g,p){if(l===void 0)return F(c);if(h)return clearTimeout(l),l=setTimeout(S,n),A(c)}return l===void 0&&(l=setTimeout(S,n)),s}return y.cancel=_,y.flush=w,y}var Id="__lodash_hash_undefined__";function Od(e){return this.__data__.set(e,Id),this}function Vd(e){return this.__data__.has(e)}function Pt(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new Ae;++n<o;)this.add(e[n])}Pt.prototype.add=Pt.prototype.push=Od,Pt.prototype.has=Vd;function Bd(e,n,o,a){for(var i=e.length,r=o+-1;++r<i;)if(n(e[r],r,e))return r;return-1}function Fd(e){return e!==e}function Rd(e,n,o){for(var a=o-1,i=e.length;++a<i;)if(e[a]===n)return a;return-1}function Dd(e,n,o){return n===n?Rd(e,n,o):Bd(e,Fd,o)}function Ld(e,n){var o=e==null?0:e.length;return!!o&&Dd(e,n,0)>-1}function Ud(e,n){return e.has(n)}function Pd(){}function Yo(e){var n=-1,o=Array(e.size);return e.forEach(function(a){o[++n]=a}),o}var $d=1/0,xd=Je&&1/Yo(new Je([,-0]))[1]==$d?function(e){return new Je(e)}:Pd,vd=200;function jd(e,n,o){var a=-1,i=Ld,r=e.length,s=!0,l=[],c=l;if(r>=vd){var m=xd(e);if(m)return Yo(m);s=!1,i=Ud,c=new Pt}else c=l;e:for(;++a<r;){var f=e[a],h=f;if(f=f!==0?f:0,s&&h===h){for(var b=c.length;b--;)if(c[b]===h)continue e;l.push(f)}else i(c,h,o)||(c!==l&&c.push(h),l.push(f))}return l}function Go(e){return e&&e.length?jd(e):[]}var qd=0;function Wo(e){var n=++qd;return to(e)+n}var Zo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,$e="\\d\\d?",xe="\\d\\d",zd="\\d{3}",Kd="\\d{4}",_t="[^\\s]+",Xo=/\[([^]*?)\]/gm;function Jo(e,n){for(var o=[],a=0,i=e.length;a<i;a++)o.push(e[a].substr(0,n));return o}var Qo=function(e){return function(n,o){var a=o[e].map(function(r){return r.toLowerCase()}),i=a.indexOf(n.toLowerCase());return i>-1?i:null}};function He(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var a=0,i=n;a<i.length;a++){var r=i[a];for(var s in r)e[s]=r[s]}return e}var ea=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ta=["January","February","March","April","May","June","July","August","September","October","November","December"],Hd=Jo(ta,3),Yd=Jo(ea,3),na={dayNamesShort:Yd,dayNames:ea,monthNamesShort:Hd,monthNames:ta,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},$t=He({},na),Gd=function(e){return $t=He($t,e)},oa=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},ce=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},Wd={D:function(e){return String(e.getDate())},DD:function(e){return ce(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return ce(e.getDay())},ddd:function(e,n){return n.dayNamesShort[e.getDay()]},dddd:function(e,n){return n.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return ce(e.getMonth()+1)},MMM:function(e,n){return n.monthNamesShort[e.getMonth()]},MMMM:function(e,n){return n.monthNames[e.getMonth()]},YY:function(e){return ce(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return ce(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return ce(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return ce(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return ce(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return ce(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return ce(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return ce(e.getMilliseconds(),3)},a:function(e,n){return e.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(e,n){return e.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60),2)+":"+ce(Math.abs(n)%60,2)}},aa=function(e){return+e-1},ia=[null,$e],ra=[null,_t],la=["isPm",_t,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],sa=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var n=(e+"").match(/([+-]|\d\d)/gi);if(n){var o=+n[1]*60+parseInt(n[2],10);return n[0]==="+"?o:-o}return 0}],Zd={D:["day",$e],DD:["day",xe],Do:["day",$e+_t,function(e){return parseInt(e,10)}],M:["month",$e,aa],MM:["month",xe,aa],YY:["year",xe,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",$e,void 0,"isPm"],hh:["hour",xe,void 0,"isPm"],H:["hour",$e],HH:["hour",xe],m:["minute",$e],mm:["minute",xe],s:["second",$e],ss:["second",xe],YYYY:["year",Kd],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",xe,function(e){return+e*10}],SSS:["millisecond",zd],d:ia,dd:ia,ddd:ra,dddd:ra,MMM:["month",_t,Qo("monthNamesShort")],MMMM:["month",_t,Qo("monthNames")],a:la,A:la,ZZ:sa,Z:sa},xt={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Xd=function(e){return He(xt,e)},Jd=function(e,n,o){if(n===void 0&&(n=xt.default),o===void 0&&(o={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");n=xt[n]||n;var a=[];n=n.replace(Xo,function(r,s){return a.push(s),"@@@"});var i=He(He({},$t),o);return n=n.replace(Zo,function(r){return Wd[r](e,i)}),n.replace(/@@@/g,function(){return a.shift()})};function Qd(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=xt[n]||n,e.length>1e3)return null;var a=new Date,i={year:a.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],s=[],l=n.replace(Xo,function(w,y){return s.push(oa(y)),"@@@"}),c={},m={};l=oa(l).replace(Zo,function(w){var y=Zd[w],g=y[0],p=y[1],V=y[3];if(c[g])throw new Error("Invalid format. "+g+" specified twice in format");return c[g]=!0,V&&(m[V]=!0),r.push(y),"("+p+")"}),Object.keys(m).forEach(function(w){if(!c[w])throw new Error("Invalid format. "+w+" is required in specified format")}),l=l.replace(/@@@/g,function(){return s.shift()});var f=e.match(new RegExp(l,"i"));if(!f)return null;for(var h=He(He({},$t),o),b=1;b<f.length;b++){var A=r[b-1],F=A[0],u=A[2],C=u?u(f[b],h):+f[b];if(C==null)return null;i[F]=C}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var S;if(i.timezoneOffset==null){S=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var N=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],b=0,_=N.length;b<_;b++)if(c[N[b][0]]&&i[N[b][0]]!==S[N[b][1]]())return null}else if(S=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return S}var et={format:Jd,parse:Qd,defaultI18n:na,setGlobalDateI18n:Gd,setGlobalDateMasks:Xd};function ec(e,n,o){switch(o.length){case 0:return e.call(n);case 1:return e.call(n,o[0]);case 2:return e.call(n,o[0],o[1]);case 3:return e.call(n,o[0],o[1],o[2])}return e.apply(n,o)}var da=Math.max;function tc(e,n,o){return n=da(n===void 0?e.length-1:n,0),function(){for(var a=arguments,i=-1,r=da(a.length-n,0),s=Array(r);++i<r;)s[i]=a[n+i];i=-1;for(var l=Array(n+1);++i<n;)l[i]=a[i];return l[n]=o(s),ec(e,this,l)}}function nc(e){return function(){return e}}var oc=Dt?function(e,n){return Dt(e,"toString",{configurable:!0,enumerable:!1,value:nc(n),writable:!0})}:Jt,ac=800,ic=16,rc=Date.now;function lc(e){var n=0,o=0;return function(){var a=rc(),i=ic-(a-o);if(o=a,i>0){if(++n>=ac)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var sc=lc(oc);function dc(e,n){return sc(tc(e,n,Jt),e+"")}function cc(e,n,o){if(!fe(o))return!1;var a=typeof n;return(a=="number"?At(o)&&Kn(n,o.length):a=="string"&&n in o)?It(o[n],e):!1}var ca=Object.prototype,mc=ca.hasOwnProperty,uc=dc(function(e,n){e=Object(e);var o=-1,a=n.length,i=a>2?n[2]:void 0;for(i&&cc(n[0],n[1],i)&&(a=1);++o<a;)for(var r=n[o],s=Ut(r),l=-1,c=s.length;++l<c;){var m=s[l],f=e[m];(f===void 0||It(f,ca[m])&&!mc.call(e,m))&&(e[m]=r[m])}return e}),fc=ge.isFinite;function ma(e){return typeof e=="number"&&fc(e)}var ua=1/0,hc=17976931348623157e292;function pc(e){if(!e)return e===0?e:0;if(e=bn(e),e===ua||e===-ua){var n=e<0?-1:1;return n*hc}return e===e?e:0}function gc(e){var n=pc(e),o=n%1;return n===n?o?n-o:n:0}function yc(e){return typeof e=="number"&&e==gc(e)}var bc="[object Number]";function _n(e){return typeof e=="number"||Ue(e)&&Le(e)==bc}const pe={general:{packageName:"forms",disable_global_radio:"The plugin is set to 'Scoped' by default when configured under a {scope}. To configure a global plugin, navigate to the global plugin list page.",disable_source_scope_change:"Changing the {scope} is not allowed when configuring a plugin under it."},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}},rla:{view_advanced:"View advanced parameters",window_type:{label:"Rate Limit Window Type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window's counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},start_with_a_use_case:"Start with a use case:",use_case_index:"Use case {index}",error_message:{label:"Error Message",code_placeholder:"Code Message",message_placeholder:"Error Message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},identifiers:{label:"Identifiers",options:{ip:"IP",credential:"Credential",consumer:"Consumer",service:"Service",header:"Header",path:"Path","consumer-group":"Consumer Group",route:"Route"}},redis:{title:"Configure your Redis",address_example:"e.g. localhost:6379"}},validators:{field_is_required:"This field is required",invalid_format:"Invalid format",number_too_small:"The number is too small. Minimum: {0}",number_too_large:"The number is too large. Maximum: {0}",invalid_number:"Invalid number",invalid_integer:"The value is not an integer",text_too_short:"The length of text is too short. Current: {0}, Minimum: {1}",text_too_long:"The length of text is too long. Current: {0}, Maximum: {1}",this_not_text:"This is not a text",this_not_array:"This is not an array",select_min_items:"Select minimum {0} items",select_max_items:"Select maximum {0} items",invalid_date:"Invalid date",date_is_early:"The date is too early. Current: {0}, Minimum: {1}",date_is_late:"The date is too late. Current: {0}, Maximum: {1}",invalid_email:"Invalid e-mail address",invalid_url:"Invalid URL",invalid_card:"Invalid card format",invalid_card_number:"Invalid card number",invalid_text_contain_number:"Invalid text - cannot contains numbers or special characters",invalid_tex_contain_spec:"Invalid text - cannot contains special characters"},redis:{title:"Redis Configuration",shared_configuration:{label:"Use shared configuration",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins.",title:"Shared Redis Configuration",error:"Fetching shared Redis configurations failed.",tooltip:"Only compatible {type} redis configurations will be listed here.",configuration_selector_label:"Select stored Redis configuration",configuration_selector_placeholder:"Pick Redis configuration",create_new_configuration:"New {type} shared configuration",empty_state:"No shared configurations",badge:"Recommended",selector:{title:"Select a Redis configuration",placeholder:"Filter Configurations",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins."}},dedicated_configuration:{label:"Use dedicated configuration",description:"Create a Redis configuration exclusively for this plugin, with settings that won’t impact other plugins.",title:"Connection Settings"},config_card:{common_fields:{created_at_label:"Created at",updated_at_label:"Last Updated at",type_label:"Redis Type"}},custom_plugin:{alert:"Note: For custom plugins, we cannot determine the correct Redis configuration type. Please ensure you select the appropriate option manually.",tooltip:"To apply a shared redis configuration, the redis fields must defined as Kong plugins in plugin schema."}},fields:{auto_suggest:{error:{load_entity:"There was an error loading {entity}"},recently_created:"Recently created {entity}",items_count:"Currently showing {count} {count, plural, =1 {item} other {items}}, type to search",no_results:"No results",loading:"Loading..."}},vfg:{labels:{on:"On",off:"Off"}}},{t:W}=ue.createI18n("en-us",pe),ne={fieldIsRequired:W("validators.field_is_required"),invalidFormat:W("validators.invalid_format"),numberTooSmall:W("validators.number_too_small"),numberTooBig:W("validators.number_too_large"),invalidNumber:W("validators.invalid_number"),invalidInteger:W("validators.invalid_integer"),textTooSmall:W("validators.text_too_short"),textTooBig:W("validators.text_too_long"),thisNotText:W("validators.this_not_text"),thisNotArray:W("validators.this_not_array"),selectMinItems:W("validators.select_min_items"),selectMaxItems:W("validators.select_max_items"),invalidDate:W("validators.invalid_date"),dateIsEarly:W("validators.date_is_early"),dateIsLate:W("validators.date_is_late"),invalidEmail:W("validators.invalid_email"),invalidURL:W("validators.invalid_url"),invalidCard:W("validators.invalid_card"),invalidCardNumber:W("validators.invalid_card_number"),invalidTextContainNumber:W("validators.invalid_text_contain_number"),invalidTextContainSpec:W("validators.invalid_tex_contain_spec")},K=(e,...n)=>{if(e&&n.length>0)for(let o=0;o<n.length;o++)e=e.replace("{"+(o-1)+"}",String(n[o]||""));return e},be=(e,n,o=ne)=>G(e)||e===""?n?[K(o.fieldIsRequired)]:[]:null,Ye={required:(e,n,o,a=ne)=>be(e,n.required,a)||[],number:(e,n,o,a=ne)=>{let i=be(e,n.required,a);return i!=null||(i=[],ma(e)?(!G(n.min)&&e<n.min,(a=ne)&&i.push(K(a.numberTooSmall,n.min)),!G(n.max)&&e>n.max,(a=ne)&&i.push(K(a.numberTooBig,n.max))):i.push(K(a.invalidNumber))),i},integer:(e,n,o,a=ne)=>{let i=be(e,n.required,a);return i!=null||(i=[],i.concat(Ye.number(e,n,o,a)),yc(e)||i.push(K(a.invalidInteger))),i},double:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(!_n(e)||isNaN(e)?[K(a.invalidNumber)]:[])},string:(e,n,o,a=ne)=>{let i=be(e,n.required,a);return i!=null||(i=[],Ke(e)?(!G(n.min)&&e.length<n.min&&i.push(K(a.textTooSmall,e.length,n.min)),!G(n.max)&&e.length>n.max&&i.push(K(a.textTooBig,e.length,n.max))):i.push(K(a.thisNotText))),i},array:(e,n,o,a=ne)=>{if(n.required){if(!Array.isArray(e))return[K(a.thisNotArray)];if(e.length===0)return[K(a.fieldIsRequired)]}if(!G(e)){if(!G(n.min)&&e.length<n.min)return[K(a.selectMinItems,n.min)];if(!G(n.max)&&e.length>n.max)return[K(a.selectMaxItems,n.max)]}return[]},date:(e,n,o,a=ne)=>{let i=be(e,n.required,a);if(i!=null)return i;i=[];const r=new Date(e);if(isNaN(r.getDate()))return[K(a.invalidDate)];if(!G(n.min)){const s=new Date(n.min);r.valueOf()<s.valueOf()&&i.push(K(a.dateIsEarly,et.format(r),et.format(s)))}if(!G(n.max)){const s=new Date(n.max);r.valueOf()>s.valueOf()&&i.push(K(a.dateIsLate,et.format(r),et.format(s)))}return i},regexp:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(!G(n.pattern)&&!new RegExp(n.pattern).test(e)?[K(a.invalidFormat)]:[])},email:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)?[]:[K(a.invalidEmail)])},url:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e)?[]:[K(a.invalidURL)])},creditCard:(e,n,o,a=ne)=>{const i=be(e,n.required,a);if(i!=null)return i;const r=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,s=e.replace(/[^0-9]+/g,"");if(!r.test(s))return[K(a.invalidCard)];let l=0,c,m,f;for(let h=s.length-1;h>=0;h--)c=s.substring(h,h+1),m=parseInt(c,10),f?(m*=2,m>=10?l+=m%10+1:l+=m):l+=m,f=!f;return l%10===0&&s?[]:[K(a.invalidCardNumber)]},alpha:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z]*$/.test(e)?[]:[K(a.invalidTextContainNumber)])},alphaNumeric:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z0-9]*$/.test(e)?[]:[K(a.invalidTextContainSpec)])}};Object.keys(Ye).forEach(e=>{const n=Ye[e];x(n)&&(n.locale=o=>(a,i,r)=>n(a,i,r,uc(o,ne)))});function fa(e){return Ke(e)?Ye[e]!=null?Ye[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function En(e,n,o){let a=P(o.context,"schema.attributes",{});const i=n.value||"input";Ke(i)&&(a=P(a,i)||a),ie(a,(r,s)=>{e.setAttribute(s,r)})}const Te={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:En,updated:En,componentUpdated:En}},computed:{value:{cache:!1,get(){let e;return x(P(this.schema,"get"))?e=this.schema.get(this.model):e=P(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),x(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=P(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const i=[];Array.isArray(this.schema.validator)?ie(this.schema.validator,r=>{i.push(fa(r).bind(this))}):i.push(fa(this.schema.validator).bind(this)),ie(i,r=>{if(n)o.push(r(this.value,this.schema,this.model));else{const s=r(this.value,this.schema,this.model);s&&x(s.then)?s.then(l=>{l&&(this.errors=this.errors.concat(l));const c=this.errors.length===0;this.$emit("validated",c,this.errors,this)}):s&&(o=o.concat(s))}})}const a=i=>{let r=[];ie(Go(i),l=>{Array.isArray(l)&&l.length>0?r=r.concat(l):Ke(l)&&r.push(l)}),x(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,r,this.schema);const s=r.length===0;return e||this.$emit("validated",s,r,this),this.errors=r,r};return n?Promise.all(o).then(a):a(o)},debouncedValidate(){x(this.debouncedValidateFunc)||(this.debouncedValidateFunc=Qe(this.validate.bind(this),P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;x(this.schema.set)?(this.schema.set(this.model,e),o=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),o=!0),o&&(this.$emit("modelUpdated",e,this.schema.model),x(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),P(this.formOptions,"validateAfterChanged",!1)===!0&&(P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,n){let o=e.replace(/\[(\w+)\]/g,".$1");o=o.replace(/^\./,"");let a=this.model;const i=o.split(".");let r=0;const s=i.length;for(;r<s;){const l=i[r];if(r<s-1)a[l]!==void 0||(a[l]={}),a=a[l];else{a[l]=n;return}++r}},getFieldID(e,n=!1){const o=P(this.formOptions,"fieldIdPrefix","");return gn(e,o)+(n?"-"+Wo():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return P(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},_c=Object.freeze(Object.defineProperty({__proto__:null,default:Te},Symbol.toStringTag,{value:"Module"})),$=(e,n)=>{const o=e.__vccOpts||e;for(const[a,i]of n)o[a]=i;return o},Ec={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Tc={class:"material-icons"},Cc=$(Object.assign({mixins:[Te],emits:["model-updated"],expose:["validate","clearValidationErrors","schema"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldAdvanced",setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",Ec,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:o[0]||(o[0]=(...a)=>n.handleOpen&&n.handleOpen(...a))},[t.createElementVNode("i",Tc,t.toDisplayString(n.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(n.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",n.openClass])},[t.createVNode(Y,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])],2)]))}}),[["__scopeId","data-v-e8f66c8a"]]),Sc={class:"array-card-container"},ha=$(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null},index:{type:Number,default:void 0}},emits:["remove-item"],setup(e){const n=e;return t.provide("vfg-array-item-index",n.index),(o,a)=>{const i=t.resolveComponent("KCard"),r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Sc,[t.createVNode(i,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(r,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=s=>o.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.TrashIcon))]),_:1})])}}}),[["__scopeId","data-v-97302224"]]),wc={class:"array-item-wrapper"},kc={class:"array-item"},Ac={class:"array-item-after"},pa=$(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",wc,[t.createElementVNode("div",kc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.TrashIcon))]),_:1})]),t.createElementVNode("div",Ac,[t.renderSlot(n.$slots,"after",{},void 0,!0)])])}}}),[["__scopeId","data-v-51d79db2"]]),Mc={class:"multi-item-wrapper"},ga=$(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Mc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[...o[1]||(o[1]=[t.createTextVNode(" - Remove Field ",-1)])]),_:1}),o[2]||(o[2]=t.createElementVNode("hr",null,null,-1))])}}}),[["__scopeId","data-v-b4fcf731"]]),Nc="#6c7489",Ic="12px",Oc="20px";var Vc=4;function ya(e){return bt(e,Vc)}const Bc=["data-testid","data-testlabel"],Fc={class:"item-label"},Rc={class:"autosuggest__results_message"},Dc=$(t.defineComponent({__name:"AutoSuggest",props:t.mergeModels({placeholder:{default:""},suggestions:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyMessage:{default:""},domId:{},error:{}},{id:{required:!0},idModifiers:{}}),emits:t.mergeModels(["change","query-change"],["update:id"]),setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.useModel(e,"id");return(a,i)=>{const r=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(r,{id:e.domId,ref:"suggestion",modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=s=>o.value=s),clearable:"",disabled:e.disabled,"enable-filtering":"",error:e.error!==null,"filter-function":()=>!0,help:e.error!==null?e.error:void 0,items:e.suggestions,loading:e.loading,placeholder:e.placeholder,width:"100%",onChange:i[1]||(i[1]=s=>a.$emit("change",s)),onQueryChange:i[2]||(i[2]=s=>a.$emit("query-change",s))},t.createSlots({"item-template":t.withCtx(({item:s})=>[t.renderSlot(a.$slots,"item",{item:s},()=>[t.createElementVNode("span",{class:"item-label","data-testid":s.id&&`${s.id}-0`,"data-testlabel":s.label},t.toDisplayString(s.label),9,Bc)],!0)]),"selected-item-template":t.withCtx(({item:s})=>[t.renderSlot(a.$slots,"selected-item",{item:s},()=>[t.createElementVNode("span",Fc,t.toDisplayString(s.label),1)],!0)]),empty:t.withCtx(()=>[t.createElementVNode("div",Rc,[t.createElementVNode("span",null,t.toDisplayString(e.emptyMessage||t.unref(n)("fields.auto_suggest.no_results")),1)])]),_:2},[a.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(a.$slots,"before",{},void 0,!0)]),key:"0"}:void 0]),1032,["id","modelValue","disabled","error","help","items","loading","placeholder"])}}}),[["__scopeId","data-v-9f6760b4"]]),Lc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Tn=e=>e?e.length===36&&new RegExp(`^${Lc}$`).test(e):!1,Uc=e=>({...e,label:e.name,value:e.id});function ba(e,n,o){return o?_e.SET_REFERRAL_VALUE:e&&!n||!e&&n?_e.UPDATE_ENTITY:e&&n?_e.CREATE_FROM_ENTITY:_e.CREATE_NOT_FROM_ENTITY}const Pc=500,$c=50,xc=t.defineComponent({__name:"FieldScopedEntitySelect",props:{transformItem:{type:Function,default:Uc},allowUuidSearch:{type:Boolean,default:!1},placeholder:{},fields:{default:()=>[]},selectedItem:{},selectedItemLoading:{type:Boolean},initialItemSelected:{type:Boolean},domId:{},id:{},entity:{},disabled:{type:Boolean},fieldDisabled:{type:Boolean},error:{},getAll:{type:Function},getPartial:{type:Function},getOne:{type:Function}},emits:["change"],setup(e){const n=t.ref(""),o=t.ref(!1),a=t.ref(!1),i=t.ref(""),r=t.ref([]),s=t.ref([]),l=t.ref([]),{t:c}=ue.createI18n("en-us",pe),m=t.ref(null);let f=null;const h=async(y,g)=>{if(!e.fieldDisabled){clearTimeout(f),f=setTimeout(()=>{o.value=!0},1500);try{const p=await y();s.value=p,r.value=s.value.map(e.transformItem)}catch(p){if(g!=null&&g.aborted)return;if(r.value=[],ei.isAxiosError(p)&&p.status===404){console.warn("unable to search with UUID",i.value,"for entity type",e.entity);return}n.value=p.message}finally{clearTimeout(f),o.value=!1}}},b=Qe(y=>{if(y=y||"",i.value=y,!y.trim()&&!a.value){r.value=N(l.value);return}m.value&&m.value.abort();const g=new AbortController;if(m.value=g,a.value){w(y);return}C(y,g)},Pc,{leading:!0}),A=async(y,g)=>await e.getAll(y,g),F=async()=>{const{data:{data:y,next:g,offset:p}}=await e.getPartial($c);return(!g||!p)&&(a.value=!0),s.value=y,l.value=y.map(V=>({...e.transformItem(V),group:c("fields.auto_suggest.recently_created",{entity:e.entity})})),y},u=async y=>[await e.getOne(y)],C=(y,g)=>{Tn(y)&&e.allowUuidSearch?h(async()=>await u(y)):h(async()=>await A(y,g.signal),g.signal)},S=y=>{let g=[];g=N(l.value),y!=null&&y.trim()?r.value=g.filter(p=>e.fields.some(V=>(p[V]||"").includes(y))):r.value=g},N=y=>e.selectedItem?y.some(g=>g.value===e.selectedItem.value)?y:[e.selectedItem,...y]:y,_=y=>{r.value=l.value.filter(g=>g.id===y)},w=y=>{Tn(y)&&e.allowUuidSearch?_(y):S(y)};return t.onMounted(async()=>{await h(F);const y=t.watch(()=>e.selectedItem,g=>{g&&(r.value=N(l.value)),y()});r.value=N(l.value)}),(y,g)=>(t.openBlock(),t.createBlock(Dc,{id:e.id,disabled:e.fieldDisabled,"dom-id":e.domId,"empty-message":n.value,error:e.error,loading:e.selectedItemLoading||o.value,placeholder:e.placeholder,readonly:e.disabled,suggestions:r.value,onChange:g[0]||(g[0]=p=>y.$emit("change",p)),onQueryChange:t.unref(b)},t.createSlots({"selected-item":t.withCtx(({item:p})=>[t.renderSlot(y.$slots,"selected-item",{item:p})]),item:t.withCtx(({item:p})=>[t.renderSlot(y.$slots,"item",{item:p})]),_:2},[y.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"before")]),key:"0"}:void 0]),1032,["id","disabled","dom-id","empty-message","error","loading","placeholder","readonly","suggestions","onQueryChange"]))}}),vc=1e3,jc={components:{FieldScopedEntitySelect:xc,SearchIcon:Se.SearchIcon},mixins:[Te],inject:[re],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e,KUI_ICON_SIZE_40:Oc,KUI_COLOR_TEXT_NEUTRAL:Nc,EMPTY_VALUE_PLACEHOLDER:ao}},data(){return{suggestions:[],idValue:"",message:"Type something to search",error:null,items:[],initialItem:null,selectedItem:null,loading:!1,dataDrained:!1}},computed:{fieldState(){return ba(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search},inputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},allowUuidSearch(){return this.inputFields.includes("id")},inputFieldsWithoutId(){return this.inputFields.filter(e=>e!=="id")},initialValueSelected(){var e;return this.idValue===((e=this.initialItem)==null?void 0:e.id)}},async created(){await this.$nextTick();let e,n;this.error=null;try{switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[re]){console.warn("[@kong-ui-public/forms] No API service provided");break}this.loading=!0,n=await this.getOne(this.model[this.schema.model]),e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}e&&(this.initialItem=this.transformItem(e),this.selectedItem=this.initialItem)}catch(o){this.message=this.t("fields.auto_suggest.error.load_entity",{entity:this.schema.entity}),this.error=o.message||this.message,console.error("err!",o)}finally{this.loading=!1}},methods:{getPartial(e){return this[re].peek(this.entity,e)},async getAll(e,n){return await this.fetchSuggestions(e,"name",n)},async getOne(e){if(!this[re])return console.warn("[@kong-ui-public/forms] No API service provided"),{};const n=await this[re].getOne(this.entity,e,{validateStatus:o=>o>=200&&o<300||o===404});if(n.status===404)throw new Error(`Entity of type ${this.entity} with id ${e} not found`);return n.data},transformItem(e){return{...e,label:this.getSuggestionLabel(e),value:e.id}},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e,n){if(!this[re])return console.warn("[@kong-ui-public/forms] No API service provided"),[];const o=this[re].getAllV2,{data:a}=await o(this.entity,{size:vc,...e},n);return a.data},async fetchSuggestions(e,n,o){return this.fetchUntilLimit({[n]:e},o)},getSuggestionLabel(e){var o;const n=((o=this.schema)==null?void 0:o.labelField)||"id";return n&&e?e[n]:""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.error=null,this.idValue=e&&e.id,this.selectedItem=e,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},qc={class:"entity-suggestion-item"},zc={class:"entity-label"},Kc={class:"entity-id"},Hc={class:"selected-entity-item"},Yc={class:"selected-entity-label"};function Gc(e,n,o,a,i,r){const s=t.resolveComponent("SearchIcon"),l=t.resolveComponent("FieldScopedEntitySelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:e.schema.disabledTooltip},{default:t.withCtx(()=>[t.createVNode(l,{id:i.idValue,"allow-uuid-search":r.allowUuidSearch,disabled:i.loading,"dom-id":e.schema.model,entity:r.entity,error:i.error,"field-disabled":e.schema.disabled,fields:r.inputFieldsWithoutId,"get-all":r.getAll,"get-one":r.getOne,"get-partial":r.getPartial,"initial-item-selected":r.initialValueSelected,placeholder:i.loading?a.t("fields.auto_suggest.loading"):e.schema.placeholder,"selected-item":i.selectedItem,"selected-item-loading":i.loading,"transform-item":r.transformItem,onChange:r.onSelected},{before:t.withCtx(()=>[t.createVNode(s,{color:a.KUI_COLOR_TEXT_NEUTRAL,size:a.KUI_ICON_SIZE_40},null,8,["color","size"])]),item:t.withCtx(({item:c})=>[t.createElementVNode("div",qc,[t.createElementVNode("span",zc,t.toDisplayString(c.label??a.EMPTY_VALUE_PLACEHOLDER),1),t.createElementVNode("span",Kc,t.toDisplayString(c.id),1)])]),"selected-item":t.withCtx(({item:c})=>[t.createElementVNode("span",Hc,[t.createElementVNode("span",Yc,t.toDisplayString(c.label??c.id),1)])]),_:1},8,["id","allow-uuid-search","disabled","dom-id","entity","error","field-disabled","fields","get-all","get-one","get-partial","initial-item-selected","placeholder","selected-item","selected-item-loading","transform-item","onChange"])]),_:1},8,["text"])}const _a=$(jc,[["render",Gc],["__scopeId","data-v-6fe8b574"]]),Cn=50,Wc={mixins:[Te],inject:[re],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return ba(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},async created(){await this.$nextTick();let e,n;switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[re]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[re].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(o){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",o)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=Qe(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],a=this.getInputFields(),i=new Set;Tn(e)&&a.includes("id")?o.push((async()=>{const r=await this.fetchExact(e);n.push({...r,label:this.getSuggestionLabel(r),value:r.id})})()):o.push(...a.filter(r=>r!=="id").map(async r=>{(await this.fetchSuggestions(e,r)).forEach(l=>{i.has(l.id)||(i.add(l.id),n.push({...l,label:this.getSuggestionLabel(l),value:l.id}))})})),await Promise.all(o),this.items=n,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e){const n=[];let o=null;if(!this[re])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<Cn;){const a=await this[re].getAll(this.entity,{size:Cn,offset:o,...e});if(n.push(...a.data.data),o=a.data.offset,!o)break}return n.slice(0,Cn)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[re]?(await this[re].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},getSuggestionLabel(e){const n=this.getInputFields();return n.length&&e?n.map(o=>e[o]).filter(Boolean).join(" - "):""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Zc=["data-testid","data-testlabel"],Xc=["data-testid"],Jc={class:"autosuggest__results_message"};function Qc(e,n,o,a,i,r){const s=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:a.t("general.disable_source_scope_change",{scope:r.scope})},{default:t.withCtx(()=>[t.createVNode(s,{id:e.schema.model,ref:"suggestion",modelValue:i.idValue,"onUpdate:modelValue":n[0]||(n[0]=l=>i.idValue=l),clearable:"",disabled:e.schema.disabled,"enable-filtering":"","filter-function":()=>!0,items:i.items,loading:i.loading,placeholder:e.schema.placeholder,width:"100%",onChange:r.onSelected,onQueryChange:r.onQueryChange},{"item-template":t.withCtx(({item:l})=>[t.createElementVNode("span",{class:"first-part","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(r.getSuggestionLabel(l).split(" - ")[0]),9,Zc),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.getSuggestionLabel(l).split(" - ").slice(1),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m,class:"field-span","data-testid":l.id&&`${l.id}-${m+1}`||m+1},t.toDisplayString(c),9,Xc))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",Jc,[t.createElementVNode("span",null,t.toDisplayString(i.message),1)])]),_:1},8,["id","modelValue","disabled","items","loading","placeholder","onChange","onQueryChange"])]),_:1},8,["text"])}const Ea=$(Wc,[["render",Qc],["__scopeId","data-v-8cfdc7f6"]]);function em(e){const n=t.ref([]),o=t.ref(null),a=u=>Ke(u)?Ye[u]!=null?Ye[u]:(console.warn(`'${u}' is not a validator function!`),null):u,i=t.computed({get(){var C,S;let u;return x(P(e.schema,"get"))?u=e.schema.get((C=e.model)==null?void 0:C.value):u=P((S=e.model)==null?void 0:S.value,e.schema.model),A(u)},set(u){const C=i;u=F(u),x(u)?u(u,C):l(u,C)}}),r=u=>{var _;c();const C=P(e.formOptions,"validateAsync",!1);let S=[];if(e.schema.readonly!==!0&&e.disabled!==!0){const w=[],y=(_=e.schema)==null?void 0:_.validator;y&&(Array.isArray(y)?ie(y,g=>{w.push(a(g))}):w.push(a(y))),x(e.externalValidator)&&w.push(e.externalValidator),ie(w,g=>{var p,V;if(C)S.push(g(i.value,e.schema,(p=e.model)==null?void 0:p.value));else{const v=g(i.value,e.schema,(V=e.model)==null?void 0:V.value);v&&x(v.then)?v.then(M=>{M&&(n.value=n.value.concat(M));const T=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:T,errors:n.value,field:e.schema})}):v&&(S=S.concat(v))}})}const N=w=>{var g,p;let y=[];if(ie(Go(w),V=>{Array.isArray(V)&&V.length>0?y=y.concat(V):Ke(V)&&y.push(V)}),x((g=e.schema)==null?void 0:g.onValidated)&&e.schema.onValidated((p=e.model)==null?void 0:p.value,y,e.schema),!u){const V=y.length===0;e.emitValidated&&e.emitValidated({isValid:V,errors:y,field:e.schema})}return w=y,y};return C?Promise.all(S).then(N):N(S)},s=()=>{x(o.value)?o.value():o.value=Qe(r,P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",500)))},l=(u,C)=>{var N,_,w;let S=!1;x(e.schema.set)?(e.schema.set((N=e.model)==null?void 0:N.value,u),S=!0):e.schema.model&&(m(e.schema.model,u),S=!0),S&&(e.emitModelUpdated&&((_=e.model)!=null&&_.value)&&e.emitModelUpdated({value:u,model:e.schema.model}),x(e.schema.onChanged)&&e.schema.onChanged((w=e.model)==null?void 0:w.value,u,C,e.schema),P(e.formOptions,"validateAfterChanged",!1)===!0&&(P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",0))>0?s():r()))},c=()=>{n.value.splice(0)},m=(u,C)=>{var g;let S=u.replace(/\[(\w+)\]/g,".$1");S=S.replace(/^\./,"");let N=((g=e.model)==null?void 0:g.value)||{},_=0;const w=S.split("."),y=w.length;for(;_<y;){const p=w[_];if(_<y-1)N[p]!==void 0||(N[p]={}),N=N[p];else{N[p]=C;return}++_}},f=(u,C=!1)=>{const S=P(e.formOptions,"fieldIdPrefix","");return gn(u,S)+(C?"-"+Wo():"")},h=u=>`${f(u)}-label`,b=()=>P(e.schema,"fieldClasses",[]),A=u=>e.formatValueToField&&typeof e.formatValueToField=="function"?e.formatValueToField(u):u,F=u=>e.formatValueToModel&&typeof e.formatValueToModel=="function"?e.formatValueToModel(u):u;return{value:i,clearValidationErrors:c,getFieldID:f,getLabelId:h,getFieldClasses:b,updateModelValue:l}}function tm(e){const n=[],o=a=>{const i=["cluster-cache","cluster_cache"];for(const r of i)if(a.model.includes(r))return!1;return new RegExp("(?<=-redis-).*").test(a.model)};return e.fields.forEach(a=>{o(a)&&n.push(a)}),{redis:{id:"_redis",fields:n,model:"__redis_partial",redisType:e._supported_redis_partial_type,redisPath:e._redis_partial_path},redisModels:n.map(a=>a.model)}}function nm(e,n){const o=new RegExp("(?<=config-redis-).*"),a=/Config\.Redis.*/;return n.filter(r=>{const s=r.model.match(o);return s&&!Object.keys(e).includes(s[0])}).map(r=>{const s=r.label.match(a);return{label:s?s[0]:r.label,key:r.model,value:"N/A",type:"text"}})}const Ce={useAbstractFields:em,useRedisPartial:tm,useRedisNonStandardFields:nm},om={class:"form-field-wrapper"},Ta=$(t.defineComponent({__name:"FieldInput",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),s=t.inject(he,void 0),{updateModelValue:l,getFieldID:c,clearValidationErrors:m,value:f}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:_=>{i("modelUpdated",_.value,_.model)}});n({clearValidationErrors:m});const h=t.computed(()=>{var w,y;const _=(w=a.schema)==null?void 0:w.inputType.toLowerCase();if(_==="number"&&((y=a.schema)==null?void 0:y.referenceable)===!0)return"text";switch(_){case"string":return"text";case"datetime":return"datetime-local";default:return _||"text"}}),b={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},A=(_,w)=>{var V,v;let y=_;const g=b[h.value]||"",p=et.parse(_,g);p&&((V=a.schema)!=null&&V.format?y=et.format(p,(v=a.schema)==null?void 0:v.format):y=p.valueOf()),l(y,w)},F=(_,w)=>{_n(_)||(_=NaN),l(_,w)},u=_=>{let w=_;switch(a.schema.inputType){case"number":case"range":ma(parseFloat(_))&&(w=parseFloat(_));break}f.value=w,l(w,_)},C=_=>{f.value=_,l(_,_)},S=t.ref(null),N=()=>{var _;x(S.value)&&((_=S.value)==null||_.flush())};return t.onMounted(()=>{switch(h.value){case"number":case"range":S.value=Qe((_,w)=>{F(_,w)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":S.value=Qe((_,w)=>{A(_,w)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{h.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):h.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):h.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(_,w)=>{const y=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",om,[t.createVNode(y,t.mergeProps(_.$attrs,{id:t.unref(c)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:h.value==="color"||h.value==="range"?t.unref(f):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(f),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,"show-password-mask-toggle":h.value==="password",type:h.value,width:e.schema.width,onBlur:N,"onUpdate:modelValue":u}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","show-password-mask-toggle","type","width"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(s)),{schema:e.schema,update:C,value:t.unref(f)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-899b626c"]]),am={name:"FieldMetric",components:{AddIcon:Se.AddIcon,TrashIcon:Se.TrashIcon},mixins:[Te],emits:["remove-item"],data(){return{contentVisible:!1}}},im={key:0,class:"content"};function rm(e,n,o,a,i,r){const s=t.resolveComponent("AddIcon"),l=t.resolveComponent("TrashIcon"),c=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:i.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=m=>i.contentVisible=!i.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(s,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[i.contentVisible?(t.openBlock(),t.createElementBlock("div",im,[t.renderSlot(e.$slots,"default"),t.createVNode(c,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=m=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(l)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const Ca=$(am,[["render",rm]]),lm={class:"field-object-container"},sm={key:1},dm=["id"],cm={key:0},mm=["onUpdate:modelValue"],um={key:1},fm=["onUpdate:modelValue"],hm={key:2},pm=["onUpdate:modelValue"],gm=["onClick"],Sa=$(Object.assign({mixins:[Te],emits:["modelUpdated"],expose:["validate","clearValidationErrors","schema"],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const e=Object.keys(this.value),n={};for(let o=0;o<e.length;o++){const a=e[o];n[a]=typeof this.value[a]}this.keyTypes=n},methods:{removeElement(e){const n=this.value;delete n[e],this.value=JSON.parse(JSON.stringify(n));const o=this.keyTypes;delete o[e],this.keyTypes=JSON.parse(JSON.stringify(o))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""},updateModel(e,n){this.$emit("modelUpdated",e,n)}}},{__name:"FieldObject",setup(e){return(n,o)=>{const a=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",lm,[n.schema.schema?(t.openBlock(),t.createBlock(Y,{key:0,model:n.value,options:n.formOptions,schema:n.schema.schema,onModelUpdated:n.updateModel},null,8,["model","options","schema","onModelUpdated"])):(t.openBlock(),t.createElementBlock("div",sm,[t.createElementVNode("table",{id:n.getFieldID(n.schema),class:t.normalizeClass(n.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("tr",{key:r},[t.createElementVNode("td",null,t.toDisplayString(r),1),n.keyTypes[r]==="string"?(t.openBlock(),t.createElementBlock("td",cm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,type:"text"},null,8,mm),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="boolean"?(t.openBlock(),t.createElementBlock("td",um,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,type:"checkbox"},null,8,fm),[[t.vModelCheckbox,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="number"?(t.openBlock(),t.createElementBlock("td",hm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,type:"number"},null,8,pm),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:s=>n.removeElement(r)},null,8,gm)])]))),128))],10,dm),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyType=i)},[...o[3]||(o[3]=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)])],512),[[t.vModelSelect,n.newKeyType]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=i=>n.newKeyName=i),type:"text"},null,512),[[t.vModelText,n.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:o[2]||(o[2]=(...i)=>n.addKey&&n.addKey(...i))})]))])),[[a,n.attributes]])}}}),[["__scopeId","data-v-6eddb0ed"]]),ym=["id"],bm=["data-testid"],_m={class:"item-wrapper"},Em={class:"index-wrapper"},Tm={key:0},Cm={key:1},Sm=["onUpdate:modelValue","placeholder","type","onInput"],wm={key:0,class:"hint"},km={class:"input-item"},Am=["placeholder"],Mm={key:0,class:"hint"},wa=$(Object.assign({mixins:[Te],inject:{autofillSlot:{from:he,default:void 0}},emits:["model-updated"],expose:["validate","clearValidationErrors","schema"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(e,n)=>({[this.schema.model]:e[n]}),set:(e,n,o)=>e[n]=o[this.schema.model]}):this.model[this.schema.model]},valueInputType(){var e;return["number","integer"].includes((e=this.schema.values)==null?void 0:e.type)?"number":"text"}},mounted(){this.value||(this.value={});let e=[];this.subSchema?e=this.subSchema.fields:this.subFields&&(e=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,e,this.schema.model)},methods:{removeElement(e){const n=this.value;delete n[e],this.value={...n}},transformMapModelValuesToObject(e,n,o){let a={};try{a=JSON.parse(JSON.stringify(e??{}))[o]??{}}catch{}return Object.keys(e).map(i=>{const r=i.indexOf(o+"-");if(r>-1&&Array.isArray(n))if(n.length>0){const l=i.split("-").filter(m=>n.find(f=>f.model===m)),c=i.split(`-${l}`)[0].split(`${o}-`)[1];l.length?a[c]={...a[c],[l]:e[i]}:a[i.substring(r+`${o}-`.length)]=e[i]}else a[i.substring(`${o}-`.length)]=e[i];else{const l=i.split("-").filter(m=>m===this.schema.model),c=i.split(`-${l}`)[0].split(`${o}-`)[1];c&&(a[c]=e[i])}return i}),a},addKey(){var a;const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=((a=this.schema.values)==null?void 0:a.default)??(this.valueInputType==="number"?0:""),o=this.subSchema?e?[""]:{}:n;this.value[this.newKeyName]=o,this.newKeyName=""},updateModel(e,n){this.$emit("model-updated",this.model[this.schema.model],n)}}},{__name:"FieldObjectAdvanced",setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{id:n.getFieldID(n.schema),class:t.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,"data-testid":`field-object-key-${r}`},[t.createElementVNode("div",null,[t.createElementVNode("div",_m,[t.createElementVNode("div",Em,[t.createElementVNode("strong",null,t.toDisplayString(r),1),t.createElementVNode("div",null,[t.createVNode(a,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:s=>n.removeElement(r)},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.TrashIcon))]),_:1},8,["onClick"])])]),o[1]||(o[1]=t.createElementVNode("hr",{class:"divider"},null,-1)),n.subSchema?(t.openBlock(),t.createElementBlock("div",Tm,[t.createVNode(Y,{model:n.transformedModel[r],options:{helpAsHtml:!0},schema:n.subSchema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",Cm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:n.valueInputType,onInput:s=>n.updateModel(n.value[r],n.model[n.schema.model])},null,40,Sm),[[t.vModelDynamic,n.value[r]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",wm,t.toDisplayString(n.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.autofillSlot),{schema:n.schema.fields&&n.schema.fields[0].schema||n.schema.values,update:s=>n.value[r]=s,value:n.value[r]},null,8,["schema","update","value"]))])),o[2]||(o[2]=t.createElementVNode("hr",{class:"wide-divider"},null,-1))])])],8,bm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:n.hasObjectKeys}])},[t.createElementVNode("div",km,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyName=i),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Am),[[t.vModelText,n.newKeyName]]),t.createVNode(a,{appearance:"tertiary","data-testid":"add-key",disabled:!n.newKeyName,onClick:n.addKey},{default:t.withCtx(()=>[t.createTextVNode(" + Add "+t.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(t.openBlock(),t.createElementBlock("p",Mm,t.toDisplayString(n.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,ym)}}}),[["__scopeId","data-v-0faeec4d"]]),Nm={class:"radio-selection-group"},ka=$(t.defineComponent({__name:"FieldRadio",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{updateModelValue:s,value:l,clearValidationErrors:c}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:f=>{i("modelUpdated",f.value,f.model)}});n({clearValidationErrors:c});const m=f=>{let h=f;typeof f=="string"&&(h=f.split(","),a.schema.array||(h=h.toString())),s(h,f)};return(f,h)=>{const b=t.resolveComponent("KRadio");return t.openBlock(),t.createElementBlock("div",Nm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(A,F)=>(t.openBlock(),t.createBlock(b,{id:e.schema.name+"-"+F,key:A.value,modelValue:t.unref(l),"onUpdate:modelValue":h[0]||(h[0]=u=>t.isRef(l)?l.value=u:null),label:A.name,"label-attributes":{info:e.schema.help},name:e.schema.name,required:e.schema.required||void 0,"selected-value":A.value,onChange:m},null,8,["id","modelValue","label","label-attributes","name","required","selected-value"]))),128))])}}}),[["__scopeId","data-v-42b9c6ac"]]),Aa=t.defineComponent({__name:"FieldSelect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.computed(()=>a.schema.selectOptions||{}),s=u=>G(u)?null:u,l=t.toRefs(a),{getFieldID:c,clearValidationErrors:m,value:f}=Ce.useAbstractFields({model:l.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:s,emitModelUpdated:u=>{i("modelUpdated",u.value,u.model)}});n({clearValidationErrors:m});const h=t.computed(()=>{const u=a.schema.values;return b(typeof u=="function"?u.apply(this,[a.model,a.schema]):u)}),b=u=>{const C=[];return u.forEach(S=>{C.push({label:F(S),value:A(S),disabled:typeof S=="object"&&S.disabled||void 0,group:typeof S=="object"&&String(S.group||"").toUpperCase()||void 0})}),C},A=u=>{if(fe(u)){if(r.value&&typeof r.value.value<"u")return u[r.value.value];if(typeof u.id<"u")return String(u.id);throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return u},F=u=>{if(fe(u)){if(r.value&&typeof r.value.name<"u")return u[r.value.name];if(typeof u.name<"u")return String(u.name);throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return String(u)};return(u,C)=>{const S=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(S,{id:t.unref(c)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":C[0]||(C[0]=N=>t.isRef(f)?f.value=N:null),class:t.normalizeClass(e.schema.fieldClasses),clearable:!e.schema.required,disabled:e.disabled||void 0,items:h.value,"kpop-attributes":{"data-testid":`${t.unref(c)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:r.value.hideNoneSelectedText?void 0:r.value.noneSelectedText||"Nothing Selected",required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","class","clearable","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),Im={name:"FieldArray",components:{FieldArrayItem:pa,FieldArrayMultiItem:ga,FieldSelect:Aa,FieldMetric:Ca,FieldObject:Sa,FieldObjectAdvanced:wa,FieldAutoSuggest:_a,FieldAutoSuggestLegacy:Ea,FieldRadio:ka,FieldArrayCardContainer:ha,FieldInput:Ta},mixins:[Te],inject:{autofillSlot:{from:he,default:void 0}},props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},emits:["refreshModel"],methods:{generateSchema(e,n,o){var i,r,s;let a;return n&&(a=JSON.parse(JSON.stringify(n)),(s=(r=(i=a.schema)==null?void 0:i.fields)==null?void 0:r.map)==null||s.call(r,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...a,set(l,c){e[o]=c},get(){return e[o]}}},newElement(){let e=this.value,n;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?n=this.schema.items.default():n=this.schema.items.default),e.push(n),this.value=[...e]},removeElement(e){this.value=this.value.filter((n,o)=>o!==e)},getFieldComponent(e){return e.component?e.component:"field-"+e.type},modelUpdated(){this.$emit("refreshModel")},handleInput(e,n){var a,i;let o=e;((i=(a=this.schema)==null?void 0:a.inputAttributes)==null?void 0:i.type)==="number"&&_n(parseFloat(e))&&(o=parseFloat(e)),this.value=this.value.map((r,s)=>s===n?o:r)}}},Om=["id"],Vm={key:1},Bm=["onUpdate:modelValue","aria-labelledby","type"],Fm=["onUpdate:modelValue","aria-labelledby"];function Rm(e,n,o,a,i,r){const s=t.resolveComponent("KTextArea"),l=t.resolveComponent("KInput"),c=t.resolveComponent("KButton");return e.schema?(t.openBlock(),t.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(m,f)=>(t.openBlock(),t.createElementBlock("div",{key:f,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,index:f,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onRemoveItem:h=>r.removeElement(f)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["index","model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Vm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${f}`,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onRemoveItem:h=>r.removeElement(f)},{after:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:h=>e.value[f]=h,value:e.value[f]},null,8,["schema","update","value"]))]),default:t.withCtx(()=>{var h;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,ref_for:!0},e.schema.inputAttributes,{id:e.getFieldID(e.schema),modelValue:e.value[f],"onUpdate:modelValue":b=>e.value[f]=b,"aria-labelledby":e.getLabelId(e.schema),autosize:"","character-limit":e.schema.inputAttributes.max,class:e.schema.fieldClasses,maxlength:e.schema.max,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","onUpdate:modelValue","aria-labelledby","character-limit","class","maxlength","minlength","name","placeholder","readonly","required","rows"])):!e.schema.inputAttributes||!e.schema.inputAttributes.type||e.schema.inputAttributes.type==="text"||e.schema.inputAttributes.type==="number"?(t.openBlock(),t.createBlock(l,t.mergeProps({key:1,"aria-labelledby":e.getLabelId(e.schema)},{ref_for:!0},e.schema.inputAttributes,{"model-value":e.value[f],type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text",onInput:b=>{r.handleInput(b,f)}}),null,16,["aria-labelledby","model-value","type","onInput"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":b=>e.value[f]=b,"aria-labelledby":e.getLabelId(e.schema)},{ref_for:!0},e.schema.inputAttributes,{type:((h=e.schema.inputAttributes)==null?void 0:h.type)||"text"}),null,16,Bm)),[[t.vModelDynamic,e.value[f]]])]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":h=>e.value[f]=h,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Fm),[[t.vModelText,e.value[f]]]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:h=>e.value[f]=h,value:e.value[f]},null,8,["schema","update","value"]))],64))],2))),128)),t.createVNode(c,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:r.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Om)):t.createCommentVNode("",!0)}const Dm=$(Im,[["render",Rm],["__scopeId","data-v-d6740b2b"]]),Lm={class:"form-field-wrapper field-checkbox"},Um=$(t.defineComponent({__name:"FieldCheckbox",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{getFieldID:s,value:l,clearValidationErrors:c}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:m=>{i("modelUpdated",m.value,m.model)}});return n({clearValidationErrors:c}),(m,f)=>{const h=t.resolveComponent("KCheckbox");return t.openBlock(),t.createElementBlock("div",Lm,[t.createVNode(h,t.mergeProps(m.$attrs,{id:t.unref(s)(e.schema),modelValue:t.unref(l),"onUpdate:modelValue":f[0]||(f[0]=b=>t.isRef(l)?l.value=b:null),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:void 0,name:e.schema.inputName,readonly:e.schema.readonly,required:e.schema.required,width:e.schema.width}),null,16,["id","modelValue","autocomplete","class","disabled","help","name","readonly","required","width"])])}}}),[["__scopeId","data-v-6b4ee1cd"]]),Pm={class:"wrapper"},$m=["disabled"],xm=["id","checked","disabled","onChange","name"],vm=["disabled"],jm={class:"info"},qm={class:"dropList"},zm=["id","checked","disabled","onChange","name"];function Km(e,n,o,a,i,r){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Pm,[e.schema.listBox?(t.openBlock(),t.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(l)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,l),name:r.getInputName(l)},null,40,xm),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)])],2))),256))],8,$m)):t.createCommentVNode("",!0),e.schema.listBox?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[t.createElementVNode("div",{class:t.normalizeClass(["mainRow",{expanded:i.comboExpanded}]),onClick:n[0]||(n[0]=(...l)=>r.onExpandCombo&&r.onExpandCombo(...l))},[t.createElementVNode("div",jm,t.toDisplayString(r.selectedCount)+" selected",1),n[1]||(n[1]=t.createElementVNode("div",{class:"arrow"},null,-1))],2),t.createElementVNode("div",qm,[i.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(l)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,l),name:r.getInputName(l)},null,40,zm),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,vm))])),[[s,"wrapper"]])}const Hm=$({mixins:[Te],data(){return{comboExpanded:!1}},computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(e){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?zo(this.schema.inputName+"_"+this.getItemValue(e)):zo(this.getItemValue(e))},getItemValue(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return e[this.schema.checklistOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},getItemName(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return e[this.schema.checklistOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},isItemChecked(e){return this.value&&this.value.indexOf(this.getItemValue(e))!==-1},onChanged(e,n){if((G(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=ya(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=ya(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Km]]),Ym={name:"FieldKeyValuePairs",components:{TrashIcon:Se.TrashIcon},mixins:[Te],inject:{autofillSlot:{from:he,default:void 0}},data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var n,o;this.value||(this.value={});const e=((o=this.model)==null?void 0:o[(n=this.schema)==null?void 0:n.model])??{};Object.keys(e).forEach(a=>{this.pairs.push({key:a,value:e[a]})})},methods:{onInput(e,n,o){this.pairs[n][o]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:n,value:o})=>({...e,...n&&o?{[n]:o}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},Gm={class:"key-value-pairs-editor"},Wm={class:"pair-item-cell"},Zm=["data-testid","placeholder","value","onInput"],Xm={class:"pair-item-cell"},Jm=["data-testid","placeholder","value","onInput"];function Qm(e,n,o,a,i,r){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Gm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pairs,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,class:"pair-item"},[t.createElementVNode("div",Wm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${m}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:c.key,onInput:f=>{r.onInput(f,m,"key")}},null,40,Zm),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>r.onInput({target:{value:f}},m,"key"),value:c.key},null,8,["schema","update","value"]))]),t.createElementVNode("div",Xm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${m}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:c.value,onInput:f=>{r.onInput(f,m,"value")}},null,40,Jm),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>r.onInput({target:{value:f}},m,"value"),value:c.value},null,8,["schema","update","value"]))]),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${m}`,onClick:()=>{r.removePair(m)}},{default:t.withCtx(()=>[t.createVNode(s)]),_:1},8,["data-testid","onClick"])]))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:r.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const eu=$(Ym,[["render",Qm],["__scopeId","data-v-9a9650ac"]]),tu=$(t.defineComponent({__name:"FieldLabel",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0}},setup(e){const n=e,o=t.toRefs(n),{getFieldID:a,value:i}=Ce.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(r,s)=>{const l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(l,{id:t.unref(a)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-d046a15a"]]),nu=t.defineComponent({__name:"FieldMultiselect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRef(a,"model"),{getLabelId:s,getFieldID:l,clearValidationErrors:c,value:m}=Ce.useAbstractFields({model:r,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:h=>{i("modelUpdated",h.value,h.model)}});n({clearValidationErrors:c});const f=t.computed(()=>{var h,b;return a.schema.values?a.schema.values:(b=(h=a.schema.elements)==null?void 0:h.one_of)!=null&&b.length?a.schema.elements.one_of.map(A=>({label:String(A),value:String(A)})):[]});return(h,b)=>{const A=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(A,{id:t.unref(l)(e.schema),modelValue:t.unref(m),"onUpdate:modelValue":b[0]||(b[0]=F=>t.isRef(m)?m.value=F:null),"aria-labelledby":t.unref(s)(e.schema),class:t.normalizeClass(e.schema.fieldClasses),"data-testid":"field-multiselect",disabled:e.disabled||void 0,items:f.value,"kpop-attributes":{"data-testid":`${t.unref(l)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:e.schema.placeholder,required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","aria-labelledby","class","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),ou={class:"selection-group"},au={class:"form-group horizontal-radios"},iu={class:"radio-group"},ru=["disabled","value"],lu={class:"control-help"},su={key:0,class:"option-field"},du={class:"option-field-container"},cu=$(Object.assign({mixins:[Te],emits:["model-updated"],expose:["validate","clearValidationErrors","schema"],data(){return{checkedGroup:null,fieldModel:{...this.model},renderedTrack:[],fieldSchema:[],scope:"scope"}},watch:{checkedGroup:{handler(e,n){if(this.renderedTrack[e]=!0,n===null){this.fieldModel={...this.model};return}const o=this.schema.fields[e].fields,a=this.schema.fields[n].fields;a&&a.forEach(i=>this.updateModel("",i.model)),o&&o.forEach(i=>this.updateModel(this.fieldModel[i.model],i.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{this.renderedTrack.push(!1),e.fields&&e.fields.forEach(o=>{var a;this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model),this.scope=(a=o.label)==null?void 0:a.toLowerCase())})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldSelectionGroup",setup(e){const{t:n}=ue.createI18n("en-us",pe);return(o,a)=>(t.openBlock(),t.createElementBlock("div",ou,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.$props.disabled?"k-tooltip":"div"),{"max-width":"300",text:t.unref(n)("general.disable_global_radio",{scope:o.scope})},{default:t.withCtx(()=>[t.createElementVNode("div",au,[t.createElementVNode("div",iu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["option-group",{"radio-disabled":o.$props.disabled}])},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${i.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=s=>o.checkedGroup=s),class:"k-input",disabled:o.$props.disabled,type:"radio",value:r},null,8,ru),[[t.vModelRadio,o.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(i.label)+" ",1),t.createElementVNode("div",lu,t.toDisplayString(i.description),1)],2)],2))),128))])])]),_:1},8,["text"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:"option-group"},[o.renderedTrack[r]?t.withDirectives((t.openBlock(),t.createElementBlock("div",su,[t.createElementVNode("div",du,[t.createVNode(Y,{model:o.model,options:{helpAsHtml:!0},schema:{fields:i.fields},onModelUpdated:o.updateModel},null,8,["model","schema","onModelUpdated"])])],512)),[[t.vShow,i.fields&&o.checkedGroup===r]]):t.createCommentVNode("",!0)]))),128))]))}}),[["__scopeId","data-v-a536356c"]]),mu={class:"form-field-wrapper"},uu=t.defineComponent({__name:"FieldSwitch",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,{t:r}=ue.createI18n("en-us",pe),s=b=>b!=null&&a.schema.valueOn?b===a.schema.valueOn:b,l=b=>b!=null&&a.schema.valueOn?b?a.schema.valueOn:a.schema.valueOff:b,c=t.toRefs(a),{getFieldID:m,value:f,clearValidationErrors:h}=Ce.useAbstractFields({model:c.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:s,formatValueToModel:l,emitModelUpdated:b=>{i("modelUpdated",b.value,b.model)}});return n({clearValidationErrors:h}),(b,A)=>{const F=t.resolveComponent("KInputSwitch");return t.openBlock(),t.createElementBlock("div",mu,[t.createVNode(F,{id:t.unref(m)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":A[0]||(A[0]=u=>t.isRef(f)?f.value=u:null),autocomplete:e.schema.autocomplete,class:t.normalizeClass(e.schema.fieldClasses),disabled:e.disabled||void 0,label:t.unref(f)?e.schema.textOn||t.unref(r)("vfg.labels.on"):e.schema.textOff||t.unref(r)("vfg.labels.off"),"label-attributes":{info:e.schema.help},name:e.schema.inputName,required:e.schema.required||void 0},null,8,["id","modelValue","autocomplete","class","disabled","label","label-attributes","name","required"])])}}}),fu={class:"field-textarea"},hu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:Cc,FieldArray:Dm,FieldArrayCardContainer:ha,FieldArrayItem:pa,FieldArrayMultiItem:ga,FieldAutoSuggest:_a,FieldAutoSuggestLegacy:Ea,FieldCheckbox:Um,FieldChecklist:Hm,FieldInput:Ta,FieldKeyValuePairs:eu,FieldLabel:tu,FieldMetric:Ca,FieldMultiselect:nu,FieldObject:Sa,FieldObjectAdvanced:wa,FieldRadio:ka,FieldSelect:Aa,FieldSelectionGroup:cu,FieldSwitch:uu,FieldTextArea:$(t.defineComponent({__name:"FieldTextArea",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),s=t.inject(he,void 0),{updateModelValue:l,getFieldID:c,clearValidationErrors:m,value:f}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:b=>{i("modelUpdated",b.value,b.model)}});n({clearValidationErrors:m});const h=b=>{f.value=b,l(b,b)};return(b,A)=>{const F=t.resolveComponent("KTextArea");return t.openBlock(),t.createElementBlock("div",fu,[t.createVNode(F,t.mergeProps(b.$attrs,{id:t.unref(c)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":A[0]||(A[0]=u=>t.isRef(f)?f.value=u:null),autosize:"","character-limit":e.schema.max??!1,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint||void 0,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","character-limit","class","disabled","help","minlength","name","placeholder","readonly","required","rows"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(s)),{schema:e.schema,update:h,value:t.unref(f)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-609c18d6"]])},Symbol.toStringTag,{value:"Module"})),mixins:[Ko],inject:{"vfg-array-item-index":{default:void 0}},props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated","refreshModel"],data(){return{child:t.ref()}},computed:{schema(){var n;if(!((n=this.field)!=null&&n.schema)||!Array.isArray(this.field.schema.fields))return this.field;const e=this["vfg-array-item-index"];return typeof e!="number"||Number.isNaN(e)?this.field:{...this.field,schema:{...this.field.schema,fields:this.field.schema.fields.map(o=>({...o,...o.id?{id:`${o.id}-${e}`}:void 0}))}}}},methods:{sanitize(e){return Il.sanitize(e)},fieldTypeHasLabel(e){if(G(e.label))return!1;let n="";switch(e.type==="input"?n=e.inputType:n=e.type,n){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const n=P(this.options,"fieldIdPrefix","");return gn(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldComponent(e){return e.component?e.component:"field-"+e.type},getButtonType(e){return P(e,"type","button")},onFieldValidated(e,n,o){this.$emit("validated",e,n,o)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,n,o){return e.onclick.call(this,this.model,n,o,this)},fieldHint(e){return x(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(n=>n.field.fieldName===e.fieldName).map(n=>n.error)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e){return this.$refs.child.validate(e)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(e){return e?e.replace(/^[cC]onfig\./,""):""}}},pu=["innerHTML"],gu={class:"icon-wrapper"},yu={key:0,class:"link-wrapper"},bu={class:"field-wrap"},_u={key:0,class:"buttons"},Eu=["type","onClick","textContent"],Tu={key:1,class:"hint"},Cu={key:2,class:"errors help-block"};function Su(e,n,o,a,i,r){const s=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[r.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?r.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:r.getFieldID(o.field),info:!o.options.helpAsHtml&&o.field.help?o.field.help:void 0,"tooltip-attributes":o.field.help?{maxWidth:"300",placement:"top",tooltipId:r.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",gu,[t.createElementVNode("span",null,t.toDisplayString(r.formattedLabel(o.field.label)),1)]),o.field.link?(t.openBlock(),t.createElementBlock("div",yu,[t.createVNode(s,{href:o.field.link},{default:t.withCtx(()=>[...n[0]||(n[0]=[t.createElementVNode("span",{class:"section-header"},"More info",-1)])]),_:1},8,["href"])])):t.createCommentVNode("",!0)]),_:2},[o.options.helpAsHtml&&o.field.help?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:r.sanitize(o.field.help)},null,8,pu)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",bu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&o.field.type==="input"?r.fieldHint(o.field):void 0,model:o.model,schema:r.schema,vfg:o.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onRefreshModel","onValidated"])),r.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",_u,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(c,m)=>(t.openBlock(),t.createElementBlock("button",{key:m,class:t.normalizeClass(c.classes),type:r.getButtonType(c),onClick:f=>r.buttonClickHandler(c,o.field,f),textContent:t.toDisplayString(c.label)},null,10,Eu))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&o.field.type!=="input"?(t.openBlock(),t.createElementBlock("div",Tu,t.toDisplayString(r.fieldHint(o.field)),1)):t.createCommentVNode("",!0),r.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",Cu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fieldErrors(o.field),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m},t.toDisplayString(c),1))),128))])):t.createCommentVNode("",!0)],2)}const Ma=$(hu,[["render",Su],["__scopeId","data-v-fe02085f"]]);var Et=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(Et||{});const wu=e=>{var n,o;return e.type===Et.REDIS_CE?"Host/Port":(n=e.config.sentinel_nodes)!=null&&n.length?"Sentinel":(o=e.config.cluster_nodes)!=null&&o.length?"Cluster":"Host/Port"},ku={[Et.REDIS_CE]:"open source",[Et.REDIS_EE]:"enterprise"},Na=e=>ku[e]??"",Au={class:"partial-config-card"},Mu={class:"config-card-row-label"},Nu={class:"label-text"},Iu=["data-testid"],Ou=["data-testid"],Vu={key:1},Bu=["data-testid"],Fu=["data-testid"],Ru=$(t.defineComponent({__name:"RedisConfigCard",props:{configFields:{type:Object,required:!0},pluginRedisFields:{type:Array,required:!0}},setup(e){const{t:n,formatUnixTimeStamp:o}=ue.createI18n("en-us",pe),a={id:{order:1},name:{order:1},type:{label:n("redis.config_card.common_fields.type_label"),hidden:!0,type:"hidden"},created_at:{label:n("redis.config_card.common_fields.created_at_label"),formatter:o,order:2},updated_at:{label:n("redis.config_card.common_fields.updated_at_label"),formatter:o,order:3}},i=e,r=h=>h!=null,s=(h,b)=>r(b)&&["password","sentinel_password"].includes(h)?"password":"text",{convertKeyToTitle:l}=kt.useStringHelpers(),c=t.computed(()=>Object.entries(i.configFields).map(([h,b])=>{var A,F,u,C;return{key:h,label:((A=a[h])==null?void 0:A.label)??l(h),value:(F=a[h])!=null&&F.formatter?a[h].formatter(b):b,type:((u=a[h])==null?void 0:u.type)??s(h,b),order:((C=a[h])==null?void 0:C.order)??100}}).sort((h,b)=>h.order-b.order).filter(h=>h.type!=="hidden")),m=Ce.useRedisNonStandardFields(i.configFields,i.pluginRedisFields),f=t.computed(()=>c.value.concat(m));return(h,b)=>{const A=t.resolveComponent("KCopy");return t.openBlock(),t.createElementBlock("div",Au,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,({key:F,label:u,value:C,type:S})=>(t.openBlock(),t.createElementBlock("div",{key:F,class:"partial-config-card-row"},[t.createElementVNode("div",Mu,[t.createElementVNode("div",Nu,t.toDisplayString(u),1)]),t.createElementVNode("div",{class:"config-card-row-value","data-testid":`${F}-property-value`},[r(C)?(t.openBlock(),t.createElementBlock("div",Vu,[S==="password"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${F}-copy-password`},[t.createVNode(A,{format:"redacted",text:String(C)},null,8,["text"])],8,Bu)):(t.openBlock(),t.createElementBlock("div",{key:1,"data-testid":`${F}-plain-text`},t.toDisplayString(C),9,Fu))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${F}-no-value`}," – ",8,Ou))],8,Iu)]))),128))])}}}),[["__scopeId","data-v-40b3d7b5"]]),Du={class:"redis-config-select","data-testid":"redis-config-select"},Lu={class:"selected-redis-config"},Uu=["data-testid"],Pu={class:"select-item-name","data-testid":"selected-redis-config"},$u={class:"empty-redis-config","data-testid":"empty-redis-config"},xu={key:1,class:"redis-shared-config-error-message","data-testid":"redis-config-fetch-error"},vu="1000",Ia=$(t.defineComponent({__name:"RedisConfigSelect",props:{defaultRedisConfigItem:{type:String,required:!1,default:""},updateRedisModel:{type:Function,required:!0},pluginRedisFields:{type:Array,required:!0},redisType:{type:String,default:"all"},isCustomPlugin:{type:Boolean,default:!1}},emits:["showNewPartialModal"],setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.inject(oo),a={konnect:{getOne:"/v2/control-planes/{controlPlaneId}/core-entities/partials/{id}",getAll:"/v2/control-planes/{controlPlaneId}/core-entities/partials"},kongManager:{getOne:"/{workspace}/partials/{id}",getAll:"/{workspace}/partials"}},i=e,r=t.ref(null),{getMessageFromError:s}=kt.useErrors(),l=t.inject(no),{debouncedQueryChange:c,loading:m,error:f,loadItems:h,results:b}=kt.useDebouncedFilter(l,a[l.app].getAll,vu,{fetchedItemsKey:"data",searchKeys:["id","name"]}),A=t.computed(()=>f.value?s(f.value):""),F=N=>{let _=`${l.apiBaseUrl}${a[l.app].getOne}`;return l.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,(l==null?void 0:l.controlPlaneId)||""):l.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,l!=null&&l.workspace?`/${l.workspace}`:"")),_=_.replace(/{id}/gi,String(N)),_},u=t.computed(()=>{const N=(b.value||[]).map(_=>({label:_.id,name:_.name,value:_.id,type:_.type,tag:wu(_)})).filter(_=>_.type==="redis-ce"||_.type==="redis-ee");return i.redisType!=="all"?N.filter(_=>_.type===i.redisType):N}),{axiosInstance:C}=kt.useAxios(l==null?void 0:l.axiosRequestConfig),S=async N=>{if(N){i.updateRedisModel(N);try{const _=await C.get(F(N));if(_.data.config){const w=Object.assign(_.data,_.data.config);delete w.config,r.value=w}}catch(_){console.error(_)}}};return t.watch(()=>o==null?void 0:o.value,async N=>{N&&await h()}),t.onBeforeMount(()=>{h(),i.defaultRedisConfigItem&&S(i.defaultRedisConfigItem)}),(N,_)=>{const w=t.resolveComponent("KLabel"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Du,[t.createVNode(w,{info:e.isCustomPlugin?t.unref(n)("redis.custom_plugin.tooltip"):t.unref(n)("redis.shared_configuration.tooltip",{type:t.unref(Na)(e.redisType)}),"tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("redis.shared_configuration.title")),1)]),_:1},8,["info"]),_[2]||(_[2]=t.createElementVNode("div",{class:"shared-redis-config-title"},null,-1)),t.createVNode(g,{class:"redis-config-select-trigger","data-testid":"redis-config-select-trigger","enable-filtering":"","filter-function":()=>!0,items:u.value,loading:t.unref(m),"model-value":e.defaultRedisConfigItem,placeholder:t.unref(n)("redis.shared_configuration.selector.placeholder"),onChange:_[1]||(_[1]=p=>S(p==null?void 0:p.value)),onQueryChange:t.unref(c)},{"selected-item-template":t.withCtx(({item:p})=>[t.createElementVNode("div",Lu,t.toDisplayString(p.name),1)]),"item-template":t.withCtx(({item:p})=>[t.createElementVNode("div",{class:"plugin-form-redis-configuration-dropdown-item","data-testid":`redis-configuration-dropdown-item-${p.name}`},[t.createElementVNode("span",Pu,t.toDisplayString(p.name),1),t.createVNode(y,{appearance:"info",class:"select-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p.tag),1)]),_:2},1024)],8,Uu)]),empty:t.withCtx(()=>[t.createElementVNode("div",$u,t.toDisplayString(t.unref(n)("redis.shared_configuration.empty_state")),1)]),"dropdown-footer-text":t.withCtx(()=>[t.createElementVNode("div",{class:"new-redis-config-area","data-testid":"new-redis-config-area",onClick:_[0]||(_[0]=p=>N.$emit("showNewPartialModal"))},[t.createVNode(t.unref(Se.AddIcon),{size:t.unref(Ic)},null,8,["size"]),t.createElementVNode("span",null,t.toDisplayString(t.unref(n)("redis.shared_configuration.create_new_configuration",{type:t.unref(Na)(e.redisType)})),1)])]),_:1},8,["items","loading","model-value","placeholder","onQueryChange"])]),r.value?(t.openBlock(),t.createBlock(Ru,{key:0,"config-fields":r.value,"plugin-redis-fields":e.pluginRedisFields},null,8,["config-fields","plugin-redis-fields"])):t.createCommentVNode("",!0),A.value?(t.openBlock(),t.createElementBlock("p",xu,t.toDisplayString(A.value||t.unref(n)("redis.shared_configuration.error")),1)):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-31a7151d"]]),ju={key:0},qu={class:"redis-config-radio-group","data-testid":"redis-config-radio-group"},zu={key:0,class:"shared-redis-config"},Ku={key:1,class:"dedicated-redis-config"},Hu={class:"dedicated-redis-config-title"},Yu={name:"VueFormGenerator",components:{formGroup:Ma,formRedis:$(t.defineComponent({__name:"FormRedis",props:{tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},model:{type:Object,default:()=>{}},options:{type:Object,required:!0},field:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default(){return[]}},redisPath:{type:String,default:void 0,required:!1},isEditing:{type:Boolean,default:!1}},emits:["modelUpdated","partialToggled","showNewPartialModal","refreshModel","validated"],setup(e,{emit:n}){const o=e,a=n,{t:i}=ue.createI18n("en-us",pe),r=t.computed(()=>o.field.pluginType==="custom"),s=t.ref(!o.isEditing),l=t.ref(),c=t.ref({}),m=t.ref(),f=u=>x(u.visible)?u.visible.call(this,o.model,u,this):G(u.visible)?!0:u.visible,h=async u=>{a("modelUpdated",[{id:u,path:o.redisPath}],"partials"),m.value=[{id:u,path:o.redisPath}],l.value=u},b=(u,C)=>{c.value={...c.value,[C]:u},a("modelUpdated",u,C)},A=()=>{a("refreshModel")},F=(u,C,S)=>{a("validated",u,C,S)};return t.watch(()=>s.value,u=>{u?m.value&&a("partialToggled","redis",{partials:m.value}):a("partialToggled","partials",c.value)}),t.onBeforeMount(()=>{var u,C,S;if(o.model&&(c.value=o.field.fields.reduce((N,_)=>(Object.keys(o.model).includes(_.model)&&(N[_.model]=o.model[_.model]),N),{})),(S=(C=(u=o==null?void 0:o.model)==null?void 0:u.partials)==null?void 0:C[0])!=null&&S.id){const N=o.model.partials[0].id;s.value=!0,l.value=N}}),(u,C)=>{const S=t.resolveComponent("KAlert"),N=t.resolveComponent("KBadge"),_=t.resolveComponent("KRadio"),w=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",null,[r.value?(t.openBlock(),t.createElementBlock("div",ju,[t.createVNode(S,{"data-testid":"custom-plugin-redis-config-note",message:t.unref(i)("redis.custom_plugin.alert")},null,8,["message"]),t.createVNode(Ia,{"default-redis-config-item":l.value,"is-custom-plugin":"","plugin-redis-fields":e.field.fields,"update-redis-model":h,onShowNewPartialModal:C[0]||(C[0]=y=>u.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields"])])):(t.openBlock(),t.createBlock(w,{key:1,class:"redis-config-card","data-testid":"redis-config-card",title:t.unref(i)("redis.title")},{default:t.withCtx(()=>[t.createElementVNode("div",qu,[t.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":C[1]||(C[1]=y=>s.value=y),card:"","card-orientation":"horizontal","data-testid":"shared-redis-config-radio",description:t.unref(i)("redis.shared_configuration.description"),label:t.unref(i)("redis.shared_configuration.label"),"selected-value":!0},{default:t.withCtx(()=>[t.createVNode(N,{appearance:"success"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("redis.shared_configuration.badge")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":C[2]||(C[2]=y=>s.value=y),card:"","card-orientation":"horizontal","data-testid":"dedicated-redis-config-radio",description:t.unref(i)("redis.dedicated_configuration.description"),label:t.unref(i)("redis.dedicated_configuration.label"),"selected-value":!1},null,8,["modelValue","description","label"])]),s.value?(t.openBlock(),t.createElementBlock("div",zu,[t.createVNode(Ia,{"default-redis-config-item":l.value,"plugin-redis-fields":e.field.fields,"redis-type":e.field.redisType,"update-redis-model":h,onShowNewPartialModal:C[3]||(C[3]=y=>u.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields","redis-type"])])):(t.openBlock(),t.createElementBlock("div",Ku,[t.createElementVNode("div",Hu,t.toDisplayString(t.unref(i)("redis.dedicated_configuration.title")),1),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.field.fields,y=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:y.model},[f(y)?(t.openBlock(),t.createBlock(Ma,{key:0,ref_for:!0,ref:"children",errors:e.errors,field:y,model:e.model,options:e.options,vfg:e.vfg,onModelUpdated:b,onRefreshModel:A,onValidated:F},null,8,["errors","field","model","options","vfg"])):t.createCommentVNode("",!0)],64))),128))]),_:1}))]))]),_:1},8,["title"]))])}}}),[["__scopeId","data-v-addd6536"]])},mixins:[Ko],inject:{autofillSlot:{from:he,default:void 0}},provide(){var e;return{...!this.autofillSlot&&{[he]:(e=this.$slots)==null?void 0:e[ze]}}},props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:t.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},enableRedisPartial:{type:Boolean,default:!1},isEditing:{type:Boolean,default:!1}},emits:["validated","modelUpdated","refreshModel","partialToggled","showNewPartialModal"],data(){return{vfg:this,errors:[],children:t.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&ie(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&ie(this.schema.groups.slice(0),n=>{e.push(n)}),e}},watch:{model:{deep:!0,handler(e,n){n!==e&&e!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(e){return x(e.visible)?e.visible.call(this,this.model,e,this):G(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(i=>i.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&ie(n,i=>{this.errors.push({field:o.schema,error:i})});const a=this.errors.length===0;this.$emit("validated",a,this.errors,this)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},onPartialToggled(e,n){this.$emit("partialToggled",e,n)},validate(e=null){e===null&&(e=P(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];ie(this.$refs.children,i=>{x(i.validate)&&(n.push(i.$refs.child),o.push(i.$refs.child.validate(!0)))});const a=i=>{const r=[];ie(i,(l,c)=>{Array.isArray(l)&&l.length>0&&ie(l,m=>{r.push({field:n[c].schema,error:m})})}),this.errors=r;const s=r.length===0;return this.$emit("validated",s,r,this),e?r:s};return e?Promise.all(o).then(a):a(o)},clearValidationErrors(){this.errors.splice(0),ie(this.$refs.children,e=>{e.clearValidationErrors()})}}},Gu={key:0,class:"vue-form-generator"},Wu={key:0};function Zu(e,n,o,a,i,r){const s=t.resolveComponent("form-redis"),l=t.resolveComponent("form-group"),c=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Gu,[o.schema.fields?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[m.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(s,{key:0,errors:i.errors,field:m,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:f=>e.$emit("showNewPartialModal",m.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(m)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:m,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.groups,(m,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${f}`},[m.collapsible!==void 0&&m.collapsible!==!1?(t.openBlock(),t.createBlock(c,{key:0,class:"root-level-collapse","model-value":!1,title:m.collapsible.title},t.createSlots({default:t.withCtx(()=>{var h,b,A,F;return[(h=m.slots)!=null&&h.beforeContent?t.renderSlot(e.$slots,(b=m.slots)==null?void 0:b.beforeContent,{key:0}):t.createCommentVNode("",!0),m.fields.length===0&&((A=m.slots)!=null&&A.emptyState)?t.renderSlot(e.$slots,(F=m.slots)==null?void 0:F.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,u=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:u.model},[r.fieldVisible(u)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:u,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),m.collapsible!==!0&&m.collapsible.nestedCollapsible&&m.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(c,{key:3,class:"nested-collapse","model-value":i.collapseStates[`group-${f}-nested`]??!0,"trigger-alignment":"leading","trigger-label":i.collapseStates[`group-${f}-nested`]??!0?m.collapsible.nestedCollapsible.triggerLabel.expand:m.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":u=>i.collapseStates[`group-${f}-nested`]=u},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.collapsible.nestedCollapsible.fields,u=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:u.model},[u.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(s,{key:0,errors:i.errors,field:u,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:C=>e.$emit("showNewPartialModal",u.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(u)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:u,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):t.createCommentVNode("",!0)]}),_:2},[m.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(m.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[m.legend?(t.openBlock(),t.createElementBlock("legend",Wu,t.toDisplayString(m.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[r.fieldVisible(h)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:h,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const Y=$(Yu,[["render",Zu]]),Tt={openIdConnectDocs:"https://developer.konghq.com/plugins/openid-connect/",openIdConnectJWKDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-client-jwk",openIdConnectClusterNodesDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-redis-cluster-nodes",openIdConfigurationDocs:"https://developer.konghq.com/plugins/openid-connect/reference/",openIdAuthorizationDocs:"https://developer.konghq.com/plugins/openid-connect/#authorization"},Oa=new Set(["config-client_id","config-client_secret","config-issuer"]),Va=new Set(["config-scopes_claim","config-scopes_required","config-audience_claim","config-audience_required","config-roles_claim","config-roles_required","config-groups_claim","config-groups_required","config-authenticated_groups_claim"]),Xu={name:"OIDCForm",components:{VueFormGenerator:Y},provide(){var e;return{[he]:(e=this.$slots)==null?void 0:e[ze]}},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},onPartialToggled:{type:Function,required:!0},isEditing:{type:Boolean,required:!0},enableRedisPartial:{type:Boolean,required:!1},showNewPartialModal:{type:Function,default:()=>{}}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,openIdConnectLink:Tt.openIdConnectDocs,openIdConnectJWKLink:Tt.openIdConnectJWKDocs,openIdConnectClusterNodesLink:Tt.openIdConnectClusterNodesDocs,openIdConfigurationDocs:Tt.openIdConfigurationDocs,openIdAuthorizationDocs:Tt.openIdAuthorizationDocs,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var e;if(!this.init){this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(i=>!i.model.startsWith("config")&&i.model!=="tags")};const n=this.formSchema.fields.reduce((i,r)=>(i[r.model]=r,i),{});this.commonFieldsSchema={fields:Array.from(Oa).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])},this.authFieldsSchema={fields:Array.from(Va).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])};const{redis:o,redisModels:a}=Ce.useRedisPartial(this.formSchema);this.advancedFieldsSchema={fields:this.formSchema.fields.filter(i=>i.model.startsWith("config")&&i.model!=="config-auth_methods"&&!Oa.has(i.model)&&!Va.has(i.model)&&(!this.enableRedisPartial||!a.includes(i.model))||i.model==="tags").reduce((i,r)=>{var s,l,c,m;switch(r.model){case"config-client_jwk":{if(Array.isArray((l=(s=r.items)==null?void 0:s.schema)==null?void 0:l.fields))for(const f of r.items.schema.fields)f.label=f.model;i.push({...r,link:this.openIdConnectJWKLink,newElementButtonLabel:"+ Add Client JWK",...Array.isArray((m=(c=r.items)==null?void 0:c.schema)==null?void 0:m.fields)&&r.items.schema.fields.map(f=>({...f,label:f.model}))});break}case"config-session_redis_cluster_nodes":{i.push({...r,link:this.openIdConnectClusterNodesLink,newElementButtonLabel:"+ Add Cluster Node"});break}default:i.push(r)}return i},[])},this.enableRedisPartial&&this.advancedFieldsSchema.fields.unshift(o),this.sessionManagement=this.formModel["config-auth_methods"].includes("session"),this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.formModel["config-auth_methods"].includes("authorization_code")},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.formModel["config-auth_methods"].includes("bearer")},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.formModel["config-auth_methods"].includes("client_credentials")},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.formModel["config-auth_methods"].includes("password")},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.formModel["config-auth_methods"].includes("introspection")},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.formModel["config-auth_methods"].includes("userinfo")},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.formModel["config-auth_methods"].includes("kong_oauth2")},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.formModel["config-auth_methods"].includes("refresh_token")}];for(const i of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const r of i.fields){const s=(e=n[r.model])==null?void 0:e.help;r.help===void 0&&typeof s=="string"&&(r.help=s)}}},getAuthMethodsValue(e,n){const o=[];for(let a=0;a<this.authMethods.length;a++)this.authMethods[a].prop&&this.authMethods[a].value!==e&&o.push(this.authMethods[a].value);return this.sessionManagement&&e&&o.push("session"),n&&(e?o.push(e):o.push("session")),o},handleUpdate(e,n){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(n,e),this.onModelUpdated()}}},Ju={class:"general-settings"},Qu={class:"link-wrapper"},ef={class:"auth-method-container"},tf={class:"general-settings"},nf={class:"link-wrapper"},of={class:"general-settings"},af={class:"link-wrapper"};function rf(e,n,o,a,i,r){const s=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KLabel"),m=t.resolveComponent("KCheckbox"),f=t.resolveComponent("KInputSwitch"),h=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(s,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:i.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(h,{tabs:i.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Ju,[t.createElementVNode("div",Qu,[t.createVNode(l,{href:i.openIdConfigurationDocs},{default:t.withCtx(()=>[...n[2]||(n[2]=[t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)])]),_:1},8,["href"])]),n[4]||(n[4]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:i.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(c,null,{default:t.withCtx(()=>[...n[3]||(n[3]=[t.createTextVNode("Auth Methods",-1)])]),_:1}),t.createElementVNode("div",ef,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.authMethods,b=>(t.openBlock(),t.createElementBlock("div",{key:b.value,class:"auth-method"},[t.createVNode(m,{modelValue:b.prop,"onUpdate:modelValue":A=>b.prop=A,onChange:A=>r.handleUpdate(A,b.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(b.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(f,{modelValue:i.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=b=>i.sessionManagement=b),label:"Enable Session Management",onChange:r.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",tf,[t.createElementVNode("div",nf,[t.createVNode(l,{href:i.openIdAuthorizationDocs},{default:t.withCtx(()=>[...n[5]||(n[5]=[t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)])]),_:1},8,["href"])]),n[6]||(n[6]=t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:i.authFieldsSchema,onModelUpdated:o.onModelUpdated},{"autofill-provider":t.withCtx(b=>[t.renderSlot(e.$slots,"autofill-provider",t.normalizeProps(t.guardReactiveProps(b)),void 0,!0)]),_:3},8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",of,[t.createElementVNode("div",af,[t.createVNode(l,{href:i.openIdConnectLink},{default:t.withCtx(()=>[...n[7]||(n[7]=[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)])]),_:1},8,["href"])]),n[8]||(n[8]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(s,{key:0,"enable-redis-partial":o.enableRedisPartial,"is-editing":o.isEditing,model:o.formModel,options:o.formOptions,schema:i.advancedFieldsSchema,onModelUpdated:o.onModelUpdated,onPartialToggled:o.onPartialToggled,onShowNewPartialModal:n[1]||(n[1]=()=>o.showNewPartialModal(o.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onModelUpdated","onPartialToggled"])):t.createCommentVNode("",!0)])]),_:3},8,["tabs"])])}const lf=$(Xu,[["render",rf],["__scopeId","data-v-741bf3cb"]]),sf=$(t.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var s;t.provide(he,(s=t.useSlots())==null?void 0:s[ze]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const l=a.formSchema;return l.fields.map(c=>{const m=`post-function.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="post-function-array-item-container",c.fieldItemsClasses="post-function-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),l});return(l,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-f54f37ae"]]),df=$(t.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var s;t.provide(he,(s=t.useSlots())==null?void 0:s[ze]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const l=a.formSchema;return l.fields.map(c=>{const m=`exit-transformer.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="exit-transformer-array-item-container",c.fieldItemsClasses="exit-transformer-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),l});return(l,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0d5c541f"]]),cf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},mf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},uf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},ff={class:"general-settings"},hf={class:"sub-form"},pf={class:"general-settings"},gf={class:"sub-form"},yf={class:"general-settings"},bf=$(t.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var y;t.provide(he,(y=t.useSlots())==null?void 0:y[ze]);const n=e,o=t.ref("zeroSsl"),a=t.ref("shm"),i=t.computed(()=>{var p;const g={};if((p=n.formSchema)!=null&&p.fields)for(const V of n.formSchema.fields)g[V.model]=V;return g}),r=t.computed(()=>{var p;const g=Ie(cf);for(const V of g.fields){const v=(p=i.value[V.model])==null?void 0:p.help;V.help===void 0&&typeof v=="string"&&(V.help=v)}return g}),s=t.computed(()=>{var p;const g=Ie(mf);for(const V of g.fields){const v=(p=i.value[V.model])==null?void 0:p.help;V.help===void 0&&typeof v=="string"&&(V.help=v)}return g}),l=t.computed(()=>{var p;const g=Ie(uf);for(const V of g.fields){const v=(p=i.value[V.model])==null?void 0:p.help;V.help===void 0&&typeof v=="string"&&(V.help=v)}return g}),c=t.computed(()=>({fields:n.formSchema.fields.filter(g=>!g.model.startsWith("config")&&g.model!=="tags")})),m=t.computed(()=>({fields:r.value.fields.filter(p=>!s.value.fields.some(V=>V.model===p.model)&&!l.value.fields.some(V=>V.model===p.model))})),f=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage")&&!p.model.startsWith("config-storage_config-consul")&&!p.model.startsWith("config-storage_config-redis")&&!p.model.startsWith("config-storage_config-shm")&&!p.model.startsWith("config-storage_config-vault"))})),h=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-consul"))})),b=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-redis"))})),A=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-shm"))})),F=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-vault"))})),u=t.computed(()=>({fields:n.formSchema.fields.filter(g=>g.model.startsWith("config")&&!m.value.fields.filter(p=>p.model===g.model).length&&!f.value.fields.filter(p=>p.model===g.model).length||g.model==="tags")})),C=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),S=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],N=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];t.onMounted(()=>{o.value==="zeroSsl"&&(n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const _=g=>{o.value=g.value,(g.value==="zeroSsl"||g.value==="other")&&(g.value==="zeroSsl"?n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":n.formModel["config-api_uri"]="https://acme.example.com/",n.formModel["config-tos_accepted"]=!1),g.value==="letsEncrypt"&&(n.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",n.formModel["config-eab_hmac_key"]="",n.formModel["config-eab_kid"]=""),n.onModelUpdated()},w=(g,p)=>{p==="config-storage"&&(a.value=g),n.onModelUpdated()};return(g,p)=>{const V=t.resolveComponent("KSelect"),v=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(Y,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(v,{tabs:S},{general:t.withCtx(()=>[t.createElementVNode("div",ff,[p[0]||(p[0]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),p[1]||(p[1]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),p[2]||(p[2]=t.createElementVNode("hr",null,null,-1)),t.createVNode(V,{class:"issuer-select",items:N,label:"Issuer",onChange:_}),t.createElementVNode("div",hf,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",pf,[p[3]||(p[3]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),p[4]||(p[4]=t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:f.value,onModelUpdated:w},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",gf,[a.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:b.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="shm"?(t.openBlock(),t.createBlock(Y,{key:2,model:e.formModel,options:e.formOptions,schema:A.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:F.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",yf,[p[5]||(p[5]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),p[6]||(p[6]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:u.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-07cecf5b"]]),_f={class:"rla-form-basic-fields"},Ef={class:"rla-form-request-limits-subtitle"},Tf={class:"rla-form-request-limits-content"},Cf={class:"rla-form-window-type"},Sf=["innerHTML"],wf={class:"rla-form-window-type-radios"},kf={class:"rla-form-request-limits-items"},Af={class:"rla-form-request-limits-row"},Mf=["id"],Nf={class:"rla-form-request-limits-actions"},If={key:0,class:"rla-form-request-limits-examples"},Of={class:"rla-form-request-limits-examples-badges"},Vf=["innerHTML"],Bf={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Ff=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:bf,ExitTransformer:df,OIDCForm:lf,PostFunction:sf,RLAForm:$(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},onPartialToggled:{type:Function},showNewPartialModal:{type:Function},isEditing:{type:Boolean},enableRedisPartial:{type:Boolean}},setup(e){var v;t.provide(he,(v=t.useSlots())==null?void 0:v[ze]);const n={fixed:[{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit.",config:{limit:500,window_size:3600}},{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits.",config:{limit:200,window_size:1800}},{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences.",config:{limit:500,window_size:86400}}],sliding:[{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset.",config:{limit:100,window_size:3600}},{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made.",config:{limit:300,window_size:1800}},{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
|
|
1
|
+
(function(L,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("axios"),require("@kong-ui-public/entities-shared")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","axios","@kong-ui-public/entities-shared"],t):(L=typeof globalThis<"u"?globalThis:L||self,t(L["kong-ui-public-forms"]={},L.Vue,L["kong-ui-public-i18n"],L.KongIcons,L.axios,L["kong-ui-public-entities-shared"]))})(this,function(L,t,ue,Se,ei,kt){"use strict";function Ln(e,n){for(var o=-1,a=e==null?0:e.length;++o<a&&n(e[o],o,e)!==!1;);return e}function ti(e){return function(n,o,a){for(var i=-1,r=Object(n),s=a(n),l=s.length;l--;){var c=s[++i];if(o(r[c],c,r)===!1)break}return n}}var ni=ti();function oi(e,n){for(var o=-1,a=Array(e);++o<e;)a[o]=n(o);return a}var Un=typeof global=="object"&&global&&global.Object===Object&&global,ai=typeof self=="object"&&self&&self.Object===Object&&self,ge=Un||ai||Function("return this")(),Le=ge.Symbol,Pn=Object.prototype,ii=Pn.hasOwnProperty,ri=Pn.toString,dt=Le?Le.toStringTag:void 0;function li(e){var n=ii.call(e,dt),o=e[dt];try{e[dt]=void 0;var a=!0}catch{}var i=ri.call(e);return a&&(n?e[dt]=o:delete e[dt]),i}var si=Object.prototype,di=si.toString;function ci(e){return di.call(e)}var mi="[object Null]",ui="[object Undefined]",$n=Le?Le.toStringTag:void 0;function Ue(e){return e==null?e===void 0?ui:mi:$n&&$n in Object(e)?li(e):ci(e)}function Pe(e){return e!=null&&typeof e=="object"}var fi="[object Arguments]";function xn(e){return Pe(e)&&Ue(e)==fi}var vn=Object.prototype,hi=vn.hasOwnProperty,pi=vn.propertyIsEnumerable,gi=xn(function(){return arguments}())?xn:function(e){return Pe(e)&&hi.call(e,"callee")&&!pi.call(e,"callee")},$e=Array.isArray;function yi(){return!1}var jn=typeof L=="object"&&L&&!L.nodeType&&L,qn=jn&&typeof module=="object"&&module&&!module.nodeType&&module,bi=qn&&qn.exports===jn,zn=bi?ge.Buffer:void 0,_i=zn?zn.isBuffer:void 0,Kn=_i||yi,Ei=9007199254740991,Ti=/^(?:0|[1-9]\d*)$/;function Hn(e,n){var o=typeof e;return n=n??Ei,!!n&&(o=="number"||o!="symbol"&&Ti.test(e))&&e>-1&&e%1==0&&e<n}var Ci=9007199254740991;function Yn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ci}var Si="[object Arguments]",wi="[object Array]",ki="[object Boolean]",Ai="[object Date]",Mi="[object Error]",Ni="[object Function]",Ii="[object Map]",Oi="[object Number]",Vi="[object Object]",Bi="[object RegExp]",Fi="[object Set]",Ri="[object String]",Di="[object WeakMap]",Li="[object ArrayBuffer]",Ui="[object DataView]",Pi="[object Float32Array]",$i="[object Float64Array]",xi="[object Int8Array]",vi="[object Int16Array]",ji="[object Int32Array]",qi="[object Uint8Array]",zi="[object Uint8ClampedArray]",Ki="[object Uint16Array]",Hi="[object Uint32Array]",q={};q[Pi]=q[$i]=q[xi]=q[vi]=q[ji]=q[qi]=q[zi]=q[Ki]=q[Hi]=!0,q[Si]=q[wi]=q[Li]=q[ki]=q[Ui]=q[Ai]=q[Mi]=q[Ni]=q[Ii]=q[Oi]=q[Vi]=q[Bi]=q[Fi]=q[Ri]=q[Di]=!1;function Yi(e){return Pe(e)&&Yn(e.length)&&!!q[Ue(e)]}function Wt(e){return function(n){return e(n)}}var Gn=typeof L=="object"&&L&&!L.nodeType&&L,ct=Gn&&typeof module=="object"&&module&&!module.nodeType&&module,Gi=ct&&ct.exports===Gn,Zt=Gi&&Un.process,Xe=function(){try{var e=ct&&ct.require&&ct.require("util").types;return e||Zt&&Zt.binding&&Zt.binding("util")}catch{}}(),Wn=Xe&&Xe.isTypedArray,Wi=Wn?Wt(Wn):Yi,Zi=Object.prototype,Xi=Zi.hasOwnProperty;function Zn(e,n){var o=$e(e),a=!o&&gi(e),i=!o&&!a&&Kn(e),r=!o&&!a&&!i&&Wi(e),s=o||a||i||r,l=s?oi(e.length,String):[],c=l.length;for(var m in e)(n||Xi.call(e,m))&&!(s&&(m=="length"||i&&(m=="offset"||m=="parent")||r&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Hn(m,c)))&&l.push(m);return l}var Ji=Object.prototype;function Xt(e){var n=e&&e.constructor,o=typeof n=="function"&&n.prototype||Ji;return e===o}function Xn(e,n){return function(o){return e(n(o))}}var Qi=Xn(Object.keys,Object),er=Object.prototype,tr=er.hasOwnProperty;function nr(e){if(!Xt(e))return Qi(e);var n=[];for(var o in Object(e))tr.call(e,o)&&o!="constructor"&&n.push(o);return n}function fe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var or="[object AsyncFunction]",ar="[object Function]",ir="[object GeneratorFunction]",rr="[object Proxy]";function x(e){if(!fe(e))return!1;var n=Ue(e);return n==ar||n==ir||n==or||n==rr}function At(e){return e!=null&&Yn(e.length)&&!x(e)}function Mt(e){return At(e)?Zn(e):nr(e)}function lr(e,n){return e&&ni(e,n,Mt)}function sr(e,n){return function(o,a){if(o==null)return o;if(!At(o))return e(o,a);for(var i=o.length,r=-1,s=Object(o);++r<i&&a(s[r],r,s)!==!1;);return o}}var dr=sr(lr);function Jt(e){return e}function cr(e){return typeof e=="function"?e:Jt}function ie(e,n){var o=$e(e)?Ln:dr;return o(e,cr(n))}var mr="[object Symbol]";function Nt(e){return typeof e=="symbol"||Pe(e)&&Ue(e)==mr}var ur=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fr=/^\w*$/;function hr(e,n){if($e(e))return!1;var o=typeof e;return o=="number"||o=="symbol"||o=="boolean"||e==null||Nt(e)?!0:fr.test(e)||!ur.test(e)||n!=null&&e in Object(n)}var Qt=ge["__core-js_shared__"],Jn=function(){var e=/[^.]+$/.exec(Qt&&Qt.keys&&Qt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function pr(e){return!!Jn&&Jn in e}var gr=Function.prototype,yr=gr.toString;function je(e){if(e!=null){try{return yr.call(e)}catch{}try{return e+""}catch{}}return""}var br=/[\\^$.*+?()[\]{}|]/g,_r=/^\[object .+?Constructor\]$/,Er=Function.prototype,Tr=Object.prototype,Cr=Er.toString,Sr=Tr.hasOwnProperty,wr=RegExp("^"+Cr.call(Sr).replace(br,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kr(e){if(!fe(e)||pr(e))return!1;var n=x(e)?wr:_r;return n.test(je(e))}function Ar(e,n){return e==null?void 0:e[n]}function qe(e,n){var o=Ar(e,n);return kr(o)?o:void 0}var mt=qe(Object,"create");function Mr(){this.__data__=mt?mt(null):{},this.size=0}function Nr(e){var n=this.has(e)&&delete this.__data__[e];return this.size-=n?1:0,n}var Ir="__lodash_hash_undefined__",Or=Object.prototype,Vr=Or.hasOwnProperty;function Br(e){var n=this.__data__;if(mt){var o=n[e];return o===Ir?void 0:o}return Vr.call(n,e)?n[e]:void 0}var Fr=Object.prototype,Rr=Fr.hasOwnProperty;function Dr(e){var n=this.__data__;return mt?n[e]!==void 0:Rr.call(n,e)}var Lr="__lodash_hash_undefined__";function Ur(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=mt&&n===void 0?Lr:n,this}function ze(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}ze.prototype.clear=Mr,ze.prototype.delete=Nr,ze.prototype.get=Br,ze.prototype.has=Dr,ze.prototype.set=Ur;function Pr(){this.__data__=[],this.size=0}function It(e,n){return e===n||e!==e&&n!==n}function Ot(e,n){for(var o=e.length;o--;)if(It(e[o][0],n))return o;return-1}var $r=Array.prototype,xr=$r.splice;function vr(e){var n=this.__data__,o=Ot(n,e);if(o<0)return!1;var a=n.length-1;return o==a?n.pop():xr.call(n,o,1),--this.size,!0}function jr(e){var n=this.__data__,o=Ot(n,e);return o<0?void 0:n[o][1]}function qr(e){return Ot(this.__data__,e)>-1}function zr(e,n){var o=this.__data__,a=Ot(o,e);return a<0?(++this.size,o.push([e,n])):o[a][1]=n,this}function Me(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}Me.prototype.clear=Pr,Me.prototype.delete=vr,Me.prototype.get=jr,Me.prototype.has=qr,Me.prototype.set=zr;var ut=qe(ge,"Map");function Kr(){this.size=0,this.__data__={hash:new ze,map:new(ut||Me),string:new ze}}function Hr(e){var n=typeof e;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?e!=="__proto__":e===null}function Vt(e,n){var o=e.__data__;return Hr(n)?o[typeof n=="string"?"string":"hash"]:o.map}function Yr(e){var n=Vt(this,e).delete(e);return this.size-=n?1:0,n}function Gr(e){return Vt(this,e).get(e)}function Wr(e){return Vt(this,e).has(e)}function Zr(e,n){var o=Vt(this,e),a=o.size;return o.set(e,n),this.size+=o.size==a?0:1,this}function Ne(e){var n=-1,o=e==null?0:e.length;for(this.clear();++n<o;){var a=e[n];this.set(a[0],a[1])}}Ne.prototype.clear=Kr,Ne.prototype.delete=Yr,Ne.prototype.get=Gr,Ne.prototype.has=Wr,Ne.prototype.set=Zr;var Xr="Expected a function";function en(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new TypeError(Xr);var o=function(){var a=arguments,i=n?n.apply(this,a):a[0],r=o.cache;if(r.has(i))return r.get(i);var s=e.apply(this,a);return o.cache=r.set(i,s)||r,s};return o.cache=new(en.Cache||Ne),o}en.Cache=Ne;var Jr=500;function Qr(e){var n=en(e,function(a){return o.size===Jr&&o.clear(),a}),o=n.cache;return n}var el=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tl=/\\(\\)?/g,nl=Qr(function(e){var n=[];return e.charCodeAt(0)===46&&n.push(""),e.replace(el,function(o,a,i,r){n.push(i?r.replace(tl,"$1"):a||o)}),n});function ol(e,n){for(var o=-1,a=e==null?0:e.length,i=Array(a);++o<a;)i[o]=n(e[o],o,e);return i}var Qn=Le?Le.prototype:void 0,eo=Qn?Qn.toString:void 0;function to(e){if(typeof e=="string")return e;if($e(e))return ol(e,to)+"";if(Nt(e))return eo?eo.call(e):"";var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function no(e){return e==null?"":to(e)}function al(e,n){return $e(e)?e:hr(e,n)?[e]:nl(no(e))}function il(e){if(typeof e=="string"||Nt(e))return e;var n=e+"";return n=="0"&&1/e==-1/0?"-0":n}function rl(e,n){n=al(n,e);for(var o=0,a=n.length;e!=null&&o<a;)e=e[il(n[o++])];return o&&o==a?e:void 0}function P(e,n,o){var a=e==null?void 0:rl(e,n);return a===void 0?o:a}function G(e){return e==null}const re="kong-ui-forms-api",oo="kong-ui-forms-config",ao="redis-partial-list-fetcher-key",ll="redis-partial-info",Ke="autofill",he="autofillSlot",_e={CREATE_NOT_FROM_ENTITY:"CREATE_NOT_FROM_ENTITY",CREATE_FROM_ENTITY:"CREATE_FROM_ENTITY",UPDATE_ENTITY:"UPDATE_ENTITY",SET_REFERRAL_VALUE:"SET_REFERRAL_VALUE"},io="—";/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:ro,setPrototypeOf:lo,isFrozen:sl,getPrototypeOf:dl,getOwnPropertyDescriptor:cl}=Object;let{freeze:le,seal:ye,create:tn}=Object,{apply:nn,construct:on}=typeof Reflect<"u"&&Reflect;le||(le=function(n){return n}),ye||(ye=function(n){return n}),nn||(nn=function(n,o){for(var a=arguments.length,i=new Array(a>2?a-2:0),r=2;r<a;r++)i[r-2]=arguments[r];return n.apply(o,i)}),on||(on=function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return new n(...a)});const Bt=de(Array.prototype.forEach),ml=de(Array.prototype.lastIndexOf),so=de(Array.prototype.pop),ft=de(Array.prototype.push),ul=de(Array.prototype.splice),Ft=de(String.prototype.toLowerCase),an=de(String.prototype.toString),rn=de(String.prototype.match),ht=de(String.prototype.replace),fl=de(String.prototype.indexOf),hl=de(String.prototype.trim),Ee=de(Object.prototype.hasOwnProperty),se=de(RegExp.prototype.test),pt=pl(TypeError);function de(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return nn(e,n,a)}}function pl(e){return function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return on(e,o)}}function D(e,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ft;lo&&lo(e,null);let a=n.length;for(;a--;){let i=n[a];if(typeof i=="string"){const r=o(i);r!==i&&(sl(n)||(n[a]=r),i=r)}e[i]=!0}return e}function gl(e){for(let n=0;n<e.length;n++)Ee(e,n)||(e[n]=null);return e}function we(e){const n=tn(null);for(const[o,a]of ro(e))Ee(e,o)&&(Array.isArray(a)?n[o]=gl(a):a&&typeof a=="object"&&a.constructor===Object?n[o]=we(a):n[o]=a);return n}function gt(e,n){for(;e!==null;){const a=cl(e,n);if(a){if(a.get)return de(a.get);if(typeof a.value=="function")return de(a.value)}e=dl(e)}function o(){return null}return o}const co=le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ln=le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),sn=le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yl=le(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dn=le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bl=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),mo=le(["#text"]),uo=le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),cn=le(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fo=le(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rt=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_l=ye(/\{\{[\w\W]*|[\w\W]*\}\}/gm),El=ye(/<%[\w\W]*|[\w\W]*%>/gm),Tl=ye(/\$\{[\w\W]*/gm),Cl=ye(/^data-[\-\w.\u00B7-\uFFFF]+$/),Sl=ye(/^aria-[\-\w]+$/),ho=ye(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wl=ye(/^(?:\w+script|data):/i),kl=ye(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),po=ye(/^html$/i),Al=ye(/^[a-z][.\w]*(-[.\w]+)+$/i);var go=Object.freeze({__proto__:null,ARIA_ATTR:Sl,ATTR_WHITESPACE:kl,CUSTOM_ELEMENT:Al,DATA_ATTR:Cl,DOCTYPE_NAME:po,ERB_EXPR:El,IS_ALLOWED_URI:ho,IS_SCRIPT_OR_DATA:wl,MUSTACHE_EXPR:_l,TMPLIT_EXPR:Tl});const yt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ml=function(){return typeof window>"u"?null:window},Nl=function(n,o){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(a=o.getAttribute(i));const r="dompurify"+(a?"#"+a:"");try{return n.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},yo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function bo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ml();const n=I=>bo(I);if(n.version="3.3.1",n.removed=[],!e||!e.document||e.document.nodeType!==yt.document||!e.Element)return n.isSupported=!1,n;let{document:o}=e;const a=o,i=a.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:m,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:b,trustedTypes:A}=e,F=c.prototype,u=gt(F,"cloneNode"),C=gt(F,"remove"),S=gt(F,"nextSibling"),N=gt(F,"childNodes"),_=gt(F,"parentNode");if(typeof s=="function"){const I=o.createElement("template");I.content&&I.content.ownerDocument&&(o=I.content.ownerDocument)}let w,y="";const{implementation:g,createNodeIterator:p,createDocumentFragment:V,getElementsByTagName:v}=o,{importNode:M}=a;let T=yo();n.isSupported=typeof ro=="function"&&typeof _=="function"&&g&&g.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:R,TMPLIT_EXPR:U,DATA_ATTR:te,ARIA_ATTR:Ve,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:Sn}=go;let{IS_ALLOWED_URI:vt}=go,O=null;const H=D({},[...co,...ln,...sn,...dn,...mo]);let Z=null;const Fa=D({},[...uo,...cn,...fo,...Rt]);let X=Object.seal(tn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ct=null,wn=null;const nt=Object.seal(tn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ra=!0,kn=!0,Da=!1,La=!0,ot=!1,jt=!0,We=!1,An=!1,Mn=!1,at=!1,qt=!1,zt=!1,Ua=!0,Pa=!1;const Lf="user-content-";let Nn=!0,St=!1,it={},ke=null;const In=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let $a=null;const xa=D({},["audio","video","img","source","image","track"]);let On=null;const va=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let rt=Fe,Vn=!1,Bn=null;const Uf=D({},[Kt,Ht,Fe],an);let Yt=D({},["mi","mo","mn","ms","mtext"]),Gt=D({},["annotation-xml"]);const Pf=D({},["title","style","font","a","script"]);let wt=null;const $f=["application/xhtml+xml","text/html"],xf="text/html";let ee=null,lt=null;const vf=o.createElement("form"),ja=function(d){return d instanceof RegExp||d instanceof Function},Fn=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(lt&<===d)){if((!d||typeof d!="object")&&(d={}),d=we(d),wt=$f.indexOf(d.PARSER_MEDIA_TYPE)===-1?xf:d.PARSER_MEDIA_TYPE,ee=wt==="application/xhtml+xml"?an:Ft,O=Ee(d,"ALLOWED_TAGS")?D({},d.ALLOWED_TAGS,ee):H,Z=Ee(d,"ALLOWED_ATTR")?D({},d.ALLOWED_ATTR,ee):Fa,Bn=Ee(d,"ALLOWED_NAMESPACES")?D({},d.ALLOWED_NAMESPACES,an):Uf,On=Ee(d,"ADD_URI_SAFE_ATTR")?D(we(va),d.ADD_URI_SAFE_ATTR,ee):va,$a=Ee(d,"ADD_DATA_URI_TAGS")?D(we(xa),d.ADD_DATA_URI_TAGS,ee):xa,ke=Ee(d,"FORBID_CONTENTS")?D({},d.FORBID_CONTENTS,ee):In,Ct=Ee(d,"FORBID_TAGS")?D({},d.FORBID_TAGS,ee):we({}),wn=Ee(d,"FORBID_ATTR")?D({},d.FORBID_ATTR,ee):we({}),it=Ee(d,"USE_PROFILES")?d.USE_PROFILES:!1,Ra=d.ALLOW_ARIA_ATTR!==!1,kn=d.ALLOW_DATA_ATTR!==!1,Da=d.ALLOW_UNKNOWN_PROTOCOLS||!1,La=d.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ot=d.SAFE_FOR_TEMPLATES||!1,jt=d.SAFE_FOR_XML!==!1,We=d.WHOLE_DOCUMENT||!1,at=d.RETURN_DOM||!1,qt=d.RETURN_DOM_FRAGMENT||!1,zt=d.RETURN_TRUSTED_TYPE||!1,Mn=d.FORCE_BODY||!1,Ua=d.SANITIZE_DOM!==!1,Pa=d.SANITIZE_NAMED_PROPS||!1,Nn=d.KEEP_CONTENT!==!1,St=d.IN_PLACE||!1,vt=d.ALLOWED_URI_REGEXP||ho,rt=d.NAMESPACE||Fe,Yt=d.MATHML_TEXT_INTEGRATION_POINTS||Yt,Gt=d.HTML_INTEGRATION_POINTS||Gt,X=d.CUSTOM_ELEMENT_HANDLING||{},d.CUSTOM_ELEMENT_HANDLING&&ja(d.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=d.CUSTOM_ELEMENT_HANDLING.tagNameCheck),d.CUSTOM_ELEMENT_HANDLING&&ja(d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=d.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),d.CUSTOM_ELEMENT_HANDLING&&typeof d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=d.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ot&&(kn=!1),qt&&(at=!0),it&&(O=D({},mo),Z=[],it.html===!0&&(D(O,co),D(Z,uo)),it.svg===!0&&(D(O,ln),D(Z,cn),D(Z,Rt)),it.svgFilters===!0&&(D(O,sn),D(Z,cn),D(Z,Rt)),it.mathMl===!0&&(D(O,dn),D(Z,fo),D(Z,Rt))),d.ADD_TAGS&&(typeof d.ADD_TAGS=="function"?nt.tagCheck=d.ADD_TAGS:(O===H&&(O=we(O)),D(O,d.ADD_TAGS,ee))),d.ADD_ATTR&&(typeof d.ADD_ATTR=="function"?nt.attributeCheck=d.ADD_ATTR:(Z===Fa&&(Z=we(Z)),D(Z,d.ADD_ATTR,ee))),d.ADD_URI_SAFE_ATTR&&D(On,d.ADD_URI_SAFE_ATTR,ee),d.FORBID_CONTENTS&&(ke===In&&(ke=we(ke)),D(ke,d.FORBID_CONTENTS,ee)),d.ADD_FORBID_CONTENTS&&(ke===In&&(ke=we(ke)),D(ke,d.ADD_FORBID_CONTENTS,ee)),Nn&&(O["#text"]=!0),We&&D(O,["html","head","body"]),O.table&&(D(O,["tbody"]),delete Ct.tbody),d.TRUSTED_TYPES_POLICY){if(typeof d.TRUSTED_TYPES_POLICY.createHTML!="function")throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof d.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=d.TRUSTED_TYPES_POLICY,y=w.createHTML("")}else w===void 0&&(w=Nl(A,i)),w!==null&&typeof y=="string"&&(y=w.createHTML(""));le&&le(d),lt=d}},qa=D({},[...ln,...sn,...yl]),za=D({},[...dn,...bl]),jf=function(d){let E=_(d);(!E||!E.tagName)&&(E={namespaceURI:rt,tagName:"template"});const k=Ft(d.tagName),z=Ft(E.tagName);return Bn[d.namespaceURI]?d.namespaceURI===Ht?E.namespaceURI===Fe?k==="svg":E.namespaceURI===Kt?k==="svg"&&(z==="annotation-xml"||Yt[z]):!!qa[k]:d.namespaceURI===Kt?E.namespaceURI===Fe?k==="math":E.namespaceURI===Ht?k==="math"&&Gt[z]:!!za[k]:d.namespaceURI===Fe?E.namespaceURI===Ht&&!Gt[z]||E.namespaceURI===Kt&&!Yt[z]?!1:!za[k]&&(Pf[k]||!qa[k]):!!(wt==="application/xhtml+xml"&&Bn[d.namespaceURI]):!1},Ae=function(d){ft(n.removed,{element:d});try{_(d).removeChild(d)}catch{C(d)}},Ze=function(d,E){try{ft(n.removed,{attribute:E.getAttributeNode(d),from:E})}catch{ft(n.removed,{attribute:null,from:E})}if(E.removeAttribute(d),d==="is")if(at||qt)try{Ae(E)}catch{}else try{E.setAttribute(d,"")}catch{}},Ka=function(d){let E=null,k=null;if(Mn)d="<remove></remove>"+d;else{const Q=rn(d,/^[\r\n\t ]+/);k=Q&&Q[0]}wt==="application/xhtml+xml"&&rt===Fe&&(d='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+d+"</body></html>");const z=w?w.createHTML(d):d;if(rt===Fe)try{E=new b().parseFromString(z,wt)}catch{}if(!E||!E.documentElement){E=g.createDocument(rt,"template",null);try{E.documentElement.innerHTML=Vn?y:z}catch{}}const ae=E.body||E.documentElement;return d&&k&&ae.insertBefore(o.createTextNode(k),ae.childNodes[0]||null),rt===Fe?v.call(E,We?"html":"body")[0]:We?E.documentElement:ae},Ha=function(d){return p.call(d.ownerDocument||d,d,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Rn=function(d){return d instanceof h&&(typeof d.nodeName!="string"||typeof d.textContent!="string"||typeof d.removeChild!="function"||!(d.attributes instanceof f)||typeof d.removeAttribute!="function"||typeof d.setAttribute!="function"||typeof d.namespaceURI!="string"||typeof d.insertBefore!="function"||typeof d.hasChildNodes!="function")},Ya=function(d){return typeof l=="function"&&d instanceof l};function Re(I,d,E){Bt(I,k=>{k.call(n,d,E,lt)})}const Ga=function(d){let E=null;if(Re(T.beforeSanitizeElements,d,null),Rn(d))return Ae(d),!0;const k=ee(d.nodeName);if(Re(T.uponSanitizeElement,d,{tagName:k,allowedTags:O}),jt&&d.hasChildNodes()&&!Ya(d.firstElementChild)&&se(/<[/\w!]/g,d.innerHTML)&&se(/<[/\w!]/g,d.textContent)||d.nodeType===yt.progressingInstruction||jt&&d.nodeType===yt.comment&&se(/<[/\w]/g,d.data))return Ae(d),!0;if(!(nt.tagCheck instanceof Function&&nt.tagCheck(k))&&(!O[k]||Ct[k])){if(!Ct[k]&&Za(k)&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,k)||X.tagNameCheck instanceof Function&&X.tagNameCheck(k)))return!1;if(Nn&&!ke[k]){const z=_(d)||d.parentNode,ae=N(d)||d.childNodes;if(ae&&z){const Q=ae.length;for(let me=Q-1;me>=0;--me){const De=u(ae[me],!0);De.__removalCount=(d.__removalCount||0)+1,z.insertBefore(De,S(d))}}}return Ae(d),!0}return d instanceof c&&!jf(d)||(k==="noscript"||k==="noembed"||k==="noframes")&&se(/<\/no(script|embed|frames)/i,d.innerHTML)?(Ae(d),!0):(ot&&d.nodeType===yt.text&&(E=d.textContent,Bt([B,R,U],z=>{E=ht(E,z," ")}),d.textContent!==E&&(ft(n.removed,{element:d.cloneNode()}),d.textContent=E)),Re(T.afterSanitizeElements,d,null),!1)},Wa=function(d,E,k){if(Ua&&(E==="id"||E==="name")&&(k in o||k in vf))return!1;if(!(kn&&!wn[E]&&se(te,E))){if(!(Ra&&se(Ve,E))){if(!(nt.attributeCheck instanceof Function&&nt.attributeCheck(E,d))){if(!Z[E]||wn[E]){if(!(Za(d)&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,d)||X.tagNameCheck instanceof Function&&X.tagNameCheck(d))&&(X.attributeNameCheck instanceof RegExp&&se(X.attributeNameCheck,E)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(E,d))||E==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&se(X.tagNameCheck,k)||X.tagNameCheck instanceof Function&&X.tagNameCheck(k))))return!1}else if(!On[E]){if(!se(vt,ht(k,Be,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&d!=="script"&&fl(k,"data:")===0&&$a[d])){if(!(Da&&!se(J,ht(k,Be,"")))){if(k)return!1}}}}}}}return!0},Za=function(d){return d!=="annotation-xml"&&rn(d,Sn)},Xa=function(d){Re(T.beforeSanitizeAttributes,d,null);const{attributes:E}=d;if(!E||Rn(d))return;const k={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let z=E.length;for(;z--;){const ae=E[z],{name:Q,namespaceURI:me,value:De}=ae,st=ee(Q),Dn=De;let oe=Q==="value"?Dn:hl(Dn);if(k.attrName=st,k.attrValue=oe,k.keepAttr=!0,k.forceKeepAttr=void 0,Re(T.uponSanitizeAttribute,d,k),oe=k.attrValue,Pa&&(st==="id"||st==="name")&&(Ze(Q,d),oe=Lf+oe),jt&&se(/((--!?|])>)|<\/(style|title|textarea)/i,oe)){Ze(Q,d);continue}if(st==="attributename"&&rn(oe,"href")){Ze(Q,d);continue}if(k.forceKeepAttr)continue;if(!k.keepAttr){Ze(Q,d);continue}if(!La&&se(/\/>/i,oe)){Ze(Q,d);continue}ot&&Bt([B,R,U],Qa=>{oe=ht(oe,Qa," ")});const Ja=ee(d.nodeName);if(!Wa(Ja,st,oe)){Ze(Q,d);continue}if(w&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!me)switch(A.getAttributeType(Ja,st)){case"TrustedHTML":{oe=w.createHTML(oe);break}case"TrustedScriptURL":{oe=w.createScriptURL(oe);break}}if(oe!==Dn)try{me?d.setAttributeNS(me,Q,oe):d.setAttribute(Q,oe),Rn(d)?Ae(d):so(n.removed)}catch{Ze(Q,d)}}Re(T.afterSanitizeAttributes,d,null)},qf=function I(d){let E=null;const k=Ha(d);for(Re(T.beforeSanitizeShadowDOM,d,null);E=k.nextNode();)Re(T.uponSanitizeShadowNode,E,null),Ga(E),Xa(E),E.content instanceof r&&I(E.content);Re(T.afterSanitizeShadowDOM,d,null)};return n.sanitize=function(I){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,k=null,z=null,ae=null;if(Vn=!I,Vn&&(I="<!-->"),typeof I!="string"&&!Ya(I))if(typeof I.toString=="function"){if(I=I.toString(),typeof I!="string")throw pt("dirty is not a string, aborting")}else throw pt("toString is not a function");if(!n.isSupported)return I;if(An||Fn(d),n.removed=[],typeof I=="string"&&(St=!1),St){if(I.nodeName){const De=ee(I.nodeName);if(!O[De]||Ct[De])throw pt("root node is forbidden and cannot be sanitized in-place")}}else if(I instanceof l)E=Ka("<!---->"),k=E.ownerDocument.importNode(I,!0),k.nodeType===yt.element&&k.nodeName==="BODY"||k.nodeName==="HTML"?E=k:E.appendChild(k);else{if(!at&&!ot&&!We&&I.indexOf("<")===-1)return w&&zt?w.createHTML(I):I;if(E=Ka(I),!E)return at?null:zt?y:""}E&&Mn&&Ae(E.firstChild);const Q=Ha(St?I:E);for(;z=Q.nextNode();)Ga(z),Xa(z),z.content instanceof r&&qf(z.content);if(St)return I;if(at){if(qt)for(ae=V.call(E.ownerDocument);E.firstChild;)ae.appendChild(E.firstChild);else ae=E;return(Z.shadowroot||Z.shadowrootmode)&&(ae=M.call(a,ae,!0)),ae}let me=We?E.outerHTML:E.innerHTML;return We&&O["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&se(po,E.ownerDocument.doctype.name)&&(me="<!DOCTYPE "+E.ownerDocument.doctype.name+`>
|
|
2
|
+
`+me),ot&&Bt([B,R,U],De=>{me=ht(me,De," ")}),w&&zt?w.createHTML(me):me},n.setConfig=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fn(I),An=!0},n.clearConfig=function(){lt=null,An=!1},n.isValidAttribute=function(I,d,E){lt||Fn({});const k=ee(I),z=ee(d);return Wa(k,z,E)},n.addHook=function(I,d){typeof d=="function"&&ft(T[I],d)},n.removeHook=function(I,d){if(d!==void 0){const E=ml(T[I],d);return E===-1?void 0:ul(T[I],E,1)[0]}return so(T[I])},n.removeHooks=function(I){T[I]=[]},n.removeAllHooks=function(){T=yo()},n}var Il=bo();function Ol(){this.__data__=new Me,this.size=0}function Vl(e){var n=this.__data__,o=n.delete(e);return this.size=n.size,o}function Bl(e){return this.__data__.get(e)}function Fl(e){return this.__data__.has(e)}var Rl=200;function Dl(e,n){var o=this.__data__;if(o instanceof Me){var a=o.__data__;if(!ut||a.length<Rl-1)return a.push([e,n]),this.size=++o.size,this;o=this.__data__=new Ne(a)}return o.set(e,n),this.size=o.size,this}function Je(e){var n=this.__data__=new Me(e);this.size=n.size}Je.prototype.clear=Ol,Je.prototype.delete=Vl,Je.prototype.get=Bl,Je.prototype.has=Fl,Je.prototype.set=Dl;var Dt=function(){try{var e=qe(Object,"defineProperty");return e({},"",{}),e}catch{}}();function _o(e,n,o){n=="__proto__"&&Dt?Dt(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}var Ll=Object.prototype,Ul=Ll.hasOwnProperty;function Eo(e,n,o){var a=e[n];(!(Ul.call(e,n)&&It(a,o))||o===void 0&&!(n in e))&&_o(e,n,o)}function Lt(e,n,o,a){var i=!o;o||(o={});for(var r=-1,s=n.length;++r<s;){var l=n[r],c=void 0;c===void 0&&(c=e[l]),i?_o(o,l,c):Eo(o,l,c)}return o}function Pl(e,n){return e&&Lt(n,Mt(n),e)}function $l(e){var n=[];if(e!=null)for(var o in Object(e))n.push(o);return n}var xl=Object.prototype,vl=xl.hasOwnProperty;function jl(e){if(!fe(e))return $l(e);var n=Xt(e),o=[];for(var a in e)a=="constructor"&&(n||!vl.call(e,a))||o.push(a);return o}function Ut(e){return At(e)?Zn(e,!0):jl(e)}function ql(e,n){return e&&Lt(n,Ut(n),e)}var To=typeof L=="object"&&L&&!L.nodeType&&L,Co=To&&typeof module=="object"&&module&&!module.nodeType&&module,zl=Co&&Co.exports===To,So=zl?ge.Buffer:void 0,wo=So?So.allocUnsafe:void 0;function Kl(e,n){if(n)return e.slice();var o=e.length,a=wo?wo(o):new e.constructor(o);return e.copy(a),a}function Hl(e,n){var o=-1,a=e.length;for(n||(n=Array(a));++o<a;)n[o]=e[o];return n}function Yl(e,n){for(var o=-1,a=e==null?0:e.length,i=0,r=[];++o<a;){var s=e[o];n(s,o,e)&&(r[i++]=s)}return r}function ko(){return[]}var Gl=Object.prototype,Wl=Gl.propertyIsEnumerable,Ao=Object.getOwnPropertySymbols,mn=Ao?function(e){return e==null?[]:(e=Object(e),Yl(Ao(e),function(n){return Wl.call(e,n)}))}:ko;function Zl(e,n){return Lt(e,mn(e),n)}function Mo(e,n){for(var o=-1,a=n.length,i=e.length;++o<a;)e[i+o]=n[o];return e}var No=Xn(Object.getPrototypeOf,Object),Xl=Object.getOwnPropertySymbols,Io=Xl?function(e){for(var n=[];e;)Mo(n,mn(e)),e=No(e);return n}:ko;function Jl(e,n){return Lt(e,Io(e),n)}function Oo(e,n,o){var a=n(e);return $e(e)?a:Mo(a,o(e))}function Ql(e){return Oo(e,Mt,mn)}function es(e){return Oo(e,Ut,Io)}var un=qe(ge,"DataView"),fn=qe(ge,"Promise"),Qe=qe(ge,"Set"),hn=qe(ge,"WeakMap"),Vo="[object Map]",ts="[object Object]",Bo="[object Promise]",Fo="[object Set]",Ro="[object WeakMap]",Do="[object DataView]",ns=je(un),os=je(ut),as=je(fn),is=je(Qe),rs=je(hn),Ie=Ue;(un&&Ie(new un(new ArrayBuffer(1)))!=Do||ut&&Ie(new ut)!=Vo||fn&&Ie(fn.resolve())!=Bo||Qe&&Ie(new Qe)!=Fo||hn&&Ie(new hn)!=Ro)&&(Ie=function(e){var n=Ue(e),o=n==ts?e.constructor:void 0,a=o?je(o):"";if(a)switch(a){case ns:return Do;case os:return Vo;case as:return Bo;case is:return Fo;case rs:return Ro}return n});var ls=Object.prototype,ss=ls.hasOwnProperty;function ds(e){var n=e.length,o=new e.constructor(n);return n&&typeof e[0]=="string"&&ss.call(e,"index")&&(o.index=e.index,o.input=e.input),o}var Lo=ge.Uint8Array;function pn(e){var n=new e.constructor(e.byteLength);return new Lo(n).set(new Lo(e)),n}function cs(e,n){var o=n?pn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}var ms=/\w*$/;function us(e){var n=new e.constructor(e.source,ms.exec(e));return n.lastIndex=e.lastIndex,n}var Uo=Le?Le.prototype:void 0,Po=Uo?Uo.valueOf:void 0;function fs(e){return Po?Object(Po.call(e)):{}}function hs(e,n){var o=n?pn(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}var ps="[object Boolean]",gs="[object Date]",ys="[object Map]",bs="[object Number]",_s="[object RegExp]",Es="[object Set]",Ts="[object String]",Cs="[object Symbol]",Ss="[object ArrayBuffer]",ws="[object DataView]",ks="[object Float32Array]",As="[object Float64Array]",Ms="[object Int8Array]",Ns="[object Int16Array]",Is="[object Int32Array]",Os="[object Uint8Array]",Vs="[object Uint8ClampedArray]",Bs="[object Uint16Array]",Fs="[object Uint32Array]";function Rs(e,n,o){var a=e.constructor;switch(n){case Ss:return pn(e);case ps:case gs:return new a(+e);case ws:return cs(e,o);case ks:case As:case Ms:case Ns:case Is:case Os:case Vs:case Bs:case Fs:return hs(e,o);case ys:return new a;case bs:case Ts:return new a(e);case _s:return us(e);case Es:return new a;case Cs:return fs(e)}}var $o=Object.create,Ds=function(){function e(){}return function(n){if(!fe(n))return{};if($o)return $o(n);e.prototype=n;var o=new e;return e.prototype=void 0,o}}();function Ls(e){return typeof e.constructor=="function"&&!Xt(e)?Ds(No(e)):{}}var Us="[object Map]";function Ps(e){return Pe(e)&&Ie(e)==Us}var xo=Xe&&Xe.isMap,$s=xo?Wt(xo):Ps,xs="[object Set]";function vs(e){return Pe(e)&&Ie(e)==xs}var vo=Xe&&Xe.isSet,js=vo?Wt(vo):vs,qs=1,zs=2,Ks=4,jo="[object Arguments]",Hs="[object Array]",Ys="[object Boolean]",Gs="[object Date]",Ws="[object Error]",qo="[object Function]",Zs="[object GeneratorFunction]",Xs="[object Map]",Js="[object Number]",zo="[object Object]",Qs="[object RegExp]",ed="[object Set]",td="[object String]",nd="[object Symbol]",od="[object WeakMap]",ad="[object ArrayBuffer]",id="[object DataView]",rd="[object Float32Array]",ld="[object Float64Array]",sd="[object Int8Array]",dd="[object Int16Array]",cd="[object Int32Array]",md="[object Uint8Array]",ud="[object Uint8ClampedArray]",fd="[object Uint16Array]",hd="[object Uint32Array]",j={};j[jo]=j[Hs]=j[ad]=j[id]=j[Ys]=j[Gs]=j[rd]=j[ld]=j[sd]=j[dd]=j[cd]=j[Xs]=j[Js]=j[zo]=j[Qs]=j[ed]=j[td]=j[nd]=j[md]=j[ud]=j[fd]=j[hd]=!0,j[Ws]=j[qo]=j[od]=!1;function bt(e,n,o,a,i,r){var s,l=n&qs,c=n&zs,m=n&Ks;if(s!==void 0)return s;if(!fe(e))return e;var f=$e(e);if(f){if(s=ds(e),!l)return Hl(e,s)}else{var h=Ie(e),b=h==qo||h==Zs;if(Kn(e))return Kl(e,l);if(h==zo||h==jo||b&&!i){if(s=c||b?{}:Ls(e),!l)return c?Jl(e,ql(s,e)):Zl(e,Pl(s,e))}else{if(!j[h])return i?e:{};s=Rs(e,h,l)}}r||(r=new Je);var A=r.get(e);if(A)return A;r.set(e,s),js(e)?e.forEach(function(C){s.add(bt(C,n,o,C,e,r))}):$s(e)&&e.forEach(function(C,S){s.set(S,bt(C,n,o,S,e,r))});var F=m?c?es:Ql:c?Ut:Mt,u=f?void 0:F(e);return Ln(u||e,function(C,S){u&&(S=C,C=e[S]),Eo(s,S,bt(C,n,o,S,e,r))}),s}var pd=1,gd=4;function Oe(e){return bt(e,pd|gd)}const gn=(e,n="")=>typeof e.id<"u"?n+e.id+"":n+(e.inputName||e.label||e.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,""),Ko=(e="")=>e.toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"");var yd="[object String]";function He(e){return typeof e=="string"||!$e(e)&&Pe(e)&&Ue(e)==yd}const Ho={methods:{getFieldRowClasses(e){const n=this.fieldErrors(e).length>0,o={[P(this.options,"validationErrorClass","error")]:n,[P(this.options,"validationSuccessClass","valid")]:!n,disabled:this.fieldDisabled(e),readonly:this.fieldReadonly(e),featured:this.fieldFeatured(e),required:this.fieldRequired(e)};return Array.isArray(e.styleClasses)?ie(e.styleClasses,a=>o[a]=!0):He(e.styleClasses)&&(o[e.styleClasses]=!0),G(e.type)||(o["field-"+e.type]=!0),o},fieldErrors(e){return this.errors.filter(o=>o.field.fieldName===e.fieldName).map(o=>o.error)},fieldDisabled(e){return x(e.disabled)?e.disabled.call(this,this.model,e,this):G(e.disabled)?!1:e.disabled},fieldReadonly(e){return x(e.readonly)?e.readonly.call(this,this.model,e,this):G(e.readonly)?!1:e.readonly},fieldFeatured(e){return x(e.featured)?e.featured.call(this,this.model,e,this):G(e.featured)?!1:e.featured},fieldRequired(e){return x(e.required)?e.required.call(this,this.model,e,this):G(e.required)?!1:e.required}}};var yn=function(){return ge.Date.now()},bd=/\s/;function _d(e){for(var n=e.length;n--&&bd.test(e.charAt(n)););return n}var Ed=/^\s+/;function Td(e){return e&&e.slice(0,_d(e)+1).replace(Ed,"")}var Yo=NaN,Cd=/^[-+]0x[0-9a-f]+$/i,Sd=/^0b[01]+$/i,wd=/^0o[0-7]+$/i,kd=parseInt;function bn(e){if(typeof e=="number")return e;if(Nt(e))return Yo;if(fe(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=fe(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Td(e);var o=Sd.test(e);return o||wd.test(e)?kd(e.slice(2),o?2:8):Cd.test(e)?Yo:+e}var Ad="Expected a function",Md=Math.max,Nd=Math.min;function et(e,n,o){var a,i,r,s,l,c,m=0,f=!1,h=!1,b=!0;if(typeof e!="function")throw new TypeError(Ad);n=bn(n)||0,fe(o)&&(f=!!o.leading,h="maxWait"in o,r=h?Md(bn(o.maxWait)||0,n):r,b="trailing"in o?!!o.trailing:b);function A(g){var p=a,V=i;return a=i=void 0,m=g,s=e.apply(V,p),s}function F(g){return m=g,l=setTimeout(S,n),f?A(g):s}function u(g){var p=g-c,V=g-m,v=n-p;return h?Nd(v,r-V):v}function C(g){var p=g-c,V=g-m;return c===void 0||p>=n||p<0||h&&V>=r}function S(){var g=yn();if(C(g))return N(g);l=setTimeout(S,u(g))}function N(g){return l=void 0,b&&a?A(g):(a=i=void 0,s)}function _(){l!==void 0&&clearTimeout(l),m=0,a=c=i=l=void 0}function w(){return l===void 0?s:N(yn())}function y(){var g=yn(),p=C(g);if(a=arguments,i=this,c=g,p){if(l===void 0)return F(c);if(h)return clearTimeout(l),l=setTimeout(S,n),A(c)}return l===void 0&&(l=setTimeout(S,n)),s}return y.cancel=_,y.flush=w,y}var Id="__lodash_hash_undefined__";function Od(e){return this.__data__.set(e,Id),this}function Vd(e){return this.__data__.has(e)}function Pt(e){var n=-1,o=e==null?0:e.length;for(this.__data__=new Ne;++n<o;)this.add(e[n])}Pt.prototype.add=Pt.prototype.push=Od,Pt.prototype.has=Vd;function Bd(e,n,o,a){for(var i=e.length,r=o+-1;++r<i;)if(n(e[r],r,e))return r;return-1}function Fd(e){return e!==e}function Rd(e,n,o){for(var a=o-1,i=e.length;++a<i;)if(e[a]===n)return a;return-1}function Dd(e,n,o){return n===n?Rd(e,n,o):Bd(e,Fd,o)}function Ld(e,n){var o=e==null?0:e.length;return!!o&&Dd(e,n,0)>-1}function Ud(e,n){return e.has(n)}function Pd(){}function Go(e){var n=-1,o=Array(e.size);return e.forEach(function(a){o[++n]=a}),o}var $d=1/0,xd=Qe&&1/Go(new Qe([,-0]))[1]==$d?function(e){return new Qe(e)}:Pd,vd=200;function jd(e,n,o){var a=-1,i=Ld,r=e.length,s=!0,l=[],c=l;if(r>=vd){var m=xd(e);if(m)return Go(m);s=!1,i=Ud,c=new Pt}else c=l;e:for(;++a<r;){var f=e[a],h=f;if(f=f!==0?f:0,s&&h===h){for(var b=c.length;b--;)if(c[b]===h)continue e;l.push(f)}else i(c,h,o)||(c!==l&&c.push(h),l.push(f))}return l}function Wo(e){return e&&e.length?jd(e):[]}var qd=0;function Zo(e){var n=++qd;return no(e)+n}var Xo=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,xe="\\d\\d?",ve="\\d\\d",zd="\\d{3}",Kd="\\d{4}",_t="[^\\s]+",Jo=/\[([^]*?)\]/gm;function Qo(e,n){for(var o=[],a=0,i=e.length;a<i;a++)o.push(e[a].substr(0,n));return o}var ea=function(e){return function(n,o){var a=o[e].map(function(r){return r.toLowerCase()}),i=a.indexOf(n.toLowerCase());return i>-1?i:null}};function Ye(e){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];for(var a=0,i=n;a<i.length;a++){var r=i[a];for(var s in r)e[s]=r[s]}return e}var ta=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],na=["January","February","March","April","May","June","July","August","September","October","November","December"],Hd=Qo(na,3),Yd=Qo(ta,3),oa={dayNamesShort:Yd,dayNames:ta,monthNamesShort:Hd,monthNames:na,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},$t=Ye({},oa),Gd=function(e){return $t=Ye($t,e)},aa=function(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},ce=function(e,n){for(n===void 0&&(n=2),e=String(e);e.length<n;)e="0"+e;return e},Wd={D:function(e){return String(e.getDate())},DD:function(e){return ce(e.getDate())},Do:function(e,n){return n.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return ce(e.getDay())},ddd:function(e,n){return n.dayNamesShort[e.getDay()]},dddd:function(e,n){return n.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return ce(e.getMonth()+1)},MMM:function(e,n){return n.monthNamesShort[e.getMonth()]},MMMM:function(e,n){return n.monthNames[e.getMonth()]},YY:function(e){return ce(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return ce(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return ce(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return ce(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return ce(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return ce(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return ce(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return ce(e.getMilliseconds(),3)},a:function(e,n){return e.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(e,n){return e.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60)*100+Math.abs(n)%60,4)},Z:function(e){var n=e.getTimezoneOffset();return(n>0?"-":"+")+ce(Math.floor(Math.abs(n)/60),2)+":"+ce(Math.abs(n)%60,2)}},ia=function(e){return+e-1},ra=[null,xe],la=[null,_t],sa=["isPm",_t,function(e,n){var o=e.toLowerCase();return o===n.amPm[0]?0:o===n.amPm[1]?1:null}],da=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var n=(e+"").match(/([+-]|\d\d)/gi);if(n){var o=+n[1]*60+parseInt(n[2],10);return n[0]==="+"?o:-o}return 0}],Zd={D:["day",xe],DD:["day",ve],Do:["day",xe+_t,function(e){return parseInt(e,10)}],M:["month",xe,ia],MM:["month",ve,ia],YY:["year",ve,function(e){var n=new Date,o=+(""+n.getFullYear()).substr(0,2);return+(""+(+e>68?o-1:o)+e)}],h:["hour",xe,void 0,"isPm"],hh:["hour",ve,void 0,"isPm"],H:["hour",xe],HH:["hour",ve],m:["minute",xe],mm:["minute",ve],s:["second",xe],ss:["second",ve],YYYY:["year",Kd],S:["millisecond","\\d",function(e){return+e*100}],SS:["millisecond",ve,function(e){return+e*10}],SSS:["millisecond",zd],d:ra,dd:ra,ddd:la,dddd:la,MMM:["month",_t,ea("monthNamesShort")],MMMM:["month",_t,ea("monthNames")],a:sa,A:sa,ZZ:da,Z:da},xt={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Xd=function(e){return Ye(xt,e)},Jd=function(e,n,o){if(n===void 0&&(n=xt.default),o===void 0&&(o={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");n=xt[n]||n;var a=[];n=n.replace(Jo,function(r,s){return a.push(s),"@@@"});var i=Ye(Ye({},$t),o);return n=n.replace(Xo,function(r){return Wd[r](e,i)}),n.replace(/@@@/g,function(){return a.shift()})};function Qd(e,n,o){if(o===void 0&&(o={}),typeof n!="string")throw new Error("Invalid format in fecha parse");if(n=xt[n]||n,e.length>1e3)return null;var a=new Date,i={year:a.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],s=[],l=n.replace(Jo,function(w,y){return s.push(aa(y)),"@@@"}),c={},m={};l=aa(l).replace(Xo,function(w){var y=Zd[w],g=y[0],p=y[1],V=y[3];if(c[g])throw new Error("Invalid format. "+g+" specified twice in format");return c[g]=!0,V&&(m[V]=!0),r.push(y),"("+p+")"}),Object.keys(m).forEach(function(w){if(!c[w])throw new Error("Invalid format. "+w+" is required in specified format")}),l=l.replace(/@@@/g,function(){return s.shift()});var f=e.match(new RegExp(l,"i"));if(!f)return null;for(var h=Ye(Ye({},$t),o),b=1;b<f.length;b++){var A=r[b-1],F=A[0],u=A[2],C=u?u(f[b],h):+f[b];if(C==null)return null;i[F]=C}i.isPm===1&&i.hour!=null&&+i.hour!=12?i.hour=+i.hour+12:i.isPm===0&&+i.hour==12&&(i.hour=0);var S;if(i.timezoneOffset==null){S=new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond);for(var N=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],b=0,_=N.length;b<_;b++)if(c[N[b][0]]&&i[N[b][0]]!==S[N[b][1]]())return null}else if(S=new Date(Date.UTC(i.year,i.month,i.day,i.hour,i.minute-i.timezoneOffset,i.second,i.millisecond)),i.month>11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return S}var tt={format:Jd,parse:Qd,defaultI18n:oa,setGlobalDateI18n:Gd,setGlobalDateMasks:Xd};function ec(e,n,o){switch(o.length){case 0:return e.call(n);case 1:return e.call(n,o[0]);case 2:return e.call(n,o[0],o[1]);case 3:return e.call(n,o[0],o[1],o[2])}return e.apply(n,o)}var ca=Math.max;function tc(e,n,o){return n=ca(n===void 0?e.length-1:n,0),function(){for(var a=arguments,i=-1,r=ca(a.length-n,0),s=Array(r);++i<r;)s[i]=a[n+i];i=-1;for(var l=Array(n+1);++i<n;)l[i]=a[i];return l[n]=o(s),ec(e,this,l)}}function nc(e){return function(){return e}}var oc=Dt?function(e,n){return Dt(e,"toString",{configurable:!0,enumerable:!1,value:nc(n),writable:!0})}:Jt,ac=800,ic=16,rc=Date.now;function lc(e){var n=0,o=0;return function(){var a=rc(),i=ic-(a-o);if(o=a,i>0){if(++n>=ac)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var sc=lc(oc);function dc(e,n){return sc(tc(e,n,Jt),e+"")}function cc(e,n,o){if(!fe(o))return!1;var a=typeof n;return(a=="number"?At(o)&&Hn(n,o.length):a=="string"&&n in o)?It(o[n],e):!1}var ma=Object.prototype,mc=ma.hasOwnProperty,uc=dc(function(e,n){e=Object(e);var o=-1,a=n.length,i=a>2?n[2]:void 0;for(i&&cc(n[0],n[1],i)&&(a=1);++o<a;)for(var r=n[o],s=Ut(r),l=-1,c=s.length;++l<c;){var m=s[l],f=e[m];(f===void 0||It(f,ma[m])&&!mc.call(e,m))&&(e[m]=r[m])}return e}),fc=ge.isFinite;function ua(e){return typeof e=="number"&&fc(e)}var fa=1/0,hc=17976931348623157e292;function pc(e){if(!e)return e===0?e:0;if(e=bn(e),e===fa||e===-fa){var n=e<0?-1:1;return n*hc}return e===e?e:0}function gc(e){var n=pc(e),o=n%1;return n===n?o?n-o:n:0}function yc(e){return typeof e=="number"&&e==gc(e)}var bc="[object Number]";function _n(e){return typeof e=="number"||Pe(e)&&Ue(e)==bc}const pe={general:{packageName:"forms",disable_global_radio:"The plugin is set to 'Scoped' by default when configured under a {scope}. To configure a global plugin, navigate to the global plugin list page.",disable_source_scope_change:"Changing the {scope} is not allowed when configuring a plugin under it."},"post-function":{tags:{hint:"e.g. tag1, tag2, tag3",newElementButtonLabel:"+ Add"},enabled:{newElementButtonLabel:"+ Add"},selectionGroup:{newElementButtonLabel:"+ Add"},instance_name:{newElementButtonLabel:"+ Add"},name:{newElementButtonLabel:"+ Add"},"config-certificate":{help:"Array of stringified Lua code to be cached and run in sequence during the certificate phase.",newElementButtonLabel:"+ Add"},"config-access":{help:"Array of stringified Lua code to be cached and run in sequence during the access phase.",newElementButtonLabel:"+ Add"},"config-body_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the body_filter phase.",newElementButtonLabel:"+ Add"},"config-header_filter":{help:"Array of stringified Lua code to be cached and run in sequence during the header_filter phase.",newElementButtonLabel:"+ Add"},"config-functions":{newElementButtonLabel:"+ Add"},"config-log":{newElementButtonLabel:"+ Add"},"config-rewrite":{newElementButtonLabel:"+ Add"},"config-ws_client_frame":{newElementButtonLabel:"+ Add"},"config-ws_close":{newElementButtonLabel:"+ Add"},"config-ws_handshake":{newElementButtonLabel:"+ Add"},"config-ws_upstream_frame":{newElementButtonLabel:"+ Add"}},"exit-transformer":{"config-functions":{newElementButtonLabel:"+ Add"}},rla:{view_advanced:"View advanced parameters",window_type:{label:"Rate Limit Window Type",help:"Sets the time window type to either <code>sliding</code> (default) or <code>fixed</code>.<br><ul><li>Sliding windows apply the rate limiting logic while taking into account previous hit rates (from the window that immediately precedes the current) using a dynamic weight.</li><li>Fixed windows consist of buckets that are statically assigned to a definitive time range, each request is mapped to only one fixed window based on its timestamp and will affect only that window's counters.</li></ul>",options:{fixed:"Fixed",sliding:"Sliding"}},request_limits:{title:"Request Limits",subtitle:"Set one or more limits on the number of API requests allowed within a defined timeframe.",label:"Limit",label_index:"Limit {index}",request_number:"Request number",time_interval:"Time interval",interval_determiner:"Every",seconds:"Seconds"},start_with_a_use_case:"Start with a use case:",use_case_index:"Use case {index}",error_message:{label:"Error Message",code_placeholder:"Code Message",message_placeholder:"Error Message",help:"Set a custom error code and message to be returned when the rate limit is exceeded."},identifiers:{label:"Identifiers",options:{ip:"IP",credential:"Credential",consumer:"Consumer",service:"Service",header:"Header",path:"Path","consumer-group":"Consumer Group",route:"Route"}},redis:{title:"Configure your Redis",address_example:"e.g. localhost:6379"}},validators:{field_is_required:"This field is required",invalid_format:"Invalid format",number_too_small:"The number is too small. Minimum: {0}",number_too_large:"The number is too large. Maximum: {0}",invalid_number:"Invalid number",invalid_integer:"The value is not an integer",text_too_short:"The length of text is too short. Current: {0}, Minimum: {1}",text_too_long:"The length of text is too long. Current: {0}, Maximum: {1}",this_not_text:"This is not a text",this_not_array:"This is not an array",select_min_items:"Select minimum {0} items",select_max_items:"Select maximum {0} items",invalid_date:"Invalid date",date_is_early:"The date is too early. Current: {0}, Minimum: {1}",date_is_late:"The date is too late. Current: {0}, Maximum: {1}",invalid_email:"Invalid e-mail address",invalid_url:"Invalid URL",invalid_card:"Invalid card format",invalid_card_number:"Invalid card number",invalid_text_contain_number:"Invalid text - cannot contains numbers or special characters",invalid_tex_contain_spec:"Invalid text - cannot contains special characters"},redis:{title:"Redis Configuration",shared_configuration:{label:"Use shared configuration",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins.",title:"Shared Redis Configuration",error:"Fetching shared Redis configurations failed.",tooltip:"Only compatible {type} redis configurations will be listed here.",configuration_selector_label:"Select stored Redis configuration",configuration_selector_placeholder:"Pick Redis configuration",create_new_configuration:"New {type} shared configuration",empty_state:"No shared configurations",badge:"Recommended",selector:{title:"Select a Redis configuration",placeholder:"Filter Configurations",description:"Select an existing shared Redis configuration or create a new one. Any updates to this configuration will automatically apply to all associated plugins."}},dedicated_configuration:{label:"Use dedicated configuration",description:"Create a Redis configuration exclusively for this plugin, with settings that won’t impact other plugins.",title:"Connection Settings"},config_card:{common_fields:{created_at_label:"Created at",updated_at_label:"Last Updated at",type_label:"Redis Type"}},custom_plugin:{alert:"Note: For custom plugins, we cannot determine the correct Redis configuration type. Please ensure you select the appropriate option manually.",tooltip:"To apply a shared redis configuration, the redis fields must defined as Kong plugins in plugin schema."}},fields:{auto_suggest:{error:{load_entity:"There was an error loading {entity}"},recently_created:"Recently created {entity}",items_count:"Currently showing {count} {count, plural, =1 {item} other {items}}, type to search",no_results:"No results",loading:"Loading..."}},vfg:{labels:{on:"On",off:"Off"}}},{t:W}=ue.createI18n("en-us",pe),ne={fieldIsRequired:W("validators.field_is_required"),invalidFormat:W("validators.invalid_format"),numberTooSmall:W("validators.number_too_small"),numberTooBig:W("validators.number_too_large"),invalidNumber:W("validators.invalid_number"),invalidInteger:W("validators.invalid_integer"),textTooSmall:W("validators.text_too_short"),textTooBig:W("validators.text_too_long"),thisNotText:W("validators.this_not_text"),thisNotArray:W("validators.this_not_array"),selectMinItems:W("validators.select_min_items"),selectMaxItems:W("validators.select_max_items"),invalidDate:W("validators.invalid_date"),dateIsEarly:W("validators.date_is_early"),dateIsLate:W("validators.date_is_late"),invalidEmail:W("validators.invalid_email"),invalidURL:W("validators.invalid_url"),invalidCard:W("validators.invalid_card"),invalidCardNumber:W("validators.invalid_card_number"),invalidTextContainNumber:W("validators.invalid_text_contain_number"),invalidTextContainSpec:W("validators.invalid_tex_contain_spec")},K=(e,...n)=>{if(e&&n.length>0)for(let o=0;o<n.length;o++)e=e.replace("{"+(o-1)+"}",String(n[o]||""));return e},be=(e,n,o=ne)=>G(e)||e===""?n?[K(o.fieldIsRequired)]:[]:null,Ge={required:(e,n,o,a=ne)=>be(e,n.required,a)||[],number:(e,n,o,a=ne)=>{let i=be(e,n.required,a);return i!=null||(i=[],ua(e)?(!G(n.min)&&e<n.min,(a=ne)&&i.push(K(a.numberTooSmall,n.min)),!G(n.max)&&e>n.max,(a=ne)&&i.push(K(a.numberTooBig,n.max))):i.push(K(a.invalidNumber))),i},integer:(e,n,o,a=ne)=>{let i=be(e,n.required,a);return i!=null||(i=[],i.concat(Ge.number(e,n,o,a)),yc(e)||i.push(K(a.invalidInteger))),i},double:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(!_n(e)||isNaN(e)?[K(a.invalidNumber)]:[])},string:(e,n,o,a=ne)=>{let i=be(e,n.required,a);return i!=null||(i=[],He(e)?(!G(n.min)&&e.length<n.min&&i.push(K(a.textTooSmall,e.length,n.min)),!G(n.max)&&e.length>n.max&&i.push(K(a.textTooBig,e.length,n.max))):i.push(K(a.thisNotText))),i},array:(e,n,o,a=ne)=>{if(n.required){if(!Array.isArray(e))return[K(a.thisNotArray)];if(e.length===0)return[K(a.fieldIsRequired)]}if(!G(e)){if(!G(n.min)&&e.length<n.min)return[K(a.selectMinItems,n.min)];if(!G(n.max)&&e.length>n.max)return[K(a.selectMaxItems,n.max)]}return[]},date:(e,n,o,a=ne)=>{let i=be(e,n.required,a);if(i!=null)return i;i=[];const r=new Date(e);if(isNaN(r.getDate()))return[K(a.invalidDate)];if(!G(n.min)){const s=new Date(n.min);r.valueOf()<s.valueOf()&&i.push(K(a.dateIsEarly,tt.format(r),tt.format(s)))}if(!G(n.max)){const s=new Date(n.max);r.valueOf()>s.valueOf()&&i.push(K(a.dateIsLate,tt.format(r),tt.format(s)))}return i},regexp:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(!G(n.pattern)&&!new RegExp(n.pattern).test(e)?[K(a.invalidFormat)]:[])},email:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)?[]:[K(a.invalidEmail)])},url:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e)?[]:[K(a.invalidURL)])},creditCard:(e,n,o,a=ne)=>{const i=be(e,n.required,a);if(i!=null)return i;const r=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,s=e.replace(/[^0-9]+/g,"");if(!r.test(s))return[K(a.invalidCard)];let l=0,c,m,f;for(let h=s.length-1;h>=0;h--)c=s.substring(h,h+1),m=parseInt(c,10),f?(m*=2,m>=10?l+=m%10+1:l+=m):l+=m,f=!f;return l%10===0&&s?[]:[K(a.invalidCardNumber)]},alpha:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z]*$/.test(e)?[]:[K(a.invalidTextContainNumber)])},alphaNumeric:(e,n,o,a=ne)=>{const i=be(e,n.required,a);return i??(/^[a-zA-Z0-9]*$/.test(e)?[]:[K(a.invalidTextContainSpec)])}};Object.keys(Ge).forEach(e=>{const n=Ge[e];x(n)&&(n.locale=o=>(a,i,r)=>n(a,i,r,uc(o,ne)))});function ha(e){return He(e)?Ge[e]!=null?Ge[e]:(console.warn(`'${e}' is not a validator function!`),null):e}function En(e,n,o){let a=P(o.context,"schema.attributes",{});const i=n.value||"input";He(i)&&(a=P(a,i)||a),ie(a,(r,s)=>{e.setAttribute(s,r)})}const Te={name:"abstractField",props:["vfg","model","schema","formOptions","disabled"],emits:["validated","modelUpdated"],data(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null}},directives:{attributes:{beforeMount:En,updated:En,componentUpdated:En}},computed:{value:{cache:!1,get(){let e;return x(P(this.schema,"get"))?e=this.schema.get(this.model):e=P(this.model,this.schema.model),this.formatValueToField(e)},set(e){const n=this.value;e=this.formatValueToModel(e),x(e)?e(e,n):this.updateModelValue(e,n)}}},methods:{validate(e){this.clearValidationErrors();const n=P(this.formOptions,"validateAsync",!1);let o=[];if(this.schema.validator&&this.schema.readonly!==!0&&this.disabled!==!0){const i=[];Array.isArray(this.schema.validator)?ie(this.schema.validator,r=>{i.push(ha(r).bind(this))}):i.push(ha(this.schema.validator).bind(this)),ie(i,r=>{if(n)o.push(r(this.value,this.schema,this.model));else{const s=r(this.value,this.schema,this.model);s&&x(s.then)?s.then(l=>{l&&(this.errors=this.errors.concat(l));const c=this.errors.length===0;this.$emit("validated",c,this.errors,this)}):s&&(o=o.concat(s))}})}const a=i=>{let r=[];ie(Wo(i),l=>{Array.isArray(l)&&l.length>0?r=r.concat(l):He(l)&&r.push(l)}),x(this.schema.onValidated)&&this.schema.onValidated.call(this,this.model,r,this.schema);const s=r.length===0;return e||this.$emit("validated",s,r,this),this.errors=r,r};return n?Promise.all(o).then(a):a(o)},debouncedValidate(){x(this.debouncedValidateFunc)||(this.debouncedValidateFunc=et(this.validate.bind(this),P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},updateModelValue(e,n){let o=!1;x(this.schema.set)?(this.schema.set(this.model,e),o=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,e),o=!0),o&&(this.$emit("modelUpdated",e,this.schema.model),x(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,e,n,this.schema),P(this.formOptions,"validateAfterChanged",!1)===!0&&(P(this.schema,"validateDebounceTime",P(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors(){this.errors.splice(0)},setModelValueByPath(e,n){let o=e.replace(/\[(\w+)\]/g,".$1");o=o.replace(/^\./,"");let a=this.model;const i=o.split(".");let r=0;const s=i.length;for(;r<s;){const l=i[r];if(r<s-1)a[l]!==void 0||(a[l]={}),a=a[l];else{a[l]=n;return}++r}},getFieldID(e,n=!1){const o=P(this.formOptions,"fieldIdPrefix","");return gn(e,o)+(n?"-"+Zo():"")},getLabelId(e){return`${this.getFieldID(e)}-label`},getFieldClasses(){return P(this.schema,"fieldClasses",[])},formatValueToField(e){return e},formatValueToModel(e){return e}}},_c=Object.freeze(Object.defineProperty({__proto__:null,default:Te},Symbol.toStringTag,{value:"Module"})),$=(e,n)=>{const o=e.__vccOpts||e;for(const[a,i]of n)o[a]=i;return o},Ec={class:"advanced-field-dropdown-wrapper","data-testid":"advanced-field-dropdown-wrapper"},Tc={class:"material-icons"},Cc=$(Object.assign({mixins:[Te],emits:["model-updated"],expose:["validate","clearValidationErrors","schema"],data(){return{isOpen:!1}},computed:{openClass(){return this.isOpen?"open":"closed"},fieldCount(){return this.schema.fields.length},titleText(){return`${this.isOpen?"Hide":"View"} ${this.fieldCount} Advanced Fields`}},methods:{handleOpen(){this.isOpen=!this.isOpen},updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldAdvanced",setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",Ec,[t.createElementVNode("button",{class:"advanced-field-title",type:"button",onClick:o[0]||(o[0]=(...a)=>n.handleOpen&&n.handleOpen(...a))},[t.createElementVNode("i",Tc,t.toDisplayString(n.isOpen?"keyboard_arrow_up":"keyboard_arrow_right"),1),t.createElementVNode("span",null,t.toDisplayString(n.titleText),1)]),t.createElementVNode("div",{class:t.normalizeClass(["advanced-field-dropdown",n.openClass])},[t.createVNode(Y,{model:n.model,options:{helpAsHtml:!0},schema:n.schema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])],2)]))}}),[["__scopeId","data-v-e8f66c8a"]]),Sc={class:"array-card-container"},pa=$(t.defineComponent({__name:"FieldArrayCardContainer",props:{model:{type:Object,default:()=>null},schema:{type:Object,default:()=>null},index:{type:Number,default:void 0}},emits:["remove-item"],setup(e){const n=e;return t.provide("vfg-array-item-index",n.index),(o,a)=>{const i=t.resolveComponent("KCard"),r=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Sc,[t.createVNode(i,{class:"card"},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3}),t.createVNode(r,{appearance:"tertiary",class:"array-card-remove-button",onClick:a[0]||(a[0]=s=>o.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.TrashIcon))]),_:1})])}}}),[["__scopeId","data-v-97302224"]]),wc={class:"array-item-wrapper"},kc={class:"array-item"},Ac={class:"array-item-after"},ga=$(t.defineComponent({__name:"FieldArrayItem",props:{model:{type:String,default:""}},emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",wc,[t.createElementVNode("div",kc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"tertiary",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.TrashIcon))]),_:1})]),t.createElementVNode("div",Ac,[t.renderSlot(n.$slots,"after",{},void 0,!0)])])}}}),[["__scopeId","data-v-51d79db2"]]),Mc={class:"multi-item-wrapper"},ya=$(t.defineComponent({__name:"FieldArrayMultiItem",emits:["remove-item"],setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Mc,[t.renderSlot(n.$slots,"default",{},void 0,!0),t.createVNode(a,{appearance:"danger",class:"delete",onClick:o[0]||(o[0]=i=>n.$emit("remove-item"))},{default:t.withCtx(()=>[...o[1]||(o[1]=[t.createTextVNode(" - Remove Field ",-1)])]),_:1}),o[2]||(o[2]=t.createElementVNode("hr",null,null,-1))])}}}),[["__scopeId","data-v-b4fcf731"]]),Nc="#6c7489",Ic="12px",Oc="20px";var Vc=4;function ba(e){return bt(e,Vc)}const Bc=["data-testid","data-testlabel"],Fc={class:"item-label"},Rc={class:"autosuggest__results_message"},Dc=$(t.defineComponent({__name:"AutoSuggest",props:t.mergeModels({placeholder:{default:""},suggestions:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyMessage:{default:""},domId:{},error:{}},{id:{required:!0},idModifiers:{}}),emits:t.mergeModels(["change","query-change"],["update:id"]),setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.useModel(e,"id");return(a,i)=>{const r=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(r,{id:e.domId,ref:"suggestion",modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=s=>o.value=s),clearable:"",disabled:e.disabled,"enable-filtering":"",error:e.error!==null,"filter-function":()=>!0,help:e.error!==null?e.error:void 0,items:e.suggestions,loading:e.loading,placeholder:e.placeholder,width:"100%",onChange:i[1]||(i[1]=s=>a.$emit("change",s)),onQueryChange:i[2]||(i[2]=s=>a.$emit("query-change",s))},t.createSlots({"item-template":t.withCtx(({item:s})=>[t.renderSlot(a.$slots,"item",{item:s},()=>[t.createElementVNode("span",{class:"item-label","data-testid":s.id&&`${s.id}-0`,"data-testlabel":s.label},t.toDisplayString(s.label),9,Bc)],!0)]),"selected-item-template":t.withCtx(({item:s})=>[t.renderSlot(a.$slots,"selected-item",{item:s},()=>[t.createElementVNode("span",Fc,t.toDisplayString(s.label),1)],!0)]),empty:t.withCtx(()=>[t.createElementVNode("div",Rc,[t.createElementVNode("span",null,t.toDisplayString(e.emptyMessage||t.unref(n)("fields.auto_suggest.no_results")),1)])]),_:2},[a.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(a.$slots,"before",{},void 0,!0)]),key:"0"}:void 0]),1032,["id","modelValue","disabled","error","help","items","loading","placeholder"])}}}),[["__scopeId","data-v-9f6760b4"]]),Lc="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",Tn=e=>e?e.length===36&&new RegExp(`^${Lc}$`).test(e):!1,Uc=e=>({...e,label:e.name,value:e.id});function _a(e,n,o){return o?_e.SET_REFERRAL_VALUE:e&&!n||!e&&n?_e.UPDATE_ENTITY:e&&n?_e.CREATE_FROM_ENTITY:_e.CREATE_NOT_FROM_ENTITY}const Pc=500,$c=50,xc=t.defineComponent({__name:"FieldScopedEntitySelect",props:{transformItem:{type:Function,default:Uc},allowUuidSearch:{type:Boolean,default:!1},placeholder:{},fields:{default:()=>[]},selectedItem:{},selectedItemLoading:{type:Boolean},initialItemSelected:{type:Boolean},domId:{},id:{},entity:{},disabled:{type:Boolean},fieldDisabled:{type:Boolean},error:{},getAll:{type:Function},getPartial:{type:Function},getOne:{type:Function}},emits:["change"],setup(e){const n=t.ref(""),o=t.ref(!1),a=t.ref(!1),i=t.ref(""),r=t.ref([]),s=t.ref([]),l=t.ref([]),{t:c}=ue.createI18n("en-us",pe),m=t.ref(null);let f=null;const h=async(y,g)=>{if(!e.fieldDisabled){clearTimeout(f),f=setTimeout(()=>{o.value=!0},1500);try{const p=await y();s.value=p,r.value=s.value.map(e.transformItem)}catch(p){if(g!=null&&g.aborted)return;if(r.value=[],ei.isAxiosError(p)&&p.status===404){console.warn("unable to search with UUID",i.value,"for entity type",e.entity);return}n.value=p.message}finally{clearTimeout(f),o.value=!1}}},b=et(y=>{if(y=y||"",i.value=y,!y.trim()&&!a.value){r.value=N(l.value);return}m.value&&m.value.abort();const g=new AbortController;if(m.value=g,a.value){w(y);return}C(y,g)},Pc,{leading:!0}),A=async(y,g)=>await e.getAll(y,g),F=async()=>{const{data:{data:y,next:g,offset:p}}=await e.getPartial($c);return(!g||!p)&&(a.value=!0),s.value=y,l.value=y.map(V=>({...e.transformItem(V),group:c("fields.auto_suggest.recently_created",{entity:e.entity})})),y},u=async y=>[await e.getOne(y)],C=(y,g)=>{Tn(y)&&e.allowUuidSearch?h(async()=>await u(y)):h(async()=>await A(y,g.signal),g.signal)},S=y=>{let g=[];g=N(l.value),y!=null&&y.trim()?r.value=g.filter(p=>e.fields.some(V=>(p[V]||"").includes(y))):r.value=g},N=y=>e.selectedItem?y.some(g=>g.value===e.selectedItem.value)?y:[e.selectedItem,...y]:y,_=y=>{r.value=l.value.filter(g=>g.id===y)},w=y=>{Tn(y)&&e.allowUuidSearch?_(y):S(y)};return t.onMounted(async()=>{await h(F);const y=t.watch(()=>e.selectedItem,g=>{g&&(r.value=N(l.value)),y()});r.value=N(l.value)}),(y,g)=>(t.openBlock(),t.createBlock(Dc,{id:e.id,disabled:e.fieldDisabled,"dom-id":e.domId,"empty-message":n.value,error:e.error,loading:e.selectedItemLoading||o.value,placeholder:e.placeholder,readonly:e.disabled,suggestions:r.value,onChange:g[0]||(g[0]=p=>y.$emit("change",p)),onQueryChange:t.unref(b)},t.createSlots({"selected-item":t.withCtx(({item:p})=>[t.renderSlot(y.$slots,"selected-item",{item:p})]),item:t.withCtx(({item:p})=>[t.renderSlot(y.$slots,"item",{item:p})]),_:2},[y.$slots.before?{name:"before",fn:t.withCtx(()=>[t.renderSlot(y.$slots,"before")]),key:"0"}:void 0]),1032,["id","disabled","dom-id","empty-message","error","loading","placeholder","readonly","suggestions","onQueryChange"]))}}),vc=1e3,jc={components:{FieldScopedEntitySelect:xc,SearchIcon:Se.SearchIcon},mixins:[Te],inject:[re],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e,KUI_ICON_SIZE_40:Oc,KUI_COLOR_TEXT_NEUTRAL:Nc,EMPTY_VALUE_PLACEHOLDER:io}},data(){return{suggestions:[],idValue:"",message:"Type something to search",error:null,items:[],initialItem:null,selectedItem:null,loading:!1,dataDrained:!1}},computed:{fieldState(){return _a(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search},inputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},allowUuidSearch(){return this.inputFields.includes("id")},inputFieldsWithoutId(){return this.inputFields.filter(e=>e!=="id")},initialValueSelected(){var e;return this.idValue===((e=this.initialItem)==null?void 0:e.id)}},async created(){await this.$nextTick();let e,n;this.error=null;try{switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[re]){console.warn("[@kong-ui-public/forms] No API service provided");break}this.loading=!0,n=await this.getOne(this.model[this.schema.model]),e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}e&&(this.initialItem=this.transformItem(e),this.selectedItem=this.initialItem)}catch(o){this.message=this.t("fields.auto_suggest.error.load_entity",{entity:this.schema.entity}),this.error=o.message||this.message,console.error("err!",o)}finally{this.loading=!1}},methods:{getPartial(e){return this[re].peek(this.entity,e)},async getAll(e,n){return await this.fetchSuggestions(e,"name",n)},async getOne(e){if(!this[re])return console.warn("[@kong-ui-public/forms] No API service provided"),{};const n=await this[re].getOne(this.entity,e,{validateStatus:o=>o>=200&&o<300||o===404});if(n.status===404)throw new Error(`Entity of type ${this.entity} with id ${e} not found`);return n.data},transformItem(e){return{...e,label:this.getSuggestionLabel(e),value:e.id}},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e,n){if(!this[re])return console.warn("[@kong-ui-public/forms] No API service provided"),[];const o=this[re].getAllV2,{data:a}=await o(this.entity,{size:vc,...e},n);return a.data},async fetchSuggestions(e,n,o){return this.fetchUntilLimit({[n]:e},o)},getSuggestionLabel(e){var o;const n=((o=this.schema)==null?void 0:o.labelField)||"id";return n&&e?e[n]:""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.error=null,this.idValue=e&&e.id,this.selectedItem=e,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},qc={class:"entity-suggestion-item"},zc={class:"entity-label"},Kc={class:"entity-id"},Hc={class:"selected-entity-item"},Yc={class:"selected-entity-label"};function Gc(e,n,o,a,i,r){const s=t.resolveComponent("SearchIcon"),l=t.resolveComponent("FieldScopedEntitySelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:e.schema.disabledTooltip},{default:t.withCtx(()=>[t.createVNode(l,{id:i.idValue,"allow-uuid-search":r.allowUuidSearch,disabled:i.loading,"dom-id":e.schema.model,entity:r.entity,error:i.error,"field-disabled":e.schema.disabled,fields:r.inputFieldsWithoutId,"get-all":r.getAll,"get-one":r.getOne,"get-partial":r.getPartial,"initial-item-selected":r.initialValueSelected,placeholder:i.loading?a.t("fields.auto_suggest.loading"):e.schema.placeholder,"selected-item":i.selectedItem,"selected-item-loading":i.loading,"transform-item":r.transformItem,onChange:r.onSelected},{before:t.withCtx(()=>[t.createVNode(s,{color:a.KUI_COLOR_TEXT_NEUTRAL,size:a.KUI_ICON_SIZE_40},null,8,["color","size"])]),item:t.withCtx(({item:c})=>[t.createElementVNode("div",qc,[t.createElementVNode("span",zc,t.toDisplayString(c.label??a.EMPTY_VALUE_PLACEHOLDER),1),t.createElementVNode("span",Kc,t.toDisplayString(c.id),1)])]),"selected-item":t.withCtx(({item:c})=>[t.createElementVNode("span",Hc,[t.createElementVNode("span",Yc,t.toDisplayString(c.label??c.id),1)])]),_:1},8,["id","allow-uuid-search","disabled","dom-id","entity","error","field-disabled","fields","get-all","get-one","get-partial","initial-item-selected","placeholder","selected-item","selected-item-loading","transform-item","onChange"])]),_:1},8,["text"])}const Ea=$(jc,[["render",Gc],["__scopeId","data-v-6fe8b574"]]),Cn=50,Wc={mixins:[Te],inject:[re],emits:["model-updated"],setup(){const{t:e}=ue.createI18n("en-us",pe);return{t:e}},data(){return{suggestions:[],idValue:"",message:"Type something to search",items:[],initialItems:[],loading:!1}},computed:{fieldState(){return _a(this.model[this.schema.model],this.associatedEntity||this.entityId,this.bypassSearch)},associatedEntity(){return this.$route&&this.$route.params[this.entity]},entity(){return this.schema.entity},scope(){return this.schema.label.toLowerCase()},bypassSearch(){return this.$route&&this.$route.query&&this.$route.query.no_search}},async created(){await this.$nextTick();let e,n;switch(this.fieldState){case _e.UPDATE_ENTITY:if(!this[re]){console.warn("[@kong-ui-public/forms] No API service provided");break}n=(await this[re].getOne(this.entity,this.model[this.schema.model])).data,e=this.getItem(this.schema.entityDataKey?n[this.schema.entityDataKey]:n),this.idValue=e.id;break;case _e.CREATE_FROM_ENTITY:this.idValue=this.associatedEntity.id;break;case _e.SET_REFERRAL_VALUE:this.idValue=this.value}try{e&&(this.initialItems=[{...e,label:this.getSuggestionLabel(e),value:e.id}]),this.items=this.initialItems}catch(o){this.message=`There was an error loading ${this.schema.entity}`,console.error("err!",o)}},methods:{onQueryChange(e){e.trim().length===0&&(this.items=[],this.message="Type something to search"),typeof this.performSearch!="function"&&(this.performSearch=et(this.search,500)),this.performSearch(e)},async search(e){if(e.trim().length===0)return;this.loading=!0;const n=[],o=[],a=this.getInputFields(),i=new Set;Tn(e)&&a.includes("id")?o.push((async()=>{const r=await this.fetchExact(e);n.push({...r,label:this.getSuggestionLabel(r),value:r.id})})()):o.push(...a.filter(r=>r!=="id").map(async r=>{(await this.fetchSuggestions(e,r)).forEach(l=>{i.has(l.id)||(i.add(l.id),n.push({...l,label:this.getSuggestionLabel(l),value:l.id}))})})),await Promise.all(o),this.items=n,this.items.length===0&&(this.message="No results"),this.loading=!1},getItem(e){return e.data?e.data.length>0?e.data[0]:[]:e},async fetchUntilLimit(e){const n=[];let o=null;if(!this[re])return console.warn("[@kong-ui-public/forms] No API service provided"),[];for(;n.length<Cn;){const a=await this[re].getAll(this.entity,{size:Cn,offset:o,...e});if(n.push(...a.data.data),o=a.data.offset,!o)break}return n.slice(0,Cn)},async fetchSuggestions(e,n){return this.fetchUntilLimit({[n]:e})},async fetchExact(e){return this[re]?(await this[re].getOne(this.entity,e)).data:(console.warn("[@kong-ui-public/forms] No API service provided"),{})},getInputFields(){var e,n;return((n=(e=this.schema)==null?void 0:e.inputValues)==null?void 0:n.fields)||[]},getSuggestionLabel(e){const n=this.getInputFields();return n.length&&e?n.map(o=>e[o]).filter(Boolean).join(" - "):""},updateModel(e){this.$emit("model-updated",e!=null&&e.length?e:null,this.schema.model)},onSelected(e){this.idValue=e&&e.id,this.updateModel(this.getReturnValue(e||{}))},getReturnValue(e){var o;const n=(o=this.schema)==null?void 0:o.returnKey;return n?e[n]:e.id}}},Zc=["data-testid","data-testlabel"],Xc=["data-testid"],Jc={class:"autosuggest__results_message"};function Qc(e,n,o,a,i,r){const s=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.disabled?"k-tooltip":"div"),{class:"field-wrap autosuggest","max-width":"300",text:a.t("general.disable_source_scope_change",{scope:r.scope})},{default:t.withCtx(()=>[t.createVNode(s,{id:e.schema.model,ref:"suggestion",modelValue:i.idValue,"onUpdate:modelValue":n[0]||(n[0]=l=>i.idValue=l),clearable:"",disabled:e.schema.disabled,"enable-filtering":"","filter-function":()=>!0,items:i.items,loading:i.loading,placeholder:e.schema.placeholder,width:"100%",onChange:r.onSelected,onQueryChange:r.onQueryChange},{"item-template":t.withCtx(({item:l})=>[t.createElementVNode("span",{class:"first-part","data-testid":l.id&&`${l.id}-0`,"data-testlabel":l.label},t.toDisplayString(r.getSuggestionLabel(l).split(" - ")[0]),9,Zc),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.getSuggestionLabel(l).split(" - ").slice(1),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m,class:"field-span","data-testid":l.id&&`${l.id}-${m+1}`||m+1},t.toDisplayString(c),9,Xc))),128))]),empty:t.withCtx(()=>[t.createElementVNode("div",Jc,[t.createElementVNode("span",null,t.toDisplayString(i.message),1)])]),_:1},8,["id","modelValue","disabled","items","loading","placeholder","onChange","onQueryChange"])]),_:1},8,["text"])}const Ta=$(Wc,[["render",Qc],["__scopeId","data-v-8cfdc7f6"]]);function em(e){const n=t.ref([]),o=t.ref(null),a=u=>He(u)?Ge[u]!=null?Ge[u]:(console.warn(`'${u}' is not a validator function!`),null):u,i=t.computed({get(){var C,S;let u;return x(P(e.schema,"get"))?u=e.schema.get((C=e.model)==null?void 0:C.value):u=P((S=e.model)==null?void 0:S.value,e.schema.model),A(u)},set(u){const C=i;u=F(u),x(u)?u(u,C):l(u,C)}}),r=u=>{var _;c();const C=P(e.formOptions,"validateAsync",!1);let S=[];if(e.schema.readonly!==!0&&e.disabled!==!0){const w=[],y=(_=e.schema)==null?void 0:_.validator;y&&(Array.isArray(y)?ie(y,g=>{w.push(a(g))}):w.push(a(y))),x(e.externalValidator)&&w.push(e.externalValidator),ie(w,g=>{var p,V;if(C)S.push(g(i.value,e.schema,(p=e.model)==null?void 0:p.value));else{const v=g(i.value,e.schema,(V=e.model)==null?void 0:V.value);v&&x(v.then)?v.then(M=>{M&&(n.value=n.value.concat(M));const T=n.value.length===0;e.emitValidated&&e.emitValidated({isValid:T,errors:n.value,field:e.schema})}):v&&(S=S.concat(v))}})}const N=w=>{var g,p;let y=[];if(ie(Wo(w),V=>{Array.isArray(V)&&V.length>0?y=y.concat(V):He(V)&&y.push(V)}),x((g=e.schema)==null?void 0:g.onValidated)&&e.schema.onValidated((p=e.model)==null?void 0:p.value,y,e.schema),!u){const V=y.length===0;e.emitValidated&&e.emitValidated({isValid:V,errors:y,field:e.schema})}return w=y,y};return C?Promise.all(S).then(N):N(S)},s=()=>{x(o.value)?o.value():o.value=et(r,P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",500)))},l=(u,C)=>{var N,_,w;let S=!1;x(e.schema.set)?(e.schema.set((N=e.model)==null?void 0:N.value,u),S=!0):e.schema.model&&(m(e.schema.model,u),S=!0),S&&(e.emitModelUpdated&&((_=e.model)!=null&&_.value)&&e.emitModelUpdated({value:u,model:e.schema.model}),x(e.schema.onChanged)&&e.schema.onChanged((w=e.model)==null?void 0:w.value,u,C,e.schema),P(e.formOptions,"validateAfterChanged",!1)===!0&&(P(e.schema,"validateDebounceTime",P(e.formOptions,"validateDebounceTime",0))>0?s():r()))},c=()=>{n.value.splice(0)},m=(u,C)=>{var g;let S=u.replace(/\[(\w+)\]/g,".$1");S=S.replace(/^\./,"");let N=((g=e.model)==null?void 0:g.value)||{},_=0;const w=S.split("."),y=w.length;for(;_<y;){const p=w[_];if(_<y-1)N[p]!==void 0||(N[p]={}),N=N[p];else{N[p]=C;return}++_}},f=(u,C=!1)=>{const S=P(e.formOptions,"fieldIdPrefix","");return gn(u,S)+(C?"-"+Zo():"")},h=u=>`${f(u)}-label`,b=()=>P(e.schema,"fieldClasses",[]),A=u=>e.formatValueToField&&typeof e.formatValueToField=="function"?e.formatValueToField(u):u,F=u=>e.formatValueToModel&&typeof e.formatValueToModel=="function"?e.formatValueToModel(u):u;return{value:i,clearValidationErrors:c,getFieldID:f,getLabelId:h,getFieldClasses:b,updateModelValue:l}}function tm(e){const n=[],o=a=>{const i=["cluster-cache","cluster_cache"];for(const r of i)if(a.model.includes(r))return!1;return new RegExp("(?<=-redis-).*").test(a.model)};return e.fields.forEach(a=>{o(a)&&n.push(a)}),{redis:{id:"_redis",fields:n,model:"__redis_partial",redisType:e._supported_redis_partial_type,redisPath:e._redis_partial_path},redisModels:n.map(a=>a.model)}}function nm(e,n){const o=new RegExp("(?<=config-redis-).*"),a=/Config\.Redis.*/;return n.filter(r=>{const s=r.model.match(o);return s&&!Object.keys(e).includes(s[0])}).map(r=>{const s=r.label.match(a);return{label:s?s[0]:r.label,key:r.model,value:"N/A",type:"text"}})}const Ce={useAbstractFields:em,useRedisPartial:tm,useRedisNonStandardFields:nm},om={class:"form-field-wrapper"},Ca=$(t.defineComponent({__name:"FieldInput",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),s=t.inject(he,void 0),{updateModelValue:l,getFieldID:c,clearValidationErrors:m,value:f}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:_=>{i("modelUpdated",_.value,_.model)}});n({clearValidationErrors:m});const h=t.computed(()=>{var w,y;const _=(w=a.schema)==null?void 0:w.inputType.toLowerCase();if(_==="number"&&((y=a.schema)==null?void 0:y.referenceable)===!0)return"text";switch(_){case"string":return"text";case"datetime":return"datetime-local";default:return _||"text"}}),b={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"},A=(_,w)=>{var V,v;let y=_;const g=b[h.value]||"",p=tt.parse(_,g);p&&((V=a.schema)!=null&&V.format?y=tt.format(p,(v=a.schema)==null?void 0:v.format):y=p.valueOf()),l(y,w)},F=(_,w)=>{_n(_)||(_=NaN),l(_,w)},u=_=>{let w=_;switch(a.schema.inputType){case"number":case"range":ua(parseFloat(_))&&(w=parseFloat(_));break}f.value=w,l(w,_)},C=_=>{f.value=_,l(_,_)},S=t.ref(null),N=()=>{var _;x(S.value)&&((_=S.value)==null||_.flush())};return t.onMounted(()=>{switch(h.value){case"number":case"range":S.value=et((_,w)=>{F(_,w)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":S.value=et((_,w)=>{A(_,w)},parseInt(P(a.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break}}),t.onBeforeMount(()=>{h.value==="checkbox"?console.warn("The use of 'checkbox' inputType with 'input' type fields is deprecated. Use 'checkbox' type instead."):h.value==="radio"?console.warn("The use of 'radio' inputType with 'input' type fields is deprecated. Use 'radio' type instead."):h.value==="file"&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead.")}),(_,w)=>{const y=t.resolveComponent("KInput");return t.openBlock(),t.createElementBlock("div",om,[t.createVNode(y,t.mergeProps(_.$attrs,{id:t.unref(c)(e.schema),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:h.value==="color"||h.value==="range"?t.unref(f):void 0,max:e.schema.max,maxlength:e.schema.maxlength,min:e.schema.min,minlength:e.schema.minlength,"model-value":t.unref(f),name:e.schema.inputName,pattern:e.schema.pattern,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,"show-password-mask-toggle":h.value==="password",type:h.value,width:e.schema.width,onBlur:N,"onUpdate:modelValue":u}),null,16,["id","autocomplete","class","disabled","help","max","maxlength","min","minlength","model-value","name","pattern","placeholder","readonly","required","show-password-mask-toggle","type","width"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(s)),{schema:e.schema,update:C,value:t.unref(f)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-899b626c"]]),am={name:"FieldMetric",components:{AddIcon:Se.AddIcon,TrashIcon:Se.TrashIcon},mixins:[Te],emits:["remove-item"],data(){return{contentVisible:!1}}},im={key:0,class:"content"};function rm(e,n,o,a,i,r){const s=t.resolveComponent("AddIcon"),l=t.resolveComponent("TrashIcon"),c=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["field-dropdown",{active:i.contentVisible}])},[t.createElementVNode("div",{class:"title",onClick:n[0]||(n[0]=m=>i.contentVisible=!i.contentVisible)},[t.createTextVNode(t.toDisplayString(e.model.name?e.model.name:"New Item")+" ",1),t.createVNode(s,{class:"metric-add-icon"})]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[i.contentVisible?(t.openBlock(),t.createElementBlock("div",im,[t.renderSlot(e.$slots,"default"),t.createVNode(c,{appearance:"tertiary",class:"metric-remove-button",onClick:n[1]||(n[1]=m=>e.$emit("remove-item"))},{default:t.withCtx(()=>[t.createVNode(l)]),_:1})])):t.createCommentVNode("",!0)]),_:3})],2)}const Sa=$(am,[["render",rm]]),lm={class:"field-object-container"},sm={key:1},dm=["id"],cm={key:0},mm=["onUpdate:modelValue"],um={key:1},fm=["onUpdate:modelValue"],hm={key:2},pm=["onUpdate:modelValue"],gm=["onClick"],wa=$(Object.assign({mixins:[Te],emits:["modelUpdated"],expose:["validate","clearValidationErrors","schema"],data(){return{attributes:this.schema?this.schema.attributes:void 0,newKeyType:"string",newKeyName:"",keyTypes:{}}},created(){this.value||(this.value={})},mounted(){if(!this.value)return;const e=Object.keys(this.value),n={};for(let o=0;o<e.length;o++){const a=e[o];n[a]=typeof this.value[a]}this.keyTypes=n},methods:{removeElement(e){const n=this.value;delete n[e],this.value=JSON.parse(JSON.stringify(n));const o=this.keyTypes;delete o[e],this.keyTypes=JSON.parse(JSON.stringify(o))},addKey(){this.value[this.newKeyName]=void 0,this.value={...this.value},this.keyTypes[this.newKeyName]=this.newKeyType,this.keyTypes={...this.keyTypes},this.newKeyName=""},updateModel(e,n){this.$emit("modelUpdated",e,n)}}},{__name:"FieldObject",setup(e){return(n,o)=>{const a=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",lm,[n.schema.schema?(t.openBlock(),t.createBlock(Y,{key:0,model:n.value,options:n.formOptions,schema:n.schema.schema,onModelUpdated:n.updateModel},null,8,["model","options","schema","onModelUpdated"])):(t.openBlock(),t.createElementBlock("div",sm,[t.createElementVNode("table",{id:n.getFieldID(n.schema),class:t.normalizeClass(n.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("tr",{key:r},[t.createElementVNode("td",null,t.toDisplayString(r),1),n.keyTypes[r]==="string"?(t.openBlock(),t.createElementBlock("td",cm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,type:"text"},null,8,mm),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="boolean"?(t.openBlock(),t.createElementBlock("td",um,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,type:"checkbox"},null,8,fm),[[t.vModelCheckbox,n.value[r]]])])):t.createCommentVNode("",!0),n.keyTypes[r]==="number"?(t.openBlock(),t.createElementBlock("td",hm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,type:"number"},null,8,pm),[[t.vModelText,n.value[r]]])])):t.createCommentVNode("",!0),t.createElementVNode("td",null,[t.createElementVNode("input",{type:"button",value:"x",onClick:s=>n.removeElement(r)},null,8,gm)])]))),128))],10,dm),t.withDirectives(t.createElementVNode("select",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyType=i)},[...o[3]||(o[3]=[t.createElementVNode("option",{value:"string"}," String ",-1),t.createElementVNode("option",{value:"number"}," Number ",-1),t.createElementVNode("option",{value:"boolean"}," Boolean ",-1)])],512),[[t.vModelSelect,n.newKeyType]]),t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=i=>n.newKeyName=i),type:"text"},null,512),[[t.vModelText,n.newKeyName]]),t.createElementVNode("input",{type:"button",value:"Add key",onClick:o[2]||(o[2]=(...i)=>n.addKey&&n.addKey(...i))})]))])),[[a,n.attributes]])}}}),[["__scopeId","data-v-6eddb0ed"]]),ym=["id"],bm=["data-testid"],_m={class:"item-wrapper"},Em={class:"index-wrapper"},Tm={key:0},Cm={key:1},Sm=["onUpdate:modelValue","placeholder","type","onInput"],wm={key:0,class:"hint"},km={class:"input-item"},Am=["placeholder"],Mm={key:0,class:"hint"},ka=$(Object.assign({mixins:[Te],inject:{autofillSlot:{from:he,default:void 0}},emits:["model-updated"],expose:["validate","clearValidationErrors","schema"],data(){return{newKeyName:""}},computed:{subSchema(){return this.schema.schema&&this.schema.schema.fields[0].schema},subFields(){return!this.subSchema&&this.schema.fields},hasObjectKeys(){return this.value&&Object.keys(this.value).length>0},transformedModel(){return this.subSchema&&this.subSchema.fields.length>=1&&this.subSchema.fields[0].type==="array"?new Proxy(this.model[this.schema.model],{get:(e,n)=>({[this.schema.model]:e[n]}),set:(e,n,o)=>e[n]=o[this.schema.model]}):this.model[this.schema.model]},valueInputType(){var e;return["number","integer"].includes((e=this.schema.values)==null?void 0:e.type)?"number":"text"}},mounted(){this.value||(this.value={});let e=[];this.subSchema?e=this.subSchema.fields:this.subFields&&(e=this.schema.fields[0].schema),this.value=this.transformMapModelValuesToObject(this.model,e,this.schema.model)},methods:{removeElement(e){const n=this.value;delete n[e],this.value={...n}},transformMapModelValuesToObject(e,n,o){let a={};try{a=JSON.parse(JSON.stringify(e??{}))[o]??{}}catch{}return Object.keys(e).map(i=>{const r=i.indexOf(o+"-");if(r>-1&&Array.isArray(n))if(n.length>0){const l=i.split("-").filter(m=>n.find(f=>f.model===m)),c=i.split(`-${l}`)[0].split(`${o}-`)[1];l.length?a[c]={...a[c],[l]:e[i]}:a[i.substring(r+`${o}-`.length)]=e[i]}else a[i.substring(`${o}-`.length)]=e[i];else{const l=i.split("-").filter(m=>m===this.schema.model),c=i.split(`-${l}`)[0].split(`${o}-`)[1];c&&(a[c]=e[i])}return i}),a},addKey(){var a;const e=this.subSchema&&Array.isArray(this.subSchema.fields)&&this.subSchema.fields.length===1&&this.subSchema.fields[0].type==="array",n=((a=this.schema.values)==null?void 0:a.default)??(this.valueInputType==="number"?0:""),o=this.subSchema?e?[""]:{}:n;this.value[this.newKeyName]=o,this.newKeyName=""},updateModel(e,n){this.$emit("model-updated",this.model[this.schema.model],n)}}},{__name:"FieldObjectAdvanced",setup(e){return(n,o)=>{const a=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",{id:n.getFieldID(n.schema),class:t.normalizeClass(["object-advanced-wrapper",n.schema.fieldClasses])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,"data-testid":`field-object-key-${r}`},[t.createElementVNode("div",null,[t.createElementVNode("div",_m,[t.createElementVNode("div",Em,[t.createElementVNode("strong",null,t.toDisplayString(r),1),t.createElementVNode("div",null,[t.createVNode(a,{appearance:"tertiary",class:"delete",icon:"",type:"button",onClick:s=>n.removeElement(r)},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.TrashIcon))]),_:1},8,["onClick"])])]),o[1]||(o[1]=t.createElementVNode("hr",{class:"divider"},null,-1)),n.subSchema?(t.openBlock(),t.createElementBlock("div",Tm,[t.createVNode(Y,{model:n.transformedModel[r],options:{helpAsHtml:!0},schema:n.subSchema,onModelUpdated:n.updateModel},null,8,["model","schema","onModelUpdated"])])):(t.openBlock(),t.createElementBlock("div",Cm,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s=>n.value[r]=s,class:"form-control",placeholder:n.schema.fields&&n.schema.fields[0].schema.placeholder,type:n.valueInputType,onInput:s=>n.updateModel(n.value[r],n.model[n.schema.model])},null,40,Sm),[[t.vModelDynamic,n.value[r]]]),n.schema.fields&&n.schema.fields[0].schema.hint?(t.openBlock(),t.createElementBlock("p",wm,t.toDisplayString(n.schema.fields[0].schema.hint),1)):t.createCommentVNode("",!0),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.autofillSlot),{schema:n.schema.fields&&n.schema.fields[0].schema||n.schema.values,update:s=>n.value[r]=s,value:n.value[r]},null,8,["schema","update","value"]))])),o[2]||(o[2]=t.createElementVNode("hr",{class:"wide-divider"},null,-1))])])],8,bm))),128)),t.createElementVNode("div",{class:t.normalizeClass(["input-wrapper",{indent:n.hasObjectKeys}])},[t.createElementVNode("div",km,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=i=>n.newKeyName=i),class:"form-control","data-testid":"keyname-input",placeholder:n.schema.placeholder,type:"text"},null,8,Am),[[t.vModelText,n.newKeyName]]),t.createVNode(a,{appearance:"tertiary","data-testid":"add-key",disabled:!n.newKeyName,onClick:n.addKey},{default:t.withCtx(()=>[t.createTextVNode(" + Add "+t.toDisplayString(n.schema.buttonLabel||n.schema.label),1)]),_:1},8,["disabled","onClick"])]),n.schema.hintText?(t.openBlock(),t.createElementBlock("p",Mm,t.toDisplayString(n.schema.hintText),1)):t.createCommentVNode("",!0)],2)],10,ym)}}}),[["__scopeId","data-v-0faeec4d"]]),Nm={class:"radio-selection-group"},Aa=$(t.defineComponent({__name:"FieldRadio",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{updateModelValue:s,value:l,clearValidationErrors:c}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:f=>{i("modelUpdated",f.value,f.model)}});n({clearValidationErrors:c});const m=f=>{let h=f;typeof f=="string"&&(h=f.split(","),a.schema.array||(h=h.toString())),s(h,f)};return(f,h)=>{const b=t.resolveComponent("KRadio");return t.openBlock(),t.createElementBlock("div",Nm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.schema.values,(A,F)=>(t.openBlock(),t.createBlock(b,{id:e.schema.name+"-"+F,key:A.value,modelValue:t.unref(l),"onUpdate:modelValue":h[0]||(h[0]=u=>t.isRef(l)?l.value=u:null),label:A.name,"label-attributes":{info:e.schema.help},name:e.schema.name,required:e.schema.required||void 0,"selected-value":A.value,onChange:m},null,8,["id","modelValue","label","label-attributes","name","required","selected-value"]))),128))])}}}),[["__scopeId","data-v-42b9c6ac"]]),Ma=t.defineComponent({__name:"FieldSelect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.computed(()=>a.schema.selectOptions||{}),s=u=>G(u)?null:u,l=t.toRefs(a),{getFieldID:c,clearValidationErrors:m,value:f}=Ce.useAbstractFields({model:l.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:s,emitModelUpdated:u=>{i("modelUpdated",u.value,u.model)}});n({clearValidationErrors:m});const h=t.computed(()=>{const u=a.schema.values;return b(typeof u=="function"?u.apply(this,[a.model,a.schema]):u)}),b=u=>{const C=[];return u.forEach(S=>{C.push({label:F(S),value:A(S),disabled:typeof S=="object"&&S.disabled||void 0,group:typeof S=="object"&&String(S.group||"").toUpperCase()||void 0})}),C},A=u=>{if(fe(u)){if(r.value&&typeof r.value.value<"u")return u[r.value.value];if(typeof u.id<"u")return String(u.id);throw new Error("`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return u},F=u=>{if(fe(u)){if(r.value&&typeof r.value.name<"u")return u[r.value.name];if(typeof u.name<"u")return String(u.name);throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items")}else return String(u)};return(u,C)=>{const S=t.resolveComponent("KSelect");return t.openBlock(),t.createBlock(S,{id:t.unref(c)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":C[0]||(C[0]=N=>t.isRef(f)?f.value=N:null),class:t.normalizeClass(e.schema.fieldClasses),clearable:!e.schema.required,disabled:e.disabled||void 0,items:h.value,"kpop-attributes":{"data-testid":`${t.unref(c)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:r.value.hideNoneSelectedText?void 0:r.value.noneSelectedText||"Nothing Selected",required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","class","clearable","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),Im={name:"FieldArray",components:{FieldArrayItem:ga,FieldArrayMultiItem:ya,FieldSelect:Ma,FieldMetric:Sa,FieldObject:wa,FieldObjectAdvanced:ka,FieldAutoSuggest:Ea,FieldAutoSuggestLegacy:Ta,FieldRadio:Aa,FieldArrayCardContainer:pa,FieldInput:Ca},mixins:[Te],inject:{autofillSlot:{from:he,default:void 0}},props:{newElementButtonLabel:{type:String,default:"New Item"},removeElementButtonLabel:{type:String,default:"x"}},emits:["refreshModel"],methods:{generateSchema(e,n,o){var i,r,s;let a;return n&&(a=JSON.parse(JSON.stringify(n)),(s=(r=(i=a.schema)==null?void 0:i.fields)==null?void 0:r.map)==null||s.call(r,l=>(l.id=`${l.id||l.model}-${o}`,l))),{...a,set(l,c){e[o]=c},get(){return e[o]}}},newElement(){let e=this.value,n;(!e||!e.push)&&(e=[]),this.schema.items&&this.schema.items.default&&(typeof this.schema.items.default=="function"?n=this.schema.items.default():n=this.schema.items.default),e.push(n),this.value=[...e]},removeElement(e){this.value=this.value.filter((n,o)=>o!==e)},getFieldComponent(e){return e.component?e.component:"field-"+e.type},modelUpdated(){this.$emit("refreshModel")},handleInput(e,n){var a,i;let o=e;((i=(a=this.schema)==null?void 0:a.inputAttributes)==null?void 0:i.type)==="number"&&_n(parseFloat(e))&&(o=parseFloat(e)),this.value=this.value.map((r,s)=>s===n?o:r)}}},Om=["id"],Vm={key:1},Bm=["onUpdate:modelValue","aria-labelledby","type"],Fm=["onUpdate:modelValue","aria-labelledby"];function Rm(e,n,o,a,i,r){const s=t.resolveComponent("KTextArea"),l=t.resolveComponent("KInput"),c=t.resolveComponent("KButton");return e.schema?(t.openBlock(),t.createElementBlock("div",{key:0,id:e.getFieldID(e.schema),class:t.normalizeClass(e.schema.fieldClasses)},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(m,f)=>(t.openBlock(),t.createElementBlock("div",{key:f,class:t.normalizeClass(e.schema.fieldItemsClasses)},[e.schema.items&&e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:0,index:f,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onRemoveItem:h=>r.removeElement(f)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))]),_:2},1064,["index","model","schema","onRemoveItem"])):e.schema.items?(t.openBlock(),t.createElementBlock("span",Vm,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(e.schema.items)),{"form-options":e.formOptions,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onModelUpdated:r.modelUpdated},null,40,["form-options","model","schema","onModelUpdated"]))])):e.schema.itemContainerComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.schema.itemContainerComponent),{key:2,"data-testid":`${e.getFieldID(e.schema)}-item-${f}`,model:m,schema:r.generateSchema(e.value,e.schema.items,f),onRemoveItem:h=>r.removeElement(f)},{after:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:h=>e.value[f]=h,value:e.value[f]},null,8,["schema","update","value"]))]),default:t.withCtx(()=>{var h;return[e.schema.inputAttributes&&e.schema.inputAttributes.type==="textarea"?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,ref_for:!0},e.schema.inputAttributes,{id:e.getFieldID(e.schema),modelValue:e.value[f],"onUpdate:modelValue":b=>e.value[f]=b,"aria-labelledby":e.getLabelId(e.schema),autosize:"","character-limit":e.schema.inputAttributes.max,class:e.schema.fieldClasses,maxlength:e.schema.max,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","onUpdate:modelValue","aria-labelledby","character-limit","class","maxlength","minlength","name","placeholder","readonly","required","rows"])):!e.schema.inputAttributes||!e.schema.inputAttributes.type||e.schema.inputAttributes.type==="text"||e.schema.inputAttributes.type==="number"?(t.openBlock(),t.createBlock(l,t.mergeProps({key:1,"aria-labelledby":e.getLabelId(e.schema)},{ref_for:!0},e.schema.inputAttributes,{"model-value":e.value[f],type:e.schema.inputAttributes&&e.schema.inputAttributes.type||"text",onInput:b=>{r.handleInput(b,f)}}),null,16,["aria-labelledby","model-value","type","onInput"])):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:2,"onUpdate:modelValue":b=>e.value[f]=b,"aria-labelledby":e.getLabelId(e.schema)},{ref_for:!0},e.schema.inputAttributes,{type:((h=e.schema.inputAttributes)==null?void 0:h.type)||"text"}),null,16,Bm)),[[t.vModelDynamic,e.value[f]]])]}),_:2},1064,["data-testid","model","schema","onRemoveItem"])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref_for:!0},e.schema.inputAttributes,{"onUpdate:modelValue":h=>e.value[f]=h,"aria-labelledby":e.getLabelId(e.schema),type:"text"}),null,16,Fm),[[t.vModelText,e.value[f]]]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:h=>e.value[f]=h,value:e.value[f]},null,8,["schema","update","value"]))],64))],2))),128)),t.createVNode(c,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`add-${e.getFieldID(e.schema)}`,type:"button",onClick:r.newElement},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel||o.newElementButtonLabel),1)]),_:1},8,["class","data-testid","onClick"])],10,Om)):t.createCommentVNode("",!0)}const Dm=$(Im,[["render",Rm],["__scopeId","data-v-d6740b2b"]]),Lm={class:"form-field-wrapper field-checkbox"},Um=$(t.defineComponent({__name:"FieldCheckbox",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),{getFieldID:s,value:l,clearValidationErrors:c}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:m=>{i("modelUpdated",m.value,m.model)}});return n({clearValidationErrors:c}),(m,f)=>{const h=t.resolveComponent("KCheckbox");return t.openBlock(),t.createElementBlock("div",Lm,[t.createVNode(h,t.mergeProps(m.$attrs,{id:t.unref(s)(e.schema),modelValue:t.unref(l),"onUpdate:modelValue":f[0]||(f[0]=b=>t.isRef(l)?l.value=b:null),autocomplete:e.schema.autocomplete,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint?e.hint:void 0,name:e.schema.inputName,readonly:e.schema.readonly,required:e.schema.required,width:e.schema.width}),null,16,["id","modelValue","autocomplete","class","disabled","help","name","readonly","required","width"])])}}}),[["__scopeId","data-v-6b4ee1cd"]]),Pm={class:"wrapper"},$m=["disabled"],xm=["id","checked","disabled","onChange","name"],vm=["disabled"],jm={class:"info"},qm={class:"dropList"},zm=["id","checked","disabled","onChange","name"];function Km(e,n,o,a,i,r){const s=t.resolveDirective("attributes");return t.withDirectives((t.openBlock(),t.createElementBlock("div",Pm,[e.schema.listBox?(t.openBlock(),t.createElementBlock("div",{key:0,class:"listbox form-control",disabled:e.disabled||null},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(l)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,l),name:r.getInputName(l)},null,40,xm),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)])],2))),256))],8,$m)):t.createCommentVNode("",!0),e.schema.listBox?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:1,class:"combobox form-control",disabled:e.disabled||null},[t.createElementVNode("div",{class:t.normalizeClass(["mainRow",{expanded:i.comboExpanded}]),onClick:n[0]||(n[0]=(...l)=>r.onExpandCombo&&r.onExpandCombo(...l))},[t.createElementVNode("div",jm,t.toDisplayString(r.selectedCount)+" selected",1),n[1]||(n[1]=t.createElementVNode("div",{class:"arrow"},null,-1))],2),t.createElementVNode("div",qm,[i.comboExpanded?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.items,l=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["list-row",{"is-checked":r.isItemChecked(l)}])},[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{id:e.getFieldID(e.schema,!0),type:"checkbox",checked:r.isItemChecked(l)||null,disabled:e.disabled||null,onChange:c=>r.onChanged(c,l),name:r.getInputName(l)},null,40,zm),[[s,"input"]]),t.createTextVNode(t.toDisplayString(r.getItemName(l)),1)])],2))),256)):t.createCommentVNode("",!0)])],8,vm))])),[[s,"wrapper"]])}const Hm=$({mixins:[Te],data(){return{comboExpanded:!1}},computed:{items(){const e=this.schema.values;return typeof e=="function"?e.apply(this,[this.model,this.schema]):e},selectedCount(){return this.value?this.value.length:0}},methods:{getInputName(e){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?Ko(this.schema.inputName+"_"+this.getItemValue(e)):Ko(this.getItemValue(e))},getItemValue(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.value<"u")return e[this.schema.checklistOptions.value];if(typeof e.value<"u")return e.value;throw new Error("`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},getItemName(e){if(fe(e)){if(typeof this.schema.checklistOptions<"u"&&typeof this.schema.checklistOptions.name<"u")return e[this.schema.checklistOptions.name];if(typeof e.name<"u")return e.name;throw new Error("`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values")}else return e},isItemChecked(e){return this.value&&this.value.indexOf(this.getItemValue(e))!==-1},onChanged(e,n){if((G(this.value)||!Array.isArray(this.value))&&(this.value=[]),e.target.checked){const o=ba(this.value);o.push(this.getItemValue(n)),this.value=o}else{const o=ba(this.value);o.splice(this.value.indexOf(this.getItemValue(n)),1),this.value=o}},onExpandCombo(){this.comboExpanded=!this.comboExpanded}}},[["render",Km]]),Ym={name:"FieldKeyValuePairs",components:{TrashIcon:Se.TrashIcon},mixins:[Te],inject:{autofillSlot:{from:he,default:void 0}},data(){return{pairs:[]}},watch:{pairs:{handler(){this.updateValue()},deep:!0}},created(){var n,o;this.value||(this.value={});const e=((o=this.model)==null?void 0:o[(n=this.schema)==null?void 0:n.model])??{};Object.keys(e).forEach(a=>{this.pairs.push({key:a,value:e[a]})})},methods:{onInput(e,n,o){this.pairs[n][o]=e.target.value},updateValue(){this.value=this.pairs.reduce((e,{key:n,value:o})=>({...e,...n&&o?{[n]:o}:null}),{})},addPair(){this.pairs.push({key:"",value:""})},removePair(e){this.pairs.splice(e,1)}}},Gm={class:"key-value-pairs-editor"},Wm={class:"pair-item-cell"},Zm=["data-testid","placeholder","value","onInput"],Xm={class:"pair-item-cell"},Jm=["data-testid","placeholder","value","onInput"];function Qm(e,n,o,a,i,r){const s=t.resolveComponent("TrashIcon"),l=t.resolveComponent("KButton");return t.openBlock(),t.createElementBlock("div",Gm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pairs,(c,m)=>(t.openBlock(),t.createElementBlock("div",{key:m,class:"pair-item"},[t.createElementVNode("div",Wm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-key-${m}`,placeholder:e.schema.keyInputPlaceholder??"Key",type:"text",value:c.key,onInput:f=>{r.onInput(f,m,"key")}},null,40,Zm),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>r.onInput({target:{value:f}},m,"key"),value:c.key},null,8,["schema","update","value"]))]),t.createElementVNode("div",Xm,[t.createElementVNode("input",{class:"form-control","data-testid":`${e.getFieldID(e.schema)}-pair-value-${m}`,placeholder:e.schema.valueInputPlaceholder??"Value",type:"text",value:c.value,onInput:f=>{r.onInput(f,m,"value")}},null,40,Jm),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.autofillSlot),{schema:e.schema,update:f=>r.onInput({target:{value:f}},m,"value"),value:c.value},null,8,["schema","update","value"]))]),t.createVNode(l,{appearance:"tertiary","data-testid":`${e.getFieldID(e.schema)}-remove-pair-${m}`,onClick:()=>{r.removePair(m)}},{default:t.withCtx(()=>[t.createVNode(s)]),_:1},8,["data-testid","onClick"])]))),128)),t.createVNode(l,{appearance:"tertiary",class:t.normalizeClass(e.schema.newElementButtonLabelClasses),"data-testid":`${e.getFieldID(e.schema)}-add-pair`,type:"button",onClick:r.addPair},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.schema.newElementButtonLabel??"+ Add Pair"),1)]),_:1},8,["class","data-testid","onClick"])])}const eu=$(Ym,[["render",Qm],["__scopeId","data-v-9a9650ac"]]),tu=$(t.defineComponent({__name:"FieldLabel",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0}},setup(e){const n=e,o=t.toRefs(n),{getFieldID:a,value:i}=Ce.useAbstractFields({model:o.model,schema:n.schema,formOptions:n.formOptions});return(r,s)=>{const l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["field-label",e.schema.fieldClasses])},[t.createVNode(l,{id:t.unref(a)(e.schema)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)),1)]),_:1},8,["id"])],2)}}}),[["__scopeId","data-v-d046a15a"]]),nu=t.defineComponent({__name:"FieldMultiselect",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRef(a,"model"),{getLabelId:s,getFieldID:l,clearValidationErrors:c,value:m}=Ce.useAbstractFields({model:r,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:h=>{i("modelUpdated",h.value,h.model)}});n({clearValidationErrors:c});const f=t.computed(()=>{var h,b;return a.schema.values?a.schema.values:(b=(h=a.schema.elements)==null?void 0:h.one_of)!=null&&b.length?a.schema.elements.one_of.map(A=>({label:String(A),value:String(A)})):[]});return(h,b)=>{const A=t.resolveComponent("KMultiselect");return t.openBlock(),t.createBlock(A,{id:t.unref(l)(e.schema),modelValue:t.unref(m),"onUpdate:modelValue":b[0]||(b[0]=F=>t.isRef(m)?m.value=F:null),"aria-labelledby":t.unref(s)(e.schema),class:t.normalizeClass(e.schema.fieldClasses),"data-testid":"field-multiselect",disabled:e.disabled||void 0,items:f.value,"kpop-attributes":{"data-testid":`${t.unref(l)(e.schema)}-items`},"label-attributes":{info:e.schema.help},name:e.schema.inputName,placeholder:e.schema.placeholder,required:e.schema.required||void 0,width:"100%"},null,8,["id","modelValue","aria-labelledby","class","disabled","items","kpop-attributes","label-attributes","name","placeholder","required"])}}}),ou={class:"selection-group"},au={class:"form-group horizontal-radios"},iu={class:"radio-group"},ru=["disabled","value"],lu={class:"control-help"},su={key:0,class:"option-field"},du={class:"option-field-container"},cu=$(Object.assign({mixins:[Te],emits:["model-updated"],expose:["validate","clearValidationErrors","schema"],data(){return{checkedGroup:null,fieldModel:{...this.model},renderedTrack:[],fieldSchema:[],scope:"scope"}},watch:{checkedGroup:{handler(e,n){if(this.renderedTrack[e]=!0,n===null){this.fieldModel={...this.model};return}const o=this.schema.fields[e].fields,a=this.schema.fields[n].fields;a&&a.forEach(i=>this.updateModel("",i.model)),o&&o.forEach(i=>this.updateModel(this.fieldModel[i.model],i.model))}}},async created(){await this.$nextTick(),this.schema.fields.forEach((e,n)=>{this.renderedTrack.push(!1),e.fields&&e.fields.forEach(o=>{var a;this.model[o.model]&&(this.checkedGroup=n,this.fieldSchema.push(o.model),this.scope=(a=o.label)==null?void 0:a.toLowerCase())})}),this.checkedGroup===null&&(this.checkedGroup=0)},methods:{updateModel(e,n){this.$emit("model-updated",e,n)}}},{__name:"FieldSelectionGroup",setup(e){const{t:n}=ue.createI18n("en-us",pe);return(o,a)=>(t.openBlock(),t.createElementBlock("div",ou,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.$props.disabled?"k-tooltip":"div"),{"max-width":"300",text:t.unref(n)("general.disable_global_radio",{scope:o.scope})},{default:t.withCtx(()=>[t.createElementVNode("div",au,[t.createElementVNode("div",iu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:t.normalizeClass(["option-group",{"radio-disabled":o.$props.disabled}])},[t.createElementVNode("label",{class:t.normalizeClass(["k-label",`${i.label}-check`])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=s=>o.checkedGroup=s),class:"k-input",disabled:o.$props.disabled,type:"radio",value:r},null,8,ru),[[t.vModelRadio,o.checkedGroup]]),t.createTextVNode(" "+t.toDisplayString(i.label)+" ",1),t.createElementVNode("div",lu,t.toDisplayString(i.description),1)],2)],2))),128))])])]),_:1},8,["text"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.schema.fields,(i,r)=>(t.openBlock(),t.createElementBlock("div",{key:r,class:"option-group"},[o.renderedTrack[r]?t.withDirectives((t.openBlock(),t.createElementBlock("div",su,[t.createElementVNode("div",du,[t.createVNode(Y,{model:o.model,options:{helpAsHtml:!0},schema:{fields:i.fields},onModelUpdated:o.updateModel},null,8,["model","schema","onModelUpdated"])])],512)),[[t.vShow,i.fields&&o.checkedGroup===r]]):t.createCommentVNode("",!0)]))),128))]))}}),[["__scopeId","data-v-a536356c"]]),mu={class:"form-field-wrapper"},uu=t.defineComponent({__name:"FieldSwitch",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,{t:r}=ue.createI18n("en-us",pe),s=b=>b!=null&&a.schema.valueOn?b===a.schema.valueOn:b,l=b=>b!=null&&a.schema.valueOn?b?a.schema.valueOn:a.schema.valueOff:b,c=t.toRefs(a),{getFieldID:m,value:f,clearValidationErrors:h}=Ce.useAbstractFields({model:c.model,schema:a.schema,formOptions:a.formOptions,formatValueToField:s,formatValueToModel:l,emitModelUpdated:b=>{i("modelUpdated",b.value,b.model)}});return n({clearValidationErrors:h}),(b,A)=>{const F=t.resolveComponent("KInputSwitch");return t.openBlock(),t.createElementBlock("div",mu,[t.createVNode(F,{id:t.unref(m)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":A[0]||(A[0]=u=>t.isRef(f)?f.value=u:null),autocomplete:e.schema.autocomplete,class:t.normalizeClass(e.schema.fieldClasses),disabled:e.disabled||void 0,label:t.unref(f)?e.schema.textOn||t.unref(r)("vfg.labels.on"):e.schema.textOff||t.unref(r)("vfg.labels.off"),"label-attributes":{info:e.schema.help},name:e.schema.inputName,required:e.schema.required||void 0},null,8,["id","modelValue","autocomplete","class","disabled","label","label-attributes","name","required"])])}}}),fu={class:"field-textarea"},hu={name:"FormGroup",components:Object.freeze(Object.defineProperty({__proto__:null,FieldAdvanced:Cc,FieldArray:Dm,FieldArrayCardContainer:pa,FieldArrayItem:ga,FieldArrayMultiItem:ya,FieldAutoSuggest:Ea,FieldAutoSuggestLegacy:Ta,FieldCheckbox:Um,FieldChecklist:Hm,FieldInput:Ca,FieldKeyValuePairs:eu,FieldLabel:tu,FieldMetric:Sa,FieldMultiselect:nu,FieldObject:wa,FieldObjectAdvanced:ka,FieldRadio:Aa,FieldSelect:Ma,FieldSelectionGroup:cu,FieldSwitch:uu,FieldTextArea:$(t.defineComponent({__name:"FieldTextArea",props:{disabled:{type:Boolean,default:!1},formOptions:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},schema:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default:()=>[]},hint:{type:String,default:""}},emits:["modelUpdated"],setup(e,{expose:n,emit:o}){const a=e,i=o,r=t.toRefs(a),s=t.inject(he,void 0),{updateModelValue:l,getFieldID:c,clearValidationErrors:m,value:f}=Ce.useAbstractFields({model:r.model,schema:a.schema,formOptions:a.formOptions,emitModelUpdated:b=>{i("modelUpdated",b.value,b.model)}});n({clearValidationErrors:m});const h=b=>{f.value=b,l(b,b)};return(b,A)=>{const F=t.resolveComponent("KTextArea");return t.openBlock(),t.createElementBlock("div",fu,[t.createVNode(F,t.mergeProps(b.$attrs,{id:t.unref(c)(e.schema),modelValue:t.unref(f),"onUpdate:modelValue":A[0]||(A[0]=u=>t.isRef(f)?f.value=u:null),autosize:"","character-limit":e.schema.max??!1,class:e.schema.fieldClasses,disabled:e.disabled||void 0,help:e.hint||void 0,minlength:e.schema.min,name:e.schema.inputName,placeholder:e.schema.placeholder,readonly:e.schema.readonly,required:e.schema.required,resizable:"",rows:e.schema.rows||3}),null,16,["id","modelValue","character-limit","class","disabled","help","minlength","name","placeholder","readonly","required","rows"]),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(s)),{schema:e.schema,update:h,value:t.unref(f)},null,8,["schema","value"]))])}}}),[["__scopeId","data-v-609c18d6"]])},Symbol.toStringTag,{value:"Module"})),mixins:[Ho],inject:{"vfg-array-item-index":{default:void 0}},props:{vfg:{type:Object,required:!0},model:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},field:{type:Object,required:!0},errors:{type:Array,default(){return[]}}},emits:["validated","modelUpdated","refreshModel"],data(){return{child:t.ref()}},computed:{schema(){var n;if(!((n=this.field)!=null&&n.schema)||!Array.isArray(this.field.schema.fields))return this.field;const e=this["vfg-array-item-index"];return typeof e!="number"||Number.isNaN(e)?this.field:{...this.field,schema:{...this.field.schema,fields:this.field.schema.fields.map(o=>({...o,...o.id?{id:`${o.id}-${e}`}:void 0}))}}}},methods:{sanitize(e){return Il.sanitize(e)},fieldTypeHasLabel(e){if(G(e.label))return!1;let n="";switch(e.type==="input"?n=e.inputType:n=e.type,n){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID(e){const n=P(this.options,"fieldIdPrefix","");return gn(e,n)},getTooltipId(e){return`${this.getFieldID(e)}-tooltip`},getFieldComponent(e){return e.component?e.component:"field-"+e.type},getButtonType(e){return P(e,"type","button")},onFieldValidated(e,n,o){this.$emit("validated",e,n,o)},buttonVisibility(e){return e.buttons&&e.buttons.length>0},buttonClickHandler(e,n,o){return e.onclick.call(this,this.model,n,o,this)},fieldHint(e){return x(e.hint)?e.hint.call(this,this.model,e,this):e.hint},fieldErrors(e){return this.errors.filter(n=>n.field.fieldName===e.fieldName).map(n=>n.error)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},validate(e){return this.$refs.child.validate(e)},clearValidationErrors(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},formattedLabel(e){return e?e.replace(/^[cC]onfig\./,""):""}}},pu=["innerHTML"],gu={class:"icon-wrapper"},yu={key:0,class:"link-wrapper"},bu={class:"field-wrap"},_u={key:0,class:"buttons"},Eu=["type","onClick","textContent"],Tu={key:1,class:"hint"},Cu={key:2,class:"errors help-block"};function Su(e,n,o,a,i,r){const s=t.resolveComponent("KExternalLink"),l=t.resolveComponent("KLabel");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["form-group",e.getFieldRowClasses(o.field)])},[r.fieldTypeHasLabel(o.field)?(t.openBlock(),t.createBlock(l,{key:0,"aria-describedby":o.field.help?r.getTooltipId(o.field):void 0,class:t.normalizeClass([o.field.labelClasses,"form-group-label"]),for:r.getFieldID(o.field),info:!o.options.helpAsHtml&&o.field.help?o.field.help:void 0,"tooltip-attributes":o.field.help?{maxWidth:"300",placement:"top",tooltipId:r.getTooltipId(o.field)}:void 0},t.createSlots({default:t.withCtx(()=>[t.createElementVNode("div",gu,[t.createElementVNode("span",null,t.toDisplayString(r.formattedLabel(o.field.label)),1)]),o.field.link?(t.openBlock(),t.createElementBlock("div",yu,[t.createVNode(s,{href:o.field.link},{default:t.withCtx(()=>[...n[0]||(n[0]=[t.createElementVNode("span",{class:"section-header"},"More info",-1)])]),_:1},8,["href"])])):t.createCommentVNode("",!0)]),_:2},[o.options.helpAsHtml&&o.field.help?{name:"tooltip",fn:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:r.sanitize(o.field.help)},null,8,pu)]),key:"0"}:void 0]),1032,["aria-describedby","class","for","info","tooltip-attributes"])):t.createCommentVNode("",!0),t.createElementVNode("div",bu,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getFieldComponent(o.field)),t.mergeProps(e.$attrs,{ref:"child",disabled:e.fieldDisabled(o.field)||null,"form-options":o.options,hint:o.field.hint&&o.field.type==="input"?r.fieldHint(o.field):void 0,model:o.model,schema:r.schema,vfg:o.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated}),null,16,["disabled","form-options","hint","model","schema","vfg","onModelUpdated","onRefreshModel","onValidated"])),r.buttonVisibility(o.field)?(t.openBlock(),t.createElementBlock("div",_u,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.field.buttons,(c,m)=>(t.openBlock(),t.createElementBlock("button",{key:m,class:t.normalizeClass(c.classes),type:r.getButtonType(c),onClick:f=>r.buttonClickHandler(c,o.field,f),textContent:t.toDisplayString(c.label)},null,10,Eu))),128))])):t.createCommentVNode("",!0)]),o.field.hint&&o.field.type!=="input"?(t.openBlock(),t.createElementBlock("div",Tu,t.toDisplayString(r.fieldHint(o.field)),1)):t.createCommentVNode("",!0),r.fieldErrors(o.field).length>0?(t.openBlock(),t.createElementBlock("div",Cu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fieldErrors(o.field),(c,m)=>(t.openBlock(),t.createElementBlock("span",{key:m},t.toDisplayString(c),1))),128))])):t.createCommentVNode("",!0)],2)}const Na=$(hu,[["render",Su],["__scopeId","data-v-fe02085f"]]);var Et=(e=>(e.REDIS_CE="redis-ce",e.REDIS_EE="redis-ee",e))(Et||{});const wu=e=>{var n,o;return e.type===Et.REDIS_CE?"Host/Port":(n=e.config.sentinel_nodes)!=null&&n.length?"Sentinel":(o=e.config.cluster_nodes)!=null&&o.length?"Cluster":"Host/Port"},ku={[Et.REDIS_CE]:"open source",[Et.REDIS_EE]:"enterprise"},Ia=e=>ku[e]??"",Au={class:"partial-config-card"},Mu={class:"config-card-row-label"},Nu={class:"label-text"},Iu=["data-testid"],Ou=["data-testid"],Vu={key:1},Bu=["data-testid"],Fu=["data-testid"],Ru=$(t.defineComponent({__name:"RedisConfigCard",props:{configFields:{type:Object,required:!0},pluginRedisFields:{type:Array,required:!0}},setup(e){const{t:n,formatUnixTimeStamp:o}=ue.createI18n("en-us",pe),a={id:{order:1},name:{order:1},type:{label:n("redis.config_card.common_fields.type_label"),hidden:!0,type:"hidden"},created_at:{label:n("redis.config_card.common_fields.created_at_label"),formatter:o,order:2},updated_at:{label:n("redis.config_card.common_fields.updated_at_label"),formatter:o,order:3}},i=e,r=h=>h!=null,s=(h,b)=>r(b)&&["password","sentinel_password"].includes(h)?"password":"text",{convertKeyToTitle:l}=kt.useStringHelpers(),c=t.computed(()=>Object.entries(i.configFields).map(([h,b])=>{var A,F,u,C;return{key:h,label:((A=a[h])==null?void 0:A.label)??l(h),value:(F=a[h])!=null&&F.formatter?a[h].formatter(b):b,type:((u=a[h])==null?void 0:u.type)??s(h,b),order:((C=a[h])==null?void 0:C.order)??100}}).sort((h,b)=>h.order-b.order).filter(h=>h.type!=="hidden")),m=Ce.useRedisNonStandardFields(i.configFields,i.pluginRedisFields),f=t.computed(()=>c.value.concat(m));return(h,b)=>{const A=t.resolveComponent("KCopy");return t.openBlock(),t.createElementBlock("div",Au,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,({key:F,label:u,value:C,type:S})=>(t.openBlock(),t.createElementBlock("div",{key:F,class:"partial-config-card-row"},[t.createElementVNode("div",Mu,[t.createElementVNode("div",Nu,t.toDisplayString(u),1)]),t.createElementVNode("div",{class:"config-card-row-value","data-testid":`${F}-property-value`},[r(C)?(t.openBlock(),t.createElementBlock("div",Vu,[S==="password"?(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${F}-copy-password`},[t.createVNode(A,{format:"redacted",text:String(C)},null,8,["text"])],8,Bu)):(t.openBlock(),t.createElementBlock("div",{key:1,"data-testid":`${F}-plain-text`},t.toDisplayString(C),9,Fu))])):(t.openBlock(),t.createElementBlock("div",{key:0,"data-testid":`${F}-no-value`}," – ",8,Ou))],8,Iu)]))),128))])}}}),[["__scopeId","data-v-40b3d7b5"]]),Du={class:"redis-config-select","data-testid":"redis-config-select"},Lu={class:"selected-redis-config"},Uu=["data-testid"],Pu={class:"select-item-name","data-testid":"selected-redis-config"},$u={class:"empty-redis-config","data-testid":"empty-redis-config"},xu={key:1,class:"redis-shared-config-error-message","data-testid":"redis-config-fetch-error"},vu="1000",Oa=$(t.defineComponent({__name:"RedisConfigSelect",props:{defaultRedisConfigItem:{type:String,required:!1,default:""},updateRedisModel:{type:Function,required:!0},pluginRedisFields:{type:Array,required:!0},redisType:{type:String,default:"all"},isCustomPlugin:{type:Boolean,default:!1}},emits:["showNewPartialModal"],setup(e){const{t:n}=ue.createI18n("en-us",pe),o=t.inject(ao),a={konnect:{getOne:"/v2/control-planes/{controlPlaneId}/core-entities/partials/{id}",getAll:"/v2/control-planes/{controlPlaneId}/core-entities/partials"},kongManager:{getOne:"/{workspace}/partials/{id}",getAll:"/{workspace}/partials"}},i=e,r=t.ref(null),{getMessageFromError:s}=kt.useErrors(),l=t.inject(oo),{debouncedQueryChange:c,loading:m,error:f,loadItems:h,results:b}=kt.useDebouncedFilter(l,a[l.app].getAll,vu,{fetchedItemsKey:"data",searchKeys:["id","name"]}),A=t.computed(()=>f.value?s(f.value):""),F=N=>{let _=`${l.apiBaseUrl}${a[l.app].getOne}`;return l.app==="konnect"?_=_.replace(/{controlPlaneId}/gi,(l==null?void 0:l.controlPlaneId)||""):l.app==="kongManager"&&(_=_.replace(/\/{workspace}/gi,l!=null&&l.workspace?`/${l.workspace}`:"")),_=_.replace(/{id}/gi,String(N)),_},u=t.computed(()=>{const N=(b.value||[]).map(_=>({label:_.id,name:_.name,value:_.id,type:_.type,tag:wu(_)})).filter(_=>_.type==="redis-ce"||_.type==="redis-ee");return i.redisType!=="all"?N.filter(_=>_.type===i.redisType):N}),{axiosInstance:C}=kt.useAxios(l==null?void 0:l.axiosRequestConfig),S=async N=>{if(N){i.updateRedisModel(N);try{const _=await C.get(F(N));if(_.data.config){const w=Object.assign(_.data,_.data.config);delete w.config,r.value=w}}catch(_){console.error(_)}}};return t.watch(()=>o==null?void 0:o.value,async N=>{N&&await h()}),t.onBeforeMount(()=>{h(),i.defaultRedisConfigItem&&S(i.defaultRedisConfigItem)}),(N,_)=>{const w=t.resolveComponent("KLabel"),y=t.resolveComponent("KBadge"),g=t.resolveComponent("KSelect");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",Du,[t.createVNode(w,{info:e.isCustomPlugin?t.unref(n)("redis.custom_plugin.tooltip"):t.unref(n)("redis.shared_configuration.tooltip",{type:t.unref(Ia)(e.redisType)}),"tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(n)("redis.shared_configuration.title")),1)]),_:1},8,["info"]),_[2]||(_[2]=t.createElementVNode("div",{class:"shared-redis-config-title"},null,-1)),t.createVNode(g,{class:"redis-config-select-trigger","data-testid":"redis-config-select-trigger","enable-filtering":"","filter-function":()=>!0,items:u.value,loading:t.unref(m),"model-value":e.defaultRedisConfigItem,placeholder:t.unref(n)("redis.shared_configuration.selector.placeholder"),onChange:_[1]||(_[1]=p=>S(p==null?void 0:p.value)),onQueryChange:t.unref(c)},{"selected-item-template":t.withCtx(({item:p})=>[t.createElementVNode("div",Lu,t.toDisplayString(p.name),1)]),"item-template":t.withCtx(({item:p})=>[t.createElementVNode("div",{class:"plugin-form-redis-configuration-dropdown-item","data-testid":`redis-configuration-dropdown-item-${p.name}`},[t.createElementVNode("span",Pu,t.toDisplayString(p.name),1),t.createVNode(y,{appearance:"info",class:"select-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p.tag),1)]),_:2},1024)],8,Uu)]),empty:t.withCtx(()=>[t.createElementVNode("div",$u,t.toDisplayString(t.unref(n)("redis.shared_configuration.empty_state")),1)]),"dropdown-footer-text":t.withCtx(()=>[t.createElementVNode("div",{class:"new-redis-config-area","data-testid":"new-redis-config-area",onClick:_[0]||(_[0]=p=>N.$emit("showNewPartialModal"))},[t.createVNode(t.unref(Se.AddIcon),{size:t.unref(Ic)},null,8,["size"]),t.createElementVNode("span",null,t.toDisplayString(t.unref(n)("redis.shared_configuration.create_new_configuration",{type:t.unref(Ia)(e.redisType)})),1)])]),_:1},8,["items","loading","model-value","placeholder","onQueryChange"])]),r.value?(t.openBlock(),t.createBlock(Ru,{key:0,"config-fields":r.value,"plugin-redis-fields":e.pluginRedisFields},null,8,["config-fields","plugin-redis-fields"])):t.createCommentVNode("",!0),A.value?(t.openBlock(),t.createElementBlock("p",xu,t.toDisplayString(A.value||t.unref(n)("redis.shared_configuration.error")),1)):t.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-31a7151d"]]),ju={key:0},qu={class:"redis-config-radio-group","data-testid":"redis-config-radio-group"},zu={key:0,class:"shared-redis-config"},Ku={key:1,class:"dedicated-redis-config"},Hu={class:"dedicated-redis-config-title"},Yu={name:"VueFormGenerator",components:{formGroup:Na,formRedis:$(t.defineComponent({__name:"FormRedis",props:{tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},model:{type:Object,default:()=>{}},options:{type:Object,required:!0},field:{type:Object,required:!0},vfg:{type:Object,required:!0},errors:{type:Array,default(){return[]}},redisPath:{type:String,default:void 0,required:!1},isEditing:{type:Boolean,default:!1}},emits:["modelUpdated","partialToggled","showNewPartialModal","refreshModel","validated"],setup(e,{emit:n}){const o=e,a=n,{t:i}=ue.createI18n("en-us",pe),r=t.computed(()=>o.field.pluginType==="custom"),s=t.ref(!o.isEditing),l=t.ref(),c=t.ref({}),m=t.ref(),f=u=>x(u.visible)?u.visible.call(this,o.model,u,this):G(u.visible)?!0:u.visible,h=async u=>{a("modelUpdated",[{id:u,path:o.redisPath}],"partials"),m.value=[{id:u,path:o.redisPath}],l.value=u},b=(u,C)=>{c.value={...c.value,[C]:u},a("modelUpdated",u,C)},A=()=>{a("refreshModel")},F=(u,C,S)=>{a("validated",u,C,S)};return t.watch(()=>s.value,u=>{u?m.value&&a("partialToggled","redis",{partials:m.value}):a("partialToggled","partials",c.value)}),t.onBeforeMount(()=>{var u,C,S;if(o.model&&(c.value=o.field.fields.reduce((N,_)=>(Object.keys(o.model).includes(_.model)&&(N[_.model]=o.model[_.model]),N),{})),(S=(C=(u=o==null?void 0:o.model)==null?void 0:u.partials)==null?void 0:C[0])!=null&&S.id){const N=o.model.partials[0].id;s.value=!0,l.value=N}}),(u,C)=>{const S=t.resolveComponent("KAlert"),N=t.resolveComponent("KBadge"),_=t.resolveComponent("KRadio"),w=t.resolveComponent("KCard");return t.openBlock(),t.createElementBlock("div",null,[r.value?(t.openBlock(),t.createElementBlock("div",ju,[t.createVNode(S,{"data-testid":"custom-plugin-redis-config-note",message:t.unref(i)("redis.custom_plugin.alert")},null,8,["message"]),t.createVNode(Oa,{"default-redis-config-item":l.value,"is-custom-plugin":"","plugin-redis-fields":e.field.fields,"update-redis-model":h,onShowNewPartialModal:C[0]||(C[0]=y=>u.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields"])])):(t.openBlock(),t.createBlock(w,{key:1,class:"redis-config-card","data-testid":"redis-config-card",title:t.unref(i)("redis.title")},{default:t.withCtx(()=>[t.createElementVNode("div",qu,[t.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":C[1]||(C[1]=y=>s.value=y),card:"","card-orientation":"horizontal","data-testid":"shared-redis-config-radio",description:t.unref(i)("redis.shared_configuration.description"),label:t.unref(i)("redis.shared_configuration.label"),"selected-value":!0},{default:t.withCtx(()=>[t.createVNode(N,{appearance:"success"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("redis.shared_configuration.badge")),1)]),_:1})]),_:1},8,["modelValue","description","label"]),t.createVNode(_,{modelValue:s.value,"onUpdate:modelValue":C[2]||(C[2]=y=>s.value=y),card:"","card-orientation":"horizontal","data-testid":"dedicated-redis-config-radio",description:t.unref(i)("redis.dedicated_configuration.description"),label:t.unref(i)("redis.dedicated_configuration.label"),"selected-value":!1},null,8,["modelValue","description","label"])]),s.value?(t.openBlock(),t.createElementBlock("div",zu,[t.createVNode(Oa,{"default-redis-config-item":l.value,"plugin-redis-fields":e.field.fields,"redis-type":e.field.redisType,"update-redis-model":h,onShowNewPartialModal:C[3]||(C[3]=y=>u.$emit("showNewPartialModal"))},null,8,["default-redis-config-item","plugin-redis-fields","redis-type"])])):(t.openBlock(),t.createElementBlock("div",Ku,[t.createElementVNode("div",Hu,t.toDisplayString(t.unref(i)("redis.dedicated_configuration.title")),1),(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),null,{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.field.fields,y=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:y.model},[f(y)?(t.openBlock(),t.createBlock(Na,{key:0,ref_for:!0,ref:"children",errors:e.errors,field:y,model:e.model,options:e.options,vfg:e.vfg,onModelUpdated:b,onRefreshModel:A,onValidated:F},null,8,["errors","field","model","options","vfg"])):t.createCommentVNode("",!0)],64))),128))]),_:1}))]))]),_:1},8,["title"]))])}}}),[["__scopeId","data-v-addd6536"]])},mixins:[Ho],inject:{autofillSlot:{from:he,default:void 0}},provide(){var e;return{...!this.autofillSlot&&{[he]:(e=this.$slots)==null?void 0:e[Ke]}}},props:{schema:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}},options:{type:Object,default(){return{validateAfterLoad:!1,validateAfterChanged:!1,child:t.ref([]),fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:"",helpAsHtml:!1}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(e){return e.length>0}},enableRedisPartial:{type:Boolean,default:!1},isEditing:{type:Boolean,default:!1}},emits:["validated","modelUpdated","refreshModel","partialToggled","showNewPartialModal"],data(){return{vfg:this,errors:[],children:t.ref([]),collapseStates:{}}},computed:{fields(){const e=[];return this.schema&&this.schema.fields&&ie(this.schema.fields,n=>{(!this.multiple||n.multi===!0)&&e.push(n)}),e},groups(){const e=[];return this.schema&&this.schema.groups&&ie(this.schema.groups.slice(0),n=>{e.push(n)}),e}},watch:{model:{deep:!0,handler(e,n){n!==e&&e!=null&&this.$nextTick(()=>{this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors()})}}},mounted(){this.$nextTick(()=>{this.model&&(this.options.validateAfterLoad===!0&&this.isNewModel!==!0?this.validate():this.clearValidationErrors())})},methods:{fieldVisible(e){return x(e.visible)?e.visible.call(this,this.model,e,this):G(e.visible)?!0:e.visible},onFieldValidated(e,n,o){this.errors=this.errors.filter(i=>i.field.fieldName!==o.schema.fieldName),!e&&n&&n.length>0&&ie(n,i=>{this.errors.push({field:o.schema,error:i})});const a=this.errors.length===0;this.$emit("validated",a,this.errors,this)},onRefreshModel(){this.$emit("refreshModel")},onModelUpdated(e,n){this.$emit("modelUpdated",e,n)},onPartialToggled(e,n){this.$emit("partialToggled",e,n)},validate(e=null){e===null&&(e=P(this.options,"validateAsync",!1)),this.clearValidationErrors();const n=[],o=[];ie(this.$refs.children,i=>{x(i.validate)&&(n.push(i.$refs.child),o.push(i.$refs.child.validate(!0)))});const a=i=>{const r=[];ie(i,(l,c)=>{Array.isArray(l)&&l.length>0&&ie(l,m=>{r.push({field:n[c].schema,error:m})})}),this.errors=r;const s=r.length===0;return this.$emit("validated",s,r,this),e?r:s};return e?Promise.all(o).then(a):a(o)},clearValidationErrors(){this.errors.splice(0),ie(this.$refs.children,e=>{e.clearValidationErrors()})}}},Gu={key:0,class:"vue-form-generator"},Wu={key:0};function Zu(e,n,o,a,i,r){const s=t.resolveComponent("form-redis"),l=t.resolveComponent("form-group"),c=t.resolveComponent("KCollapse");return o.schema!=null?(t.openBlock(),t.createElementBlock("div",Gu,[o.schema.fields?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.fields,m=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m.model},[m.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(s,{key:0,errors:i.errors,field:m,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:f=>e.$emit("showNewPartialModal",m.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(m)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:m,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.groups,(m,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:`group-${f}`},[m.collapsible!==void 0&&m.collapsible!==!1?(t.openBlock(),t.createBlock(c,{key:0,class:"root-level-collapse","model-value":!1,title:m.collapsible.title},t.createSlots({default:t.withCtx(()=>{var h,b,A,F;return[(h=m.slots)!=null&&h.beforeContent?t.renderSlot(e.$slots,(b=m.slots)==null?void 0:b.beforeContent,{key:0}):t.createCommentVNode("",!0),m.fields.length===0&&((A=m.slots)!=null&&A.emptyState)?t.renderSlot(e.$slots,(F=m.slots)==null?void 0:F.emptyState,{key:1}):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:2,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,u=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:u.model},[r.fieldVisible(u)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:u,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"])),m.collapsible!==!0&&m.collapsible.nestedCollapsible&&m.collapsible.nestedCollapsible.fields.length>0?(t.openBlock(),t.createBlock(c,{key:3,class:"nested-collapse","model-value":i.collapseStates[`group-${f}-nested`]??!0,"trigger-alignment":"leading","trigger-label":i.collapseStates[`group-${f}-nested`]??!0?m.collapsible.nestedCollapsible.triggerLabel.expand:m.collapsible.nestedCollapsible.triggerLabel.collapse,"onUpdate:modelValue":u=>i.collapseStates[`group-${f}-nested`]=u},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.collapsible.nestedCollapsible.fields,u=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:u.model},[u.model==="__redis_partial"&&o.enableRedisPartial?(t.openBlock(),t.createBlock(s,{key:0,errors:i.errors,field:u,"is-editing":o.isEditing,model:o.model,options:o.options,tag:o.tag,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onPartialToggled:r.onPartialToggled,onShowNewPartialModal:C=>e.$emit("showNewPartialModal",u.redisType),onValidated:r.onFieldValidated},null,8,["errors","field","is-editing","model","options","tag","vfg","onModelUpdated","onPartialToggled","onShowNewPartialModal","onValidated"])):r.fieldVisible(u)?(t.openBlock(),t.createBlock(l,{key:1,ref_for:!0,ref:"children",errors:i.errors,field:u,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))]),_:2},1032,["model-value","trigger-label","onUpdate:modelValue"])):t.createCommentVNode("",!0)]}),_:2},[m.collapsible.description?{name:"visible-content",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(m.collapsible.description),1)]),key:"0"}:void 0]),1032,["title"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),{key:1,class:t.normalizeClass(e.getFieldRowClasses(m))},{default:t.withCtx(()=>[m.legend?(t.openBlock(),t.createElementBlock("legend",Wu,t.toDisplayString(m.legend),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.fields,h=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:h.model},[r.fieldVisible(h)?(t.openBlock(),t.createBlock(l,{key:0,ref_for:!0,ref:"children",errors:i.errors,field:h,model:o.model,options:o.options,vfg:i.vfg,onModelUpdated:r.onModelUpdated,onRefreshModel:r.onRefreshModel,onValidated:r.onFieldValidated},null,8,["errors","field","model","options","vfg","onModelUpdated","onRefreshModel","onValidated"])):t.createCommentVNode("",!0)],64))),128))]),_:2},1032,["class"]))],64))),128))])):t.createCommentVNode("",!0)}const Y=$(Yu,[["render",Zu]]),Tt={openIdConnectDocs:"https://developer.konghq.com/plugins/openid-connect/",openIdConnectJWKDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-client-jwk",openIdConnectClusterNodesDocs:"https://developer.konghq.com/plugins/openid-connect/reference/#schema--config-redis-cluster-nodes",openIdConfigurationDocs:"https://developer.konghq.com/plugins/openid-connect/reference/",openIdAuthorizationDocs:"https://developer.konghq.com/plugins/openid-connect/#authorization"},Va=new Set(["config-client_id","config-client_secret","config-issuer"]),Ba=new Set(["config-scopes_claim","config-scopes_required","config-audience_claim","config-audience_required","config-roles_claim","config-roles_required","config-groups_claim","config-groups_required","config-authenticated_groups_claim"]),Xu={name:"OIDCForm",components:{VueFormGenerator:Y},provide(){var e;return{[he]:(e=this.$slots)==null?void 0:e[Ke]}},props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},onPartialToggled:{type:Function,required:!0},isEditing:{type:Boolean,required:!0},enableRedisPartial:{type:Boolean,required:!1},showNewPartialModal:{type:Function,default:()=>{}}},data(){return{init:!1,authMethods:[],sessionManagement:!1,globalFields:null,commonFieldsSchema:null,authFieldsSchema:null,openIdConnectLink:Tt.openIdConnectDocs,openIdConnectJWKLink:Tt.openIdConnectJWKDocs,openIdConnectClusterNodesLink:Tt.openIdConnectClusterNodesDocs,openIdConfigurationDocs:Tt.openIdConfigurationDocs,openIdAuthorizationDocs:Tt.openIdAuthorizationDocs,advancedFieldsSchema:{fields:[]},advancedFields:null,tabs:[{hash:"#common",title:"Common"},{hash:"#authorization",title:"Authorization"},{hash:"#advanced",title:"Advanced"}]}},computed:{displayForm(){return this.formModel.id&&this.isEditing||!this.isEditing}},watch:{formModel:{handler:function(){this.oidcSetup()}}},mounted(){this.oidcSetup()},methods:{oidcSetup(){var e;if(!this.init){this.init=!0,this.globalFields={fields:this.formSchema.fields.filter(i=>!i.model.startsWith("config")&&i.model!=="tags")};const n=this.formSchema.fields.reduce((i,r)=>(i[r.model]=r,i),{});this.commonFieldsSchema={fields:Array.from(Va).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])},this.authFieldsSchema={fields:Array.from(Ba).reduce((i,r)=>(n[r]&&i.push(n[r]),i),[])};const{redis:o,redisModels:a}=Ce.useRedisPartial(this.formSchema);this.advancedFieldsSchema={fields:this.formSchema.fields.filter(i=>i.model.startsWith("config")&&i.model!=="config-auth_methods"&&!Va.has(i.model)&&!Ba.has(i.model)&&(!this.enableRedisPartial||!a.includes(i.model))||i.model==="tags").reduce((i,r)=>{var s,l,c,m;switch(r.model){case"config-client_jwk":{if(Array.isArray((l=(s=r.items)==null?void 0:s.schema)==null?void 0:l.fields))for(const f of r.items.schema.fields)f.label=f.model;i.push({...r,link:this.openIdConnectJWKLink,newElementButtonLabel:"+ Add Client JWK",...Array.isArray((m=(c=r.items)==null?void 0:c.schema)==null?void 0:m.fields)&&r.items.schema.fields.map(f=>({...f,label:f.model}))});break}case"config-session_redis_cluster_nodes":{i.push({...r,link:this.openIdConnectClusterNodesLink,newElementButtonLabel:"+ Add Cluster Node"});break}default:i.push(r)}return i},[])},this.enableRedisPartial&&this.advancedFieldsSchema.fields.unshift(o),this.sessionManagement=this.formModel["config-auth_methods"].includes("session"),this.authMethods=[{label:"Authorization Code Flow",value:"authorization_code",hint:"authorization code flow",prop:this.formModel["config-auth_methods"].includes("authorization_code")},{label:"Bearer Access Token",value:"bearer",hint:"JWT access token verification",prop:this.formModel["config-auth_methods"].includes("bearer")},{label:"Client Credentials Grant",value:"client_credentials",hint:"OAuth client credentials grant",prop:this.formModel["config-auth_methods"].includes("client_credentials")},{label:"Passwords Grant",value:"password",hint:"OAuth legacy password grant",prop:this.formModel["config-auth_methods"].includes("password")},{label:"Introspection",value:"introspection",hint:"OAuth introspection",prop:this.formModel["config-auth_methods"].includes("introspection")},{label:"UserInfo",value:"userinfo",hint:"OpenID Connect user info endpoint authentication",prop:this.formModel["config-auth_methods"].includes("userinfo")},{label:"Kong OAuth",value:"kong_oauth2",hint:"Kong OAuth plugin issued tokens verification",prop:this.formModel["config-auth_methods"].includes("kong_oauth2")},{label:"Refresh Token",value:"refresh_token",hint:"OAuth refresh token grant",prop:this.formModel["config-auth_methods"].includes("refresh_token")}];for(const i of[this.commonFieldsSchema,this.authFieldsSchema,this.advancedFieldsSchema])for(const r of i.fields){const s=(e=n[r.model])==null?void 0:e.help;r.help===void 0&&typeof s=="string"&&(r.help=s)}}},getAuthMethodsValue(e,n){const o=[];for(let a=0;a<this.authMethods.length;a++)this.authMethods[a].prop&&this.authMethods[a].value!==e&&o.push(this.authMethods[a].value);return this.sessionManagement&&e&&o.push("session"),n&&(e?o.push(e):o.push("session")),o},handleUpdate(e,n){this.formModel["config-auth_methods"]=this.getAuthMethodsValue(n,e),this.onModelUpdated()}}},Ju={class:"general-settings"},Qu={class:"link-wrapper"},ef={class:"auth-method-container"},tf={class:"general-settings"},nf={class:"link-wrapper"},of={class:"general-settings"},af={class:"link-wrapper"};function rf(e,n,o,a,i,r){const s=t.resolveComponent("VueFormGenerator"),l=t.resolveComponent("KExternalLink"),c=t.resolveComponent("KLabel"),m=t.resolveComponent("KCheckbox"),f=t.resolveComponent("KInputSwitch"),h=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[o.formModel.id&&o.isEditing||!o.isEditing?(t.openBlock(),t.createBlock(s,{key:0,class:"global-fields",model:o.formModel,options:o.formOptions,schema:i.globalFields,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(h,{tabs:i.tabs},{common:t.withCtx(()=>[t.createElementVNode("div",Ju,[t.createElementVNode("div",Qu,[t.createVNode(l,{href:i.openIdConfigurationDocs},{default:t.withCtx(()=>[...n[2]||(n[2]=[t.createElementVNode("span",{class:"section-header"},"Common Configuration Settings",-1)])]),_:1},8,["href"])]),n[4]||(n[4]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the OpenID Connect plugin. Set these parameters before adding authorization, authentication, or other advanced configuration details. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:i.commonFieldsSchema,onModelUpdated:o.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(c,null,{default:t.withCtx(()=>[...n[3]||(n[3]=[t.createTextVNode("Auth Methods",-1)])]),_:1}),t.createElementVNode("div",ef,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.authMethods,b=>(t.openBlock(),t.createElementBlock("div",{key:b.value,class:"auth-method"},[t.createVNode(m,{modelValue:b.prop,"onUpdate:modelValue":A=>b.prop=A,onChange:A=>r.handleUpdate(A,b.value)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(b.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]))),128))]),t.createVNode(f,{modelValue:i.sessionManagement,"onUpdate:modelValue":n[0]||(n[0]=b=>i.sessionManagement=b),label:"Enable Session Management",onChange:r.handleUpdate},null,8,["modelValue","onChange"])])]),authorization:t.withCtx(()=>[t.createElementVNode("div",tf,[t.createElementVNode("div",nf,[t.createVNode(l,{href:i.openIdAuthorizationDocs},{default:t.withCtx(()=>[...n[5]||(n[5]=[t.createElementVNode("span",{class:"section-header"},"Authorization Configuration Settings",-1)])]),_:1},8,["href"])]),n[6]||(n[6]=t.createElementVNode("div",{class:"description"}," Parameters for setting up claims-based authorization. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(s,{key:0,model:o.formModel,options:o.formOptions,schema:i.authFieldsSchema,onModelUpdated:o.onModelUpdated},{"autofill-provider":t.withCtx(b=>[t.renderSlot(e.$slots,"autofill-provider",t.normalizeProps(t.guardReactiveProps(b)),void 0,!0)]),_:3},8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),advanced:t.withCtx(()=>[t.createElementVNode("div",of,[t.createElementVNode("div",af,[t.createVNode(l,{href:i.openIdConnectLink},{default:t.withCtx(()=>[...n[7]||(n[7]=[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings",-1)])]),_:1},8,["href"])]),n[8]||(n[8]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the OpenID Connect plugin. ",-1)),r.displayForm?(t.openBlock(),t.createBlock(s,{key:0,"enable-redis-partial":o.enableRedisPartial,"is-editing":o.isEditing,model:o.formModel,options:o.formOptions,schema:i.advancedFieldsSchema,onModelUpdated:o.onModelUpdated,onPartialToggled:o.onPartialToggled,onShowNewPartialModal:n[1]||(n[1]=()=>o.showNewPartialModal(o.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onModelUpdated","onPartialToggled"])):t.createCommentVNode("",!0)])]),_:3},8,["tabs"])])}const lf=$(Xu,[["render",rf],["__scopeId","data-v-741bf3cb"]]),sf=$(t.defineComponent({__name:"PostFunction",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var s;t.provide(he,(s=t.useSlots())==null?void 0:s[Ke]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const l=a.formSchema;return l.fields.map(c=>{const m=`post-function.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="post-function-array-item-container",c.fieldItemsClasses="post-function-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),l});return(l,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-f54f37ae"]]),df=$(t.defineComponent({__name:"ExitTransformer",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var s;t.provide(he,(s=t.useSlots())==null?void 0:s[Ke]);const{t:n,te:o}=ue.createI18n("en-us",pe),a=e,i=t.computed(()=>a.formModel.id&&a.isEditing||!a.isEditing),r=t.computed(()=>{const l=a.formSchema;return l.fields.map(c=>{const m=`exit-transformer.${c.model}`;return c.hint=o(`${m}.hint`)&&n(`${m}.hint`)||c.hint,c.help=o(`${m}.help`)&&n(`${m}.help`)||c.help,c.newElementButtonLabel=o(`${m}.newElementButtonLabel`)&&n(`${m}.newElementButtonLabel`)||c.newElementButtonLabel,c.model!=="tags"&&(c.valueType==="array"||c.type==="array")&&(c.type="array",c.valueArrayType="array",c.itemContainerComponent="FieldArrayItem",c.fieldClasses="exit-transformer-array-item-container",c.fieldItemsClasses="exit-transformer-array-item",c.inputAttributes={...c.inputAttributes,type:"textarea"}),c}),l});return(l,c)=>i.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:r.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0d5c541f"]]),cf={fields:[{inputType:"text",label:"Config.Account Email",model:"config-account_email",required:!0,type:"input"},{inputType:"text",label:"Config.Account Key.Key Id",model:"config-account_key-key_id",required:!0,type:"input"},{type:"input",inputType:"text",valueType:"string",label:"Config.Account Key.Key Set",model:"config-account_key-key_set",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",label:"Config.Allow Any Domain",model:"config-allow_any_domain",order:0,disabled:!1}]},mf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"checkbox",default:!1,valueType:"boolean",model:"config-tos_accepted",label:"Config.Tos Accepted",order:0,disabled:!1}]},uf={fields:[{type:"input",default:"",inputType:"text",valueType:"string",model:"config-api_uri",label:"Config.Api Uri",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_hmac_key",label:"Config.Eab Hmac Key",order:0,disabled:!1},{type:"input",inputType:"text",valueType:"string",model:"config-eab_kid",label:"Config.Eab Kid",order:0,disabled:!1}]},ff={class:"general-settings"},hf={class:"sub-form"},pf={class:"general-settings"},gf={class:"sub-form"},yf={class:"general-settings"},bf=$(t.defineComponent({__name:"ACMEForm",props:{formModel:{type:Object,required:!0},formSchema:{type:Object,required:!0},formOptions:{type:Object,default:()=>{}},onModelUpdated:{type:Function,required:!0},isEditing:{type:Boolean,required:!0}},setup(e){var y;t.provide(he,(y=t.useSlots())==null?void 0:y[Ke]);const n=e,o=t.ref("zeroSsl"),a=t.ref("shm"),i=t.computed(()=>{var p;const g={};if((p=n.formSchema)!=null&&p.fields)for(const V of n.formSchema.fields)g[V.model]=V;return g}),r=t.computed(()=>{var p;const g=Oe(cf);for(const V of g.fields){const v=(p=i.value[V.model])==null?void 0:p.help;V.help===void 0&&typeof v=="string"&&(V.help=v)}return g}),s=t.computed(()=>{var p;const g=Oe(mf);for(const V of g.fields){const v=(p=i.value[V.model])==null?void 0:p.help;V.help===void 0&&typeof v=="string"&&(V.help=v)}return g}),l=t.computed(()=>{var p;const g=Oe(uf);for(const V of g.fields){const v=(p=i.value[V.model])==null?void 0:p.help;V.help===void 0&&typeof v=="string"&&(V.help=v)}return g}),c=t.computed(()=>({fields:n.formSchema.fields.filter(g=>!g.model.startsWith("config")&&g.model!=="tags")})),m=t.computed(()=>({fields:r.value.fields.filter(p=>!s.value.fields.some(V=>V.model===p.model)&&!l.value.fields.some(V=>V.model===p.model))})),f=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage")&&!p.model.startsWith("config-storage_config-consul")&&!p.model.startsWith("config-storage_config-redis")&&!p.model.startsWith("config-storage_config-shm")&&!p.model.startsWith("config-storage_config-vault"))})),h=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-consul"))})),b=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-redis"))})),A=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-shm"))})),F=t.computed(()=>({fields:n.formSchema.fields.filter(p=>p.model.startsWith("config-storage_config-vault"))})),u=t.computed(()=>({fields:n.formSchema.fields.filter(g=>g.model.startsWith("config")&&!m.value.fields.filter(p=>p.model===g.model).length&&!f.value.fields.filter(p=>p.model===g.model).length||g.model==="tags")})),C=t.computed(()=>n.formModel.id&&n.isEditing||!n.isEditing),S=[{hash:"#general",title:"General"},{hash:"#storage",title:"Storage"},{hash:"#advanced",title:"Advanced"}],N=[{label:"Lets Encrypt",value:"letsEncrypt"},{label:"Zero SSL",value:"zeroSsl",selected:!0},{label:"Other",value:"other"}];t.onMounted(()=>{o.value==="zeroSsl"&&(n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90")});const _=g=>{o.value=g.value,(g.value==="zeroSsl"||g.value==="other")&&(g.value==="zeroSsl"?n.formModel["config-api_uri"]="https://acme.zerossl.com/v2/DV90":n.formModel["config-api_uri"]="https://acme.example.com/",n.formModel["config-tos_accepted"]=!1),g.value==="letsEncrypt"&&(n.formModel["config-api_uri"]="https://acme-v02.api.letsencrypt.org/directory",n.formModel["config-eab_hmac_key"]="",n.formModel["config-eab_kid"]=""),n.onModelUpdated()},w=(g,p)=>{p==="config-storage"&&(a.value=g),n.onModelUpdated()};return(g,p)=>{const V=t.resolveComponent("KSelect"),v=t.resolveComponent("KTabs");return t.openBlock(),t.createElementBlock("div",null,[e.formModel.id&&e.isEditing||!e.isEditing?(t.openBlock(),t.createBlock(Y,{key:0,class:"global-fields",model:e.formModel,options:e.formOptions,schema:c.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),t.createVNode(v,{tabs:S},{general:t.withCtx(()=>[t.createElementVNode("div",ff,[p[0]||(p[0]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"General Configuration Settings")],-1)),p[1]||(p[1]=t.createElementVNode("div",{class:"description"}," Parameters for enabling the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:m.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),p[2]||(p[2]=t.createElementVNode("hr",null,null,-1)),t.createVNode(V,{class:"issuer-select",items:N,label:"Issuer",onChange:_}),t.createElementVNode("div",hf,[o.value==="letsEncrypt"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),o.value==="zeroSsl"||o.value==="other"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:l.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),storage:t.withCtx(()=>[t.createElementVNode("div",pf,[p[3]||(p[3]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Storage Configuration Settings")],-1)),p[4]||(p[4]=t.createElementVNode("div",{class:"description"}," Parameters for setting up storage. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:f.value,onModelUpdated:w},null,8,["model","options","schema"])):t.createCommentVNode("",!0),t.createElementVNode("div",gf,[a.value==="consul"?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:h.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="redis"?(t.openBlock(),t.createBlock(Y,{key:1,model:e.formModel,options:e.formOptions,schema:b.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="shm"?(t.openBlock(),t.createBlock(Y,{key:2,model:e.formModel,options:e.formOptions,schema:A.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0),a.value==="vault"?(t.openBlock(),t.createBlock(Y,{key:3,model:e.formModel,options:e.formOptions,schema:F.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])])]),advanced:t.withCtx(()=>[t.createElementVNode("div",yf,[p[5]||(p[5]=t.createElementVNode("div",{class:"header-wrapper"},[t.createElementVNode("span",{class:"section-header"},"Advanced Configuration Settings")],-1)),p[6]||(p[6]=t.createElementVNode("div",{class:"description"}," Advanced parameters for manually configuring the ACME plugin. ",-1)),C.value?(t.openBlock(),t.createBlock(Y,{key:0,model:e.formModel,options:e.formOptions,schema:u.value,onModelUpdated:e.onModelUpdated},null,8,["model","options","schema","onModelUpdated"])):t.createCommentVNode("",!0)])]),_:1})])}}}),[["__scopeId","data-v-07cecf5b"]]),_f={class:"rla-form-basic-fields"},Ef={class:"rla-form-request-limits-subtitle"},Tf={class:"rla-form-request-limits-content"},Cf={class:"rla-form-window-type"},Sf=["innerHTML"],wf={class:"rla-form-window-type-radios"},kf={class:"rla-form-request-limits-items"},Af={class:"rla-form-request-limits-row"},Mf=["id"],Nf={class:"rla-form-request-limits-actions"},If={key:0,class:"rla-form-request-limits-examples"},Of={class:"rla-form-request-limits-examples-badges"},Vf=["innerHTML"],Bf={id:"rla-form-error-legend",class:"rla-form-error-inputs"},Ff=Object.freeze(Object.defineProperty({__proto__:null,ACMEForm:bf,ExitTransformer:df,OIDCForm:lf,PostFunction:sf,RLAForm:$(t.defineComponent({__name:"RLAForm",props:{formSchema:{},formModel:{},formOptions:{},onModelUpdated:{type:Function},onPartialToggled:{type:Function},showNewPartialModal:{type:Function},isEditing:{type:Boolean},enableRedisPartial:{type:Boolean}},setup(e){var v;t.provide(he,(v=t.useSlots())==null?void 0:v[Ke]);const n={fixed:[{label:"500 requests every hour",description:"A fixed limit of 500 requests per hour resetting sharply on the hour, ensuring no user can exceed this limit.",config:{limit:500,window_size:3600}},{label:"200 requests every 30 minutes",description:"Users are allowed 200 requests per 30 minutes, resetting exactly on the 30 minute mark with no carryover of unused limits.",config:{limit:200,window_size:1800}},{label:"500 requests every day",description:"A strict limit of 5000 requests per day resetting promptly at midnight, preventing any burst traffic or inconsistent user experiences.",config:{limit:500,window_size:86400}}],sliding:[{label:"100 requests every hour",description:"Maximum of 100 requests every rolling hour, continuously adjusting the count over the course of the hour. No hard limit or known reset.",config:{limit:100,window_size:3600}},{label:"300 requests every 30 minutes",description:"Each user can make up to 300 requests in any rolling 30 minute period, with older requests dropping off as new requests are made.",config:{limit:300,window_size:1800}},{label:"500 requests every hour",description:`Each user is allowed 500 requests per hour.
|
|
3
3
|
If the limit is exceeded and the user receives a 429 error, each additional request within the sliding window (hour)
|
|
4
|
-
will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`,config:{limit:500,window_size:3600}}]},o=new Set(["selectionGroup","enabled",...["identifier","limit","window_size","error_code","error_message"].map(M=>`config-${M}`)]),a=M=>M===void 0?!1:o.has(M),{t:i}=ue.createI18n("en-us",pe),r=e,s=t.computed(()=>{var B,R,U;const M=(R=(B=r.formSchema)==null?void 0:B.fields)==null?void 0:R.find(ee=>ee.type==="selectionGroup"&&ee.model==="selectionGroup");return{fields:[(U=r.formSchema)==null?void 0:U.fields.find(ee=>ee.model==="enabled"),M].filter(Boolean)}}),l=t.computed(()=>{var ee,Oe;const M=((Oe=(ee=r.formSchema)==null?void 0:ee.fields)==null?void 0:Oe.filter(J=>!a(J.model)))??[],T=[],B=[],R=[];let U=!1;for(const J of M){const Ve=J.model;if(Ve!==void 0){if(Ve.startsWith("config-redis-")){(J.model==="config-redis-cluster_addresses"||J.model==="config-redis-sentinel_addresses")&&(J.inputAttributes.help=i("rla.redis.address_example")),B.push(J);continue}U?R.push(J):T.push(J),J.model==="config-strategy"&&(U=!0)}}return{endsWithStrategy:{fields:T},redis:r.enableRedisPartial?{fields:[{fields:B,id:"_redis",model:"__redis_partial",redisType:r.formSchema._supported_redis_partial_type}]}:{fields:B},afterStrategy:{fields:R}}}),c=t.computed(()=>{const M=r.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,M)?n[M]:[]}),m=t.computed(()=>{var M,T;return(T=(M=r.formSchema)==null?void 0:M.fields)==null?void 0:T.find(B=>B.model==="config-identifier")}),f=t.computed(()=>{var M,T,B;return(((B=(T=(M=r.formSchema)==null?void 0:M.fields)==null?void 0:T.find(R=>R.model==="config-identifier"))==null?void 0:B.values)??[]).map(R=>({label:i(`rla.identifiers.options.${R}`),value:R}))}),h=t.ref(),b=t.ref(!0),A=t.computed(()=>{var M,T,B;return r.formModel["config-window_type"]??((B=(T=(M=r.formSchema)==null?void 0:M.fields)==null?void 0:T.find(R=>R.model==="config-window_type"))==null?void 0:B.default)}),F=t.computed(()=>{var T,B,R,U,ee,Oe;const M=(R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(J=>J.model==="config-window_type"))==null?void 0:R.default;return(((Oe=(ee=(U=r.formSchema)==null?void 0:U.fields)==null?void 0:ee.find(J=>J.model==="config-window_type"))==null?void 0:Oe.values)??[]).sort((J,Ve)=>J===M?-1:Ve===M?1:0)}),u=t.computed(()=>{var T;const M=(T=r.formModel["config-limit"])==null?void 0:T.map((B,R)=>{var U,ee;return{limit:B,windowSize:(ee=(U=r.formModel)==null?void 0:U["config-window_size"])==null?void 0:ee[R]}});return!Array.isArray(M)||M.length===0?[{limit:void 0,windowSize:void 0}]:M}),C=t.computed(()=>{var M,T,B,R;return((M=r.formModel)==null?void 0:M["config-identifier"])??((R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(U=>U.model==="config-identifier"))==null?void 0:R.default)}),S=t.computed(()=>{var M,T,B,R;return((M=r.formModel)==null?void 0:M["config-error_code"])??((R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(U=>U.model==="config-error_code"))==null?void 0:R.default)}),N=t.computed(()=>{var M,T,B,R;return((M=r.formModel)==null?void 0:M["config-error_message"])??((R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(U=>U.model==="config-error_message"))==null?void 0:R.default)}),_=(M,T)=>{if(T===h.value){r.onModelUpdated([],"config-limit"),r.onModelUpdated([],"config-window_size"),t.nextTick(()=>{h.value=void 0});return}r.onModelUpdated([M.config.limit],"config-limit"),r.onModelUpdated([M.config.window_size],"config-window_size"),t.nextTick(()=>{h.value=T})},w=M=>{h.value!==void 0&&(h.value=void 0),M!==null&&r.onModelUpdated(M.toString(),"config-window_type")},y=(M,T)=>{var R;h.value!==void 0&&(h.value=void 0);const B=Ie(((R=r.formModel)==null?void 0:R["config-limit"])??[]);B[M]=T,r.onModelUpdated(B,"config-limit")},g=(M,T)=>{var R;h.value!==void 0&&(h.value=void 0);const B=Ie(((R=r.formModel)==null?void 0:R["config-window_size"])??[]);B[M]=T,r.onModelUpdated(B,"config-window_size")},p=M=>{var R,U;h.value!==void 0&&(h.value=void 0);const T=Ie(((R=r.formModel)==null?void 0:R["config-limit"])??[]),B=Ie(((U=r.formModel)==null?void 0:U["config-window_size"])??[]);T.length===0&&T.push(void 0),B.length===0&&B.push(void 0),T.splice(M+1,0,void 0),B.splice(M+1,0,void 0),r.onModelUpdated(T,"config-limit"),r.onModelUpdated(B,"config-window_size")},V=M=>{var T,B;if(u.value.length>1){h.value!==void 0&&(h.value=void 0);const R=Ie(((T=r.formModel)==null?void 0:T["config-limit"])??[]),U=Ie(((B=r.formModel)==null?void 0:B["config-window_size"])??[]);R.length===0&&R.push(void 0),U.length===0&&U.push(void 0),R.splice(M,1),U.splice(M,1),r.onModelUpdated(R,"config-limit"),r.onModelUpdated(U,"config-window_size")}};return t.watch(()=>r.formModel["config-strategy"],M=>{M!=="redis"&&r.formModel.partials&&r.onModelUpdated(void 0,"partials")}),(M,T)=>{const B=t.resolveComponent("KLabel"),R=t.resolveComponent("KRadio"),U=t.resolveComponent("KInput"),ee=t.resolveComponent("KButton"),Oe=t.resolveComponent("KBadge"),J=t.resolveComponent("KTooltip"),Ve=t.resolveComponent("KCard"),Sn=t.resolveComponent("KSelect"),vt=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",_f,[t.createVNode(Y,{model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:T[0]||(T[0]=(O,H)=>e.onModelUpdated(O,H))},null,8,["model","options","schema"]),t.createVNode(Ve,{class:"rla-form-request-limits"},{title:t.withCtx(()=>[t.createVNode(B,{class:"rla-form-request-limits-title",for:"rla-form-request-limits-legend",required:""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",Ef,t.toDisplayString(t.unref(i)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Tf,[t.createElementVNode("div",Cf,[t.createVNode(B,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(i)("rla.window_type.help")},null,8,Sf)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",wf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F.value,O=>(t.openBlock(),t.createBlock(R,{key:`window-type-${O}`,"model-value":A.value,name:O,"selected-value":O,"onUpdate:modelValue":w},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)(`rla.window_type.options.${O}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",kf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(O,H)=>(t.openBlock(),t.createElementBlock("div",{key:H.toString()},[t.createVNode(B,{for:`rla-form-request-limits-item-${H}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.request_limits.label_index",{index:H+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Af,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${H}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(U,{"model-value":O.limit&&O.limit.toString(),placeholder:t.unref(i)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":Z=>y(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.interval_determiner")),1),t.createVNode(U,{"model-value":O.windowSize&&O.windowSize.toString(),placeholder:t.unref(i)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":Z=>g(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.seconds")),1)],8,Mf),t.createElementVNode("div",Nf,[t.createVNode(ee,{appearance:"tertiary",disabled:u.value.length<=1,onClick:()=>V(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.RemoveIcon))]),_:1},8,["disabled","onClick"]),t.createVNode(ee,{appearance:"tertiary",onClick:()=>p(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.AddIcon))]),_:1},8,["onClick"])])])]))),128))]),c.value.length>0?(t.openBlock(),t.createElementBlock("div",If,[t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.start_with_a_use_case")),1),t.createElementVNode("div",Of,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(O,H)=>(t.openBlock(),t.createBlock(J,{key:`use-case-${H}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(O.description),1),T[10]||(T[10]=t.createElementVNode("br",null,null,-1)),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.label"))+": "+t.toDisplayString(O.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.time_interval"))+": "+t.toDisplayString(O.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(Oe,{appearance:h.value===`${A.value}-${H}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>_(O,`${A.value}-${H}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(Sn,{modelValue:C.value,"onUpdate:modelValue":T[1]||(T[1]=O=>C.value=O),class:"rla-form-identifiers",items:f.value,label:t.unref(i)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:T[2]||(T[2]=O=>r.onModelUpdated(O.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:m.value&&m.value.help},null,8,Vf)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(B,{for:"rla-form-error-legend",info:t.unref(i)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",Bf,[t.createVNode(U,{class:"input-error-code","model-value":S.value&&S.value.toString(),placeholder:t.unref(i)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":T[3]||(T[3]=O=>e.onModelUpdated(Number.parseInt(O),"config-error_code"))},null,8,["model-value","placeholder"]),T[11]||(T[11]=t.createElementVNode("div",null,":",-1)),t.createVNode(U,{"model-value":N.value,placeholder:t.unref(i)("rla.error_message.message_placeholder"),"onUpdate:modelValue":T[4]||(T[4]=O=>e.onModelUpdated(O,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(vt,{modelValue:b.value,"onUpdate:modelValue":T[9]||(T[9]=O=>b.value=O),"data-testid":"view-advanced","trigger-label":t.unref(i)("rla.view_advanced")},{default:t.withCtx(()=>[t.createVNode(Y,{model:e.formModel,options:e.formOptions,schema:l.value.endsWithStrategy,onModelUpdated:T[5]||(T[5]=(O,H)=>e.onModelUpdated(O,H))},null,8,["model","options","schema"]),e.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.enableRedisPartial?"div":"KCard"),{key:0,class:"rla-form-redis-card",title:t.unref(i)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(Y,{"enable-redis-partial":e.enableRedisPartial,"is-editing":e.isEditing,model:e.formModel,options:e.formOptions,schema:l.value.redis,onModelUpdated:T[6]||(T[6]=(O,H)=>e.onModelUpdated(O,H)),onPartialToggled:e.onPartialToggled,onShowNewPartialModal:T[7]||(T[7]=()=>e.showNewPartialModal(e.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onPartialToggled"])]),_:1},8,["title"])):t.createCommentVNode("",!0),t.createVNode(Y,{class:t.normalizeClass({"rla-last-vfg":e.formModel["config-strategy"]!=="redis"}),model:e.formModel,options:e.formOptions,schema:l.value.afterStrategy,onModelUpdated:T[8]||(T[8]=(O,H)=>e.onModelUpdated(O,H))},null,8,["class","model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-dc7ac5da"]])},Symbol.toStringTag,{value:"Module"})),Rf=["array","metric","advanced","selectionGroup","object-advanced"],Df=e=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer","rate-limiting-advanced":"RLAForm"})[e];D.AUTOFILL_SLOT=he,D.AUTOFILL_SLOT_NAME=ze,D.EMPTY_VALUE_PLACEHOLDER=ao,D.FIELD_STATES=_e,D.FORMS_API_KEY=re,D.FORMS_CONFIG=no,D.PartialType=Et,D.REDIS_PARTIAL_FETCHER_KEY=oo,D.REDIS_PARTIAL_INFO=ll,D.VueFormGenerator=Y,D.abstractField=_c,D.composables=Ce,D.customFields=Rf,D.getSharedFormName=Df,D.sharedForms=Ff,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
|
|
4
|
+
will extend the wait time by about 12 minutes, continuously adjusting as new requests are made.`,config:{limit:500,window_size:3600}}]},o=new Set(["selectionGroup","enabled",...["identifier","limit","window_size","error_code","error_message"].map(M=>`config-${M}`)]),a=M=>M===void 0?!1:o.has(M),{t:i}=ue.createI18n("en-us",pe),r=e,s=t.computed(()=>{var B,R,U;const M=(R=(B=r.formSchema)==null?void 0:B.fields)==null?void 0:R.find(te=>te.type==="selectionGroup"&&te.model==="selectionGroup");return{fields:[(U=r.formSchema)==null?void 0:U.fields.find(te=>te.model==="enabled"),M].filter(Boolean)}}),l=t.computed(()=>{var te,Ve;const M=((Ve=(te=r.formSchema)==null?void 0:te.fields)==null?void 0:Ve.filter(J=>!a(J.model)))??[],T=[],B=[],R=[];let U=!1;for(const J of M){const Be=J.model;if(Be!==void 0){if(Be.startsWith("config-redis-")){(J.model==="config-redis-cluster_addresses"||J.model==="config-redis-sentinel_addresses")&&(J.inputAttributes.help=i("rla.redis.address_example")),B.push(J);continue}U?R.push(J):T.push(J),J.model==="config-strategy"&&(U=!0)}}return{endsWithStrategy:{fields:T},redis:r.enableRedisPartial?{fields:[{fields:B,id:"_redis",model:"__redis_partial",redisType:r.formSchema._supported_redis_partial_type}]}:{fields:B},afterStrategy:{fields:R}}}),c=t.computed(()=>{const M=r.formModel["config-window_type"];return Object.prototype.hasOwnProperty.call(n,M)?n[M]:[]}),m=t.computed(()=>{var M,T;return(T=(M=r.formSchema)==null?void 0:M.fields)==null?void 0:T.find(B=>B.model==="config-identifier")}),f=t.computed(()=>{var M,T,B;return(((B=(T=(M=r.formSchema)==null?void 0:M.fields)==null?void 0:T.find(R=>R.model==="config-identifier"))==null?void 0:B.values)??[]).map(R=>({label:i(`rla.identifiers.options.${R}`),value:R}))}),h=t.ref(),b=t.ref(!0),A=t.computed(()=>{var M,T,B;return r.formModel["config-window_type"]??((B=(T=(M=r.formSchema)==null?void 0:M.fields)==null?void 0:T.find(R=>R.model==="config-window_type"))==null?void 0:B.default)}),F=t.computed(()=>{var T,B,R,U,te,Ve;const M=(R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(J=>J.model==="config-window_type"))==null?void 0:R.default;return(((Ve=(te=(U=r.formSchema)==null?void 0:U.fields)==null?void 0:te.find(J=>J.model==="config-window_type"))==null?void 0:Ve.values)??[]).sort((J,Be)=>J===M?-1:Be===M?1:0)}),u=t.computed(()=>{var T;const M=(T=r.formModel["config-limit"])==null?void 0:T.map((B,R)=>{var U,te;return{limit:B,windowSize:(te=(U=r.formModel)==null?void 0:U["config-window_size"])==null?void 0:te[R]}});return!Array.isArray(M)||M.length===0?[{limit:void 0,windowSize:void 0}]:M}),C=t.computed(()=>{var M,T,B,R;return((M=r.formModel)==null?void 0:M["config-identifier"])??((R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(U=>U.model==="config-identifier"))==null?void 0:R.default)}),S=t.computed(()=>{var M,T,B,R;return((M=r.formModel)==null?void 0:M["config-error_code"])??((R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(U=>U.model==="config-error_code"))==null?void 0:R.default)}),N=t.computed(()=>{var M,T,B,R;return((M=r.formModel)==null?void 0:M["config-error_message"])??((R=(B=(T=r.formSchema)==null?void 0:T.fields)==null?void 0:B.find(U=>U.model==="config-error_message"))==null?void 0:R.default)}),_=(M,T)=>{if(T===h.value){r.onModelUpdated([],"config-limit"),r.onModelUpdated([],"config-window_size"),t.nextTick(()=>{h.value=void 0});return}r.onModelUpdated([M.config.limit],"config-limit"),r.onModelUpdated([M.config.window_size],"config-window_size"),t.nextTick(()=>{h.value=T})},w=M=>{h.value!==void 0&&(h.value=void 0),M!==null&&r.onModelUpdated(M.toString(),"config-window_type")},y=(M,T)=>{var R;h.value!==void 0&&(h.value=void 0);const B=Oe(((R=r.formModel)==null?void 0:R["config-limit"])??[]);B[M]=T,r.onModelUpdated(B,"config-limit")},g=(M,T)=>{var R;h.value!==void 0&&(h.value=void 0);const B=Oe(((R=r.formModel)==null?void 0:R["config-window_size"])??[]);B[M]=T,r.onModelUpdated(B,"config-window_size")},p=M=>{var R,U;h.value!==void 0&&(h.value=void 0);const T=Oe(((R=r.formModel)==null?void 0:R["config-limit"])??[]),B=Oe(((U=r.formModel)==null?void 0:U["config-window_size"])??[]);T.length===0&&T.push(void 0),B.length===0&&B.push(void 0),T.splice(M+1,0,void 0),B.splice(M+1,0,void 0),r.onModelUpdated(T,"config-limit"),r.onModelUpdated(B,"config-window_size")},V=M=>{var T,B;if(u.value.length>1){h.value!==void 0&&(h.value=void 0);const R=Oe(((T=r.formModel)==null?void 0:T["config-limit"])??[]),U=Oe(((B=r.formModel)==null?void 0:B["config-window_size"])??[]);R.length===0&&R.push(void 0),U.length===0&&U.push(void 0),R.splice(M,1),U.splice(M,1),r.onModelUpdated(R,"config-limit"),r.onModelUpdated(U,"config-window_size")}};return t.watch(()=>r.formModel["config-strategy"],M=>{M!=="redis"&&r.formModel.partials&&r.onModelUpdated(void 0,"partials")}),(M,T)=>{const B=t.resolveComponent("KLabel"),R=t.resolveComponent("KRadio"),U=t.resolveComponent("KInput"),te=t.resolveComponent("KButton"),Ve=t.resolveComponent("KBadge"),J=t.resolveComponent("KTooltip"),Be=t.resolveComponent("KCard"),Sn=t.resolveComponent("KSelect"),vt=t.resolveComponent("KCollapse");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",_f,[t.createVNode(Y,{model:e.formModel,options:e.formOptions,schema:s.value,onModelUpdated:T[0]||(T[0]=(O,H)=>e.onModelUpdated(O,H))},null,8,["model","options","schema"]),t.createVNode(Be,{class:"rla-form-request-limits"},{title:t.withCtx(()=>[t.createVNode(B,{class:"rla-form-request-limits-title",for:"rla-form-request-limits-legend",required:""},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.request_limits.title")),1)]),_:1}),t.createElementVNode("div",Ef,t.toDisplayString(t.unref(i)("rla.request_limits.subtitle")),1)]),default:t.withCtx(()=>[t.createElementVNode("div",Tf,[t.createElementVNode("div",Cf,[t.createVNode(B,{class:"rla-form-window-type-label","tooltip-attributes":{maxWidth:"300",placement:"top"}},{tooltip:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:t.unref(i)("rla.window_type.help")},null,8,Sf)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.window_type.label"))+" ",1)]),_:1}),t.createElementVNode("div",wf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F.value,O=>(t.openBlock(),t.createBlock(R,{key:`window-type-${O}`,"model-value":A.value,name:O,"selected-value":O,"onUpdate:modelValue":w},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)(`rla.window_type.options.${O}`)),1)]),_:2},1032,["model-value","name","selected-value"]))),128))])]),t.createElementVNode("div",kf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,(O,H)=>(t.openBlock(),t.createElementBlock("div",{key:H.toString()},[t.createVNode(B,{for:`rla-form-request-limits-item-${H}-legend`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.request_limits.label_index",{index:H+1})),1)]),_:2},1032,["for"]),t.createElementVNode("div",Af,[t.createElementVNode("legend",{id:`rla-form-request-limits-item-${H}-legend`,class:"rla-form-request-limits-inputs"},[t.createVNode(U,{"model-value":O.limit&&O.limit.toString(),placeholder:t.unref(i)("rla.request_limits.request_number"),type:"number","onUpdate:modelValue":Z=>y(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.interval_determiner")),1),t.createVNode(U,{"model-value":O.windowSize&&O.windowSize.toString(),placeholder:t.unref(i)("rla.request_limits.time_interval"),type:"number","onUpdate:modelValue":Z=>g(H,Number.parseInt(Z))},null,8,["model-value","placeholder","onUpdate:modelValue"]),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.seconds")),1)],8,Mf),t.createElementVNode("div",Nf,[t.createVNode(te,{appearance:"tertiary",disabled:u.value.length<=1,onClick:()=>V(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.RemoveIcon))]),_:1},8,["disabled","onClick"]),t.createVNode(te,{appearance:"tertiary",onClick:()=>p(H)},{default:t.withCtx(()=>[t.createVNode(t.unref(Se.AddIcon))]),_:1},8,["onClick"])])])]))),128))]),c.value.length>0?(t.openBlock(),t.createElementBlock("div",If,[t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.start_with_a_use_case")),1),t.createElementVNode("div",Of,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(O,H)=>(t.openBlock(),t.createBlock(J,{key:`use-case-${H}`,"max-width":"300"},{content:t.withCtx(()=>[t.createElementVNode("div",null,t.toDisplayString(O.description),1),T[10]||(T[10]=t.createElementVNode("br",null,null,-1)),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.label"))+": "+t.toDisplayString(O.config.limit),1),t.createElementVNode("div",null,t.toDisplayString(t.unref(i)("rla.request_limits.time_interval"))+": "+t.toDisplayString(O.config.window_size),1)]),default:t.withCtx(()=>[t.createVNode(Ve,{appearance:h.value===`${A.value}-${H}`?"info":"decorative",class:"rla-form-request-limits-examples-badge",onClick:()=>_(O,`${A.value}-${H}`)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(O.label),1)]),_:2},1032,["appearance","onClick"])]),_:2},1024))),128))])])):t.createCommentVNode("",!0)])]),_:1}),t.createVNode(Sn,{modelValue:C.value,"onUpdate:modelValue":T[1]||(T[1]=O=>C.value=O),class:"rla-form-identifiers",items:f.value,label:t.unref(i)("rla.identifiers.label"),"label-attributes":{tooltipAttributes:{maxWidth:"300",placement:"top"}},required:"",onSelected:T[2]||(T[2]=O=>r.onModelUpdated(O.value,"config-identifier"))},{"label-tooltip":t.withCtx(()=>[t.createElementVNode("div",{innerHTML:m.value&&m.value.help},null,8,Vf)]),_:1},8,["modelValue","items","label"]),t.createElementVNode("div",null,[t.createVNode(B,{for:"rla-form-error-legend",info:t.unref(i)("rla.error_message.help"),required:"","tooltip-attributes":{maxWidth:"300",placement:"top"}},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(t.unref(i)("rla.error_message.label")),1)]),_:1},8,["info"]),t.createElementVNode("legend",Bf,[t.createVNode(U,{class:"input-error-code","model-value":S.value&&S.value.toString(),placeholder:t.unref(i)("rla.error_message.code_placeholder"),type:"number","onUpdate:modelValue":T[3]||(T[3]=O=>e.onModelUpdated(Number.parseInt(O),"config-error_code"))},null,8,["model-value","placeholder"]),T[11]||(T[11]=t.createElementVNode("div",null,":",-1)),t.createVNode(U,{"model-value":N.value,placeholder:t.unref(i)("rla.error_message.message_placeholder"),"onUpdate:modelValue":T[4]||(T[4]=O=>e.onModelUpdated(O,"config-error_message"))},null,8,["model-value","placeholder"])])])]),t.createVNode(vt,{modelValue:b.value,"onUpdate:modelValue":T[9]||(T[9]=O=>b.value=O),"data-testid":"view-advanced","trigger-label":t.unref(i)("rla.view_advanced")},{default:t.withCtx(()=>[t.createVNode(Y,{model:e.formModel,options:e.formOptions,schema:l.value.endsWithStrategy,onModelUpdated:T[5]||(T[5]=(O,H)=>e.onModelUpdated(O,H))},null,8,["model","options","schema"]),e.formModel["config-strategy"]==="redis"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.enableRedisPartial?"div":"KCard"),{key:0,class:"rla-form-redis-card",title:t.unref(i)("rla.redis.title")},{default:t.withCtx(()=>[t.createVNode(Y,{"enable-redis-partial":e.enableRedisPartial,"is-editing":e.isEditing,model:e.formModel,options:e.formOptions,schema:l.value.redis,onModelUpdated:T[6]||(T[6]=(O,H)=>e.onModelUpdated(O,H)),onPartialToggled:e.onPartialToggled,onShowNewPartialModal:T[7]||(T[7]=()=>e.showNewPartialModal(e.formSchema._supported_redis_partial_type))},null,8,["enable-redis-partial","is-editing","model","options","schema","onPartialToggled"])]),_:1},8,["title"])):t.createCommentVNode("",!0),t.createVNode(Y,{class:t.normalizeClass({"rla-last-vfg":e.formModel["config-strategy"]!=="redis"}),model:e.formModel,options:e.formOptions,schema:l.value.afterStrategy,onModelUpdated:T[8]||(T[8]=(O,H)=>e.onModelUpdated(O,H))},null,8,["class","model","options","schema"])]),_:1},8,["modelValue","trigger-label"])],64)}}}),[["__scopeId","data-v-dc7ac5da"]])},Symbol.toStringTag,{value:"Module"})),Rf=["array","metric","advanced","selectionGroup","object-advanced"],Df=e=>({"openid-connect":"OIDCForm","post-function":"PostFunction","pre-function":"PostFunction","exit-transformer":"ExitTransformer","rate-limiting-advanced":"RLAForm"})[e];L.AUTOFILL_SLOT=he,L.AUTOFILL_SLOT_NAME=Ke,L.EMPTY_VALUE_PLACEHOLDER=io,L.FIELD_STATES=_e,L.FORMS_API_KEY=re,L.FORMS_CONFIG=oo,L.PartialType=Et,L.REDIS_PARTIAL_FETCHER_KEY=ao,L.REDIS_PARTIAL_INFO=ll,L.VueFormGenerator=Y,L.abstractField=_c,L.composables=Ce,L.customFields=Rf,L.getSharedFormName=Df,L.sharedForms=Ff,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|