import{t as d,l as i,A as f,bu as h,w as p}from"./antd-057b41b1.js";var g=0;function u(e){var n=++g;return d(e)+n}function A(e){if(e&&e.component){const n=u(`${y(e.component)}_`);return e.key=n,e.field=n,!0}return u("key_")}function k(e,n){let r=[];if(i(e)){if(h(n))r=e.splice(n,1);else{const s=e.findIndex(n);s!==-1&&(r=e.splice(s,1))}return r.shift()}}function y(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function o(e,n){if(!i(e))return;const r=s=>{s.forEach(c=>{["Grid"].includes(c.component)?c.columns?.forEach(t=>r(t.children)):n(c)})};r(e)}const q=(e,n)=>{let r;const s=c=>c.some(t=>{const{component:a}=t;return["Grid"].includes(a)?t.columns?.some(l=>s(l.children)):(n(t)&&(r=t),n(t))});return s(e),r},F=e=>{const n=f(e);return delete n.currentItem,delete n.activeKey,n.schemas&&o(n.schemas,r=>{delete r.icon,delete r.key}),n},w=async e=>{try{return p(e)?await e():e}catch{return[]}},x=e=>{o(e,n=>{"required"in n&&(!i(n.rules)&&(n.rules=[]),n.rules.push({required:!0,message:n.message}),delete n.required,delete n.message)})};export{x as a,q as b,k as c,o as f,A as g,w as h,F as r};