import{u as re,b as qe,c as h,d as We,i as Ie,_ as Me}from"./useConfig.442d698e.js";import{d as Ee,c as y,aI as C,i as He,f as P,t as Oe,r as Te,o as Ke,b as Ue,w as ke,p as we,n as ze}from"./arco.768e32d2.js";import{G as Ge,A as je,z as Ne,B as Fe,H as Je,J as Ce,K as Xe,M as ie,F as Ze}from"./index.ed45be5a.js";import{u as Qe,i as _e}from"./index.8714e774.js";import{u as Re,F as Be,i as Pe,V as q,_ as R,a as Ye,C as er,r as b,s as $e,v as rr}from"./form-model.10d173e3.js";import{g as de,r as tr}from"./index.d87791fe.js";import{a as ar,C as nr,E as lr}from"./dialog.3cb279ab.js";/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */var ur={content:{type:[String,Function]},default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},download:{type:[String,Boolean]},hover:{type:String,default:"underline",validator:function(e){return e?["color","underline"].includes(e):!0}},href:{type:String,default:""},prefixIcon:{type:Function},size:{type:String,default:"medium",validator:function(e){return e?["small","medium","large"].includes(e):!0}},suffixIcon:{type:Function},target:{type:String,default:""},theme:{type:String,default:"default",validator:function(e){return e?["default","primary","danger","warning","success"].includes(e):!0}},underline:Boolean,onClick:Function};/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function Le(l,e){var o=Object.keys(l);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(l);e&&(s=s.filter(function(S){return Object.getOwnPropertyDescriptor(l,S).enumerable})),o.push.apply(o,s)}return o}function ir(l){for(var e=1;e0;return t!=null?t:d}),A=y(function(){return s.label||e.label}),J=y(function(){return!!(r!=null&&r.colon&&A.value)}),W=re("form__label"),H=y(function(){return Pe(e.labelAlign)?r==null?void 0:r.labelAlign:e.labelAlign}),E=y(function(){return Pe(e.labelWidth)?r==null?void 0:r.labelWidth:e.labelWidth}),me=y(function(){return[p.value.label,h(h(h(h(h({},"".concat(W.value,"--required"),G.value),"".concat(W.value,"--colon"),J.value),"".concat(W.value,"--top"),A.value&&(H.value==="top"||!E.value)),"".concat(W.value,"--left"),H.value==="left"&&E.value),"".concat(W.value,"--right"),H.value==="right"&&E.value)]}),ge=function(){if(Number(E.value)!==0){var n={};return E.value&&H.value!=="top"&&(Ie(E.value)?n={width:"".concat(E.value,"px")}:n={width:E.value}),C("div",{class:me.value,style:n},[C("label",{for:e.for||null},[S("label")])])}},ne=function(){var n=function(O){return C("span",{class:p.value.status},[C(O,null,null)])},t=L.value;if(D.value===q.SUCCESS)return n(_);if(t!=null&&t[0]){var d=t[0].type||"error",f={error:te,warning:ae}[d]||_;return n(f)}return null},pe=function(){var n=e.statusIcon;if(n!==!1){var t=S("statusIcon",{defaultNode:ne()});if(t)return C("span",{class:p.value.status},[t]);if(t!==!1&&(t=r==null?void 0:r.renderContent("statusIcon",{defaultNode:ne(),params:e}),t))return t}},X=y(function(){if(!k.value)return"";if(D.value===q.SUCCESS)return e.successBorder?[p.value.success,p.value.successBorder].join(" "):p.value.success;if(!!L.value.length){var a=L.value[0].type||"error";return a==="error"?p.value.error:p.value.warning}}),se=y(function(){return[p.value.controls,X.value]}),oe=y(function(){var a={};return E.value&&H.value!=="top"&&(Ie(E.value)?a={marginLeft:"".concat(E.value,"px")}:a={marginLeft:E.value}),a}),L=P([]),B=P([]),D=P(q.TO_BE_VALIDATED),le=P(!1),x=P(!1),ue=function(){x.value=!1,L.value=[],B.value=[],D.value=q.TO_BE_VALIDATED},ye=function(){var n=Object.prototype.toString.call(de(r==null?void 0:r.data,e.name)),t;return n==="[object String]"&&(t=""),n==="[object Array]"&&(t=[]),n==="[object Object]"&&(t={}),t},be=function(){var a=R(b.mark(function n(){var t,d=arguments;return b.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:if(t=d.length>0&&d[0]!==void 0?d[0]:r==null?void 0:r.resetType,e.name){j.next=3;break}return j.abrupt("return");case 3:return t==="empty"?$e(r==null?void 0:r.data,e.name,ye()):t==="initial"&&$e(r==null?void 0:r.data,e.name,M.value),j.next=6,ze();case 6:le.value?x.value=!0:ue();case 7:case"end":return j.stop()}},n)}));return function(){return a.apply(this,arguments)}}(),ce=y(function(){var a;return(a=r==null?void 0:r.errorMessage)!==null&&a!==void 0?a:$.value.errorMessage}),g=y(function(){var a;if((a=e.rules)!==null&&a!==void 0&&a.length)return e.rules;if(!e.name)return[];var n="".concat(e.name).lastIndexOf(".")||-1,t="".concat(e.name).slice(n+1);return de(r==null?void 0:r.rules,e.name)||de(r==null?void 0:r.rules,t)||[]}),u=function(){var a=R(b.mark(function n(t){var d,f;return b.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(f={successList:[],errorList:[],rules:[],resultList:[],allowSetValue:!1},f.rules=t==="all"?g.value:g.value.filter(function(m){return(m.trigger||"change")===t}),!(g.value.length&&!((d=f.rules)!==null&&d!==void 0&&d.length))){O.next=4;break}return O.abrupt("return",f);case 4:return f.allowSetValue=!0,O.next=7,rr(w.value,f.rules);case 7:return f.resultList=O.sent,f.errorList=f.resultList.filter(function(m){return m.result!==!0}).map(function(m){return Object.keys(m).forEach(function(Y){if(!m.message&&ce.value[Y]){var fe=Xe(e.label)?e.label:e.name;m.message=cr(ce.value[Y],{name:fe,validate:m[Y]})}}),m}),f.successList=f.resultList.filter(function(m){return m.result===!0&&m.message&&m.type==="success"}),O.abrupt("return",f);case 11:case"end":return O.stop()}},n)}));return function(t){return a.apply(this,arguments)}}(),i=function(){var a=R(b.mark(function n(t,d){var f,j,O,m,Y,fe;return b.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return le.value=!0,F.value=d,ee.next=4,u(t);case 4:return f=ee.sent,j=f.successList,O=f.errorList,m=f.rules,Y=f.resultList,fe=f.allowSetValue,fe&&(B.value=j,L.value=O),m.length&&(D.value=O.length?q.FAIL:q.SUCCESS),x.value&&ue(),le.value=!1,ee.abrupt("return",h({},e.name,O.length===0?!0:Y));case 15:case"end":return ee.stop()}},n)}));return function(t,d){return a.apply(this,arguments)}}(),v=function(){var a=R(b.mark(function n(t){var d,f,j;return b.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,u(t);case 2:return d=m.sent,f=d.errorList,j=d.resultList,m.abrupt("return",h({},e.name,f.length===0?!0:j));case 6:case"end":return m.stop()}},n)}));return function(t){return a.apply(this,arguments)}}(),c=function(n){!n&&!Ce(n)||(n.length===0&&(L.value=[],D.value=q.SUCCESS),L.value=n.map(function(t){return Se(Se({},t),{},{result:!1})}),D.value=q.FAIL)},w=y(function(){return(r==null?void 0:r.data)&&de(r==null?void 0:r.data,e.name)}),M=P(void 0),T=Oe(e),K=T.name,Z=Te({name:K,resetHandler:ue,resetField:be,validate:i,validateOnly:v,setValidateMessage:c});Ke(function(){M.value=Je(w.value),r==null||r.children.push(Z)}),Ue(function(){r&&(r.children=r==null?void 0:r.children.filter(function(a){return a!==Z}))}),ke(w,R(b.mark(function a(){return b.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i("change");case 2:case"end":return t.stop()}},a)})),{deep:!0}),ke(function(){return[e.name,JSON.stringify(e.rules)].join(",")},function(){i("change")});var F=P(void 0),k=y(function(){return _e(F.value)?F.value:_e(e.showErrorMessage)?e.showErrorMessage:r==null?void 0:r.showErrorMessage}),ve=y(function(){return[p.value.formItem,De(z.value,e.name),h(h({},p.value.formItemWithHelp,he.value),p.value.formItemWithExtra,N.value)]}),he=y(function(){var a=S("help");return a?C("div",{class:p.value.help},[a]):null}),N=y(function(){var a,n=function(f){return C("div",{class:p.value.extra,title:f},[f])},t=L.value;return k.value&&t!==null&&t!==void 0&&(a=t[0])!==null&&a!==void 0&&a.message?n(t[0].message):B.value.length?n(B.value[0].message):null}),Q=y(function(){var a=S("tips");if(!a)return null;var n=["".concat(z.value,"-tips"),"".concat(U.value,"-tips"),"".concat(U.value,"-is-").concat(e.status||"default")];return C("div",{class:n},[a])}),xe=function(){var a=R(b.mark(function n(){return b.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,i("blur");case 2:case"end":return d.stop()}},n)}));return function(){return a.apply(this,arguments)}}();return we(Ye,{handleBlur:xe}),function(){return C("div",{class:ve.value},[ge(),C("div",{class:se.value,style:oe.value},[C("div",{class:p.value.controlsContent},[S("default"),pe()]),he.value,Q.value,N.value])])}}});/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */var fr={colon:Boolean,data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:void 0},errorMessage:{type:Object},formControlledComponents:{type:Array},labelAlign:{type:String,default:"right",validator:function(e){return e?["left","right","top"].includes(e):!0}},labelWidth:{type:[String,Number],default:"100px"},layout:{type:String,default:"vertical",validator:function(e){return e?["vertical","inline"].includes(e):!0}},preventSubmitDefault:{type:Boolean,default:!0},requiredMark:{type:Boolean,default:void 0},resetType:{type:String,default:"empty",validator:function(e){return e?["empty","initial"].includes(e):!0}},rules:{type:Object},scrollToFirstError:{type:String,validator:function(e){return e?["","smooth","auto"].includes(e):!0}},showErrorMessage:{type:Boolean,default:!0},statusIcon:{type:[Boolean,Function],default:void 0},submitWithWarningMessage:Boolean,onReset:Function,onSubmit:Function,onValidate:Function};/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function Ae(l,e){var o=Object.keys(l);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(l);e&&(s=s.filter(function(S){return Object.getOwnPropertyDescriptor(l,S).enumerable})),o.push.apply(o,s)}return o}function dr(l){for(var e=1;e