@nuwatop/code-canvas-core 0.5.96 → 0.5.97

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),Cr=require("react-dom/client"),F=require("antd"),qn=require("@ant-design/cssinjs"),Mr=require("antd/locale/zh_CN"),Ar=require("zustand"),jr=require("zustand/middleware"),wr=require("zustand/middleware/immer"),i=require("react"),ze=require("@ant-design/icons"),kr=require("clsx"),Ye=require("dayjs"),Vt=require("react-pdf");require("react-pdf/dist/Page/TextLayer.css");require("react-pdf/dist/Page/AnnotationLayer.css");const at=require("@ant-design/plots");function Dr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Xe=Dr(ze),Rt=new WeakMap,Gt=new WeakMap;let Jt=!1;const Wn=()=>{Jt||(Jt=!0)},Nr=t=>{let e=Gt.get(t);return e||(e=qn.createCache(),Gt.set(t,e)),e},Tr=t=>{t&&Gt.delete(t)},Er=async({el:t,component:e,props:n={},customTheme:o="light",forMainDocument:r=!1,skipUnmount:s=!1})=>{var w;Wn();const a=Rt.get(t);if(a){if(s)Object.keys(t).forEach(M=>{if(M.startsWith("__reactContainer")||M.startsWith("_reactRootContainer"))try{delete t[M]}catch{}});else try{a.unmount()}catch(M){console.warn("[mountReactComponent] Unmount failed (benign if DOM was cleared):",M)}Rt.delete(t)}const c=Cr.createRoot(t);Rt.set(t,c);const l=window.__ANTD_CSSINJS_CONTAINER__,y=window.__ANTD_IFRAME_DOC__,h=!r&&l&&y&&y.defaultView!==null,p=h?l:window.document.head,g=h?y:window.document,x=Nr(g),m=(((w=window.__GLS_COMPS__)==null?void 0:w.theme)||o)==="dark"?F.theme.darkAlgorithm:F.theme.defaultAlgorithm,d=M=>u.jsx(qn.StyleProvider,{cache:x,container:p,hashPriority:"high",children:u.jsx(F.ConfigProvider,{locale:Mr,theme:{algorithm:m,cssVar:{key:"antd-canvas"},hashed:!1},getPopupContainer:()=>t,children:u.jsx(e,{...M})})});window.__CURRENT_STYLE_CONTAINER__=p;const C=t.hasAttribute("editing"),b={...n};return C&&b.develop===void 0&&(b.develop=!0),c.render(d(b)),{root:c,unmount:()=>{try{c.unmount(),Rt.delete(t)}catch(M){console.error("[code-canvas-core] Failed to unmount component:",M)}},update:M=>{window.__CURRENT_STYLE_CONTAINER__=p,c.render(d(M))}}},_r=()=>{console.info("[code-canvas-core] Cleanup called - components will be garbage collected"),Jt=!1};function dt(t){const e=t.match(/^(.+)\[(\d+)\]$/);return e?{baseName:e[1],index:parseInt(e[2],10)}:{baseName:t,index:null}}function lt(t){if(!t||typeof t!="string")return[];const e=[],n=t.split(".").flatMap(o=>{const r=o.match(/^([^\[]+)(\[\d+\])(.*)$/);if(r){const s=[r[1]];let a=r[2]+r[3],c;for(;c=a.match(/^\[(\d+)\](.*)$/);)s.push(`[${c[1]}]`),a=c[2];return a&&s.push(a),s}return[o]});for(const o of n)if(o.startsWith("[")&&o.endsWith("]")){const r=parseInt(o.slice(1,-1),10);Number.isNaN(r)||e.push({type:"array",key:r})}else o&&e.push({type:"property",key:o});return e}function xt(t,e){if(e.length===0)return t;let n=t;for(const o of e){if(n==null)return;if(o.type==="array"){if(!Array.isArray(n))return;n=n[o.key]}else n=n[o.key]}return n}function In(t,e,n){if(!e.length)return n;const o=Array.isArray(t)?[...t]:{...t};let r=o;for(let a=0;a<e.length-1;a++){const c=e[a],l=e[a+1],y=c.key;let h=r[y];h==null?h=l.type==="array"?[]:{}:l.type==="array"&&!Array.isArray(h)?h=[]:l.type==="property"&&Array.isArray(h)?h=Object.fromEntries(h.map((p,g)=>[String(g),p]).filter(([,p])=>p!==void 0)):h=Array.isArray(h)?[...h]:{...h},r[y]=h,r=h}const s=e[e.length-1];return r[s.key]=n,o}function de(t,e){if(e)return t?`${t}_${e}`:e}function bt(t,e){if(e)return t?`${t}_${e}_validate`:`${e}_validate`}const gn={dataSets:{},commandQueues:{},propsStore:{},validateStore:{}};function pn(t,e,n,o){const{baseName:r,index:s}=dt(e);if(t.dataSets[r]||(t.dataSets[r]={}),s!==null){const y=t.dataSets[r];let h=y.value;Array.isArray(h)||(h=[]);const p=h[s],g=n.length===0?p:xt(p??{},n),x=o(g),v=n.length===0?x:In(p??{},n,x),f=[...h];f[s]=v,t.dataSets[r]={...y,value:f};return}if(n.length===0){t.dataSets[r]=o(t.dataSets[r]);return}let a=t.dataSets[r];for(let y=0;y<n.length-1;y++){const h=n[y],p=n[y+1];let g=a[h.key];g==null&&(a[h.key]=p.type==="array"?[]:{},g=a[h.key]),a=g}const c=n[n.length-1],l=a[c.key];a[c.key]=o(l)}const O=Ar.create()(jr.subscribeWithSelector(wr.immer((t,e)=>({...gn,setDataSet:(n,o,r,s=!0)=>t(a=>{if(!n)return;const c=o?lt(o):[],l=s&&typeof r=="object"&&r!==null&&!Array.isArray(r);pn(a,n,c,h=>l&&h!=null&&typeof h=="object"&&!Array.isArray(h)?{...h,...r}:r)}),updateDataSet:(n,o,r)=>t(s=>{if(!n||typeof r!="function")return;const a=o?lt(o):[];pn(s,n,a,r)}),getDataSet:(n,o)=>{if(!n)return;const r=e().dataSets,{baseName:s,index:a}=dt(n),c=r[s];if(a!==null){const l=c==null?void 0:c.value;if(!Array.isArray(l)||l[a]===void 0)return;const y=l[a];return o?xt(y,lt(o)):y}if(c)return o?xt(c,lt(o)):c},setDataSetBatch:(n,o)=>t(r=>{r.dataSets[n]={...r.dataSets[n],...o}}),clearDataSet:n=>t(o=>{delete o.dataSets[n]}),addCommand:(n,o)=>t(r=>{r.commandQueues[n]||(r.commandQueues[n]=[]),r.commandQueues[n].push(o)}),popCommand:n=>{const o=e().commandQueues[n];if(o&&o.length>0){const r=o[0];return t(s=>{s.commandQueues[n]=s.commandQueues[n].slice(1)}),r}},clearCommands:n=>t(o=>{o.commandQueues[n]=[]}),getCommands:n=>e().commandQueues[n]||[],setProps:(n,o,r)=>t(s=>{const a=`${n}_props`;s.propsStore[a]||(s.propsStore[a]={}),s.propsStore[a][o]=r}),getProps:(n,o)=>{var s;const r=`${n}_props`;return(s=e().propsStore[r])==null?void 0:s[o]},setValidateResult:(n,o,r,s)=>t(a=>{const c=bt(n,o);c&&(a.validateStore[c]||(a.validateStore[c]={}),a.validateStore[c][r]=s)}),getValidateResult:(n,o,r)=>{var a;const s=bt(n,o);return s?((a=e().validateStore[s])==null?void 0:a[r])??"":""},getValidateResults:(n,o)=>{const r=bt(n,o);return r?e().validateStore[r]??{}:{}},reset:()=>t(gn)}))));function Or(t){const{dataSet:e,dataSetField:n}=t,o=O(r=>r.setDataSet);return{get value(){var r;return(r=O.getState().dataSets[e||""])==null?void 0:r[n||""]},set value(r){e&&n&&o(e,n,r)}}}function Rr(t){const e=O(n=>n.setDataSetBatch);return{get value(){return O.getState().dataSets[t]},set value(n){e(t,n)}}}function $r(){return O(t=>t.addCommand)}function Br(){return O(t=>t.popCommand)}function Hn(t,e){const n=O(r=>{if(!t)return;const s=dt(t).baseName;return r.dataSets[s]}),o=O(r=>r.getDataSet);return i.useMemo(()=>{if(!t)return[];const r=e&&String(e).trim()!==""?e:"",s=o(t,r);return Array.isArray(s)?s:s!=null&&typeof s=="object"&&Array.isArray(s.value)?s.value:[]},[n,t,e,o])}function Lr(){const t=O(s=>s.setDataSetBatch),e=O(s=>s.setDataSet),n=O(s=>s.updateDataSet),o=O(s=>s.getDataSet),r=O.getState;return{get items(){const s=r().dataSets;return new Proxy(s,{get(a,c){return a[c]||{}}})},getDataSet:o,setDataSet:e,updateDataSet:n,updateItem:(s,a)=>{const c=a!==null&&typeof a=="object"&&!Array.isArray(a)?a:{value:a};t(s,c)},getItem:s=>r().dataSets[s]||{}}}function Vr(t){const e=O(s=>s.addCommand),n=O(s=>s.popCommand),o=O(s=>s.getCommands),r=O(s=>s.clearCommands);return{commands:o(t),addCommand:(s,a)=>{e(t,{actionName:s,arg:a,timestamp:Date.now()})},popCommand:()=>n(t),clearCommands:()=>r(t)}}function Yn(t,e,n={}){return O.subscribe(r=>r.commandQueues[e],r=>{if(r&&r.length>0){const s=[...r],a=[];s.forEach(c=>{try{const l=n[c.actionName];typeof l=="function"?l(c.arg):console.warn(`[watchCommands] Function not found: ${c.actionName}`),a.push(c)}catch(l){console.error("[watchCommands] 命令执行失败:",c,l),a.push(c)}}),a.length>0&&(console.log("[watchCommands] Clearing command queue after execution"),O.getState().clearCommands(e))}})}function Fr(t){return function(e,n){const o=t();return Yn(e,n,o)}}function st(t,e=null,n={}){if(!t)return{actionName:"",arg:null};const o=t.match(/^([^(]+)\(([^)]*)\)$/);if(!o)return{actionName:t,arg:e};const r=o[1].trim(),s=o[2].trim();if(!s)return{actionName:r,arg:e};const a=s.split(",").map(l=>{const y=l.trim();if(y==="@value")return e;if(y.startsWith("@")){const h=y.substring(1);return n[h]}return y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'")?y.slice(1,-1):isNaN(Number(y))?y:Number(y)}),c=a.length===1?a[0]:a;return{actionName:r,arg:c}}function Te(t,e,n={}){return st(t,e,n)}function on(t,e={}){return st(t,null,e)}function Pr(t,e={}){return st(t,null,e)}function se(t,e){return{actionName:t,arg:e,timestamp:Date.now()}}function ut(){return ut=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ut.apply(this,arguments)}function Kr(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Dt(t,e)}function Qt(t){return Qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qt(t)}function Dt(t,e){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Dt(t,e)}function zr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lt(t,e,n){return zr()?Lt=Reflect.construct.bind():Lt=function(r,s,a){var c=[null];c.push.apply(c,s);var l=Function.bind.apply(r,c),y=new l;return a&&Dt(y,a.prototype),y},Lt.apply(null,arguments)}function qr(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Zt(t){var e=typeof Map=="function"?new Map:void 0;return Zt=function(o){if(o===null||!qr(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(o))return e.get(o);e.set(o,r)}function r(){return Lt(o,arguments,Qt(this).constructor)}return r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Dt(r,o)},Zt(t)}var Wr=/%[sdj%]/g,Un=function(){};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Un=function(e,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(o){return typeof o=="string"})&&console.warn(e,n)});function Xt(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var o=n.field;e[o]=e[o]||[],e[o].push(n)}),e}function Ue(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var r=0,s=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var a=t.replace(Wr,function(c){if(c==="%%")return"%";if(r>=s)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}break;default:return c}});return a}return t}function Ir(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function Fe(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||Ir(e)&&typeof t=="string"&&!t)}function Hr(t,e,n){var o=[],r=0,s=t.length;function a(c){o.push.apply(o,c||[]),r++,r===s&&n(o)}t.forEach(function(c){e(c,a)})}function vn(t,e,n){var o=0,r=t.length;function s(a){if(a&&a.length){n(a);return}var c=o;o=o+1,c<r?e(t[c],s):n([])}s([])}function Yr(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,t[n]||[])}),e}var bn=function(t){Kr(e,t);function e(n,o){var r;return r=t.call(this,"Async Validation Error")||this,r.errors=n,r.fields=o,r}return e}(Zt(Error));function Ur(t,e,n,o,r){if(e.first){var s=new Promise(function(g,x){var v=function(d){return o(d),d.length?x(new bn(d,Xt(d))):g(r)},f=Yr(t);vn(f,n,v)});return s.catch(function(g){return g}),s}var a=e.firstFields===!0?Object.keys(t):e.firstFields||[],c=Object.keys(t),l=c.length,y=0,h=[],p=new Promise(function(g,x){var v=function(m){if(h.push.apply(h,m),y++,y===l)return o(h),h.length?x(new bn(h,Xt(h))):g(r)};c.length||(o(h),g(r)),c.forEach(function(f){var m=t[f];a.indexOf(f)!==-1?vn(m,n,v):Hr(m,n,v)})});return p.catch(function(g){return g}),p}function Gr(t){return!!(t&&t.message!==void 0)}function Jr(t,e){for(var n=t,o=0;o<e.length;o++){if(n==null)return n;n=n[e[o]]}return n}function xn(t,e){return function(n){var o;return t.fullFields?o=Jr(e,t.fullFields):o=e[n.field||t.fullField],Gr(n)?(n.field=n.field||t.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||t.fullField}}}function Sn(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];typeof o=="object"&&typeof t[n]=="object"?t[n]=ut({},t[n],o):t[n]=o}}return t}var Gn=function(e,n,o,r,s,a){e.required&&(!o.hasOwnProperty(e.field)||Fe(n,a||e.type))&&r.push(Ue(s.messages.required,e.fullField))},Qr=function(e,n,o,r,s){(/^\s+$/.test(n)||n==="")&&r.push(Ue(s.messages.whitespace,e.fullField))},$t,Zr=function(){if($t)return $t;var t="[a-fA-F\\d:]",e=function(w){return w&&w.includeBoundaries?"(?:(?<=\\s|^)(?="+t+")|(?<="+t+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",r=(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),Mr=require("react-dom/client"),V=require("antd"),Wn=require("@ant-design/cssinjs"),Ar=require("antd/locale/zh_CN"),jr=require("zustand"),wr=require("zustand/middleware"),kr=require("zustand/middleware/immer"),i=require("react"),ze=require("@ant-design/icons"),Dr=require("clsx"),qe=require("dayjs"),Pt=require("react-pdf");require("react-pdf/dist/Page/TextLayer.css");require("react-pdf/dist/Page/AnnotationLayer.css");const at=require("@ant-design/plots");function Nr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Xe=Nr(ze),Bt=new WeakMap,Qt=new WeakMap;let Zt=!1;const In=()=>{Zt||(Zt=!0)},Tr=t=>{let e=Qt.get(t);return e||(e=Wn.createCache(),Qt.set(t,e)),e},Er=t=>{t&&Qt.delete(t)},_r=async({el:t,component:e,props:n={},customTheme:o="light",forMainDocument:r=!1,skipUnmount:s=!1})=>{var j;In();const a=Bt.get(t);if(a){if(s)Object.keys(t).forEach(M=>{if(M.startsWith("__reactContainer")||M.startsWith("_reactRootContainer"))try{delete t[M]}catch{}});else try{a.unmount()}catch(M){console.warn("[mountReactComponent] Unmount failed (benign if DOM was cleared):",M)}Bt.delete(t)}const c=Mr.createRoot(t);Bt.set(t,c);const l=window.__ANTD_CSSINJS_CONTAINER__,y=window.__ANTD_IFRAME_DOC__,h=!r&&l&&y&&y.defaultView!==null,p=h?l:window.document.head,g=h?y:window.document,C=Tr(g),f=(((j=window.__GLS_COMPS__)==null?void 0:j.theme)||o)==="dark"?V.theme.darkAlgorithm:V.theme.defaultAlgorithm,d=M=>u.jsx(Wn.StyleProvider,{cache:C,container:p,hashPriority:"high",children:u.jsx(V.ConfigProvider,{locale:Ar,theme:{algorithm:f,cssVar:{key:"antd-canvas"},hashed:!1},getPopupContainer:()=>t,children:u.jsx(e,{...M})})});window.__CURRENT_STYLE_CONTAINER__=p;const x=t.hasAttribute("editing"),b={...n};return x&&b.develop===void 0&&(b.develop=!0),c.render(d(b)),{root:c,unmount:()=>{try{c.unmount(),Bt.delete(t)}catch(M){console.error("[code-canvas-core] Failed to unmount component:",M)}},update:M=>{window.__CURRENT_STYLE_CONTAINER__=p,c.render(d(M))}}},Or=()=>{console.info("[code-canvas-core] Cleanup called - components will be garbage collected"),Zt=!1};function dt(t){const e=t.match(/^(.+)\[(\d+)\]$/);return e?{baseName:e[1],index:parseInt(e[2],10)}:{baseName:t,index:null}}function lt(t){if(!t||typeof t!="string")return[];const e=[],n=t.split(".").flatMap(o=>{const r=o.match(/^([^\[]+)(\[\d+\])(.*)$/);if(r){const s=[r[1]];let a=r[2]+r[3],c;for(;c=a.match(/^\[(\d+)\](.*)$/);)s.push(`[${c[1]}]`),a=c[2];return a&&s.push(a),s}return[o]});for(const o of n)if(o.startsWith("[")&&o.endsWith("]")){const r=parseInt(o.slice(1,-1),10);Number.isNaN(r)||e.push({type:"array",key:r})}else o&&e.push({type:"property",key:o});return e}function xt(t,e){if(e.length===0)return t;let n=t;for(const o of e){if(n==null)return;if(o.type==="array"){if(!Array.isArray(n))return;n=n[o.key]}else n=n[o.key]}return n}function Yn(t,e,n){if(!e.length)return n;const o=Array.isArray(t)?[...t]:{...t};let r=o;for(let a=0;a<e.length-1;a++){const c=e[a],l=e[a+1],y=c.key;let h=r[y];h==null?h=l.type==="array"?[]:{}:l.type==="array"&&!Array.isArray(h)?h=[]:l.type==="property"&&Array.isArray(h)?h=Object.fromEntries(h.map((p,g)=>[String(g),p]).filter(([,p])=>p!==void 0)):h=Array.isArray(h)?[...h]:{...h},r[y]=h,r=h}const s=e[e.length-1];return r[s.key]=n,o}function de(t,e){if(e)return t?`${t}_${e}`:e}function bt(t,e){if(e)return t?`${t}_${e}_validate`:`${e}_validate`}const pn={dataSets:{},commandQueues:{},propsStore:{},validateStore:{}};function vn(t,e,n,o){const{baseName:r,index:s}=dt(e);if(t.dataSets[r]||(t.dataSets[r]={}),s!==null){const y=t.dataSets[r];let h=y.value;Array.isArray(h)||(h=[]);const p=h[s],g=n.length===0?p:xt(p??{},n),C=o(g),v=n.length===0?C:Yn(p??{},n,C),m=[...h];m[s]=v,t.dataSets[r]={...y,value:m};return}if(n.length===0){t.dataSets[r]=o(t.dataSets[r]);return}let a=t.dataSets[r];for(let y=0;y<n.length-1;y++){const h=n[y],p=n[y+1];let g=a[h.key];g==null&&(a[h.key]=p.type==="array"?[]:{},g=a[h.key]),a=g}const c=n[n.length-1],l=a[c.key];a[c.key]=o(l)}const O=jr.create()(wr.subscribeWithSelector(kr.immer((t,e)=>({...pn,setDataSet:(n,o,r,s=!0)=>t(a=>{if(!n)return;const c=o?lt(o):[],l=s&&typeof r=="object"&&r!==null&&!Array.isArray(r);vn(a,n,c,h=>l&&h!=null&&typeof h=="object"&&!Array.isArray(h)?{...h,...r}:r)}),updateDataSet:(n,o,r)=>t(s=>{if(!n||typeof r!="function")return;const a=o?lt(o):[];vn(s,n,a,r)}),getDataSet:(n,o)=>{if(!n)return;const r=e().dataSets,{baseName:s,index:a}=dt(n),c=r[s];if(a!==null){const l=c==null?void 0:c.value;if(!Array.isArray(l)||l[a]===void 0)return;const y=l[a];return o?xt(y,lt(o)):y}if(c)return o?xt(c,lt(o)):c},setDataSetBatch:(n,o)=>t(r=>{r.dataSets[n]={...r.dataSets[n],...o}}),clearDataSet:n=>t(o=>{delete o.dataSets[n]}),addCommand:(n,o)=>t(r=>{r.commandQueues[n]||(r.commandQueues[n]=[]),r.commandQueues[n].push(o)}),popCommand:n=>{const o=e().commandQueues[n];if(o&&o.length>0){const r=o[0];return t(s=>{s.commandQueues[n]=s.commandQueues[n].slice(1)}),r}},clearCommands:n=>t(o=>{o.commandQueues[n]=[]}),getCommands:n=>e().commandQueues[n]||[],setProps:(n,o,r)=>t(s=>{const a=`${n}_props`;s.propsStore[a]||(s.propsStore[a]={}),s.propsStore[a][o]=r}),getProps:(n,o)=>{var s;const r=`${n}_props`;return(s=e().propsStore[r])==null?void 0:s[o]},setValidateResult:(n,o,r,s)=>t(a=>{const c=bt(n,o);c&&(a.validateStore[c]||(a.validateStore[c]={}),a.validateStore[c][r]=s)}),getValidateResult:(n,o,r)=>{var a;const s=bt(n,o);return s?((a=e().validateStore[s])==null?void 0:a[r])??"":""},getValidateResults:(n,o)=>{const r=bt(n,o);return r?e().validateStore[r]??{}:{}},reset:()=>t(pn)}))));function Rr(t){const{dataSet:e,dataSetField:n}=t,o=O(r=>r.setDataSet);return{get value(){var r;return(r=O.getState().dataSets[e||""])==null?void 0:r[n||""]},set value(r){e&&n&&o(e,n,r)}}}function $r(t){const e=O(n=>n.setDataSetBatch);return{get value(){return O.getState().dataSets[t]},set value(n){e(t,n)}}}function Br(){return O(t=>t.addCommand)}function Vr(){return O(t=>t.popCommand)}function Hn(t,e){const n=O(r=>{if(!t)return;const s=dt(t).baseName;return r.dataSets[s]}),o=O(r=>r.getDataSet);return i.useMemo(()=>{if(!t)return[];const r=e&&String(e).trim()!==""?e:"",s=o(t,r);return Array.isArray(s)?s:s!=null&&typeof s=="object"&&Array.isArray(s.value)?s.value:[]},[n,t,e,o])}function Lr(){const t=O(s=>s.setDataSetBatch),e=O(s=>s.setDataSet),n=O(s=>s.updateDataSet),o=O(s=>s.getDataSet),r=O.getState;return{get items(){const s=r().dataSets;return new Proxy(s,{get(a,c){return a[c]||{}}})},getDataSet:o,setDataSet:e,updateDataSet:n,updateItem:(s,a)=>{const c=a!==null&&typeof a=="object"&&!Array.isArray(a)?a:{value:a};t(s,c)},getItem:s=>r().dataSets[s]||{}}}function Fr(t){const e=O(s=>s.addCommand),n=O(s=>s.popCommand),o=O(s=>s.getCommands),r=O(s=>s.clearCommands);return{commands:o(t),addCommand:(s,a)=>{e(t,{actionName:s,arg:a,timestamp:Date.now()})},popCommand:()=>n(t),clearCommands:()=>r(t)}}function Un(t,e,n={}){return O.subscribe(r=>r.commandQueues[e],r=>{if(r&&r.length>0){const s=[...r],a=[];s.forEach(c=>{try{const l=n[c.actionName];typeof l=="function"?l(c.arg):console.warn(`[watchCommands] Function not found: ${c.actionName}`),a.push(c)}catch(l){console.error("[watchCommands] 命令执行失败:",c,l),a.push(c)}}),a.length>0&&(console.log("[watchCommands] Clearing command queue after execution"),O.getState().clearCommands(e))}})}function Pr(t){return function(e,n){const o=t();return Un(e,n,o)}}function st(t,e=null,n={}){if(!t)return{actionName:"",arg:null};const o=t.match(/^([^(]+)\(([^)]*)\)$/);if(!o)return{actionName:t,arg:e};const r=o[1].trim(),s=o[2].trim();if(!s)return{actionName:r,arg:e};const a=s.split(",").map(l=>{const y=l.trim();if(y==="@value")return e;if(y.startsWith("@")){const h=y.substring(1);return n[h]}return y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'")?y.slice(1,-1):isNaN(Number(y))?y:Number(y)}),c=a.length===1?a[0]:a;return{actionName:r,arg:c}}function Te(t,e,n={}){return st(t,e,n)}function an(t,e={}){return st(t,null,e)}function zr(t,e={}){return st(t,null,e)}function se(t,e){return{actionName:t,arg:e,timestamp:Date.now()}}function ut(){return ut=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ut.apply(this,arguments)}function Kr(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Dt(t,e)}function Xt(t){return Xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xt(t)}function Dt(t,e){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Dt(t,e)}function qr(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ft(t,e,n){return qr()?Ft=Reflect.construct.bind():Ft=function(r,s,a){var c=[null];c.push.apply(c,s);var l=Function.bind.apply(r,c),y=new l;return a&&Dt(y,a.prototype),y},Ft.apply(null,arguments)}function Wr(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function en(t){var e=typeof Map=="function"?new Map:void 0;return en=function(o){if(o===null||!Wr(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(o))return e.get(o);e.set(o,r)}function r(){return Ft(o,arguments,Xt(this).constructor)}return r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Dt(r,o)},en(t)}var Ir=/%[sdj%]/g,Gn=function(){};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Gn=function(e,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(o){return typeof o=="string"})&&console.warn(e,n)});function tn(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var o=n.field;e[o]=e[o]||[],e[o].push(n)}),e}function Ge(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var r=0,s=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var a=t.replace(Ir,function(c){if(c==="%%")return"%";if(r>=s)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}break;default:return c}});return a}return t}function Yr(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function Fe(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||Yr(e)&&typeof t=="string"&&!t)}function Hr(t,e,n){var o=[],r=0,s=t.length;function a(c){o.push.apply(o,c||[]),r++,r===s&&n(o)}t.forEach(function(c){e(c,a)})}function bn(t,e,n){var o=0,r=t.length;function s(a){if(a&&a.length){n(a);return}var c=o;o=o+1,c<r?e(t[c],s):n([])}s([])}function Ur(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,t[n]||[])}),e}var xn=function(t){Kr(e,t);function e(n,o){var r;return r=t.call(this,"Async Validation Error")||this,r.errors=n,r.fields=o,r}return e}(en(Error));function Gr(t,e,n,o,r){if(e.first){var s=new Promise(function(g,C){var v=function(d){return o(d),d.length?C(new xn(d,tn(d))):g(r)},m=Ur(t);bn(m,n,v)});return s.catch(function(g){return g}),s}var a=e.firstFields===!0?Object.keys(t):e.firstFields||[],c=Object.keys(t),l=c.length,y=0,h=[],p=new Promise(function(g,C){var v=function(f){if(h.push.apply(h,f),y++,y===l)return o(h),h.length?C(new xn(h,tn(h))):g(r)};c.length||(o(h),g(r)),c.forEach(function(m){var f=t[m];a.indexOf(m)!==-1?bn(f,n,v):Hr(f,n,v)})});return p.catch(function(g){return g}),p}function Jr(t){return!!(t&&t.message!==void 0)}function Qr(t,e){for(var n=t,o=0;o<e.length;o++){if(n==null)return n;n=n[e[o]]}return n}function Sn(t,e){return function(n){var o;return t.fullFields?o=Qr(e,t.fullFields):o=e[n.field||t.fullField],Jr(n)?(n.field=n.field||t.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||t.fullField}}}function Cn(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];typeof o=="object"&&typeof t[n]=="object"?t[n]=ut({},t[n],o):t[n]=o}}return t}var Jn=function(e,n,o,r,s,a){e.required&&(!o.hasOwnProperty(e.field)||Fe(n,a||e.type))&&r.push(Ge(s.messages.required,e.fullField))},Zr=function(e,n,o,r,s){(/^\s+$/.test(n)||n==="")&&r.push(Ge(s.messages.whitespace,e.fullField))},Vt,Xr=function(){if(Vt)return Vt;var t="[a-fA-F\\d:]",e=function(j){return j&&j.includeBoundaries?"(?:(?<=\\s|^)(?="+t+")|(?<="+t+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",o="[a-fA-F\\d]{1,4}",r=(`
2
2
  (?:
3
3
  (?:`+o+":){7}(?:"+o+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
4
4
  (?:`+o+":){6}(?:"+n+"|:"+o+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
@@ -9,7 +9,7 @@
9
9
  (?:`+o+":){1}(?:(?::"+o+"){0,4}:"+n+"|(?::"+o+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
10
10
  (?::(?:(?::`+o+"){0,5}:"+n+"|(?::"+o+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
11
11
  )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
12
- `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),s=new RegExp("(?:^"+n+"$)|(?:^"+r+"$)"),a=new RegExp("^"+n+"$"),c=new RegExp("^"+r+"$"),l=function(w){return w&&w.exact?s:new RegExp("(?:"+e(w)+n+e(w)+")|(?:"+e(w)+r+e(w)+")","g")};l.v4=function(b){return b&&b.exact?a:new RegExp(""+e(b)+n+e(b),"g")},l.v6=function(b){return b&&b.exact?c:new RegExp(""+e(b)+r+e(b),"g")};var y="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",p=l.v4().source,g=l.v6().source,x="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",v="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",f="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",m="(?::\\d{2,5})?",d='(?:[/?#][^\\s"]*)?',C="(?:"+y+"|www\\.)"+h+"(?:localhost|"+p+"|"+g+"|"+x+v+f+")"+m+d;return $t=new RegExp("(?:^"+C+"$)","i"),$t},Cn={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},wt={integer:function(e){return wt.number(e)&&parseInt(e,10)===e},float:function(e){return wt.number(e)&&!wt.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!wt.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Cn.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Zr())},hex:function(e){return typeof e=="string"&&!!e.match(Cn.hex)}},Xr=function(e,n,o,r,s){if(e.required&&n===void 0){Gn(e,n,o,r,s);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],c=e.type;a.indexOf(c)>-1?wt[c](n)||r.push(Ue(s.messages.types[c],e.fullField,e.type)):c&&typeof n!==e.type&&r.push(Ue(s.messages.types[c],e.fullField,e.type))},eo=function(e,n,o,r,s){var a=typeof e.len=="number",c=typeof e.min=="number",l=typeof e.max=="number",y=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=n,p=null,g=typeof n=="number",x=typeof n=="string",v=Array.isArray(n);if(g?p="number":x?p="string":v&&(p="array"),!p)return!1;v&&(h=n.length),x&&(h=n.replace(y,"_").length),a?h!==e.len&&r.push(Ue(s.messages[p].len,e.fullField,e.len)):c&&!l&&h<e.min?r.push(Ue(s.messages[p].min,e.fullField,e.min)):l&&!c&&h>e.max?r.push(Ue(s.messages[p].max,e.fullField,e.max)):c&&l&&(h<e.min||h>e.max)&&r.push(Ue(s.messages[p].range,e.fullField,e.min,e.max))},pt="enum",to=function(e,n,o,r,s){e[pt]=Array.isArray(e[pt])?e[pt]:[],e[pt].indexOf(n)===-1&&r.push(Ue(s.messages[pt],e.fullField,e[pt].join(", ")))},no=function(e,n,o,r,s){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||r.push(Ue(s.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var a=new RegExp(e.pattern);a.test(n)||r.push(Ue(s.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},Ae={required:Gn,whitespace:Qr,type:Xr,range:eo,enum:to,pattern:no},ro=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n,"string")&&!e.required)return o();Ae.required(e,n,r,a,s,"string"),Fe(n,"string")||(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s),Ae.pattern(e,n,r,a,s),e.whitespace===!0&&Ae.whitespace(e,n,r,a,s))}o(a)},oo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae.type(e,n,r,a,s)}o(a)},so=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(n===""&&(n=void 0),Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},io=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae.type(e,n,r,a,s)}o(a)},ao=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),Fe(n)||Ae.type(e,n,r,a,s)}o(a)},co=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},lo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},uo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(n==null&&!e.required)return o();Ae.required(e,n,r,a,s,"array"),n!=null&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},fo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae.type(e,n,r,a,s)}o(a)},mo="enum",yo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae[mo](e,n,r,a,s)}o(a)},ho=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n,"string")&&!e.required)return o();Ae.required(e,n,r,a,s),Fe(n,"string")||Ae.pattern(e,n,r,a,s)}o(a)},go=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n,"date")&&!e.required)return o();if(Ae.required(e,n,r,a,s),!Fe(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),Ae.type(e,l,r,a,s),l&&Ae.range(e,l.getTime(),r,a,s)}}o(a)},po=function(e,n,o,r,s){var a=[],c=Array.isArray(n)?"array":typeof n;Ae.required(e,n,r,a,s,c),o(a)},Wt=function(e,n,o,r,s){var a=e.type,c=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Fe(n,a)&&!e.required)return o();Ae.required(e,n,r,c,s,a),Fe(n,a)||Ae.type(e,n,r,c,s)}o(c)},vo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s)}o(a)},kt={string:ro,method:oo,number:so,boolean:io,regexp:ao,integer:co,float:lo,array:uo,object:fo,enum:yo,pattern:ho,date:go,url:Wt,hex:Wt,email:Wt,required:po,any:vo};function en(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var tn=en(),Nt=function(){function t(n){this.rules=null,this._messages=tn,this.define(n)}var e=t.prototype;return e.define=function(o){var r=this;if(!o)throw new Error("Cannot configure a schema with no rules");if(typeof o!="object"||Array.isArray(o))throw new Error("Rules must be an object");this.rules={},Object.keys(o).forEach(function(s){var a=o[s];r.rules[s]=Array.isArray(a)?a:[a]})},e.messages=function(o){return o&&(this._messages=Sn(en(),o)),this._messages},e.validate=function(o,r,s){var a=this;r===void 0&&(r={}),s===void 0&&(s=function(){});var c=o,l=r,y=s;if(typeof l=="function"&&(y=l,l={}),!this.rules||Object.keys(this.rules).length===0)return y&&y(null,c),Promise.resolve(c);function h(f){var m=[],d={};function C(w){if(Array.isArray(w)){var M;m=(M=m).concat.apply(M,w)}else m.push(w)}for(var b=0;b<f.length;b++)C(f[b]);m.length?(d=Xt(m),y(m,d)):y(null,c)}if(l.messages){var p=this.messages();p===tn&&(p=en()),Sn(p,l.messages),l.messages=p}else l.messages=this.messages();var g={},x=l.keys||Object.keys(this.rules);x.forEach(function(f){var m=a.rules[f],d=c[f];m.forEach(function(C){var b=C;typeof b.transform=="function"&&(c===o&&(c=ut({},c)),d=c[f]=b.transform(d)),typeof b=="function"?b={validator:b}:b=ut({},b),b.validator=a.getValidationMethod(b),b.validator&&(b.field=f,b.fullField=b.fullField||f,b.type=a.getType(b),g[f]=g[f]||[],g[f].push({rule:b,value:d,source:c,field:f}))})});var v={};return Ur(g,l,function(f,m){var d=f.rule,C=(d.type==="object"||d.type==="array")&&(typeof d.fields=="object"||typeof d.defaultField=="object");C=C&&(d.required||!d.required&&f.value),d.field=f.field;function b(S,A){return ut({},A,{fullField:d.fullField+"."+S,fullFields:d.fullFields?[].concat(d.fullFields,[S]):[S]})}function w(S){S===void 0&&(S=[]);var A=Array.isArray(S)?S:[S];!l.suppressWarning&&A.length&&t.warning("async-validator:",A),A.length&&d.message!==void 0&&(A=[].concat(d.message));var k=A.map(xn(d,c));if(l.first&&k.length)return v[d.field]=1,m(k);if(!C)m(k);else{if(d.required&&!f.value)return d.message!==void 0?k=[].concat(d.message).map(xn(d,c)):l.error&&(k=[l.error(d,Ue(l.messages.required,d.field))]),m(k);var $={};d.defaultField&&Object.keys(f.value).map(function(N){$[N]=d.defaultField}),$=ut({},$,f.rule.fields);var D={};Object.keys($).forEach(function(N){var E=$[N],T=Array.isArray(E)?E:[E];D[N]=T.map(b.bind(null,N))});var j=new t(D);j.messages(l.messages),f.rule.options&&(f.rule.options.messages=l.messages,f.rule.options.error=l.error),j.validate(f.value,f.rule.options||l,function(N){var E=[];k&&k.length&&E.push.apply(E,k),N&&N.length&&E.push.apply(E,N),m(E.length?E:null)})}}var M;if(d.asyncValidator)M=d.asyncValidator(d,f.value,w,f.source,l);else if(d.validator){try{M=d.validator(d,f.value,w,f.source,l)}catch(S){console.error==null||console.error(S),l.suppressValidatorError||setTimeout(function(){throw S},0),w(S.message)}M===!0?w():M===!1?w(typeof d.message=="function"?d.message(d.fullField||d.field):d.message||(d.fullField||d.field)+" fails"):M instanceof Array?w(M):M instanceof Error&&w(M.message)}M&&M.then&&M.then(function(){return w()},function(S){return w(S)})},function(f){h(f)},c)},e.getType=function(o){if(o.type===void 0&&o.pattern instanceof RegExp&&(o.type="pattern"),typeof o.validator!="function"&&o.type&&!kt.hasOwnProperty(o.type))throw new Error(Ue("Unknown rule type %s",o.type));return o.type||"string"},e.getValidationMethod=function(o){if(typeof o.validator=="function")return o.validator;var r=Object.keys(o),s=r.indexOf("message");return s!==-1&&r.splice(s,1),r.length===1&&r[0]==="required"?kt.required:kt[this.getType(o)]||void 0},t}();Nt.register=function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");kt[e]=n};Nt.warning=Un;Nt.messages=tn;Nt.validators=kt;function bo(t){if(!t||typeof t!="string")return null;try{let e=t.trim();return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),new RegExp(e)}catch{return null}}function sn(t){return!t||!Array.isArray(t)?[]:t.map(e=>{const n={...e};if(n.pattern&&typeof n.pattern=="string"&&n.pattern.trim()){const o=bo(n.pattern);o?n.pattern=o:delete n.pattern}return n})}const Mn="_v";function an(t,e,n,o){if(!(t!=null&&t.length)){n();return}const r={[Mn]:t};new Nt(r).validate({[Mn]:e},{first:!0}).then(()=>{n()}).catch(({errors:a})=>{o(a||[])})}function We(t){const{rules:e,dataSet:n,dataSetField:o,sessionId:r,id:s,develop:a}=t,c=O(M=>M.setValidateResult),l=O(M=>M.getProps),y=O(M=>M.setProps),h=i.useMemo(()=>bt(r,n),[r,n]),p=O(M=>{var S;return h&&o?((S=M.validateStore[h])==null?void 0:S[o])??"":""}),g=O(M=>{var S;return r&&s?((S=M.propsStore[`${r}_props`])==null?void 0:S[s])??null:null}),x=O(M=>M.getDataSet),v=i.useMemo(()=>de(r,n),[r,n]),f=i.useMemo(()=>n?de(r,`${n}_validateAction`):void 0,[r,n]),m=O(M=>{var S;return f?(S=M.dataSets[f])==null?void 0:S.validate:void 0}),d=i.useCallback(M=>{const S=M??"";if(r&&n&&o&&c(r,n,o,S),r&&s){const A=l(r,s)||{};y(r,s,{...A,validateStatus:S?"error":void 0,help:S})}},[r,n,o,s,c,l,y]),C=i.useCallback(M=>{const S=sn(e||[]);an(S,M,()=>d(""),A=>{var k;return d(((k=A[0])==null?void 0:k.message)??"")})},[e,d]),b=a?void 0:r&&n&&o?p:(g==null?void 0:g.help)??"",w=!a&&b?"error":void 0;return i.useEffect(()=>{if(m==null||!v||!o)return;const M=x(v,o);C(M)},[m,v,o,x,C]),{validate:C,help:b,validateStatus:w}}function cn(t){if(!t)return[];const e=[];let n=t;for(;n;)e.push(n),n=n.parentContext??null;return e.reverse()}const xo=cn;function So(t){if(!t)return"";const e=t.parentIndex??t.index;return e===void 0||!Number.isFinite(Number(e))?"":`items_${e}_`}const Co=["value","validateStatus","help"];function Ie(t,e,n){const o=(n==null?void 0:n.skipKeys)??Co,r={...t};return!e||typeof e!="object"||Object.keys(e).forEach(s=>{if(o.includes(s))return;const a=e[s];a!=null&&(r[s]=a)}),r}function ct(t,e,n){if(t==null||t==="")return null;const o=cn(e),r=o.length>0?o[o.length-1]:void 0,s=r&&typeof r.parentIndex=="number"?r.parentIndex:void 0,a=r&&typeof r.index=="number"?r.index:void 0;if(s!==void 0&&Number.isFinite(s)&&a!==void 0&&Number.isFinite(a))return s!==a?`${String(t)}_${s}_${a}`:`${String(t)}_${s}`;if(o.length>=2){const l=o.map(y=>y.index).filter(y=>typeof y=="number"&&Number.isFinite(y));if(l.length>=2)return`${String(t)}_${l.join("_")}`}const c=s!==void 0&&Number.isFinite(s)?s:a!==void 0&&Number.isFinite(a)?a:typeof n=="number"?n:void 0;return c!==void 0&&Number.isFinite(c)?`${String(t)}_${c}`:String(t)}function Ze(t){return typeof t=="string"&&t.trim()!==""}function Mo(t,e){return t==="config.cells"&&e.startsWith("config.content.")?`config.${e.slice(15)}`:e}function An(t){return Ze(t)&&t.trim().startsWith("[")}function jn(t){return Ze(t)&&/^items\[\d+\]/.test(t.trim())}function Jn(t,e,n,o){const r=n??(o==null?void 0:o.sessionId);if(Ze(t))return{dataSet:t,dataSetField:e,sessionId:r};if(!o)return{dataSet:t,dataSetField:e,sessionId:r};const s=typeof o.index=="number"?o.index:void 0,a=typeof o.parentIndex=="number"?o.parentIndex:void 0,c=o.dataSet,l=o.dataSetFieldRoot;if(Ze(e)){const y=Mo(l,e.trim());if(y.startsWith("["))return{dataSet:c,dataSetField:Ze(l)?`${l}${y}`:y,sessionId:r};if(typeof a=="number"&&typeof s=="number"&&Ze(l)&&!An(l)&&!jn(l))return{dataSet:c,dataSetField:`[${a}].${l}[${s}].${y}`,sessionId:r};if(typeof s=="number")return Ze(l)?{dataSet:c,dataSetField:`${l}[${s}].${y}`,sessionId:r}:{dataSet:c,dataSetField:`[${s}].${y}`,sessionId:r};const h=Ze(l)?`${l}.${y}`:y;return{dataSet:c,dataSetField:h,sessionId:r}}return typeof a=="number"&&typeof s=="number"&&Ze(l)&&!An(l)&&!jn(l)?{dataSet:c,dataSetField:`[${a}].${l}[${s}]`,sessionId:r}:typeof s=="number"&&Ze(l)?{dataSet:c,dataSetField:`${l}[${s}]`,sessionId:r}:typeof s=="number"?{dataSet:c,dataSetField:`[${s}]`,sessionId:r}:{dataSet:c,dataSetField:Ze(l)?l:e,sessionId:r}}const qe=i.createContext(null);function tt(t,e,n){const o=i.useContext(qe);return i.useMemo(()=>Jn(t,e,n,o),[o,t,e,n])}function Qn(t,e){return t===e?!0:String(t??"")===String(e??"")}function et(t,e){if(Array.isArray(t))return t.find(n=>Qn(n.value,e))}let Je={};function Ao(t){Je={...Je,...t}}function Ge(){return Je}async function it(t){if(Je.request){const e={...t,baseURL:t.baseURL||Je.baseURL};return Je.request(e)}throw new Error("Request handler not configured. Please call setCoreConfig() first.")}async function ln(t,e){if(Je.upload)return Je.upload(t,e);throw new Error("Upload handler not configured. Please call setCoreConfig() first.")}async function Pt(t){return Je.getDictOptions?Je.getDictOptions(t):(console.warn("Dict service not configured. Please call setCoreConfig() with getDictOptions."),[])}function Ft(){return Je.getAccessToken?Je.getAccessToken():null}const jo={post:(t,e,n)=>it({url:t,data:e,method:"POST",...n}),get:(t,e,n)=>it({url:t,params:e,method:"GET",...n})};function Zn(){const t=Ge(),e=i.useCallback(async(l,y)=>{const h=typeof l=="string"?{url:l,...y}:l;return it(h)},[]),n=i.useCallback(async(l,y,h)=>it({url:l,params:y,method:"GET",...h}),[]),o=i.useCallback(async(l,y,h)=>it({url:l,data:y,method:"POST",...h}),[]),r=i.useCallback(async l=>Pt(l),[]),s=i.useCallback(async(l,y)=>ln(l,y),[]),a=i.useCallback(()=>Ft(),[]),c=i.useCallback(()=>!!t.request,[t.request]);return{request:e,get:n,post:o,getDictOptions:r,upload:s,getAccessToken:a,isConfigured:c,baseURL:t.baseURL}}function St(t){const[e,n]=i.useState([]),[o,r]=i.useState(!1),[s,a]=i.useState(null);return i.useEffect(()=>{if(!t){n([]);return}let c=!1;return r(!0),a(null),Pt(t).then(l=>{c||n(l)}).catch(l=>{c||(a(l),console.error(`Failed to load dict: ${t}`,l))}).finally(()=>{c||r(!1)}),()=>{c=!0}},[t]),{options:e,loading:o,error:s}}function Kt(t,e){const[n,o]=i.useState([]),[r,s]=i.useState(!1),[a,c]=i.useState(null),{labelKey:l="label",valueKey:y="value",immediate:h=!0,field:p}=e||{},g=JSON.stringify((e==null?void 0:e.params)??null),x=i.useMemo(()=>(e==null?void 0:e.params)!=null?JSON.parse(g):void 0,[g]),v=i.useCallback(m=>Array.isArray(m)?m.map(d=>({label:d[l],value:d[y]})):[],[l,y]),f=i.useCallback(async()=>{if(t){s(!0),c(null);try{const m=await it({url:t,method:"GET",...x!=null&&Object.keys(x).length>0?{params:x}:{}}),d=(m==null?void 0:m.data)!=null?m.data:m;let C=[];p!=null&&p!==""?C=Array.isArray(d==null?void 0:d[p])?d[p]:[]:Array.isArray(d)?C=d:d!=null&&typeof d=="object"&&(C=(d==null?void 0:d.list)??(d==null?void 0:d.records)??[]),o(v(C))}catch(m){c(m),console.error(`Failed to load remote options: ${t}`,m)}finally{s(!1)}}},[t,x,v,p]);return i.useEffect(()=>{h&&t&&f()},[h,t,f]),{options:n,loading:r,error:a,reload:f}}const Ct=t=>{if(t==null||t==="")return 0;const e=Number(t);return isNaN(e)||!isFinite(e)?0:e},Ve=t=>t==null?"":String(t),zt=t=>{if(t==null)return null;let e;if(t instanceof Date)e=t;else if(typeof t=="number"){const n=t.toString().length===10?t*1e3:t;if(n<0||n>864e13)return null;e=new Date(n)}else e=new Date(t);return isNaN(e.getTime())?null:e},wo=(t,e="CNY",n={})=>{try{const o=Ct(t),r=/^[A-Z]{3}$/.test(e)?e:"CNY";return new Intl.NumberFormat("zh-CN",{style:"currency",currency:r,...n}).format(o)}catch{return""}},ko=(t,e={})=>{try{const n=Ct(t);return new Intl.NumberFormat("zh-CN",{minimumFractionDigits:0,maximumFractionDigits:2,...e}).format(n)}catch{return""}},Do=(t,e=2)=>{try{const n=Ct(t),o=Math.max(0,Math.min(20,Math.floor(e)));return new Intl.NumberFormat("zh-CN",{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(n)}catch{return""}},No=(t,e="compact")=>{try{const n=Ct(t);return new Intl.NumberFormat("zh-CN",{notation:e,compactDisplay:"short"}).format(n)}catch{return""}},To=(t,e={})=>{try{const n=zt(t);return n?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",...e}).format(n):""}catch{return""}},Xn=(t,e="YYYY-MM-DD")=>{try{const n=zt(t);if(!n)return"";const o=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0"),a=String(n.getHours()).padStart(2,"0"),c=String(n.getMinutes()).padStart(2,"0"),l=String(n.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(o)).replace("MM",r).replace("DD",s).replace("HH",a).replace("mm",c).replace("ss",l)}catch{return""}},Eo=(t,e="YYYY-MM-DD HH:mm:ss")=>Xn(t,e),_o=t=>{try{const e=zt(t);if(!e)return"";const o=new Date().getTime()-e.getTime(),r=Math.floor(o/1e3),s=Math.floor(r/60),a=Math.floor(s/60),c=Math.floor(a/24),l=Math.floor(c/30),y=Math.floor(c/365);return r<60?"刚刚":s<60?`${s}分钟前`:a<24?`${a}小时前`:c<30?`${c}天前`:l<12?`${l}个月前`:`${y}年前`}catch{return""}},Oo=t=>{try{const e=Math.floor(Ct(t));if(e<0||e>31536e3)return"";const n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=e%60,s=[];return n>0&&s.push(`${n}小时`),o>0&&s.push(`${o}分钟`),(r>0||s.length===0)&&s.push(`${r}秒`),s.join("")}catch{return""}},Ro=t=>{try{const e=zt(t);if(!e)return"";const n=new Date;if(e>n)return"";let o=n.getFullYear()-e.getFullYear();const r=n.getMonth()-e.getMonth();return(r<0||r===0&&n.getDate()<e.getDate())&&o--,o<0||o>150?"":`${o}岁`}catch{return""}},$o=(t,e=2,n=!0)=>{try{const o=Ct(t);if(o<0||o>Number.MAX_SAFE_INTEGER)return"";if(o===0)return"0 B";const r=Math.max(0,Math.min(10,Math.floor(e))),s=n?1024:1e3,a=n?["B","KiB","MiB","GiB","TiB","PiB"]:["B","KB","MB","GB","TB","PB"],c=Math.min(Math.floor(Math.log(o)/Math.log(s)),a.length-1);return`${parseFloat((o/Math.pow(s,c)).toFixed(r))} ${a[c]}`}catch{return""}},Bo=(t,e="CN")=>{try{const n=Ve(t).replace(/\D/g,"");return n?e==="CN"&&n.length===11&&/^1[3-9]\d{9}$/.test(n)?n.replace(/(\d{3})(\d{4})(\d{4})/,"$1 $2 $3"):e==="US"&&n.length===10?n.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):Ve(t):""}catch{return""}},Lo=t=>{try{const e=Ve(t).replace(/\D/g,"");return e.length===11?e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):Ve(t)}catch{return""}},Vo=t=>{try{const e=Ve(t);if(!e||!e.includes("@"))return"";const[n,o]=e.split("@");return n.length<=1?e:n.length<=3?`${n[0]}*@${o}`:`${n[0]+"*".repeat(n.length-2)+n[n.length-1]}@${o}`}catch{return""}},Fo=(t,e=!0)=>{try{const n=Ve(t).replace(/\s/g,"");return n.length===18&&/^\d{17}[\dXx]$/.test(n)?e?n.replace(/(\d{6})\d{8}(\d{3}[\dXx])/,"$1********$2"):n.replace(/(\d{6})(\d{8})(\d{4})/,"$1 $2 $3"):""}catch{return""}},Po=(t,e=!0)=>{try{const n=Ve(t).replace(/\s/g,"");if(!/^\d{13,19}$/.test(n))return"";if(e&&n.length>=8){const o=n.slice(0,4),r=n.slice(-4),s=n.length-8,a="*".repeat(s);return(o+a+r).replace(/(.{4})/g,"$1 ").trim()}return n.replace(/(.{4})/g,"$1 ").trim()}catch{return""}},Ko=t=>{try{const e=Ve(t);return e.length<=1?e:e.length===2?e[0]+"*":e[0]+"*".repeat(e.length-2)+e[e.length-1]}catch{return""}},zo=(t,e=50,n="...")=>{try{const o=Ve(t),r=Math.max(1,Math.min(1e3,Math.floor(e)));return o.length<=r?o:o.slice(0,r)+n}catch{return""}},qo=t=>{try{const e=Ve(t);return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}catch{return""}},Wo=(t,e=", ")=>{try{return Array.isArray(t)?t.join(e):Ve(t)}catch{return""}},Io=t=>({0:"女",1:"男",2:"未知",male:"男",female:"女",m:"男",f:"女",M:"男",F:"女"})[Ve(t)]||Ve(t),Ho=(t,e)=>e?e[Ve(t)]||Ve(t):{0:"禁用",1:"启用",true:"是",false:"否"}[Ve(t)]||Ve(t),Yo=t=>{try{return Ve(t).replace(/<[^>]*>/g,"")}catch{return""}};function er(t,e,n={}){if(!e||t===void 0||t===null)return Ve(t);switch(e){case"currency":return wo(t,n.currency,n);case"number":return ko(t,n);case"percent":return Do(t,n.precision);case"compact":return No(t,n.notation);case"timestamp":return Eo(t,n.pattern);case"date":return To(t,n);case"dateCustom":return Xn(t,n.pattern);case"relativeTime":return _o(t);case"duration":return Oo(t);case"age":return Ro(t);case"fileSize":return $o(t,n.precision,n.binary);case"phone":return Bo(t,n.country);case"phoneMask":return Lo(t);case"emailMask":return Vo(t);case"idCard":return Fo(t,n.mask);case"bankCard":return Po(t,n.mask);case"usernameMask":return Ko(t);case"truncate":return zo(t,n.maxLength,n.suffix);case"capitalize":return qo(t);case"array":return Wo(t,n.delimiter);case"gender":return Io(t);case"status":return Ho(t,n.statusMap);case"stripHtml":return Yo(t);default:return Ve(t)}}const qt={colorPrimary:"colorPrimary",colorSuccess:"colorSuccess",colorWarning:"colorWarning",colorError:"colorError",colorInfo:"colorInfo",colorText:"colorText",colorTextSecondary:"colorTextSecondary",colorTextTertiary:"colorTextTertiary",colorTextQuaternary:"colorTextQuaternary",colorTextBase:"colorTextBase",colorBgBase:"colorBgBase",colorBgContainer:"colorBgContainer",colorBgElevated:"colorBgElevated",colorBgLayout:"colorBgLayout",colorBgSpotlight:"colorBgSpotlight",colorBorder:"colorBorder",colorBorderSecondary:"colorBorderSecondary",colorFill:"colorFill",colorFillSecondary:"colorFillSecondary",colorFillTertiary:"colorFillTertiary",colorFillQuaternary:"colorFillQuaternary",colorLink:"colorLink",colorLinkHover:"colorLinkHover",colorLinkActive:"colorLinkActive"},Uo=Object.keys(qt),Go=[{label:"主色",value:"colorPrimary"},{label:"成功",value:"colorSuccess"},{label:"警告",value:"colorWarning"},{label:"错误",value:"colorError"},{label:"信息",value:"colorInfo"},{label:"文本",value:"colorText"},{label:"次级文本",value:"colorTextSecondary"},{label:"链接",value:"colorLink"}];function un(t){return qt.hasOwnProperty(t)}function Tt(t){const{token:e}=F.theme.useToken();if(t){if(un(t)){const n=qt[t];return e[n]||t}return t}}function Jo(t,e){if(t){if(un(t)){const n=qt[t];return e[n]||t}return t}}const Qo=({id:t,text:e,tooltip:n,iconName:o,clickAction:r,sessionId:s,develop:a,onClick:c,children:l,index:y,dataSet:h,dataSetField:p,token:g,...x})=>{const v=O(P=>P.addCommand),f=i.useContext(qe),m=y??(f==null?void 0:f.index),d=f==null?void 0:f.parentIndex,C=O(P=>{var R;return s&&t?(R=P.propsStore[`${s}_props`])==null?void 0:R[t]:null}),b=i.useMemo(()=>{const P={...x};return C&&typeof C=="object"&&Object.keys(C).forEach(R=>{C[R]!==void 0&&C[R]!==null&&(P[R]=C[R])}),a&&(P.disabled=!1),P},[x,C,a]),w=i.useMemo(()=>{const P=(C==null?void 0:C.iconName)||o;return P&&Xe[P]?Xe[P]:null},[o,C==null?void 0:C.iconName]),M=i.useCallback(P=>{if(c){c(P);return}if(r&&s){const{actionName:R,arg:V}=on(r,{id:t,index:m,parentIndex:d,dataSet:h,dataSetField:p,...b}),z=se(R,V);v(s,z)}},[r,s,t,m,h,p,d,b,v,c]),S=(C==null?void 0:C.text)||e,A=(C==null?void 0:C.tooltip)??n,k=i.useMemo(()=>{const P=C==null?void 0:C.token,R={...g,...P};if(!R||Object.keys(R).length===0)return;const V={};return Object.entries(R).forEach(([z,q])=>{q!==""&&q!==void 0&&q!==null&&(V[z]=q)}),Object.keys(V).length>0?V:void 0},[g,C==null?void 0:C.token]),$=i.useMemo(()=>k?{components:{Button:k}}:void 0,[k]),{iconPosition:D,iconPlacement:j,clickAction:N,tooltip:E,token:T,...K}=b,B=j||D,L=!!(K!=null&&K.block),_=u.jsx(F.Button,{...K,iconPlacement:B,icon:w?u.jsx(w,{}):void 0,onClick:M,children:S||l}),I=A?u.jsx(F.Tooltip,{title:A,children:u.jsx("span",{style:{display:L?"block":"inline-block",width:L?"100%":void 0},children:_})}):_;return $?u.jsx(F.ConfigProvider,{theme:$,children:I}):I},nt={whiteSpace:"nowrap",flex:"none"};function Zo(t){const e=typeof t=="string"?t.trim():"";if(!e)return;const n=Xe[e];if(n)return i.createElement(n)}function rt({iconName:t,label:e}){const n=typeof t=="string"?t.trim():"",o=e==null?"":typeof e=="string"?e.trim():String(e).trim();return n?{iconConfigured:!0,iconNode:Zo(n)??n,labelText:o||void 0}:{iconConfigured:!1,iconNode:void 0,labelText:o||void 0}}const Xo=["value","validateStatus","help"],es=200;function ts(t){if(!t)return;const e={};return Object.entries(t).forEach(([n,o])=>{o!==""&&o!==void 0&&o!==null&&(e[n]=o)}),Object.keys(e).length>0?e:void 0}function ns(t,e,n){const o={...t};if(e&&typeof e=="object"&&Object.keys(e).forEach(r=>{!Xo.includes(r)&&e[r]!==void 0&&e[r]!==null&&(o[r]=e[r])}),n.develop){const r=o.disabled;o.disabled=!1,o.readOnly=!0,r&&(o.className=`${o.className||""} ant-input-disabled`.trim())}return o}const tr=t=>{const{id:e,sessionId:n,develop:o,dataSet:r,dataSetField:s,index:a,changeAction:c,onChange:l,value:y,styles:h,token:p,rules:g,validateOnChange:x,validateOnBlur:v,focusAction:f,blurAction:m,pressEnterAction:d,clearAction:C,bordered:b,...w}=t,M=tt(r,s,n),S=M.dataSet,A=M.dataSetField,k=M.sessionId,$=i.useContext(qe),D=a??($==null?void 0:$.index),j=$==null?void 0:$.parentIndex,N=i.useRef(""),E=i.useRef(null),T=O(re=>re.addCommand),K=O(re=>re.getDataSet),B=O(re=>re.setDataSet),L=O(re=>re.getProps),_=O(re=>re.setProps),I=O(re=>re.setValidateResult),P=i.useMemo(()=>de(k,S),[k,S]),R=i.useMemo(()=>k?ct(e,$,a):null,[k,e,$==null?void 0:$.parentIndex,$==null?void 0:$.index,a]),V=O(re=>{var le;return R?((le=re.propsStore[`${k}_props`])==null?void 0:le[R])??null:null}),z=i.useMemo(()=>bt(k,S),[k,S]),q=O(re=>{var le;return z&&A?((le=re.validateStore[z])==null?void 0:le[A])??"":""}),G=O(re=>P&&A?re.getDataSet(P,A):void 0),ie=i.useMemo(()=>S?de(k,`${S}_validateAction`):void 0,[k,S]),pe=O(re=>{var le;return ie?(le=re.dataSets[ie])==null?void 0:le.validate:void 0}),ne=i.useMemo(()=>G!==void 0?G:(V==null?void 0:V.value)!==void 0?V.value:y,[G,V==null?void 0:V.value,y]),ue=i.useMemo(()=>ns(w,V??null,{develop:o}),[w,V,o]),{prefixIconNode:fe,suffixIconNode:me,prefixAddonText:ee,suffixAddonText:W,inputMergedProps:te}=i.useMemo(()=>{const re=ue,le=re.prefix,H=re.suffix,ae=re.addonBefore,Y=re.addonAfter,{prefix:X,suffix:ve,addonBefore:ce,addonAfter:J,...he}=re,be=rt({iconName:le==null?void 0:String(le),label:ae==null?void 0:String(ae)}),ke=rt({iconName:H==null?void 0:String(H),label:Y==null?void 0:String(Y)});return{prefixIconNode:be.iconNode,suffixIconNode:ke.iconNode,prefixAddonText:be.iconConfigured?void 0:be.labelText,suffixAddonText:ke.iconConfigured?void 0:ke.labelText,inputMergedProps:he}},[ue]),ye=i.useCallback(re=>{const le=re??"";if(k&&S&&A&&I(k,S,A,le),k&&R){const H=L(k,R)||{};_(k,R,{...H,validateStatus:le?"error":void 0,help:le})}},[k,S,A,R,I,L,_]),Q=i.useCallback(re=>{const le=sn(g||[]);an(le,re,()=>ye(""),H=>{var ae;return ye(((ae=H[0])==null?void 0:ae.message)??"")})},[g,ye]),oe=i.useCallback(re=>{const le=re.target.value;if(N.current=le,l){l(le,re);return}if(P&&A&&B(P,A,le),c&&k){const{actionName:H,arg:ae}=Te(c,le,{id:e,dataSet:S,dataSetField:A,index:D,parentIndex:j,...te});T(k,se(H,ae))}x&&(E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{E.current=null,Q(le)},es))},[l,P,A,B,c,k,e,S,A,D,j,te,T,x,Q]),xe=i.useCallback(()=>{if(!v)return;const re=P&&A?String(K(P,A)??""):N.current;Q(re)},[v,P,A,K,Q]),Ne=i.useCallback(re=>{const H=te.onPressEnter;if(H){H(re);return}if(d&&k){const{actionName:ae,arg:Y}=Te(d,ne,{id:e,dataSet:S,dataSetField:A,index:D,parentIndex:j,...te});T(k,se(ae,Y))}},[te,d,k,ne,e,S,A,D,j,T]),$e=i.useCallback(()=>{const le=te.onClear;if(le){le();return}if(C&&k){const{actionName:H,arg:ae}=Te(C,"",{id:e,dataSet:S,dataSetField:A,index:D,parentIndex:j,...te});T(k,se(H,ae))}},[te,C,k,e,S,A,D,j,T]);i.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]),i.useEffect(()=>{if(pe==null||!P||!A)return;const re=String(K(P,A)??"");Q(re)},[pe,P,A,K,Q]);const _e=i.useMemo(()=>ts(p),[p]),Ee=i.useMemo(()=>_e?{components:{Input:_e}}:void 0,[_e]),Se=o?void 0:k&&S&&A?q:(V==null?void 0:V.help)??"",Ke=!o&&Se?"error":void 0,Z=u.jsxs(u.Fragment,{children:[u.jsxs(F.Space.Compact,{style:{width:"100%"},children:[ee?u.jsx(F.Space.Addon,{style:nt,children:ee}):null,u.jsx(F.Input,{...te,prefix:fe,suffix:me,value:ne,onChange:oe,onBlur:xe,onPressEnter:Ne,onClear:$e,status:Ke,styles:h}),W?u.jsx(F.Space.Addon,{style:nt,children:W}):null]}),Se&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:Se})]});return Ee?u.jsx(F.ConfigProvider,{theme:Ee,children:Z}):Z};tr.displayName="AndInput";const nr=i.memo(tr),wn=200,rr=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,pressEnterAction:y,clearAction:h,allowClear:p,stepAction:g,onChange:x,defaultValue:v,value:f,...m})=>{const d=tt(o,r,e),C=d.dataSet,b=d.dataSetField,w=d.sessionId,M=O(te=>te.addCommand),S=O(te=>te.setDataSet),A=i.useRef(null),k=i.useMemo(()=>de(w,C),[w,C]),$=O(te=>{var ye;return w&&t?((ye=te.propsStore[`${w}_props`])==null?void 0:ye[t])??null:null}),D=O(te=>k&&b?te.getDataSet(k,b):void 0),{validate:j,help:N}=We({rules:s,dataSet:C,dataSetField:b,sessionId:w,id:t,develop:n}),E=i.useMemo(()=>D!==void 0?D:($==null?void 0:$.value)!==void 0?$.value:f,[D,$==null?void 0:$.value,f]),T=i.useCallback((te,ye,Q)=>{te&&e&&M(e,se(te,{type:ye,value:Q}))},[e,M]),K=i.useCallback(te=>{if(x){x(te);return}k&&b&&S(k,b,te),c&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null,j(te)},wn)),T(l,"change",te)},[x,k,b,S,c,j,l,T]),B=i.useCallback(()=>{a&&j(E)},[a,j,E]),L=i.useCallback(te=>{if(m.onPressEnter){m.onPressEnter(te);return}if(y&&w){const{actionName:ye,arg:Q}=Te(y,E,{id:t,dataSet:C,dataSetField:b});M(w,se(ye,Q))}},[m.onPressEnter,y,w,E,t,C,b,M]),_=i.useCallback(()=>{if(x){x(null);return}if(k&&b&&S(k,b,null),c&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null,j(null)},wn)),T(l,"change",null),h&&w){const{actionName:te,arg:ye}=Te(h,null,{id:t,dataSet:C,dataSetField:b});M(w,se(te,ye))}},[x,k,b,S,c,j,T,l,h,w,t,C,b,M]),I=i.useCallback((te,ye)=>{T(g,"step",{value:te,type:ye.type})},[g,T]);i.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),i.useEffect(()=>{v!==void 0&&E===void 0&&k&&b&&S(k,b,v)},[v,E,k,b,S]);const P=i.useMemo(()=>Ie(m,$??void 0),[m,$]),{prefix:R,suffix:V,addonBefore:z,addonAfter:q,style:G,...ie}=P,pe=i.useMemo(()=>rt({iconName:R!=null?String(R):void 0,label:z!=null?String(z):void 0}),[R,z]),ne=i.useMemo(()=>rt({iconName:V!=null?String(V):void 0,label:q!=null?String(q):void 0}),[V,q]),ue=pe.iconNode,fe=ne.iconNode,me=pe.iconConfigured?void 0:pe.labelText,ee=ne.iconConfigured?void 0:ne.labelText,W=i.useMemo(()=>{if(!(p&&E!==null&&E!==void 0))return fe;const ye=u.jsx("span",{role:"button","aria-label":"clear",style:{cursor:"pointer",marginInlineStart:4},onMouseDown:Q=>Q.preventDefault(),onClick:Q=>{Q.stopPropagation(),_()},children:u.jsx(ze.CloseCircleOutlined,{})});return fe==null||fe===!1?ye:u.jsxs(u.Fragment,{children:[fe,ye]})},[p,E,fe,_]);return u.jsxs("div",{style:{width:"100%"},children:[u.jsxs(F.Space.Compact,{style:{width:"100%"},children:[me?u.jsx(F.Space.Addon,{style:nt,children:me}):null,u.jsx(F.InputNumber,{...ie,disabled:n?!1:ie.disabled,readOnly:n?!0:ie.readOnly,className:kr(ie.className,{"ant-input-number-disabled":n&&ie.disabled}),prefix:ue,value:E,onChange:K,onBlur:B,onPressEnter:L,onStep:I,suffix:W,status:N?"error":void 0,style:{width:"100%",...G}}),ee?u.jsx(F.Space.Addon,{style:nt,children:ee}):null]}),N&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:N})]})},{TextArea:kn}=F.Input,rs=200,os=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,pressEnterAction:y,clearAction:h,onChange:p,value:g,defaultValue:x,index:v,...f})=>{const m=tt(o,r,e),d=m.dataSet,C=m.dataSetField,b=m.sessionId,w=O(ne=>ne.addCommand),M=O(ne=>ne.setDataSet),S=i.useRef(null),A=i.useContext(qe),k=v??(A==null?void 0:A.index),$=A==null?void 0:A.parentIndex,D=i.useMemo(()=>de(b,d),[b,d]),j=i.useMemo(()=>b?ct(t,A,v):null,[b,t,A==null?void 0:A.parentIndex,A==null?void 0:A.index,v]),N=O(ne=>{var ue;return j?((ue=ne.propsStore[`${b}_props`])==null?void 0:ue[j])??null:null}),E=O(ne=>D&&C?ne.getDataSet(D,C):void 0),{validate:T,help:K}=We({rules:s,dataSet:d,dataSetField:C,sessionId:b,id:t,develop:n}),B=i.useMemo(()=>E!==void 0?E:(N==null?void 0:N.value)!==void 0?N.value:g??x,[E,N==null?void 0:N.value,g,x]),L=i.useMemo(()=>Ie(f,N??void 0),[f,N]),{leftAddonNode:_,rightAddonNode:I,inputRest:P}=i.useMemo(()=>{const ne=L,{prefix:ue,suffix:fe,addonBefore:me,addonAfter:ee,...W}=ne,te=rt({iconName:ue==null?void 0:String(ue),label:me==null?void 0:String(me)}),ye=rt({iconName:fe==null?void 0:String(fe),label:ee==null?void 0:String(ee)});return{leftAddonNode:te.iconNode??te.labelText,rightAddonNode:ye.iconNode??ye.labelText,inputRest:W}},[L]),R=i.useMemo(()=>_!=null&&_!==!1||I!=null&&I!==!1,[_,I]),V=i.useCallback(ne=>{const ue=ne.target.value;if(p){p(ue,ne);return}if(D&&C&&M(D,C,ue),l&&b){const{actionName:fe,arg:me}=Te(l,ue,{id:t,dataSet:d,dataSetField:C,index:k,parentIndex:$});w(b,se(fe,me))}c&&(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{S.current=null,T(ue)},rs))},[p,D,C,M,l,b,t,k,$,w,c,T]),z=i.useCallback(()=>{a&&T(B)},[a,T,B]),q=i.useCallback(ne=>{const ue=P.onPressEnter;if(ue){ue(ne);return}if(y&&b&&!ne.shiftKey){const{actionName:fe,arg:me}=Te(y,B,{id:t,dataSet:d,dataSetField:C,index:k,parentIndex:$});w(b,se(fe,me))}},[P,y,b,B,t,d,C,k,$,w]),G=i.useCallback(()=>{const ne=P.onClear;if(ne){ne();return}if(h&&b){const{actionName:ue,arg:fe}=Te(h,"",{id:t,dataSet:d,dataSetField:C,index:k,parentIndex:$});w(b,se(ue,fe))}},[P,h,b,t,d,C,k,$,w]);i.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const ie={...P,disabled:n?!1:P.disabled,value:B,onChange:V,onBlur:z,onPressEnter:q,onClear:G,status:K?"error":void 0,style:{...P.style||{},...R?{flex:1,minWidth:0}:{}}},pe=R?u.jsxs(F.Space.Compact,{style:{width:"100%",display:"flex"},children:[_!=null&&_!==!1?u.jsx(F.Space.Addon,{style:nt,children:_}):null,u.jsx(kn,{...ie}),I!=null&&I!==!1?u.jsx(F.Space.Addon,{style:nt,children:I}):null]}):u.jsx(kn,{...ie});return u.jsxs("div",{style:{width:"100%"},children:[pe,K&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:K})]})},{Password:ss}=F.Input,is=200,as=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,pressEnterAction:y,clearAction:h,onChange:p,value:g,defaultValue:x,...v})=>{const f=O(_=>_.addCommand),m=O(_=>_.setDataSet),d=i.useRef(null),C=i.useMemo(()=>de(e,o),[e,o]),b=O(_=>{var I;return e&&t?((I=_.propsStore[`${e}_props`])==null?void 0:I[t])??null:null}),w=O(_=>C&&r?_.getDataSet(C,r):void 0),{validate:M,help:S}=We({rules:s,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),A=i.useMemo(()=>w!==void 0?w:(b==null?void 0:b.value)!==void 0?b.value:g??x,[w,b==null?void 0:b.value,g,x]),k=i.useMemo(()=>Ie(v,b??void 0),[v,b]),{prefixIconNode:$,suffixIconNode:D,prefixAddonText:j,suffixAddonText:N,inputRest:E}=i.useMemo(()=>{const _=k,{prefix:I,suffix:P,addonBefore:R,addonAfter:V,...z}=_,q=rt({iconName:I==null?void 0:String(I),label:R==null?void 0:String(R)}),G=rt({iconName:P==null?void 0:String(P),label:V==null?void 0:String(V)});return{prefixIconNode:q.iconNode,suffixIconNode:G.iconNode,prefixAddonText:q.iconConfigured?void 0:q.labelText,suffixAddonText:G.iconConfigured?void 0:G.labelText,inputRest:z}},[k]),T=i.useCallback(_=>{const I=_.target.value;if(p){p(I,_);return}if(C&&r&&m(C,r,I),l&&e){const{actionName:P,arg:R}=Te(l,I,{id:t,dataSet:o,dataSetField:r});f(e,se(P,R))}c&&(d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{d.current=null,M(I)},is))},[p,C,r,m,l,e,t,f,c,M]),K=i.useCallback(()=>{a&&M(A)},[a,M,A]),B=i.useCallback(_=>{const I=E.onPressEnter;if(I){I(_);return}if(y&&e){const{actionName:P,arg:R}=Te(y,A,{id:t,dataSet:o,dataSetField:r});f(e,se(P,R))}},[E,y,e,A,t,o,r,f]),L=i.useCallback(()=>{const _=E.onClear;if(_){_();return}if(h&&e){const{actionName:I,arg:P}=Te(h,"",{id:t,dataSet:o,dataSetField:r});f(e,se(I,P))}},[E,h,e,t,o,r,f]);return i.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),u.jsxs("div",{style:{width:"100%"},children:[u.jsxs(F.Space.Compact,{style:{width:"100%"},children:[j?u.jsx(F.Space.Addon,{style:nt,children:j}):null,u.jsx(ss,{...E,prefix:$,suffix:D,disabled:n?!1:E.disabled,value:A,onChange:T,onBlur:K,onPressEnter:B,onClear:L,status:S?"error":void 0}),N?u.jsx(F.Space.Addon,{style:nt,children:N}):null]}),S&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:S})]})},{Search:cs}=F.Input,ls=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,searchAction:a,onChange:c,onSearch:l,value:y,defaultValue:h,...p})=>{const g=O(j=>j.addCommand),x=O(j=>j.getDataSet),v=O(j=>j.setDataSet),f=O(j=>{var N;return e&&t?((N=j.propsStore[`${e}_props`])==null?void 0:N[t])??null:null}),m=i.useMemo(()=>de(e,o),[e,o]),d=i.useMemo(()=>{if(m&&r)return x(m,r)},[m,r,x]),C=i.useMemo(()=>d??y??h,[d,y,h]),b=i.useMemo(()=>Ie(p,f??void 0),[p,f]),{prefixIconNode:w,suffixIconNode:M,prefixAddonText:S,suffixAddonText:A,inputProps:k}=i.useMemo(()=>{const j=b,{prefix:N,suffix:E,addonBefore:T,addonAfter:K,...B}=j,L=rt({iconName:N==null?void 0:String(N),label:T==null?void 0:String(T)}),_=rt({iconName:E==null?void 0:String(E),label:K==null?void 0:String(K)});return{prefixIconNode:L.iconNode,suffixIconNode:_.iconNode,prefixAddonText:L.iconConfigured?void 0:L.labelText,suffixAddonText:_.iconConfigured?void 0:_.labelText,inputProps:B}},[b]),$=i.useCallback(j=>{const N=j.target.value;if(c){c(N);return}if(m&&r&&v(m,r,N),s&&e){const{actionName:E,arg:T}=Te(s,N,{id:t,dataSet:o,dataSetField:r});g(e,se(E,T))}},[c,m,r,v,s,e,t,g]),D=i.useCallback(j=>{if(l){l(j);return}a&&e&&g(e,se(a,j))},[l,a,e,g]);return u.jsxs(F.Space.Compact,{style:{width:"100%"},children:[S?u.jsx(F.Space.Addon,{style:nt,children:S}):null,u.jsx(cs,{...k,prefix:w,suffix:M,disabled:n?!1:k.disabled,value:C,onChange:$,onSearch:D}),A?u.jsx(F.Space.Addon,{style:nt,children:A}):null]})},us=200,ds="_selected";function vt(t){var e;if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(i.isValidElement(t)){const n=(e=t.props)==null?void 0:e.children;if(typeof n=="string"||typeof n=="number")return String(n);if(Array.isArray(n))return n.map(vt).join("")}return String(t)}function fs(t,e){if(t===e||t==null&&e==null)return!0;if(t==null||e==null)return!1;const n=t.key,o=e.key,r=t.label,s=e.label;return Array.isArray(n)&&Array.isArray(o)&&Array.isArray(r)&&Array.isArray(s)?n.length!==o.length||r.length!==s.length?!1:n.every((a,c)=>a===o[c])&&r.every((a,c)=>a===s[c]):Array.isArray(n)||Array.isArray(o)?!1:n===o&&r===s}function Dn(t,e,n,o,r){var y;if(!(r==="multiple"||r==="tags"||Array.isArray(t))){if(t==null||t==="")return null;if(o&&t&&typeof t=="object"&&!Array.isArray(t)&&"value"in t){const x=t;return{key:x.value,label:vt(x.label)}}const h=e&&!Array.isArray(e)?e:et(n,t),p=(h==null?void 0:h.label)??(h==null?void 0:h.children),g=vt(p??((y=et(n,t))==null?void 0:y.label)??String(t));return{key:t,label:g}}if(!Array.isArray(t)||t.length===0)return null;if(o&&t[0]&&typeof t[0]=="object"&&t[0]!==null&&"value"in t[0]){const h=t.map(g=>g.value),p=t.map(g=>vt(g.label));return{key:h,label:p}}const a=Array.isArray(e)?e:[],c=t,l=c.map((h,p)=>{var v;const g=a[p],x=(g==null?void 0:g.label)??(g==null?void 0:g.children);return x!=null?vt(x):vt(((v=et(n,h))==null?void 0:v.label)??String(h))});return{key:c,label:l}}const ms=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,enableDict:s,dictType:a,optionsCfg:c,rules:l,validateOnBlur:y,validateOnChange:h,changeAction:p,onChange:g,autoSelectFirst:x=!1,options:v,defaultValue:f,value:m,index:d,showArrow:C,remoteUrl:b,searchAction:w,selectAction:M,deselectAction:S,dictCode:A,dropdownMatchSelectWidth:k,...$})=>{var Se,Ke;const D=tt(o,r,e),j=D.dataSet,N=D.dataSetField,E=D.sessionId,T=O(Z=>Z.addCommand),K=O(Z=>Z.setDataSet),B=i.useRef(null),L=i.useContext(qe),_=i.useMemo(()=>de(E,j),[E,j]),I=d??(L==null?void 0:L.index),P=L==null?void 0:L.parentIndex,R=i.useMemo(()=>E?ct(t,L,d):null,[E,t,L==null?void 0:L.parentIndex,L==null?void 0:L.index,d]),V=O(Z=>{var re;return R?((re=Z.propsStore[`${E}_props`])==null?void 0:re[R])??null:null}),z=O(Z=>_&&N?Z.getDataSet(_,N):void 0),q=i.useMemo(()=>(V==null?void 0:V.optionsCfg)!=null?V.optionsCfg:c,[V==null?void 0:V.optionsCfg,c]),{options:G,loading:ie}=St(A||(s?a:void 0)),{options:pe,loading:ne}=Kt(q==null?void 0:q.url,{valueKey:(q==null?void 0:q.codeKey)||"value",labelKey:(q==null?void 0:q.labelKey)||"label",immediate:!!(q!=null&&q.url),params:q==null?void 0:q.params,field:q==null?void 0:q.field}),ue=ie||ne,{validate:fe,help:me}=We({rules:l,dataSet:j,dataSetField:N,sessionId:E,id:t,develop:n}),ee=i.useMemo(()=>z!=null&&z!==""?z:(V==null?void 0:V.value)!==void 0?V.value:m??f,[z,V==null?void 0:V.value,m,f]),W=i.useMemo(()=>Ie($,V??void 0),[$,V]),te=i.useMemo(()=>V!=null&&V.options&&Array.isArray(V.options)?V.options:q!=null&&q.url&&pe.length>0?pe:(A||s&&a)&&G.length>0?G:v||[],[V==null?void 0:V.options,q==null?void 0:q.url,pe,A,s,a,G,v]),ye=i.useMemo(()=>{if(te.length===0)return ee;if(Array.isArray(ee))return ee.map(re=>{var le;return((le=et(te,re))==null?void 0:le.value)??re});const Z=et(te,ee);return(Z==null?void 0:Z.value)??ee},[ee,te]),Q=N?`${N}${ds}`:"",oe=i.useRef(null),xe=i.useCallback((Z,re)=>{if(g){g(Z,re);return}if(_&&N){K(_,N,Z);const le=Dn(Z,re,te,W.labelInValue,W.mode);K(_,Q,le)}if(h&&(B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{B.current=null,fe(Z)},us)),p&&E){const{actionName:le,arg:H}=Te(p,Z,{id:t,dataSet:j,dataSetField:N,index:I,parentIndex:P});T(E,se(le,H))}},[g,_,N,K,h,fe,p,E,t,j,N,I,P,T,te,W.labelInValue,W.mode,Q]);i.useEffect(()=>{if(g||!_||!N||!Q)return;const Z=Dn(ee,void 0,te,W.labelInValue,W.mode),re=O.getState().getDataSet(_,Q);fs(re,Z)||K(_,Q,Z)},[g,_,N,Q,ee,te,W.labelInValue,W.mode,K]);const Ne=i.useCallback(()=>{y&&fe(ye)},[y,fe,ye]),$e=(V==null?void 0:V.autoSelectFirst)??x,_e=i.useMemo(()=>{if(Array.isArray(ee))return ee.length===0;if(ee==null||ee==="")return!0;if(W.labelInValue&&ee&&typeof ee=="object"&&!Array.isArray(ee)&&"value"in ee){const Z=ee.value;return Z==null||Z===""}return!1},[ee,W.labelInValue]);i.useEffect(()=>{var ce,J;if(!$e||te.length===0||!_e){oe.current=null;return}const Z=((ce=W.fieldNames)==null?void 0:ce.value)||"value",re=((J=W.fieldNames)==null?void 0:J.label)||"label",le=te[0];if(!le)return;const H=le[Z]??le.value;if(H==null||H==="")return;const ae=`${_??""}:${N??""}:${String(H)}`;if(oe.current===ae)return;oe.current=ae;const Y=W.mode==="multiple"||W.mode==="tags"||Array.isArray(ee),X=le[re]??le.label;if(W.labelInValue){xe(Y?[{value:H,label:X}]:{value:H,label:X},Y?[le]:le);return}xe(Y?[H]:H,Y?[le]:le)},[$e,_,N,te,xe,_e,(Se=W.fieldNames)==null?void 0:Se.label,(Ke=W.fieldNames)==null?void 0:Ke.value,W.labelInValue,W.mode,ee]),i.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const Ee=i.useCallback((Z,re)=>((re==null?void 0:re.label)??"").toLowerCase().includes(Z.toLowerCase()),[]);return u.jsxs("div",{style:{width:"100%"},children:[u.jsx(F.Select,{...W,disabled:n?!1:W.disabled,open:n?!1:void 0,value:ye,options:te,onChange:xe,onBlur:Ne,filterOption:Ee,loading:ue,status:me?"error":void 0,style:{width:"100%",...W.style}}),me&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:me})]})},ys=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,onChange:y,checked:h,defaultChecked:p,...g})=>{const x=O(A=>A.addCommand),v=O(A=>A.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),m=O(A=>{var k;return e&&t?((k=A.propsStore[`${e}_props`])==null?void 0:k[t])??null:null}),d=O(A=>f&&r?A.getDataSet(f,r):void 0),{validate:C,help:b}=We({rules:s,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),w=i.useMemo(()=>d!==void 0?!!d:(m==null?void 0:m.checked)!==void 0?m.checked:h??p,[d,m==null?void 0:m.checked,h,p]),M=i.useCallback(A=>{if(y){y(A);return}if(f&&r&&v(f,r,A),c&&C(A),l&&e){const{actionName:k,arg:$}=Te(l,A,{id:t,dataSet:o,dataSetField:r});x(e,se(k,$))}},[y,f,r,v,c,C,l,e,t,x]),S=i.useCallback(()=>{a&&C(w)},[a,C,w]);return u.jsxs("div",{style:{display:"inline-block"},onBlur:S,children:[u.jsx(F.Switch,{...g,disabled:n?!1:g.disabled,checked:w,onChange:M}),b&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:b})]})};var hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var or={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(hs,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,s=/\d\d/,a=/\d\d?/,c=/\d*[^-_:/,()\s\d]+/,l={},y=function(m){return(m=+m)+(m>68?1900:2e3)},h=function(m){return function(d){this[m]=+d}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(d){if(!d||d==="Z")return 0;var C=d.match(/([+-]|\d\d)/g),b=60*C[1]+(+C[2]||0);return b===0?0:C[0]==="+"?-b:b}(m)}],g=function(m){var d=l[m];return d&&(d.indexOf?d:d.s.concat(d.f))},x=function(m,d){var C,b=l.meridiem;if(b){for(var w=1;w<=24;w+=1)if(m.indexOf(b(w,0,d))>-1){C=w>12;break}}else C=m===(d?"pm":"PM");return C},v={A:[c,function(m){this.afternoon=x(m,!1)}],a:[c,function(m){this.afternoon=x(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[s,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[a,h("seconds")],ss:[a,h("seconds")],m:[a,h("minutes")],mm:[a,h("minutes")],H:[a,h("hours")],h:[a,h("hours")],HH:[a,h("hours")],hh:[a,h("hours")],D:[a,h("day")],DD:[s,h("day")],Do:[c,function(m){var d=l.ordinal,C=m.match(/\d+/);if(this.day=C[0],d)for(var b=1;b<=31;b+=1)d(b).replace(/\[|\]/g,"")===m&&(this.day=b)}],w:[a,h("week")],ww:[s,h("week")],M:[a,h("month")],MM:[s,h("month")],MMM:[c,function(m){var d=g("months"),C=(g("monthsShort")||d.map(function(b){return b.slice(0,3)})).indexOf(m)+1;if(C<1)throw new Error;this.month=C%12||C}],MMMM:[c,function(m){var d=g("months").indexOf(m)+1;if(d<1)throw new Error;this.month=d%12||d}],Y:[/[+-]?\d+/,h("year")],YY:[s,function(m){this.year=y(m)}],YYYY:[/\d{4}/,h("year")],Z:p,ZZ:p};function f(m){var d,C;d=m,C=l&&l.formats;for(var b=(m=d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,j,N){var E=N&&N.toUpperCase();return j||C[N]||n[N]||C[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(T,K,B){return K||B.slice(1)})})).match(o),w=b.length,M=0;M<w;M+=1){var S=b[M],A=v[S],k=A&&A[0],$=A&&A[1];b[M]=$?{regex:k,parser:$}:S.replace(/^\[|\]$/g,"")}return function(D){for(var j={},N=0,E=0;N<w;N+=1){var T=b[N];if(typeof T=="string")E+=T.length;else{var K=T.regex,B=T.parser,L=D.slice(E),_=K.exec(L)[0];B.call(j,_),D=D.replace(_,"")}}return function(I){var P=I.afternoon;if(P!==void 0){var R=I.hours;P?R<12&&(I.hours+=12):R===12&&(I.hours=0),delete I.afternoon}}(j),j}}return function(m,d,C){C.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(y=m.parseTwoDigitYear);var b=d.prototype,w=b.parse;b.parse=function(M){var S=M.date,A=M.utc,k=M.args;this.$u=A;var $=k[1];if(typeof $=="string"){var D=k[2]===!0,j=k[3]===!0,N=D||j,E=k[2];j&&(E=k[2]),l=this.$locale(),!D&&E&&(l=C.Ls[E]),this.$d=function(L,_,I,P){try{if(["x","X"].indexOf(_)>-1)return new Date((_==="X"?1e3:1)*L);var R=f(_)(L),V=R.year,z=R.month,q=R.day,G=R.hours,ie=R.minutes,pe=R.seconds,ne=R.milliseconds,ue=R.zone,fe=R.week,me=new Date,ee=q||(V||z?1:me.getDate()),W=V||me.getFullYear(),te=0;V&&!z||(te=z>0?z-1:me.getMonth());var ye,Q=G||0,oe=ie||0,xe=pe||0,Ne=ne||0;return ue?new Date(Date.UTC(W,te,ee,Q,oe,xe,Ne+60*ue.offset*1e3)):I?new Date(Date.UTC(W,te,ee,Q,oe,xe,Ne)):(ye=new Date(W,te,ee,Q,oe,xe,Ne),fe&&(ye=P(ye).week(fe).toDate()),ye)}catch{return new Date("")}}(S,$,A,C),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),N&&S!=this.format($)&&(this.$d=new Date("")),l={}}else if($ instanceof Array)for(var T=$.length,K=1;K<=T;K+=1){k[1]=$[K-1];var B=C.apply(this,k);if(B.isValid()){this.$d=B.$d,this.$L=B.$L,this.init();break}K===T&&(this.$d=new Date(""))}else w.call(this,M)}}})})(or);var ps=or.exports;const vs=gs(ps);Ye.extend(vs);const Nn="YYYY-MM-DD",bs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,valueFormat:a=Nn,rules:c,validateOnBlur:l,validateOnChange:y,onChange:h,value:p,defaultValue:g,...x})=>{const v=O(j=>j.addCommand),f=O(j=>j.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),d=O(j=>{var N;return e&&t?((N=j.propsStore[`${e}_props`])==null?void 0:N[t])??null:null}),C=O(j=>m&&r?j.getDataSet(m,r):void 0),{validate:b,help:w}=We({rules:c,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),M=i.useMemo(()=>Ie(x,d??void 0),[x,d]),S=typeof M.format=="string"?M.format:void 0,A=i.useCallback(j=>{if(j==null||j==="")return null;if(Ye.isDayjs(j))return j.isValid()?j:null;if(typeof j!="string")return null;const N=[a,Nn,S].filter(T=>!!T);for(const T of N){const K=Ye(j,T,!0);if(K.isValid())return K}const E=Ye(j);return E.isValid()?E:null},[a,S]),k=i.useMemo(()=>{const j=C??(d==null?void 0:d.value)??p??g;return A(j)},[C,d==null?void 0:d.value,p,g,A]),$=i.useCallback((j,N)=>{if(h){h(j,N);return}const E=j!=null&&j.isValid()?j.format(a):"";if(m&&r&&f(m,r,E),y&&b(E||null),s&&e){const{actionName:T,arg:K}=Te(s,E,{id:t,dataSet:o,dataSetField:r});v(e,se(T,K))}},[h,m,r,f,y,b,s,e,t,o,r,v,a]);i.useEffect(()=>{if(g&&k===null&&m&&r){const j=Ye(g).format(a);f(m,r,j)}},[g,k,m,r,f,a]);const D=i.useCallback(()=>{if(l){const j=k?k.format(a):null;b(j)}},[l,b,k,a]);return u.jsxs("div",{onBlur:D,style:{display:"flex"},children:[u.jsx(F.DatePicker,{...M,disabled:n?!1:M.disabled,open:n?!1:void 0,value:k,onChange:$,style:{width:"100%",...M.style}}),w&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:w})]})},xs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,valueFormat:a="HH:mm:ss",onChange:c,value:l,defaultValue:y,rules:h,validateOnChange:p,validateOnBlur:g,...x})=>{const v=O(D=>D.addCommand),f=O(D=>D.getDataSet),m=O(D=>D.setDataSet),d=i.useMemo(()=>de(e,o),[e,o]),C=i.useMemo(()=>{if(d&&r)return f(d,r)},[d,r,f]),{validate:b,help:w}=We({rules:h,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),M=i.useCallback(D=>{if(!D)return null;if(Ye.isDayjs(D))return D;if(typeof D=="string"){const j=Ye(D,a);return j.isValid()?j:null}return null},[a]),S=i.useMemo(()=>M(C??l??y),[C,l,y,M]),A=i.useCallback((D,j)=>{if(c){c(D,j);return}const N=j||"";if(d&&r&&m(d,r,N),p&&b(N),s&&e){const{actionName:E,arg:T}=Te(s,N,{id:t,dataSet:o,dataSetField:r});v(e,se(E,T))}},[c,d,r,m,p,b,s,e,t,v]),k=i.useCallback(()=>{g&&b(S?S.format(a):"")},[g,b,S,a]),$=w?"error":void 0;return u.jsxs(u.Fragment,{children:[u.jsx(F.TimePicker,{...x,disabled:n?!1:x.disabled,open:n?!1:void 0,value:S,onChange:A,onBlur:k,style:{width:"100%",...x.style},status:$}),w&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:"12px",marginTop:"4px"},children:w})]})},{RangePicker:Ss}=F.DatePicker,Cs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,valueFormat:a="YYYY-MM-DD",rules:c,validateOnBlur:l,validateOnChange:y,onChange:h,value:p,defaultValue:g,...x})=>{const v=O(D=>D.addCommand),f=O(D=>D.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),d=O(D=>{var j;return e&&t?((j=D.propsStore[`${e}_props`])==null?void 0:j[t])??null:null}),C=O(D=>m&&r?D.getDataSet(m,r):void 0),{validate:b,help:w}=We({rules:c,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),M=i.useCallback(D=>{if(!D||!Array.isArray(D)||D.length!==2)return null;const[j,N]=D,E=Ye.isDayjs(j)?j:Ye(j,a),T=Ye.isDayjs(N)?N:Ye(N,a);return E.isValid()&&T.isValid()?[E,T]:null},[a]),S=i.useMemo(()=>{const D=C??(d==null?void 0:d.value)??p??g;return M(D)},[C,d==null?void 0:d.value,p,g,M]),A=i.useMemo(()=>Ie(x,d??void 0),[x,d]),k=i.useCallback((D,j)=>{if(h){h(D,j);return}if(m&&r&&f(m,r,j),y&&b(j),s&&e){const{actionName:N,arg:E}=Te(s,j,{id:t,dataSet:o,dataSetField:r});v(e,se(N,E))}},[h,m,r,f,y,b,s,e,t,v]),$=i.useCallback(()=>{var D,j;l&&b(S?[(D=S[0])==null?void 0:D.format(a),(j=S[1])==null?void 0:j.format(a)]:null)},[l,b,S,a]);return u.jsxs("div",{onBlur:$,children:[u.jsx(Ss,{...A,disabled:n?!1:A.disabled,open:n?!1:void 0,value:S,onChange:k,style:{width:"100%",...A.style}}),w&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:w})]})},Ms=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,options:s=[],optionsCfg:a,changeAction:c,buttonStyle:l,optionType:y="default",rules:h,validateOnBlur:p,validateOnChange:g,onChange:x,value:v,defaultValue:f,dictCode:m,index:d,direction:C,remoteUrl:b,...w})=>{const M=tt(o,r,e),S=M.dataSet,A=M.dataSetField,k=M.sessionId,$=O(ne=>ne.addCommand),D=O(ne=>ne.setDataSet),j=i.useContext(qe),N=d??(j==null?void 0:j.index),E=j==null?void 0:j.parentIndex,T=i.useMemo(()=>de(k,S),[k,S]),K=i.useMemo(()=>k?ct(t,j,d):null,[k,t,j==null?void 0:j.parentIndex,j==null?void 0:j.index,d]),B=O(ne=>{var ue;return K?((ue=ne.propsStore[`${k}_props`])==null?void 0:ue[K])??null:null}),L=O(ne=>T&&A?ne.getDataSet(T,A):void 0),{validate:_,help:I}=We({rules:h,dataSet:S,dataSetField:A,sessionId:k,id:t,develop:n}),P=i.useMemo(()=>L!==void 0?L:(B==null?void 0:B.value)!==void 0?B.value:v??f,[L,B==null?void 0:B.value,v,f]),{options:R}=St(m),{options:V}=Kt(a==null?void 0:a.url,{valueKey:(a==null?void 0:a.codeKey)||"value",labelKey:(a==null?void 0:a.labelKey)||"label",immediate:!!(a!=null&&a.url)}),z=i.useMemo(()=>B!=null&&B.options?B.options:a!=null&&a.url&&V.length>0?V:m&&R.length>0?R:s,[B==null?void 0:B.options,a==null?void 0:a.url,V,m,R,s]),q=i.useMemo(()=>{if(z.length===0)return P;const ne=et(z,P);return(ne==null?void 0:ne.value)??P},[P,z]),G=i.useMemo(()=>Ie(w,B??void 0),[w,B]),ie=i.useCallback(ne=>{const ue=ne.target.value;if(x){x(ue);return}if(T&&A&&D(T,A,ue),g&&_(ue),c&&k){const{actionName:fe,arg:me}=Te(c,ue,{id:t,dataSet:S,dataSetField:A,index:N,parentIndex:E});$(k,se(fe,me))}},[x,T,A,D,g,_,c,k,t,S,A,N,E,$]),pe=i.useCallback(()=>{p&&_(q)},[p,_,q]);return u.jsxs("div",{onBlur:pe,children:[u.jsx(F.Radio.Group,{...G,disabled:n?!1:G.disabled,value:q,onChange:ie,buttonStyle:(B==null?void 0:B.buttonStyle)??l,optionType:(B==null?void 0:B.optionType)??y,children:y==="button"?z.map(ne=>u.jsx(F.Radio.Button,{value:ne.value,disabled:ne.disabled,children:ne.label},ne.value)):u.jsx(F.Space,{orientation:(B==null?void 0:B.direction)??C??"horizontal",wrap:!0,children:z.map(ne=>u.jsx(F.Radio,{value:ne.value,disabled:ne.disabled,children:ne.label},ne.value))})}),I&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:I})]})},As=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,options:s=[],optionsCfg:a,multiple:c=!1,changeAction:l,rules:y,validateOnBlur:h,validateOnChange:p,onChange:g,onChangeMultiple:x,checked:v,values:f,defaultChecked:m,children:d,dictCode:C,index:b,direction:w="horizontal",remoteUrl:M,...S})=>{const A=tt(o,r,e),k=A.dataSet,$=A.dataSetField,D=A.sessionId,j=O(W=>W.addCommand),N=O(W=>W.setDataSet),E=i.useContext(qe),T=b??(E==null?void 0:E.index),K=E==null?void 0:E.parentIndex,B=i.useMemo(()=>de(D,k),[D,k]),L=i.useMemo(()=>D?ct(t,E,b):null,[D,t,E==null?void 0:E.parentIndex,E==null?void 0:E.index,b]),_=O(W=>{var te;return L?((te=W.propsStore[`${D}_props`])==null?void 0:te[L])??null:null}),I=O(W=>B&&$?W.getDataSet(B,$):void 0),{validate:P,help:R}=We({rules:y,dataSet:k,dataSetField:$,sessionId:D,id:t,develop:n}),{options:V}=St(C),{options:z}=Kt(a==null?void 0:a.url,{valueKey:(a==null?void 0:a.codeKey)||"value",labelKey:(a==null?void 0:a.labelKey)||"label",immediate:!!(a!=null&&a.url)}),q=i.useMemo(()=>{if(!c)return I!==void 0?!!I:(_==null?void 0:_.checked)!==void 0?_.checked:v??m},[c,I,_==null?void 0:_.checked,v,m]),G=i.useMemo(()=>_!=null&&_.options?_.options:a!=null&&a.url&&z.length>0?z:C&&V.length>0?V:s,[_==null?void 0:_.options,a==null?void 0:a.url,z,C,V,s]),ie=i.useMemo(()=>{if(!c)return[];let W=[];return Array.isArray(I)?W=I:Array.isArray(_==null?void 0:_.values)?W=_.values:W=f||[],G.length===0?W:W.map(te=>{var ye;return((ye=et(G,te))==null?void 0:ye.value)??te})},[c,I,_==null?void 0:_.values,f,G]),pe=i.useMemo(()=>Ie(S,_??void 0,{skipKeys:["value","help","validateStatus","checked","values","options"]}),[S,_]),ue=(pe.direction??w)==="vertical"?"vertical":"horizontal",fe=i.useCallback(W=>{const te=W.target.checked;if(g){g(te);return}if(B&&$&&N(B,$,te),p&&P(te),l&&D){const{actionName:ye,arg:Q}=Te(l,te,{id:t,dataSet:k,dataSetField:$}),oe=typeof Q=="object"&&Q!==null?{...Q,index:T,parentIndex:K}:Q;j(D,se(ye,oe))}},[g,B,$,N,p,P,l,D,t,j,T,K,k]),me=i.useCallback(W=>{if(x){x(W);return}if(B&&$&&N(B,$,W),p&&P(W),l&&D){const{actionName:te,arg:ye}=Te(l,W,{id:t,dataSet:k,dataSetField:$}),Q=typeof ye=="object"&&ye!==null?{...ye,index:T,parentIndex:K}:ye;j(D,se(te,Q))}},[x,B,$,N,p,P,l,D,t,j,T,K,k]),ee=i.useCallback(()=>{h&&P(c?ie:q)},[h,P,c,ie,q]);if(c&&G.length>0){const{indeterminate:W,direction:te,...ye}=pe;return u.jsxs("div",{onBlur:ee,children:[u.jsx(F.Checkbox.Group,{...ye,value:ie,onChange:me,disabled:n?!1:pe.disabled,children:u.jsx(F.Space,{orientation:ue,wrap:!0,children:G.map(Q=>u.jsx(F.Checkbox,{value:Q.value,disabled:Q.disabled,children:Q.label},Q.value))})}),R&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:R})]})}return u.jsxs("div",{onBlur:ee,children:[u.jsx(F.Checkbox,{...pe,disabled:n?!1:pe.disabled,checked:q,onChange:fe,children:d}),R&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:R})]})},js=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,rules:a,validateOnBlur:c,validateOnChange:l,onChange:y,value:h,defaultValue:p,...g})=>{const x=O(k=>k.addCommand),v=O(k=>k.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),m=O(k=>{var $;return e&&t?(($=k.propsStore[`${e}_props`])==null?void 0:$[t])??null:null}),d=O(k=>f&&r?k.getDataSet(f,r):void 0),{validate:C,help:b}=We({rules:a,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),w=i.useMemo(()=>d!==void 0?d:(m==null?void 0:m.value)!==void 0?m.value:h??p,[d,m==null?void 0:m.value,h,p]),M=i.useCallback(k=>{if(y){y(k);return}if(f&&r&&v(f,r,k),l&&C(k),s&&e){const{actionName:$,arg:D}=Te(s,k,{id:t,dataSet:o,dataSetField:r});x(e,se($,D))}},[y,f,r,v,l,C,s,e,t,x]),S=i.useCallback(()=>{c&&C(w)},[c,C,w]),A=i.useMemo(()=>Ie(g,m??void 0),[g,m]);return u.jsxs("div",{onBlur:S,children:[u.jsx(F.Rate,{...A,disabled:n?!1:A.disabled,value:w,onChange:M}),b&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:b})]})},ws=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,onChange:a,value:c,defaultValue:l,...y})=>{const h=O(d=>d.addCommand),p=O(d=>d.getDataSet),g=O(d=>d.setDataSet),x=i.useMemo(()=>de(e,o),[e,o]),v=i.useMemo(()=>{if(x&&r)return p(x,r)},[x,r,p]),f=i.useMemo(()=>v??c??l,[v,c,l]),m=i.useCallback(d=>{if(a){a(d);return}if(x&&r&&g(x,r,d),s&&e){const{actionName:C,arg:b}=Te(s,d,{id:t,dataSet:o,dataSetField:r});h(e,se(C,b))}},[a,x,r,g,s,e,t,h]);return u.jsx(F.Slider,{...y,disabled:n?!1:y.disabled,value:f,onChange:m})},ks=200,sr=(t,e,n=1)=>{if(!Array.isArray(t))return[];const{codeKey:o,labelKey:r,childrenKey:s,maxLevel:a}=e;return t.map(c=>{const l=n<a&&Array.isArray(c==null?void 0:c[s])?sr(c[s],e,n+1):void 0,y={value:String(c==null?void 0:c[o]),label:c==null?void 0:c[r]};return l&&l.length&&(y.children=l),y})},Tn=t=>!t||typeof t!="string"?[]:t.includes(",")?t.split(",").map(e=>e.trim()).filter(e=>e):[t],Ds=(t,e)=>{const n=(o,r,s=[])=>{for(const a of o){const c=a.value,l=[...s,c];if(c===r)return l;if(a.children&&Array.isArray(a.children)){const y=n(a.children,r,l);if(y)return y}}return null};return n(e,t)||[]},En=t=>Array.isArray(t)&&t.length>0&&!Array.isArray(t[0]),_n=t=>Array.isArray(t)&&t.length>0&&Array.isArray(t[0]),Ns=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,optionsCfg:s,rules:a,validateOnBlur:c,validateOnChange:l,changeAction:y,onChange:h,options:p,defaultValue:g,value:x,remoteUrl:v,...f})=>{const m=O(L=>L.addCommand),d=O(L=>L.setDataSet),C=i.useRef(null),[b,w]=i.useState([]),[M,S]=i.useState(!1),A=i.useMemo(()=>de(e,o),[e,o]),k=O(L=>A&&r?L.getDataSet(A,r):void 0),{validate:$,help:D,validateStatus:j}=We({rules:a,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),N=i.useMemo(()=>(s==null?void 0:s.url)&&b.length>0,[s==null?void 0:s.url,b.length]),E=i.useMemo(()=>{let L=k??x??g??[];return typeof L=="string"?N?Tn(L).map(I=>Ds(I,b)).filter(I=>Array.isArray(I)&&I.length>0):[L]:En(L)&&N?L.map(I=>Tn(I)).filter(I=>Array.isArray(I)&&I.length>0):_n(L)&&N?L.filter(_=>Array.isArray(_)&&_.length>0):L},[k,x,g,N,b]),T=i.useMemo(()=>s!=null&&s.url&&b.length>0?b:p||[],[s==null?void 0:s.url,b,p]);i.useEffect(()=>{(async()=>{if(s!=null&&s.url){S(!0);try{const _=await it({url:s.url,method:"GET"}),I=Array.isArray(_)?_:_!=null&&_.data?Array.isArray(_.data)?_.data:_.data.list||_.data.records||[]:[],P=s.codeKey||"value",R=s.labelKey||"label",V=s.childrenKey||"children",z=s.maxLevel||5,q=sr(I,{codeKey:P,labelKey:R,childrenKey:V,maxLevel:z});w(q)}catch(_){console.error("Failed to load remote options:",_),w([])}finally{S(!1)}}})()},[s==null?void 0:s.url,s==null?void 0:s.codeKey,s==null?void 0:s.labelKey,s==null?void 0:s.childrenKey,s==null?void 0:s.maxLevel]);const K=i.useCallback((L,_)=>{if(h){h(L,_);return}let I=L;if(En(L)&&N?I=String(L[L.length-1]||""):_n(L)&&N&&(I=L.map(P=>P.join(","))),A&&r&&d(A,r,I),l&&(C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{C.current=null,$(L)},ks)),y&&e){const{actionName:P,arg:R}=Te(y,L,{id:t,dataSet:o,dataSetField:r});m(e,se(P,R))}},[h,A,r,d,l,$,y,e,t,m,N]),B=i.useCallback(()=>{c&&$(E)},[c,$,E]);return i.useEffect(()=>()=>{C.current&&clearTimeout(C.current)},[]),u.jsxs("div",{style:{width:"100%"},children:[u.jsx(F.Cascader,{...f,disabled:n?!1:f.disabled,open:n?!1:void 0,value:E,options:T,onChange:K,onBlur:B,loading:M,status:j,style:{width:"100%",...f.style}}),D&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:D})]})},Ts=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,onChange:a,value:c,defaultValue:l,treeData:y,remoteUrl:h,selectAction:p,styles:g,classNames:x,token:v,rules:f,validateOnChange:m,validateOnBlur:d,...C})=>{const b=O(_=>_.addCommand),w=O(_=>_.setDataSet),M=i.useMemo(()=>de(e,o),[e,o]),S=O(_=>{var I;return e&&t?((I=_.propsStore[`${e}_props`])==null?void 0:I[t])??null:null}),A=O(_=>M&&r?_.getDataSet(M,r):void 0),{validate:k,help:$}=We({rules:f,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),D=i.useMemo(()=>A??(S==null?void 0:S.value)??c??l,[A,S==null?void 0:S.value,c,l]),j=i.useMemo(()=>Ie(C,S??void 0),[C,S]),N=i.useCallback((_,I,P)=>{if(a){a(_,I,P);return}if(M&&r&&w(M,r,_),m&&k(_),s&&e){const{actionName:R,arg:V}=Te(s,_,{id:t,dataSet:o,dataSetField:r});b(e,se(R,V))}},[a,M,r,w,m,k,s,e,t,b]),E=i.useCallback(()=>{d&&k(D)},[d,k,D]),T=i.useMemo(()=>{if(!v)return;const _={};return Object.entries(v).forEach(([I,P])=>{P!==""&&P!==void 0&&P!==null&&(_[I]=P)}),Object.keys(_).length>0?_:void 0},[v]),K=i.useMemo(()=>{if(T)return{components:{TreeSelect:T}}},[T]),B=$?"error":void 0,L=u.jsxs("div",{onBlur:E,children:[u.jsx(F.TreeSelect,{...j,disabled:n?!1:j.disabled,open:n?!1:void 0,treeData:y,value:D,onChange:N,style:{width:"100%",...j.style},styles:g,classNames:x,status:B}),$&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:$})]});return K?u.jsx(F.ConfigProvider,{theme:K,children:L}):L},Es=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,buttonText:a="上传文件",rules:c,validateOnBlur:l,validateOnChange:y,onChange:h,fileList:p,children:g,uploadUrl:x,maxSize:v=10,uploadParams:f,listDisplayText:m,action:d,...C})=>{const b=tt(o,r,e),w=b.dataSet,M=b.dataSetField,S=b.sessionId,A=O(Y=>Y.addCommand),k=O(Y=>Y.setDataSet),$=i.useMemo(()=>de(S,w),[S,w]),D=O(Y=>{var X;return S&&t?((X=Y.propsStore[`${S}_props`])==null?void 0:X[t])??null:null}),j=O(Y=>$&&M?Y.getDataSet($,M):void 0),{validate:N,help:E}=We({rules:c,dataSet:w,dataSetField:M,sessionId:S,id:t,develop:n}),T=i.useCallback(Y=>Y.map(X=>{var ve;return((ve=X==null?void 0:X.response)==null?void 0:ve.src)??(X==null?void 0:X.src)??(X==null?void 0:X.url)??(X==null?void 0:X.thumbUrl)??""}).filter(X=>X&&typeof X=="string"),[]),K=i.useCallback(Y=>{const X=Ge().viewRes,ve=ce=>(X?X(ce):ce)||ce;return Y.map((ce,J)=>{const he=ve(ce);return{uid:`src-${J}-${ce}`,name:ce.split("/").pop()||ce,url:he,thumbUrl:he,status:"done",response:{src:ce}}})},[]),B=i.useCallback(Y=>{const X=Ge().viewRes,ve=ce=>(ce&&X?X(ce):ce)||ce;return Y.map(ce=>{var ke;const J=((ke=ce==null?void 0:ce.response)==null?void 0:ke.src)??(ce==null?void 0:ce.src)??(ce==null?void 0:ce.url)??(ce==null?void 0:ce.thumbUrl)??"",he=typeof J=="string"?ve(J):J,be={};for(const Oe of Object.keys(ce)){const He=ce[Oe];He instanceof File?be[Oe]=He:He&&typeof He=="object"&&!Array.isArray(He)?be[Oe]={...He}:be[Oe]=He}return he&&typeof he=="string"&&(be.url=he,be.thumbUrl=he),be})},[]),[L,_]=i.useState(null),I=i.useMemo(()=>{const Y=j??(D==null?void 0:D.fileList)??p;if(Y!=null){if(typeof Y=="string"&&Y)return K([Y]);if(Array.isArray(Y))return Y.length>0&&typeof Y[0]=="string"?K(Y):B(Y)}},[j,D==null?void 0:D.fileList,p,K,B]),P=L??I,R=i.useMemo(()=>Ie(C,D??void 0,{skipKeys:["value","help","validateStatus","fileList","listDisplayText"]}),[C,D]),V=R,z=V.maxCount,q=V.repeatUpload===!0,G=V.token&&typeof V.token=="object"&&!Array.isArray(V.token)?V.token:void 0,ie=V.styles,pe=i.useMemo(()=>{const Y=ie;if(!Y||typeof Y=="function"||Array.isArray(Y))return;const X=Y.trigger;return X&&typeof X=="object"&&!Array.isArray(X)?X:void 0},[ie]),ne=i.useMemo(()=>{const Y=ie;if(!Y||Array.isArray(Y))return;if(typeof Y=="function")return Y;const{trigger:X,...ve}=Y;return Object.keys(ve).length>0?ve:void 0},[ie]),ue=i.useMemo(()=>{const Y={...R};return delete Y.token,delete Y.styles,delete Y.repeatUpload,delete Y.buttonText,Y},[R]),fe=i.useCallback(Y=>Y.size/1024/1024<v?!0:(F.message.error(`文件大小不能超过 ${v}MB`),!1),[v]),me=i.useCallback(async Y=>{const{file:X,onSuccess:ve,onError:ce,onProgress:J}=Y;if(Ge().upload)try{J==null||J({percent:30});const be=await ln(X,{url:x,headers:{Authorization:Ft()?`Bearer ${Ft()}`:""},form:f==null?void 0:f.form,query:f==null?void 0:f.query});J==null||J({percent:100}),ve==null||ve(be,X)}catch(be){ce==null||ce(be),F.message.error("上传失败")}else ce==null||ce(new Error("Upload handler not configured")),F.message.warning("上传功能未配置")},[x,f]),ee=i.useCallback(Y=>{if(h){h(Y);return}let X=Array.isArray(Y.fileList)?B(Y.fileList):Y.fileList;const ve=Array.isArray(X)&&X.some(he=>(he==null?void 0:he.status)==="uploading");q&&typeof z=="number"&&Array.isArray(X)&&X.length>z&&!ve&&(X=B([...X.slice(0,z-1),X[X.length-1]]));const ce=Array.isArray(X)?T(X):[];$&&M&&(ce.length>0||!Array.isArray(X)||X.length===0)?(k($,M,ce),_(null)):ve?_(X):X.length===0&&_(null),y&&N(X),s&&S&&A(S,se(s,{file:Y.file,fileList:X,src:ce}))},[h,$,M,k,y,N,s,S,A,B,T,q,z]),W=i.useCallback(()=>{l&&N(P)},[l,N,P]),te=i.useCallback(Y=>{var he;const X=Y.url||Y.thumbUrl;if(!X)return"";const ve=((he=Y.response)==null?void 0:he.src)??(typeof X=="string"?X:""),ce=Ge().viewRes,J=ve&&ce?ce(ve):X;return String(J).replace(/([?&])download=1(&|$)/,(be,ke,Oe)=>Oe?ke:"")},[]),ye=i.useCallback(Y=>{var ce,J;const X=((ce=Y.response)==null?void 0:ce.src)??Y.name??"",ve=((J=String(X).split(".").pop())==null?void 0:J.toLowerCase())||"";return["webp","svg","png","gif","jpg","jpeg","jfif","bmp","ico","heic","heif"].includes(ve)||/^data:image\//.test(te(Y))},[te]),[Q,oe]=i.useState({url:"",name:"",urls:[],current:0,open:!1}),xe=i.useCallback(Y=>{const X=te(Y);if(X)if(ye(Y)&&(P!=null&&P.length)){const ve=P.filter(he=>ye(he)),ce=ve.map(he=>te(he)).filter(Boolean),J=ve.findIndex(he=>(he.uid||he.url)===(Y.uid||Y.url));oe({url:X,name:Y.name,urls:ce,current:J>=0?J:0,open:!0})}else ye(Y)||window.open(X,"_blank")},[te,ye,P]),$e=!!Ge().upload&&!d,_e=V.buttonText??a,Ee=V.listType??C.listType,Se=String((D==null?void 0:D.listDisplayText)??m??"").trim(),Ke=i.useMemo(()=>{const Y=V.showUploadList;return Ee!=="text"||Y===!1||!Se||!(P!=null&&P.length)?P:P.map(X=>({...X,name:Se}))},[P,Ee,V.showUploadList,Se]),Z=(P==null?void 0:P.length)??0,re=typeof z=="number"&&Z>=z,le=i.useCallback(Y=>re&&!q?(F.message.warning(`最多只能上传 ${z} 个文件`),!1):fe(Y),[re,q,z,fe]),H=!re||q,ae=u.jsx(F.Upload,{...ue,styles:ne,disabled:n?!1:R.disabled,fileList:Ke,onChange:ee,onPreview:xe,beforeUpload:le,customRequest:$e?me:void 0,action:$e?void 0:d||x,openFileDialogOnClick:!n,children:H&&(g||(Ee==="picture-card"||Ee==="picture-circle"?u.jsxs("button",{type:"button",style:{border:0,background:"none",...pe},children:[u.jsx(ze.PlusOutlined,{}),u.jsx("div",{style:{marginTop:8},children:_e})]}):u.jsx(F.Button,{icon:u.jsx(ze.UploadOutlined,{}),style:pe,children:_e})))});return u.jsxs("div",{onBlur:W,children:[G&&Object.keys(G).length>0?u.jsx(F.ConfigProvider,{theme:{components:{Upload:G}},children:ae}):ae,E&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:E}),Q.url&&u.jsx("div",{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:Q.urls.length>1?u.jsx(F.Image.PreviewGroup,{preview:{current:Q.current,onOpenChange:Y=>!Y&&oe(X=>({...X,open:!1}))},children:Q.urls.map((Y,X)=>u.jsx(F.Image,{src:Y,style:{width:1,height:1},preview:{open:Q.open&&Q.current===X,onOpenChange:ve=>!ve&&oe(ce=>({...ce,open:!1}))}},X))}):u.jsx(F.Image,{src:Q.url,alt:Q.name,style:{width:1,height:1},preview:{open:Q.open,onOpenChange:Y=>!Y&&oe(X=>({...X,open:!1}))}})})]})},_s=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,selectAction:a,onChange:c,onSelect:l,value:y,defaultValue:h,options:p,remoteUrl:g,remoteOptions:x,searchAction:v,...f})=>{const m=O(T=>T.addCommand),d=O(T=>T.getDataSet),C=O(T=>T.setDataSet),b=i.useMemo(()=>de(e,o),[e,o]),[w,M]=i.useState(p||[]),[,S]=i.useState(!1),A=i.useRef(void 0),{get:k}=Zn(),$=i.useMemo(()=>{if(b&&r)return d(b,r)},[b,r,d]),D=i.useMemo(()=>$??y??h,[$,y,h]),j=i.useCallback(T=>{if(!(x!=null&&x.queryApi)){p&&M(p.filter(K=>{var B,L;return((B=K.value)==null?void 0:B.toString().toLowerCase().includes(T.toLowerCase()))||((L=K.label)==null?void 0:L.toString().toLowerCase().includes(T.toLowerCase()))}));return}A.current&&clearTimeout(A.current),A.current=setTimeout(async()=>{if(x!=null&&x.queryApi){S(!0);try{const{queryApi:K,keyWordParamName:B="keyword",valueKey:L="value",labelKey:_="label",fixedParams:I=[]}=x,P={};B&&(P[B]=T),Array.isArray(I)&&I.forEach(q=>{q.key&&(P[q.key]=q.value)});const R=await k(K,P);let V=[];Array.isArray(R)?V=R:R&&Array.isArray(R.data)?V=R.data:R&&R.data&&Array.isArray(R.data.records)?V=R.data.records:R&&R.result&&Array.isArray(R.result)&&(V=R.result);const z=V.map(q=>({value:q[L],label:q[_]||q[L],...q}));M(z)}catch(K){console.error("Failed to fetch remote options:",K),M([])}finally{S(!1)}}},500)},[x,p,k]);i.useEffect(()=>{!(x!=null&&x.queryApi)&&p&&M(p)},[p,x==null?void 0:x.queryApi]);const N=i.useCallback(T=>{if(c){c(T);return}if(b&&r&&C(b,r,T),s&&e){const{actionName:K,arg:B}=Te(s,T,{id:t,dataSet:o,dataSetField:r});m(e,se(K,B))}},[c,b,r,C,s,e,t,m]),E=i.useCallback((T,K)=>{if(l){l(T,K);return}a&&e&&m(e,se(a,{value:T,option:K}))},[l,a,e,m]);return u.jsx(F.AutoComplete,{...f,disabled:n?!1:f.disabled,open:n?!1:void 0,options:w,value:D,onChange:N,onSelect:E,onSearch:j,style:{width:"100%",...f.style}})},Os=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,submitAction:s,resetAction:a,showSubmit:c=!0,showReset:l=!0,submitText:y="提交",resetText:h="重置",onFinish:p,onReset:g,children:x,...v})=>{const[f]=F.Form.useForm(),m=O(M=>M.addCommand),d=O(M=>M.setDataSet),C=i.useMemo(()=>de(e,o),[e,o]),b=M=>{if(p){p(M);return}C&&r&&d(C,r,M),s&&e&&m(e,se(s,M))},w=()=>{if(f.resetFields(),g){g();return}a&&e&&m(e,se(a,null))};return u.jsxs(F.Form,{...v,form:f,onFinish:b,children:[x,(c||l)&&u.jsx(F.Form.Item,{children:u.jsxs(F.Space,{children:[c&&u.jsx(F.Button,{type:"primary",htmlType:"submit",children:y}),l&&u.jsx(F.Button,{onClick:w,children:h})]})})]})},Rs=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(F.Form.Item,{...r,children:o}),Qe=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{return JSON.parse(t)}catch{return e}return t},$s=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,dataSource:s,targetKeys:a,selectedKeys:c,disabled:l,showSearch:y,showSelectAll:h,oneWay:p,pagination:g,status:x,titles:v,actions:f,locale:m,changeAction:d,selectChangeAction:C,searchAction:b,scrollAction:w,onChange:M,onSelectChange:S,onSearch:A,onScroll:k,styles:$,token:D,...j})=>{const N=O(ee=>ee.addCommand),E=O(ee=>ee.getDataSet),T=O(ee=>ee.setDataSet),K=i.useMemo(()=>de(e,o),[e,o]),B=i.useMemo(()=>Qe($,{}),[$]),L=i.useMemo(()=>Qe(D,{}),[D]),_=i.useMemo(()=>Qe(v,["源列表","目标列表"]),[v]),I=i.useMemo(()=>Qe(f,[">","<"]),[f]),P=i.useMemo(()=>Qe(m,{itemUnit:"项",itemsUnit:"项",searchPlaceholder:"请输入搜索内容"}),[m]),R=i.useMemo(()=>Qe(g,!1),[g]),V=i.useMemo(()=>{if(K&&r){const ee=E(K,r);if(Array.isArray(ee))return ee}},[K,r,E]),z=i.useMemo(()=>{if(K&&r){const ee=E(K,`${r}.dataSource`);if(Array.isArray(ee))return ee}},[K,r,E]),q=i.useMemo(()=>n?z??Qe(s,[]):K?z??[]:Qe(s,[]),[n,K,z,s]),G=i.useMemo(()=>n?V??Qe(a,[]):K?V??[]:Qe(a,[]),[n,K,V,a]),ie=i.useMemo(()=>Qe(c,[]),[c]),pe=i.useCallback((ee,W,te)=>{if(M){M(ee,W,te);return}K&&r&&T(K,r,ee),d&&e&&N(e,se(d,{targetKeys:ee,direction:W,moveKeys:te}))},[M,K,r,T,d,e,N]),ne=i.useCallback((ee,W)=>{if(S){S(ee,W);return}C&&e&&N(e,se(C,{sourceSelectedKeys:ee,targetSelectedKeys:W}))},[S,C,e,N]),ue=i.useCallback((ee,W)=>{if(A){A(ee,W);return}b&&e&&N(e,se(b,{direction:ee,value:W}))},[A,b,e,N]),fe=i.useCallback((ee,W)=>{if(k){k(ee,W);return}w&&e&&N(e,se(w,{direction:ee}))},[k,w,e,N]),me=u.jsx(F.Transfer,{dataSource:q,targetKeys:G,selectedKeys:ie,disabled:l,showSearch:y,showSelectAll:h,oneWay:p,pagination:R,status:x||void 0,titles:_,actions:I,locale:P,onChange:pe,onSelectChange:ne,onSearch:ue,onScroll:fe,styles:B,render:ee=>ee.title,...j});return L&&Object.keys(L).length>0?u.jsx(F.ConfigProvider,{theme:{components:{Transfer:L}},children:me}):me},nn=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{const n=t.trim();if(n.startsWith("[")||n.startsWith("{"))return JSON.parse(n)}catch{return e}return t},Bs=t=>{if(!t)return null;const e=Xe[t];return e?u.jsx(e,{}):null},Ls=t=>nn(t,[]).map(n=>({label:n.label,value:n.value,icon:n.icon?Bs(n.icon):void 0,disabled:n.disabled})),Vs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,options:s,value:a,defaultValue:c,block:l,disabled:y,size:h,vertical:p,shape:g,changeAction:x,onChange:v,styles:f,token:m,...d})=>{const C=O(E=>E.addCommand),b=O(E=>E.getDataSet),w=O(E=>E.setDataSet),M=i.useMemo(()=>de(e,o),[e,o]),S=i.useMemo(()=>nn(f,{}),[f]),A=i.useMemo(()=>nn(m,{}),[m]),k=i.useMemo(()=>Ls(s),[s]),D=i.useMemo(()=>{if(M&&r){const E=b(M,r);if(typeof E=="string")return E}},[M,r,b])??a,j=i.useCallback(E=>{const T=String(E);if(v){v(T);return}M&&r&&w(M,r,T),x&&e&&C(e,se(x,{value:T}))},[v,M,r,w,x,e,C]),N=u.jsx(F.Segmented,{...d,options:k,value:D,defaultValue:c,block:l,disabled:y,size:h,vertical:p,shape:g,onChange:j,styles:S});return A&&Object.keys(A).length>0?u.jsx(F.ConfigProvider,{theme:{components:{Segmented:A}},children:N}):N},Fs=(t,e,n)=>{const[o,r]=i.useState(void 0),s=e==="100%",a=i.useRef(0);return i.useLayoutEffect(()=>{if(!s||!t.current){r(void 0);return}const c=t.current,l=()=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{const g=c.clientHeight;if(g===0)return;let x=0;const v=c.querySelector('[data-table-slot="title"]');v&&(x+=v.offsetHeight);const f=c.querySelector('[data-table-slot="footer"]');f&&(x+=f.offsetHeight);const m=c.querySelector(".ant-table-title");m&&(x+=m.offsetHeight);const d=c.querySelector(".ant-table-thead");if(d&&(x+=d.offsetHeight),n){const M=c.querySelector(".ant-pagination");if(M){const S=M,A=window.getComputedStyle(S),k=parseFloat(A.marginTop)||0,$=parseFloat(A.marginBottom)||0;x+=S.offsetHeight+k+$}}const C=c.querySelector(".ant-table-wrapper");if(C){const M=window.getComputedStyle(C),S=parseFloat(M.marginTop)||0,A=parseFloat(M.marginBottom)||0;x+=S+A}const b=g-x-2,w=Math.max(Math.floor(b),50);r(w)})};r(50);const y=setTimeout(l,16),h=new ResizeObserver(()=>{l()});h.observe(c);const p=new MutationObserver(()=>{l()});return p.observe(c,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{clearTimeout(y),a.current&&cancelAnimationFrame(a.current),h.disconnect(),p.disconnect()}},[s,n]),s?o:e};function Ps(t){const e=t.ellipsis;return e===!0||e==="true"}function Ks(t){const e=t.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e=="string"){const n=e.trim();if(!n)return;const o=Number(n.replace(/px$/i,""));if(Number.isFinite(o)&&o>0)return o}}function On(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return String(t)}catch{return""}}function zs(t,e){try{const n=Ye(t);return n.isValid()?e.dateFormat==="date"?n.format("YYYY-MM-DD"):e.dateFormat==="time"?n.format("HH:mm:ss"):n.format("YYYY-MM-DD HH:mm:ss"):""}catch{return""}}function qs(t,e){let n=parseFloat(t);if(isNaN(n))return"无效金额";const o=e.minDecimalPlace||0,r=e.maxDecimalPlace||2;Number.isInteger(n)&&o>0&&(n=parseFloat(n.toFixed(o)));let s=new Intl.NumberFormat("zh-CN",{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:r,useGrouping:e.showCommaSeparator||!1}).format(n);return e.currencySymbol&&(s=e.currencySymbol+s),s}function Ws(t,e){if(t==null||t==="")return"";const n=e.arraySeparator||",";return Array.isArray(t)?t.join(n):String(t)}const Is={display:"block",width:"100%",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};function Mt(t,e){const n=u.jsx("div",{style:Is,children:t});return e?u.jsx(F.Tooltip,{title:e,placement:"topLeft",children:n}):n}const Rn=new Map;function Hs(t){let e=Rn.get(t);return e||(e=Pt(t),Rn.set(t,e)),e}const Ys=({dictCode:t,value:e})=>{const[n,o]=i.useState(null);if(i.useEffect(()=>{if(!t){o([]);return}let s=!1;return Hs(t).then(a=>{s||o(a)}),()=>{s=!0}},[t]),e==null||e==="")return u.jsx("span",{});if(!n)return u.jsx("span",{children:String(e)});const r=et(n,e);return u.jsx("span",{children:(r==null?void 0:r.label)??String(e)})},Us=(t,e)=>{const n=e.columnDictType||e.dictType||"";return n?u.jsx(Ys,{dictCode:n,value:t}):u.jsx("span",{children:t!=null&&t!==""?String(t):""})},Gs=(t,e)=>{const[n,o]=(e.imageWidthHeight||"").split(/\s*[,,]\s*/),r=n||"50",s=o||"50";let a=[];return Array.isArray(t)?a=t.slice(0,3):typeof t=="string"&&t&&(a=[t]),a.length===0?u.jsx("span",{children:"无图片"}):a.length===1?u.jsx(F.Image,{src:a[0],alt:"image",width:r,height:s,preview:{src:a[0]}}):u.jsx(F.Image.PreviewGroup,{children:a.map((c,l)=>u.jsx(F.Image,{src:c,alt:`image-${l}`,width:r,height:s,style:{marginRight:8,marginBottom:8}},l))})},Js=(t,e)=>{let n=parseFloat(t);if(isNaN(n))return u.jsx("span",{children:"无效金额"});const o=e.currencySymbol||"",r=e.showCommaSeparator||!1,s=e.minDecimalPlace||0,a=e.maxDecimalPlace||2;Number.isInteger(n)&&s>0&&(n=parseFloat(n.toFixed(s)));const c={style:"decimal",minimumFractionDigits:s,maximumFractionDigits:a,useGrouping:r};let l=new Intl.NumberFormat("zh-CN",c).format(n);return o&&(l=o+l),u.jsx("span",{children:l})},Qs=(t,e)=>{let n="";try{const o=Ye(t);o.isValid()&&(e.dateFormat==="date"?n=o.format("YYYY-MM-DD"):e.dateFormat==="time"?n=o.format("HH:mm:ss"):(e.dateFormat,n=o.format("YYYY-MM-DD HH:mm:ss")))}catch{n=""}return u.jsx("span",{children:n})},Zs=(t,e)=>{if(t==null||t==="")return u.jsx("span",{});const n=e.arraySeparator||",";return Array.isArray(t)?u.jsx("span",{children:t.join(n)}):u.jsx("span",{children:String(t)})};function ir(t){return typeof t.dataIndex=="string"?t.dataIndex:Array.isArray(t.dataIndex)?t.dataIndex.join("."):typeof t.key=="string"||typeof t.key=="number"?String(t.key):""}const Xs=(t,e,n,o)=>{const r=ir(e);return u.jsx(nr,{value:t??"",onChange:s=>{!r||!(o!=null&&o.onCellValueChange)||o.onCellValueChange(n,r,s)}})},ei=(t,e,n,o)=>{const r=ir(e),s=t===""||t===null||t===void 0?null:typeof t=="number"?t:Number(t),a=s===null||Number.isNaN(s)?null:s;return u.jsx(rr,{value:a,onChange:c=>{!r||!(o!=null&&o.onCellValueChange)||o.onCellValueChange(n,r,c)}})};function ti(t){const e=[16,16];if(t==null||t==="")return e;let n=[];if(Array.isArray(t))n=t;else if(typeof t=="string")try{const s=JSON.parse(t);if(Array.isArray(s))n=s;else return e}catch{return e}else return e;const o=Number(n[0]),r=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(r)?e:[Math.max(1,o),Math.max(1,r)]}function ni(t){return!!(t==null||t===""||Array.isArray(t)&&t.length===0)}const ri=(t,e,n,o)=>{var p;if(ni(t))return u.jsx("span",{});const r=(p=e.columnIcon)==null?void 0:p.trim();if(!r)return u.jsx("span",{});const s=Xe[r];if(!s)return u.jsx("span",{});const[a,c]=ti(e.iconSize),l=(e.iconClickAction||"").trim(),y=o==null?void 0:o.runAction,h=u.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:a,height:c},children:u.jsx(s,{style:{fontSize:Math.min(a,c)}})});return l&&y?u.jsx("span",{role:"button",tabIndex:0,style:{cursor:"pointer",display:"flex"},onClick:()=>y(l,{...n}),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),y(l,{...n}))},children:h}):h},oi=(t,e)=>{const n={...t},o=Ps(n),r=Ks(n);if(r!==void 0){const s=n.onCell,a=n.onHeaderCell,c={maxWidth:r,overflow:"hidden",boxSizing:"border-box"};n.onCell=(l,y)=>{const h=(s?s(l,y):void 0)||{};return{...h,style:{...h.style||{},...c}}},n.onHeaderCell=(l,y)=>{const h=(a?a(l,y):void 0)||{};return{...h,style:{...h.style||{},...c}}}}if(n.specialFields===!0&&n.renderType)n.render=(s,a,c)=>{switch(n.renderType){case"image":return Gs(s,n);case"money":{const l=Js(s,n);return o?Mt(l,qs(s,n)):l}case"date":{const l=Qs(s,n);return o?Mt(l,zs(s,n)):l}case"array":{const l=Zs(s,n);return o?Mt(l,Ws(s,n)):l}case"dict":{const l=Us(s,n);return o?Mt(l,On(s)):l}case"icon":return ri(s,n,a,e);case"input":return Xs(s,n,a,e);case"inputNumber":return ei(s,n,a,e);default:return s}};else if(o){const s=n.render;n.render=(a,c,l)=>{const y=s?s(a,c,l):a??"";return Mt(y,On(a))}}return o&&(n.ellipsis=!1),n},It=15,At=10,si=[{value:"small",label:"紧凑"},{value:"middle",label:"默认"},{value:"large",label:"宽松"}];function $n(t,e,n,o){const r={};return e.forEach(s=>{s.width!==void 0&&(r[s.key]=s.width)}),{rowIndexVisible:t,order:e.map(s=>s.key),visible:e.reduce((s,a)=>(s[a.key]=a.visible,s),{}),fixed:e.reduce((s,a)=>(a.fixed&&(s[a.key]=a.fixed),s),{}),width:Object.keys(r).length?r:void 0,scrollX:n,size:o}}function ii(t,e,n,o){const r=(t==null?void 0:t.order)??e.map(p=>p.key),s=(t==null?void 0:t.visible)??{},a=(t==null?void 0:t.fixed)??{},c=(t==null?void 0:t.width)??{},l=new Map(e.map(p=>[p.key,p])),y=[],h=new Set;for(const p of r){const g=l.get(p);g&&(h.add(p),y.push({key:g.key,title:g.title,visible:s[p]??g.visible,fixed:a[p]??g.fixed,width:c[p]??g.width}))}for(const p of e)h.has(p.key)||y.push({...p,visible:s[p.key]??p.visible,fixed:a[p.key]??p.fixed,width:c[p.key]??p.width});return{rowIndexVisible:(t==null?void 0:t.rowIndexVisible)??n,items:y,scrollX:t==null?void 0:t.scrollX,size:(t==null?void 0:t.size)??o??"middle"}}const Ht=420,Bn=440,ai=({open:t,position:e,rowIndexVisible:n,columnItems:o,defaultRowIndexVisible:r,defaultColumnItems:s,scrollX:a=!1,defaultScrollX:c=!1,size:l="middle",defaultSize:y="middle",onSave:h,onClose:p})=>{const[g,x]=i.useState(n),[v,f]=i.useState(o),[m,d]=i.useState(a),[C,b]=i.useState(l),[w,M]=i.useState(null);i.useEffect(()=>{t&&(x(n),f([...o]),d(a),b(l))},[t,n,o,a,l]);const S=i.useCallback(R=>{queueMicrotask(()=>h(R))},[h]),A=i.useCallback((R,V,z,q)=>$n(R,V,z??m,q??C),[m,C]),k=i.useCallback(()=>{x(r);const R=s.map(V=>({...V}));f(R),d(c),b(y),S($n(r,R,c,y))},[r,s,c,y,S]),$=i.useCallback(R=>{f(V=>{const z=V.map(q=>q.key===R?{...q,visible:!q.visible}:q);return S(A(g,z)),z})},[g,A,S]),D=i.useCallback((R,V)=>{f(z=>{const q=z.map(G=>G.key===R?{...G,fixed:V}:G);return S(A(g,q)),q})},[g,A,S]),j=i.useCallback((R,V)=>{f(z=>{const q=z.map(G=>G.key===R?{...G,width:V}:G);return S(A(g,q)),q})},[g,A,S]),N=i.useCallback((R,V)=>{f(z=>{const q=z.find(ne=>ne.key===R);if(!q)return z;const G=typeof q.width=="number"?q.width:80,ie=Math.max(It,G+V),pe=z.map(ne=>ne.key===R?{...ne,width:ie}:ne);return S(A(g,pe)),pe})},[g,A,S]),E=i.useCallback((R,V)=>{if(V<0||V>=v.length)return;const z=[...v],[q]=z.splice(R,1);z.splice(V,0,q),f(z),S(A(g,z))},[v,g,A,S]),T=i.useCallback(R=>{x(R),S(A(R,v))},[v,A,S]),K=i.useCallback(R=>{d(R),S(A(g,v,R,C))},[g,v,C,A,S]),B=i.useCallback(R=>{b(R),S(A(g,v,m,R))},[g,v,m,A,S]),L=R=>V=>{M(R),V.dataTransfer.effectAllowed="move",V.dataTransfer.setData("text/plain",String(R))},_=R=>V=>{V.preventDefault(),V.dataTransfer.dropEffect="move",!(w===null||w===R)&&(E(w,R),M(R))},I=()=>M(null),P=e!=null?(()=>{let R=e.y,V=e.x;return typeof window<"u"&&(V+Ht>window.innerWidth&&(V=window.innerWidth-Ht-16),V<16&&(V=16),R+Bn>window.innerHeight&&(R=Math.max(16,window.innerHeight-Bn-16)),R<16&&(R=16)),{margin:0,top:R,left:V}})():void 0;return u.jsx(F.Modal,{title:"列设置",open:t,onCancel:p,footer:null,width:Ht,destroyOnHidden:!0,centered:e==null,style:P,mask:!1,className:`and-table-column-setting-modal${e!=null?" and-table-column-setting-modal-positioned":""}`,children:u.jsxs("div",{className:"and-table-column-setting-body",children:[u.jsx("div",{className:"and-table-column-setting-header",children:u.jsxs("div",{className:"and-table-column-setting-header-row",children:[u.jsx(F.Checkbox,{checked:g,onChange:R=>T(R.target.checked),children:"序号列"}),u.jsx(F.Checkbox,{checked:m,onChange:R=>K(R.target.checked),children:"自动滚动"}),u.jsxs(F.Space,{align:"center",children:[u.jsx("span",{className:"and-table-column-setting-label",children:"表格"}),u.jsx(F.Select,{size:"small",value:C,onChange:B,options:[...si],style:{width:80}})]})]})}),u.jsx("div",{className:"and-table-column-setting-list-wrap",children:u.jsxs("table",{className:"and-table-column-setting-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"and-table-column-setting-th-drag",children:"排序"}),u.jsx("th",{className:"and-table-column-setting-th-name",children:"列名/可见"}),u.jsx("th",{className:"and-table-column-setting-th-width",children:"宽度(px)"}),u.jsx("th",{className:"and-table-column-setting-th-fix",children:"固定"})]})}),u.jsx("tbody",{children:v.map((R,V)=>{const z=typeof R.width=="number"?R.width:null,q=R.width==="auto"||R.width===void 0&&z===null;return u.jsxs("tr",{className:`and-table-column-setting-row ${w===V?"and-table-column-setting-row-dragging":""}`,draggable:!0,onDragStart:L(V),onDragOver:_(V),onDragEnd:I,children:[u.jsx("td",{className:"and-table-column-setting-td-drag",children:u.jsx("span",{className:"and-table-column-setting-drag",title:"拖动排序",children:u.jsx(ze.MenuOutlined,{})})}),u.jsxs("td",{className:"and-table-column-setting-td-name",children:[u.jsx(F.Checkbox,{checked:R.visible,onChange:()=>$(R.key)}),u.jsx("span",{className:"and-table-column-setting-title",title:R.title,children:R.title})]}),u.jsx("td",{className:"and-table-column-setting-td-width",children:u.jsxs("div",{className:"and-table-column-setting-width",children:[u.jsx("span",{className:"and-table-column-setting-fix-btn",onClick:()=>N(R.key,-At),title:`减 ${At}px`,children:u.jsx(ze.MinusOutlined,{})}),u.jsx(F.InputNumber,{size:"small",min:It,step:At,value:q?void 0:z??80,placeholder:"auto",controls:!1,style:{width:44},onChange:G=>{G==null||typeof G=="string"&&G===""?j(R.key,"auto"):j(R.key,Math.max(It,Number(G)))}}),u.jsx("span",{className:"and-table-column-setting-fix-btn",onClick:()=>N(R.key,At),title:`加 ${At}px`,children:u.jsx(ze.PlusOutlined,{})})]})}),u.jsx("td",{className:"and-table-column-setting-td-fix",children:u.jsxs(F.Space,{className:"and-table-column-setting-fix",children:[u.jsx("span",{className:`and-table-column-setting-fix-btn ${R.fixed==="left"?"active":""}`,onClick:()=>D(R.key,R.fixed==="left"?!1:"left"),title:"固定到左侧",children:u.jsx(ze.LeftOutlined,{})}),u.jsx("span",{className:"and-table-column-setting-fix-divider",children:"|"}),u.jsx("span",{className:`and-table-column-setting-fix-btn ${R.fixed==="right"?"active":""}`,onClick:()=>D(R.key,R.fixed==="right"?!1:"right"),title:"固定到右侧",children:u.jsx(ze.RightOutlined,{})})]})})]},R.key)})})]})}),u.jsx("div",{className:"and-table-column-setting-footer",children:u.jsx(F.Button,{onClick:k,children:"重置"})})]})})},ci=256,li=[/__proto__/,/constructor\s*[.[(]/,/globalThis/],Ln=new Map,ui=t=>{const e=Ln.get(t);if(e)return e;try{const n=new Function("row",`with(row){ return (${t}); }`);return Ln.set(t,n),n}catch(n){return typeof console<"u"&&console.warn("[AndTable] visibleExpression compile failed:",t,n),null}},di=(t,e)=>{if(e==null)return!0;const n=String(e).trim();if(!n)return!0;if(n.length>ci||li.some(r=>r.test(n)))return!1;const o=ui(n);if(!o)return!1;try{return!!o(t&&typeof t=="object"?t:{})}catch(r){return typeof console<"u"&&console.warn("[AndTable] visibleExpression eval failed:",n,r),!1}},fi=["value","validateStatus","help","dataSource","children","id","sessionId","develop","dataSet","dataSetField"],mi=t=>{const{id:e,sessionId:n}=t,o=O(U=>{var ge;return n&&e?((ge=U.propsStore[`${n}_props`])==null?void 0:ge[e])??null:null}),r=i.useMemo(()=>Ie({...t},o??void 0,{skipKeys:[...fi]}),[t,o]),{develop:s,dataSet:a,dataSetField:c,columns:l=[],operateColumns:y=[],sampleData:h,operationColumnVisible:p=!0,operationColumnSettings:g,selectRowEnable:x,singleSelectMode:v,selectAction:f,rowKeyField:m="id",displayRowIndex:d,queryAction:C,pagination:b,emptyText:w,bordered:M,size:S,sticky:A,scroll:k,autoFillHeight:$,showTitle:D,showSummary:j,showFooter:N,renderTitle:E,renderSummary:T,renderFooter:K,children:B,token:L,columnSettingOpenKey:_,columnSettingsKey:I,...P}=r,R=O(U=>U.addCommand),V=O(U=>U.getDataSet),z=O(U=>U.setDataSet),[q,G]=i.useState([]),ie=i.useRef(null),[pe,ne]=i.useState(void 0),ue=i.useCallback((U,ge,De)=>{if(!ge)return U;const Me=ge.split(".").filter(Boolean);if(Me.length===0)return U;const Ce={...U};let je=Ce;for(let we=0;we<Me.length-1;we+=1){const Pe=Me[we],Le=je[Pe];je[Pe]=Le&&typeof Le=="object"?{...Le}:{},je=je[Pe]}return je[Me[Me.length-1]]=De,Ce},[]),fe=i.useCallback((U,ge)=>{if(U==null)return ge;if(typeof U=="string")try{return JSON.parse(U)??ge}catch{return ge}return U},[]),me=i.useMemo(()=>Array.isArray(l)?l:[],[l]),ee=i.useMemo(()=>Array.isArray(y)?y:[],[y]),W=i.useMemo(()=>({dataSet:de(n,a),pagination:a?de(n,`${a}_pagination`):void 0,selected:a?de(n,`${a}_selected`):void 0,columnSettingOpen:a&&n?de(n,`${a}_columnSettingOpen`):void 0,columnSettings:a&&n?de(n,`${a}_columnSettings`):void 0}),[n,a]),{style:te,className:ye,...Q}=P,oe=i.useMemo(()=>{if(k)return k;let U=Q["scroll-x"],ge=Q["scroll-y"];if(String(U)==="true"?U=!0:String(U)==="false"||U==="__unset__"?U=void 0:U==="max-content"&&(U="max-content"),(ge===""||ge===null||ge===void 0)&&(ge=void 0),U!==void 0||ge!==void 0)return{x:U,y:ge}},[k,Q["scroll-x"],Q["scroll-y"]]),xe=O(U=>{var ge;return W.columnSettingOpen?((ge=U.dataSets[W.columnSettingOpen])==null?void 0:ge.value)===!0:!1}),Ne=420;i.useLayoutEffect(()=>{if(!xe||!ie.current)return;const U=ie.current.querySelector(".ant-table-thead")||ie.current.querySelector(".ant-table-header");if(!U)return;const ge=U.getBoundingClientRect();ne({x:ge.right-Ne,y:ge.bottom+8})},[xe]);const $e=O(U=>{var De;const ge=W.columnSettings?(De=U.dataSets[W.columnSettings])==null?void 0:De.value:void 0;return typeof ge=="object"&&ge!==null?ge:void 0}),_e=Hn(W.dataSet,c),Ee=i.useMemo(()=>s?(h==null?void 0:h.data)||[]:W.dataSet?_e:(h==null?void 0:h.data)||[],[s,W.dataSet,_e,h==null?void 0:h.data]),Se=i.useMemo(()=>fe(L,{}),[L,fe]),Ke=Se&&Object.keys(Se).length>0,Z=i.useMemo(()=>Ke?{components:{Table:Se}}:void 0,[Ke,Se]),re=O(U=>W.pagination?U.dataSets[W.pagination]:void 0),le=i.useMemo(()=>W.pagination?V(W.pagination,"")||{}:{},[W.pagination,V,re]),H=i.useMemo(()=>!(b===!1||typeof b=="object"&&(b==null?void 0:b.visible)===!1),[b]),ae=Fs(ie,oe==null?void 0:oe.y,H),Y=i.useMemo(()=>{if(!H)return!1;const U=typeof b=="object"?b:{},ge=P||{},De=U.showSizeChanger??ge["pagination-showSizeChanger"]??!0,Me=U.showQuickJumper??ge["pagination-showQuickJumper"]??!1,Ce=U.simple??ge["pagination-simple"]??!1,je=U.defaultPageSize??ge["pagination-defaultPageSize"]??10,we=U.pageSizeOptions??ge["pagination-pageSizeOptions"]??"10,20,50,100",Pe=typeof we=="string"?we.split(",").map(Le=>parseInt(String(Le).trim(),10)||10).filter(Le=>!isNaN(Le)):Array.isArray(we)?we:[10,20,50,100];return{...le,showSizeChanger:De,showQuickJumper:Me,simple:Ce,defaultPageSize:je,pageSizeOptions:Pe,showTotal:(Le,Be)=>(U.showTotal||"共 ${total} 条").replace("${total}",String(Le)).replace("${range[0]}",String(Be[0])).replace("${range[1]}",String(Be[1])).replace("${range}",`${Be[0]}-${Be[1]}`),onChange:(Le,Be)=>{W.pagination&&z(W.pagination,"",{...le,current:Le,pageSize:Be}),C&&n&&R(n,se(C,null))},hideOnSinglePage:!1}},[H,b,P,le,W.pagination,z,C,n,R]),X=i.useCallback((U,ge)=>{n&&R(n,se(U.action,{...ge}))},[n,R]),ve=i.useMemo(()=>{let U=g;if(typeof U=="string"){const Ce=U.trim();if(!Ce)U=void 0;else try{U=JSON.parse(Ce)}catch{U=void 0}}const ge=!!(U&&typeof U=="object"&&(U.useCompact===!0||U.useCompact==="true")),De={},Me=U&&typeof U=="object"?U.actionSettings:void 0;if(Me&&typeof Me=="object"&&Object.entries(Me).forEach(([Ce,je])=>{if(!Ce||!je||typeof je!="object")return;const we={};je.styles&&typeof je.styles=="object"&&!Array.isArray(je.styles)&&(we.styles=je.styles),je.classNames&&typeof je.classNames=="object"&&!Array.isArray(je.classNames)&&(we.classNames=je.classNames),(we.styles||we.classNames)&&(De[Ce]=we)}),Object.keys(De).length===0&&U&&typeof U=="object"){const Ce=Array.isArray(U.buttonStyles)?U.buttonStyles:null;Ce&&ee.forEach((je,we)=>{const Pe=je==null?void 0:je.key;if(!Pe)return;const Le=Ce[we];Le&&typeof Le=="object"&&!Array.isArray(Le)&&(De[Pe]={styles:Le})})}return{useCompact:ge,actionSettings:De}},[g,ee]),ce=i.useCallback((U,ge)=>{n&&U&&R(n,se(U,ge))},[n,R]),J=i.useCallback((U,ge,De)=>{if(!W.dataSet)return;const Me=c&&String(c).trim()!==""?c:"",Ce=U==null?void 0:U[m],je=Ee.map(we=>(Ce!=null?(we==null?void 0:we[m])===Ce:we===U)?ue(we??{},ge,De):we);z(W.dataSet,Me,je,!1)},[W.dataSet,c,m,Ee,z,ue]),he=i.useMemo(()=>me.map(U=>{let ge=!1;U.fixed===!0||U.fixed==="left"?ge="left":U.fixed==="right"&&(ge="right");const De=U.width;return{key:String(U.key??U.dataIndex??""),title:typeof U.title=="string"?U.title:"列",visible:U.visible!==!1,fixed:ge,width:typeof De=="number"?De:"auto"}}).filter(U=>U.key),[me]),be=d===!0,ke=!1,Oe=S==="small"||S==="large"?S:"middle",{rowIndexVisible:He,items:ft,scrollX:mt,size:dn}=i.useMemo(()=>ii($e,he,be,Oe),[$e,he,be,Oe]),yt=!!(a&&n),dr=i.useMemo(()=>{if(mt!==void 0)return mt;const U=oe==null?void 0:oe.x;return U===!0||typeof U=="number"&&Number.isFinite(U)&&U>0?!0:U==="max-content"?!1:ke},[mt,oe==null?void 0:oe.x,ke]),fn=i.useMemo(()=>yt?mt!==void 0?mt?!0:"max-content":(oe==null?void 0:oe.x)!==void 0?oe.x:"max-content":oe==null?void 0:oe.x,[yt,mt,oe==null?void 0:oe.x,ke]),Et=i.useMemo(()=>{const U=[];He&&U.push({title:"序号",key:"rowIndex",width:60,align:"center",render:(Me,Ce,je)=>{const we=le.current||1,Pe=le.pageSize||10;return(we-1)*Pe+je+1}});const ge=new Map(me.map(Me=>[String(Me.key??Me.dataIndex??""),Me]));if(ft.filter(Me=>Me.visible).forEach(Me=>{const Ce=ge.get(Me.key);if(!Ce)return;const je=Me.fixed||void 0,we=Me.width==="auto"||Me.width===void 0?void 0:Me.width;U.push(oi({...Ce,dataIndex:Ce.dataIndex||Ce.key,fixed:je||Ce.fixed,width:we??Ce.width},{runAction:ce,onCellValueChange:J}))}),p!==!1&&ee.length>0){const{useCompact:Me,actionSettings:Ce}=ve,je=we=>{const Pe=we==null?void 0:we.key;return Pe?Ce[Pe]:void 0};U.push({title:"操作",key:"action",render:(we,Pe)=>{const Le=ee.map((Be,ht)=>({action:Be,idx:ht})).filter(({action:Be})=>di(Pe,Be.visibleExpression));return Le.length===0?null:Me?u.jsx(F.Space.Compact,{children:Le.map(({action:Be,idx:ht})=>{const gt=je(Be);return u.jsx(F.Tooltip,{title:Be.tooltip,children:u.jsx(F.Button,{size:"small",onClick:()=>X(Be,Pe),styles:gt==null?void 0:gt.styles,classNames:gt==null?void 0:gt.classNames,children:Be.title})},Be.key??ht)})}):u.jsx(F.Space,{children:Le.map(({action:Be,idx:ht})=>u.jsx(F.Tooltip,{title:Be.tooltip,children:u.jsx("a",{onClick:()=>X(Be,Pe),style:{marginRight:5},children:Be.title})},Be.key??ht))})}})}return U},[me,ee,He,ft,p,ve,le,X,ce,J]),fr=i.useCallback(()=>{W.columnSettingOpen&&z(W.columnSettingOpen,"",!1)},[W.columnSettingOpen,z]),mr=i.useCallback(U=>{W.columnSettings&&z(W.columnSettings,"value",U)},[W.columnSettings,z]),yr=i.useMemo(()=>{if(!v&&x)return{selectedRowKeys:q,onChange:(U,ge,De)=>{G(U),W.selected&&z(W.selected,"",U),f!=null&&f.trim()&&n&&R(n,se(f.trim(),{selectedRowKeys:U,selectedRows:ge,info:De}))}}},[x,v,q,W.selected,z,f,n,R]),mn=i.useCallback(U=>{if(!v)return;const De=[U[m]];G(De),W.selected&&z(W.selected,"",De),f!=null&&f.trim()&&n&&R(n,se(f.trim(),{record:U,selectedRowKeys:De}))},[v,f,n,m,W.selected,z,R]),hr=i.useCallback(U=>v&&q.includes(U[m])?"ant-table-row-selected":"",[v,m,q]),gr=i.useCallback(U=>v?{onClick:()=>mn(U),style:{cursor:"pointer"}}:{},[v,mn]),pr=i.useMemo(()=>{if(!oe&&!yt)return;const U=fn,ge=(oe==null?void 0:oe.y)==="100%"?ae:oe==null?void 0:oe.y;return U!==void 0||ge!==void 0?{x:U,y:ge}:oe?oe.y==="100%"?{x:oe.x,y:ae}:oe:void 0},[oe,ae,yt,fn]),{titleSlot:_t,summarySlot:Ot,footerSlot:yn,otherChildren:vr}=i.useMemo(()=>{let U=null,ge=null,De=null;const Me=[];return i.Children.forEach(B,Ce=>{if(!i.isValidElement(Ce)){Me.push(Ce);return}const je=Ce.props["data-slot-type"];je==="title"?U=Ce:je==="summary"?ge=Ce:je==="footer"?De=Ce:Me.push(Ce)}),{titleSlot:U,summarySlot:ge,footerSlot:De,otherChildren:Me}},[B]),br=i.useMemo(()=>{if(!_t){if(E)return E;if(D&&s)return()=>u.jsx("div",{"data-table-slot-container":"title",style:{minHeight:20}})}},[D,_t,E,s]),xr=i.useMemo(()=>{if(T)return T;if(j&&Ot)return()=>u.jsx("tr",{children:u.jsx("td",{colSpan:Et.length,style:{padding:0},children:Ot})});if(j&&s)return()=>u.jsx("tr",{children:u.jsx("td",{colSpan:Et.length,style:{padding:0},children:u.jsx("div",{"data-table-slot-container":"summary",style:{minHeight:20}})})})},[j,Ot,T,Et.length,s]),Sr=yt?dn:S,hn=u.jsx(F.Table,{...Q,columns:Et,dataSource:Ee,rowKey:m,rowSelection:yr,rowClassName:hr,pagination:Y,locale:{emptyText:w},bordered:M,size:Sr,sticky:A,scroll:pr,title:br,summary:xr,footer:void 0,onRow:gr});return u.jsxs(F.Flex,{ref:ie,vertical:!0,style:{width:"100%",height:"100%",...te},className:ye,children:[_t&&u.jsx("div",{"data-table-slot":"title",children:_t}),u.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[v&&(()=>{const U=(Se==null?void 0:Se.rowSelectedBg)||"#e6f4ff",ge=(Se==null?void 0:Se.rowSelectedHoverBg)||(Se==null?void 0:Se.rowSelectedBg)||"#bae0ff",De=Se==null?void 0:Se.rowSelectedColor,Me=(Se==null?void 0:Se.rowSelectedLinkColor)??De,Ce=(Se==null?void 0:Se.rowSelectedLinkHoverColor)??Me;return u.jsx("style",{children:`
12
+ `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),s=new RegExp("(?:^"+n+"$)|(?:^"+r+"$)"),a=new RegExp("^"+n+"$"),c=new RegExp("^"+r+"$"),l=function(j){return j&&j.exact?s:new RegExp("(?:"+e(j)+n+e(j)+")|(?:"+e(j)+r+e(j)+")","g")};l.v4=function(b){return b&&b.exact?a:new RegExp(""+e(b)+n+e(b),"g")},l.v6=function(b){return b&&b.exact?c:new RegExp(""+e(b)+r+e(b),"g")};var y="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",p=l.v4().source,g=l.v6().source,C="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",v="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",f="(?::\\d{2,5})?",d='(?:[/?#][^\\s"]*)?',x="(?:"+y+"|www\\.)"+h+"(?:localhost|"+p+"|"+g+"|"+C+v+m+")"+f+d;return Vt=new RegExp("(?:^"+x+"$)","i"),Vt},Mn={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},wt={integer:function(e){return wt.number(e)&&parseInt(e,10)===e},float:function(e){return wt.number(e)&&!wt.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!wt.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(Mn.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Xr())},hex:function(e){return typeof e=="string"&&!!e.match(Mn.hex)}},eo=function(e,n,o,r,s){if(e.required&&n===void 0){Jn(e,n,o,r,s);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],c=e.type;a.indexOf(c)>-1?wt[c](n)||r.push(Ge(s.messages.types[c],e.fullField,e.type)):c&&typeof n!==e.type&&r.push(Ge(s.messages.types[c],e.fullField,e.type))},to=function(e,n,o,r,s){var a=typeof e.len=="number",c=typeof e.min=="number",l=typeof e.max=="number",y=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,h=n,p=null,g=typeof n=="number",C=typeof n=="string",v=Array.isArray(n);if(g?p="number":C?p="string":v&&(p="array"),!p)return!1;v&&(h=n.length),C&&(h=n.replace(y,"_").length),a?h!==e.len&&r.push(Ge(s.messages[p].len,e.fullField,e.len)):c&&!l&&h<e.min?r.push(Ge(s.messages[p].min,e.fullField,e.min)):l&&!c&&h>e.max?r.push(Ge(s.messages[p].max,e.fullField,e.max)):c&&l&&(h<e.min||h>e.max)&&r.push(Ge(s.messages[p].range,e.fullField,e.min,e.max))},pt="enum",no=function(e,n,o,r,s){e[pt]=Array.isArray(e[pt])?e[pt]:[],e[pt].indexOf(n)===-1&&r.push(Ge(s.messages[pt],e.fullField,e[pt].join(", ")))},ro=function(e,n,o,r,s){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||r.push(Ge(s.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var a=new RegExp(e.pattern);a.test(n)||r.push(Ge(s.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},Ae={required:Jn,whitespace:Zr,type:eo,range:to,enum:no,pattern:ro},oo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n,"string")&&!e.required)return o();Ae.required(e,n,r,a,s,"string"),Fe(n,"string")||(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s),Ae.pattern(e,n,r,a,s),e.whitespace===!0&&Ae.whitespace(e,n,r,a,s))}o(a)},so=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae.type(e,n,r,a,s)}o(a)},io=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(n===""&&(n=void 0),Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},ao=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae.type(e,n,r,a,s)}o(a)},co=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),Fe(n)||Ae.type(e,n,r,a,s)}o(a)},lo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},uo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},fo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(n==null&&!e.required)return o();Ae.required(e,n,r,a,s,"array"),n!=null&&(Ae.type(e,n,r,a,s),Ae.range(e,n,r,a,s))}o(a)},mo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae.type(e,n,r,a,s)}o(a)},yo="enum",ho=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s),n!==void 0&&Ae[yo](e,n,r,a,s)}o(a)},go=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n,"string")&&!e.required)return o();Ae.required(e,n,r,a,s),Fe(n,"string")||Ae.pattern(e,n,r,a,s)}o(a)},po=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n,"date")&&!e.required)return o();if(Ae.required(e,n,r,a,s),!Fe(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),Ae.type(e,l,r,a,s),l&&Ae.range(e,l.getTime(),r,a,s)}}o(a)},vo=function(e,n,o,r,s){var a=[],c=Array.isArray(n)?"array":typeof n;Ae.required(e,n,r,a,s,c),o(a)},Yt=function(e,n,o,r,s){var a=e.type,c=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Fe(n,a)&&!e.required)return o();Ae.required(e,n,r,c,s,a),Fe(n,a)||Ae.type(e,n,r,c,s)}o(c)},bo=function(e,n,o,r,s){var a=[],c=e.required||!e.required&&r.hasOwnProperty(e.field);if(c){if(Fe(n)&&!e.required)return o();Ae.required(e,n,r,a,s)}o(a)},kt={string:oo,method:so,number:io,boolean:ao,regexp:co,integer:lo,float:uo,array:fo,object:mo,enum:ho,pattern:go,date:po,url:Yt,hex:Yt,email:Yt,required:vo,any:bo};function nn(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var rn=nn(),Tt=function(){function t(n){this.rules=null,this._messages=rn,this.define(n)}var e=t.prototype;return e.define=function(o){var r=this;if(!o)throw new Error("Cannot configure a schema with no rules");if(typeof o!="object"||Array.isArray(o))throw new Error("Rules must be an object");this.rules={},Object.keys(o).forEach(function(s){var a=o[s];r.rules[s]=Array.isArray(a)?a:[a]})},e.messages=function(o){return o&&(this._messages=Cn(nn(),o)),this._messages},e.validate=function(o,r,s){var a=this;r===void 0&&(r={}),s===void 0&&(s=function(){});var c=o,l=r,y=s;if(typeof l=="function"&&(y=l,l={}),!this.rules||Object.keys(this.rules).length===0)return y&&y(null,c),Promise.resolve(c);function h(m){var f=[],d={};function x(j){if(Array.isArray(j)){var M;f=(M=f).concat.apply(M,j)}else f.push(j)}for(var b=0;b<m.length;b++)x(m[b]);f.length?(d=tn(f),y(f,d)):y(null,c)}if(l.messages){var p=this.messages();p===rn&&(p=nn()),Cn(p,l.messages),l.messages=p}else l.messages=this.messages();var g={},C=l.keys||Object.keys(this.rules);C.forEach(function(m){var f=a.rules[m],d=c[m];f.forEach(function(x){var b=x;typeof b.transform=="function"&&(c===o&&(c=ut({},c)),d=c[m]=b.transform(d)),typeof b=="function"?b={validator:b}:b=ut({},b),b.validator=a.getValidationMethod(b),b.validator&&(b.field=m,b.fullField=b.fullField||m,b.type=a.getType(b),g[m]=g[m]||[],g[m].push({rule:b,value:d,source:c,field:m}))})});var v={};return Gr(g,l,function(m,f){var d=m.rule,x=(d.type==="object"||d.type==="array")&&(typeof d.fields=="object"||typeof d.defaultField=="object");x=x&&(d.required||!d.required&&m.value),d.field=m.field;function b(S,A){return ut({},A,{fullField:d.fullField+"."+S,fullFields:d.fullFields?[].concat(d.fullFields,[S]):[S]})}function j(S){S===void 0&&(S=[]);var A=Array.isArray(S)?S:[S];!l.suppressWarning&&A.length&&t.warning("async-validator:",A),A.length&&d.message!==void 0&&(A=[].concat(d.message));var k=A.map(Sn(d,c));if(l.first&&k.length)return v[d.field]=1,f(k);if(!x)f(k);else{if(d.required&&!m.value)return d.message!==void 0?k=[].concat(d.message).map(Sn(d,c)):l.error&&(k=[l.error(d,Ge(l.messages.required,d.field))]),f(k);var $={};d.defaultField&&Object.keys(m.value).map(function(N){$[N]=d.defaultField}),$=ut({},$,m.rule.fields);var D={};Object.keys($).forEach(function(N){var E=$[N],T=Array.isArray(E)?E:[E];D[N]=T.map(b.bind(null,N))});var w=new t(D);w.messages(l.messages),m.rule.options&&(m.rule.options.messages=l.messages,m.rule.options.error=l.error),w.validate(m.value,m.rule.options||l,function(N){var E=[];k&&k.length&&E.push.apply(E,k),N&&N.length&&E.push.apply(E,N),f(E.length?E:null)})}}var M;if(d.asyncValidator)M=d.asyncValidator(d,m.value,j,m.source,l);else if(d.validator){try{M=d.validator(d,m.value,j,m.source,l)}catch(S){console.error==null||console.error(S),l.suppressValidatorError||setTimeout(function(){throw S},0),j(S.message)}M===!0?j():M===!1?j(typeof d.message=="function"?d.message(d.fullField||d.field):d.message||(d.fullField||d.field)+" fails"):M instanceof Array?j(M):M instanceof Error&&j(M.message)}M&&M.then&&M.then(function(){return j()},function(S){return j(S)})},function(m){h(m)},c)},e.getType=function(o){if(o.type===void 0&&o.pattern instanceof RegExp&&(o.type="pattern"),typeof o.validator!="function"&&o.type&&!kt.hasOwnProperty(o.type))throw new Error(Ge("Unknown rule type %s",o.type));return o.type||"string"},e.getValidationMethod=function(o){if(typeof o.validator=="function")return o.validator;var r=Object.keys(o),s=r.indexOf("message");return s!==-1&&r.splice(s,1),r.length===1&&r[0]==="required"?kt.required:kt[this.getType(o)]||void 0},t}();Tt.register=function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");kt[e]=n};Tt.warning=Gn;Tt.messages=rn;Tt.validators=kt;function xo(t){if(!t||typeof t!="string")return null;try{let e=t.trim();return e.startsWith("/")&&e.endsWith("/")&&(e=e.slice(1,-1)),new RegExp(e)}catch{return null}}function cn(t){return!t||!Array.isArray(t)?[]:t.map(e=>{const n={...e};if(n.pattern&&typeof n.pattern=="string"&&n.pattern.trim()){const o=xo(n.pattern);o?n.pattern=o:delete n.pattern}return n})}const An="_v";function ln(t,e,n,o){if(!(t!=null&&t.length)){n();return}const r={[An]:t};new Tt(r).validate({[An]:e},{first:!0}).then(()=>{n()}).catch(({errors:a})=>{o(a||[])})}function Ie(t){const{rules:e,dataSet:n,dataSetField:o,sessionId:r,id:s,develop:a}=t,c=O(M=>M.setValidateResult),l=O(M=>M.getProps),y=O(M=>M.setProps),h=i.useMemo(()=>bt(r,n),[r,n]),p=O(M=>{var S;return h&&o?((S=M.validateStore[h])==null?void 0:S[o])??"":""}),g=O(M=>{var S;return r&&s?((S=M.propsStore[`${r}_props`])==null?void 0:S[s])??null:null}),C=O(M=>M.getDataSet),v=i.useMemo(()=>de(r,n),[r,n]),m=i.useMemo(()=>n?de(r,`${n}_validateAction`):void 0,[r,n]),f=O(M=>{var S;return m?(S=M.dataSets[m])==null?void 0:S.validate:void 0}),d=i.useCallback(M=>{const S=M??"";if(r&&n&&o&&c(r,n,o,S),r&&s){const A=l(r,s)||{};y(r,s,{...A,validateStatus:S?"error":void 0,help:S})}},[r,n,o,s,c,l,y]),x=i.useCallback(M=>{const S=cn(e||[]);ln(S,M,()=>d(""),A=>{var k;return d(((k=A[0])==null?void 0:k.message)??"")})},[e,d]),b=a?void 0:r&&n&&o?p:(g==null?void 0:g.help)??"",j=!a&&b?"error":void 0;return i.useEffect(()=>{if(f==null||!v||!o)return;const M=C(v,o);x(M)},[f,v,o,C,x]),{validate:x,help:b,validateStatus:j}}function un(t){if(!t)return[];const e=[];let n=t;for(;n;)e.push(n),n=n.parentContext??null;return e.reverse()}const So=un;function Co(t){if(!t)return"";const e=t.parentIndex??t.index;return e===void 0||!Number.isFinite(Number(e))?"":`items_${e}_`}const Mo=["value","validateStatus","help"];function Ye(t,e,n){const o=(n==null?void 0:n.skipKeys)??Mo,r={...t};return!e||typeof e!="object"||Object.keys(e).forEach(s=>{if(o.includes(s))return;const a=e[s];a!=null&&(r[s]=a)}),r}function ct(t,e,n){if(t==null||t==="")return null;const o=un(e),r=o.length>0?o[o.length-1]:void 0,s=r&&typeof r.parentIndex=="number"?r.parentIndex:void 0,a=r&&typeof r.index=="number"?r.index:void 0;if(s!==void 0&&Number.isFinite(s)&&a!==void 0&&Number.isFinite(a))return s!==a?`${String(t)}_${s}_${a}`:`${String(t)}_${s}`;if(o.length>=2){const l=o.map(y=>y.index).filter(y=>typeof y=="number"&&Number.isFinite(y));if(l.length>=2)return`${String(t)}_${l.join("_")}`}const c=s!==void 0&&Number.isFinite(s)?s:a!==void 0&&Number.isFinite(a)?a:typeof n=="number"?n:void 0;return c!==void 0&&Number.isFinite(c)?`${String(t)}_${c}`:String(t)}function Ze(t){return typeof t=="string"&&t.trim()!==""}function Ao(t,e){return t==="config.cells"&&e.startsWith("config.content.")?`config.${e.slice(15)}`:e}function jn(t){return Ze(t)&&t.trim().startsWith("[")}function wn(t){return Ze(t)&&/^items\[\d+\]/.test(t.trim())}function Qn(t,e,n,o){const r=n??(o==null?void 0:o.sessionId);if(Ze(t))return{dataSet:t,dataSetField:e,sessionId:r};if(!o)return{dataSet:t,dataSetField:e,sessionId:r};const s=typeof o.index=="number"?o.index:void 0,a=typeof o.parentIndex=="number"?o.parentIndex:void 0,c=o.dataSet,l=o.dataSetFieldRoot;if(Ze(e)){const y=Ao(l,e.trim());if(y.startsWith("["))return{dataSet:c,dataSetField:Ze(l)?`${l}${y}`:y,sessionId:r};if(typeof a=="number"&&typeof s=="number"&&Ze(l)&&!jn(l)&&!wn(l))return{dataSet:c,dataSetField:`[${a}].${l}[${s}].${y}`,sessionId:r};if(typeof s=="number")return Ze(l)?{dataSet:c,dataSetField:`${l}[${s}].${y}`,sessionId:r}:{dataSet:c,dataSetField:`[${s}].${y}`,sessionId:r};const h=Ze(l)?`${l}.${y}`:y;return{dataSet:c,dataSetField:h,sessionId:r}}return typeof a=="number"&&typeof s=="number"&&Ze(l)&&!jn(l)&&!wn(l)?{dataSet:c,dataSetField:`[${a}].${l}[${s}]`,sessionId:r}:typeof s=="number"&&Ze(l)?{dataSet:c,dataSetField:`${l}[${s}]`,sessionId:r}:typeof s=="number"?{dataSet:c,dataSetField:`[${s}]`,sessionId:r}:{dataSet:c,dataSetField:Ze(l)?l:e,sessionId:r}}const We=i.createContext(null);function tt(t,e,n){const o=i.useContext(We);return i.useMemo(()=>Qn(t,e,n,o),[o,t,e,n])}function Zn(t,e){return t===e?!0:String(t??"")===String(e??"")}function et(t,e){if(Array.isArray(t))return t.find(n=>Zn(n.value,e))}let Je={};function jo(t){Je={...Je,...t}}function Ue(){return Je}async function it(t){if(Je.request){const e={...t,baseURL:t.baseURL||Je.baseURL};return Je.request(e)}throw new Error("Request handler not configured. Please call setCoreConfig() first.")}async function zt(t,e){if(Je.upload)return Je.upload(t,e);throw new Error("Upload handler not configured. Please call setCoreConfig() first.")}async function Kt(t){return Je.getDictOptions?Je.getDictOptions(t):(console.warn("Dict service not configured. Please call setCoreConfig() with getDictOptions."),[])}function Nt(){return Je.getAccessToken?Je.getAccessToken():null}const wo={post:(t,e,n)=>it({url:t,data:e,method:"POST",...n}),get:(t,e,n)=>it({url:t,params:e,method:"GET",...n})};function Xn(){const t=Ue(),e=i.useCallback(async(l,y)=>{const h=typeof l=="string"?{url:l,...y}:l;return it(h)},[]),n=i.useCallback(async(l,y,h)=>it({url:l,params:y,method:"GET",...h}),[]),o=i.useCallback(async(l,y,h)=>it({url:l,data:y,method:"POST",...h}),[]),r=i.useCallback(async l=>Kt(l),[]),s=i.useCallback(async(l,y)=>zt(l,y),[]),a=i.useCallback(()=>Nt(),[]),c=i.useCallback(()=>!!t.request,[t.request]);return{request:e,get:n,post:o,getDictOptions:r,upload:s,getAccessToken:a,isConfigured:c,baseURL:t.baseURL}}function St(t){const[e,n]=i.useState([]),[o,r]=i.useState(!1),[s,a]=i.useState(null);return i.useEffect(()=>{if(!t){n([]);return}let c=!1;return r(!0),a(null),Kt(t).then(l=>{c||n(l)}).catch(l=>{c||(a(l),console.error(`Failed to load dict: ${t}`,l))}).finally(()=>{c||r(!1)}),()=>{c=!0}},[t]),{options:e,loading:o,error:s}}function qt(t,e){const[n,o]=i.useState([]),[r,s]=i.useState(!1),[a,c]=i.useState(null),{labelKey:l="label",valueKey:y="value",immediate:h=!0,field:p}=e||{},g=JSON.stringify((e==null?void 0:e.params)??null),C=i.useMemo(()=>(e==null?void 0:e.params)!=null?JSON.parse(g):void 0,[g]),v=i.useCallback(f=>Array.isArray(f)?f.map(d=>({label:d[l],value:d[y]})):[],[l,y]),m=i.useCallback(async()=>{if(t){s(!0),c(null);try{const f=await it({url:t,method:"GET",...C!=null&&Object.keys(C).length>0?{params:C}:{}}),d=(f==null?void 0:f.data)!=null?f.data:f;let x=[];p!=null&&p!==""?x=Array.isArray(d==null?void 0:d[p])?d[p]:[]:Array.isArray(d)?x=d:d!=null&&typeof d=="object"&&(x=(d==null?void 0:d.list)??(d==null?void 0:d.records)??[]),o(v(x))}catch(f){c(f),console.error(`Failed to load remote options: ${t}`,f)}finally{s(!1)}}},[t,C,v,p]);return i.useEffect(()=>{h&&t&&m()},[h,t,m]),{options:n,loading:r,error:a,reload:m}}const Ct=t=>{if(t==null||t==="")return 0;const e=Number(t);return isNaN(e)||!isFinite(e)?0:e},Le=t=>t==null?"":String(t),Wt=t=>{if(t==null)return null;let e;if(t instanceof Date)e=t;else if(typeof t=="number"){const n=t.toString().length===10?t*1e3:t;if(n<0||n>864e13)return null;e=new Date(n)}else e=new Date(t);return isNaN(e.getTime())?null:e},ko=(t,e="CNY",n={})=>{try{const o=Ct(t),r=/^[A-Z]{3}$/.test(e)?e:"CNY";return new Intl.NumberFormat("zh-CN",{style:"currency",currency:r,...n}).format(o)}catch{return""}},Do=(t,e={})=>{try{const n=Ct(t);return new Intl.NumberFormat("zh-CN",{minimumFractionDigits:0,maximumFractionDigits:2,...e}).format(n)}catch{return""}},No=(t,e=2)=>{try{const n=Ct(t),o=Math.max(0,Math.min(20,Math.floor(e)));return new Intl.NumberFormat("zh-CN",{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o}).format(n)}catch{return""}},To=(t,e="compact")=>{try{const n=Ct(t);return new Intl.NumberFormat("zh-CN",{notation:e,compactDisplay:"short"}).format(n)}catch{return""}},Eo=(t,e={})=>{try{const n=Wt(t);return n?new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",...e}).format(n):""}catch{return""}},er=(t,e="YYYY-MM-DD")=>{try{const n=Wt(t);if(!n)return"";const o=n.getFullYear(),r=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0"),a=String(n.getHours()).padStart(2,"0"),c=String(n.getMinutes()).padStart(2,"0"),l=String(n.getSeconds()).padStart(2,"0");return e.replace("YYYY",String(o)).replace("MM",r).replace("DD",s).replace("HH",a).replace("mm",c).replace("ss",l)}catch{return""}},_o=(t,e="YYYY-MM-DD HH:mm:ss")=>er(t,e),Oo=t=>{try{const e=Wt(t);if(!e)return"";const o=new Date().getTime()-e.getTime(),r=Math.floor(o/1e3),s=Math.floor(r/60),a=Math.floor(s/60),c=Math.floor(a/24),l=Math.floor(c/30),y=Math.floor(c/365);return r<60?"刚刚":s<60?`${s}分钟前`:a<24?`${a}小时前`:c<30?`${c}天前`:l<12?`${l}个月前`:`${y}年前`}catch{return""}},Ro=t=>{try{const e=Math.floor(Ct(t));if(e<0||e>31536e3)return"";const n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=e%60,s=[];return n>0&&s.push(`${n}小时`),o>0&&s.push(`${o}分钟`),(r>0||s.length===0)&&s.push(`${r}秒`),s.join("")}catch{return""}},$o=t=>{try{const e=Wt(t);if(!e)return"";const n=new Date;if(e>n)return"";let o=n.getFullYear()-e.getFullYear();const r=n.getMonth()-e.getMonth();return(r<0||r===0&&n.getDate()<e.getDate())&&o--,o<0||o>150?"":`${o}岁`}catch{return""}},Bo=(t,e=2,n=!0)=>{try{const o=Ct(t);if(o<0||o>Number.MAX_SAFE_INTEGER)return"";if(o===0)return"0 B";const r=Math.max(0,Math.min(10,Math.floor(e))),s=n?1024:1e3,a=n?["B","KiB","MiB","GiB","TiB","PiB"]:["B","KB","MB","GB","TB","PB"],c=Math.min(Math.floor(Math.log(o)/Math.log(s)),a.length-1);return`${parseFloat((o/Math.pow(s,c)).toFixed(r))} ${a[c]}`}catch{return""}},Vo=(t,e="CN")=>{try{const n=Le(t).replace(/\D/g,"");return n?e==="CN"&&n.length===11&&/^1[3-9]\d{9}$/.test(n)?n.replace(/(\d{3})(\d{4})(\d{4})/,"$1 $2 $3"):e==="US"&&n.length===10?n.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):Le(t):""}catch{return""}},Lo=t=>{try{const e=Le(t).replace(/\D/g,"");return e.length===11?e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):Le(t)}catch{return""}},Fo=t=>{try{const e=Le(t);if(!e||!e.includes("@"))return"";const[n,o]=e.split("@");return n.length<=1?e:n.length<=3?`${n[0]}*@${o}`:`${n[0]+"*".repeat(n.length-2)+n[n.length-1]}@${o}`}catch{return""}},Po=(t,e=!0)=>{try{const n=Le(t).replace(/\s/g,"");return n.length===18&&/^\d{17}[\dXx]$/.test(n)?e?n.replace(/(\d{6})\d{8}(\d{3}[\dXx])/,"$1********$2"):n.replace(/(\d{6})(\d{8})(\d{4})/,"$1 $2 $3"):""}catch{return""}},zo=(t,e=!0)=>{try{const n=Le(t).replace(/\s/g,"");if(!/^\d{13,19}$/.test(n))return"";if(e&&n.length>=8){const o=n.slice(0,4),r=n.slice(-4),s=n.length-8,a="*".repeat(s);return(o+a+r).replace(/(.{4})/g,"$1 ").trim()}return n.replace(/(.{4})/g,"$1 ").trim()}catch{return""}},Ko=t=>{try{const e=Le(t);return e.length<=1?e:e.length===2?e[0]+"*":e[0]+"*".repeat(e.length-2)+e[e.length-1]}catch{return""}},qo=(t,e=50,n="...")=>{try{const o=Le(t),r=Math.max(1,Math.min(1e3,Math.floor(e)));return o.length<=r?o:o.slice(0,r)+n}catch{return""}},Wo=t=>{try{const e=Le(t);return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}catch{return""}},Io=(t,e=", ")=>{try{return Array.isArray(t)?t.join(e):Le(t)}catch{return""}},Yo=t=>({0:"女",1:"男",2:"未知",male:"男",female:"女",m:"男",f:"女",M:"男",F:"女"})[Le(t)]||Le(t),Ho=(t,e)=>e?e[Le(t)]||Le(t):{0:"禁用",1:"启用",true:"是",false:"否"}[Le(t)]||Le(t),Uo=t=>{try{return Le(t).replace(/<[^>]*>/g,"")}catch{return""}};function tr(t,e,n={}){if(!e||t===void 0||t===null)return Le(t);switch(e){case"currency":return ko(t,n.currency,n);case"number":return Do(t,n);case"percent":return No(t,n.precision);case"compact":return To(t,n.notation);case"timestamp":return _o(t,n.pattern);case"date":return Eo(t,n);case"dateCustom":return er(t,n.pattern);case"relativeTime":return Oo(t);case"duration":return Ro(t);case"age":return $o(t);case"fileSize":return Bo(t,n.precision,n.binary);case"phone":return Vo(t,n.country);case"phoneMask":return Lo(t);case"emailMask":return Fo(t);case"idCard":return Po(t,n.mask);case"bankCard":return zo(t,n.mask);case"usernameMask":return Ko(t);case"truncate":return qo(t,n.maxLength,n.suffix);case"capitalize":return Wo(t);case"array":return Io(t,n.delimiter);case"gender":return Yo(t);case"status":return Ho(t,n.statusMap);case"stripHtml":return Uo(t);default:return Le(t)}}const It={colorPrimary:"colorPrimary",colorSuccess:"colorSuccess",colorWarning:"colorWarning",colorError:"colorError",colorInfo:"colorInfo",colorText:"colorText",colorTextSecondary:"colorTextSecondary",colorTextTertiary:"colorTextTertiary",colorTextQuaternary:"colorTextQuaternary",colorTextBase:"colorTextBase",colorBgBase:"colorBgBase",colorBgContainer:"colorBgContainer",colorBgElevated:"colorBgElevated",colorBgLayout:"colorBgLayout",colorBgSpotlight:"colorBgSpotlight",colorBorder:"colorBorder",colorBorderSecondary:"colorBorderSecondary",colorFill:"colorFill",colorFillSecondary:"colorFillSecondary",colorFillTertiary:"colorFillTertiary",colorFillQuaternary:"colorFillQuaternary",colorLink:"colorLink",colorLinkHover:"colorLinkHover",colorLinkActive:"colorLinkActive"},Go=Object.keys(It),Jo=[{label:"主色",value:"colorPrimary"},{label:"成功",value:"colorSuccess"},{label:"警告",value:"colorWarning"},{label:"错误",value:"colorError"},{label:"信息",value:"colorInfo"},{label:"文本",value:"colorText"},{label:"次级文本",value:"colorTextSecondary"},{label:"链接",value:"colorLink"}];function dn(t){return It.hasOwnProperty(t)}function Et(t){const{token:e}=V.theme.useToken();if(t){if(dn(t)){const n=It[t];return e[n]||t}return t}}function Qo(t,e){if(t){if(dn(t)){const n=It[t];return e[n]||t}return t}}const Zo=({id:t,text:e,tooltip:n,iconName:o,clickAction:r,sessionId:s,develop:a,onClick:c,children:l,index:y,dataSet:h,dataSetField:p,token:g,...C})=>{const v=O(P=>P.addCommand),m=i.useContext(We),f=y??(m==null?void 0:m.index),d=m==null?void 0:m.parentIndex,x=O(P=>{var R;return s&&t?(R=P.propsStore[`${s}_props`])==null?void 0:R[t]:null}),b=i.useMemo(()=>{const P={...C};return x&&typeof x=="object"&&Object.keys(x).forEach(R=>{x[R]!==void 0&&x[R]!==null&&(P[R]=x[R])}),a&&(P.disabled=!1),P},[C,x,a]),j=i.useMemo(()=>{const P=(x==null?void 0:x.iconName)||o;return P&&Xe[P]?Xe[P]:null},[o,x==null?void 0:x.iconName]),M=i.useCallback(P=>{if(c){c(P);return}if(r&&s){const{actionName:R,arg:F}=an(r,{id:t,index:f,parentIndex:d,dataSet:h,dataSetField:p,...b}),K=se(R,F);v(s,K)}},[r,s,t,f,h,p,d,b,v,c]),S=(x==null?void 0:x.text)||e,A=(x==null?void 0:x.tooltip)??n,k=i.useMemo(()=>{const P=x==null?void 0:x.token,R={...g,...P};if(!R||Object.keys(R).length===0)return;const F={};return Object.entries(R).forEach(([K,q])=>{q!==""&&q!==void 0&&q!==null&&(F[K]=q)}),Object.keys(F).length>0?F:void 0},[g,x==null?void 0:x.token]),$=i.useMemo(()=>k?{components:{Button:k}}:void 0,[k]),{iconPosition:D,iconPlacement:w,clickAction:N,tooltip:E,token:T,...z}=b,B=w||D,L=!!(z!=null&&z.block),_=u.jsx(V.Button,{...z,iconPlacement:B,icon:j?u.jsx(j,{}):void 0,onClick:M,children:S||l}),I=A?u.jsx(V.Tooltip,{title:A,children:u.jsx("span",{style:{display:L?"block":"inline-block",width:L?"100%":void 0},children:_})}):_;return $?u.jsx(V.ConfigProvider,{theme:$,children:I}):I},nt={whiteSpace:"nowrap",flex:"none"};function Xo(t){const e=typeof t=="string"?t.trim():"";if(!e)return;const n=Xe[e];if(n)return i.createElement(n)}function rt({iconName:t,label:e}){const n=typeof t=="string"?t.trim():"",o=e==null?"":typeof e=="string"?e.trim():String(e).trim();return n?{iconConfigured:!0,iconNode:Xo(n)??n,labelText:o||void 0}:{iconConfigured:!1,iconNode:void 0,labelText:o||void 0}}const es=["value","validateStatus","help"],ts=200;function ns(t){if(!t)return;const e={};return Object.entries(t).forEach(([n,o])=>{o!==""&&o!==void 0&&o!==null&&(e[n]=o)}),Object.keys(e).length>0?e:void 0}function rs(t,e,n){const o={...t};if(e&&typeof e=="object"&&Object.keys(e).forEach(r=>{!es.includes(r)&&e[r]!==void 0&&e[r]!==null&&(o[r]=e[r])}),n.develop){const r=o.disabled;o.disabled=!1,o.readOnly=!0,r&&(o.className=`${o.className||""} ant-input-disabled`.trim())}return o}const nr=t=>{const{id:e,sessionId:n,develop:o,dataSet:r,dataSetField:s,index:a,changeAction:c,onChange:l,value:y,styles:h,token:p,rules:g,validateOnChange:C,validateOnBlur:v,focusAction:m,blurAction:f,pressEnterAction:d,clearAction:x,bordered:b,...j}=t,M=tt(r,s,n),S=M.dataSet,A=M.dataSetField,k=M.sessionId,$=i.useContext(We),D=a??($==null?void 0:$.index),w=$==null?void 0:$.parentIndex,N=i.useRef(""),E=i.useRef(null),T=O(re=>re.addCommand),z=O(re=>re.getDataSet),B=O(re=>re.setDataSet),L=O(re=>re.getProps),_=O(re=>re.setProps),I=O(re=>re.setValidateResult),P=i.useMemo(()=>de(k,S),[k,S]),R=i.useMemo(()=>k?ct(e,$,a):null,[k,e,$==null?void 0:$.parentIndex,$==null?void 0:$.index,a]),F=O(re=>{var le;return R?((le=re.propsStore[`${k}_props`])==null?void 0:le[R])??null:null}),K=i.useMemo(()=>bt(k,S),[k,S]),q=O(re=>{var le;return K&&A?((le=re.validateStore[K])==null?void 0:le[A])??"":""}),G=O(re=>P&&A?re.getDataSet(P,A):void 0),ie=i.useMemo(()=>S?de(k,`${S}_validateAction`):void 0,[k,S]),pe=O(re=>{var le;return ie?(le=re.dataSets[ie])==null?void 0:le.validate:void 0}),ne=i.useMemo(()=>G!==void 0?G:(F==null?void 0:F.value)!==void 0?F.value:y,[G,F==null?void 0:F.value,y]),ue=i.useMemo(()=>rs(j,F??null,{develop:o}),[j,F,o]),{prefixIconNode:fe,suffixIconNode:me,prefixAddonText:ee,suffixAddonText:W,inputMergedProps:te}=i.useMemo(()=>{const re=ue,le=re.prefix,Y=re.suffix,ae=re.addonBefore,H=re.addonAfter,{prefix:X,suffix:ve,addonBefore:ce,addonAfter:J,...he}=re,be=rt({iconName:le==null?void 0:String(le),label:ae==null?void 0:String(ae)}),ke=rt({iconName:Y==null?void 0:String(Y),label:H==null?void 0:String(H)});return{prefixIconNode:be.iconNode,suffixIconNode:ke.iconNode,prefixAddonText:be.iconConfigured?void 0:be.labelText,suffixAddonText:ke.iconConfigured?void 0:ke.labelText,inputMergedProps:he}},[ue]),ye=i.useCallback(re=>{const le=re??"";if(k&&S&&A&&I(k,S,A,le),k&&R){const Y=L(k,R)||{};_(k,R,{...Y,validateStatus:le?"error":void 0,help:le})}},[k,S,A,R,I,L,_]),Q=i.useCallback(re=>{const le=cn(g||[]);ln(le,re,()=>ye(""),Y=>{var ae;return ye(((ae=Y[0])==null?void 0:ae.message)??"")})},[g,ye]),oe=i.useCallback(re=>{const le=re.target.value;if(N.current=le,l){l(le,re);return}if(P&&A&&B(P,A,le),c&&k){const{actionName:Y,arg:ae}=Te(c,le,{id:e,dataSet:S,dataSetField:A,index:D,parentIndex:w,...te});T(k,se(Y,ae))}C&&(E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{E.current=null,Q(le)},ts))},[l,P,A,B,c,k,e,S,A,D,w,te,T,C,Q]),xe=i.useCallback(()=>{if(!v)return;const re=P&&A?String(z(P,A)??""):N.current;Q(re)},[v,P,A,z,Q]),Ne=i.useCallback(re=>{const Y=te.onPressEnter;if(Y){Y(re);return}if(d&&k){const{actionName:ae,arg:H}=Te(d,ne,{id:e,dataSet:S,dataSetField:A,index:D,parentIndex:w,...te});T(k,se(ae,H))}},[te,d,k,ne,e,S,A,D,w,T]),$e=i.useCallback(()=>{const le=te.onClear;if(le){le();return}if(x&&k){const{actionName:Y,arg:ae}=Te(x,"",{id:e,dataSet:S,dataSetField:A,index:D,parentIndex:w,...te});T(k,se(Y,ae))}},[te,x,k,e,S,A,D,w,T]);i.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]),i.useEffect(()=>{if(pe==null||!P||!A)return;const re=String(z(P,A)??"");Q(re)},[pe,P,A,z,Q]);const _e=i.useMemo(()=>ns(p),[p]),Ee=i.useMemo(()=>_e?{components:{Input:_e}}:void 0,[_e]),Se=o?void 0:k&&S&&A?q:(F==null?void 0:F.help)??"",Ke=!o&&Se?"error":void 0,Z=u.jsxs(u.Fragment,{children:[u.jsxs(V.Space.Compact,{style:{width:"100%"},children:[ee?u.jsx(V.Space.Addon,{style:nt,children:ee}):null,u.jsx(V.Input,{...te,prefix:fe,suffix:me,value:ne,onChange:oe,onBlur:xe,onPressEnter:Ne,onClear:$e,status:Ke,styles:h}),W?u.jsx(V.Space.Addon,{style:nt,children:W}):null]}),Se&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:Se})]});return Ee?u.jsx(V.ConfigProvider,{theme:Ee,children:Z}):Z};nr.displayName="AndInput";const rr=i.memo(nr),kn=200,or=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,pressEnterAction:y,clearAction:h,allowClear:p,stepAction:g,onChange:C,defaultValue:v,value:m,...f})=>{const d=tt(o,r,e),x=d.dataSet,b=d.dataSetField,j=d.sessionId,M=O(te=>te.addCommand),S=O(te=>te.setDataSet),A=i.useRef(null),k=i.useMemo(()=>de(j,x),[j,x]),$=O(te=>{var ye;return j&&t?((ye=te.propsStore[`${j}_props`])==null?void 0:ye[t])??null:null}),D=O(te=>k&&b?te.getDataSet(k,b):void 0),{validate:w,help:N}=Ie({rules:s,dataSet:x,dataSetField:b,sessionId:j,id:t,develop:n}),E=i.useMemo(()=>D!==void 0?D:($==null?void 0:$.value)!==void 0?$.value:m,[D,$==null?void 0:$.value,m]),T=i.useCallback((te,ye,Q)=>{te&&e&&M(e,se(te,{type:ye,value:Q}))},[e,M]),z=i.useCallback(te=>{if(C){C(te);return}k&&b&&S(k,b,te),c&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null,w(te)},kn)),T(l,"change",te)},[C,k,b,S,c,w,l,T]),B=i.useCallback(()=>{a&&w(E)},[a,w,E]),L=i.useCallback(te=>{if(f.onPressEnter){f.onPressEnter(te);return}if(y&&j){const{actionName:ye,arg:Q}=Te(y,E,{id:t,dataSet:x,dataSetField:b});M(j,se(ye,Q))}},[f.onPressEnter,y,j,E,t,x,b,M]),_=i.useCallback(()=>{if(C){C(null);return}if(k&&b&&S(k,b,null),c&&(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{A.current=null,w(null)},kn)),T(l,"change",null),h&&j){const{actionName:te,arg:ye}=Te(h,null,{id:t,dataSet:x,dataSetField:b});M(j,se(te,ye))}},[C,k,b,S,c,w,T,l,h,j,t,x,b,M]),I=i.useCallback((te,ye)=>{T(g,"step",{value:te,type:ye.type})},[g,T]);i.useEffect(()=>()=>{A.current&&clearTimeout(A.current)},[]),i.useEffect(()=>{v!==void 0&&E===void 0&&k&&b&&S(k,b,v)},[v,E,k,b,S]);const P=i.useMemo(()=>Ye(f,$??void 0),[f,$]),{prefix:R,suffix:F,addonBefore:K,addonAfter:q,style:G,...ie}=P,pe=i.useMemo(()=>rt({iconName:R!=null?String(R):void 0,label:K!=null?String(K):void 0}),[R,K]),ne=i.useMemo(()=>rt({iconName:F!=null?String(F):void 0,label:q!=null?String(q):void 0}),[F,q]),ue=pe.iconNode,fe=ne.iconNode,me=pe.iconConfigured?void 0:pe.labelText,ee=ne.iconConfigured?void 0:ne.labelText,W=i.useMemo(()=>{if(!(p&&E!==null&&E!==void 0))return fe;const ye=u.jsx("span",{role:"button","aria-label":"clear",style:{cursor:"pointer",marginInlineStart:4},onMouseDown:Q=>Q.preventDefault(),onClick:Q=>{Q.stopPropagation(),_()},children:u.jsx(ze.CloseCircleOutlined,{})});return fe==null||fe===!1?ye:u.jsxs(u.Fragment,{children:[fe,ye]})},[p,E,fe,_]);return u.jsxs("div",{style:{width:"100%"},children:[u.jsxs(V.Space.Compact,{style:{width:"100%"},children:[me?u.jsx(V.Space.Addon,{style:nt,children:me}):null,u.jsx(V.InputNumber,{...ie,disabled:n?!1:ie.disabled,readOnly:n?!0:ie.readOnly,className:Dr(ie.className,{"ant-input-number-disabled":n&&ie.disabled}),prefix:ue,value:E,onChange:z,onBlur:B,onPressEnter:L,onStep:I,suffix:W,status:N?"error":void 0,style:{width:"100%",...G}}),ee?u.jsx(V.Space.Addon,{style:nt,children:ee}):null]}),N&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:N})]})},{TextArea:Dn}=V.Input,os=200,ss=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,pressEnterAction:y,clearAction:h,onChange:p,value:g,defaultValue:C,index:v,...m})=>{const f=tt(o,r,e),d=f.dataSet,x=f.dataSetField,b=f.sessionId,j=O(ne=>ne.addCommand),M=O(ne=>ne.setDataSet),S=i.useRef(null),A=i.useContext(We),k=v??(A==null?void 0:A.index),$=A==null?void 0:A.parentIndex,D=i.useMemo(()=>de(b,d),[b,d]),w=i.useMemo(()=>b?ct(t,A,v):null,[b,t,A==null?void 0:A.parentIndex,A==null?void 0:A.index,v]),N=O(ne=>{var ue;return w?((ue=ne.propsStore[`${b}_props`])==null?void 0:ue[w])??null:null}),E=O(ne=>D&&x?ne.getDataSet(D,x):void 0),{validate:T,help:z}=Ie({rules:s,dataSet:d,dataSetField:x,sessionId:b,id:t,develop:n}),B=i.useMemo(()=>E!==void 0?E:(N==null?void 0:N.value)!==void 0?N.value:g??C,[E,N==null?void 0:N.value,g,C]),L=i.useMemo(()=>Ye(m,N??void 0),[m,N]),{leftAddonNode:_,rightAddonNode:I,inputRest:P}=i.useMemo(()=>{const ne=L,{prefix:ue,suffix:fe,addonBefore:me,addonAfter:ee,...W}=ne,te=rt({iconName:ue==null?void 0:String(ue),label:me==null?void 0:String(me)}),ye=rt({iconName:fe==null?void 0:String(fe),label:ee==null?void 0:String(ee)});return{leftAddonNode:te.iconNode??te.labelText,rightAddonNode:ye.iconNode??ye.labelText,inputRest:W}},[L]),R=i.useMemo(()=>_!=null&&_!==!1||I!=null&&I!==!1,[_,I]),F=i.useCallback(ne=>{const ue=ne.target.value;if(p){p(ue,ne);return}if(D&&x&&M(D,x,ue),l&&b){const{actionName:fe,arg:me}=Te(l,ue,{id:t,dataSet:d,dataSetField:x,index:k,parentIndex:$});j(b,se(fe,me))}c&&(S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{S.current=null,T(ue)},os))},[p,D,x,M,l,b,t,k,$,j,c,T]),K=i.useCallback(()=>{a&&T(B)},[a,T,B]),q=i.useCallback(ne=>{const ue=P.onPressEnter;if(ue){ue(ne);return}if(y&&b&&!ne.shiftKey){const{actionName:fe,arg:me}=Te(y,B,{id:t,dataSet:d,dataSetField:x,index:k,parentIndex:$});j(b,se(fe,me))}},[P,y,b,B,t,d,x,k,$,j]),G=i.useCallback(()=>{const ne=P.onClear;if(ne){ne();return}if(h&&b){const{actionName:ue,arg:fe}=Te(h,"",{id:t,dataSet:d,dataSetField:x,index:k,parentIndex:$});j(b,se(ue,fe))}},[P,h,b,t,d,x,k,$,j]);i.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const ie={...P,disabled:n?!1:P.disabled,value:B,onChange:F,onBlur:K,onPressEnter:q,onClear:G,status:z?"error":void 0,style:{...P.style||{},...R?{flex:1,minWidth:0}:{}}},pe=R?u.jsxs(V.Space.Compact,{style:{width:"100%",display:"flex"},children:[_!=null&&_!==!1?u.jsx(V.Space.Addon,{style:nt,children:_}):null,u.jsx(Dn,{...ie}),I!=null&&I!==!1?u.jsx(V.Space.Addon,{style:nt,children:I}):null]}):u.jsx(Dn,{...ie});return u.jsxs("div",{style:{width:"100%"},children:[pe,z&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:z})]})},{Password:is}=V.Input,as=200,cs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,pressEnterAction:y,clearAction:h,onChange:p,value:g,defaultValue:C,...v})=>{const m=O(_=>_.addCommand),f=O(_=>_.setDataSet),d=i.useRef(null),x=i.useMemo(()=>de(e,o),[e,o]),b=O(_=>{var I;return e&&t?((I=_.propsStore[`${e}_props`])==null?void 0:I[t])??null:null}),j=O(_=>x&&r?_.getDataSet(x,r):void 0),{validate:M,help:S}=Ie({rules:s,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),A=i.useMemo(()=>j!==void 0?j:(b==null?void 0:b.value)!==void 0?b.value:g??C,[j,b==null?void 0:b.value,g,C]),k=i.useMemo(()=>Ye(v,b??void 0),[v,b]),{prefixIconNode:$,suffixIconNode:D,prefixAddonText:w,suffixAddonText:N,inputRest:E}=i.useMemo(()=>{const _=k,{prefix:I,suffix:P,addonBefore:R,addonAfter:F,...K}=_,q=rt({iconName:I==null?void 0:String(I),label:R==null?void 0:String(R)}),G=rt({iconName:P==null?void 0:String(P),label:F==null?void 0:String(F)});return{prefixIconNode:q.iconNode,suffixIconNode:G.iconNode,prefixAddonText:q.iconConfigured?void 0:q.labelText,suffixAddonText:G.iconConfigured?void 0:G.labelText,inputRest:K}},[k]),T=i.useCallback(_=>{const I=_.target.value;if(p){p(I,_);return}if(x&&r&&f(x,r,I),l&&e){const{actionName:P,arg:R}=Te(l,I,{id:t,dataSet:o,dataSetField:r});m(e,se(P,R))}c&&(d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{d.current=null,M(I)},as))},[p,x,r,f,l,e,t,m,c,M]),z=i.useCallback(()=>{a&&M(A)},[a,M,A]),B=i.useCallback(_=>{const I=E.onPressEnter;if(I){I(_);return}if(y&&e){const{actionName:P,arg:R}=Te(y,A,{id:t,dataSet:o,dataSetField:r});m(e,se(P,R))}},[E,y,e,A,t,o,r,m]),L=i.useCallback(()=>{const _=E.onClear;if(_){_();return}if(h&&e){const{actionName:I,arg:P}=Te(h,"",{id:t,dataSet:o,dataSetField:r});m(e,se(I,P))}},[E,h,e,t,o,r,m]);return i.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),u.jsxs("div",{style:{width:"100%"},children:[u.jsxs(V.Space.Compact,{style:{width:"100%"},children:[w?u.jsx(V.Space.Addon,{style:nt,children:w}):null,u.jsx(is,{...E,prefix:$,suffix:D,disabled:n?!1:E.disabled,value:A,onChange:T,onBlur:z,onPressEnter:B,onClear:L,status:S?"error":void 0}),N?u.jsx(V.Space.Addon,{style:nt,children:N}):null]}),S&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:S})]})},{Search:ls}=V.Input,us=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,searchAction:a,onChange:c,onSearch:l,value:y,defaultValue:h,...p})=>{const g=O(w=>w.addCommand),C=O(w=>w.getDataSet),v=O(w=>w.setDataSet),m=O(w=>{var N;return e&&t?((N=w.propsStore[`${e}_props`])==null?void 0:N[t])??null:null}),f=i.useMemo(()=>de(e,o),[e,o]),d=i.useMemo(()=>{if(f&&r)return C(f,r)},[f,r,C]),x=i.useMemo(()=>d??y??h,[d,y,h]),b=i.useMemo(()=>Ye(p,m??void 0),[p,m]),{prefixIconNode:j,suffixIconNode:M,prefixAddonText:S,suffixAddonText:A,inputProps:k}=i.useMemo(()=>{const w=b,{prefix:N,suffix:E,addonBefore:T,addonAfter:z,...B}=w,L=rt({iconName:N==null?void 0:String(N),label:T==null?void 0:String(T)}),_=rt({iconName:E==null?void 0:String(E),label:z==null?void 0:String(z)});return{prefixIconNode:L.iconNode,suffixIconNode:_.iconNode,prefixAddonText:L.iconConfigured?void 0:L.labelText,suffixAddonText:_.iconConfigured?void 0:_.labelText,inputProps:B}},[b]),$=i.useCallback(w=>{const N=w.target.value;if(c){c(N);return}if(f&&r&&v(f,r,N),s&&e){const{actionName:E,arg:T}=Te(s,N,{id:t,dataSet:o,dataSetField:r});g(e,se(E,T))}},[c,f,r,v,s,e,t,g]),D=i.useCallback(w=>{if(l){l(w);return}a&&e&&g(e,se(a,w))},[l,a,e,g]);return u.jsxs(V.Space.Compact,{style:{width:"100%"},children:[S?u.jsx(V.Space.Addon,{style:nt,children:S}):null,u.jsx(ls,{...k,prefix:j,suffix:M,disabled:n?!1:k.disabled,value:x,onChange:$,onSearch:D}),A?u.jsx(V.Space.Addon,{style:nt,children:A}):null]})},ds=200,fs="_selected";function vt(t){var e;if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(i.isValidElement(t)){const n=(e=t.props)==null?void 0:e.children;if(typeof n=="string"||typeof n=="number")return String(n);if(Array.isArray(n))return n.map(vt).join("")}return String(t)}function ms(t,e){if(t===e||t==null&&e==null)return!0;if(t==null||e==null)return!1;const n=t.key,o=e.key,r=t.label,s=e.label;return Array.isArray(n)&&Array.isArray(o)&&Array.isArray(r)&&Array.isArray(s)?n.length!==o.length||r.length!==s.length?!1:n.every((a,c)=>a===o[c])&&r.every((a,c)=>a===s[c]):Array.isArray(n)||Array.isArray(o)?!1:n===o&&r===s}function Nn(t,e,n,o,r){var y;if(!(r==="multiple"||r==="tags"||Array.isArray(t))){if(t==null||t==="")return null;if(o&&t&&typeof t=="object"&&!Array.isArray(t)&&"value"in t){const C=t;return{key:C.value,label:vt(C.label)}}const h=e&&!Array.isArray(e)?e:et(n,t),p=(h==null?void 0:h.label)??(h==null?void 0:h.children),g=vt(p??((y=et(n,t))==null?void 0:y.label)??String(t));return{key:t,label:g}}if(!Array.isArray(t)||t.length===0)return null;if(o&&t[0]&&typeof t[0]=="object"&&t[0]!==null&&"value"in t[0]){const h=t.map(g=>g.value),p=t.map(g=>vt(g.label));return{key:h,label:p}}const a=Array.isArray(e)?e:[],c=t,l=c.map((h,p)=>{var v;const g=a[p],C=(g==null?void 0:g.label)??(g==null?void 0:g.children);return C!=null?vt(C):vt(((v=et(n,h))==null?void 0:v.label)??String(h))});return{key:c,label:l}}const sr=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,enableDict:s,dictType:a,optionsCfg:c,rules:l,validateOnBlur:y,validateOnChange:h,changeAction:p,onChange:g,autoSelectFirst:C=!1,options:v,defaultValue:m,value:f,index:d,showArrow:x,remoteUrl:b,searchAction:j,selectAction:M,deselectAction:S,dictCode:A,dropdownMatchSelectWidth:k,...$})=>{var Se,Ke;const D=tt(o,r,e),w=D.dataSet,N=D.dataSetField,E=D.sessionId,T=O(Z=>Z.addCommand),z=O(Z=>Z.setDataSet),B=i.useRef(null),L=i.useContext(We),_=i.useMemo(()=>de(E,w),[E,w]),I=d??(L==null?void 0:L.index),P=L==null?void 0:L.parentIndex,R=i.useMemo(()=>E?ct(t,L,d):null,[E,t,L==null?void 0:L.parentIndex,L==null?void 0:L.index,d]),F=O(Z=>{var re;return R?((re=Z.propsStore[`${E}_props`])==null?void 0:re[R])??null:null}),K=O(Z=>_&&N?Z.getDataSet(_,N):void 0),q=i.useMemo(()=>(F==null?void 0:F.optionsCfg)!=null?F.optionsCfg:c,[F==null?void 0:F.optionsCfg,c]),{options:G,loading:ie}=St(A||(s?a:void 0)),{options:pe,loading:ne}=qt(q==null?void 0:q.url,{valueKey:(q==null?void 0:q.codeKey)||"value",labelKey:(q==null?void 0:q.labelKey)||"label",immediate:!!(q!=null&&q.url),params:q==null?void 0:q.params,field:q==null?void 0:q.field}),ue=ie||ne,{validate:fe,help:me}=Ie({rules:l,dataSet:w,dataSetField:N,sessionId:E,id:t,develop:n}),ee=i.useMemo(()=>K!=null&&K!==""?K:(F==null?void 0:F.value)!==void 0?F.value:f??m,[K,F==null?void 0:F.value,f,m]),W=i.useMemo(()=>Ye($,F??void 0),[$,F]),te=i.useMemo(()=>F!=null&&F.options&&Array.isArray(F.options)?F.options:q!=null&&q.url&&pe.length>0?pe:(A||s&&a)&&G.length>0?G:v||[],[F==null?void 0:F.options,q==null?void 0:q.url,pe,A,s,a,G,v]),ye=i.useMemo(()=>{if(te.length===0)return ee;if(Array.isArray(ee))return ee.map(re=>{var le;return((le=et(te,re))==null?void 0:le.value)??re});const Z=et(te,ee);return(Z==null?void 0:Z.value)??ee},[ee,te]),Q=N?`${N}${fs}`:"",oe=i.useRef(null),xe=i.useCallback((Z,re)=>{if(g){g(Z,re);return}if(_&&N){z(_,N,Z);const le=Nn(Z,re,te,W.labelInValue,W.mode);z(_,Q,le)}if(h&&(B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{B.current=null,fe(Z)},ds)),p&&E){const{actionName:le,arg:Y}=Te(p,Z,{id:t,dataSet:w,dataSetField:N,index:I,parentIndex:P});T(E,se(le,Y))}},[g,_,N,z,h,fe,p,E,t,w,N,I,P,T,te,W.labelInValue,W.mode,Q]);i.useEffect(()=>{if(g||!_||!N||!Q)return;const Z=Nn(ee,void 0,te,W.labelInValue,W.mode),re=O.getState().getDataSet(_,Q);ms(re,Z)||z(_,Q,Z)},[g,_,N,Q,ee,te,W.labelInValue,W.mode,z]);const Ne=i.useCallback(()=>{y&&fe(ye)},[y,fe,ye]),$e=(F==null?void 0:F.autoSelectFirst)??C,_e=i.useMemo(()=>{if(Array.isArray(ee))return ee.length===0;if(ee==null||ee==="")return!0;if(W.labelInValue&&ee&&typeof ee=="object"&&!Array.isArray(ee)&&"value"in ee){const Z=ee.value;return Z==null||Z===""}return!1},[ee,W.labelInValue]);i.useEffect(()=>{var ce,J;if(!$e||te.length===0||!_e){oe.current=null;return}const Z=((ce=W.fieldNames)==null?void 0:ce.value)||"value",re=((J=W.fieldNames)==null?void 0:J.label)||"label",le=te[0];if(!le)return;const Y=le[Z]??le.value;if(Y==null||Y==="")return;const ae=`${_??""}:${N??""}:${String(Y)}`;if(oe.current===ae)return;oe.current=ae;const H=W.mode==="multiple"||W.mode==="tags"||Array.isArray(ee),X=le[re]??le.label;if(W.labelInValue){xe(H?[{value:Y,label:X}]:{value:Y,label:X},H?[le]:le);return}xe(H?[Y]:Y,H?[le]:le)},[$e,_,N,te,xe,_e,(Se=W.fieldNames)==null?void 0:Se.label,(Ke=W.fieldNames)==null?void 0:Ke.value,W.labelInValue,W.mode,ee]),i.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const Ee=i.useCallback((Z,re)=>((re==null?void 0:re.label)??"").toLowerCase().includes(Z.toLowerCase()),[]);return u.jsxs("div",{style:{width:"100%"},children:[u.jsx(V.Select,{...W,disabled:n?!1:W.disabled,open:n?!1:void 0,value:ye,options:te,onChange:xe,onBlur:Ne,filterOption:Ee,loading:ue,status:me?"error":void 0,style:{width:"100%",...W.style}}),me&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:me})]})},ys=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,rules:s,validateOnBlur:a,validateOnChange:c,changeAction:l,onChange:y,checked:h,defaultChecked:p,...g})=>{const C=O(A=>A.addCommand),v=O(A=>A.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),f=O(A=>{var k;return e&&t?((k=A.propsStore[`${e}_props`])==null?void 0:k[t])??null:null}),d=O(A=>m&&r?A.getDataSet(m,r):void 0),{validate:x,help:b}=Ie({rules:s,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),j=i.useMemo(()=>d!==void 0?!!d:(f==null?void 0:f.checked)!==void 0?f.checked:h??p,[d,f==null?void 0:f.checked,h,p]),M=i.useCallback(A=>{if(y){y(A);return}if(m&&r&&v(m,r,A),c&&x(A),l&&e){const{actionName:k,arg:$}=Te(l,A,{id:t,dataSet:o,dataSetField:r});C(e,se(k,$))}},[y,m,r,v,c,x,l,e,t,C]),S=i.useCallback(()=>{a&&x(j)},[a,x,j]);return u.jsxs("div",{style:{display:"inline-block"},onBlur:S,children:[u.jsx(V.Switch,{...g,disabled:n?!1:g.disabled,checked:j,onChange:M}),b&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:b})]})};var hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ir={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(hs,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,s=/\d\d/,a=/\d\d?/,c=/\d*[^-_:/,()\s\d]+/,l={},y=function(f){return(f=+f)+(f>68?1900:2e3)},h=function(f){return function(d){this[f]=+d}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(f){(this.zone||(this.zone={})).offset=function(d){if(!d||d==="Z")return 0;var x=d.match(/([+-]|\d\d)/g),b=60*x[1]+(+x[2]||0);return b===0?0:x[0]==="+"?-b:b}(f)}],g=function(f){var d=l[f];return d&&(d.indexOf?d:d.s.concat(d.f))},C=function(f,d){var x,b=l.meridiem;if(b){for(var j=1;j<=24;j+=1)if(f.indexOf(b(j,0,d))>-1){x=j>12;break}}else x=f===(d?"pm":"PM");return x},v={A:[c,function(f){this.afternoon=C(f,!1)}],a:[c,function(f){this.afternoon=C(f,!0)}],Q:[r,function(f){this.month=3*(f-1)+1}],S:[r,function(f){this.milliseconds=100*+f}],SS:[s,function(f){this.milliseconds=10*+f}],SSS:[/\d{3}/,function(f){this.milliseconds=+f}],s:[a,h("seconds")],ss:[a,h("seconds")],m:[a,h("minutes")],mm:[a,h("minutes")],H:[a,h("hours")],h:[a,h("hours")],HH:[a,h("hours")],hh:[a,h("hours")],D:[a,h("day")],DD:[s,h("day")],Do:[c,function(f){var d=l.ordinal,x=f.match(/\d+/);if(this.day=x[0],d)for(var b=1;b<=31;b+=1)d(b).replace(/\[|\]/g,"")===f&&(this.day=b)}],w:[a,h("week")],ww:[s,h("week")],M:[a,h("month")],MM:[s,h("month")],MMM:[c,function(f){var d=g("months"),x=(g("monthsShort")||d.map(function(b){return b.slice(0,3)})).indexOf(f)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[c,function(f){var d=g("months").indexOf(f)+1;if(d<1)throw new Error;this.month=d%12||d}],Y:[/[+-]?\d+/,h("year")],YY:[s,function(f){this.year=y(f)}],YYYY:[/\d{4}/,h("year")],Z:p,ZZ:p};function m(f){var d,x;d=f,x=l&&l.formats;for(var b=(f=d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,w,N){var E=N&&N.toUpperCase();return w||x[N]||n[N]||x[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(T,z,B){return z||B.slice(1)})})).match(o),j=b.length,M=0;M<j;M+=1){var S=b[M],A=v[S],k=A&&A[0],$=A&&A[1];b[M]=$?{regex:k,parser:$}:S.replace(/^\[|\]$/g,"")}return function(D){for(var w={},N=0,E=0;N<j;N+=1){var T=b[N];if(typeof T=="string")E+=T.length;else{var z=T.regex,B=T.parser,L=D.slice(E),_=z.exec(L)[0];B.call(w,_),D=D.replace(_,"")}}return function(I){var P=I.afternoon;if(P!==void 0){var R=I.hours;P?R<12&&(I.hours+=12):R===12&&(I.hours=0),delete I.afternoon}}(w),w}}return function(f,d,x){x.p.customParseFormat=!0,f&&f.parseTwoDigitYear&&(y=f.parseTwoDigitYear);var b=d.prototype,j=b.parse;b.parse=function(M){var S=M.date,A=M.utc,k=M.args;this.$u=A;var $=k[1];if(typeof $=="string"){var D=k[2]===!0,w=k[3]===!0,N=D||w,E=k[2];w&&(E=k[2]),l=this.$locale(),!D&&E&&(l=x.Ls[E]),this.$d=function(L,_,I,P){try{if(["x","X"].indexOf(_)>-1)return new Date((_==="X"?1e3:1)*L);var R=m(_)(L),F=R.year,K=R.month,q=R.day,G=R.hours,ie=R.minutes,pe=R.seconds,ne=R.milliseconds,ue=R.zone,fe=R.week,me=new Date,ee=q||(F||K?1:me.getDate()),W=F||me.getFullYear(),te=0;F&&!K||(te=K>0?K-1:me.getMonth());var ye,Q=G||0,oe=ie||0,xe=pe||0,Ne=ne||0;return ue?new Date(Date.UTC(W,te,ee,Q,oe,xe,Ne+60*ue.offset*1e3)):I?new Date(Date.UTC(W,te,ee,Q,oe,xe,Ne)):(ye=new Date(W,te,ee,Q,oe,xe,Ne),fe&&(ye=P(ye).week(fe).toDate()),ye)}catch{return new Date("")}}(S,$,A,x),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),N&&S!=this.format($)&&(this.$d=new Date("")),l={}}else if($ instanceof Array)for(var T=$.length,z=1;z<=T;z+=1){k[1]=$[z-1];var B=x.apply(this,k);if(B.isValid()){this.$d=B.$d,this.$L=B.$L,this.init();break}z===T&&(this.$d=new Date(""))}else j.call(this,M)}}})})(ir);var ps=ir.exports;const vs=gs(ps);qe.extend(vs);const Tn="YYYY-MM-DD",bs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,valueFormat:a=Tn,rules:c,validateOnBlur:l,validateOnChange:y,onChange:h,value:p,defaultValue:g,...C})=>{const v=O(w=>w.addCommand),m=O(w=>w.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),d=O(w=>{var N;return e&&t?((N=w.propsStore[`${e}_props`])==null?void 0:N[t])??null:null}),x=O(w=>f&&r?w.getDataSet(f,r):void 0),{validate:b,help:j}=Ie({rules:c,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),M=i.useMemo(()=>Ye(C,d??void 0),[C,d]),S=typeof M.format=="string"?M.format:void 0,A=i.useCallback(w=>{if(w==null||w==="")return null;if(qe.isDayjs(w))return w.isValid()?w:null;if(typeof w!="string")return null;const N=[a,Tn,S].filter(T=>!!T);for(const T of N){const z=qe(w,T,!0);if(z.isValid())return z}const E=qe(w);return E.isValid()?E:null},[a,S]),k=i.useMemo(()=>{const w=x??(d==null?void 0:d.value)??p??g;return A(w)},[x,d==null?void 0:d.value,p,g,A]),$=i.useCallback((w,N)=>{if(h){h(w,N);return}const E=w!=null&&w.isValid()?w.format(a):"";if(f&&r&&m(f,r,E),y&&b(E||null),s&&e){const{actionName:T,arg:z}=Te(s,E,{id:t,dataSet:o,dataSetField:r});v(e,se(T,z))}},[h,f,r,m,y,b,s,e,t,o,r,v,a]);i.useEffect(()=>{if(g&&k===null&&f&&r){const w=qe(g).format(a);m(f,r,w)}},[g,k,f,r,m,a]);const D=i.useCallback(()=>{if(l){const w=k?k.format(a):null;b(w)}},[l,b,k,a]);return u.jsxs("div",{onBlur:D,style:{display:"flex"},children:[u.jsx(V.DatePicker,{...M,disabled:n?!1:M.disabled,open:n?!1:void 0,value:k,onChange:$,style:{width:"100%",...M.style}}),j&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:j})]})},xs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,valueFormat:a="HH:mm:ss",onChange:c,value:l,defaultValue:y,rules:h,validateOnChange:p,validateOnBlur:g,...C})=>{const v=O(D=>D.addCommand),m=O(D=>D.getDataSet),f=O(D=>D.setDataSet),d=i.useMemo(()=>de(e,o),[e,o]),x=i.useMemo(()=>{if(d&&r)return m(d,r)},[d,r,m]),{validate:b,help:j}=Ie({rules:h,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),M=i.useCallback(D=>{if(!D)return null;if(qe.isDayjs(D))return D;if(typeof D=="string"){const w=qe(D,a);return w.isValid()?w:null}return null},[a]),S=i.useMemo(()=>M(x??l??y),[x,l,y,M]),A=i.useCallback((D,w)=>{if(c){c(D,w);return}const N=w||"";if(d&&r&&f(d,r,N),p&&b(N),s&&e){const{actionName:E,arg:T}=Te(s,N,{id:t,dataSet:o,dataSetField:r});v(e,se(E,T))}},[c,d,r,f,p,b,s,e,t,v]),k=i.useCallback(()=>{g&&b(S?S.format(a):"")},[g,b,S,a]),$=j?"error":void 0;return u.jsxs(u.Fragment,{children:[u.jsx(V.TimePicker,{...C,disabled:n?!1:C.disabled,open:n?!1:void 0,value:S,onChange:A,onBlur:k,style:{width:"100%",...C.style},status:$}),j&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:"12px",marginTop:"4px"},children:j})]})},{RangePicker:Ss}=V.DatePicker,Cs=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,valueFormat:a="YYYY-MM-DD",rules:c,validateOnBlur:l,validateOnChange:y,onChange:h,value:p,defaultValue:g,...C})=>{const v=O(D=>D.addCommand),m=O(D=>D.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),d=O(D=>{var w;return e&&t?((w=D.propsStore[`${e}_props`])==null?void 0:w[t])??null:null}),x=O(D=>f&&r?D.getDataSet(f,r):void 0),{validate:b,help:j}=Ie({rules:c,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),M=i.useCallback(D=>{if(!D||!Array.isArray(D)||D.length!==2)return null;const[w,N]=D,E=qe.isDayjs(w)?w:qe(w,a),T=qe.isDayjs(N)?N:qe(N,a);return E.isValid()&&T.isValid()?[E,T]:null},[a]),S=i.useMemo(()=>{const D=x??(d==null?void 0:d.value)??p??g;return M(D)},[x,d==null?void 0:d.value,p,g,M]),A=i.useMemo(()=>Ye(C,d??void 0),[C,d]),k=i.useCallback((D,w)=>{if(h){h(D,w);return}if(f&&r&&m(f,r,w),y&&b(w),s&&e){const{actionName:N,arg:E}=Te(s,w,{id:t,dataSet:o,dataSetField:r});v(e,se(N,E))}},[h,f,r,m,y,b,s,e,t,v]),$=i.useCallback(()=>{var D,w;l&&b(S?[(D=S[0])==null?void 0:D.format(a),(w=S[1])==null?void 0:w.format(a)]:null)},[l,b,S,a]);return u.jsxs("div",{onBlur:$,children:[u.jsx(Ss,{...A,disabled:n?!1:A.disabled,open:n?!1:void 0,value:S,onChange:k,style:{width:"100%",...A.style}}),j&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:j})]})},Ms=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,options:s=[],optionsCfg:a,changeAction:c,buttonStyle:l,optionType:y="default",rules:h,validateOnBlur:p,validateOnChange:g,onChange:C,value:v,defaultValue:m,dictCode:f,index:d,direction:x,remoteUrl:b,...j})=>{const M=tt(o,r,e),S=M.dataSet,A=M.dataSetField,k=M.sessionId,$=O(ne=>ne.addCommand),D=O(ne=>ne.setDataSet),w=i.useContext(We),N=d??(w==null?void 0:w.index),E=w==null?void 0:w.parentIndex,T=i.useMemo(()=>de(k,S),[k,S]),z=i.useMemo(()=>k?ct(t,w,d):null,[k,t,w==null?void 0:w.parentIndex,w==null?void 0:w.index,d]),B=O(ne=>{var ue;return z?((ue=ne.propsStore[`${k}_props`])==null?void 0:ue[z])??null:null}),L=O(ne=>T&&A?ne.getDataSet(T,A):void 0),{validate:_,help:I}=Ie({rules:h,dataSet:S,dataSetField:A,sessionId:k,id:t,develop:n}),P=i.useMemo(()=>L!==void 0?L:(B==null?void 0:B.value)!==void 0?B.value:v??m,[L,B==null?void 0:B.value,v,m]),{options:R}=St(f),{options:F}=qt(a==null?void 0:a.url,{valueKey:(a==null?void 0:a.codeKey)||"value",labelKey:(a==null?void 0:a.labelKey)||"label",immediate:!!(a!=null&&a.url)}),K=i.useMemo(()=>B!=null&&B.options?B.options:a!=null&&a.url&&F.length>0?F:f&&R.length>0?R:s,[B==null?void 0:B.options,a==null?void 0:a.url,F,f,R,s]),q=i.useMemo(()=>{if(K.length===0)return P;const ne=et(K,P);return(ne==null?void 0:ne.value)??P},[P,K]),G=i.useMemo(()=>Ye(j,B??void 0),[j,B]),ie=i.useCallback(ne=>{const ue=ne.target.value;if(C){C(ue);return}if(T&&A&&D(T,A,ue),g&&_(ue),c&&k){const{actionName:fe,arg:me}=Te(c,ue,{id:t,dataSet:S,dataSetField:A,index:N,parentIndex:E});$(k,se(fe,me))}},[C,T,A,D,g,_,c,k,t,S,A,N,E,$]),pe=i.useCallback(()=>{p&&_(q)},[p,_,q]);return u.jsxs("div",{onBlur:pe,children:[u.jsx(V.Radio.Group,{...G,disabled:n?!1:G.disabled,value:q,onChange:ie,buttonStyle:(B==null?void 0:B.buttonStyle)??l,optionType:(B==null?void 0:B.optionType)??y,children:y==="button"?K.map(ne=>u.jsx(V.Radio.Button,{value:ne.value,disabled:ne.disabled,children:ne.label},ne.value)):u.jsx(V.Space,{orientation:(B==null?void 0:B.direction)??x??"horizontal",wrap:!0,children:K.map(ne=>u.jsx(V.Radio,{value:ne.value,disabled:ne.disabled,children:ne.label},ne.value))})}),I&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:I})]})},As=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,options:s=[],optionsCfg:a,multiple:c=!1,changeAction:l,rules:y,validateOnBlur:h,validateOnChange:p,onChange:g,onChangeMultiple:C,checked:v,values:m,defaultChecked:f,children:d,dictCode:x,index:b,direction:j="horizontal",remoteUrl:M,...S})=>{const A=tt(o,r,e),k=A.dataSet,$=A.dataSetField,D=A.sessionId,w=O(W=>W.addCommand),N=O(W=>W.setDataSet),E=i.useContext(We),T=b??(E==null?void 0:E.index),z=E==null?void 0:E.parentIndex,B=i.useMemo(()=>de(D,k),[D,k]),L=i.useMemo(()=>D?ct(t,E,b):null,[D,t,E==null?void 0:E.parentIndex,E==null?void 0:E.index,b]),_=O(W=>{var te;return L?((te=W.propsStore[`${D}_props`])==null?void 0:te[L])??null:null}),I=O(W=>B&&$?W.getDataSet(B,$):void 0),{validate:P,help:R}=Ie({rules:y,dataSet:k,dataSetField:$,sessionId:D,id:t,develop:n}),{options:F}=St(x),{options:K}=qt(a==null?void 0:a.url,{valueKey:(a==null?void 0:a.codeKey)||"value",labelKey:(a==null?void 0:a.labelKey)||"label",immediate:!!(a!=null&&a.url)}),q=i.useMemo(()=>{if(!c)return I!==void 0?!!I:(_==null?void 0:_.checked)!==void 0?_.checked:v??f},[c,I,_==null?void 0:_.checked,v,f]),G=i.useMemo(()=>_!=null&&_.options?_.options:a!=null&&a.url&&K.length>0?K:x&&F.length>0?F:s,[_==null?void 0:_.options,a==null?void 0:a.url,K,x,F,s]),ie=i.useMemo(()=>{if(!c)return[];let W=[];return Array.isArray(I)?W=I:Array.isArray(_==null?void 0:_.values)?W=_.values:W=m||[],G.length===0?W:W.map(te=>{var ye;return((ye=et(G,te))==null?void 0:ye.value)??te})},[c,I,_==null?void 0:_.values,m,G]),pe=i.useMemo(()=>Ye(S,_??void 0,{skipKeys:["value","help","validateStatus","checked","values","options"]}),[S,_]),ue=(pe.direction??j)==="vertical"?"vertical":"horizontal",fe=i.useCallback(W=>{const te=W.target.checked;if(g){g(te);return}if(B&&$&&N(B,$,te),p&&P(te),l&&D){const{actionName:ye,arg:Q}=Te(l,te,{id:t,dataSet:k,dataSetField:$}),oe=typeof Q=="object"&&Q!==null?{...Q,index:T,parentIndex:z}:Q;w(D,se(ye,oe))}},[g,B,$,N,p,P,l,D,t,w,T,z,k]),me=i.useCallback(W=>{if(C){C(W);return}if(B&&$&&N(B,$,W),p&&P(W),l&&D){const{actionName:te,arg:ye}=Te(l,W,{id:t,dataSet:k,dataSetField:$}),Q=typeof ye=="object"&&ye!==null?{...ye,index:T,parentIndex:z}:ye;w(D,se(te,Q))}},[C,B,$,N,p,P,l,D,t,w,T,z,k]),ee=i.useCallback(()=>{h&&P(c?ie:q)},[h,P,c,ie,q]);if(c&&G.length>0){const{indeterminate:W,direction:te,...ye}=pe;return u.jsxs("div",{onBlur:ee,children:[u.jsx(V.Checkbox.Group,{...ye,value:ie,onChange:me,disabled:n?!1:pe.disabled,children:u.jsx(V.Space,{orientation:ue,wrap:!0,children:G.map(Q=>u.jsx(V.Checkbox,{value:Q.value,disabled:Q.disabled,children:Q.label},Q.value))})}),R&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:R})]})}return u.jsxs("div",{onBlur:ee,children:[u.jsx(V.Checkbox,{...pe,disabled:n?!1:pe.disabled,checked:q,onChange:fe,children:d}),R&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:R})]})},js=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,rules:a,validateOnBlur:c,validateOnChange:l,onChange:y,value:h,defaultValue:p,...g})=>{const C=O(k=>k.addCommand),v=O(k=>k.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),f=O(k=>{var $;return e&&t?(($=k.propsStore[`${e}_props`])==null?void 0:$[t])??null:null}),d=O(k=>m&&r?k.getDataSet(m,r):void 0),{validate:x,help:b}=Ie({rules:a,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),j=i.useMemo(()=>d!==void 0?d:(f==null?void 0:f.value)!==void 0?f.value:h??p,[d,f==null?void 0:f.value,h,p]),M=i.useCallback(k=>{if(y){y(k);return}if(m&&r&&v(m,r,k),l&&x(k),s&&e){const{actionName:$,arg:D}=Te(s,k,{id:t,dataSet:o,dataSetField:r});C(e,se($,D))}},[y,m,r,v,l,x,s,e,t,C]),S=i.useCallback(()=>{c&&x(j)},[c,x,j]),A=i.useMemo(()=>Ye(g,f??void 0),[g,f]);return u.jsxs("div",{onBlur:S,children:[u.jsx(V.Rate,{...A,disabled:n?!1:A.disabled,value:j,onChange:M}),b&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:b})]})},ws=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,onChange:a,value:c,defaultValue:l,...y})=>{const h=O(d=>d.addCommand),p=O(d=>d.getDataSet),g=O(d=>d.setDataSet),C=i.useMemo(()=>de(e,o),[e,o]),v=i.useMemo(()=>{if(C&&r)return p(C,r)},[C,r,p]),m=i.useMemo(()=>v??c??l,[v,c,l]),f=i.useCallback(d=>{if(a){a(d);return}if(C&&r&&g(C,r,d),s&&e){const{actionName:x,arg:b}=Te(s,d,{id:t,dataSet:o,dataSetField:r});h(e,se(x,b))}},[a,C,r,g,s,e,t,h]);return u.jsx(V.Slider,{...y,disabled:n?!1:y.disabled,value:m,onChange:f})},ks=200,ar=(t,e,n=1)=>{if(!Array.isArray(t))return[];const{codeKey:o,labelKey:r,childrenKey:s,maxLevel:a}=e;return t.map(c=>{const l=n<a&&Array.isArray(c==null?void 0:c[s])?ar(c[s],e,n+1):void 0,y={value:String(c==null?void 0:c[o]),label:c==null?void 0:c[r]};return l&&l.length&&(y.children=l),y})},En=t=>!t||typeof t!="string"?[]:t.includes(",")?t.split(",").map(e=>e.trim()).filter(e=>e):[t],Ds=(t,e)=>{const n=(o,r,s=[])=>{for(const a of o){const c=a.value,l=[...s,c];if(c===r)return l;if(a.children&&Array.isArray(a.children)){const y=n(a.children,r,l);if(y)return y}}return null};return n(e,t)||[]},_n=t=>Array.isArray(t)&&t.length>0&&!Array.isArray(t[0]),On=t=>Array.isArray(t)&&t.length>0&&Array.isArray(t[0]),Ns=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,optionsCfg:s,rules:a,validateOnBlur:c,validateOnChange:l,changeAction:y,onChange:h,options:p,defaultValue:g,value:C,remoteUrl:v,...m})=>{const f=O(L=>L.addCommand),d=O(L=>L.setDataSet),x=i.useRef(null),[b,j]=i.useState([]),[M,S]=i.useState(!1),A=i.useMemo(()=>de(e,o),[e,o]),k=O(L=>A&&r?L.getDataSet(A,r):void 0),{validate:$,help:D,validateStatus:w}=Ie({rules:a,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),N=i.useMemo(()=>(s==null?void 0:s.url)&&b.length>0,[s==null?void 0:s.url,b.length]),E=i.useMemo(()=>{let L=k??C??g??[];return typeof L=="string"?N?En(L).map(I=>Ds(I,b)).filter(I=>Array.isArray(I)&&I.length>0):[L]:_n(L)&&N?L.map(I=>En(I)).filter(I=>Array.isArray(I)&&I.length>0):On(L)&&N?L.filter(_=>Array.isArray(_)&&_.length>0):L},[k,C,g,N,b]),T=i.useMemo(()=>s!=null&&s.url&&b.length>0?b:p||[],[s==null?void 0:s.url,b,p]);i.useEffect(()=>{(async()=>{if(s!=null&&s.url){S(!0);try{const _=await it({url:s.url,method:"GET"}),I=Array.isArray(_)?_:_!=null&&_.data?Array.isArray(_.data)?_.data:_.data.list||_.data.records||[]:[],P=s.codeKey||"value",R=s.labelKey||"label",F=s.childrenKey||"children",K=s.maxLevel||5,q=ar(I,{codeKey:P,labelKey:R,childrenKey:F,maxLevel:K});j(q)}catch(_){console.error("Failed to load remote options:",_),j([])}finally{S(!1)}}})()},[s==null?void 0:s.url,s==null?void 0:s.codeKey,s==null?void 0:s.labelKey,s==null?void 0:s.childrenKey,s==null?void 0:s.maxLevel]);const z=i.useCallback((L,_)=>{if(h){h(L,_);return}let I=L;if(_n(L)&&N?I=String(L[L.length-1]||""):On(L)&&N&&(I=L.map(P=>P.join(","))),A&&r&&d(A,r,I),l&&(x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{x.current=null,$(L)},ks)),y&&e){const{actionName:P,arg:R}=Te(y,L,{id:t,dataSet:o,dataSetField:r});f(e,se(P,R))}},[h,A,r,d,l,$,y,e,t,f,N]),B=i.useCallback(()=>{c&&$(E)},[c,$,E]);return i.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),u.jsxs("div",{style:{width:"100%"},children:[u.jsx(V.Cascader,{...m,disabled:n?!1:m.disabled,open:n?!1:void 0,value:E,options:T,onChange:z,onBlur:B,loading:M,status:w,style:{width:"100%",...m.style}}),D&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:D})]})},Ts=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,onChange:a,value:c,defaultValue:l,treeData:y,remoteUrl:h,selectAction:p,styles:g,classNames:C,token:v,rules:m,validateOnChange:f,validateOnBlur:d,...x})=>{const b=O(_=>_.addCommand),j=O(_=>_.setDataSet),M=i.useMemo(()=>de(e,o),[e,o]),S=O(_=>{var I;return e&&t?((I=_.propsStore[`${e}_props`])==null?void 0:I[t])??null:null}),A=O(_=>M&&r?_.getDataSet(M,r):void 0),{validate:k,help:$}=Ie({rules:m,dataSet:o,dataSetField:r,sessionId:e,id:t,develop:n}),D=i.useMemo(()=>A??(S==null?void 0:S.value)??c??l,[A,S==null?void 0:S.value,c,l]),w=i.useMemo(()=>Ye(x,S??void 0),[x,S]),N=i.useCallback((_,I,P)=>{if(a){a(_,I,P);return}if(M&&r&&j(M,r,_),f&&k(_),s&&e){const{actionName:R,arg:F}=Te(s,_,{id:t,dataSet:o,dataSetField:r});b(e,se(R,F))}},[a,M,r,j,f,k,s,e,t,b]),E=i.useCallback(()=>{d&&k(D)},[d,k,D]),T=i.useMemo(()=>{if(!v)return;const _={};return Object.entries(v).forEach(([I,P])=>{P!==""&&P!==void 0&&P!==null&&(_[I]=P)}),Object.keys(_).length>0?_:void 0},[v]),z=i.useMemo(()=>{if(T)return{components:{TreeSelect:T}}},[T]),B=$?"error":void 0,L=u.jsxs("div",{onBlur:E,children:[u.jsx(V.TreeSelect,{...w,disabled:n?!1:w.disabled,open:n?!1:void 0,treeData:y,value:D,onChange:N,style:{width:"100%",...w.style},styles:g,classNames:C,status:B}),$&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:$})]});return z?u.jsx(V.ConfigProvider,{theme:z,children:L}):L},Es=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,buttonText:a="上传文件",rules:c,validateOnBlur:l,validateOnChange:y,onChange:h,fileList:p,children:g,uploadUrl:C,maxSize:v=10,uploadParams:m,listDisplayText:f,action:d,...x})=>{const b=tt(o,r,e),j=b.dataSet,M=b.dataSetField,S=b.sessionId,A=O(H=>H.addCommand),k=O(H=>H.setDataSet),$=i.useMemo(()=>de(S,j),[S,j]),D=O(H=>{var X;return S&&t?((X=H.propsStore[`${S}_props`])==null?void 0:X[t])??null:null}),w=O(H=>$&&M?H.getDataSet($,M):void 0),{validate:N,help:E}=Ie({rules:c,dataSet:j,dataSetField:M,sessionId:S,id:t,develop:n}),T=i.useCallback(H=>H.map(X=>{var ve;return((ve=X==null?void 0:X.response)==null?void 0:ve.src)??(X==null?void 0:X.src)??(X==null?void 0:X.url)??(X==null?void 0:X.thumbUrl)??""}).filter(X=>X&&typeof X=="string"),[]),z=i.useCallback(H=>{const X=Ue().viewRes,ve=ce=>(X?X(ce):ce)||ce;return H.map((ce,J)=>{const he=ve(ce);return{uid:`src-${J}-${ce}`,name:ce.split("/").pop()||ce,url:he,thumbUrl:he,status:"done",response:{src:ce}}})},[]),B=i.useCallback(H=>{const X=Ue().viewRes,ve=ce=>(ce&&X?X(ce):ce)||ce;return H.map(ce=>{var ke;const J=((ke=ce==null?void 0:ce.response)==null?void 0:ke.src)??(ce==null?void 0:ce.src)??(ce==null?void 0:ce.url)??(ce==null?void 0:ce.thumbUrl)??"",he=typeof J=="string"?ve(J):J,be={};for(const Oe of Object.keys(ce)){const He=ce[Oe];He instanceof File?be[Oe]=He:He&&typeof He=="object"&&!Array.isArray(He)?be[Oe]={...He}:be[Oe]=He}return he&&typeof he=="string"&&(be.url=he,be.thumbUrl=he),be})},[]),[L,_]=i.useState(null),I=i.useMemo(()=>{const H=w??(D==null?void 0:D.fileList)??p;if(H!=null){if(typeof H=="string"&&H)return z([H]);if(Array.isArray(H))return H.length>0&&typeof H[0]=="string"?z(H):B(H)}},[w,D==null?void 0:D.fileList,p,z,B]),P=L??I,R=i.useMemo(()=>Ye(x,D??void 0,{skipKeys:["value","help","validateStatus","fileList","listDisplayText"]}),[x,D]),F=R,K=F.maxCount,q=F.repeatUpload===!0,G=F.token&&typeof F.token=="object"&&!Array.isArray(F.token)?F.token:void 0,ie=F.styles,pe=i.useMemo(()=>{const H=ie;if(!H||typeof H=="function"||Array.isArray(H))return;const X=H.trigger;return X&&typeof X=="object"&&!Array.isArray(X)?X:void 0},[ie]),ne=i.useMemo(()=>{const H=ie;if(!H||Array.isArray(H))return;if(typeof H=="function")return H;const{trigger:X,...ve}=H;return Object.keys(ve).length>0?ve:void 0},[ie]),ue=i.useMemo(()=>{const H={...R};return delete H.token,delete H.styles,delete H.repeatUpload,delete H.buttonText,H},[R]),fe=i.useCallback(H=>H.size/1024/1024<v?!0:(V.message.error(`文件大小不能超过 ${v}MB`),!1),[v]),me=i.useCallback(async H=>{const{file:X,onSuccess:ve,onError:ce,onProgress:J}=H;if(Ue().upload)try{J==null||J({percent:30});const be=await zt(X,{url:C,headers:{Authorization:Nt()?`Bearer ${Nt()}`:""},form:m==null?void 0:m.form,query:m==null?void 0:m.query});J==null||J({percent:100}),ve==null||ve(be,X)}catch(be){ce==null||ce(be),V.message.error("上传失败")}else ce==null||ce(new Error("Upload handler not configured")),V.message.warning("上传功能未配置")},[C,m]),ee=i.useCallback(H=>{if(h){h(H);return}let X=Array.isArray(H.fileList)?B(H.fileList):H.fileList;const ve=Array.isArray(X)&&X.some(he=>(he==null?void 0:he.status)==="uploading");q&&typeof K=="number"&&Array.isArray(X)&&X.length>K&&!ve&&(X=B([...X.slice(0,K-1),X[X.length-1]]));const ce=Array.isArray(X)?T(X):[];$&&M&&(ce.length>0||!Array.isArray(X)||X.length===0)?(k($,M,ce),_(null)):ve?_(X):X.length===0&&_(null),y&&N(X),s&&S&&A(S,se(s,{file:H.file,fileList:X,src:ce}))},[h,$,M,k,y,N,s,S,A,B,T,q,K]),W=i.useCallback(()=>{l&&N(P)},[l,N,P]),te=i.useCallback(H=>{var he;const X=H.url||H.thumbUrl;if(!X)return"";const ve=((he=H.response)==null?void 0:he.src)??(typeof X=="string"?X:""),ce=Ue().viewRes,J=ve&&ce?ce(ve):X;return String(J).replace(/([?&])download=1(&|$)/,(be,ke,Oe)=>Oe?ke:"")},[]),ye=i.useCallback(H=>{var ce,J;const X=((ce=H.response)==null?void 0:ce.src)??H.name??"",ve=((J=String(X).split(".").pop())==null?void 0:J.toLowerCase())||"";return["webp","svg","png","gif","jpg","jpeg","jfif","bmp","ico","heic","heif"].includes(ve)||/^data:image\//.test(te(H))},[te]),[Q,oe]=i.useState({url:"",name:"",urls:[],current:0,open:!1}),xe=i.useCallback(H=>{const X=te(H);if(X)if(ye(H)&&(P!=null&&P.length)){const ve=P.filter(he=>ye(he)),ce=ve.map(he=>te(he)).filter(Boolean),J=ve.findIndex(he=>(he.uid||he.url)===(H.uid||H.url));oe({url:X,name:H.name,urls:ce,current:J>=0?J:0,open:!0})}else ye(H)||window.open(X,"_blank")},[te,ye,P]),$e=!!Ue().upload&&!d,_e=F.buttonText??a,Ee=F.listType??x.listType,Se=String((D==null?void 0:D.listDisplayText)??f??"").trim(),Ke=i.useMemo(()=>{const H=F.showUploadList;return Ee!=="text"||H===!1||!Se||!(P!=null&&P.length)?P:P.map(X=>({...X,name:Se}))},[P,Ee,F.showUploadList,Se]),Z=(P==null?void 0:P.length)??0,re=typeof K=="number"&&Z>=K,le=i.useCallback(H=>re&&!q?(V.message.warning(`最多只能上传 ${K} 个文件`),!1):fe(H),[re,q,K,fe]),Y=!re||q,ae=u.jsx(V.Upload,{...ue,styles:ne,disabled:n?!1:R.disabled,fileList:Ke,onChange:ee,onPreview:xe,beforeUpload:le,customRequest:$e?me:void 0,action:$e?void 0:d||C,openFileDialogOnClick:!n,children:Y&&(g||(Ee==="picture-card"||Ee==="picture-circle"?u.jsxs("button",{type:"button",style:{border:0,background:"none",...pe},children:[u.jsx(ze.PlusOutlined,{}),u.jsx("div",{style:{marginTop:8},children:_e})]}):u.jsx(V.Button,{icon:u.jsx(ze.UploadOutlined,{}),style:pe,children:_e})))});return u.jsxs("div",{onBlur:W,children:[G&&Object.keys(G).length>0?u.jsx(V.ConfigProvider,{theme:{components:{Upload:G}},children:ae}):ae,E&&u.jsx("div",{style:{color:"#ff4d4f",fontSize:12,marginTop:4},children:E}),Q.url&&u.jsx("div",{style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:Q.urls.length>1?u.jsx(V.Image.PreviewGroup,{preview:{current:Q.current,onOpenChange:H=>!H&&oe(X=>({...X,open:!1}))},children:Q.urls.map((H,X)=>u.jsx(V.Image,{src:H,style:{width:1,height:1},preview:{open:Q.open&&Q.current===X,onOpenChange:ve=>!ve&&oe(ce=>({...ce,open:!1}))}},X))}):u.jsx(V.Image,{src:Q.url,alt:Q.name,style:{width:1,height:1},preview:{open:Q.open,onOpenChange:H=>!H&&oe(X=>({...X,open:!1}))}})})]})},_s=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,selectAction:a,onChange:c,onSelect:l,value:y,defaultValue:h,options:p,remoteUrl:g,remoteOptions:C,searchAction:v,...m})=>{const f=O(T=>T.addCommand),d=O(T=>T.getDataSet),x=O(T=>T.setDataSet),b=i.useMemo(()=>de(e,o),[e,o]),[j,M]=i.useState(p||[]),[,S]=i.useState(!1),A=i.useRef(void 0),{get:k}=Xn(),$=i.useMemo(()=>{if(b&&r)return d(b,r)},[b,r,d]),D=i.useMemo(()=>$??y??h,[$,y,h]),w=i.useCallback(T=>{if(!(C!=null&&C.queryApi)){p&&M(p.filter(z=>{var B,L;return((B=z.value)==null?void 0:B.toString().toLowerCase().includes(T.toLowerCase()))||((L=z.label)==null?void 0:L.toString().toLowerCase().includes(T.toLowerCase()))}));return}A.current&&clearTimeout(A.current),A.current=setTimeout(async()=>{if(C!=null&&C.queryApi){S(!0);try{const{queryApi:z,keyWordParamName:B="keyword",valueKey:L="value",labelKey:_="label",fixedParams:I=[]}=C,P={};B&&(P[B]=T),Array.isArray(I)&&I.forEach(q=>{q.key&&(P[q.key]=q.value)});const R=await k(z,P);let F=[];Array.isArray(R)?F=R:R&&Array.isArray(R.data)?F=R.data:R&&R.data&&Array.isArray(R.data.records)?F=R.data.records:R&&R.result&&Array.isArray(R.result)&&(F=R.result);const K=F.map(q=>({value:q[L],label:q[_]||q[L],...q}));M(K)}catch(z){console.error("Failed to fetch remote options:",z),M([])}finally{S(!1)}}},500)},[C,p,k]);i.useEffect(()=>{!(C!=null&&C.queryApi)&&p&&M(p)},[p,C==null?void 0:C.queryApi]);const N=i.useCallback(T=>{if(c){c(T);return}if(b&&r&&x(b,r,T),s&&e){const{actionName:z,arg:B}=Te(s,T,{id:t,dataSet:o,dataSetField:r});f(e,se(z,B))}},[c,b,r,x,s,e,t,f]),E=i.useCallback((T,z)=>{if(l){l(T,z);return}a&&e&&f(e,se(a,{value:T,option:z}))},[l,a,e,f]);return u.jsx(V.AutoComplete,{...m,disabled:n?!1:m.disabled,open:n?!1:void 0,options:j,value:D,onChange:N,onSelect:E,onSearch:w,style:{width:"100%",...m.style}})},Os=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,submitAction:s,resetAction:a,showSubmit:c=!0,showReset:l=!0,submitText:y="提交",resetText:h="重置",onFinish:p,onReset:g,children:C,...v})=>{const[m]=V.Form.useForm(),f=O(M=>M.addCommand),d=O(M=>M.setDataSet),x=i.useMemo(()=>de(e,o),[e,o]),b=M=>{if(p){p(M);return}x&&r&&d(x,r,M),s&&e&&f(e,se(s,M))},j=()=>{if(m.resetFields(),g){g();return}a&&e&&f(e,se(a,null))};return u.jsxs(V.Form,{...v,form:m,onFinish:b,children:[C,(c||l)&&u.jsx(V.Form.Item,{children:u.jsxs(V.Space,{children:[c&&u.jsx(V.Button,{type:"primary",htmlType:"submit",children:y}),l&&u.jsx(V.Button,{onClick:j,children:h})]})})]})},Rs=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(V.Form.Item,{...r,children:o}),Qe=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{return JSON.parse(t)}catch{return e}return t},$s=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,dataSource:s,targetKeys:a,selectedKeys:c,disabled:l,showSearch:y,showSelectAll:h,oneWay:p,pagination:g,status:C,titles:v,actions:m,locale:f,changeAction:d,selectChangeAction:x,searchAction:b,scrollAction:j,onChange:M,onSelectChange:S,onSearch:A,onScroll:k,styles:$,token:D,...w})=>{const N=O(ee=>ee.addCommand),E=O(ee=>ee.getDataSet),T=O(ee=>ee.setDataSet),z=i.useMemo(()=>de(e,o),[e,o]),B=i.useMemo(()=>Qe($,{}),[$]),L=i.useMemo(()=>Qe(D,{}),[D]),_=i.useMemo(()=>Qe(v,["源列表","目标列表"]),[v]),I=i.useMemo(()=>Qe(m,[">","<"]),[m]),P=i.useMemo(()=>Qe(f,{itemUnit:"项",itemsUnit:"项",searchPlaceholder:"请输入搜索内容"}),[f]),R=i.useMemo(()=>Qe(g,!1),[g]),F=i.useMemo(()=>{if(z&&r){const ee=E(z,r);if(Array.isArray(ee))return ee}},[z,r,E]),K=i.useMemo(()=>{if(z&&r){const ee=E(z,`${r}.dataSource`);if(Array.isArray(ee))return ee}},[z,r,E]),q=i.useMemo(()=>n?K??Qe(s,[]):z?K??[]:Qe(s,[]),[n,z,K,s]),G=i.useMemo(()=>n?F??Qe(a,[]):z?F??[]:Qe(a,[]),[n,z,F,a]),ie=i.useMemo(()=>Qe(c,[]),[c]),pe=i.useCallback((ee,W,te)=>{if(M){M(ee,W,te);return}z&&r&&T(z,r,ee),d&&e&&N(e,se(d,{targetKeys:ee,direction:W,moveKeys:te}))},[M,z,r,T,d,e,N]),ne=i.useCallback((ee,W)=>{if(S){S(ee,W);return}x&&e&&N(e,se(x,{sourceSelectedKeys:ee,targetSelectedKeys:W}))},[S,x,e,N]),ue=i.useCallback((ee,W)=>{if(A){A(ee,W);return}b&&e&&N(e,se(b,{direction:ee,value:W}))},[A,b,e,N]),fe=i.useCallback((ee,W)=>{if(k){k(ee,W);return}j&&e&&N(e,se(j,{direction:ee}))},[k,j,e,N]),me=u.jsx(V.Transfer,{dataSource:q,targetKeys:G,selectedKeys:ie,disabled:l,showSearch:y,showSelectAll:h,oneWay:p,pagination:R,status:C||void 0,titles:_,actions:I,locale:P,onChange:pe,onSelectChange:ne,onSearch:ue,onScroll:fe,styles:B,render:ee=>ee.title,...w});return L&&Object.keys(L).length>0?u.jsx(V.ConfigProvider,{theme:{components:{Transfer:L}},children:me}):me},on=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{const n=t.trim();if(n.startsWith("[")||n.startsWith("{"))return JSON.parse(n)}catch{return e}return t},Bs=t=>{if(!t)return null;const e=Xe[t];return e?u.jsx(e,{}):null},Vs=t=>on(t,[]).map(n=>({label:n.label,value:n.value,icon:n.icon?Bs(n.icon):void 0,disabled:n.disabled})),Ls=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,options:s,value:a,defaultValue:c,block:l,disabled:y,size:h,vertical:p,shape:g,changeAction:C,onChange:v,styles:m,token:f,...d})=>{const x=O(E=>E.addCommand),b=O(E=>E.getDataSet),j=O(E=>E.setDataSet),M=i.useMemo(()=>de(e,o),[e,o]),S=i.useMemo(()=>on(m,{}),[m]),A=i.useMemo(()=>on(f,{}),[f]),k=i.useMemo(()=>Vs(s),[s]),D=i.useMemo(()=>{if(M&&r){const E=b(M,r);if(typeof E=="string")return E}},[M,r,b])??a,w=i.useCallback(E=>{const T=String(E);if(v){v(T);return}M&&r&&j(M,r,T),C&&e&&x(e,se(C,{value:T}))},[v,M,r,j,C,e,x]),N=u.jsx(V.Segmented,{...d,options:k,value:D,defaultValue:c,block:l,disabled:y,size:h,vertical:p,shape:g,onChange:w,styles:S});return A&&Object.keys(A).length>0?u.jsx(V.ConfigProvider,{theme:{components:{Segmented:A}},children:N}):N},Fs=(t,e,n)=>{const[o,r]=i.useState(void 0),s=e==="100%",a=i.useRef(0);return i.useLayoutEffect(()=>{if(!s||!t.current){r(void 0);return}const c=t.current,l=()=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>{const g=c.clientHeight;if(g===0)return;let C=0;const v=c.querySelector('[data-table-slot="title"]');v&&(C+=v.offsetHeight);const m=c.querySelector('[data-table-slot="footer"]');m&&(C+=m.offsetHeight);const f=c.querySelector(".ant-table-title");f&&(C+=f.offsetHeight);const d=c.querySelector(".ant-table-thead");if(d&&(C+=d.offsetHeight),n){const M=c.querySelector(".ant-pagination");if(M){const S=M,A=window.getComputedStyle(S),k=parseFloat(A.marginTop)||0,$=parseFloat(A.marginBottom)||0;C+=S.offsetHeight+k+$}}const x=c.querySelector(".ant-table-wrapper");if(x){const M=window.getComputedStyle(x),S=parseFloat(M.marginTop)||0,A=parseFloat(M.marginBottom)||0;C+=S+A}const b=g-C-2,j=Math.max(Math.floor(b),50);r(j)})};r(50);const y=setTimeout(l,16),h=new ResizeObserver(()=>{l()});h.observe(c);const p=new MutationObserver(()=>{l()});return p.observe(c,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}),()=>{clearTimeout(y),a.current&&cancelAnimationFrame(a.current),h.disconnect(),p.disconnect()}},[s,n]),s?o:e};function Ps(t){const e=t.ellipsis;return e===!0||e==="true"}function zs(t){const e=t.width;if(typeof e=="number"&&Number.isFinite(e)&&e>0)return e;if(typeof e=="string"){const n=e.trim();if(!n)return;const o=Number(n.replace(/px$/i,""));if(Number.isFinite(o)&&o>0)return o}}function Rn(t){if(t==null)return"";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return String(t)}catch{return""}}function Ks(t,e){try{const n=qe(t);return n.isValid()?e.dateFormat==="date"?n.format("YYYY-MM-DD"):e.dateFormat==="time"?n.format("HH:mm:ss"):n.format("YYYY-MM-DD HH:mm:ss"):""}catch{return""}}function qs(t,e){let n=parseFloat(t);if(isNaN(n))return"无效金额";const o=e.minDecimalPlace||0,r=e.maxDecimalPlace||2;Number.isInteger(n)&&o>0&&(n=parseFloat(n.toFixed(o)));let s=new Intl.NumberFormat("zh-CN",{style:"decimal",minimumFractionDigits:o,maximumFractionDigits:r,useGrouping:e.showCommaSeparator||!1}).format(n);return e.currencySymbol&&(s=e.currencySymbol+s),s}function Ws(t,e){if(t==null||t==="")return"";const n=e.arraySeparator||",";return Array.isArray(t)?t.join(n):String(t)}const Is={display:"block",width:"100%",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};function Mt(t,e){const n=u.jsx("div",{style:Is,children:t});return e?u.jsx(V.Tooltip,{title:e,placement:"topLeft",children:n}):n}const $n=new Map;function Ys(t){let e=$n.get(t);return e||(e=Kt(t),$n.set(t,e)),e}const Hs=({dictCode:t,value:e})=>{const[n,o]=i.useState(null);if(i.useEffect(()=>{if(!t){o([]);return}let s=!1;return Ys(t).then(a=>{s||o(a)}),()=>{s=!0}},[t]),e==null||e==="")return u.jsx("span",{});if(!n)return u.jsx("span",{children:String(e)});const r=et(n,e);return u.jsx("span",{children:(r==null?void 0:r.label)??String(e)})},Us=(t,e)=>{const n=e.columnDictType||e.dictType||"";return n?u.jsx(Hs,{dictCode:n,value:t}):u.jsx("span",{children:t!=null&&t!==""?String(t):""})},Gs=(t,e)=>{const[n,o]=(e.imageWidthHeight||"").split(/\s*[,,]\s*/),r=n||"50",s=o||"50";let a=[];return Array.isArray(t)?a=t.slice(0,3):typeof t=="string"&&t&&(a=[t]),a.length===0?u.jsx("span",{children:"无图片"}):a.length===1?u.jsx(V.Image,{src:a[0],alt:"image",width:r,height:s,preview:{src:a[0]}}):u.jsx(V.Image.PreviewGroup,{children:a.map((c,l)=>u.jsx(V.Image,{src:c,alt:`image-${l}`,width:r,height:s,style:{marginRight:8,marginBottom:8}},l))})},Js=(t,e)=>{let n=parseFloat(t);if(isNaN(n))return u.jsx("span",{children:"无效金额"});const o=e.currencySymbol||"",r=e.showCommaSeparator||!1,s=e.minDecimalPlace||0,a=e.maxDecimalPlace||2;Number.isInteger(n)&&s>0&&(n=parseFloat(n.toFixed(s)));const c={style:"decimal",minimumFractionDigits:s,maximumFractionDigits:a,useGrouping:r};let l=new Intl.NumberFormat("zh-CN",c).format(n);return o&&(l=o+l),u.jsx("span",{children:l})},Qs=(t,e)=>{let n="";try{const o=qe(t);o.isValid()&&(e.dateFormat==="date"?n=o.format("YYYY-MM-DD"):e.dateFormat==="time"?n=o.format("HH:mm:ss"):(e.dateFormat,n=o.format("YYYY-MM-DD HH:mm:ss")))}catch{n=""}return u.jsx("span",{children:n})},Zs=(t,e)=>{if(t==null||t==="")return u.jsx("span",{});const n=e.arraySeparator||",";return Array.isArray(t)?u.jsx("span",{children:t.join(n)}):u.jsx("span",{children:String(t)})};function _t(t){return typeof t.dataIndex=="string"?t.dataIndex:Array.isArray(t.dataIndex)?t.dataIndex.join("."):typeof t.key=="string"||typeof t.key=="number"?String(t.key):""}const Xs=(t,e,n,o)=>{const r=_t(e);return u.jsx(rr,{value:t??"",onChange:s=>{!r||!(o!=null&&o.onCellValueChange)||o.onCellValueChange(n,r,s)}})},ei=(t,e,n,o)=>{const r=_t(e),s=t===""||t===null||t===void 0?null:typeof t=="number"?t:Number(t),a=s===null||Number.isNaN(s)?null:s;return u.jsx(or,{value:a,onChange:c=>{!r||!(o!=null&&o.onCellValueChange)||o.onCellValueChange(n,r,c)}})};function ti(t){const e=t.dateFormat;return e==="time"?{pickerType:"time",valueFormat:"HH:mm:ss"}:e==="datetime"?{pickerType:"datetime",valueFormat:"YYYY-MM-DD HH:mm:ss"}:{pickerType:"date",valueFormat:"YYYY-MM-DD"}}function ni(t,e){if(t==null||t==="")return null;if(qe.isDayjs(t))return t.isValid()?t:null;if(typeof t=="string"){const o=qe(t,e,!0);if(o.isValid())return o;const r=qe(t);return r.isValid()?r:null}const n=qe(t);return n.isValid()?n:null}const ri=(t,e,n,o)=>{const r=_t(e),{pickerType:s,valueFormat:a}=ti(e),c=ni(t,a),l=h=>{if(!r||!(o!=null&&o.onCellValueChange))return;const p=h&&h.isValid()?h.format(a):"";o.onCellValueChange(n,r,p)},y={width:"100%"};return s==="time"?u.jsx(V.TimePicker,{value:c,onChange:l,format:a,style:y}):s==="datetime"?u.jsx(V.DatePicker,{value:c,onChange:l,showTime:!0,format:a,style:y}):u.jsx(V.DatePicker,{value:c,onChange:l,format:a,style:y})};function oi(t){return t==null||t===""?[]:Array.isArray(t)?t.map(e=>{var n;return typeof e=="string"?e:e&&typeof e=="object"?((n=e.response)==null?void 0:n.src)??e.src??e.url??e.thumbUrl??"":""}).filter(e=>typeof e=="string"&&e):typeof t=="string"?[t]:[]}const si=(t,e,n,o)=>{const r=_t(e),s=oi(t),a=Math.max(1,Number(e.uploadMaxCount)||1),c=Math.max(1,Number(e.uploadMaxSize)||10),l=(e.uploadPreviewAction||"").trim(),y=e.uploadButtonText||"上传",h=s.length>=a,p=f=>f.size/1024/1024>=c?(V.message.error(`文件大小不能超过 ${c}MB`),!1):!0,g=async f=>{const{file:d,onSuccess:x,onError:b,onProgress:j}=f;if(!Ue().upload){b==null||b(new Error("Upload handler not configured")),V.message.warning("上传功能未配置");return}try{j==null||j({percent:30});const S=Nt(),A=await zt(d,{headers:S?{Authorization:`Bearer ${S}`}:void 0});j==null||j({percent:100}),x==null||x(A,d)}catch(S){b==null||b(S),V.message.error("上传失败")}},C=f=>{var b;if(!(f!=null&&f.file)||f.file.status!=="done"||!r||!(o!=null&&o.onCellValueChange))return;const d=(b=f.file.response)==null?void 0:b.src;if(typeof d!="string"||!d)return;const x=[...s,d].slice(0,a);o.onCellValueChange(n,r,x)},v=()=>{!l||!(o!=null&&o.runAction)||s.length===0||o.runAction(l,{record:{...n},srcs:[...s],src:s[0],dataIndex:r})},m=s.length>1?`预览(${s.length})`:"预览";return u.jsxs(V.Space,{size:4,children:[l&&s.length>0&&u.jsx("a",{onClick:v,children:m}),!h&&u.jsx(V.Upload,{showUploadList:!1,accept:e.uploadAccept||void 0,beforeUpload:p,customRequest:g,onChange:C,children:u.jsx(V.Button,{size:"small",icon:u.jsx(ze.UploadOutlined,{}),children:y})})]})},ii=(t,e,n,o)=>{const r=_t(e),s=e.columnDictType||e.dictType||"",a=t===""||t===null||t===void 0?void 0:t;return u.jsx(sr,{enableDict:!!s,dictType:s||void 0,value:a,onChange:c=>{!r||!(o!=null&&o.onCellValueChange)||o.onCellValueChange(n,r,c)}})};function ai(t){const e=[16,16];if(t==null||t==="")return e;let n=[];if(Array.isArray(t))n=t;else if(typeof t=="string")try{const s=JSON.parse(t);if(Array.isArray(s))n=s;else return e}catch{return e}else return e;const o=Number(n[0]),r=Number(n[1]);return!Number.isFinite(o)||!Number.isFinite(r)?e:[Math.max(1,o),Math.max(1,r)]}function ci(t){return!!(t==null||t===""||Array.isArray(t)&&t.length===0)}const li=(t,e,n,o)=>{var p;if(ci(t))return u.jsx("span",{});const r=(p=e.columnIcon)==null?void 0:p.trim();if(!r)return u.jsx("span",{});const s=Xe[r];if(!s)return u.jsx("span",{});const[a,c]=ai(e.iconSize),l=(e.iconClickAction||"").trim(),y=o==null?void 0:o.runAction,h=u.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:a,height:c},children:u.jsx(s,{style:{fontSize:Math.min(a,c)}})});return l&&y?u.jsx("span",{role:"button",tabIndex:0,style:{cursor:"pointer",display:"flex"},onClick:()=>y(l,{...n}),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),y(l,{...n}))},children:h}):h},ui=(t,e)=>{const n={...t},o=Ps(n),r=zs(n);if(r!==void 0){const s=n.onCell,a=n.onHeaderCell,c={maxWidth:r,overflow:"hidden",boxSizing:"border-box"};n.onCell=(l,y)=>{const h=(s?s(l,y):void 0)||{};return{...h,style:{...h.style||{},...c}}},n.onHeaderCell=(l,y)=>{const h=(a?a(l,y):void 0)||{};return{...h,style:{...h.style||{},...c}}}}if(n.specialFields===!0&&n.renderType)n.render=(s,a,c)=>{switch(n.renderType){case"image":return Gs(s,n);case"money":{const l=Js(s,n);return o?Mt(l,qs(s,n)):l}case"date":{const l=Qs(s,n);return o?Mt(l,Ks(s,n)):l}case"array":{const l=Zs(s,n);return o?Mt(l,Ws(s,n)):l}case"dict":{const l=Us(s,n);return o?Mt(l,Rn(s)):l}case"icon":return li(s,n,a,e);case"input":return Xs(s,n,a,e);case"inputNumber":return ei(s,n,a,e);case"dateInput":return ri(s,n,a,e);case"uploadInput":return si(s,n,a,e);case"selectInput":return ii(s,n,a,e);default:return s}};else if(o){const s=n.render;n.render=(a,c,l)=>{const y=s?s(a,c,l):a??"";return Mt(y,Rn(a))}}return o&&(n.ellipsis=!1),n},Ht=15,At=10,di=[{value:"small",label:"紧凑"},{value:"middle",label:"默认"},{value:"large",label:"宽松"}];function Bn(t,e,n,o){const r={};return e.forEach(s=>{s.width!==void 0&&(r[s.key]=s.width)}),{rowIndexVisible:t,order:e.map(s=>s.key),visible:e.reduce((s,a)=>(s[a.key]=a.visible,s),{}),fixed:e.reduce((s,a)=>(a.fixed&&(s[a.key]=a.fixed),s),{}),width:Object.keys(r).length?r:void 0,scrollX:n,size:o}}function fi(t,e,n,o){const r=(t==null?void 0:t.order)??e.map(p=>p.key),s=(t==null?void 0:t.visible)??{},a=(t==null?void 0:t.fixed)??{},c=(t==null?void 0:t.width)??{},l=new Map(e.map(p=>[p.key,p])),y=[],h=new Set;for(const p of r){const g=l.get(p);g&&(h.add(p),y.push({key:g.key,title:g.title,visible:s[p]??g.visible,fixed:a[p]??g.fixed,width:c[p]??g.width}))}for(const p of e)h.has(p.key)||y.push({...p,visible:s[p.key]??p.visible,fixed:a[p.key]??p.fixed,width:c[p.key]??p.width});return{rowIndexVisible:(t==null?void 0:t.rowIndexVisible)??n,items:y,scrollX:t==null?void 0:t.scrollX,size:(t==null?void 0:t.size)??o??"middle"}}const Ut=420,Vn=440,mi=({open:t,position:e,rowIndexVisible:n,columnItems:o,defaultRowIndexVisible:r,defaultColumnItems:s,scrollX:a=!1,defaultScrollX:c=!1,size:l="middle",defaultSize:y="middle",onSave:h,onClose:p})=>{const[g,C]=i.useState(n),[v,m]=i.useState(o),[f,d]=i.useState(a),[x,b]=i.useState(l),[j,M]=i.useState(null);i.useEffect(()=>{t&&(C(n),m([...o]),d(a),b(l))},[t,n,o,a,l]);const S=i.useCallback(R=>{queueMicrotask(()=>h(R))},[h]),A=i.useCallback((R,F,K,q)=>Bn(R,F,K??f,q??x),[f,x]),k=i.useCallback(()=>{C(r);const R=s.map(F=>({...F}));m(R),d(c),b(y),S(Bn(r,R,c,y))},[r,s,c,y,S]),$=i.useCallback(R=>{m(F=>{const K=F.map(q=>q.key===R?{...q,visible:!q.visible}:q);return S(A(g,K)),K})},[g,A,S]),D=i.useCallback((R,F)=>{m(K=>{const q=K.map(G=>G.key===R?{...G,fixed:F}:G);return S(A(g,q)),q})},[g,A,S]),w=i.useCallback((R,F)=>{m(K=>{const q=K.map(G=>G.key===R?{...G,width:F}:G);return S(A(g,q)),q})},[g,A,S]),N=i.useCallback((R,F)=>{m(K=>{const q=K.find(ne=>ne.key===R);if(!q)return K;const G=typeof q.width=="number"?q.width:80,ie=Math.max(Ht,G+F),pe=K.map(ne=>ne.key===R?{...ne,width:ie}:ne);return S(A(g,pe)),pe})},[g,A,S]),E=i.useCallback((R,F)=>{if(F<0||F>=v.length)return;const K=[...v],[q]=K.splice(R,1);K.splice(F,0,q),m(K),S(A(g,K))},[v,g,A,S]),T=i.useCallback(R=>{C(R),S(A(R,v))},[v,A,S]),z=i.useCallback(R=>{d(R),S(A(g,v,R,x))},[g,v,x,A,S]),B=i.useCallback(R=>{b(R),S(A(g,v,f,R))},[g,v,f,A,S]),L=R=>F=>{M(R),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",String(R))},_=R=>F=>{F.preventDefault(),F.dataTransfer.dropEffect="move",!(j===null||j===R)&&(E(j,R),M(R))},I=()=>M(null),P=e!=null?(()=>{let R=e.y,F=e.x;return typeof window<"u"&&(F+Ut>window.innerWidth&&(F=window.innerWidth-Ut-16),F<16&&(F=16),R+Vn>window.innerHeight&&(R=Math.max(16,window.innerHeight-Vn-16)),R<16&&(R=16)),{margin:0,top:R,left:F}})():void 0;return u.jsx(V.Modal,{title:"列设置",open:t,onCancel:p,footer:null,width:Ut,destroyOnHidden:!0,centered:e==null,style:P,mask:!1,className:`and-table-column-setting-modal${e!=null?" and-table-column-setting-modal-positioned":""}`,children:u.jsxs("div",{className:"and-table-column-setting-body",children:[u.jsx("div",{className:"and-table-column-setting-header",children:u.jsxs("div",{className:"and-table-column-setting-header-row",children:[u.jsx(V.Checkbox,{checked:g,onChange:R=>T(R.target.checked),children:"序号列"}),u.jsx(V.Checkbox,{checked:f,onChange:R=>z(R.target.checked),children:"自动滚动"}),u.jsxs(V.Space,{align:"center",children:[u.jsx("span",{className:"and-table-column-setting-label",children:"表格"}),u.jsx(V.Select,{size:"small",value:x,onChange:B,options:[...di],style:{width:80}})]})]})}),u.jsx("div",{className:"and-table-column-setting-list-wrap",children:u.jsxs("table",{className:"and-table-column-setting-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{className:"and-table-column-setting-th-drag",children:"排序"}),u.jsx("th",{className:"and-table-column-setting-th-name",children:"列名/可见"}),u.jsx("th",{className:"and-table-column-setting-th-width",children:"宽度(px)"}),u.jsx("th",{className:"and-table-column-setting-th-fix",children:"固定"})]})}),u.jsx("tbody",{children:v.map((R,F)=>{const K=typeof R.width=="number"?R.width:null,q=R.width==="auto"||R.width===void 0&&K===null;return u.jsxs("tr",{className:`and-table-column-setting-row ${j===F?"and-table-column-setting-row-dragging":""}`,draggable:!0,onDragStart:L(F),onDragOver:_(F),onDragEnd:I,children:[u.jsx("td",{className:"and-table-column-setting-td-drag",children:u.jsx("span",{className:"and-table-column-setting-drag",title:"拖动排序",children:u.jsx(ze.MenuOutlined,{})})}),u.jsxs("td",{className:"and-table-column-setting-td-name",children:[u.jsx(V.Checkbox,{checked:R.visible,onChange:()=>$(R.key)}),u.jsx("span",{className:"and-table-column-setting-title",title:R.title,children:R.title})]}),u.jsx("td",{className:"and-table-column-setting-td-width",children:u.jsxs("div",{className:"and-table-column-setting-width",children:[u.jsx("span",{className:"and-table-column-setting-fix-btn",onClick:()=>N(R.key,-At),title:`减 ${At}px`,children:u.jsx(ze.MinusOutlined,{})}),u.jsx(V.InputNumber,{size:"small",min:Ht,step:At,value:q?void 0:K??80,placeholder:"auto",controls:!1,style:{width:44},onChange:G=>{G==null||typeof G=="string"&&G===""?w(R.key,"auto"):w(R.key,Math.max(Ht,Number(G)))}}),u.jsx("span",{className:"and-table-column-setting-fix-btn",onClick:()=>N(R.key,At),title:`加 ${At}px`,children:u.jsx(ze.PlusOutlined,{})})]})}),u.jsx("td",{className:"and-table-column-setting-td-fix",children:u.jsxs(V.Space,{className:"and-table-column-setting-fix",children:[u.jsx("span",{className:`and-table-column-setting-fix-btn ${R.fixed==="left"?"active":""}`,onClick:()=>D(R.key,R.fixed==="left"?!1:"left"),title:"固定到左侧",children:u.jsx(ze.LeftOutlined,{})}),u.jsx("span",{className:"and-table-column-setting-fix-divider",children:"|"}),u.jsx("span",{className:`and-table-column-setting-fix-btn ${R.fixed==="right"?"active":""}`,onClick:()=>D(R.key,R.fixed==="right"?!1:"right"),title:"固定到右侧",children:u.jsx(ze.RightOutlined,{})})]})})]},R.key)})})]})}),u.jsx("div",{className:"and-table-column-setting-footer",children:u.jsx(V.Button,{onClick:k,children:"重置"})})]})})},yi=256,hi=[/__proto__/,/constructor\s*[.[(]/,/globalThis/],Ln=new Map,gi=t=>{const e=Ln.get(t);if(e)return e;try{const n=new Function("row",`with(row){ return (${t}); }`);return Ln.set(t,n),n}catch(n){return typeof console<"u"&&console.warn("[AndTable] visibleExpression compile failed:",t,n),null}},pi=(t,e)=>{if(e==null)return!0;const n=String(e).trim();if(!n)return!0;if(n.length>yi||hi.some(r=>r.test(n)))return!1;const o=gi(n);if(!o)return!1;try{return!!o(t&&typeof t=="object"?t:{})}catch(r){return typeof console<"u"&&console.warn("[AndTable] visibleExpression eval failed:",n,r),!1}},vi=["value","validateStatus","help","dataSource","children","id","sessionId","develop","dataSet","dataSetField"],bi=t=>{const{id:e,sessionId:n}=t,o=O(U=>{var ge;return n&&e?((ge=U.propsStore[`${n}_props`])==null?void 0:ge[e])??null:null}),r=i.useMemo(()=>Ye({...t},o??void 0,{skipKeys:[...vi]}),[t,o]),{develop:s,dataSet:a,dataSetField:c,columns:l=[],operateColumns:y=[],sampleData:h,operationColumnVisible:p=!0,operationColumnSettings:g,selectRowEnable:C,singleSelectMode:v,selectAction:m,rowKeyField:f="id",displayRowIndex:d,queryAction:x,pagination:b,emptyText:j,bordered:M,size:S,sticky:A,scroll:k,autoFillHeight:$,showTitle:D,showSummary:w,showFooter:N,renderTitle:E,renderSummary:T,renderFooter:z,children:B,token:L,columnSettingOpenKey:_,columnSettingsKey:I,...P}=r,R=O(U=>U.addCommand),F=O(U=>U.getDataSet),K=O(U=>U.setDataSet),[q,G]=i.useState([]),ie=i.useRef(null),[pe,ne]=i.useState(void 0),ue=i.useCallback((U,ge,De)=>{if(!ge)return U;const Me=ge.split(".").filter(Boolean);if(Me.length===0)return U;const Ce={...U};let je=Ce;for(let we=0;we<Me.length-1;we+=1){const Pe=Me[we],Ve=je[Pe];je[Pe]=Ve&&typeof Ve=="object"?{...Ve}:{},je=je[Pe]}return je[Me[Me.length-1]]=De,Ce},[]),fe=i.useCallback((U,ge)=>{if(U==null)return ge;if(typeof U=="string")try{return JSON.parse(U)??ge}catch{return ge}return U},[]),me=i.useMemo(()=>Array.isArray(l)?l:[],[l]),ee=i.useMemo(()=>Array.isArray(y)?y:[],[y]),W=i.useMemo(()=>({dataSet:de(n,a),pagination:a?de(n,`${a}_pagination`):void 0,selected:a?de(n,`${a}_selected`):void 0,columnSettingOpen:a&&n?de(n,`${a}_columnSettingOpen`):void 0,columnSettings:a&&n?de(n,`${a}_columnSettings`):void 0}),[n,a]),{style:te,className:ye,...Q}=P,oe=i.useMemo(()=>{if(k)return k;let U=Q["scroll-x"],ge=Q["scroll-y"];if(String(U)==="true"?U=!0:String(U)==="false"||U==="__unset__"?U=void 0:U==="max-content"&&(U="max-content"),(ge===""||ge===null||ge===void 0)&&(ge=void 0),U!==void 0||ge!==void 0)return{x:U,y:ge}},[k,Q["scroll-x"],Q["scroll-y"]]),xe=O(U=>{var ge;return W.columnSettingOpen?((ge=U.dataSets[W.columnSettingOpen])==null?void 0:ge.value)===!0:!1}),Ne=420;i.useLayoutEffect(()=>{if(!xe||!ie.current)return;const U=ie.current.querySelector(".ant-table-thead")||ie.current.querySelector(".ant-table-header");if(!U)return;const ge=U.getBoundingClientRect();ne({x:ge.right-Ne,y:ge.bottom+8})},[xe]);const $e=O(U=>{var De;const ge=W.columnSettings?(De=U.dataSets[W.columnSettings])==null?void 0:De.value:void 0;return typeof ge=="object"&&ge!==null?ge:void 0}),_e=Hn(W.dataSet,c),Ee=i.useMemo(()=>s?(h==null?void 0:h.data)||[]:W.dataSet?_e:(h==null?void 0:h.data)||[],[s,W.dataSet,_e,h==null?void 0:h.data]),Se=i.useMemo(()=>fe(L,{}),[L,fe]),Ke=Se&&Object.keys(Se).length>0,Z=i.useMemo(()=>Ke?{components:{Table:Se}}:void 0,[Ke,Se]),re=O(U=>W.pagination?U.dataSets[W.pagination]:void 0),le=i.useMemo(()=>W.pagination?F(W.pagination,"")||{}:{},[W.pagination,F,re]),Y=i.useMemo(()=>!(b===!1||typeof b=="object"&&(b==null?void 0:b.visible)===!1),[b]),ae=Fs(ie,oe==null?void 0:oe.y,Y),H=i.useMemo(()=>{if(!Y)return!1;const U=typeof b=="object"?b:{},ge=P||{},De=U.showSizeChanger??ge["pagination-showSizeChanger"]??!0,Me=U.showQuickJumper??ge["pagination-showQuickJumper"]??!1,Ce=U.simple??ge["pagination-simple"]??!1,je=U.defaultPageSize??ge["pagination-defaultPageSize"]??10,we=U.pageSizeOptions??ge["pagination-pageSizeOptions"]??"10,20,50,100",Pe=typeof we=="string"?we.split(",").map(Ve=>parseInt(String(Ve).trim(),10)||10).filter(Ve=>!isNaN(Ve)):Array.isArray(we)?we:[10,20,50,100];return{...le,showSizeChanger:De,showQuickJumper:Me,simple:Ce,defaultPageSize:je,pageSizeOptions:Pe,showTotal:(Ve,Be)=>(U.showTotal||"共 ${total} 条").replace("${total}",String(Ve)).replace("${range[0]}",String(Be[0])).replace("${range[1]}",String(Be[1])).replace("${range}",`${Be[0]}-${Be[1]}`),onChange:(Ve,Be)=>{W.pagination&&K(W.pagination,"",{...le,current:Ve,pageSize:Be}),x&&n&&R(n,se(x,null))},hideOnSinglePage:!1}},[Y,b,P,le,W.pagination,K,x,n,R]),X=i.useCallback((U,ge)=>{n&&R(n,se(U.action,{...ge}))},[n,R]),ve=i.useMemo(()=>{let U=g;if(typeof U=="string"){const Ce=U.trim();if(!Ce)U=void 0;else try{U=JSON.parse(Ce)}catch{U=void 0}}const ge=!!(U&&typeof U=="object"&&(U.useCompact===!0||U.useCompact==="true")),De={},Me=U&&typeof U=="object"?U.actionSettings:void 0;if(Me&&typeof Me=="object"&&Object.entries(Me).forEach(([Ce,je])=>{if(!Ce||!je||typeof je!="object")return;const we={};je.styles&&typeof je.styles=="object"&&!Array.isArray(je.styles)&&(we.styles=je.styles),je.classNames&&typeof je.classNames=="object"&&!Array.isArray(je.classNames)&&(we.classNames=je.classNames),(we.styles||we.classNames)&&(De[Ce]=we)}),Object.keys(De).length===0&&U&&typeof U=="object"){const Ce=Array.isArray(U.buttonStyles)?U.buttonStyles:null;Ce&&ee.forEach((je,we)=>{const Pe=je==null?void 0:je.key;if(!Pe)return;const Ve=Ce[we];Ve&&typeof Ve=="object"&&!Array.isArray(Ve)&&(De[Pe]={styles:Ve})})}return{useCompact:ge,actionSettings:De}},[g,ee]),ce=i.useCallback((U,ge)=>{n&&U&&R(n,se(U,ge))},[n,R]),J=i.useCallback((U,ge,De)=>{if(!W.dataSet)return;const Me=c&&String(c).trim()!==""?c:"",Ce=U==null?void 0:U[f],je=Ee.map(we=>(Ce!=null?(we==null?void 0:we[f])===Ce:we===U)?ue(we??{},ge,De):we);K(W.dataSet,Me,je,!1)},[W.dataSet,c,f,Ee,K,ue]),he=i.useMemo(()=>me.map(U=>{let ge=!1;U.fixed===!0||U.fixed==="left"?ge="left":U.fixed==="right"&&(ge="right");const De=U.width;return{key:String(U.key??U.dataIndex??""),title:typeof U.title=="string"?U.title:"列",visible:U.visible!==!1,fixed:ge,width:typeof De=="number"?De:"auto"}}).filter(U=>U.key),[me]),be=d===!0,ke=!1,Oe=S==="small"||S==="large"?S:"middle",{rowIndexVisible:He,items:ft,scrollX:mt,size:fn}=i.useMemo(()=>fi($e,he,be,Oe),[$e,he,be,Oe]),yt=!!(a&&n),fr=i.useMemo(()=>{if(mt!==void 0)return mt;const U=oe==null?void 0:oe.x;return U===!0||typeof U=="number"&&Number.isFinite(U)&&U>0?!0:U==="max-content"?!1:ke},[mt,oe==null?void 0:oe.x,ke]),mn=i.useMemo(()=>yt?mt!==void 0?mt?!0:"max-content":(oe==null?void 0:oe.x)!==void 0?oe.x:"max-content":oe==null?void 0:oe.x,[yt,mt,oe==null?void 0:oe.x,ke]),Ot=i.useMemo(()=>{const U=[];He&&U.push({title:"序号",key:"rowIndex",width:60,align:"center",render:(Me,Ce,je)=>{const we=le.current||1,Pe=le.pageSize||10;return(we-1)*Pe+je+1}});const ge=new Map(me.map(Me=>[String(Me.key??Me.dataIndex??""),Me]));if(ft.filter(Me=>Me.visible).forEach(Me=>{const Ce=ge.get(Me.key);if(!Ce)return;const je=Me.fixed||void 0,we=Me.width==="auto"||Me.width===void 0?void 0:Me.width;U.push(ui({...Ce,dataIndex:Ce.dataIndex||Ce.key,fixed:je||Ce.fixed,width:we??Ce.width},{runAction:ce,onCellValueChange:J}))}),p!==!1&&ee.length>0){const{useCompact:Me,actionSettings:Ce}=ve,je=we=>{const Pe=we==null?void 0:we.key;return Pe?Ce[Pe]:void 0};U.push({title:"操作",key:"action",render:(we,Pe)=>{const Ve=ee.map((Be,ht)=>({action:Be,idx:ht})).filter(({action:Be})=>pi(Pe,Be.visibleExpression));return Ve.length===0?null:Me?u.jsx(V.Space.Compact,{children:Ve.map(({action:Be,idx:ht})=>{const gt=je(Be);return u.jsx(V.Tooltip,{title:Be.tooltip,children:u.jsx(V.Button,{size:"small",onClick:()=>X(Be,Pe),styles:gt==null?void 0:gt.styles,classNames:gt==null?void 0:gt.classNames,children:Be.title})},Be.key??ht)})}):u.jsx(V.Space,{children:Ve.map(({action:Be,idx:ht})=>u.jsx(V.Tooltip,{title:Be.tooltip,children:u.jsx("a",{onClick:()=>X(Be,Pe),style:{marginRight:5},children:Be.title})},Be.key??ht))})}})}return U},[me,ee,He,ft,p,ve,le,X,ce,J]),mr=i.useCallback(()=>{W.columnSettingOpen&&K(W.columnSettingOpen,"",!1)},[W.columnSettingOpen,K]),yr=i.useCallback(U=>{W.columnSettings&&K(W.columnSettings,"value",U)},[W.columnSettings,K]),hr=i.useMemo(()=>{if(!v&&C)return{selectedRowKeys:q,onChange:(U,ge,De)=>{G(U),W.selected&&K(W.selected,"",U),m!=null&&m.trim()&&n&&R(n,se(m.trim(),{selectedRowKeys:U,selectedRows:ge,info:De}))}}},[C,v,q,W.selected,K,m,n,R]),yn=i.useCallback(U=>{if(!v)return;const De=[U[f]];G(De),W.selected&&K(W.selected,"",De),m!=null&&m.trim()&&n&&R(n,se(m.trim(),{record:U,selectedRowKeys:De}))},[v,m,n,f,W.selected,K,R]),gr=i.useCallback(U=>v&&q.includes(U[f])?"ant-table-row-selected":"",[v,f,q]),pr=i.useCallback(U=>v?{onClick:()=>yn(U),style:{cursor:"pointer"}}:{},[v,yn]),vr=i.useMemo(()=>{if(!oe&&!yt)return;const U=mn,ge=(oe==null?void 0:oe.y)==="100%"?ae:oe==null?void 0:oe.y;return U!==void 0||ge!==void 0?{x:U,y:ge}:oe?oe.y==="100%"?{x:oe.x,y:ae}:oe:void 0},[oe,ae,yt,mn]),{titleSlot:Rt,summarySlot:$t,footerSlot:hn,otherChildren:br}=i.useMemo(()=>{let U=null,ge=null,De=null;const Me=[];return i.Children.forEach(B,Ce=>{if(!i.isValidElement(Ce)){Me.push(Ce);return}const je=Ce.props["data-slot-type"];je==="title"?U=Ce:je==="summary"?ge=Ce:je==="footer"?De=Ce:Me.push(Ce)}),{titleSlot:U,summarySlot:ge,footerSlot:De,otherChildren:Me}},[B]),xr=i.useMemo(()=>{if(!Rt){if(E)return E;if(D&&s)return()=>u.jsx("div",{"data-table-slot-container":"title",style:{minHeight:20}})}},[D,Rt,E,s]),Sr=i.useMemo(()=>{if(T)return T;if(w&&$t)return()=>u.jsx("tr",{children:u.jsx("td",{colSpan:Ot.length,style:{padding:0},children:$t})});if(w&&s)return()=>u.jsx("tr",{children:u.jsx("td",{colSpan:Ot.length,style:{padding:0},children:u.jsx("div",{"data-table-slot-container":"summary",style:{minHeight:20}})})})},[w,$t,T,Ot.length,s]),Cr=yt?fn:S,gn=u.jsx(V.Table,{...Q,columns:Ot,dataSource:Ee,rowKey:f,rowSelection:hr,rowClassName:gr,pagination:H,locale:{emptyText:j},bordered:M,size:Cr,sticky:A,scroll:vr,title:xr,summary:Sr,footer:void 0,onRow:pr});return u.jsxs(V.Flex,{ref:ie,vertical:!0,style:{width:"100%",height:"100%",...te},className:ye,children:[Rt&&u.jsx("div",{"data-table-slot":"title",children:Rt}),u.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[v&&(()=>{const U=(Se==null?void 0:Se.rowSelectedBg)||"#e6f4ff",ge=(Se==null?void 0:Se.rowSelectedHoverBg)||(Se==null?void 0:Se.rowSelectedBg)||"#bae0ff",De=Se==null?void 0:Se.rowSelectedColor,Me=(Se==null?void 0:Se.rowSelectedLinkColor)??De,Ce=(Se==null?void 0:Se.rowSelectedLinkHoverColor)??Me;return u.jsx("style",{children:`
13
13
  .ant-table-row-selected > td {
14
14
  background: ${U} !important;
15
15
  ${De?`color: ${De};`:""}
@@ -19,6 +19,6 @@
19
19
  }
20
20
  ${Me?`.ant-table-row-selected > td a { color: ${Me}; }`:""}
21
21
  ${Ce?`.ant-table-row-selected > td a:hover { color: ${Ce}; }`:""}
22
- `})})(),Z?u.jsx(F.ConfigProvider,{theme:Z,children:hn}):hn]}),Ot,yn&&u.jsx("div",{"data-table-slot":"footer",children:yn}),vr,yt&&u.jsx(ai,{open:xe,position:pe,rowIndexVisible:He,columnItems:ft,defaultRowIndexVisible:be,defaultColumnItems:he,scrollX:dr,defaultScrollX:ke,size:dn,defaultSize:Oe,onSave:mr,onClose:fr})]})},{Text:yi}=F.Typography,hi=({id:t,sessionId:e,develop:n,content:o,children:r,dataSet:s,dataSetField:a,fontSize:c,color:l,dictCode:y,formatType:h,formatValue:p,fallbackDisplay:g=!1,styles:x,token:v,clickAction:f,stopClickPropagation:m,index:d,...C})=>{const b=O(Q=>Q.addCommand),w=i.useContext(qe),M=d??(w==null?void 0:w.index),S=w==null?void 0:w.parentIndex,A=typeof s=="string"&&s.trim()!=="",k=typeof a=="string"&&a.trim()!=="",$=A||k||y==="selectedCount",D=tt($?s:void 0,$?a:void 0,e),j=e??D.sessionId,N=O(Q=>Q.getDataSet),E=i.useMemo(()=>j?ct(t,w,d):null,[j,t,w==null?void 0:w.parentIndex,w==null?void 0:w.index,d]),T=O(Q=>{var oe;return E?((oe=Q.propsStore[`${j}_props`])==null?void 0:oe[E])??null:null}),K=i.useMemo(()=>y==="selectedCount"&&a&&!s?a:$?D.dataSet:void 0,[y,a,s,D.dataSet,$]),B=i.useMemo(()=>y==="selectedCount"?"selectedCount":$?D.dataSetField:void 0,[y,D.dataSetField,$]),L=i.useMemo(()=>de(j,K),[j,K]),_=O(Q=>{if(!L)return;const oe=dt(L).baseName;return Q.dataSets[oe]}),{options:I}=St(y),P=i.useMemo(()=>{if(L&&B)return N(L,B)},[L,B,N,_]),R=i.useMemo(()=>{if(!p)return{};if(typeof p=="string")try{return JSON.parse(p)}catch{return{}}return p},[p]),V=Q=>Q==null||Q===""||typeof Q=="string"&&Q.trim()==="",z=i.useMemo(()=>$&&!!(L&&B&&String(B).trim()!==""),[$,L,B]),q=i.useMemo(()=>n?o:z?g&&V(P)?o:P:(T==null?void 0:T.content)!==void 0?T.content:o,[n,z,P,T==null?void 0:T.content,o,g]),G=i.useMemo(()=>{if(y&&I.length>0&&q!==void 0&&q!==null){const Q=et(I,q);return(Q==null?void 0:Q.label)??q}return q},[y,I,q]),ie=i.useMemo(()=>{if(n)return G;const Q=(T==null?void 0:T.formatType)||h;return Q&&G!==void 0&&G!==null?er(G,Q,R):G},[n,G,h,R,T==null?void 0:T.formatType]),pe=i.useMemo(()=>{const Q={...C};return T&&typeof T=="object"&&Object.keys(T).forEach(oe=>{!["content","formatType","formatValue","clickAction","stopClickPropagation"].includes(oe)&&T[oe]!==void 0&&T[oe]!==null&&(Q[oe]=T[oe])}),Q},[C,T]),ne=i.useMemo(()=>(T==null?void 0:T.clickAction)??f,[T==null?void 0:T.clickAction,f]),ue=(T==null?void 0:T.develop)??n,fe=i.useMemo(()=>{if(ue)return!1;const Q=(T==null?void 0:T.stopClickPropagation)??m;return Q!==void 0?Q:!!ne},[ue,T==null?void 0:T.stopClickPropagation,m,ne]),me=(T==null?void 0:T.color)??l,ee=Tt(me),W=i.useMemo(()=>{if(!v)return;let Q=v;if(typeof v=="string")try{Q=JSON.parse(v)}catch{return}if(!Q||typeof Q!="object")return;const oe={};return Object.entries(Q).forEach(([xe,Ne])=>{Ne!==""&&Ne!==void 0&&Ne!==null&&(oe[xe]=Ne)}),Object.keys(oe).length>0?oe:void 0},[v]),te=i.useMemo(()=>{const Q={width:"100%"},oe=(T==null?void 0:T.fontSize)??c;if(oe){const xe=oe&&!String(oe).match(/\d+(px|em|rem|%|vh|vw|pt|pc|in|cm|mm|ex|ch)$/)?`${oe}px`:oe;Q.fontSize=xe}return ee&&(Q.color=ee),Q},[c,ee,T==null?void 0:T.fontSize]),ye=u.jsx(yi,{...pe,style:{...te,...x,...pe.style},onClick:Q=>{if(typeof pe.onClick=="function"&&pe.onClick(Q),ne&&j){const{actionName:oe,arg:xe}=on(ne,{id:t,index:M,parentIndex:S,dataSet:K,dataSetField:B,...pe}),Ne=se(oe,xe);b(j,Ne)}fe&&Q.stopPropagation()},children:ie!=null&&ie!==""?String(ie):r});return W?u.jsx(F.ConfigProvider,{theme:{token:W},children:ye}):ye},{Title:gi}=F.Typography,pi=({id:t,sessionId:e,develop:n,content:o,children:r,dataSet:s,dataSetField:a,level:c=1,color:l,styles:y,...h})=>{const p=O(M=>M.getDataSet),g=O(M=>M.getProps),x=i.useMemo(()=>de(e,s),[e,s]),v=i.useMemo(()=>e&&t?g(e,t):null,[e,t,g]),f=i.useMemo(()=>{if(x&&a)return p(x,a)},[x,a,p]),m=i.useMemo(()=>n?o:f!=null&&f!==""?String(f):(v==null?void 0:v.content)!==void 0?v.content:o,[n,f,v==null?void 0:v.content,o]),d=(v==null?void 0:v.color)??l,C=Tt(d),b=i.useMemo(()=>{const M={};return C&&(M.color=C),M},[C]),w=i.useMemo(()=>{const M={...h};return v&&typeof v=="object"&&Object.keys(v).forEach(S=>{S!=="content"&&v[S]!==void 0&&v[S]!==null&&(M[S]=v[S])}),M},[h,v]);return u.jsx(gi,{level:c,...w,style:{...b,...y,...w.style},children:m||r})},{Paragraph:vi}=F.Typography,bi=({id:t,sessionId:e,develop:n,content:o,children:r,dataSet:s,dataSetField:a,color:c,styles:l,...y})=>{const h=O(w=>w.getDataSet),p=O(w=>w.getProps),g=i.useMemo(()=>de(e,s),[e,s]),x=i.useMemo(()=>e&&t?p(e,t):null,[e,t,p]),v=i.useMemo(()=>{if(g&&a)return h(g,a)},[g,a,h]),f=i.useMemo(()=>n?o:v!=null&&v!==""?String(v):(x==null?void 0:x.content)!==void 0?x.content:o,[n,v,x==null?void 0:x.content,o]),m=(x==null?void 0:x.color)??c,d=Tt(m),C=i.useMemo(()=>{const w={};return d&&(w.color=d),w},[d]),b=i.useMemo(()=>{const w={...y};return x&&typeof x=="object"&&Object.keys(x).forEach(M=>{M!=="content"&&x[M]!==void 0&&x[M]!==null&&(w[M]=x[M])}),w},[y,x]);return u.jsx(vi,{...b,style:{...C,...l,...b.style},children:f||r})},xi=t=>{if(!t)return[];if(typeof t=="string")try{return JSON.parse(t)}catch{return[]}return t},Si=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,tabs:s,items:a,changeAction:c,onChange:l,activeKey:y,defaultActiveKey:h,renderTabContent:p,children:g,...x})=>{const v=O($=>$.addCommand),f=O($=>$.getDataSet),m=O($=>$.setDataSet),d=i.useMemo(()=>de(e,o),[e,o]),C=i.useMemo(()=>xi(s),[s]),b=i.useMemo(()=>a&&a.length>0?n?a.map($=>({...$,forceRender:!0})):a:C.length>0?C.map(($,D)=>({key:$.key,label:$.tab,disabled:$.disabled,forceRender:n?!0:void 0,children:p?p($.key,D):null})):[],[a,C,p,n]),w=i.useMemo(()=>{if(d&&r)return f(d,r)},[d,r,f]),[M,S]=i.useState(void 0),A=i.useMemo(()=>{if(n&&M)return M;const $=w??y??h;return!$&&b.length>0?b[0].key:$},[n,M,w,y,h,b]),k=i.useCallback($=>{if(n){S($);return}if(l){l($);return}d&&r&&m(d,r,$),c&&e&&v(e,se(c,$))},[n,l,d,r,m,c,e,v]);return u.jsx(F.Tabs,{...x,activeKey:A,items:b,onChange:k,animated:n?!1:x.animated,children:g})},Ci=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,selectAction:s,checkAction:a,expandAction:c,dragEndAction:l,dragEnterAction:y,dragLeaveAction:h,dragOverAction:p,dragStartAction:g,dropAction:x,rightClickAction:v,loadAction:f,onSelect:m,onCheck:d,onExpand:C,onDragEnd:b,onDragEnter:w,onDragLeave:M,onDragOver:S,onDragStart:A,onDrop:k,onRightClick:$,onLoad:D,treeData:j,styles:N,classNames:E,token:T,...K})=>{const B=O(Z=>Z.addCommand),L=O(Z=>Z.setDataSet),_=i.useMemo(()=>de(e,o),[e,o]),I=i.useMemo(()=>o?de(e,`${o}_selected`):void 0,[e,o]),P=i.useMemo(()=>o?de(e,`${o}_checked`):void 0,[e,o]),R=i.useMemo(()=>o?de(e,`${o}_expanded`):void 0,[e,o]),V=O(Z=>{if(!_)return;if(r)return Z.getDataSet(_,r);const re=Z.dataSets[_];if(!re)return;if(Array.isArray(re))return re;const le=re.value;return Array.isArray(le)?le:void 0}),z=O(Z=>I?Z.getDataSet(I,""):void 0),q=O(Z=>P?Z.getDataSet(P,""):void 0),G=O(Z=>R?Z.getDataSet(R,""):void 0),ie=i.useMemo(()=>n?V??j??[]:_?V??[]:j??[],[n,_,V,j]),pe=z,ne=q,ue=G,fe=i.useCallback((Z,re)=>{if(m){m(Z,re);return}I&&L(I,"",Z),s&&e&&B(e,se(s,{selectedKeys:Z}))},[m,I,e,L,s,B]),me=i.useCallback((Z,re)=>{if(d){d(Z,re);return}P&&L(P,"",Z),a&&e&&B(e,se(a,{checkedKeys:Z}))},[d,P,e,L,a,B]),ee=i.useCallback((Z,re)=>{if(C){C(Z,re);return}R&&L(R,"",Z),c&&e&&B(e,se(c,{expandedKeys:Z,expanded:re.expanded}))},[C,R,e,L,c,B]),W=i.useCallback(Z=>{if(b){b(Z);return}l&&e&&B(e,se(l,Z))},[b,l,e,B]),te=i.useCallback(Z=>{if(w){w(Z);return}y&&e&&B(e,se(y,Z))},[w,y,e,B]),ye=i.useCallback(Z=>{if(M){M(Z);return}h&&e&&B(e,se(h,Z))},[M,h,e,B]),Q=i.useCallback(Z=>{if(S){S(Z);return}p&&e&&B(e,se(p,Z))},[S,p,e,B]),oe=i.useCallback(Z=>{if(A){A(Z);return}g&&e&&B(e,se(g,Z))},[A,g,e,B]),xe=i.useCallback(Z=>{if(k){k(Z);return}x&&e&&B(e,se(x,Z))},[k,x,e,B]),Ne=i.useCallback(Z=>{if($){$(Z);return}v&&e&&B(e,se(v,Z))},[$,v,e,B]),$e=i.useCallback((Z,re)=>{if(D){D(Z,re);return}f&&e&&B(e,se(f,{loadedKeys:Z,...re}))},[D,f,e,B]),_e=i.useMemo(()=>{if(!T)return;const Z={};return Object.entries(T).forEach(([re,le])=>{le!==""&&le!==void 0&&le!==null&&(Z[re]=le)}),Object.keys(Z).length>0?Z:void 0},[T]),Ee=i.useMemo(()=>{const Z={};return n&&(Z.motion=!1),_e&&(Z.components={Tree:_e}),Object.keys(Z).length>0?Z:void 0},[n,_e]),Se=n?{motion:!1}:{},Ke=u.jsx(F.Tree,{...K,...Se,treeData:ie,...I!=null?{selectedKeys:pe??[]}:{},...P!=null?{checkedKeys:ne??[]}:{},...R!=null?{expandedKeys:ue??[]}:{},onSelect:fe,onCheck:me,onExpand:ee,onDragEnd:W,onDragEnter:te,onDragLeave:ye,onDragOver:Q,onDragStart:oe,onDrop:xe,onRightClick:Ne,onLoad:$e,styles:N,classNames:E});return Ee?u.jsx(F.ConfigProvider,{theme:Ee,children:Ke}):Ke},Mi=({id:t,sessionId:e,develop:n,items:o,children:r,dataSet:s,dataSetField:a,remoteUrl:c,mode:l,...y})=>{const h=O(C=>C.getDataSet),p=O(C=>C.getProps),g=i.useMemo(()=>de(e,s),[e,s]),x=i.useMemo(()=>e&&t?p(e,t):null,[e,t,p]),v=i.useMemo(()=>{if(g&&a)return h(g,a)},[g,a,h]),f=i.useMemo(()=>{let C;const b=v!=null?Array.isArray(v)?v:typeof v=="string"?(()=>{try{return JSON.parse(v)}catch{return}})():void 0:x==null?void 0:x.items;return n?C=b??o:g?C=b??[]:C=o,Array.isArray(C)?C.map(w=>{const M={...w};return M.label&&!M.title&&(M.title=M.label,delete M.label),M.children&&!M.content&&(M.content=M.children,delete M.children),M}):C},[n,g,v,x==null?void 0:x.items,o]),m=i.useMemo(()=>{const C={...y};return x&&typeof x=="object"&&Object.keys(x).forEach(b=>{b!=="items"&&x[b]!==void 0&&x[b]!==null&&(C[b]=x[b])}),C},[y,x]),d=i.useMemo(()=>l==="left"?"start":l==="right"?"end":l,[l]);return u.jsx(F.Timeline,{...m,mode:d,items:f,children:r})},Yt=(t,e)=>{if(!t)return e;if(typeof t=="string")try{return JSON.parse(t)}catch{return e}return t},Ai=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,onChange:a,current:c,items:l,direction:y,orientation:h,labelPlacement:p,titlePlacement:g,styles:x,token:v,...f})=>{const m=O(T=>T.addCommand),d=O(T=>T.getDataSet),C=O(T=>T.setDataSet),b=i.useMemo(()=>de(e,o),[e,o]),w=i.useMemo(()=>{if(b&&r)return d(b,r)},[b,r,d]),M=i.useMemo(()=>w??c??0,[w,c]),S=i.useMemo(()=>h??y,[h,y]),A=i.useMemo(()=>g??p,[g,p]),k=i.useMemo(()=>Yt(l,[]),[l]),$=i.useMemo(()=>Yt(x,{}),[x]),D=i.useMemo(()=>Yt(v,{}),[v]),j=i.useCallback(T=>{if(a){a(T);return}b&&r&&C(b,r,T),s&&e&&m(e,se(s,T))},[a,b,r,C,s,e,m]),N=Object.keys(D).length>0,E=u.jsx(F.Steps,{...f,current:M,items:k,styles:$,orientation:S,titlePlacement:A,onChange:j});return N?u.jsx(F.ConfigProvider,{theme:{components:{Steps:D}},children:E}):E},ji=({id:t,sessionId:e,develop:n,...o})=>u.jsx(F.Statistic,{...o}),wi=({id:t,sessionId:e,develop:n,...o})=>{const r=F.Statistic.Timer;if(r)return u.jsx(r,{type:"countdown",...o});const{Countdown:s}=F.Statistic;return u.jsx(s,{...o})},ki={top:"top",bottom:"bottom",left:"start",right:"end"},Di=t=>{if(!t)return[];if(typeof t=="string")try{return JSON.parse(t)}catch{return[]}return t},Ni=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,dotPosition:s,dotPlacement:a,slides:c,changeAction:l,afterChange:y,renderSlideContent:h,children:p,...g})=>{const x=O(w=>w.addCommand),v=O(w=>w.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),m=i.useMemo(()=>{if(a)return a;if(s)return ki[s]||s},[s,a]),d=i.useMemo(()=>Di(c),[c]),C=i.useCallback(w=>{if(y){y(w);return}f&&r&&v(f,r,w),l&&e&&x(e,se(l,w))},[y,f,r,v,l,e,x]),b=i.useMemo(()=>p||(d.length>0?d.map((w,M)=>{const S=h?h(w.key,M):null;return u.jsx("div",{"data-slide-key":w.key,children:S||u.jsx("div",{style:{minHeight:"100px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999",background:n?"#f5f5f5":void 0},children:n?w.title:null})},w.key)}):null),[p,d,h,n]);return u.jsx(F.Carousel,{...g,dotPlacement:m,afterChange:C,children:b})};function Ti(t){if(!t||typeof t!="string"||/^(data:|blob:|https?:\/\/)/i.test(t))return t;const e=Ge().viewRes;return e?e(t):t}const Ei="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMjAwIDIwMCI+PHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNmMGYwZjAiLz48cGF0aCBkPSJNNzAgNzBhMTIgMTIgMCAxIDEgMCAyNCAxMiAxMiAwIDAgMSAwLTI0em02MCAxMEw4NSAxMzBsLTI1LTIwLTIwIDE1djE1aDEyMHYtNDB6IiBmaWxsPSIjYmZiZmJmIi8+PC9zdmc+";function _i(t,e,n){if(!e)return;const{baseName:o,index:r}=dt(e),s=t[o];if(r!==null){const a=s==null?void 0:s.value;if(!Array.isArray(a)||a[r]===void 0)return;const c=a[r];return n?xt(c,lt(n)):c}if(s)return n?xt(s,lt(n)):s}const Oi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,remoteUrl:s,objectFit:a="cover",src:c,...l})=>{const y=O(m=>m.getProps),h=i.useMemo(()=>de(e,o),[e,o]),p=O(m=>h&&r?_i(m.dataSets,h,r):void 0),g=i.useMemo(()=>e&&t?y(e,t):null,[e,t,y]),x=i.useMemo(()=>{let m;return p!=null&&p!==""?m=String(p):(g==null?void 0:g.src)!==void 0?m=g.src:m=c,Ti(m)},[p,g==null?void 0:g.src,c]),v=i.useMemo(()=>{const m={...l};return g&&typeof g=="object"&&Object.keys(g).forEach(d=>{d!=="src"&&g[d]!==void 0&&g[d]!==null&&(m[d]=g[d])}),m},[l,g]),f={...v,src:x||void 0,fallback:v.fallback||Ei,preview:n?!1:v.preview,styles:{root:{width:"100%",height:"100%"},image:{width:"100%",height:"100%",objectFit:a}}};return u.jsx("div",{style:{width:"100%",height:"100%",display:"flex"},children:u.jsx(F.Image,{...f})})},{PreviewGroup:Ri}=F.Image;function $i(t){if(!t||typeof t!="string"||/^(data:|blob:|https?:\/\/)/i.test(t))return t;const e=Ge().viewRes;return e?e(t):t}const Bi=({id:t,sessionId:e,develop:n,children:o,dataSet:r,dataSetField:s,items:a,...c})=>{const l=O(m=>m.getDataSet),y=O(m=>m.getProps),h=i.useMemo(()=>de(e,r),[e,r]),p=i.useMemo(()=>e&&t?y(e,t):null,[e,t,y]),g=i.useMemo(()=>{if(h&&s)return l(h,s)},[h,s,l]),x=i.useMemo(()=>{const m=g!=null?Array.isArray(g)?g:typeof g=="string"?(()=>{try{return JSON.parse(g)}catch{return}})():void 0:p==null?void 0:p.items;return n?m??a??[]:h?Array.isArray(m)?m:[]:a??[]},[n,h,g,p==null?void 0:p.items,a]),v=i.useMemo(()=>x.map(m=>{const d=typeof m=="string"?m:m&&typeof m=="object"?m.url??m.src:void 0;return $i(d)}).filter(m=>!!m),[x]),f=i.useMemo(()=>{const m={...c};return p&&typeof p=="object"&&Object.keys(p).forEach(d=>{d!=="items"&&p[d]!==void 0&&p[d]!==null&&(m[d]=p[d])}),m},[c,p]);return u.jsx(Ri,{...f,items:v,children:o})},Li=({id:t,sessionId:e,develop:n,children:o,dataSet:r,dataSetField:s,src:a,clickAction:c,icon:l,token:y,...h})=>{const p=O(S=>S.getDataSet),g=O(S=>S.getProps),x=i.useMemo(()=>de(e,r),[e,r]),v=i.useMemo(()=>e&&t?g(e,t):null,[e,t,g]),f=i.useMemo(()=>{if(x&&s)return p(x,s)},[x,s,p]),m=i.useMemo(()=>{let S=a;if(n||(f!=null&&f!==""?S=String(f):(v==null?void 0:v.src)!==void 0&&(S=v.src)),!(typeof S=="string"&&S.trim()===""))return S},[n,f,v==null?void 0:v.src,a]),d=i.useMemo(()=>{let S=l;if(!n&&(v!=null&&v.icon)&&(S=v.icon),typeof S=="string"&&S){const A=Xe[S];if(A)return u.jsx(A,{})}return S},[l,v==null?void 0:v.icon,n]),C=i.useMemo(()=>{const S={...h};return v&&typeof v=="object"&&Object.keys(v).forEach(A=>{!["src","icon","token"].includes(A)&&v[A]!==void 0&&v[A]!==null&&(S[A]=v[A])}),S},[h,v]),b=i.useMemo(()=>{const S=v==null?void 0:v.token,A={...y,...S};if(!A||Object.keys(A).length===0)return;const k={};return Object.entries(A).forEach(([$,D])=>{if(D!==""&&D!==void 0&&D!==null)if(["containerSize","containerSizeLG","containerSizeSM","textFontSize","textFontSizeLG","textFontSizeSM","groupOverlapping"].includes($)){const j=typeof D=="string"?parseInt(D,10):D;isNaN(j)||(k[$]=j)}else k[$]=D}),Object.keys(k).length>0?k:void 0},[y,v==null?void 0:v.token]),w=i.useMemo(()=>{if(b)return{components:{Avatar:b}}},[b]),M=u.jsx(F.Avatar,{...C,src:m,icon:d,children:o});return w?u.jsx(F.ConfigProvider,{theme:w,children:M}):M},Vi={0:"default",1:"success",2:"warning",3:"error",true:"success",false:"default",yes:"success",no:"default"},Fi=({id:t,sessionId:e,develop:n,children:o,content:r,dataSet:s,dataSetField:a,dictCode:c,autoColor:l=!1,colorMap:y,color:h,closeAction:p,clickAction:g,...x})=>{const v=tt(s,a,e),f=v.dataSet,m=v.dataSetField,d=v.sessionId,C=i.useMemo(()=>de(d,f),[d,f]),{options:b}=St(c),w=i.useMemo(()=>{if(y){if(typeof y=="string")try{return JSON.parse(y)}catch{return}return y}},[y]),M=O(K=>{var B;return d&&t?((B=K.propsStore[`${d}_props`])==null?void 0:B[t])??null:null}),S=O(K=>C&&m?K.getDataSet(C,m):void 0),A=i.useMemo(()=>n?r:S!=null&&S!==""?String(S):(M==null?void 0:M.content)!==void 0?M.content:r,[n,S,M==null?void 0:M.content,r]),k=i.useMemo(()=>{if(c&&b.length>0&&A!==void 0&&A!==null){const K=et(b,A);return(K==null?void 0:K.label)??A}return A},[c,b,A]),$=i.useMemo(()=>{if(!l||A===void 0||A===null)return;const K=String(A).toLowerCase();return w&&w[K]?w[K]:Vi[K]},[l,A,w]),D=i.useMemo(()=>{const K={...x};return M&&typeof M=="object"&&Object.keys(M).forEach(B=>{!["content","color"].includes(B)&&M[B]!==void 0&&M[B]!==null&&(K[B]=M[B])}),K},[x,M]),j=i.useMemo(()=>{const{bordered:K,...B}=D;return B},[D]),N=(M==null?void 0:M.color)??h,T=Tt(N)||$;return u.jsx(F.Tag,{...j,color:T,children:k||o})};function Vn(t,e){const n=Number(t??e??10);return Number.isFinite(n)&&n>0?n:10}const Pi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,showSizeChangeAction:a,onChange:c,onShowSizeChange:l,current:y,pageSize:h,total:p,defaultPageSize:g,...x})=>{const v=O(D=>D.addCommand),f=O(D=>D.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),d=r??(m?"":void 0),C=i.useMemo(()=>({}),[]),b=O(D=>{if(!m)return C;const j=D.getDataSet(m,d??"");return j!=null&&typeof j=="object"?j:C}),w=Vn(h,g),M=b.current??y??1,S=b.pageSize??w,A=b.total??p??0;i.useEffect(()=>{if(!m||d===void 0)return;const D=d??"",{getDataSet:j,setDataSet:N}=O.getState(),E=j(m,D),T=Vn(h,g);if(E==null||typeof E!="object"||Array.isArray(E)){N(m,D,{current:y??1,pageSize:T,total:p??0},!1);return}const K=Number(E.pageSize);Number.isFinite(K)&&K>0||N(m,D,{...E,pageSize:T,current:E.current??y??1,total:E.total??p??0},!1)},[m,d,y,h,g,p]);const k=i.useCallback((D,j)=>{if(c){c(D,j);return}m&&f(m,d??"",{current:D,pageSize:j,total:A}),s&&e&&v(e,se(s,{page:D,pageSize:j}))},[c,m,d,f,A,s,e,v]),$=i.useCallback((D,j)=>{if(l){l(D,j);return}m&&f(m,d??"",{current:D,pageSize:j,total:A}),a&&e&&v(e,se(a,{current:D,pageSize:j}))},[l,m,d,f,A,a,e,v]);return u.jsx(F.Pagination,{...x,current:M,pageSize:S,total:A,onChange:k,onShowSizeChange:$,showTotal:i.useMemo(()=>{const D=x.showTotal;return typeof D=="string"?(j,N)=>D.replace("${total}",String(j)).replace("${range[0]}",String(N[0])).replace("${range[1]}",String(N[1])).replace("${range}",`${N[0]}-${N[1]}`):D},[x.showTotal])})},Ki=({id:t,sessionId:e,develop:n,items:o,children:r,...s})=>u.jsx(F.Breadcrumb,{...s,items:o,children:r}),Bt=t=>Object.entries(t).map(([e,n])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; "),zi=({mode:t,arrowStyle:e,arrowIconPrev:n,arrowIconNext:o,children:r})=>{const s=i.useRef(null),a=i.useRef(null),[c,l]=i.useState(0),[y,h]=i.useState(!1),[p,g]=i.useState(0),[x,v]=i.useState(0),f=t==="horizontal";i.useEffect(()=>{const S=()=>{if(!s.current||!a.current)return;const k=s.current,$=a.current;let D=0,j=0,N=!1;f?(D=k.clientWidth,j=$.scrollWidth,N=j>D):(D=k.clientHeight,j=$.scrollHeight,N=j>D),v(D),g(j),h(N),N||l(0)},A=new ResizeObserver(S);return s.current&&A.observe(s.current),a.current&&A.observe(a.current),S(),()=>A.disconnect()},[f]);const m=c<=0,d=!y||c>=p-x,C=i.useCallback(()=>{var A,k;if(m)return;const S=f?((A=s.current)==null?void 0:A.clientWidth)??200:((k=s.current)==null?void 0:k.clientHeight)??200;l($=>Math.max(0,$-S))},[f,m]),b=i.useCallback(()=>{var k,$,D,j,N,E;if(d)return;const S=f?((k=s.current)==null?void 0:k.clientWidth)??200:(($=s.current)==null?void 0:$.clientHeight)??200,A=f?(((D=a.current)==null?void 0:D.scrollWidth)??0)-(((j=s.current)==null?void 0:j.clientWidth)??0):(((N=a.current)==null?void 0:N.scrollHeight)??0)-(((E=s.current)==null?void 0:E.clientHeight)??0);l(T=>Math.min(A,T+S))},[f,d]),w=n||(f?u.jsx(ze.LeftOutlined,{}):u.jsx(ze.UpOutlined,{})),M=o||(f?u.jsx(ze.RightOutlined,{}):u.jsx(ze.DownOutlined,{}));return u.jsxs("div",{style:{display:"flex",flexDirection:f?"row":"column",alignItems:"center",width:"100%",height:"100%"},children:[u.jsx(F.Button,{type:"text",size:"middle",icon:w,shape:"circle",disabled:m,onClick:C,style:{flexShrink:0,alignSelf:"center",margin:f?"0 4px":"4px 0",...e,borderRadius:"50%"}}),u.jsx("div",{ref:s,style:{flex:1,overflow:"hidden",position:"relative",display:"flex",justifyContent:f&&!y?"center":"flex-start"},children:u.jsx("div",{ref:a,style:{transform:f?`translateX(-${c}px)`:`translateY(-${c}px)`,transition:"transform 0.3s ease-out",display:f?"inline-flex":"block",whiteSpace:f?"nowrap":"normal"},children:r})}),u.jsx(F.Button,{type:"text",size:"middle",shape:"circle",icon:M,disabled:d,onClick:b,style:{flexShrink:0,alignSelf:"center",margin:f?"0 4px":"4px 0",...e,borderRadius:"50%"}})]})},qi=({mode:t,children:e})=>{const n=t==="horizontal";return u.jsx("div",{style:{overflow:n?"auto hidden":"hidden auto",width:"100%",height:"100%",scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.2) transparent"},children:e})},Wi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,index:s,clickAction:a,selectAction:c,openChangeAction:l,deselectAction:y,onClick:h,onSelect:p,onOpenChange:g,onDeselect:x,items:v,selectedKeys:f,openKeys:m,defaultOpenKeys:d,styles:C,classNames:b,token:w,expandIcon:M,overflowedIndicator:S,openKeysDataSet:A,openKeysDataSetField:k,mode:$,inlineCollapsed:D,remoteUrl:j,overflowStrategy:N="default",paginationArrowStyle:E,paginationArrowIconPrev:T,paginationArrowIconNext:K,expandTrigger:B,...L})=>{const _=i.useContext(qe),I=i.useMemo(()=>e&&t?ct(t,_,s):null,[e,t,_==null?void 0:_.parentIndex,_==null?void 0:_.index,s]),P=O(J=>{var he;return I&&e?((he=J.propsStore[`${e}_props`])==null?void 0:he[I])??null:null}),R=O(J=>J.addCommand),V=O(J=>J.setDataSet),z=i.useMemo(()=>de(e,o),[e,o]),q=O(J=>{if(z)return r?J.getDataSet(z,r):J.dataSets[z]}),G=i.useMemo(()=>({}),[]),ie=q??G,pe=i.useMemo(()=>(ie==null?void 0:ie.items)??(Array.isArray(ie)?ie:void 0)??(Array.isArray(ie==null?void 0:ie.value)?ie.value:void 0),[ie]),ne=i.useMemo(()=>n?pe??v??[]:z?pe??[]:v??[],[n,z,pe,v]),ue=i.useMemo(()=>(P==null?void 0:P.selectedKeys)??ie.selectedKeys??f,[P==null?void 0:P.selectedKeys,ie.selectedKeys,f]),fe=i.useMemo(()=>(P==null?void 0:P.openKeys)??ie.openKeys??(A&&k?void 0:m),[P==null?void 0:P.openKeys,ie.openKeys,A,k,m]),me=i.useMemo(()=>de(e,A),[e,A]),ee=O(J=>{if(!ie.openKeys&&me&&k)return J.getDataSet(me,k)}),W=i.useMemo(()=>{const J=he=>Array.isArray(he)?he.map(be=>{const ke={...be};if(ke.icon&&typeof ke.icon=="string"){const Oe=Xe[ke.icon];Oe&&(ke.icon=u.jsx(Oe,{}))}return ke.children&&ke.children.length>0&&(ke.children=J(ke.children)),ke}):[];return J(ne||[])},[ne]),te=i.useMemo(()=>ue,[ue]),ye=i.useMemo(()=>fe??ee,[fe,ee]),Q=i.useCallback(J=>{if(h){h(J);return}a&&e&&R(e,se(a,{key:J.key,keyPath:J.keyPath}))},[h,a,e,R]),oe=i.useCallback(J=>{if(p){p(J);return}if(z)if(r){const he=O.getState().getDataSet(z,r)||{};V(z,r,{...he,selectedKeys:J.selectedKeys})}else V(z,"selectedKeys",J.selectedKeys);c&&e&&R(e,se(c,{selectedKeys:J.selectedKeys}))},[p,z,r,V,c,e,R]),xe=i.useCallback(J=>{if(g){g(J);return}if(z)if(r){const he=O.getState().getDataSet(z,r)||{};V(z,r,{...he,openKeys:J})}else V(z,"openKeys",J);else me&&k&&V(me,k,J);l&&e&&R(e,se(l,{openKeys:J}))},[g,z,r,me,k,V,l,e,R]),Ne=i.useCallback(J=>{if(x){x(J);return}y&&e&&R(e,se(y,{selectedKeys:J.selectedKeys,key:J.key}))},[x,y,e,R]),$e=$==="inline"&&D!==void 0?{inlineCollapsed:D}:{},_e=i.useMemo(()=>{if(!w)return;const J={};return Object.entries(w).forEach(([he,be])=>{be!==""&&be!==void 0&&be!==null&&(J[he]=be)}),Object.keys(J).length>0?J:void 0},[w]),Ee=i.useMemo(()=>{if(b==null||typeof b=="function")return b;const J=be=>{if(be==null||be==="")return;if(typeof be=="string"||typeof be!="object"||Array.isArray(be))return be;const ke={};for(const[Oe,He]of Object.entries(be)){const ft=J(He);ft!==void 0&&(ke[Oe]=ft)}return Object.keys(ke).length?ke:void 0};return J(b)},[b]),Se=n?{motion:{motionName:""}}:{},Ke=i.useMemo(()=>{if(typeof T=="string"&&T){const J=Xe[T];if(J)return u.jsx(J,{})}return T},[T]),Z=i.useMemo(()=>{if(typeof K=="string"&&K){const J=Xe[K];if(J)return u.jsx(J,{})}return K},[K]),re=i.useMemo(()=>N==="pagination"||N==="scroll"?null:S,[N,S]),le=i.useId(),H=t||le.replace(/:/g,"-"),ae=i.useMemo(()=>{var ke;if(!C||typeof C=="function")return"";const J=(ke=C.subMenu)==null?void 0:ke.root;if(!J)return"";const he=[],be=`[data-and-menu-id="${H}"]`;if(J.item&&Object.keys(J.item).length>0){const Oe=Bt(J.item);he.push(`${be} .ant-menu-submenu > .ant-menu-submenu-title { ${Oe} }`)}if(J.itemIcon&&Object.keys(J.itemIcon).length>0){const Oe=Bt(J.itemIcon);he.push(`${be} .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-item-icon { ${Oe} }`)}if(J.itemContent&&Object.keys(J.itemContent).length>0){const Oe=Bt(J.itemContent);he.push(`${be} .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-title-content { ${Oe} }`)}if(J.selected&&Object.keys(J.selected).length>0){const Oe=Bt(J.selected);he.push(`${be} .ant-menu-submenu-selected > .ant-menu-submenu-title { ${Oe} }`)}return he.join(`
23
- `)},[C,H]),Y=u.jsx(F.Menu,{...L,...$e,...Se,mode:$,items:W,selectedKeys:te,openKeys:ye,defaultOpenKeys:d,onClick:Q,onSelect:oe,onOpenChange:xe,onDeselect:Ne,styles:C,classNames:Ee,expandIcon:M,overflowedIndicator:re,disabledOverflow:N!=="default"}),X=()=>N==="pagination"?u.jsx(zi,{mode:$||"horizontal",arrowStyle:E,arrowIconPrev:Ke,arrowIconNext:Z,children:Y}):N==="scroll"?u.jsx(qi,{mode:$||"horizontal",children:Y}):Y,ve=i.useMemo(()=>{const J={};return n&&(J.motion=!1),_e&&(J.components={Menu:_e}),Object.keys(J).length>0?J:void 0},[n,_e]);return(()=>{const J=X(),he=ae?u.jsxs("div",{"data-and-menu-id":H,style:{display:"contents"},children:[u.jsx("style",{children:ae}),J]}):J;return ve?u.jsx(F.ConfigProvider,{theme:ve,children:he}):he})()},Ii=({id:t,sessionId:e,develop:n,...o})=>u.jsx(F.Calendar,{...o}),Hi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,count:s,showZero:a,overflowCount:c,dot:l,offset:y,size:h,status:p,text:g,color:x,title:v,children:f,...m})=>{const d=O(k=>k.getDataSet),C=i.useMemo(()=>de(e,o),[e,o]),b=i.useMemo(()=>{if(C&&r)return d(C,r)},[C,r,d]),w=i.useMemo(()=>b??s,[b,s]),S=(F.theme.useToken?F.theme.useToken():{token:void 0}).token,A=i.useMemo(()=>{if(!(!x||typeof x!="string"))return S&&x in S?S[x]:x},[x,S]);return u.jsx(F.Badge,{...m,count:w,showZero:a,overflowCount:c,dot:l,offset:y,size:h,status:p,text:g,color:A,title:v,children:u.jsx("span",{"data-slot":"content",className:"and-badge-content-slot",style:{display:"inline-block",minWidth:!f&&!g?"20px":void 0,minHeight:!f&&!g?"20px":void 0},children:f})})},Yi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,text:s,placement:a,color:c,children:l,...y})=>{const h=O(d=>d.getDataSet),p=i.useMemo(()=>de(e,o),[e,o]),g=i.useMemo(()=>{if(p&&r)return h(p,r)},[p,r,h]),x=i.useMemo(()=>g??s,[g,s]),f=(F.theme.useToken?F.theme.useToken():{token:void 0}).token,m=i.useMemo(()=>{if(!(!c||typeof c!="string"))return f&&c in f?f[c]:c},[c,f]);return u.jsx(F.Badge.Ribbon,{...y,text:x,placement:a,color:m,children:u.jsx("div",{"data-slot":"content",className:"and-badge-ribbon-content-slot",style:{display:"block",minHeight:"40px",border:n?"1px dashed #dedede":void 0},children:l})})},Ui=t=>{if(!t)return[];if(typeof t=="string")try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return t},Gi=t=>{if(!(t==null||t==="")){if(typeof t=="number")return t;if(typeof t=="string"){const e=parseInt(t,10);if(!isNaN(e))return e;try{return JSON.parse(t)}catch{return}}return t}},Ji=t=>{if(!(t==null||t==="")){if(typeof t=="number")return t;if(typeof t=="string"){const e=parseInt(t,10);if(!isNaN(e))return e;try{const n=JSON.parse(t);return Array.isArray(n)&&n.length===2,n}catch{return}}return Array.isArray(t),t}},Qi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,items:s,columns:a,gutter:c,fresh:l,layoutChangeAction:y,onLayoutChange:h,itemRender:p,...g})=>{const x=tt(o,r,e),v=x.dataSet,f=x.dataSetField,m=x.sessionId,d=i.useContext(qe),C=O(L=>L.addCommand),b=i.useMemo(()=>de(m,v),[m,v]),w=O(L=>b&&f?L.getDataSet(b,f):null),M=i.useMemo(()=>!m||t==null||t===""?null:d&&typeof d.index=="number"?`${String(t)}_${d.index}`:String(t),[m,t,d]),S=O(L=>{var _;return M?((_=L.propsStore[`${m}_props`])==null?void 0:_[M])??null:null}),A=i.useMemo(()=>w&&Array.isArray(w)?w:Ui(s),[w,s]),k=(S==null?void 0:S.columns)!==void 0&&(S==null?void 0:S.columns)!==null?S.columns:a,$=i.useMemo(()=>Gi(k),[k]),D=i.useMemo(()=>Ji(c),[c]),j=i.useMemo(()=>{if(h)return h;if(y&&m)return L=>{C(m,{actionName:y,arg:L,timestamp:Date.now()})}},[h,y,m,C]),N=i.useMemo(()=>A.length>0?A:n?[{key:"1",height:150,data:{title:"示例项 1"}},{key:"2",height:200,data:{title:"示例项 2"}},{key:"3",height:120,data:{title:"示例项 3"}},{key:"4",height:180,data:{title:"示例项 4"}},{key:"5",height:140,data:{title:"示例项 5"}},{key:"6",height:160,data:{title:"示例项 6"}}]:[],[A,n]),E=i.useMemo(()=>{if(p)return p;if(n)return L=>{var _;return u.jsx("div",{style:{height:L.height||100,background:"#f0f5ff",border:"1px dashed #91caff",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",color:"#1677ff",fontSize:14},children:((_=L.data)==null?void 0:_.title)||`Item ${L.key}`})}},[p,n]),T=i.useMemo(()=>{if(E)return!v||!f?E:(L,_)=>{const I=typeof _=="number"?_:typeof(L==null?void 0:L.index)=="number"?L.index:Number((L==null?void 0:L.index)??0);return u.jsx(qe.Provider,{value:{dataSet:v,index:I,parentIndex:d==null?void 0:d.index,parentContext:d??void 0,sessionId:m,dataSetFieldRoot:f},children:E(L)})}},[E,v,f,m]),{layoutChangeAction:K,...B}=g;return u.jsx(F.Masonry,{...B,items:N,columns:$,gutter:D,fresh:l,itemRender:T,onLayoutChange:j})},Zi=({id:t,sessionId:e,develop:n,closeAction:o,onClose:r,dataSet:s,dataSetField:a,title:c,description:l,closeText:y,closable:h,...p})=>{const g=O(M=>M.getDataSet),x=O(M=>M.getProps),v=i.useMemo(()=>de(e,s),[e,s]),f=i.useMemo(()=>e&&t?x(e,t):null,[e,t,x]),m=i.useMemo(()=>{if(v&&a)return g(v,a)},[v,a,g]),d=i.useMemo(()=>n?c:m!=null&&m!==""?String(m):(f==null?void 0:f.title)!==void 0?f.title:(f==null?void 0:f.message)!==void 0?f.message:c,[n,m,f==null?void 0:f.title,f==null?void 0:f.message,c]),C=i.useMemo(()=>{const M={...p,description:l};return f&&typeof f=="object"&&Object.keys(f).forEach(S=>{S!=="title"&&S!=="message"&&f[S]!==void 0&&f[S]!==null&&(M[S]=f[S])}),M},[p,l,f]),b=i.useMemo(()=>y?{closeIcon:u.jsx("span",{children:y})}:h,[y,h]),w=i.useCallback(M=>{r&&r(M)},[r]);return u.jsx(F.Alert,{...C,title:d,closable:b,onClose:w})},Xi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,okAction:s,cancelAction:a,onOk:c,onCancel:l,open:y,children:h,...p})=>{const g=O(w=>w.addCommand),x=O(w=>w.getDataSet),v=O(w=>w.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),m=i.useMemo(()=>{if(f&&r)return x(f,r)},[f,r,x]),d=m!==void 0?!!m:y,C=i.useCallback(()=>{c&&c(),f&&r&&v(f,r,!1),s&&e&&g(e,{actionName:s,arg:null,timestamp:Date.now()})},[c,f,r,v,s,e,g]),b=i.useCallback(()=>{l&&l(),f&&r&&v(f,r,!1),a&&e&&g(e,{actionName:a,arg:null,timestamp:Date.now()})},[l,f,r,v,a,e,g]);return u.jsx(F.Modal,{...p,open:d,onOk:C,onCancel:b,children:h})},ea=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,closeAction:s,onClose:a,open:c,children:l,...y})=>{const h=O(d=>d.addCommand),p=O(d=>d.getDataSet),g=O(d=>d.setDataSet),x=i.useMemo(()=>de(e,o),[e,o]),v=i.useMemo(()=>{if(x&&r)return p(x,r)},[x,r,p]),f=v!==void 0?!!v:c,m=i.useCallback(()=>{a&&a(),x&&r&&g(x,r,!1),s&&e&&h(e,{actionName:s,arg:null,timestamp:Date.now()})},[a,x,r,g,s,e,h]);return u.jsx(F.Drawer,{...y,open:f,onClose:m,children:l})},ta=({id:t,sessionId:e,develop:n,children:o,resultProps:r,...s})=>{const a=O(l=>{var y;return e&&t?((y=l.propsStore[`${e}_props`])==null?void 0:y[t])??null:null}),c=i.useMemo(()=>{const l={...s,...r&&typeof r=="object"?r:{}};return Ie(l,a??void 0)},[s,r,a]);return u.jsx(F.Result,{...c,children:o})},rn=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{const n=t.trim();if(n.startsWith("[")||n.startsWith("{"))return JSON.parse(n)}catch{return e}return t},na=t=>t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase()),ra=t=>!t||typeof t!="object"||Array.isArray(t)?t??{}:Object.fromEntries(Object.entries(t).map(([e,n])=>[na(e),n])),oa=t=>rn(t,[]).map(n=>({key:n.key,tab:n.tab,disabled:n.disabled})),sa=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,title:s,extra:a,cover:c,tabBarExtraContent:l,actions:y,tabList:h,activeTabKey:p,defaultActiveTabKey:g,tabChangeAction:x,onTabChange:v,styles:f,token:m,showHeader:d,showCover:C,showActions:b,size:w,children:M,...S})=>{const A=O(G=>G.addCommand),k=O(G=>G.getDataSet),$=O(G=>G.setDataSet),D=i.useMemo(()=>de(e,o),[e,o]),j=w==="default"?"medium":w,N=i.useMemo(()=>{const G=rn(f,{});return Object.fromEntries(Object.entries(G).map(([ie,pe])=>[ie,ra(pe)]))},[f]),E=i.useMemo(()=>{const G=oa(h);return G.length>0?G:void 0},[h]),K=i.useMemo(()=>{if(D&&r){const G=k(D,`${r}.activeTabKey`);if(typeof G=="string")return G}},[D,r,k])??p,B=i.useCallback(G=>{if(v){v(G);return}D&&r&&$(D,`${r}.activeTabKey`,G),x&&e&&A(e,se(x,{key:G}))},[v,D,r,$,x,e,A]),{titleSlot:L,extraSlot:_,coverSlot:I,actionsSlot:P,otherChildren:R,actionsFromChildren:V}=i.useMemo(()=>{let G=null,ie=null,pe=null,ne=[];const ue=[];let fe=!1;return s&&(G=s),a&&(ie=a),c&&(pe=c),y&&(ne=y),i.Children.forEach(M,me=>{if(!i.isValidElement(me)){ue.push(me);return}const ee=me.props,W=ee["data-slot-type"];W==="title"&&!s?G=me:W==="extra"&&!a?ie=me:W==="cover"&&!c?pe=me:W==="actions"&&!y?(ne=[me],fe=!0):W==="body"&&ee.children?ue.push(ee.children):ue.push(me)}),{titleSlot:G,extraSlot:ie,coverSlot:pe,actionsSlot:ne,otherChildren:ue,actionsFromChildren:fe}},[M,s,a,c,y]),z=i.useMemo(()=>{const G=rn(m,{});return V?{actionsLiMargin:"0px",...G}:G},[m,V]),q=u.jsx(F.Card,{...S,size:j,title:L,extra:_,cover:I,tabBarExtraContent:l,actions:P.length>0?P:void 0,tabList:E,activeTabKey:K,defaultActiveTabKey:g,onTabChange:E?B:void 0,styles:N,children:R});return z&&Object.keys(z).length>0?u.jsx(F.ConfigProvider,{theme:{components:{Card:z}},children:q}):q},ia=({id:t,sessionId:e,develop:n,text:o,children:r,styles:s,token:a,...c})=>{const l=r||o;return a&&Object.keys(a).length>0?u.jsx(F.ConfigProvider,{theme:{components:{Divider:a}},children:u.jsx(F.Divider,{...c,styles:s,children:l})}):u.jsx(F.Divider,{...c,styles:s,children:l})},Fn=t=>{if(!t)return[];if(typeof t=="string")try{return JSON.parse(t)}catch{return[]}return t},ar=t=>t.map(e=>e.divider?{type:"divider",key:e.key}:{key:e.key,label:e.label,disabled:e.disabled,danger:e.danger,children:e.children?ar(e.children):void 0}),cr=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,text:s="下拉菜单",items:a,clickAction:c,selectAction:l,deselectAction:y,openChangeAction:h,onOpenChange:p,children:g,hasChildren:x,index:v,...f})=>{const m=O(j=>j.addCommand),d=i.useContext(qe),C=v??(d==null?void 0:d.index),b=d==null?void 0:d.parentIndex,w=i.useMemo(()=>de(e,o),[e,o]),M=O(j=>{if(w)return r?j.getDataSet(w,r):j.dataSets[w]}),S=i.useMemo(()=>{if(M==null)return;if(Array.isArray(M))return M;const j=M;if(Array.isArray(j==null?void 0:j.items))return j.items;if(Array.isArray(j==null?void 0:j.value))return j.value},[M]),A=i.useMemo(()=>n?S??Fn(a)??[]:w?S??[]:Fn(a)??[],[n,w,S,a]),k=i.useCallback((j,N)=>{if(p){p(j,N);return}if(h&&e){const{actionName:E,arg:T}=st(h,j,{id:t,dataSet:o,dataSetField:r,index:C,parentIndex:b,source:N.source});m(e,se(E,T))}},[p,h,e,m,t,o,r,C,b]),$=i.useMemo(()=>({items:ar(A),onClick:j=>{if(c&&e){const{actionName:N,arg:E}=st(c,j.key,{id:t,dataSet:o,dataSetField:r,index:C,parentIndex:b,key:j.key,keyPath:j.keyPath});m(e,se(N,E))}},onSelect:j=>{if(l&&e){const{actionName:N,arg:E}=st(l,j.key,{id:t,dataSet:o,dataSetField:r,index:C,parentIndex:b,key:j.key,keyPath:j.keyPath,selectedKeys:j.selectedKeys});m(e,se(N,E))}},onDeselect:j=>{if(y&&e){const{actionName:N,arg:E}=st(y,j.key,{id:t,dataSet:o,dataSetField:r,index:C,parentIndex:b,key:j.key,keyPath:j.keyPath,selectedKeys:j.selectedKeys});m(e,se(N,E))}}}),[A,c,l,y,e,m,t,o,r,C,b]),D=i.useMemo(()=>u.jsxs("div",{className:"and-dropdown-trigger-slot",style:{display:"inline-block",cursor:"pointer"},children:[g,n&&!g&&!x&&u.jsx("div",{style:{padding:"4px 8px",border:"1px dashed #d9d9d9",color:"#ccc",fontSize:12},children:"请配置触发器"}),!g&&!n&&s&&u.jsx(F.Button,{children:u.jsxs(F.Space,{children:[s,u.jsx(ze.DownOutlined,{})]})})]}),[g,n,s,x]);return u.jsx(F.Dropdown,{...f,menu:$,onOpenChange:k,children:D})},aa=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(F.Row,{...r,children:o}),ca=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(F.Col,{...r,children:o}),la=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(F.Flex,{...r,children:o}),ua=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,value:s,...a})=>{const c=O(v=>v.getDataSet),l=O(v=>v.getProps),y=i.useMemo(()=>de(e,o),[e,o]),h=i.useMemo(()=>e&&t?l(e,t):null,[e,t,l]),p=i.useMemo(()=>{if(y&&r)return c(y,r)},[y,r,c]),g=i.useMemo(()=>n?s:p!=null&&p!==""?String(p):(h==null?void 0:h.value)!==void 0?h.value:s,[n,p,h==null?void 0:h.value,s]),x=i.useMemo(()=>{const v={...a};return h&&typeof h=="object"&&Object.keys(h).forEach(f=>{f!=="value"&&h[f]!==void 0&&h[f]!==null&&(v[f]=h[f])}),v},[a,h]);return u.jsx(F.QRCode,{...x,value:g||""})},jt=t=>{if(!t)return;const e=Xe[t];if(e)return i.createElement(e)},Ut=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{const n=t.trim();if(n.startsWith("[")||n.startsWith("{"))return JSON.parse(n)}catch{return e}return t},da=({id:t,sessionId:e,develop:n,panels:o,orientation:r="horizontal",lazy:s=!1,draggerIcon:a,collapsibleIcon:c,resizeAction:l,resizeEndAction:y,onResize:h,onResizeEnd:p,styles:g,token:x,children:v,renderPanelContent:f,...m})=>{const d=O(N=>N.addCommand),C=i.useMemo(()=>Ut(o,[]),[o]),b=i.useMemo(()=>Ut(x,{}),[x]),w=i.useMemo(()=>jt(a),[a]),M=i.useMemo(()=>{if(c){if(typeof c=="string"){const N=Ut(c,null);return N&&typeof N=="object"?{start:jt(N.start),end:jt(N.end)}:void 0}return{start:jt(c.start),end:jt(c.end)}}},[c]),S=i.useCallback(N=>{if(h){h(N);return}l&&e&&d(e,se(l,{sizes:N}))},[h,l,e,d]),A=i.useCallback(N=>{if(p){p(N);return}y&&e&&d(e,se(y,{sizes:N}))},[p,y,e,d]),k=()=>v&&i.Children.count(v)>0?i.Children.map(v,(N,E)=>{const T=C[E]||{};return u.jsx(F.Splitter.Panel,{defaultSize:T.defaultSize,min:T.min,max:T.max,collapsible:T.collapsible,resizable:T.resizable!==!1,children:N},T.key||E)}):C.map((N,E)=>u.jsx(F.Splitter.Panel,{defaultSize:N.defaultSize||void 0,min:N.min||void 0,max:N.max||void 0,collapsible:N.collapsible,resizable:N.resizable!==!1,children:f?f(N.key,E):u.jsxs("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#999",fontSize:14},children:["Panel ",E+1]})},N.key||E)),{layout:$,...D}=m,j=u.jsx("div",{style:{width:"100%",height:"100%"},children:u.jsx(F.Splitter,{...D,orientation:r,lazy:s,onResize:S,onResizeEnd:A,style:{height:"100%",width:"100%",...D.style},styles:g,draggerIcon:w,collapsibleIcon:M,children:k()},r)});return b&&Object.keys(b).length>0?u.jsx(F.ConfigProvider,{theme:{components:{Splitter:b}},children:j}):j},fa=({children:t,className:e,style:n,key:o,defaultSize:r,min:s,max:a,collapsible:c,resizable:l,sessionId:y,...h})=>u.jsx("div",{className:e,style:{display:"contents",width:"100%",height:"100%",...n},...h,children:t}),ma=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,renderItem:s,renderEmpty:a,items:c,maxCount:l,containerStyle:y,children:h,"page-disabled":p=!1,"page-defaultPageSize":g=10,"page-pageSizeOptions":x=["10","20","30","40"],"page-showSizeChanger":v=!0,"page-showQuickJumper":f=!1,"page-simple":m=!1,"page-size":d="small","page-showLessItems":C=!1,"page-showTotal":b})=>{const w=d==="default"?"middle":d,M=i.useMemo(()=>{const B=b==null?void 0:b.trim();if(B)return(L,_)=>B.replace(/\$\{total\}/g,String(L)).replace(/\$\{range\[0\]\}/g,String(_[0])).replace(/\$\{range\[1\]\}/g,String(_[1])).replace(/\$\{range\}/g,`${_[0]}-${_[1]}`)},[b]),S=O(B=>B.getDataSet),A=i.useMemo(()=>de(e,o),[e,o]),[k,$]=i.useState(1),[D,j]=i.useState(g),N=i.useMemo(()=>{if(A&&r){const B=S(A,r);return Array.isArray(B)?B:[]}return[]},[A,r,S]),E=i.useMemo(()=>n?N.length>0?N:c||[]:A?N:c||[],[n,A,N,c]),T=i.useMemo(()=>{let B=E;if(!p){const L=(k-1)*D,_=L+D;B=B.slice(L,_)}return l?B.slice(0,l):B},[E,p,k,D,l]);if(!E||E.length===0)return a?u.jsx(u.Fragment,{children:a()}):u.jsx("div",{style:{textAlign:"center",padding:"20px",color:"#999"},children:"暂无数据"});const K=(B,L)=>{$(B),L&&j(L)};return u.jsxs("div",{style:{display:"flex",flexDirection:"column",...y},children:[u.jsx("div",{style:{flex:1},children:T.map((B,L)=>u.jsx(i.Fragment,{children:s?s(B,L):u.jsx("div",{style:{padding:"8px",borderBottom:"1px solid #f0f0f0"},children:JSON.stringify(B)})},B.id||L))}),!p&&E.length>0&&u.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:16},children:u.jsx(F.Pagination,{current:k,pageSize:D,total:E.length,onChange:K,pageSizeOptions:x,showSizeChanger:v,showQuickJumper:f,simple:m,size:w,showLessItems:C,showTotal:M})})]})},ya="@keyframes and-icon-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",ha=".and-icon-svg-root svg,.and-icon-svg-root svg path{fill:currentColor}.and-icon-svg-root svg{color:inherit}",ga=({id:t,sessionId:e,develop:n,name:o,svg:r,size:s=16,color:a,spin:c=!1,rotate:l=0,twoToneColor:y,style:h,styles:p,onClick:g})=>{const x=typeof r=="string"?r.trim():"",v={fontSize:s,color:a,cursor:g?"pointer":void 0,...p,...h};if(x){const m={display:"inline-flex",alignItems:"center",justifyContent:"center",width:s,height:s,transform:l?`rotate(${l}deg)`:void 0,...v},d=c?{animation:"and-icon-spin 1s linear infinite",display:"inline-flex"}:{display:"inline-flex"};return u.jsxs(u.Fragment,{children:[u.jsx("style",{children:ha}),c&&u.jsx("style",{children:ya}),u.jsx("span",{className:"and-icon-svg-root",style:m,onClick:g,role:g?"button":void 0,children:u.jsx("span",{style:d,children:u.jsx("span",{dangerouslySetInnerHTML:{__html:x},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}})})})]})}if(!o)return null;const f=Xe[o];return f?u.jsx(f,{style:v,spin:c,rotate:l,twoToneColor:y||void 0,onClick:g}):(console.warn(`Icon "${o}" not found in @ant-design/icons`),null)},pa=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,products:s,columns:a=4,clickAction:c,style:l})=>{const y=O(f=>f.addCommand),h=O(f=>f.getDataSet),p=i.useMemo(()=>de(e,o),[e,o]),g=i.useMemo(()=>{if(p&&r){const f=h(p,r);return Array.isArray(f)?f:[]}return[]},[p,r,h]),x=g.length>0?g:s||[],v=f=>{c&&e&&y(e,se(c,f))};return u.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${a}, 1fr)`,gap:16,...l},children:x.map(f=>u.jsx(F.Card,{hoverable:!0,cover:f.image&&u.jsx("img",{alt:f.name,src:f.image,style:{height:200,objectFit:"cover"}}),onClick:()=>v(f),children:u.jsx(F.Card.Meta,{title:f.name,description:u.jsxs(F.Space,{direction:"vertical",size:4,children:[f.price!==void 0&&u.jsxs("div",{children:[u.jsxs("span",{style:{color:"#f5222d",fontSize:18,fontWeight:"bold"},children:["¥",f.price]}),f.originalPrice&&u.jsxs("span",{style:{marginLeft:8,color:"#999",textDecoration:"line-through"},children:["¥",f.originalPrice]})]}),f.tags&&f.tags.length>0&&u.jsx(F.Space,{size:4,wrap:!0,children:f.tags.map((m,d)=>u.jsx(F.Tag,{color:"blue",children:m},d))})]})})},f.id))})},Pn=({id:t,icon:e,title:n,description:o,style:r})=>u.jsxs("div",{id:t,style:{width:"100%",height:"100%",minHeight:80,flex:"1 1 auto",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px dashed #d9d9d9",borderRadius:4,background:"#fafafa",color:"#8c8c8c",padding:16,boxSizing:"border-box",...r},children:[e||u.jsx(ze.InboxOutlined,{style:{fontSize:28,marginBottom:8,color:"#bfbfbf"}}),n&&u.jsx("div",{style:{fontWeight:500,fontSize:13,marginBottom:4},children:n}),o&&u.jsx("div",{style:{fontSize:12,opacity:.7},children:o})]}),va=({componentName:t,componentProps:e={},storePropsKey:n,sessionId:o,title:r,develop:s=!1,style:a,id:c,componentResolver:l,placeholder:y,placeholderFlexDirection:h="column",index:p})=>{var D,j,N,E;const g=i.useContext(qe),{storeBaseKey:x,arrayIndex:v}=i.useMemo(()=>{if(!n)return{storeBaseKey:void 0,arrayIndex:null};const T=n.split(".")[0],{baseName:K,index:B}=dt(T);let L=B;if(L===null&&p!==void 0&&p!==null){const _=Number(p);L=Number.isFinite(_)?_:null}if(L===null){const _=Number(g==null?void 0:g.index);if(Number.isFinite(_))L=_;else{const I=Number(g==null?void 0:g.parentIndex);L=Number.isFinite(I)?I:null}}return{storeBaseKey:de(o,K),arrayIndex:L}},[n,o,p,g]),f=O(T=>{if(!x)return null;const K=T.dataSets[x];if(v!==null){const B=K==null?void 0:K.value;if(!Array.isArray(B))return K!=null&&typeof K.componentName=="string"?K:null;const L=Number((g==null?void 0:g.parentIndex)!==void 0?g.parentIndex:g==null?void 0:g.index);if(Number.isFinite(L)){const _=B[L];if(Array.isArray(_))return _[v]??null}return B[v]??null}return K??null}),m=i.useMemo(()=>{if(!n||!f)return{componentName:"",props:{}};const K=n.split(".")[1],B=K?f[K]||{}:f;if(typeof B=="object"&&B!==null){const{componentName:L,props:_,...I}=B;return{componentName:L||"",props:_||I||{}}}return{componentName:"",props:{}}},[n,o,f]),d=((D=m.props)==null?void 0:D.inheritDataSet)!==void 0?String((j=m.props)==null?void 0:j.inheritDataSet):void 0,C=((N=m.props)==null?void 0:N.inheritDataSetFieldRoot)!==void 0?String((E=m.props)==null?void 0:E.inheritDataSetFieldRoot):void 0,b=m.componentName||t,w=i.useMemo(()=>({...m.props?(()=>{const{inheritDataSet:T,inheritDataSetFieldRoot:K,...B}=m.props;return B})():{},...p!==void 0?{index:p}:{},...e,sessionId:o}),[m.props,e,o,p]),M=i.useMemo(()=>{var I,P;if(!d)return null;const T=!!C&&C.trim().startsWith("["),K=(I=m.props)==null?void 0:I.index,B=T?void 0:typeof K=="number"&&Number.isFinite(K)?K:v!==null?v:void 0,L=(P=m.props)==null?void 0:P.parentIndex;let _;if(typeof L=="number"&&Number.isFinite(L))_=L;else if(g){const R=(g==null?void 0:g.parentIndex)??(g==null?void 0:g.index);_=R!==void 0?Number(R):void 0,_!==void 0&&!Number.isFinite(_)&&(_=void 0)}return{dataSet:d,...B!==void 0?{index:B}:{},..._!==void 0?{parentIndex:_}:{},...g?{parentContext:g}:{},...C?{dataSetFieldRoot:C}:{},sessionId:o}},[d,v,m.props,g,C,o]),S=y||"请配置组件";if(s){const T=h==="row";return u.jsxs("div",{id:c,style:{width:"100%",height:"100%",display:"flex",flexGrow:1,flexDirection:h,alignItems:"center",justifyContent:"center",gap:T?8:0,border:"2px dashed #d9d9d9",borderRadius:4,color:"#8c8c8c",background:"transparent",boxSizing:"border-box"},children:[u.jsx(ze.ApiOutlined,{style:{fontSize:20,flexShrink:0,color:"#bfbfbf",...T?{}:{marginBottom:4}}}),u.jsx("div",{style:{fontWeight:500,fontSize:12},children:r||"动态容器"}),u.jsx("div",{style:{fontSize:11,opacity:.7},children:b?`${b}`:"未配置"}),n&&u.jsx("div",{style:{fontSize:10,opacity:.5,marginTop:T?0:2},children:n})]})}const A=Ge(),k=l||A.componentResolver;if(!k)return u.jsx(Pn,{id:c,title:S,description:"动态容器未配置组件解析器",style:a});const $=b?k(b):null;return $?u.jsx(i.Suspense,{fallback:u.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:u.jsx(F.Spin,{})}),children:u.jsx("div",{id:c,style:{width:"100%",height:"100%",flex:"1 1 auto",...a},children:M?u.jsx(qe.Provider,{value:M,children:u.jsx($,{...w})}):u.jsx($,{...w})})}):u.jsx(Pn,{id:c,title:S,description:b?`组件 "${b}" 未找到`:void 0,style:a})},ba=({content:t="Watermark",width:e,height:n,rotate:o=-22,zIndex:r=9,image:s,gap:a=[100,100],offset:c,inherit:l=!0,font:y,develop:h,token:p,children:g,...x})=>{const v={color:(y==null?void 0:y.color)??"rgba(0, 0, 0, 0.15)",fontSize:(y==null?void 0:y.fontSize)??16,fontWeight:(y==null?void 0:y.fontWeight)??"normal",fontFamily:(y==null?void 0:y.fontFamily)??"sans-serif",fontStyle:(y==null?void 0:y.fontStyle)??"normal",textAlign:(y==null?void 0:y.textAlign)??"center"},f=u.jsx(F.Watermark,{content:t,width:e,height:n,rotate:o,zIndex:r,image:s,gap:a,offset:c,inherit:l,font:v,...x,children:h?u.jsx("div",{"data-slot":"content",style:{minHeight:100,minWidth:100,display:"block",position:"relative"},children:g}):g});return p&&Object.keys(p).length>0?u.jsx(F.ConfigProvider,{theme:{algorithm:F.theme.defaultAlgorithm,token:p},children:f}):f};if(typeof Promise<"u"){const t=Promise;typeof t.withResolvers!="function"&&(t.withResolvers=function(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}})}if(typeof URL<"u"){const t=URL;typeof t.parse!="function"&&(t.parse=function(e,n){try{return arguments.length<2||n===void 0?new URL(String(e)):new URL(String(e),String(n))}catch{return null}})}let lr=!1,Kn=!1;function xa(t){typeof window>"u"||(Vt.pdfjs.GlobalWorkerOptions.workerSrc=t,lr=!0)}function ur(t){var o,r;if(typeof window>"u"||lr)return;const e=(o=Ge().pdfWorkerFallbackUrl)==null?void 0:o.trim(),n=(r=t??e)==null?void 0:r.trim();if(n){Vt.pdfjs.GlobalWorkerOptions.workerSrc=n;return}Kn||(Kn=!0,console.warn("[@nuwatop/code-canvas-core] PDF worker 未配置。请在入口调用 setPdfjsWorkerSrc(localUrl),或通过 setCoreConfig({ pdfWorkerFallbackUrl }) 指定同源脚本地址。"))}const Sa=.5,Ca=3,zn=.1,Ma=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,filePath:s,initialPage:a=1,metaPathPrefix:c="",loadErrorMessage:l,nonPdfBackgroundColor:y="#ECECEC",styles:h,token:p,className:g,style:x})=>{i.useEffect(()=>{ur()},[]);const v=O(H=>H.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),m=O(H=>{if(!f||!r)return;const ae=H.getDataSet(f,r);if(ae!=null&&ae!=="")return String(ae)}),d=O(H=>{var ae;return e&&t?((ae=H.propsStore[`${e}_props`])==null?void 0:ae[t])??null:null}),C=i.useMemo(()=>{let H;if(m!==void 0)H=m;else if(d&&typeof d=="object"){const ae=d.filePath;ae!=null&&ae!==""&&(H=String(ae))}return H===void 0&&(H=s),H},[m,d,s]),b=i.useMemo(()=>{if(d&&typeof d=="object"){const H=d.nonPdfBackgroundColor;if(typeof H=="string"&&H.trim())return H.trim()}return y},[d,y]),[w,M]=i.useState(0),[S,A]=i.useState(()=>Math.max(1,a||1)),k=i.useRef(S);k.current=S;const[$,D]=i.useState(null),[j,N]=i.useState(!!C),[E,T]=i.useState("all"),[K,B]=i.useState("width"),[L,_]=i.useState(1),I=i.useRef(null),P=i.useRef(null),R=i.useRef({}),V=i.useRef(!1),z=i.useRef(null),[q,G]=i.useState(600),[ie,pe]=i.useState(800),ne=i.useRef(0),ue=i.useMemo(()=>{var Y;const H=(Y=Ge().pdfCMapUrl)==null?void 0:Y.trim();return H?{cMapUrl:H.endsWith("/")?H:`${H}/`,cMapPacked:!0}:{}},[]),fe=(c||"").trim(),me=O(H=>{if(!(!f||!fe))return H.getDataSet(f,`${fe}.targetPage`)});i.useEffect(()=>{const H=P.current;if(!H)return;const ae=new ResizeObserver(()=>{const ve=H.clientWidth,ce=H.clientHeight;ve>0&&G(ve),ce>0&&pe(ce)});ae.observe(H);const Y=H.clientWidth,X=H.clientHeight;return Y>0&&G(Y),X>0&&pe(X),()=>ae.disconnect()},[C]);const ee=i.useMemo(()=>Math.max(240,q-16),[q]),W=i.useMemo(()=>Math.max(320,ie-16),[ie]),te=i.useMemo(()=>Math.max(120,ee*L),[ee,L]),ye=i.useMemo(()=>Math.max(180,W*L),[W,L]),Q=i.useMemo(()=>E==="all"?Array.from({length:w},(H,ae)=>ae+1):[S],[E,w,S]),oe=i.useCallback((H,ae)=>{!f||!fe||(v(f,`${fe}.currentPage`,H),ae>0&&v(f,`${fe}.totalPages`,ae))},[f,fe,v]);i.useEffect(()=>{w>0&&oe(S,w)},[S,w,oe]);const xe=i.useCallback((H,ae="auto")=>{const Y=w>0?Math.max(1,Math.min(Math.floor(H),w)):Math.max(1,Math.floor(H));if(A(Y),E==="all"){const X=R.current[Y];X&&X.scrollIntoView({block:"start",behavior:ae})}},[w,E]),Ne=i.useRef(xe);Ne.current=xe,i.useEffect(()=>{const H=me;typeof H!="number"||!Number.isFinite(H)||(xe(H,"auto"),f&&fe&&v(f,`${fe}.targetPage`,void 0))},[me,xe,f,fe,v]),i.useEffect(()=>{const H=Math.max(1,a??1);A(H)},[a]);const $e=i.useCallback(({numPages:H})=>{D(null),N(!1);const ae=k.current,Y=Math.min(Math.max(1,ae),H||1);M(H),A(Y),V.current=!0,z.current=Y},[]),_e=i.useCallback(H=>{D(H),N(!1),V.current=!1,z.current=null},[]);i.useEffect(()=>{N(!!C),D(null),_(1),M(0),V.current=!!C,z.current=null,R.current={}},[C]),i.useEffect(()=>{const H=z.current;if(H==null||j||w<=0||E!=="all")return;let ae=!1,Y=0;const X=120,ve=()=>{if(ae)return;Y++;const ce=Math.max(1,Math.min(Math.floor(H),w));let J=!0;for(let he=1;he<=ce;he++){const be=R.current[he];if(!be||!be.isConnected||be.clientHeight<=50){J=!1;break}}if(J){requestAnimationFrame(()=>{if(ae)return;const he=R.current[ce];he&&he.scrollIntoView({block:"start",behavior:"auto"}),z.current=null,requestAnimationFrame(()=>{ae||(V.current=!1)})});return}if(Y>=X){z.current=null,V.current=!1;return}requestAnimationFrame(ve)};return requestAnimationFrame(ve),()=>{ae=!0}},[j,w,E]);const Ee=i.useCallback(H=>{_(ae=>{const Y=Number((ae+H).toFixed(2));return Math.max(Sa,Math.min(Ca,Y))})},[]),Se=i.useCallback(()=>{if(!C)return;const H=window.open(C,"_blank","noopener,noreferrer");H&&(H.onload=()=>{try{H.print()}catch{}})},[C]),Ke=i.useCallback(()=>{if(!C)return;const H=document.createElement("a");H.href=C,H.download="",H.rel="noopener noreferrer",H.target="_blank",document.body.appendChild(H),H.click(),H.remove()},[C]),Z=i.useCallback(()=>{var ae;const H=I.current;H&&((ae=H.requestFullscreen)==null||ae.call(H))},[]),re=i.useCallback(()=>{document.fullscreenElement&&document.exitFullscreen()},[]),le=i.useCallback(()=>{if(j||E!=="all"||w<=0||V.current)return;const H=P.current;if(!H)return;const ae=H.scrollTop+H.clientHeight*.35;let Y=S,X=Number.POSITIVE_INFINITY;for(let ve=1;ve<=w;ve++){const ce=R.current[ve];if(!ce)continue;const J=Math.abs(ce.offsetTop-ae);J<X&&(X=J,Y=ve)}Y!==S&&A(Y)},[j,E,w,S]);return i.useEffect(()=>{if(!d||typeof d!="object")return;const H=d._pdfCmdNonce,ae=d.pdfCommand,Y=d.pdfCommandArg;if(!(H==null||H===ne.current||!ae)){switch(ne.current=H,ae){case"print":Se();break;case"download":Ke();break;case"enterFullscreen":Z();break;case"exitFullscreen":re();break;case"goToPage":typeof Y=="number"&&xe(Y,"smooth");break;case"fitWidth":B("width"),_(1);break;case"fitHeight":B("height"),_(1);break;case"zoomIn":Ee(zn);break;case"zoomOut":Ee(-zn);break;case"previewSingle":T("single");break;case"previewAll":T("all");break}if(e&&t){const X=O.getState().getProps(e,t),ve=X&&typeof X=="object"&&!Array.isArray(X)?X:{};O.getState().setProps(e,t,{...ve,pdfCommand:void 0,pdfCommandArg:void 0})}}},[d,e,t,Se,Ke,Z,re,xe,Ee]),u.jsx("div",{ref:I,className:g,style:{display:"flex",flexDirection:"column",width:"100%",flexGrow:1,...x},children:u.jsx("div",{ref:P,onScroll:le,style:{flex:1,width:"100%",overflow:"auto",position:"relative",backgroundColor:b,border:n?"1px dashed #ccc":void 0},children:$?u.jsx(F.Alert,{type:"error",message:(l==null?void 0:l.trim())||$.message,showIcon:!0}):C?u.jsxs(u.Fragment,{children:[j?u.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:b,zIndex:2,pointerEvents:"none"},children:u.jsx(F.Spin,{})}):null,u.jsx(Vt.Document,{file:C,onLoadSuccess:$e,onLoadError:_e,loading:null,options:ue,children:Q.map(H=>u.jsx("div",{ref:ae=>{R.current[H]=ae},style:{display:"flex",justifyContent:"center",width:"100%",padding:"8px 0"},children:u.jsx(Vt.Page,{pageNumber:H,width:K==="width"?te:void 0,height:K==="height"?ye:void 0,renderTextLayer:!1,renderAnnotationLayer:!1})},H))},C)]}):u.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:u.jsx(F.Empty,{image:u.jsx(ze.FilePdfOutlined,{style:{fontSize:72,color:"rgba(0, 0, 0, 0.25)"}}),description:u.jsxs("div",{style:{textAlign:"center"},children:[u.jsx("div",{style:{marginBottom:8,fontSize:14,color:"rgba(0, 0, 0, 0.88)"},children:"暂无预览"}),u.jsx("div",{style:{fontSize:12,color:"rgba(0, 0, 0, 0.45)"},children:"请传入文件路径"})]})})})})})};function Aa(t,e,n,o){const{getProps:r,setProps:s}=O.getState(),a=r(t,e),c=a&&typeof a=="object"&&!Array.isArray(a)?a:{};s(t,e,{...c,pdfCommand:n,pdfCommandArg:o,_pdfCmdNonce:Date.now()})}function Re(t){if(!(t==null||t==="")){if(typeof t=="string")try{const e=t.trim();if(e.startsWith("{")||e.startsWith("["))return JSON.parse(e)}catch{}return t}}function ja(t,e){return t==null||t===""?e:t===!0||t==="true"?!0:t===!1||t==="false"?!1:e}function ot(t,e){const{chartType:n,defaultHeight:o=300,defaultData:r=[]}=e,s=a=>{const{id:c,sessionId:l,develop:y,style:h,className:p,dataSet:g,dataSetField:x,data:v,common:f,height:m,width:d,autoFit:C,padding:b,title:w,legend:M,label:S,tooltip:A,animate:k,scale:$,interaction:D,annotations:j,axis:N,scrollbar:E,slider:T,theme:K,state:B,events:L,..._}=a,I=i.useRef(null),P=O(xe=>xe.getDataSet),R=O(xe=>xe.addCommand),V=i.useMemo(()=>{if(g&&x){const Ne=P(g,x);if(Ne!==void 0)return Ne}const xe=Re(v);return xe!==void 0?xe:y?r:[]},[v,g,x,P,y]),z=xe=>{var Ne;if(I.current=xe,!y&&l){const $e=Re(L);$e&&typeof $e=="object"&&Object.entries($e).forEach(([_e,Ee])=>{typeof Ee=="string"&&xe.on(_e,Se=>{R(l,{actionName:Ee,arg:Se,timestamp:Date.now()})})})}(Ne=_.onReady)==null||Ne.call(_,xe)},q=Re(f)||{},G={data:V,height:q.height??o,autoFit:ja(q.autoFit,!0),...q,animate:y?!1:Re(k),onReady:z,..._},ie=Re(w);ie!==void 0&&(G.title=ie);const pe=Re(M);pe!==void 0&&(G.legend=pe);const ne=Re(S);ne!==void 0&&(G.label=ne);const ue=Re(A);ue!==void 0&&(G.tooltip=ue);const fe=Re($);fe!==void 0&&(G.scale=fe);const me=Re(D);me!==void 0&&(G.interaction=me);const ee=Re(j);ee!==void 0&&(G.annotations=ee);const W=Re(N);W!==void 0&&(G.axis=W);const te=Re(E);te!==void 0&&(G.scrollbar=te);const ye=Re(T);ye!==void 0&&(G.slider=ye);const Q=Re(K);Q!==void 0&&(G.theme=Q);const oe=Re(B);return oe!==void 0&&(G.state=oe),u.jsx(t,{...G})};return s.displayName=`withBaseChart(${n})`,s}const wa=[{year:"2020",value:3},{year:"2021",value:4},{year:"2022",value:3.5},{year:"2023",value:5},{year:"2024",value:4.9},{year:"2025",value:6}],ka=ot(at.Line,{chartType:"AndVLine",defaultHeight:300,defaultData:wa}),Da=t=>{const{xField:e="year",yField:n="value",seriesField:o,smooth:r=!1,connectNulls:s=!1,lineStyle:a,...c}=t;return u.jsx(ka,{...c,xField:e,yField:n,seriesField:o,smooth:r,connectNulls:s,lineStyle:a})},Na=[{category:"一月",value:38},{category:"二月",value:52},{category:"三月",value:61},{category:"四月",value:45},{category:"五月",value:48},{category:"六月",value:58}],Ta=ot(at.Column,{chartType:"AndVColumn",defaultHeight:300,defaultData:Na}),Ea=t=>{const{xField:e="category",yField:n="value",seriesField:o,isGroup:r=!1,isStack:s=!1,columnWidth:a,...c}=t,l={...c,xField:e,yField:n};return o&&(l.seriesField=o),r&&(l.isGroup=r),s&&(l.isStack=s),a&&(l.columnWidth=a),u.jsx(Ta,{...l})},_a=[{type:"分类一",value:27},{type:"分类二",value:25},{type:"分类三",value:18},{type:"分类四",value:15},{type:"分类五",value:10},{type:"其他",value:5}],Oa=ot(at.Pie,{chartType:"AndVPie",defaultHeight:300,defaultData:_a}),Ra=t=>{const{angleField:e="value",colorField:n="type",radius:o=.8,innerRadius:r,...s}=t,a={...s,angleField:e,colorField:n,radius:o};return r!==void 0&&r>0&&(a.innerRadius=r),u.jsx(Oa,{...a})},$a=ot(at.Area,{chartType:"AndVArea",defaultHeight:300,defaultData:[{year:"1991",value:3},{year:"1992",value:4},{year:"1993",value:3.5},{year:"1994",value:5},{year:"1995",value:4.9},{year:"1996",value:6},{year:"1997",value:7},{year:"1998",value:9},{year:"1999",value:13}]}),Ba=t=>{const{xField:e,yField:n,seriesField:o,colorField:r,shapeField:s,sizeField:a,line:c,point:l,stack:y,percent:h,symmetry:p,diff:g,...x}=t,v={...x};e&&(v.xField=e),n&&(v.yField=n),o&&(v.seriesField=o),r&&(v.colorField=r),s&&(v.shapeField=s),a&&(v.sizeField=a),y!==void 0&&(v.stack=y===!0||y==="true"),h!==void 0&&(v.percent=h===!0||h==="true"),p!==void 0&&(v.symmetry=p===!0||p==="true"),g!==void 0&&(v.diff=g===!0||g==="true");const f=Re(c);f!==void 0&&(v.line=f);const m=Re(l);return m!==void 0&&(v.point=m),u.jsx($a,{...v})},La=ot(at.DualAxes,{chartType:"AndVDualAxes",defaultHeight:300,defaultData:[{year:"1991",value:3,count:10},{year:"1992",value:4,count:4},{year:"1993",value:3.5,count:5},{year:"1994",value:5,count:5},{year:"1995",value:4.9,count:4.9},{year:"1996",value:6,count:35},{year:"1997",value:7,count:7},{year:"1998",value:9,count:1},{year:"1999",value:13,count:20}]}),Va=t=>{const{xField:e,yField:n,seriesField:o,colorField:r,children:s,...a}=t,c={...a};console.log("[AndVDualAxes] props:",{xField:e,yField:n,children:s}),e&&(c.xField=e);const l=Re(n);l?c.yField=l:n&&(c.yField=n),o&&(c.seriesField=o),r&&(c.colorField=r);const y=Re(s);return y!==void 0&&(c.children=y),u.jsx(La,{...c})},Fa=ot(at.Gauge,{chartType:"AndVGauge",defaultHeight:300,defaultData:{percent:.7}}),Pa=t=>{const{...e}=t,n={...e};return console.log("[AndVGauge] chartProps:",JSON.stringify(n,null,2)),u.jsx(Fa,{...n})},Ka=ot(at.Liquid,{chartType:"AndVLiquid",defaultHeight:300,defaultData:.25}),za=t=>{const{percent:e,...n}=t,o={...n};return e!==void 0&&(o.percent=e),console.log("[AndVLiquid] chartProps:",JSON.stringify(o,null,2)),u.jsx(Ka,{...o})},qa=ot(at.Bar,{chartType:"AndVBar",defaultHeight:300,defaultData:[{year:"1951 年",value:38},{year:"1952 年",value:52},{year:"1956 年",value:61},{year:"1957 年",value:145},{year:"1958 年",value:48}]}),Wa=t=>{const{xField:e,yField:n,seriesField:o,colorField:r,stack:s,group:a,percent:c,conversionTag:l,markBackground:y,...h}=t,p={...h};e&&(p.xField=e),n&&(p.yField=n),o&&(p.seriesField=o),r&&(p.colorField=r),s!==void 0&&(p.stack=s===!0||s==="true"),a!==void 0&&(p.group=a===!0||a==="true"),c!==void 0&&(p.percent=c===!0||c==="true");const g=Re(l);g!==void 0&&(p.conversionTag=g);const x=Re(y);return x!==void 0&&(p.markBackground=x),console.log("[AndVBar] chartProps:",JSON.stringify(p,null,2)),u.jsx(qa,{...p})};exports.AVAILABLE_TOKENS=Uo;exports.AndAlert=Zi;exports.AndAutoComplete=_s;exports.AndAvatar=Li;exports.AndBadge=Hi;exports.AndBadgeRibbon=Yi;exports.AndBreadCrumb=Ki;exports.AndButton=Qo;exports.AndCalendar=Ii;exports.AndCard=sa;exports.AndCarousel=Ni;exports.AndCascade=Ns;exports.AndCheckbox=As;exports.AndColumn=ca;exports.AndContainer=la;exports.AndDatePicker=bs;exports.AndDivider=ia;exports.AndDrawer=ea;exports.AndDropdown=cr;exports.AndDropdownMenu=cr;exports.AndDynamicContainer=va;exports.AndFormItem=Rs;exports.AndIcon=ga;exports.AndImage=Oi;exports.AndImageGroup=Bi;exports.AndInput=nr;exports.AndInputArea=os;exports.AndInputNumber=rr;exports.AndInputPassword=as;exports.AndInputSearch=ls;exports.AndIterator=ma;exports.AndMasonry=Qi;exports.AndMenu=Wi;exports.AndModal=Xi;exports.AndPagination=Pi;exports.AndParagraph=bi;exports.AndPdfViewer=Ma;exports.AndProductCategory=pa;exports.AndQRCode=ua;exports.AndRadio=Ms;exports.AndRangePicker=Cs;exports.AndRate=js;exports.AndResult=ta;exports.AndRow=aa;exports.AndSegmented=Vs;exports.AndSelect=ms;exports.AndSimpleForm=Os;exports.AndSlider=ws;exports.AndSplitter=da;exports.AndSplitterPanel=fa;exports.AndStatistics=ji;exports.AndStatisticsCountdown=wi;exports.AndSteps=Ai;exports.AndSwitch=ys;exports.AndTable=mi;exports.AndTabs=Si;exports.AndTag=Fi;exports.AndText=hi;exports.AndTimePicker=xs;exports.AndTimeline=Mi;exports.AndTitle=pi;exports.AndTransfer=$s;exports.AndTree=Ci;exports.AndTreeSelect=Ts;exports.AndUpload=Es;exports.AndVArea=Ba;exports.AndVBar=Wa;exports.AndVColumn=Ea;exports.AndVDualAxes=Va;exports.AndVGauge=Pa;exports.AndVLine=Da;exports.AndVLiquid=za;exports.AndVPie=Ra;exports.AndWatermark=ba;exports.COMMON_TOKENS=Go;exports.DataSetInheritContext=qe;exports.cleanupAllMounts=_r;exports.clearCssCache=Tr;exports.collectContextChainRootToLeaf=cn;exports.createCommand=se;exports.createWatchCommands=Fr;exports.deriveScopedComponentId=ct;exports.dictValueEquals=Qn;exports.dispatchPdfViewerCommand=Aa;exports.ensurePdfjsWorker=ur;exports.findDictOptionByValue=et;exports.flattenScopeChain=xo;exports.formatByType=er;exports.getAccessToken=Ft;exports.getCoreConfig=Ge;exports.getDataSetStoreKey=de;exports.getDictOptions=Pt;exports.getNestedValue=xt;exports.getValidateStoreKey=bt;exports.initReactMount=Wn;exports.isTokenName=un;exports.layoutKeyPrefixFromContext=So;exports.mergeStoreProps=Ie;exports.mountReactComponent=Er;exports.parseAction=st;exports.parseArrayNotation=dt;exports.parseChangeAction=Te;exports.parseClickAction=on;exports.parseNestedPath=lt;exports.parseQueryAction=Pr;exports.processValidationRules=sn;exports.req=jo;exports.request=it;exports.resolveInheritedDataSet=Jn;exports.resolveTokenColorWithToken=Jo;exports.setCoreConfig=Ao;exports.setNestedValue=In;exports.setPdfjsWorkerSrc=xa;exports.upload=ln;exports.useAddCommand=$r;exports.useAndStore=O;exports.useApiService=Zn;exports.useCommandsStore=Vr;exports.useDictOptions=St;exports.useFieldValidation=We;exports.useItemStore=Lr;exports.usePopCommand=Br;exports.useRemoteOptions=Kt;exports.useResolveTokenColor=Tt;exports.useResolvedDataSet=tt;exports.useStore=Or;exports.useStoreByName=Rr;exports.useStoreData=Hn;exports.validateWithSchema=an;exports.watchCommands=Yn;exports.withBaseChart=ot;
22
+ `})})(),Z?u.jsx(V.ConfigProvider,{theme:Z,children:gn}):gn]}),$t,hn&&u.jsx("div",{"data-table-slot":"footer",children:hn}),br,yt&&u.jsx(mi,{open:xe,position:pe,rowIndexVisible:He,columnItems:ft,defaultRowIndexVisible:be,defaultColumnItems:he,scrollX:fr,defaultScrollX:ke,size:fn,defaultSize:Oe,onSave:yr,onClose:mr})]})},{Text:xi}=V.Typography,Si=({id:t,sessionId:e,develop:n,content:o,children:r,dataSet:s,dataSetField:a,fontSize:c,color:l,dictCode:y,formatType:h,formatValue:p,fallbackDisplay:g=!1,styles:C,token:v,clickAction:m,stopClickPropagation:f,index:d,...x})=>{const b=O(Q=>Q.addCommand),j=i.useContext(We),M=d??(j==null?void 0:j.index),S=j==null?void 0:j.parentIndex,A=typeof s=="string"&&s.trim()!=="",k=typeof a=="string"&&a.trim()!=="",$=A||k||y==="selectedCount",D=tt($?s:void 0,$?a:void 0,e),w=e??D.sessionId,N=O(Q=>Q.getDataSet),E=i.useMemo(()=>w?ct(t,j,d):null,[w,t,j==null?void 0:j.parentIndex,j==null?void 0:j.index,d]),T=O(Q=>{var oe;return E?((oe=Q.propsStore[`${w}_props`])==null?void 0:oe[E])??null:null}),z=i.useMemo(()=>y==="selectedCount"&&a&&!s?a:$?D.dataSet:void 0,[y,a,s,D.dataSet,$]),B=i.useMemo(()=>y==="selectedCount"?"selectedCount":$?D.dataSetField:void 0,[y,D.dataSetField,$]),L=i.useMemo(()=>de(w,z),[w,z]),_=O(Q=>{if(!L)return;const oe=dt(L).baseName;return Q.dataSets[oe]}),{options:I}=St(y),P=i.useMemo(()=>{if(L&&B)return N(L,B)},[L,B,N,_]),R=i.useMemo(()=>{if(!p)return{};if(typeof p=="string")try{return JSON.parse(p)}catch{return{}}return p},[p]),F=Q=>Q==null||Q===""||typeof Q=="string"&&Q.trim()==="",K=i.useMemo(()=>$&&!!(L&&B&&String(B).trim()!==""),[$,L,B]),q=i.useMemo(()=>n?o:K?g&&F(P)?o:P:(T==null?void 0:T.content)!==void 0?T.content:o,[n,K,P,T==null?void 0:T.content,o,g]),G=i.useMemo(()=>{if(y&&I.length>0&&q!==void 0&&q!==null){const Q=et(I,q);return(Q==null?void 0:Q.label)??q}return q},[y,I,q]),ie=i.useMemo(()=>{if(n)return G;const Q=(T==null?void 0:T.formatType)||h;return Q&&G!==void 0&&G!==null?tr(G,Q,R):G},[n,G,h,R,T==null?void 0:T.formatType]),pe=i.useMemo(()=>{const Q={...x};return T&&typeof T=="object"&&Object.keys(T).forEach(oe=>{!["content","formatType","formatValue","clickAction","stopClickPropagation"].includes(oe)&&T[oe]!==void 0&&T[oe]!==null&&(Q[oe]=T[oe])}),Q},[x,T]),ne=i.useMemo(()=>(T==null?void 0:T.clickAction)??m,[T==null?void 0:T.clickAction,m]),ue=(T==null?void 0:T.develop)??n,fe=i.useMemo(()=>{if(ue)return!1;const Q=(T==null?void 0:T.stopClickPropagation)??f;return Q!==void 0?Q:!!ne},[ue,T==null?void 0:T.stopClickPropagation,f,ne]),me=(T==null?void 0:T.color)??l,ee=Et(me),W=i.useMemo(()=>{if(!v)return;let Q=v;if(typeof v=="string")try{Q=JSON.parse(v)}catch{return}if(!Q||typeof Q!="object")return;const oe={};return Object.entries(Q).forEach(([xe,Ne])=>{Ne!==""&&Ne!==void 0&&Ne!==null&&(oe[xe]=Ne)}),Object.keys(oe).length>0?oe:void 0},[v]),te=i.useMemo(()=>{const Q={width:"100%"},oe=(T==null?void 0:T.fontSize)??c;if(oe){const xe=oe&&!String(oe).match(/\d+(px|em|rem|%|vh|vw|pt|pc|in|cm|mm|ex|ch)$/)?`${oe}px`:oe;Q.fontSize=xe}return ee&&(Q.color=ee),Q},[c,ee,T==null?void 0:T.fontSize]),ye=u.jsx(xi,{...pe,style:{...te,...C,...pe.style},onClick:Q=>{if(typeof pe.onClick=="function"&&pe.onClick(Q),ne&&w){const{actionName:oe,arg:xe}=an(ne,{id:t,index:M,parentIndex:S,dataSet:z,dataSetField:B,...pe}),Ne=se(oe,xe);b(w,Ne)}fe&&Q.stopPropagation()},children:ie!=null&&ie!==""?String(ie):r});return W?u.jsx(V.ConfigProvider,{theme:{token:W},children:ye}):ye},{Title:Ci}=V.Typography,Mi=({id:t,sessionId:e,develop:n,content:o,children:r,dataSet:s,dataSetField:a,level:c=1,color:l,styles:y,...h})=>{const p=O(M=>M.getDataSet),g=O(M=>M.getProps),C=i.useMemo(()=>de(e,s),[e,s]),v=i.useMemo(()=>e&&t?g(e,t):null,[e,t,g]),m=i.useMemo(()=>{if(C&&a)return p(C,a)},[C,a,p]),f=i.useMemo(()=>n?o:m!=null&&m!==""?String(m):(v==null?void 0:v.content)!==void 0?v.content:o,[n,m,v==null?void 0:v.content,o]),d=(v==null?void 0:v.color)??l,x=Et(d),b=i.useMemo(()=>{const M={};return x&&(M.color=x),M},[x]),j=i.useMemo(()=>{const M={...h};return v&&typeof v=="object"&&Object.keys(v).forEach(S=>{S!=="content"&&v[S]!==void 0&&v[S]!==null&&(M[S]=v[S])}),M},[h,v]);return u.jsx(Ci,{level:c,...j,style:{...b,...y,...j.style},children:f||r})},{Paragraph:Ai}=V.Typography,ji=({id:t,sessionId:e,develop:n,content:o,children:r,dataSet:s,dataSetField:a,color:c,styles:l,...y})=>{const h=O(j=>j.getDataSet),p=O(j=>j.getProps),g=i.useMemo(()=>de(e,s),[e,s]),C=i.useMemo(()=>e&&t?p(e,t):null,[e,t,p]),v=i.useMemo(()=>{if(g&&a)return h(g,a)},[g,a,h]),m=i.useMemo(()=>n?o:v!=null&&v!==""?String(v):(C==null?void 0:C.content)!==void 0?C.content:o,[n,v,C==null?void 0:C.content,o]),f=(C==null?void 0:C.color)??c,d=Et(f),x=i.useMemo(()=>{const j={};return d&&(j.color=d),j},[d]),b=i.useMemo(()=>{const j={...y};return C&&typeof C=="object"&&Object.keys(C).forEach(M=>{M!=="content"&&C[M]!==void 0&&C[M]!==null&&(j[M]=C[M])}),j},[y,C]);return u.jsx(Ai,{...b,style:{...x,...l,...b.style},children:m||r})},wi=t=>{if(!t)return[];if(typeof t=="string")try{return JSON.parse(t)}catch{return[]}return t},ki=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,tabs:s,items:a,changeAction:c,onChange:l,activeKey:y,defaultActiveKey:h,renderTabContent:p,children:g,...C})=>{const v=O($=>$.addCommand),m=O($=>$.getDataSet),f=O($=>$.setDataSet),d=i.useMemo(()=>de(e,o),[e,o]),x=i.useMemo(()=>wi(s),[s]),b=i.useMemo(()=>a&&a.length>0?n?a.map($=>({...$,forceRender:!0})):a:x.length>0?x.map(($,D)=>({key:$.key,label:$.tab,disabled:$.disabled,forceRender:n?!0:void 0,children:p?p($.key,D):null})):[],[a,x,p,n]),j=i.useMemo(()=>{if(d&&r)return m(d,r)},[d,r,m]),[M,S]=i.useState(void 0),A=i.useMemo(()=>{if(n&&M)return M;const $=j??y??h;return!$&&b.length>0?b[0].key:$},[n,M,j,y,h,b]),k=i.useCallback($=>{if(n){S($);return}if(l){l($);return}d&&r&&f(d,r,$),c&&e&&v(e,se(c,$))},[n,l,d,r,f,c,e,v]);return u.jsx(V.Tabs,{...C,activeKey:A,items:b,onChange:k,animated:n?!1:C.animated,children:g})},Di=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,selectAction:s,checkAction:a,expandAction:c,dragEndAction:l,dragEnterAction:y,dragLeaveAction:h,dragOverAction:p,dragStartAction:g,dropAction:C,rightClickAction:v,loadAction:m,onSelect:f,onCheck:d,onExpand:x,onDragEnd:b,onDragEnter:j,onDragLeave:M,onDragOver:S,onDragStart:A,onDrop:k,onRightClick:$,onLoad:D,treeData:w,styles:N,classNames:E,token:T,...z})=>{const B=O(Z=>Z.addCommand),L=O(Z=>Z.setDataSet),_=i.useMemo(()=>de(e,o),[e,o]),I=i.useMemo(()=>o?de(e,`${o}_selected`):void 0,[e,o]),P=i.useMemo(()=>o?de(e,`${o}_checked`):void 0,[e,o]),R=i.useMemo(()=>o?de(e,`${o}_expanded`):void 0,[e,o]),F=O(Z=>{if(!_)return;if(r)return Z.getDataSet(_,r);const re=Z.dataSets[_];if(!re)return;if(Array.isArray(re))return re;const le=re.value;return Array.isArray(le)?le:void 0}),K=O(Z=>I?Z.getDataSet(I,""):void 0),q=O(Z=>P?Z.getDataSet(P,""):void 0),G=O(Z=>R?Z.getDataSet(R,""):void 0),ie=i.useMemo(()=>n?F??w??[]:_?F??[]:w??[],[n,_,F,w]),pe=K,ne=q,ue=G,fe=i.useCallback((Z,re)=>{if(f){f(Z,re);return}I&&L(I,"",Z),s&&e&&B(e,se(s,{selectedKeys:Z}))},[f,I,e,L,s,B]),me=i.useCallback((Z,re)=>{if(d){d(Z,re);return}P&&L(P,"",Z),a&&e&&B(e,se(a,{checkedKeys:Z}))},[d,P,e,L,a,B]),ee=i.useCallback((Z,re)=>{if(x){x(Z,re);return}R&&L(R,"",Z),c&&e&&B(e,se(c,{expandedKeys:Z,expanded:re.expanded}))},[x,R,e,L,c,B]),W=i.useCallback(Z=>{if(b){b(Z);return}l&&e&&B(e,se(l,Z))},[b,l,e,B]),te=i.useCallback(Z=>{if(j){j(Z);return}y&&e&&B(e,se(y,Z))},[j,y,e,B]),ye=i.useCallback(Z=>{if(M){M(Z);return}h&&e&&B(e,se(h,Z))},[M,h,e,B]),Q=i.useCallback(Z=>{if(S){S(Z);return}p&&e&&B(e,se(p,Z))},[S,p,e,B]),oe=i.useCallback(Z=>{if(A){A(Z);return}g&&e&&B(e,se(g,Z))},[A,g,e,B]),xe=i.useCallback(Z=>{if(k){k(Z);return}C&&e&&B(e,se(C,Z))},[k,C,e,B]),Ne=i.useCallback(Z=>{if($){$(Z);return}v&&e&&B(e,se(v,Z))},[$,v,e,B]),$e=i.useCallback((Z,re)=>{if(D){D(Z,re);return}m&&e&&B(e,se(m,{loadedKeys:Z,...re}))},[D,m,e,B]),_e=i.useMemo(()=>{if(!T)return;const Z={};return Object.entries(T).forEach(([re,le])=>{le!==""&&le!==void 0&&le!==null&&(Z[re]=le)}),Object.keys(Z).length>0?Z:void 0},[T]),Ee=i.useMemo(()=>{const Z={};return n&&(Z.motion=!1),_e&&(Z.components={Tree:_e}),Object.keys(Z).length>0?Z:void 0},[n,_e]),Se=n?{motion:!1}:{},Ke=u.jsx(V.Tree,{...z,...Se,treeData:ie,...I!=null?{selectedKeys:pe??[]}:{},...P!=null?{checkedKeys:ne??[]}:{},...R!=null?{expandedKeys:ue??[]}:{},onSelect:fe,onCheck:me,onExpand:ee,onDragEnd:W,onDragEnter:te,onDragLeave:ye,onDragOver:Q,onDragStart:oe,onDrop:xe,onRightClick:Ne,onLoad:$e,styles:N,classNames:E});return Ee?u.jsx(V.ConfigProvider,{theme:Ee,children:Ke}):Ke},Ni=({id:t,sessionId:e,develop:n,items:o,children:r,dataSet:s,dataSetField:a,remoteUrl:c,mode:l,...y})=>{const h=O(x=>x.getDataSet),p=O(x=>x.getProps),g=i.useMemo(()=>de(e,s),[e,s]),C=i.useMemo(()=>e&&t?p(e,t):null,[e,t,p]),v=i.useMemo(()=>{if(g&&a)return h(g,a)},[g,a,h]),m=i.useMemo(()=>{let x;const b=v!=null?Array.isArray(v)?v:typeof v=="string"?(()=>{try{return JSON.parse(v)}catch{return}})():void 0:C==null?void 0:C.items;return n?x=b??o:g?x=b??[]:x=o,Array.isArray(x)?x.map(j=>{const M={...j};return M.label&&!M.title&&(M.title=M.label,delete M.label),M.children&&!M.content&&(M.content=M.children,delete M.children),M}):x},[n,g,v,C==null?void 0:C.items,o]),f=i.useMemo(()=>{const x={...y};return C&&typeof C=="object"&&Object.keys(C).forEach(b=>{b!=="items"&&C[b]!==void 0&&C[b]!==null&&(x[b]=C[b])}),x},[y,C]),d=i.useMemo(()=>l==="left"?"start":l==="right"?"end":l,[l]);return u.jsx(V.Timeline,{...f,mode:d,items:m,children:r})},Gt=(t,e)=>{if(!t)return e;if(typeof t=="string")try{return JSON.parse(t)}catch{return e}return t},Ti=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,onChange:a,current:c,items:l,direction:y,orientation:h,labelPlacement:p,titlePlacement:g,styles:C,token:v,...m})=>{const f=O(T=>T.addCommand),d=O(T=>T.getDataSet),x=O(T=>T.setDataSet),b=i.useMemo(()=>de(e,o),[e,o]),j=i.useMemo(()=>{if(b&&r)return d(b,r)},[b,r,d]),M=i.useMemo(()=>j??c??0,[j,c]),S=i.useMemo(()=>h??y,[h,y]),A=i.useMemo(()=>g??p,[g,p]),k=i.useMemo(()=>Gt(l,[]),[l]),$=i.useMemo(()=>Gt(C,{}),[C]),D=i.useMemo(()=>Gt(v,{}),[v]),w=i.useCallback(T=>{if(a){a(T);return}b&&r&&x(b,r,T),s&&e&&f(e,se(s,T))},[a,b,r,x,s,e,f]),N=Object.keys(D).length>0,E=u.jsx(V.Steps,{...m,current:M,items:k,styles:$,orientation:S,titlePlacement:A,onChange:w});return N?u.jsx(V.ConfigProvider,{theme:{components:{Steps:D}},children:E}):E},Ei=({id:t,sessionId:e,develop:n,...o})=>u.jsx(V.Statistic,{...o}),_i=({id:t,sessionId:e,develop:n,...o})=>{const r=V.Statistic.Timer;if(r)return u.jsx(r,{type:"countdown",...o});const{Countdown:s}=V.Statistic;return u.jsx(s,{...o})},Oi={top:"top",bottom:"bottom",left:"start",right:"end"},Ri=t=>{if(!t)return[];if(typeof t=="string")try{return JSON.parse(t)}catch{return[]}return t},$i=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,dotPosition:s,dotPlacement:a,slides:c,changeAction:l,afterChange:y,renderSlideContent:h,children:p,...g})=>{const C=O(j=>j.addCommand),v=O(j=>j.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),f=i.useMemo(()=>{if(a)return a;if(s)return Oi[s]||s},[s,a]),d=i.useMemo(()=>Ri(c),[c]),x=i.useCallback(j=>{if(y){y(j);return}m&&r&&v(m,r,j),l&&e&&C(e,se(l,j))},[y,m,r,v,l,e,C]),b=i.useMemo(()=>p||(d.length>0?d.map((j,M)=>{const S=h?h(j.key,M):null;return u.jsx("div",{"data-slide-key":j.key,children:S||u.jsx("div",{style:{minHeight:"100px",display:"flex",alignItems:"center",justifyContent:"center",color:"#999",background:n?"#f5f5f5":void 0},children:n?j.title:null})},j.key)}):null),[p,d,h,n]);return u.jsx(V.Carousel,{...g,dotPlacement:f,afterChange:x,children:b})};function Bi(t){if(!t||typeof t!="string"||/^(data:|blob:|https?:\/\/)/i.test(t))return t;const e=Ue().viewRes;return e?e(t):t}const Vi="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMjAwIDIwMCI+PHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNmMGYwZjAiLz48cGF0aCBkPSJNNzAgNzBhMTIgMTIgMCAxIDEgMCAyNCAxMiAxMiAwIDAgMSAwLTI0em02MCAxMEw4NSAxMzBsLTI1LTIwLTIwIDE1djE1aDEyMHYtNDB6IiBmaWxsPSIjYmZiZmJmIi8+PC9zdmc+";function Li(t,e,n){if(!e)return;const{baseName:o,index:r}=dt(e),s=t[o];if(r!==null){const a=s==null?void 0:s.value;if(!Array.isArray(a)||a[r]===void 0)return;const c=a[r];return n?xt(c,lt(n)):c}if(s)return n?xt(s,lt(n)):s}const Fi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,remoteUrl:s,objectFit:a="cover",src:c,...l})=>{const y=O(f=>f.getProps),h=i.useMemo(()=>de(e,o),[e,o]),p=O(f=>h&&r?Li(f.dataSets,h,r):void 0),g=i.useMemo(()=>e&&t?y(e,t):null,[e,t,y]),C=i.useMemo(()=>{let f;return p!=null&&p!==""?f=String(p):(g==null?void 0:g.src)!==void 0?f=g.src:f=c,Bi(f)},[p,g==null?void 0:g.src,c]),v=i.useMemo(()=>{const f={...l};return g&&typeof g=="object"&&Object.keys(g).forEach(d=>{d!=="src"&&g[d]!==void 0&&g[d]!==null&&(f[d]=g[d])}),f},[l,g]),m={...v,src:C||void 0,fallback:v.fallback||Vi,preview:n?!1:v.preview,styles:{root:{width:"100%",height:"100%"},image:{width:"100%",height:"100%",objectFit:a}}};return u.jsx("div",{style:{width:"100%",height:"100%",display:"flex"},children:u.jsx(V.Image,{...m})})},{PreviewGroup:Pi}=V.Image;function zi(t){if(!t||typeof t!="string"||/^(data:|blob:|https?:\/\/)/i.test(t))return t;const e=Ue().viewRes;return e?e(t):t}const Ki=({id:t,sessionId:e,develop:n,children:o,dataSet:r,dataSetField:s,items:a,...c})=>{const l=O(f=>f.getDataSet),y=O(f=>f.getProps),h=i.useMemo(()=>de(e,r),[e,r]),p=i.useMemo(()=>e&&t?y(e,t):null,[e,t,y]),g=i.useMemo(()=>{if(h&&s)return l(h,s)},[h,s,l]),C=i.useMemo(()=>{const f=g!=null?Array.isArray(g)?g:typeof g=="string"?(()=>{try{return JSON.parse(g)}catch{return}})():void 0:p==null?void 0:p.items;return n?f??a??[]:h?Array.isArray(f)?f:[]:a??[]},[n,h,g,p==null?void 0:p.items,a]),v=i.useMemo(()=>C.map(f=>{const d=typeof f=="string"?f:f&&typeof f=="object"?f.url??f.src:void 0;return zi(d)}).filter(f=>!!f),[C]),m=i.useMemo(()=>{const f={...c};return p&&typeof p=="object"&&Object.keys(p).forEach(d=>{d!=="items"&&p[d]!==void 0&&p[d]!==null&&(f[d]=p[d])}),f},[c,p]);return u.jsx(Pi,{...m,items:v,children:o})},qi=({id:t,sessionId:e,develop:n,children:o,dataSet:r,dataSetField:s,src:a,clickAction:c,icon:l,token:y,...h})=>{const p=O(S=>S.getDataSet),g=O(S=>S.getProps),C=i.useMemo(()=>de(e,r),[e,r]),v=i.useMemo(()=>e&&t?g(e,t):null,[e,t,g]),m=i.useMemo(()=>{if(C&&s)return p(C,s)},[C,s,p]),f=i.useMemo(()=>{let S=a;if(n||(m!=null&&m!==""?S=String(m):(v==null?void 0:v.src)!==void 0&&(S=v.src)),!(typeof S=="string"&&S.trim()===""))return S},[n,m,v==null?void 0:v.src,a]),d=i.useMemo(()=>{let S=l;if(!n&&(v!=null&&v.icon)&&(S=v.icon),typeof S=="string"&&S){const A=Xe[S];if(A)return u.jsx(A,{})}return S},[l,v==null?void 0:v.icon,n]),x=i.useMemo(()=>{const S={...h};return v&&typeof v=="object"&&Object.keys(v).forEach(A=>{!["src","icon","token"].includes(A)&&v[A]!==void 0&&v[A]!==null&&(S[A]=v[A])}),S},[h,v]),b=i.useMemo(()=>{const S=v==null?void 0:v.token,A={...y,...S};if(!A||Object.keys(A).length===0)return;const k={};return Object.entries(A).forEach(([$,D])=>{if(D!==""&&D!==void 0&&D!==null)if(["containerSize","containerSizeLG","containerSizeSM","textFontSize","textFontSizeLG","textFontSizeSM","groupOverlapping"].includes($)){const w=typeof D=="string"?parseInt(D,10):D;isNaN(w)||(k[$]=w)}else k[$]=D}),Object.keys(k).length>0?k:void 0},[y,v==null?void 0:v.token]),j=i.useMemo(()=>{if(b)return{components:{Avatar:b}}},[b]),M=u.jsx(V.Avatar,{...x,src:f,icon:d,children:o});return j?u.jsx(V.ConfigProvider,{theme:j,children:M}):M},Wi={0:"default",1:"success",2:"warning",3:"error",true:"success",false:"default",yes:"success",no:"default"},Ii=({id:t,sessionId:e,develop:n,children:o,content:r,dataSet:s,dataSetField:a,dictCode:c,autoColor:l=!1,colorMap:y,color:h,closeAction:p,clickAction:g,...C})=>{const v=tt(s,a,e),m=v.dataSet,f=v.dataSetField,d=v.sessionId,x=i.useMemo(()=>de(d,m),[d,m]),{options:b}=St(c),j=i.useMemo(()=>{if(y){if(typeof y=="string")try{return JSON.parse(y)}catch{return}return y}},[y]),M=O(z=>{var B;return d&&t?((B=z.propsStore[`${d}_props`])==null?void 0:B[t])??null:null}),S=O(z=>x&&f?z.getDataSet(x,f):void 0),A=i.useMemo(()=>n?r:S!=null&&S!==""?String(S):(M==null?void 0:M.content)!==void 0?M.content:r,[n,S,M==null?void 0:M.content,r]),k=i.useMemo(()=>{if(c&&b.length>0&&A!==void 0&&A!==null){const z=et(b,A);return(z==null?void 0:z.label)??A}return A},[c,b,A]),$=i.useMemo(()=>{if(!l||A===void 0||A===null)return;const z=String(A).toLowerCase();return j&&j[z]?j[z]:Wi[z]},[l,A,j]),D=i.useMemo(()=>{const z={...C};return M&&typeof M=="object"&&Object.keys(M).forEach(B=>{!["content","color"].includes(B)&&M[B]!==void 0&&M[B]!==null&&(z[B]=M[B])}),z},[C,M]),w=i.useMemo(()=>{const{bordered:z,...B}=D;return B},[D]),N=(M==null?void 0:M.color)??h,T=Et(N)||$;return u.jsx(V.Tag,{...w,color:T,children:k||o})};function Fn(t,e){const n=Number(t??e??10);return Number.isFinite(n)&&n>0?n:10}const Yi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,changeAction:s,showSizeChangeAction:a,onChange:c,onShowSizeChange:l,current:y,pageSize:h,total:p,defaultPageSize:g,...C})=>{const v=O(D=>D.addCommand),m=O(D=>D.setDataSet),f=i.useMemo(()=>de(e,o),[e,o]),d=r??(f?"":void 0),x=i.useMemo(()=>({}),[]),b=O(D=>{if(!f)return x;const w=D.getDataSet(f,d??"");return w!=null&&typeof w=="object"?w:x}),j=Fn(h,g),M=b.current??y??1,S=b.pageSize??j,A=b.total??p??0;i.useEffect(()=>{if(!f||d===void 0)return;const D=d??"",{getDataSet:w,setDataSet:N}=O.getState(),E=w(f,D),T=Fn(h,g);if(E==null||typeof E!="object"||Array.isArray(E)){N(f,D,{current:y??1,pageSize:T,total:p??0},!1);return}const z=Number(E.pageSize);Number.isFinite(z)&&z>0||N(f,D,{...E,pageSize:T,current:E.current??y??1,total:E.total??p??0},!1)},[f,d,y,h,g,p]);const k=i.useCallback((D,w)=>{if(c){c(D,w);return}f&&m(f,d??"",{current:D,pageSize:w,total:A}),s&&e&&v(e,se(s,{page:D,pageSize:w}))},[c,f,d,m,A,s,e,v]),$=i.useCallback((D,w)=>{if(l){l(D,w);return}f&&m(f,d??"",{current:D,pageSize:w,total:A}),a&&e&&v(e,se(a,{current:D,pageSize:w}))},[l,f,d,m,A,a,e,v]);return u.jsx(V.Pagination,{...C,current:M,pageSize:S,total:A,onChange:k,onShowSizeChange:$,showTotal:i.useMemo(()=>{const D=C.showTotal;return typeof D=="string"?(w,N)=>D.replace("${total}",String(w)).replace("${range[0]}",String(N[0])).replace("${range[1]}",String(N[1])).replace("${range}",`${N[0]}-${N[1]}`):D},[C.showTotal])})},Hi=({id:t,sessionId:e,develop:n,items:o,children:r,...s})=>u.jsx(V.Breadcrumb,{...s,items:o,children:r}),Lt=t=>Object.entries(t).map(([e,n])=>`${e.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${n}`).join("; "),Ui=({mode:t,arrowStyle:e,arrowIconPrev:n,arrowIconNext:o,children:r})=>{const s=i.useRef(null),a=i.useRef(null),[c,l]=i.useState(0),[y,h]=i.useState(!1),[p,g]=i.useState(0),[C,v]=i.useState(0),m=t==="horizontal";i.useEffect(()=>{const S=()=>{if(!s.current||!a.current)return;const k=s.current,$=a.current;let D=0,w=0,N=!1;m?(D=k.clientWidth,w=$.scrollWidth,N=w>D):(D=k.clientHeight,w=$.scrollHeight,N=w>D),v(D),g(w),h(N),N||l(0)},A=new ResizeObserver(S);return s.current&&A.observe(s.current),a.current&&A.observe(a.current),S(),()=>A.disconnect()},[m]);const f=c<=0,d=!y||c>=p-C,x=i.useCallback(()=>{var A,k;if(f)return;const S=m?((A=s.current)==null?void 0:A.clientWidth)??200:((k=s.current)==null?void 0:k.clientHeight)??200;l($=>Math.max(0,$-S))},[m,f]),b=i.useCallback(()=>{var k,$,D,w,N,E;if(d)return;const S=m?((k=s.current)==null?void 0:k.clientWidth)??200:(($=s.current)==null?void 0:$.clientHeight)??200,A=m?(((D=a.current)==null?void 0:D.scrollWidth)??0)-(((w=s.current)==null?void 0:w.clientWidth)??0):(((N=a.current)==null?void 0:N.scrollHeight)??0)-(((E=s.current)==null?void 0:E.clientHeight)??0);l(T=>Math.min(A,T+S))},[m,d]),j=n||(m?u.jsx(ze.LeftOutlined,{}):u.jsx(ze.UpOutlined,{})),M=o||(m?u.jsx(ze.RightOutlined,{}):u.jsx(ze.DownOutlined,{}));return u.jsxs("div",{style:{display:"flex",flexDirection:m?"row":"column",alignItems:"center",width:"100%",height:"100%"},children:[u.jsx(V.Button,{type:"text",size:"middle",icon:j,shape:"circle",disabled:f,onClick:x,style:{flexShrink:0,alignSelf:"center",margin:m?"0 4px":"4px 0",...e,borderRadius:"50%"}}),u.jsx("div",{ref:s,style:{flex:1,overflow:"hidden",position:"relative",display:"flex",justifyContent:m&&!y?"center":"flex-start"},children:u.jsx("div",{ref:a,style:{transform:m?`translateX(-${c}px)`:`translateY(-${c}px)`,transition:"transform 0.3s ease-out",display:m?"inline-flex":"block",whiteSpace:m?"nowrap":"normal"},children:r})}),u.jsx(V.Button,{type:"text",size:"middle",shape:"circle",icon:M,disabled:d,onClick:b,style:{flexShrink:0,alignSelf:"center",margin:m?"0 4px":"4px 0",...e,borderRadius:"50%"}})]})},Gi=({mode:t,children:e})=>{const n=t==="horizontal";return u.jsx("div",{style:{overflow:n?"auto hidden":"hidden auto",width:"100%",height:"100%",scrollbarWidth:"thin",scrollbarColor:"rgba(0, 0, 0, 0.2) transparent"},children:e})},Ji=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,index:s,clickAction:a,selectAction:c,openChangeAction:l,deselectAction:y,onClick:h,onSelect:p,onOpenChange:g,onDeselect:C,items:v,selectedKeys:m,openKeys:f,defaultOpenKeys:d,styles:x,classNames:b,token:j,expandIcon:M,overflowedIndicator:S,openKeysDataSet:A,openKeysDataSetField:k,mode:$,inlineCollapsed:D,remoteUrl:w,overflowStrategy:N="default",paginationArrowStyle:E,paginationArrowIconPrev:T,paginationArrowIconNext:z,expandTrigger:B,...L})=>{const _=i.useContext(We),I=i.useMemo(()=>e&&t?ct(t,_,s):null,[e,t,_==null?void 0:_.parentIndex,_==null?void 0:_.index,s]),P=O(J=>{var he;return I&&e?((he=J.propsStore[`${e}_props`])==null?void 0:he[I])??null:null}),R=O(J=>J.addCommand),F=O(J=>J.setDataSet),K=i.useMemo(()=>de(e,o),[e,o]),q=O(J=>{if(K)return r?J.getDataSet(K,r):J.dataSets[K]}),G=i.useMemo(()=>({}),[]),ie=q??G,pe=i.useMemo(()=>(ie==null?void 0:ie.items)??(Array.isArray(ie)?ie:void 0)??(Array.isArray(ie==null?void 0:ie.value)?ie.value:void 0),[ie]),ne=i.useMemo(()=>n?pe??v??[]:K?pe??[]:v??[],[n,K,pe,v]),ue=i.useMemo(()=>(P==null?void 0:P.selectedKeys)??ie.selectedKeys??m,[P==null?void 0:P.selectedKeys,ie.selectedKeys,m]),fe=i.useMemo(()=>(P==null?void 0:P.openKeys)??ie.openKeys??(A&&k?void 0:f),[P==null?void 0:P.openKeys,ie.openKeys,A,k,f]),me=i.useMemo(()=>de(e,A),[e,A]),ee=O(J=>{if(!ie.openKeys&&me&&k)return J.getDataSet(me,k)}),W=i.useMemo(()=>{const J=he=>Array.isArray(he)?he.map(be=>{const ke={...be};if(ke.icon&&typeof ke.icon=="string"){const Oe=Xe[ke.icon];Oe&&(ke.icon=u.jsx(Oe,{}))}return ke.children&&ke.children.length>0&&(ke.children=J(ke.children)),ke}):[];return J(ne||[])},[ne]),te=i.useMemo(()=>ue,[ue]),ye=i.useMemo(()=>fe??ee,[fe,ee]),Q=i.useCallback(J=>{if(h){h(J);return}a&&e&&R(e,se(a,{key:J.key,keyPath:J.keyPath}))},[h,a,e,R]),oe=i.useCallback(J=>{if(p){p(J);return}if(K)if(r){const he=O.getState().getDataSet(K,r)||{};F(K,r,{...he,selectedKeys:J.selectedKeys})}else F(K,"selectedKeys",J.selectedKeys);c&&e&&R(e,se(c,{selectedKeys:J.selectedKeys}))},[p,K,r,F,c,e,R]),xe=i.useCallback(J=>{if(g){g(J);return}if(K)if(r){const he=O.getState().getDataSet(K,r)||{};F(K,r,{...he,openKeys:J})}else F(K,"openKeys",J);else me&&k&&F(me,k,J);l&&e&&R(e,se(l,{openKeys:J}))},[g,K,r,me,k,F,l,e,R]),Ne=i.useCallback(J=>{if(C){C(J);return}y&&e&&R(e,se(y,{selectedKeys:J.selectedKeys,key:J.key}))},[C,y,e,R]),$e=$==="inline"&&D!==void 0?{inlineCollapsed:D}:{},_e=i.useMemo(()=>{if(!j)return;const J={};return Object.entries(j).forEach(([he,be])=>{be!==""&&be!==void 0&&be!==null&&(J[he]=be)}),Object.keys(J).length>0?J:void 0},[j]),Ee=i.useMemo(()=>{if(b==null||typeof b=="function")return b;const J=be=>{if(be==null||be==="")return;if(typeof be=="string"||typeof be!="object"||Array.isArray(be))return be;const ke={};for(const[Oe,He]of Object.entries(be)){const ft=J(He);ft!==void 0&&(ke[Oe]=ft)}return Object.keys(ke).length?ke:void 0};return J(b)},[b]),Se=n?{motion:{motionName:""}}:{},Ke=i.useMemo(()=>{if(typeof T=="string"&&T){const J=Xe[T];if(J)return u.jsx(J,{})}return T},[T]),Z=i.useMemo(()=>{if(typeof z=="string"&&z){const J=Xe[z];if(J)return u.jsx(J,{})}return z},[z]),re=i.useMemo(()=>N==="pagination"||N==="scroll"?null:S,[N,S]),le=i.useId(),Y=t||le.replace(/:/g,"-"),ae=i.useMemo(()=>{var ke;if(!x||typeof x=="function")return"";const J=(ke=x.subMenu)==null?void 0:ke.root;if(!J)return"";const he=[],be=`[data-and-menu-id="${Y}"]`;if(J.item&&Object.keys(J.item).length>0){const Oe=Lt(J.item);he.push(`${be} .ant-menu-submenu > .ant-menu-submenu-title { ${Oe} }`)}if(J.itemIcon&&Object.keys(J.itemIcon).length>0){const Oe=Lt(J.itemIcon);he.push(`${be} .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-item-icon { ${Oe} }`)}if(J.itemContent&&Object.keys(J.itemContent).length>0){const Oe=Lt(J.itemContent);he.push(`${be} .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-title-content { ${Oe} }`)}if(J.selected&&Object.keys(J.selected).length>0){const Oe=Lt(J.selected);he.push(`${be} .ant-menu-submenu-selected > .ant-menu-submenu-title { ${Oe} }`)}return he.join(`
23
+ `)},[x,Y]),H=u.jsx(V.Menu,{...L,...$e,...Se,mode:$,items:W,selectedKeys:te,openKeys:ye,defaultOpenKeys:d,onClick:Q,onSelect:oe,onOpenChange:xe,onDeselect:Ne,styles:x,classNames:Ee,expandIcon:M,overflowedIndicator:re,disabledOverflow:N!=="default"}),X=()=>N==="pagination"?u.jsx(Ui,{mode:$||"horizontal",arrowStyle:E,arrowIconPrev:Ke,arrowIconNext:Z,children:H}):N==="scroll"?u.jsx(Gi,{mode:$||"horizontal",children:H}):H,ve=i.useMemo(()=>{const J={};return n&&(J.motion=!1),_e&&(J.components={Menu:_e}),Object.keys(J).length>0?J:void 0},[n,_e]);return(()=>{const J=X(),he=ae?u.jsxs("div",{"data-and-menu-id":Y,style:{display:"contents"},children:[u.jsx("style",{children:ae}),J]}):J;return ve?u.jsx(V.ConfigProvider,{theme:ve,children:he}):he})()},Qi=({id:t,sessionId:e,develop:n,...o})=>u.jsx(V.Calendar,{...o}),Zi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,count:s,showZero:a,overflowCount:c,dot:l,offset:y,size:h,status:p,text:g,color:C,title:v,children:m,...f})=>{const d=O(k=>k.getDataSet),x=i.useMemo(()=>de(e,o),[e,o]),b=i.useMemo(()=>{if(x&&r)return d(x,r)},[x,r,d]),j=i.useMemo(()=>b??s,[b,s]),S=(V.theme.useToken?V.theme.useToken():{token:void 0}).token,A=i.useMemo(()=>{if(!(!C||typeof C!="string"))return S&&C in S?S[C]:C},[C,S]);return u.jsx(V.Badge,{...f,count:j,showZero:a,overflowCount:c,dot:l,offset:y,size:h,status:p,text:g,color:A,title:v,children:u.jsx("span",{"data-slot":"content",className:"and-badge-content-slot",style:{display:"inline-block",minWidth:!m&&!g?"20px":void 0,minHeight:!m&&!g?"20px":void 0},children:m})})},Xi=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,text:s,placement:a,color:c,children:l,...y})=>{const h=O(d=>d.getDataSet),p=i.useMemo(()=>de(e,o),[e,o]),g=i.useMemo(()=>{if(p&&r)return h(p,r)},[p,r,h]),C=i.useMemo(()=>g??s,[g,s]),m=(V.theme.useToken?V.theme.useToken():{token:void 0}).token,f=i.useMemo(()=>{if(!(!c||typeof c!="string"))return m&&c in m?m[c]:c},[c,m]);return u.jsx(V.Badge.Ribbon,{...y,text:C,placement:a,color:f,children:u.jsx("div",{"data-slot":"content",className:"and-badge-ribbon-content-slot",style:{display:"block",minHeight:"40px",border:n?"1px dashed #dedede":void 0},children:l})})},ea=t=>{if(!t)return[];if(typeof t=="string")try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return t},ta=t=>{if(!(t==null||t==="")){if(typeof t=="number")return t;if(typeof t=="string"){const e=parseInt(t,10);if(!isNaN(e))return e;try{return JSON.parse(t)}catch{return}}return t}},na=t=>{if(!(t==null||t==="")){if(typeof t=="number")return t;if(typeof t=="string"){const e=parseInt(t,10);if(!isNaN(e))return e;try{const n=JSON.parse(t);return Array.isArray(n)&&n.length===2,n}catch{return}}return Array.isArray(t),t}},ra=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,items:s,columns:a,gutter:c,fresh:l,layoutChangeAction:y,onLayoutChange:h,itemRender:p,...g})=>{const C=tt(o,r,e),v=C.dataSet,m=C.dataSetField,f=C.sessionId,d=i.useContext(We),x=O(L=>L.addCommand),b=i.useMemo(()=>de(f,v),[f,v]),j=O(L=>b&&m?L.getDataSet(b,m):null),M=i.useMemo(()=>!f||t==null||t===""?null:d&&typeof d.index=="number"?`${String(t)}_${d.index}`:String(t),[f,t,d]),S=O(L=>{var _;return M?((_=L.propsStore[`${f}_props`])==null?void 0:_[M])??null:null}),A=i.useMemo(()=>j&&Array.isArray(j)?j:ea(s),[j,s]),k=(S==null?void 0:S.columns)!==void 0&&(S==null?void 0:S.columns)!==null?S.columns:a,$=i.useMemo(()=>ta(k),[k]),D=i.useMemo(()=>na(c),[c]),w=i.useMemo(()=>{if(h)return h;if(y&&f)return L=>{x(f,{actionName:y,arg:L,timestamp:Date.now()})}},[h,y,f,x]),N=i.useMemo(()=>A.length>0?A:n?[{key:"1",height:150,data:{title:"示例项 1"}},{key:"2",height:200,data:{title:"示例项 2"}},{key:"3",height:120,data:{title:"示例项 3"}},{key:"4",height:180,data:{title:"示例项 4"}},{key:"5",height:140,data:{title:"示例项 5"}},{key:"6",height:160,data:{title:"示例项 6"}}]:[],[A,n]),E=i.useMemo(()=>{if(p)return p;if(n)return L=>{var _;return u.jsx("div",{style:{height:L.height||100,background:"#f0f5ff",border:"1px dashed #91caff",borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",color:"#1677ff",fontSize:14},children:((_=L.data)==null?void 0:_.title)||`Item ${L.key}`})}},[p,n]),T=i.useMemo(()=>{if(E)return!v||!m?E:(L,_)=>{const I=typeof _=="number"?_:typeof(L==null?void 0:L.index)=="number"?L.index:Number((L==null?void 0:L.index)??0);return u.jsx(We.Provider,{value:{dataSet:v,index:I,parentIndex:d==null?void 0:d.index,parentContext:d??void 0,sessionId:f,dataSetFieldRoot:m},children:E(L)})}},[E,v,m,f]),{layoutChangeAction:z,...B}=g;return u.jsx(V.Masonry,{...B,items:N,columns:$,gutter:D,fresh:l,itemRender:T,onLayoutChange:w})},oa=({id:t,sessionId:e,develop:n,closeAction:o,onClose:r,dataSet:s,dataSetField:a,title:c,description:l,closeText:y,closable:h,...p})=>{const g=O(M=>M.getDataSet),C=O(M=>M.getProps),v=i.useMemo(()=>de(e,s),[e,s]),m=i.useMemo(()=>e&&t?C(e,t):null,[e,t,C]),f=i.useMemo(()=>{if(v&&a)return g(v,a)},[v,a,g]),d=i.useMemo(()=>n?c:f!=null&&f!==""?String(f):(m==null?void 0:m.title)!==void 0?m.title:(m==null?void 0:m.message)!==void 0?m.message:c,[n,f,m==null?void 0:m.title,m==null?void 0:m.message,c]),x=i.useMemo(()=>{const M={...p,description:l};return m&&typeof m=="object"&&Object.keys(m).forEach(S=>{S!=="title"&&S!=="message"&&m[S]!==void 0&&m[S]!==null&&(M[S]=m[S])}),M},[p,l,m]),b=i.useMemo(()=>y?{closeIcon:u.jsx("span",{children:y})}:h,[y,h]),j=i.useCallback(M=>{r&&r(M)},[r]);return u.jsx(V.Alert,{...x,title:d,closable:b,onClose:j})},sa=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,okAction:s,cancelAction:a,onOk:c,onCancel:l,open:y,children:h,...p})=>{const g=O(j=>j.addCommand),C=O(j=>j.getDataSet),v=O(j=>j.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),f=i.useMemo(()=>{if(m&&r)return C(m,r)},[m,r,C]),d=f!==void 0?!!f:y,x=i.useCallback(()=>{c&&c(),m&&r&&v(m,r,!1),s&&e&&g(e,{actionName:s,arg:null,timestamp:Date.now()})},[c,m,r,v,s,e,g]),b=i.useCallback(()=>{l&&l(),m&&r&&v(m,r,!1),a&&e&&g(e,{actionName:a,arg:null,timestamp:Date.now()})},[l,m,r,v,a,e,g]);return u.jsx(V.Modal,{...p,open:d,onOk:x,onCancel:b,children:h})},ia=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,closeAction:s,onClose:a,open:c,children:l,...y})=>{const h=O(d=>d.addCommand),p=O(d=>d.getDataSet),g=O(d=>d.setDataSet),C=i.useMemo(()=>de(e,o),[e,o]),v=i.useMemo(()=>{if(C&&r)return p(C,r)},[C,r,p]),m=v!==void 0?!!v:c,f=i.useCallback(()=>{a&&a(),C&&r&&g(C,r,!1),s&&e&&h(e,{actionName:s,arg:null,timestamp:Date.now()})},[a,C,r,g,s,e,h]);return u.jsx(V.Drawer,{...y,open:m,onClose:f,children:l})},aa=({id:t,sessionId:e,develop:n,children:o,resultProps:r,...s})=>{const a=O(l=>{var y;return e&&t?((y=l.propsStore[`${e}_props`])==null?void 0:y[t])??null:null}),c=i.useMemo(()=>{const l={...s,...r&&typeof r=="object"?r:{}};return Ye(l,a??void 0)},[s,r,a]);return u.jsx(V.Result,{...c,children:o})},sn=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{const n=t.trim();if(n.startsWith("[")||n.startsWith("{"))return JSON.parse(n)}catch{return e}return t},ca=t=>t.replace(/-([a-z])/g,(e,n)=>n.toUpperCase()),la=t=>!t||typeof t!="object"||Array.isArray(t)?t??{}:Object.fromEntries(Object.entries(t).map(([e,n])=>[ca(e),n])),ua=t=>sn(t,[]).map(n=>({key:n.key,tab:n.tab,disabled:n.disabled})),da=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,title:s,extra:a,cover:c,tabBarExtraContent:l,actions:y,tabList:h,activeTabKey:p,defaultActiveTabKey:g,tabChangeAction:C,onTabChange:v,styles:m,token:f,showHeader:d,showCover:x,showActions:b,size:j,children:M,...S})=>{const A=O(G=>G.addCommand),k=O(G=>G.getDataSet),$=O(G=>G.setDataSet),D=i.useMemo(()=>de(e,o),[e,o]),w=j==="default"?"medium":j,N=i.useMemo(()=>{const G=sn(m,{});return Object.fromEntries(Object.entries(G).map(([ie,pe])=>[ie,la(pe)]))},[m]),E=i.useMemo(()=>{const G=ua(h);return G.length>0?G:void 0},[h]),z=i.useMemo(()=>{if(D&&r){const G=k(D,`${r}.activeTabKey`);if(typeof G=="string")return G}},[D,r,k])??p,B=i.useCallback(G=>{if(v){v(G);return}D&&r&&$(D,`${r}.activeTabKey`,G),C&&e&&A(e,se(C,{key:G}))},[v,D,r,$,C,e,A]),{titleSlot:L,extraSlot:_,coverSlot:I,actionsSlot:P,otherChildren:R,actionsFromChildren:F}=i.useMemo(()=>{let G=null,ie=null,pe=null,ne=[];const ue=[];let fe=!1;return s&&(G=s),a&&(ie=a),c&&(pe=c),y&&(ne=y),i.Children.forEach(M,me=>{if(!i.isValidElement(me)){ue.push(me);return}const ee=me.props,W=ee["data-slot-type"];W==="title"&&!s?G=me:W==="extra"&&!a?ie=me:W==="cover"&&!c?pe=me:W==="actions"&&!y?(ne=[me],fe=!0):W==="body"&&ee.children?ue.push(ee.children):ue.push(me)}),{titleSlot:G,extraSlot:ie,coverSlot:pe,actionsSlot:ne,otherChildren:ue,actionsFromChildren:fe}},[M,s,a,c,y]),K=i.useMemo(()=>{const G=sn(f,{});return F?{actionsLiMargin:"0px",...G}:G},[f,F]),q=u.jsx(V.Card,{...S,size:w,title:L,extra:_,cover:I,tabBarExtraContent:l,actions:P.length>0?P:void 0,tabList:E,activeTabKey:z,defaultActiveTabKey:g,onTabChange:E?B:void 0,styles:N,children:R});return K&&Object.keys(K).length>0?u.jsx(V.ConfigProvider,{theme:{components:{Card:K}},children:q}):q},fa=({id:t,sessionId:e,develop:n,text:o,children:r,styles:s,token:a,...c})=>{const l=r||o;return a&&Object.keys(a).length>0?u.jsx(V.ConfigProvider,{theme:{components:{Divider:a}},children:u.jsx(V.Divider,{...c,styles:s,children:l})}):u.jsx(V.Divider,{...c,styles:s,children:l})},Pn=t=>{if(!t)return[];if(typeof t=="string")try{return JSON.parse(t)}catch{return[]}return t},cr=t=>t.map(e=>e.divider?{type:"divider",key:e.key}:{key:e.key,label:e.label,disabled:e.disabled,danger:e.danger,children:e.children?cr(e.children):void 0}),lr=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,text:s="下拉菜单",items:a,clickAction:c,selectAction:l,deselectAction:y,openChangeAction:h,onOpenChange:p,children:g,hasChildren:C,index:v,...m})=>{const f=O(w=>w.addCommand),d=i.useContext(We),x=v??(d==null?void 0:d.index),b=d==null?void 0:d.parentIndex,j=i.useMemo(()=>de(e,o),[e,o]),M=O(w=>{if(j)return r?w.getDataSet(j,r):w.dataSets[j]}),S=i.useMemo(()=>{if(M==null)return;if(Array.isArray(M))return M;const w=M;if(Array.isArray(w==null?void 0:w.items))return w.items;if(Array.isArray(w==null?void 0:w.value))return w.value},[M]),A=i.useMemo(()=>n?S??Pn(a)??[]:j?S??[]:Pn(a)??[],[n,j,S,a]),k=i.useCallback((w,N)=>{if(p){p(w,N);return}if(h&&e){const{actionName:E,arg:T}=st(h,w,{id:t,dataSet:o,dataSetField:r,index:x,parentIndex:b,source:N.source});f(e,se(E,T))}},[p,h,e,f,t,o,r,x,b]),$=i.useMemo(()=>({items:cr(A),onClick:w=>{if(c&&e){const{actionName:N,arg:E}=st(c,w.key,{id:t,dataSet:o,dataSetField:r,index:x,parentIndex:b,key:w.key,keyPath:w.keyPath});f(e,se(N,E))}},onSelect:w=>{if(l&&e){const{actionName:N,arg:E}=st(l,w.key,{id:t,dataSet:o,dataSetField:r,index:x,parentIndex:b,key:w.key,keyPath:w.keyPath,selectedKeys:w.selectedKeys});f(e,se(N,E))}},onDeselect:w=>{if(y&&e){const{actionName:N,arg:E}=st(y,w.key,{id:t,dataSet:o,dataSetField:r,index:x,parentIndex:b,key:w.key,keyPath:w.keyPath,selectedKeys:w.selectedKeys});f(e,se(N,E))}}}),[A,c,l,y,e,f,t,o,r,x,b]),D=i.useMemo(()=>u.jsxs("div",{className:"and-dropdown-trigger-slot",style:{display:"inline-block",cursor:"pointer"},children:[g,n&&!g&&!C&&u.jsx("div",{style:{padding:"4px 8px",border:"1px dashed #d9d9d9",color:"#ccc",fontSize:12},children:"请配置触发器"}),!g&&!n&&s&&u.jsx(V.Button,{children:u.jsxs(V.Space,{children:[s,u.jsx(ze.DownOutlined,{})]})})]}),[g,n,s,C]);return u.jsx(V.Dropdown,{...m,menu:$,onOpenChange:k,children:D})},ma=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(V.Row,{...r,children:o}),ya=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(V.Col,{...r,children:o}),ha=({id:t,sessionId:e,develop:n,children:o,...r})=>u.jsx(V.Flex,{...r,children:o}),ga=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,value:s,...a})=>{const c=O(v=>v.getDataSet),l=O(v=>v.getProps),y=i.useMemo(()=>de(e,o),[e,o]),h=i.useMemo(()=>e&&t?l(e,t):null,[e,t,l]),p=i.useMemo(()=>{if(y&&r)return c(y,r)},[y,r,c]),g=i.useMemo(()=>n?s:p!=null&&p!==""?String(p):(h==null?void 0:h.value)!==void 0?h.value:s,[n,p,h==null?void 0:h.value,s]),C=i.useMemo(()=>{const v={...a};return h&&typeof h=="object"&&Object.keys(h).forEach(m=>{m!=="value"&&h[m]!==void 0&&h[m]!==null&&(v[m]=h[m])}),v},[a,h]);return u.jsx(V.QRCode,{...C,value:g||""})},jt=t=>{if(!t)return;const e=Xe[t];if(e)return i.createElement(e)},Jt=(t,e)=>{if(t==null)return e;if(typeof t=="string")try{const n=t.trim();if(n.startsWith("[")||n.startsWith("{"))return JSON.parse(n)}catch{return e}return t},pa=({id:t,sessionId:e,develop:n,panels:o,orientation:r="horizontal",lazy:s=!1,draggerIcon:a,collapsibleIcon:c,resizeAction:l,resizeEndAction:y,onResize:h,onResizeEnd:p,styles:g,token:C,children:v,renderPanelContent:m,...f})=>{const d=O(N=>N.addCommand),x=i.useMemo(()=>Jt(o,[]),[o]),b=i.useMemo(()=>Jt(C,{}),[C]),j=i.useMemo(()=>jt(a),[a]),M=i.useMemo(()=>{if(c){if(typeof c=="string"){const N=Jt(c,null);return N&&typeof N=="object"?{start:jt(N.start),end:jt(N.end)}:void 0}return{start:jt(c.start),end:jt(c.end)}}},[c]),S=i.useCallback(N=>{if(h){h(N);return}l&&e&&d(e,se(l,{sizes:N}))},[h,l,e,d]),A=i.useCallback(N=>{if(p){p(N);return}y&&e&&d(e,se(y,{sizes:N}))},[p,y,e,d]),k=()=>v&&i.Children.count(v)>0?i.Children.map(v,(N,E)=>{const T=x[E]||{};return u.jsx(V.Splitter.Panel,{defaultSize:T.defaultSize,min:T.min,max:T.max,collapsible:T.collapsible,resizable:T.resizable!==!1,children:N},T.key||E)}):x.map((N,E)=>u.jsx(V.Splitter.Panel,{defaultSize:N.defaultSize||void 0,min:N.min||void 0,max:N.max||void 0,collapsible:N.collapsible,resizable:N.resizable!==!1,children:m?m(N.key,E):u.jsxs("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#999",fontSize:14},children:["Panel ",E+1]})},N.key||E)),{layout:$,...D}=f,w=u.jsx("div",{style:{width:"100%",height:"100%"},children:u.jsx(V.Splitter,{...D,orientation:r,lazy:s,onResize:S,onResizeEnd:A,style:{height:"100%",width:"100%",...D.style},styles:g,draggerIcon:j,collapsibleIcon:M,children:k()},r)});return b&&Object.keys(b).length>0?u.jsx(V.ConfigProvider,{theme:{components:{Splitter:b}},children:w}):w},va=({children:t,className:e,style:n,key:o,defaultSize:r,min:s,max:a,collapsible:c,resizable:l,sessionId:y,...h})=>u.jsx("div",{className:e,style:{display:"contents",width:"100%",height:"100%",...n},...h,children:t}),ba=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,renderItem:s,renderEmpty:a,items:c,maxCount:l,containerStyle:y,children:h,"page-disabled":p=!1,"page-defaultPageSize":g=10,"page-pageSizeOptions":C=["10","20","30","40"],"page-showSizeChanger":v=!0,"page-showQuickJumper":m=!1,"page-simple":f=!1,"page-size":d="small","page-showLessItems":x=!1,"page-showTotal":b})=>{const j=d==="default"?"middle":d,M=i.useMemo(()=>{const B=b==null?void 0:b.trim();if(B)return(L,_)=>B.replace(/\$\{total\}/g,String(L)).replace(/\$\{range\[0\]\}/g,String(_[0])).replace(/\$\{range\[1\]\}/g,String(_[1])).replace(/\$\{range\}/g,`${_[0]}-${_[1]}`)},[b]),S=O(B=>B.getDataSet),A=i.useMemo(()=>de(e,o),[e,o]),[k,$]=i.useState(1),[D,w]=i.useState(g),N=i.useMemo(()=>{if(A&&r){const B=S(A,r);return Array.isArray(B)?B:[]}return[]},[A,r,S]),E=i.useMemo(()=>n?N.length>0?N:c||[]:A?N:c||[],[n,A,N,c]),T=i.useMemo(()=>{let B=E;if(!p){const L=(k-1)*D,_=L+D;B=B.slice(L,_)}return l?B.slice(0,l):B},[E,p,k,D,l]);if(!E||E.length===0)return a?u.jsx(u.Fragment,{children:a()}):u.jsx("div",{style:{textAlign:"center",padding:"20px",color:"#999"},children:"暂无数据"});const z=(B,L)=>{$(B),L&&w(L)};return u.jsxs("div",{style:{display:"flex",flexDirection:"column",...y},children:[u.jsx("div",{style:{flex:1},children:T.map((B,L)=>u.jsx(i.Fragment,{children:s?s(B,L):u.jsx("div",{style:{padding:"8px",borderBottom:"1px solid #f0f0f0"},children:JSON.stringify(B)})},B.id||L))}),!p&&E.length>0&&u.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:16},children:u.jsx(V.Pagination,{current:k,pageSize:D,total:E.length,onChange:z,pageSizeOptions:C,showSizeChanger:v,showQuickJumper:m,simple:f,size:j,showLessItems:x,showTotal:M})})]})},xa="@keyframes and-icon-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",Sa=".and-icon-svg-root svg,.and-icon-svg-root svg path{fill:currentColor}.and-icon-svg-root svg{color:inherit}",Ca=({id:t,sessionId:e,develop:n,name:o,svg:r,size:s=16,color:a,spin:c=!1,rotate:l=0,twoToneColor:y,style:h,styles:p,onClick:g})=>{const C=typeof r=="string"?r.trim():"",v={fontSize:s,color:a,cursor:g?"pointer":void 0,...p,...h};if(C){const f={display:"inline-flex",alignItems:"center",justifyContent:"center",width:s,height:s,transform:l?`rotate(${l}deg)`:void 0,...v},d=c?{animation:"and-icon-spin 1s linear infinite",display:"inline-flex"}:{display:"inline-flex"};return u.jsxs(u.Fragment,{children:[u.jsx("style",{children:Sa}),c&&u.jsx("style",{children:xa}),u.jsx("span",{className:"and-icon-svg-root",style:f,onClick:g,role:g?"button":void 0,children:u.jsx("span",{style:d,children:u.jsx("span",{dangerouslySetInnerHTML:{__html:C},style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}})})})]})}if(!o)return null;const m=Xe[o];return m?u.jsx(m,{style:v,spin:c,rotate:l,twoToneColor:y||void 0,onClick:g}):(console.warn(`Icon "${o}" not found in @ant-design/icons`),null)},Ma=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,products:s,columns:a=4,clickAction:c,style:l})=>{const y=O(m=>m.addCommand),h=O(m=>m.getDataSet),p=i.useMemo(()=>de(e,o),[e,o]),g=i.useMemo(()=>{if(p&&r){const m=h(p,r);return Array.isArray(m)?m:[]}return[]},[p,r,h]),C=g.length>0?g:s||[],v=m=>{c&&e&&y(e,se(c,m))};return u.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${a}, 1fr)`,gap:16,...l},children:C.map(m=>u.jsx(V.Card,{hoverable:!0,cover:m.image&&u.jsx("img",{alt:m.name,src:m.image,style:{height:200,objectFit:"cover"}}),onClick:()=>v(m),children:u.jsx(V.Card.Meta,{title:m.name,description:u.jsxs(V.Space,{direction:"vertical",size:4,children:[m.price!==void 0&&u.jsxs("div",{children:[u.jsxs("span",{style:{color:"#f5222d",fontSize:18,fontWeight:"bold"},children:["¥",m.price]}),m.originalPrice&&u.jsxs("span",{style:{marginLeft:8,color:"#999",textDecoration:"line-through"},children:["¥",m.originalPrice]})]}),m.tags&&m.tags.length>0&&u.jsx(V.Space,{size:4,wrap:!0,children:m.tags.map((f,d)=>u.jsx(V.Tag,{color:"blue",children:f},d))})]})})},m.id))})},zn=({id:t,icon:e,title:n,description:o,style:r})=>u.jsxs("div",{id:t,style:{width:"100%",height:"100%",minHeight:80,flex:"1 1 auto",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",border:"1px dashed #d9d9d9",borderRadius:4,background:"#fafafa",color:"#8c8c8c",padding:16,boxSizing:"border-box",...r},children:[e||u.jsx(ze.InboxOutlined,{style:{fontSize:28,marginBottom:8,color:"#bfbfbf"}}),n&&u.jsx("div",{style:{fontWeight:500,fontSize:13,marginBottom:4},children:n}),o&&u.jsx("div",{style:{fontSize:12,opacity:.7},children:o})]}),Aa=({componentName:t,componentProps:e={},storePropsKey:n,sessionId:o,title:r,develop:s=!1,style:a,id:c,componentResolver:l,placeholder:y,placeholderFlexDirection:h="column",index:p})=>{var D,w,N,E;const g=i.useContext(We),{storeBaseKey:C,arrayIndex:v}=i.useMemo(()=>{if(!n)return{storeBaseKey:void 0,arrayIndex:null};const T=n.split(".")[0],{baseName:z,index:B}=dt(T);let L=B;if(L===null&&p!==void 0&&p!==null){const _=Number(p);L=Number.isFinite(_)?_:null}if(L===null){const _=Number(g==null?void 0:g.index);if(Number.isFinite(_))L=_;else{const I=Number(g==null?void 0:g.parentIndex);L=Number.isFinite(I)?I:null}}return{storeBaseKey:de(o,z),arrayIndex:L}},[n,o,p,g]),m=O(T=>{if(!C)return null;const z=T.dataSets[C];if(v!==null){const B=z==null?void 0:z.value;if(!Array.isArray(B))return z!=null&&typeof z.componentName=="string"?z:null;const L=Number((g==null?void 0:g.parentIndex)!==void 0?g.parentIndex:g==null?void 0:g.index);if(Number.isFinite(L)){const _=B[L];if(Array.isArray(_))return _[v]??null}return B[v]??null}return z??null}),f=i.useMemo(()=>{if(!n||!m)return{componentName:"",props:{}};const z=n.split(".")[1],B=z?m[z]||{}:m;if(typeof B=="object"&&B!==null){const{componentName:L,props:_,...I}=B;return{componentName:L||"",props:_||I||{}}}return{componentName:"",props:{}}},[n,o,m]),d=((D=f.props)==null?void 0:D.inheritDataSet)!==void 0?String((w=f.props)==null?void 0:w.inheritDataSet):void 0,x=((N=f.props)==null?void 0:N.inheritDataSetFieldRoot)!==void 0?String((E=f.props)==null?void 0:E.inheritDataSetFieldRoot):void 0,b=f.componentName||t,j=i.useMemo(()=>({...f.props?(()=>{const{inheritDataSet:T,inheritDataSetFieldRoot:z,...B}=f.props;return B})():{},...p!==void 0?{index:p}:{},...e,sessionId:o}),[f.props,e,o,p]),M=i.useMemo(()=>{var I,P;if(!d)return null;const T=!!x&&x.trim().startsWith("["),z=(I=f.props)==null?void 0:I.index,B=T?void 0:typeof z=="number"&&Number.isFinite(z)?z:v!==null?v:void 0,L=(P=f.props)==null?void 0:P.parentIndex;let _;if(typeof L=="number"&&Number.isFinite(L))_=L;else if(g){const R=(g==null?void 0:g.parentIndex)??(g==null?void 0:g.index);_=R!==void 0?Number(R):void 0,_!==void 0&&!Number.isFinite(_)&&(_=void 0)}return{dataSet:d,...B!==void 0?{index:B}:{},..._!==void 0?{parentIndex:_}:{},...g?{parentContext:g}:{},...x?{dataSetFieldRoot:x}:{},sessionId:o}},[d,v,f.props,g,x,o]),S=y||"请配置组件";if(s){const T=h==="row";return u.jsxs("div",{id:c,style:{width:"100%",height:"100%",display:"flex",flexGrow:1,flexDirection:h,alignItems:"center",justifyContent:"center",gap:T?8:0,border:"2px dashed #d9d9d9",borderRadius:4,color:"#8c8c8c",background:"transparent",boxSizing:"border-box"},children:[u.jsx(ze.ApiOutlined,{style:{fontSize:20,flexShrink:0,color:"#bfbfbf",...T?{}:{marginBottom:4}}}),u.jsx("div",{style:{fontWeight:500,fontSize:12},children:r||"动态容器"}),u.jsx("div",{style:{fontSize:11,opacity:.7},children:b?`${b}`:"未配置"}),n&&u.jsx("div",{style:{fontSize:10,opacity:.5,marginTop:T?0:2},children:n})]})}const A=Ue(),k=l||A.componentResolver;if(!k)return u.jsx(zn,{id:c,title:S,description:"动态容器未配置组件解析器",style:a});const $=b?k(b):null;return $?u.jsx(i.Suspense,{fallback:u.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:u.jsx(V.Spin,{})}),children:u.jsx("div",{id:c,style:{width:"100%",height:"100%",flex:"1 1 auto",...a},children:M?u.jsx(We.Provider,{value:M,children:u.jsx($,{...j})}):u.jsx($,{...j})})}):u.jsx(zn,{id:c,title:S,description:b?`组件 "${b}" 未找到`:void 0,style:a})},ja=({content:t="Watermark",width:e,height:n,rotate:o=-22,zIndex:r=9,image:s,gap:a=[100,100],offset:c,inherit:l=!0,font:y,develop:h,token:p,children:g,...C})=>{const v={color:(y==null?void 0:y.color)??"rgba(0, 0, 0, 0.15)",fontSize:(y==null?void 0:y.fontSize)??16,fontWeight:(y==null?void 0:y.fontWeight)??"normal",fontFamily:(y==null?void 0:y.fontFamily)??"sans-serif",fontStyle:(y==null?void 0:y.fontStyle)??"normal",textAlign:(y==null?void 0:y.textAlign)??"center"},m=u.jsx(V.Watermark,{content:t,width:e,height:n,rotate:o,zIndex:r,image:s,gap:a,offset:c,inherit:l,font:v,...C,children:h?u.jsx("div",{"data-slot":"content",style:{minHeight:100,minWidth:100,display:"block",position:"relative"},children:g}):g});return p&&Object.keys(p).length>0?u.jsx(V.ConfigProvider,{theme:{algorithm:V.theme.defaultAlgorithm,token:p},children:m}):m};if(typeof Promise<"u"){const t=Promise;typeof t.withResolvers!="function"&&(t.withResolvers=function(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}})}if(typeof URL<"u"){const t=URL;typeof t.parse!="function"&&(t.parse=function(e,n){try{return arguments.length<2||n===void 0?new URL(String(e)):new URL(String(e),String(n))}catch{return null}})}let ur=!1,Kn=!1;function wa(t){typeof window>"u"||(Pt.pdfjs.GlobalWorkerOptions.workerSrc=t,ur=!0)}function dr(t){var o,r;if(typeof window>"u"||ur)return;const e=(o=Ue().pdfWorkerFallbackUrl)==null?void 0:o.trim(),n=(r=t??e)==null?void 0:r.trim();if(n){Pt.pdfjs.GlobalWorkerOptions.workerSrc=n;return}Kn||(Kn=!0,console.warn("[@nuwatop/code-canvas-core] PDF worker 未配置。请在入口调用 setPdfjsWorkerSrc(localUrl),或通过 setCoreConfig({ pdfWorkerFallbackUrl }) 指定同源脚本地址。"))}const ka=.5,Da=3,qn=.1,Na=({id:t,sessionId:e,develop:n,dataSet:o,dataSetField:r,filePath:s,initialPage:a=1,metaPathPrefix:c="",loadErrorMessage:l,nonPdfBackgroundColor:y="#ECECEC",styles:h,token:p,className:g,style:C})=>{i.useEffect(()=>{dr()},[]);const v=O(Y=>Y.setDataSet),m=i.useMemo(()=>de(e,o),[e,o]),f=O(Y=>{if(!m||!r)return;const ae=Y.getDataSet(m,r);if(ae!=null&&ae!=="")return String(ae)}),d=O(Y=>{var ae;return e&&t?((ae=Y.propsStore[`${e}_props`])==null?void 0:ae[t])??null:null}),x=i.useMemo(()=>{let Y;if(f!==void 0)Y=f;else if(d&&typeof d=="object"){const ae=d.filePath;ae!=null&&ae!==""&&(Y=String(ae))}return Y===void 0&&(Y=s),Y},[f,d,s]),b=i.useMemo(()=>{if(d&&typeof d=="object"){const Y=d.nonPdfBackgroundColor;if(typeof Y=="string"&&Y.trim())return Y.trim()}return y},[d,y]),[j,M]=i.useState(0),[S,A]=i.useState(()=>Math.max(1,a||1)),k=i.useRef(S);k.current=S;const[$,D]=i.useState(null),[w,N]=i.useState(!!x),[E,T]=i.useState("all"),[z,B]=i.useState("width"),[L,_]=i.useState(1),I=i.useRef(null),P=i.useRef(null),R=i.useRef({}),F=i.useRef(!1),K=i.useRef(null),[q,G]=i.useState(600),[ie,pe]=i.useState(800),ne=i.useRef(0),ue=i.useMemo(()=>{var H;const Y=(H=Ue().pdfCMapUrl)==null?void 0:H.trim();return Y?{cMapUrl:Y.endsWith("/")?Y:`${Y}/`,cMapPacked:!0}:{}},[]),fe=(c||"").trim(),me=O(Y=>{if(!(!m||!fe))return Y.getDataSet(m,`${fe}.targetPage`)});i.useEffect(()=>{const Y=P.current;if(!Y)return;const ae=new ResizeObserver(()=>{const ve=Y.clientWidth,ce=Y.clientHeight;ve>0&&G(ve),ce>0&&pe(ce)});ae.observe(Y);const H=Y.clientWidth,X=Y.clientHeight;return H>0&&G(H),X>0&&pe(X),()=>ae.disconnect()},[x]);const ee=i.useMemo(()=>Math.max(240,q-16),[q]),W=i.useMemo(()=>Math.max(320,ie-16),[ie]),te=i.useMemo(()=>Math.max(120,ee*L),[ee,L]),ye=i.useMemo(()=>Math.max(180,W*L),[W,L]),Q=i.useMemo(()=>E==="all"?Array.from({length:j},(Y,ae)=>ae+1):[S],[E,j,S]),oe=i.useCallback((Y,ae)=>{!m||!fe||(v(m,`${fe}.currentPage`,Y),ae>0&&v(m,`${fe}.totalPages`,ae))},[m,fe,v]);i.useEffect(()=>{j>0&&oe(S,j)},[S,j,oe]);const xe=i.useCallback((Y,ae="auto")=>{const H=j>0?Math.max(1,Math.min(Math.floor(Y),j)):Math.max(1,Math.floor(Y));if(A(H),E==="all"){const X=R.current[H];X&&X.scrollIntoView({block:"start",behavior:ae})}},[j,E]),Ne=i.useRef(xe);Ne.current=xe,i.useEffect(()=>{const Y=me;typeof Y!="number"||!Number.isFinite(Y)||(xe(Y,"auto"),m&&fe&&v(m,`${fe}.targetPage`,void 0))},[me,xe,m,fe,v]),i.useEffect(()=>{const Y=Math.max(1,a??1);A(Y)},[a]);const $e=i.useCallback(({numPages:Y})=>{D(null),N(!1);const ae=k.current,H=Math.min(Math.max(1,ae),Y||1);M(Y),A(H),F.current=!0,K.current=H},[]),_e=i.useCallback(Y=>{D(Y),N(!1),F.current=!1,K.current=null},[]);i.useEffect(()=>{N(!!x),D(null),_(1),M(0),F.current=!!x,K.current=null,R.current={}},[x]),i.useEffect(()=>{const Y=K.current;if(Y==null||w||j<=0||E!=="all")return;let ae=!1,H=0;const X=120,ve=()=>{if(ae)return;H++;const ce=Math.max(1,Math.min(Math.floor(Y),j));let J=!0;for(let he=1;he<=ce;he++){const be=R.current[he];if(!be||!be.isConnected||be.clientHeight<=50){J=!1;break}}if(J){requestAnimationFrame(()=>{if(ae)return;const he=R.current[ce];he&&he.scrollIntoView({block:"start",behavior:"auto"}),K.current=null,requestAnimationFrame(()=>{ae||(F.current=!1)})});return}if(H>=X){K.current=null,F.current=!1;return}requestAnimationFrame(ve)};return requestAnimationFrame(ve),()=>{ae=!0}},[w,j,E]);const Ee=i.useCallback(Y=>{_(ae=>{const H=Number((ae+Y).toFixed(2));return Math.max(ka,Math.min(Da,H))})},[]),Se=i.useCallback(()=>{if(!x)return;const Y=window.open(x,"_blank","noopener,noreferrer");Y&&(Y.onload=()=>{try{Y.print()}catch{}})},[x]),Ke=i.useCallback(()=>{if(!x)return;const Y=document.createElement("a");Y.href=x,Y.download="",Y.rel="noopener noreferrer",Y.target="_blank",document.body.appendChild(Y),Y.click(),Y.remove()},[x]),Z=i.useCallback(()=>{var ae;const Y=I.current;Y&&((ae=Y.requestFullscreen)==null||ae.call(Y))},[]),re=i.useCallback(()=>{document.fullscreenElement&&document.exitFullscreen()},[]),le=i.useCallback(()=>{if(w||E!=="all"||j<=0||F.current)return;const Y=P.current;if(!Y)return;const ae=Y.scrollTop+Y.clientHeight*.35;let H=S,X=Number.POSITIVE_INFINITY;for(let ve=1;ve<=j;ve++){const ce=R.current[ve];if(!ce)continue;const J=Math.abs(ce.offsetTop-ae);J<X&&(X=J,H=ve)}H!==S&&A(H)},[w,E,j,S]);return i.useEffect(()=>{if(!d||typeof d!="object")return;const Y=d._pdfCmdNonce,ae=d.pdfCommand,H=d.pdfCommandArg;if(!(Y==null||Y===ne.current||!ae)){switch(ne.current=Y,ae){case"print":Se();break;case"download":Ke();break;case"enterFullscreen":Z();break;case"exitFullscreen":re();break;case"goToPage":typeof H=="number"&&xe(H,"smooth");break;case"fitWidth":B("width"),_(1);break;case"fitHeight":B("height"),_(1);break;case"zoomIn":Ee(qn);break;case"zoomOut":Ee(-qn);break;case"previewSingle":T("single");break;case"previewAll":T("all");break}if(e&&t){const X=O.getState().getProps(e,t),ve=X&&typeof X=="object"&&!Array.isArray(X)?X:{};O.getState().setProps(e,t,{...ve,pdfCommand:void 0,pdfCommandArg:void 0})}}},[d,e,t,Se,Ke,Z,re,xe,Ee]),u.jsx("div",{ref:I,className:g,style:{display:"flex",flexDirection:"column",width:"100%",flexGrow:1,...C},children:u.jsx("div",{ref:P,onScroll:le,style:{flex:1,width:"100%",overflow:"auto",position:"relative",backgroundColor:b,border:n?"1px dashed #ccc":void 0},children:$?u.jsx(V.Alert,{type:"error",message:(l==null?void 0:l.trim())||$.message,showIcon:!0}):x?u.jsxs(u.Fragment,{children:[w?u.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:b,zIndex:2,pointerEvents:"none"},children:u.jsx(V.Spin,{})}):null,u.jsx(Pt.Document,{file:x,onLoadSuccess:$e,onLoadError:_e,loading:null,options:ue,children:Q.map(Y=>u.jsx("div",{ref:ae=>{R.current[Y]=ae},style:{display:"flex",justifyContent:"center",width:"100%",padding:"8px 0"},children:u.jsx(Pt.Page,{pageNumber:Y,width:z==="width"?te:void 0,height:z==="height"?ye:void 0,renderTextLayer:!1,renderAnnotationLayer:!1})},Y))},x)]}):u.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:u.jsx(V.Empty,{image:u.jsx(ze.FilePdfOutlined,{style:{fontSize:72,color:"rgba(0, 0, 0, 0.25)"}}),description:u.jsxs("div",{style:{textAlign:"center"},children:[u.jsx("div",{style:{marginBottom:8,fontSize:14,color:"rgba(0, 0, 0, 0.88)"},children:"暂无预览"}),u.jsx("div",{style:{fontSize:12,color:"rgba(0, 0, 0, 0.45)"},children:"请传入文件路径"})]})})})})})};function Ta(t,e,n,o){const{getProps:r,setProps:s}=O.getState(),a=r(t,e),c=a&&typeof a=="object"&&!Array.isArray(a)?a:{};s(t,e,{...c,pdfCommand:n,pdfCommandArg:o,_pdfCmdNonce:Date.now()})}function Re(t){if(!(t==null||t==="")){if(typeof t=="string")try{const e=t.trim();if(e.startsWith("{")||e.startsWith("["))return JSON.parse(e)}catch{}return t}}function Ea(t,e){return t==null||t===""?e:t===!0||t==="true"?!0:t===!1||t==="false"?!1:e}function ot(t,e){const{chartType:n,defaultHeight:o=300,defaultData:r=[]}=e,s=a=>{const{id:c,sessionId:l,develop:y,style:h,className:p,dataSet:g,dataSetField:C,data:v,common:m,height:f,width:d,autoFit:x,padding:b,title:j,legend:M,label:S,tooltip:A,animate:k,scale:$,interaction:D,annotations:w,axis:N,scrollbar:E,slider:T,theme:z,state:B,events:L,..._}=a,I=i.useRef(null),P=O(xe=>xe.getDataSet),R=O(xe=>xe.addCommand),F=i.useMemo(()=>{if(g&&C){const Ne=P(g,C);if(Ne!==void 0)return Ne}const xe=Re(v);return xe!==void 0?xe:y?r:[]},[v,g,C,P,y]),K=xe=>{var Ne;if(I.current=xe,!y&&l){const $e=Re(L);$e&&typeof $e=="object"&&Object.entries($e).forEach(([_e,Ee])=>{typeof Ee=="string"&&xe.on(_e,Se=>{R(l,{actionName:Ee,arg:Se,timestamp:Date.now()})})})}(Ne=_.onReady)==null||Ne.call(_,xe)},q=Re(m)||{},G={data:F,height:q.height??o,autoFit:Ea(q.autoFit,!0),...q,animate:y?!1:Re(k),onReady:K,..._},ie=Re(j);ie!==void 0&&(G.title=ie);const pe=Re(M);pe!==void 0&&(G.legend=pe);const ne=Re(S);ne!==void 0&&(G.label=ne);const ue=Re(A);ue!==void 0&&(G.tooltip=ue);const fe=Re($);fe!==void 0&&(G.scale=fe);const me=Re(D);me!==void 0&&(G.interaction=me);const ee=Re(w);ee!==void 0&&(G.annotations=ee);const W=Re(N);W!==void 0&&(G.axis=W);const te=Re(E);te!==void 0&&(G.scrollbar=te);const ye=Re(T);ye!==void 0&&(G.slider=ye);const Q=Re(z);Q!==void 0&&(G.theme=Q);const oe=Re(B);return oe!==void 0&&(G.state=oe),u.jsx(t,{...G})};return s.displayName=`withBaseChart(${n})`,s}const _a=[{year:"2020",value:3},{year:"2021",value:4},{year:"2022",value:3.5},{year:"2023",value:5},{year:"2024",value:4.9},{year:"2025",value:6}],Oa=ot(at.Line,{chartType:"AndVLine",defaultHeight:300,defaultData:_a}),Ra=t=>{const{xField:e="year",yField:n="value",seriesField:o,smooth:r=!1,connectNulls:s=!1,lineStyle:a,...c}=t;return u.jsx(Oa,{...c,xField:e,yField:n,seriesField:o,smooth:r,connectNulls:s,lineStyle:a})},$a=[{category:"一月",value:38},{category:"二月",value:52},{category:"三月",value:61},{category:"四月",value:45},{category:"五月",value:48},{category:"六月",value:58}],Ba=ot(at.Column,{chartType:"AndVColumn",defaultHeight:300,defaultData:$a}),Va=t=>{const{xField:e="category",yField:n="value",seriesField:o,isGroup:r=!1,isStack:s=!1,columnWidth:a,...c}=t,l={...c,xField:e,yField:n};return o&&(l.seriesField=o),r&&(l.isGroup=r),s&&(l.isStack=s),a&&(l.columnWidth=a),u.jsx(Ba,{...l})},La=[{type:"分类一",value:27},{type:"分类二",value:25},{type:"分类三",value:18},{type:"分类四",value:15},{type:"分类五",value:10},{type:"其他",value:5}],Fa=ot(at.Pie,{chartType:"AndVPie",defaultHeight:300,defaultData:La}),Pa=t=>{const{angleField:e="value",colorField:n="type",radius:o=.8,innerRadius:r,...s}=t,a={...s,angleField:e,colorField:n,radius:o};return r!==void 0&&r>0&&(a.innerRadius=r),u.jsx(Fa,{...a})},za=ot(at.Area,{chartType:"AndVArea",defaultHeight:300,defaultData:[{year:"1991",value:3},{year:"1992",value:4},{year:"1993",value:3.5},{year:"1994",value:5},{year:"1995",value:4.9},{year:"1996",value:6},{year:"1997",value:7},{year:"1998",value:9},{year:"1999",value:13}]}),Ka=t=>{const{xField:e,yField:n,seriesField:o,colorField:r,shapeField:s,sizeField:a,line:c,point:l,stack:y,percent:h,symmetry:p,diff:g,...C}=t,v={...C};e&&(v.xField=e),n&&(v.yField=n),o&&(v.seriesField=o),r&&(v.colorField=r),s&&(v.shapeField=s),a&&(v.sizeField=a),y!==void 0&&(v.stack=y===!0||y==="true"),h!==void 0&&(v.percent=h===!0||h==="true"),p!==void 0&&(v.symmetry=p===!0||p==="true"),g!==void 0&&(v.diff=g===!0||g==="true");const m=Re(c);m!==void 0&&(v.line=m);const f=Re(l);return f!==void 0&&(v.point=f),u.jsx(za,{...v})},qa=ot(at.DualAxes,{chartType:"AndVDualAxes",defaultHeight:300,defaultData:[{year:"1991",value:3,count:10},{year:"1992",value:4,count:4},{year:"1993",value:3.5,count:5},{year:"1994",value:5,count:5},{year:"1995",value:4.9,count:4.9},{year:"1996",value:6,count:35},{year:"1997",value:7,count:7},{year:"1998",value:9,count:1},{year:"1999",value:13,count:20}]}),Wa=t=>{const{xField:e,yField:n,seriesField:o,colorField:r,children:s,...a}=t,c={...a};console.log("[AndVDualAxes] props:",{xField:e,yField:n,children:s}),e&&(c.xField=e);const l=Re(n);l?c.yField=l:n&&(c.yField=n),o&&(c.seriesField=o),r&&(c.colorField=r);const y=Re(s);return y!==void 0&&(c.children=y),u.jsx(qa,{...c})},Ia=ot(at.Gauge,{chartType:"AndVGauge",defaultHeight:300,defaultData:{percent:.7}}),Ya=t=>{const{...e}=t,n={...e};return console.log("[AndVGauge] chartProps:",JSON.stringify(n,null,2)),u.jsx(Ia,{...n})},Ha=ot(at.Liquid,{chartType:"AndVLiquid",defaultHeight:300,defaultData:.25}),Ua=t=>{const{percent:e,...n}=t,o={...n};return e!==void 0&&(o.percent=e),console.log("[AndVLiquid] chartProps:",JSON.stringify(o,null,2)),u.jsx(Ha,{...o})},Ga=ot(at.Bar,{chartType:"AndVBar",defaultHeight:300,defaultData:[{year:"1951 年",value:38},{year:"1952 年",value:52},{year:"1956 年",value:61},{year:"1957 年",value:145},{year:"1958 年",value:48}]}),Ja=t=>{const{xField:e,yField:n,seriesField:o,colorField:r,stack:s,group:a,percent:c,conversionTag:l,markBackground:y,...h}=t,p={...h};e&&(p.xField=e),n&&(p.yField=n),o&&(p.seriesField=o),r&&(p.colorField=r),s!==void 0&&(p.stack=s===!0||s==="true"),a!==void 0&&(p.group=a===!0||a==="true"),c!==void 0&&(p.percent=c===!0||c==="true");const g=Re(l);g!==void 0&&(p.conversionTag=g);const C=Re(y);return C!==void 0&&(p.markBackground=C),console.log("[AndVBar] chartProps:",JSON.stringify(p,null,2)),u.jsx(Ga,{...p})};exports.AVAILABLE_TOKENS=Go;exports.AndAlert=oa;exports.AndAutoComplete=_s;exports.AndAvatar=qi;exports.AndBadge=Zi;exports.AndBadgeRibbon=Xi;exports.AndBreadCrumb=Hi;exports.AndButton=Zo;exports.AndCalendar=Qi;exports.AndCard=da;exports.AndCarousel=$i;exports.AndCascade=Ns;exports.AndCheckbox=As;exports.AndColumn=ya;exports.AndContainer=ha;exports.AndDatePicker=bs;exports.AndDivider=fa;exports.AndDrawer=ia;exports.AndDropdown=lr;exports.AndDropdownMenu=lr;exports.AndDynamicContainer=Aa;exports.AndFormItem=Rs;exports.AndIcon=Ca;exports.AndImage=Fi;exports.AndImageGroup=Ki;exports.AndInput=rr;exports.AndInputArea=ss;exports.AndInputNumber=or;exports.AndInputPassword=cs;exports.AndInputSearch=us;exports.AndIterator=ba;exports.AndMasonry=ra;exports.AndMenu=Ji;exports.AndModal=sa;exports.AndPagination=Yi;exports.AndParagraph=ji;exports.AndPdfViewer=Na;exports.AndProductCategory=Ma;exports.AndQRCode=ga;exports.AndRadio=Ms;exports.AndRangePicker=Cs;exports.AndRate=js;exports.AndResult=aa;exports.AndRow=ma;exports.AndSegmented=Ls;exports.AndSelect=sr;exports.AndSimpleForm=Os;exports.AndSlider=ws;exports.AndSplitter=pa;exports.AndSplitterPanel=va;exports.AndStatistics=Ei;exports.AndStatisticsCountdown=_i;exports.AndSteps=Ti;exports.AndSwitch=ys;exports.AndTable=bi;exports.AndTabs=ki;exports.AndTag=Ii;exports.AndText=Si;exports.AndTimePicker=xs;exports.AndTimeline=Ni;exports.AndTitle=Mi;exports.AndTransfer=$s;exports.AndTree=Di;exports.AndTreeSelect=Ts;exports.AndUpload=Es;exports.AndVArea=Ka;exports.AndVBar=Ja;exports.AndVColumn=Va;exports.AndVDualAxes=Wa;exports.AndVGauge=Ya;exports.AndVLine=Ra;exports.AndVLiquid=Ua;exports.AndVPie=Pa;exports.AndWatermark=ja;exports.COMMON_TOKENS=Jo;exports.DataSetInheritContext=We;exports.cleanupAllMounts=Or;exports.clearCssCache=Er;exports.collectContextChainRootToLeaf=un;exports.createCommand=se;exports.createWatchCommands=Pr;exports.deriveScopedComponentId=ct;exports.dictValueEquals=Zn;exports.dispatchPdfViewerCommand=Ta;exports.ensurePdfjsWorker=dr;exports.findDictOptionByValue=et;exports.flattenScopeChain=So;exports.formatByType=tr;exports.getAccessToken=Nt;exports.getCoreConfig=Ue;exports.getDataSetStoreKey=de;exports.getDictOptions=Kt;exports.getNestedValue=xt;exports.getValidateStoreKey=bt;exports.initReactMount=In;exports.isTokenName=dn;exports.layoutKeyPrefixFromContext=Co;exports.mergeStoreProps=Ye;exports.mountReactComponent=_r;exports.parseAction=st;exports.parseArrayNotation=dt;exports.parseChangeAction=Te;exports.parseClickAction=an;exports.parseNestedPath=lt;exports.parseQueryAction=zr;exports.processValidationRules=cn;exports.req=wo;exports.request=it;exports.resolveInheritedDataSet=Qn;exports.resolveTokenColorWithToken=Qo;exports.setCoreConfig=jo;exports.setNestedValue=Yn;exports.setPdfjsWorkerSrc=wa;exports.upload=zt;exports.useAddCommand=Br;exports.useAndStore=O;exports.useApiService=Xn;exports.useCommandsStore=Fr;exports.useDictOptions=St;exports.useFieldValidation=Ie;exports.useItemStore=Lr;exports.usePopCommand=Vr;exports.useRemoteOptions=qt;exports.useResolveTokenColor=Et;exports.useResolvedDataSet=tt;exports.useStore=Rr;exports.useStoreByName=$r;exports.useStoreData=Hn;exports.validateWithSchema=ln;exports.watchCommands=Un;exports.withBaseChart=ot;
24
24
  //# sourceMappingURL=index.js.map