import{cB as l,a4 as n,ab as c,a8 as T,a9 as t,cC as f}from"./index-F5308wi0.js";import{c as z,u as M}from"./capitalize-CGrE5d6Y.js";function N(u,e,r,x){for(var s=-1,d=u==null?0:u.length;++s<d;)r=e(r,u[s],s,u);return r}function Z(u){return function(e){return u==null?void 0:u[e]}}var D={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},w=Z(D),F=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,W="\\u0300-\\u036f",$="\\ufe20-\\ufe2f",y="\\u20d0-\\u20ff",H=W+$+y,V="["+H+"]",G=RegExp(V,"g");function J(u){return u=l(u),u&&u.replace(F,w).replace(G,"")}var P=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function B(u){return u.match(P)||[]}var Y=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function _(u){return Y.test(u)}var m="\\ud800-\\udfff",q="\\u0300-\\u036f",K="\\ufe20-\\ufe2f",Q="\\u20d0-\\u20ff",X=q+K+Q,p="\\u2700-\\u27bf",R="a-z\\xdf-\\xf6\\xf8-\\xff",u0="\\xac\\xb1\\xd7\\xf7",e0="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",r0="\\u2000-\\u206f",n0=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",C="A-Z\\xc0-\\xd6\\xd8-\\xde",a0="\\ufe0e\\ufe0f",E=u0+e0+r0+n0,h="['’]",o="["+E+"]",s0="["+X+"]",A="\\d+",x0="["+p+"]",O="["+R+"]",k="[^"+m+E+A+p+R+C+"]",d0="\\ud83c[\\udffb-\\udfff]",f0="(?:"+s0+"|"+d0+")",c0="[^"+m+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",U="[\\ud800-\\udbff][\\udc00-\\udfff]",a="["+C+"]",t0="\\u200d",i="(?:"+O+"|"+k+")",o0="(?:"+a+"|"+k+")",g="(?:"+h+"(?:d|ll|m|re|s|t|ve))?",b="(?:"+h+"(?:D|LL|M|RE|S|T|VE))?",L=f0+"?",S="["+a0+"]?",i0="(?:"+t0+"(?:"+[c0,v,U].join("|")+")"+S+L+")*",g0="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",b0="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",l0=S+L+i0,m0="(?:"+[x0,v,U].join("|")+")"+l0,p0=RegExp([a+"?"+O+"+"+g+"(?="+[o,a,"$"].join("|")+")",o0+"+"+b+"(?="+[o,a+i,"$"].join("|")+")",a+"?"+i+"+"+g,a+"+"+b,b0,g0,A,m0].join("|"),"g");function R0(u){return u.match(p0)||[]}function C0(u,e,r){return u=l(u),e=e,e===void 0?_(u)?R0(u):B(u):u.match(e)||[]}var E0="['’]",h0=RegExp(E0,"g");function A0(u){return function(e){return N(C0(J(e).replace(h0,"")),u,"")}}var O0=A0(function(u,e,r){return e=e.toLowerCase(),u+(r?z(e):e)});const k0=u=>{const e=O0(u);return M(e)},L0=u=>{if("success"in u){const{success:e,okText:r,helperText:x,failText:s,showIcon:d,action:j,className:I}=u;return n.jsxs("span",{className:c(I,"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset",{"bg-green-50 text-success ring-green-600/20 dark:bg-green-500/10 dark:ring-green-500/20":e,"bg-red-50 text-danger ring-red-600/10 dark:bg-red-400/10 dark:ring-red-400/20":!e}),children:[d&&n.jsx(T,{mr:4,type:e?"icon-right":"icon-wrong"}),n.jsx(t,{title:x,children:n.jsx("span",{children:e?r:s})}),j]})}if("enabled"in u){const{enabled:e,helperText:r,className:x}=u;return n.jsx("span",{className:c(x,"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset",{"bg-green-50 text-success ring-green-600/20 dark:bg-green-500/10 dark:ring-green-500/20":e===f.EFFECTIVE,"bg-red-50 text-danger ring-red-600/10 dark:bg-red-400/10 dark:ring-red-400/20":e!==f.EFFECTIVE}),children:n.jsx(t,{title:r,children:n.jsx("span",{children:k0(e===f.EFFECTIVE?"Enabled":"Disabled")})})})}return null};export{L0 as S,Z as b};