bi-components-library 1.0.27 → 1.0.29

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.umd.js CHANGED
@@ -1,12 +1,12 @@
1
- (function(X,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom"],l):(X=typeof globalThis<"u"?globalThis:X||self,l(X.SealSeekBIComponents={},X.React,X.React,X.antd,X.AntdIcons,X.ReactDOM))})(this,function(X,l,c,W,de,Qe){"use strict";const Ie=({variant:t="primary",loading:g=!1,children:p,...u})=>{const d=w=>{switch(w){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return l.jsx(W.Button,{...u,type:d(t),loading:g,ghost:t==="ghost",children:p})};Ie.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const Be=({title:t,children:g,bordered:p=!0,hoverable:u=!1,size:d="default",...w})=>l.jsx(W.Card,{...w,title:t,bordered:p,hoverable:u,size:d,children:g});Be.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const Ve=({showDefaultFooter:t=!0,...g})=>{const p=g.footer!==void 0?g.footer:t?(u,{OkBtn:d,CancelBtn:w})=>l.jsxs(l.Fragment,{children:[l.jsx(d,{}),l.jsx(w,{})]}):null;return l.jsx(W.Modal,{...g,footer:p})};Ve.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const _e=({scrollX:t,showPagination:g=!0,defaultPageSize:p=10,...u})=>l.jsx(W.Table,{...u,scroll:{x:t||"max-content",y:"50vh"},pagination:g?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:p,...u.pagination}:!1});_e.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const Ye=de.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),Ge=({name:t,size:g,color:p,style:u,...d})=>{const w={fontSize:g,color:p,...u};return l.jsx(Ye,{...d,type:t,style:w})};Ge.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const De=({loading:t,description:g="暂无数据",className:p,emptyChildren:u,loadingText:d,emptyImage:w})=>t?l.jsxs(W.Flex,{className:`pt-10 w-full ${p||""}`,align:"center",justify:"center",vertical:!0,children:[l.jsx(W.Spin,{size:"large"}),d&&l.jsx("div",{className:"mt-4 text-gray-500",children:d})]}):l.jsx(W.Flex,{className:`pt-10 w-full ${p||""}`,align:"center",justify:"center",children:l.jsx(W.Empty,{image:w,description:g,imageStyle:{height:180},children:u})});De.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const Pe=({onClick:t,showText:g=!1,className:p,size:u="small",type:d="default"})=>l.jsx(W.Button,{size:u,type:d,icon:l.jsx(de.LeftOutlined,{}),className:`cursor-pointer ${p||""}`,onClick:t,children:g&&"返回"});Pe.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const Me=({removePadding:t=!0,className:g,...p})=>{const u=t?`px-0 h-auto ${g||""}`:g;return l.jsx(W.Button,{type:"link",...p,className:u,children:p.children})};Me.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:Ze}=W.Select,He=({columns:t,request:g,searchFields:p=[],showSearch:u=!0,showRefresh:d=!0,defaultPageSize:w=10,pageSizeOptions:I=["10","20","50","100"],autoLoad:C=!0,externalParams:T={},...e})=>{const[L,h]=c.useState([]),[i,n]=c.useState(!1),[a,o]=c.useState({current:1,pageSize:w,total:0}),[r,s]=c.useState({}),[f,v]=c.useState({}),[x]=W.Form.useForm(),D=c.useRef(a);D.current=a;const S=c.useRef(T);S.current=T;const G=c.useRef(!1),F=c.useMemo(()=>t.map(N=>{const{sortable:H,render:te,...ae}=N;return{...ae,sorter:H?!0:void 0,render:te||(se=>se)}}),[t]),M=c.useCallback(async(N={})=>{if(g){n(!0);try{const H={page:D.current.current,pageSize:D.current.pageSize,sortField:f.field,sortOrder:f.order,searchParams:{...r,...S.current},...N},te=await g(H);te.success&&(h(te.data),o(ae=>({...ae,total:te.total,current:H.page||ae.current})))}catch(H){console.error("加载数据失败:",H)}finally{n(!1)}}},[g,f,r]),U=c.useCallback(N=>{s(N),o(H=>({...H,current:1}))},[]),J=c.useCallback(()=>{x.resetFields(),s({}),o(N=>({...N,current:1}))},[x]),Q=c.useCallback(()=>{M()},[M]),Z=c.useCallback((N,H,te)=>{const ae={current:N.current||1,pageSize:N.pageSize||w,total:N.total||0},se={field:te?.field,order:te?.order};o(ae),v(se)},[w]);return c.useEffect(()=>{const N=Object.keys(T).length>0;(C&&!G.current||N)&&(M(),G.current=!0)},[C,T,M]),l.jsxs("div",{children:[u&&p.length>0&&l.jsx(W.Card,{size:"small",style:{marginBottom:16},children:l.jsxs(W.Form,{form:x,layout:"inline",onFinish:U,initialValues:p.reduce((N,H)=>(H.defaultValue!==void 0&&(N[H.key]=H.defaultValue),N),{}),children:[p.map(N=>l.jsx(W.Form.Item,{name:N.key,label:N.label,children:N.type==="input"?l.jsx(W.Input,{placeholder:N.placeholder||`请输入${N.label}`,style:{width:200}}):l.jsx(W.Select,{placeholder:N.placeholder||`请选择${N.label}`,style:{width:200},allowClear:!0,children:N.options?.map(H=>l.jsx(Ze,{value:H.value,children:H.label},H.value))})},N.key)),l.jsx(W.Form.Item,{children:l.jsxs(W.Space,{children:[l.jsx(W.Button,{type:"primary",htmlType:"submit",icon:l.jsx(de.SearchOutlined,{}),children:"查询"}),l.jsx(W.Button,{onClick:J,children:"重置"}),d&&l.jsx(W.Button,{icon:l.jsx(de.ReloadOutlined,{}),onClick:Q,children:"刷新"})]})})]})}),l.jsx(W.Table,{...e,columns:F,dataSource:L,loading:i,pagination:{...a,showSizeChanger:!0,showQuickJumper:!0,showTotal:(N,H)=>`第 ${H[0]}-${H[1]} 条/共 ${N} 条`,pageSizeOptions:I},onChange:Z,scroll:{x:"max-content",y:"50vh"}})]})};He.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function he(t,g,p){if(!t.current)return;const u=new Set,d={};for(const h of g)h.exclusionGroup&&h.exclusionGroup!=="separator"&&(u.add(h.exclusionGroup),d[h.exclusionGroup]||(d[h.exclusionGroup]=[]),d[h.exclusionGroup].push({type:h.type,key:h.key,exclusionGroup:h.exclusionGroup}));const w={};for(const h of u){w[h]=!1;for(const i of d[h])if(i.type==="upload"&&i.key){if(p[i.key]!==null&&p[i.key]!==void 0){w[h]=!0;break}}else if(i.type==="variable"&&i.key){const n=t.current.querySelector(`[data-type="variable"][data-key="${i.key}"]`);if(n&&n.innerText.replace(/[\u200B\n]/g,"").trim().length>0){w[h]=!0;break}}}const I=g.some(h=>h.exclusionGroup==="separator"),T=Object.keys(w).filter(h=>w[h]).length>0;let e=null;if(T&&I){for(const h of g)if(h.exclusionGroup&&h.exclusionGroup!=="separator"&&w[h.exclusionGroup]){e=h.exclusionGroup;break}}for(const h of u){const i=t.current.querySelectorAll(`[data-group="${h}"]`);I&&T&&e?h===e?i.forEach(n=>{n.classList.contains("required-upload-group")?n.style.setProperty("display","inline-flex","important"):(n.classList.contains("exclusion-wrapper"),n.style.setProperty("display","inline-block","important"))}):i.forEach(n=>{n.style.display="none",n.style.setProperty("display","none","important")}):i.forEach(n=>{n.classList.contains("required-upload-group")?n.style.setProperty("display","inline-flex","important"):(n.classList.contains("exclusion-wrapper"),n.style.setProperty("display","inline-block","important"))})}t.current.querySelectorAll('[data-group="separator"]').forEach(h=>{h.style.display=T?"none":"inline"})}function ve(t,g,p,u){if(!t.current){u(!1);return}const d=[];for(let i=0;i<g.length;i++){const n=g[i];if((n.type==="variable"||n.type==="upload"||n.type==="multi-variable"||n.type==="select"||n.type==="textarea"||n.type==="richtext"||n.type==="datepicker")&&n.required&&n.key){d.push({exclusionGroup:n.exclusionGroup||"",key:n.key,type:n.type==="multi-variable"?"variable":n.type,isMultiVariable:n.type==="multi-variable",minCount:n.type==="multi-variable"?n.minCount:void 0});continue}if(n.type==="text"&&n.className?.includes("rte-text-required"))if(n.exclusionGroup)for(let a=i+1;a<g.length;a++){const o=g[a];if(o.exclusionGroup===n.exclusionGroup&&(o.type==="variable"||o.type==="upload"||o.type==="select"||o.type==="textarea"||o.type==="richtext"||o.type==="datepicker")&&o.key){d.push({exclusionGroup:n.exclusionGroup,key:o.key,type:o.type});break}}else for(let a=i+1;a<g.length;a++){const o=g[a];if((o.type==="variable"||o.type==="upload"||o.type==="select"||o.type==="textarea"||o.type==="richtext"||o.type==="datepicker")&&o.key){d.push({exclusionGroup:o.exclusionGroup||"",key:o.key,type:o.type});break}}}const w=g.some(i=>i.exclusionGroup==="separator"),I=[];if(w&&d.length>1){const i=[];g.forEach((n,a)=>{n.exclusionGroup==="separator"&&i.push(a)});for(const n of i){let a=null;for(let r=n-1;r>=0;r--){const s=g[r];if((s.type==="variable"||s.type==="upload"||s.type==="select"||s.type==="textarea"||s.type==="richtext"||s.type==="datepicker")&&s.key){const f=d.find(v=>v.key===s.key);if(f){a=f;break}}}let o=null;for(let r=n+1;r<g.length;r++){const s=g[r];if((s.type==="variable"||s.type==="upload"||s.type==="select"||s.type==="textarea"||s.type==="richtext"||s.type==="datepicker")&&s.key){const f=d.find(v=>v.key===s.key);if(f){o=f;break}}}a&&o&&I.push([a,o])}}if(d.length===0){if(g.length===0){if(!t.current){u(!1);return}const i=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";u(i.length>0);return}u(!0);return}const C=d.filter(i=>{if(!t.current)return!1;if(i.exclusionGroup){const n=t.current.querySelectorAll(`[data-group="${i.exclusionGroup}"]`);if(n.length>0)return n[0].style.display!=="none"}if(i.type==="upload"&&i.key){const n=t.current.querySelector(`[data-type="upload"][data-key="${i.key}"]`);if(n){const a=n.closest("[data-group]")||n.parentElement;return a?a.style.display!=="none":!0}}else if(i.type==="variable"&&i.key)if(i.isMultiVariable){const n=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${i.key}"]`);if(n.length>0){const a=n[0],o=a.closest("[data-group]")||a.parentElement;return o?o.style.display!=="none":!0}}else{const n=t.current.querySelector(`[data-type="variable"][data-key="${i.key}"]`);if(n){const a=n.closest("[data-group]")||n.parentElement;return a?a.style.display!=="none":!0}}else if(i.type==="select"&&i.key){const n=t.current.querySelector(`[data-type="select"][data-key="${i.key}"]`);if(n){const a=n.closest("[data-group]")||n.parentElement;return a?a.style.display!=="none":!0}}else if(i.type==="textarea"&&i.key){const n=t.current.querySelector(`[data-type="textarea"][data-key="${i.key}"]`);if(n){const a=n.closest("[data-group]")||n.parentElement;return a?a.style.display!=="none":!0}}else if(i.type==="richtext"&&i.key){const n=t.current.querySelector(`[data-type="richtext"][data-key="${i.key}"]`);if(n){const a=n.closest("[data-group]")||n.parentElement;return a?a.style.display!=="none":!0}}else if(i.type==="datepicker"&&i.key){const n=t.current.querySelector(`[data-type="datepicker"][data-key="${i.key}"]`);if(n){const a=n.closest("[data-group]")||n.parentElement;return a?a.style.display!=="none":!0}}return!1});if(C.length===0){u(!0);return}const T=new Set;I.forEach(i=>{i.forEach(n=>{n.key&&T.add(n.key)})});const e=C.filter(i=>!i.key||!T.has(i.key));let L=(I.length===0,!0);for(const i of I){const n=i.filter(o=>{if(!t.current)return!1;if(o.exclusionGroup){const r=t.current.querySelectorAll(`[data-group="${o.exclusionGroup}"]`);if(r.length>0)return r[0].style.display!=="none"}return!0});if(n.length===0)continue;let a=!1;for(const o of n)if(o.type==="upload"&&o.key){if(p[o.key]!==null&&p[o.key]!==void 0){a=!0;break}}else if(o.type==="variable"&&o.key)if(o.isMultiVariable){const r=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${o.key}"]`);let s=0;for(const v of Array.from(r))v.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(s+=1);const f=o.minCount&&o.minCount>0?o.minCount:1;if(s>=f){a=!0;break}}else{const r=t.current.querySelector(`[data-type="variable"][data-key="${o.key}"]`);if(r&&r.innerText.replace(/[\u200B\n]/g,"").trim().length>0){a=!0;break}}else if(o.type==="select"&&o.key){const r=t.current.querySelector(`[data-type="select"][data-key="${o.key}"]`);if(r&&(r.value||"").trim().length>0){a=!0;break}}else if(o.type==="textarea"&&o.key){const r=t.current.querySelector(`[data-type="textarea"][data-key="${o.key}"]`);if(r&&(r.value||"").trim().length>0){a=!0;break}}else if(o.type==="richtext"&&o.key){const r=t.current.querySelector(`[data-type="richtext"][data-key="${o.key}"]`);if(r&&(r.textContent||"").replace(/[\u200B]/g,"").trim().length>0){a=!0;break}}else if(o.type==="datepicker"&&o.key){const r=t.current.querySelector(`[data-type="datepicker"][data-key="${o.key}"]`);if(r&&(r.getAttribute("data-value")||"").trim().length>0){a=!0;break}}if(!a){L=!1;break}}let h=!0;for(const i of e)if(i.type==="upload"&&i.key){if(p[i.key]===null||p[i.key]===void 0){h=!1;break}}else if(i.type==="variable"&&i.key)if(i.isMultiVariable){const n=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${i.key}"]`);let a=0;for(const r of Array.from(n))r.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(a+=1);const o=i.minCount&&i.minCount>0?i.minCount:1;if(a<o){h=!1;break}}else{const n=t.current.querySelector(`[data-type="variable"][data-key="${i.key}"]`);if(!n){h=!1;break}if(n.innerText.replace(/[\u200B\n]/g,"").trim().length===0){h=!1;break}}else if(i.type==="select"&&i.key){const n=t.current.querySelector(`[data-type="select"][data-key="${i.key}"]`);if(!n||(n.value||"").trim().length===0){h=!1;break}}else if(i.type==="textarea"&&i.key){const n=t.current.querySelector(`[data-type="textarea"][data-key="${i.key}"]`);if(!n||(n.value||"").trim().length===0){h=!1;break}}else if(i.type==="richtext"&&i.key){const n=t.current.querySelector(`[data-type="richtext"][data-key="${i.key}"]`);if(!n||(n.textContent||"").replace(/[\u200B]/g,"").trim().length===0){h=!1;break}}else if(i.type==="datepicker"&&i.key){const n=t.current.querySelector(`[data-type="datepicker"][data-key="${i.key}"]`);if(!n||(n.getAttribute("data-value")||"").trim().length===0){h=!1;break}}u(L&&h)}function qe(t,g){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(u=>{const d=u.innerText.replace(/\n/g,"");d.replace(/\u200B/g,"")?u.classList.remove("show-placeholder"):(d!=="​"&&(u.innerText="​"),u.classList.add("show-placeholder"))})}function Re(t,g,p,u,d,w={},I){if(!t.current)return;let C="",T=0;for(;T<g.length;){const e=g[T],L=T+1<g.length?g[T+1]:null;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&L){const r=L.type==="upload"&&L.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===L.exclusionGroup,s=L.type==="variable"&&L.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===L.exclusionGroup;if(r){const v=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,x="</span>";let D="";e.className?D=`<span class="${e.className}">${e.text??""}</span>`:D=e.text??"";const S=L,G=p[S.key]!==null&&p[S.key]!==void 0,F=G?p[S.key]:null,M=G?p[S.key]?.name:S.text,U=G?"":"hidden",J=S.tooltip&&!G?"":"hidden",Q=G?"has-file":"",Z=G&&M?` data-file-name="${M.replace(/"/g,"&quot;")}"`:"";let N="";G&&F&&(F.type?.startsWith("image/")?N=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(F)}" alt="preview" />`:N="<i class='iconfont icon-exlwenjian'></i>");const H=`<span contenteditable="false" data-type="upload" data-key="${S.key}" class="upload-chip"><span class="upload-inner-wrapper ${Q}"><span class="upload-icon">${N}</span><span class="upload-label"${Z}>${M||S.text}</span>${S.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${J}" data-upload-key="${S.key}" data-tooltip="${S.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${U}" title="移除文件">×</span></span></span>`;C+=v+D+H+x,T+=2;continue}if(s){const v=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,x="</span>";let D="";e.className?D=`<span class="${e.className}">${e.text??""}</span>`:D=e.text??"";const S=L,F=(S.key?d[S.key]:void 0)||S.text||"",M=!F,U=M?"​":F,J=M?"show-placeholder":"",Q=S.exclusionGroup?` data-group="${S.exclusionGroup}"`:"",Z=S.tooltip?` data-tooltip="${S.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${S.key||""}"`:"",N=S.tooltip&&M?"":"hidden",H=`<span contenteditable="true" data-type="variable" data-key="${S.key}" data-placeholder="${S.placeholder||""}"${Q}${Z} class="variable-chip ${J}">${U}${S.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${N}" data-variable-key="${S.key}" data-tooltip="${S.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;C+=v+D+H+x,T+=2;continue}}const i=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",n=e.exclusionGroup?`<span ${i} class="exclusion-wrapper">`:"",a=e.exclusionGroup?"</span>":"";let o="";if(e.type==="tag"){const s=u||I==="hideTagClose"?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',f=u?' data-locked="true"':"",v=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-tag-key="${e.key||""}"`:"";o=`<span contenteditable="false" class="tag-node group"${f}${v}><span class="tag-label">${e.text}</span>${s}</span>`}else if(e.type==="text"){const r=u?' data-locked="true" contenteditable="false"':' contenteditable="false"',f=(e.text??"").replace(/\n/g,"<br/>");e.className?o=`<span class="${e.className}"${r}>${f}</span>`:o=u?`<span${r}>${f}</span>`:`<span contenteditable="false">${f}</span>`}else if(e.type==="variable"&&e.key){const s=d[e.key]||e.text||"",f=!s,v=f?"​":s,x=f?"show-placeholder":"",D=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",S=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",G=e.tooltip&&f?"":"hidden",F=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${D}${S} class="variable-chip ${x}">${v}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${G}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${F}</span>`:o=F}else if(e.type==="upload"&&e.key){const r=p[e.key]!==null&&p[e.key]!==void 0,s=r?p[e.key]:null,f=r?p[e.key]?.name:e.text,v=r?"":"hidden",x=e.tooltip&&!r?"":"hidden",D=r?"has-file":"",S=r&&f?` data-file-name="${f.replace(/"/g,"&quot;")}"`:"";let G="";r&&s&&(s.type?.startsWith("image/")?G=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(s)}" alt="preview" />`:G="<i class='iconfont icon-exlwenjian'></i>");const F=`<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${D}"><span class="upload-icon">${G}</span><span class="upload-label"${S}>${f||e.text}</span>${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${x}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${v}" title="移除文件">×</span></span></span>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${F}</span>`:o=F}else if(e.type==="select"&&e.key){const r=d[e.key]??e.text??"",s=(e.options||[]).map(S=>{const G=r===S.value?"selected":"";return`<option value="${S.value}" ${G}>${S.label}</option>`}).join(""),f=e.placeholder?`<option value="" ${r?"":"selected"} disabled hidden>${e.placeholder}</option>`:"",D=`<span class="rte-select-wrapper">${`<select data-type="select" data-key="${e.key}" class="rte-select rte-select-has-icon">${f}${s}</select>`}<i class="iconfont icon-qiehuan-xiayizhang rte-select-icon"></i></span>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${D}</span>`:o=D}else if(e.type==="textarea"&&e.key){const r=d[e.key]||"",s=e.maxHeight||252,f=e.expandable!==!1,v=e.placeholder?` placeholder="${e.placeholder}"`:"",x=`<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${s}" style="max-height:${s}px;"${v}>${r}</textarea>`,D=f?`<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>`:"",S=`<div class="rte-textarea-wrapper" data-key="${e.key}">${x}${D}</div>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${S}</span>`:o=S}else if(e.type==="richtext"&&e.key){const r=d[e.key]||e.text||"",s=e.minHeight||140,f=e.placeholder?` data-placeholder="${e.placeholder}"`:"",v=e.expandable!==!1,x=r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),D=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${f} style="min-height:${s}px;">${x}</div>`,S=v?`<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>`:"",G=`<div class="rte-richtext-wrapper" data-key="${e.key}">${D}${S}</div>`,F=`<div class="rte-richtext-container" data-key="${e.key}">${G}</div>`;e.required?o=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group rte-richtext-required"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${F}</div>`:o=F}else if(e.type==="datepicker"&&e.key){const r=d[e.key]||"",s=e.placeholder?` data-placeholder="${e.placeholder}"`:"",f=`<div data-type="datepicker" data-key="${e.key}" data-value="${r}" class="rte-datepicker-host"${s}></div>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${f}</span>`:o=f}else if(e.type==="multi-variable"&&e.key){const r=e.maxCount||9,s=w[e.key]||1,f=Math.min(s,r);if(e.required){const v=`<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`,x=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"";let D="";for(let S=0;S<f;S++){const G=`${e.key}_${S}`,F=d[G]||"",M=!F,U=M?"​":F,J=M?"show-placeholder":"",Q=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",Z=e.tooltip&&M?"":"hidden",N=`<span contenteditable="true" data-type="variable" data-key="${G}" data-multi-key="${e.key}" data-index="${S}" data-placeholder="${e.placeholder||""}"${Q} class="variable-chip ${J}">${U}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Z}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;S===0?D+=`<span ${x} class="exclusion-wrapper required-upload-group required-multi-first">${v}${N}</span>`:D+=N}o=D}else{let v="";for(let x=0;x<f;x++){const D=`${e.key}_${x}`,S=d[D]||"",G=!S,F=G?"​":S,M=G?"show-placeholder":"",U=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",J=e.tooltip&&G?"":"hidden",Q=`<span contenteditable="true" data-type="variable" data-key="${D}" data-multi-key="${e.key}" data-index="${x}" data-placeholder="${e.placeholder||""}"${U} class="variable-chip ${M}">${F}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${J}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;v+=Q}o=v}}C+=n+o+a,T++}t.current&&(t.current.innerHTML=C,setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(L=>{const h=L.innerText.replace(/\n/g,"");h.replace(/\u200B/g,"")?L.classList.remove("show-placeholder"):(h!=="​"&&(L.innerText="​"),L.classList.add("show-placeholder"))})},0))}function et(t,g,p,u,d={},w,I,C){const T=c.useCallback(()=>{if(!t.current)return;if(g.length===0){t.current.innerHTML="";return}let e={};const h=t.current.__tempVariableValues;if(h?(e=h,setTimeout(()=>{if(t.current){const i=t.current;i.__tempVariableValues===h&&delete i.__tempVariableValues}},100)):(t.current.querySelectorAll('[data-type="variable"]').forEach(s=>{const f=s.dataset.key;if(f){const v=s.innerText.replace(/[\u200B\n]/g,"").trim();v&&(e[f]=v)}}),t.current.querySelectorAll('[data-type="select"]').forEach(s=>{const f=s.dataset.key;if(f){const v=s.value.trim();v&&(e[f]=v)}}),t.current.querySelectorAll('[data-type="textarea"]').forEach(s=>{const f=s.dataset.key;if(f){const v=s.value.replace(/[\u200B]/g,"").trim();v&&(e[f]=v)}}),t.current.querySelectorAll('[data-type="richtext"]').forEach(s=>{const f=s.dataset.key;if(f){const v=(s.textContent||"").replace(/[\u200B]/g,"").trim();v&&(e[f]=v)}}),t.current.querySelectorAll('[data-type="datepicker"]').forEach(s=>{const f=s.dataset.key;if(f){const v=(s.getAttribute("data-value")||"").trim();v&&(e[f]=v)}})),Re(t,g,p,u,e,d,C),w?.current){const{key:i,offset:n}=w.current;setTimeout(()=>{if(!t.current)return;const a=t.current.querySelector(`[data-type="variable"][data-key="${i}"]`);if(a){try{const o=document.createRange(),r=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null);let s=0,f=null,v=0;for(;r.nextNode();){const x=r.currentNode,D=x.textContent?.length||0;if(s+D>=n){f=x,v=n-s;break}s+=D}if(f){o.setStart(f,Math.min(v,f.textContent?.length||0)),o.collapse(!0);const x=window.getSelection();x&&(x.removeAllRanges(),x.addRange(o),a.focus())}else{o.selectNodeContents(a),o.collapse(!1);const x=window.getSelection();x&&(x.removeAllRanges(),x.addRange(o),a.focus())}}catch{const o=document.createRange();o.selectNodeContents(a),o.collapse(!1);const r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(o),a.focus())}w.current=null}},0)}},[g,p,u,t,d,w,I,C]);c.useEffect(()=>{T()},[T])}function tt(t,g,p,u){c.useEffect(()=>{const d=t.current;if(!d)return;const w=C=>{const T=C.target?.closest(".upload-info-icon");if(T&&T.classList.contains("upload-info-icon")){const L=T.dataset.uploadKey;L&&u({key:L,anchorEl:T,type:"upload"});return}const e=C.target?.closest('[data-type="upload"]');if(e){const L=e.dataset.key;if(L){const h=p[L];h&&h.type&&h.type.startsWith("image/")&&u({key:L,anchorEl:e,type:"upload-preview"})}}},I=C=>{const T=C.target?.closest(".upload-info-icon"),e=C.relatedTarget;if(T&&T.classList.contains("upload-info-icon")){!e||!d.contains(e)?u(null):e.closest(".upload-info-icon")||u(null);return}const L=C.target?.closest('[data-type="upload"]');if(L){const h=e;if(h&&L.contains(h))return;u(null)}};return d.addEventListener("mouseover",w,!0),d.addEventListener("mouseout",I,!0),()=>{d.removeEventListener("mouseover",w,!0),d.removeEventListener("mouseout",I,!0)}},[g,p,t,u])}function at(t,g,p,u){c.useEffect(()=>{if(!t.current)return;const d=T=>{if(u==="hideTagClose")return;const e=T.currentTarget,L=e.dataset.tooltip,h=e.dataset.tagKey||"";L&&p({key:h,anchorEl:e,type:"tag"})},w=()=>{p(null)};let I;const C=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",w)})};return I=requestAnimationFrame(()=>{I=requestAnimationFrame(C)}),()=>{cancelAnimationFrame(I),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.removeEventListener("mouseenter",d),e.removeEventListener("mouseleave",w)})}},[g,t,p,u])}function nt(t,g,p){c.useEffect(()=>{const u=t.current;if(!u)return;const d=I=>{const C=I.target?.closest(".variable-info-icon");if(C&&C.classList.contains("variable-info-icon")){const T=C.dataset.variableKey;T&&p({key:T,anchorEl:C,type:"variable"})}},w=I=>{const C=I.target?.closest(".variable-info-icon"),T=I.relatedTarget;C&&C.classList.contains("variable-info-icon")&&(!T||!u.contains(T)?p(null):T.closest(".variable-info-icon")||p(null))};return u.addEventListener("mouseover",d,!0),u.addEventListener("mouseout",w,!0),()=>{u.removeEventListener("mouseover",d,!0),u.removeEventListener("mouseout",w,!0)}},[g,t,p])}function rt(t,g,p,u){c.useEffect(()=>{if(!t.current)return;const d=T=>{const e=T.currentTarget;e.dataset.fileName&&u({key:"",anchorEl:e,type:"upload-label"})},w=()=>{u(null)};let I;const C=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(e=>{e.addEventListener("mouseenter",d),e.addEventListener("mouseleave",w)})};return I=requestAnimationFrame(()=>{I=requestAnimationFrame(C)}),()=>{cancelAnimationFrame(I),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(e=>{e.removeEventListener("mouseenter",d),e.removeEventListener("mouseleave",w)})}},[g,p,t,u])}function ot(t,g,p,u){c.useEffect(()=>{const d=setTimeout(()=>{he(t,g,p),ve(t,g,p,u)},0);return()=>clearTimeout(d)},[p,g,t,u]),c.useEffect(()=>{const d=t.current;if(!d)return;const w=I=>{const C=I.target;C&&C.matches('[data-type="select"]')&&(he(t,g,p),ve(t,g,p,u))};return d.addEventListener("change",w,!0),()=>{d.removeEventListener("change",w,!0)}},[g,p,t,u])}function lt(t,g){c.useEffect(()=>{if(!t.current)return;let p=!1,u=0;const d=()=>{p=!0},w=()=>{p=!1,u=Date.now()};let I=!1,C=0;const T=()=>{I=!0},e=()=>{I=!1,C=Date.now()},L=()=>{C=Date.now()},h=()=>{if(!t.current)return;const n=window.getSelection();if(!n||n.rangeCount===0||g.current||p||I||Date.now()-C<500)return;const a=n.getRangeAt(0);if(!a.collapsed)return t.current.contains(a.commonAncestorContainer),void 0;const o=n.anchorNode;if(!o||!t.current.contains(o))return;let r=null;if(o.nodeType===Node.ELEMENT_NODE?r=o.closest('[data-type="variable"]'):o.nodeType===Node.TEXT_NODE&&o.parentElement&&(r=o.parentElement.closest('[data-type="variable"]')),!r){if(Date.now()-u>500)return;const s=t.current.querySelectorAll('[data-type="variable"]');if(s.length>0){let f=null;for(const v of Array.from(s))if(v.style.display!=="none"){f=v;break}if(!f&&s.length>0&&(f=s[0]),f){const v=document.createRange();v.selectNodeContents(f),v.collapse(!1),n.removeAllRanges(),n.addRange(v),f.focus()}else n.removeAllRanges()}else n.removeAllRanges()}},i=t.current;return i&&(i.addEventListener("compositionstart",T),i.addEventListener("compositionend",e),i.addEventListener("input",L)),document.addEventListener("mousedown",d),document.addEventListener("mouseup",w),document.addEventListener("selectionchange",h),()=>{const n=t.current;n&&(n.removeEventListener("compositionstart",T),n.removeEventListener("compositionend",e),n.removeEventListener("input",L)),document.removeEventListener("mousedown",d),document.removeEventListener("mouseup",w),document.removeEventListener("selectionchange",h)}},[t,g])}const Oe=({config:t,onSend:g,isProcessing:p=!1,disabled:u=!1,width:d,lockStructure:w=!1,agentOptions:I=[],onAgentSelect:C,onAgentExit:T,loading:e=!1,placeholder:L,border:h,background:i="transparent",hideButtons:n})=>{const a=c.useRef(null),o=c.useRef(null),[r,s]=c.useState({}),[f,v]=c.useState(null),[x,D]=c.useState(null),S=c.useRef(!1),G=c.useRef(null),[F,M]=c.useState(!1),U=c.useRef(null),[J,Q]=c.useState(!0),[Z,N]=c.useState(()=>{const y={};return t.forEach(m=>{m.type==="multi-variable"&&m.key&&(y[m.key]=1)}),y}),H=c.useRef({}),te=c.useRef({}),ae=c.useRef({});c.useEffect(()=>{te.current=r},[r]),c.useEffect(()=>{ae.current=Z},[Z]);const se=c.useCallback(y=>y.find(b=>b.type==="tag")?.text||null,[]),fe=c.useRef(t),ie=c.useRef(null);c.useEffect(()=>{const y=se(fe.current),m=se(t);if(y&&y!==m&&a.current){const b={};a.current.querySelectorAll('[data-type="variable"]').forEach(E=>{const _=E.dataset.key;if(_){const $=E.innerText.replace(/[\u200B\n]/g,"").trim();$&&(b[_]=$)}}),a.current.querySelectorAll('[data-type="select"]').forEach(E=>{const _=E.dataset.key;if(_){const $=E.value.trim();$&&(b[_]=$)}}),a.current.querySelectorAll('[data-type="textarea"]').forEach(E=>{const _=E.dataset.key;if(_){const $=E.value.replace(/[\u200B]/g,"").trim();$&&(b[_]=$)}}),H.current[y]={variableValues:b,files:{...te.current},multiVariableCounts:{...ae.current}}}if(m&&H.current[m]){const b=H.current[m];ie.current=b,s(b.files),N(b.multiVariableCounts)}else if(m){ie.current=null;const b={};t.forEach(A=>{A.type==="multi-variable"&&A.key&&(b[A.key]=1)}),N(b),s({})}else ie.current=null,N({}),s({});fe.current=t},[t,se]),c.useLayoutEffect(()=>{ie.current&&a.current&&(a.current.__tempVariableValues=ie.current.variableValues,setTimeout(()=>{ie.current&&(ie.current=null)},0))}),et(a,t,r,w,Z,U,void 0,n),tt(a,t,r,D),at(a,t,D,n),rt(a,t,r,D),nt(a,t,D),ot(a,t,r,M),lt(a,S),c.useEffect(()=>{if(t.length>0){Q(!1);return}const y=()=>{if(!a.current){Q(!0);return}const b=a.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",A=a.current.querySelectorAll('[data-type="variable"]'),k=a.current.querySelectorAll('[data-type="upload"]');let q=!1;A.forEach(_=>{(_.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(q=!0)}),k.forEach(_=>{_.querySelector(".upload-inner-wrapper.has-file")&&(q=!0)});const E=!b&&!q;Q(E),t.length===0&&M(!E)};y();const m=new MutationObserver(y);return a.current&&m.observe(a.current,{childList:!0,subtree:!0,characterData:!0}),()=>{m.disconnect()}},[t]);const Se=y=>{if(u){y.preventDefault();return}y.preventDefault();const m=y.clipboardData.getData("text/plain"),b=window.getSelection();if(b&&b.rangeCount>0){const A=b.anchorNode;if(A){let k=null;if(A.nodeType===Node.ELEMENT_NODE?k=A.closest('[data-type="variable"]'):A.nodeType===Node.TEXT_NODE&&A.parentElement&&(k=A.parentElement.closest('[data-type="variable"]')),k){const q=k.dataset.multiKey;if(q){const E=/[、,,\s\n\r\t]+/,_=m.split(E).map($=>$.trim()).filter($=>$.length>0);if(console.log("[Paste Event] 粘贴的内容:",m),console.log("[Paste Event] 拆分后的值:",_),_.length>1){const $=parseInt(k.dataset.index||"0",10),P=t.find(ee=>ee.type==="multi-variable"&&ee.key===q)?.maxCount||9,z=Z[q]||1,B=Math.min($+_.length,P);B>z&&N(K=>({...K,[q]:B}));const O=[];for(let K=0;K<z;K++){const ee=`${q}_${K}`,oe=a.current.querySelector(`[data-type="variable"][data-key="${ee}"][data-multi-key="${q}"]`);if(oe){const ue=oe.innerText.replace(/[\u200B\n]/g,"").trim();O.push(ue)}}O.splice($,1,..._.slice(0,P-$));const Y=O.slice(0,P);Y.length>0&&Y[Y.length-1]!==""&&Y.length<P&&Y.push("");const V=Math.max(Y.length,1),R={};Y.forEach((K,ee)=>{K&&(R[`${q}_${ee}`]=K)}),a.current.querySelectorAll('[data-type="variable"]').forEach(K=>{const ee=K.dataset.key,oe=K.dataset.multiKey;if(ee&&oe!==q){const ue=K.innerText.replace(/[\u200B\n]/g,"").trim();ue&&(R[ee]=ue)}}),a.current.__tempVariableValues=R,N(K=>({...K,[q]:V})),console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:",Y);return}else _.length===1&&console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分")}}}}document.execCommand("insertText",!1,m),ce(),setTimeout(()=>{const A=window.getSelection();if(A&&A.rangeCount>0){const k=A.anchorNode;if(k){let q=null;if(k.nodeType===Node.ELEMENT_NODE?q=k.closest('[data-type="variable"][data-multi-key]'):k.nodeType===Node.TEXT_NODE&&k.parentElement&&(q=k.parentElement.closest('[data-type="variable"][data-multi-key]')),q){const E=q.innerText.replace(/[\u200B\n]/g,"").trim();/[、,,\s]+/.test(E)&&(console.log("[Paste Event] 粘贴后检测到分隔符,内容:",E),console.log("[Paste Event] 提示:失去焦点后将自动拆分"))}}}},0)},$e=y=>{if(y.target.files&&y.target.files[0]&&f){const m=y.target.files[0],b=f;s(A=>({...A,[b]:m}))}y.target&&(y.target.value=""),v(null)},be=y=>{s(m=>{const b={...m};return delete b[y],b})},Ne=y=>{const m=y.target;if(m.closest(".tag-close-btn")){if(y.preventDefault(),y.stopPropagation(),w)return;D(null),T?T():a.current&&(a.current.innerHTML="",a.current.focus());return}if(w){const k=m.closest(".tag-node"),q=m.closest('[data-type="text"]');if(k||q){y.preventDefault(),y.stopPropagation();const E=window.getSelection();E&&E.removeAllRanges();return}}m.closest('[data-type="variable"]')||(G.current={x:y.clientX,y:y.clientY},S.current=!1,m.closest(".file-remove-btn")&&(y.preventDefault(),y.stopPropagation()))},ye=y=>{if(!y.target.closest('[data-type="variable"]')&&G.current){const A=Math.abs(y.clientX-G.current.x),k=Math.abs(y.clientY-G.current.y);(A>3||k>3)&&(S.current=!0)}},Ae=y=>{if(y.target.closest('[data-type="variable"]')){G.current=null,S.current=!1;return}G.current=null,S.current=!1},j=y=>{if(u)return;const m=y.target;if(m.closest('[data-type="datepicker"]'))return;if(m.closest(".tag-close-btn")){y.preventDefault(),y.stopPropagation();return}if(t.length===0)return;const k=(B,O)=>{if(!a.current)return;Array.from(a.current.children).forEach(V=>{if(V!==B)if(O)V.dataset.prevDisplay===void 0&&(V.dataset.prevDisplay=V.style.display||""),V.style.setProperty("display","none","important");else if(V.dataset.prevDisplay!==void 0){const R=V.dataset.prevDisplay;R?V.style.display=R:V.style.removeProperty("display"),delete V.dataset.prevDisplay}else V.style.removeProperty("display")})},q=m.closest(".rte-textarea-toggle");if(q){y.preventDefault(),y.stopPropagation();const B=q.closest(".rte-textarea-wrapper"),O=B?.querySelector('[data-type="textarea"]'),V=!(q.getAttribute("data-expanded")==="true");q.setAttribute("data-expanded",String(V)),q.textContent=V?"收起":"展开",B&&B.classList.toggle("rte-textarea-expanded",V);const R=B?.closest(".rte-textarea-required");if(R?R.classList.toggle("rte-textarea-overlay",V):B&&B.classList.toggle("rte-textarea-overlay",V),O)if(V)O.classList.add("rte-textarea-expanded"),O.style.maxHeight="none",O.style.height="100%";else{O.classList.remove("rte-textarea-expanded");const ne=O.dataset.maxHeight||"252";O.style.maxHeight=`${ne}px`,O.style.height="auto"}a.current&&(V?a.current.classList.add("rte-overlay-active"):a.current.classList.remove("rte-overlay-active"));return}const E=m.closest(".rte-richtext-toggle");if(E){y.preventDefault(),y.stopPropagation();const B=E.closest(".rte-richtext-wrapper"),O=B?.querySelector('[data-type="richtext"]'),V=!(E.getAttribute("data-expanded")==="true");((ee,oe)=>{ee.setAttribute("data-expanded",String(oe)),ee.innerHTML=oe?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})(E,V);const ne=B?.closest(".rte-richtext-required");ne?ne.classList.toggle("rte-richtext-expanded",V):B&&B.classList.toggle("rte-richtext-expanded",V);const K=B?.closest(".exclusion-wrapper")||B?.parentElement;O&&(V?(O.style.height="100%",O.style.overflow="auto"):(O.style.height="",O.style.overflow="")),K&&(K.classList.toggle("rte-richtext-host-expanded",V),k(K,V)),a.current&&a.current.classList.toggle("rte-richtext-fullscreen-active",V);return}if(m.closest('[data-type="text"]')){y.preventDefault(),y.stopPropagation();const B=window.getSelection();B&&B.removeAllRanges();return}if(w&&m.closest(".tag-node")){y.preventDefault(),y.stopPropagation();const O=window.getSelection();O&&O.removeAllRanges();return}if(m.closest('[data-type="variable"]')){if(S.current)return;setTimeout(()=>{const B=window.getSelection();B&&!B.isCollapsed||qe(a)},10);return}const P=m.closest(".file-remove-btn");if(P){y.preventDefault(),y.stopPropagation();const O=P.closest('[data-type="upload"]')?.dataset.key;O&&be(O);return}const z=m.closest('[data-type="upload"]');if(z){const B=z.dataset.key;B&&(v(B),o.current?.click());return}},re=y=>{const b=y.target.closest('[data-type="variable"]');if(b){const A=window.getSelection();if(A){const k=document.createRange(),q=b.textContent||"";if(q.replace(/\u200B/g,"")){let _=0,$=q.length;q.startsWith("​")&&(_=1),q.endsWith("​")&&q.length>1&&($=q.length-1);const P=b.firstChild;P&&P.nodeType===Node.TEXT_NODE?(k.setStart(P,_),k.setEnd(P,$)):k.selectNodeContents(b)}else k.selectNodeContents(b),k.collapse(!0);A.removeAllRanges(),A.addRange(k)}}},ce=()=>{if(t.length===0){if(a.current){const b=!(a.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");Q(b),M(!b)}return}if(qe(a),a.current&&a.current.querySelectorAll('[data-type="variable"]').forEach(b=>{const A=b.querySelector(".variable-info-icon");if(A){let k=!1;const q=document.createTreeWalker(b,NodeFilter.SHOW_TEXT,{acceptNode:E=>A.contains(E)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;q.nextNode();)if(q.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){k=!0;break}k?A.classList.add("hidden"):A.classList.remove("hidden")}}),he(a,t,r),ve(a,t,r,M),!a.current)return;t.filter(m=>m.type==="multi-variable"&&m.key).forEach(m=>{if(!m.key)return;const b=m.maxCount||9,A=Z[m.key]||1,k=[];for(let P=0;P<A;P++){const z=`${m.key}_${P}`,B=a.current.querySelector(`[data-type="variable"][data-key="${z}"][data-multi-key="${m.key}"]`);if(B){const O=B.innerText.replace(/[\u200B\n]/g,"").trim();k.push(O)}}const E=(k[k.length-1]||"")==="";let _=!1,$=-1;for(let P=0;P<k.length-1;P++)if(k[P]===""){_=!0,$=P;break}if(_&&$>=0){const P=window.getSelection();if(P&&P.rangeCount>0){const V=P.getRangeAt(0),R=V.startContainer,ne=R.nodeType===Node.ELEMENT_NODE?R.closest('[data-type="variable"][data-multi-key]'):R.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ne){const K=ne.dataset.key;if(K){const ee=document.createRange();ee.setStartBefore(ne),ee.setEnd(V.startContainer,V.startOffset);const oe=ee.toString().length;U.current={key:K,offset:oe}}}}const z=[...k];for(let V=$;V<z.length-1;V++)z[V]=z[V+1];z.pop();const B={};z.forEach((V,R)=>{V&&(B[`${m.key}_${R}`]=V)});const O=Math.max(E?z.length:z.length+1,1);a.current.querySelectorAll('[data-type="variable"]').forEach(V=>{const R=V.dataset.key,ne=V.dataset.multiKey;if(R&&ne!==m.key){const K=V.innerText.replace(/[\u200B\n]/g,"").trim();K&&(B[R]=K)}}),a.current.__tempVariableValues=B,N(V=>({...V,[m.key]:O}));return}if(!E){const P=A-1,z=`${m.key}_${P}`,B=a.current.querySelector(`[data-type="variable"][data-key="${z}"][data-multi-key="${m.key}"]`);if(B&&B.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&A<b){const Y=window.getSelection();if(Y&&Y.rangeCount>0){const V=Y.getRangeAt(0),R=V.startContainer,ne=R.nodeType===Node.ELEMENT_NODE?R.closest('[data-type="variable"][data-multi-key]'):R.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ne){const K=ne.dataset.key;if(K){const ee=document.createRange();ee.setStartBefore(ne),ee.setEnd(V.startContainer,V.startOffset);const oe=ee.toString().length;U.current={key:K,offset:oe}}}}N(V=>({...V,[m.key]:A+1}))}}})};c.useLayoutEffect(()=>{const y=a.current;if(!y)return;const m=new Map,b=q=>{const E=q.target,_=q.relatedTarget;!E||!a.current||!a.current.contains(E)||_&&a.current.contains(_)||setTimeout(()=>{if(a.current){if(t.length===0){const $=a.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";M($.length>0);return}qe(a),he(a,t,r),ve(a,t,r,M)}},0)};y.addEventListener("blur",b,!0);const A=()=>{if(!a.current)return;m.forEach((_,$)=>{$.removeEventListener("blur",_,!1)}),m.clear();const q=a.current.querySelectorAll('[data-type="variable"][data-multi-key]'),E=_=>{_.stopPropagation(),_.stopImmediatePropagation();const $=_.target;if(!$||!a.current||!a.current.contains($))return;const P=$.closest('[data-type="variable"][data-multi-key]');if(!P||!a.current.contains(P))return;let z=!1;if(m.forEach((ee,oe)=>{(oe===P||oe.contains($))&&(z=!0)}),!z)return;const B=P.dataset.multiKey,O=P.dataset.key,Y=P.dataset.index;if(!B||!O||Y===void 0)return;const V=_.relatedTarget;if(!(!V||!a.current.contains(V)))return;const ne=P.innerText.replace(/[\u200B\n]/g,"").trim();console.log("[Blur Event] 失去焦点的 multi-variable 输入框:",{multiKey:B,currentKey:O,index:Y,content:ne});const K=/[、,,\s]+/;if(K.test(ne)){const ee=ne.split(K).map(me=>me.trim()).filter(me=>me.length>0);console.log("[Blur Event] 拆分前的内容:",ne),console.log("[Blur Event] 拆分后的部分:",ee);const ue=ee.slice(0,9);if(console.log("[Blur Event] 有效的部分(最多9个):",ue),ue.length>1){const me=t.find(ke=>ke.type==="multi-variable"&&ke.key===B);if(me){const ke=Z[B]||1,Xe=parseInt(Y,10),Je=me.maxCount||9,we=[];for(let le=0;le<ke;le++){const ge=`${B}_${le}`,Ee=a.current.querySelector(`[data-type="variable"][data-key="${ge}"][data-multi-key="${B}"]`);if(Ee){const Ce=Ee.innerText.replace(/[\u200B\n]/g,"").trim();we.push(Ce)}}console.log("[Blur Event] 拆分前的所有值:",we),console.log("[Blur Event] 当前索引:",Xe),console.log("[Blur Event] 要插入的值:",ue),we.splice(Xe,1,...ue);const pe=we.slice(0,Je);console.log("[Blur Event] 拆分后的所有值:",pe),pe.length>0&&pe[pe.length-1]!==""&&pe.length<Je&&pe.push("");const yt=Math.max(pe.length,1),Le={};pe.forEach((le,ge)=>{le&&(Le[`${B}_${ge}`]=le)}),a.current.querySelectorAll('[data-type="variable"]').forEach(le=>{const ge=le.dataset.key,Ee=le.dataset.multiKey;if(ge&&Ee!==B){const Ce=le.innerText.replace(/[\u200B\n]/g,"").trim();Ce&&(Le[ge]=Ce)}}),a.current.__tempVariableValues=Le,N(le=>({...le,[B]:yt}))}}}};q.forEach(_=>{_.addEventListener("blur",E,!1),m.set(_,E)})},k=setTimeout(()=>{A()},0);return()=>{clearTimeout(k),y.removeEventListener("blur",b,!0),m.forEach((q,E)=>{E.removeEventListener("blur",q,!1)}),m.clear()}},[t,Z,r]);const xe=y=>{if(u){y.preventDefault();return}const m=window.getSelection();if(m&&m.rangeCount>0){const b=m.anchorNode;let A=null;if(b&&(b.nodeType===Node.ELEMENT_NODE?A=b.closest('[data-type="text"]'):b.nodeType===Node.TEXT_NODE&&b.parentElement&&(A=b.parentElement.closest('[data-type="text"]'))),A){if(y.preventDefault(),y.stopPropagation(),a.current){const k=a.current.querySelector('[data-type="variable"], [data-type="upload"]');k&&k.focus()}return}}if(w&&m&&m.rangeCount>0){const b=m.anchorNode;let A=null;if(b&&(b.nodeType===Node.ELEMENT_NODE?A=b.closest(".tag-node"):b.nodeType===Node.TEXT_NODE&&b.parentElement&&(A=b.parentElement.closest(".tag-node"))),A){if(y.preventDefault(),y.stopPropagation(),a.current){const k=a.current.querySelector('[data-type="variable"], [data-type="upload"]');k&&k.focus()}return}}if(y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),Ue()),y.key==="Escape"&&a.current){if(w){y.preventDefault();return}a.current.innerHTML="",a.current.focus()}if(y.key==="Backspace"){const b=window.getSelection();if(b&&b.rangeCount>0){const A=b.getRangeAt(0),k=b.anchorNode;if(w){let E=null,_=null;if(k&&(k.nodeType===Node.ELEMENT_NODE?(E=k.closest(".tag-node"),_=k.closest('[data-type="text"]')):k.nodeType===Node.TEXT_NODE&&k.parentElement&&(E=k.parentElement.closest(".tag-node"),_=k.parentElement.closest('[data-type="text"]'))),(E||_)&&A.collapsed&&A.startOffset===0){y.preventDefault();return}}let q=null;if(k&&(k.nodeType===Node.ELEMENT_NODE?q=k.closest('[data-type="variable"]'):k.nodeType===Node.TEXT_NODE&&k.parentElement&&(q=k.parentElement.closest('[data-type="variable"]'))),q){if(!A.collapsed)return;const E=q.innerText;if(E==="​"||E===""){y.preventDefault();return}if(A.startOffset===0){y.preventDefault();return}if(E.startsWith("​")&&A.startOffset===1){y.preventDefault();return}}}}},Ue=()=>{if(p||u||e||!F||!a.current)return;if(t.length===0){const q=a.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!q)return;g(q,q);return}const y=a.current;let m="";const b={},A=q=>{if(!(q.nodeType===Node.ELEMENT_NODE&&q.style.display==="none")){if(q.nodeType===Node.TEXT_NODE)m+=(q.textContent||"").replace(/\u200B/g,"");else if(q.nodeType===Node.ELEMENT_NODE){const E=q,_=E.dataset.type,$=E.dataset.key;if(_==="variable"&&$){let P="";const z=document.createTreeWalker(E,NodeFilter.SHOW_TEXT,{acceptNode:O=>{const Y=E.querySelector(".variable-info-icon");return Y&&Y.contains(O)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;z.nextNode();)P+=z.currentNode.textContent||"";const B=P.replace(/[\u200B\n]/g,"").trim();if(B){const O=E.dataset.multiKey;if(O){(!b[O]||!Array.isArray(b[O]))&&(b[O]=[]);const Y=b[O];Y.push(B),Y.length>1&&(m+=" "),m+=B}else b[$]=B,m+=B}}else if(_==="select"&&$){const P=E,z=(P.value||"").trim();if(z){b[$]=z;const B=P.selectedOptions?.[0];m+=B?.textContent||z}}else if(_==="textarea"&&$){const z=(E.value||"").replace(/\u200B/g,"").trim();z&&(b[$]=z,m+=z)}else if(_==="richtext"&&$){const z=(E.textContent||"").replace(/\u200B/g,"").trim();z&&(b[$]=z,m+=z)}else if(_==="datepicker"&&$){const z=(E.getAttribute("data-value")||"").trim();z&&(b[$]=z,m+=z)}else if(_==="upload"&&$)b[$]=r[$]??null,r[$]&&(m+=` [附带文件: ${r[$]?.name}] `);else{if(E.classList.contains("tag-close-btn")||E.classList.contains("file-remove-btn"))return;E.getAttribute("contenteditable")==="false"&&!_&&E.classList.contains("tag-node")?m+=E.innerText:E.childNodes.forEach(A)}}}};if(y.childNodes.forEach(A),m=m.trim(),!m)return;const k=new FormData;k.append("fullPrompt",m),Object.keys(b).forEach(q=>{const E=b[q];E!=null&&(E instanceof File?k.append(q,E):Array.isArray(E)?t.some($=>$.type==="multi-variable"&&$.key===q)?E.forEach($=>{$!=null&&$!==""&&k.append(q,String($))}):E.forEach(($,P)=>{$!=null&&($ instanceof File?k.append(`${q}[${P}]`,$):typeof $=="string"?k.append(`${q}[${P}]`,$):k.append(`${q}[${P}]`,String($)))}):typeof E=="string"?k.append(q,E):k.append(q,String(E)))}),g(k,m)},ft={...d?{width:typeof d=="number"?`${d}px`:d}:{},...h?{border:h}:{},...i?{background:i}:{}};return l.jsxs("div",{className:"rich-text-editor",style:ft,"data-disabled":u,children:[l.jsx("div",{ref:a,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${J&&L?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":L,onMouseDown:Ne,onMouseMove:ye,onMouseUp:Ae,onClick:j,onDoubleClick:re,onInput:ce,onKeyDown:xe,onPaste:Se}),l.jsx("input",{type:"file",ref:o,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:$e}),l.jsxs("div",{className:"rich-text-editor-footer",children:[l.jsx("div",{className:"rich-text-editor-footer-left",children:l.jsxs("div",{className:"rich-text-editor-brand",children:[l.jsxs("div",{className:"rte-brand-badge",children:[l.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),l.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),n!=="hideAgent"&&l.jsx(W.Dropdown,{placement:"top",menu:{items:I.map(y=>({key:y.key,label:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[y.icon&&l.jsx("i",{className:y.icon}),l.jsx("span",{children:y.label})]}),onClick:()=>{C?.(y)}}))},trigger:["click"],disabled:u||p,children:l.jsxs("div",{className:"rte-agent-badge",style:{cursor:I.length>0?"pointer":"default"},children:[l.jsx("i",{className:"iconfont icon-zhinengti"}),l.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(()=>{const y=t.find(b=>b.type==="tag");if(!y||!y.text)return null;const m=I.find(b=>b.label===y.text);return!m||m.points===void 0||m.points===null?null:l.jsxs("div",{className:"rte-points-badge",children:[l.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px"}}),l.jsxs("span",{style:{fontSize:"16px"},children:["-",String(m.points)]})]})})(),l.jsx("button",{type:"button",onClick:Ue,disabled:p||u||e||!F,className:"rich-text-editor-send-button",children:p||e?l.jsx("span",{className:"rte-send-spinner"}):l.jsx("i",{className:"iconfont icon-fasong"})})]})]}),x?.anchorEl&&(()=>{if(!document.body.contains(x.anchorEl))return null;let y="",m={background:"var(--neutral-800, #262626)"};if(x.type==="upload")y=t.find(k=>k.type==="upload"&&k.key===x.key)?.tooltip||"";else if(x.type==="tag")y=x.anchorEl.dataset.tooltip||"";else if(x.type==="upload-label")y=x.anchorEl.dataset.fileName||"";else if(x.type==="variable")y=x.anchorEl.dataset.tooltip||"";else if(x.type==="upload-preview"){const A=r[x.key];if(A&&A.type&&A.type.startsWith("image/")){const k=URL.createObjectURL(A);y=l.jsx("div",{style:{width:120,height:120,display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx("img",{src:k,style:{maxWidth:120,maxHeight:120,objectFit:"contain"}})}),m={background:"#fff",padding:4},setTimeout(()=>URL.revokeObjectURL(k),1e3)}else y=""}if(!y)return null;const b=x.type==="upload-preview"?"#0A0A0A":"#fff";return Qe.createPortal(l.jsx(W.Tooltip,{arrow:!1,title:l.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:b},children:y}),open:!0,placement:"top",getPopupContainer:()=>document.body,overlayInnerStyle:m,children:l.jsx("div",{style:{position:"fixed",left:`${x.anchorEl.getBoundingClientRect().left}px`,top:`${x.anchorEl.getBoundingClientRect().top}px`,width:`${x.anchorEl.offsetWidth}px`,height:`${x.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})()]})};Oe.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",st=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],it=({autoLoading:t,batchSize:g,loadingProgress:p,loadIcon:u,onBatchSizeChange:d,onLoadNextPage:w,onStartAutoLoad:I,onStopLoad:C})=>t&&p?l.jsxs("div",{className:"auto_load_progress",children:[u||l.jsx("img",{src:Fe,alt:"自动加载",width:14,height:14}),l.jsxs("span",{children:["正在加载第",p.currentPage,"/",p.totalPages,"页"]}),l.jsx(W.Progress,{percent:p.percentage,type:"line",size:[160,8]}),l.jsx("span",{onClick:C,className:"auto_load_stop_btn",children:"停止加载"})]}):l.jsxs("div",{className:"auto_load_container",children:[l.jsx("div",{onClick:w,className:"auto_load_next_btn",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:"加载下一页"}),l.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:[l.jsxs("div",{className:"auto_load_btn",onClick:t?void 0:I,children:[u||l.jsx("img",{src:Fe,alt:"自动加载",width:14,height:14}),l.jsx("span",{children:"自动加载"})]}),l.jsx(W.Select,{value:g,onChange:d,options:st,disabled:t,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),ct=({current:t,loadIcon:g,pageSize:p,total:u,cachedPages:d,loadedCount:w,autoLoading:I=!1,loadingProgress:C,onChange:T,onLoadNextPage:e,onStartAutoLoad:L,onStopLoading:h})=>{const[i,n]=c.useState(5),a=Math.ceil(u/p),o=c.useMemo(()=>d.length>=a,[d,a]),r=()=>Array.from({length:a},(v,x)=>x+1).filter(v=>!d.includes(v)).slice(0,i),s=(f,v,x)=>{const D=d.includes(f);return v==="prev"||v==="next"||v==="jump-prev"||v==="jump-next"?l.jsx("div",{className:"pageBox",children:x}):l.jsxs("div",{className:"pageBox",style:{backgroundColor:t===f?"#2563EB":"#f5f5f5",color:t===f?"#fff":D?"#171717":"#a3a3a3"},children:[f,!D&&l.jsx("span",{className:"unload_spot"})]})};return l.jsxs("div",{className:"pagination_footer",children:[l.jsxs("div",{className:"pagination_leftWrap",children:[l.jsxs("span",{className:"pagination_total",children:[l.jsx(de.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",w,"/",u,"条数据"]}),!o&&l.jsx(it,{loadIcon:g||void 0,autoLoading:I,batchSize:i,loadingProgress:C,disabled:!e||!L,onBatchSizeChange:n,onLoadNextPage:()=>e?.(),onStartAutoLoad:()=>{const f=r();L?.(f)},onStopLoad:()=>h?.()})]}),l.jsx(W.Pagination,{current:t,pageSize:p,total:u,onChange:f=>T(f),showSizeChanger:!1,showQuickJumper:!1,showTotal:(f,v)=>"",itemRender:s})]})},ze=t=>{const{loading:g,autoLoading:p,loadingProgress:u,columns:d=[],dataSource:w=[],total:I,current:C,pageSize:T,cachedPages:e,onChangePage:L,onLoadNextPage:h,onStartAutoLoad:i,onStopLoading:n,...a}=t,o=c.useRef(null),r=c.useCallback(s=>{L(s),e.includes(s)&&o.current?.scrollTo({key:`${(s-1)*T+1}`})},[C]);return l.jsxs("div",{className:"flex flex-col",children:[l.jsx(W.Table,{ref:o,...a,columns:d,dataSource:w,pagination:!1,virtual:!0}),l.jsx(ct,{loading:g,autoLoading:p,loadingProgress:u,current:C,pageSize:T,total:I,loadedCount:w.length,cachedPages:e,onChange:r,onLoadNextPage:h,onStartAutoLoad:i,onStopLoading:n})]})};ze.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const We=({texts:t=[],placeholder:g="请输入内容",animationSpeed:p=100,autoPlay:u=!0,value:d,onChange:w,...I})=>{const[C,T]=c.useState(""),[e,L]=c.useState(0),[h,i]=c.useState(!1),[n,a]=c.useState(!1),[o,r]=c.useState(!1),s=c.useRef(void 0),f=c.useRef(void 0),v=c.useRef(t),x=c.useRef(e),D=c.useRef(n),S=c.useRef(C);c.useEffect(()=>{v.current=t,x.current=e,D.current=n,S.current=C});const G=c.useCallback((N,H)=>{let te=0;r(!0);const ae=()=>{te<N.length?(T(N.slice(0,te+1)),te++,f.current=window.setTimeout(ae,p)):(r(!1),H?.())};ae()},[p]),F=c.useCallback(N=>{let H=S.current.length;const te=()=>{H>0?(T(S.current.slice(0,H-1)),H--,f.current=window.setTimeout(te,p/2)):N?.()};te()},[p]),M=c.useCallback(()=>{if(v.current.length===0||D.current)return;i(!0);const N=v.current[x.current];S.current?F(()=>{G(N,()=>{s.current=window.setTimeout(()=>{L(H=>(H+1)%v.current.length),i(!1)},2e3)})}):G(N,()=>{s.current=window.setTimeout(()=>{L(H=>(H+1)%v.current.length),i(!1)},2e3)})},[F,G]);c.useEffect(()=>(u&&t.length>0&&!n&&M(),()=>{s.current&&window.clearTimeout(s.current),f.current&&window.clearTimeout(f.current)}),[e,n,u,t.length,M]),c.useEffect(()=>{!h&&u&&t.length>0&&!n&&M()},[e,h,u,t.length,n,M]);const U=N=>{a(!0),s.current&&window.clearTimeout(s.current),f.current&&window.clearTimeout(f.current),i(!1),r(!1),I.onFocus?.(N)},J=N=>{a(!1),!d&&t.length>0&&(T(""),L(0)),I.onBlur?.(N)},Q=N=>{w?.(N.target.value),I.onChange?.(N)},Z=()=>n||d?g:C||g;return l.jsxs("div",{style:{position:"relative"},children:[l.jsx(W.Input,{...I,value:d,onChange:Q,onFocus:U,onBlur:J,placeholder:Z(),style:{...I.style,position:"relative",zIndex:1}}),!n&&!d&&C&&l.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[l.jsx("span",{children:C}),o&&l.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),l.jsx("style",{children:`
1
+ (function(ae,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom"],s):(ae=typeof globalThis<"u"?globalThis:ae||self,s(ae.SealSeekBIComponents={},ae.React,ae.React,ae.antd,ae.AntdIcons,ae.ReactDOM))})(this,function(ae,s,c,R,xe,Be){"use strict";const Pe=({variant:t="primary",loading:w=!1,children:f,...i})=>{const p=T=>{switch(T){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return s.jsx(R.Button,{...i,type:p(t),loading:w,ghost:t==="ghost",children:f})};Pe.__docgenInfo={displayName:"Button",description:"基础按钮,用于触发操作",props:{variant:{name:"variant",required:!1,description:"视觉风格",type:{name:"ButtonVariant",raw:'"primary" | "ghost" | "dashed" | "link" | "text"'},defaultValue:{value:'"primary"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: MouseEvent) => void"}}}};const Oe=({title:t,children:w,bordered:f=!0,hoverable:i=!1,size:p="default",...T})=>s.jsx(R.Card,{...T,title:t,bordered:f,hoverable:i,size:p,children:w});Oe.__docgenInfo={displayName:"Card",description:"卡片容器,用于分组内容",props:{title:{name:"title",required:!1,description:"标题",type:{name:"ReactNode",raw:"React.ReactNode"}},children:{name:"children",required:!1,description:"内容区域",type:{name:"ReactNode",raw:"React.ReactNode"}},bordered:{name:"bordered",required:!1,description:"是否显示边框",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},hoverable:{name:"hoverable",required:!1,description:"是否可悬停",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},size:{name:"size",required:!1,description:"卡片大小",type:{name:"CardSize",raw:'"default" | "small"'},defaultValue:{value:'"default"'}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},actions:{name:"actions",required:!1,description:"卡片操作组",type:{name:"ReactNode[]",raw:"React.ReactNode[]"}}}};const Ge=({showDefaultFooter:t=!0,...w})=>{const f=w.footer!==void 0?w.footer:t?(i,{OkBtn:p,CancelBtn:T})=>s.jsxs(s.Fragment,{children:[s.jsx(p,{}),s.jsx(T,{})]}):null;return s.jsx(R.Modal,{...w,footer:f})};Ge.__docgenInfo={displayName:"AppModal",description:"应用级模态框组件,基于 Ant Design Modal 封装",props:{showDefaultFooter:{name:"showDefaultFooter",required:!1,description:"是否显示默认的确定和取消按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},title:{name:"title",required:!1,description:"模态框标题",type:{name:"ReactNode",raw:"React.ReactNode"}},open:{name:"open",required:!1,description:"是否显示模态框",type:{name:"boolean",raw:"boolean"}},onCancel:{name:"onCancel",required:!1,description:"取消按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},onOk:{name:"onOk",required:!1,description:"确定按钮点击事件",type:{name:"function",raw:"(e: React.MouseEvent<HTMLElement>) => void"}},children:{name:"children",required:!1,description:"模态框内容",type:{name:"ReactNode",raw:"React.ReactNode"}},width:{name:"width",required:!1,description:"模态框宽度",type:{name:"string | number",raw:"string | number"}},centered:{name:"centered",required:!1,description:"是否居中显示",type:{name:"boolean",raw:"boolean"}},maskClosable:{name:"maskClosable",required:!1,description:"点击蒙层是否允许关闭",type:{name:"boolean",raw:"boolean"}}}};const He=({scrollX:t,showPagination:w=!0,defaultPageSize:f=10,...i})=>s.jsx(R.Table,{...i,scroll:{x:t||"max-content",y:"50vh"},pagination:w?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:f,...i.pagination}:!1});He.__docgenInfo={displayName:"PageTable",description:"页面级表格组件,高度铺满容器,自动滚动",props:{scrollX:{name:"scrollX",required:!1,description:"水平滚动宽度",type:{name:"number",raw:"number"}},showPagination:{name:"showPagination",required:!1,description:"是否显示分页器",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},columns:{name:"columns",required:!1,description:"表格列配置",type:{name:"ColumnType[]",raw:"ColumnType<any>[]"}},dataSource:{name:"dataSource",required:!1,description:"数据源",type:{name:"any[]",raw:"any[]"}},loading:{name:"loading",required:!1,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},rowKey:{name:"rowKey",required:!1,description:"行数据的 Key",type:{name:"string | function",raw:"string | ((record: any) => string)"}}}};const nt=xe.createFromIconfontCN({scriptUrl:["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]}),Fe=({name:t,size:w,color:f,style:i,...p})=>{const T={fontSize:w,color:f,...i};return s.jsx(nt,{...p,type:t,style:T})};Fe.__docgenInfo={displayName:"XcIcon",description:"自定义图标组件,基于 iconfont",props:{name:{name:"name",required:!0,description:"图标名称",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"图标大小",type:{name:"number | string",raw:"number | string"}},color:{name:"color",required:!1,description:"图标颜色",type:{name:"string",raw:"string"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const ze=({loading:t,description:w="暂无数据",className:f,emptyChildren:i,loadingText:p,emptyImage:T})=>t?s.jsxs(R.Flex,{className:`pt-10 w-full ${f||""}`,align:"center",justify:"center",vertical:!0,children:[s.jsx(R.Spin,{size:"large"}),p&&s.jsx("div",{className:"mt-4 text-gray-500",children:p})]}):s.jsx(R.Flex,{className:`pt-10 w-full ${f||""}`,align:"center",justify:"center",children:s.jsx(R.Empty,{image:T,description:w,imageStyle:{height:180},children:i})});ze.__docgenInfo={displayName:"EmptyAndSpin",description:"空状态和加载状态组合组件",props:{loading:{name:"loading",required:!0,description:"是否加载中",type:{name:"boolean",raw:"boolean"}},description:{name:"description",required:!1,description:"空状态描述",type:{name:"ReactNode",raw:"React.ReactNode"},defaultValue:{value:'"暂无数据"'}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},emptyChildren:{name:"emptyChildren",required:!1,description:"空状态额外内容",type:{name:"ReactNode",raw:"React.ReactNode"}},loadingText:{name:"loadingText",required:!1,description:"加载中提示文字",type:{name:"string",raw:"string"}},emptyImage:{name:"emptyImage",required:!1,description:"空状态图片",type:{name:"string",raw:"string"}}}};const We=({onClick:t,showText:w=!1,className:f,size:i="small",type:p="default"})=>s.jsx(R.Button,{size:i,type:p,icon:s.jsx(xe.LeftOutlined,{}),className:`cursor-pointer ${f||""}`,onClick:t,children:w&&"返回"});We.__docgenInfo={displayName:"BackButton",description:"返回按钮组件",props:{onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"() => void"}},showText:{name:"showText",required:!1,description:"是否显示文字",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},size:{name:"size",required:!1,description:"按钮大小",type:{name:"ButtonSize",raw:'"small" | "middle" | "large"'},defaultValue:{value:'"small"'}},type:{name:"type",required:!1,description:"按钮类型",type:{name:"ButtonType",raw:'"primary" | "default" | "dashed" | "link" | "text"'},defaultValue:{value:'"default"'}}}};const je=({removePadding:t=!0,className:w,...f})=>{const i=t?`px-0 h-auto ${w||""}`:w;return s.jsx(R.Button,{type:"link",...f,className:i,children:f.children})};je.__docgenInfo={displayName:"LinkButton",description:"链接样式按钮组件,适用于表格操作列",props:{removePadding:{name:"removePadding",required:!1,description:"是否去除默认内边距",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},children:{name:"children",required:!1,description:"按钮内容",type:{name:"ReactNode",raw:"React.ReactNode"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLButtonElement>) => void"}},disabled:{name:"disabled",required:!1,description:"是否禁用",type:{name:"boolean",raw:"boolean"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}}}};const{Option:at}=R.Select,Ue=({columns:t,request:w,searchFields:f=[],showSearch:i=!0,showRefresh:p=!0,defaultPageSize:T=10,pageSizeOptions:M=["10","20","50","100"],autoLoad:C=!0,externalParams:$={},...e})=>{const[q,m]=c.useState([]),[l,r]=c.useState(!1),[n,o]=c.useState({current:1,pageSize:T,total:0}),[a,y]=c.useState({}),[h,b]=c.useState({}),[k]=R.Form.useForm(),B=c.useRef(n);B.current=n;const E=c.useRef($);E.current=$;const O=c.useRef(!1),z=c.useMemo(()=>t.map(u=>{const{sortable:d,render:x,...I}=u;return{...I,sorter:d?!0:void 0,render:x||(N=>N)}}),[t]),W=c.useCallback(async(u={})=>{if(w){r(!0);try{const d={page:B.current.current,pageSize:B.current.pageSize,sortField:h.field,sortOrder:h.order,searchParams:{...a,...E.current},...u},x=await w(d);x.success&&(m(x.data),o(I=>({...I,total:x.total,current:d.page||I.current})))}catch(d){console.error("加载数据失败:",d)}finally{r(!1)}}},[w,h,a]),Y=c.useCallback(u=>{y(u),o(d=>({...d,current:1}))},[]),H=c.useCallback(()=>{k.resetFields(),y({}),o(u=>({...u,current:1}))},[k]),Z=c.useCallback(()=>{W()},[W]),ne=c.useCallback((u,d,x)=>{const I={current:u.current||1,pageSize:u.pageSize||T,total:u.total||0},N={field:x?.field,order:x?.order};o(I),b(N)},[T]);return c.useEffect(()=>{const u=Object.keys($).length>0;(C&&!O.current||u)&&(W(),O.current=!0)},[C,$,W]),s.jsxs("div",{children:[i&&f.length>0&&s.jsx(R.Card,{size:"small",style:{marginBottom:16},children:s.jsxs(R.Form,{form:k,layout:"inline",onFinish:Y,initialValues:f.reduce((u,d)=>(d.defaultValue!==void 0&&(u[d.key]=d.defaultValue),u),{}),children:[f.map(u=>s.jsx(R.Form.Item,{name:u.key,label:u.label,children:u.type==="input"?s.jsx(R.Input,{placeholder:u.placeholder||`请输入${u.label}`,style:{width:200}}):s.jsx(R.Select,{placeholder:u.placeholder||`请选择${u.label}`,style:{width:200},allowClear:!0,children:u.options?.map(d=>s.jsx(at,{value:d.value,children:d.label},d.value))})},u.key)),s.jsx(R.Form.Item,{children:s.jsxs(R.Space,{children:[s.jsx(R.Button,{type:"primary",htmlType:"submit",icon:s.jsx(xe.SearchOutlined,{}),children:"查询"}),s.jsx(R.Button,{onClick:H,children:"重置"}),p&&s.jsx(R.Button,{icon:s.jsx(xe.ReloadOutlined,{}),onClick:Z,children:"刷新"})]})})]})}),s.jsx(R.Table,{...e,columns:z,dataSource:q,loading:l,pagination:{...n,showSizeChanger:!0,showQuickJumper:!0,showTotal:(u,d)=>`第 ${d[0]}-${d[1]} 条/共 ${u} 条`,pageSizeOptions:M},onChange:ne,scroll:{x:"max-content",y:"50vh"}})]})};Ue.__docgenInfo={displayName:"AdvancedTable",description:"高阶表格组件,支持异步请求、搜索、排序等功能",props:{columns:{name:"columns",required:!0,description:"列配置",type:{name:"AdvancedColumnType[]",raw:"AdvancedColumnType<any>[]"}},request:{name:"request",required:!1,description:"异步请求函数",type:{name:"function",raw:"(params: RequestParams) => Promise<RequestResponse>"}},searchFields:{name:"searchFields",required:!1,description:"搜索字段配置",type:{name:"SearchFieldConfig[]",raw:"SearchFieldConfig[]"},defaultValue:{value:"[]"}},showSearch:{name:"showSearch",required:!1,description:"是否显示搜索区域",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},showRefresh:{name:"showRefresh",required:!1,description:"是否显示刷新按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},defaultPageSize:{name:"defaultPageSize",required:!1,description:"默认页面大小",type:{name:"number",raw:"number"},defaultValue:{value:"10"}},pageSizeOptions:{name:"pageSizeOptions",required:!1,description:"页面大小选项",type:{name:"string[]",raw:"string[]"},defaultValue:{value:'["10", "20", "50", "100"]'}},autoLoad:{name:"autoLoad",required:!1,description:"是否自动加载",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},externalParams:{name:"externalParams",required:!1,description:"外部请求参数",type:{name:"Record<string, any>",raw:"Record<string, any>"},defaultValue:{value:"{}"}}}};function Le(t,w,f){if(!t.current)return;const i=new Set,p={};for(const m of w)m.exclusionGroup&&m.exclusionGroup!=="separator"&&(i.add(m.exclusionGroup),p[m.exclusionGroup]||(p[m.exclusionGroup]=[]),p[m.exclusionGroup].push({type:m.type,key:m.key,exclusionGroup:m.exclusionGroup}));const T={};for(const m of i){T[m]=!1;for(const l of p[m])if(l.type==="upload"&&l.key){if(f[l.key]!==null&&f[l.key]!==void 0){T[m]=!0;break}}else if(l.type==="variable"&&l.key){const r=t.current.querySelector(`[data-type="variable"][data-key="${l.key}"]`);if(r&&r.innerText.replace(/[\u200B\n]/g,"").trim().length>0){T[m]=!0;break}}}const M=w.some(m=>m.exclusionGroup==="separator"),$=Object.keys(T).filter(m=>T[m]).length>0;let e=null;if($&&M){for(const m of w)if(m.exclusionGroup&&m.exclusionGroup!=="separator"&&T[m.exclusionGroup]){e=m.exclusionGroup;break}}for(const m of i){const l=t.current.querySelectorAll(`[data-group="${m}"]`);M&&$&&e?m===e?l.forEach(r=>{r.classList.contains("required-upload-group")?r.style.setProperty("display","inline-flex","important"):(r.classList.contains("exclusion-wrapper"),r.style.setProperty("display","inline-block","important"))}):l.forEach(r=>{r.style.display="none",r.style.setProperty("display","none","important")}):l.forEach(r=>{r.classList.contains("required-upload-group")?r.style.setProperty("display","inline-flex","important"):(r.classList.contains("exclusion-wrapper"),r.style.setProperty("display","inline-block","important"))})}t.current.querySelectorAll('[data-group="separator"]').forEach(m=>{m.style.display=$?"none":"inline"})}function Ie(t,w,f,i){if(!t.current){i(!1);return}const p=[];for(let l=0;l<w.length;l++){const r=w[l];if((r.type==="variable"||r.type==="upload"||r.type==="multi-variable"||r.type==="select"||r.type==="textarea"||r.type==="richtext"||r.type==="datepicker")&&r.required&&r.key){p.push({exclusionGroup:r.exclusionGroup||"",key:r.key,type:r.type==="multi-variable"?"variable":r.type,isMultiVariable:r.type==="multi-variable",minCount:r.type==="multi-variable"?r.minCount:void 0,__index:l});continue}if(r.type==="text"&&r.className?.includes("rte-text-required"))if(r.exclusionGroup)for(let n=l+1;n<w.length;n++){const o=w[n];if(o.exclusionGroup===r.exclusionGroup&&(o.type==="variable"||o.type==="upload"||o.type==="select"||o.type==="textarea"||o.type==="richtext"||o.type==="datepicker")&&o.key){p.push({exclusionGroup:r.exclusionGroup,key:o.key,type:o.type,__index:n});break}}else for(let n=l+1;n<w.length;n++){const o=w[n];if((o.type==="variable"||o.type==="upload"||o.type==="select"||o.type==="textarea"||o.type==="richtext"||o.type==="datepicker")&&o.key){p.push({exclusionGroup:o.exclusionGroup||"",key:o.key,type:o.type,__index:n});break}}}const T=w.some(l=>l.exclusionGroup==="separator"),M=[];if(T&&p.length>1){const l=[];w.forEach((r,n)=>{r.exclusionGroup==="separator"&&l.push(n)});for(const r of l){const o=p.filter(h=>typeof h.__index=="number"&&h.__index<r).sort((h,b)=>(b.__index??0)-(h.__index??0))[0],y=p.filter(h=>typeof h.__index=="number"&&h.__index>r).sort((h,b)=>(h.__index??0)-(b.__index??0))[0];o&&y&&M.push([o,y])}}if(p.length===0){if(w.length===0){if(!t.current){i(!1);return}const l=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";i(l.length>0);return}i(!0);return}const C=p.filter(l=>{if(!t.current)return!1;if(l.exclusionGroup){const r=t.current.querySelectorAll(`[data-group="${l.exclusionGroup}"]`);if(r.length>0)return r[0].style.display!=="none"}if(l.type==="upload"&&l.key){const r=t.current.querySelector(`[data-type="upload"][data-key="${l.key}"]`);if(r){const n=r.closest("[data-group]")||r.parentElement;return n?n.style.display!=="none":!0}}else if(l.type==="variable"&&l.key)if(l.isMultiVariable){const r=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${l.key}"]`);if(r.length>0){const n=r[0],o=n.closest("[data-group]")||n.parentElement;return o?o.style.display!=="none":!0}}else{const r=t.current.querySelector(`[data-type="variable"][data-key="${l.key}"]`);if(r){const n=r.closest("[data-group]")||r.parentElement;return n?n.style.display!=="none":!0}}else if(l.type==="select"&&l.key){const r=t.current.querySelector(`[data-type="select"][data-key="${l.key}"]`);if(r){const n=r.closest("[data-group]")||r.parentElement;return n?n.style.display!=="none":!0}}else if(l.type==="textarea"&&l.key){const r=t.current.querySelector(`[data-type="textarea"][data-key="${l.key}"]`);if(r){const n=r.closest("[data-group]")||r.parentElement;return n?n.style.display!=="none":!0}}else if(l.type==="richtext"&&l.key){const r=t.current.querySelector(`[data-type="richtext"][data-key="${l.key}"]`);if(r){const n=r.closest("[data-group]")||r.parentElement;return n?n.style.display!=="none":!0}}else if(l.type==="datepicker"&&l.key){const r=t.current.querySelector(`[data-type="datepicker"][data-key="${l.key}"]`);if(r){const n=r.closest("[data-group]")||r.parentElement;return n?n.style.display!=="none":!0}}return!1});if(C.length===0){i(!0);return}const $=new Set;M.forEach(l=>{l.forEach(r=>{r.key&&$.add(r.key)})});const e=C.filter(l=>!l.key||!$.has(l.key));let q=(M.length===0,!0);for(const l of M){const r=l.filter(o=>{if(!t.current)return!1;if(o.exclusionGroup){const a=t.current.querySelectorAll(`[data-group="${o.exclusionGroup}"]`);if(a.length>0)return a[0].style.display!=="none"}return!0});if(r.length===0)continue;let n=!1;for(const o of r)if(o.type==="upload"&&o.key){if(f[o.key]!==null&&f[o.key]!==void 0){n=!0;break}}else if(o.type==="variable"&&o.key)if(o.isMultiVariable){const a=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${o.key}"]`);let y=0;for(const b of Array.from(a)){if(b.classList.contains("show-placeholder"))continue;b.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(y+=1)}const h=o.minCount&&o.minCount>0?o.minCount:1;if(y>=h){n=!0;break}}else{const a=t.current.querySelector(`[data-type="variable"][data-key="${o.key}"]`);if(a){if(a.classList.contains("show-placeholder"))continue;if(a.innerText.replace(/[\u200B\n]/g,"").trim().length>0){n=!0;break}}}else if(o.type==="select"&&o.key){const a=t.current.querySelector(`[data-type="select"][data-key="${o.key}"]`);if(a&&(a.value||"").trim().length>0){n=!0;break}}else if(o.type==="textarea"&&o.key){const a=t.current.querySelector(`[data-type="textarea"][data-key="${o.key}"]`);if(a&&(a.value||"").trim().length>0){n=!0;break}}else if(o.type==="richtext"&&o.key){const a=t.current.querySelector(`[data-type="richtext"][data-key="${o.key}"]`);if(a&&(a.textContent||"").replace(/[\u200B]/g,"").trim().length>0){n=!0;break}}else if(o.type==="datepicker"&&o.key){const a=t.current.querySelector(`[data-type="datepicker"][data-key="${o.key}"]`);if(a&&(a.getAttribute("data-value")||"").trim().length>0){n=!0;break}}if(!n){q=!1;break}}let m=!0;for(const l of e)if(l.type==="upload"&&l.key){if(f[l.key]===null||f[l.key]===void 0){m=!1;break}}else if(l.type==="variable"&&l.key)if(l.isMultiVariable){const r=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${l.key}"]`);let n=0;for(const a of Array.from(r)){if(a.classList.contains("show-placeholder"))continue;a.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(n+=1)}const o=l.minCount&&l.minCount>0?l.minCount:1;if(n<o){m=!1;break}}else{const r=t.current.querySelector(`[data-type="variable"][data-key="${l.key}"]`);if(!r){m=!1;break}if(r.classList.contains("show-placeholder")){m=!1;break}if(r.innerText.replace(/[\u200B\n]/g,"").trim().length===0){m=!1;break}}else if(l.type==="select"&&l.key){const r=t.current.querySelector(`[data-type="select"][data-key="${l.key}"]`);if(!r||(r.value||"").trim().length===0){m=!1;break}}else if(l.type==="textarea"&&l.key){const r=t.current.querySelector(`[data-type="textarea"][data-key="${l.key}"]`);if(!r||(r.value||"").trim().length===0){m=!1;break}}else if(l.type==="richtext"&&l.key){const r=t.current.querySelector(`[data-type="richtext"][data-key="${l.key}"]`);if(!r||(r.textContent||"").replace(/[\u200B]/g,"").trim().length===0){m=!1;break}}else if(l.type==="datepicker"&&l.key){const r=t.current.querySelector(`[data-type="datepicker"][data-key="${l.key}"]`);if(!r||(r.getAttribute("data-value")||"").trim().length===0){m=!1;break}}i(q&&m)}function _e(t,w){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(i=>{const p=i.innerText.replace(/\n/g,"");p.replace(/\u200B/g,"")?i.classList.remove("show-placeholder"):(p!=="​"&&(i.innerText="​"),i.classList.add("show-placeholder"))})}function rt(t,w,f,i,p,T={},M){if(!t.current)return;let C="",$=0;for(;$<w.length;){const e=w[$],q=$+1<w.length?w[$+1]:null;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&q){const a=q.type==="upload"&&q.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===q.exclusionGroup,y=q.type==="variable"&&q.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===q.exclusionGroup;if(a){const b=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,k="</span>";let B="";e.className?B=`<span class="${e.className}">${e.text??""}</span>`:B=e.text??"";const E=q,O=f[E.key]!==null&&f[E.key]!==void 0,z=O?f[E.key]:null,W=O?f[E.key]?.name:E.text,Y=O?"":"hidden",H=E.tooltip&&!O?"":"hidden",Z=O?"has-file":"",ne=O&&W?` data-file-name="${W.replace(/"/g,"&quot;")}"`:"";let u="";O&&z&&(z.type?.startsWith("image/")?u=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(z)}" alt="preview" />`:u="<i class='iconfont icon-exlwenjian'></i>");const d=`<span contenteditable="false" data-type="upload" data-key="${E.key}" class="upload-chip"><span class="upload-inner-wrapper ${Z}"><span class="upload-icon">${u}</span><span class="upload-label"${ne}>${W||E.text}</span>${E.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${H}" data-upload-key="${E.key}" data-tooltip="${E.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${Y}" title="移除文件">×</span></span></span>`;C+=b+B+d+k,$+=2;continue}if(y){const b=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,k="</span>";let B="";e.className?B=`<span class="${e.className}">${e.text??""}</span>`:B=e.text??"";const E=q,z=(E.key?p[E.key]:void 0)||E.text||"",W=!z,Y=W?"​":z,H=W?"show-placeholder":"",Z=E.exclusionGroup?` data-group="${E.exclusionGroup}"`:"",ne=E.tooltip?` data-tooltip="${E.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${E.key||""}"`:"",u=E.tooltip&&W?"":"hidden",d=`<span contenteditable="true" data-type="variable" data-key="${E.key}" data-placeholder="${E.placeholder||""}"${Z}${ne} class="variable-chip ${H}">${Y}${E.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${u}" data-variable-key="${E.key}" data-tooltip="${E.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;C+=b+B+d+k,$+=2;continue}}const l=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",r=e.exclusionGroup?`<span ${l} class="exclusion-wrapper">`:"",n=e.exclusionGroup?"</span>":"";let o="";if(e.type==="tag"){const y=i||M==="hideTagClose"?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',h=i?' data-locked="true"':"",b=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-tag-key="${e.key||""}"`:"";o=`<span contenteditable="false" class="tag-node group"${h}${b}><span class="tag-label">${e.text}</span>${y}</span>`}else if(e.type==="text"){const a=i?' data-locked="true" contenteditable="false"':' contenteditable="false"',h=(e.text??"").replace(/\n/g,"<br/>");e.className?o=`<span class="${e.className}"${a}>${h}</span>`:o=i?`<span${a}>${h}</span>`:`<span contenteditable="false">${h}</span>`}else if(e.type==="variable"&&e.key){const y=p[e.key]||e.text||"",h=!y,b=h?"​":y,k=h?"show-placeholder":"",B=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",E=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",O=e.tooltip&&h?"":"hidden",z=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${B}${E} class="variable-chip ${k}">${b}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${O}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${z}</span>`:o=z}else if(e.type==="upload"&&e.key){const a=f[e.key]!==null&&f[e.key]!==void 0,y=a?f[e.key]:null,h=a?f[e.key]?.name:e.text,b=a?"":"hidden",k=e.tooltip&&!a?"":"hidden",B=a?"has-file":"",E=a&&h?` data-file-name="${h.replace(/"/g,"&quot;")}"`:"";let O="";a&&y&&(y.type?.startsWith("image/")?O=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(y)}" alt="preview" />`:O="<i class='iconfont icon-exlwenjian'></i>");const z=`<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${B}"><span class="upload-icon">${O}</span><span class="upload-label"${E}>${h||e.text}</span>${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${k}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>`:""}<span class="file-remove-btn ${b}" title="移除文件">×</span></span></span>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${z}</span>`:o=z}else if(e.type==="select"&&e.key){const a=p[e.key]||e.defaultValue||"",y=(e.options||[]).map(k=>{const B=a===k.value?"selected":"";return`<option value="${k.value}" ${B}>${k.label}</option>`}).join(""),h=e.placeholder?`<option value="" ${a?"":"selected"} disabled hidden>${e.placeholder}</option>`:"",b=`<select data-type="select" data-key="${e.key}" class="rte-select">${h}${y}</select>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${b}</span>`:o=b}else if(e.type==="textarea"&&e.key){const a=p[e.key]||"",y=e.maxHeight||252,h=e.expandable!==!1,b=e.placeholder?` placeholder="${e.placeholder}"`:"",k=`<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${y}" style="max-height:${y}px;"${b}>${a}</textarea>`,B=h?`<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>`:"",E=`<div class="rte-textarea-wrapper" data-key="${e.key}">${k}${B}</div>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${E}</span>`:o=E}else if(e.type==="richtext"&&e.key){const a=p[e.key]||e.text||"",y=e.minHeight||140,h=e.placeholder?` data-placeholder="${e.placeholder}"`:"",b=e.expandable!==!1,k=a,B=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${h} style="min-height:${y}px;">${k}</div>`,E=b?`<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false">展开</button>`:"",O=`<div class="rte-richtext-wrapper" data-key="${e.key}">${B}${E}</div>`,z=`<div class="rte-richtext-container" data-key="${e.key}">${O}</div>`;e.required?o=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group rte-richtext-required"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${z}</div>`:o=z}else if(e.type==="datepicker"&&e.key){const a=p[e.key]||"",y=e.placeholder?` data-placeholder="${e.placeholder}"`:"",h=e.limitRange?` data-limit-range="${e.limitRange}"`:"",b=e.disableFuture?' data-disable-future="true"':"",k=`<div data-type="datepicker" data-key="${e.key}" data-value="${a}" class="rte-datepicker-host"${y}${h}${b}></div>`;e.required?o=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${k}</span>`:o=k}else if(e.type==="multi-variable"&&e.key){const a=e.maxCount||9,y=T[e.key]||1,h=Math.min(y,a);if(e.required){const b=`<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`,k=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"";let B="";for(let E=0;E<h;E++){const O=`${e.key}_${E}`,z=p[O]||"",W=!z,Y=W?"​":z,H=W?"show-placeholder":"",Z=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",ne=e.tooltip&&W?"":"hidden",u=`<span contenteditable="true" data-type="variable" data-key="${O}" data-multi-key="${e.key}" data-index="${E}" data-placeholder="${e.placeholder||""}"${Z} class="variable-chip ${H}">${Y}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${ne}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;E===0?B+=`<span ${k} class="exclusion-wrapper required-upload-group required-multi-first">${b}${u}</span>`:B+=u}o=B}else{let b="";for(let k=0;k<h;k++){const B=`${e.key}_${k}`,E=p[B]||"",O=!E,z=O?"​":E,W=O?"show-placeholder":"",Y=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" data-variable-key="${e.key||""}"`:"",H=e.tooltip&&O?"":"hidden",Z=`<span contenteditable="true" data-type="variable" data-key="${B}" data-multi-key="${e.key}" data-index="${k}" data-placeholder="${e.placeholder||""}"${Y} class="variable-chip ${W}">${z}${e.tooltip?`<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,"&quot;")}" title="提示"></i>`:""}</span>`;b+=Z}o=b}}C+=r+o+n,$++}t.current&&(t.current.innerHTML=C,setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(q=>{const m=q.innerText.replace(/\n/g,"");m.replace(/\u200B/g,"")?q.classList.remove("show-placeholder"):(m!=="​"&&(q.innerText="​"),q.classList.add("show-placeholder"))})},0))}function ot(t,w,f,i,p={},T,M,C){const $=c.useCallback(()=>{if(!t.current)return;if(w.length===0){t.current.innerHTML="";return}let e={};const m=t.current.__tempVariableValues;if(m?(e=m,setTimeout(()=>{if(t.current){const l=t.current;l.__tempVariableValues===m&&delete l.__tempVariableValues}},100)):(t.current.querySelectorAll('[data-type="variable"]').forEach(y=>{const h=y.dataset.key;if(h){const b=y.innerText.replace(/[\u200B\n]/g,"").trim();b&&(e[h]=b)}}),t.current.querySelectorAll('[data-type="select"]').forEach(y=>{const h=y.dataset.key;if(h){const b=y.value.trim();b&&(e[h]=b)}}),t.current.querySelectorAll('[data-type="textarea"]').forEach(y=>{const h=y.dataset.key;if(h){const b=y.value.replace(/[\u200B]/g,"").trim();b&&(e[h]=b)}}),t.current.querySelectorAll('[data-type="richtext"]').forEach(y=>{const h=y.dataset.key;if(h){const b=(y.textContent||"").replace(/[\u200B]/g,"").trim();b&&(e[h]=b)}}),t.current.querySelectorAll('[data-type="datepicker"]').forEach(y=>{const h=y.dataset.key;if(h){const b=(y.getAttribute("data-value")||"").trim();b&&(e[h]=b)}})),rt(t,w,f,i,e,p,C),T?.current){const{key:l,offset:r}=T.current;setTimeout(()=>{if(!t.current)return;const n=t.current.querySelector(`[data-type="variable"][data-key="${l}"]`);if(n){try{const o=document.createRange(),a=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let y=0,h=null,b=0;for(;a.nextNode();){const k=a.currentNode,B=k.textContent?.length||0;if(y+B>=r){h=k,b=r-y;break}y+=B}if(h){o.setStart(h,Math.min(b,h.textContent?.length||0)),o.collapse(!0);const k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(o),n.focus())}else{o.selectNodeContents(n),o.collapse(!1);const k=window.getSelection();k&&(k.removeAllRanges(),k.addRange(o),n.focus())}}catch{const o=document.createRange();o.selectNodeContents(n),o.collapse(!1);const a=window.getSelection();a&&(a.removeAllRanges(),a.addRange(o),n.focus())}T.current=null}},0)}},[w,f,i,t,p,T,M,C]);c.useEffect(()=>{$()},[$])}function st(t,w,f,i){c.useEffect(()=>{const p=t.current;if(!p)return;const T=C=>{const $=C.target?.closest(".upload-info-icon");if($&&$.classList.contains("upload-info-icon")){const q=$.dataset.uploadKey;q&&i({key:q,anchorEl:$,type:"upload"});return}const e=C.target?.closest('[data-type="upload"]');if(e){const q=e.dataset.key;if(q){const m=f[q];m&&m.type&&m.type.startsWith("image/")&&i({key:q,anchorEl:e,type:"upload-preview"})}}},M=C=>{const $=C.target?.closest(".upload-info-icon"),e=C.relatedTarget;if($&&$.classList.contains("upload-info-icon")){!e||!p.contains(e)?i(null):e.closest(".upload-info-icon")||i(null);return}const q=C.target?.closest('[data-type="upload"]');if(q){const m=e;if(m&&q.contains(m))return;i(null)}};return p.addEventListener("mouseover",T,!0),p.addEventListener("mouseout",M,!0),()=>{p.removeEventListener("mouseover",T,!0),p.removeEventListener("mouseout",M,!0)}},[w,f,t,i])}function lt(t,w,f,i){c.useEffect(()=>{if(!t.current)return;const p=$=>{if(i==="hideTagClose")return;const e=$.currentTarget,q=e.dataset.tooltip,m=e.dataset.tagKey||"";q&&f({key:m,anchorEl:e,type:"tag"})},T=()=>{f(null)};let M;const C=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.addEventListener("mouseenter",p),e.addEventListener("mouseleave",T)})};return M=requestAnimationFrame(()=>{M=requestAnimationFrame(C)}),()=>{cancelAnimationFrame(M),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(e=>{e.removeEventListener("mouseenter",p),e.removeEventListener("mouseleave",T)})}},[w,t,f,i])}function it(t,w,f){c.useEffect(()=>{const i=t.current;if(!i)return;const p=M=>{const C=M.target?.closest(".variable-info-icon");if(C&&C.classList.contains("variable-info-icon")){const $=C.dataset.variableKey;$&&f({key:$,anchorEl:C,type:"variable"})}},T=M=>{const C=M.target?.closest(".variable-info-icon"),$=M.relatedTarget;C&&C.classList.contains("variable-info-icon")&&(!$||!i.contains($)?f(null):$.closest(".variable-info-icon")||f(null))};return i.addEventListener("mouseover",p,!0),i.addEventListener("mouseout",T,!0),()=>{i.removeEventListener("mouseover",p,!0),i.removeEventListener("mouseout",T,!0)}},[w,t,f])}function ct(t,w,f,i){c.useEffect(()=>{if(!t.current)return;const p=$=>{const e=$.currentTarget;e.dataset.fileName&&i({key:"",anchorEl:e,type:"upload-label"})},T=()=>{i(null)};let M;const C=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(e=>{e.addEventListener("mouseenter",p),e.addEventListener("mouseleave",T)})};return M=requestAnimationFrame(()=>{M=requestAnimationFrame(C)}),()=>{cancelAnimationFrame(M),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(e=>{e.removeEventListener("mouseenter",p),e.removeEventListener("mouseleave",T)})}},[w,f,t,i])}function ut(t,w,f,i){c.useEffect(()=>{const p=setTimeout(()=>{Le(t,w,f),Ie(t,w,f,i)},0);return()=>clearTimeout(p)},[f,w,t,i])}function dt(t,w){const f=c.useRef(0);c.useEffect(()=>{if(!t.current)return;let i=!1,p=0;const T=a=>a instanceof HTMLElement?!!(a.closest(".rte-datepicker-wrapper")||a.closest(".rte-datepicker-host")||a.closest(".ant-picker")||a.closest(".ant-picker-dropdown")):!1,M=a=>{i=!0,T(a.target)&&(f.current=Date.now(),console.log("[SelectionCtrl] mousedown on datepicker target"))},C=()=>{i=!1,p=Date.now()};let $=!1,e=0;const q=()=>{$=!0},m=()=>{$=!1,e=Date.now()},l=()=>{e=Date.now()},r=a=>{T(a.target)&&(f.current=Date.now(),console.log("[SelectionCtrl] focusin datepicker target"))},n=()=>{if(Date.now()-f.current<800){console.log("[SelectionCtrl] skip selectionchange due to recent datepicker interaction");return}const a=document.activeElement;if(a&&(a.closest(".rte-datepicker-wrapper")||a.closest(".rte-datepicker-host")||a.closest(".ant-picker-dropdown")||a.tagName==="INPUT"&&a.closest(".ant-picker"))){console.log("[SelectionCtrl] activeElement is datepicker; skip");return}if(!t.current)return;const y=window.getSelection();if(!y||y.rangeCount===0||w.current||i||$||Date.now()-e<500)return;const h=y.getRangeAt(0);if(!h.collapsed)return t.current.contains(h.commonAncestorContainer),void 0;const b=y.anchorNode;if(!b||!t.current.contains(b))return;let k=!1;if(b.nodeType===Node.ELEMENT_NODE){const E=b;(E.closest('[data-type="datepicker"]')||E.closest(".rte-datepicker-wrapper")||E.closest(".rte-datepicker-host"))&&(k=!0)}else if(b.parentElement){const E=b.parentElement;(E.closest('[data-type="datepicker"]')||E.closest(".rte-datepicker-wrapper")||E.closest(".rte-datepicker-host"))&&(k=!0)}if(k)return;let B=null;if(b.nodeType===Node.ELEMENT_NODE?B=b.closest('[data-type="variable"]'):b.nodeType===Node.TEXT_NODE&&b.parentElement&&(B=b.parentElement.closest('[data-type="variable"]')),!B){if(Date.now()-p>500)return;const E=t.current.querySelectorAll('[data-type="variable"]');if(E.length>0){let O=null;for(const z of Array.from(E))if(z.style.display!=="none"){O=z;break}if(!O&&E.length>0&&(O=E[0]),O){const z=document.createRange();z.selectNodeContents(O),z.collapse(!1),y.removeAllRanges(),y.addRange(z),O.focus()}else y.removeAllRanges()}else y.removeAllRanges()}},o=t.current;return o&&(o.addEventListener("compositionstart",q),o.addEventListener("compositionend",m),o.addEventListener("input",l)),document.addEventListener("mousedown",M),document.addEventListener("mouseup",C),document.addEventListener("focusin",r),document.addEventListener("selectionchange",n),()=>{const a=t.current;a&&(a.removeEventListener("compositionstart",q),a.removeEventListener("compositionend",m),a.removeEventListener("input",l)),document.removeEventListener("mousedown",M),document.removeEventListener("mouseup",C),document.removeEventListener("focusin",r),document.removeEventListener("selectionchange",n)}},[t,w])}function pt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Se={exports:{}},ft=Se.exports,Ye;function yt(){return Ye||(Ye=1,function(t,w){(function(f,i){t.exports=i()})(ft,function(){var f=1e3,i=6e4,p=36e5,T="millisecond",M="second",C="minute",$="hour",e="day",q="week",m="month",l="quarter",r="year",n="date",o="Invalid Date",a=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(u){var d=["th","st","nd","rd"],x=u%100;return"["+u+(d[(x-20)%10]||d[x]||d[0])+"]"}},b=function(u,d,x){var I=String(u);return!I||I.length>=d?u:""+Array(d+1-I.length).join(x)+u},k={s:b,z:function(u){var d=-u.utcOffset(),x=Math.abs(d),I=Math.floor(x/60),N=x%60;return(d<=0?"+":"-")+b(I,2,"0")+":"+b(N,2,"0")},m:function u(d,x){if(d.date()<x.date())return-u(x,d);var I=12*(x.year()-d.year())+(x.month()-d.month()),N=d.clone().add(I,m),U=x-N<0,j=d.clone().add(I+(U?-1:1),m);return+(-(I+(x-N)/(U?N-j:j-N))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:m,y:r,w:q,d:e,D:n,h:$,m:C,s:M,ms:T,Q:l}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},B="en",E={};E[B]=h;var O="$isDayjsObject",z=function(u){return u instanceof Z||!(!u||!u[O])},W=function u(d,x,I){var N;if(!d)return B;if(typeof d=="string"){var U=d.toLowerCase();E[U]&&(N=U),x&&(E[U]=x,N=U);var j=d.split("-");if(!N&&j.length>1)return u(j[0])}else{var te=d.name;E[te]=d,N=te}return!I&&N&&(B=N),N||!I&&B},Y=function(u,d){if(z(u))return u.clone();var x=typeof d=="object"?d:{};return x.date=u,x.args=arguments,new Z(x)},H=k;H.l=W,H.i=z,H.w=function(u,d){return Y(u,{locale:d.$L,utc:d.$u,x:d.$x,$offset:d.$offset})};var Z=function(){function u(x){this.$L=W(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[O]=!0}var d=u.prototype;return d.parse=function(x){this.$d=function(I){var N=I.date,U=I.utc;if(N===null)return new Date(NaN);if(H.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var j=N.match(a);if(j){var te=j[2]-1||0,oe=(j[7]||"0").substring(0,3);return U?new Date(Date.UTC(j[1],te,j[3]||1,j[4]||0,j[5]||0,j[6]||0,oe)):new Date(j[1],te,j[3]||1,j[4]||0,j[5]||0,j[6]||0,oe)}}return new Date(N)}(x),this.init()},d.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},d.$utils=function(){return H},d.isValid=function(){return this.$d.toString()!==o},d.isSame=function(x,I){var N=Y(x);return this.startOf(I)<=N&&N<=this.endOf(I)},d.isAfter=function(x,I){return Y(x)<this.startOf(I)},d.isBefore=function(x,I){return this.endOf(I)<Y(x)},d.$g=function(x,I,N){return H.u(x)?this[I]:this.set(N,x)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(x,I){var N=this,U=!!H.u(I)||I,j=H.p(x),te=function(ye,pe){var ve=H.w(N.$u?Date.UTC(N.$y,pe,ye):new Date(N.$y,pe,ye),N);return U?ve:ve.endOf(e)},oe=function(ye,pe){return H.w(N.toDate()[ye].apply(N.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(pe)),N)},ie=this.$W,ue=this.$M,de=this.$D,ge="set"+(this.$u?"UTC":"");switch(j){case r:return U?te(1,0):te(31,11);case m:return U?te(1,ue):te(0,ue+1);case q:var Q=this.$locale().weekStart||0,ce=(ie<Q?ie+7:ie)-Q;return te(U?de-ce:de+(6-ce),ue);case e:case n:return oe(ge+"Hours",0);case $:return oe(ge+"Minutes",1);case C:return oe(ge+"Seconds",2);case M:return oe(ge+"Milliseconds",3);default:return this.clone()}},d.endOf=function(x){return this.startOf(x,!1)},d.$set=function(x,I){var N,U=H.p(x),j="set"+(this.$u?"UTC":""),te=(N={},N[e]=j+"Date",N[n]=j+"Date",N[m]=j+"Month",N[r]=j+"FullYear",N[$]=j+"Hours",N[C]=j+"Minutes",N[M]=j+"Seconds",N[T]=j+"Milliseconds",N)[U],oe=U===e?this.$D+(I-this.$W):I;if(U===m||U===r){var ie=this.clone().set(n,1);ie.$d[te](oe),ie.init(),this.$d=ie.set(n,Math.min(this.$D,ie.daysInMonth())).$d}else te&&this.$d[te](oe);return this.init(),this},d.set=function(x,I){return this.clone().$set(x,I)},d.get=function(x){return this[H.p(x)]()},d.add=function(x,I){var N,U=this;x=Number(x);var j=H.p(I),te=function(ue){var de=Y(U);return H.w(de.date(de.date()+Math.round(ue*x)),U)};if(j===m)return this.set(m,this.$M+x);if(j===r)return this.set(r,this.$y+x);if(j===e)return te(1);if(j===q)return te(7);var oe=(N={},N[C]=i,N[$]=p,N[M]=f,N)[j]||1,ie=this.$d.getTime()+x*oe;return H.w(ie,this)},d.subtract=function(x,I){return this.add(-1*x,I)},d.format=function(x){var I=this,N=this.$locale();if(!this.isValid())return N.invalidDate||o;var U=x||"YYYY-MM-DDTHH:mm:ssZ",j=H.z(this),te=this.$H,oe=this.$m,ie=this.$M,ue=N.weekdays,de=N.months,ge=N.meridiem,Q=function(pe,ve,ke,Ee){return pe&&(pe[ve]||pe(I,U))||ke[ve].slice(0,Ee)},ce=function(pe){return H.s(te%12||12,pe,"0")},ye=ge||function(pe,ve,ke){var Ee=pe<12?"AM":"PM";return ke?Ee.toLowerCase():Ee};return U.replace(y,function(pe,ve){return ve||function(ke){switch(ke){case"YY":return String(I.$y).slice(-2);case"YYYY":return H.s(I.$y,4,"0");case"M":return ie+1;case"MM":return H.s(ie+1,2,"0");case"MMM":return Q(N.monthsShort,ie,de,3);case"MMMM":return Q(de,ie);case"D":return I.$D;case"DD":return H.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return Q(N.weekdaysMin,I.$W,ue,2);case"ddd":return Q(N.weekdaysShort,I.$W,ue,3);case"dddd":return ue[I.$W];case"H":return String(te);case"HH":return H.s(te,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return ye(te,oe,!0);case"A":return ye(te,oe,!1);case"m":return String(oe);case"mm":return H.s(oe,2,"0");case"s":return String(I.$s);case"ss":return H.s(I.$s,2,"0");case"SSS":return H.s(I.$ms,3,"0");case"Z":return j}return null}(pe)||j.replace(":","")})},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(x,I,N){var U,j=this,te=H.p(I),oe=Y(x),ie=(oe.utcOffset()-this.utcOffset())*i,ue=this-oe,de=function(){return H.m(j,oe)};switch(te){case r:U=de()/12;break;case m:U=de();break;case l:U=de()/3;break;case q:U=(ue-ie)/6048e5;break;case e:U=(ue-ie)/864e5;break;case $:U=ue/p;break;case C:U=ue/i;break;case M:U=ue/f;break;default:U=ue}return N?U:H.a(U)},d.daysInMonth=function(){return this.endOf(m).$D},d.$locale=function(){return E[this.$L]},d.locale=function(x,I){if(!x)return this.$L;var N=this.clone(),U=W(x,I,!0);return U&&(N.$L=U),N},d.clone=function(){return H.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},u}(),ne=Z.prototype;return Y.prototype=ne,[["$ms",T],["$s",M],["$m",C],["$H",$],["$W",e],["$M",m],["$y",r],["$D",n]].forEach(function(u){ne[u[1]]=function(d){return this.$g(d,u[0],u[1])}}),Y.extend=function(u,d){return u.$i||(u(d,Z,Y),u.$i=!0),Y},Y.locale=W,Y.isDayjs=z,Y.unix=function(u){return Y(1e3*u)},Y.en=E[B],Y.Ls=E,Y.p={},Y})}(Se)),Se.exports}var mt=yt();const De=pt(mt),{RangePicker:ht}=R.DatePicker,gt=({host:t,onChange:w})=>{const f=t.dataset.key,i=t.dataset.value,p=t.dataset.placeholder,T=t.dataset.limitRange?parseInt(t.dataset.limitRange,10):void 0,M=t.dataset.disableFuture==="true",[C,$]=c.useState(()=>{if(!i)return null;const o=i.split(",");return o.length===2&&o[0]&&o[1]?[De(o[0]),De(o[1])]:null}),[e,q]=c.useState(null),m=o=>o?M&&o.isAfter(De(),"day")?!0:!T||!e||!e[0]?!1:Math.abs(o.diff(e[0],"days"))>T:!1,l=o=>{console.log("[DatePicker] onCalendarChange",o?.map(a=>a?.format("YYYY-MM-DD")||null)),q(o)},r=o=>{if(console.log("[DatePicker] onChange",o?.map(a=>a?.format("YYYY-MM-DD")||null)),$(o),q(null),o&&o[0]&&o[1]){const a=`${o[0].format("YYYY-MM-DD")},${o[1].format("YYYY-MM-DD")}`;t.setAttribute("data-value",a),w(f,a)}else t.setAttribute("data-value",""),w(f,"")},n=o=>{console.log("[DatePicker] onOpenChange",o),q(o?C:null)};return Be.createPortal(s.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"240px"},children:s.jsx(ht,{value:C,disabledDate:m,onCalendarChange:l,onChange:r,onOpenChange:n,placeholder:[p||"开始日期",p||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),t)},vt=t=>{const[w,f]=c.useState([]);return c.useEffect(()=>{const i=t.current;if(!i)return;const p=()=>{const M=i.querySelectorAll(".rte-datepicker-host"),C=[];M.forEach($=>{const e=$.getAttribute("data-key");e&&C.push(s.jsx(gt,{host:$,onChange:()=>{if(t.current){const q=new Event("input",{bubbles:!0});t.current.dispatchEvent(q)}}},`datepicker-${e}`))}),f(C)};p();const T=new MutationObserver(M=>{let C=!1;for(const $ of M)if($.type==="childList"){let e=!1;if($.addedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const m=q;(m.classList?.contains("rte-datepicker-host")||m.querySelector?.(".rte-datepicker-host"))&&(e=!0)}}),$.removedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const m=q;(m.classList?.contains("rte-datepicker-host")||m.querySelector?.(".rte-datepicker-host"))&&(e=!0)}}),e){C=!0;break}}C&&p()});return T.observe(i,{childList:!0,subtree:!0}),()=>T.disconnect()},[t]),w},Ke=({config:t,onSend:w,isProcessing:f=!1,disabled:i=!1,width:p,lockStructure:T=!1,agentOptions:M=[],onAgentSelect:C,onAgentExit:$,loading:e=!1,placeholder:q,border:m,background:l="transparent",hideButtons:r})=>{const n=c.useRef(null),o=c.useRef(null),[a,y]=c.useState({}),[h,b]=c.useState(null),[k,B]=c.useState(null),E=c.useRef(!1),O=c.useRef(null),[z,W]=c.useState(!1),Y=c.useRef(null),[H,Z]=c.useState(!0),[ne,u]=c.useState(()=>{const v={};return t.forEach(g=>{g.type==="multi-variable"&&g.key&&(v[g.key]=1)}),v}),d=c.useRef({}),x=c.useRef({}),I=c.useRef({});c.useEffect(()=>{x.current=a},[a]),c.useEffect(()=>{I.current=ne},[ne]);const N=c.useCallback(v=>v.find(S=>S.type==="tag")?.text||null,[]),U=c.useRef(t),j=c.useRef(null);c.useEffect(()=>{const v=N(U.current),g=N(t);if(v&&v!==g&&n.current){const S={};n.current.querySelectorAll('[data-type="variable"]').forEach(L=>{const F=L.dataset.key;if(F){const D=L.innerText.replace(/[\u200B\n]/g,"").trim();D&&(S[F]=D)}}),n.current.querySelectorAll('[data-type="select"]').forEach(L=>{const F=L.dataset.key;if(F){const D=L.value.trim();D&&(S[F]=D)}}),n.current.querySelectorAll('[data-type="textarea"]').forEach(L=>{const F=L.dataset.key;if(F){const D=L.value.replace(/[\u200B]/g,"").trim();D&&(S[F]=D)}}),d.current[v]={variableValues:S,files:{...x.current},multiVariableCounts:{...I.current}}}if(g&&d.current[g]){const S=d.current[g];j.current=S,y(S.files),u(S.multiVariableCounts)}else if(g){j.current=null;const S={};t.forEach(V=>{V.type==="multi-variable"&&V.key&&(S[V.key]=1)}),u(S),y({})}else j.current=null,u({}),y({});U.current=t},[t,N]),c.useLayoutEffect(()=>{j.current&&n.current&&(n.current.__tempVariableValues=j.current.variableValues,setTimeout(()=>{j.current&&(j.current=null)},0))}),ot(n,t,a,T,ne,Y,void 0,r),st(n,t,a,B),lt(n,t,B,r),ct(n,t,a,B),it(n,t,B),ut(n,t,a,W),dt(n,E);const te=vt(n);c.useEffect(()=>{if(t.length>0){Z(!1);return}const v=()=>{if(!n.current){Z(!0);return}const S=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",V=n.current.querySelectorAll('[data-type="variable"]'),A=n.current.querySelectorAll('[data-type="upload"]');let _=!1;V.forEach(F=>{(F.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(_=!0)}),A.forEach(F=>{F.querySelector(".upload-inner-wrapper.has-file")&&(_=!0)});const L=!S&&!_;Z(L),t.length===0&&W(!L)};v();const g=new MutationObserver(v);return n.current&&g.observe(n.current,{childList:!0,subtree:!0,characterData:!0}),()=>{g.disconnect()}},[t]);const oe=v=>{if(i){v.preventDefault();return}v.preventDefault();const g=v.clipboardData.getData("text/plain"),S=window.getSelection();if(S&&S.rangeCount>0){const V=S.anchorNode;if(V){let A=null;if(V.nodeType===Node.ELEMENT_NODE?A=V.closest('[data-type="variable"]'):V.nodeType===Node.TEXT_NODE&&V.parentElement&&(A=V.parentElement.closest('[data-type="variable"]')),A){const _=A.dataset.multiKey;if(_){const L=/[、,,\s\n\r\t]+/,F=g.split(L).map(D=>D.trim()).filter(D=>D.length>0);if(console.log("[Paste Event] 粘贴的内容:",g),console.log("[Paste Event] 拆分后的值:",F),F.length>1){const D=parseInt(A.dataset.index||"0",10),K=t.find(le=>le.type==="multi-variable"&&le.key===_)?.maxCount||9,X=ne[_]||1,P=Math.min(D+F.length,K);P>X&&u(ee=>({...ee,[_]:P}));const J=[];for(let ee=0;ee<X;ee++){const le=`${_}_${ee}`,me=n.current.querySelector(`[data-type="variable"][data-key="${le}"][data-multi-key="${_}"]`);if(me){const be=me.innerText.replace(/[\u200B\n]/g,"").trim();J.push(be)}}J.splice(D,1,...F.slice(0,K-D));const re=J.slice(0,K);re.length>0&&re[re.length-1]!==""&&re.length<K&&re.push("");const G=Math.max(re.length,1),se={};re.forEach((ee,le)=>{ee&&(se[`${_}_${le}`]=ee)}),n.current.querySelectorAll('[data-type="variable"]').forEach(ee=>{const le=ee.dataset.key,me=ee.dataset.multiKey;if(le&&me!==_){const be=ee.innerText.replace(/[\u200B\n]/g,"").trim();be&&(se[le]=be)}}),n.current.__tempVariableValues=se,u(ee=>({...ee,[_]:G})),console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:",re);return}else F.length===1&&console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分")}}}}document.execCommand("insertText",!1,g),pe(),setTimeout(()=>{const V=window.getSelection();if(V&&V.rangeCount>0){const A=V.anchorNode;if(A){let _=null;if(A.nodeType===Node.ELEMENT_NODE?_=A.closest('[data-type="variable"][data-multi-key]'):A.nodeType===Node.TEXT_NODE&&A.parentElement&&(_=A.parentElement.closest('[data-type="variable"][data-multi-key]')),_){const L=_.innerText.replace(/[\u200B\n]/g,"").trim();/[、,,\s]+/.test(L)&&(console.log("[Paste Event] 粘贴后检测到分隔符,内容:",L),console.log("[Paste Event] 提示:失去焦点后将自动拆分"))}}}},0)},ie=v=>{if(v.target.files&&v.target.files[0]&&h){const g=v.target.files[0],S=h;y(V=>({...V,[S]:g}))}v.target&&(v.target.value=""),b(null)},ue=v=>{y(g=>{const S={...g};return delete S[v],S})},de=v=>{const g=v.target;if(g.closest(".rte-datepicker-wrapper")||g.closest(".rte-datepicker-host"))return;if(g.closest(".tag-close-btn")){if(v.preventDefault(),v.stopPropagation(),T)return;B(null),$?$():n.current&&(n.current.innerHTML="",n.current.focus());return}if(T){const A=g.closest(".tag-node"),_=g.closest('[data-type="text"]');if(A||_){v.preventDefault(),v.stopPropagation();const L=window.getSelection();L&&L.removeAllRanges();return}}g.closest('[data-type="variable"]')||(O.current={x:v.clientX,y:v.clientY},E.current=!1,g.closest(".file-remove-btn")&&(v.preventDefault(),v.stopPropagation()))},ge=v=>{if(!v.target.closest('[data-type="variable"]')&&O.current){const V=Math.abs(v.clientX-O.current.x),A=Math.abs(v.clientY-O.current.y);(V>3||A>3)&&(E.current=!0)}},Q=v=>{if(v.target.closest('[data-type="variable"]')){O.current=null,E.current=!1;return}O.current=null,E.current=!1},ce=v=>{if(i)return;const g=v.target;if(g.closest('[data-type="datepicker"]'))return;if(g.closest(".tag-close-btn")){v.preventDefault(),v.stopPropagation();return}if(t.length===0)return;const A=(P,J)=>{if(!n.current)return;Array.from(n.current.children).forEach(G=>{if(G!==P)if(J)G.dataset.prevDisplay===void 0&&(G.dataset.prevDisplay=G.style.display||""),G.style.setProperty("display","none","important");else if(G.dataset.prevDisplay!==void 0){const se=G.dataset.prevDisplay;se?G.style.display=se:G.style.removeProperty("display"),delete G.dataset.prevDisplay}else G.style.removeProperty("display")})},_=g.closest(".rte-textarea-toggle");if(_){v.preventDefault(),v.stopPropagation();const P=_.closest(".rte-textarea-wrapper"),J=P?.querySelector('[data-type="textarea"]'),G=!(_.getAttribute("data-expanded")==="true");_.setAttribute("data-expanded",String(G)),_.textContent=G?"收起":"展开",P&&P.classList.toggle("rte-textarea-expanded",G);const se=P?.closest(".rte-textarea-required");if(se?se.classList.toggle("rte-textarea-overlay",G):P&&P.classList.toggle("rte-textarea-overlay",G),J)if(G)J.classList.add("rte-textarea-expanded"),J.style.maxHeight="none",J.style.height="100%";else{J.classList.remove("rte-textarea-expanded");const fe=J.dataset.maxHeight||"252";J.style.maxHeight=`${fe}px`,J.style.height="auto"}n.current&&(G?n.current.classList.add("rte-overlay-active"):n.current.classList.remove("rte-overlay-active"));return}const L=g.closest(".rte-richtext-toggle");if(L){v.preventDefault(),v.stopPropagation();const P=L.closest(".rte-richtext-wrapper"),J=P?.querySelector('[data-type="richtext"]'),G=!(L.getAttribute("data-expanded")==="true");((le,me)=>{le.setAttribute("data-expanded",String(me)),le.innerHTML=me?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})(L,G);const fe=P?.closest(".rte-richtext-required");fe?fe.classList.toggle("rte-richtext-expanded",G):P&&P.classList.toggle("rte-richtext-expanded",G);const ee=P?.closest(".exclusion-wrapper")||P?.parentElement;J&&(G?(J.style.height="100%",J.style.overflow="auto"):(J.style.height="",J.style.overflow="")),ee&&(ee.classList.toggle("rte-richtext-host-expanded",G),A(ee,G)),n.current&&n.current.classList.toggle("rte-richtext-fullscreen-active",G);return}if(g.closest('[data-type="text"]')){v.preventDefault(),v.stopPropagation();const P=window.getSelection();P&&P.removeAllRanges();return}if(T&&g.closest(".tag-node")){v.preventDefault(),v.stopPropagation();const J=window.getSelection();J&&J.removeAllRanges();return}if(g.closest('[data-type="variable"]')){if(E.current)return;setTimeout(()=>{const P=window.getSelection();P&&!P.isCollapsed||_e(n)},10);return}const K=g.closest(".file-remove-btn");if(K){v.preventDefault(),v.stopPropagation();const J=K.closest('[data-type="upload"]')?.dataset.key;J&&ue(J);return}const X=g.closest('[data-type="upload"]');if(X){const P=X.dataset.key;P&&(b(P),o.current?.click());return}},ye=v=>{const S=v.target.closest('[data-type="variable"]');if(S){const V=window.getSelection();if(V){const A=document.createRange(),_=S.textContent||"";if(_.replace(/\u200B/g,"")){let F=0,D=_.length;_.startsWith("​")&&(F=1),_.endsWith("​")&&_.length>1&&(D=_.length-1);const K=S.firstChild;K&&K.nodeType===Node.TEXT_NODE?(A.setStart(K,F),A.setEnd(K,D)):A.selectNodeContents(S)}else A.selectNodeContents(S),A.collapse(!0);V.removeAllRanges(),V.addRange(A)}}},pe=()=>{if(t.length===0){if(n.current){const S=!(n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");Z(S),W(!S)}return}if(_e(n),n.current&&n.current.querySelectorAll('[data-type="variable"]').forEach(S=>{const V=S.querySelector(".variable-info-icon");if(V){let A=!1;const _=document.createTreeWalker(S,NodeFilter.SHOW_TEXT,{acceptNode:L=>V.contains(L)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;_.nextNode();)if(_.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){A=!0;break}A?V.classList.add("hidden"):V.classList.remove("hidden")}}),Le(n,t,a),Ie(n,t,a,W),!n.current)return;t.filter(g=>g.type==="multi-variable"&&g.key).forEach(g=>{if(!g.key)return;const S=g.maxCount||9,V=ne[g.key]||1,A=[];for(let K=0;K<V;K++){const X=`${g.key}_${K}`,P=n.current.querySelector(`[data-type="variable"][data-key="${X}"][data-multi-key="${g.key}"]`);if(P){const J=P.innerText.replace(/[\u200B\n]/g,"").trim();A.push(J)}}const L=(A[A.length-1]||"")==="";let F=!1,D=-1;for(let K=0;K<A.length-1;K++)if(A[K]===""){F=!0,D=K;break}if(F&&D>=0){const K=window.getSelection();if(K&&K.rangeCount>0){const G=K.getRangeAt(0),se=G.startContainer,fe=se.nodeType===Node.ELEMENT_NODE?se.closest('[data-type="variable"][data-multi-key]'):se.parentElement?.closest('[data-type="variable"][data-multi-key]');if(fe){const ee=fe.dataset.key;if(ee){const le=document.createRange();le.setStartBefore(fe),le.setEnd(G.startContainer,G.startOffset);const me=le.toString().length;Y.current={key:ee,offset:me}}}}const X=[...A];for(let G=D;G<X.length-1;G++)X[G]=X[G+1];X.pop();const P={};X.forEach((G,se)=>{G&&(P[`${g.key}_${se}`]=G)});const J=Math.max(L?X.length:X.length+1,1);n.current.querySelectorAll('[data-type="variable"]').forEach(G=>{const se=G.dataset.key,fe=G.dataset.multiKey;if(se&&fe!==g.key){const ee=G.innerText.replace(/[\u200B\n]/g,"").trim();ee&&(P[se]=ee)}}),n.current.__tempVariableValues=P,u(G=>({...G,[g.key]:J}));return}if(!L){const K=V-1,X=`${g.key}_${K}`,P=n.current.querySelector(`[data-type="variable"][data-key="${X}"][data-multi-key="${g.key}"]`);if(P&&P.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&V<S){const re=window.getSelection();if(re&&re.rangeCount>0){const G=re.getRangeAt(0),se=G.startContainer,fe=se.nodeType===Node.ELEMENT_NODE?se.closest('[data-type="variable"][data-multi-key]'):se.parentElement?.closest('[data-type="variable"][data-multi-key]');if(fe){const ee=fe.dataset.key;if(ee){const le=document.createRange();le.setStartBefore(fe),le.setEnd(G.startContainer,G.startOffset);const me=le.toString().length;Y.current={key:ee,offset:me}}}}u(G=>({...G,[g.key]:V+1}))}}})};c.useLayoutEffect(()=>{const v=n.current;if(!v)return;const g=new Map,S=_=>{const L=_.target,F=_.relatedTarget;!L||!n.current||!n.current.contains(L)||F&&n.current.contains(F)||setTimeout(()=>{if(n.current){if(t.length===0){const D=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";W(D.length>0);return}_e(n),Le(n,t,a),Ie(n,t,a,W)}},0)};v.addEventListener("blur",S,!0);const V=()=>{if(!n.current)return;g.forEach((F,D)=>{D.removeEventListener("blur",F,!1)}),g.clear();const _=n.current.querySelectorAll('[data-type="variable"][data-multi-key]'),L=F=>{F.stopPropagation(),F.stopImmediatePropagation();const D=F.target;if(!D||!n.current||!n.current.contains(D))return;const K=D.closest('[data-type="variable"][data-multi-key]');if(!K||!n.current.contains(K))return;let X=!1;if(g.forEach((le,me)=>{(me===K||me.contains(D))&&(X=!0)}),!X)return;const P=K.dataset.multiKey,J=K.dataset.key,re=K.dataset.index;if(!P||!J||re===void 0)return;const G=F.relatedTarget;if(!(!G||!n.current.contains(G)))return;const fe=K.innerText.replace(/[\u200B\n]/g,"").trim();console.log("[Blur Event] 失去焦点的 multi-variable 输入框:",{multiKey:P,currentKey:J,index:re,content:fe});const ee=/[、,,\s]+/;if(ee.test(fe)){const le=fe.split(ee).map($e=>$e.trim()).filter($e=>$e.length>0);console.log("[Blur Event] 拆分前的内容:",fe),console.log("[Blur Event] 拆分后的部分:",le);const be=le.slice(0,9);if(console.log("[Blur Event] 有效的部分(最多9个):",be),be.length>1){const $e=t.find(Te=>Te.type==="multi-variable"&&Te.key===P);if($e){const Te=ne[P]||1,et=parseInt(re,10),tt=$e.maxCount||9,qe=[];for(let he=0;he<Te;he++){const Ce=`${P}_${he}`,Ne=n.current.querySelector(`[data-type="variable"][data-key="${Ce}"][data-multi-key="${P}"]`);if(Ne){const Ae=Ne.innerText.replace(/[\u200B\n]/g,"").trim();qe.push(Ae)}}console.log("[Blur Event] 拆分前的所有值:",qe),console.log("[Blur Event] 当前索引:",et),console.log("[Blur Event] 要插入的值:",be),qe.splice(et,1,...be);const we=qe.slice(0,tt);console.log("[Blur Event] 拆分后的所有值:",we),we.length>0&&we[we.length-1]!==""&&we.length<tt&&we.push("");const Ct=Math.max(we.length,1),Ve={};we.forEach((he,Ce)=>{he&&(Ve[`${P}_${Ce}`]=he)}),n.current.querySelectorAll('[data-type="variable"]').forEach(he=>{const Ce=he.dataset.key,Ne=he.dataset.multiKey;if(Ce&&Ne!==P){const Ae=he.innerText.replace(/[\u200B\n]/g,"").trim();Ae&&(Ve[Ce]=Ae)}}),n.current.__tempVariableValues=Ve,u(he=>({...he,[P]:Ct}))}}}};_.forEach(F=>{F.addEventListener("blur",L,!1),g.set(F,L)})},A=setTimeout(()=>{V()},0);return()=>{clearTimeout(A),v.removeEventListener("blur",S,!0),g.forEach((_,L)=>{L.removeEventListener("blur",_,!1)}),g.clear()}},[t,ne,a]);const ve=v=>{if(i){v.preventDefault();return}const g=window.getSelection();if(g&&g.rangeCount>0){const S=g.anchorNode;let V=null;if(S&&(S.nodeType===Node.ELEMENT_NODE?V=S.closest('[data-type="text"]'):S.nodeType===Node.TEXT_NODE&&S.parentElement&&(V=S.parentElement.closest('[data-type="text"]'))),V){if(v.preventDefault(),v.stopPropagation(),n.current){const A=n.current.querySelector('[data-type="variable"], [data-type="upload"]');A&&A.focus()}return}}if(T&&g&&g.rangeCount>0){const S=g.anchorNode;let V=null;if(S&&(S.nodeType===Node.ELEMENT_NODE?V=S.closest(".tag-node"):S.nodeType===Node.TEXT_NODE&&S.parentElement&&(V=S.parentElement.closest(".tag-node"))),V){if(v.preventDefault(),v.stopPropagation(),n.current){const A=n.current.querySelector('[data-type="variable"], [data-type="upload"]');A&&A.focus()}return}}if(v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),ke()),v.key==="Escape"&&n.current){if(T){v.preventDefault();return}n.current.innerHTML="",n.current.focus()}if(v.key==="Backspace"){const S=window.getSelection();if(S&&S.rangeCount>0){const V=S.getRangeAt(0),A=S.anchorNode;if(T){let L=null,F=null;if(A&&(A.nodeType===Node.ELEMENT_NODE?(L=A.closest(".tag-node"),F=A.closest('[data-type="text"]')):A.nodeType===Node.TEXT_NODE&&A.parentElement&&(L=A.parentElement.closest(".tag-node"),F=A.parentElement.closest('[data-type="text"]'))),(L||F)&&V.collapsed&&V.startOffset===0){v.preventDefault();return}}let _=null;if(A&&(A.nodeType===Node.ELEMENT_NODE?_=A.closest('[data-type="variable"]'):A.nodeType===Node.TEXT_NODE&&A.parentElement&&(_=A.parentElement.closest('[data-type="variable"]'))),_){if(!V.collapsed)return;const L=_.innerText;if(L==="​"||L===""){v.preventDefault();return}if(V.startOffset===0){v.preventDefault();return}if(L.startsWith("​")&&V.startOffset===1){v.preventDefault();return}}}}},ke=()=>{if(f||i||e||!z||!n.current)return;if(t.length===0){const _=n.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!_)return;w(_,_);return}const v=n.current;let g="";const S={},V=_=>{if(!(_.nodeType===Node.ELEMENT_NODE&&_.style.display==="none")){if(_.nodeType===Node.TEXT_NODE)g+=(_.textContent||"").replace(/\u200B/g,"");else if(_.nodeType===Node.ELEMENT_NODE){const L=_,F=L.dataset.type,D=L.dataset.key;if(F==="variable"&&D){let K="";const X=document.createTreeWalker(L,NodeFilter.SHOW_TEXT,{acceptNode:J=>{const re=L.querySelector(".variable-info-icon");return re&&re.contains(J)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;X.nextNode();)K+=X.currentNode.textContent||"";const P=K.replace(/[\u200B\n]/g,"").trim();if(P){const J=L.dataset.multiKey;if(J){(!S[J]||!Array.isArray(S[J]))&&(S[J]=[]);const re=S[J];re.push(P),re.length>1&&(g+=" "),g+=P}else S[D]=P,g+=P}}else if(F==="select"&&D){const K=L,X=(K.value||"").trim();if(X){S[D]=X;const P=K.selectedOptions?.[0];g+=P?.textContent||X}}else if(F==="textarea"&&D){const X=(L.value||"").replace(/\u200B/g,"").trim();X&&(S[D]=X,g+=X)}else if(F==="richtext"&&D){const X=(L.textContent||"").replace(/\u200B/g,"").trim();X&&(S[D]=X,g+=X)}else if(F==="datepicker"&&D){const X=(L.getAttribute("data-value")||"").trim();if(X)if(X.includes(",")){const P=X.split(",");P.length===2?(S[D]=P,g+=`[${P[0]}, ${P[1]}]`):(S[D]=X,g+=X)}else S[D]=X,g+=X}else if(F==="upload"&&D)S[D]=a[D]??null,a[D]&&(g+=` [附带文件: ${a[D]?.name}] `);else{if(L.classList.contains("tag-close-btn")||L.classList.contains("file-remove-btn"))return;L.getAttribute("contenteditable")==="false"&&!F&&L.classList.contains("tag-node")?g+=L.innerText:L.childNodes.forEach(V)}}}};if(v.childNodes.forEach(V),g=g.trim(),!g)return;const A=new FormData;A.append("fullPrompt",g),Object.keys(S).forEach(_=>{const L=S[_];L!=null&&(L instanceof File?A.append(_,L):Array.isArray(L)?t.some(D=>D.type==="multi-variable"&&D.key===_)?L.forEach(D=>{D!=null&&D!==""&&A.append(_,String(D))}):L.forEach((D,K)=>{D!=null&&(D instanceof File?A.append(`${_}[${K}]`,D):typeof D=="string"?A.append(`${_}[${K}]`,D):A.append(`${_}[${K}]`,String(D)))}):typeof L=="string"?A.append(_,L):A.append(_,String(L)))}),w(A,g)},Ee={...p?{width:typeof p=="number"?`${p}px`:p}:{},...m?{border:m}:{},...l?{background:l}:{}};return s.jsxs("div",{className:"rich-text-editor",style:Ee,"data-disabled":i,children:[s.jsx("div",{ref:n,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${H&&q?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":q,onMouseDown:de,onMouseMove:ge,onMouseUp:Q,onClick:ce,onDoubleClick:ye,onInput:pe,onKeyDown:ve,onPaste:oe}),s.jsx("input",{type:"file",ref:o,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:ie}),s.jsxs("div",{className:"rich-text-editor-footer",children:[s.jsx("div",{className:"rich-text-editor-footer-left",children:s.jsxs("div",{className:"rich-text-editor-brand",children:[s.jsxs("div",{className:"rte-brand-badge",children:[s.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),s.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),r!=="hideAgent"&&s.jsx(R.Dropdown,{placement:"top",menu:{items:M.map(v=>({key:v.key,label:s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[v.icon&&s.jsx("i",{className:v.icon}),s.jsx("span",{children:v.label})]}),onClick:()=>{C?.(v)}}))},trigger:["click"],disabled:i||f,children:s.jsxs("div",{className:"rte-agent-badge",style:{cursor:M.length>0?"pointer":"default"},children:[s.jsx("i",{className:"iconfont icon-zhinengti"}),s.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(()=>{const v=t.find(S=>S.type==="tag");if(!v||!v.text)return null;const g=M.find(S=>S.label===v.text);return!g||g.points===void 0||g.points===null?null:s.jsxs("div",{className:"rte-points-badge",children:[s.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px"}}),s.jsxs("span",{style:{fontSize:"16px"},children:["-",String(g.points)]})]})})(),s.jsx("button",{type:"button",onClick:ke,disabled:f||i||e||!z,className:"rich-text-editor-send-button",children:f||e?s.jsx("span",{className:"rte-send-spinner"}):s.jsx("i",{className:"iconfont icon-fasong"})})]})]}),k?.anchorEl&&(()=>{if(!document.body.contains(k.anchorEl))return null;let v="",g={background:"var(--neutral-800, #262626)"};if(k.type==="upload")v=t.find(A=>A.type==="upload"&&A.key===k.key)?.tooltip||"";else if(k.type==="tag")v=k.anchorEl.dataset.tooltip||"";else if(k.type==="upload-label")v=k.anchorEl.dataset.fileName||"";else if(k.type==="variable")v=k.anchorEl.dataset.tooltip||"";else if(k.type==="upload-preview"){const V=a[k.key];if(V&&V.type&&V.type.startsWith("image/")){const A=URL.createObjectURL(V);v=s.jsx("div",{style:{width:120,height:120,display:"flex",alignItems:"center",justifyContent:"center"},children:s.jsx("img",{src:A,style:{maxWidth:120,maxHeight:120,objectFit:"contain"}})}),g={background:"#fff",padding:4},setTimeout(()=>URL.revokeObjectURL(A),1e3)}else v=""}if(!v)return null;const S=k.type==="upload-preview"?"#0A0A0A":"#fff";return Be.createPortal(s.jsx(R.Tooltip,{arrow:!1,title:s.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:S},children:v}),open:!0,placement:"top",getPopupContainer:()=>document.body,overlayInnerStyle:g,children:s.jsx("div",{style:{position:"fixed",left:`${k.anchorEl.getBoundingClientRect().left}px`,top:`${k.anchorEl.getBoundingClientRect().top}px`,width:`${k.anchorEl.offsetWidth}px`,height:`${k.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})(),te]})};Ke.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const Xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",bt=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],xt=({autoLoading:t,batchSize:w,loadingProgress:f,loadIcon:i,onBatchSizeChange:p,onLoadNextPage:T,onStartAutoLoad:M,onStopLoad:C})=>t&&f?s.jsxs("div",{className:"auto_load_progress",children:[i||s.jsx("img",{src:Xe,alt:"自动加载",width:14,height:14}),s.jsxs("span",{children:["正在加载第",f.currentPage,"/",f.totalPages,"页"]}),s.jsx(R.Progress,{percent:f.percentage,type:"line",size:[160,8]}),s.jsx("span",{onClick:C,className:"auto_load_stop_btn",children:"停止加载"})]}):s.jsxs("div",{className:"auto_load_container",children:[s.jsx("div",{onClick:T,className:"auto_load_next_btn",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:"加载下一页"}),s.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:[s.jsxs("div",{className:"auto_load_btn",onClick:t?void 0:M,children:[i||s.jsx("img",{src:Xe,alt:"自动加载",width:14,height:14}),s.jsx("span",{children:"自动加载"})]}),s.jsx(R.Select,{value:w,onChange:p,options:bt,disabled:t,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),kt=({current:t,loadIcon:w,pageSize:f,total:i,cachedPages:p,loadedCount:T,autoLoading:M=!1,loadingProgress:C,onChange:$,onLoadNextPage:e,onStartAutoLoad:q,onStopLoading:m})=>{const[l,r]=c.useState(5),n=Math.ceil(i/f),o=c.useMemo(()=>p.length>=n,[p,n]),a=()=>Array.from({length:n},(b,k)=>k+1).filter(b=>!p.includes(b)).slice(0,l),y=(h,b,k)=>{const B=p.includes(h);return b==="prev"||b==="next"||b==="jump-prev"||b==="jump-next"?s.jsx("div",{className:"pageBox",children:k}):s.jsxs("div",{className:"pageBox",style:{backgroundColor:t===h?"#2563EB":"#f5f5f5",color:t===h?"#fff":B?"#171717":"#a3a3a3"},children:[h,!B&&s.jsx("span",{className:"unload_spot"})]})};return s.jsxs("div",{className:"pagination_footer",children:[s.jsxs("div",{className:"pagination_leftWrap",children:[s.jsxs("span",{className:"pagination_total",children:[s.jsx(xe.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",T,"/",i,"条数据"]}),!o&&s.jsx(xt,{loadIcon:w||void 0,autoLoading:M,batchSize:l,loadingProgress:C,disabled:!e||!q,onBatchSizeChange:r,onLoadNextPage:()=>e?.(),onStartAutoLoad:()=>{const h=a();q?.(h)},onStopLoad:()=>m?.()})]}),s.jsx(R.Pagination,{current:t,pageSize:f,total:i,onChange:h=>$(h),showSizeChanger:!1,showQuickJumper:!1,showTotal:(h,b)=>"",itemRender:y})]})},Je=t=>{const{loading:w,autoLoading:f,loadingProgress:i,columns:p=[],dataSource:T=[],total:M,current:C,pageSize:$,cachedPages:e,onChangePage:q,onLoadNextPage:m,onStartAutoLoad:l,onStopLoading:r,...n}=t,o=c.useRef(null),a=c.useCallback(y=>{q(y),e.includes(y)&&o.current?.scrollTo({key:`${(y-1)*$+1}`})},[C]);return s.jsxs("div",{className:"flex flex-col",children:[s.jsx(R.Table,{ref:o,...n,columns:p,dataSource:T,pagination:!1,virtual:!0}),s.jsx(kt,{loading:w,autoLoading:f,loadingProgress:i,current:C,pageSize:$,total:M,loadedCount:T.length,cachedPages:e,onChange:a,onLoadNextPage:m,onStartAutoLoad:l,onStopLoading:r})]})};Je.__docgenInfo={displayName:"VirtualTable",description:"虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",props:{loading:{description:"加载状态",name:"loading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},total:{description:"总数据条数",name:"total",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"0"}},current:{description:"当前页码",name:"current",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"1"}},pageSize:{description:"每页数据条数",name:"pageSize",required:!0,type:{name:"number",raw:"number"},defaultValue:{value:"10"}},cachedPages:{description:"已缓存的页码数组",name:"cachedPages",required:!0,type:{name:"number[]",raw:"number[]"},defaultValue:{value:"[]"}},dataSource:{description:"数据源",name:"dataSource",required:!0,type:{name:"Array<T>",raw:"Array<T>"},defaultValue:{value:"[]"}},onChangePage:{description:"页码变更回调函数",name:"onChangePage",required:!0,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},autoLoading:{description:"是否正在自动加载",name:"autoLoading",required:!0,type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},loadingProgress:{description:"加载进度信息",name:"loadingProgress",required:!0,type:{name:"object",raw:"{percentage: 0, currentPage: 1, totalPages: 5}"},defaultValue:{value:"-"}},onLoadNextPage:{description:"加载下一页回调函数",name:"onLoadNextPage",required:!1,type:{name:"function",raw:"function(page: number): void"},defaultValue:{value:"-"}},onStartAutoLoad:{description:"开始自动加载回调函数",name:"onStartAutoLoad",required:!1,type:{name:"function",raw:"function(loadNextPages: number[]): void"},defaultValue:{value:"-"}},onStopLoading:{description:"停止加载回调函数",name:"onStopLoading",required:!1,type:{name:"function",raw:"function(): void"},defaultValue:{value:"-"}},columns:{description:"表格列配置",name:"columns",required:!0,type:{name:"Array<object>",raw:"Array<object>"},defaultValue:{value:"[]"}}}};const Qe=({texts:t=[],placeholder:w="请输入内容",animationSpeed:f=100,autoPlay:i=!0,value:p,onChange:T,...M})=>{const[C,$]=c.useState(""),[e,q]=c.useState(0),[m,l]=c.useState(!1),[r,n]=c.useState(!1),[o,a]=c.useState(!1),y=c.useRef(void 0),h=c.useRef(void 0),b=c.useRef(t),k=c.useRef(e),B=c.useRef(r),E=c.useRef(C);c.useEffect(()=>{b.current=t,k.current=e,B.current=r,E.current=C});const O=c.useCallback((u,d)=>{let x=0;a(!0);const I=()=>{x<u.length?($(u.slice(0,x+1)),x++,h.current=window.setTimeout(I,f)):(a(!1),d?.())};I()},[f]),z=c.useCallback(u=>{let d=E.current.length;const x=()=>{d>0?($(E.current.slice(0,d-1)),d--,h.current=window.setTimeout(x,f/2)):u?.()};x()},[f]),W=c.useCallback(()=>{if(b.current.length===0||B.current)return;l(!0);const u=b.current[k.current];E.current?z(()=>{O(u,()=>{y.current=window.setTimeout(()=>{q(d=>(d+1)%b.current.length),l(!1)},2e3)})}):O(u,()=>{y.current=window.setTimeout(()=>{q(d=>(d+1)%b.current.length),l(!1)},2e3)})},[z,O]);c.useEffect(()=>(i&&t.length>0&&!r&&W(),()=>{y.current&&window.clearTimeout(y.current),h.current&&window.clearTimeout(h.current)}),[e,r,i,t.length,W]),c.useEffect(()=>{!m&&i&&t.length>0&&!r&&W()},[e,m,i,t.length,r,W]);const Y=u=>{n(!0),y.current&&window.clearTimeout(y.current),h.current&&window.clearTimeout(h.current),l(!1),a(!1),M.onFocus?.(u)},H=u=>{n(!1),!p&&t.length>0&&($(""),q(0)),M.onBlur?.(u)},Z=u=>{T?.(u.target.value),M.onChange?.(u)},ne=()=>r||p?w:C||w;return s.jsxs("div",{style:{position:"relative"},children:[s.jsx(R.Input,{...M,value:p,onChange:Z,onFocus:Y,onBlur:H,placeholder:ne(),style:{...M.style,position:"relative",zIndex:1}}),!r&&!p&&C&&s.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",paddingLeft:11,paddingRight:11,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit"},children:[s.jsx("span",{children:C}),o&&s.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),s.jsx("style",{children:`
2
2
  @keyframes blink {
3
3
  0%, 50% { opacity: 1; }
4
4
  51%, 100% { opacity: 0; }
5
5
  }
6
- `})]})};We.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const je=({texts:t=[],placeholder:g="请输入内容",animationSpeed:p=100,autoPlay:u=!0,value:d="",onChange:w,onSubmit:I,maxLength:C=500,showCount:T=!0,submitText:e="发送",disabled:L=!1,rows:h=4,style:i,...n})=>{const[a,o]=c.useState(""),[r,s]=c.useState(0),[f,v]=c.useState(!1),[x,D]=c.useState(!1),[S,G]=c.useState(!1),[F,M]=c.useState(d||""),U=c.useRef(void 0),J=c.useRef(void 0),Q=c.useRef(t),Z=c.useRef(r),N=c.useRef(x),H=c.useRef(a),te=c.useRef(null);c.useEffect(()=>{Q.current=t,Z.current=r,N.current=x,H.current=a});const ae=c.useCallback((j,re)=>{let ce=0;G(!0);const xe=()=>{ce<j.length?(o(j.slice(0,ce+1)),ce++,J.current=window.setTimeout(xe,p)):(G(!1),re?.())};xe()},[p]),se=c.useCallback(j=>{let re=H.current.length;const ce=()=>{re>0?(o(H.current.slice(0,re-1)),re--,J.current=window.setTimeout(ce,p/2)):j?.()};ce()},[p]),fe=c.useCallback(()=>{if(Q.current.length===0||N.current)return;v(!0);const j=Q.current[Z.current];H.current?se(()=>{ae(j,()=>{U.current=window.setTimeout(()=>{s(re=>(re+1)%Q.current.length),v(!1)},2e3)})}):ae(j,()=>{U.current=window.setTimeout(()=>{s(re=>(re+1)%Q.current.length),v(!1)},2e3)})},[se,ae]);c.useEffect(()=>(u&&t.length>0&&!x&&fe(),()=>{U.current&&window.clearTimeout(U.current),J.current&&window.clearTimeout(J.current)}),[r,x,u,t.length,fe]),c.useEffect(()=>{!f&&u&&t.length>0&&!x&&fe()},[r,f,u,t.length,x,fe]);const ie=j=>{D(!0),U.current&&window.clearTimeout(U.current),J.current&&window.clearTimeout(J.current),v(!1),G(!1),n.onFocus?.(j)},Se=j=>{D(!1),!d&&t.length>0&&(o(""),s(0)),n.onBlur?.(j)},$e=j=>{const re=j.target.value;C&&re.length>C||(w?w(re):M(re),n.onChange?.(j))},be=()=>{const j=w?d:F;j.trim()&&!L&&(I?.(j),w||M(""))},Ne=j=>{(j.ctrlKey||j.metaKey)&&j.key==="Enter"&&(j.preventDefault(),be()),n.onKeyDown?.(j)},ye=w?d:F,Ae=L||!ye.trim()||(C?ye.length>C:!1);return l.jsxs("div",{style:{position:"relative",...i},children:[l.jsxs("div",{style:{position:"relative"},children:[l.jsx("textarea",{ref:te,value:w?d:F,onChange:$e,onFocus:j=>{j.target.style.borderColor="#1890ff",j.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",ie(j)},onBlur:j=>{j.target.style.borderColor="#d9d9d9",j.target.style.boxShadow="none",Se(j)},onKeyDown:Ne,placeholder:x||ye?g:"",maxLength:C,rows:h,disabled:L,style:{width:"100%",minHeight:`${h*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...n.style},...n}),!x&&!ye&&a&&l.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[l.jsx("span",{children:a}),S&&l.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),l.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:l.jsx(W.Button,{type:"primary",size:"small",icon:l.jsx(de.SendOutlined,{}),onClick:be,disabled:Ae,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e})})]}),T&&l.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[ye.length,"/",C]}),l.jsx("style",{children:`
6
+ `})]})};Qe.__docgenInfo={displayName:"DynamicInput",description:"动态文案输入框组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}}}};const Re=({texts:t=[],placeholder:w="请输入内容",animationSpeed:f=100,autoPlay:i=!0,value:p="",onChange:T,onSubmit:M,maxLength:C=500,showCount:$=!0,submitText:e="发送",disabled:q=!1,rows:m=4,style:l,...r})=>{const[n,o]=c.useState(""),[a,y]=c.useState(0),[h,b]=c.useState(!1),[k,B]=c.useState(!1),[E,O]=c.useState(!1),[z,W]=c.useState(p||""),Y=c.useRef(void 0),H=c.useRef(void 0),Z=c.useRef(t),ne=c.useRef(a),u=c.useRef(k),d=c.useRef(n),x=c.useRef(null);c.useEffect(()=>{Z.current=t,ne.current=a,u.current=k,d.current=n});const I=c.useCallback((Q,ce)=>{let ye=0;O(!0);const pe=()=>{ye<Q.length?(o(Q.slice(0,ye+1)),ye++,H.current=window.setTimeout(pe,f)):(O(!1),ce?.())};pe()},[f]),N=c.useCallback(Q=>{let ce=d.current.length;const ye=()=>{ce>0?(o(d.current.slice(0,ce-1)),ce--,H.current=window.setTimeout(ye,f/2)):Q?.()};ye()},[f]),U=c.useCallback(()=>{if(Z.current.length===0||u.current)return;b(!0);const Q=Z.current[ne.current];d.current?N(()=>{I(Q,()=>{Y.current=window.setTimeout(()=>{y(ce=>(ce+1)%Z.current.length),b(!1)},2e3)})}):I(Q,()=>{Y.current=window.setTimeout(()=>{y(ce=>(ce+1)%Z.current.length),b(!1)},2e3)})},[N,I]);c.useEffect(()=>(i&&t.length>0&&!k&&U(),()=>{Y.current&&window.clearTimeout(Y.current),H.current&&window.clearTimeout(H.current)}),[a,k,i,t.length,U]),c.useEffect(()=>{!h&&i&&t.length>0&&!k&&U()},[a,h,i,t.length,k,U]);const j=Q=>{B(!0),Y.current&&window.clearTimeout(Y.current),H.current&&window.clearTimeout(H.current),b(!1),O(!1),r.onFocus?.(Q)},te=Q=>{B(!1),!p&&t.length>0&&(o(""),y(0)),r.onBlur?.(Q)},oe=Q=>{const ce=Q.target.value;C&&ce.length>C||(T?T(ce):W(ce),r.onChange?.(Q))},ie=()=>{const Q=T?p:z;Q.trim()&&!q&&(M?.(Q),T||W(""))},ue=Q=>{(Q.ctrlKey||Q.metaKey)&&Q.key==="Enter"&&(Q.preventDefault(),ie()),r.onKeyDown?.(Q)},de=T?p:z,ge=q||!de.trim()||(C?de.length>C:!1);return s.jsxs("div",{style:{position:"relative",...l},children:[s.jsxs("div",{style:{position:"relative"},children:[s.jsx("textarea",{ref:x,value:T?p:z,onChange:oe,onFocus:Q=>{Q.target.style.borderColor="#1890ff",Q.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",j(Q)},onBlur:Q=>{Q.target.style.borderColor="#d9d9d9",Q.target.style.boxShadow="none",te(Q)},onKeyDown:ue,placeholder:k||de?w:"",maxLength:C,rows:m,disabled:q,style:{width:"100%",minHeight:`${m*24+16}px`,padding:"8px 60px 8px 12px",border:"1px solid #d9d9d9",borderRadius:"6px",fontSize:"14px",lineHeight:"1.5",fontFamily:"inherit",resize:"vertical",outline:"none",transition:"border-color 0.3s, box-shadow 0.3s",backgroundColor:"#fff",...r.style},...r}),!k&&!de&&n&&s.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-start",paddingTop:8,paddingLeft:12,paddingRight:12,color:"#bfbfbf",pointerEvents:"none",zIndex:2,fontSize:14,fontFamily:"inherit",lineHeight:"1.5"},children:[s.jsx("span",{children:n}),E&&s.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),s.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:s.jsx(R.Button,{type:"primary",size:"small",icon:s.jsx(xe.SendOutlined,{}),onClick:ie,disabled:ge,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e})})]}),$&&s.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[de.length,"/",C]}),s.jsx("style",{children:`
7
7
  @keyframes blink {
8
8
  0%, 50% { opacity: 1; }
9
9
  51%, 100% { opacity: 0; }
10
10
  }
11
- `})]})};je.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const Te=({src:t,poster:g,width:p=300,height:u,videoWidth:d,videoHeight:w,showPlayButton:I=!0,autoPlayOnHover:C=!0,onClick:T,onVideoLoaded:e,onVideoPlay:L,onVideoPause:h,onVideoEnded:i,className:n,style:a,...o})=>{const r=c.useRef(null),[s,f]=c.useState(!1),[v,x]=c.useState(!1),[D,S]=c.useState(!1),G=c.useCallback(()=>{r.current&&(r.current.play(),f(!0),L?.())},[L]),F=c.useCallback(()=>{r.current&&(r.current.pause(),f(!1),h?.())},[h]),M=c.useCallback(ae=>{ae.stopPropagation(),s?F():G()},[s,G,F]),U=c.useCallback(()=>{x(!0),C&&!s&&G()},[C,s,G]),J=c.useCallback(()=>{x(!1),C&&s&&F()},[C,s,F]),Q=c.useCallback(()=>{S(!0),e?.()},[e]),Z=c.useCallback(()=>{f(!0),L?.()},[L]),N=c.useCallback(()=>{f(!1),h?.()},[h]),H=c.useCallback(()=>{f(!1),i?.()},[i]),te=c.useCallback(ae=>{T?.(ae)},[T]);return l.jsx(W.Card,{...o,className:`video-card ${n||""}`,style:{width:p,height:u,padding:0,overflow:"hidden",cursor:T?"pointer":"default",border:"none",borderRadius:0,...a},bordered:!1,onMouseEnter:U,onMouseLeave:J,onClick:te,children:l.jsxs("div",{className:"video-card-container",children:[l.jsx("video",{ref:r,src:t,poster:g,preload:"metadata",onLoadedData:Q,onPlay:Z,onPause:N,onEnded:H,muted:!0,loop:!0}),I&&l.jsx("div",{className:`video-play-button ${v?"hovered":""}`,onClick:M,children:s?l.jsx(de.PauseCircleOutlined,{className:"play-icon"}):l.jsx(de.PlayCircleOutlined,{className:"play-icon"})}),!D&&l.jsx("div",{className:"video-loading-mask",children:l.jsx("div",{className:"loading-spinner"})})]})})};Te.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const ut=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(p=>t.toLowerCase().includes(p)),dt=t=>t.type?t.type:ut(t.url)?"video":"image",Ke=({items:t,columns:g,gap:p=0,responsive:u=!0,breakpoints:d={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:w,style:I,onClick:C})=>{const T=c.useRef(null),[e,L]=c.useState(g||d.md||3),h=c.useRef(new Map),i=c.useCallback(()=>{if(!u||g)return g||d.md||3;const r=window.innerWidth;return r<576?d.xs||1:r<768?d.sm||2:r<992?d.md||3:r<1200?d.lg||4:r<1600?d.xl||5:d.xxl||6},[u,g,d]),n=c.useCallback(()=>{if(!T.current)return;const r=e,s=T.current,v=(s.offsetWidth-p*(r-1))/r,x=new Array(r).fill(0);t.forEach((S,G)=>{const F=S.id||G,M=h.current.get(F);if(!M)return;const U=Math.min(...x),J=x.indexOf(U),Q=J*(v+p),Z=x[J];M.style.position="absolute",M.style.left=`${Q}px`,M.style.top=`${Z}px`,M.style.width=`${v}px`,x[J]+=M.offsetHeight+p});const D=Math.max(...x);s.style.height=`${D}px`},[t,e,p]);c.useEffect(()=>{const r=()=>{const s=i();s!==e&&L(s)};if(u)return window.addEventListener("resize",r),r(),()=>window.removeEventListener("resize",r)},[u,i,e]),c.useEffect(()=>{const r=setTimeout(()=>{n()},100);return()=>clearTimeout(r)},[t,e,n]);const a=c.useCallback(()=>{n()},[n]),o=c.useCallback(r=>{C&&C(r),r.onClick?.(r)},[C]);return l.jsx("div",{ref:T,className:`waterfall-container ${w||""}`,style:{position:"relative",width:"100%",...I},children:t.map((r,s)=>{const f=r.id||s,v=dt(r);return l.jsx("div",{ref:x=>{x?h.current.set(f,x):h.current.delete(f)},className:"waterfall-item",children:v==="video"?l.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:C||r.onClick?"pointer":"default"},children:l.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:l.jsx(Te,{src:r.url,poster:r.poster,width:"100%",height:"100%",onClick:()=>o(r),onVideoLoaded:a,autoPlayOnHover:!0,showPlayButton:!1})})}):l.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>o(r),style:{cursor:C||r.onClick?"pointer":"default"},children:l.jsx("img",{src:r.url,alt:`瀑布流图片 ${s+1}`,className:"waterfall-image",onLoad:a,onError:a,style:{display:"block",width:"100%",height:"auto"}})})},f)})})};Ke.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const pt={algorithm:W.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};X.AdvancedTable=He,X.AppModal=Ve,X.BackButton=Pe,X.Button=Ie,X.Card=Be,X.DynamicInput=We,X.DynamicTextArea=je,X.EmptyAndSpin=De,X.LinkButton=Me,X.PageTable=_e,X.RichTextEditor=Oe,X.VideoCard=Te,X.VirtualTable=ze,X.Waterfall=Ke,X.XcIcon=Ge,X.lightTheme=pt,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});
11
+ `})]})};Re.__docgenInfo={displayName:"DynamicTextArea",description:"动态文案文本域组件,支持流式文字动画效果",props:{texts:{name:"texts",required:!0,description:"动态展示的文案数组",type:{name:"string[]",raw:"string[]"}},placeholder:{name:"placeholder",required:!1,description:"输入框占位符",type:{name:"string",raw:"string"},defaultValue:{value:'"请输入内容"'}},animationSpeed:{name:"animationSpeed",required:!1,description:"动画速度(毫秒)",type:{name:"number",raw:"number"},defaultValue:{value:"100"}},autoPlay:{name:"autoPlay",required:!1,description:"是否自动播放动画",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},value:{name:"value",required:!1,description:"输入框值",type:{name:"string",raw:"string"}},onChange:{name:"onChange",required:!1,description:"输入框变化回调",type:{name:"function",raw:"(value: string) => void"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const Me=({src:t,poster:w,width:f=300,height:i,videoWidth:p,videoHeight:T,showPlayButton:M=!0,autoPlayOnHover:C=!0,onClick:$,onVideoLoaded:e,onVideoPlay:q,onVideoPause:m,onVideoEnded:l,className:r,style:n,...o})=>{const a=c.useRef(null),[y,h]=c.useState(!1),[b,k]=c.useState(!1),[B,E]=c.useState(!1),O=c.useCallback(()=>{a.current&&(a.current.play(),h(!0),q?.())},[q]),z=c.useCallback(()=>{a.current&&(a.current.pause(),h(!1),m?.())},[m]),W=c.useCallback(I=>{I.stopPropagation(),y?z():O()},[y,O,z]),Y=c.useCallback(()=>{k(!0),C&&!y&&O()},[C,y,O]),H=c.useCallback(()=>{k(!1),C&&y&&z()},[C,y,z]),Z=c.useCallback(()=>{E(!0),e?.()},[e]),ne=c.useCallback(()=>{h(!0),q?.()},[q]),u=c.useCallback(()=>{h(!1),m?.()},[m]),d=c.useCallback(()=>{h(!1),l?.()},[l]),x=c.useCallback(I=>{$?.(I)},[$]);return s.jsx(R.Card,{...o,className:`video-card ${r||""}`,style:{width:f,height:i,padding:0,overflow:"hidden",cursor:$?"pointer":"default",border:"none",borderRadius:0,...n},bordered:!1,onMouseEnter:Y,onMouseLeave:H,onClick:x,children:s.jsxs("div",{className:"video-card-container",children:[s.jsx("video",{ref:a,src:t,poster:w,preload:"metadata",onLoadedData:Z,onPlay:ne,onPause:u,onEnded:d,muted:!0,loop:!0}),M&&s.jsx("div",{className:`video-play-button ${b?"hovered":""}`,onClick:W,children:y?s.jsx(xe.PauseCircleOutlined,{className:"play-icon"}):s.jsx(xe.PlayCircleOutlined,{className:"play-icon"})}),!B&&s.jsx("div",{className:"video-loading-mask",children:s.jsx("div",{className:"loading-spinner"})})]})})};Me.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const wt=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(f=>t.toLowerCase().includes(f)),Et=t=>t.type?t.type:wt(t.url)?"video":"image",Ze=({items:t,columns:w,gap:f=0,responsive:i=!0,breakpoints:p={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:T,style:M,onClick:C})=>{const $=c.useRef(null),[e,q]=c.useState(w||p.md||3),m=c.useRef(new Map),l=c.useCallback(()=>{if(!i||w)return w||p.md||3;const a=window.innerWidth;return a<576?p.xs||1:a<768?p.sm||2:a<992?p.md||3:a<1200?p.lg||4:a<1600?p.xl||5:p.xxl||6},[i,w,p]),r=c.useCallback(()=>{if(!$.current)return;const a=e,y=$.current,b=(y.offsetWidth-f*(a-1))/a,k=new Array(a).fill(0);t.forEach((E,O)=>{const z=E.id||O,W=m.current.get(z);if(!W)return;const Y=Math.min(...k),H=k.indexOf(Y),Z=H*(b+f),ne=k[H];W.style.position="absolute",W.style.left=`${Z}px`,W.style.top=`${ne}px`,W.style.width=`${b}px`,k[H]+=W.offsetHeight+f});const B=Math.max(...k);y.style.height=`${B}px`},[t,e,f]);c.useEffect(()=>{const a=()=>{const y=l();y!==e&&q(y)};if(i)return window.addEventListener("resize",a),a(),()=>window.removeEventListener("resize",a)},[i,l,e]),c.useEffect(()=>{const a=setTimeout(()=>{r()},100);return()=>clearTimeout(a)},[t,e,r]);const n=c.useCallback(()=>{r()},[r]),o=c.useCallback(a=>{C&&C(a),a.onClick?.(a)},[C]);return s.jsx("div",{ref:$,className:`waterfall-container ${T||""}`,style:{position:"relative",width:"100%",...M},children:t.map((a,y)=>{const h=a.id||y,b=Et(a);return s.jsx("div",{ref:k=>{k?m.current.set(h,k):m.current.delete(h)},className:"waterfall-item",children:b==="video"?s.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:C||a.onClick?"pointer":"default"},children:s.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:s.jsx(Me,{src:a.url,poster:a.poster,width:"100%",height:"100%",onClick:()=>o(a),onVideoLoaded:n,autoPlayOnHover:!0,showPlayButton:!1})})}):s.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>o(a),style:{cursor:C||a.onClick?"pointer":"default"},children:s.jsx("img",{src:a.url,alt:`瀑布流图片 ${y+1}`,className:"waterfall-image",onLoad:n,onError:n,style:{display:"block",width:"100%",height:"auto"}})})},h)})})};Ze.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const $t={algorithm:R.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};ae.AdvancedTable=Ue,ae.AppModal=Ge,ae.BackButton=We,ae.Button=Pe,ae.Card=Oe,ae.DynamicInput=Qe,ae.DynamicTextArea=Re,ae.EmptyAndSpin=ze,ae.LinkButton=je,ae.PageTable=He,ae.RichTextEditor=Ke,ae.VideoCard=Me,ae.VirtualTable=Je,ae.Waterfall=Ze,ae.XcIcon=Fe,ae.lightTheme=$t,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})});
12
12
  //# sourceMappingURL=index.umd.js.map