/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
const e={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{}};function t(t){function r(e,t){return`${e}[${t}]`}function a(e,a,n,s){const i=[r(e,a)];switch(n){case"swap":i.push(r(e,s));break;case"move":{const[t,n]=[Math.min(a,s),Math.max(a,s)];for(let a=t;a<=n;a++)i.push(r(e,a));break}default:{const n=t.getFieldValue(e),s=Array.isArray(n)?n.length:0;for(let t=a+1;t<s;t++)i.push(r(e,t));break}}return Object.keys(t.fieldInfo).filter(e=>i.some(t=>e.startsWith(t)))}function n(e,r){("up"===r?e:[...e].reverse()).forEach(e=>{const a=function(e,t){return e.replace(/\[(\d+)\]/,(e,r)=>{const a=parseInt(r,10);return`[${"up"===t?a+1:Math.max(0,a-1)}]`})}(e.toString(),r),n=t.getFieldMeta(a);n?t.setFieldMeta(e,n):t.setFieldMeta(e,s())})}const s=()=>e;return{handleArrayMove:function(e,s,i){const o=a(e,s,"move",i),c=Math.min(s,i),l=Math.max(s,i);for(let t=c;t<=l;t++)o.push(r(e,t));const u=Object.keys(t.fieldInfo).reduce((a,n)=>(n.startsWith(r(e,s))&&a.set(n,t.getFieldMeta(n)),a),
/* @__PURE__ */new Map);n(o,s<i?"up":"down"),Object.keys(t.fieldInfo).filter(t=>t.startsWith(r(e,i))).forEach(a=>{const n=a.replace(r(e,i),r(e,s)),o=u.get(n);o&&t.setFieldMeta(a,o)})},handleArrayRemove:function(e,t){n(a(e,t,"remove"),"up")},handleArraySwap:function(e,n,s){a(e,n,"swap",s).forEach(a=>{if(!a.toString().startsWith(r(e,n)))return;const i=a.toString().replace(r(e,n),r(e,s)),[o,c]=[t.getFieldMeta(a),t.getFieldMeta(i)];o&&t.setFieldMeta(i,o),c&&t.setFieldMeta(a,c)})},handleArrayInsert:function(e,i){const o=a(e,i,"insert");n(o,"down"),o.forEach(a=>{a.toString().startsWith(r(e,i))&&t.setFieldMeta(a,s())})}}}export{e as defaultFieldMeta,t as metaHelper};