@yuku123/z-ctc-component 1.0.17 → 1.0.19

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.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Jd=Object.defineProperty;var Xd=(e,t,n)=>t in e?Jd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ue=(e,t,n)=>Xd(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),u=require("antd"),jt=require("@yuku123/z-frontend-common/ui"),d=require("react"),me=require("@ant-design/icons"),Xt=require("@yuku123/z-frontend-common");require("react-dom/client");const zc=require("react-dom"),Qd=require("react-router-dom");function ef(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const be=ef(d),tf="# z-ctc-component\n\nz-ctc 4A 中心的**可复用前端组件层**(library mode):账号 / 组织 / 部门 / 用户组 / 租户 / 域 / 角色 / 资源 /\n权限 / 审计 / 字典 / 短链这一整套管理组件。主壳「系统工作台」按域接进来后,ctc 域的页面都从这里出。\n\n- **npm 包名**:`@yuku123/z-ctc-component`\n- **宿主接入**:`import { ComponentDocPage } from '@yuku123/z-ctc-component'`(主壳取文档页的统一名,lead 008 §7)\n 或直接消费各管理组件(`OrgPage` / `AccountManagement` / `RoleManagement` / …)\n- **后端**:z-ctc 后端,前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 默认 `/api`)\n- **技术栈**:React 19 + antd 6 + `@yuku123/z-frontend-common`(基座 `createRequest` 统一解包 `Result<T>`)\n\n> ⚠ 本仓与 `z-ctc-suit` 是**两个不同的包**:suit 是 4A 中心的独立运行壳(`private: true`,不发布 npm),\n> 它不再自建页面,菜单里的每一页都是本包组件的薄包装;本包承载的是**组件层**(`src/components/**`)。\n> 两边视角不同、API 大体重叠 —— 本文件描述的是**本包**的能力面。\n\n---\n\n## 一、能力概览\n\n| 能力 | 组件 | 源文件 | 说明 |\n|------|------|--------|------|\n| 4A 总览 | `CtcOverview` | `components/CtcOverview/index.jsx` | 4A 中心概览入口 |\n| 组织 / 部门 / 组 | `OrgPage`、`OrgManagement` | `components/OrgPage/`、`components/OrgManagement/` | 三级树 CRUD;`OrgPage` 自带租户 / 域拉取,`OrgManagement` 由调用方传 `tenants` / `domains` |\n| 租户 / 域 | `TenantManagement` | `components/TenantManagement/` | 左树右表:租户维护 + 租户下的域维护 |\n| 账号 | `AccountManagement` | `components/AccountManagement/` | 账号列表、新增 / 停用、分配角色、改密 / 重置口令、删除 |\n| 角色 | `RoleManagement` | `components/RoleManagement/` | 角色 CRUD(4A AUTHZ 域) |\n| 权限 | `PermissionManagement` | `components/PermissionManagement/` | 资源 × 角色的授权配置 |\n| 资源(权限点) | `ResourcePage` | `components/ResourcePage/index.jsx` | 全域权限点统一视图,按应用分页查询 |\n| 用户权限 | `UserPermissionPage` | `components/UserPermissionPage/index.jsx` | 查某用户的角色 + 权限资源树 |\n| 应用 | `ApplicationManagement` | `components/ApplicationManagement/` | split-panel:左应用列表,右「基本信息 + Tabs(API 资产 / 菜单 / 按钮 / 数据)」 |\n| 审计 | `AuditPage` | `components/AuditPage/index.jsx` | 审计中心,按类型 Tabs 隔离日志(登录日志等) |\n| 字典 | `DictPage` | `components/DictPage/index.jsx` | 字典类型 + 字典项维护 |\n| 短链 | `SurlManagement` | `components/SurlManagement/` | 生成短码、查元信息、失效 |\n| 通用件 | `UserTable`、`StatusTag` | `components/UserTable.jsx`、`components/StatusTag.jsx` | 可复用的用户表格 / 状态标签 |\n\n### 路由\n\n本包**不自带**路由表;页面由调用方组合(本仓 `src/pages-manifest.tsx` 只提供一条骨架路由 `/z-ctc/hello`)。\n主壳工作台按宿主前缀 `/ctc/*` 挂,文档页的实际路径见第五节。\n\n## 二、导出面\n\n```ts\n// 主入口\nimport { ComponentDocPage } from '@yuku123/z-ctc-component'; // 主壳按统一名取文档页(lead 008 §7)\nimport HelloCtc from '@yuku123/z-ctc-component'; // 默认导出桶(宿主可能依赖其形状)\n\n// 管理组件\nimport { OrgPage, TenantManagement, AccountManagement, ApplicationManagement,\n RoleManagement, PermissionManagement, ResourcePage, UserPermissionPage,\n SurlManagement, DictPage, AuditPage, CtcOverview, OrgManagement,\n UserTable, StatusTag } from '@yuku123/z-ctc-component';\n\n// API client(顶栏租户 / 域下拉要用)\nimport { ctcAcTenantApi, ctcAcDomainApi } from '@yuku123/z-ctc-component';\n\n// /pages 子路径\nimport { routes, appMeta } from '@yuku123/z-ctc-component/pages';\n```\n\n- `ComponentDocPage` 是**具名再导出**(`export { default as ComponentDocPage } from './pages/ComponentDoc'`),\n 与默认导出桶 `export default { HelloCtc }` **并存** —— 默认桶的形状不动(宿主可能依赖它)。\n- `src/index.d.ts` 是手写声明文件(TS 走它、运行时走 `.js`),新增导出必须**同步补进去**,\n 否则 TS 侧会报 TS2305「no exported member」而运行期正常。\n\n## 三、API 端点\n\n前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 可改),下表路径是 `src/components/**/api.js`\n与 `src/components/_api/**` 里**实际调用**的路径。\n\n### 3.1 账号(AC 域,`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/accounts` | 建账号,返回新 ID |\n| GET | `/ctc/ac/accounts` | 账号列表(按租户 / 域过滤)或按 `id` 查单条 |\n| PUT | `/ctc/ac/accounts` | 改账号(`id` 走请求参数) |\n| DELETE | `/ctc/ac/accounts` | 删账号 |\n| POST | `/ctc/ac/accounts/status` | 启用 / 停用 |\n| POST | `/ctc/ac/accounts/password/change` | 改口令 |\n| POST | `/ctc/ac/accounts/password/reset` | 重置口令 |\n| POST | `/ctc/ac/accounts/assign-role` | 给账号分配角色 |\n\n### 3.2 租户 / 域(AC 域,`TenantManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/tenants` | 建租户 |\n| GET | `/ctc/ac/tenants` | 按 `tenantCode` 查租户 |\n| GET | `/ctc/ac/tenants/list` | 租户全量列表 |\n| POST | `/ctc/ac/tenants/status` | 启用 / 停用租户 |\n| GET | `/ctc/ac/domains/list` | 某租户下的域列表 |\n| GET | `/ctc/ac/domains/list-all` | 域全量列表 |\n| GET | `/ctc/ac/domains` | 按 `id` 查域 |\n| POST | `/ctc/ac/domains` | 建域 |\n| PUT | `/ctc/ac/domains` | 改域 |\n| DELETE | `/ctc/ac/domains` | 删域 |\n\n### 3.3 组织 / 部门 / 组(AC 域,`OrgManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST / GET / PUT / DELETE | `/ctc/ac/orgs` | 组织增删改查;列表走 `/ctc/ac/orgs/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/depts` | 部门增删改查;列表走 `/ctc/ac/depts/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/groups` | 用户组增删改查;列表走 `/ctc/ac/groups/list` |\n\n组织 / 部门 / 组三级都以 `tenantCode` + `domainCode` 为前缀过滤,组再带 `deptCode`;\n主键类参数一律走**请求参数**(`?xxx=`),不用路径变量。\n\n### 3.4 授权(AUTHZ 域,`_api/ctcAuthorization.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/authz/resources/page-by-app`、`/list`、`/page`、`/distinct-apps` | 资源(权限点)分页 / 列表 / 按应用 |\n| GET / POST / PUT / DELETE | `/ctc/authz/resources` | 资源增删改查 |\n| GET | `/ctc/authz/resources/roles` | 某资源上的角色 |\n| POST / DELETE | `/ctc/authz/roles/grant-resource`、`/ctc/authz/roles/revoke-resource` | 角色 ↔ 资源 绑定 / 解绑 |\n| GET | `/ctc/authz/roles/list`、`/page` | 角色清单 / 分页 |\n| GET / POST / PUT / DELETE | `/ctc/authz/roles` | 角色增删改查 |\n| GET | `/ctc/authz/users/roles`、`/ctc/authz/users/permissions` | 某用户的角色 / 权限 |\n| POST / DELETE | `/ctc/authz/users/grant-role`、`/ctc/authz/users/revoke-role` | 用户 ↔ 角色 授予 / 撤销 |\n| GET | `/ctc/authz/roles/resources` | 某角色拥有的资源 |\n| POST | `/ctc/authz/check` | 鉴权判定 |\n\n### 3.5 应用(`_api/metaApp.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/meta-app/list` | 应用清单 |\n| GET | `/meta-app/get` | 应用详情 |\n| POST | `/meta-app` | 建应用 |\n| PUT | `/meta-app` | 改应用 |\n| DELETE | `/meta-app` | 删应用 |\n\n### 3.6 字典(`_api/dict.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/dict/type/list`、`/dict/type/get` | 字典类型列表 / 详情 |\n| POST / PUT / DELETE | `/dict/type` | 字典类型增删改 |\n| GET | `/dict/item/list`、`/dict/items/get` | 字典项列表(按 `dictId` 或 `dictCode`) |\n| POST / PUT / DELETE | `/dict/item` | 字典项增删改 |\n\n### 3.7 审计 / 登录日志(`_api/loginLog.js`、`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/ac/login-log/list` | 登录日志列表 |\n| GET | `/ctc/ac/login-log/page` | 登录日志分页 |\n| GET | `/ctc/ac/login-log/recent` | 最近登录 |\n| POST | `/ctc/ac/login-log/list` | 登录日志条件查询(账号页在用) |\n\n### 3.8 短链(`SurlManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/surl/shorten` | 生成短码 |\n| GET | `/ctc/surl/info` | 查短码元信息 |\n| DELETE | `/ctc/surl` | 失效短码 |\n| GET | `/s/{mapKey}` | 短链跳转(前端拼 `origin + /s/{mapKey}`) |\n\n## 四、组件说明\n\n### 4.1 组织 / 部门 / 组(OrgPage、OrgManagement)\n\n左树右表布局,三级联动:租户 → 域 → 组织 → 部门 → 用户组。\n`OrgPage` 是**标准页面**:自己拉租户 / 域并维护选中态;`OrgManagement` 是**业务组件**:\n租户 / 域由调用方通过 props 传入(本组件不耦合 z-meta),适合嵌进别的页面。\n\n### 4.2 租户 / 域(TenantManagement)\n\n左树右表。租户支持新建、按 code 查询、启停用、全量列表;域挂在选中租户下,支持新建 / 改 / 删。\n`ctcAcTenantApi` / `ctcAcDomainApi` 同时从主入口导出,供宿主顶栏的租户 / 域下拉直接调用。\n\n### 4.3 账号(AccountManagement)\n\n列表 + 新增 / 停用 / 分配角色 / 改密 / 重置口令 / 删除。\n\n### 4.4 应用(ApplicationManagement)\n\nsplit-panel:左侧应用紧凑列表(编辑 / 停用 / 删除),右侧整块替换为「应用基本信息 + Tabs」,\n每个 Tab 一张表(API 资产 / 菜单 / 按钮 / 数据)。\n\n### 4.5 授权(RoleManagement / PermissionManagement / ResourcePage / UserPermissionPage)\n\n- **角色**:角色 CRUD。\n- **权限**:资源 × 角色的授权配置(授予 / 撤销)。\n- **资源**:全域权限点统一视图,按应用分页。\n- **用户权限**:输入用户 → 看他的角色 + 权限资源树(用户列表来自 AC 域,角色 / 权限来自 AUTHZ 域)。\n\n### 4.6 审计 / 字典 / 短链\n\n审计中心按类型 Tabs 隔离日志(当前实现登录日志);字典是类型 + 字典项两级;短链是生成 / 查询 / 失效三件套。\n\n### 4.7 组件文档\n\n本文件。内容以 `?raw` 在编译期内联进 bundle(零额外请求);渲染用基座\n`@yuku123/z-frontend-common/ui` 的 `ComponentDoc`(左 240px TOC + 右正文两栏)。\n\n## 五、路由与宿主接入\n\n| 场景 | 路径 | 说明 |\n|---|---|---|\n| 独立壳(`z-ctc-suit`) | `/z-ctc/docs` | 本包 `src/pages-manifest.tsx` 里 `routes` 的路径;独立壳把 `routes` 数组直接铺成 `<Route>` |\n| 主壳「系统工作台」 | **`/ctc/docs`** | 工作台按**宿主前缀**挂各域(`/ctc/*`),文档页由主壳 `SystemShell.tsx` 的路由表指向本包导出的 `ComponentDocPage` |\n\n⚠ 两者路径**不同源**:manifest 的 `/z-ctc/docs` 只在独立壳里生效;工作台里走宿主前缀 `/ctc/docs`\n(主壳的路由表注释写明:manifest 的 routes 是给独立壳用的,工作台按宿主前缀挂,manifest 路径在工作台不生效)。\n\n## 六、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| API 前缀 | `/api` | 各 `api.js` 的 `configureApiBaseURL(baseURL)` 可覆写 |\n| 超时 | 15000ms | `createRequest({baseURL, timeout})` |\n| 响应解包 | 基座统一拦截器 | 业务层拿到的已经是内层数据,**不要**再 `.then(r => r.data)` |\n| 参数规约 | 请求参数 | 主键 / 编码一律 `?xxx=`,不用路径变量 |\n\n## 七、已知限制\n\n- **认证策略配置(密码策略、第三方登录)还没有迁进本包** —— 那张页面目前仍住在 `z-ctc-suit/src/pages/AuthnPage.jsx`,\n 本包不含对应组件与端点。\n- **本包不含路由表**:真实页面路由由宿主(独立壳 / 主壳)决定,本包只提供组件与 `routes` 骨架。\n- `src/index.d.ts` 是手写声明文件,**新增导出必须同步补**,否则 TS 侧报 TS2305 而运行期正常。\n- `OrgManagement` 依赖调用方传入 `tenants` / `domains`,不自己拉租户域(避免耦合 z-meta)。\n- 主键类参数走请求参数,URL 变长;后端因此不能靠路径变量路由。\n\n## 八、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 1.0.4(本次改动,版本号未抬) | 落地 lead 008 §7:新增本文件 + `src/pages/ComponentDoc.tsx` 薄包装 + `pages-manifest` 里 `/z-ctc/docs` 路由 + 主入口(与 `index.d.ts`)具名再导出 `ComponentDocPage` |\n| 1.0.4 | 4A 组件层:账号 / 组织 / 部门 / 组 / 租户 / 域 / 角色 / 资源 / 权限 / 应用 / 审计 / 字典 / 短链 |\n";function nf(){return s.jsx(jt.ComponentDoc,{markdown:tf,title:"组件文档 — z-ctc"})}function rf({dataSource:e,loading:t,onEdit:n,onDelete:r,onRefresh:a}){const i=[{title:"用户名",dataIndex:"userName",key:"userName"},{title:"昵称",dataIndex:"nickName",key:"nickName"},{title:"手机号",dataIndex:"phone",key:"phone"},{title:"邮箱",dataIndex:"email",key:"email"},{title:"状态",dataIndex:"status",key:"status",render:o=>s.jsx(u.Tag,{color:o===1?"green":"red",children:o===1?"正常":"禁用"})},{title:"操作",key:"action",render:(o,l)=>s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>n==null?void 0:n(l),children:"编辑"}),s.jsx(u.Button,{type:"link",size:"small",danger:!0,onClick:()=>r==null?void 0:r(l),children:"删除"})]})}];return s.jsx(jt.ListTable,{rows:e,columns:i,loading:t,rowKey:"id",searchKeys:["userName","nickName","phone","email"],searchPlaceholder:"按用户名 / 昵称 / 手机号 / 邮箱过滤"})}const sf={1:{color:"green",text:"正常"},0:{color:"red",text:"禁用"},pending:{color:"orange",text:"待处理"},approved:{color:"blue",text:"已通过"},rejected:{color:"red",text:"已拒绝"}};function af({status:e,map:t}){const n=(t==null?void 0:t[e])||sf[e]||{color:"default",text:e};return s.jsx(u.Tag,{color:n.color,children:n.text})}let Bc="/api";function of(e){Bc=e||"/api"}function ft(){return Xt.createRequest({baseURL:Bc,timeout:15e3})}const ua={create:e=>ft().post("/ctc/ac/orgs",e),listByDomain:(e,t)=>ft().get("/ctc/ac/orgs/list",{params:{tenantCode:e,domainCode:t}}),getByCode:(e,t,n)=>ft().get("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}}),update:(e,t,n,r)=>ft().put("/ctc/ac/orgs",r,{params:{tenantCode:e,domainCode:t,orgCode:n}}),delete:(e,t,n)=>ft().delete("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}})},Ur={create:e=>ft().post("/ctc/ac/depts",e),listByOrg:(e,t,n)=>ft().get("/ctc/ac/depts/list",{params:{tenantCode:e,domainCode:t,orgCode:n}}),getByCode:(e,t,n,r)=>ft().get("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),update:(e,t,n,r)=>ft().put("/ctc/ac/depts",r,{params:{tenantCode:e,domainCode:t,deptCode:n}}),delete:(e,t,n,r)=>ft().delete("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}})},da={create:e=>ft().post("/ctc/ac/groups",e),listByDept:(e,t,n)=>ft().get("/ctc/ac/groups/list",{params:{tenantCode:e,domainCode:t,deptCode:n}}),getByCode:(e,t,n,r)=>ft().get("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),update:(e,t,n,r,a)=>ft().put("/ctc/ac/groups",a,{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),delete:(e,t,n,r)=>ft().delete("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}})},lf="z_org_ext_config",So={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Dt={org:{label:"组织",color:"#1677ff"},dept:{label:"部门",color:"#52c41a"},group:{label:"组别",color:"#fa8c16"}};function Sn(e,t){return`${e}:${t}`}function sn(e,t){return t==="org"?e.orgCode:t==="dept"?e.deptCode:e.groupCode}function Kr(e){return e.orgName||e.deptName||e.groupName||""}function Wr(e){return e.groupCode?"group":e.deptCode?"dept":"org"}function Co(e,t){try{return JSON.parse(localStorage.getItem(t)||"{}")[e]||[]}catch{return[]}}function wo(e,t,n){const r=JSON.parse(localStorage.getItem(n)||"{}");r[e]=t,localStorage.setItem(n,JSON.stringify(r))}function Vc({selectedTenant:e=null,selectedDomain:t=null,apiBaseURL:n,extConfigStorageKey:r=lf}){var fe,J;d.useEffect(()=>{n&&of(n)},[n]);const[a,i]=d.useState({}),[o,l]=d.useState({}),[c,h]=d.useState({}),[g,f]=d.useState([]),[m,p]=d.useState([]),[S,y]=d.useState([]),[w,v]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState([]),[T,$]=d.useState(!1),[F,E]=d.useState(null),[M]=u.Form.useForm(),[k,V]=d.useState(!1),[z,A]=d.useState(null),[I,R]=d.useState(null),[D]=u.Form.useForm(),O=d.useCallback(async(K,te)=>{if(!K||!te)return[];const oe=await ua.listByDomain(K,te),xe=Array.isArray(oe)?oe:[];return i(ae=>({...ae,[te]:xe})),xe},[]),N=d.useCallback(async(K,te,oe)=>{if(!K||!te||!oe)return[];const xe=await Ur.listByOrg(K,te,oe),ae=Array.isArray(xe)?xe:[];return l(ee=>({...ee,[oe]:ae})),ae},[]),q=d.useCallback(async(K,te,oe)=>{if(!K||!te||!oe)return[];const xe=await da.listByDept(K,te,oe),ae=Array.isArray(xe)?xe:[];return h(ee=>({...ee,[oe]:ae})),ae},[]);d.useEffect(()=>{if(!e||!t){f([]);return}if(!a[t]){O(e,t);return}const te=(a[t]||[]).map(oe=>({key:Sn("org",oe.orgCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(u.Tag,{color:Dt.org.color,style:{margin:0},children:"组织"}),oe.orgName||oe.orgCode,oe.status===0&&s.jsx(u.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"org",data:oe},isLeaf:!1}));f(te)},[e,t,a,O]);const L=async K=>{const{key:te,data:oe,type:xe}=K;let ae=[];xe==="org"?ae=(await N(e,t,oe.orgCode)).map(de=>({key:Sn("dept",de.deptCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(u.Tag,{color:Dt.dept.color,style:{margin:0},children:"部门"}),de.deptName||de.deptCode,de.status===0&&s.jsx(u.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"dept",data:de},isLeaf:!1})):xe==="dept"&&(ae=(await q(e,t,oe.deptCode)).map(de=>({key:Sn("group",de.groupCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(u.Tag,{color:Dt.group.color,style:{margin:0},children:"组"}),de.groupName||de.groupCode,de.status===0&&s.jsx(u.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"group",data:de},isLeaf:!0}))),f(ee=>H(ee,te,ae))},H=(K,te,oe)=>K.map(xe=>xe.key===te?{...xe,children:oe}:xe.children?{...xe,children:H(xe.children,te,oe)}:xe),G=(K,te)=>{if(!K||K.length===0)return;const oe=K[0];y([oe]);const xe=te.node.data;v(xe),C(Co(oe,r)),xe.type==="org"?b(o[xe.data.orgCode]||[]):xe.type==="dept"?b(c[xe.data.deptCode]||[]):b([])},W=K=>{var de;const te=K.data,oe=te==null?void 0:te.type,xe=te==null?void 0:te.data,ae=oe==="org"?[{key:"dept",label:s.jsxs("span",{children:[s.jsx(u.Tag,{color:Dt.dept.color,children:"部门"})," 新增部门"]})}]:oe==="dept"?[{key:"group",label:s.jsxs("span",{children:[s.jsx(u.Tag,{color:Dt.group.color,children:"组别"})," 新增组别"]})}]:[],ee=oe&&((de=Dt[oe])==null?void 0:de.label)||"节点";return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},onClick:he=>he.stopPropagation(),children:[s.jsx("span",{style:{flex:1},children:K.title}),ae.length>0&&s.jsx(u.Dropdown,{menu:{items:ae,onClick:({key:he})=>_(he,xe)},trigger:["click"],children:s.jsx(u.Button,{size:"small",type:"text",icon:s.jsx(me.PlusOutlined,{style:{fontSize:11}}),onClick:he=>he.stopPropagation()})}),s.jsx(u.Popconfirm,{title:`确定删除该${ee}?`,onConfirm:()=>oe&&B(oe,xe),onCancel:he=>he==null?void 0:he.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(u.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(me.DeleteOutlined,{style:{fontSize:11}}),onClick:he=>he.stopPropagation()})})]})},B=async(K,te)=>{try{const oe=te.tenantCode||e,xe=te.domainCode||t;if(!oe||!xe){u.message.error("租户/域信息缺失, 无法删除");return}K==="org"?(await ua.delete(oe,xe,te.orgCode),await O(oe,xe)):K==="dept"?(await Ur.delete(oe,xe,te.deptCode,te.orgCode),te.orgCode&&await N(oe,xe,te.orgCode)):K==="group"&&(await da.delete(oe,xe,te.deptCode,te.groupCode),te.deptCode&&await q(oe,xe,te.deptCode)),u.message.success("删除成功"),w&&sn(w.data,w.type)===sn(te,K)&&(v(null),C([]),b([]),y([]))}catch(oe){u.message.error("删除失败:"+((oe==null?void 0:oe.message)||"未知错误"))}},_=(K,te)=>{A(K),R(te||null),D.resetFields(),V(!0)},Y=d.useMemo(()=>{const K=(I==null?void 0:I.data)||I||{},te={tenantCode:K.tenantCode||e,domainCode:K.domainCode||t};return z==="dept"&&(te.orgCode=K.orgCode),z==="group"&&(te.deptCode=K.deptCode,K.orgCode&&(te.orgCode=K.orgCode)),te},[z,I,e,t]),P=async()=>{if(z)try{const K=await D.validateFields(),te={...Y,...K,status:Number(K.status??1),description:K.description||"",extConfig:"[]"};if(z==="org"){await ua.create(te);const oe=te.domainCode||t;oe&&await O(te.tenantCode,oe)}else if(z==="dept"){await Ur.create(te);const oe=te.orgCode;if(oe&&await N(te.tenantCode,te.domainCode,oe),(w==null?void 0:w.type)==="org"&&w.data.orgCode===oe){const xe=await Ur.listByOrg(te.tenantCode,te.domainCode,oe);b(xe)}}else if(z==="group"){await da.create(te);const oe=te.deptCode;oe&&await q(te.tenantCode,te.domainCode,oe)}u.message.success("创建成功"),V(!1)}catch(K){if(K!=null&&K.errorFields)return;u.message.error("创建失败:"+((K==null?void 0:K.message)||"未知错误"))}},U=async()=>{if(w)try{const K=await M.validateFields();let te;if(F)te=x.map(xe=>xe.key===F.key?{key:K.dataId,value:K.content}:xe);else{if(x.some(xe=>xe.key===K.dataId)){u.message.error("Key 已存在");return}te=[...x,{key:K.dataId,value:K.content}]}const oe=Sn(w.type,sn(w.data,w.type));wo(oe,te,r),C(te),$(!1),E(null),M.resetFields(),u.message.success("保存成功")}catch(K){if(K!=null&&K.errorFields)return;u.message.error("保存失败")}},X=K=>{if(!w)return;const te=Sn(w.type,sn(w.data,w.type)),oe=x.filter(xe=>xe.key!==K.key);wo(te,oe,r),C(oe),u.message.success("删除成功")},ne=(K,te)=>{const oe=sn(K,te);y([Sn(te,oe)]),v({type:te,data:K}),C(Co(Sn(te,oe),r)),b(te==="org"?o[K.orgCode]||[]:te==="dept"?c[K.deptCode]||[]:[])},[Z,re]=d.useState(""),ie=d.useMemo(()=>j.map((K,te)=>({...K,key:te})),[j]),se=d.useMemo(()=>{const K=Z.trim().toLowerCase();return K?ie.filter(te=>`${sn(te,Wr(te))||""} ${Kr(te)||""}`.toLowerCase().includes(K)):ie},[ie,Z]),pe=[{title:"编码",dataIndex:"code",width:140,render:(K,te)=>sn(te,Wr(te))},{title:"名称",dataIndex:"name",ellipsis:!0,render:(K,te)=>Kr(te)},{title:"类型",dataIndex:"type",width:100,render:(K,te)=>{const oe=Wr(te);return s.jsx(u.Tag,{color:Dt[oe].color,children:Dt[oe].label})}},{title:"操作",dataIndex:"action",width:100,render:(K,te)=>{const oe=Wr(te);return s.jsx(u.Button,{type:"link",size:"small",onClick:()=>ne(te,oe),children:"详情"})}}],ge=[{title:"Key",dataIndex:"key",width:200,ellipsis:!0},{title:"Value",dataIndex:"value",ellipsis:!0},{title:"操作",width:140,render:(K,te)=>s.jsxs(u.Space,{children:[s.jsx(u.Button,{size:"small",type:"link",onClick:()=>{E(te),M.setFieldsValue({dataId:te.key,content:te.value}),$(!0)},children:"编辑"}),s.jsx(u.Popconfirm,{title:"确认删除",onConfirm:()=>X(te),children:s.jsx(u.Button,{size:"small",type:"link",danger:!0,children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,flex:1,minHeight:0},children:[s.jsxs("div",{style:{display:"flex",gap:16,flex:1,minHeight:0},children:[s.jsx(u.Card,{size:"small",style:{width:340,overflow:"auto",flexShrink:0},title:"组织树",extra:s.jsxs(u.Space,{size:4,children:[t&&s.jsx(u.Tooltip,{title:"新增组织",children:s.jsx(u.Button,{size:"small",type:"primary",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>_("org",{tenantCode:e,domainCode:t})})}),s.jsx(u.Tooltip,{title:"刷新",children:s.jsx(u.Button,{size:"small",icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>O(e,t)})})]}),children:t?g.length>0?s.jsx(u.Tree,{treeData:g,onSelect:G,loadData:L,titleRender:W,blockNode:!0,showLine:!0,showIcon:!1,expandedKeys:m,onExpand:p,selectedKeys:S}):s.jsx(u.Empty,{description:"该域下暂无组织,请点击右上角新增"}):s.jsx(u.Empty,{description:"未获取到登录租户/域上下文"})}),s.jsx(u.Card,{size:"small",style:{flex:1,overflow:"auto"},children:w?s.jsxs(s.Fragment,{children:[s.jsxs(u.Descriptions,{title:`${Dt[w.type].label}信息 — ${Kr(w.data)}`,size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[s.jsx(u.Descriptions.Item,{label:"编码",children:sn(w.data,w.type)}),s.jsx(u.Descriptions.Item,{label:"名称",children:Kr(w.data)}),s.jsx(u.Descriptions.Item,{label:"租户",children:w.data.tenantCode||"-"}),s.jsx(u.Descriptions.Item,{label:"域",children:w.data.domainCode||"-"}),w.type!=="org"&&s.jsx(u.Descriptions.Item,{label:"所属组织",children:w.data.orgCode}),w.type==="group"&&s.jsx(u.Descriptions.Item,{label:"所属部门",children:w.data.deptCode}),s.jsx(u.Descriptions.Item,{label:"状态",span:w.type==="group"?1:2,children:s.jsx(u.Tag,{color:(fe=So[w.data.status??1])==null?void 0:fe.color,children:(J=So[w.data.status??1])==null?void 0:J.text})}),s.jsx(u.Descriptions.Item,{label:"描述",span:2,children:w.data.description||"-"})]}),w.type!=="group"&&s.jsx(u.Card,{type:"inner",title:w.type==="org"?"下级部门 / 组":"下级组",size:"small",style:{marginBottom:16},extra:s.jsx(u.Space,{children:s.jsx(u.Input.Search,{allowClear:!0,placeholder:"按编码 / 名称过滤",style:{width:220},onChange:K=>re(K.target.value)})}),children:s.jsx(u.Table,{columns:pe,dataSource:se,rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无下级"}})}),s.jsx(u.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsx(u.Button,{size:"small",type:"primary",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>{E(null),M.resetFields(),$(!0)},children:"新增"}),children:s.jsx(u.Table,{columns:ge,dataSource:x.map((K,te)=>({...K,key:K.key||te})),rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无扩展配置"}})})]}):s.jsx(u.Empty,{description:"请从左侧选择组织/部门/组"})})]}),s.jsx(u.Modal,{title:F?"编辑配置":"新增配置",open:T,onCancel:()=>{$(!1),E(null)},onOk:U,destroyOnHidden:!0,children:s.jsxs(u.Form,{form:M,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(u.Input,{disabled:!!F})}),s.jsx(u.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(u.Input.TextArea,{rows:4})})]})}),s.jsxs(u.Modal,{title:z?`新增${Dt[z].label}`:"新增",open:k,onCancel:()=>V(!1),onOk:P,destroyOnHidden:!0,children:[s.jsxs("div",{style:{marginTop:12,padding:"8px 12px",background:"#f7f8fa",borderRadius:6,fontSize:12,color:"#666",display:"flex",flexWrap:"wrap",gap:16},children:[s.jsxs("span",{children:["租户:",Y.tenantCode||"-"]}),s.jsxs("span",{children:["域:",Y.domainCode||"-"]}),z==="dept"&&s.jsxs("span",{children:["所属组织:",Y.orgCode||"-"]}),z==="group"&&s.jsxs("span",{children:["所属部门:",Y.deptCode||"-"]})]}),s.jsxs(u.Form,{form:D,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:z==="org"?"orgCode":z==="dept"?"deptCode":"groupCode",label:"编码",rules:[{required:!0}],children:s.jsx(u.Input,{placeholder:"唯一标识"})}),s.jsx(u.Form.Item,{name:z==="org"?"orgName":z==="dept"?"deptName":"groupName",label:"名称",rules:[{required:!0}],children:s.jsx(u.Input,{})}),s.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:2})})]})]})]})}let Hc="/api";function Ni(e){Hc=e||"/api"}function kt(){return Xt.createRequest({baseURL:Hc,timeout:15e3})}const Kn={create:e=>kt().post("/ctc/ac/tenants",e),getByCode:e=>kt().get("/ctc/ac/tenants",{params:{tenantCode:e}}),updateStatus:(e,t)=>kt().post("/ctc/ac/tenants/status",null,{params:{tenantCode:e,status:t}}),listAll:()=>kt().get("/ctc/ac/tenants/list"),listAllForPlatform:()=>kt().get("/ctc/ac/tenants/list-all")},_t={listByTenant:e=>kt().get("/ctc/ac/domains/list",{params:{tenantCode:e}}),listAll:()=>kt().get("/ctc/ac/domains/list-all"),getById:e=>kt().get("/ctc/ac/domains",{params:{id:e}}),create:e=>kt().post("/ctc/ac/domains",e),update:(e,t)=>kt().put("/ctc/ac/domains",t,{params:{id:e}}),delete:e=>kt().delete("/ctc/ac/domains",{params:{id:e}})};function Ka(e,t){const n=t==null?void 0:t.domainCode;return n?n==="default"||!!e&&n===`${e}-default`:!1}function cf(){let e="",t="";try{const n=JSON.parse(localStorage.getItem("userInfo")||"{}");e=String((n==null?void 0:n.tenantCode)??""),t=String((n==null?void 0:n.domainCode)??"")}catch{}try{const n=JSON.parse(localStorage.getItem("z_ctc_domain")||"null");n&&n.tenantCode&&n.tenantCode===e&&n.domainCode&&(t=String(n.domainCode))}catch{}return{tenantCode:e||null,domainCode:t||null}}function uf({apiBaseURL:e}){d.useEffect(()=>{e&&Ni(e)},[e]);const[{tenantCode:t,domainCode:n},r]=d.useState(cf);return s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:s.jsx(Vc,{selectedTenant:t,selectedDomain:n,apiBaseURL:"/api"})})}function Ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ps={exports:{}},df=ps.exports,jo;function Yc(){return jo||(jo=1,(function(e,t){(function(n,r){e.exports=r()})(df,(function(){var n=1e3,r=6e4,a=36e5,i="millisecond",o="second",l="minute",c="hour",h="day",g="week",f="month",m="quarter",p="year",S="date",y="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|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,x={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(A){var I=["th","st","nd","rd"],R=A%100;return"["+A+(I[(R-20)%10]||I[R]||I[0])+"]"}},C=function(A,I,R){var D=String(A);return!D||D.length>=I?A:""+Array(I+1-D.length).join(R)+A},j={s:C,z:function(A){var I=-A.utcOffset(),R=Math.abs(I),D=Math.floor(R/60),O=R%60;return(I<=0?"+":"-")+C(D,2,"0")+":"+C(O,2,"0")},m:function A(I,R){if(I.date()<R.date())return-A(R,I);var D=12*(R.year()-I.year())+(R.month()-I.month()),O=I.clone().add(D,f),N=R-O<0,q=I.clone().add(D+(N?-1:1),f);return+(-(D+(R-O)/(N?O-q:q-O))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:p,w:g,d:h,D:S,h:c,m:l,s:o,ms:i,Q:m}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},b="en",T={};T[b]=x;var $="$isDayjsObject",F=function(A){return A instanceof V||!(!A||!A[$])},E=function A(I,R,D){var O;if(!I)return b;if(typeof I=="string"){var N=I.toLowerCase();T[N]&&(O=N),R&&(T[N]=R,O=N);var q=I.split("-");if(!O&&q.length>1)return A(q[0])}else{var L=I.name;T[L]=I,O=L}return!D&&O&&(b=O),O||!D&&b},M=function(A,I){if(F(A))return A.clone();var R=typeof I=="object"?I:{};return R.date=A,R.args=arguments,new V(R)},k=j;k.l=E,k.i=F,k.w=function(A,I){return M(A,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var V=(function(){function A(R){this.$L=E(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[$]=!0}var I=A.prototype;return I.parse=function(R){this.$d=(function(D){var O=D.date,N=D.utc;if(O===null)return new Date(NaN);if(k.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var q=O.match(w);if(q){var L=q[2]-1||0,H=(q[7]||"0").substring(0,3);return N?new Date(Date.UTC(q[1],L,q[3]||1,q[4]||0,q[5]||0,q[6]||0,H)):new Date(q[1],L,q[3]||1,q[4]||0,q[5]||0,q[6]||0,H)}}return new Date(O)})(R),this.init()},I.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},I.$utils=function(){return k},I.isValid=function(){return this.$d.toString()!==y},I.isSame=function(R,D){var O=M(R);return this.startOf(D)<=O&&O<=this.endOf(D)},I.isAfter=function(R,D){return M(R)<this.startOf(D)},I.isBefore=function(R,D){return this.endOf(D)<M(R)},I.$g=function(R,D,O){return k.u(R)?this[D]:this.set(O,R)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(R,D){var O=this,N=!!k.u(D)||D,q=k.p(R),L=function(U,X){var ne=k.w(O.$u?Date.UTC(O.$y,X,U):new Date(O.$y,X,U),O);return N?ne:ne.endOf(h)},H=function(U,X){return k.w(O.toDate()[U].apply(O.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(X)),O)},G=this.$W,W=this.$M,B=this.$D,_="set"+(this.$u?"UTC":"");switch(q){case p:return N?L(1,0):L(31,11);case f:return N?L(1,W):L(0,W+1);case g:var Y=this.$locale().weekStart||0,P=(G<Y?G+7:G)-Y;return L(N?B-P:B+(6-P),W);case h:case S:return H(_+"Hours",0);case c:return H(_+"Minutes",1);case l:return H(_+"Seconds",2);case o:return H(_+"Milliseconds",3);default:return this.clone()}},I.endOf=function(R){return this.startOf(R,!1)},I.$set=function(R,D){var O,N=k.p(R),q="set"+(this.$u?"UTC":""),L=(O={},O[h]=q+"Date",O[S]=q+"Date",O[f]=q+"Month",O[p]=q+"FullYear",O[c]=q+"Hours",O[l]=q+"Minutes",O[o]=q+"Seconds",O[i]=q+"Milliseconds",O)[N],H=N===h?this.$D+(D-this.$W):D;if(N===f||N===p){var G=this.clone().set(S,1);G.$d[L](H),G.init(),this.$d=G.set(S,Math.min(this.$D,G.daysInMonth())).$d}else L&&this.$d[L](H);return this.init(),this},I.set=function(R,D){return this.clone().$set(R,D)},I.get=function(R){return this[k.p(R)]()},I.add=function(R,D){var O,N=this;R=Number(R);var q=k.p(D),L=function(W){var B=M(N);return k.w(B.date(B.date()+Math.round(W*R)),N)};if(q===f)return this.set(f,this.$M+R);if(q===p)return this.set(p,this.$y+R);if(q===h)return L(1);if(q===g)return L(7);var H=(O={},O[l]=r,O[c]=a,O[o]=n,O)[q]||1,G=this.$d.getTime()+R*H;return k.w(G,this)},I.subtract=function(R,D){return this.add(-1*R,D)},I.format=function(R){var D=this,O=this.$locale();if(!this.isValid())return O.invalidDate||y;var N=R||"YYYY-MM-DDTHH:mm:ssZ",q=k.z(this),L=this.$H,H=this.$m,G=this.$M,W=O.weekdays,B=O.months,_=O.meridiem,Y=function(X,ne,Z,re){return X&&(X[ne]||X(D,N))||Z[ne].slice(0,re)},P=function(X){return k.s(L%12||12,X,"0")},U=_||function(X,ne,Z){var re=X<12?"AM":"PM";return Z?re.toLowerCase():re};return N.replace(v,(function(X,ne){return ne||(function(Z){switch(Z){case"YY":return String(D.$y).slice(-2);case"YYYY":return k.s(D.$y,4,"0");case"M":return G+1;case"MM":return k.s(G+1,2,"0");case"MMM":return Y(O.monthsShort,G,B,3);case"MMMM":return Y(B,G);case"D":return D.$D;case"DD":return k.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return Y(O.weekdaysMin,D.$W,W,2);case"ddd":return Y(O.weekdaysShort,D.$W,W,3);case"dddd":return W[D.$W];case"H":return String(L);case"HH":return k.s(L,2,"0");case"h":return P(1);case"hh":return P(2);case"a":return U(L,H,!0);case"A":return U(L,H,!1);case"m":return String(H);case"mm":return k.s(H,2,"0");case"s":return String(D.$s);case"ss":return k.s(D.$s,2,"0");case"SSS":return k.s(D.$ms,3,"0");case"Z":return q}return null})(X)||q.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(R,D,O){var N,q=this,L=k.p(D),H=M(R),G=(H.utcOffset()-this.utcOffset())*r,W=this-H,B=function(){return k.m(q,H)};switch(L){case p:N=B()/12;break;case f:N=B();break;case m:N=B()/3;break;case g:N=(W-G)/6048e5;break;case h:N=(W-G)/864e5;break;case c:N=W/a;break;case l:N=W/r;break;case o:N=W/n;break;default:N=W}return O?N:k.a(N)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return T[this.$L]},I.locale=function(R,D){if(!R)return this.$L;var O=this.clone(),N=E(R,D,!0);return N&&(O.$L=N),O},I.clone=function(){return k.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},A})(),z=V.prototype;return M.prototype=z,[["$ms",i],["$s",o],["$m",l],["$H",c],["$W",h],["$M",f],["$y",p],["$D",S]].forEach((function(A){z[A[1]]=function(I){return this.$g(I,A[0],A[1])}})),M.extend=function(A,I){return A.$i||(A(I,V,M),A.$i=!0),M},M.locale=E,M.isDayjs=F,M.unix=function(A){return M(1e3*A)},M.en=T[b],M.Ls=T,M.p={},M}))})(ps)),ps.exports}var ff=Yc();const Te=Ht(ff),an={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},fa=(e,t,n)=>e==="tenant"?`tenant:${t}`:`domain:${t}:${n}`;function mf({apiBaseURL:e,platformView:t=!1}){var K,te,oe,xe;d.useEffect(()=>{e&&Ni(e)},[e]);const[n,r]=d.useState([]),[a,i]=d.useState(!1),[o,l]=d.useState({}),[c,h]=d.useState({}),[g,f]=d.useState([]),[m,p]=d.useState([]),[S,y]=d.useState([]),[w,v]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState(!1),[T]=u.Form.useForm(),[$,F]=d.useState(!1),[E,M]=d.useState(null),[k]=u.Form.useForm(),[V,z]=d.useState(!1),[A,I]=d.useState(null),[R]=u.Form.useForm(),[D,O]=d.useState(()=>{try{const ae=Number(localStorage.getItem("ctc_tenant_tree_width"));return Number.isFinite(ae)&&ae>=220&&ae<=640?ae:320}catch{return 320}}),N=d.useRef(D),q=ae=>{ae.preventDefault();const ee=ae.clientX,de=N.current,he=Ee=>{const ke=Math.min(640,Math.max(220,de+Ee.clientX-ee));N.current=ke,O(ke)},je=()=>{document.removeEventListener("mousemove",he),document.removeEventListener("mouseup",je),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem("ctc_tenant_tree_width",String(N.current))}catch{}};document.addEventListener("mousemove",he),document.addEventListener("mouseup",je),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},L=d.useCallback(async()=>{i(!0);try{const ae=t?await Kn.listAllForPlatform():await Kn.listAll();r(Array.isArray(ae)?ae:[])}catch(ae){u.message.error((t?"获取全平台租户失败(系统租户面板仅平台管理员可访问):":"获取租户列表失败:")+((ae==null?void 0:ae.message)||"未知错误")),r([])}finally{i(!1)}},[t]);d.useEffect(()=>{L()},[L]);const H=d.useCallback(async ae=>{const ee=await Promise.all(ae.map(async de=>{try{const he=await _t.listByTenant(de.tenantCode);return[de.tenantCode,Array.isArray(he)?he:[]]}catch{return[de.tenantCode,[]]}}));l(Object.fromEntries(ee))},[]);d.useEffect(()=>{n.length>0&&H(n)},[n,H]),d.useEffect(()=>{const ae=n.map(ee=>{var de,he;return{key:fa("tenant",ee.tenantCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ee.tenantName||ee.tenantCode}),s.jsx(u.Tag,{color:(de=an[ee.status??1])==null?void 0:de.color,style:{margin:0,fontSize:10,flexShrink:0},children:(he=an[ee.status??1])==null?void 0:he.text})]}),rawTitle:`${ee.tenantName||ee.tenantCode} (${ee.tenantCode})`,data:{type:"tenant",data:ee},children:(Array.isArray(o[ee.tenantCode])?o[ee.tenantCode]:[]).map(je=>{var Ee,ke;return{key:fa("domain",ee.tenantCode,je.domainCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:je.domainName}),s.jsx(u.Tag,{color:(Ee=an[je.status])==null?void 0:Ee.color,style:{margin:0,fontSize:10,flexShrink:0},children:(ke=an[je.status])==null?void 0:ke.text})]}),rawTitle:`${je.domainName} (${je.domainCode})`,data:{type:"domain",data:je},isLeaf:!0}})}});f(ae),y(ee=>ee.length>0?ee:ae.map(de=>de.key))},[n,o]);const G=async(ae,ee)=>{if(Ka(ae,ee)){u.message.warning("默认域受保护,不可删除");return}if(ee.id==null){u.message.error("域 ID 缺失");return}try{await _t.delete(ee.id),u.message.success("删除成功");const de=await _t.listByTenant(ae);l(he=>({...he,[ae]:Array.isArray(de)?de:[]}))}catch(de){u.message.error("删除失败:"+((de==null?void 0:de.message)||"未知错误"))}},W=async()=>{try{const ae=await T.validateFields();await Kn.create({...ae,status:1}),u.message.success("创建成功"),b(!1),T.resetFields(),await L()}catch(ae){if(ae!=null&&ae.errorFields)return;u.message.error("创建失败:"+((ae==null?void 0:ae.message)||"未知错误"))}},B=async(ae,ee)=>{const de=ee===1?0:1;try{await Kn.updateStatus(ae,de),u.message.success(de===1?"已启用":"已停用"),await L()}catch(he){u.message.error("操作失败:"+((he==null?void 0:he.message)||"未知错误"))}},_=ae=>{M(ae),k.resetFields(),k.setFieldsValue({status:1}),F(!0)},Y=async()=>{if(E)try{const ae=await k.validateFields(),ee=E.tenantCode;await _t.create({domainCode:ae.domainCode,domainName:ae.domainName,tenantCode:ee,status:ae.status??1}),u.message.success(`已为租户「${E.tenantName||ee}」新增域「${ae.domainName}」`),F(!1),k.resetFields();const de=await _t.listByTenant(ee),he=Array.isArray(de)?de:[];l(Ee=>({...Ee,[ee]:he}));const je=fa("tenant",ee);y(Ee=>Ee.includes(je)?Ee:[...Ee,je])}catch(ae){if(ae!=null&&ae.errorFields)return;u.message.error("新增域失败:"+((ae==null?void 0:ae.message)||"未知错误"))}},P=(ae,ee)=>{if(ae.length===0)return;const de=ae[0];p([de]);const he=ee.node.data;v(he),C(c[de]||[])},U=async()=>{if(m[0])try{const ae=await R.validateFields();let ee;if(A)ee=x.map(de=>de.key===A.key?{key:ae.dataId,value:ae.content}:de);else{if(x.some(de=>de.key===ae.dataId)){u.message.error("Key 已存在");return}ee=[...x,{key:ae.dataId,value:ae.content}]}h(de=>({...de,[m[0]]:ee})),C(ee),u.message.success(A?"更新成功":"创建成功"),z(!1),I(null),R.resetFields()}catch(ae){if(ae!=null&&ae.errorFields)return;u.message.error("保存失败")}},X=ae=>{const ee=x.filter(de=>de.key!==ae.key);h(de=>({...de,[m[0]]:ee})),C(ee),u.message.success("删除成功")},ne=(w==null?void 0:w.type)==="tenant"?w.data:null,Z=(w==null?void 0:w.type)==="domain"?w.data:null,re=Z?n.find(ae=>ae.tenantCode===Z.tenantCode):null,[ie,se]=d.useState(""),pe=d.useMemo(()=>x.map((ae,ee)=>({...ae,_idx:ee})),[x]),ge=d.useMemo(()=>{const ae=ie.trim().toLowerCase();return ae?pe.filter(ee=>`${ee.key||""} ${ee.value||""}`.toLowerCase().includes(ae)):pe},[pe,ie]),fe=[{title:"Key",dataIndex:"key",key:"key",width:200},{title:"Value",dataIndex:"value",key:"value",ellipsis:!0},{title:"操作",key:"action",width:120,render:(ae,ee)=>s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>{I(ee),R.setFieldsValue({dataId:ee.key,content:ee.value}),z(!0)},children:"编辑"}),s.jsx(u.Popconfirm,{title:"确认删除该配置?",onConfirm:()=>X(ee),children:s.jsx(u.Button,{type:"link",danger:!0,size:"small",children:"删除"})})]})}],J=ae=>{const ee=ae.data;if(ee.type==="tenant"){const je=ee.data;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:ae.title}),s.jsx(u.Tooltip,{title:"新增域",children:s.jsx(u.Button,{size:"small",type:"text",icon:s.jsx(me.PlusOutlined,{style:{fontSize:11}}),onClick:Ee=>{Ee.stopPropagation(),_(je)}})})]})}const de=ee.data,he=de.tenantCode;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:ae.title}),s.jsx(u.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:je=>{je==null||je.stopPropagation(),G(he,de)},onCancel:je=>je==null?void 0:je.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(u.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(me.DeleteOutlined,{style:{fontSize:11}}),onClick:je=>je.stopPropagation()})})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs("div",{style:{display:"flex",gap:0,height:"calc(100vh - 140px)"},children:[s.jsx(u.Card,{title:"租户 / 域",size:"small",style:{width:D,minWidth:D,flexShrink:0},styles:{body:{padding:8,overflow:"auto",height:"calc(100% - 40px)"}},extra:s.jsxs(u.Space,{size:4,children:[s.jsx(u.Tooltip,{title:"新增租户",children:s.jsx(u.Button,{size:"small",type:"text",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>{T.resetFields(),b(!0)}})}),s.jsx(u.Tooltip,{title:"刷新",children:s.jsx(u.Button,{size:"small",type:"text",icon:s.jsx(me.ReloadOutlined,{}),onClick:L})})]}),children:g.length>0?s.jsx(u.Tree,{treeData:g,selectedKeys:m,onSelect:P,titleRender:J,expandedKeys:S,onExpand:y,defaultExpandAll:!0,showLine:!0,className:"ctc-tenant-tree",blockNode:!0}):s.jsx(u.Empty,{description:a?"加载中...":'暂无租户,点击右上"新增租户"图标创建'})}),s.jsx("div",{onMouseDown:q,title:"拖动调整宽度",style:{width:5,flexShrink:0,cursor:"col-resize",borderRadius:2,background:"#eef0f3"}}),s.jsx(u.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},children:w?s.jsxs(s.Fragment,{children:[s.jsx(u.Descriptions,{title:ne?"租户信息":"域信息",size:"small",bordered:!0,column:2,style:{marginBottom:16},children:ne?s.jsxs(s.Fragment,{children:[s.jsx(u.Descriptions.Item,{label:"编码",children:ne.tenantCode}),s.jsx(u.Descriptions.Item,{label:"名称",children:ne.tenantName}),s.jsx(u.Descriptions.Item,{label:"描述",span:2,children:ne.description||"-"}),s.jsx(u.Descriptions.Item,{label:"状态",children:s.jsx(u.Popconfirm,{title:`确认${ne.status===1?"停用":"启用"}该租户?`,onConfirm:()=>B(ne.tenantCode,ne.status??1),children:s.jsxs(u.Button,{size:"small",type:"link",danger:ne.status===1,children:[s.jsx(u.Tag,{color:(K=an[ne.status??1])==null?void 0:K.color,children:(te=an[ne.status??1])==null?void 0:te.text}),s.jsx("span",{style:{marginLeft:4,fontSize:12},children:"点击切换"})]})})}),s.jsx(u.Descriptions.Item,{label:"创建时间",children:ne.createdAt||"-"})]}):s.jsxs(s.Fragment,{children:[s.jsx(u.Descriptions.Item,{label:"编码",children:Z.domainCode}),s.jsx(u.Descriptions.Item,{label:"名称",children:Z.domainName}),s.jsx(u.Descriptions.Item,{label:"所属租户",children:(re==null?void 0:re.tenantName)||Z.tenantCode}),s.jsx(u.Descriptions.Item,{label:"状态",children:s.jsx(u.Tag,{color:(oe=an[Z.status])==null?void 0:oe.color,children:(xe=an[Z.status])==null?void 0:xe.text})})]})}),s.jsx(u.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsxs(u.Space,{children:[s.jsx(u.Input.Search,{allowClear:!0,placeholder:"按 Key / Value 过滤",style:{width:220},onChange:ae=>se(ae.target.value)}),s.jsx(u.Button,{type:"primary",size:"small",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>{I(null),R.resetFields(),z(!0)},children:"新增"})]}),children:s.jsx(u.Table,{columns:fe,dataSource:ge,rowKey:ae=>`${ae.key}_${ae._idx}`,pagination:!1,size:"small",locale:{emptyText:'暂无扩展配置,点击右上"新增"添加'}})})]}):s.jsx(u.Empty,{description:"请从左侧选择租户或域",style:{marginTop:80}})})]}),s.jsx(u.Modal,{title:"新建租户",open:j,onOk:W,onCancel:()=>b(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:T,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"tenantCode",label:"租户编码",rules:[{required:!0,message:"请输入租户编码"},{pattern:/^[a-z0-9_]+$/,message:"仅允许小写字母数字下划线"}],extra:"唯一标识,创建后不可修改",children:s.jsx(u.Input,{placeholder:"如 default / tenant_a"})}),s.jsx(u.Form.Item,{name:"tenantName",label:"租户名称",rules:[{required:!0}],children:s.jsx(u.Input,{placeholder:"如 默认租户"})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:3,placeholder:"可选"})})]})}),s.jsx(u.Modal,{title:A?"编辑配置":"新增配置",open:V,onOk:U,onCancel:()=>{z(!1),I(null)},destroyOnHidden:!0,children:s.jsxs(u.Form,{form:R,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(u.Input,{disabled:!!A,placeholder:"如 max_users"})}),s.jsx(u.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(u.Input.TextArea,{rows:4,placeholder:"配置值"})})]})}),s.jsx(u.Modal,{title:E?`为「${E.tenantName||E.tenantCode}」新增域`:"新增域",open:$,onOk:Y,onCancel:()=>{F(!1),k.resetFields()},size:"large",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:k,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{label:"所属租户",children:s.jsx(u.Input,{value:(E==null?void 0:E.tenantName)||"",disabled:!0})}),s.jsx(u.Form.Item,{name:"domainCode",label:"域编码",rules:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(u.Input,{placeholder:"如 prod / staging"})}),s.jsx(u.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(u.Input,{placeholder:"如 生产环境"})}),s.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})})]})})]})}const ma={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function hf({apiBaseURL:e}){d.useEffect(()=>{e&&Ni(e)},[e]);const[t,n]=d.useState([]),[r,a]=d.useState(""),[i,o]=d.useState(!1),[l,c]=d.useState([]),[h,g]=d.useState(!1),[f,m]=d.useState(!1),[p,S]=d.useState(null),[y]=u.Form.useForm(),w=d.useCallback(async()=>{o(!0);try{const F=await Kn.listAll(),E=Array.isArray(F)?F:[];n(E),a(M=>{var k;return E.some(V=>V.tenantCode===M)?M:((k=E[0])==null?void 0:k.tenantCode)||""})}catch(F){u.message.error("获取我的租户失败:"+((F==null?void 0:F.message)||"未知错误")),n([]),a("")}finally{o(!1)}},[]),v=d.useCallback(async F=>{if(!F){c([]);return}g(!0);try{const E=await _t.listByTenant(F);c(Array.isArray(E)?E:[])}catch(E){u.message.error("获取域列表失败:"+((E==null?void 0:E.message)||"未知错误")),c([])}finally{g(!1)}},[]);d.useEffect(()=>{w()},[w]),d.useEffect(()=>{v(r)},[r,v]);const x=d.useMemo(()=>t.find(F=>F.tenantCode===r)||null,[t,r]),C=()=>{S(null),y.resetFields(),y.setFieldsValue({status:1}),m(!0)},j=F=>{S(F),y.resetFields(),y.setFieldsValue({domainCode:F.domainCode,domainName:F.domainName,description:F.description,status:F.status??1}),m(!0)},b=async()=>{if(r)try{const F=await y.validateFields();p?(await _t.update(p.id,{domainName:F.domainName,description:F.description||"",status:F.status??1}),u.message.success("已保存")):(await _t.create({domainCode:F.domainCode,domainName:F.domainName,description:F.description||"",tenantCode:r,status:F.status??1}),u.message.success(`已新增域「${F.domainName}」`)),m(!1),S(null),y.resetFields(),await v(r)}catch(F){if(F!=null&&F.errorFields)return;u.message.error("保存失败:"+((F==null?void 0:F.message)||"未知错误"))}},T=async F=>{if(Ka(r,F)){u.message.warning("默认域受保护,不可删除");return}try{await _t.delete(F.id),u.message.success("已删除"),await v(r)}catch(E){u.message.error("删除失败:"+((E==null?void 0:E.message)||"未知错误"))}},$=[{title:"域编码",dataIndex:"domainCode",key:"domainCode",width:220},{title:"域名称",dataIndex:"domainName",key:"domainName",width:200},{title:"状态",dataIndex:"status",key:"status",width:100,render:F=>{const E=ma[F]||{text:String(F??"-"),color:"default"};return s.jsx(u.Tag,{color:E.color,children:E.text})}},{title:"描述",dataIndex:"description",key:"description",ellipsis:!0},{title:"创建时间",dataIndex:"createdAt",key:"createdAt",width:180},{title:"操作",key:"action",width:150,render:(F,E)=>s.jsxs(u.Space,{size:0,children:[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>j(E),children:"编辑"}),Ka(r,E)?s.jsx(u.Tooltip,{title:"默认域受保护,不可删除",children:s.jsx(u.Button,{type:"link",size:"small",danger:!0,disabled:!0,children:"删除"})}):s.jsx(u.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:()=>T(E),okText:"确定",cancelText:"取消",children:s.jsx(u.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return!i&&t.length===0?s.jsx(u.Card,{size:"small",children:s.jsx(u.Empty,{description:"当前账号还未加入任何租户"})}):s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(u.Card,{size:"small",title:"我的租户",extra:s.jsxs(u.Space,{size:8,children:[t.length>1&&s.jsx(u.Select,{size:"small",style:{minWidth:200},value:r||void 0,onChange:a,options:t.map(F=>({value:F.tenantCode,label:`${F.tenantName||F.tenantCode} (${F.tenantCode})`}))}),s.jsx(u.Tooltip,{title:"刷新",children:s.jsx(u.Button,{size:"small",type:"text",icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>{w(),v(r)}})})]}),children:x?s.jsxs(u.Descriptions,{size:"small",bordered:!0,column:{xs:1,sm:2,md:2,lg:4},children:[s.jsx(u.Descriptions.Item,{label:"租户编码",children:x.tenantCode}),s.jsx(u.Descriptions.Item,{label:"租户名称",children:x.tenantName||"-"}),s.jsx(u.Descriptions.Item,{label:"状态",children:s.jsx(u.Tag,{color:(ma[x.status??1]||{}).color,children:(ma[x.status??1]||{text:"-"}).text})}),s.jsx(u.Descriptions.Item,{label:"创建时间",children:x.createdAt||"-"})]}):s.jsx(u.Empty,{description:i?"加载中...":"暂无租户"})}),s.jsx(u.Card,{size:"small",title:"域",extra:s.jsx(u.Space,{size:4,children:s.jsx(u.Button,{type:"primary",size:"small",icon:s.jsx(me.PlusOutlined,{}),disabled:!r,onClick:C,children:"新增域"})}),children:s.jsx(u.Table,{columns:$,dataSource:l,rowKey:F=>F.id??F.domainCode,loading:h,size:"small",scroll:{x:880},pagination:{pageSize:10,showSizeChanger:!1,hideOnSinglePage:!0},locale:{emptyText:"该租户下暂无域,点击右上「新增域」创建"}})}),s.jsx(u.Modal,{title:p?`编辑域「${p.domainName}」`:`为「${(x==null?void 0:x.tenantName)||r}」新增域`,open:f,onOk:b,onCancel:()=>{m(!1),S(null),y.resetFields()},destroyOnHidden:!0,children:s.jsxs(u.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"domainCode",label:"域编码",rules:p?[]:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:p?"编码创建后不可修改":"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(u.Input,{placeholder:"如 prod / staging",disabled:!!p})}),s.jsx(u.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(u.Input,{placeholder:"如 生产环境"})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:3,placeholder:"可选"})}),s.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(u.Select,{options:[{value:1,label:"正常"},{value:0,label:"停用"}]})})]})})]})}const Uc=e=>{const t=be.useRef(e);return t.current=e,be.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])};function Nr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const vo=process.env.NODE_ENV!=="test"&&Nr()?be.useLayoutEffect:be.useEffect,gf=(e,t)=>{const n=be.useRef(!0);vo(()=>e(n.current),t),vo(()=>(n.current=!1,()=>{n.current=!0}),[])};function rt(e,t){const[n,r]=d.useState(e),a=t!==void 0?t:n;return gf(i=>{i||r(t)},[t]),[a,r]}let Kc=e=>+setTimeout(e,16),Wc=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(Kc=e=>window.requestAnimationFrame(e),Wc=e=>window.cancelAnimationFrame(e));let To=0;const Ks=new Map;function qc(e){Ks.delete(e)}const Li=(e,t=1)=>{To+=1;const n=To;function r(a){if(a===0)qc(n),e();else{const i=Kc(()=>{r(a-1)});Ks.set(n,i)}}return r(t),n};Li.cancel=e=>{const t=Ks.get(e);return qc(e),Wc(t)};process.env.NODE_ENV!=="production"&&(Li.ids=()=>Ks);function pf(e,t,n){const r=be.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var qr={exports:{}},_e={};/**
1
+ "use strict";var Qd=Object.defineProperty;var ef=(e,t,n)=>t in e?Qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ce=(e,t,n)=>ef(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),c=require("antd"),Ft=require("@yuku123/z-frontend-common/ui"),d=require("react"),de=require("@ant-design/icons"),nn=require("@yuku123/z-frontend-common");require("react-dom/client");const Gc=require("react-dom"),tf=require("react-router-dom");function nf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const xe=nf(d),rf="# z-ctc-component\n\nz-ctc 4A 中心的**可复用前端组件层**(library mode):账号 / 组织 / 部门 / 用户组 / 租户 / 域 / 角色 / 资源 /\n权限 / 审计 / 字典 / 短链这一整套管理组件。主壳「系统工作台」按域接进来后,ctc 域的页面都从这里出。\n\n- **npm 包名**:`@yuku123/z-ctc-component`\n- **宿主接入**:`import { ComponentDocPage } from '@yuku123/z-ctc-component'`(主壳取文档页的统一名,lead 008 §7)\n 或直接消费各管理组件(`OrgPage` / `AccountManagement` / `RoleManagement` / …)\n- **后端**:z-ctc 后端,前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 默认 `/api`)\n- **技术栈**:React 19 + antd 6 + `@yuku123/z-frontend-common`(基座 `createRequest` 统一解包 `Result<T>`)\n\n> ⚠ 本仓与 `z-ctc-suit` 是**两个不同的包**:suit 是 4A 中心的独立运行壳(`private: true`,不发布 npm),\n> 它不再自建页面,菜单里的每一页都是本包组件的薄包装;本包承载的是**组件层**(`src/components/**`)。\n> 两边视角不同、API 大体重叠 —— 本文件描述的是**本包**的能力面。\n\n---\n\n## 一、能力概览\n\n| 能力 | 组件 | 源文件 | 说明 |\n|------|------|--------|------|\n| 4A 总览 | `CtcOverview` | `components/CtcOverview/index.jsx` | 4A 中心概览入口 |\n| 组织 / 部门 / 组 | `OrgPage`、`OrgManagement` | `components/OrgPage/`、`components/OrgManagement/` | 三级树 CRUD;`OrgPage` 自带租户 / 域拉取,`OrgManagement` 由调用方传 `tenants` / `domains` |\n| 租户 / 域 | `TenantManagement` | `components/TenantManagement/` | 左树右表:租户维护 + 租户下的域维护 |\n| 账号 | `AccountManagement` | `components/AccountManagement/` | 账号列表、新增 / 停用、分配角色、改密 / 重置口令、删除 |\n| 角色 | `RoleManagement` | `components/RoleManagement/` | 角色 CRUD(4A AUTHZ 域) |\n| 权限 | `PermissionManagement` | `components/PermissionManagement/` | 资源 × 角色的授权配置 |\n| 资源(权限点) | `ResourcePage` | `components/ResourcePage/index.jsx` | 全域权限点统一视图,按应用分页查询 |\n| 用户权限 | `UserPermissionPage` | `components/UserPermissionPage/index.jsx` | 查某用户的角色 + 权限资源树 |\n| 应用 | `ApplicationManagement` | `components/ApplicationManagement/` | split-panel:左应用列表,右「基本信息 + Tabs(API 资产 / 菜单 / 按钮 / 数据)」 |\n| 审计 | `AuditPage` | `components/AuditPage/index.jsx` | 审计中心,按类型 Tabs 隔离日志(登录日志等) |\n| 字典 | `DictPage` | `components/DictPage/index.jsx` | 字典类型 + 字典项维护 |\n| 短链 | `SurlManagement` | `components/SurlManagement/` | 生成短码、查元信息、失效 |\n| 通用件 | `UserTable`、`StatusTag` | `components/UserTable.jsx`、`components/StatusTag.jsx` | 可复用的用户表格 / 状态标签 |\n\n### 路由\n\n本包**不自带**路由表;页面由调用方组合(本仓 `src/pages-manifest.tsx` 只提供一条骨架路由 `/z-ctc/hello`)。\n主壳工作台按宿主前缀 `/ctc/*` 挂,文档页的实际路径见第五节。\n\n## 二、导出面\n\n```ts\n// 主入口\nimport { ComponentDocPage } from '@yuku123/z-ctc-component'; // 主壳按统一名取文档页(lead 008 §7)\nimport HelloCtc from '@yuku123/z-ctc-component'; // 默认导出桶(宿主可能依赖其形状)\n\n// 管理组件\nimport { OrgPage, TenantManagement, AccountManagement, ApplicationManagement,\n RoleManagement, PermissionManagement, ResourcePage, UserPermissionPage,\n SurlManagement, DictPage, AuditPage, CtcOverview, OrgManagement,\n UserTable, StatusTag } from '@yuku123/z-ctc-component';\n\n// API client(顶栏租户 / 域下拉要用)\nimport { ctcAcTenantApi, ctcAcDomainApi } from '@yuku123/z-ctc-component';\n\n// /pages 子路径\nimport { routes, appMeta } from '@yuku123/z-ctc-component/pages';\n```\n\n- `ComponentDocPage` 是**具名再导出**(`export { default as ComponentDocPage } from './pages/ComponentDoc'`),\n 与默认导出桶 `export default { HelloCtc }` **并存** —— 默认桶的形状不动(宿主可能依赖它)。\n- `src/index.d.ts` 是手写声明文件(TS 走它、运行时走 `.js`),新增导出必须**同步补进去**,\n 否则 TS 侧会报 TS2305「no exported member」而运行期正常。\n\n## 三、API 端点\n\n前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 可改),下表路径是 `src/components/**/api.js`\n与 `src/components/_api/**` 里**实际调用**的路径。\n\n### 3.1 账号(AC 域,`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/accounts` | 建账号,返回新 ID |\n| GET | `/ctc/ac/accounts` | 账号列表(按租户 / 域过滤)或按 `id` 查单条 |\n| PUT | `/ctc/ac/accounts` | 改账号(`id` 走请求参数) |\n| DELETE | `/ctc/ac/accounts` | 删账号 |\n| POST | `/ctc/ac/accounts/status` | 启用 / 停用 |\n| POST | `/ctc/ac/accounts/password/change` | 改口令 |\n| POST | `/ctc/ac/accounts/password/reset` | 重置口令 |\n| POST | `/ctc/ac/accounts/assign-role` | 给账号分配角色 |\n\n### 3.2 租户 / 域(AC 域,`TenantManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/tenants` | 建租户 |\n| GET | `/ctc/ac/tenants` | 按 `tenantCode` 查租户 |\n| GET | `/ctc/ac/tenants/list` | 租户全量列表 |\n| POST | `/ctc/ac/tenants/status` | 启用 / 停用租户 |\n| GET | `/ctc/ac/domains/list` | 某租户下的域列表 |\n| GET | `/ctc/ac/domains/list-all` | 域全量列表 |\n| GET | `/ctc/ac/domains` | 按 `id` 查域 |\n| POST | `/ctc/ac/domains` | 建域 |\n| PUT | `/ctc/ac/domains` | 改域 |\n| DELETE | `/ctc/ac/domains` | 删域 |\n\n### 3.3 组织 / 部门 / 组(AC 域,`OrgManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST / GET / PUT / DELETE | `/ctc/ac/orgs` | 组织增删改查;列表走 `/ctc/ac/orgs/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/depts` | 部门增删改查;列表走 `/ctc/ac/depts/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/groups` | 用户组增删改查;列表走 `/ctc/ac/groups/list` |\n\n组织 / 部门 / 组三级都以 `tenantCode` + `domainCode` 为前缀过滤,组再带 `deptCode`;\n主键类参数一律走**请求参数**(`?xxx=`),不用路径变量。\n\n### 3.4 授权(AUTHZ 域,`_api/ctcAuthorization.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/authz/resources/page-by-app`、`/list`、`/page`、`/distinct-apps` | 资源(权限点)分页 / 列表 / 按应用 |\n| GET / POST / PUT / DELETE | `/ctc/authz/resources` | 资源增删改查 |\n| GET | `/ctc/authz/resources/roles` | 某资源上的角色 |\n| POST / DELETE | `/ctc/authz/roles/grant-resource`、`/ctc/authz/roles/revoke-resource` | 角色 ↔ 资源 绑定 / 解绑 |\n| GET | `/ctc/authz/roles/list`、`/page` | 角色清单 / 分页 |\n| GET / POST / PUT / DELETE | `/ctc/authz/roles` | 角色增删改查 |\n| GET | `/ctc/authz/users/roles`、`/ctc/authz/users/permissions` | 某用户的角色 / 权限 |\n| POST / DELETE | `/ctc/authz/users/grant-role`、`/ctc/authz/users/revoke-role` | 用户 ↔ 角色 授予 / 撤销 |\n| GET | `/ctc/authz/roles/resources` | 某角色拥有的资源 |\n| POST | `/ctc/authz/check` | 鉴权判定 |\n\n### 3.5 应用(`_api/metaApp.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/meta-app/list` | 应用清单 |\n| GET | `/meta-app/get` | 应用详情 |\n| POST | `/meta-app` | 建应用 |\n| PUT | `/meta-app` | 改应用 |\n| DELETE | `/meta-app` | 删应用 |\n\n### 3.6 字典(`_api/dict.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/dict/type/list`、`/dict/type/get` | 字典类型列表 / 详情 |\n| POST / PUT / DELETE | `/dict/type` | 字典类型增删改 |\n| GET | `/dict/item/list`、`/dict/items/get` | 字典项列表(按 `dictId` 或 `dictCode`) |\n| POST / PUT / DELETE | `/dict/item` | 字典项增删改 |\n\n### 3.7 审计 / 登录日志(`_api/loginLog.js`、`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/ac/login-log/list` | 登录日志列表 |\n| GET | `/ctc/ac/login-log/page` | 登录日志分页 |\n| GET | `/ctc/ac/login-log/recent` | 最近登录 |\n| POST | `/ctc/ac/login-log/list` | 登录日志条件查询(账号页在用) |\n\n### 3.8 短链(`SurlManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/surl/shorten` | 生成短码 |\n| GET | `/ctc/surl/info` | 查短码元信息 |\n| DELETE | `/ctc/surl` | 失效短码 |\n| GET | `/s/{mapKey}` | 短链跳转(前端拼 `origin + /s/{mapKey}`) |\n\n## 四、组件说明\n\n### 4.1 组织 / 部门 / 组(OrgPage、OrgManagement)\n\n左树右表布局,三级联动:租户 → 域 → 组织 → 部门 → 用户组。\n`OrgPage` 是**标准页面**:自己拉租户 / 域并维护选中态;`OrgManagement` 是**业务组件**:\n租户 / 域由调用方通过 props 传入(本组件不耦合 z-meta),适合嵌进别的页面。\n\n### 4.2 租户 / 域(TenantManagement)\n\n左树右表。租户支持新建、按 code 查询、启停用、全量列表;域挂在选中租户下,支持新建 / 改 / 删。\n`ctcAcTenantApi` / `ctcAcDomainApi` 同时从主入口导出,供宿主顶栏的租户 / 域下拉直接调用。\n\n### 4.3 账号(AccountManagement)\n\n列表 + 新增 / 停用 / 分配角色 / 改密 / 重置口令 / 删除。\n\n### 4.4 应用(ApplicationManagement)\n\nsplit-panel:左侧应用紧凑列表(编辑 / 停用 / 删除),右侧整块替换为「应用基本信息 + Tabs」,\n每个 Tab 一张表(API 资产 / 菜单 / 按钮 / 数据)。\n\n### 4.5 授权(RoleManagement / PermissionManagement / ResourcePage / UserPermissionPage)\n\n- **角色**:角色 CRUD。\n- **权限**:资源 × 角色的授权配置(授予 / 撤销)。\n- **资源**:全域权限点统一视图,按应用分页。\n- **用户权限**:输入用户 → 看他的角色 + 权限资源树(用户列表来自 AC 域,角色 / 权限来自 AUTHZ 域)。\n\n### 4.6 审计 / 字典 / 短链\n\n审计中心按类型 Tabs 隔离日志(当前实现登录日志);字典是类型 + 字典项两级;短链是生成 / 查询 / 失效三件套。\n\n### 4.7 组件文档\n\n本文件。内容以 `?raw` 在编译期内联进 bundle(零额外请求);渲染用基座\n`@yuku123/z-frontend-common/ui` 的 `ComponentDoc`(左 240px TOC + 右正文两栏)。\n\n## 五、路由与宿主接入\n\n| 场景 | 路径 | 说明 |\n|---|---|---|\n| 独立壳(`z-ctc-suit`) | `/z-ctc/docs` | 本包 `src/pages-manifest.tsx` 里 `routes` 的路径;独立壳把 `routes` 数组直接铺成 `<Route>` |\n| 主壳「系统工作台」 | **`/ctc/docs`** | 工作台按**宿主前缀**挂各域(`/ctc/*`),文档页由主壳 `SystemShell.tsx` 的路由表指向本包导出的 `ComponentDocPage` |\n\n⚠ 两者路径**不同源**:manifest 的 `/z-ctc/docs` 只在独立壳里生效;工作台里走宿主前缀 `/ctc/docs`\n(主壳的路由表注释写明:manifest 的 routes 是给独立壳用的,工作台按宿主前缀挂,manifest 路径在工作台不生效)。\n\n## 六、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| API 前缀 | `/api` | 各 `api.js` 的 `configureApiBaseURL(baseURL)` 可覆写 |\n| 超时 | 15000ms | `createRequest({baseURL, timeout})` |\n| 响应解包 | 基座统一拦截器 | 业务层拿到的已经是内层数据,**不要**再 `.then(r => r.data)` |\n| 参数规约 | 请求参数 | 主键 / 编码一律 `?xxx=`,不用路径变量 |\n\n## 七、已知限制\n\n- **认证策略配置(密码策略、第三方登录)还没有迁进本包** —— 那张页面目前仍住在 `z-ctc-suit/src/pages/AuthnPage.jsx`,\n 本包不含对应组件与端点。\n- **本包不含路由表**:真实页面路由由宿主(独立壳 / 主壳)决定,本包只提供组件与 `routes` 骨架。\n- `src/index.d.ts` 是手写声明文件,**新增导出必须同步补**,否则 TS 侧报 TS2305 而运行期正常。\n- `OrgManagement` 依赖调用方传入 `tenants` / `domains`,不自己拉租户域(避免耦合 z-meta)。\n- 主键类参数走请求参数,URL 变长;后端因此不能靠路径变量路由。\n\n## 八、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 1.0.4(本次改动,版本号未抬) | 落地 lead 008 §7:新增本文件 + `src/pages/ComponentDoc.tsx` 薄包装 + `pages-manifest` 里 `/z-ctc/docs` 路由 + 主入口(与 `index.d.ts`)具名再导出 `ComponentDocPage` |\n| 1.0.4 | 4A 组件层:账号 / 组织 / 部门 / 组 / 租户 / 域 / 角色 / 资源 / 权限 / 应用 / 审计 / 字典 / 短链 |\n";function sf(){return s.jsx(Ft.ComponentDoc,{markdown:rf,title:"组件文档 — z-ctc"})}function af({dataSource:e,loading:t,onEdit:n,onDelete:r,onRefresh:a}){const i=[{title:"用户名",dataIndex:"userName",key:"userName"},{title:"昵称",dataIndex:"nickName",key:"nickName"},{title:"手机号",dataIndex:"phone",key:"phone"},{title:"邮箱",dataIndex:"email",key:"email"},{title:"状态",dataIndex:"status",key:"status",render:o=>s.jsx(c.Tag,{color:o===1?"green":"red",children:o===1?"正常":"禁用"})},{title:"操作",key:"action",render:(o,l)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>n==null?void 0:n(l),children:"编辑"}),s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:()=>r==null?void 0:r(l),children:"删除"})]})}];return s.jsx(Ft.ListTable,{rows:e,columns:i,loading:t,rowKey:"id",searchKeys:["userName","nickName","phone","email"],searchPlaceholder:"按用户名 / 昵称 / 手机号 / 邮箱过滤"})}const of={1:{color:"green",text:"正常"},0:{color:"red",text:"禁用"},pending:{color:"orange",text:"待处理"},approved:{color:"blue",text:"已通过"},rejected:{color:"red",text:"已拒绝"}};function lf({status:e,map:t}){const n=(t==null?void 0:t[e])||of[e]||{color:"default",text:e};return s.jsx(c.Tag,{color:n.color,children:n.text})}let Zc="/api";function cf(e){Zc=e||"/api"}function pt(){return nn.createRequest({baseURL:Zc,timeout:15e3})}const Ia={create:e=>pt().post("/ctc/ac/orgs",e),listByDomain:(e,t)=>pt().get("/ctc/ac/orgs/list",{params:{tenantCode:e,domainCode:t}}),getByCode:(e,t,n)=>pt().get("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}}),update:(e,t,n,r)=>pt().put("/ctc/ac/orgs",r,{params:{tenantCode:e,domainCode:t,orgCode:n}}),delete:(e,t,n)=>pt().delete("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}})},cs={create:e=>pt().post("/ctc/ac/depts",e),listByOrg:(e,t,n)=>pt().get("/ctc/ac/depts/list",{params:{tenantCode:e,domainCode:t,orgCode:n}}),getByCode:(e,t,n,r)=>pt().get("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),update:(e,t,n,r)=>pt().put("/ctc/ac/depts",r,{params:{tenantCode:e,domainCode:t,deptCode:n}}),delete:(e,t,n,r)=>pt().delete("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}})},Ma={create:e=>pt().post("/ctc/ac/groups",e),listByDept:(e,t,n)=>pt().get("/ctc/ac/groups/list",{params:{tenantCode:e,domainCode:t,deptCode:n}}),getByCode:(e,t,n,r)=>pt().get("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),update:(e,t,n,r,a)=>pt().put("/ctc/ac/groups",a,{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),delete:(e,t,n,r)=>pt().delete("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}})},uf="z_org_ext_config",$o={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},zt={org:{label:"组织",color:"#1677ff"},dept:{label:"部门",color:"#52c41a"},group:{label:"组别",color:"#fa8c16"}};function on(e,t){return`${e}:${t}`}function ln(e,t){return t==="org"?e.orgCode:t==="dept"?e.deptCode:e.groupCode}function us(e){return e.orgName||e.deptName||e.groupName||""}function ds(e){return e.groupCode?"group":e.deptCode?"dept":"org"}function Eo(e,t){try{return JSON.parse(localStorage.getItem(t)||"{}")[e]||[]}catch{return[]}}function Io(e,t,n){const r=JSON.parse(localStorage.getItem(n)||"{}");r[e]=t,localStorage.setItem(n,JSON.stringify(r))}function Jc({selectedTenant:e=null,selectedDomain:t=null,apiBaseURL:n,extConfigStorageKey:r=uf}){var Se,Fe;d.useEffect(()=>{n&&cf(n)},[n]);const[a,i]=d.useState({}),[o,l]=d.useState({}),[u,m]=d.useState({}),[g,f]=d.useState([]),[h,p]=d.useState([]),[S,y]=d.useState([]),[w,v]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState([]),[T,R]=d.useState(!1),[F,E]=d.useState(null),[M]=c.Form.useForm(),[k,V]=d.useState(!1),[_,A]=d.useState(null),[I,$]=d.useState(null),[D]=c.Form.useForm(),O=d.useCallback(async(ie,Y)=>{if(!ie||!Y)return[];const K=await Ia.listByDomain(ie,Y),re=Array.isArray(K)?K:[];return i(fe=>({...fe,[Y]:re})),re},[]),z=d.useCallback(async(ie,Y,K)=>{if(!ie||!Y||!K)return[];const re=await cs.listByOrg(ie,Y,K),fe=Array.isArray(re)?re:[];return l(be=>({...be,[K]:fe})),fe},[]),Z=d.useCallback(async(ie,Y,K)=>{if(!ie||!Y||!K)return[];const re=await Ma.listByDept(ie,Y,K),fe=Array.isArray(re)?re:[];return m(be=>({...be,[K]:fe})),fe},[]);d.useEffect(()=>{if(!e||!t){f([]);return}if(!a[t]){O(e,t);return}const Y=(a[t]||[]).map(K=>({key:on("org",K.orgCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:zt.org.color,style:{margin:0},children:"组织"}),K.orgName||K.orgCode,K.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"org",data:K},isLeaf:!1}));f(Y)},[e,t,a,O]);const L=ie=>ie.map(Y=>({key:on("dept",Y.deptCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:zt.dept.color,style:{margin:0},children:"部门"}),Y.deptName||Y.deptCode,Y.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"dept",data:Y},isLeaf:!1})),U=ie=>ie.map(Y=>({key:on("group",Y.groupCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:zt.group.color,style:{margin:0},children:"组"}),Y.groupName||Y.groupCode,Y.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"group",data:Y},isLeaf:!0})),J=async ie=>{var Ee;const Y=(Ee=ie==null?void 0:ie.data)!=null&&Ee.type?ie.data:ie,{key:K}=ie,re=Y==null?void 0:Y.type,fe=(Y==null?void 0:Y.data)||{};let be=[];re==="org"?be=L(await z(e,t,fe.orgCode)):re==="dept"&&(be=U(await Z(e,t,fe.deptCode))),f(je=>H(je,K,be))},G=async(ie,Y)=>{let K=[];if(ie==="org")K=L(await z(e,t,Y));else if(ie==="dept")K=U(await Z(e,t,Y));else return;f(re=>H(re,on(ie,Y),K))},H=(ie,Y,K)=>ie.map(re=>re.key===Y?{...re,children:K}:re.children?{...re,children:H(re.children,Y,K)}:re),B=(ie,Y)=>{if(!ie||ie.length===0)return;const K=ie[0];y([K]);const re=Y.node.data;v(re),C(Eo(K,r)),re.type==="org"?b(o[re.data.orgCode]||[]):re.type==="dept"?b(u[re.data.deptCode]||[]):b([])},W=ie=>{var Ee;const Y=ie.data,K=Y==null?void 0:Y.type,re=Y==null?void 0:Y.data,fe=K==="org"?[{key:"dept",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:zt.dept.color,children:"部门"})," 新增部门"]})}]:K==="dept"?[{key:"group",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:zt.group.color,children:"组别"})," 新增组别"]})}]:[],be=K&&((Ee=zt[K])==null?void 0:Ee.label)||"节点";return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},onClick:je=>je.stopPropagation(),children:[s.jsx("span",{style:{flex:1},children:ie.title}),fe.length>0&&s.jsx(c.Dropdown,{menu:{items:fe,onClick:({key:je})=>q(je,re)},trigger:["click"],children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{style:{fontSize:11}}),onClick:je=>je.stopPropagation()})}),s.jsx(c.Popconfirm,{title:`确定删除该${be}?`,onConfirm:()=>K&&N(K,re),onCancel:je=>je==null?void 0:je.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(de.DeleteOutlined,{style:{fontSize:11}}),onClick:je=>je.stopPropagation()})})]})},N=async(ie,Y)=>{try{const K=Y.tenantCode||e,re=Y.domainCode||t;if(!K||!re){c.message.error("租户/域信息缺失, 无法删除");return}ie==="org"?(await Ia.delete(K,re,Y.orgCode),await O(K,re)):ie==="dept"?(await cs.delete(K,re,Y.deptCode,Y.orgCode),Y.orgCode&&await G("org",Y.orgCode)):ie==="group"&&(await Ma.delete(K,re,Y.deptCode,Y.groupCode),Y.deptCode&&await G("dept",Y.deptCode)),c.message.success("删除成功"),w&&ln(w.data,w.type)===ln(Y,ie)&&(v(null),C([]),b([]),y([]))}catch(K){c.message.error("删除失败:"+((K==null?void 0:K.message)||"未知错误"))}},q=(ie,Y)=>{A(ie),$(Y||null),D.resetFields(),V(!0)},ee=d.useMemo(()=>{const ie=(I==null?void 0:I.data)||I||{},Y={tenantCode:ie.tenantCode||e,domainCode:ie.domainCode||t};return _==="dept"&&(Y.orgCode=ie.orgCode),_==="group"&&(Y.deptCode=ie.deptCode,ie.orgCode&&(Y.orgCode=ie.orgCode)),Y},[_,I,e,t]),ne=async()=>{if(_)try{const ie=await D.validateFields(),Y={...ee,...ie,status:Number(ie.status??1),description:ie.description||"",extConfig:"[]"};if(_==="org"){await Ia.create(Y);const K=Y.domainCode||t;K&&await O(Y.tenantCode,K)}else if(_==="dept"){await cs.create(Y);const K=Y.orgCode;if(K&&await G("org",K),(w==null?void 0:w.type)==="org"&&w.data.orgCode===K){const re=await cs.listByOrg(Y.tenantCode,Y.domainCode,K);b(re)}}else if(_==="group"){await Ma.create(Y);const K=Y.deptCode;K&&await G("dept",K)}c.message.success("创建成功"),V(!1)}catch(ie){if(ie!=null&&ie.errorFields)return;c.message.error("创建失败:"+((ie==null?void 0:ie.message)||"未知错误"))}},X=async()=>{if(w)try{const ie=await M.validateFields();let Y;if(F)Y=x.map(re=>re.key===F.key?{key:ie.dataId,value:ie.content}:re);else{if(x.some(re=>re.key===ie.dataId)){c.message.error("Key 已存在");return}Y=[...x,{key:ie.dataId,value:ie.content}]}const K=on(w.type,ln(w.data,w.type));Io(K,Y,r),C(Y),R(!1),E(null),M.resetFields(),c.message.success("保存成功")}catch(ie){if(ie!=null&&ie.errorFields)return;c.message.error("保存失败")}},ae=ie=>{if(!w)return;const Y=on(w.type,ln(w.data,w.type)),K=x.filter(re=>re.key!==ie.key);Io(Y,K,r),C(K),c.message.success("删除成功")},oe=(ie,Y)=>{const K=ln(ie,Y);y([on(Y,K)]),v({type:Y,data:ie}),C(Eo(on(Y,K),r)),b(Y==="org"?o[ie.orgCode]||[]:Y==="dept"?u[ie.deptCode]||[]:[])},[ue,ge]=d.useState(""),me=d.useMemo(()=>j.map((ie,Y)=>({...ie,key:Y})),[j]),he=d.useMemo(()=>{const ie=ue.trim().toLowerCase();return ie?me.filter(Y=>`${ln(Y,ds(Y))||""} ${us(Y)||""}`.toLowerCase().includes(ie)):me},[me,ue]),Q=[{title:"编码",dataIndex:"code",width:140,render:(ie,Y)=>ln(Y,ds(Y))},{title:"名称",dataIndex:"name",ellipsis:!0,render:(ie,Y)=>us(Y)},{title:"类型",dataIndex:"type",width:100,render:(ie,Y)=>{const K=ds(Y);return s.jsx(c.Tag,{color:zt[K].color,children:zt[K].label})}},{title:"操作",dataIndex:"action",width:100,render:(ie,Y)=>{const K=ds(Y);return s.jsx(c.Button,{type:"link",size:"small",onClick:()=>oe(Y,K),children:"详情"})}}],se=[{title:"Key",dataIndex:"key",width:200,ellipsis:!0},{title:"Value",dataIndex:"value",ellipsis:!0},{title:"操作",width:140,render:(ie,Y)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",type:"link",onClick:()=>{E(Y),M.setFieldsValue({dataId:Y.key,content:Y.value}),R(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除",onConfirm:()=>ae(Y),children:s.jsx(c.Button,{size:"small",type:"link",danger:!0,children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,flex:1,minHeight:0},children:[s.jsxs("div",{style:{display:"flex",gap:16,flex:1,minHeight:0},children:[s.jsx(c.Card,{size:"small",style:{width:340,overflow:"auto",flexShrink:0},title:"组织树",extra:s.jsxs(c.Space,{size:4,children:[t&&s.jsx(c.Tooltip,{title:"新增组织",children:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>q("org",{tenantCode:e,domainCode:t})})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>O(e,t)})})]}),children:t?g.length>0?s.jsx(c.Tree,{treeData:g,onSelect:B,loadData:J,titleRender:W,blockNode:!0,showLine:!0,showIcon:!1,expandedKeys:h,onExpand:p,selectedKeys:S}):s.jsx(c.Empty,{description:"该域下暂无组织,请点击右上角新增"}):s.jsx(c.Empty,{description:"未获取到登录租户/域上下文"})}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},children:w?s.jsxs(s.Fragment,{children:[s.jsxs(c.Descriptions,{title:`${zt[w.type].label}信息 — ${us(w.data)}`,size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[s.jsx(c.Descriptions.Item,{label:"编码",children:ln(w.data,w.type)}),s.jsx(c.Descriptions.Item,{label:"名称",children:us(w.data)}),s.jsx(c.Descriptions.Item,{label:"租户",children:w.data.tenantCode||"-"}),s.jsx(c.Descriptions.Item,{label:"域",children:w.data.domainCode||"-"}),w.type!=="org"&&s.jsx(c.Descriptions.Item,{label:"所属组织",children:w.data.orgCode}),w.type==="group"&&s.jsx(c.Descriptions.Item,{label:"所属部门",children:w.data.deptCode}),s.jsx(c.Descriptions.Item,{label:"状态",span:w.type==="group"?1:2,children:s.jsx(c.Tag,{color:(Se=$o[w.data.status??1])==null?void 0:Se.color,children:(Fe=$o[w.data.status??1])==null?void 0:Fe.text})}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:w.data.description||"-"})]}),w.type!=="group"&&s.jsx(c.Card,{type:"inner",title:w.type==="org"?"下级部门 / 组":"下级组",size:"small",style:{marginBottom:16},extra:s.jsx(c.Space,{children:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按编码 / 名称过滤",style:{width:220},onChange:ie=>ge(ie.target.value)})}),children:s.jsx(c.Table,{columns:Q,dataSource:he,rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无下级"}})}),s.jsx(c.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{E(null),M.resetFields(),R(!0)},children:"新增"}),children:s.jsx(c.Table,{columns:se,dataSource:x.map((ie,Y)=>({...ie,key:ie.key||Y})),rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无扩展配置"}})})]}):s.jsx(c.Empty,{description:"请从左侧选择组织/部门/组"})})]}),s.jsx(c.Modal,{title:F?"编辑配置":"新增配置",open:T,onCancel:()=>{R(!1),E(null)},onOk:X,destroyOnHidden:!0,children:s.jsxs(c.Form,{form:M,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!F})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4})})]})}),s.jsxs(c.Modal,{title:_?`新增${zt[_].label}`:"新增",open:k,onCancel:()=>V(!1),onOk:ne,destroyOnHidden:!0,children:[s.jsxs("div",{style:{marginTop:12,padding:"8px 12px",background:"#f7f8fa",borderRadius:6,fontSize:12,color:"#666",display:"flex",flexWrap:"wrap",gap:16},children:[s.jsxs("span",{children:["租户:",ee.tenantCode||"-"]}),s.jsxs("span",{children:["域:",ee.domainCode||"-"]}),_==="dept"&&s.jsxs("span",{children:["所属组织:",ee.orgCode||"-"]}),_==="group"&&s.jsxs("span",{children:["所属部门:",ee.deptCode||"-"]})]}),s.jsxs(c.Form,{form:D,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:_==="org"?"orgCode":_==="dept"?"deptCode":"groupCode",label:"编码",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"唯一标识"})}),s.jsx(c.Form.Item,{name:_==="org"?"orgName":_==="dept"?"deptName":"groupName",label:"名称",rules:[{required:!0}],children:s.jsx(c.Input,{})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2})})]})]})]})}let Xc="/api";function no(e){Xc=e||"/api"}function Dt(){return nn.createRequest({baseURL:Xc,timeout:15e3})}const er={create:e=>Dt().post("/ctc/ac/tenants",e),getByCode:e=>Dt().get("/ctc/ac/tenants",{params:{tenantCode:e}}),updateStatus:(e,t)=>Dt().post("/ctc/ac/tenants/status",null,{params:{tenantCode:e,status:t}}),listAll:()=>Dt().get("/ctc/ac/tenants/list"),listAllForPlatform:()=>Dt().get("/ctc/ac/tenants/list-all")},Ut={listByTenant:e=>Dt().get("/ctc/ac/domains/list",{params:{tenantCode:e}}),listAll:()=>Dt().get("/ctc/ac/domains/list-all"),getById:e=>Dt().get("/ctc/ac/domains",{params:{id:e}}),create:e=>Dt().post("/ctc/ac/domains",e),update:(e,t)=>Dt().put("/ctc/ac/domains",t,{params:{id:e}}),delete:e=>Dt().delete("/ctc/ac/domains",{params:{id:e}})};function fi(e,t){const n=t==null?void 0:t.domainCode;return n?n==="default"||!!e&&n===`${e}-default`:!1}function df(){let e="",t="";try{const n=JSON.parse(localStorage.getItem("userInfo")||"{}");e=String((n==null?void 0:n.tenantCode)??""),t=String((n==null?void 0:n.domainCode)??"")}catch{}try{const n=JSON.parse(localStorage.getItem("z_ctc_domain")||"null");n&&n.tenantCode&&n.tenantCode===e&&n.domainCode&&(t=String(n.domainCode))}catch{}return{tenantCode:e||null,domainCode:t||null}}function ff({apiBaseURL:e}){d.useEffect(()=>{e&&no(e)},[e]);const[{tenantCode:t,domainCode:n},r]=d.useState(df);return s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:s.jsx(Jc,{selectedTenant:t,selectedDomain:n,apiBaseURL:"/api"})})}function qt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Os={exports:{}},hf=Os.exports,Mo;function Qc(){return Mo||(Mo=1,(function(e,t){(function(n,r){e.exports=r()})(hf,(function(){var n=1e3,r=6e4,a=36e5,i="millisecond",o="second",l="minute",u="hour",m="day",g="week",f="month",h="quarter",p="year",S="date",y="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|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,x={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(A){var I=["th","st","nd","rd"],$=A%100;return"["+A+(I[($-20)%10]||I[$]||I[0])+"]"}},C=function(A,I,$){var D=String(A);return!D||D.length>=I?A:""+Array(I+1-D.length).join($)+A},j={s:C,z:function(A){var I=-A.utcOffset(),$=Math.abs(I),D=Math.floor($/60),O=$%60;return(I<=0?"+":"-")+C(D,2,"0")+":"+C(O,2,"0")},m:function A(I,$){if(I.date()<$.date())return-A($,I);var D=12*($.year()-I.year())+($.month()-I.month()),O=I.clone().add(D,f),z=$-O<0,Z=I.clone().add(D+(z?-1:1),f);return+(-(D+($-O)/(z?O-Z:Z-O))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:p,w:g,d:m,D:S,h:u,m:l,s:o,ms:i,Q:h}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},b="en",T={};T[b]=x;var R="$isDayjsObject",F=function(A){return A instanceof V||!(!A||!A[R])},E=function A(I,$,D){var O;if(!I)return b;if(typeof I=="string"){var z=I.toLowerCase();T[z]&&(O=z),$&&(T[z]=$,O=z);var Z=I.split("-");if(!O&&Z.length>1)return A(Z[0])}else{var L=I.name;T[L]=I,O=L}return!D&&O&&(b=O),O||!D&&b},M=function(A,I){if(F(A))return A.clone();var $=typeof I=="object"?I:{};return $.date=A,$.args=arguments,new V($)},k=j;k.l=E,k.i=F,k.w=function(A,I){return M(A,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var V=(function(){function A($){this.$L=E($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[R]=!0}var I=A.prototype;return I.parse=function($){this.$d=(function(D){var O=D.date,z=D.utc;if(O===null)return new Date(NaN);if(k.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var Z=O.match(w);if(Z){var L=Z[2]-1||0,U=(Z[7]||"0").substring(0,3);return z?new Date(Date.UTC(Z[1],L,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)):new Date(Z[1],L,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)}}return new Date(O)})($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return k},I.isValid=function(){return this.$d.toString()!==y},I.isSame=function($,D){var O=M($);return this.startOf(D)<=O&&O<=this.endOf(D)},I.isAfter=function($,D){return M($)<this.startOf(D)},I.isBefore=function($,D){return this.endOf(D)<M($)},I.$g=function($,D,O){return k.u($)?this[D]:this.set(O,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,D){var O=this,z=!!k.u(D)||D,Z=k.p($),L=function(q,ee){var ne=k.w(O.$u?Date.UTC(O.$y,ee,q):new Date(O.$y,ee,q),O);return z?ne:ne.endOf(m)},U=function(q,ee){return k.w(O.toDate()[q].apply(O.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(ee)),O)},J=this.$W,G=this.$M,H=this.$D,B="set"+(this.$u?"UTC":"");switch(Z){case p:return z?L(1,0):L(31,11);case f:return z?L(1,G):L(0,G+1);case g:var W=this.$locale().weekStart||0,N=(J<W?J+7:J)-W;return L(z?H-N:H+(6-N),G);case m:case S:return U(B+"Hours",0);case u:return U(B+"Minutes",1);case l:return U(B+"Seconds",2);case o:return U(B+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,D){var O,z=k.p($),Z="set"+(this.$u?"UTC":""),L=(O={},O[m]=Z+"Date",O[S]=Z+"Date",O[f]=Z+"Month",O[p]=Z+"FullYear",O[u]=Z+"Hours",O[l]=Z+"Minutes",O[o]=Z+"Seconds",O[i]=Z+"Milliseconds",O)[z],U=z===m?this.$D+(D-this.$W):D;if(z===f||z===p){var J=this.clone().set(S,1);J.$d[L](U),J.init(),this.$d=J.set(S,Math.min(this.$D,J.daysInMonth())).$d}else L&&this.$d[L](U);return this.init(),this},I.set=function($,D){return this.clone().$set($,D)},I.get=function($){return this[k.p($)]()},I.add=function($,D){var O,z=this;$=Number($);var Z=k.p(D),L=function(G){var H=M(z);return k.w(H.date(H.date()+Math.round(G*$)),z)};if(Z===f)return this.set(f,this.$M+$);if(Z===p)return this.set(p,this.$y+$);if(Z===m)return L(1);if(Z===g)return L(7);var U=(O={},O[l]=r,O[u]=a,O[o]=n,O)[Z]||1,J=this.$d.getTime()+$*U;return k.w(J,this)},I.subtract=function($,D){return this.add(-1*$,D)},I.format=function($){var D=this,O=this.$locale();if(!this.isValid())return O.invalidDate||y;var z=$||"YYYY-MM-DDTHH:mm:ssZ",Z=k.z(this),L=this.$H,U=this.$m,J=this.$M,G=O.weekdays,H=O.months,B=O.meridiem,W=function(ee,ne,X,ae){return ee&&(ee[ne]||ee(D,z))||X[ne].slice(0,ae)},N=function(ee){return k.s(L%12||12,ee,"0")},q=B||function(ee,ne,X){var ae=ee<12?"AM":"PM";return X?ae.toLowerCase():ae};return z.replace(v,(function(ee,ne){return ne||(function(X){switch(X){case"YY":return String(D.$y).slice(-2);case"YYYY":return k.s(D.$y,4,"0");case"M":return J+1;case"MM":return k.s(J+1,2,"0");case"MMM":return W(O.monthsShort,J,H,3);case"MMMM":return W(H,J);case"D":return D.$D;case"DD":return k.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return W(O.weekdaysMin,D.$W,G,2);case"ddd":return W(O.weekdaysShort,D.$W,G,3);case"dddd":return G[D.$W];case"H":return String(L);case"HH":return k.s(L,2,"0");case"h":return N(1);case"hh":return N(2);case"a":return q(L,U,!0);case"A":return q(L,U,!1);case"m":return String(U);case"mm":return k.s(U,2,"0");case"s":return String(D.$s);case"ss":return k.s(D.$s,2,"0");case"SSS":return k.s(D.$ms,3,"0");case"Z":return Z}return null})(ee)||Z.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,D,O){var z,Z=this,L=k.p(D),U=M($),J=(U.utcOffset()-this.utcOffset())*r,G=this-U,H=function(){return k.m(Z,U)};switch(L){case p:z=H()/12;break;case f:z=H();break;case h:z=H()/3;break;case g:z=(G-J)/6048e5;break;case m:z=(G-J)/864e5;break;case u:z=G/a;break;case l:z=G/r;break;case o:z=G/n;break;default:z=G}return O?z:k.a(z)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return T[this.$L]},I.locale=function($,D){if(!$)return this.$L;var O=this.clone(),z=E($,D,!0);return z&&(O.$L=z),O},I.clone=function(){return k.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},A})(),_=V.prototype;return M.prototype=_,[["$ms",i],["$s",o],["$m",l],["$H",u],["$W",m],["$M",f],["$y",p],["$D",S]].forEach((function(A){_[A[1]]=function(I){return this.$g(I,A[0],A[1])}})),M.extend=function(A,I){return A.$i||(A(I,V,M),A.$i=!0),M},M.locale=E,M.isDayjs=F,M.unix=function(A){return M(1e3*A)},M.en=T[b],M.Ls=T,M.p={},M}))})(Os)),Os.exports}var mf=Qc();const Re=qt(mf),cn={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},ka=(e,t,n)=>e==="tenant"?`tenant:${t}`:`domain:${t}:${n}`;function gf({apiBaseURL:e,platformView:t=!1}){var se,Se,Fe,ie;d.useEffect(()=>{e&&no(e)},[e]);const[n,r]=d.useState([]),[a,i]=d.useState(!1),[o,l]=d.useState({}),[u,m]=d.useState({}),[g,f]=d.useState([]),[h,p]=d.useState([]),[S,y]=d.useState([]),[w,v]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState(!1),[T]=c.Form.useForm(),[R,F]=d.useState(!1),[E,M]=d.useState(null),[k]=c.Form.useForm(),[V,_]=d.useState(!1),[A,I]=d.useState(null),[$]=c.Form.useForm(),[D,O]=d.useState(()=>{try{const Y=Number(localStorage.getItem("ctc_tenant_tree_width"));return Number.isFinite(Y)&&Y>=220&&Y<=640?Y:320}catch{return 320}}),z=d.useRef(D),Z=Y=>{Y.preventDefault();const K=Y.clientX,re=z.current,fe=Ee=>{const je=Math.min(640,Math.max(220,re+Ee.clientX-K));z.current=je,O(je)},be=()=>{document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",be),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem("ctc_tenant_tree_width",String(z.current))}catch{}};document.addEventListener("mousemove",fe),document.addEventListener("mouseup",be),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},L=d.useCallback(async()=>{i(!0);try{const Y=t?await er.listAllForPlatform():await er.listAll();r(Array.isArray(Y)?Y:[])}catch(Y){c.message.error((t?"获取全平台租户失败(系统租户面板仅平台管理员可访问):":"获取租户列表失败:")+((Y==null?void 0:Y.message)||"未知错误")),r([])}finally{i(!1)}},[t]);d.useEffect(()=>{L()},[L]);const U=d.useCallback(async Y=>{const K=await Promise.all(Y.map(async re=>{try{const fe=await Ut.listByTenant(re.tenantCode);return[re.tenantCode,Array.isArray(fe)?fe:[]]}catch{return[re.tenantCode,[]]}}));l(Object.fromEntries(K))},[]);d.useEffect(()=>{n.length>0&&U(n)},[n,U]),d.useEffect(()=>{const Y=n.map(K=>{var re,fe;return{key:ka("tenant",K.tenantCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:K.tenantName||K.tenantCode}),s.jsx(c.Tag,{color:(re=cn[K.status??1])==null?void 0:re.color,style:{margin:0,fontSize:10,flexShrink:0},children:(fe=cn[K.status??1])==null?void 0:fe.text})]}),rawTitle:`${K.tenantName||K.tenantCode} (${K.tenantCode})`,data:{type:"tenant",data:K},children:(Array.isArray(o[K.tenantCode])?o[K.tenantCode]:[]).map(be=>{var Ee,je;return{key:ka("domain",K.tenantCode,be.domainCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:be.domainName}),s.jsx(c.Tag,{color:(Ee=cn[be.status])==null?void 0:Ee.color,style:{margin:0,fontSize:10,flexShrink:0},children:(je=cn[be.status])==null?void 0:je.text})]}),rawTitle:`${be.domainName} (${be.domainCode})`,data:{type:"domain",data:be},isLeaf:!0}})}});f(Y),y(K=>K.length>0?K:Y.map(re=>re.key))},[n,o]);const J=async(Y,K)=>{if(fi(Y,K)){c.message.warning("默认域受保护,不可删除");return}if(K.id==null){c.message.error("域 ID 缺失");return}try{await Ut.delete(K.id),c.message.success("删除成功");const re=await Ut.listByTenant(Y);l(fe=>({...fe,[Y]:Array.isArray(re)?re:[]}))}catch(re){c.message.error("删除失败:"+((re==null?void 0:re.message)||"未知错误"))}},G=async()=>{try{const Y=await T.validateFields();await er.create({...Y,status:1}),c.message.success("创建成功"),b(!1),T.resetFields(),await L()}catch(Y){if(Y!=null&&Y.errorFields)return;c.message.error("创建失败:"+((Y==null?void 0:Y.message)||"未知错误"))}},H=async(Y,K)=>{const re=K===1?0:1;try{await er.updateStatus(Y,re),c.message.success(re===1?"已启用":"已停用"),await L()}catch(fe){c.message.error("操作失败:"+((fe==null?void 0:fe.message)||"未知错误"))}},B=Y=>{M(Y),k.resetFields(),k.setFieldsValue({status:1}),F(!0)},W=async()=>{if(E)try{const Y=await k.validateFields(),K=E.tenantCode;await Ut.create({domainCode:Y.domainCode,domainName:Y.domainName,tenantCode:K,status:Y.status??1}),c.message.success(`已为租户「${E.tenantName||K}」新增域「${Y.domainName}」`),F(!1),k.resetFields();const re=await Ut.listByTenant(K),fe=Array.isArray(re)?re:[];l(Ee=>({...Ee,[K]:fe}));const be=ka("tenant",K);y(Ee=>Ee.includes(be)?Ee:[...Ee,be])}catch(Y){if(Y!=null&&Y.errorFields)return;c.message.error("新增域失败:"+((Y==null?void 0:Y.message)||"未知错误"))}},N=(Y,K)=>{if(Y.length===0)return;const re=Y[0];p([re]);const fe=K.node.data;v(fe),C(u[re]||[])},q=async()=>{if(h[0])try{const Y=await $.validateFields();let K;if(A)K=x.map(re=>re.key===A.key?{key:Y.dataId,value:Y.content}:re);else{if(x.some(re=>re.key===Y.dataId)){c.message.error("Key 已存在");return}K=[...x,{key:Y.dataId,value:Y.content}]}m(re=>({...re,[h[0]]:K})),C(K),c.message.success(A?"更新成功":"创建成功"),_(!1),I(null),$.resetFields()}catch(Y){if(Y!=null&&Y.errorFields)return;c.message.error("保存失败")}},ee=Y=>{const K=x.filter(re=>re.key!==Y.key);m(re=>({...re,[h[0]]:K})),C(K),c.message.success("删除成功")},ne=(w==null?void 0:w.type)==="tenant"?w.data:null,X=(w==null?void 0:w.type)==="domain"?w.data:null,ae=X?n.find(Y=>Y.tenantCode===X.tenantCode):null,[oe,ue]=d.useState(""),ge=d.useMemo(()=>x.map((Y,K)=>({...Y,_idx:K})),[x]),me=d.useMemo(()=>{const Y=oe.trim().toLowerCase();return Y?ge.filter(K=>`${K.key||""} ${K.value||""}`.toLowerCase().includes(Y)):ge},[ge,oe]),he=[{title:"Key",dataIndex:"key",key:"key",width:200},{title:"Value",dataIndex:"value",key:"value",ellipsis:!0},{title:"操作",key:"action",width:120,render:(Y,K)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>{I(K),$.setFieldsValue({dataId:K.key,content:K.value}),_(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除该配置?",onConfirm:()=>ee(K),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})]})}],Q=Y=>{const K=Y.data;if(K.type==="tenant"){const be=K.data;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:Y.title}),s.jsx(c.Tooltip,{title:"新增域",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{style:{fontSize:11}}),onClick:Ee=>{Ee.stopPropagation(),B(be)}})})]})}const re=K.data,fe=re.tenantCode;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:Y.title}),s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:be=>{be==null||be.stopPropagation(),J(fe,re)},onCancel:be=>be==null?void 0:be.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(de.DeleteOutlined,{style:{fontSize:11}}),onClick:be=>be.stopPropagation()})})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs("div",{style:{display:"flex",gap:0,height:"calc(100vh - 140px)"},children:[s.jsx(c.Card,{title:"租户 / 域",size:"small",style:{width:D,minWidth:D,flexShrink:0},styles:{body:{padding:8,overflow:"auto",height:"calc(100% - 40px)"}},extra:s.jsxs(c.Space,{size:4,children:[s.jsx(c.Tooltip,{title:"新增租户",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{T.resetFields(),b(!0)}})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.ReloadOutlined,{}),onClick:L})})]}),children:g.length>0?s.jsx(c.Tree,{treeData:g,selectedKeys:h,onSelect:N,titleRender:Q,expandedKeys:S,onExpand:y,defaultExpandAll:!0,showLine:!0,className:"ctc-tenant-tree",blockNode:!0}):s.jsx(c.Empty,{description:a?"加载中...":'暂无租户,点击右上"新增租户"图标创建'})}),s.jsx("div",{onMouseDown:Z,title:"拖动调整宽度",style:{width:5,flexShrink:0,cursor:"col-resize",borderRadius:2,background:"#eef0f3"}}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},children:w?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions,{title:ne?"租户信息":"域信息",size:"small",bordered:!0,column:2,style:{marginBottom:16},children:ne?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:ne.tenantCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:ne.tenantName}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:ne.description||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Popconfirm,{title:`确认${ne.status===1?"停用":"启用"}该租户?`,onConfirm:()=>H(ne.tenantCode,ne.status??1),children:s.jsxs(c.Button,{size:"small",type:"link",danger:ne.status===1,children:[s.jsx(c.Tag,{color:(se=cn[ne.status??1])==null?void 0:se.color,children:(Se=cn[ne.status??1])==null?void 0:Se.text}),s.jsx("span",{style:{marginLeft:4,fontSize:12},children:"点击切换"})]})})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:ne.createdAt||"-"})]}):s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:X.domainCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:X.domainName}),s.jsx(c.Descriptions.Item,{label:"所属租户",children:(ae==null?void 0:ae.tenantName)||X.tenantCode}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(Fe=cn[X.status])==null?void 0:Fe.color,children:(ie=cn[X.status])==null?void 0:ie.text})})]})}),s.jsx(c.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按 Key / Value 过滤",style:{width:220},onChange:Y=>ue(Y.target.value)}),s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{I(null),$.resetFields(),_(!0)},children:"新增"})]}),children:s.jsx(c.Table,{columns:he,dataSource:me,rowKey:Y=>`${Y.key}_${Y._idx}`,pagination:!1,size:"small",locale:{emptyText:'暂无扩展配置,点击右上"新增"添加'}})})]}):s.jsx(c.Empty,{description:"请从左侧选择租户或域",style:{marginTop:80}})})]}),s.jsx(c.Modal,{title:"新建租户",open:j,onOk:G,onCancel:()=>b(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:T,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"tenantCode",label:"租户编码",rules:[{required:!0,message:"请输入租户编码"},{pattern:/^[a-z0-9_]+$/,message:"仅允许小写字母数字下划线"}],extra:"唯一标识,创建后不可修改",children:s.jsx(c.Input,{placeholder:"如 default / tenant_a"})}),s.jsx(c.Form.Item,{name:"tenantName",label:"租户名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 默认租户"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:3,placeholder:"可选"})})]})}),s.jsx(c.Modal,{title:A?"编辑配置":"新增配置",open:V,onOk:q,onCancel:()=>{_(!1),I(null)},destroyOnHidden:!0,children:s.jsxs(c.Form,{form:$,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!A,placeholder:"如 max_users"})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4,placeholder:"配置值"})})]})}),s.jsx(c.Modal,{title:E?`为「${E.tenantName||E.tenantCode}」新增域`:"新增域",open:R,onOk:W,onCancel:()=>{F(!1),k.resetFields()},size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:k,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{label:"所属租户",children:s.jsx(c.Input,{value:(E==null?void 0:E.tenantName)||"",disabled:!0})}),s.jsx(c.Form.Item,{name:"domainCode",label:"域编码",rules:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(c.Input,{placeholder:"如 prod / staging"})}),s.jsx(c.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(c.Input,{placeholder:"如 生产环境"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})})]})})]})}const Aa={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function pf({apiBaseURL:e}){d.useEffect(()=>{e&&no(e)},[e]);const[t,n]=d.useState([]),[r,a]=d.useState(""),[i,o]=d.useState(!1),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),w=d.useCallback(async()=>{o(!0);try{const F=await er.listAll(),E=Array.isArray(F)?F:[];n(E),a(M=>{var k;return E.some(V=>V.tenantCode===M)?M:((k=E[0])==null?void 0:k.tenantCode)||""})}catch(F){c.message.error("获取我的租户失败:"+((F==null?void 0:F.message)||"未知错误")),n([]),a("")}finally{o(!1)}},[]),v=d.useCallback(async F=>{if(!F){u([]);return}g(!0);try{const E=await Ut.listByTenant(F);u(Array.isArray(E)?E:[])}catch(E){c.message.error("获取域列表失败:"+((E==null?void 0:E.message)||"未知错误")),u([])}finally{g(!1)}},[]);d.useEffect(()=>{w()},[w]),d.useEffect(()=>{v(r)},[r,v]);const x=d.useMemo(()=>t.find(F=>F.tenantCode===r)||null,[t,r]),C=()=>{S(null),y.resetFields(),y.setFieldsValue({status:1}),h(!0)},j=F=>{S(F),y.resetFields(),y.setFieldsValue({domainCode:F.domainCode,domainName:F.domainName,description:F.description,status:F.status??1}),h(!0)},b=async()=>{if(r)try{const F=await y.validateFields();p?(await Ut.update(p.id,{domainName:F.domainName,description:F.description||"",status:F.status??1}),c.message.success("已保存")):(await Ut.create({domainCode:F.domainCode,domainName:F.domainName,description:F.description||"",tenantCode:r,status:F.status??1}),c.message.success(`已新增域「${F.domainName}」`)),h(!1),S(null),y.resetFields(),await v(r)}catch(F){if(F!=null&&F.errorFields)return;c.message.error("保存失败:"+((F==null?void 0:F.message)||"未知错误"))}},T=async F=>{if(fi(r,F)){c.message.warning("默认域受保护,不可删除");return}try{await Ut.delete(F.id),c.message.success("已删除"),await v(r)}catch(E){c.message.error("删除失败:"+((E==null?void 0:E.message)||"未知错误"))}},R=[{title:"域编码",dataIndex:"domainCode",key:"domainCode",width:220},{title:"域名称",dataIndex:"domainName",key:"domainName",width:200},{title:"状态",dataIndex:"status",key:"status",width:100,render:F=>{const E=Aa[F]||{text:String(F??"-"),color:"default"};return s.jsx(c.Tag,{color:E.color,children:E.text})}},{title:"描述",dataIndex:"description",key:"description",ellipsis:!0},{title:"创建时间",dataIndex:"createdAt",key:"createdAt",width:180},{title:"操作",key:"action",width:150,render:(F,E)=>s.jsxs(c.Space,{size:0,children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>j(E),children:"编辑"}),fi(r,E)?s.jsx(c.Tooltip,{title:"默认域受保护,不可删除",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,disabled:!0,children:"删除"})}):s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:()=>T(E),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return!i&&t.length===0?s.jsx(c.Card,{size:"small",children:s.jsx(c.Empty,{description:"当前账号还未加入任何租户"})}):s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(c.Card,{size:"small",title:"我的租户",extra:s.jsxs(c.Space,{size:8,children:[t.length>1&&s.jsx(c.Select,{size:"small",style:{minWidth:200},value:r||void 0,onChange:a,options:t.map(F=>({value:F.tenantCode,label:`${F.tenantName||F.tenantCode} (${F.tenantCode})`}))}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{w(),v(r)}})})]}),children:x?s.jsxs(c.Descriptions,{size:"small",bordered:!0,column:{xs:1,sm:2,md:2,lg:4},children:[s.jsx(c.Descriptions.Item,{label:"租户编码",children:x.tenantCode}),s.jsx(c.Descriptions.Item,{label:"租户名称",children:x.tenantName||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(Aa[x.status??1]||{}).color,children:(Aa[x.status??1]||{text:"-"}).text})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:x.createdAt||"-"})]}):s.jsx(c.Empty,{description:i?"加载中...":"暂无租户"})}),s.jsx(c.Card,{size:"small",title:"域",extra:s.jsx(c.Space,{size:4,children:s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),disabled:!r,onClick:C,children:"新增域"})}),children:s.jsx(c.Table,{columns:R,dataSource:l,rowKey:F=>F.id??F.domainCode,loading:m,size:"small",scroll:{x:880},pagination:{pageSize:10,showSizeChanger:!1,hideOnSinglePage:!0},locale:{emptyText:"该租户下暂无域,点击右上「新增域」创建"}})}),s.jsx(c.Modal,{title:p?`编辑域「${p.domainName}」`:`为「${(x==null?void 0:x.tenantName)||r}」新增域`,open:f,onOk:b,onCancel:()=>{h(!1),S(null),y.resetFields()},destroyOnHidden:!0,children:s.jsxs(c.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"domainCode",label:"域编码",rules:p?[]:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:p?"编码创建后不可修改":"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(c.Input,{placeholder:"如 prod / staging",disabled:!!p})}),s.jsx(c.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(c.Input,{placeholder:"如 生产环境"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:3,placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"正常"},{value:0,label:"停用"}]})})]})})]})}const eu=e=>{const t=xe.useRef(e);return t.current=e,xe.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])};function Gr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const ko=process.env.NODE_ENV!=="test"&&Gr()?xe.useLayoutEffect:xe.useEffect,yf=(e,t)=>{const n=xe.useRef(!0);ko(()=>e(n.current),t),ko(()=>(n.current=!1,()=>{n.current=!0}),[])};function it(e,t){const[n,r]=d.useState(e),a=t!==void 0?t:n;return yf(i=>{i||r(t)},[t]),[a,r]}let tu=e=>+setTimeout(e,16),nu=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(tu=e=>window.requestAnimationFrame(e),nu=e=>window.cancelAnimationFrame(e));let Ao=0;const da=new Map;function ru(e){da.delete(e)}const ro=(e,t=1)=>{Ao+=1;const n=Ao;function r(a){if(a===0)ru(n),e();else{const i=tu(()=>{r(a-1)});da.set(n,i)}}return r(t),n};ro.cancel=e=>{const t=da.get(e);return ru(e),nu(t)};process.env.NODE_ENV!=="production"&&(ro.ids=()=>da);function xf(e,t,n){const r=xe.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var fs={exports:{}},Ue={};/**
2
2
  * @license React
3
3
  * react-is.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Fo;function yf(){if(Fo)return _e;Fo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),m=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function S(y){if(typeof y=="object"&&y!==null){var w=y.$$typeof;switch(w){case e:switch(y=y.type,y){case n:case a:case r:case c:case h:case m:return y;default:switch(y=y&&y.$$typeof,y){case o:case l:case f:case g:return y;case i:return y;default:return w}}case t:return w}}}return _e.ContextConsumer=i,_e.ContextProvider=o,_e.Element=e,_e.ForwardRef=l,_e.Fragment=n,_e.Lazy=f,_e.Memo=g,_e.Portal=t,_e.Profiler=a,_e.StrictMode=r,_e.Suspense=c,_e.SuspenseList=h,_e.isContextConsumer=function(y){return S(y)===i},_e.isContextProvider=function(y){return S(y)===o},_e.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},_e.isForwardRef=function(y){return S(y)===l},_e.isFragment=function(y){return S(y)===n},_e.isLazy=function(y){return S(y)===f},_e.isMemo=function(y){return S(y)===g},_e.isPortal=function(y){return S(y)===t},_e.isProfiler=function(y){return S(y)===a},_e.isStrictMode=function(y){return S(y)===r},_e.isSuspense=function(y){return S(y)===c},_e.isSuspenseList=function(y){return S(y)===h},_e.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===c||y===h||y===m||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===g||y.$$typeof===o||y.$$typeof===i||y.$$typeof===l||y.$$typeof===p||y.getModuleId!==void 0)},_e.typeOf=S,_e}var ze={};/**
9
+ */var Oo;function bf(){if(Oo)return Ue;Oo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function S(y){if(typeof y=="object"&&y!==null){var w=y.$$typeof;switch(w){case e:switch(y=y.type,y){case n:case a:case r:case u:case m:case h:return y;default:switch(y=y&&y.$$typeof,y){case o:case l:case f:case g:return y;case i:return y;default:return w}}case t:return w}}}return Ue.ContextConsumer=i,Ue.ContextProvider=o,Ue.Element=e,Ue.ForwardRef=l,Ue.Fragment=n,Ue.Lazy=f,Ue.Memo=g,Ue.Portal=t,Ue.Profiler=a,Ue.StrictMode=r,Ue.Suspense=u,Ue.SuspenseList=m,Ue.isContextConsumer=function(y){return S(y)===i},Ue.isContextProvider=function(y){return S(y)===o},Ue.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Ue.isForwardRef=function(y){return S(y)===l},Ue.isFragment=function(y){return S(y)===n},Ue.isLazy=function(y){return S(y)===f},Ue.isMemo=function(y){return S(y)===g},Ue.isPortal=function(y){return S(y)===t},Ue.isProfiler=function(y){return S(y)===a},Ue.isStrictMode=function(y){return S(y)===r},Ue.isSuspense=function(y){return S(y)===u},Ue.isSuspenseList=function(y){return S(y)===m},Ue.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===u||y===m||y===h||typeof y=="object"&&y!==null&&(y.$$typeof===f||y.$$typeof===g||y.$$typeof===o||y.$$typeof===i||y.$$typeof===l||y.$$typeof===p||y.getModuleId!==void 0)},Ue.typeOf=S,Ue}var Ye={};/**
10
10
  * @license React
11
11
  * react-is.development.js
12
12
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var $o;function xf(){return $o||($o=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(typeof y=="object"&&y!==null){var w=y.$$typeof;switch(w){case t:switch(y=y.type,y){case r:case i:case a:case h:case g:case p:return y;default:switch(y=y&&y.$$typeof,y){case l:case c:case m:case f:return y;case o:return y;default:return w}}case n:return w}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),S=Symbol.for("react.client.reference");ze.ContextConsumer=o,ze.ContextProvider=l,ze.Element=t,ze.ForwardRef=c,ze.Fragment=r,ze.Lazy=m,ze.Memo=f,ze.Portal=n,ze.Profiler=i,ze.StrictMode=a,ze.Suspense=h,ze.SuspenseList=g,ze.isContextConsumer=function(y){return e(y)===o},ze.isContextProvider=function(y){return e(y)===l},ze.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},ze.isForwardRef=function(y){return e(y)===c},ze.isFragment=function(y){return e(y)===r},ze.isLazy=function(y){return e(y)===m},ze.isMemo=function(y){return e(y)===f},ze.isPortal=function(y){return e(y)===n},ze.isProfiler=function(y){return e(y)===i},ze.isStrictMode=function(y){return e(y)===a},ze.isSuspense=function(y){return e(y)===h},ze.isSuspenseList=function(y){return e(y)===g},ze.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===i||y===a||y===h||y===g||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===m||y.$$typeof===f||y.$$typeof===l||y.$$typeof===o||y.$$typeof===c||y.$$typeof===S||y.getModuleId!==void 0)},ze.typeOf=e})()),ze}var Ro;function bf(){return Ro||(Ro=1,process.env.NODE_ENV==="production"?qr.exports=yf():qr.exports=xf()),qr.exports}var ha=bf();const Sf=Symbol.for("react.element"),Cf=Symbol.for("react.transitional.element"),wf=Symbol.for("react.fragment");function Gc(e){return e&&typeof e=="object"&&(e.$$typeof===Sf||e.$$typeof===Cf)&&e.type===wf}var Lc;const jf=Number((Lc=d.version)==null?void 0:Lc.split(".")[0]),vf=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},Tf=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{vf(r,n)})}},Ff=(...e)=>pf(()=>Tf(...e),e,(t,n)=>t.length!==n.length||t.every((r,a)=>r!==n[a])),$f=e=>{var n,r;if(!e)return!1;if(Zc(e)&&jf>=19)return!0;const t=ha.isMemo(e)?e.type.type:e.type;return!(typeof t=="function"&&!((n=t.prototype)!=null&&n.render)&&t.$$typeof!==ha.ForwardRef||typeof e=="function"&&!((r=e.prototype)!=null&&r.render)&&e.$$typeof!==ha.ForwardRef)};function Zc(e){return d.isValidElement(e)&&!Gc(e)}const Rf=e=>{if(e&&Zc(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function Ef(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const Eo="data-rc-order",Io="data-rc-priority",If="rc-util-key",Wa=new Map;function Jc({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:If}function Ws(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Mf(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function _i(e){return e?Array.from((Wa.get(e)||e).children).filter(t=>t.tagName==="STYLE"):[]}function Xc(e,t={}){if(!Nr())return null;const{csp:n,prepend:r,priority:a=0}=t,i=Mf(r),o=i==="prependQueue",l=document.createElement("style");l.setAttribute(Eo,i),o&&a&&l.setAttribute(Io,`${a}`),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;const c=Ws(t);if(!c)return null;const{firstChild:h}=c;if(r){if(o){const g=(t.styles||_i(c)).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(Eo)))return!1;const m=Number(f.getAttribute(Io)||0);return a>=m});if(g.length)return c.insertBefore(l,g[g.length-1].nextSibling),l}c.insertBefore(l,h)}else c.appendChild(l);return l}function Qc(e,t={}){let{styles:n}=t;return n||(n=_i(Ws(t))),n.find(r=>r.getAttribute(Jc(t))===e)}function kf(e,t={}){const n=Qc(e,t);if(n){const r=Ws(t);r==null||r.removeChild(n)}}function Af(e,t){const n=Wa.get(e);if(!n||!Ef(document,n)){const r=Xc("",t);if(!r)return;const{parentNode:a}=r;Wa.set(e,a),e.removeChild(r)}}function ys(e,t,n={}){var c,h,g;const r=Ws(n);if(!r)return null;const a=_i(r),i={...n,styles:a};Af(r,i);const o=Qc(t,i);if(o)return(c=i.csp)!=null&&c.nonce&&o.nonce!==((h=i.csp)==null?void 0:h.nonce)&&(o.nonce=(g=i.csp)==null?void 0:g.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;const l=Xc(e,i);return l?(l.setAttribute(Jc(i),t),l):null}function Mo(e){return e instanceof HTMLElement||e instanceof SVGElement}function Of(e){return e&&typeof e=="object"&&Mo(e.nativeElement)?e.nativeElement:Mo(e)?e:null}let qa={};const zi=[],Df=e=>{zi.push(e)};function Ms(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=zi.reduce((r,a)=>a(r??"","warning"),t);n&&console.error(`Warning: ${n}`)}}function Pf(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=zi.reduce((r,a)=>a(r??"","note"),t);n&&console.warn(`Note: ${n}`)}}function Nf(){qa={}}function eu(e,t,n){!t&&!qa[n]&&(e(!1,n),qa[n]=!0)}function Ge(e,t){eu(Ms,e,t)}function Lf(e,t){eu(Pf,e,t)}Ge.preMessage=Df;Ge.resetWarned=Nf;Ge.noteOnce=Lf;function ko(e,t,n=!1){const r=new Set;function a(i,o,l=1){const c=r.has(i);if(Ge(!c,"Warning: There may be circular references"),c)return!1;if(i===o)return!0;if(n&&l>1)return!1;r.add(i);const h=l+1;if(Array.isArray(i)){if(!Array.isArray(o)||i.length!==o.length)return!1;for(let g=0;g<i.length;g++)if(!a(i[g],o[g],h))return!1;return!0}if(i&&o&&typeof i=="object"&&typeof o=="object"){const g=Object.keys(i);return g.length!==Object.keys(o).length?!1:g.every(f=>a(i[f],o[f],h))}return!1}return a(e,t)}var hr={exports:{}},Ao;function _f(){if(Ao)return hr.exports;Ao=1,hr.exports=r,hr.exports.isMobile=r,hr.exports.default=r;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,t=/CrOS/,n=/android|ipad|playbook|silk/i;function r(a){a||(a={});let i=a.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let o=e.test(i)&&!t.test(i)||!!a.tablet&&n.test(i);return!o&&a.tablet&&a.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(o=!0),o}return hr.exports}_f();function Ve(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function pn(e,t={}){let n=[];return d.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(pn(r)):Gc(r)&&r.props?n=n.concat(pn(r.props.children,t)):n.push(r))}),n}function Oe(e,t){let n=e;for(let r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function tu(e,t,n,r){if(!t.length)return n;const[a,...i]=t;let o;if(!e&&typeof a=="number"?o=[]:Array.isArray(e)?o=[...e]:o={...e},r&&n===void 0&&i.length===1){const l=o[a];if(l&&typeof l=="object"){const c=Array.isArray(l)?[...l]:{...l};delete c[i[0]],o[a]=c}}else o[a]=tu(o[a],i,n,r);return o}function Ue(e,t,n,r=!1){return t.length&&r&&n===void 0&&!Oe(e,t.slice(0,-1))?e:tu(e,t,n,r)}function zf(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Oo(e){return Array.isArray(e)?[]:{}}const Bf=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Vf(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let a=Oo(e[0]);return e.forEach(i=>{function o(l,c){const h=new Set(c),g=Oe(i,l),f=Array.isArray(g);if(f||zf(g)){if(!h.has(g)){h.add(g);const m=Oe(a,l);f?a=Ue(a,l,r(m,g)):(!m||typeof m!="object")&&(a=Ue(a,l,Oo(g))),Bf(g).forEach(p=>{Object.getOwnPropertyDescriptor(g,p).enumerable&&o([...l,p],h)})}}else a=Ue(a,l,g)}o([])}),a}function Wn(...e){return Vf(e)}function nu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=nu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ce(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=nu(e))&&(r&&(r+=" "),r+=t);return r}function Ir(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}const Hf="%";function Ga(e){return e.join(Hf)}let Do=0;class Yf{constructor(t){ue(this,"instanceId");ue(this,"cache",new Map);ue(this,"updateTimes",new Map);ue(this,"extracted",new Set);this.instanceId=t}get(t){return this.opGet(Ga(t))}opGet(t){return this.cache.get(t)||null}update(t,n){return this.opUpdate(Ga(t),n)}opUpdate(t,n){const r=this.cache.get(t),a=n(r);a===null?(this.cache.delete(t),this.updateTimes.delete(t)):(this.cache.set(t,a),this.updateTimes.set(t,Do),Do+=1)}}const ru="data-token-hash",$n="data-css-hash",Uf="data-cache-path",un="__cssinjs_instance__";function Kf(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${$n}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(a=>{a[un]||(a[un]=e),a[un]===e&&document.head.insertBefore(a,n)});const r={};Array.from(document.querySelectorAll(`style[${$n}]`)).forEach(a=>{var o;const i=a.getAttribute($n);r[i]?a[un]===e&&((o=a.parentNode)==null||o.removeChild(a)):r[i]=!0})}return new Yf(e)}const Bi=be.createContext({hashPriority:"low",cache:Kf(),defaultCache:!0,autoPrefix:!1});let Po=0;class Wf{constructor(t){ue(this,"derivatives");ue(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=Po,t.length===0&&Ms(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Po+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const qf=new WeakMap,ga={};function Gf(e,t){let n=qf;for(let r=0;r<t.length;r+=1){const a=t[r];n.has(a)||n.set(a,new WeakMap),n=n.get(a)}return n.has(ga)||n.set(ga,e()),n.get(ga)}const No=new WeakMap;function vr(e){let t=No.get(e)||"";return t||(Object.keys(e).forEach(n=>{const r=e[n];t+=n,r instanceof Wf?t+=r.id:r&&typeof r=="object"?t+=vr(r):t+=r}),t=Ir(t),No.set(e,t)),t}function Zf(e,t){return Ir(`${t}_${vr(e)}`)}const Lo=Nr();function su(e){const{hashCls:t,hashPriority:n="low"}=e||{};if(!t)return"";const r=`.${t}`;return n==="low"?`:where(${r})`:r}const Jf=e=>e!=null;function au(e,t){const n=typeof t=="function"?t():t;return n?{...e,csp:{...e.csp,nonce:n}}:e}const Xf=(e,t="")=>`--${t?`${t}-`:""}${e}`.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase(),Qf=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",scope:i}=n||{};if(!Object.keys(e).length)return"";const o=`${su({hashCls:r,hashPriority:a})}.${t}`,l=[i].flat().filter(Boolean);return`${l.length?l.map(h=>`${o}.${h}`).join(", "):o}{${Object.entries(e).map(([h,g])=>`${h}:${g};`).join("")}}`},em=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",prefix:i,unitless:o,ignore:l,preserve:c}=n||{},h={},g={};return Object.entries(e).forEach(([f,m])=>{if(c!=null&&c[f])g[f]=m;else if((typeof m=="string"||typeof m=="number")&&!(l!=null&&l[f])){const p=Xf(f,i);h[p]=typeof m=="number"&&!(o!=null&&o[f])?`${m}px`:String(m),g[f]=`var(${p})`}}),[g,Qf(h,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:a})]};function tm(){return!1}let Za=!1;function nm(){return Za}const rm=process.env.NODE_ENV==="production"?tm:nm;if(process.env.NODE_ENV!=="production"&&typeof module<"u"&&module&&module.hot&&typeof window<"u"){const e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null;if(e&&typeof e.webpackHotUpdate=="function"){const t=e.webpackHotUpdate;e.webpackHotUpdate=(...n)=>(Za=!0,setTimeout(()=>{Za=!1},0),t(...n))}}const Gr=new Map;function iu(e,t,n,r,a){const{cache:i}=be.useContext(Bi),o=[e,...t],l=Ga(o),c=rm(),h=m=>{i.opUpdate(l,p=>{const[S=0,y]=p||[void 0,void 0];let w=y;process.env.NODE_ENV!=="production"&&y&&c&&(r==null||r(w,c),w=null);const v=w||n(),x=[S,v];return m?m(x):x})};be.useMemo(()=>{h()},[l]);let g=i.opGet(l);process.env.NODE_ENV!=="production"&&!g&&(h(),g=i.opGet(l));const f=g[1];return d.useInsertionEffect(()=>(h(([m,p])=>[m+1,p]),Gr.has(l)||(a==null||a(f),Gr.set(l,!0),Promise.resolve().then(()=>{Gr.delete(l)})),()=>{i.opUpdate(l,m=>{const[p=0,S]=m||[];return p-1===0?(r==null||r(S,!1),Gr.delete(l),null):[p-1,S]})}),[l]),f}const sm={},am=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",jn=new Map;function im(e){jn.set(e,(jn.get(e)||0)+1)}function om(e,t){typeof document<"u"&&document.querySelectorAll(`style[${ru}="${e}"]`).forEach(r=>{var a;r[un]===t&&((a=r.parentNode)==null||a.removeChild(r))})}const lm=-1;function cm(e,t){jn.set(e,(jn.get(e)||0)-1);const n=new Set;jn.forEach((r,a)=>{r<=0&&n.add(a)}),jn.size-n.size>lm&&n.forEach(r=>{om(r,t),jn.delete(r)})}const um=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},dm="token";function fm(e,t,n){const{cache:{instanceId:r},container:a,hashPriority:i}=d.useContext(Bi),{salt:o="",override:l=sm,formatToken:c,getComputedToken:h,cssVar:g,nonce:f}=n,m=Gf(()=>Object.assign({},...t),t),p=vr(m),S=vr(l),y=vr(g);return iu(dm,[o,e.id,p,S,y],()=>{const v=h?h(m,l,e):um(m,l,e,c),x={...v},C=`${o}_${g.prefix}`,j=Ir(C),b=`${am}-${j}`;x._tokenKey=Zf(x,C);const[T,$]=em(v,g.key,{prefix:g.prefix,ignore:g.ignore,unitless:g.unitless,preserve:g.preserve,hashPriority:i,hashCls:g.hashed?b:void 0});return T._hashId=j,im(g.key),[T,b,x,$,g.key]},([,,,,v])=>{cm(v,r)},([,,,v,x])=>{if(!v)return;let C={mark:$n,prepend:"queue",attachTo:a,priority:-999};C=au(C,f);const j=ys(v,Ir(`css-var-${x}`),C);j[un]=r,j.setAttribute(ru,x)})}var mm={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ze="-ms-",Tr="-moz-",Pe="-webkit-",ou="comm",Vi="rule",Hi="decl",hm="@import",gm="@namespace",lu="@keyframes",pm="@layer",ym=Math.abs,Fr=String.fromCharCode,Ja=Object.assign;function xm(e,t){return it(e,0)^45?(((t<<2^it(e,0))<<2^it(e,1))<<2^it(e,2))<<2^it(e,3):0}function cu(e){return e.trim()}function qt(e,t){return(e=t.exec(e))?e[0]:e}function Re(e,t,n){return e.replace(t,n)}function pa(e,t){return e.indexOf(t)}function it(e,t){return e.charCodeAt(t)|0}function En(e,t,n){return e.slice(t,n)}function Mt(e){return e.length}function uu(e){return e.length}function Sr(e,t){return t.push(e),e}function bm(e,t){return e.map(t).join("")}function _o(e,t){return e.filter(function(n){return!qt(n,t)})}var qs=1,Qn=1,du=0,Rt=0,at=0,ar="";function Gs(e,t,n,r,a,i,o,l){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:qs,column:Qn,length:o,return:"",siblings:l}}function ln(e,t){return Ja(Gs("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function _n(e){for(;e.root;)e=ln(e.root,{children:[e]});Sr(e,e.siblings)}function Sm(){return at}function Cm(){return at=Rt>0?it(ar,--Rt):0,Qn--,at===10&&(Qn=1,qs--),at}function Ot(){return at=Rt<du?it(ar,Rt++):0,Qn++,at===10&&(Qn=1,qs++),at}function dn(){return it(ar,Rt)}function xs(){return Rt}function Zs(e,t){return En(ar,e,t)}function Mr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function wm(e){return qs=Qn=1,du=Mt(ar=e),Rt=0,[]}function jm(e){return ar="",e}function ya(e){return cu(Zs(Rt-1,Xa(e===91?e+2:e===40?e+1:e)))}function vm(e){for(;(at=dn())&&at<33;)Ot();return Mr(e)>2||Mr(at)>3?"":" "}function Tm(e,t){for(;--t&&Ot()&&!(at<48||at>102||at>57&&at<65||at>70&&at<97););return Zs(e,xs()+(t<6&&dn()==32&&Ot()==32))}function Xa(e){for(;Ot();)switch(at){case e:return Rt;case 34:case 39:e!==34&&e!==39&&Xa(at);break;case 40:e===41&&Xa(e);break;case 92:Ot();break}return Rt}function Fm(e,t){for(;Ot()&&e+at!==57;)if(e+at===84&&dn()===47)break;return"/*"+Zs(t,Rt-1)+"*"+Fr(e===47?e:Ot())}function $m(e){for(;!Mr(dn());)Ot();return Zs(e,Rt)}function zo(e){return jm(bs("",null,null,null,[""],e=wm(e),0,[0],e))}function bs(e,t,n,r,a,i,o,l,c){for(var h=0,g=0,f=o,m=0,p=0,S=0,y=1,w=1,v=1,x=0,C=0,j="",b=a,T=i,$=r,F=j;w;)switch(S=C,C=Ot()){case 40:S!=108&&it(F,f-1)==58?(x++,F+="("):F+=ya(C);break;case 41:x--,F+=")";break;case 34:case 39:case 91:F+=ya(C);break;case 9:case 10:case 13:case 32:if(x>0){F+=Fr(C);break}F+=vm(S);break;case 92:F+=Tm(xs()-1,7);continue;case 47:switch(dn()){case 42:case 47:Sr(Rm(Fm(Ot(),xs()),t,n,c),c),(Mr(S||1)==5||Mr(dn()||1)==5)&&Mt(F)&&En(F,-1,void 0)!==" "&&(F+=" ");break;default:F+="/"}break;case 123*y:l[h++]=Mt(F)*v;case 125*y:case 59:case 0:if(x>0&&C){F+=Fr(C);break}switch(C){case 0:case 125:w=0;case 59+g:v==-1&&(F=Re(F,/\f/g,"")),p>0&&(Mt(F)-f||y===0)&&Sr(p>32?Vo(F+";",r,n,f-1,c):Vo(Re(F," ","")+";",r,n,f-2,c),c);break;case 59:F+=";";default:if(Sr($=Bo(F,t,n,h,g,a,l,j,b=[],T=[],f,i),i),C===123)if(g===0)bs(F,t,$,$,b,i,f,l,T);else{switch(m){case 99:if(it(F,3)===110)break;case 108:if(it(F,2)===97)break;default:g=0;case 100:case 109:case 115:}g?bs(e,$,$,r&&Sr(Bo(e,$,$,0,0,a,l,j,a,b=[],f,T),T),a,T,f,l,r?b:T):bs(F,$,$,$,[""],T,0,l,T)}}h=g=p=0,y=v=1,j=F="",f=o;break;case 58:f=1+Mt(F),p=S;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&Cm()==125)continue}switch(F+=Fr(C),C*y){case 38:v=g>0?1:(F+="\f",-1);break;case 44:if(x>0)break;l[h++]=(Mt(F)-1)*v,v=1;break;case 64:dn()===45&&(F+=ya(Ot())),m=dn(),g=f=Mt(j=F+=$m(xs())),C++;break;case 45:S===45&&Mt(F)==2&&(y=0)}}return i}function Bo(e,t,n,r,a,i,o,l,c,h,g,f){for(var m=a-1,p=a===0?i:[""],S=uu(p),y=0,w=0,v=0;y<r;++y)for(var x=0,C=En(e,m+1,m=ym(w=o[y])),j=e;x<S;++x)(j=cu(w>0?p[x]+" "+C:Re(C,/&\f/g,p[x])))&&(c[v++]=j);return Gs(e,t,n,a===0?Vi:l,c,h,g,f)}function Rm(e,t,n,r){return Gs(e,t,n,ou,Fr(Sm()),En(e,2,-2),0,r)}function Vo(e,t,n,r,a){return Gs(e,t,n,Hi,En(e,0,r),En(e,r+1,-1),r,a)}function fu(e,t,n){switch(xm(e,t)){case 5103:return Pe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return Pe+e+e;case 4855:return Pe+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Tr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Pe+e+Tr+e+Ze+e+e;case 5936:switch(it(e,t+11)){case 114:return Pe+e+Ze+Re(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Pe+e+Ze+Re(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Pe+e+Ze+Re(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Pe+e+Ze+e+e;case 6165:return Pe+e+Ze+"flex-"+e+e;case 5187:return Pe+e+Re(e,/(\w+).+(:[^]+)/,Pe+"box-$1$2"+Ze+"flex-$1$2")+e;case 5443:return Pe+e+Ze+"flex-item-"+Re(e,/flex-|-self/g,"")+(qt(e,/flex-|baseline/)?"":Ze+"grid-row-"+Re(e,/flex-|-self/g,""))+e;case 4675:return Pe+e+Ze+"flex-line-pack"+Re(e,/align-content|flex-|-self/g,"")+e;case 5548:return Pe+e+Ze+Re(e,"shrink","negative")+e;case 5292:return Pe+e+Ze+Re(e,"basis","preferred-size")+e;case 6060:return Pe+"box-"+Re(e,"-grow","")+Pe+e+Ze+Re(e,"grow","positive")+e;case 4554:return Pe+Re(e,/([^-])(transform)/g,"$1"+Pe+"$2")+e;case 6187:return Re(Re(Re(e,/(zoom-|grab)/,Pe+"$1"),/(image-set)/,Pe+"$1"),e,"")+e;case 5495:case 3959:return Re(e,/(image-set\([^]*)/,Pe+"$1$`$1");case 4968:return Re(Re(e,/(.+:)(flex-)?(.*)/,Pe+"box-pack:$3"+Ze+"flex-pack:$3"),/space-between/,"justify")+Pe+e+e;case 4200:if(!qt(e,/flex-|baseline/))return Ze+"grid-column-align"+En(e,t)+e;break;case 2592:case 3360:return Ze+Re(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,a){return t=a,qt(r.props,/grid-\w+-end/)})?~pa(e+(n=n[t].value),"span")?e:Ze+Re(e,"-start","")+e+Ze+"grid-row-span:"+(~pa(n,"span")?qt(n,/\d+/):+qt(n,/\d+/)-+qt(e,/\d+/))+";":Ze+Re(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return qt(r.props,/grid-\w+-start/)})?e:Ze+Re(Re(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Re(e,/(.+)-inline(.+)/,Pe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Mt(e)-1-t>6)switch(it(e,t+1)){case 109:if(it(e,t+4)!==45)break;case 102:return Re(e,/(.+:)(.+)-([^]+)/,"$1"+Pe+"$2-$3$1"+Tr+(it(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~pa(e,"stretch")?fu(Re(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Re(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,a,i,o,l,c,h){return Ze+a+":"+i+h+(o?Ze+a+"-span:"+(l?c:+c-+i)+h:"")+e});case 4949:if(it(e,t+6)===121)return Re(e,":",":"+Pe)+e;break;case 6444:switch(it(e,it(e,14)===45?18:11)){case 120:return Re(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Pe+(it(e,14)===45?"inline-":"")+"box$3$1"+Pe+"$2$3$1"+Ze+"$2box$3")+e;case 100:return Re(e,":",":"+Ze)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Re(e,"scroll-","scroll-snap-")+e}return e}function kr(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Ho(e,t,n,r){switch(e.type){case pm:if(e.children.length)break;case hm:case gm:case Hi:return e.return=e.return||e.value;case ou:return"";case lu:return e.return=e.value+"{"+kr(e.children,r)+"}";case Vi:if(!Mt(e.value=e.props.join(",")))return""}return Mt(n=kr(e.children,r))?e.return=e.value+"{"+n+"}":""}function Em(e){var t=uu(e);return function(n,r,a,i){for(var o="",l=0;l<t;l++)o+=e[l](n,r,a,i)||"";return o}}function Im(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Hi:e.return=fu(e.value,e.length,n);return;case lu:return kr([ln(e,{value:Re(e.value,"@","@"+Pe)})],r);case Vi:if(e.length)return bm(n=e.props,function(a){switch(qt(a,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":_n(ln(e,{props:[Re(a,/:(read-\w+)/,":"+Tr+"$1")]})),_n(ln(e,{props:[a]})),Ja(e,{props:_o(n,r)});break;case"::placeholder":_n(ln(e,{props:[Re(a,/:(plac\w+)/,":"+Pe+"input-$1")]})),_n(ln(e,{props:[Re(a,/:(plac\w+)/,":"+Tr+"$1")]})),_n(ln(e,{props:[Re(a,/:(plac\w+)/,Ze+"input-$1")]})),_n(ln(e,{props:[a]})),Ja(e,{props:_o(n,r)});break}return""})}}function mu(e,t){const{path:n,parentSelectors:r}=t;Ge(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${e}${r.length?` Selector: ${r.join(" | ")}`:""}`)}const Mm=(e,t,n)=>{if(e==="content"){const r=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;(typeof t!="string"||["normal","none","initial","inherit","unset"].indexOf(t)===-1&&!r.test(t)&&!t.startsWith("var(")&&(t.charAt(0)!==t.charAt(t.length-1)||t.charAt(0)!=='"'&&t.charAt(0)!=="'"))&&mu(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${t}"'\`.`,n)}},km=(e,t,n)=>{e==="animation"&&n.hashId&&t!=="none"&&mu(`You seem to be using hashed animation '${t}', in which case 'animationName' with Keyframe as value is recommended.`,n)},Yo="data-ant-cssinjs-cache-path",hu="_FILE_STYLE__";let Rn,gu=!0;function Am(){var e;if(!Rn&&(Rn={},Nr())){const t=document.createElement("div");t.className=Yo,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);let n=getComputedStyle(t).content||"";n=n.replace(/^"/,"").replace(/"$/,""),n.split(";").forEach(a=>{const[i,o]=a.split(":");Rn[i]=o});const r=document.querySelector(`style[${Yo}]`);r&&(gu=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function Om(e){return Am(),!!Rn[e]}function Dm(e){const t=Rn[e];let n=null;if(t&&Nr())if(gu)n=hu;else{const r=document.querySelector(`style[${$n}="${Rn[e]}"]`);r?n=r.innerHTML:delete Rn[e]}return[n,t]}const pu="_skip_check_",yu="_multi_value_";function xa(e,t){return(t?kr(zo(e),Em([Im,Ho])):kr(zo(e),Ho)).replace(/\{%%%\:[^;];}/g,";")}function Pm(e){return typeof e=="object"&&e&&(pu in e||yu in e)}function Uo(e,t,n="high"){if(!t)return e;const r=su({hashCls:t,hashPriority:n});return e.split(",").map(i=>{var h;const o=i.trim().split(/\s+/);let l=o[0]||"";const c=((h=l.match(/^\w+/))==null?void 0:h[0])||"";return l=`${c}${r}${l.slice(c.length)}`,[l,...o.slice(1)].join(" ")}).join(",")}const Qa=(e,t={},{root:n,injectHash:r,parentSelectors:a}={root:!0,parentSelectors:[]})=>{const{hashId:i,layer:o,path:l,hashPriority:c,transformers:h=[],linters:g=[]}=t;let f="",m={};function p(w){const v=w.getName(i);if(!m[v]){const[x]=Qa(w.style,t,{root:!1,parentSelectors:a});m[v]=`@keyframes ${w.getName(i)}${x}`}}function S(w,v=[]){return w.forEach(x=>{Array.isArray(x)?S(x,v):x&&v.push(x)}),v}return S(Array.isArray(e)?e:[e]).forEach(w=>{const v=typeof w=="string"&&!n?{}:w;if(typeof v=="string")f+=`${v}
18
- `;else if(v._keyframe)p(v);else{const x=h.reduce((C,j)=>{var b;return((b=j==null?void 0:j.visit)==null?void 0:b.call(j,C))||C},v);Object.keys(x).forEach(C=>{const j=x[C];if(typeof j=="object"&&j&&(C!=="animationName"||!j._keyframe)&&!Pm(j)){let b=!1,T=C.trim(),$=!1;(n||r)&&i?T.startsWith("@")?b=!0:T==="&"?T=Uo("",i,c):T=Uo(C,i,c):n&&!i&&(T==="&"||T==="")&&(T="",$=!0);const[F,E]=Qa(j,t,{root:$,injectHash:b,parentSelectors:[...a,T]});m={...m,...E},f+=`${T}${F}`}else{let b=function($,F){process.env.NODE_ENV!=="production"&&(typeof j!="object"||!(j!=null&&j[pu]))&&[Mm,km,...g].forEach(k=>k($,F,{path:l,hashId:i,parentSelectors:a}));const E=$.replace(/[A-Z]/g,k=>`-${k.toLowerCase()}`);let M=F;!mm[$]&&typeof M=="number"&&M!==0&&(M=`${M}px`),$==="animationName"&&(F!=null&&F._keyframe)&&(p(F),M=F.getName(i)),f+=`${E}:${M};`};const T=(j==null?void 0:j.value)??j;typeof j=="object"&&(j!=null&&j[yu])&&Array.isArray(T)?T.forEach($=>{b(C,$)}):Jf(T)&&b(C,T)}})}}),n?o&&(f&&(f=`@layer ${o.name} {${f}}`),o.dependencies&&(m[`@layer ${o.name}`]=o.dependencies.map(w=>`@layer ${w}, ${o.name};`).join(`
19
- `))):f=`{${f}}`,[f,m]};function Nm(e,t){return Ir(`${e.join("%")}${t}`)}const Lm="style";function _m(e,t){const{path:n,hashId:r,layer:a,nonce:i,clientOnly:o,order:l=0}=e,{mock:c,hashPriority:h,container:g,transformers:f,linters:m,cache:p,layer:S,autoPrefix:y}=be.useContext(Bi),w=[r||""];S&&w.push("layer"),w.push(...n);let v=Lo;process.env.NODE_ENV!=="production"&&c!==void 0&&(v=c==="client"),iu(Lm,w,()=>{const x=w.join("|");if(Om(x)){const[F,E]=Dm(x);if(F)return[F,E,{},o,l]}const C=t(),[j,b]=Qa(C,{hashId:r,hashPriority:h,layer:S?a:void 0,path:n.join("-"),transformers:f,linters:m}),T=xa(j,y||!1),$=Nm(w,T);return[T,$,b,o,l]},(x,C)=>{const[,j]=x;C&&Lo&&kf(j,{mark:$n,attachTo:g})},x=>{const[C,j,b,,T]=x;if(v&&C!==hu){let $={mark:$n,prepend:S?!1:"queue",attachTo:g,priority:T};$=au($,i);const F=[],E=[];Object.keys(b).forEach(k=>{k.startsWith("@layer")?F.push(k):E.push(k)}),F.forEach(k=>{ys(xa(b[k],y||!1),`_layer-${k}`,{...$,prepend:!0})});const M=ys(C,j,$);M[un]=p.instanceId,process.env.NODE_ENV!=="production"&&M.setAttribute(Uf,w.join("|")),E.forEach(k=>{ys(xa(b[k],y||!1),`_effect-${k}`,$)})}})}class xu{constructor(t,n){ue(this,"name");ue(this,"style");ue(this,"_keyframe",!0);this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}function zn(e){return e.notSplit=!0,e}zn(["borderTop","borderBottom"]),zn(["borderTop"]),zn(["borderBottom"]),zn(["borderLeft","borderRight"]),zn(["borderLeft"]),zn(["borderRight"]);const zm={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},Bm={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},Vm={...Bm,locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月",nextMonth:"下个月",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年",nextYear:"下一年",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1},bu={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},ei={lang:{placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"],...Vm},timePickerLocale:{...bu}};ei.lang.ok="确定";const yt="${label}不是一个有效的${type}",Hm={locale:"zh-cn",Pagination:zm,DatePicker:ei,TimePicker:bu,Calendar:ei,global:{placeholder:"请选择",close:"关闭",sortable:"可排序",show:"显示",hide:"隐藏"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckAll:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Carousel:{prevSlide:"上一张幻灯片",nextSlide:"下一张幻灯片"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:yt,method:yt,array:yt,object:yt,number:yt,date:yt,boolean:yt,integer:yt,float:yt,regexp:yt,email:yt,url:yt,hex:yt},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无",transparent:"无色",singleColor:"单色",gradientColor:"渐变色"}};var Ss={exports:{}},Ym=Ss.exports,Ko;function Um(){return Ko||(Ko=1,(function(e,t){(function(n,r){e.exports=r(Yc())})(Ym,(function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var a=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,l){return l==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,l){var c=100*o+l;return c<600?"凌晨":c<900?"早上":c<1100?"上午":c<1300?"中午":c<1800?"下午":"晚上"}};return a.default.locale(i,null,!0),i}))})(Ss)),Ss.exports}Um();var Zr={exports:{}},ba={};/**
17
+ */var Do;function Sf(){return Do||(Do=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(typeof y=="object"&&y!==null){var w=y.$$typeof;switch(w){case t:switch(y=y.type,y){case r:case i:case a:case m:case g:case p:return y;default:switch(y=y&&y.$$typeof,y){case l:case u:case h:case f:return y;case o:return y;default:return w}}case n:return w}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),S=Symbol.for("react.client.reference");Ye.ContextConsumer=o,Ye.ContextProvider=l,Ye.Element=t,Ye.ForwardRef=u,Ye.Fragment=r,Ye.Lazy=h,Ye.Memo=f,Ye.Portal=n,Ye.Profiler=i,Ye.StrictMode=a,Ye.Suspense=m,Ye.SuspenseList=g,Ye.isContextConsumer=function(y){return e(y)===o},Ye.isContextProvider=function(y){return e(y)===l},Ye.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},Ye.isForwardRef=function(y){return e(y)===u},Ye.isFragment=function(y){return e(y)===r},Ye.isLazy=function(y){return e(y)===h},Ye.isMemo=function(y){return e(y)===f},Ye.isPortal=function(y){return e(y)===n},Ye.isProfiler=function(y){return e(y)===i},Ye.isStrictMode=function(y){return e(y)===a},Ye.isSuspense=function(y){return e(y)===m},Ye.isSuspenseList=function(y){return e(y)===g},Ye.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===i||y===a||y===m||y===g||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===l||y.$$typeof===o||y.$$typeof===u||y.$$typeof===S||y.getModuleId!==void 0)},Ye.typeOf=e})()),Ye}var Po;function Cf(){return Po||(Po=1,process.env.NODE_ENV==="production"?fs.exports=bf():fs.exports=Sf()),fs.exports}var Oa=Cf();const wf=Symbol.for("react.element"),jf=Symbol.for("react.transitional.element"),vf=Symbol.for("react.fragment");function su(e){return e&&typeof e=="object"&&(e.$$typeof===wf||e.$$typeof===jf)&&e.type===vf}var Wc;const Tf=Number((Wc=d.version)==null?void 0:Wc.split(".")[0]),Ff=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},Rf=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{Ff(r,n)})}},$f=(...e)=>xf(()=>Rf(...e),e,(t,n)=>t.length!==n.length||t.every((r,a)=>r!==n[a])),Ef=e=>{var n,r;if(!e)return!1;if(au(e)&&Tf>=19)return!0;const t=Oa.isMemo(e)?e.type.type:e.type;return!(typeof t=="function"&&!((n=t.prototype)!=null&&n.render)&&t.$$typeof!==Oa.ForwardRef||typeof e=="function"&&!((r=e.prototype)!=null&&r.render)&&e.$$typeof!==Oa.ForwardRef)};function au(e){return d.isValidElement(e)&&!su(e)}const If=e=>{if(e&&au(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function Mf(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const No="data-rc-order",Lo="data-rc-priority",kf="rc-util-key",hi=new Map;function iu({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:kf}function fa(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Af(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function so(e){return e?Array.from((hi.get(e)||e).children).filter(t=>t.tagName==="STYLE"):[]}function ou(e,t={}){if(!Gr())return null;const{csp:n,prepend:r,priority:a=0}=t,i=Af(r),o=i==="prependQueue",l=document.createElement("style");l.setAttribute(No,i),o&&a&&l.setAttribute(Lo,`${a}`),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;const u=fa(t);if(!u)return null;const{firstChild:m}=u;if(r){if(o){const g=(t.styles||so(u)).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(No)))return!1;const h=Number(f.getAttribute(Lo)||0);return a>=h});if(g.length)return u.insertBefore(l,g[g.length-1].nextSibling),l}u.insertBefore(l,m)}else u.appendChild(l);return l}function lu(e,t={}){let{styles:n}=t;return n||(n=so(fa(t))),n.find(r=>r.getAttribute(iu(t))===e)}function Of(e,t={}){const n=lu(e,t);if(n){const r=fa(t);r==null||r.removeChild(n)}}function Df(e,t){const n=hi.get(e);if(!n||!Mf(document,n)){const r=ou("",t);if(!r)return;const{parentNode:a}=r;hi.set(e,a),e.removeChild(r)}}function Ds(e,t,n={}){var u,m,g;const r=fa(n);if(!r)return null;const a=so(r),i={...n,styles:a};Df(r,i);const o=lu(t,i);if(o)return(u=i.csp)!=null&&u.nonce&&o.nonce!==((m=i.csp)==null?void 0:m.nonce)&&(o.nonce=(g=i.csp)==null?void 0:g.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;const l=ou(e,i);return l?(l.setAttribute(iu(i),t),l):null}function _o(e){return e instanceof HTMLElement||e instanceof SVGElement}function Pf(e){return e&&typeof e=="object"&&_o(e.nativeElement)?e.nativeElement:_o(e)?e:null}let mi={};const ao=[],Nf=e=>{ao.push(e)};function Zs(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=ao.reduce((r,a)=>a(r??"","warning"),t);n&&console.error(`Warning: ${n}`)}}function Lf(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=ao.reduce((r,a)=>a(r??"","note"),t);n&&console.warn(`Note: ${n}`)}}function _f(){mi={}}function cu(e,t,n){!t&&!mi[n]&&(e(!1,n),mi[n]=!0)}function Qe(e,t){cu(Zs,e,t)}function zf(e,t){cu(Lf,e,t)}Qe.preMessage=Nf;Qe.resetWarned=_f;Qe.noteOnce=zf;function zo(e,t,n=!1){const r=new Set;function a(i,o,l=1){const u=r.has(i);if(Qe(!u,"Warning: There may be circular references"),u)return!1;if(i===o)return!0;if(n&&l>1)return!1;r.add(i);const m=l+1;if(Array.isArray(i)){if(!Array.isArray(o)||i.length!==o.length)return!1;for(let g=0;g<i.length;g++)if(!a(i[g],o[g],m))return!1;return!0}if(i&&o&&typeof i=="object"&&typeof o=="object"){const g=Object.keys(i);return g.length!==Object.keys(o).length?!1:g.every(f=>a(i[f],o[f],m))}return!1}return a(e,t)}var Fr={exports:{}},Bo;function Bf(){if(Bo)return Fr.exports;Bo=1,Fr.exports=r,Fr.exports.isMobile=r,Fr.exports.default=r;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,t=/CrOS/,n=/android|ipad|playbook|silk/i;function r(a){a||(a={});let i=a.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let o=e.test(i)&&!t.test(i)||!!a.tablet&&n.test(i);return!o&&a.tablet&&a.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(o=!0),o}return Fr.exports}Bf();function We(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function bn(e,t={}){let n=[];return d.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(bn(r)):su(r)&&r.props?n=n.concat(bn(r.props.children,t)):n.push(r))}),n}function De(e,t){let n=e;for(let r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function uu(e,t,n,r){if(!t.length)return n;const[a,...i]=t;let o;if(!e&&typeof a=="number"?o=[]:Array.isArray(e)?o=[...e]:o={...e},r&&n===void 0&&i.length===1){const l=o[a];if(l&&typeof l=="object"){const u=Array.isArray(l)?[...l]:{...l};delete u[i[0]],o[a]=u}}else o[a]=uu(o[a],i,n,r);return o}function Ge(e,t,n,r=!1){return t.length&&r&&n===void 0&&!De(e,t.slice(0,-1))?e:uu(e,t,n,r)}function Vf(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Vo(e){return Array.isArray(e)?[]:{}}const Hf=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Uf(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let a=Vo(e[0]);return e.forEach(i=>{function o(l,u){const m=new Set(u),g=De(i,l),f=Array.isArray(g);if(f||Vf(g)){if(!m.has(g)){m.add(g);const h=De(a,l);f?a=Ge(a,l,r(h,g)):(!h||typeof h!="object")&&(a=Ge(a,l,Vo(g))),Hf(g).forEach(p=>{Object.getOwnPropertyDescriptor(g,p).enumerable&&o([...l,p],m)})}}else a=Ge(a,l,g)}o([])}),a}function tr(...e){return Uf(e)}function du(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=du(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function le(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=du(e))&&(r&&(r+=" "),r+=t);return r}function Vr(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}const Yf="%";function gi(e){return e.join(Yf)}let Ho=0;class Kf{constructor(t){ce(this,"instanceId");ce(this,"cache",new Map);ce(this,"updateTimes",new Map);ce(this,"extracted",new Set);this.instanceId=t}get(t){return this.opGet(gi(t))}opGet(t){return this.cache.get(t)||null}update(t,n){return this.opUpdate(gi(t),n)}opUpdate(t,n){const r=this.cache.get(t),a=n(r);a===null?(this.cache.delete(t),this.updateTimes.delete(t)):(this.cache.set(t,a),this.updateTimes.set(t,Ho),Ho+=1)}}const fu="data-token-hash",Mn="data-css-hash",Wf="data-cache-path",hn="__cssinjs_instance__";function qf(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${Mn}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(a=>{a[hn]||(a[hn]=e),a[hn]===e&&document.head.insertBefore(a,n)});const r={};Array.from(document.querySelectorAll(`style[${Mn}]`)).forEach(a=>{var o;const i=a.getAttribute(Mn);r[i]?a[hn]===e&&((o=a.parentNode)==null||o.removeChild(a)):r[i]=!0})}return new Kf(e)}const io=xe.createContext({hashPriority:"low",cache:qf(),defaultCache:!0,autoPrefix:!1});let Uo=0;class Gf{constructor(t){ce(this,"derivatives");ce(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=Uo,t.length===0&&Zs(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Uo+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const Zf=new WeakMap,Da={};function Jf(e,t){let n=Zf;for(let r=0;r<t.length;r+=1){const a=t[r];n.has(a)||n.set(a,new WeakMap),n=n.get(a)}return n.has(Da)||n.set(Da,e()),n.get(Da)}const Yo=new WeakMap;function Pr(e){let t=Yo.get(e)||"";return t||(Object.keys(e).forEach(n=>{const r=e[n];t+=n,r instanceof Gf?t+=r.id:r&&typeof r=="object"?t+=Pr(r):t+=r}),t=Vr(t),Yo.set(e,t)),t}function Xf(e,t){return Vr(`${t}_${Pr(e)}`)}const Ko=Gr();function hu(e){const{hashCls:t,hashPriority:n="low"}=e||{};if(!t)return"";const r=`.${t}`;return n==="low"?`:where(${r})`:r}const Qf=e=>e!=null;function mu(e,t){const n=typeof t=="function"?t():t;return n?{...e,csp:{...e.csp,nonce:n}}:e}const eh=(e,t="")=>`--${t?`${t}-`:""}${e}`.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase(),th=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",scope:i}=n||{};if(!Object.keys(e).length)return"";const o=`${hu({hashCls:r,hashPriority:a})}.${t}`,l=[i].flat().filter(Boolean);return`${l.length?l.map(m=>`${o}.${m}`).join(", "):o}{${Object.entries(e).map(([m,g])=>`${m}:${g};`).join("")}}`},nh=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",prefix:i,unitless:o,ignore:l,preserve:u}=n||{},m={},g={};return Object.entries(e).forEach(([f,h])=>{if(u!=null&&u[f])g[f]=h;else if((typeof h=="string"||typeof h=="number")&&!(l!=null&&l[f])){const p=eh(f,i);m[p]=typeof h=="number"&&!(o!=null&&o[f])?`${h}px`:String(h),g[f]=`var(${p})`}}),[g,th(m,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:a})]};function rh(){return!1}let pi=!1;function sh(){return pi}const ah=process.env.NODE_ENV==="production"?rh:sh;if(process.env.NODE_ENV!=="production"&&typeof module<"u"&&module&&module.hot&&typeof window<"u"){const e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null;if(e&&typeof e.webpackHotUpdate=="function"){const t=e.webpackHotUpdate;e.webpackHotUpdate=(...n)=>(pi=!0,setTimeout(()=>{pi=!1},0),t(...n))}}const hs=new Map;function gu(e,t,n,r,a){const{cache:i}=xe.useContext(io),o=[e,...t],l=gi(o),u=ah(),m=h=>{i.opUpdate(l,p=>{const[S=0,y]=p||[void 0,void 0];let w=y;process.env.NODE_ENV!=="production"&&y&&u&&(r==null||r(w,u),w=null);const v=w||n(),x=[S,v];return h?h(x):x})};xe.useMemo(()=>{m()},[l]);let g=i.opGet(l);process.env.NODE_ENV!=="production"&&!g&&(m(),g=i.opGet(l));const f=g[1];return d.useInsertionEffect(()=>(m(([h,p])=>[h+1,p]),hs.has(l)||(a==null||a(f),hs.set(l,!0),Promise.resolve().then(()=>{hs.delete(l)})),()=>{i.opUpdate(l,h=>{const[p=0,S]=h||[];return p-1===0?(r==null||r(S,!1),hs.delete(l),null):[p-1,S]})}),[l]),f}const ih={},oh=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",Fn=new Map;function lh(e){Fn.set(e,(Fn.get(e)||0)+1)}function ch(e,t){typeof document<"u"&&document.querySelectorAll(`style[${fu}="${e}"]`).forEach(r=>{var a;r[hn]===t&&((a=r.parentNode)==null||a.removeChild(r))})}const uh=-1;function dh(e,t){Fn.set(e,(Fn.get(e)||0)-1);const n=new Set;Fn.forEach((r,a)=>{r<=0&&n.add(a)}),Fn.size-n.size>uh&&n.forEach(r=>{ch(r,t),Fn.delete(r)})}const fh=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},hh="token";function mh(e,t,n){const{cache:{instanceId:r},container:a,hashPriority:i}=d.useContext(io),{salt:o="",override:l=ih,formatToken:u,getComputedToken:m,cssVar:g,nonce:f}=n,h=Jf(()=>Object.assign({},...t),t),p=Pr(h),S=Pr(l),y=Pr(g);return gu(hh,[o,e.id,p,S,y],()=>{const v=m?m(h,l,e):fh(h,l,e,u),x={...v},C=`${o}_${g.prefix}`,j=Vr(C),b=`${oh}-${j}`;x._tokenKey=Xf(x,C);const[T,R]=nh(v,g.key,{prefix:g.prefix,ignore:g.ignore,unitless:g.unitless,preserve:g.preserve,hashPriority:i,hashCls:g.hashed?b:void 0});return T._hashId=j,lh(g.key),[T,b,x,R,g.key]},([,,,,v])=>{dh(v,r)},([,,,v,x])=>{if(!v)return;let C={mark:Mn,prepend:"queue",attachTo:a,priority:-999};C=mu(C,f);const j=Ds(v,Vr(`css-var-${x}`),C);j[hn]=r,j.setAttribute(fu,x)})}var gh={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},et="-ms-",Nr="-moz-",Le="-webkit-",pu="comm",oo="rule",lo="decl",ph="@import",yh="@namespace",yu="@keyframes",xh="@layer",bh=Math.abs,Lr=String.fromCharCode,yi=Object.assign;function Sh(e,t){return dt(e,0)^45?(((t<<2^dt(e,0))<<2^dt(e,1))<<2^dt(e,2))<<2^dt(e,3):0}function xu(e){return e.trim()}function Xt(e,t){return(e=t.exec(e))?e[0]:e}function Me(e,t,n){return e.replace(t,n)}function Pa(e,t){return e.indexOf(t)}function dt(e,t){return e.charCodeAt(t)|0}function An(e,t,n){return e.slice(t,n)}function Ot(e){return e.length}function bu(e){return e.length}function kr(e,t){return t.push(e),e}function Ch(e,t){return e.map(t).join("")}function Wo(e,t){return e.filter(function(n){return!Xt(n,t)})}var ha=1,or=1,Su=0,Mt=0,ut=0,hr="";function ma(e,t,n,r,a,i,o,l){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:ha,column:or,length:o,return:"",siblings:l}}function dn(e,t){return yi(ma("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function qn(e){for(;e.root;)e=dn(e.root,{children:[e]});kr(e,e.siblings)}function wh(){return ut}function jh(){return ut=Mt>0?dt(hr,--Mt):0,or--,ut===10&&(or=1,ha--),ut}function Nt(){return ut=Mt<Su?dt(hr,Mt++):0,or++,ut===10&&(or=1,ha++),ut}function mn(){return dt(hr,Mt)}function Ps(){return Mt}function ga(e,t){return An(hr,e,t)}function Hr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function vh(e){return ha=or=1,Su=Ot(hr=e),Mt=0,[]}function Th(e){return hr="",e}function Na(e){return xu(ga(Mt-1,xi(e===91?e+2:e===40?e+1:e)))}function Fh(e){for(;(ut=mn())&&ut<33;)Nt();return Hr(e)>2||Hr(ut)>3?"":" "}function Rh(e,t){for(;--t&&Nt()&&!(ut<48||ut>102||ut>57&&ut<65||ut>70&&ut<97););return ga(e,Ps()+(t<6&&mn()==32&&Nt()==32))}function xi(e){for(;Nt();)switch(ut){case e:return Mt;case 34:case 39:e!==34&&e!==39&&xi(ut);break;case 40:e===41&&xi(e);break;case 92:Nt();break}return Mt}function $h(e,t){for(;Nt()&&e+ut!==57;)if(e+ut===84&&mn()===47)break;return"/*"+ga(t,Mt-1)+"*"+Lr(e===47?e:Nt())}function Eh(e){for(;!Hr(mn());)Nt();return ga(e,Mt)}function qo(e){return Th(Ns("",null,null,null,[""],e=vh(e),0,[0],e))}function Ns(e,t,n,r,a,i,o,l,u){for(var m=0,g=0,f=o,h=0,p=0,S=0,y=1,w=1,v=1,x=0,C=0,j="",b=a,T=i,R=r,F=j;w;)switch(S=C,C=Nt()){case 40:S!=108&&dt(F,f-1)==58?(x++,F+="("):F+=Na(C);break;case 41:x--,F+=")";break;case 34:case 39:case 91:F+=Na(C);break;case 9:case 10:case 13:case 32:if(x>0){F+=Lr(C);break}F+=Fh(S);break;case 92:F+=Rh(Ps()-1,7);continue;case 47:switch(mn()){case 42:case 47:kr(Ih($h(Nt(),Ps()),t,n,u),u),(Hr(S||1)==5||Hr(mn()||1)==5)&&Ot(F)&&An(F,-1,void 0)!==" "&&(F+=" ");break;default:F+="/"}break;case 123*y:l[m++]=Ot(F)*v;case 125*y:case 59:case 0:if(x>0&&C){F+=Lr(C);break}switch(C){case 0:case 125:w=0;case 59+g:v==-1&&(F=Me(F,/\f/g,"")),p>0&&(Ot(F)-f||y===0)&&kr(p>32?Zo(F+";",r,n,f-1,u):Zo(Me(F," ","")+";",r,n,f-2,u),u);break;case 59:F+=";";default:if(kr(R=Go(F,t,n,m,g,a,l,j,b=[],T=[],f,i),i),C===123)if(g===0)Ns(F,t,R,R,b,i,f,l,T);else{switch(h){case 99:if(dt(F,3)===110)break;case 108:if(dt(F,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Ns(e,R,R,r&&kr(Go(e,R,R,0,0,a,l,j,a,b=[],f,T),T),a,T,f,l,r?b:T):Ns(F,R,R,R,[""],T,0,l,T)}}m=g=p=0,y=v=1,j=F="",f=o;break;case 58:f=1+Ot(F),p=S;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&jh()==125)continue}switch(F+=Lr(C),C*y){case 38:v=g>0?1:(F+="\f",-1);break;case 44:if(x>0)break;l[m++]=(Ot(F)-1)*v,v=1;break;case 64:mn()===45&&(F+=Na(Nt())),h=mn(),g=f=Ot(j=F+=Eh(Ps())),C++;break;case 45:S===45&&Ot(F)==2&&(y=0)}}return i}function Go(e,t,n,r,a,i,o,l,u,m,g,f){for(var h=a-1,p=a===0?i:[""],S=bu(p),y=0,w=0,v=0;y<r;++y)for(var x=0,C=An(e,h+1,h=bh(w=o[y])),j=e;x<S;++x)(j=xu(w>0?p[x]+" "+C:Me(C,/&\f/g,p[x])))&&(u[v++]=j);return ma(e,t,n,a===0?oo:l,u,m,g,f)}function Ih(e,t,n,r){return ma(e,t,n,pu,Lr(wh()),An(e,2,-2),0,r)}function Zo(e,t,n,r,a){return ma(e,t,n,lo,An(e,0,r),An(e,r+1,-1),r,a)}function Cu(e,t,n){switch(Sh(e,t)){case 5103:return Le+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return Le+e+e;case 4855:return Le+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return Nr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Le+e+Nr+e+et+e+e;case 5936:switch(dt(e,t+11)){case 114:return Le+e+et+Me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Le+e+et+Me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Le+e+et+Me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Le+e+et+e+e;case 6165:return Le+e+et+"flex-"+e+e;case 5187:return Le+e+Me(e,/(\w+).+(:[^]+)/,Le+"box-$1$2"+et+"flex-$1$2")+e;case 5443:return Le+e+et+"flex-item-"+Me(e,/flex-|-self/g,"")+(Xt(e,/flex-|baseline/)?"":et+"grid-row-"+Me(e,/flex-|-self/g,""))+e;case 4675:return Le+e+et+"flex-line-pack"+Me(e,/align-content|flex-|-self/g,"")+e;case 5548:return Le+e+et+Me(e,"shrink","negative")+e;case 5292:return Le+e+et+Me(e,"basis","preferred-size")+e;case 6060:return Le+"box-"+Me(e,"-grow","")+Le+e+et+Me(e,"grow","positive")+e;case 4554:return Le+Me(e,/([^-])(transform)/g,"$1"+Le+"$2")+e;case 6187:return Me(Me(Me(e,/(zoom-|grab)/,Le+"$1"),/(image-set)/,Le+"$1"),e,"")+e;case 5495:case 3959:return Me(e,/(image-set\([^]*)/,Le+"$1$`$1");case 4968:return Me(Me(e,/(.+:)(flex-)?(.*)/,Le+"box-pack:$3"+et+"flex-pack:$3"),/space-between/,"justify")+Le+e+e;case 4200:if(!Xt(e,/flex-|baseline/))return et+"grid-column-align"+An(e,t)+e;break;case 2592:case 3360:return et+Me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,a){return t=a,Xt(r.props,/grid-\w+-end/)})?~Pa(e+(n=n[t].value),"span")?e:et+Me(e,"-start","")+e+et+"grid-row-span:"+(~Pa(n,"span")?Xt(n,/\d+/):+Xt(n,/\d+/)-+Xt(e,/\d+/))+";":et+Me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Xt(r.props,/grid-\w+-start/)})?e:et+Me(Me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Me(e,/(.+)-inline(.+)/,Le+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ot(e)-1-t>6)switch(dt(e,t+1)){case 109:if(dt(e,t+4)!==45)break;case 102:return Me(e,/(.+:)(.+)-([^]+)/,"$1"+Le+"$2-$3$1"+Nr+(dt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Pa(e,"stretch")?Cu(Me(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Me(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,a,i,o,l,u,m){return et+a+":"+i+m+(o?et+a+"-span:"+(l?u:+u-+i)+m:"")+e});case 4949:if(dt(e,t+6)===121)return Me(e,":",":"+Le)+e;break;case 6444:switch(dt(e,dt(e,14)===45?18:11)){case 120:return Me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Le+(dt(e,14)===45?"inline-":"")+"box$3$1"+Le+"$2$3$1"+et+"$2box$3")+e;case 100:return Me(e,":",":"+et)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Me(e,"scroll-","scroll-snap-")+e}return e}function Ur(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Jo(e,t,n,r){switch(e.type){case xh:if(e.children.length)break;case ph:case yh:case lo:return e.return=e.return||e.value;case pu:return"";case yu:return e.return=e.value+"{"+Ur(e.children,r)+"}";case oo:if(!Ot(e.value=e.props.join(",")))return""}return Ot(n=Ur(e.children,r))?e.return=e.value+"{"+n+"}":""}function Mh(e){var t=bu(e);return function(n,r,a,i){for(var o="",l=0;l<t;l++)o+=e[l](n,r,a,i)||"";return o}}function kh(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case lo:e.return=Cu(e.value,e.length,n);return;case yu:return Ur([dn(e,{value:Me(e.value,"@","@"+Le)})],r);case oo:if(e.length)return Ch(n=e.props,function(a){switch(Xt(a,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":qn(dn(e,{props:[Me(a,/:(read-\w+)/,":"+Nr+"$1")]})),qn(dn(e,{props:[a]})),yi(e,{props:Wo(n,r)});break;case"::placeholder":qn(dn(e,{props:[Me(a,/:(plac\w+)/,":"+Le+"input-$1")]})),qn(dn(e,{props:[Me(a,/:(plac\w+)/,":"+Nr+"$1")]})),qn(dn(e,{props:[Me(a,/:(plac\w+)/,et+"input-$1")]})),qn(dn(e,{props:[a]})),yi(e,{props:Wo(n,r)});break}return""})}}function wu(e,t){const{path:n,parentSelectors:r}=t;Qe(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${e}${r.length?` Selector: ${r.join(" | ")}`:""}`)}const Ah=(e,t,n)=>{if(e==="content"){const r=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;(typeof t!="string"||["normal","none","initial","inherit","unset"].indexOf(t)===-1&&!r.test(t)&&!t.startsWith("var(")&&(t.charAt(0)!==t.charAt(t.length-1)||t.charAt(0)!=='"'&&t.charAt(0)!=="'"))&&wu(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${t}"'\`.`,n)}},Oh=(e,t,n)=>{e==="animation"&&n.hashId&&t!=="none"&&wu(`You seem to be using hashed animation '${t}', in which case 'animationName' with Keyframe as value is recommended.`,n)},Xo="data-ant-cssinjs-cache-path",ju="_FILE_STYLE__";let kn,vu=!0;function Dh(){var e;if(!kn&&(kn={},Gr())){const t=document.createElement("div");t.className=Xo,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);let n=getComputedStyle(t).content||"";n=n.replace(/^"/,"").replace(/"$/,""),n.split(";").forEach(a=>{const[i,o]=a.split(":");kn[i]=o});const r=document.querySelector(`style[${Xo}]`);r&&(vu=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function Ph(e){return Dh(),!!kn[e]}function Nh(e){const t=kn[e];let n=null;if(t&&Gr())if(vu)n=ju;else{const r=document.querySelector(`style[${Mn}="${kn[e]}"]`);r?n=r.innerHTML:delete kn[e]}return[n,t]}const Tu="_skip_check_",Fu="_multi_value_";function La(e,t){return(t?Ur(qo(e),Mh([kh,Jo])):Ur(qo(e),Jo)).replace(/\{%%%\:[^;];}/g,";")}function Lh(e){return typeof e=="object"&&e&&(Tu in e||Fu in e)}function Qo(e,t,n="high"){if(!t)return e;const r=hu({hashCls:t,hashPriority:n});return e.split(",").map(i=>{var m;const o=i.trim().split(/\s+/);let l=o[0]||"";const u=((m=l.match(/^\w+/))==null?void 0:m[0])||"";return l=`${u}${r}${l.slice(u.length)}`,[l,...o.slice(1)].join(" ")}).join(",")}const bi=(e,t={},{root:n,injectHash:r,parentSelectors:a}={root:!0,parentSelectors:[]})=>{const{hashId:i,layer:o,path:l,hashPriority:u,transformers:m=[],linters:g=[]}=t;let f="",h={};function p(w){const v=w.getName(i);if(!h[v]){const[x]=bi(w.style,t,{root:!1,parentSelectors:a});h[v]=`@keyframes ${w.getName(i)}${x}`}}function S(w,v=[]){return w.forEach(x=>{Array.isArray(x)?S(x,v):x&&v.push(x)}),v}return S(Array.isArray(e)?e:[e]).forEach(w=>{const v=typeof w=="string"&&!n?{}:w;if(typeof v=="string")f+=`${v}
18
+ `;else if(v._keyframe)p(v);else{const x=m.reduce((C,j)=>{var b;return((b=j==null?void 0:j.visit)==null?void 0:b.call(j,C))||C},v);Object.keys(x).forEach(C=>{const j=x[C];if(typeof j=="object"&&j&&(C!=="animationName"||!j._keyframe)&&!Lh(j)){let b=!1,T=C.trim(),R=!1;(n||r)&&i?T.startsWith("@")?b=!0:T==="&"?T=Qo("",i,u):T=Qo(C,i,u):n&&!i&&(T==="&"||T==="")&&(T="",R=!0);const[F,E]=bi(j,t,{root:R,injectHash:b,parentSelectors:[...a,T]});h={...h,...E},f+=`${T}${F}`}else{let b=function(R,F){process.env.NODE_ENV!=="production"&&(typeof j!="object"||!(j!=null&&j[Tu]))&&[Ah,Oh,...g].forEach(k=>k(R,F,{path:l,hashId:i,parentSelectors:a}));const E=R.replace(/[A-Z]/g,k=>`-${k.toLowerCase()}`);let M=F;!gh[R]&&typeof M=="number"&&M!==0&&(M=`${M}px`),R==="animationName"&&(F!=null&&F._keyframe)&&(p(F),M=F.getName(i)),f+=`${E}:${M};`};const T=(j==null?void 0:j.value)??j;typeof j=="object"&&(j!=null&&j[Fu])&&Array.isArray(T)?T.forEach(R=>{b(C,R)}):Qf(T)&&b(C,T)}})}}),n?o&&(f&&(f=`@layer ${o.name} {${f}}`),o.dependencies&&(h[`@layer ${o.name}`]=o.dependencies.map(w=>`@layer ${w}, ${o.name};`).join(`
19
+ `))):f=`{${f}}`,[f,h]};function _h(e,t){return Vr(`${e.join("%")}${t}`)}const zh="style";function Bh(e,t){const{path:n,hashId:r,layer:a,nonce:i,clientOnly:o,order:l=0}=e,{mock:u,hashPriority:m,container:g,transformers:f,linters:h,cache:p,layer:S,autoPrefix:y}=xe.useContext(io),w=[r||""];S&&w.push("layer"),w.push(...n);let v=Ko;process.env.NODE_ENV!=="production"&&u!==void 0&&(v=u==="client"),gu(zh,w,()=>{const x=w.join("|");if(Ph(x)){const[F,E]=Nh(x);if(F)return[F,E,{},o,l]}const C=t(),[j,b]=bi(C,{hashId:r,hashPriority:m,layer:S?a:void 0,path:n.join("-"),transformers:f,linters:h}),T=La(j,y||!1),R=_h(w,T);return[T,R,b,o,l]},(x,C)=>{const[,j]=x;C&&Ko&&Of(j,{mark:Mn,attachTo:g})},x=>{const[C,j,b,,T]=x;if(v&&C!==ju){let R={mark:Mn,prepend:S?!1:"queue",attachTo:g,priority:T};R=mu(R,i);const F=[],E=[];Object.keys(b).forEach(k=>{k.startsWith("@layer")?F.push(k):E.push(k)}),F.forEach(k=>{Ds(La(b[k],y||!1),`_layer-${k}`,{...R,prepend:!0})});const M=Ds(C,j,R);M[hn]=p.instanceId,process.env.NODE_ENV!=="production"&&M.setAttribute(Wf,w.join("|")),E.forEach(k=>{Ds(La(b[k],y||!1),`_effect-${k}`,R)})}})}class Ru{constructor(t,n){ce(this,"name");ce(this,"style");ce(this,"_keyframe",!0);this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}function Gn(e){return e.notSplit=!0,e}Gn(["borderTop","borderBottom"]),Gn(["borderTop"]),Gn(["borderBottom"]),Gn(["borderLeft","borderRight"]),Gn(["borderLeft"]),Gn(["borderRight"]);const Vh={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},Hh={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},Uh={...Hh,locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月",nextMonth:"下个月",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年",nextYear:"下一年",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1},$u={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Si={lang:{placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"],...Uh},timePickerLocale:{...$u}};Si.lang.ok="确定";const St="${label}不是一个有效的${type}",Yh={locale:"zh-cn",Pagination:Vh,DatePicker:Si,TimePicker:$u,Calendar:Si,global:{placeholder:"请选择",close:"关闭",sortable:"可排序",show:"显示",hide:"隐藏"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckAll:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Carousel:{prevSlide:"上一张幻灯片",nextSlide:"下一张幻灯片"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:St,method:St,array:St,object:St,number:St,date:St,boolean:St,integer:St,float:St,regexp:St,email:St,url:St,hex:St},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无",transparent:"无色",singleColor:"单色",gradientColor:"渐变色"}};var Ls={exports:{}},Kh=Ls.exports,el;function Wh(){return el||(el=1,(function(e,t){(function(n,r){e.exports=r(Qc())})(Kh,(function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var a=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,l){return l==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,l){var u=100*o+l;return u<600?"凌晨":u<900?"早上":u<1100?"上午":u<1300?"中午":u<1800?"下午":"晚上"}};return a.default.locale(i,null,!0),i}))})(Ls)),Ls.exports}Wh();var ms={exports:{}},_a={};/**
20
20
  * @license React
21
21
  * use-sync-external-store-shim.production.js
22
22
  *
@@ -24,7 +24,7 @@
24
24
  *
25
25
  * This source code is licensed under the MIT license found in the
26
26
  * LICENSE file in the root directory of this source tree.
27
- */var Wo;function Km(){if(Wo)return ba;Wo=1;var e=d;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function l(f,m){var p=m(),S=r({inst:{value:p,getSnapshot:m}}),y=S[0].inst,w=S[1];return i(function(){y.value=p,y.getSnapshot=m,c(y)&&w({inst:y})},[f,p,m]),a(function(){return c(y)&&w({inst:y}),f(function(){c(y)&&w({inst:y})})},[f]),o(p),p}function c(f){var m=f.getSnapshot;f=f.value;try{var p=m();return!n(f,p)}catch{return!0}}function h(f,m){return m()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:l;return ba.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,ba}var Sa={};/**
27
+ */var tl;function qh(){if(tl)return _a;tl=1;var e=d;function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function l(f,h){var p=h(),S=r({inst:{value:p,getSnapshot:h}}),y=S[0].inst,w=S[1];return i(function(){y.value=p,y.getSnapshot=h,u(y)&&w({inst:y})},[f,p,h]),a(function(){return u(y)&&w({inst:y}),f(function(){u(y)&&w({inst:y})})},[f]),o(p),p}function u(f){var h=f.getSnapshot;f=f.value;try{var p=h();return!n(f,p)}catch{return!0}}function m(f,h){return h()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:l;return _a.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,_a}var za={};/**
28
28
  * @license React
29
29
  * use-sync-external-store-shim.development.js
30
30
  *
@@ -32,31 +32,31 @@
32
32
  *
33
33
  * This source code is licensed under the MIT license found in the
34
34
  * LICENSE file in the root directory of this source tree.
35
- */var qo;function Wm(){return qo||(qo=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}function t(p,S){g||a.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=S();if(!f){var w=S();i(y,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}w=o({inst:{value:y,getSnapshot:S}});var v=w[0].inst,x=w[1];return c(function(){v.value=y,v.getSnapshot=S,n(v)&&x({inst:v})},[p,y,S]),l(function(){return n(v)&&x({inst:v}),p(function(){n(v)&&x({inst:v})})},[p]),h(y),y}function n(p){var S=p.getSnapshot;p=p.value;try{var y=S();return!i(p,y)}catch{return!0}}function r(p,S){return S()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=d,i=typeof Object.is=="function"?Object.is:e,o=a.useState,l=a.useEffect,c=a.useLayoutEffect,h=a.useDebugValue,g=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Sa.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Sa}var Go;function qm(){return Go||(Go=1,process.env.NODE_ENV==="production"?Zr.exports=Km():Zr.exports=Wm()),Zr.exports}var Zo=qm(),Jo=Object.prototype.hasOwnProperty;function ti(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ti(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Jo.call(e,n)&&++r&&!Jo.call(t,n)||!(n in t)||!ti(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Su=0,Cu=1,wu=2,Xo=3,ju=4,Lt=new WeakMap,Gt=()=>{},Ke=Gt(),ks=Object,Fe=e=>e===Ke,At=e=>typeof e=="function",zt=(e,t)=>({...e,...t}),ni=e=>At(e.then),Ca={},Jr={},Yi="undefined",Lr=typeof window!=Yi,ri=typeof document!=Yi,Gm=Lr&&"Deno"in window,Zm=()=>Lr&&typeof window.requestAnimationFrame!=Yi,vu=(e,t)=>{const n=Lt.get(e);return[()=>!Fe(t)&&e.get(t)||Ca,r=>{if(!Fe(t)){const a=e.get(t);t in Jr||(Jr[t]=a),n[5](t,zt(a,r),a||Ca)}},n[6],()=>!Fe(t)&&t in Jr?Jr[t]:!Fe(t)&&e.get(t)||Ca]};let si=!0;const Jm=()=>si,[ai,ii]=Lr&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Gt,Gt],Xm=()=>{const e=ri&&document.visibilityState;return Fe(e)||e!=="hidden"},Qm=e=>(ri&&document.addEventListener("visibilitychange",e),ai("focus",e),()=>{ri&&document.removeEventListener("visibilitychange",e),ii("focus",e)}),eh=e=>{const t=()=>{si=!0,e()},n=()=>{si=!1};return ai("online",t),ai("offline",n),()=>{ii("online",t),ii("offline",n)}},th={isOnline:Jm,isVisible:Xm},nh={initFocus:Qm,initReconnect:eh},Qo=!d.useId,vn=!Lr||Gm,rh=e=>Zm()?window.requestAnimationFrame(e):setTimeout(e,1),Yn=vn?d.useEffect:d.useLayoutEffect,wa=typeof navigator<"u"&&navigator.connection,el=!vn&&wa&&(["slow-2g","2g"].includes(wa.effectiveType)||wa.saveData),Xr=new WeakMap,sh=e=>ks.prototype.toString.call(e),ja=(e,t)=>e===`[object ${t}]`;let ah=0;const oi=e=>{const t=typeof e,n=sh(e),r=ja(n,"Date"),a=ja(n,"RegExp"),i=ja(n,"Object");let o,l;if(ks(e)===e&&!r&&!a){if(o=Xr.get(e),o)return o;if(o=++ah+"~",Xr.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=oi(e[l])+",";Xr.set(e,o)}if(i){o="#";const c=ks.keys(e).sort();for(;!Fe(l=c.pop());)Fe(e[l])||(o+=l+":"+oi(e[l])+",");Xr.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Ui=e=>{if(At(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?oi(e):"",[e,t]};let ih=0;const As=()=>++ih;async function Tu(...e){const[t,n,r,a]=e,i=zt({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const l=i.rollbackOnError;let c=i.optimisticData;const h=m=>typeof l=="function"?l(m):l!==!1,g=i.throwOnError;if(At(n)){const m=n,p=[],S=t.keys();for(const y of S)!/^\$(inf|sub)\$/.test(y)&&m(t.get(y)._k)&&p.push(y);return Promise.all(p.map(f))}return f(n);async function f(m){const[p]=Ui(m);if(!p)return;const[S,y]=vu(t,p),[w,v,x,C]=Lt.get(t),j=()=>{const A=w[p];return(At(i.revalidate)?i.revalidate(S().data,m):i.revalidate!==!1)&&(delete x[p],delete C[p],A&&A[0])?A[0](wu).then(()=>S().data):S().data};if(e.length<3)return j();let b=r,T,$=!1;const F=As();v[p]=[F,0];const E=!Fe(c),M=S(),k=M.data,V=M._c,z=Fe(V)?k:V;if(E&&(c=At(c)?c(z,k):c,y({data:c,_c:z})),At(b))try{b=b(z)}catch(A){T=A,$=!0}if(b&&ni(b))if(b=await b.catch(A=>{T=A,$=!0}),F!==v[p][0]){if($)throw T;return b}else $&&E&&h(T)&&(o=!0,y({data:z,_c:Ke}));if(o&&!$)if(At(o)){const A=o(b,z);y({data:A,error:Ke,_c:Ke})}else y({data:b,error:Ke,_c:Ke});if(v[p][1]=As(),Promise.resolve(j()).then(()=>{y({_c:Ke})}),$){if(g)throw T;return}return b}}const tl=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Fu=(e,t)=>{if(!Lt.has(e)){const r=zt(nh,t),a=Object.create(null),i=Tu.bind(Ke,e);let o=Gt;const l=Object.create(null),c=(m,p)=>{const S=l[m]||[];return l[m]=S,S.push(p),()=>{const y=S.indexOf(p);y>=0&&(S[y]=S[S.length-1],S.pop())}},h=(m,p,S)=>{e.set(m,p);const y=l[m];if(y)for(const w of y)w(p,S)},g=m=>{const p=Lt.get(e),[,S,y,w]=p,v=As();p[8]++;for(const j in y)delete y[j];for(const j in w)delete w[j];for(const j in S)S[j]=[v,v];const x={};for(const j of[...e.keys()]){const b=e.get(j);e.delete(j);const T=l[j];if(T)for(const $ of T)$(x,b)}const C=!m||m.revalidate!==!1;for(const j in a){const b=a[j];for(let T=0;T<b.length;T++)b[T](ju,{revalidate:C&&!T})}},f=()=>{if(!Lt.has(e)&&(Lt.set(e,[a,Object.create(null),Object.create(null),Object.create(null),i,h,c,g,0]),!vn)){const m=r.initFocus(setTimeout.bind(Ke,tl.bind(Ke,a,Su))),p=r.initReconnect(setTimeout.bind(Ke,tl.bind(Ke,a,Cu)));o=()=>{m&&m(),p&&p(),Lt.delete(e)}}};return f(),[e,i,f,o,g]}const n=Lt.get(e);return[e,n[4],Ke,Ke,n[7]]},oh=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Fe(i)&&o>i||setTimeout(r,l,a)},lh=ti,[Ki,ch,,,uh]=Fu(new Map),$u=zt({onLoadingSlow:Gt,onSuccess:Gt,onError:Gt,onErrorRetry:oh,onDiscarded:Gt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:el?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:el?5e3:3e3,compare:lh,isPaused:()=>!1,cache:Ki,mutate:ch,unload:uh,fallback:{}},th),Ru=(e,t)=>{const n=zt(e,t);if(t){const{use:r,fallback:a,cacheData:i}=e,{use:o,fallback:l,cacheData:c}=t;r&&o&&(n.use=r.concat(o)),a&&l&&(n.fallback=zt(a,l)),i&&c&&(n.cacheData=zt(i,c))}return n},li=d.createContext({}),dh=e=>{const{value:t}=e,n=d.useContext(li),r=At(t),a=d.useMemo(()=>r?t(n):t,[r,n,t]),i=d.useMemo(()=>r?a:Ru(n,a),[r,n,a]),o=a&&a.provider,l=d.useRef(Ke);o&&!l.current&&(l.current=Fu(o(i.cache||Ki),a));const c=l.current;return c&&(i.cache=c[0],i.mutate=c[1],i.unload=c[4]),Yn(()=>{if(c)return c[2]&&c[2](),c[3]},[]),d.createElement(li.Provider,zt(e,{value:i}))},fh="$inf$",Eu=Lr&&window.__SWR_DEVTOOLS_USE__,mh=Eu?window.__SWR_DEVTOOLS_USE__:[],hh=()=>{Eu&&(window.__SWR_DEVTOOLS_REACT__=d)},gh=e=>At(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Iu=()=>{const e=d.useContext(li);return d.useMemo(()=>zt($u,e),[e])},ph=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=Ui(t),[,,,l]=Lt.get(Ki);if(o.startsWith(fh))return n(...i);const c=l[o];return Fe(c)?n(...i):(delete l[o],c)}),r),yh=mh.concat(ph),xh=e=>function(...n){const r=Iu(),[a,i,o]=gh(n),l=Ru(r,o);let c=e;const{use:h}=l,g=(h||[]).concat(yh);for(let f=g.length;f--;)c=g[f](c);return c(a,i||l.fetcher||null,l)},bh=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};hh();const Qr=d.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),va={dedupe:!0},nl=(e,t,n)=>{var r;return t?((r=e.get(t))==null?void 0:r.has(n))===!0:!1},Ta=(e,t,n)=>{if(!t)return;let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)},Sh=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{const a=i=>{n()&&Fe(t())&&r(i)};Promise.resolve(e).then(i=>{a({data:i,error:Ke})},i=>{a({error:i})})},Os=Promise.resolve(Ke);Os.status="fulfilled";Os.value=Ke;const Ch=()=>Gt,wh=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:l,revalidateIfStale:c,refreshInterval:h,refreshWhenHidden:g,refreshWhenOffline:f,keepPreviousData:m,strictServerPrefetchWarning:p}=n,[S,y,w,v]=Lt.get(r),[x,C]=Ui(e),j=d.useRef(!1),b=d.useRef(!1),T=d.useRef(x),$=d.useRef(t),F=d.useRef(n),E=()=>F.current,M=()=>E().isVisible()&&E().isOnline(),[k,V,z,A]=vu(r,x),I=d.useRef({}).current,R=Fe(o)?Fe(n.fallback)?Ke:n.fallback[x]:o,D=n.cacheData,O=x?D==null?void 0:D[x]:Ke,N=x?v[x]:Ke,q=Fe(N)&&!Fe(O),L=q?O:N,H=(ee,de)=>{for(const he in I){const je=he;if(je==="data"){if(!a(ee[je],de[je])&&(!Fe(ee[je])||!a(ie,de[je])))return!1}else if(de[je]!==ee[je])return!1}return!0},G=!j.current,W=d.useMemo(()=>{const ee=k(),de=A(),he=He=>{const Qe=zt(He);return delete Qe._k,(()=>{if(!x||!t||E().isPaused())return!1;if(G&&!Fe(l))return l;const $e=Fe(R)?Qe.data:R;return i&&q&&Fe($e)?!1:Fe($e)||c})()?{isValidating:!0,isLoading:!0,...Qe}:Qe},je=he(ee),Ee=ee===de?je:he(de);let ke=je;return[()=>{const He=he(k());return H(He,ke)?(ke.data=He.data,ke.isLoading=He.isLoading,ke.isValidating=He.isValidating,ke.error=He.error,ke):(ke=He,He)},()=>Ee]},[r,x]),B=Zo.useSyncExternalStore(d.useCallback(ee=>z(x,(de,he)=>{H(he,de)||ee()}),[r,x]),W[0],W[1]),_=S[x]&&S[x].length>0,Y=B.data;let P=Fe(Y)?R&&ni(R)?Qr(R):R:Y;const U=B.error,X=d.useRef(P),ne=d.useRef(Ke);let Z=ne.current;Z||(Z=new WeakMap,ne.current=Z);const re=d.useRef(null);let ie=m?Fe(Y)?Fe(X.current)?P:X.current:Y:P;const se=x&&Fe(P),pe=d.useRef(null);!vn&&Zo.useSyncExternalStore(Ch,()=>(pe.current=!1,pe),()=>(pe.current=!0,pe));const ge=pe.current;p&&ge&&!i&&se&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const fe=!x||!t||E().isPaused()||_&&!Fe(U)?!1:G&&!Fe(l)?l:i&&q&&se?!1:i?Fe(P)?!1:c:Fe(P)||c,J=G&&fe,K=Fe(B.isValidating)?J:B.isValidating,te=Fe(B.isLoading)?J:B.isLoading,oe=d.useCallback(async ee=>{const de=$.current;if(!x||!de||b.current||E().isPaused())return!1;let he,je,Ee=!0;const ke=ee||{},He=!w[x]||!ke.dedupe,Qe=q&&!nl(Z,D,x)&&!Fe(L)&&Fe(k().data),ve=()=>Qo?!b.current&&x===T.current&&j.current:x===T.current,$e={isValidating:!1,isLoading:!1},ut=()=>{V($e)},Q=()=>{const Se=w[x];Se&&Se[1]===je&&delete w[x]},le={isValidating:!0};Fe(k().data)&&(le.isLoading=!0);try{if(He&&(V(le),n.loadingTimeout&&Fe(k().data)&&setTimeout(()=>{Ee&&ve()&&E().onLoadingSlow(x,n)},n.loadingTimeout),Qe&&Ta(Z,D,x),w[x]=[Qe?L:de(C),As()],Qe&&v[x]&&delete v[x]),[he,je]=w[x],he=await he,He&&setTimeout(Q,n.dedupingInterval),!w[x]||w[x][1]!==je)return He&&ve()&&E().onDiscarded(x),!1;$e.error=Ke;const Se=y[x];if(!Fe(Se)&&(je<=Se[0]||je<=Se[1]||Se[1]===0))return ut(),He&&ve()&&E().onDiscarded(x),!1;const Le=k().data;$e.data=a(Le,he)?Le:he,He&&ve()&&E().onSuccess(he,x,n)}catch(Se){Q();const Le=E(),{shouldRetryOnError:Ye}=Le;Le.isPaused()||($e.error=Se,He&&ve()&&(Le.onError(Se,x,Le),(Ye===!0||At(Ye)&&Ye(Se))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||M())&&Le.onErrorRetry(Se,x,Le,tn=>{const nn=S[x];nn&&nn[0]&&nn[0](Xo,tn)},{retryCount:(ke.retryCount||0)+1,dedupe:!0})))}return Ee=!1,ut(),!0},[x,r]),xe=d.useCallback((...ee)=>Tu(r,T.current,...ee),[]);if(Yn(()=>{const ee=re.current;ee&&(re.current=null,Ta(Z,ee.cacheData,ee.key),Fe(k().data)&&V({data:ee.data,error:Ke,_k:ee._k}),v[ee.key]&&delete v[ee.key])}),Yn(()=>{$.current=t,F.current=n,Fe(Y)||(X.current=Y)}),Yn(()=>{if(t||!q||Fe(L)||nl(Z,D,x)||!Fe(k().data))return;Ta(Z,D,x);const ee=y[x];Sh({value:L,getCacheData:()=>k().data,canCommit:()=>!b.current&&x===T.current&&y[x]===ee,setCache:de=>V({...de,_k:C})})}),Yn(()=>{if(!x)return;const ee=oe.bind(Ke,va);let de=0;E().revalidateOnFocus&&(de=Date.now()+E().focusThrottleInterval);const je=bh(x,S,(Ee,ke={})=>{if(Ee==Su){const He=Date.now();E().revalidateOnFocus&&He>de&&M()&&(de=He+E().focusThrottleInterval,ee())}else if(Ee==Cu)E().revalidateOnReconnect&&M()&&ee();else{if(Ee==wu)return oe();if(Ee==Xo)return oe(ke);if(Ee==ju&&(X.current=Ke,ke.revalidate))return oe()}});return b.current=!1,T.current=x,j.current=!0,V({_k:C}),fe&&(w[x]||(Fe(P)||vn?ee():rh(ee))),()=>{b.current=!0,je()}},[x]),Yn(()=>{let ee;function de(){const je=At(h)?h(k().data):h;je&&ee!==-1&&(ee=setTimeout(he,je))}function he(){!k().error&&(g||E().isVisible())&&(f||E().isOnline())?oe(va).then(de):de()}return de(),()=>{ee&&(clearTimeout(ee),ee=-1)}},[h,g,f,x]),d.useDebugValue(ie),i){if(!Qo&&vn&&se&&Fe(L))throw new Error("Fallback data is required when using Suspense in SSR.");se&&($.current=t,F.current=n,b.current=!1);const ee=!Fe(L)&&se;let de=Ke;if(ee&&q)de=L&&ni(L)?Qr(L):L,P=de,ie=de,vn||(re.current={data:de,_k:C,key:x,cacheData:D});else{const je=ee?xe(L):Os;Qr(je)}if(!Fe(U)&&se)throw U;const he=se&&Fe(de)?oe(va):Os;!Fe(ie)&&se&&(he.status="fulfilled",he.value=!0),Qr(he)}return{mutate:xe,get data(){return I.data=!0,ie},get error(){return I.error=!0,U},get isValidating(){return I.isValidating=!0,K},get isLoading(){return I.isLoading=!0,te}}},jh=ks.defineProperty(dh,"defaultValue",{value:$u}),Mu=xh(wh),vh={moneySymbol:"$",form:{lightFilter:{more:"المزيد",clear:"نظف",confirm:"تأكيد",itemUnit:"عناصر"}},tableForm:{search:"ابحث",reset:"إعادة تعيين",submit:"ارسال",collapsed:"مُقلص",expand:"مُوسع",inputPlaceholder:"الرجاء الإدخال",selectPlaceholder:"الرجاء الإختيار"},alert:{clear:"نظف",selected:"محدد",item:"عنصر"},pagination:{total:{range:" ",total:"من",item:"عناصر"}},tableToolBar:{leftPin:"ثبت على اليسار",rightPin:"ثبت على اليمين",noPin:"الغاء التثبيت",leftFixedTitle:"لصق على اليسار",rightFixedTitle:"لصق على اليمين",noFixedTitle:"إلغاء الإلصاق",reset:"إعادة تعيين",columnDisplay:"الأعمدة المعروضة",columnSetting:"الإعدادات",fullScreen:"وضع كامل الشاشة",exitFullScreen:"الخروج من وضع كامل الشاشة",reload:"تحديث",density:"الكثافة",densityDefault:"افتراضي",densityLarger:"أكبر",densityMiddle:"وسط",densitySmall:"مدمج"},stepsForm:{next:"التالي",prev:"السابق",submit:"أنهى"},loginForm:{submitText:"تسجيل الدخول"},editableTable:{action:{save:"أنقذ",cancel:"إلغاء الأمر",delete:"حذف",add:"إضافة صف من البيانات"}},switch:{open:"مفتوح",close:"غلق"}},Th={moneySymbol:"€",form:{lightFilter:{more:"Més",clear:"Netejar",confirm:"Confirmar",itemUnit:"Elements"}},tableForm:{search:"Cercar",reset:"Netejar",submit:"Enviar",collapsed:"Expandir",expand:"Col·lapsar",inputPlaceholder:"Introduïu valor",selectPlaceholder:"Seleccioneu valor"},alert:{clear:"Netejar",selected:"Seleccionat",item:"Article"},pagination:{total:{range:" ",total:"de",item:"articles"}},tableToolBar:{leftPin:"Pin a l'esquerra",rightPin:"Pin a la dreta",noPin:"Sense Pin",leftFixedTitle:"Fixat a l'esquerra",rightFixedTitle:"Fixat a la dreta",noFixedTitle:"Sense fixar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuració",fullScreen:"Pantalla Completa",exitFullScreen:"Sortir Pantalla Completa",reload:"Refrescar",density:"Densitat",densityDefault:"Per Defecte",densityLarger:"Llarg",densityMiddle:"Mitjà",densitySmall:"Compacte"},stepsForm:{next:"Següent",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Cancel·lar",delete:"Eliminar",add:"afegir una fila de dades"}},switch:{open:"obert",close:"tancat"}},Fh={moneySymbol:"Kč",deleteThisLine:"Smazat tento řádek",copyThisLine:"Kopírovat tento řádek",form:{lightFilter:{more:"Víc",clear:"Vymazat",confirm:"Potvrdit",itemUnit:"Položky"}},tableForm:{search:"Hledat",reset:"Resetovat",submit:"Odeslat",collapsed:"Zvětšit",expand:"Zmenšit",inputPlaceholder:"Zadejte prosím",selectPlaceholder:"Vyberte prosím"},alert:{clear:"Vymazat",selected:"Vybráno",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položek"}},tableToolBar:{leftPin:"Připnout doleva",rightPin:"Připnout doprava",noPin:"Odepnuto",leftFixedTitle:"Fixováno nalevo",rightFixedTitle:"Fixováno napravo",noFixedTitle:"Nefixováno",reset:"Resetovat",columnDisplay:"Zobrazení sloupců",columnSetting:"Nastavení",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončit celou obrazovku",reload:"Obnovit",density:"Hustota",densityDefault:"Výchozí",densityLarger:"Větší",densityMiddle:"Střední",densitySmall:"Kompaktní"},stepsForm:{next:"Další",prev:"Předchozí",submit:"Dokončit"},loginForm:{submitText:"Přihlásit se"},editableTable:{onlyOneLineEditor:"Upravit lze pouze jeden řádek",action:{save:"Uložit",cancel:"Zrušit",delete:"Vymazat",add:"Přidat řádek"}},switch:{open:"Otevřít",close:"Zavřít"}},$h={moneySymbol:"€",form:{lightFilter:{more:"Mehr",clear:"Zurücksetzen",confirm:"Bestätigen",itemUnit:"Einträge"}},tableForm:{search:"Suchen",reset:"Zurücksetzen",submit:"Absenden",collapsed:"Zeige mehr",expand:"Zeige weniger",inputPlaceholder:"Bitte eingeben",selectPlaceholder:"Bitte auswählen"},alert:{clear:"Zurücksetzen",selected:"Ausgewählt",item:"Eintrag"},pagination:{total:{range:" ",total:"von",item:"Einträgen"}},tableToolBar:{leftPin:"Links anheften",rightPin:"Rechts anheften",noPin:"Nicht angeheftet",leftFixedTitle:"Links fixiert",rightFixedTitle:"Rechts fixiert",noFixedTitle:"Nicht fixiert",reset:"Zurücksetzen",columnDisplay:"Angezeigte Reihen",columnSetting:"Einstellungen",fullScreen:"Vollbild",exitFullScreen:"Vollbild verlassen",reload:"Aktualisieren",density:"Abstand",densityDefault:"Standard",densityLarger:"Größer",densityMiddle:"Mittel",densitySmall:"Kompakt"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Anmelden"},editableTable:{action:{save:"Retten",cancel:"Abbrechen",delete:"Löschen",add:"Hinzufügen einer Datenzeile"}},switch:{open:"offen",close:"schließen"}},Rh={moneySymbol:"£",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},Eh={moneySymbol:"$",deleteThisLine:"Delete this line",copyThisLine:"Copy this line",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},Ih={moneySymbol:"€",form:{lightFilter:{more:"Más",clear:"Limpiar",confirm:"Confirmar",itemUnit:"artículos"}},tableForm:{search:"Buscar",reset:"Limpiar",submit:"Submit",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Ingrese valor",selectPlaceholder:"Seleccione valor"},alert:{clear:"Limpiar",selected:"Seleccionado",item:"Articulo"},pagination:{total:{range:" ",total:"de",item:"artículos"}},tableToolBar:{leftPin:"Pin a la izquierda",rightPin:"Pin a la derecha",noPin:"Sin Pin",leftFixedTitle:"Fijado a la izquierda",rightFixedTitle:"Fijado a la derecha",noFixedTitle:"Sin Fijar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuración",fullScreen:"Pantalla Completa",exitFullScreen:"Salir Pantalla Completa",reload:"Refrescar",density:"Densidad",densityDefault:"Por Defecto",densityLarger:"Largo",densityMiddle:"Medio",densitySmall:"Compacto"},stepsForm:{next:"Siguiente",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Descartar",delete:"Borrar",add:"añadir una fila de datos"}},switch:{open:"abrir",close:"cerrar"}},Mh={moneySymbol:"تومان",form:{lightFilter:{more:"بیشتر",clear:"پاک کردن",confirm:"تایید",itemUnit:"مورد"}},tableForm:{search:"جستجو",reset:"بازنشانی",submit:"تایید",collapsed:"نمایش بیشتر",expand:"نمایش کمتر",inputPlaceholder:"پیدا کنید",selectPlaceholder:"انتخاب کنید"},alert:{clear:"پاک سازی",selected:"انتخاب",item:"مورد"},pagination:{total:{range:" ",total:"از",item:"مورد"}},tableToolBar:{leftPin:"سنجاق به چپ",rightPin:"سنجاق به راست",noPin:"سنجاق نشده",leftFixedTitle:"ثابت شده در چپ",rightFixedTitle:"ثابت شده در راست",noFixedTitle:"شناور",reset:"بازنشانی",columnDisplay:"نمایش همه",columnSetting:"تنظیمات",fullScreen:"تمام صفحه",exitFullScreen:"خروج از حالت تمام صفحه",reload:"تازه سازی",density:"تراکم",densityDefault:"پیش فرض",densityLarger:"بزرگ",densityMiddle:"متوسط",densitySmall:"کوچک"},stepsForm:{next:"بعدی",prev:"قبلی",submit:"اتمام"},loginForm:{submitText:"ورود"},editableTable:{action:{save:"ذخیره",cancel:"لغو",delete:"حذف",add:"یک ردیف داده اضافه کنید"}},switch:{open:"باز",close:"نزدیک"}},kh={moneySymbol:"€",form:{lightFilter:{more:"Plus",clear:"Effacer",confirm:"Confirmer",itemUnit:"Items"}},tableForm:{search:"Rechercher",reset:"Réinitialiser",submit:"Envoyer",collapsed:"Agrandir",expand:"Réduire",inputPlaceholder:"Entrer une valeur",selectPlaceholder:"Sélectionner une valeur"},alert:{clear:"Réinitialiser",selected:"Sélectionné",item:"Item"},pagination:{total:{range:" ",total:"sur",item:"éléments"}},tableToolBar:{leftPin:"Épingler à gauche",rightPin:"Épingler à gauche",noPin:"Sans épingle",leftFixedTitle:"Fixer à gauche",rightFixedTitle:"Fixer à droite",noFixedTitle:"Non fixé",reset:"Réinitialiser",columnDisplay:"Affichage colonne",columnSetting:"Réglages",fullScreen:"Plein écran",exitFullScreen:"Quitter Plein écran",reload:"Rafraichir",density:"Densité",densityDefault:"Par défaut",densityLarger:"Larger",densityMiddle:"Moyenne",densitySmall:"Compacte"},stepsForm:{next:"Suivante",prev:"Précédente",submit:"Finaliser"},loginForm:{submitText:"Se connecter"},editableTable:{action:{save:"Sauvegarder",cancel:"Annuler",delete:"Supprimer",add:"ajouter une ligne de données"}},switch:{open:"ouvert",close:"près"}},Ah={moneySymbol:"₪",deleteThisLine:"מחק שורה זו",copyThisLine:"העתק שורה זו",form:{lightFilter:{more:"יותר",clear:"נקה",confirm:"אישור",itemUnit:"פריטים"}},tableForm:{search:"חיפוש",reset:"איפוס",submit:"שלח",collapsed:"הרחב",expand:"כווץ",inputPlaceholder:"אנא הכנס",selectPlaceholder:"אנא בחר"},alert:{clear:"נקה",selected:"נבחר",item:"פריט"},pagination:{total:{range:" ",total:"מתוך",item:"פריטים"}},tableToolBar:{leftPin:"הצמד לשמאל",rightPin:"הצמד לימין",noPin:"לא מצורף",leftFixedTitle:"מוצמד לשמאל",rightFixedTitle:"מוצמד לימין",noFixedTitle:"לא מוצמד",reset:"איפוס",columnDisplay:"תצוגת עמודות",columnSetting:"הגדרות",fullScreen:"מסך מלא",exitFullScreen:"צא ממסך מלא",reload:"רענן",density:"רזולוציה",densityDefault:"ברירת מחדל",densityLarger:"גדול",densityMiddle:"בינוני",densitySmall:"קטן"},stepsForm:{next:"הבא",prev:"קודם",submit:"סיום"},loginForm:{submitText:"כניסה"},editableTable:{onlyOneLineEditor:"ניתן לערוך רק שורה אחת",action:{save:"שמור",cancel:"ביטול",delete:"מחיקה",add:"הוסף שורת נתונים"}},switch:{open:"פתח",close:"סגור"}},Oh={moneySymbol:"kn",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pretraži",reset:"Poništi",submit:"Potvrdi",collapsed:"Raširi",expand:"Skupi",inputPlaceholder:"Unesite",selectPlaceholder:"Odaberite"},alert:{clear:"Očisti",selected:"Odaberi",item:"stavke"},pagination:{total:{range:" ",total:"od",item:"stavke"}},tableToolBar:{leftPin:"Prikači lijevo",rightPin:"Prikači desno",noPin:"Bez prikačenja",leftFixedTitle:"Fiksiraj lijevo",rightFixedTitle:"Fiksiraj desno",noFixedTitle:"Bez fiksiranja",reset:"Resetiraj",columnDisplay:"Prikaz stupaca",columnSetting:"Postavke",fullScreen:"Puni zaslon",exitFullScreen:"Izađi iz punog zaslona",reload:"Ponovno učitaj",density:"Veličina",densityDefault:"Zadano",densityLarger:"Veliko",densityMiddle:"Srednje",densitySmall:"Malo"},stepsForm:{next:"Sljedeći",prev:"Prethodni",submit:"Kraj"},loginForm:{submitText:"Prijava"},editableTable:{action:{save:"Spremi",cancel:"Odustani",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"otvori",close:"zatvori"}},Dh={moneySymbol:"RP",form:{lightFilter:{more:"Lebih",clear:"Hapus",confirm:"Konfirmasi",itemUnit:"Unit"}},tableForm:{search:"Cari",reset:"Atur ulang",submit:"Kirim",collapsed:"Lebih sedikit",expand:"Lebih banyak",inputPlaceholder:"Masukkan pencarian",selectPlaceholder:"Pilih"},alert:{clear:"Hapus",selected:"Dipilih",item:"Butir"},pagination:{total:{range:" ",total:"Dari",item:"Butir"}},tableToolBar:{leftPin:"Pin kiri",rightPin:"Pin kanan",noPin:"Tidak ada pin",leftFixedTitle:"Rata kiri",rightFixedTitle:"Rata kanan",noFixedTitle:"Tidak tetap",reset:"Atur ulang",columnDisplay:"Tampilan kolom",columnSetting:"Pengaturan",fullScreen:"Layar penuh",exitFullScreen:"Keluar layar penuh",reload:"Atur ulang",density:"Kerapatan",densityDefault:"Standar",densityLarger:"Lebih besar",densityMiddle:"Sedang",densitySmall:"Rapat"},stepsForm:{next:"Selanjutnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Login"},editableTable:{action:{save:"simpan",cancel:"batal",delete:"hapus",add:"Tambahkan baris data"}},switch:{open:"buka",close:"tutup"}},Ph={moneySymbol:"€",form:{lightFilter:{more:"più",clear:"pulisci",confirm:"conferma",itemUnit:"elementi"}},tableForm:{search:"Filtra",reset:"Pulisci",submit:"Invia",collapsed:"Espandi",expand:"Contrai",inputPlaceholder:"Digita",selectPlaceholder:"Seleziona"},alert:{clear:"Rimuovi",selected:"Selezionati",item:"elementi"},pagination:{total:{range:" ",total:"di",item:"elementi"}},tableToolBar:{leftPin:"Fissa a sinistra",rightPin:"Fissa a destra",noPin:"Ripristina posizione",leftFixedTitle:"Fissato a sinistra",rightFixedTitle:"Fissato a destra",noFixedTitle:"Non fissato",reset:"Ripristina",columnDisplay:"Disposizione colonne",columnSetting:"Impostazioni",fullScreen:"Modalità schermo intero",exitFullScreen:"Esci da modalità schermo intero",reload:"Ricarica",density:"Grandezza tabella",densityDefault:"predefinito",densityLarger:"Grande",densityMiddle:"Media",densitySmall:"Compatta"},stepsForm:{next:"successivo",prev:"precedente",submit:"finisci"},loginForm:{submitText:"Accedi"},editableTable:{action:{save:"salva",cancel:"annulla",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"chiudi"}},Nh={moneySymbol:"¥",form:{lightFilter:{more:"更に",clear:"クリア",confirm:"確認",itemUnit:"アイテム"}},tableForm:{search:"検索",reset:"リセット",submit:"送信",collapsed:"拡大",expand:"折畳",inputPlaceholder:"入力してください",selectPlaceholder:"選択してください"},alert:{clear:"クリア",selected:"選択した",item:"アイテム"},pagination:{total:{range:"レコード",total:"/合計",item:" "}},tableToolBar:{leftPin:"左に固定",rightPin:"右に固定",noPin:"キャンセル",leftFixedTitle:"左に固定された項目",rightFixedTitle:"右に固定された項目",noFixedTitle:"固定されてない項目",reset:"リセット",columnDisplay:"表示列",columnSetting:"列表示設定",fullScreen:"フルスクリーン",exitFullScreen:"終了",reload:"更新",density:"行高",densityDefault:"デフォルト",densityLarger:"大",densityMiddle:"中",densitySmall:"小"},stepsForm:{next:"次へ",prev:"前へ",submit:"送信"},loginForm:{submitText:"ログイン"},editableTable:{action:{save:"保存",cancel:"キャンセル",delete:"削除",add:"追加"}},switch:{open:"開く",close:"閉じる"}},Lh={moneySymbol:"₩",form:{lightFilter:{more:"더보기",clear:"초기화",confirm:"확인",itemUnit:"건수"}},tableForm:{search:"조회",reset:"초기화",submit:"제출",collapsed:"확장",expand:"닫기",inputPlaceholder:"입력해 주세요",selectPlaceholder:"선택해 주세요"},alert:{clear:"취소",selected:"선택",item:"건"},pagination:{total:{range:" ",total:"/ 총",item:"건"}},tableToolBar:{leftPin:"왼쪽으로 핀",rightPin:"오른쪽으로 핀",noPin:"핀 제거",leftFixedTitle:"왼쪽으로 고정",rightFixedTitle:"오른쪽으로 고정",noFixedTitle:"비고정",reset:"초기화",columnDisplay:"컬럼 표시",columnSetting:"설정",fullScreen:"전체 화면",exitFullScreen:"전체 화면 취소",reload:"새로 고침",density:"여백",densityDefault:"기본",densityLarger:"많은 여백",densityMiddle:"중간 여백",densitySmall:"좁은 여백"},stepsForm:{next:"다음",prev:"이전",submit:"종료"},loginForm:{submitText:"로그인"},editableTable:{action:{save:"저장",cancel:"취소",delete:"삭제",add:"데이터 행 추가"}},switch:{open:"열",close:"가까 운"}},_h={moneySymbol:"₮",form:{lightFilter:{more:"Илүү",clear:"Цэвэрлэх",confirm:"Баталгаажуулах",itemUnit:"Нэгжүүд"}},tableForm:{search:"Хайх",reset:"Шинэчлэх",submit:"Илгээх",collapsed:"Өргөтгөх",expand:"Хураах",inputPlaceholder:"Утга оруулна уу",selectPlaceholder:"Утга сонгоно уу"},alert:{clear:"Цэвэрлэх",selected:"Сонгогдсон",item:"Нэгж"},pagination:{total:{range:" ",total:"Нийт",item:"мөр"}},tableToolBar:{leftPin:"Зүүн тийш бэхлэх",rightPin:"Баруун тийш бэхлэх",noPin:"Бэхлэхгүй",leftFixedTitle:"Зүүн зэрэгцүүлэх",rightFixedTitle:"Баруун зэрэгцүүлэх",noFixedTitle:"Зэрэгцүүлэхгүй",reset:"Шинэчлэх",columnDisplay:"Баганаар харуулах",columnSetting:"Тохиргоо",fullScreen:"Бүтэн дэлгэцээр",exitFullScreen:"Бүтэн дэлгэц цуцлах",reload:"Шинэчлэх",density:"Хэмжээ",densityDefault:"Хэвийн",densityLarger:"Том",densityMiddle:"Дунд",densitySmall:"Жижиг"},stepsForm:{next:"Дараах",prev:"Өмнөх",submit:"Дуусгах"},loginForm:{submitText:"Нэвтрэх"},editableTable:{action:{save:"Хадгалах",cancel:"Цуцлах",delete:"Устгах",add:"Мөр нэмэх"}},switch:{open:"Нээх",close:"Хаах"}},zh={moneySymbol:"RM",form:{lightFilter:{more:"Lebih banyak",clear:"Jelas",confirm:"Mengesahkan",itemUnit:"Item"}},tableForm:{search:"Cari",reset:"Menetapkan semula",submit:"Hantar",collapsed:"Kembang",expand:"Kuncup",inputPlaceholder:"Sila masuk",selectPlaceholder:"Sila pilih"},alert:{clear:"Padam",selected:"Dipilih",item:"Item"},pagination:{total:{range:" ",total:"daripada",item:"item"}},tableToolBar:{leftPin:"Pin ke kiri",rightPin:"Pin ke kanan",noPin:"Tidak pin",leftFixedTitle:"Tetap ke kiri",rightFixedTitle:"Tetap ke kanan",noFixedTitle:"Tidak Tetap",reset:"Menetapkan semula",columnDisplay:"Lajur",columnSetting:"Settings",fullScreen:"Full Screen",exitFullScreen:"Keluar Full Screen",reload:"Muat Semula",density:"Densiti",densityDefault:"Biasa",densityLarger:"Besar",densityMiddle:"Tengah",densitySmall:"Kecil"},stepsForm:{next:"Seterusnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Log Masuk"},editableTable:{action:{save:"Simpan",cancel:"Membatalkan",delete:"Menghapuskan",add:"tambah baris data"}},switch:{open:"Terbuka",close:"Tutup"}},Bh={moneySymbol:"€",deleteThisLine:"Verwijder deze regel",copyThisLine:"Kopieer deze regel",form:{lightFilter:{more:"Meer filters",clear:"Wissen",confirm:"Bevestigen",itemUnit:"item"}},tableForm:{search:"Zoeken",reset:"Resetten",submit:"Indienen",collapsed:"Uitvouwen",expand:"Inklappen",inputPlaceholder:"Voer in",selectPlaceholder:"Selecteer"},alert:{clear:"Selectie annuleren",selected:"Geselecteerd",item:"item"},pagination:{total:{range:"Van",total:"items/totaal",item:"items"}},tableToolBar:{leftPin:"Vastzetten aan begin",rightPin:"Vastzetten aan einde",noPin:"Niet vastzetten",leftFixedTitle:"Vastzetten aan de linkerkant",rightFixedTitle:"Vastzetten aan de rechterkant",noFixedTitle:"Niet vastzetten",reset:"Resetten",columnDisplay:"Kolomweergave",columnSetting:"Kolominstellingen",fullScreen:"Volledig scherm",exitFullScreen:"Verlaat volledig scherm",reload:"Vernieuwen",density:"Dichtheid",densityDefault:"Normaal",densityLarger:"Ruim",densityMiddle:"Gemiddeld",densitySmall:"Compact"},stepsForm:{next:"Volgende stap",prev:"Vorige stap",submit:"Indienen"},loginForm:{submitText:"Inloggen"},editableTable:{onlyOneLineEditor:"Slechts één regel tegelijk bewerken",action:{save:"Opslaan",cancel:"Annuleren",delete:"Verwijderen",add:"Een regel toevoegen"}},switch:{open:"Openen",close:"Sluiten"}},Vh={moneySymbol:"zł",form:{lightFilter:{more:"Więcej",clear:"Wyczyść",confirm:"Potwierdź",itemUnit:"Ilość"}},tableForm:{search:"Szukaj",reset:"Reset",submit:"Zatwierdź",collapsed:"Pokaż wiecej",expand:"Pokaż mniej",inputPlaceholder:"Proszę podać",selectPlaceholder:"Proszę wybrać"},alert:{clear:"Wyczyść",selected:"Wybrane",item:"Wpis"},pagination:{total:{range:" ",total:"z",item:"Wpisów"}},tableToolBar:{leftPin:"Przypnij do lewej",rightPin:"Przypnij do prawej",noPin:"Odepnij",leftFixedTitle:"Przypięte do lewej",rightFixedTitle:"Przypięte do prawej",noFixedTitle:"Nieprzypięte",reset:"Reset",columnDisplay:"Wyświetlane wiersze",columnSetting:"Ustawienia",fullScreen:"Pełen ekran",exitFullScreen:"Zamknij pełen ekran",reload:"Odśwież",density:"Odstęp",densityDefault:"Standard",densityLarger:"Wiekszy",densityMiddle:"Sredni",densitySmall:"Kompaktowy"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Zaloguj się"},editableTable:{action:{save:"Zapisać",cancel:"Anuluj",delete:"Usunąć",add:"dodawanie wiersza danych"}},switch:{open:"otwierać",close:"zamykać"}},Hh={moneySymbol:"R$",form:{lightFilter:{more:"Mais",clear:"Limpar",confirm:"Confirmar",itemUnit:"Itens"}},tableForm:{search:"Filtrar",reset:"Limpar",submit:"Confirmar",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Por favor insira",selectPlaceholder:"Por favor selecione"},alert:{clear:"Limpar",selected:"Selecionado(s)",item:"Item(s)"},pagination:{total:{range:" ",total:"de",item:"itens"}},tableToolBar:{leftPin:"Fixar à esquerda",rightPin:"Fixar à direita",noPin:"Desfixado",leftFixedTitle:"Fixado à esquerda",rightFixedTitle:"Fixado à direita",noFixedTitle:"Não fixado",reset:"Limpar",columnDisplay:"Mostrar Coluna",columnSetting:"Configurações",fullScreen:"Tela Cheia",exitFullScreen:"Sair da Tela Cheia",reload:"Atualizar",density:"Densidade",densityDefault:"Padrão",densityLarger:"Largo",densityMiddle:"Médio",densitySmall:"Compacto"},stepsForm:{next:"Próximo",prev:"Anterior",submit:"Enviar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Salvar",cancel:"Cancelar",delete:"Apagar",add:"adicionar uma linha de dados"}},switch:{open:"abrir",close:"fechar"}},Yh={moneySymbol:"RON",deleteThisLine:"Șterge acest rând",copyThisLine:"Copiază acest rând",form:{lightFilter:{more:"Mai multe filtre",clear:"Curăță",confirm:"Confirmă",itemUnit:"elemente"}},tableForm:{search:"Caută",reset:"Resetează",submit:"Trimite",collapsed:"Extinde",expand:"Restrânge",inputPlaceholder:"Introduceți",selectPlaceholder:"Selectați"},alert:{clear:"Anulează selecția",selected:"Selectat",item:"elemente"},pagination:{total:{range:"De la",total:"elemente/total",item:"elemente"}},tableToolBar:{leftPin:"Fixează la început",rightPin:"Fixează la sfârșit",noPin:"Nu fixa",leftFixedTitle:"Fixează în stânga",rightFixedTitle:"Fixează în dreapta",noFixedTitle:"Nu fixa",reset:"Resetează",columnDisplay:"Afișare coloane",columnSetting:"Setări coloane",fullScreen:"Ecran complet",exitFullScreen:"Ieși din ecran complet",reload:"Reîncarcă",density:"Densitate",densityDefault:"Normal",densityLarger:"Larg",densityMiddle:"Mediu",densitySmall:"Compact"},stepsForm:{next:"Pasul următor",prev:"Pasul anterior",submit:"Trimite"},loginForm:{submitText:"Autentificare"},editableTable:{onlyOneLineEditor:"Se poate edita doar un rând simultan",action:{save:"Salvează",cancel:"Anulează",delete:"Șterge",add:"Adaugă un rând"}},switch:{open:"Deschide",close:"Închide"}},Uh={moneySymbol:"₽",form:{lightFilter:{more:"Еще",clear:"Очистить",confirm:"ОК",itemUnit:"Позиции"}},tableForm:{search:"Найти",reset:"Сброс",submit:"Отправить",collapsed:"Развернуть",expand:"Свернуть",inputPlaceholder:"Введите значение",selectPlaceholder:"Выберите значение"},alert:{clear:"Очистить",selected:"Выбрано",item:"элементов"},pagination:{total:{range:" ",total:"из",item:"элементов"}},tableToolBar:{leftPin:"Закрепить слева",rightPin:"Закрепить справа",noPin:"Открепить",leftFixedTitle:"Закреплено слева",rightFixedTitle:"Закреплено справа",noFixedTitle:"Не закреплено",reset:"Сброс",columnDisplay:"Отображение столбца",columnSetting:"Настройки",fullScreen:"Полный экран",exitFullScreen:"Выйти из полноэкранного режима",reload:"Обновить",density:"Размер",densityDefault:"По умолчанию",densityLarger:"Большой",densityMiddle:"Средний",densitySmall:"Сжатый"},stepsForm:{next:"Следующий",prev:"Предыдущий",submit:"Завершить"},loginForm:{submitText:"Вход"},editableTable:{action:{save:"Сохранить",cancel:"Отменить",delete:"Удалить",add:"добавить ряд данных"}},switch:{open:"Открытый чемпионат мира по теннису",close:"По адресу:"}},Kh={moneySymbol:"€",deleteThisLine:"Odstrániť tento riadok",copyThisLine:"Skopírujte tento riadok",form:{lightFilter:{more:"Viac",clear:"Vyčistiť",confirm:"Potvrďte",itemUnit:"Položky"}},tableForm:{search:"Vyhladať",reset:"Resetovať",submit:"Odoslať",collapsed:"Rozbaliť",expand:"Zbaliť",inputPlaceholder:"Prosím, zadajte",selectPlaceholder:"Prosím, vyberte"},alert:{clear:"Vyčistiť",selected:"Vybraný",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položiek"}},tableToolBar:{leftPin:"Pripnúť vľavo",rightPin:"Pripnúť vpravo",noPin:"Odopnuté",leftFixedTitle:"Fixované na ľavo",rightFixedTitle:"Fixované na pravo",noFixedTitle:"Nefixované",reset:"Resetovať",columnDisplay:"Zobrazenie stĺpcov",columnSetting:"Nastavenia",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončiť celú obrazovku",reload:"Obnoviť",density:"Hustota",densityDefault:"Predvolené",densityLarger:"Väčšie",densityMiddle:"Stredné",densitySmall:"Kompaktné"},stepsForm:{next:"Ďalšie",prev:"Predchádzajúce",submit:"Potvrdiť"},loginForm:{submitText:"Prihlásiť sa"},editableTable:{onlyOneLineEditor:"Upravovať možno iba jeden riadok",action:{save:"Uložiť",cancel:"Zrušiť",delete:"Odstrániť",add:"pridať riadok údajov"}},switch:{open:"otvoriť",close:"zavrieť"}},Wh={moneySymbol:"RSD",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pronađi",reset:"Resetuj",submit:"Pošalji",collapsed:"Proširi",expand:"Skupi",inputPlaceholder:"Molimo unesite",selectPlaceholder:"Molimo odaberite"},alert:{clear:"Očisti",selected:"Odabrano",item:"Stavka"},pagination:{total:{range:" ",total:"od",item:"stavki"}},tableToolBar:{leftPin:"Zakači levo",rightPin:"Zakači desno",noPin:"Nije zakačeno",leftFixedTitle:"Fiksirano levo",rightFixedTitle:"Fiksirano desno",noFixedTitle:"Nije fiksirano",reset:"Resetuj",columnDisplay:"Prikaz kolona",columnSetting:"Podešavanja",fullScreen:"Pun ekran",exitFullScreen:"Zatvori pun ekran",reload:"Osveži",density:"Veličina",densityDefault:"Podrazumevana",densityLarger:"Veća",densityMiddle:"Srednja",densitySmall:"Kompaktna"},stepsForm:{next:"Dalje",prev:"Nazad",submit:"Gotovo"},loginForm:{submitText:"Prijavi se"},editableTable:{action:{save:"Sačuvaj",cancel:"Poništi",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"Отворите",close:"Затворите"}},qh={moneySymbol:"SEK",deleteThisLine:"Radera denna rad",copyThisLine:"Kopiera denna rad",form:{lightFilter:{more:"Fler filter",clear:"Rensa",confirm:"Bekräfta",itemUnit:"objekt"}},tableForm:{search:"Sök",reset:"Återställ",submit:"Skicka",collapsed:"Expandera",expand:"Fäll ihop",inputPlaceholder:"Vänligen ange",selectPlaceholder:"Vänligen välj"},alert:{clear:"Avbryt val",selected:"Vald",item:"objekt"},pagination:{total:{range:"Från",total:"objekt/totalt",item:"objekt"}},tableToolBar:{leftPin:"Fäst till vänster",rightPin:"Fäst till höger",noPin:"Inte fäst",leftFixedTitle:"Fäst till vänster",rightFixedTitle:"Fäst till höger",noFixedTitle:"Inte fäst",reset:"Återställ",columnDisplay:"Kolumnvisning",columnSetting:"Kolumninställningar",fullScreen:"Fullskärm",exitFullScreen:"Avsluta fullskärm",reload:"Ladda om",density:"Täthet",densityDefault:"Normal",densityLarger:"Lös",densityMiddle:"Medium",densitySmall:"Kompakt"},stepsForm:{next:"Nästa steg",prev:"Föregående steg",submit:"Skicka"},loginForm:{submitText:"Logga in"},editableTable:{onlyOneLineEditor:"Endast en rad kan redigeras åt gången",action:{save:"Spara",cancel:"Avbryt",delete:"Radera",add:"Lägg till en rad"}},switch:{open:"Öppna",close:"Stäng"}},Gh={moneySymbol:"฿",deleteThisLine:"ลบบรรทัดนี้",copyThisLine:"คัดลอกบรรทัดนี้",form:{lightFilter:{more:"มากกว่า",clear:"ชัดเจน",confirm:"ยืนยัน",itemUnit:"รายการ"}},tableForm:{search:"สอบถาม",reset:"รีเซ็ต",submit:"ส่ง",collapsed:"ขยาย",expand:"ทรุด",inputPlaceholder:"กรุณาป้อน",selectPlaceholder:"โปรดเลือก"},alert:{clear:"ชัดเจน",selected:"เลือกแล้ว",item:"รายการ"},pagination:{total:{range:" ",total:"ของ",item:"รายการ"}},tableToolBar:{leftPin:"ปักหมุดไปทางซ้าย",rightPin:"ปักหมุดไปทางขวา",noPin:"เลิกตรึงแล้ว",leftFixedTitle:"แก้ไขด้านซ้าย",rightFixedTitle:"แก้ไขด้านขวา",noFixedTitle:"ไม่คงที่",reset:"รีเซ็ต",columnDisplay:"การแสดงคอลัมน์",columnSetting:"การตั้งค่า",fullScreen:"เต็มจอ",exitFullScreen:"ออกจากโหมดเต็มหน้าจอ",reload:"รีเฟรช",density:"ความหนาแน่น",densityDefault:"ค่าเริ่มต้น",densityLarger:"ขนาดใหญ่ขึ้น",densityMiddle:"กลาง",densitySmall:"กะทัดรัด"},stepsForm:{next:"ถัดไป",prev:"ก่อนหน้า",submit:"เสร็จ"},loginForm:{submitText:"เข้าสู่ระบบ"},editableTable:{onlyOneLineEditor:"แก้ไขได้เพียงบรรทัดเดียวเท่านั้น",action:{save:"บันทึก",cancel:"ยกเลิก",delete:"ลบ",add:"เพิ่มแถวของข้อมูล"}},switch:{open:"เปิด",close:"ปิด"}},Zh={moneySymbol:"₺",form:{lightFilter:{more:"Daha Fazla",clear:"Temizle",confirm:"Onayla",itemUnit:"Öğeler"}},tableForm:{search:"Filtrele",reset:"Sıfırla",submit:"Gönder",collapsed:"Daha fazla",expand:"Daha az",inputPlaceholder:"Filtrelemek için bir değer girin",selectPlaceholder:"Filtrelemek için bir değer seçin"},alert:{clear:"Temizle",selected:"Seçili",item:"Öğe"},pagination:{total:{range:" ",total:"Toplam",item:"Öğe"}},tableToolBar:{leftPin:"Sola sabitle",rightPin:"Sağa sabitle",noPin:"Sabitlemeyi kaldır",leftFixedTitle:"Sola sabitlendi",rightFixedTitle:"Sağa sabitlendi",noFixedTitle:"Sabitlenmedi",reset:"Sıfırla",columnDisplay:"Kolon Görünümü",columnSetting:"Ayarlar",fullScreen:"Tam Ekran",exitFullScreen:"Tam Ekrandan Çık",reload:"Yenile",density:"Kalınlık",densityDefault:"Varsayılan",densityLarger:"Büyük",densityMiddle:"Orta",densitySmall:"Küçük"},stepsForm:{next:"Sıradaki",prev:"Önceki",submit:"Gönder"},loginForm:{submitText:"Giriş Yap"},editableTable:{action:{save:"Kaydet",cancel:"Vazgeç",delete:"Sil",add:"foegje in rige gegevens ta"}},switch:{open:"açık",close:"kapatmak"}},Jh={moneySymbol:"₴",deleteThisLine:"Видатили рядок",copyThisLine:"Скопіювати рядок",form:{lightFilter:{more:"Ще",clear:"Очистити",confirm:"Ок",itemUnit:"Позиції"}},tableForm:{search:"Пошук",reset:"Очистити",submit:"Відправити",collapsed:"Розгорнути",expand:"Згорнути",inputPlaceholder:"Введіть значення",selectPlaceholder:"Оберіть значення"},alert:{clear:"Очистити",selected:"Обрано",item:"елементів"},pagination:{total:{range:" ",total:"з",item:"елементів"}},tableToolBar:{leftPin:"Закріпити зліва",rightPin:"Закріпити справа",noPin:"Відкріпити",leftFixedTitle:"Закріплено зліва",rightFixedTitle:"Закріплено справа",noFixedTitle:"Не закріплено",reset:"Скинути",columnDisplay:"Відображення стовпців",columnSetting:"Налаштування",fullScreen:"Повноекранний режим",exitFullScreen:"Вийти з повноекранного режиму",reload:"Оновити",density:"Розмір",densityDefault:"За замовчуванням",densityLarger:"Великий",densityMiddle:"Середній",densitySmall:"Стислий"},stepsForm:{next:"Наступний",prev:"Попередній",submit:"Завершити"},loginForm:{submitText:"Вхіх"},editableTable:{onlyOneLineEditor:"Тільки один рядок може бути редагований одночасно",action:{save:"Зберегти",cancel:"Відмінити",delete:"Видалити",add:"додати рядок"}},switch:{open:"Відкрито",close:"Закрито"}},Xh={moneySymbol:"UZS",form:{lightFilter:{more:"Yana",clear:"Tozalash",confirm:"OK",itemUnit:"Pozitsiyalar"}},tableForm:{search:"Qidirish",reset:"Qayta tiklash",submit:"Yuborish",collapsed:"Yig‘ish",expand:"Kengaytirish",inputPlaceholder:"Qiymatni kiriting",selectPlaceholder:"Qiymatni tanlang"},alert:{clear:"Tozalash",selected:"Tanlangan",item:"elementlar"},pagination:{total:{range:" ",total:"dan",item:"elementlar"}},tableToolBar:{leftPin:"Chapga mahkamlash",rightPin:"O‘ngga mahkamlash",noPin:"Mahkamlashni olib tashlash",leftFixedTitle:"Chapga mahkamlangan",rightFixedTitle:"O‘ngga mahkamlangan",noFixedTitle:"Mahkamlashsiz",reset:"Qayta tiklash",columnDisplay:"Ustunni ko‘rsatish",columnSetting:"Sozlamalar",fullScreen:"To‘liq ekran",exitFullScreen:"To‘liq ekrandan chiqish",reload:"Yangilash",density:"O‘lcham",densityDefault:"Standart",densityLarger:"Katta",densityMiddle:"O‘rtacha",densitySmall:"Kichik"},stepsForm:{next:"Keyingi",prev:"Oldingi",submit:"Tugatish"},loginForm:{submitText:"Kirish"},editableTable:{action:{save:"Saqlash",cancel:"Bekor qilish",delete:"O‘chirish",add:"maʼlumotlar qatorini qo‘shish"}},switch:{open:"Ochish",close:"Yopish"}},Qh={moneySymbol:"₫",form:{lightFilter:{more:"Nhiều hơn",clear:"Trong",confirm:"Xác nhận",itemUnit:"Mục"}},tableForm:{search:"Tìm kiếm",reset:"Làm lại",submit:"Gửi đi",collapsed:"Mở rộng",expand:"Thu gọn",inputPlaceholder:"nhập dữ liệu",selectPlaceholder:"Vui lòng chọn"},alert:{clear:"Xóa",selected:"đã chọn",item:"mục"},pagination:{total:{range:" ",total:"trên",item:"mặt hàng"}},tableToolBar:{leftPin:"Ghim trái",rightPin:"Ghim phải",noPin:"Bỏ ghim",leftFixedTitle:"Cố định trái",rightFixedTitle:"Cố định phải",noFixedTitle:"Chưa cố định",reset:"Làm lại",columnDisplay:"Cột hiển thị",columnSetting:"Cấu hình",fullScreen:"Chế độ toàn màn hình",exitFullScreen:"Thoát chế độ toàn màn hình",reload:"Làm mới",density:"Mật độ hiển thị",densityDefault:"Mặc định",densityLarger:"Mặc định",densityMiddle:"Trung bình",densitySmall:"Chật"},stepsForm:{next:"Sau",prev:"Trước",submit:"Kết thúc"},loginForm:{submitText:"Đăng nhập"},editableTable:{action:{save:"Cứu",cancel:"Hủy",delete:"Xóa",add:"thêm một hàng dữ liệu"}},switch:{open:"mở",close:"đóng"}},eg={moneySymbol:"¥",deleteThisLine:"删除此项",copyThisLine:"复制此项",form:{lightFilter:{more:"更多筛选",clear:"清除",confirm:"确认",itemUnit:"项"}},tableForm:{search:"查询",reset:"重置",submit:"提交",collapsed:"展开",expand:"收起",inputPlaceholder:"请输入",selectPlaceholder:"请选择"},alert:{clear:"取消选择",selected:"已选择",item:"项"},pagination:{total:{range:"第",total:"条/总共",item:"条"}},tableToolBar:{leftPin:"固定在列首",rightPin:"固定在列尾",noPin:"不固定",leftFixedTitle:"固定在左侧",rightFixedTitle:"固定在右侧",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列设置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"宽松",densityMiddle:"中等",densitySmall:"紧凑"},stepsForm:{next:"下一步",prev:"上一步",submit:"提交"},loginForm:{submitText:"登录"},editableTable:{onlyOneLineEditor:"只能同时编辑一行",action:{save:"保存",cancel:"取消",delete:"删除",add:"添加一行数据"}},switch:{open:"打开",close:"关闭"}},tg={moneySymbol:"HK$",deleteThisLine:"刪除此項",copyThisLine:"複製此項",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"搜尋",reset:"重設",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選取",selected:"已選取",item:"項"},pagination:{total:{range:"第",total:"項/總共",item:"項"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重設",columnDisplay:"列顯示",columnSetting:"列設定",fullScreen:"全螢幕",exitFullScreen:"退出全螢幕",reload:"重新整理",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},ng={moneySymbol:"NT$",deleteThisLine:"刪除此项",copyThisLine:"複製此项",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"查詢",reset:"重置",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選擇",selected:"已選擇",item:"項"},pagination:{total:{range:"第",total:"條/總共",item:"條"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列設置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},De=(e,t)=>({getMessage:(n,r)=>{const a=Oe(t,n.replace(/\[(\d+)\]/g,".$1").split("."))||"";if(a)return a;if(e.replace("_","-")==="zh-CN")return r;const o=In["zh-CN"];return o?o.getMessage(n,r):r},locale:e}),rg=De("mn_MN",_h),sg=De("ar_EG",vh),Ar=De("zh_CN",eg),ag=De("en_US",Eh),ig=De("en_GB",Rh),og=De("vi_VN",Qh),lg=De("it_IT",Ph),cg=De("ja_JP",Nh),ug=De("es_ES",Ih),dg=De("ca_ES",Th),fg=De("ru_RU",Uh),mg=De("sr_RS",Wh),hg=De("ms_MY",zh),gg=De("zh_TW",ng),pg=De("zh_HK",tg),yg=De("fr_FR",kh),xg=De("pt_BR",Hh),bg=De("ko_KR",Lh),Sg=De("id_ID",Dh),Cg=De("de_DE",$h),wg=De("fa_IR",Mh),jg=De("tr_TR",Zh),vg=De("pl_PL",Vh),Tg=De("hr_",Oh),Fg=De("th_TH",Gh),$g=De("cs_cz",Fh),Rg=De("sk_SK",Kh),Eg=De("he_IL",Ah),Ig=De("uk_UA",Jh),Mg=De("uz_UZ",Xh),kg=De("nl_NL",Bh),Ag=De("ro_RO",Yh),Og=De("sv_SE",qh),In={"mn-MN":rg,"ar-EG":sg,"zh-CN":Ar,"en-US":ag,"en-GB":ig,"vi-VN":og,"it-IT":lg,"ja-JP":cg,"es-ES":ug,"ca-ES":dg,"ru-RU":fg,"sr-RS":mg,"ms-MY":hg,"zh-TW":gg,"zh-HK":pg,"fr-FR":yg,"pt-BR":xg,"ko-KR":bg,"id-ID":Sg,"de-DE":Cg,"fa-IR":wg,"tr-TR":jg,"pl-PL":vg,"hr-HR":Tg,"th-TH":Fg,"cs-CZ":$g,"sk-SK":Rg,"he-IL":Eg,"uk-UA":Ig,"uz-UZ":Mg,"nl-NL":kg,"ro-RO":Ag,"sv-SE":Og},Dg=Object.keys(In),ku=e=>{const t=(e||"zh-CN").toLocaleLowerCase();return Dg.find(n=>n.toLocaleLowerCase().includes(t))};function ct(e,t){Pg(e)&&(e="100%");const n=Ng(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)}function es(e){return Math.min(1,Math.max(0,e))}function Pg(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Ng(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Au(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ts(e){return Number(e)<=1?`${Number(e)*100}%`:e}function Tn(e){return e.length===1?"0"+e:String(e)}function Lg(e,t,n){return{r:ct(e,255)*255,g:ct(t,255)*255,b:ct(n,255)*255}}function rl(e,t,n){e=ct(e,255),t=ct(t,255),n=ct(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0,o=0;const l=(r+a)/2;if(r===a)o=0,i=0;else{const c=r-a;switch(o=l>.5?c/(2-r-a):c/(r+a),r){case e:i=(t-n)/c+(t<n?6:0);break;case t:i=(n-e)/c+2;break;case n:i=(e-t)/c+4;break}i/=6}return{h:i,s:o,l}}function Fa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _g(e,t,n){let r,a,i;if(e=ct(e,360),t=ct(t,100),n=ct(n,100),t===0)a=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=Fa(l,o,e+1/3),a=Fa(l,o,e),i=Fa(l,o,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function sl(e,t,n){e=ct(e,255),t=ct(t,255),n=ct(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0;const o=r,l=r-a,c=r===0?0:l/r;if(r===a)i=0;else{switch(r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:c,v:o}}function zg(e,t,n){e=ct(e,360)*6,t=ct(t,100),n=ct(n,100);const r=Math.floor(e),a=e-r,i=n*(1-t),o=n*(1-a*t),l=n*(1-(1-a)*t),c=r%6,h=[n,o,i,i,l,n][c],g=[l,n,n,o,i,i][c],f=[i,i,l,n,n,o][c];return{r:h*255,g:g*255,b:f*255}}function al(e,t,n,r){const a=Tn(Math.round(e).toString(16)),i=Tn(Math.round(t).toString(16)),o=Tn(Math.round(n).toString(16));return r&&a.startsWith(a.charAt(1))&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))?a.charAt(0)+i.charAt(0)+o.charAt(0):a+i+o}function Bg(e,t,n,r,a){const i=Tn(Math.round(e).toString(16)),o=Tn(Math.round(t).toString(16)),l=Tn(Math.round(n).toString(16)),c=Tn(Hg(r));return a&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))&&l.startsWith(l.charAt(1))&&c.startsWith(c.charAt(1))?i.charAt(0)+o.charAt(0)+l.charAt(0)+c.charAt(0):i+o+l+c}function Vg(e,t,n,r){const a=e/100,i=t/100,o=n/100,l=r/100,c=255*(1-a)*(1-l),h=255*(1-i)*(1-l),g=255*(1-o)*(1-l);return{r:c,g:h,b:g}}function il(e,t,n){let r=1-e/255,a=1-t/255,i=1-n/255,o=Math.min(r,a,i);return o===1?(r=0,a=0,i=0):(r=(r-o)/(1-o)*100,a=(a-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(a),y:Math.round(i),k:Math.round(o)}}function Hg(e){return Math.round(parseFloat(e)*255).toString(16)}function ol(e){return bt(e)/255}function bt(e){return parseInt(e,16)}function Yg(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const ci={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ug(e){let t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,l=!1;return typeof e=="string"&&(e=qg(e)),typeof e=="object"&&(xt(e.r)&&xt(e.g)&&xt(e.b)?(t=Lg(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):xt(e.h)&&xt(e.s)&&xt(e.v)?(r=ts(e.s),a=ts(e.v),t=zg(e.h,r,a),o=!0,l="hsv"):xt(e.h)&&xt(e.s)&&xt(e.l)?(r=ts(e.s),i=ts(e.l),t=_g(e.h,r,i),o=!0,l="hsl"):xt(e.c)&&xt(e.m)&&xt(e.y)&&xt(e.k)&&(t=Vg(e.c,e.m,e.y,e.k),o=!0,l="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Au(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const Kg="[-\\+]?\\d+%?",Wg="[-\\+]?\\d*\\.\\d+%?",fn="(?:"+Wg+")|(?:"+Kg+")",$a="[\\s|\\(]+("+fn+")[,|\\s]+("+fn+")[,|\\s]+("+fn+")\\s*\\)?",ns="[\\s|\\(]+("+fn+")[,|\\s]+("+fn+")[,|\\s]+("+fn+")[,|\\s]+("+fn+")\\s*\\)?",St={hex:/^[0-9a-fA-F]+$/,CSS_UNIT:new RegExp(fn),rgb:new RegExp("rgb"+$a),rgba:new RegExp("rgba"+ns),hsl:new RegExp("hsl"+$a),hsla:new RegExp("hsla"+ns),hsv:new RegExp("hsv"+$a),hsva:new RegExp("hsva"+ns),cmyk:new RegExp("cmyk"+ns),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function qg(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(ci[e])e=ci[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n;if(typeof e=="string"&&e.length<=9&&(e.startsWith("#")||St.hex.test(e))){if(n=St.hex8.exec(e),n)return{r:bt(n[1]),g:bt(n[2]),b:bt(n[3]),a:ol(n[4]),format:t?"name":"hex8"};if(n=St.hex6.exec(e),n)return{r:bt(n[1]),g:bt(n[2]),b:bt(n[3]),format:t?"name":"hex"};if(n=St.hex4.exec(e),n)return{r:bt(n[1]+n[1]),g:bt(n[2]+n[2]),b:bt(n[3]+n[3]),a:ol(n[4]+n[4]),format:t?"name":"hex8"};if(n=St.hex3.exec(e),n)return{r:bt(n[1]+n[1]),g:bt(n[2]+n[2]),b:bt(n[3]+n[3]),format:t?"name":"hex"}}return n=St.rgb.exec(e),n?{r:n[1],g:n[2],b:n[3]}:(n=St.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=St.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=St.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=St.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=St.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=St.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function xt(e){return typeof e=="number"?!Number.isNaN(e):St.CSS_UNIT.test(e)}class st{constructor(t="",n={}){if(t instanceof st)return t;typeof t=="number"&&(t=Yg(t)),this.originalInput=t;const r=Ug(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,r,a;const i=t.r/255,o=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a}getAlpha(){return this.a}setAlpha(t){return this.a=Au(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=sl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=sl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${a}%)`:`hsva(${n}, ${r}%, ${a}%, ${this.roundA})`}toHsl(){const t=rl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=rl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${a}%)`:`hsla(${n}, ${r}%, ${a}%, ${this.roundA})`}toHex(t=!1){return al(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return Bg(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(ct(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(ct(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...il(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=il(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+al(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(ci))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const a=this.a<1&&this.a>=0;return!n&&a&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),t==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new st(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=es(n.l),new st(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new st(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=es(n.l),new st(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=es(n.s),new st(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=es(n.s),new st(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new st(n)}mix(t,n=50){const r=this.toRgb(),a=new st(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new st(o)}analogous(t=6,n=30){const r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(new st(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new st(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s:a}=n;let{v:i}=n;const o=[],l=1/t;for(;t--;)o.push(new st({h:r,s:a,v:i})),i=(i+l)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new st({h:(n+72)%360,s:t.s,l:t.l}),new st({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new st(t).toRgb(),a=n.a+r.a*(1-n.a);return new st({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,a=[this],i=360/t;for(let o=1;o<t;o++)a.push(new st({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new st(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}const Ct=(e,t)=>new st(e).setAlpha(t).toRgbString(),hn=u.theme,Ra=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none","*, *::before, *::after":{boxSizing:"border-box"}}),Gg=e=>{let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},Zg=e=>{try{return Gg(JSON.stringify(e))}catch{return""}};function We(e,t){let{token:n={},hashed:r}=d.useContext(Yt);const{token:a,hashId:i,theme:o}=u.theme.useToken(),{getPrefixCls:l,csp:c}=d.useContext(u.ConfigProvider.ConfigContext);n.layout||(n={...a}),n.proComponentsCls=n.proComponentsCls??`.${l("pro")}`,n.antCls=`.${l()}`;const h=d.useMemo(()=>Zg(n),[n]),g=[i,o.id,n.themeId,h].filter(Boolean).join("-"),f=d.useRef(""),m=d.useRef(0);f.current!==g&&(m.current+=1,f.current=g);const p=[e,g,m.current].filter(Boolean);return _m({path:p,nonce:c==null?void 0:c.nonce,layer:{name:"antd-pro"}},()=>t(n)),{wrapSSR:S=>S,hashId:r?i:""}}const Jg=(e,t)=>{var a,i,o,l,c;const n={...e},r=Ct(t.colorBgElevated,.6);return{bgLayout:`linear-gradient(${t.colorBgContainer}, ${t.colorBgLayout} 28%)`,colorTextAppListIcon:t.colorTextSecondary,appListIconHoverBgColor:(a=n==null?void 0:n.sider)==null?void 0:a.colorBgMenuItemSelected,colorBgAppListIconHover:Ct(t.colorTextBase,.04),colorTextAppListIconHover:t.colorTextBase,...n,header:{colorBgHeader:r,colorBgScrollHeader:Ct(t.colorBgElevated,.8),colorHeaderTitle:t.colorText,colorBgMenuItemHover:Ct(t.colorTextBase,.03),colorBgMenuItemSelected:"transparent",colorBgMenuElevated:(((i=n==null?void 0:n.header)==null?void 0:i.colorBgHeader)??r)!==r?(o=n.header)==null?void 0:o.colorBgHeader:t.colorBgElevated,colorTextMenuSelected:Ct(t.colorTextBase,.95),colorBgRightActionsItemHover:Ct(t.colorTextBase,.03),colorTextRightActionsItem:t.colorTextTertiary,heightLayoutHeader:56,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextMenuActive:t.colorText,...n.header},sider:{paddingInlineLayoutMenu:8,paddingBlockLayoutMenu:0,colorBgCollapsedButton:t.colorBgElevated,colorTextCollapsedButtonHover:t.colorTextSecondary,colorTextCollapsedButton:Ct(t.colorTextBase,.25),colorMenuBackground:"transparent",colorMenuItemDivider:Ct(t.colorTextBase,.06),colorBgMenuItemHover:Ct(t.colorTextBase,.03),colorBgMenuItemSelected:Ct(t.colorTextBase,.04),colorTextMenuItemHover:t.colorText,colorTextMenuSelected:Ct(t.colorTextBase,.95),colorTextMenuActive:t.colorText,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextSubMenuSelected:Ct(t.colorTextBase,.95),...n.sider},pageContainer:{colorBgPageContainer:"transparent",paddingInlinePageContainerContent:((l=n.pageContainer)==null?void 0:l.paddingInlinePageContainerContent)||40,paddingBlockPageContainerContent:((c=n.pageContainer)==null?void 0:c.paddingBlockPageContainerContent)||32,colorBgPageContainerFixed:t.colorBgElevated,...n.pageContainer}}},Xg=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t},Qg=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Ea=()=>{var e,t;return!(typeof process<"u"&&(((e=process.env.NODE_ENV)==null?void 0:e.toUpperCase())==="TEST"||((t=process.env.NODE_ENV)==null?void 0:t.toUpperCase())==="DEV"))},Vt=d.createContext({intl:{...Ar,locale:"default"},valueTypeMap:{},hashed:!0,dark:!1,token:{...u.theme.getDesignToken(),proComponentsCls:".ant-pro",antCls:".ant",themeId:0},prefixCls:".ant-pro"}),{Consumer:jF}=Vt,ep=()=>{const{cache:e}=Iu();return d.useEffect(()=>()=>{e.clear()},[]),null},tp=e=>{var M,k;const{children:t,dark:n,valueTypeMap:r,autoClearCache:a=!1,token:i,prefixCls:o,intl:l}=e,{locale:c,getPrefixCls:h,...g}=d.useContext(u.ConfigProvider.ConfigContext),f=(k=(M=u.theme).useToken)==null?void 0:k.call(M),m=d.useContext(Vt),p=o?`.${o}`:`.${h()}-pro`,S="."+h(),y=`${p}`,w=d.useMemo(()=>Jg(i||{},f.token),[i,f.token]),v=d.useMemo(()=>{var I;const V=c==null?void 0:c.locale,z=ku(V),A=l??(V&&((I=m.intl)==null?void 0:I.locale)==="default"?In[z]:m.intl||In[z]);return{...m,dark:n??m.dark,token:Xg(m.token,f.token,{proComponentsCls:p,antCls:S,themeId:f.theme.id,layout:w}),intl:A||Ar}},[c==null?void 0:c.locale,m,n,f.token,f.theme.id,p,S,w,l]),x={...v.token||{},proComponentsCls:p},[C,j]=fm(f.theme,[f.token,x??{}],{salt:y,override:x,cssVar:{key:"pro"}}),b=d.useMemo(()=>!(e.hashed===!1||m.hashed===!1),[m.hashed,e.hashed]),T=d.useMemo(()=>e.hashed===!1||m.hashed===!1||Ea()===!1?"":f.hashId?f.hashId:j,[j,m.hashed,e.hashed]);d.useEffect(()=>{Te.locale((c==null?void 0:c.locale)||"zh-cn")},[c==null?void 0:c.locale]);const $=d.useMemo(()=>({...g.theme,hashId:T,hashed:b&&Ea()}),[g.theme,T,b,Ea()]),F=d.useMemo(()=>({...v,valueTypeMap:r||(v==null?void 0:v.valueTypeMap),token:x,theme:f.theme,hashed:b,hashId:T,prefixCls:o}),[v,r,C,f.theme,b,T,o]),E=d.useMemo(()=>s.jsx(u.ConfigProvider,{...g,theme:$,children:s.jsx(Vt.Provider,{value:F,children:s.jsxs(s.Fragment,{children:[a&&s.jsx(ep,{}),t]})})}),[g,$,F,a,t]);return a?s.jsx(jh,{value:{provider:()=>new Map},children:E}):E},Mn=e=>{const{needDeps:t,dark:n,token:r}=e,a=d.useContext(Vt),{locale:i,theme:o,...l}=d.useContext(u.ConfigProvider.ConfigContext);if(t&&a.hashId!==void 0&&Object.keys(e).sort().join("-")==="children-needDeps")return s.jsx(s.Fragment,{children:e.children});const g={...l,locale:i||Hm,theme:Qg({...o,algorithm:n??a.dark?[o==null?void 0:o.algorithm,u.theme.darkAlgorithm].flat(1).filter(Boolean):o==null?void 0:o.algorithm})};return s.jsx(u.ConfigProvider,{...g,children:s.jsx(tp,{...e,token:r})})};function Ie(){const{locale:e}=d.useContext(u.ConfigProvider.ConfigContext),{intl:t}=d.useContext(Vt);return t&&t.locale!=="default"?t:e!=null&&e.locale&&In[ku(e.locale)]||Ar}Vt.displayName="ProProvider";const Yt=Vt,np=e=>{const{componentCls:t,antCls:n}=e;return{[`${t}-actions`]:{boxSizing:"border-box",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,listStyle:"none",display:"flex",gap:e.marginXS,background:e.colorBgContainer,borderBlockStart:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,minHeight:42,"& > *":{alignItems:"center",justifyContent:"center",flex:1,display:"flex",cursor:"pointer",color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},"& > li > div":{flex:1,width:"100%",marginBlock:e.marginSM,marginInline:0,color:e.colorTextSecondary,textAlign:"center",a:{color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},div:{position:"relative",display:"block",minWidth:32,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimaryHover,transition:"color 0.3s"},[`a:not(${n}-btn),
36
- > .anticon`]:{display:"inline-block",width:"100%",color:e.colorTextSecondary,lineHeight:"22px",transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},".anticon":{fontSize:e.cardActionIconSize,lineHeight:"22px"}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`}}}}};function rp(e){return We("ProCardActions",t=>{const n={...t,componentCls:`.${e}`,cardActionIconSize:16};return[np(n)]})}const sp=e=>{const{actions:t,prefixCls:n}=e,{wrapSSR:r,hashId:a}=rp(n);return Array.isArray(t)&&(t!=null&&t.length)?r(s.jsx("ul",{className:ce(`${n}-actions`,a),children:t.map((i,o)=>s.jsx("li",{style:{width:`${100/t.length}%`,padding:0,margin:0},className:ce(`${n}-actions-item`,a),children:i},`action-${o}`))})):r(s.jsx("ul",{className:ce(`${n}-actions`,a),children:t}))};function Wi(e,t){if(!t||!d.isValidElement(e))return e;if(e.type===d.Fragment){const r=d.Children.toArray(e.props.children).map((a,i)=>i===0?Wi(a,t):a);return d.cloneElement(e,{},...r)}return d.cloneElement(e,{...e.props,autoFocus:t})}const ap=e=>({[e.componentCls]:{boxSizing:"border-box",display:"flex",justifyContent:"space-between",paddingBlock:8,paddingInlineStart:8,paddingInlineEnd:8,borderBlockStart:`1px solid ${e.colorSplit}`}});function ip(e){return We("DropdownFooter",t=>{const n={...t,componentCls:`.${e}`};return[ap(n)]})}const op=e=>{const t=Ie(),{onClear:n,onConfirm:r,disabled:a,footerRender:i}=e,{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-core-dropdown-footer"),{wrapSSR:c,hashId:h}=ip(l),g=[s.jsx(u.Button,{style:{visibility:n?"visible":"hidden"},type:"link",size:"small",disabled:a,onClick:m=>{n&&n(m),m.stopPropagation()},children:t.getMessage("form.lightFilter.clear","清除")},"clear"),s.jsx(u.Button,{"data-type":"confirm",type:"primary",size:"small",onClick:r,disabled:a,children:t.getMessage("form.lightFilter.confirm","确认")},"confirm")];if(i===!1||(i==null?void 0:i(r,n))===!1)return null;const f=(i==null?void 0:i(r,n))||g;return c(s.jsx("div",{className:ce(l,h),onClick:m=>m.target.getAttribute("data-type")!=="confirm"&&m.stopPropagation(),children:f}))};class lp extends d.Component{constructor(){super(...arguments);ue(this,"state",{hasError:!1,errorInfo:""})}static getDerivedStateFromError(n){return console.warn("ErrorBoundary caught an error",n),{hasError:!0,errorInfo:n.message}}componentDidCatch(n,r){console.warn("ErrorBoundary caught an error",n,r)}render(){return this.state.hasError?s.jsx(u.Result,{status:"error",title:"Something went wrong.",extra:this.state.errorInfo}):this.props.children}}const cp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",gap:e.marginXXS,alignItems:"center",height:"30px",paddingBlock:0,paddingInline:8,fontSize:e.fontSize,lineHeight:"30px",borderRadius:e.borderRadius,cornerShape:"squircle",cursor:"pointer","&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{paddingBlock:0,paddingInline:8,[`&${e.componentCls}-allow-clear:hover:not(${e.componentCls}-disabled)`]:{[`${e.componentCls}-arrow`]:{display:"none"},[`${e.componentCls}-close`]:{display:"inline-flex"}}},[`${e.antCls}-select`]:{[`${e.antCls}-select-clear`]:{borderRadius:"50%"}},[`${e.antCls}-picker`]:{[`${e.antCls}-picker-clear`]:{borderRadius:"50%"}},"&-icon":{color:e.colorIcon,transition:"color 0.3s",fontSize:12,verticalAlign:"middle",[`&${e.componentCls}-close`]:{display:"none",fontSize:12,alignItems:"center",justifyContent:"center",color:e.colorTextPlaceholder,borderRadius:"50%"},"&:hover":{color:e.colorIconHover}},"&-disabled":{color:e.colorTextPlaceholder,cursor:"not-allowed",[`${e.componentCls}-icon`]:{color:e.colorTextPlaceholder}},"&-small":{height:"24px",paddingBlock:0,paddingInline:4,fontSize:e.fontSizeSM,lineHeight:"24px",[`&${e.componentCls}-active`]:{paddingBlock:0,paddingInline:8},[`${e.componentCls}-icon`]:{paddingBlock:0,paddingInline:0},[`${e.componentCls}-close`]:{marginBlockStart:"-2px",paddingBlock:4,paddingInline:4,fontSize:"6px"}},"&-outlined":{height:"32px",paddingBlock:0,paddingInline:8,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,"&-active":{backgroundColor:"none"}},"&-borderless":{height:"32px","&-active":{backgroundColor:e.colorBgTextHover}},"&-filled":{height:"32px",backgroundColor:e.colorBgTextHover,border:`${e.lineWidth}px solid transparent`,"&:hover":{border:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-underlined":{height:"32px",borderRadius:0,borderBottom:`${e.lineWidth}px solid ${e.colorSplit}`,"&:hover":{borderBottom:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-bordered&-small":{height:"24px",paddingBlock:0,paddingInline:8},"&-bordered&-active":{backgroundColor:e.colorBgContainer}}});function up(e){return We("FieldLabel",t=>{const n={...t,componentCls:`.${e}`};return[cp(n)]})}const dp=(e,t)=>{var k,V;const{label:n,onClear:r,value:a,disabled:i,onLabelClick:o,ellipsis:l,placeholder:c,className:h,formatter:g,variant:f,style:m,downIcon:p,allowClear:S=!0,valueMaxLength:y=41}=e,{componentSize:w}=((V=(k=u.ConfigProvider)==null?void 0:k.useConfig)==null?void 0:V.call(k))||{componentSize:"middle"},{getPrefixCls:v}=d.useContext(u.ConfigProvider.ConfigContext),x=v("pro-core-field-label"),{wrapSSR:C,hashId:j}=up(x),b=Ie(),T=d.useRef(null),$=d.useRef(null);d.useImperativeHandle(t,()=>({labelRef:$,clearRef:T}));const F=z=>z.every(A=>typeof A=="string")?z.join(","):z.map((A,I)=>{const R=I===z.length-1?"":",";return typeof A=="string"?s.jsxs("span",{children:[A,R]},I):s.jsxs("span",{style:{display:"flex"},children:[A,R]},I)}),E=z=>g?g(z):Array.isArray(z)?F(z):z,M=(z,A)=>{var I,R;if(A!=null&&A!==""&&(!Array.isArray(A)||A.length)){const D=z?s.jsxs("span",{onClick:()=>{o==null||o()},className:ce(`${x}-text`,j),children:[z,": "]}):"",O=E(A);if(!l)return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center"},children:[D,E(A)]});const q=(()=>{const L=Array.isArray(A)&&A.length>1,H=b.getMessage("form.lightFilter.itemUnit","项");return typeof O=="string"&&O.length>y&&L?`...${A.length}${H}`:""})();return s.jsxs("span",{title:typeof O=="string"?O:void 0,style:{display:"inline-flex",alignItems:"center"},children:[D,s.jsx("span",{style:{paddingInlineStart:4,display:"flex"},children:typeof O=="string"?(R=(I=O==null?void 0:O.toString())==null?void 0:I.slice)==null?void 0:R.call(I,0,y):O}),q]})}return z||c};return C(s.jsxs("span",{className:ce(x,j,`${x}-${e.size??w??"middle"}`,{[`${x}-${f||"borderless"}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-disabled`]:i,[`${x}-${f}`]:f,[`${x}-allow-clear`]:S},h),style:m,ref:$,onClick:()=>{var z;(z=e==null?void 0:e.onClick)==null||z.call(e)},children:[M(n,a),(a||a===0)&&S&&s.jsx(me.CloseCircleFilled,{role:"button",title:b.getMessage("form.lightFilter.clear","清除"),className:ce(`${x}-icon`,j,`${x}-close`),onClick:z=>{i||r==null||r(),z.stopPropagation()},ref:T}),p!==!1?p??s.jsx(me.DownOutlined,{className:ce(`${x}-icon`,j,`${x}-arrow`)}):null]}))},Ut=d.forwardRef(dp),fp=e=>({[`${e.componentCls}-label`]:{cursor:"pointer"},[`${e.componentCls}-label-bordered`]:{display:"inline-flex",alignItems:"center",height:e.controlHeight,paddingBlock:0,paddingInline:e.paddingSM,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,boxSizing:"border-box"},[`${e.componentCls}-overlay`]:{minWidth:"200px",marginBlockStart:"4px"},[`${e.componentCls}-content`]:{paddingBlock:16,paddingInline:16}});function mp(e){return We("FilterDropdown",t=>{const n={...t,componentCls:`.${e}`};return[fp(n)]})}const Ou=e=>{const{children:t,label:n,footer:r,open:a,onOpenChange:i,disabled:o,footerRender:l,placement:c,popoverProps:h}=e,{getPrefixCls:g}=d.useContext(u.ConfigProvider.ConfigContext),f=g("pro-core-field-dropdown"),{wrapSSR:m,hashId:p}=mp(f),S=d.useRef(null),y=d.useMemo(()=>{var w;return{container:{padding:0,...((w=h==null?void 0:h.styles)==null?void 0:w.container)||{}},...(h==null?void 0:h.styles)||{}}},[h==null?void 0:h.styles]);return m(s.jsx(u.Popover,{...h,placement:c,trigger:["click"],open:a||!1,onOpenChange:i,styles:y,content:s.jsxs("div",{ref:S,className:ce(`${f}-overlay`,{[`${f}-overlay-${c}`]:c,hashId:p}),children:[s.jsx(u.ConfigProvider,{getPopupContainer:()=>S.current||document.body,children:s.jsx("div",{className:ce(`${f}-content`,p),children:t})}),r&&s.jsx(op,{disabled:o,footerRender:l,...r})]}),children:s.jsx("span",{className:ce(`${f}-label`,p),children:n})}))},hp=e=>{const t=`${e.antCls}-progress-bg`;return{[e.componentCls]:{boxSizing:"border-box","&-multiple":{paddingBlockStart:6,paddingBlockEnd:12,paddingInline:8},"&-progress":{"&-success":{[t]:{backgroundColor:e.colorSuccess}},"&-error":{[t]:{backgroundColor:e.colorError}},"&-warning":{[t]:{backgroundColor:e.colorWarning}}},"&-rule":{display:"flex",alignItems:"center","&-icon":{"&-default":{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"22px","&-circle":{width:"6px",height:"6px",backgroundColor:e.colorTextSecondary,borderRadius:"4px"}},"&-loading":{color:e.colorPrimary},"&-error":{color:e.colorError},"&-success":{color:e.colorSuccess}},"&-text":{color:e.colorText}}}}};function gp(e){return We("InlineErrorFormItem",t=>{const n={...t,componentCls:`.${e}`};return[hp(n)]})}const Du={marginBlockStart:-5,marginBlockEnd:-5,marginInlineStart:0,marginInlineEnd:0},pp=({inputProps:e,input:t,extra:n,errorList:r,popoverProps:a})=>{var v,x;const[i,o]=d.useState(!1),[l,c]=d.useState({errors:[],warnings:[]}),{getPrefixCls:h}=d.useContext(u.ConfigProvider.ConfigContext),g=h(),f=u.theme.useToken(),{wrapSSR:m,hashId:p}=gp(`${g}-form-item-with-help`);d.useEffect(()=>{e.validateStatus!=="validating"&&c({errors:e.errors??[],warnings:e.warnings??[]})},[e.errors,e.warnings,e.validateStatus]);const S=e.validateStatus==="validating",y=(((v=l.errors)==null?void 0:v.length)??0)+(((x=l.warnings)==null?void 0:x.length)??0)>=1,w=()=>{var C,j;return s.jsxs(s.Fragment,{children:[(C=l.errors)==null?void 0:C.map((b,T)=>s.jsx("div",{className:ce(`${g}-form-item-explain-error`,p),children:b},`error-${T}`)),(j=l.warnings)==null?void 0:j.map((b,T)=>s.jsx("div",{className:ce(`${g}-form-item-explain-warning`,p),children:b},`warning-${T}`))]})};return s.jsx(u.Popover,{open:y?i:!1,onOpenChange:C=>{C!==i&&o(C)},trigger:(a==null?void 0:a.trigger)||["click"],placement:(a==null?void 0:a.placement)||"topLeft",getPopupContainer:a==null?void 0:a.getPopupContainer,getTooltipContainer:a==null?void 0:a.getTooltipContainer,content:m(s.jsx("div",{className:ce(`${g}-form-item`,p,f.hashId),style:{margin:0,padding:0},children:s.jsxs("div",{className:ce(`${g}-form-item-with-help`,p,f.hashId),children:[S?s.jsx(me.LoadingOutlined,{}):null,y?w():r]})})),...a,children:s.jsxs(s.Fragment,{children:[t,n]})},"popover")},yp=({rules:e,name:t,children:n,popoverProps:r,...a})=>s.jsx(u.Form.Item,{name:t,rules:e,hasFeedback:!1,shouldUpdate:(i,o)=>{if(i===o)return!1;const l=[t].flat(1);l.length>1&&l.pop();try{return JSON.stringify(Oe(i,l))!==JSON.stringify(Oe(o,l))}catch{return!0}},_internalItemRender:{mark:"pro_table_render",render:(i,o)=>s.jsx(pp,{inputProps:i,popoverProps:r,...o})},...a,style:{...Du,...a==null?void 0:a.style},children:n}),xp=e=>{const{errorType:t,rules:n,name:r,popoverProps:a,children:i,...o}=e;return r&&(n!=null&&n.length)&&t==="popover"?s.jsx(yp,{name:r,rules:n,popoverProps:a,...o,children:i}):s.jsx(u.Form.Item,{rules:n,shouldUpdate:r?(l,c)=>{if(l===c)return!1;const h=[r].flat(1);h.length>1&&h.pop();try{return JSON.stringify(Oe(l,h))!==JSON.stringify(Oe(c,h))}catch{return!0}}:void 0,...o,style:{...Du,...o.style},name:r,children:i})},bp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",alignItems:"center",maxWidth:"100%","&-icon":{display:"block",marginInlineStart:"4px",cursor:"pointer","&:hover":{color:e.colorPrimary}},"&-title":{display:"inline-flex",flex:"1"},"&-subtitle ":{marginInlineStart:8,color:e.colorTextSecondary,fontWeight:"normal",fontSize:e.fontSize,whiteSpace:"nowrap"},"&-title-ellipsis":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",wordBreak:"keep-all"}}});function Sp(e){return We("LabelIconTip",t=>{const n={...t,componentCls:`.${e}`};return[bp(n)]})}const er=d.memo(e=>{const{label:t,tooltip:n,ellipsis:r,subTitle:a}=e,{getPrefixCls:i}=d.useContext(u.ConfigProvider.ConfigContext),o=i("pro-core-label-tip"),{wrapSSR:l,hashId:c}=Sp(o);if(!n&&!a)return s.jsx(s.Fragment,{children:t});const h=typeof n=="string"||d.isValidElement(n)?{title:n}:n,g=(h==null?void 0:h.icon)||s.jsx(me.InfoCircleOutlined,{});return l(s.jsxs("div",{className:ce(o,c),onMouseDown:f=>f.stopPropagation(),onMouseLeave:f=>f.stopPropagation(),onMouseMove:f=>f.stopPropagation(),children:[s.jsx("div",{className:ce(`${o}-title`,c,{[`${o}-title-ellipsis`]:r}),children:t}),a&&s.jsx("div",{className:ce(`${o}-subtitle`,c),children:a}),n&&s.jsx(u.Tooltip,{...h,children:s.jsx("span",{className:ce(`${o}-icon`,c),children:g})})]}))}),_r=d.createContext({});var Cs={exports:{}},Cp=Cs.exports,ll;function wp(){return ll||(ll=1,(function(e,t){(function(n,r){e.exports=r()})(Cp,(function(){var n="month",r="quarter";return function(a,i){var o=i.prototype;o.quarter=function(h){return this.$utils().u(h)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(h-1))};var l=o.add;o.add=function(h,g){return h=Number(h),this.$utils().p(g)===r?this.add(3*h,n):l.bind(this)(h,g)};var c=o.startOf;o.startOf=function(h,g){var f=this.$utils(),m=!!f.u(g)||g;if(f.p(h)===r){var p=this.quarter()-1;return m?this.month(3*p).startOf(n).startOf("day"):this.month(3*p+2).endOf(n).endOf("day")}return c.bind(this)(h,g)}}}))})(Cs)),Cs.exports}var jp=wp();const vp=Ht(jp),Et=e=>e==null;Te.extend(vp);const qi={time:"HH:mm:ss",timeRange:"HH:mm:ss",date:"YYYY-MM-DD",dateWeek:"YYYY-wo",dateMonth:"YYYY-MM",dateQuarter:"YYYY-[Q]Q",dateYear:"YYYY",dateRange:"YYYY-MM-DD",dateTime:"YYYY-MM-DD HH:mm:ss",dateTimeRange:"YYYY-MM-DD HH:mm:ss"};function cl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Tp(e){if(cl(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(cl(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}const ui=e=>!!(e!=null&&e._isAMomentObject),ul=(e,t,n)=>{if(!t)return e;if(Te.isDayjs(e)||ui(e)){if(t==="number")return e.valueOf();if(t==="string")return e.format(qi[n]||"YYYY-MM-DD HH:mm:ss");if(typeof t=="string"&&t!=="string")return e.format(t);if(typeof t=="function")return t(e,n)}return e},di=(e,t,n,r,a)=>{const i={};return typeof window>"u"||typeof e!="object"||Et(e)||e instanceof Blob||Array.isArray(e)?e:(Object.keys(e).forEach(o=>{const l=a?[a,o].flat(1):[o],c=Oe(n,l)||"text";let h="text",g;typeof c=="string"?h=c:(h=c.valueType,g=c.dateFormat);const f=e[o];if(Et(f)&&r||r&&f==="")return;if(Tp(f)&&!Array.isArray(f)&&!Te.isDayjs(f)&&!ui(f)){i[o]=di(f,t,n,r,l);return}const m=t??"string";let p;if(m==="number"||m===!1||typeof m=="function"?p=m:m==="string"?p=g||qi[h]:p=m,Array.isArray(f)){i[o]=f.map((S,y)=>Te.isDayjs(S)||ui(S)?ul(S,p===void 0&&m==="string"?"string":p,h):di(S,t,n,r,[o,`${y}`].flat(1)));return}i[o]=ul(f,p,h)}),i)},dl=(e,t)=>typeof t=="function"?t(Te(e)):Te(e).format(t),Fp=(e,t)=>{const[n,r]=Array.isArray(e)?e:[];let a,i;Array.isArray(t)?(a=t[0],i=t[1]):typeof t=="object"&&t.type==="mask"?(a=t.format,i=t.format):(a=t,i=t);const o=n?dl(n,a):"",l=r?dl(r,i):"";return o&&l?`${o} ~ ${l}`:""};function $t(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}const $p=e=>{var t;return!!((t=e==null?void 0:e.valueType)!=null&&t.toString().startsWith("date")||(e==null?void 0:e.valueType)==="select"||e!=null&&e.valueEnum)},Rp=e=>{var t;return((t=e.ellipsis)==null?void 0:t.showTitle)===!1?!1:e.ellipsis},fl=e=>e==null?"":String(e).trimEnd(),Ep=e=>d.isValidElement(e),Ip=(e,t,n,r)=>{const a=Rp(t);if(!a)return!1;const i=$p(t),o=Ep(r);if((i||o)&&(t==null?void 0:t.tooltip)!==!1){const l=s.jsx("div",{className:"pro-table-tooltip-text",children:e});return $t(a)&&$t(a.tooltip)?{tooltip:{title:l,...a.tooltip}}:{tooltip:l}}return n?$t(a)&&$t(a.tooltip)?{tooltip:{title:n,...a.tooltip}}:{tooltip:n}:!1},Mp=(e,t,n,r)=>{if(!t.copyable&&!t.ellipsis)return e;const a=fl(n),i=r!==void 0?fl(r):a,o=Ip(e,t,a,n);return t.copyable?s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"},children:[s.jsx(u.Typography.Text,{style:{flex:1,minWidth:0,margin:0,padding:0},title:"",ellipsis:o,children:e}),i?s.jsx("span",{style:{flex:"none",userSelect:"none"},children:s.jsx(u.Typography.Text,{style:{margin:0,padding:0},copyable:{text:i,tooltips:["",""]}})}):null]}):s.jsx(u.Typography.Text,{style:{width:"100%",margin:0,padding:0},title:"",ellipsis:o,children:e})};function ht(e,...t){return typeof e=="function"?e(...t):e}const fi=(e,t,n)=>t===void 0?e:ht(e,t,n),we=e=>{const t=d.useRef(null);return t.current=e,d.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])};function Gi(e,t){const n=we(e),r=d.useRef(),a=d.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i=d.useCallback(async(...o)=>t===0||t===void 0?n(...o):(a(),new Promise(l=>{r.current=setTimeout(async()=>{l(await n(...o))},t)})),[n,a,t]);return d.useEffect(()=>a,[a]),{run:i,cancel:a}}const Zi=e=>{const t=d.useRef(e);return t.current=e,t};function kp(e,t=100,n){const[r,a]=d.useState(e),i=Zi(e);return d.useEffect(()=>{const o=setTimeout(()=>{a(i.current)},t);return()=>clearTimeout(o)},n?[t,...n]:void 0),r}function gn(e,t,n){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,a,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(!gn(e[a],t[a],n))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;for(a of e.entries())if(!gn(a[1],t.get(a[0]),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=r;a--!==0;){const o=i[a];if(!(n!=null&&n.includes(o))&&!(o==="_owner"&&e.$$typeof)&&!gn(e[o],t[o],n))return!1}return!0}return e!==e&&t!==t}const Ap=(e,t,n)=>gn(e,t,n);function Ji(e,t){const n=d.useRef();return Ap(e,n.current,t)||(n.current=e),n.current}function qn(e,t,n){d.useEffect(e,Ji(t||[],n))}function Pu(e,t,n,r){const a=Gi(async()=>{e()},r||16);d.useEffect(()=>{a.run()},Ji(t||[],n))}function dt(e,t){return d.useMemo(e,Ji(t))}const Op=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Xi=()=>typeof process<"u"&&process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Op;let ml=0;function Dp(e){const t=d.useRef(null),[n]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():(ml+=1,ml.toString())),r=async()=>{var l;(l=t.current)==null||l.abort();const o=new AbortController;t.current=o;try{return e.request?await e.request(e.params,o.signal):void 0}catch(c){if(c.name==="AbortError")return;throw c}},{data:a,isValidating:i}=Mu(e.request?[n,e.params]:null,r,{revalidateOnFocus:!1,shouldRetryOnError:!1,onError:()=>{}});return e.request?[a,i]:[void 0,!1]}const $r=e=>{const t=d.useRef();return d.useEffect(()=>{t.current=e}),t.current};function Pp(){const[,e]=d.useState(!0);return d.useCallback(()=>e(n=>!n),[])}function Np(e,t){const n=d.useMemo(()=>{const r={current:t};return new Proxy(r,{set(a,i,o){return Object.is(a[i],o)||(a[i]=o,e(n)),!0}})},[]);return n}function Lp(e){const t=Pp();return Np(t,e)}const _p=e=>{let t=!1;return(typeof e=="string"&&e.startsWith("date")&&!e.endsWith("Range")||e==="select"||e==="time")&&(t=!0),t},Nu=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t};let hl=0,zp=(e=21)=>{if(typeof window>"u"||!window.crypto)return(hl+=1).toFixed(0);let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const Or=()=>{var e;return(e=window==null?void 0:window.crypto)!=null&&e.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():zp()},Lu=e=>{if(e&&e!==!0)return e},lt=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Bp=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};var ws={exports:{}},Vp=ws.exports,gl;function Hp(){return gl||(gl=1,(function(e,t){(function(n,r){e.exports=r()})(Vp,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,i=/\d\d/,o=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,c={},h=function(w){return(w=+w)+(w>68?1900:2e3)},g=function(w){return function(v){this[w]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(w){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),C=60*x[1]+(+x[2]||0);return C===0?0:x[0]==="+"?-C:C})(w)}],m=function(w){var v=c[w];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(w,v){var x,C=c.meridiem;if(C){for(var j=1;j<=24;j+=1)if(w.indexOf(C(j,0,v))>-1){x=j>12;break}}else x=w===(v?"pm":"PM");return x},S={A:[l,function(w){this.afternoon=p(w,!1)}],a:[l,function(w){this.afternoon=p(w,!0)}],Q:[a,function(w){this.month=3*(w-1)+1}],S:[a,function(w){this.milliseconds=100*+w}],SS:[i,function(w){this.milliseconds=10*+w}],SSS:[/\d{3}/,function(w){this.milliseconds=+w}],s:[o,g("seconds")],ss:[o,g("seconds")],m:[o,g("minutes")],mm:[o,g("minutes")],H:[o,g("hours")],h:[o,g("hours")],HH:[o,g("hours")],hh:[o,g("hours")],D:[o,g("day")],DD:[i,g("day")],Do:[l,function(w){var v=c.ordinal,x=w.match(/\d+/);if(this.day=x[0],v)for(var C=1;C<=31;C+=1)v(C).replace(/\[|\]/g,"")===w&&(this.day=C)}],w:[o,g("week")],ww:[i,g("week")],M:[o,g("month")],MM:[i,g("month")],MMM:[l,function(w){var v=m("months"),x=(m("monthsShort")||v.map((function(C){return C.slice(0,3)}))).indexOf(w)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[l,function(w){var v=m("months").indexOf(w)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,g("year")],YY:[i,function(w){this.year=h(w)}],YYYY:[/\d{4}/,g("year")],Z:f,ZZ:f};function y(w){var v,x;v=w,x=c&&c.formats;for(var C=(w=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,k,V){var z=V&&V.toUpperCase();return k||x[V]||n[V]||x[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,I,R){return I||R.slice(1)}))}))).match(r),j=C.length,b=0;b<j;b+=1){var T=C[b],$=S[T],F=$&&$[0],E=$&&$[1];C[b]=E?{regex:F,parser:E}:T.replace(/^\[|\]$/g,"")}return function(M){for(var k={},V=0,z=0;V<j;V+=1){var A=C[V];if(typeof A=="string")z+=A.length;else{var I=A.regex,R=A.parser,D=M.slice(z),O=I.exec(D)[0];R.call(k,O),M=M.replace(O,"")}}return(function(N){var q=N.afternoon;if(q!==void 0){var L=N.hours;q?L<12&&(N.hours+=12):L===12&&(N.hours=0),delete N.afternoon}})(k),k}}return function(w,v,x){x.p.customParseFormat=!0,w&&w.parseTwoDigitYear&&(h=w.parseTwoDigitYear);var C=v.prototype,j=C.parse;C.parse=function(b){var T=b.date,$=b.utc,F=b.args;this.$u=$;var E=F[1];if(typeof E=="string"){var M=F[2]===!0,k=F[3]===!0,V=M||k,z=F[2];k&&(z=F[2]),c=this.$locale(),!M&&z&&(c=x.Ls[z]),this.$d=(function(D,O,N,q){try{if(["x","X"].indexOf(O)>-1)return new Date((O==="X"?1e3:1)*D);var L=y(O)(D),H=L.year,G=L.month,W=L.day,B=L.hours,_=L.minutes,Y=L.seconds,P=L.milliseconds,U=L.zone,X=L.week,ne=new Date,Z=W||(H||G?1:ne.getDate()),re=H||ne.getFullYear(),ie=0;H&&!G||(ie=G>0?G-1:ne.getMonth());var se,pe=B||0,ge=_||0,fe=Y||0,J=P||0;return U?new Date(Date.UTC(re,ie,Z,pe,ge,fe,J+60*U.offset*1e3)):N?new Date(Date.UTC(re,ie,Z,pe,ge,fe,J)):(se=new Date(re,ie,Z,pe,ge,fe,J),X&&(se=q(se).week(X).toDate()),se)}catch{return new Date("")}})(T,E,$,x),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),V&&T!=this.format(E)&&(this.$d=new Date("")),c={}}else if(E instanceof Array)for(var A=E.length,I=1;I<=A;I+=1){F[1]=E[I-1];var R=x.apply(this,F);if(R.isValid()){this.$d=R.$d,this.$L=R.$L,this.init();break}I===A&&(this.$d=new Date(""))}else j.call(this,b)}}}))})(ws)),ws.exports}var Yp=Hp();const Up=Ht(Yp);Te.extend(Up);const pl=e=>!!(e!=null&&e._isAMomentObject),ir=(e,t)=>Et(e)||Te.isDayjs(e)||pl(e)?pl(e)?Te(e):e:Array.isArray(e)?e.map(n=>ir(n,t)):typeof e=="number"?Te(e):Te(e,t),Kp=["colon","dependencies","extra","getValueFromEvent","getValueProps","hasFeedback","help","htmlFor","initialValue","noStyle","label","labelAlign","labelCol","name","preserve","normalize","required","rules","shouldUpdate","trigger","validateFirst","validateStatus","validateTrigger","valuePropName","wrapperCol","hidden","validateDebounce","addonBefore","addonAfter","addonWarpStyle"];function Wp(e){const t={};return Kp.forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t}const qp="valueType request formItemRender render text formItemProps valueEnum",Gp="fieldProps isDefaultDom groupProps contentRender submitterProps submitter";function It(e,t=!1){const n=`${qp} ${Gp}`.split(/[\s\n]+/),r={};return Object.keys(e||{}).forEach(a=>{n.includes(a)&&!t||(r[a]=e[a])}),r}function Zp(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const Jp=({color:e,children:t})=>s.jsx(u.Badge,{color:e,text:t}),Qt=e=>Zp(e)==="map"?e:new Map(Object.entries(e||{})),Xp={Success:({children:e})=>s.jsx(u.Badge,{status:"success",text:e}),Error:({children:e})=>s.jsx(u.Badge,{status:"error",text:e}),Default:({children:e})=>s.jsx(u.Badge,{status:"default",text:e}),Processing:({children:e})=>s.jsx(u.Badge,{status:"processing",text:e}),Warning:({children:e})=>s.jsx(u.Badge,{status:"warning",text:e}),success:({children:e})=>s.jsx(u.Badge,{status:"success",text:e}),error:({children:e})=>s.jsx(u.Badge,{status:"error",text:e}),default:({children:e})=>s.jsx(u.Badge,{status:"default",text:e}),processing:({children:e})=>s.jsx(u.Badge,{status:"processing",text:e}),warning:({children:e})=>s.jsx(u.Badge,{status:"warning",text:e})},On=(e,t,n)=>{if(Array.isArray(e))return s.jsx(u.Space,{separator:",",size:2,wrap:!0,children:e.map((c,h)=>On(c,t,h))},n);const r=Qt(t);if(!r.has(e)&&!r.has(`${e}`))return(e==null?void 0:e.label)||e;const a=r.get(e)||r.get(`${e}`);if(!a)return s.jsx(d.Fragment,{children:(e==null?void 0:e.label)||e},n);const{status:i,color:o}=a,l=Xp[i||"Init"];return l?s.jsx(l,{children:a.text},n):o?s.jsx(Jp,{color:o,children:a.text},n):s.jsx(d.Fragment,{children:a.text||a},n)};var rs={exports:{}},yl;function Qp(){return yl||(yl=1,(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=v();r.configure=v,r.stringify=r,r.default=r,t.stringify=r,t.configure=v,e.exports=r;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function i(x){return x.length<5e3&&!a.test(x)?`"${x}"`:JSON.stringify(x)}function o(x,C){if(x.length>200||C)return x.sort(C);for(let j=1;j<x.length;j++){const b=x[j];let T=j;for(;T!==0&&x[T-1]>b;)x[T]=x[T-1],T--;x[T]=b}return x}const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(x){return l.call(x)!==void 0&&x.length!==0}function h(x,C,j){x.length<j&&(j=x.length);const b=C===","?"":" ";let T=`"0":${b}${x[0]}`;for(let $=1;$<j;$++)T+=`${C}"${$}":${b}${x[$]}`;return T}function g(x){if(n.call(x,"circularValue")){const C=x.circularValue;if(typeof C=="string")return`"${C}"`;if(C==null)return C;if(C===Error||C===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(x){let C;if(n.call(x,"deterministic")&&(C=x.deterministic,typeof C!="boolean"&&typeof C!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return C===void 0?!0:C}function m(x,C){let j;if(n.call(x,C)&&(j=x[C],typeof j!="boolean"))throw new TypeError(`The "${C}" argument must be of type boolean`);return j===void 0?!0:j}function p(x,C){let j;if(n.call(x,C)){if(j=x[C],typeof j!="number")throw new TypeError(`The "${C}" argument must be of type number`);if(!Number.isInteger(j))throw new TypeError(`The "${C}" argument must be an integer`);if(j<1)throw new RangeError(`The "${C}" argument must be >= 1`)}return j===void 0?1/0:j}function S(x){return x===1?"1 item":`${x} items`}function y(x){const C=new Set;for(const j of x)(typeof j=="string"||typeof j=="number")&&C.add(String(j));return C}function w(x){if(n.call(x,"strict")){const C=x.strict;if(typeof C!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(C)return j=>{let b=`Object can not safely be stringified. Received type ${typeof j}`;throw typeof j!="function"&&(b+=` (${j.toString()})`),new Error(b)}}}function v(x){x={...x};const C=w(x);C&&(x.bigint===void 0&&(x.bigint=!1),"circularValue"in x||(x.circularValue=Error));const j=g(x),b=m(x,"bigint"),T=f(x),$=typeof T=="function"?T:void 0,F=p(x,"maximumDepth"),E=p(x,"maximumBreadth");function M(I,R,D,O,N,q){let L=R[I];switch(typeof L=="object"&&L!==null&&typeof L.toJSON=="function"&&(L=L.toJSON(I)),L=O.call(R,I,L),typeof L){case"string":return i(L);case"object":{if(L===null)return"null";if(D.indexOf(L)!==-1)return j;let H="",G=",";const W=q;if(Array.isArray(L)){if(L.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push(L),N!==""&&(q+=N,H+=`
37
- ${q}`,G=`,
38
- ${q}`);const X=Math.min(L.length,E);let ne=0;for(;ne<X-1;ne++){const re=M(String(ne),L,D,O,N,q);H+=re!==void 0?re:"null",H+=G}const Z=M(String(ne),L,D,O,N,q);if(H+=Z!==void 0?Z:"null",L.length-1>E){const re=L.length-E-1;H+=`${G}"... ${S(re)} not stringified"`}return N!==""&&(H+=`
39
- ${W}`),D.pop(),`[${H}]`}let B=Object.keys(L);const _=B.length;if(_===0)return"{}";if(F<D.length+1)return'"[Object]"';let Y="",P="";N!==""&&(q+=N,G=`,
40
- ${q}`,Y=" ");const U=Math.min(_,E);T&&!c(L)&&(B=o(B,$)),D.push(L);for(let X=0;X<U;X++){const ne=B[X],Z=M(ne,L,D,O,N,q);Z!==void 0&&(H+=`${P}${i(ne)}:${Y}${Z}`,P=G)}if(_>E){const X=_-E;H+=`${P}"...":${Y}"${S(X)} not stringified"`,P=G}return N!==""&&P.length>1&&(H=`
41
- ${q}${H}
42
- ${W}`),D.pop(),`{${H}}`}case"number":return isFinite(L)?String(L):C?C(L):"null";case"boolean":return L===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(L);default:return C?C(L):void 0}}function k(I,R,D,O,N,q){switch(typeof R=="object"&&R!==null&&typeof R.toJSON=="function"&&(R=R.toJSON(I)),typeof R){case"string":return i(R);case"object":{if(R===null)return"null";if(D.indexOf(R)!==-1)return j;const L=q;let H="",G=",";if(Array.isArray(R)){if(R.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push(R),N!==""&&(q+=N,H+=`
43
- ${q}`,G=`,
44
- ${q}`);const _=Math.min(R.length,E);let Y=0;for(;Y<_-1;Y++){const U=k(String(Y),R[Y],D,O,N,q);H+=U!==void 0?U:"null",H+=G}const P=k(String(Y),R[Y],D,O,N,q);if(H+=P!==void 0?P:"null",R.length-1>E){const U=R.length-E-1;H+=`${G}"... ${S(U)} not stringified"`}return N!==""&&(H+=`
45
- ${L}`),D.pop(),`[${H}]`}D.push(R);let W="";N!==""&&(q+=N,G=`,
46
- ${q}`,W=" ");let B="";for(const _ of O){const Y=k(_,R[_],D,O,N,q);Y!==void 0&&(H+=`${B}${i(_)}:${W}${Y}`,B=G)}return N!==""&&B.length>1&&(H=`
47
- ${q}${H}
48
- ${L}`),D.pop(),`{${H}}`}case"number":return isFinite(R)?String(R):C?C(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(R);default:return C?C(R):void 0}}function V(I,R,D,O,N){switch(typeof R){case"string":return i(R);case"object":{if(R===null)return"null";if(typeof R.toJSON=="function"){if(R=R.toJSON(I),typeof R!="object")return V(I,R,D,O,N);if(R===null)return"null"}if(D.indexOf(R)!==-1)return j;const q=N;if(Array.isArray(R)){if(R.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push(R),N+=O;let Y=`
49
- ${N}`;const P=`,
50
- ${N}`,U=Math.min(R.length,E);let X=0;for(;X<U-1;X++){const Z=V(String(X),R[X],D,O,N);Y+=Z!==void 0?Z:"null",Y+=P}const ne=V(String(X),R[X],D,O,N);if(Y+=ne!==void 0?ne:"null",R.length-1>E){const Z=R.length-E-1;Y+=`${P}"... ${S(Z)} not stringified"`}return Y+=`
51
- ${q}`,D.pop(),`[${Y}]`}let L=Object.keys(R);const H=L.length;if(H===0)return"{}";if(F<D.length+1)return'"[Object]"';N+=O;const G=`,
52
- ${N}`;let W="",B="",_=Math.min(H,E);c(R)&&(W+=h(R,G,E),L=L.slice(R.length),_-=R.length,B=G),T&&(L=o(L,$)),D.push(R);for(let Y=0;Y<_;Y++){const P=L[Y],U=V(P,R[P],D,O,N);U!==void 0&&(W+=`${B}${i(P)}: ${U}`,B=G)}if(H>E){const Y=H-E;W+=`${B}"...": "${S(Y)} not stringified"`,B=G}return B!==""&&(W=`
53
- ${N}${W}
54
- ${q}`),D.pop(),`{${W}}`}case"number":return isFinite(R)?String(R):C?C(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(R);default:return C?C(R):void 0}}function z(I,R,D){switch(typeof R){case"string":return i(R);case"object":{if(R===null)return"null";if(typeof R.toJSON=="function"){if(R=R.toJSON(I),typeof R!="object")return z(I,R,D);if(R===null)return"null"}if(D.indexOf(R)!==-1)return j;let O="";const N=R.length!==void 0;if(N&&Array.isArray(R)){if(R.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push(R);const W=Math.min(R.length,E);let B=0;for(;B<W-1;B++){const Y=z(String(B),R[B],D);O+=Y!==void 0?Y:"null",O+=","}const _=z(String(B),R[B],D);if(O+=_!==void 0?_:"null",R.length-1>E){const Y=R.length-E-1;O+=`,"... ${S(Y)} not stringified"`}return D.pop(),`[${O}]`}let q=Object.keys(R);const L=q.length;if(L===0)return"{}";if(F<D.length+1)return'"[Object]"';let H="",G=Math.min(L,E);N&&c(R)&&(O+=h(R,",",E),q=q.slice(R.length),G-=R.length,H=","),T&&(q=o(q,$)),D.push(R);for(let W=0;W<G;W++){const B=q[W],_=z(B,R[B],D);_!==void 0&&(O+=`${H}${i(B)}:${_}`,H=",")}if(L>E){const W=L-E;O+=`${H}"...":"${S(W)} not stringified"`}return D.pop(),`{${O}}`}case"number":return isFinite(R)?String(R):C?C(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(R);default:return C?C(R):void 0}}function A(I,R,D){if(arguments.length>1){let O="";if(typeof D=="number"?O=" ".repeat(Math.min(D,10)):typeof D=="string"&&(O=D.slice(0,10)),R!=null){if(typeof R=="function")return M("",{"":I},[],R,O,"");if(Array.isArray(R))return k("",I,[],y(R),O,"")}if(O.length!==0)return V("",I,[],O,"")}return z("",I,[])}return A}})(rs,rs.exports)),rs.exports}var ey=Qp();const ty=Ht(ey),ny=ty.configure,mn=ny({bigint:!0,circularValue:"Magic circle!",deterministic:!1,maximumDepth:4});var _u=typeof global=="object"&&global&&global.Object===Object&&global,ry=typeof self=="object"&&self&&self.Object===Object&&self,Kt=_u||ry||Function("return this")(),yn=Kt.Symbol,zu=Object.prototype,sy=zu.hasOwnProperty,ay=zu.toString,gr=yn?yn.toStringTag:void 0;function iy(e){var t=sy.call(e,gr),n=e[gr];try{e[gr]=void 0;var r=!0}catch{}var a=ay.call(e);return r&&(t?e[gr]=n:delete e[gr]),a}var oy=Object.prototype,ly=oy.toString;function cy(e){return ly.call(e)}var uy="[object Null]",dy="[object Undefined]",xl=yn?yn.toStringTag:void 0;function or(e){return e==null?e===void 0?dy:uy:xl&&xl in Object(e)?iy(e):cy(e)}function Jt(e){return e!=null&&typeof e=="object"}var xn=Array.isArray;function Bu(e){return e}var fy="[object AsyncFunction]",my="[object Function]",hy="[object GeneratorFunction]",gy="[object Proxy]";function Qi(e){if(!$t(e))return!1;var t=or(e);return t==my||t==hy||t==fy||t==gy}var Ia=Kt["__core-js_shared__"],bl=(function(){var e=/[^.]+$/.exec(Ia&&Ia.keys&&Ia.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function py(e){return!!bl&&bl in e}var yy=Function.prototype,xy=yy.toString;function Dn(e){if(e!=null){try{return xy.call(e)}catch{}try{return e+""}catch{}}return""}var by=/[\\^$.*+?()[\]{}|]/g,Sy=/^\[object .+?Constructor\]$/,Cy=Function.prototype,wy=Object.prototype,jy=Cy.toString,vy=wy.hasOwnProperty,Ty=RegExp("^"+jy.call(vy).replace(by,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Fy(e){if(!$t(e)||py(e))return!1;var t=Qi(e)?Ty:Sy;return t.test(Dn(e))}function $y(e,t){return e==null?void 0:e[t]}function Pn(e,t){var n=$y(e,t);return Fy(n)?n:void 0}var mi=Pn(Kt,"WeakMap"),Sl=Object.create,Ry=(function(){function e(){}return function(t){if(!$t(t))return{};if(Sl)return Sl(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Ey(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Iy(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var My=800,ky=16,Ay=Date.now;function Oy(e){var t=0,n=0;return function(){var r=Ay(),a=ky-(r-n);if(n=r,a>0){if(++t>=My)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Dy(e){return function(){return e}}var Ds=(function(){try{var e=Pn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Py=Ds?function(e,t){return Ds(e,"toString",{configurable:!0,enumerable:!1,value:Dy(t),writable:!0})}:Bu,Ny=Oy(Py);function Ly(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var _y=9007199254740991,zy=/^(?:0|[1-9]\d*)$/;function Vu(e,t){var n=typeof e;return t=t??_y,!!t&&(n=="number"||n!="symbol"&&zy.test(e))&&e>-1&&e%1==0&&e<t}function eo(e,t,n){t=="__proto__"&&Ds?Ds(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function zr(e,t){return e===t||e!==e&&t!==t}var By=Object.prototype,Vy=By.hasOwnProperty;function Hu(e,t,n){var r=e[t];(!(Vy.call(e,t)&&zr(r,n))||n===void 0&&!(t in e))&&eo(e,t,n)}function Hy(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var l=t[i],c=void 0;c===void 0&&(c=e[l]),a?eo(n,l,c):Hu(n,l,c)}return n}var Cl=Math.max;function Yy(e,t,n){return t=Cl(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=Cl(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),Ey(e,this,l)}}function Uy(e,t){return Ny(Yy(e,t,Bu),e+"")}var Ky=9007199254740991;function Yu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ky}function Br(e){return e!=null&&Yu(e.length)&&!Qi(e)}function Wy(e,t,n){if(!$t(n))return!1;var r=typeof t;return(r=="number"?Br(n)&&Vu(t,n.length):r=="string"&&t in n)?zr(n[t],e):!1}function qy(e){return Uy(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&Wy(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,i)}return t})}var Gy=Object.prototype;function Js(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Gy;return e===n}function Zy(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Jy="[object Arguments]";function wl(e){return Jt(e)&&or(e)==Jy}var Uu=Object.prototype,Xy=Uu.hasOwnProperty,Qy=Uu.propertyIsEnumerable,Ps=wl((function(){return arguments})())?wl:function(e){return Jt(e)&&Xy.call(e,"callee")&&!Qy.call(e,"callee")};function ex(){return!1}var Ku=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jl=Ku&&typeof module=="object"&&module&&!module.nodeType&&module,tx=jl&&jl.exports===Ku,vl=tx?Kt.Buffer:void 0,nx=vl?vl.isBuffer:void 0,tr=nx||ex,rx="[object Arguments]",sx="[object Array]",ax="[object Boolean]",ix="[object Date]",ox="[object Error]",lx="[object Function]",cx="[object Map]",ux="[object Number]",dx="[object Object]",fx="[object RegExp]",mx="[object Set]",hx="[object String]",gx="[object WeakMap]",px="[object ArrayBuffer]",yx="[object DataView]",xx="[object Float32Array]",bx="[object Float64Array]",Sx="[object Int8Array]",Cx="[object Int16Array]",wx="[object Int32Array]",jx="[object Uint8Array]",vx="[object Uint8ClampedArray]",Tx="[object Uint16Array]",Fx="[object Uint32Array]",Xe={};Xe[xx]=Xe[bx]=Xe[Sx]=Xe[Cx]=Xe[wx]=Xe[jx]=Xe[vx]=Xe[Tx]=Xe[Fx]=!0;Xe[rx]=Xe[sx]=Xe[px]=Xe[ax]=Xe[yx]=Xe[ix]=Xe[ox]=Xe[lx]=Xe[cx]=Xe[ux]=Xe[dx]=Xe[fx]=Xe[mx]=Xe[hx]=Xe[gx]=!1;function $x(e){return Jt(e)&&Yu(e.length)&&!!Xe[or(e)]}function to(e){return function(t){return e(t)}}var Wu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rr=Wu&&typeof module=="object"&&module&&!module.nodeType&&module,Rx=Rr&&Rr.exports===Wu,Ma=Rx&&_u.process,nr=(function(){try{var e=Rr&&Rr.require&&Rr.require("util").types;return e||Ma&&Ma.binding&&Ma.binding("util")}catch{}})(),Tl=nr&&nr.isTypedArray,Xs=Tl?to(Tl):$x,Ex=Object.prototype,Ix=Ex.hasOwnProperty;function qu(e,t){var n=xn(e),r=!n&&Ps(e),a=!n&&!r&&tr(e),i=!n&&!r&&!a&&Xs(e),o=n||r||a||i,l=o?Zy(e.length,String):[],c=l.length;for(var h in e)(t||Ix.call(e,h))&&!(o&&(h=="length"||a&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Vu(h,c)))&&l.push(h);return l}function Gu(e,t){return function(n){return e(t(n))}}var Mx=Gu(Object.keys,Object),kx=Object.prototype,Ax=kx.hasOwnProperty;function Zu(e){if(!Js(e))return Mx(e);var t=[];for(var n in Object(e))Ax.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ox(e){return Br(e)?qu(e):Zu(e)}function Dx(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Px=Object.prototype,Nx=Px.hasOwnProperty;function Lx(e){if(!$t(e))return Dx(e);var t=Js(e),n=[];for(var r in e)r=="constructor"&&(t||!Nx.call(e,r))||n.push(r);return n}function Ju(e){return Br(e)?qu(e,!0):Lx(e)}var Dr=Pn(Object,"create");function _x(){this.__data__=Dr?Dr(null):{},this.size=0}function zx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Bx="__lodash_hash_undefined__",Vx=Object.prototype,Hx=Vx.hasOwnProperty;function Yx(e){var t=this.__data__;if(Dr){var n=t[e];return n===Bx?void 0:n}return Hx.call(t,e)?t[e]:void 0}var Ux=Object.prototype,Kx=Ux.hasOwnProperty;function Wx(e){var t=this.__data__;return Dr?t[e]!==void 0:Kx.call(t,e)}var qx="__lodash_hash_undefined__";function Gx(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Dr&&t===void 0?qx:t,this}function kn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kn.prototype.clear=_x;kn.prototype.delete=zx;kn.prototype.get=Yx;kn.prototype.has=Wx;kn.prototype.set=Gx;function Zx(){this.__data__=[],this.size=0}function Qs(e,t){for(var n=e.length;n--;)if(zr(e[n][0],t))return n;return-1}var Jx=Array.prototype,Xx=Jx.splice;function Qx(e){var t=this.__data__,n=Qs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Xx.call(t,n,1),--this.size,!0}function eb(e){var t=this.__data__,n=Qs(t,e);return n<0?void 0:t[n][1]}function tb(e){return Qs(this.__data__,e)>-1}function nb(e,t){var n=this.__data__,r=Qs(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}en.prototype.clear=Zx;en.prototype.delete=Qx;en.prototype.get=eb;en.prototype.has=tb;en.prototype.set=nb;var Pr=Pn(Kt,"Map");function rb(){this.size=0,this.__data__={hash:new kn,map:new(Pr||en),string:new kn}}function sb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ea(e,t){var n=e.__data__;return sb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ab(e){var t=ea(this,e).delete(e);return this.size-=t?1:0,t}function ib(e){return ea(this,e).get(e)}function ob(e){return ea(this,e).has(e)}function lb(e,t){var n=ea(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Nn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nn.prototype.clear=rb;Nn.prototype.delete=ab;Nn.prototype.get=ib;Nn.prototype.has=ob;Nn.prototype.set=lb;function cb(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var Xu=Gu(Object.getPrototypeOf,Object),ub="[object Object]",db=Function.prototype,fb=Object.prototype,Qu=db.toString,mb=fb.hasOwnProperty,hb=Qu.call(Object);function gb(e){if(!Jt(e)||or(e)!=ub)return!1;var t=Xu(e);if(t===null)return!0;var n=mb.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Qu.call(n)==hb}function pb(){this.__data__=new en,this.size=0}function yb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function xb(e){return this.__data__.get(e)}function bb(e){return this.__data__.has(e)}var Sb=200;function Cb(e,t){var n=this.__data__;if(n instanceof en){var r=n.__data__;if(!Pr||r.length<Sb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Nn(r)}return n.set(e,t),this.size=n.size,this}function Bt(e){var t=this.__data__=new en(e);this.size=t.size}Bt.prototype.clear=pb;Bt.prototype.delete=yb;Bt.prototype.get=xb;Bt.prototype.has=bb;Bt.prototype.set=Cb;var ed=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fl=ed&&typeof module=="object"&&module&&!module.nodeType&&module,wb=Fl&&Fl.exports===ed,$l=wb?Kt.Buffer:void 0,Rl=$l?$l.allocUnsafe:void 0;function td(e,t){if(t)return e.slice();var n=e.length,r=Rl?Rl(n):new e.constructor(n);return e.copy(r),r}function jb(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}function vb(){return[]}var Tb=Object.prototype,Fb=Tb.propertyIsEnumerable,El=Object.getOwnPropertySymbols,$b=El?function(e){return e==null?[]:(e=Object(e),jb(El(e),function(t){return Fb.call(e,t)}))}:vb;function Rb(e,t,n){var r=t(e);return xn(e)?r:cb(r,n(e))}function hi(e){return Rb(e,Ox,$b)}var gi=Pn(Kt,"DataView"),pi=Pn(Kt,"Promise"),yi=Pn(Kt,"Set"),Il="[object Map]",Eb="[object Object]",Ml="[object Promise]",kl="[object Set]",Al="[object WeakMap]",Ol="[object DataView]",Ib=Dn(gi),Mb=Dn(Pr),kb=Dn(pi),Ab=Dn(yi),Ob=Dn(mi),Ft=or;(gi&&Ft(new gi(new ArrayBuffer(1)))!=Ol||Pr&&Ft(new Pr)!=Il||pi&&Ft(pi.resolve())!=Ml||yi&&Ft(new yi)!=kl||mi&&Ft(new mi)!=Al)&&(Ft=function(e){var t=or(e),n=t==Eb?e.constructor:void 0,r=n?Dn(n):"";if(r)switch(r){case Ib:return Ol;case Mb:return Il;case kb:return Ml;case Ab:return kl;case Ob:return Al}return t});var Db=Object.prototype,Pb=Db.hasOwnProperty;function Nb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Pb.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ns=Kt.Uint8Array;function no(e){var t=new e.constructor(e.byteLength);return new Ns(t).set(new Ns(e)),t}function Lb(e,t){var n=no(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var _b=/\w*$/;function zb(e){var t=new e.constructor(e.source,_b.exec(e));return t.lastIndex=e.lastIndex,t}var Dl=yn?yn.prototype:void 0,Pl=Dl?Dl.valueOf:void 0;function Bb(e){return Pl?Object(Pl.call(e)):{}}function nd(e,t){var n=t?no(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Vb="[object Boolean]",Hb="[object Date]",Yb="[object Map]",Ub="[object Number]",Kb="[object RegExp]",Wb="[object Set]",qb="[object String]",Gb="[object Symbol]",Zb="[object ArrayBuffer]",Jb="[object DataView]",Xb="[object Float32Array]",Qb="[object Float64Array]",eS="[object Int8Array]",tS="[object Int16Array]",nS="[object Int32Array]",rS="[object Uint8Array]",sS="[object Uint8ClampedArray]",aS="[object Uint16Array]",iS="[object Uint32Array]";function oS(e,t,n){var r=e.constructor;switch(t){case Zb:return no(e);case Vb:case Hb:return new r(+e);case Jb:return Lb(e);case Xb:case Qb:case eS:case tS:case nS:case rS:case sS:case aS:case iS:return nd(e,n);case Yb:return new r;case Ub:case qb:return new r(e);case Kb:return zb(e);case Wb:return new r;case Gb:return Bb(e)}}function rd(e){return typeof e.constructor=="function"&&!Js(e)?Ry(Xu(e)):{}}var lS="[object Map]";function cS(e){return Jt(e)&&Ft(e)==lS}var Nl=nr&&nr.isMap,uS=Nl?to(Nl):cS,dS="[object Set]";function fS(e){return Jt(e)&&Ft(e)==dS}var Ll=nr&&nr.isSet,mS=Ll?to(Ll):fS,hS=1,sd="[object Arguments]",gS="[object Array]",pS="[object Boolean]",yS="[object Date]",xS="[object Error]",ad="[object Function]",bS="[object GeneratorFunction]",SS="[object Map]",CS="[object Number]",id="[object Object]",wS="[object RegExp]",jS="[object Set]",vS="[object String]",TS="[object Symbol]",FS="[object WeakMap]",$S="[object ArrayBuffer]",RS="[object DataView]",ES="[object Float32Array]",IS="[object Float64Array]",MS="[object Int8Array]",kS="[object Int16Array]",AS="[object Int32Array]",OS="[object Uint8Array]",DS="[object Uint8ClampedArray]",PS="[object Uint16Array]",NS="[object Uint32Array]",qe={};qe[sd]=qe[gS]=qe[$S]=qe[RS]=qe[pS]=qe[yS]=qe[ES]=qe[IS]=qe[MS]=qe[kS]=qe[AS]=qe[SS]=qe[CS]=qe[id]=qe[wS]=qe[jS]=qe[vS]=qe[TS]=qe[OS]=qe[DS]=qe[PS]=qe[NS]=!0;qe[xS]=qe[ad]=qe[FS]=!1;function js(e,t,n,r,a,i){var o,l=t&hS;if(o!==void 0)return o;if(!$t(e))return e;var c=xn(e);if(c)o=Nb(e);else{var h=Ft(e),g=h==ad||h==bS;if(tr(e))return td(e,l);if(h==id||h==sd||g&&!a)o=g?{}:rd(e);else{if(!qe[h])return a?e:{};o=oS(e,h,l)}}i||(i=new Bt);var f=i.get(e);if(f)return f;i.set(e,o),mS(e)?e.forEach(function(S){o.add(js(S,t,n,S,e,i))}):uS(e)&&e.forEach(function(S,y){o.set(y,js(S,t,n,y,e,i))});var m=hi,p=c?void 0:m(e);return Ly(p||e,function(S,y){p&&(y=S,S=e[y]),Hu(o,y,js(S,t,n,y,e,i))}),o}var LS=1,_S=4;function zS(e){return js(e,LS|_S)}var BS="__lodash_hash_undefined__";function VS(e){return this.__data__.set(e,BS),this}function HS(e){return this.__data__.has(e)}function Ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Nn;++t<n;)this.add(e[t])}Ls.prototype.add=Ls.prototype.push=VS;Ls.prototype.has=HS;function YS(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function US(e,t){return e.has(t)}var KS=1,WS=2;function od(e,t,n,r,a,i){var o=n&KS,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var h=i.get(e),g=i.get(t);if(h&&g)return h==t&&g==e;var f=-1,m=!0,p=n&WS?new Ls:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var S=e[f],y=t[f];if(r)var w=o?r(y,S,f,t,e,i):r(S,y,f,e,t,i);if(w!==void 0){if(w)continue;m=!1;break}if(p){if(!YS(t,function(v,x){if(!US(p,x)&&(S===v||a(S,v,n,r,i)))return p.push(x)})){m=!1;break}}else if(!(S===y||a(S,y,n,r,i))){m=!1;break}}return i.delete(e),i.delete(t),m}function qS(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function GS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var ZS=1,JS=2,XS="[object Boolean]",QS="[object Date]",eC="[object Error]",tC="[object Map]",nC="[object Number]",rC="[object RegExp]",sC="[object Set]",aC="[object String]",iC="[object Symbol]",oC="[object ArrayBuffer]",lC="[object DataView]",_l=yn?yn.prototype:void 0,ka=_l?_l.valueOf:void 0;function cC(e,t,n,r,a,i,o){switch(n){case lC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oC:return!(e.byteLength!=t.byteLength||!i(new Ns(e),new Ns(t)));case XS:case QS:case nC:return zr(+e,+t);case eC:return e.name==t.name&&e.message==t.message;case rC:case aC:return e==t+"";case tC:var l=qS;case sC:var c=r&ZS;if(l||(l=GS),e.size!=t.size&&!c)return!1;var h=o.get(e);if(h)return h==t;r|=JS,o.set(e,t);var g=od(l(e),l(t),r,a,i,o);return o.delete(e),g;case iC:if(ka)return ka.call(e)==ka.call(t)}return!1}var uC=1,dC=Object.prototype,fC=dC.hasOwnProperty;function mC(e,t,n,r,a,i){var o=n&uC,l=hi(e),c=l.length,h=hi(t),g=h.length;if(c!=g&&!o)return!1;for(var f=c;f--;){var m=l[f];if(!(o?m in t:fC.call(t,m)))return!1}var p=i.get(e),S=i.get(t);if(p&&S)return p==t&&S==e;var y=!0;i.set(e,t),i.set(t,e);for(var w=o;++f<c;){m=l[f];var v=e[m],x=t[m];if(r)var C=o?r(x,v,m,t,e,i):r(v,x,m,e,t,i);if(!(C===void 0?v===x||a(v,x,n,r,i):C)){y=!1;break}w||(w=m=="constructor")}if(y&&!w){var j=e.constructor,b=t.constructor;j!=b&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof b=="function"&&b instanceof b)&&(y=!1)}return i.delete(e),i.delete(t),y}var hC=1,zl="[object Arguments]",Bl="[object Array]",ss="[object Object]",gC=Object.prototype,Vl=gC.hasOwnProperty;function pC(e,t,n,r,a,i){var o=xn(e),l=xn(t),c=o?Bl:Ft(e),h=l?Bl:Ft(t);c=c==zl?ss:c,h=h==zl?ss:h;var g=c==ss,f=h==ss,m=c==h;if(m&&tr(e)){if(!tr(t))return!1;o=!0,g=!1}if(m&&!g)return i||(i=new Bt),o||Xs(e)?od(e,t,n,r,a,i):cC(e,t,c,n,r,a,i);if(!(n&hC)){var p=g&&Vl.call(e,"__wrapped__"),S=f&&Vl.call(t,"__wrapped__");if(p||S){var y=p?e.value():e,w=S?t.value():t;return i||(i=new Bt),a(y,w,n,r,i)}}return m?(i||(i=new Bt),mC(e,t,n,r,a,i)):!1}function ld(e,t,n,r,a){return e===t?!0:e==null||t==null||!Jt(e)&&!Jt(t)?e!==e&&t!==t:pC(e,t,n,r,ld,a)}function yC(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),l=o.length;l--;){var c=o[++a];if(n(i[c],c,i)===!1)break}return t}}var xC=yC();function xi(e,t,n){(n!==void 0&&!zr(e[t],n)||n===void 0&&!(t in e))&&eo(e,t,n)}function bC(e){return Jt(e)&&Br(e)}function bi(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function SC(e){return Hy(e,Ju(e))}function CC(e,t,n,r,a,i,o){var l=bi(e,n),c=bi(t,n),h=o.get(c);if(h){xi(e,n,h);return}var g=i?i(l,c,n+"",e,t,o):void 0,f=g===void 0;if(f){var m=xn(c),p=!m&&tr(c),S=!m&&!p&&Xs(c);g=c,m||p||S?xn(l)?g=l:bC(l)?g=Iy(l):p?(f=!1,g=td(c,!0)):S?(f=!1,g=nd(c,!0)):g=[]:gb(c)||Ps(c)?(g=l,Ps(l)?g=SC(l):(!$t(l)||Qi(l))&&(g=rd(c))):f=!1}f&&(o.set(c,g),a(g,c,r,i,o),o.delete(c)),xi(e,n,g)}function cd(e,t,n,r,a){e!==t&&xC(t,function(i,o){if(a||(a=new Bt),$t(i))CC(e,t,o,n,cd,r,a);else{var l=r?r(bi(e,o),i,o+"",e,t,a):void 0;l===void 0&&(l=i),xi(e,o,l)}},Ju)}var wC="[object Map]",jC="[object Set]",vC=Object.prototype,TC=vC.hasOwnProperty;function FC(e){if(e==null)return!0;if(Br(e)&&(xn(e)||typeof e=="string"||typeof e.splice=="function"||tr(e)||Xs(e)||Ps(e)))return!e.length;var t=Ft(e);if(t==wC||t==jC)return!e.size;if(Js(e))return!Zu(e).length;for(var n in e)if(TC.call(e,n))return!1;return!0}function Aa(e,t){return ld(e,t)}var _s=qy(function(e,t,n){cd(e,t,n)});function $C(e){return typeof e!="object"?!1:e===null?!0:!(d.isValidElement(e)||e.constructor===RegExp||e instanceof Map||e instanceof Set||e instanceof HTMLElement||e instanceof Blob||e instanceof File||Array.isArray(e))}function RC(e){return e.split(".").map(t=>/^\d+$/.test(t)?parseInt(t,10):t)}function EC(e){const t={};for(const n in e){const r=e[n];Et(r)||(t[n]=r)}return t}function IC(e){const t={},n={};for(const r in e){const a=e[r];Et(a)||(r.includes(".")?t[r]=a:n[r]=a)}return{dotPathTransforms:t,objectTransforms:n}}function MC(e,t){for(const n in t){const r=t[n];if(typeof r!="function")continue;const a=RC(n),i=Oe(e,a);if(i===void 0)continue;const o=r(i,a.map(String),e);if(typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=a.slice(0,-1),c=l.length>0?Oe(e,l):e;if(c&&typeof c=="object"){const h=a[a.length-1];delete c[h],Object.assign(c,o)}}else{let l=e;for(let c=0;c<a.length-1;c++){const h=a[c];if(l[h]===void 0){const g=a[c+1];l[h]=typeof g=="number"?[]:{}}l=l[h]}l[a[a.length-1]]=o}}}function kC(e,t,n){let r=e;for(const a of t){const i=String(a);if(r&&typeof r[i]=="object")r=r[i];else{r=null;break}}if(r&&typeof r[n]=="function")return r[n]}function AC(e){return e.some(t=>!isNaN(Number(t)))}function Si(e,t,n,r,a){if(e!=null&&typeof e=="object"){if(a.has(e))return e;a.add(e)}const i=Array.isArray(e);let o=i?[]:{};if(e==null||e===void 0)return o;const l=i?e.map((c,h)=>h.toString()):Object.keys(e);for(const c of l){const h=t?[...t,c]:[c],g=e[c];let f=n[c];if(!f&&t&&(f=kC(n,t,c)),f&&typeof f=="function"){const m=f(g,c,e);typeof m=="object"&&m!==null&&!Array.isArray(m)?(t?AC(t):!1)?Object.assign(o,m):r.push(m):o[c]=m}else if($C(g)&&!Et(g)){const m=n[c];if(m&&typeof m=="object"){const p=Si(g,h,m,r,a);Object.keys(p).length>0&&(o[c]=p)}else{const p=Si(g,h,n,r,a);o[c]=p}}else Et(g)||(o[c]=g)}return o}const OC=(e,t)=>{const n=EC(t);if(Object.keys(n).length<1||typeof window>"u"||typeof e!="object"||Et(e)||e instanceof Blob)return e;let r=zS(e);const{dotPathTransforms:a,objectTransforms:i}=IC(t);MC(r,a);const o=[];Object.keys(i).length>0&&(r=Si(r,void 0,i,o,new Set));for(const l of o)Object.assign(r,l);return r},DC=(e,t,n)=>{const r=d.useRef({});function a(i){var l;function o(c,h){c.forEach((g,f)=>{const m=n(g,f);h.set(m,g),g&&typeof g=="object"&&t in g&&o(g[t]||[],h)})}if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){const c=new Map;o(e,c),r.current={data:e,childrenColumnName:t,kvMap:c,getRowKey:n}}return(l=r.current.kvMap)==null?void 0:l.get(i)}return[a]},{noteOnce:PC}=Ge,Hl=e=>u.message.warning(e),Je=e=>Array.isArray(e)?e.join(","):e,ro=(...e)=>e.flat(1).filter(t=>t!=null).map(t=>typeof t=="number"?t.toString():t);function ud(e,t,n,r,a){const i=new Map;return e.forEach((o,l)=>{const c=(a||0)*10+l,h=t(o,c).toString();if(o&&typeof o=="object"&&n in o){const m=o[n]||[];ud(m,t,n,h,c).forEach((S,y)=>i.set(y,S))}const f={...o,map_row_key:h,map_row_parentKey:r};delete f.children,r||delete f.map_row_parentKey,i.set(h,f)}),i}function NC(e,t,n){const r=new Map,a=[],i=o=>{e.forEach(l=>{var c;if(l.map_row_parentKey!=null&&!l.map_row_key){const{map_row_parentKey:h,...g}=l,f=String(h);r.has(f)||r.set(f,[]),o&&((c=r.get(f))==null||c.push(g))}})};return i(n==="top"),e.forEach(o=>{var l,c;if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:h,map_row_key:g,isNewRecord:f,...m}=o,p={...m,map_row_key:g},S=h!=null?String(h):null;if(!S)return;r.has(S)||r.set(S,[]),f&&n==="top"?(l=r.get(S))==null||l.unshift(p):(c=r.get(S))==null||c.push(p)}}),e.forEach(o=>{if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:l,map_row_key:c}=o,h=l!=null?String(l):null;if(!h)return;const g=r.get(h);if(g&&g.length>0){const f=g.findIndex(m=>{const p=m.map_row_key||m.id;return String(p)===String(c)});f>=0&&r.has(c)&&(g[f]={...g[f],[t]:r.get(c)})}}}),i(n==="update"),e.forEach(o=>{if(!o.map_row_parentKey){const{map_row_key:l,...c}=o,h=l&&r.has(l)?{...c,[t]:r.get(l)}:c;a.push(h)}}),a}function Cr(e,t){var c;const{getRowKey:n,row:r,data:a,childrenColumnName:i="children"}=e,o=(c=Je(e.key))==null?void 0:c.toString(),l=ud(a,n,i);if(t==="delete")l.delete(o);else if(t==="top"||t==="update"){const h=l.get(o);h?l.set(o,{...h,...r}):l.set(o,{...r,map_row_key:o,map_row_parentKey:r.map_row_parentKey,isNewRecord:!0})}return NC(l,i,t)}function LC({recordKey:e,onSave:t,row:n,children:r,newLineConfig:a,editorType:i,tableName:o},l){const c=d.useContext(_r),h=u.Form.useFormInstance(),[g,f]=d.useState(!1),m=we(async()=>{try{const p=i==="Map",S=ro(o,Array.isArray(e)?e[0]:e);f(!0);try{await h.validateFields(S,{recursive:!0})}catch(x){throw f(!1),x}const y=(()=>{var j;const x=(j=c==null?void 0:c.getFieldFormatValueObject)==null?void 0:j.call(c,S);return(x!=null?Oe(x,S):null)??h.getFieldValue(S)})();if(Array.isArray(e)&&e.length>1){const[,...x]=e,C=Oe(y,x);Ue(y,x,C)}const w=p?Ue({},S,y):y,v=await(t==null?void 0:t(e,Nu({},n,w),n,a));return f(!1),v}catch(p){throw f(!1),p}});return d.useImperativeHandle(l,()=>({save:m}),[m]),s.jsxs("a",{onClick:async p=>{p.stopPropagation(),p.preventDefault();try{await m()}catch{}},children:[g?s.jsx(me.LoadingOutlined,{style:{marginInlineEnd:8}}):null,r||"保存"]},"save")}const _C=({recordKey:e,onDelete:t,preEditRowRef:n,preEditRowRefs:r,row:a,children:i,deletePopconfirmMessage:o})=>{const[l,c]=d.useState(!1),h=we(async()=>{var g,f;try{c(!0);const m=await(t==null?void 0:t(e,a));return c(!1),m===!1?!1:m}catch{return c(!1),null}finally{const m=(g=Je(e))==null?void 0:g.toString();m&&((f=r==null?void 0:r.current)==null||f.delete(m)),n&&(n.current=null)}});return i!==!1?s.jsx(u.Popconfirm,{title:o||"确定要删除这条记录吗?",onConfirm:h,getPopupContainer:g=>g.parentElement||document.body,children:s.jsxs("a",{children:[l?s.jsx(me.LoadingOutlined,{style:{marginInlineEnd:8}}):null,i||"删除"]})},"delete"):null},zC=e=>{const{recordKey:t,tableName:n,newLineConfig:r,editorType:a,onCancel:i,cancelEditable:o,row:l,cancelText:c,preEditRowRef:h,preEditRowRefs:g}=e,f=d.useContext(_r),m=u.Form.useFormInstance();return s.jsx("a",{onClick:async p=>{var F,E,M,k;p.stopPropagation(),p.preventDefault();const S=a==="Map",y=(F=Je(t))==null?void 0:F.toString(),w=ro(n,t),v=(()=>{var A;const V=(A=f==null?void 0:f.getFieldFormatValueObject)==null?void 0:A.call(f,w);return(V!=null?Oe(V,w):null)??(m==null?void 0:m.getFieldValue(w))})(),x=S?Ue({},w,v):v,C=y!=null?(E=g==null?void 0:g.current)==null?void 0:E.get(y):void 0,j=(()=>{var I,R,D;const V=(I=r==null?void 0:r.options)==null?void 0:I.recordKey;if(V==null||t==null)return!1;const z=(R=Je(V))==null?void 0:R.toString(),A=(D=Je(t))==null?void 0:D.toString();return!z||!A?!1:z===A})(),b=await(i==null?void 0:i(t,x,l,r));await o(t);const T=C??(h==null?void 0:h.current)??l;return C===null||C===void 0&&(h==null?void 0:h.current)===null&&j?await((M=e.onDelete)==null?void 0:M.call(e,t,l)):T!=null&&m.setFieldsValue(Ue({},w,T)),y&&((k=g==null?void 0:g.current)==null||k.delete(y)),h&&(h.current=null),b},children:c||"取消"},"cancel")};function BC(e,t){const{recordKey:n,newLineConfig:r,saveText:a,deleteText:i}=t,o=d.forwardRef(LC),l=d.createRef();return{save:s.jsx(o,{...t,row:e,ref:l,children:a},"save"+n),saveRef:l,delete:(r==null?void 0:r.options.recordKey)!==n?s.jsx(_C,{...t,row:e,children:i},"delete"+n):void 0,cancel:s.jsx(zC,{...t,row:e},"cancel"+n)}}function VC(e){const t=Ie(),n=d.useRef(null),r=d.useRef(new Map),[a,i]=d.useState(void 0),o=we(()=>{const P=new Map,U=(X,ne)=>{X==null||X.forEach((Z,re)=>{const ie=ne==null?re.toString():`${ne}_${re}`,se=Je(e.getRowKey(Z,-1));if(se==null)return;P.set(ie,se),P.set(se.toString(),ie);const pe=e.childrenColumnName&&(Z==null?void 0:Z[e.childrenColumnName]);pe&&U(pe,ie)})};return U(e.dataSource),P}),l=d.useMemo(()=>o(),[]),c=d.useRef(l),h=d.useRef(void 0);Pu(()=>{c.current=o()},[e.dataSource]),h.current=a;const g=e.type||"single",[f]=DC(e.dataSource,"children",e.getRowKey),[m,p]=rt([],e.editableKeys),S=d.useCallback(P=>{p(U=>{var ne;const X=typeof P=="function"?P(U):P;return(ne=e==null?void 0:e.onChange)==null||ne.call(e,(X==null?void 0:X.filter(Z=>Z!==void 0))??[],(X==null?void 0:X.map(Z=>f(Z)).filter(Z=>Z!==void 0))??[]),X})},[e.onChange,f]),y=$r(m),w=we((P,U)=>U.includes(P)),v=we(P=>{var ie,se;const U=(ie=e.getRowKey(P,P.index))==null?void 0:ie.toString(),X=(se=e.getRowKey(P,-1))==null?void 0:se.toString(),ne=(m==null?void 0:m.map(pe=>pe==null?void 0:pe.toString()))||[],Z=(y==null?void 0:y.map(pe=>pe==null?void 0:pe.toString()))||[],re=w(X,Z)||w(U,Z);return{recordKey:X,isEditable:w(X,ne)||w(U,ne),preIsEditable:re}}),x=we(()=>m&&m.length>0&&g==="single"&&e.onlyOneLineEditorAlertMessage!==!1?(Hl(e.onlyOneLineEditorAlertMessage||t.getMessage("editableTable.onlyOneLineEditor","只能同时编辑一行")),!1):!0),C=we(P=>{var U;return((U=e.dataSource)==null?void 0:U.find((X,ne)=>e.getRowKey(X,ne)===P))??null}),j=we((P,U)=>{var Z;if(!x())return!1;if(!(m==null?void 0:m.some(re=>re===P||(re==null?void 0:re.toString())===(P==null?void 0:P.toString())))){const re=m?[...m,P]:[P];S(re)}n.current=U??C(P)??null;const ne=(Z=Je(P))==null?void 0:Z.toString();return ne&&r.current.set(ne,n.current),!0}),b=we(P=>{const U=Je(P),X=U!=null?U.toString():null;if(X==null)return;const ne=(m==null?void 0:m.filter(Z=>(Z==null?void 0:Z.toString())!==X&&Z!==U))??[];S(ne)}),T=we(async(P,U)=>{var se,pe,ge,fe;const X=Je(P),ne=X!=null?X.toString():null,Z=ne!=null?c.current.get(ne):void 0,re=m==null?void 0:m.some(J=>ne==null?!1:(J==null?void 0:J.toString())===ne||J===X);if(!re&&Z&&(U??!0)&&e.tableName)return await T(Z,!1);if(e.onCancel&&re){const J=Array.isArray(P)?P[0]:P,K=C(J),te=n.current,oe=(se=a==null?void 0:a.options)==null?void 0:se.recordKey,xe=oe!=null?Je(oe):null,ae=xe!=null?xe.toString():null,ee=a!=null&&oe!=null&&(oe===P||ae!=null&&ne!=null&&ae===ne||(oe==null?void 0:oe.toString())===(P==null?void 0:P.toString())||String(oe)===String(P))?a:void 0;try{await e.onCancel(P,K||(ee==null?void 0:ee.defaultValue)||{},te||K||(ee==null?void 0:ee.defaultValue)||{},ee)}catch(de){console.error("onCancel error:",de)}}if(a){const J=a.options.recordKey,K=J!=null?(pe=Je(J))==null?void 0:pe.toString():null;(J===P||K!=null&&ne!=null&&K===ne||(J==null?void 0:J.toString())===(P==null?void 0:P.toString())||String(J)===String(P))&&i(void 0)}const ie=n.current;if(ie&&e.getRowKey(ie,-1)===P&&re){try{const J=(ge=e.formProps)==null?void 0:ge.formRef,K=(J==null?void 0:J.current)||e.form;if(K)if(e.tableName){const te=ro(e.tableName,P);K.setFieldsValue(Ue({},te,ie))}else{const te=(fe=Je(P))==null?void 0:fe.toString();if(te)try{K.resetFields([[te]]),K.setFieldsValue({[te]:void 0})}catch(oe){console.warn("Failed to clear form fields in cancelEditable:",oe)}}}catch(J){console.warn("Failed to reset form fields in cancelEditable:",J)}n.current=null}return b(P),!0}),$=Gi(async(...P)=>{var U;(U=e.onValuesChange)==null||U.call(e,...P)},64),F=we(P=>[e.tableName||"",P].flat(1).filter(U=>U||U===0)),E=we((P,U)=>{let X=P;return m==null||m.forEach(ne=>{if((a==null?void 0:a.options.recordKey)===ne)return;const Z=ne.toString(),re=F(Z),ie=Oe(U,re);ie&&(X=Cr({data:X,getRowKey:e.getRowKey,row:ie,key:Z,childrenColumnName:e.childrenColumnName||"children"},"update"))}),X}),M=we((P,U,X)=>{var pe;const ne=Object.keys(P||{});if(ne.length===0)return(a==null?void 0:a.defaultValue)||{};const Z=((pe=ne.pop())==null?void 0:pe.toString())||"";if(!Z)return(a==null?void 0:a.defaultValue)||{};const re=F(Z),ie={...a==null?void 0:a.defaultValue,...Oe(U,re)};return c.current.has(Je(Z))&&X.find((fe,J)=>{var te;return((te=e.getRowKey(fe,J))==null?void 0:te.toString())===Z})||ie}),k=we((P,U)=>{if(!e.onValuesChange)return;const X=E(e.dataSource,U),ne=M(P,U,X);$.run(ne,X)}),V=d.useRef(new Map);d.useEffect(()=>{const P=new Set((m==null?void 0:m.map(U=>U==null?void 0:U.toString()))??[]);V.current.forEach((U,X)=>{P.has(X==null?void 0:X.toString())||V.current.delete(X)})},[m]);const z=we(P=>{const U=Je(P);return V.current.get(U)||V.current.get(U.toString())}),A=we(async(P,U)=>{const X=Je(P),ne=X.toString(),Z=c.current.get(ne);if(!(m==null?void 0:m.some(se=>(se==null?void 0:se.toString())===ne||se===X))&&Z&&(U??!0)&&e.tableName)return await A(Z,!1);const ie=z(P);return ie!=null&&ie.current?(await ie.current.save(),b(P),!0):!1}),I=we(P=>P!=null&&P.parentKey&&!c.current.has(Je(P==null?void 0:P.parentKey).toString())?(console.warn("can't find record by key",P==null?void 0:P.parentKey),!1):h.current&&e.onlyAddOneLineAlertMessage!==!1?(Hl(e.onlyAddOneLineAlertMessage||t.getMessage("editableTable.onlyAddOneLine","只能新增一行")),!1):!!x()),R=we(P=>{if(P==null&&P!==0&&P!=="")throw PC(!1,`请设置 recordCreatorProps.record 并返回一个唯一的key
55
- https://procomponents.ant.design/components/editable-table#editable-%E6%96%B0%E5%BB%BA%E8%A1%8C`),new Error("请设置 recordCreatorProps.record 并返回一个唯一的key")}),D=we((P,U)=>{var se,pe;if(!I(U))return!1;const X=e.getRowKey(P,-1);R(X);const ne=(se=Je(X))==null?void 0:se.toString();if(ne&&r.current.set(ne,null),!(m==null?void 0:m.some(ge=>ge===X||(ge==null?void 0:ge.toString())===(X==null?void 0:X.toString())))){const ge=m?[...m,X]:[X];S(ge)}const re=typeof(U==null?void 0:U.parentKey)=="function"?U.parentKey():U==null?void 0:U.parentKey;if((U==null?void 0:U.newRecordType)==="dataSource"||e.tableName&&(U==null?void 0:U.newRecordType)!=="cache"){const ge={data:e.dataSource,getRowKey:e.getRowKey,row:{...P,map_row_parentKey:re?(pe=Je(re))==null?void 0:pe.toString():void 0},key:X,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Cr(ge,(U==null?void 0:U.position)==="top"?"top":"update"))}else i({defaultValue:P,options:{...U,parentKey:re,recordKey:X}});return!0}),O=(e==null?void 0:e.saveText)||t.getMessage("editableTable.action.save","保存"),N=(e==null?void 0:e.deleteText)||t.getMessage("editableTable.action.delete","删除"),q=(e==null?void 0:e.cancelText)||t.getMessage("editableTable.action.cancel","取消"),L=we(async(P,U,X,ne)=>{var pe,ge,fe;const Z=await((pe=e==null?void 0:e.onSave)==null?void 0:pe.call(e,P,U,X,ne));if(Z===!1)return Z;const{options:re}=ne||h.current||{};if(!(re!=null&&re.parentKey)&&(re==null?void 0:re.recordKey)===P)(re==null?void 0:re.position)==="top"?e.setDataSource([U,...e.dataSource]):e.setDataSource([...e.dataSource,U]);else{const J={data:e.dataSource,getRowKey:e.getRowKey,row:re?{...U,map_row_parentKey:(ge=Je((re==null?void 0:re.parentKey)??""))==null?void 0:ge.toString()}:U,key:P,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Cr(J,(re==null?void 0:re.position)==="top"?"top":"update"))}await T(P);const se=(fe=Je(P))==null?void 0:fe.toString();return se&&r.current.delete(se),Z}),H=we(async(P,U)=>{var re,ie;const X={data:e.dataSource,getRowKey:e.getRowKey,row:U,key:P,childrenColumnName:e.childrenColumnName||"children"},ne=await((re=e==null?void 0:e.onDelete)==null?void 0:re.call(e,P,U));if(ne===!1)return!1;await T(P,!1),e.setDataSource(Cr(X,"delete"));const Z=(ie=Je(P))==null?void 0:ie.toString();return Z&&r.current.delete(Z),ne}),G=we(async(P,U,X,ne)=>{var re;return await((re=e==null?void 0:e.onCancel)==null?void 0:re.call(e,P,U,X,ne))}),W=e.actionRender&&typeof e.actionRender=="function",B=W?e.actionRender:()=>{},_=we(B);return{editableKeys:m,setEditableRowKeys:S,isEditable:v,actionRender:P=>{const U=e.getRowKey(P,P.index),X={saveText:O,cancelText:q,deleteText:N,addEditRecord:D,recordKey:U,cancelEditable:T,index:P.index,tableName:e.tableName,newLineConfig:a,onCancel:G,onDelete:H,onSave:L,editableKeys:m,setEditableRowKeys:S,preEditRowRef:n,preEditRowRefs:r,deletePopconfirmMessage:e.deletePopconfirmMessage||`${t.getMessage("deleteThisLine","删除此项")}?`},ne=BC(P,X);return e.tableName?V.current.set(c.current.get(Je(U))||Je(U),ne.saveRef):V.current.set(Je(U),ne.saveRef),W?_(P,X,{save:ne.save,delete:ne.delete,cancel:ne.cancel}):[ne.save,ne.delete,ne.cancel]},startEditable:j,cancelEditable:T,addEditRecord:D,saveEditable:A,newLineRecord:a,preEditableKeys:y,onValuesChange:k,getRealIndex:e.getRealIndex}}const HC=new xu("card-loading",{"0%":{backgroundPosition:"0 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),YC=e=>({[e.componentCls]:{boxSizing:"border-box","&-loading":{overflow:"hidden"},"&-loading &-body":{userSelect:"none"},[`${e.componentCls}-loading-content`]:{width:"100%",p:{marginBlock:0,marginInline:0}},[`${e.componentCls}-loading-block`]:{height:"14px",marginBlock:"4px",background:"linear-gradient(90deg, rgba(54, 61, 64, 0.2), rgba(54, 61, 64, 0.4), rgba(54, 61, 64, 0.2))",backgroundSize:"600% 600%",borderRadius:e.borderRadius,animationName:HC,animationDuration:"1.4s",animationTimingFunction:"ease",animationIterationCount:"infinite"}}});function UC(e){return We("ProCardLoading",t=>{const n={...t,componentCls:`.${e}`};return[YC(n)]})}const KC=e=>{const{style:t,prefix:n}=e,{wrapSSR:r}=UC(n||"ant-pro-card");return r(s.jsxs("div",{className:`${n}-loading-content`,style:t,children:[s.jsx(u.Row,{gutter:8,children:s.jsx(u.Col,{span:22,children:s.jsx("div",{className:`${n}-loading-block`})})}),s.jsxs(u.Row,{gutter:8,children:[s.jsx(u.Col,{span:8,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(u.Col,{span:15,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(u.Row,{gutter:8,children:[s.jsx(u.Col,{span:6,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(u.Col,{span:18,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(u.Row,{gutter:8,children:[s.jsx(u.Col,{span:13,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(u.Col,{span:9,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(u.Row,{gutter:8,children:[s.jsx(u.Col,{span:4,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(u.Col,{span:3,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(u.Col,{span:16,children:s.jsx("div",{className:`${n}-loading-block`})})]})]}))},Yl=e=>({backgroundColor:e.controlItemBgActive,borderColor:e.controlOutline}),WC=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"flex",flexDirection:"column",boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},width:"100%",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,backgroundColor:e.colorBgContainer,borderRadius:e.borderRadius,transition:"all 0.3s",...Ra==null?void 0:Ra(e),"&-box-shadow":{boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017",borderColor:"transparent"},"&-col":{width:"100%"},[` ${t}-col${t}-split-vertical`]:{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[` ${t}-col${t}-split-horizontal`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-divider`]:{flex:"none",alignSelf:"stretch",width:e.lineWidth,marginInline:e.marginXS,marginBlock:e.marginLG,backgroundColor:e.colorSplit,[`&${t}-divider-horizontal`]:{width:"auto",alignSelf:"auto",height:e.lineWidth,marginInline:e.marginLG,marginBlock:e.marginXS}},"&-border":{border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-hoverable":{cursor:"pointer",transition:"box-shadow 0.3s, border-color 0.3s","&:hover":{borderColor:"transparent",boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017"},[`&${t}-checked:hover`]:{borderColor:e.controlOutline}},"&-checked":{...Yl(e),"&::after":{visibility:"visible",position:"absolute",insetBlockStart:2,insetInlineEnd:2,opacity:1,width:0,height:0,border:`6px solid ${e.colorPrimary}`,borderBlockEnd:"6px solid transparent",borderInlineStart:"6px solid transparent",borderStartEndRadius:2,content:'""'}},"&:focus":{...Yl(e)},"&&-ghost":{backgroundColor:"transparent",[`> ${t}`]:{"&-header":{paddingInlineEnd:0,paddingBlockEnd:e.padding,paddingInlineStart:0},"&-body":{paddingBlock:0,paddingInline:0,backgroundColor:"transparent"}}},"&&-split > &-body":{paddingBlock:0,paddingInline:0},"&&-contain-card > &-body":{display:"flex"},[`${t}-body-direction-column`]:{flexDirection:"column"},[`${t}-body-wrap`]:{flexWrap:"wrap"},"&&-collapse":{[`> ${t}`]:{"&-header":{paddingBlockEnd:e.padding,borderBlockEnd:0},"&-body":{display:"none"}}},[`${t}-header`]:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:e.paddingLG,paddingBlock:e.padding,paddingBlockEnd:0,"&-border":{"&":{paddingBlockEnd:e.padding},borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-collapsible":{cursor:"pointer"}},[`${t}-title`]:{color:e.colorText,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeight},[`${t}-extra`]:{color:e.colorText},[`${t}-type-inner`]:{[`${t}-header`]:{backgroundColor:e.colorFillAlter}},[`${t}-collapsible-icon`]:{marginInlineEnd:e.marginXS,color:e.colorIconHover,":hover":{color:e.colorPrimaryHover},"& svg":{transition:`transform ${e.motionDurationMid}`}},[`${t}-cover`]:{overflow:"hidden",borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`,"& > *":{width:"100%",display:"block"},"& img":{verticalAlign:"middle"}},[`${t}-body`]:{display:"block",boxSizing:"border-box",height:"100%",paddingInline:e.paddingLG,paddingBlock:e.padding,"&-center":{display:"flex",alignItems:"center",justifyContent:"center"}},"&&-size-small":{[t]:{"&-header":{paddingInline:e.paddingSM,paddingBlock:e.paddingXS,paddingBlockEnd:0,"&-border":{paddingBlockEnd:e.paddingXS}},"&-title":{fontSize:e.fontSize},"&-body":{paddingInline:e.paddingSM,paddingBlock:e.paddingSM}},[` ${t}-divider`]:{marginBlock:e.marginLG,marginInline:e.marginXS,[`&${t}-divider-horizontal`]:{marginBlock:e.marginXS,marginInline:e.marginLG}},[`${t}-header${t}-header-collapsible`]:{paddingBlock:e.paddingXS}}},[`${t}-tabs`]:{[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:e.marginXS,paddingInlineStart:e.padding}},[`${e.antCls}-tabs-bottom > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingInlineStart:e.padding}},[`${e.antCls}-tabs-left`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-left > ${e.antCls}-tabs-nav`]:{marginInlineEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}},[`${e.antCls}-tabs-right`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-right > ${e.antCls}-tabs-nav`]:{[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}}}}},dd=24,qC=(e,t)=>{const{componentCls:n}=t;return e===0?{[`${n}-col-0`]:{display:"none"}}:{[`${n}-col-${e}`]:{flexShrink:0,width:`${e/dd*100}%`}}},GC=e=>Array(dd+1).fill(1).map((t,n)=>qC(n,e));function ZC(e){return We("ProCard",t=>{const n={...t,componentCls:`.${e}`};return[WC(n),GC(n)]})}const{useBreakpoint:JC}=u.Grid,fd=d.forwardRef((e,t)=>{var Qe;const{className:n,rootClassName:r,style:a,styles:i,title:o,subTitle:l,extra:c,wrap:h=!1,layout:g,loading:f,gutter:m=0,tooltip:p,split:S,headerBordered:y=!1,variant:w,cover:v,classNames:x,boxShadow:C=!1,children:j,size:b,actions:T,ghost:$=!1,hoverable:F=!1,direction:E,collapsed:M,collapsible:k=!1,collapsibleIconRender:V,colStyle:z,defaultCollapsed:A=!1,onCollapse:I,checked:R,onChecked:D,tabs:O,type:N,...q}=e,L=w??"outlined",H={header:i==null?void 0:i.header,body:i==null?void 0:i.body,root:i==null?void 0:i.root,extra:i==null?void 0:i.extra,title:i==null?void 0:i.title,actions:i==null?void 0:i.actions,cover:i==null?void 0:i.cover},{getPrefixCls:G}=d.useContext(u.ConfigProvider.ConfigContext),W=JC()||{lg:!0,md:!0,sm:!0,xl:!1,xs:!1,xxl:!1},[B,_]=rt(A,M),Y=we(ve=>{I==null||I(ve)}),P=d.useCallback(ve=>{_($e=>{const ut=typeof ve=="function"?ve($e):ve;return queueMicrotask(()=>{Y(ut)}),ut})},[Y]),U=["xxl","xl","lg","md","sm","xs"],X=O==null?void 0:O.items,ne=ve=>{const $e=[0,0];return(Array.isArray(ve)?ve:[ve,0]).forEach((Q,le)=>{if(typeof Q=="object")for(let Se=0;Se<U.length;Se+=1){const Le=U[Se];if(W[Le]&&Q[Le]!==void 0){$e[le]=Q[Le];break}}else $e[le]=Q||0}),$e},Z=(ve,$e)=>ve?$e:{},re=ve=>{let $e=ve;if(typeof ve=="object")for(let Q=0;Q<U.length;Q+=1){const le=U[Q];if(W!=null&&W[le]&&(ve==null?void 0:ve[le])!==void 0){$e=ve[le];break}}const ut=Z(typeof $e=="string"&&/\d%|\dpx/i.test($e),{width:$e,flexShrink:0});return{span:$e,colSpanStyle:ut}},ie=G("pro-card"),{wrapSSR:se,hashId:pe}=ZC(ie),[ge,fe]=ne(m);let J=!1;const K=d.Children.toArray(j),te=K.map((ve,$e)=>{var ut;if((ut=ve==null?void 0:ve.type)!=null&&ut.isProCard){J=!0;const{colSpan:Q}=ve.props,{span:le,colSpanStyle:Se}=re(Q),Le=ce([`${ie}-col`],pe,{[`${ie}-split-vertical`]:S==="vertical"&&$e!==K.length-1,[`${ie}-split-horizontal`]:S==="horizontal"&&$e!==K.length-1,[`${ie}-col-${le}`]:typeof le=="number"&&le>=0&&le<=24}),Ye=se(s.jsx("div",{style:{...Se,...Z(ge>0,{paddingInlineEnd:ge/2,paddingInlineStart:ge/2}),...Z(fe>0,{paddingBlockStart:fe/2,paddingBlockEnd:fe/2}),...z},className:Le,children:d.cloneElement(ve)}));return d.cloneElement(Ye,{key:`pro-card-col-${(ve==null?void 0:ve.key)||$e}`})}return ve}),oe=ce(`${ie}`,n,r,pe,x==null?void 0:x.root,{[`${ie}-border`]:L==="outlined",[`${ie}-box-shadow`]:C,[`${ie}-contain-card`]:J,[`${ie}-loading`]:f,[`${ie}-split`]:S==="vertical"||S==="horizontal",[`${ie}-ghost`]:$,[`${ie}-hoverable`]:F,[`${ie}-size-${b}`]:b,[`${ie}-type-${N}`]:N,[`${ie}-collapse`]:B,[`${ie}-checked`]:R}),xe=ce(`${ie}-body`,pe,x==null?void 0:x.body,{[`${ie}-body-center`]:g==="center",[`${ie}-body-direction-column`]:S==="horizontal"||E==="column",[`${ie}-body-wrap`]:h&&J}),ae=(Qe=H.body)==null?void 0:Qe.padding,ee=d.isValidElement(f)?f:s.jsx(KC,{prefix:ie,style:ae===0||ae==="0px"?{padding:24}:void 0}),de=d.useCallback(()=>{k==="icon"&&P(ve=>!ve)},[k,P]),he=k&&(V?s.jsx("span",{role:"button",tabIndex:k==="icon"?0:void 0,className:ce(`${ie}-collapsible-icon`,pe),onClick:k==="icon"?de:void 0,onKeyDown:k==="icon"?ve=>{(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),de())}:void 0,children:V({collapsed:B})}):s.jsx(me.RightOutlined,{onClick:de,rotate:B?void 0:90,className:ce(`${ie}-collapsible-icon`,pe)})),je=ce(`${ie}-header`,pe,x==null?void 0:x.header,{[`${ie}-header-border`]:y||N==="inner",[`${ie}-header-collapsible`]:he}),Ee=ce(`${ie}-title`,pe,x==null?void 0:x.title),ke=ce(`${ie}-extra`,pe,x==null?void 0:x.extra),He={...H.root,...a};return se(s.jsxs("div",{className:oe,style:He,ref:t,onClick:ve=>{var $e;D==null||D(ve),($e=q==null?void 0:q.onClick)==null||$e.call(q,ve)},...Ve(q,["prefixCls","colSpan"]),children:[(o||c||he)&&s.jsxs("div",{className:je,style:H.header,onClick:()=>{(k==="header"||k===!0)&&P(!B)},children:[s.jsxs("div",{className:Ee,style:H.title,children:[he,s.jsx(er,{label:o,tooltip:p,subTitle:l})]}),c&&s.jsx("div",{className:ke,style:H.extra,onClick:ve=>ve.stopPropagation(),children:c})]}),v&&!B&&s.jsx("div",{className:ce(`${ie}-cover`,pe,x==null?void 0:x.cover),style:H.cover,children:v}),O?s.jsx("div",{className:ce(`${ie}-tabs`,pe),children:s.jsx(u.Tabs,{onChange:O.onChange,...Ve(O,["cardProps"]),items:X,children:f?ee:j})}):s.jsx("div",{className:xe,style:H.body,children:f?ee:te}),T?s.jsx(sp,{actions:T,prefixCls:ie}):null]}))});function XC(e){return We("ProCardDivider",()=>({}))}const QC=e=>{const{getPrefixCls:t}=d.useContext(u.ConfigProvider.ConfigContext),r=`${t("pro-card")}-divider`,{wrapSSR:a,hashId:i}=XC(),{className:o,style:l={},orientation:c="vertical"}=e,h=ce(r,o,i,{[`${r}-${c}`]:c});return a(s.jsx("div",{className:h,style:l}))},ew=e=>{const{styles:t,...n}=e;return s.jsx(fd,{...n,styles:{...t,body:{...t==null?void 0:t.body,padding:0}}})},ta=fd;ta.isProCard=!0;ta.Divider=QC;ta.Group=ew;var vs={exports:{}},tw=vs.exports,Ul;function nw(){return Ul||(Ul=1,(function(e,t){(function(n,r){e.exports=r()})(tw,(function(){return function(n,r){var a=r.prototype,i=a.format;a.format=function(o){var l=this,c=this.$locale();if(!this.isValid())return i.bind(this)(o);var h=this.$utils(),g=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return c.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return c.ordinal(l.week(),"W");case"w":case"ww":return h.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return h.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return h.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return i.bind(this)(g)}}}))})(vs)),vs.exports}var rw=nw();const md=Ht(rw);var Ts={exports:{}},sw=Ts.exports,Kl;function aw(){return Kl||(Kl=1,(function(e,t){(function(n,r){e.exports=r()})(sw,(function(){var n="day";return function(r,a,i){var o=function(h){return h.add(4-h.isoWeekday(),n)},l=a.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(h){if(!this.$utils().u(h))return this.add(7*(h-this.isoWeek()),n);var g,f,m,p,S=o(this),y=(g=this.isoWeekYear(),f=this.$u,m=(f?i.utc:i)().year(g).startOf("year"),p=4-m.isoWeekday(),m.isoWeekday()>4&&(p+=7),m.add(p,n));return S.diff(y,"week")+1},l.isoWeekday=function(h){return this.$utils().u(h)?this.day()||7:this.day(this.day()%7?h:h-7)};var c=l.startOf;l.startOf=function(h,g){var f=this.$utils(),m=!!f.u(g)||g;return f.p(h)==="isoweek"?m?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(h,g)}}}))})(Ts)),Ts.exports}var iw=aw();const hd=Ht(iw);var Fs={exports:{}},ow=Fs.exports,Wl;function lw(){return Wl||(Wl=1,(function(e,t){(function(n,r){e.exports=r()})(ow,(function(){return function(n,r,a){var i=r.prototype,o=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,m,p,S,y){var w=f.name?f:f.$locale(),v=o(w[m]),x=o(w[p]),C=v||x.map((function(b){return b.slice(0,S)}));if(!y)return C;var j=w.weekStart;return C.map((function(b,T){return C[(T+(j||0))%7]}))},c=function(){return a.Ls[a.locale()]},h=function(f,m){return f.formats[m]||(function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,y,w){return y||w.slice(1)}))})(f.formats[m.toUpperCase()])},g=function(){var f=this;return{months:function(m){return m?m.format("MMMM"):l(f,"months")},monthsShort:function(m){return m?m.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(m){return m?m.format("dddd"):l(f,"weekdays")},weekdaysMin:function(m){return m?m.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(m){return m?m.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(m){return h(f.$locale(),m)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return g.bind(this)()},a.localeData=function(){var f=c();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(m){return h(f,m)},meridiem:f.meridiem,ordinal:f.ordinal}},a.months=function(){return l(c(),"months")},a.monthsShort=function(){return l(c(),"monthsShort","months",3)},a.weekdays=function(f){return l(c(),"weekdays",null,null,f)},a.weekdaysShort=function(f){return l(c(),"weekdaysShort","weekdays",3,f)},a.weekdaysMin=function(f){return l(c(),"weekdaysMin","weekdays",2,f)}}}))})(Fs)),Fs.exports}var cw=lw();const gd=Ht(cw);var $s={exports:{}},uw=$s.exports,ql;function dw(){return ql||(ql=1,(function(e,t){(function(n,r){e.exports=r()})(uw,(function(){return function(n,r){r.prototype.weekday=function(a){var i=this.$locale().weekStart||0,o=this.$W,l=(o<i?o+7:o)-i;return this.$utils().u(a)?l:this.subtract(l,"day").add(a,"day")}}}))})($s)),$s.exports}var fw=dw();const pd=Ht(fw);var Rs={exports:{}},mw=Rs.exports,Gl;function hw(){return Gl||(Gl=1,(function(e,t){(function(n,r){e.exports=r()})(mw,(function(){var n="week",r="year";return function(a,i,o){var l=i.prototype;l.week=function(c){if(c===void 0&&(c=null),c!==null)return this.add(7*(c-this.week()),"day");var h=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var g=o(this).startOf(r).add(1,r).date(h),f=o(this).endOf(n);if(g.isBefore(f))return 1}var m=o(this).startOf(r).date(h).startOf(n).subtract(1,"millisecond"),p=this.diff(m,n,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(Rs)),Rs.exports}var gw=hw();const so=Ht(gw),Zl=(e,t)=>typeof t!="object"?e[t]||t:e[t==null?void 0:t.value]||t.label,pw=(e,t)=>{const{label:n,prefixCls:r,onChange:a,value:i,mode:o,defaultValue:l,labelVariant:c,size:h,showSearch:g,disabled:f,style:m,className:p,options:S,onSearch:y,allowClear:w,labelInValue:v,fieldNames:x,lightLabel:C,labelTrigger:j,optionFilterProp:b,optionLabelProp:T="",valueMaxLength:$=41,fetchDataOnSearch:F=!1,fetchData:E,variant:M="outlined",...k}=e,{placeholder:V=n}=e,{label:z="label",value:A="value"}=x||{},{getPrefixCls:I}=d.useContext(u.ConfigProvider.ConfigContext),R=I("pro-field-select-light-select"),[D,O]=d.useState(!1),[N,q]=d.useState(""),{wrapSSR:L,hashId:H}=We("LightSelect",_=>({[`.${R}`]:{[`${_.antCls}-select`]:{position:"absolute",width:"153px",height:"28px",visibility:"hidden",opacity:0,"&-selector":{height:28}},[`&.${R}-searchable`]:{[`${_.antCls}-select`]:{width:"200px","&-selector":{height:28}}}}})),G=d.useMemo(()=>{const _={};return S==null||S.forEach(Y=>{const P=Y[T]||Y[z],U=Y[A];_[U]=P||U}),_},[z,S,A,T]),W=d.useMemo(()=>Reflect.has(k,"open")?k==null?void 0:k.open:D,[D,k]),B=Array.isArray(i)?i.map(_=>Zl(G,_)):Zl(G,i);return L(s.jsxs("div",{className:ce(R,H,{[`${R}-searchable`]:g},`${R}-container-${k.placement||"bottomLeft"}`,p),style:m,onClick:_=>{var P,U,X;if(f)return;((X=(U=(P=C==null?void 0:C.current)==null?void 0:P.labelRef)==null?void 0:U.current)==null?void 0:X.contains(_.target))||O(!0)},children:[s.jsx(u.Select,{...k,allowClear:w,value:i,mode:o,labelInValue:v,size:h,disabled:f,variant:M,onChange:(_,Y)=>{a==null||a(_,Y),o!=="multiple"&&O(!1)},showSearch:g,onSearch:g?_=>{F&&E&&E(_),y==null||y(_)}:void 0,style:m,popupRender:_=>s.jsxs("div",{ref:t,children:[g&&s.jsx("div",{style:{margin:"4px 8px"},children:s.jsx(u.Input,{value:N,allowClear:!!w,onChange:Y=>{q(Y.target.value),F&&E&&E(Y.target.value),y==null||y(Y.target.value)},onKeyDown:Y=>{if(Y.key==="Backspace"){Y.stopPropagation();return}(Y.key==="ArrowUp"||Y.key==="ArrowDown")&&Y.preventDefault()},style:{width:"100%"},prefix:s.jsx(me.SearchOutlined,{})})}),_]}),open:W,onOpenChange:_=>{var Y;_||q(""),j||O(_),(Y=k==null?void 0:k.onOpenChange)==null||Y.call(k,_)},prefixCls:r,options:y||!N?S:S==null?void 0:S.filter(_=>{var Y,P,U,X,ne;return b?pn(_[b]).join("").toLowerCase().includes(N):((P=(Y=String(_[z]))==null?void 0:Y.toLowerCase())==null?void 0:P.includes(N==null?void 0:N.toLowerCase()))||((ne=(X=(U=_[A])==null?void 0:U.toString())==null?void 0:X.toLowerCase())==null?void 0:ne.includes(N==null?void 0:N.toLowerCase()))})}),s.jsx(Ut,{ellipsis:!0,label:n,placeholder:V,disabled:f,variant:c,allowClear:!!w,value:B||(i==null?void 0:i.label)||i,onClear:()=>{a==null||a(void 0,void 0)},onClick:()=>{f||O(!D)},ref:C,valueMaxLength:$})]}))},yw=d.forwardRef(pw),xw=(e,t)=>{const{optionItemRender:n,mode:r,onSearch:a,onFocus:i,onChange:o,autoClearSearchValue:l=!0,searchOnFocus:c=!1,resetAfterSelect:h=!1,fetchDataOnSearch:g=!0,optionFilterProp:f="label",optionLabelProp:m="label",className:p,disabled:S,options:y,fetchData:w,resetData:v,prefixCls:x,onClear:C,searchValue:j,showSearch:b,fieldNames:T,defaultSearchValue:$,preserveOriginalLabel:F=!1,...E}=e,{label:M="label",value:k="value",options:V="options"}=T||{},[z,A]=rt($,j),I=d.useRef();d.useImperativeHandle(t,()=>I.current),d.useEffect(()=>{var H;E.autoFocus&&((H=I==null?void 0:I.current)==null||H.focus())},[E.autoFocus]);const{getPrefixCls:R}=d.useContext(u.ConfigProvider.ConfigContext),D=R("pro-filed-search-select",x),O=ce(D,p,{[`${D}-disabled`]:S}),N=(H,G)=>{if(H&&typeof H.label=="string"&&H.label)return H.label;if(H&&H.text&&typeof H.text=="string")return H.text;if(H&&H.label)return String(H.label);if(H&&H.text)return String(H.text);if(G&&G.label){const W=G.label;return(d.isValidElement(W)||W&&typeof W=="object"&&"props"in W)&&W.props&&W.props.label?String(W.props.label):typeof W=="string"?W:String(W)}return""},q=(H,G)=>Array.isArray(H)&&Array.isArray(G)&&H.length>0?H.map((W,B)=>{const _=G==null?void 0:G[B],Y=_==null?void 0:_["data-item"],P=N(Y,W);return{...Y||{},...W,label:P||W.label}}):[],L=H=>H.map((G,W)=>{const{className:B,optionType:_,...Y}=G,P=G[M]??G.text,U=G[k],X=G[V]??[];return _==="optGroup"||G.options?{label:P,...Y,data_title:P,title:P,key:U??`${P==null?void 0:P.toString()}-${W}-${Or()}`,children:L(X)}:{title:P,...Y,data_title:P,value:U??W,key:U??`${P==null?void 0:P.toString()}-${W}-${Or()}`,"data-item":G,className:`${D}-option ${B||""}`.trim(),label:(n==null?void 0:n(G))||P}});return s.jsx(u.Select,{ref:I,className:O,allowClear:!0,autoClearSearchValue:l,disabled:S,mode:r,showSearch:b,searchValue:z,optionFilterProp:f,optionLabelProp:m,onClear:()=>{C==null||C(),w(void 0),b&&(a==null||a(""),A(""))},...E,filterOption:E.filterOption==!1?!1:(H,G)=>{var B,_;const W=z===""?"":H||z;return W?E.filterOption&&typeof E.filterOption=="function"?E.filterOption(W,{...G,label:G==null?void 0:G.data_title}):!!((B=G==null?void 0:G.data_title)!=null&&B.toString().toLowerCase().includes(W.toLowerCase())||(_=G==null?void 0:G[f])!=null&&_.toString().toLowerCase().includes(W.toLowerCase())):!0},onSearch:b?H=>{g&&w(H),a==null||a(H),A(H)}:void 0,onChange:(H,G,...W)=>{if(b&&l&&(w(void 0),a==null||a(""),A("")),!e.labelInValue){o==null||o(H,G,...W);return}if(r!=="multiple"&&!Array.isArray(G)){let Y=G&&G["data-item"];if(!Y&&H&&y){const P=H[k]??H.value,U=X=>{for(const ne of X){if((ne[k]??ne.value)===P)return ne;if(ne[V]||ne.options){const re=U(ne[V]||ne.options||[]);if(re)return re}}return null};Y=U(y)}if(!H||!Y){const P=N(Y,H),U=H&&{...H,label:P};o==null||o(U,G,...W)}else{const P=N(Y,H);o==null||o({...H,...Y,label:P},G,...W)}return}const B=q(H,G);o==null||o(B,G,...W),h&&v()},onFocus:H=>{c&&(w(void 0),b&&(a==null||a(""),A(""))),i==null||i(H)},options:L(y||[])})},bw=d.forwardRef(xw),Sw=({label:e,words:t})=>{const{getPrefixCls:n}=d.useContext(u.ConfigProvider.ConfigContext),r=n("pro-select-item-option-content-light"),a=n("pro-select-item-option-content"),{wrapSSR:i}=We("Highlight",h=>({[`.${r}`]:{color:h.colorPrimary},[`.${a}`]:{flex:"auto",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})),o=new RegExp(t.map(h=>h.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")).join("|"),"gi");let l=e;const c=[];for(;l.length;){const h=o.exec(l);if(!h){c.push(l);break}const g=h.index,f=h[0].length+g;c.push(l.slice(0,g),d.createElement("span",{className:r},l.slice(g,f))),l=l.slice(f)}return i(d.createElement("div",{title:e,className:a},...c))};function Ci(e,t){var n,r;return!!(!t||(n=e==null?void 0:e.label)!=null&&n.toString().toLowerCase().includes(t.toLowerCase())||(r=e==null?void 0:e.value)!=null&&r.toString().toLowerCase().includes(t.toLowerCase())||(e.children||e.options)&&[...e.children||[],e.options||[]].find(i=>Ci(i,t)))}const yd=e=>{const t=[],n=Qt(e);return n.forEach((r,a)=>{const i=n.get(a)||n.get(`${a}`);if(i){if(typeof i=="object"&&(i!=null&&i.text)){t.push({text:i==null?void 0:i.text,value:a,label:i==null?void 0:i.text,disabled:i.disabled});return}t.push({text:i,value:a})}}),t},lr=e=>{var w,v;const{cacheForSwr:t,fieldProps:n}=e,[r,a]=d.useState(e.defaultKeyWords),[i]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():e.request?Or():"no-fetch"),o=d.useRef(i),l=we(x=>yd(Qt(x)).map(({value:C,text:j,...b})=>({label:j,value:C,key:C,...b}))),c=dt(()=>{if(!n)return;const x=(n==null?void 0:n.options)||(n==null?void 0:n.treeData);if(!x)return;const{children:C,label:j,value:b}=n.fieldNames||{},T=($,F)=>{if(!($!=null&&$.length))return;const E=$.length;let M=0;for(;M<E;){const k=$[M++];(k[C]||k[j]||k[b])&&(k[F]=k[F==="children"?C:F==="label"?j:b],T(k[C],F))}};return C&&T(x,"children"),j&&T(x,"label"),b&&T(x,"value"),x},[n]),[h,g]=rt(()=>e.valueEnum?l(e.valueEnum):[],c);qn(()=>{var x,C;!e.valueEnum||(x=e.fieldProps)!=null&&x.options||(C=e.fieldProps)!=null&&C.treeData||g(l(e.valueEnum))},[e.valueEnum]);const f=kp([o.current,e.params,r],e.debounceTime??((w=e==null?void 0:e.fieldProps)==null?void 0:w.debounceTime)??0,[e.params,r]),{data:m,mutate:p,isValidating:S}=Mu(()=>e.request?f:null,([,x,C])=>e.request({...x,keyWords:C},e),{revalidateIfStale:!t,revalidateOnReconnect:t,shouldRetryOnError:!1,revalidateOnFocus:!1}),y=d.useMemo(()=>{var C,j;const x=h==null?void 0:h.map(b=>{if(typeof b=="string")return{label:b,value:b};if(b.children||b.options){const T=[...b.children||[],...b.options||[]].filter($=>Ci($,r));return{...b,children:T,options:T}}return b});return((C=e.fieldProps)==null?void 0:C.filterOption)===!0||((j=e.fieldProps)==null?void 0:j.filterOption)===void 0?x==null?void 0:x.filter(b=>b?r?Ci(b,r):!0:!1):x},[h,r,(v=e.fieldProps)==null?void 0:v.filterOption]);return[S,e.request?m:y,x=>{a(x)},()=>{a(void 0),p([],!1)}]},Cw=(e,t)=>{var k,V;const{mode:n,valueEnum:r,render:a,formItemRender:i,request:o,fieldProps:l,light:c,proFieldKey:h,params:g,label:f,variant:m,id:p,lightLabel:S,labelTrigger:y,...w}=e,v=d.useRef(),x=Ie(),C=d.useRef(""),{fieldNames:j}=l;d.useEffect(()=>{C.current=l==null?void 0:l.searchValue},[l==null?void 0:l.searchValue]);const[b,T,$,F]=lr(e),{componentSize:E}=((V=(k=u.ConfigProvider)==null?void 0:k.useConfig)==null?void 0:V.call(k))||{componentSize:"middle"};d.useImperativeHandle(t,()=>({...v.current||{},fetchData:z=>$(z)}),[$]);const M=d.useMemo(()=>{if(n!=="read")return;const{label:z="label",value:A="value",options:I="options"}=j||{},R=new Map,D=O=>{if(!(O!=null&&O.length))return R;const N=O.length;let q=0;for(;q<N;){const L=O[q++];R.set(L[A],L[z]),D(L[I])}return R};return D(T)},[j,n,T]);if(n==="read"){const z=s.jsx(s.Fragment,{children:On(w.text,Qt(r||M))});return a?a(z,{mode:n,...l},z)??null:z}if(n==="edit"||n==="update"){const A=c?s.jsx(yw,{id:p,loading:b,ref:v,allowClear:!0,size:E,options:T,label:f,labelVariant:m,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),lightLabel:S,labelTrigger:y,fetchData:$,...l}):s.jsx(bw,{className:w.className,style:{minWidth:100,...w.style},id:p,loading:b,ref:v,allowClear:!0,defaultSearchValue:e.defaultKeyWords,notFoundContent:b?s.jsx(u.Spin,{size:"small"}):l==null?void 0:l.notFoundContent,fetchData:I=>{C.current=I??"",$(I),I===void 0&&(C.current="")},resetData:F,optionItemRender:I=>typeof I.label=="string"&&C.current?s.jsx(Sw,{label:I.label,words:[C.current]}):I.label,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),label:f,...l,options:T},"SearchSelect");return i?i(w.text,{mode:n,...l,options:T,loading:b},A)??null:A}return null},as=d.forwardRef(Cw),ww=({placeholder:e,formItemRender:t,mode:n,render:r,label:a,light:i,variant:o,...l},c)=>{var C;const{getPrefixCls:h}=d.useContext(u.ConfigProvider.ConfigContext),g=h("pro-field-cascader"),[f,m,p]=lr(l),S=Ie(),y=d.useRef(),[w,v]=d.useState(!1);d.useImperativeHandle(c,()=>({...y.current||{},fetchData:j=>p(j)}),[p]);const x=d.useMemo(()=>{var E;if(n!=="read")return;const{value:j="value",label:b="label",children:T="children"}=((E=l.fieldProps)==null?void 0:E.fieldNames)||{},$=new Map,F=M=>{if(!(M!=null&&M.length))return $;const k=M.length;let V=0;for(;V<k;){const z=M[V++];$.set(z[j],z[b]),F(z[T])}return $};return F(m)},[n,m,(C=l.fieldProps)==null?void 0:C.fieldNames]);if(n==="read"){const j=s.jsx(s.Fragment,{children:On(l.text,Qt(l.valueEnum||x))});return r?r(l.text,{mode:n,...l.fieldProps},j)??null:j}if(n==="edit"){const j=l.fieldProps||{};let b=s.jsx(u.Cascader,{ref:y,open:w,suffixIcon:f?s.jsx(me.LoadingOutlined,{}):void 0,placeholder:e||S.getMessage("tableForm.selectPlaceholder","请选择"),allowClear:(j==null?void 0:j.allowClear)!==!1,...j,onOpenChange:T=>{var $;($=j==null?void 0:j.onOpenChange)==null||$.call(j,T),v(T)},className:ce(j==null?void 0:j.className,g),options:m});if(t&&(b=t(l.text,{mode:n,...j,options:m,loading:f},b)??null),i){const{disabled:T,value:$}=j,F=!!$&&($==null?void 0:$.length)!==0;return s.jsx(Ut,{label:a,disabled:T,variant:o,value:F||w?b:null,style:F?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:F||w?!1:void 0,onClick:()=>{var E;v(!0),(E=j==null?void 0:j.onOpenChange)==null||E.call(j,!0)}})}return b}return null},Jl=d.forwardRef(ww),jw=({layout:e="horizontal",formItemRender:t,mode:n,render:r,...a},i)=>{var w,v,x,C,j;const{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-field-checkbox"),c=(v=(w=u.Form.Item)==null?void 0:w.useStatus)==null?void 0:v.call(w),[h,g,f]=lr(a),{wrapSSR:m,hashId:p}=We("Checkbox",b=>({[`.${l}`]:{"&-error":{span:{color:b.colorError}},"&-warning":{span:{color:b.colorWarning}},"&-vertical":{[`&${b.antCls}-checkbox-group`]:{display:"inline-block"},[`${b.antCls}-checkbox-wrapper+${b.antCls}-checkbox-wrapper`]:{"margin-inline-start":"0 !important"},[`${b.antCls}-checkbox-group-item`]:{display:"flex",marginInlineEnd:0}}}})),{token:S}=(C=(x=u.theme).useToken)==null?void 0:C.call(x),y=d.useRef();if(d.useImperativeHandle(i,()=>({...y.current||{},fetchData:b=>f(b)}),[f]),h)return s.jsx(u.Spin,{size:"small"});if(n==="read"){const b=g!=null&&g.length?g==null?void 0:g.reduce(($,F)=>({...$,[F.value??""]:F.label}),{}):void 0,T=On(a.text,Qt(a.valueEnum||b));return r?r(a.text,{mode:n,...a.fieldProps},s.jsx(s.Fragment,{children:T}))??null:s.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:S.marginSM},children:T})}if(n==="edit"){const{fieldNames:b,variant:T,...$}=a.fieldProps||{},F=m(s.jsx(u.Checkbox.Group,{...$,variant:T,className:ce((j=a.fieldProps)==null?void 0:j.className,p,`${l}-${e}`,{[`${l}-error`]:(c==null?void 0:c.status)==="error",[`${l}-warning`]:(c==null?void 0:c.status)==="warning"}),options:g}));return t?t(a.text,{mode:n,...a.fieldProps,options:g,loading:h},F)??null:F}return null},Xl=d.forwardRef(jw),vw=(e,t)=>{if(typeof e!="string")return e;try{if(t==="json")return JSON.stringify(JSON.parse(e),null,2)}catch{}return e},Tw=({text:e,mode:t,render:n,language:r="text",formItemRender:a,fieldProps:i},o)=>{const l=vw(e,r),{token:c}=hn.useToken();if(t==="read"){const h=s.jsx("pre",{ref:o,...i,style:{padding:16,overflow:"auto",fontSize:"85%",lineHeight:1.45,color:c.colorTextSecondary,fontFamily:c.fontFamilyCode,backgroundColor:"rgba(150, 150, 150, 0.1)",borderRadius:3,width:"min-content",...i.style},children:s.jsx("code",{children:l})});return n?n(l,{mode:t,...i,ref:o},h):h}if(t==="edit"||t==="update"){i.value=l;const h=s.jsx(u.Input.TextArea,{rows:5,...i,ref:o});return a?a(l,{mode:t,...i,ref:o},h)??null:h}return null},is=d.forwardRef(Tw),Fw={label:"Recommended",colors:["#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB","#722ED1","#EB2F96","#F5222D4D","#FA8C164D","#FADB144D","#8BBB114D","#52C41A4D","#13A8A84D","#1677FF4D","#2F54EB4D","#722ED14D","#EB2F964D"]},$w=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{const{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-field-color-picker");if(t==="read"){const c=s.jsx(u.ColorPicker,{value:e,className:ce({[l]:!0}),open:!1});return n?n(e,{mode:t,...a},c):c}if(t==="edit"||t==="update"){const c={display:"table-cell",...a.style},h=s.jsx(u.ColorPicker,{ref:i,presets:[Fw],...a,style:c,className:ce({[l]:!0})});return r?r(e,{mode:t,...a,style:c},h):h}return null},Ql=d.forwardRef($w);Te.extend(so);const Rw=(e,t)=>e?typeof t=="function"?t(Te(e)):Te(e).format((Array.isArray(t)?t[0]:t)||"YYYY-MM-DD"):"-",Ew=({text:e,mode:t,format:n="YYYY-MM-DD",label:r,light:a,render:i,formItemRender:o,showTime:l,fieldProps:c,picker:h,lightLabel:g,variant:f},m)=>{const p=Ie(),[S,y]=d.useState(!1);if(t==="read"){const w=Rw(e,c.format||n);return i?i(e,{mode:t,...c},s.jsx(s.Fragment,{children:w})):s.jsx(s.Fragment,{children:w})}if(t==="edit"||t==="update"){let w;const{disabled:v,value:x,placeholder:C=p.getMessage("tableForm.selectPlaceholder","请选择")}=c,j=ir(x);return a?w=s.jsx(Ut,{label:r,onClick:()=>{var b;(b=c==null?void 0:c.onOpenChange)==null||b.call(c,!0),y(!0)},style:j?{paddingInlineEnd:0}:void 0,disabled:v,value:j||S?s.jsx(u.DatePicker,{picker:h,showTime:l,format:n,ref:m,...c,value:j,onOpenChange:b=>{var T;y(b),(T=c==null?void 0:c.onOpenChange)==null||T.call(c,b)},open:S}):void 0,allowClear:!1,downIcon:j||S?!1:void 0,variant:f,ref:g}):w=s.jsx(u.DatePicker,{picker:h,showTime:l,format:n,placeholder:C,variant:f,ref:m,...c,value:j}),o?o(e,{mode:t,...c},w):w}return null},vt=d.forwardRef(Ew);function Iw(e){return Et(e)||e===""||(e==null?void 0:e.trim())===""}const Mw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i},o)=>{var g;const l=Ie(),c=r||l.getMessage("tableForm.inputPlaceholder","请输入"),h=d.useCallback(f=>{let m=f??void 0;if(!i.stringMode&&typeof m=="string"){const p=Number(m);if(isNaN(p)){const S=m.match(/^(\d+(?:\.\d+)?)/);S?m=Number(S[1]):m=void 0}else m=p}return typeof m=="number"&&!Et(m)&&!Et(i.precision)&&(m=Number(m.toFixed(i.precision))),m},[i]);if(t==="read"){let f={};i!=null&&i.precision&&(f={minimumFractionDigits:Number(i.precision),maximumFractionDigits:Number(i.precision)});const m=new Intl.NumberFormat(void 0,{...f,...(i==null?void 0:i.intlProps)||{}}).format(Number(e)),p=i!=null&&i.stringMode?s.jsx("span",{children:e}):s.jsx("span",{ref:o,children:((g=i==null?void 0:i.formatter)==null?void 0:g.call(i,m))||m});return n?n(e,{mode:t,...i},p):p}if(t==="edit"||t==="update"){const f=s.jsx(u.InputNumber,{ref:o,min:0,placeholder:c,...Ve(i,["onChange","onBlur"]),onChange:m=>{var p;return(p=i==null?void 0:i.onChange)==null?void 0:p.call(i,h(m))},onBlur:m=>{var y,w,v;const p=m.target.value;if(Iw(p)){(y=i==null?void 0:i.onBlur)==null||y.call(i,m);return}const S=h(p);m.target&&typeof S=="number"&&(m.target.value=S.toString(),(w=i==null?void 0:i.onChange)==null||w.call(i,S)),(v=i==null?void 0:i.onBlur)==null||v.call(i,m)}});return a?a(e,{mode:t,...i},f):f}return null},zs=d.forwardRef(Mw),kw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i,separator:o="~",separatorWidth:l=30},c)=>{const{value:h,defaultValue:g,onChange:f,id:m}=i,p=Ie(),{token:S}=hn.useToken(),[y,w]=rt(()=>g,h),v=d.useCallback(C=>{w(j=>{const b=typeof C=="function"?C(j):C;return f==null||f(b),b})},[f]),x=d.useRef(y);if(t==="read"){const C=b=>{var $;const T=new Intl.NumberFormat(void 0,{minimumSignificantDigits:2,...(i==null?void 0:i.intlProps)||{}}).format(Number(b));return(($=i==null?void 0:i.formatter)==null?void 0:$.call(i,T))||T},j=s.jsxs("span",{ref:c,children:[C(e[0])," ",o," ",C(e[1])]});return n?n(e,{mode:t,...i},j):j}if(t==="edit"||t==="update"){const C=()=>{if(Array.isArray(x.current)){const[F,E]=x.current;if(typeof F=="number"&&typeof E=="number"&&F>E){v([E,F]);return}F===void 0&&E===void 0&&v(void 0)}},j=(F,E)=>{const M=[...y||[]];M[F]=E===null?void 0:E,x.current=M,v(M)},b=(i==null?void 0:i.placeholder)||r||[p.getMessage("tableForm.inputPlaceholder","请输入"),p.getMessage("tableForm.inputPlaceholder","请输入")],T=F=>Array.isArray(b)?b[F]:b,$=s.jsxs(u.Space.Compact,{block:!0,onBlur:C,children:[s.jsx(u.InputNumber,{...i,placeholder:T(0),id:m??`${m}-0`,style:{width:`calc((100% - ${l}px) / 2)`},value:y==null?void 0:y[0],defaultValue:g==null?void 0:g[0],onChange:F=>j(0,F)}),s.jsx(u.Input,{style:{width:l,textAlign:"center",borderInlineStart:0,borderInlineEnd:0,pointerEvents:"none",backgroundColor:S==null?void 0:S.colorBgContainer},placeholder:o,disabled:!0}),s.jsx(u.InputNumber,{...i,placeholder:T(1),id:m??`${m}-1`,style:{width:`calc((100% - ${l}px) / 2)`,borderInlineStart:0},value:y==null?void 0:y[1],defaultValue:g==null?void 0:g[1],onChange:F=>j(1,F)})]});return a?a(e,{mode:t,...i},$):$}return null},ec=d.forwardRef(kw);var Es={exports:{}},Aw=Es.exports,tc;function Ow(){return tc||(tc=1,(function(e,t){(function(n,r){e.exports=r()})(Aw,(function(){return function(n,r,a){n=n||{};var i=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(h,g,f,m){return i.fromToBase(h,g,f,m)}a.en.relativeTime=o,i.fromToBase=function(h,g,f,m,p){for(var S,y,w,v=f.$locale().relativeTime||o,x=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],C=x.length,j=0;j<C;j+=1){var b=x[j];b.d&&(S=m?a(h).diff(f,b.d,!0):f.diff(h,b.d,!0));var T=(n.rounding||Math.round)(Math.abs(S));if(w=S>0,T<=b.r||!b.r){T<=1&&j>0&&(b=x[j-1]);var $=v[b.l];p&&(T=p(""+T)),y=typeof $=="string"?$.replace("%d",T):$(T,g,b.l,w);break}}if(g)return y;var F=w?v.future:v.past;return typeof F=="function"?F(y):F.replace("%s",y)},i.to=function(h,g){return l(h,g,this,!0)},i.from=function(h,g){return l(h,g,this)};var c=function(h){return h.$u?a.utc():a()};i.toNow=function(h){return this.to(c(this),h)},i.fromNow=function(h){return this.from(c(this),h)}}}))})(Es)),Es.exports}var Dw=Ow();const Pw=Ht(Dw);Te.extend(Pw);const Nw=({text:e,mode:t,variant:n,render:r,formItemRender:a,format:i,fieldProps:o},l)=>{const c=Ie();if(t==="read"){const h=s.jsx(u.Tooltip,{title:Te(e).format((o==null?void 0:o.format)||i||"YYYY-MM-DD HH:mm:ss"),children:Te(e).fromNow()});return r?r(e,{mode:t,...o},s.jsx(s.Fragment,{children:h})):s.jsx(s.Fragment,{children:h})}if(t==="edit"||t==="update"){const h=c.getMessage("tableForm.selectPlaceholder","请选择"),g=ir(o.value),f=s.jsx(u.DatePicker,{ref:l,placeholder:h,showTime:!0,variant:n??(o==null?void 0:o.variant)??"outlined",...o,value:g});return a?a(e,{mode:t,...o},f):f}return null},nc=d.forwardRef(Nw),rc=d.forwardRef(({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i,width:o},l)=>{const c=Ie(),h=i||c.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const g=s.jsx(u.Image,{ref:l,width:o||32,src:e,...a});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(u.Input,{ref:l,placeholder:h,...a});return r?r(e,{mode:t,...a},g):g}return null}),Lw=({border:e=!1,children:t},n)=>{const{getPrefixCls:r}=d.useContext(u.ConfigProvider.ConfigContext),a=r("pro-field-index-column"),{wrapSSR:i,hashId:o}=We("IndexColumn",()=>({[`.${a}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px","&-border":{color:"#fff",fontSize:"12px",lineHeight:"12px",backgroundColor:"#314659",borderRadius:"9px","&.top-three":{backgroundColor:"#979797"}}}}));return i(s.jsx("div",{ref:n,className:ce(a,o,{[`${a}-border`]:e,"top-three":t>3}),children:t}))},os=d.forwardRef(Lw),xd=new Intl.NumberFormat("zh-Hans-CN",{currency:"CNY",style:"currency"}),_w={style:"currency",currency:"USD"},zw={style:"currency",currency:"RUB"},Bw={style:"currency",currency:"RSD"},Vw={style:"currency",currency:"MYR"},Hw={style:"currency",currency:"BRL"},Yw={default:xd,"zh-Hans-CN":{currency:"CNY",style:"currency"},"en-US":_w,"ru-RU":zw,"ms-MY":Vw,"sr-RS":Bw,"pt-BR":Hw},sc=(e,t,n,r,a="")=>{let i=t==null?void 0:t.toString().replaceAll(",","");if(typeof i=="string"){const l=Number(i);if(Number.isNaN(l))return i;i=l}if(!i&&i!==0)return"";let o=!1;try{o=e!==!1&&Intl.NumberFormat.supportedLocalesOf([e.replace("_","-")],{localeMatcher:"lookup"}).length>0}catch{}try{const c=new Intl.NumberFormat(o&&e!==!1&&(e==null?void 0:e.replace("_","-"))||"zh-Hans-CN",{...Yw[e||"zh-Hans-CN"]||xd,maximumFractionDigits:n,...r}).format(i),g=(m=>{const p=m.match(/\d+/);if(p){const S=p[0];return m.slice(m.indexOf(S))}else return m})(c),[f]=c||"";return["+","-"].includes(f)?`${a||""}${f}${g}`:`${a||""}${g}`}catch{return i}},Oa=2,Uw=d.forwardRef(({contentRender:e,numberFormatOptions:t,numberPopoverRender:n,open:r,onOpenChange:a,...i},o)=>{const[l,c]=rt(()=>i.defaultValue,i.value),[h,g]=d.useState(r??!1),f=d.useRef(!0);d.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),d.useEffect(()=>{r!==void 0&&g(r)},[r]);const m=d.useCallback(y=>{c(w=>{var x;const v=typeof y=="function"?y(w):y;return(x=i.onChange)==null||x.call(i,v),v})},[i.onChange,c]),p=d.useCallback(y=>{a==null||a(y),r===void 0&&queueMicrotask(()=>{f.current&&g(y)})},[r,a]),S=e==null?void 0:e({...i,value:l});return S?s.jsx(u.Popover,{placement:"topLeft",open:h,onOpenChange:p,trigger:["focus","click"],content:S,getPopupContainer:y=>(y==null?void 0:y.parentElement)||document.body,children:s.jsx(u.InputNumber,{ref:o,...i,value:l,onChange:m})}):s.jsx(u.InputNumber,{ref:o,...i,value:l,onChange:m})}),Kw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,proFieldKey:i,valueEnum:o,placeholder:l,locale:c,customSymbol:h=a.customSymbol,numberFormatOptions:g=a==null?void 0:a.numberFormatOptions,numberPopoverRender:f=(a==null?void 0:a.numberPopoverRender)||!1,...m},p)=>{const S=(a==null?void 0:a.precision)??Oa;let y=Ie();c&&In[c]&&(y=In[c]);const w=l||y.getMessage("tableForm.inputPlaceholder","请输入"),v=d.useMemo(()=>{if(h)return h;if(!(m.moneySymbol===!1||a.moneySymbol===!1))return y.getMessage("moneySymbol","¥")},[h,a.moneySymbol,y,m.moneySymbol]),x=d.useCallback(C=>{const j=new RegExp(`\\B(?=(\\d{${3+Math.max(S-Oa,0)}})+(?!\\d))`,"g"),[b,T]=String(C).split("."),$=b.replace(j,",");let F="";return T&&S>0&&(F=`.${T.slice(0,S===void 0?Oa:S)}`),`${$}${F}`},[S]);if(t==="read"){const C=s.jsx("span",{ref:p,children:sc(c||!1,e,S,g??a.numberFormatOptions,v)});return n?n(e,{mode:t,...a},C):C}if(t==="edit"||t==="update"){const C=s.jsx(Uw,{contentRender:j=>{if(f===!1||!j.value)return null;const b=sc(v||c||!1,`${x(j.value)}`,S,{...g,notation:"compact"},v);return typeof f=="function"?f==null?void 0:f(j,b):b},ref:p,precision:S,formatter:j=>j&&v?`${v} ${x(j)}`:(j==null?void 0:j.toString())||j,parser:j=>v&&j?j.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),""):j,placeholder:w,...Ve(a,["numberFormatOptions","precision","numberPopoverRender","customSymbol","moneySymbol","visible","open"]),onBlur:a.onBlur?j=>{var T;let b=j.target.value;v&&b&&(b=b.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),"")),(T=a.onBlur)==null||T.call(a,b)}:void 0});return r?r(e,{mode:t,...a},C):C}return null},ac=d.forwardRef(Kw),ic=e=>e.map((t,n)=>{var r;return d.isValidElement(t)?d.cloneElement(t,{key:n,...t==null?void 0:t.props,style:{...(r=t==null?void 0:t.props)==null?void 0:r.style}}):s.jsx(d.Fragment,{children:t},n)}),Ww=({text:e,mode:t,render:n,fieldProps:r},a)=>{const{getPrefixCls:i}=d.useContext(u.ConfigProvider.ConfigContext),o=i("pro-field-option"),{token:l}=hn.useToken();if(d.useImperativeHandle(a,()=>({})),n){const c=n(e,{mode:t,...r},s.jsx(s.Fragment,{}));return!c||(c==null?void 0:c.length)<1||!Array.isArray(c)?null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:ic(c)})}return!e||!Array.isArray(e)?d.isValidElement(e)?e:null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:ic(e)})},oc=d.forwardRef(Ww),qw=(e,t)=>{const n=Ie(),{text:r,mode:a,render:i,formItemRender:o,fieldProps:l,...c}=Ve(e,["proFieldKey"]),[h,g]=rt(()=>c.open||!1,c.open),f=d.useCallback(m=>{g(p=>{var y;const S=typeof m=="function"?m(p):m;return(y=c.onOpenChange)==null||y.call(c,S),S})},[c.onOpenChange]);if(a==="read"){let m=s.jsx(s.Fragment,{children:"-"});return r&&(m=s.jsxs(u.Space,{children:[s.jsx("span",{ref:t,children:h?r:"********"}),s.jsx("a",{onClick:()=>f(!h),children:h?s.jsx(me.EyeOutlined,{}):s.jsx(me.EyeInvisibleOutlined,{})})]})),i?i(r,{mode:a,...l},m):m}if(a==="edit"||a==="update"){const m=s.jsx(u.Input.Password,{placeholder:n.getMessage("tableForm.inputPlaceholder","请输入"),ref:t,...l});return o?o(r,{mode:a,...l},m):m}return null},Gn=d.forwardRef(qw);function Gw(e){return e===0?null:e>0?"+":"-"}function Zw(e){return e===0?"#595959":e>0?"#ff4d4f":"#52c41a"}function Jw(e,t=2){return t>=0?e==null?void 0:e.toFixed(t):e}function Bs(e){return typeof e=="symbol"||e instanceof Symbol?NaN:Number(e)}const Xw=({text:e,prefix:t,precision:n,suffix:r="%",mode:a,showColor:i=!1,render:o,formItemRender:l,fieldProps:c,placeholder:h,showSymbol:g},f)=>{const m=Ie(),p=h||m.getMessage("tableForm.inputPlaceholder","请输入"),S=d.useMemo(()=>typeof e=="string"&&e.includes("%")?Bs(e.replace("%","")):Bs(e),[e]),y=d.useMemo(()=>typeof g=="function"?g==null?void 0:g(e):g,[g,e]);if(a==="read"){const w=i?{color:Zw(S)}:{},v=s.jsxs("span",{style:w,ref:f,children:[t&&s.jsx("span",{children:t}),y&&s.jsxs(d.Fragment,{children:[Gw(S)," "]}),Jw(Math.abs(S),n),r&&r]});return o?o(e,{mode:a,...c,prefix:t,precision:n,showSymbol:y,suffix:r},v):v}if(a==="edit"||a==="update"){const w=s.jsx(u.InputNumber,{ref:f,formatter:v=>v&&t?`${t} ${v}`.replace(/\B(?=(\d{3})+(?!\d)$)/g,","):v,parser:v=>v?v.replace(/.*\s|,/g,""):"",placeholder:p,...c});return l?l(e,{mode:a,...c},w):w}return null},lc=d.forwardRef(Xw);function Qw(e){return e===100?"success":e<0?"exception":e<100?"active":"normal"}const ej=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Ie(),c=i||l.getMessage("tableForm.inputPlaceholder","请输入"),h=d.useMemo(()=>typeof e=="string"&&e.includes("%")?Bs(e.replace("%","")):Bs(e),[e]);if(t==="read"){const g=s.jsx(u.Progress,{ref:o,size:"small",style:{minWidth:100,maxWidth:320},percent:h,steps:a==null?void 0:a.steps,status:Qw(h),...a});return n?n(h,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(u.InputNumber,{ref:o,placeholder:c,...a});return r?r(e,{mode:t,...a},g):g}return null},cc=d.forwardRef(ej),tj=({radioType:e,formItemRender:t,mode:n,render:r,...a},i)=>{var y,w,v;const{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-field-radio"),[c,h,g]=lr(a),f=d.useRef(),m=(w=(y=u.Form.Item)==null?void 0:y.useStatus)==null?void 0:w.call(y);d.useImperativeHandle(i,()=>({...f.current||{},fetchData:x=>g(x)}),[g]);const{wrapSSR:p,hashId:S}=We("FieldRadioRadio",x=>({[`.${l}-error`]:{span:{color:x.colorError}},[`.${l}-warning`]:{span:{color:x.colorWarning}},[`.${l}-vertical`]:{[`${x.antCls}-radio-wrapper`]:{display:"flex",marginInlineEnd:0}}}));if(c)return s.jsx(u.Spin,{size:"small"});if(n==="read"){const x=h!=null&&h.length?h==null?void 0:h.reduce((j,b)=>({...j,[b.value??""]:b.label}),{}):void 0,C=s.jsx(s.Fragment,{children:On(a.text,Qt(a.valueEnum||x))});return r?r(a.text,{mode:n,...a.fieldProps},C)??null:C}if(n==="edit"){const x=p(s.jsx(u.Radio.Group,{ref:f,optionType:e,...a.fieldProps,className:ce((v=a.fieldProps)==null?void 0:v.className,{[`${l}-error`]:(m==null?void 0:m.status)==="error",[`${l}-warning`]:(m==null?void 0:m.status)==="warning"},S,`${l}-${a.fieldProps.layout||"horizontal"}`),options:h}));return t?t(a.text,{mode:n,...a.fieldProps,options:h,loading:c},x)??null:x}return null},ls=d.forwardRef(tj),nj=({text:e,mode:t,light:n,label:r,format:a="YYYY-MM-DD",render:i,picker:o,formItemRender:l,showTime:c,lightLabel:h,variant:g,fieldProps:f},m)=>{const p=Ie(),[S,y]=Array.isArray(e)?e:[],[w,v]=d.useState(!1),x=d.useCallback(b=>{var T;return typeof(f==null?void 0:f.format)=="function"?(T=f==null?void 0:f.format)==null?void 0:T.call(f,b):(f==null?void 0:f.format)||a||"YYYY-MM-DD"},[f,a]),C=S?Te(S).format(x(Te(S))):"",j=y?Te(y).format(x(Te(y))):"";if(t==="read"){const b=s.jsxs("div",{ref:m,style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return i?i(e,{mode:t,...f},s.jsx("span",{children:b})):b}if(t==="edit"||t==="update"){const b=ir(f.value);let T;const $=F=>{var E;(E=f==null?void 0:f.onChange)==null||E.call(f,F),F||v(!1)};return n?T=s.jsx(Ut,{label:r,onClick:()=>{var F;(F=f==null?void 0:f.onOpenChange)==null||F.call(f,!0),v(!0)},style:b?{paddingInlineEnd:0}:void 0,disabled:f.disabled,value:b||w?s.jsx(u.DatePicker.RangePicker,{picker:o,showTime:c,format:a,...f,placeholder:f.placeholder??[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],value:b,onOpenChange:F=>{var E;b&&v(F),(E=f==null?void 0:f.onOpenChange)==null||E.call(f,F)},onChange:$}):null,variant:g,allowClear:!1,ref:h,downIcon:b||w?!1:void 0}):T=s.jsx(u.DatePicker.RangePicker,{ref:m,format:a,showTime:c,placeholder:[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],...f,value:b}),l?l(e,{mode:t,...f},T):T}return null},Tt=d.forwardRef(nj),rj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=s.jsx(u.Rate,{allowHalf:!0,disabled:!0,ref:i,...a,value:e});return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):o}if(t==="edit"||t==="update"){const o=s.jsx(u.Rate,{allowHalf:!0,ref:i,...a});return r?r(e,{mode:t,...a},o):o}return null},uc=d.forwardRef(rj);function sj(e){let t=e,n="",r=!1;t<0&&(t=-t,r=!0);const a=Math.floor(t/(3600*24)),i=Math.floor(t/3600%24),o=Math.floor(t/60%60);return n=`${Math.floor(t%60)}秒`,o>0&&(n=`${o}分钟${n}`),i>0&&(n=`${i}小时${n}`),a>0&&(n=`${a}天${n}`),r&&(n+="前"),n}const aj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Ie(),c=i||l.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const h=sj(Number(e)),g=s.jsx("span",{ref:o,children:h});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const h=s.jsx(u.InputNumber,{ref:o,min:0,style:{width:"100%"},placeholder:c,...a});return r?r(e,{mode:t,...a},h):h}return null},dc=d.forwardRef(aj),ij=(e,t)=>{const{mode:n,render:r,formItemRender:a,fieldProps:i,emptyText:o="-",...l}=e,c=d.useRef(),[h,g,f]=lr(e);if(d.useImperativeHandle(t,()=>({...c.current||{},fetchData:m=>f(m)}),[f]),h)return s.jsx(u.Spin,{size:"small"});if(n==="read"){const m=g!=null&&g.length?g==null?void 0:g.reduce((S,y)=>({...S,[y.value??""]:y.label}),{}):void 0,p=s.jsx(s.Fragment,{children:On(l.text,Qt(l.valueEnum||m))});return r?r(l.text,{mode:n,...i},s.jsx(s.Fragment,{children:p}))??o:p}if(n==="edit"||n==="update"){const m=s.jsx(u.Segmented,{ref:c,...Ve(i||{},["allowClear"]),options:g});return a?a(l.text,{mode:n,...i,options:g,loading:h},m):m}return null},fc=d.forwardRef(ij),oj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=e;return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):s.jsx(s.Fragment,{children:o})}if(t==="edit"||t==="update"){const o=s.jsx(u.Slider,{ref:i,...a,style:{minWidth:120,...a==null?void 0:a.style}});return r?r(e,{mode:t,...a},o):o}return null},mc=d.forwardRef(oj),lj=({text:e,mode:t,render:n,light:r,label:a,formItemRender:i,fieldProps:o,variant:l},c)=>{const h=Ie(),g=l??(o==null?void 0:o.variant),f=d.useMemo(()=>e==null||`${e}`.length<1?"-":e?(o==null?void 0:o.checkedChildren)??h.getMessage("switch.open","打开"):(o==null?void 0:o.unCheckedChildren)??h.getMessage("switch.close","关闭"),[o==null?void 0:o.checkedChildren,o==null?void 0:o.unCheckedChildren,e]);if(t==="read")return n?n(e,{mode:t,...o},s.jsx(s.Fragment,{children:f})):f??"-";if(t==="edit"||t==="update"){const m=s.jsx(u.Switch,{ref:c,size:r?"small":void 0,...Ve(o,["value"]),checked:(o==null?void 0:o.checked)??(o==null?void 0:o.value)});if(r){const{disabled:p}=o;return s.jsx(Ut,{label:a,disabled:p,variant:g,downIcon:!1,value:s.jsx("div",{style:{paddingLeft:8},children:m}),allowClear:!1})}return i?i(e,{mode:t,...o},m):m}return null},hc=d.forwardRef(lj),cj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,emptyText:i="-"},o)=>{const{autoFocus:l,prefix:c="",suffix:h=""}=a||{},g=Ie(),f=d.useRef();if(d.useImperativeHandle(o,()=>f.current,[]),d.useEffect(()=>{l&&queueMicrotask(()=>{var m;(m=f.current)==null||m.focus()})},[l]),t==="read"){const m=s.jsxs(s.Fragment,{children:[c,e??i,h]});return n?n(e,{mode:t,...a},m)??i:m}if(t==="edit"||t==="update"){const m=g.getMessage("tableForm.inputPlaceholder","请输入"),p=s.jsx(u.Input,{ref:f,placeholder:m,allowClear:!0,...a});return r?r(e,{mode:t,...a},p):p}return null},wi=d.forwardRef(cj),uj=({text:e,fieldProps:t},n)=>{const{getPrefixCls:r}=d.useContext(u.ConfigProvider.ConfigContext),a=r("pro-field-readonly"),i=`${a}-textarea`,{wrapSSR:o,hashId:l}=We("TextArea",()=>({[`.${i}`]:{display:"inline-block",lineHeight:"1.5715",maxWidth:"100%",whiteSpace:"pre-wrap"}}));return o(s.jsx("span",{ref:n,className:ce(l,a,i),...Ve(t,["autoSize","classNames","styles"]),children:e??"-"}))},dj=d.forwardRef(uj),fj=(e,t)=>{const{text:n,mode:r,render:a,formItemRender:i,fieldProps:o}=e,l=Ie();if(r==="read"){const c=s.jsx(dj,{...e,ref:t});return a?a(n,{mode:r,...Ve(o,["showCount"])},c):c}if(r==="edit"||r==="update"){const c=s.jsx(u.Input.TextArea,{ref:t,rows:3,onKeyDown:h=>{h.key==="Enter"&&h.stopPropagation()},placeholder:l.getMessage("tableForm.inputPlaceholder","请输入"),...o});return i?i(n,{mode:r,...o},c):c}return null},gc=d.forwardRef(fj),mj=({text:e,mode:t,light:n,label:r,format:a="HH:mm:ss",render:i,formItemRender:o,fieldProps:l,lightLabel:c,variant:h},g)=>{const[f,m]=d.useState(!1),p=Ie(),S=(l==null?void 0:l.format)||a,y=Te.isDayjs(e)||typeof e=="number";if(t==="read"){const w=s.jsx("span",{ref:g,children:e?Te(e,y?void 0:S).format(S):"-"});return i?i(e,{mode:t,...l},s.jsx("span",{children:w})):w}if(t==="edit"||t==="update"){let w;const{disabled:v,value:x}=l,C=ir(x,S);return n?w=s.jsx(Ut,{onClick:()=>{var j;(j=l==null?void 0:l.onOpenChange)==null||j.call(l,!0),m(!0)},style:C?{paddingInlineEnd:0}:void 0,label:r,disabled:v,variant:h??(l==null?void 0:l.variant),value:C||f?s.jsx(u.TimePicker,{variant:h??(l==null?void 0:l.variant),format:a,ref:g,...l,placeholder:l.placeholder??p.getMessage("tableForm.selectPlaceholder","请选择"),value:C,onOpenChange:j=>{var b;m(j),(b=l==null?void 0:l.onOpenChange)==null||b.call(l,j)},open:f}):null,downIcon:C||f?!1:void 0,allowClear:!1,ref:c}):w=s.jsx(u.DatePicker.TimePicker,{ref:g,format:a,...l,value:C}),o?o(e,{mode:t,...l},w):w}return null},hj=({text:e,light:t,label:n,mode:r,lightLabel:a,format:i="HH:mm:ss",render:o,formItemRender:l,fieldProps:c,variant:h},g)=>{const f=Ie(),[m,p]=d.useState(!1),S=(c==null?void 0:c.format)||i,[y,w]=Array.isArray(e)?e:[],v=Te.isDayjs(y)||typeof y=="number",x=Te.isDayjs(w)||typeof w=="number",C=y?Te(y,v?void 0:S).format(S):"",j=w?Te(w,x?void 0:S).format(S):"";if(r==="read"){const b=s.jsxs("div",{ref:g,children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return o?o(e,{mode:r,...c},s.jsx("span",{children:b})):b}if(r==="edit"||r==="update"){const b=ir(c.value,S);let T;if(t){const{disabled:$,placeholder:F=[f.getMessage("tableForm.selectPlaceholder","请选择"),f.getMessage("tableForm.selectPlaceholder","请选择")]}=c;T=s.jsx(Ut,{onClick:()=>{var E;(E=c==null?void 0:c.onOpenChange)==null||E.call(c,!0),p(!0)},style:b?{paddingInlineEnd:0}:void 0,label:n,disabled:$,variant:h,placeholder:F,value:b||m?s.jsx(u.TimePicker.RangePicker,{variant:h??(c==null?void 0:c.variant),format:i,ref:g,...c,placeholder:F,value:b,onOpenChange:E=>{var M;p(E),(M=c==null?void 0:c.onOpenChange)==null||M.call(c,E)},open:m}):null,downIcon:b||m?!1:void 0,allowClear:!1,ref:a})}else T=s.jsx(u.TimePicker.RangePicker,{ref:g,format:i,variant:h,...c,value:b});return l?l(e,{mode:r,...c},T):T}return null},pc=d.forwardRef(hj),yc=d.forwardRef(mj),gj=({formItemRender:e,mode:t,light:n,label:r,render:a,variant:i,...o},l)=>{var q,L;const{getPrefixCls:c}=d.useContext(u.ConfigProvider.ConfigContext),h=c("pro-field-tree-select"),g=d.useRef(null),[f,m]=d.useState(!1),{onClear:p,onChange:S,onBlur:y,showSearch:w,fetchDataOnSearch:v,onSearch:x,autoClearSearchValue:C,searchValue:j,...b}=Ve(o.fieldProps,["treeData"]),T=typeof w=="object"?w:{},$=(T==null?void 0:T.onSearch)!==void 0?T.onSearch:x,F=(T==null?void 0:T.autoClearSearchValue)!==void 0?T.autoClearSearchValue:C,E=(T==null?void 0:T.searchValue)!==void 0?T.searchValue:j,M=i??(b==null?void 0:b.variant),k=Ie(),[V,z,A]=lr({...o,defaultKeyWords:E}),[I,R]=rt(void 0,E),D=d.useCallback(H=>{R(G=>{const W=typeof H=="function"?H(G):H;return $==null||$(W),W})},[$]);d.useImperativeHandle(l,()=>({...g.current||{},fetchData:H=>A(H)}));const O=d.useMemo(()=>{if(t!=="read")return;const{value:H="value",label:G="label",children:W="children"}=(b==null?void 0:b.fieldNames)||{},B=new Map,_=Y=>{if(!(Y!=null&&Y.length))return B;const P=Y.length;let U=0;for(;U<P;){const X=Y[U++];B.set(X[H],X[G]),_(X[W])}return B};return _(z)},[b==null?void 0:b.fieldNames,t,z]),N=(H,G,W)=>{w&&F&&(A(void 0),D(void 0)),S==null||S(H,G,W)};if(t==="read"){const H=s.jsx(s.Fragment,{children:On(o.text,Qt(o.valueEnum||O))});return a?a(o.text,{mode:t,...b,treeData:z},H)??null:H}if(t==="edit"){const H=Array.isArray(b==null?void 0:b.value)?(q=b==null?void 0:b.value)==null?void 0:q.length:0;let G=s.jsx(u.Spin,{spinning:V,children:s.jsx(u.TreeSelect,{open:f,onOpenChange:W=>{var B;(B=b==null?void 0:b.onOpenChange)==null||B.call(b,W),m(W)},ref:g,popupMatchSelectWidth:!n,placeholder:k.getMessage("tableForm.selectPlaceholder","请选择"),tagRender:n?W=>{var _;if(H<2)return s.jsx(s.Fragment,{children:W.label});const B=(_=b==null?void 0:b.value)==null?void 0:_.findIndex(Y=>Y===W.value||Y.value===W.value);return s.jsxs(s.Fragment,{children:[W.label," ",B<H-1?",":""]})}:void 0,...b,treeData:z,showSearch:w&&{...T,searchValue:I,autoClearSearchValue:F,onSearch:W=>{v&&(o!=null&&o.request)&&A(W),D(W)}},style:{minWidth:60,...b.style},allowClear:b.allowClear!==!1,onClear:()=>{p==null||p(),A(void 0),w&&D(void 0)},onChange:N,onBlur:W=>{D(void 0),A(void 0),y==null||y(W)},className:ce(b==null?void 0:b.className,h)})});if(e&&(G=e(o.text,{mode:t,...b,options:z,loading:V},G)??null),n){const{disabled:W,placeholder:B}=b,_=!!b.value&&((L=b.value)==null?void 0:L.length)!==0;return s.jsx(Ut,{label:r,disabled:W,placeholder:B,onClick:()=>{var Y;m(!0),(Y=b==null?void 0:b.onOpenChange)==null||Y.call(b,!0)},variant:M,value:_||f?G:null,style:_?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:!1})}return G}return null},xc=d.forwardRef(gj);function Ne(e){const[t,n]=d.useState(!1),r=d.useRef(null),a=d.useCallback(l=>{var g,f,m,p,S,y;const c=(m=(f=(g=r.current)==null?void 0:g.labelRef)==null?void 0:f.current)==null?void 0:m.contains(l.target),h=(y=(S=(p=r.current)==null?void 0:p.clearRef)==null?void 0:S.current)==null?void 0:y.contains(l.target);return c&&!h},[r]),i=l=>{a(l)&&n(!0)},o=()=>{n(!1)};return e.isLight?s.jsx("div",{onMouseDown:i,onMouseUp:o,children:d.cloneElement(e.children,{labelTrigger:t,lightLabel:r})}):s.jsx(s.Fragment,{children:e.children})}Te.extend(gd);Te.extend(md);Te.extend(hd);Te.extend(so);Te.extend(pd);const bd=(e,t,n,r)=>{var l,c,h,g;const{mode:a="read",emptyText:i="-"}=n;if(i!==!1&&a==="read"&&t!=="option"&&t!=="switch"&&typeof e!="boolean"&&typeof e!="number"&&!e){const{fieldProps:f,render:m}=n;return m?m(e,{mode:a,...f},s.jsx(s.Fragment,{children:i})):s.jsx(s.Fragment,{children:i})}if(delete n.emptyText,typeof t=="object")return bd(e,t.type,{...t,...n},r);const o=r&&r[t];if(o){if(delete n.ref,a==="read"){const f=(l=o.render)==null?void 0:l.call(o,e,{text:e,...n,mode:a||"read"},s.jsx(s.Fragment,{children:e}));return n!=null&&n.render?(c=n.render)==null?void 0:c.call(n,e,{text:e,...n},f):f}if(a==="update"||a==="edit"){const f=(h=o.formItemRender)==null?void 0:h.call(o,e,{text:e,...n},s.jsx(s.Fragment,{children:e}));return n!=null&&n.formItemRender?(g=n.formItemRender)==null?void 0:g.call(n,e,{text:e,...n},f):f}}return s.jsx(wi,{text:e,...n})},pj=({text:e,valueType:t="text",mode:n="read",onChange:r,formItemRender:a,value:i,readonly:o,fieldProps:l,...c},h)=>{const g=d.useContext(Vt),f=we((...S)=>{var y;(y=l==null?void 0:l.onChange)==null||y.call(l,...S),r==null||r(...S)}),m=dt(()=>(i!==void 0||l)&&{value:i,...lt(l),onChange:f},[i,l,f]),p=bd(n==="edit"?(m==null?void 0:m.value)??e??"":e??(m==null?void 0:m.value)??"",t||"text",lt({ref:h,...c,mode:o?"read":n,formItemRender:a?(S,y,w)=>{const{placeholder:v,...x}=y,C=a(S,x,w);return d.isValidElement(C)?d.cloneElement(C,{...m,...C.props||{}}):C}:void 0,placeholder:a?void 0:(c==null?void 0:c.placeholder)??(m==null?void 0:m.placeholder),fieldProps:It(lt({...m,placeholder:a?void 0:(c==null?void 0:c.placeholder)??(m==null?void 0:m.placeholder)}))}),g.valueTypeMap||{});return s.jsx(d.Fragment,{children:p})},yj=d.forwardRef(pj);Te.extend(gd);Te.extend(md);Te.extend(hd);Te.extend(so);Te.extend(pd);const Sd={progress:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(cc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(cc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},money:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},percent:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(lc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(lc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},image:{render:(e,t)=>s.jsx(rc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(rc,{...t,text:e})},date:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM-DD",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM-DD",...t,text:e})})},dateWeek:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-wo",picker:"week",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-wo",picker:"week",...t,text:e})})},dateWeekRange:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})})},dateMonthRange:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})})},dateQuarterRange:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})})},dateYearRange:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})})},dateMonth:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM",picker:"month",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM",picker:"month",...t,text:e})})},dateQuarter:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})})},dateYear:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY",picker:"year",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY",picker:"year",...t,text:e})})},dateRange:{render:(e,t)=>s.jsx(Tt,{format:"YYYY-MM-DD",...t,text:e}),formItemRender:(e,t)=>s.jsx(Tt,{format:"YYYY-MM-DD",...t,text:e})},dateTime:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},dateTimeRange:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(Tt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},time:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(yc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(yc,{format:"HH:mm:ss",...t,text:e})})},timeRange:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(pc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(pc,{format:"HH:mm:ss",...t,text:e})})},fromNow:{render:(e,t)=>s.jsx(nc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(nc,{...t,text:e})},index:{render:e=>s.jsx(os,{children:e+1}),formItemRender:e=>s.jsx(os,{children:e+1})},indexBorder:{render:e=>s.jsx(os,{border:!0,children:e+1}),formItemRender:e=>s.jsx(os,{border:!0,children:e+1})},avatar:{render:e=>s.jsx(u.Avatar,{src:e,size:22,shape:"circle"}),formItemRender:e=>s.jsx(u.Avatar,{src:e,size:22,shape:"circle"})},code:{render:(e,t)=>s.jsx(is,{...t,text:e}),formItemRender:(e,t)=>s.jsx(is,{...t,text:e})},jsonCode:{render:(e,t)=>s.jsx(is,{language:"json",...t,text:e}),formItemRender:(e,t)=>s.jsx(is,{language:"json",...t,text:e})},textarea:{render:(e,t)=>s.jsx(gc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(gc,{...t,text:e})},digit:{render:(e,t)=>{const n=It(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(zs,{text:a,placeholder:r,mode:t.mode,fieldProps:n})},formItemRender:(e,t)=>{const n=It(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(zs,{text:a,placeholder:r,mode:t.mode,fieldProps:n})}},digitRange:{render:(e,t)=>s.jsx(ec,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ec,{...t,text:e})},second:{render:(e,t)=>s.jsx(dc,{...t,text:e,placeholder:t.placeholder}),formItemRender:(e,t)=>s.jsx(dc,{...t,text:e,placeholder:t.placeholder})},select:{render:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(as,{...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ne,{isLight:t.light,children:s.jsx(as,{...t,text:e})})},text:{render:(e,t)=>"valueEnum"in t?s.jsx(Ne,{isLight:t.light,children:s.jsx(as,{...t,text:e})}):s.jsx(wi,{...t,text:e}),formItemRender:(e,t)=>"valueEnum"in t?s.jsx(Ne,{isLight:t.light,children:s.jsx(as,{...t,text:e})}):s.jsx(wi,{...t,text:e})},checkbox:{render:(e,t)=>s.jsx(Xl,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Xl,{...t,text:e})},radio:{render:(e,t)=>s.jsx(ls,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ls,{...t,text:e})},radioButton:{render:(e,t)=>s.jsx(ls,{radioType:"button",...t,text:e}),formItemRender:(e,t)=>s.jsx(ls,{radioType:"button",...t,text:e})},rate:{render:(e,t)=>s.jsx(uc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(uc,{...t,text:e})},slider:{render:(e,t)=>s.jsx(mc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(mc,{...t,text:e})},switch:{render:(e,t)=>s.jsx(hc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(hc,{...t,text:e})},option:{render:(e,t)=>s.jsx(oc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(oc,{...t,text:e})},password:{render:(e,t)=>s.jsx(Gn,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Gn,{...t,text:e})},cascader:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(Jl,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(Jl,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})}},treeSelect:{render:(e,t)=>s.jsx(xc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(xc,{...t,text:e})},color:{render:(e,t)=>s.jsx(Ql,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Ql,{...t,text:e})},segmented:{render:(e,t)=>s.jsx(fc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(fc,{...t,text:e})}},ao=d.createContext({grid:!1,colProps:void 0,rowProps:void 0}),xj=({grid:e,rowProps:t,colProps:n})=>({grid:!!e,RowWrapper({children:r,Wrapper:a,...i}={}){return e?s.jsx(u.Row,{gutter:8,...t,...i,children:r}):a?s.jsx(a,{children:r}):r},ColWrapper({children:r,Wrapper:a,variant:i,fieldProps:o,...l}={}){var g;const c=d.useMemo(()=>{const f={...n,...l};return typeof f.span>"u"&&typeof f.xs>"u"&&(f.xs=24),f},[l]),h=(i!==void 0||o!==void 0)&&d.Children.count(r)===1&&d.isValidElement(r)?d.cloneElement(r,{...i!==void 0&&{variant:i},...o&&{fieldProps:{...(g=r==null?void 0:r.props)==null?void 0:g.fieldProps,...o}}}):r;return e?s.jsx(u.Col,{...c,children:h}):a?s.jsx(a,{children:h}):h}}),cr=e=>{const t=d.useMemo(()=>typeof e=="object"?e:{grid:e},[e]),{grid:n,colProps:r}=d.useContext(ao);return d.useMemo(()=>xj({grid:!!(n||t.grid),rowProps:t==null?void 0:t.rowProps,colProps:(t==null?void 0:t.colProps)||r,Wrapper:t==null?void 0:t.Wrapper}),[t==null?void 0:t.Wrapper,t.grid,n,JSON.stringify([r,t==null?void 0:t.colProps,t==null?void 0:t.rowProps])])},Fn="RC_FORM_INTERNAL_HOOKS",Be=()=>{Ge(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},An=be.createContext({getFieldValue:Be,getFieldsValue:Be,getFieldError:Be,getFieldWarning:Be,getFieldsError:Be,isFieldsTouched:Be,isFieldTouched:Be,isFieldValidating:Be,isFieldsValidating:Be,resetFields:Be,setFields:Be,setFieldValue:Be,setFieldsValue:Be,validateFields:Be,submit:Be,getInternalHooks:()=>(Be(),{dispatch:Be,initEntityValue:Be,registerField:Be,useSubscribe:Be,setInitialValues:Be,destroyForm:Be,setCallbacks:Be,registerWatch:Be,getFields:Be,setValidateMessages:Be,setPreserve:Be,getInitialValue:Be})}),Vs=be.createContext(null);function ji(e){return e==null?[]:Array.isArray(e)?e:[e]}function bj(e){return e&&!!e._init}function vi(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){const e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}const Da=vi(),Sj=/%[sdj%]/g;let Cd=()=>{};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Cd=(e,t)=>{typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&t.every(n=>typeof n=="string")&&console.warn(e,t)});function Ti(e){if(!e||!e.length)return null;const t={};return e.forEach(n=>{const r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function wt(e,...t){let n=0;const r=t.length;return typeof e=="function"?e.apply(null,t):typeof e=="string"?e.replace(Sj,i=>{if(i==="%%")return"%";if(n>=r)return i;switch(i){case"%s":return String(t[n++]);case"%d":return Number(t[n++]);case"%j":try{return JSON.stringify(t[n++])}catch{return"[Circular]"}break;default:return i}}):e}function Cj(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function ot(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Cj(t)&&typeof e=="string"&&!e)}function wj(e,t,n){const r=[];let a=0;const i=e.length;function o(l){r.push(...l||[]),a++,a===i&&n(r)}e.forEach(l=>{t(l,o)})}function bc(e,t,n){let r=0;const a=e.length;function i(o){if(o&&o.length){n(o);return}const l=r;r=r+1,l<a?t(e[l],i):n([])}i([])}function jj(e){const t=[];return Object.keys(e).forEach(n=>{t.push(...e[n]||[])}),t}class Sc extends Error{constructor(n,r){super("Async Validation Error");ue(this,"errors");ue(this,"fields");this.errors=n,this.fields=r}}function vj(e,t,n,r,a){if(t.first){const f=new Promise((m,p)=>{const S=w=>(r(w),w.length?p(new Sc(w,Ti(w))):m(a)),y=jj(e);bc(y,n,S)});return f.catch(m=>m),f}const i=t.firstFields===!0?Object.keys(e):t.firstFields||[],o=Object.keys(e),l=o.length;let c=0;const h=[],g=new Promise((f,m)=>{const p=S=>{if(h.push.apply(h,S),c++,c===l)return r(h),h.length?m(new Sc(h,Ti(h))):f(a)};o.length||(r(h),f(a)),o.forEach(S=>{const y=e[S];i.indexOf(S)!==-1?bc(y,n,p):wj(y,n,p)})});return g.catch(f=>f),g}function Tj(e){return!!(e&&e.message!==void 0)}function Fj(e,t){let n=e;for(let r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function Cc(e,t){return n=>{let r;return e.fullFields?r=Fj(t,e.fullFields):r=t[n.field||e.fullField],Tj(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function wc(e,t){if(t){for(const n in t)if(t.hasOwnProperty(n)){const r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]={...e[n],...r}:e[n]=r}}return e}const Bn="enum",$j=(e,t,n,r,a)=>{e[Bn]=Array.isArray(e[Bn])?e[Bn]:[],e[Bn].indexOf(t)===-1&&r.push(wt(a.messages[Bn],e.fullField,e[Bn].join(", ")))},Rj=(e,t,n,r,a)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(wt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern=="string"&&(new RegExp(e.pattern).test(t)||r.push(wt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))))},Ej=(e,t,n,r,a)=>{const i=typeof e.len=="number",o=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let h=t,g=null;const f=typeof t=="number",m=typeof t=="string",p=Array.isArray(t);if(f?g="number":m?g="string":p&&(g="array"),!g)return!1;p&&(h=t.length),m&&(h=t.replace(c,"_").length),i?h!==e.len&&r.push(wt(a.messages[g].len,e.fullField,e.len)):o&&!l&&h<e.min?r.push(wt(a.messages[g].min,e.fullField,e.min)):l&&!o&&h>e.max?r.push(wt(a.messages[g].max,e.fullField,e.max)):o&&l&&(h<e.min||h>e.max)&&r.push(wt(a.messages[g].range,e.fullField,e.min,e.max))},wd=(e,t,n,r,a,i)=>{e.required&&(!n.hasOwnProperty(e.field)||ot(t,i||e.type))&&r.push(wt(a.messages.required,e.fullField))};let cs;const Ij=(()=>{if(cs)return cs;const e="[a-fA-F\\d:]",t=b=>b&&b.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=`(?:${[`(?:${r}:){7}(?:${r}|:)`,`(?:${r}:){6}(?:${n}|:${r}|:)`,`(?:${r}:){5}(?::${n}|(?::${r}){1,2}|:)`,`(?:${r}:){4}(?:(?::${r}){0,1}:${n}|(?::${r}){1,3}|:)`,`(?:${r}:){3}(?:(?::${r}){0,2}:${n}|(?::${r}){1,4}|:)`,`(?:${r}:){2}(?:(?::${r}){0,3}:${n}|(?::${r}){1,5}|:)`,`(?:${r}:){1}(?:(?::${r}){0,4}:${n}|(?::${r}){1,6}|:)`,`(?::(?:(?::${r}){0,5}:${n}|(?::${r}){1,7}|:))`].join("|")})(?:%[0-9a-zA-Z]{1,})?`,l=new RegExp(`(?:^${n}$)|(?:^${o}$)`),c=new RegExp(`^${n}$`),h=new RegExp(`^${o}$`),g=b=>b&&b.exact?l:new RegExp(`(?:${t(b)}${n}${t(b)})|(?:${t(b)}${o}${t(b)})`,"g");g.v4=b=>b&&b.exact?c:new RegExp(`${t(b)}${n}${t(b)}`,"g"),g.v6=b=>b&&b.exact?h:new RegExp(`${t(b)}${o}${t(b)}`,"g");const f="(?:(?:[a-z]+:)?//)",m="(?:\\S+(?::\\S*)?@)?",p=g.v4().source,S=g.v6().source,j=`(?:${f}|www\\.)${m}(?:localhost|${p}|${S}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return cs=new RegExp(`(?:^${j}$)`,"i"),cs}),Pa={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},wr={integer(e){return wr.number(e)&&parseInt(e,10)===e},float(e){return wr.number(e)&&!wr.integer(e)},array(e){return Array.isArray(e)},regexp(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number(e){return isNaN(e)?!1:typeof e=="number"},object(e){return typeof e=="object"&&!wr.array(e)},method(e){return typeof e=="function"},email(e){return typeof e=="string"&&e.length<=320&&!!e.match(Pa.email)},tel(e){return typeof e=="string"&&e.length<=32&&!!e.match(Pa.tel)},url(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Ij())},hex(e){return typeof e=="string"&&!!e.match(Pa.hex)}},Mj=(e,t,n,r,a)=>{if(e.required&&t===void 0){wd(e,t,n,r,a);return}const i=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],o=e.type;i.indexOf(o)>-1?wr[o](t)||r.push(wt(a.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(wt(a.messages.types[o],e.fullField,e.type))},kj=(e,t,n,r,a)=>{(/^\s+$/.test(t)||t==="")&&r.push(wt(a.messages.whitespace,e.fullField))},Me={required:wd,whitespace:kj,type:Mj,range:Ej,enum:$j,pattern:Rj},Aj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a)}n(i)},Oj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();Me.required(e,t,r,i,a,"array"),t!=null&&(Me.type(e,t,r,i,a),Me.range(e,t,r,i,a))}n(i)},Dj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&Me.type(e,t,r,i,a)}n(i)},Pj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t,"date")&&!e.required)return n();if(Me.required(e,t,r,i,a),!ot(t,"date")){let l;t instanceof Date?l=t:l=new Date(t),Me.type(e,l,r,i,a),l&&Me.range(e,l.getTime(),r,i,a)}}n(i)},Nj="enum",Lj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&Me[Nj](e,t,r,i,a)}n(i)},_j=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&(Me.type(e,t,r,i,a),Me.range(e,t,r,i,a))}n(i)},zj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&(Me.type(e,t,r,i,a),Me.range(e,t,r,i,a))}n(i)},Bj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&Me.type(e,t,r,i,a)}n(i)},Vj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===""&&(t=void 0),ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&(Me.type(e,t,r,i,a),Me.range(e,t,r,i,a))}n(i)},Hj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),t!==void 0&&Me.type(e,t,r,i,a)}n(i)},Yj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t,"string")&&!e.required)return n();Me.required(e,t,r,i,a),ot(t,"string")||Me.pattern(e,t,r,i,a)}n(i)},Uj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t)&&!e.required)return n();Me.required(e,t,r,i,a),ot(t)||Me.type(e,t,r,i,a)}n(i)},Kj=(e,t,n,r,a)=>{const i=[],o=Array.isArray(t)?"array":typeof t;Me.required(e,t,r,i,a,o),n(i)},Wj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t,"string")&&!e.required)return n();Me.required(e,t,r,i,a,"string"),ot(t,"string")||(Me.type(e,t,r,i,a),Me.range(e,t,r,i,a),Me.pattern(e,t,r,i,a),e.whitespace===!0&&Me.whitespace(e,t,r,i,a))}n(i)},us=(e,t,n,r,a)=>{const i=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ot(t,i)&&!e.required)return n();Me.required(e,t,r,o,a,i),ot(t,i)||Me.type(e,t,r,o,a)}n(o)},pr={string:Wj,method:Bj,number:Vj,boolean:Dj,regexp:Uj,integer:zj,float:_j,array:Oj,object:Hj,enum:Lj,pattern:Yj,date:Pj,url:us,hex:us,email:us,tel:us,required:Kj,any:Aj},cn=class cn{constructor(t){ue(this,"rules",null);ue(this,"_messages",Da);this.define(t)}define(t){if(!t)throw new Error("Cannot configure a schema with no rules");if(typeof t!="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach(n=>{const r=t[n];this.rules[n]=Array.isArray(r)?r:[r]})}messages(t){return t&&(this._messages=wc(vi(),t)),this._messages}validate(t,n={},r=()=>{}){let a=t,i=n,o=r;if(typeof i=="function"&&(o=i,i={}),!this.rules||Object.keys(this.rules).length===0)return o&&o(null,a),Promise.resolve(a);function l(f){let m=[],p={};function S(y){Array.isArray(y)?m=m.concat(...y):m.push(y)}for(let y=0;y<f.length;y++)S(f[y]);m.length?(p=Ti(m),o(m,p)):o(null,a)}if(i.messages){let f=this.messages();f===Da&&(f=vi()),wc(f,i.messages),i.messages=f}else i.messages=this.messages();const c={};(i.keys||Object.keys(this.rules)).forEach(f=>{const m=this.rules[f];let p=a[f];m.forEach(S=>{let y=S;typeof y.transform=="function"&&(a===t&&(a={...a}),p=a[f]=y.transform(p),p!=null&&(y.type=y.type||(Array.isArray(p)?"array":typeof p))),typeof y=="function"?y={validator:y}:y={...y},y.validator=this.getValidationMethod(y),y.validator&&(y.field=f,y.fullField=y.fullField||f,y.type=this.getType(y),c[f]=c[f]||[],c[f].push({rule:y,value:p,source:a,field:f}))})});const g={};return vj(c,i,(f,m)=>{var x;const p=f.rule;let S=(p.type==="object"||p.type==="array")&&(typeof p.fields=="object"||typeof p.defaultField=="object");S=S&&(p.required||!p.required&&f.value),p.field=f.field;function y(C,j){return{...j,fullField:`${p.fullField}.${C}`,fullFields:p.fullFields?[...p.fullFields,C]:[C]}}function w(C=[]){let j=Array.isArray(C)?C:[C];!i.suppressWarning&&j.length&&cn.warning("async-validator:",j),j.length&&p.message!==void 0&&p.message!==null&&(j=[].concat(p.message));let b=j.map(Cc(p,a));if(i.first&&b.length)return g[p.field]=1,m(b);if(!S)m(b);else{if(p.required&&!f.value)return p.message!==void 0?b=[].concat(p.message).map(Cc(p,a)):i.error&&(b=[i.error(p,wt(i.messages.required,p.field))]),m(b);let T={};p.defaultField&&Object.keys(f.value).map(E=>{T[E]=p.defaultField}),T={...T,...f.rule.fields};const $={};Object.keys(T).forEach(E=>{const M=T[E],k=Array.isArray(M)?M:[M];$[E]=k.map(y.bind(null,E))});const F=new cn($);F.messages(i.messages),f.rule.options&&(f.rule.options.messages=i.messages,f.rule.options.error=i.error),F.validate(f.value,f.rule.options||i,E=>{const M=[];b&&b.length&&M.push(...b),E&&E.length&&M.push(...E),m(M.length?M:null)})}}let v;if(p.asyncValidator)v=p.asyncValidator(p,f.value,w,f.source,i);else if(p.validator){try{v=p.validator(p,f.value,w,f.source,i)}catch(C){(x=console.error)==null||x.call(console,C),i.suppressValidatorError||setTimeout(()=>{throw C},0),w(C.message)}v===!0?w():v===!1?w(typeof p.message=="function"?p.message(p.fullField||p.field):p.message||`${p.fullField||p.field} fails`):v instanceof Array?w(v):v instanceof Error&&w(v.message)}v&&v.then&&v.then(()=>w(),C=>w(C))},f=>{l(f)},a)}getType(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!pr.hasOwnProperty(t.type))throw new Error(wt("Unknown rule type %s",t.type));return t.type||"string"}getValidationMethod(t){if(typeof t.validator=="function")return t.validator;const n=Object.keys(t),r=n.indexOf("message");return r!==-1&&n.splice(r,1),n.length===1&&n[0]==="required"?pr.required:pr[this.getType(t)]||void 0}};ue(cn,"register",function(n,r){if(typeof r!="function")throw new Error("Cannot register a validator by type, validator is not a function");pr[n]=r}),ue(cn,"warning",Cd),ue(cn,"messages",Da),ue(cn,"validators",pr);let Fi=cn;const mt="'${name}' is not a valid ${type}",jd={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:mt,method:mt,array:mt,object:mt,number:mt,date:mt,boolean:mt,integer:mt,float:mt,regexp:mt,email:mt,tel:mt,url:mt,hex:mt},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},jc=Fi;function qj(e,t){return e.replace(/\\?\$\{\w+\}/g,n=>{if(n.startsWith("\\"))return n.slice(1);const r=n.slice(2,-1);return t[r]})}const vc="CODE_LOGIC_ERROR";async function $i(e,t,n,r,a){const i={...n};if(delete i.ruleIndex,jc.warning=()=>{},i.validator){const m=i.validator;i.validator=(...p)=>{try{return m(...p)}catch(S){return console.error(S),Promise.reject(vc)}}}let o=null;i&&i.type==="array"&&i.defaultField&&(o=i.defaultField,delete i.defaultField);const l=new jc({[e]:[i]}),c=Wn(jd,r.validateMessages);l.messages(c);let h=[];try{await Promise.resolve(l.validate({[e]:t},{...r}))}catch(m){m.errors&&(h=m.errors.map(({message:p},S)=>{const y=p===vc?c.default:p;return be.isValidElement(y)?be.cloneElement(y,{key:`error_${S}`}):y}))}if(!h.length&&o&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((p,S)=>$i(`${e}.${S}`,p,o,r,a)))).reduce((p,S)=>[...p,...S],[]);const g={...n,name:e,enum:(n.enum||[]).join(", "),...a};return h.map(m=>typeof m=="string"?qj(m,g):m)}function Gj(e,t,n,r,a,i){const o=e.join("."),l=n.map((h,g)=>{const f=h.validator,m={...h,ruleIndex:g};return f&&(m.validator=(p,S,y)=>{let w=!1;const x=f(p,S,(...C)=>{Promise.resolve().then(()=>{Ge(!w,"Your validator function has already return a promise. `callback` will be ignored."),w||y(...C)})});w=x&&typeof x.then=="function"&&typeof x.catch=="function",Ge(w,"`callback` is deprecated. Please return a promise instead."),w&&x.then(()=>{y()}).catch(C=>{y(C||" ")})}),m}).sort(({warningOnly:h,ruleIndex:g},{warningOnly:f,ruleIndex:m})=>!!h==!!f?g-m:h?1:-1);let c;if(a===!0)c=new Promise(async(h,g)=>{for(let f=0;f<l.length;f+=1){const m=l[f],p=await $i(o,t,m,r,i);if(p.length){g([{errors:p,rule:m}]);return}}h([])});else{const h=l.map(g=>$i(o,t,g,r,i).then(f=>({errors:f,rule:g})));c=(a?Jj(h):Zj(h)).then(g=>Promise.reject(g))}return c.catch(h=>h),c}async function Zj(e){return Promise.all(e).then(t=>[].concat(...t))}async function Jj(e){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(a=>{a.errors.length&&n([a]),t+=1,t===e.length&&n([])})})})}function nt(e){return ji(e)}function Tc(e,t){let n={};return t.forEach(r=>{const a=Oe(e,r);n=Ue(n,r,a)}),n}function Jn(e,t,n=!1){return e&&e.some(r=>Hs(t,r,n))}function Hs(e,t,n=!1){return!e||!t||!n&&e.length!==t.length?!1:t.every((r,a)=>e[a]===r)}function Xj(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);return[...new Set([...n,...r])].every(i=>{const o=e[i],l=t[i];return typeof o=="function"&&typeof l=="function"?!0:o===l})}function Qj(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function Fc(e,t,n){const{length:r}=e;if(t<0||t>=r||n<0||n>=r)return e;const a=e[t],i=t-n;return i>0?[...e.slice(0,n),a,...e.slice(n,t),...e.slice(t+1,r)]:i<0?[...e.slice(0,t),...e.slice(t+1,n+1),a,...e.slice(n+1,r)]:e}const vd=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class e0{constructor(t){ue(this,"namePathList",[]);ue(this,"taskId",0);ue(this,"watcherList",new Set);ue(this,"form");this.form=t}register(t){return this.watcherList.add(t),()=>{this.watcherList.delete(t)}}notify(t){t.forEach(n=>{this.namePathList.every(r=>!Hs(r,n))&&this.namePathList.push(n)}),this.doBatch()}doBatch(){this.taskId+=1;const t=this.taskId;vd(()=>{if(t===this.taskId&&this.watcherList.size){const n=this.form.getForm(),r=n.getFieldsValue(),a=n.getFieldsValue(!0);this.watcherList.forEach(i=>{i(r,a,this.namePathList)}),this.namePathList=[]}})}}async function t0(){return new Promise(e=>{vd(()=>{Li(()=>{e()})})})}function Ri(){return Ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ri.apply(this,arguments)}const Cn=[],yr=[];function Na(e,t,n,r,a,i){return typeof e=="function"?e(t,n,"source"in i?{source:i.source}:{}):r!==a}class Td extends be.PureComponent{constructor(n){super(n);ue(this,"state",{resetCount:0});ue(this,"cancelRegisterFunc",null);ue(this,"mounted",!1);ue(this,"touched",!1);ue(this,"dirty",!1);ue(this,"validatePromise");ue(this,"prevValidating");ue(this,"errors",Cn);ue(this,"warnings",yr);ue(this,"cancelRegister",()=>{const{preserve:n,isListField:r,name:a}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,nt(a)),this.cancelRegisterFunc=null});ue(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:a=[]}=r;return n!==void 0?[...a,...n]:[]});ue(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(a=>typeof a=="function"?a(r):a)});ue(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});ue(this,"metaCache",null);ue(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const a={...this.getMeta(),destroy:n};ko(this.metaCache,a)||r(a),this.metaCache=a}else this.metaCache=null});ue(this,"onStoreChange",(n,r,a)=>{const{shouldUpdate:i,dependencies:o=[],onReset:l}=this.props,{store:c}=a,h=this.getNamePath(),g=this.getValue(n),f=this.getValue(c),m=r&&Jn(r,h);switch(a.type==="valueUpdate"&&a.source==="external"&&!ko(g,f)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=Cn,this.warnings=yr,this.triggerMetaEvent()),a.type){case"reset":if(!r||m){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=Cn,this.warnings=yr,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&Na(i,n,c,g,f,a)){this.reRender();return}break}case"setField":{const{data:p}=a;if(m){"touched"in p&&(this.touched=p.touched),"validating"in p&&!("originRCField"in p)&&(this.validatePromise=p.validating?Promise.resolve([]):null),"errors"in p&&(this.errors=p.errors||Cn),"warnings"in p&&(this.warnings=p.warnings||yr),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in p&&Jn(r,h,!0)){this.reRender();return}if(i&&!h.length&&Na(i,n,c,g,f,a)){this.reRender();return}break}case"dependenciesUpdate":{if(o.map(nt).some(S=>Jn(a.relatedFields,S))){this.reRender();return}break}default:if(m||(!o.length||h.length||i)&&Na(i,n,c,g,f,a)){this.reRender();return}break}i===!0&&this.reRender()});ue(this,"validateRules",n=>{const r=this.getNamePath(),a=this.getValue(),{triggerName:i,validateOnly:o=!1,delayFrame:l}=n||{},c=Promise.resolve().then(async()=>{if(!this.mounted)return[];const{validateFirst:h=!1,messageVariables:g,validateDebounce:f}=this.props;l&&await t0();let m=this.getRules();if(i&&(m=m.filter(S=>S).filter(S=>{const{validateTrigger:y}=S;return y?ji(y).includes(i):!0})),f&&i&&(await new Promise(S=>{setTimeout(S,f)}),this.validatePromise!==c))return[];const p=Gj(r,a,m,n,h,g);return p.catch(S=>S).then((S=Cn)=>{var y;if(this.validatePromise===c){this.validatePromise=null;const w=[],v=[];(y=S.forEach)==null||y.call(S,({rule:{warningOnly:x},errors:C=Cn})=>{x?v.push(...C):w.push(...C)}),this.errors=w,this.warnings=v,this.triggerMetaEvent(),this.reRender()}}),p});return o||(this.validatePromise=c,this.dirty=!0,this.errors=Cn,this.warnings=yr,this.triggerMetaEvent(),this.reRender()),c});ue(this,"isFieldValidating",()=>!!this.validatePromise);ue(this,"isFieldTouched",()=>this.touched);ue(this,"isFieldDirty",()=>{if(this.dirty||this.props.initialValue!==void 0)return!0;const{fieldContext:n}=this.props,{getInitialValue:r}=n.getInternalHooks(Fn);return r(this.getNamePath())!==void 0});ue(this,"getErrors",()=>this.errors);ue(this,"getWarnings",()=>this.warnings);ue(this,"isListField",()=>this.props.isListField);ue(this,"isList",()=>this.props.isList);ue(this,"isPreserve",()=>this.props.preserve);ue(this,"getMeta",()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:this.validatePromise===null}));ue(this,"getOnlyChild",n=>{if(typeof n=="function"){const a=this.getMeta();return{...this.getOnlyChild(n(this.getControlled(),a,this.props.fieldContext)),isFunction:!0}}const r=pn(n);return r.length!==1||!be.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});ue(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,a=this.getNamePath();return Oe(n||r(!0),a)});ue(this,"getControlled",(n={})=>{const{name:r,trigger:a="onChange",validateTrigger:i,getValueFromEvent:o,normalize:l,valuePropName:c="value",getValueProps:h,fieldContext:g}=this.props,f=i!==void 0?i:g.validateTrigger,m=this.getNamePath(),{getInternalHooks:p,getFieldsValue:S}=g,{dispatch:y}=p(Fn),w=this.getValue(),v=h||(T=>({[c]:T})),x=n[a],C=r!==void 0?v(w):{};process.env.NODE_ENV!=="production"&&C&&Object.keys(C).forEach(T=>{Ge(typeof C[T]!="function",`It's not recommended to generate dynamic function prop by \`getValueProps\`. Please pass it to child component directly (prop: ${T})`)});const j={...n,...C};return j[a]=(...T)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();const $=this.getValue();let F;o?F=o(...T):F=Qj(c,...T),l&&(F=l(F,$,S(!0))),F!==$&&y({type:"updateValue",namePath:m,value:F}),x&&x(...T)},ji(f||[]).forEach(T=>{const $=j[T];j[T]=(...F)=>{$&&$(...F);const{rules:E}=this.props;E&&E.length&&y({type:"validateField",namePath:m,triggerName:T})}}),j});if(n.fieldContext){const{getInternalHooks:r}=n.fieldContext,{initEntityValue:a}=r(Fn);a(this)}}componentDidMount(){const{shouldUpdate:n,fieldContext:r}=this.props;if(this.mounted=!0,r){const{getInternalHooks:a}=r,{registerField:i}=a(Fn);this.cancelRegisterFunc=i(this)}n===!0&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}reRender(){this.mounted&&this.forceUpdate()}render(){const{resetCount:n}=this.state,{children:r}=this.props,{child:a,isFunction:i}=this.getOnlyChild(r);let o;return i?o=a:be.isValidElement(a)?o=be.cloneElement(a,this.getControlled(a.props)):(Ge(!a,"`children` of Field is not validate ReactElement."),o=a),be.createElement(be.Fragment,{key:n},o)}}ue(Td,"contextType",An);function Fd({name:e,...t}){const n=be.useContext(An),r=be.useContext(Vs),a=e!==void 0?nt(e):void 0,i=t.isListField??!!r;let o="keep";return i||(o=`_${(a||[]).join("_")}`),process.env.NODE_ENV!=="production"&&t.preserve===!1&&i&&a.length<=1&&Ge(!1,"`preserve` should not apply on Form.List fields."),be.createElement(Td,Ri({key:o,name:a,isListField:i},t,{fieldContext:n}))}function n0({name:e,initialValue:t,children:n,rules:r,validateTrigger:a,isListField:i}){const o=be.useContext(An),l=be.useContext(Vs),h=be.useRef({keys:[],id:0}).current,g=be.useMemo(()=>[...nt(o.prefixName)||[],...nt(e)],[o.prefixName,e]),f=be.useMemo(()=>({...o,prefixName:g}),[o,g]),m=be.useMemo(()=>({getKey:S=>{const y=g.length,w=S[y];return[h.keys[w],S.slice(y+1)]}}),[h,g]);if(typeof n!="function")return Ge(!1,"Form.List only accepts function as children."),null;const p=(S,y,{source:w})=>w==="internal"?!1:S!==y;return be.createElement(Vs.Provider,{value:m},be.createElement(An.Provider,{value:f},be.createElement(Fd,{name:[],shouldUpdate:p,rules:r,validateTrigger:a,initialValue:t,isList:!0,isListField:i??!!l},({value:S=[],onChange:y},w)=>{const{getFieldValue:v}=o,x=()=>v(g||[])||[],C={add:(b,T)=>{const $=x();T>=0&&T<=$.length?(h.keys=[...h.keys.slice(0,T),h.id,...h.keys.slice(T)],y([...$.slice(0,T),b,...$.slice(T)])):(process.env.NODE_ENV!=="production"&&(T<0||T>$.length)&&Ge(!1,"The second parameter of the add function should be a valid positive number."),h.keys=[...h.keys,h.id],y([...$,b])),h.id+=1},remove:b=>{const T=x(),$=new Set(Array.isArray(b)?b:[b]);$.size<=0||(h.keys=h.keys.filter((F,E)=>!$.has(E)),y(T.filter((F,E)=>!$.has(E))))},move(b,T){if(b===T)return;const $=x();b<0||b>=$.length||T<0||T>=$.length||(h.keys=Fc(h.keys,b,T),y(Fc($,b,T)))}};let j=S||[];return Array.isArray(j)||(j=[],process.env.NODE_ENV!=="production"&&Ge(!1,`Current value of '${g.join(" > ")}' is not an array type.`)),n(j.map((b,T)=>{let $=h.keys[T];return $===void 0&&(h.keys[T]=h.id,$=h.keys[T],h.id+=1),{name:T,key:$,isListField:!0}}),C,w)})))}function r0(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((a,i)=>{e.forEach((o,l)=>{o.catch(c=>(t=!0,c)).then(c=>{n-=1,r[l]=c,!(n>0)&&(t&&i(r),a(r))})})}):Promise.resolve([])}const Ei="__@field_split__";function ds(e){return e.map(t=>`${typeof t}:${t}`).join(Ei)}class Vn{constructor(){ue(this,"kvs",new Map)}set(t,n){this.kvs.set(ds(t),n)}get(t){return this.kvs.get(ds(t))}getAsPrefix(t){const n=ds(t),r=n+Ei,a=[],i=this.kvs.get(n);return i!==void 0&&a.push(i),this.kvs.forEach((o,l)=>{l.startsWith(r)&&a.push(o)}),a}update(t,n){const r=this.get(t),a=n(r);a?this.set(t,a):this.delete(t)}delete(t){this.kvs.delete(ds(t))}map(t){return[...this.kvs.entries()].map(([n,r])=>{const a=n.split(Ei);return t({key:a.map(i=>{const[,o,l]=i.match(/^([^:]*):(.*)$/);return o==="number"?Number(l):l}),value:r})})}toJSON(){const t={};return this.map(({key:n,value:r})=>(t[n.join(".")]=r,null)),t}}class s0{constructor(t){ue(this,"formHooked",!1);ue(this,"forceRootUpdate");ue(this,"subscribable",!0);ue(this,"store",{});ue(this,"fieldEntities",[]);ue(this,"initialValues",{});ue(this,"callbacks",{});ue(this,"validateMessages",null);ue(this,"preserve",null);ue(this,"lastValidatePromise",null);ue(this,"watcherCenter",new e0(this));ue(this,"getForm",()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks}));ue(this,"getInternalHooks",t=>t===Fn?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):(Ge(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));ue(this,"useSubscribe",t=>{this.subscribable=t});ue(this,"prevWithoutPreserves",null);ue(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let a=Wn(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{a=Ue(a,i,Oe(t,i))}),this.prevWithoutPreserves=null,this.updateStore(a)}});ue(this,"destroyForm",t=>{if(t)this.updateStore({});else{const n=new Vn;this.getFieldEntities(!0).forEach(r=>{this.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),this.prevWithoutPreserves=n}});ue(this,"getInitialValue",t=>{const n=Oe(this.initialValues,t);return t.length?Wn(n):n});ue(this,"setCallbacks",t=>{this.callbacks=t});ue(this,"setValidateMessages",t=>{this.validateMessages=t});ue(this,"setPreserve",t=>{this.preserve=t});ue(this,"registerWatch",t=>this.watcherCenter.register(t));ue(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});ue(this,"timeoutId",null);ue(this,"warningUnhooked",()=>{process.env.NODE_ENV!=="production"&&!this.timeoutId&&typeof window<"u"&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.formHooked||Ge(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))});ue(this,"updateStore",t=>{this.store=t});ue(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);ue(this,"getFieldsMap",(t=!1)=>{const n=new Vn;return this.getFieldEntities(t).forEach(r=>{const a=r.getNamePath();n.set(a,r)}),n});ue(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(a=>{const i=nt(a),o=r.getAsPrefix(i);return o.length?o:[{INVALIDATE_NAME_PATH:i}]}):t.map(a=>{const i=nt(a);return r.get(i)||{INVALIDATE_NAME_PATH:nt(a)}})});ue(this,"getFieldsValue",(t,n)=>{this.warningUnhooked();let r,a;if(t===!0||Array.isArray(t)?(r=t,a=n):t&&typeof t=="object"&&(a=t.filter),r===!0&&!a)return this.store;const i=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),o=[],l=[];i.forEach(h=>{var f;const g=h.INVALIDATE_NAME_PATH||h.getNamePath();if((f=h.isList)!=null&&f.call(h)){l.push(g);return}if(!a)o.push(g);else{const m="getMeta"in h?h.getMeta():null;a(m)&&o.push(g)}});let c=Tc(this.store,o.map(nt));return l.forEach(h=>{Oe(c,h)||(c=Ue(c,h,[]))}),c});ue(this,"getFieldValue",t=>{this.warningUnhooked();const n=nt(t);return Oe(this.store,n)});ue(this,"getFieldsError",t=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(t).map((r,a)=>r&&!r.INVALIDATE_NAME_PATH?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:nt(t[a]),errors:[],warnings:[]})));ue(this,"getFieldError",t=>{this.warningUnhooked();const n=nt(t);return this.getFieldsError([n])[0].errors});ue(this,"getFieldWarning",t=>{this.warningUnhooked();const n=nt(t);return this.getFieldsError([n])[0].warnings});ue(this,"isFieldsTouched",(...t)=>{this.warningUnhooked();const[n,r]=t;let a,i=!1;t.length===0?a=null:t.length===1?Array.isArray(n)?(a=n.map(nt),i=!1):(a=null,i=n):(a=n.map(nt),i=r);const o=this.getFieldEntities(!0),l=f=>f.isFieldTouched();if(!a)return i?o.every(f=>l(f)||f.isList()):o.some(l);const c=new Vn;a.forEach(f=>{c.set(f,[])}),o.forEach(f=>{const m=f.getNamePath();a.forEach(p=>{p.every((S,y)=>m[y]===S)&&c.update(p,S=>[...S,f])})});const h=f=>f.some(l),g=c.map(({value:f})=>f);return i?g.every(h):g.some(h)});ue(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));ue(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(a=>a.isFieldValidating());const r=t.map(nt);return n.some(a=>{const i=a.getNamePath();return Jn(r,i)&&a.isFieldValidating()})});ue(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));ue(this,"resetWithFieldInitialValue",(t={})=>{const n=new Vn,r=this.getFieldEntities(!0);r.forEach(o=>{const{initialValue:l}=o.props,c=o.getNamePath();if(l!==void 0){const h=n.get(c)||new Set;h.add({entity:o,value:l}),n.set(c,h)}});const a=o=>{o.forEach(l=>{const{initialValue:c}=l.props;if(c!==void 0){const h=l.getNamePath();if(this.getInitialValue(h)!==void 0)Ge(!1,`Form already set 'initialValues' with path '${h.join(".")}'. Field can not overwrite it.`);else{const f=n.get(h);if(f&&f.size>1)Ge(!1,`Multiple Field with path '${h.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(f){const m=this.getFieldValue(h);!l.isListField()&&(!t.skipExist||m===void 0)&&this.updateStore(Ue(this.store,h,[...f][0].value))}}}})};let i;t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach(o=>{const l=n.get(o);l&&i.push(...[...l].map(c=>c.entity))})):i=r,a(i)});ue(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(Wn(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(nt);r.forEach(a=>{const i=this.getInitialValue(a);this.updateStore(Ue(this.store,a,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});ue(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(a=>{const{name:i,...o}=a,l=nt(i);r.push(l),"value"in o&&this.updateStore(Ue(this.store,l,o.value)),this.notifyObservers(n,[l],{type:"setField",data:a})}),this.notifyWatch(r)});ue(this,"getFields",()=>this.getFieldEntities(!0).map(r=>{const a=r.getNamePath(),o={...r.getMeta(),name:a,value:this.getFieldValue(a)};return Object.defineProperty(o,"originRCField",{value:!0}),o}));ue(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();Oe(this.store,r)===void 0&&this.updateStore(Ue(this.store,r,n))}});ue(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);ue(this,"registerField",t=>{this.fieldEntities.push(t);const n=t.getNamePath();if(this.notifyWatch([n]),t.props.initialValue!==void 0){const r=this.store;this.resetWithFieldInitialValue({entities:[t],skipExist:!0}),this.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,a,i=[])=>{if(this.fieldEntities=this.fieldEntities.filter(o=>o!==t),!this.isMergedPreserve(a)&&(!r||i.length>1)){const o=r?void 0:this.getInitialValue(n);if(n.length&&this.getFieldValue(n)!==o&&this.fieldEntities.every(l=>!Hs(l.getNamePath(),n))){const l=this.store;this.updateStore(Ue(l,n,o,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});ue(this,"dispatch",t=>{switch(t.type){case"updateValue":{const{namePath:n,value:r}=t;this.updateValue(n,r);break}case"validateField":{const{namePath:n,triggerName:r}=t;this.validateFields([n],{triggerName:r});break}}});ue(this,"notifyObservers",(t,n,r)=>{if(this.subscribable){const a={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:i})=>{i(t,n,a)})}else this.forceRootUpdate()});ue(this,"triggerDependenciesUpdate",(t,n)=>{const r=this.getDependencyChildrenFields(n);return r.length&&this.validateFields(r,{delayFrame:!0}),this.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[n,...r]}),r});ue(this,"updateValue",(t,n)=>{const r=nt(t),a=this.store;this.updateStore(Ue(this.store,r,n)),this.notifyObservers(a,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);const i=this.triggerDependenciesUpdate(a,r),{onValuesChange:o}=this.callbacks;if(o){const l=Tc(this.store,[r]),c=this.getFieldsValue(),h=Ue(c,r,Oe(l,r));o(l,h)}this.triggerOnFieldsChange([r,...i])});ue(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=Wn(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});ue(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});ue(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],a=new Vn;this.getFieldEntities().forEach(o=>{const{dependencies:l}=o.props;(l||[]).forEach(c=>{const h=nt(c);a.update(h,(g=new Set)=>(g.add(o),g))})});const i=o=>{(a.get(o)||new Set).forEach(c=>{if(!n.has(c)){n.add(c);const h=c.getNamePath();c.isFieldDirty()&&h.length&&(r.push(h),i(h))}})};return i(t),r});ue(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const a=this.getFields();if(n){const o=new Vn;n.forEach(({name:l,errors:c})=>{o.set(l,c)}),a.forEach(l=>{l.errors=o.get(l.name)||l.errors})}const i=a.filter(({name:o})=>Jn(t,o));i.length&&r(i,a)}});ue(this,"validateFields",(t,n)=>{this.warningUnhooked();let r,a;Array.isArray(t)||typeof t=="string"||typeof n=="string"?(r=t,a=n):a=t;const i=!!r,o=i?r.map(nt):[],l=[...o],c=[],h=String(Date.now()),g=new Set,{recursive:f,dirty:m}=a||{};this.getFieldEntities(!0).forEach(w=>{const v=w.getNamePath();if(i||((!w.isList()||!o.some(x=>Hs(x,v,!0)))&&l.push(v),o.push(v)),!(!w.props.rules||!w.props.rules.length)&&!(m&&!w.isFieldDirty())&&(g.add(v.join(h)),!i||Jn(o,v,f))){const x=w.validateRules({validateMessages:{...jd,...this.validateMessages},...a});c.push(x.then(()=>({name:v,errors:[],warnings:[]})).catch(C=>{var T;const j=[],b=[];return(T=C.forEach)==null||T.call(C,({rule:{warningOnly:$},errors:F})=>{$?b.push(...F):j.push(...F)}),j.length?Promise.reject({name:v,errors:j,warnings:b}):{name:v,errors:j,warnings:b}}))}});const p=r0(c);this.lastValidatePromise=p,p.catch(w=>w).then(w=>{const v=w.map(({name:x})=>x);this.notifyObservers(this.store,v,{type:"validateFinish"}),this.triggerOnFieldsChange(v,w)});const S=p.then(()=>this.lastValidatePromise===p?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(w=>{var C,j;const v=w.filter(b=>b&&b.errors.length),x=(j=(C=v[0])==null?void 0:C.errors)==null?void 0:j[0];return Promise.reject({message:x,values:this.getFieldsValue(o),errorFields:v,outOfDate:this.lastValidatePromise!==p})});S.catch(w=>w);const y=o.filter(w=>g.has(w.join(h)));return this.triggerOnFieldsChange(y),S});ue(this,"submit",()=>{this.warningUnhooked(),this.validateFields().then(t=>{const{onFinish:n}=this.callbacks;if(n)try{n(t)}catch(r){console.error(r)}}).catch(t=>{const{onFinishFailed:n}=this.callbacks;n&&n(t)})});this.forceRootUpdate=t}}function $d(e){const t=be.useRef(null),[,n]=be.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},a=new s0(r);t.current=a.getForm()}return[t.current]}const Ii=be.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),a0=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const a=be.useContext(Ii),i=be.useRef({});return be.createElement(Ii.Provider,{value:{...a,validateMessages:{...a.validateMessages,...e},triggerFormChange:(o,l)=>{t&&t(o,{changedFields:l,forms:i.current}),a.triggerFormChange(o,l)},triggerFormFinish:(o,l)=>{n&&n(o,{values:l,forms:i.current}),a.triggerFormFinish(o,l)},registerForm:(o,l)=>{o&&(i.current={...i.current,[o]:l}),a.registerForm(o,l)},unregisterForm:o=>{const l={...i.current};delete l[o],i.current=l,a.unregisterForm(o)}}},r)};function Mi(){return Mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mi.apply(this,arguments)}const i0=(e,t)=>{const{name:n,initialValues:r,fields:a,form:i,preserve:o,children:l,component:c="form",validateMessages:h,validateTrigger:g="onChange",onValuesChange:f,onFieldsChange:m,onFinish:p,onFinishFailed:S,clearOnDestroy:y,...w}=e,v=be.useRef(null),x=be.useContext(Ii),[C]=$d(i),{useSubscribe:j,setInitialValues:b,setCallbacks:T,setValidateMessages:$,setPreserve:F,destroyForm:E}=C.getInternalHooks(Fn);be.useImperativeHandle(t,()=>({...C,nativeElement:v.current})),be.useEffect(()=>(x.registerForm(n,C),()=>{x.unregisterForm(n)}),[x,C,n]),$({...x.validateMessages,...h}),T({onValuesChange:f,onFieldsChange:(R,...D)=>{x.triggerFormChange(n,R),m&&m(R,...D)},onFinish:R=>{x.triggerFormFinish(n,R),p&&p(R)},onFinishFailed:S}),F(o);const M=be.useRef(null);b(r,!M.current),M.current||(M.current=!0),be.useEffect(()=>()=>E(y),[]);let k;const V=typeof l=="function";if(V){const R=C.getFieldsValue(!0);k=l(R,C)}else k=l;j(!V);const z=be.useRef(null);be.useEffect(()=>{Xj(z.current||[],a||[])||C.setFields(a||[]),z.current=a},[a,C]);const A=be.useMemo(()=>({...C,validateTrigger:g}),[C,g]),I=be.createElement(Vs.Provider,{value:null},be.createElement(An.Provider,{value:A},k));return c===!1?I:be.createElement(c,Mi({},w,{ref:v,onSubmit:R=>{R.preventDefault(),R.stopPropagation(),C.submit()},onReset:R=>{var D;R.preventDefault(),C.resetFields(),(D=w.onReset)==null||D.call(w,R)}}),I)};function La(e){try{return JSON.stringify(e)}catch{return Math.random()}}function o0(...e){const[t,n={}]=e,r=bj(n)?{form:n}:n,a=r.form,[i,o]=d.useState(()=>typeof t=="function"?t({}):void 0),l=d.useMemo(()=>La(i),[i]),c=d.useRef(l);c.current=l;const h=d.useContext(An),g=a||h,f=g&&g._init;process.env.NODE_ENV!=="production"&&Ge(e.length===2?a?f:!0:f,"useWatch requires a form instance since it can not auto detect from context.");const{getFieldsValue:m,getInternalHooks:p}=g,{registerWatch:S}=p(Fn),y=Uc((v,x)=>{const C=r.preserve?x??m(!0):v??m(),j=typeof t=="function"?t(C):Oe(C,nt(t));La(i)!==La(j)&&o(j)}),w=typeof t=="function"?t:JSON.stringify(t);return d.useEffect(()=>{f&&y()},[f,w]),d.useEffect(()=>f?S((x,C)=>{y(x,C)}):void 0,[f]),i}const l0=be.forwardRef(i0),Vr=l0;Vr.FormProvider=a0;Vr.Field=Fd;Vr.List=n0;Vr.useForm=$d;Vr.useWatch=o0;const ur=d.createContext({}),Hr=d.createContext({mode:"edit"}),c0=e=>Array.isArray(e)?e:typeof e=="function"?[e]:pn(e),u0=e=>{var se,pe,ge;const{creatorButtonProps:t,deleteIconProps:n,copyIconProps:r,arrowSort:a,upIconProps:i,downIconProps:o,itemContainerRender:l,itemRender:c,alwaysShowItemLabel:h,prefixCls:g,creatorRecord:f,action:m,actionGuard:p,children:S,actionRender:y,fields:w,meta:v,field:x,index:C,formInstance:j,originName:b,containerClassName:T,containerStyle:$,min:F,max:E,count:M,...k}=e,{hashId:V}=d.useContext(Yt),{componentSize:z}=((pe=(se=u.ConfigProvider).useConfig)==null?void 0:pe.call(se))||{componentSize:"middle"},A=d.useContext(rr),I=d.useRef(!1),{mode:R}=d.useContext(Hr),[D,O]=d.useState(!1),[N,q]=d.useState(!1);d.useEffect(()=>()=>{I.current=!0},[]);const L=()=>j.getFieldValue([A.listName,b,C==null?void 0:C.toString()].flat(1).filter(fe=>fe!=null)),H={getCurrentRowData:L,setCurrentRowData:fe=>{var oe;const J=((oe=j==null?void 0:j.getFieldsValue)==null?void 0:oe.call(j))||{},K=[A.listName,b,C==null?void 0:C.toString()].flat(1).filter(xe=>xe!=null),te=Ue(J,K,{...L(),...fe||{}});return j.setFieldsValue(te)}},G=c0(S).map(fe=>typeof fe=="function"?fe==null?void 0:fe(x,C,{...m,...H},M):fe).map((fe,J)=>{var K;return d.isValidElement(fe)?d.cloneElement(fe,{key:fe.key||((K=fe==null?void 0:fe.props)==null?void 0:K.name)||J,...(fe==null?void 0:fe.props)||{}}):fe}),W=d.useMemo(()=>{if(R==="read"||r===!1||E===M)return null;const{Icon:fe=me.CopyOutlined,tooltipText:J}=r;return s.jsx(u.Tooltip,{title:J,children:N?s.jsx(me.LoadingOutlined,{}):s.jsx(fe,{className:ce(`${g}-action-icon action-copy`,V),onClick:async()=>{q(!0);const K=j==null?void 0:j.getFieldValue([A.listName,b,x.name].filter(te=>te!==void 0).flat(1));await m.add(K,M),q(!1)}})},"copy")},[r,E,M,N,g,V,j,A.listName,x.name,b,m]),B=d.useMemo(()=>{if(R==="read"||n===!1||F===M)return null;const{Icon:fe=me.DeleteOutlined,tooltipText:J}=n;return s.jsx(u.Tooltip,{title:J,children:D?s.jsx(me.LoadingOutlined,{}):s.jsx(fe,{className:ce(`${g}-action-icon action-remove`,V),onClick:async()=>{O(!0),await m.remove(x.name),I.current||O(!1)}})},"delete")},[n,F,M,D,g,V,m,x.name]),_=d.useMemo(()=>{if(!a||R==="read"||i===!1)return null;const fe=C-1;if(fe<0)return null;const{Icon:J=me.ArrowUpOutlined,tooltipText:K}=i;return s.jsx(u.Tooltip,{title:K,children:s.jsx(J,{className:ce(`${g}-action-icon action-up`,V),onClick:async()=>{await m.move(C,fe)}})},"up")},[i,g,V,m,a]),Y=d.useMemo(()=>{if(!a||R==="read"||o===!1)return null;const fe=C+1;if(fe>=M)return null;const{Icon:J=me.ArrowDownOutlined,tooltipText:K}=o;return s.jsx(u.Tooltip,{title:K,children:s.jsx(J,{className:ce(`${g}-action-icon action-down`,V),onClick:async()=>{await m.move(C,fe)}})},"down")},[i,g,V,m,a]),P=d.useMemo(()=>[W,B,_,Y].filter(fe=>fe!=null),[W,B,_,Y]),U=(y==null?void 0:y(x,m,P,M))||P,X=U.length>0&&R!=="read"?s.jsx("div",{className:ce(`${g}-action`,{[`${g}-action-small`]:z==="small"},V),children:U}):null,ne={name:k.name,field:x,index:C,record:(ge=j==null?void 0:j.getFieldValue)==null?void 0:ge.call(j,[A.listName,b,x.name].filter(fe=>fe!==void 0).flat(1)),fields:w,operation:m,meta:v},{grid:Z}=cr(),re=(l==null?void 0:l(G,ne))||G,ie=(c==null?void 0:c({listDom:s.jsx("div",{className:ce(`${g}-container`,T,V),style:{width:Z?"100%":void 0,...$},children:re}),action:X},ne))||s.jsxs("div",{className:ce(`${g}-item`,V,{[`${g}-item-default`]:h===void 0,[`${g}-item-show-label`]:h}),style:{display:"flex",alignItems:"flex-end"},children:[s.jsx("div",{className:ce(`${g}-container`,T,V),style:{width:Z?"100%":void 0,...$},children:re}),X]});return s.jsx(rr.Provider,{value:{...x,listName:[A.listName,b,x.name].filter(fe=>fe!==void 0).flat(1)},children:ie})},d0=e=>{const t=Ie(),{creatorButtonProps:n,prefixCls:r,children:a,creatorRecord:i,action:o,fields:l,actionGuard:c,max:h,fieldExtraRender:g,meta:f,containerClassName:m,containerStyle:p,onAfterAdd:S,onAfterRemove:y}=e,{hashId:w}=d.useContext(Yt),v=d.useRef(new Map),[x,C]=d.useState(!1),j=d.useMemo(()=>l.map(M=>{var V,z,A;(V=v.current)!=null&&V.has(M.key.toString())||(z=v.current)==null||z.set(M.key.toString(),Or());const k=(A=v.current)==null?void 0:A.get(M.key.toString());return{...M,uuid:k}}),[l]),b=d.useMemo(()=>{const M={...o},k=j.length;return c!=null&&c.beforeAddRow?M.add=async(...V)=>{if(await c.beforeAddRow(...V,k)){const A=o.add(...V);return S==null||S(...V,k+1),A}return!1}:M.add=async(...V)=>{const z=o.add(...V);return S==null||S(...V,k+1),z},c!=null&&c.beforeRemoveRow?M.remove=async(...V)=>{if(await c.beforeRemoveRow(...V,k)){const A=o.remove(...V);return y==null||y(...V,k-1),A}return!1}:M.remove=async(...V)=>{const z=o.remove(...V);return y==null||y(...V,k-1),z},M},[o,c==null?void 0:c.beforeAddRow,c==null?void 0:c.beforeRemoveRow,S,y,j.length]),T=d.useMemo(()=>{if(n===!1||j.length===h)return null;const{position:M="bottom",creatorButtonText:k=t.getMessage("editableTable.action.add","添加一行数据")}=n||{};return s.jsx(u.Button,{className:ce(`${r}-creator-button-${M}`,w),type:"dashed",loading:x,block:!0,icon:s.jsx(me.PlusOutlined,{}),...Ve(n||{},["position","creatorButtonText"]),onClick:async()=>{C(!0);let V=j.length;M==="top"&&(V=0),await b.add(ht(i)??{},V),C(!1)},children:k})},[n,j.length,h,t,r,w,x,b,i]),$=d.useContext(Hr),F={width:"max-content",maxWidth:"100%",minWidth:"100%",...p},E=d.useMemo(()=>j.map((M,k)=>d.createElement(u0,{...e,key:M.uuid,field:M,index:k,action:b,count:j.length},a)),[a,e,j,b]);return $.mode==="read"||e.readonly===!0?s.jsx(s.Fragment,{children:E}):s.jsxs("div",{style:F,className:m,children:[n!==!1&&(n==null?void 0:n.position)==="top"&&T,E,g&&g(b,f),n!==!1&&(n==null?void 0:n.position)!=="top"&&T]})},f0=e=>({[`${e.antCls}-pro`]:{[`${e.antCls}-form:not(${e.antCls}-form-horizontal)`]:{[e.componentCls]:{[`&-item:not(${e.componentCls}-item-show-label)`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},[e.componentCls]:{boxSizing:"border-box",maxWidth:"100%","&-item":{"&&-show-label":{[`${e.antCls}-form-item-label`]:{display:"inline-block"}},"&&-default:first-child":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"inline-block"}}}},"&&-default:not(:first-child)":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},"&-action":{display:"flex",height:e.controlHeight,marginBlockEnd:e.marginLG,lineHeight:e.controlHeight+"px","&-small":{height:e.controlHeightSM,lineHeight:e.controlHeightSM}},"&-action-icon":{marginInlineStart:8,cursor:"pointer",transition:"color 0.3s ease-in-out","&:hover":{color:e.colorPrimaryTextHover}},[`${e.proComponentsCls}-card ${e.proComponentsCls}-card-extra`]:{[e.componentCls]:{"&-action":{marginBlockEnd:0}}},"&-creator-button-top":{marginBlockEnd:24}}});function m0(e){return We("ProFormList",t=>{const n={...t,componentCls:`.${e}`};return[f0(n)]})}const{noteOnce:$c}=Ge,rr=d.createContext({});function h0(e){const t=d.useRef(),n=d.useContext(u.ConfigProvider.ConfigContext),r=d.useContext(rr),a=n.getPrefixCls("pro-form-list"),i=Ie(),{setFieldValueType:o}=d.useContext(ur),{transform:l,actionRender:c,creatorButtonProps:h,label:g,alwaysShowItemLabel:f,tooltip:m,creatorRecord:p,itemRender:S,rules:y,itemContainerRender:w,fieldExtraRender:v,copyIconProps:x={Icon:me.CopyOutlined,tooltipText:i.getMessage("copyThisLine","复制此项")},children:C,deleteIconProps:j={Icon:me.DeleteOutlined,tooltipText:i.getMessage("deleteThisLine","删除此项")},arrowSort:b,upIconProps:T={Icon:me.ArrowUpOutlined,tooltipText:i.getMessage("sortUpThisLine","向上排序")},downIconProps:$={Icon:me.ArrowDownOutlined,tooltipText:i.getMessage("sortDownThisLine","向下排序")},actionRef:F,style:E,prefixCls:M,actionGuard:k,min:V,max:z,colProps:A,wrapperCol:I,rowProps:R,onAfterAdd:D,onAfterRemove:O,isValidateList:N=!1,emptyListMessage:q="列表不能为空",className:L,containerClassName:H,containerStyle:G,readonly:W,...B}=e,{ColWrapper:_,RowWrapper:Y}=cr({colProps:A,rowProps:R}),P=d.useContext(_r),U=d.useMemo(()=>r.name===void 0?[B.name].flat(1):[r.name,B.name].flat(1),[r.name,B.name]);d.useImperativeHandle(F,()=>({...t.current,get:Z=>P.formRef.current.getFieldValue([...U,Z]),getList:()=>P.formRef.current.getFieldValue([...U])}),[U,P.formRef]),d.useEffect(()=>{$c(!!P.formRef,"ProFormList 必须要放到 ProForm 中,否则会造成行为异常。"),$c(!!P.formRef,"Proformlist must be placed in ProForm, otherwise it will cause abnormal behavior.")},[P.formRef]),d.useEffect(()=>{!o||!e.name||o([e.name].flat(1).filter(Z=>Z!==void 0),{valueType:"formList",transform:l})},[e.name,o,l]);const{wrapSSR:X,hashId:ne}=m0(a);return P.formRef?X(s.jsx(_,{children:s.jsx("div",{className:ce(a,ne),style:E,children:s.jsx(u.Form.Item,{label:g,prefixCls:M,tooltip:m,style:E,required:y==null?void 0:y.some(Z=>Z.required),wrapperCol:I,className:L,...B,name:N?U:void 0,rules:N?[{validator:(Z,re)=>!re||re.length===0?Promise.reject(new Error(q)):Promise.resolve(),required:!0}]:void 0,children:s.jsx(u.Form.List,{rules:y,...B,name:U,children:(Z,re,ie)=>(t.current=re,s.jsxs(Y,{children:[s.jsx(d0,{name:U,readonly:!!W,originName:B.name,copyIconProps:x,deleteIconProps:j,arrowSort:b,upIconProps:T,downIconProps:$,formInstance:P.formRef.current,prefixCls:a,meta:ie,fields:Z,itemContainerRender:w,itemRender:S,fieldExtraRender:v,creatorButtonProps:h,creatorRecord:p,actionRender:c,action:re,actionGuard:k,alwaysShowItemLabel:f,min:V,max:z,count:Z.length,onAfterAdd:(se,pe,ge)=>{N&&P.formRef.current.validateFields([U]),D==null||D(se,pe,ge)},onAfterRemove:(se,pe)=>{N&&pe===0&&P.formRef.current.validateFields([U]),O==null||O(se,pe)},containerClassName:H,containerStyle:G,children:C}),s.jsx(u.Form.ErrorList,{errors:ie.errors})]}))})})})})):null}const na=({name:e,originDependencies:t=e,children:n,ignoreFormListField:r,...a})=>{const i=d.useContext(_r),o=d.useContext(rr),l=d.useMemo(()=>e.map(c=>{var g;const h=[c];return!r&&o.name!==void 0&&((g=o.listName)!=null&&g.length)&&h.unshift(o.listName),h.flat(1)}),[o.listName,o.name,r,e==null?void 0:e.toString()]);return s.jsx(u.Form.Item,{...a,noStyle:!0,shouldUpdate:(c,h,g)=>{var f;return typeof a.shouldUpdate=="boolean"?a.shouldUpdate:typeof a.shouldUpdate=="function"?(f=a.shouldUpdate)==null?void 0:f.call(a,c,h,g):l.some(m=>!gn(Oe(c,m),Oe(h,m)))},children:c=>{var g,f;let h={};for(let m=0;m<e.length;m++){const p=l[m],S=t[m];let y=(g=i.getFieldFormatValueObject)==null?void 0:g.call(i,p);y&&Object.keys(y).length?(h=_s({},h,y),Oe(y,p)&&(h=Ue(h,[S].flat(1),Oe(y,p)))):(y=(f=c.getFieldValue)==null?void 0:f.call(c,p),typeof y<"u"&&(h=Ue(h,[S].flat(1),y)))}return n==null?void 0:n(h,{...c,...i})}})};na.displayName="ProFormDependency";const g0=d.createContext({}),p0=e=>{var v,x,C;const{children:t,onChange:n,onBlur:r,ignoreFormItem:a,valuePropName:i="value",...o}=e,l=((v=t==null?void 0:t.type)==null?void 0:v.displayName)!=="ProFormComponent",c=!d.isValidElement(t),h=we(function(...j){var b,T,$,F,E;n==null||n(...j),!l&&(c||((T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...j),(E=(F=($=t==null?void 0:t.props)==null?void 0:$.fieldProps)==null?void 0:F.onChange)==null||E.call(F,...j)))}),g=we(function(...j){var b,T,$,F,E;l||c||(r==null||r(...j),(T=(b=t==null?void 0:t.props)==null?void 0:b.onBlur)==null||T.call(b,...j),(E=(F=($=t==null?void 0:t.props)==null?void 0:$.fieldProps)==null?void 0:F.onBlur)==null||E.call(F,...j))}),f=dt(()=>{var j;return Ve(((j=t==null?void 0:t.props)==null?void 0:j.fieldProps)||{},["onBlur","onChange"])},[Ve(((x=t==null?void 0:t.props)==null?void 0:x.fieldProps)||{},["onBlur","onChange"])]),m=e[i],p=d.useMemo(()=>{if(!l&&!c)return lt({id:o.id,[i]:m,...f,onBlur:g,onChange:h})},[m,f,g,h,o.id,i]),S=d.useMemo(()=>{if(!p&&d.isValidElement(t))return(...j)=>{var b,T;n==null||n(...j),(T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...j)}},[p,t,n]);if(!d.isValidElement(t))return s.jsx(s.Fragment,{children:t});const y=o.variant,w=o.fieldProps;return d.cloneElement(t,lt({...o,[i]:e[i],...t.props,onChange:S,...!l&&p?{fieldProps:{...(C=t.props)==null?void 0:C.fieldProps,...w,...p}}:{},...y!==void 0&&{variant:y},onBlur:l&&!c&&typeof r=="function"?r:void 0}))},Rc=({children:e,addonAfter:t,addonBefore:n,valuePropName:r,addonWarpStyle:a,convertValue:i,help:o,...l})=>{const c=d.useMemo(()=>{let h=g=>{const f=(i==null?void 0:i(g,l.name))??g;return l.getValueProps?l.getValueProps(f):{[r||"value"]:f}};return!i&&!l.getValueProps&&(h=void 0),!t&&!n?s.jsx(u.Form.Item,{...l,valuePropName:r,getValueProps:h,children:e}):s.jsx(u.Form.Item,{...l,help:typeof o!="function"?o:void 0,valuePropName:r,_internalItemRender:{mark:"pro_table_render",render:(g,f)=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",...a},children:[n?s.jsx("div",{style:{marginInlineEnd:8},children:n}):null,f.input,t?s.jsx("div",{style:{marginInlineStart:8},children:t}):null]}),typeof o=="function"?o({errors:g.errors,warnings:g.warnings}):f.errorList,f.extra]})},...l,getValueProps:h,children:e})},[t,n,e,i==null?void 0:i.toString(),l]);return s.jsx(g0.Provider,{value:{name:l.name,label:l.label},children:c})},Rd=e=>{var j,b,T,$,F,E;const{componentSize:t}=((b=(j=u.ConfigProvider)==null?void 0:j.useConfig)==null?void 0:b.call(j))||{componentSize:"middle"},n=t,{valueType:r,transform:a,dataFormat:i,ignoreFormItem:o,lightProps:l,children:c,fieldProps:h,...g}=e,f=d.useContext(rr),m=d.useMemo(()=>e.name===void 0?e.name:f.name!==void 0?[f.name,e.name].flat(1):Array.isArray(e.name)?e.name:[e.name],[f.name,e.name]),{setFieldValueType:p,formItemProps:S}=d.useContext(ur);d.useEffect(()=>{!p||!e.name||p(m,{valueType:r||"text",dateFormat:i,transform:a})},[m,i,e.name,p,a,r]);const y=d.isValidElement(e.children)&&_p(r||e.children.props.valueType),w=d.useMemo(()=>!!(!(l!=null&&l.light)||l!=null&&l.customLightMode||y),[l==null?void 0:l.customLightMode,y,l==null?void 0:l.light]);if(typeof e.children=="function")return d.createElement(Rc,{...g,name:m,key:g.proFormFieldKey||((T=g.name)==null?void 0:T.toString())},e.children);const v=s.jsx(p0,{valuePropName:e.valuePropName,children:e.children},g.proFormFieldKey||(($=g.name)==null?void 0:$.toString())),x=lt(l||{}),C=w?v:d.createElement(F0,{...x,key:g.proFormFieldKey||((F=g.name)==null?void 0:F.toString()),size:n},v);return o?s.jsx(s.Fragment,{children:C}):s.jsx(Rc,{...S,...g,name:m,isListField:f.name!==void 0,children:C},g.proFormFieldKey||((E=g.name)==null?void 0:E.toString()))},Ec={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},y0=["switch","radioButton","radio","rate"];function Xn(e,t){e.displayName="ProFormComponent";const n=a=>{const{valueType:i,customLightMode:o,lightFilterLabelFormatter:l,valuePropName:c="value",ignoreWidth:h,defaultProps:g,...f}={...a==null?void 0:a.fieldConfig,...t},{label:m,tooltip:p,placeholder:S,width:y,bordered:w,messageVariables:v,ignoreFormItem:x,transform:C,convertValue:j,readonly:b,allowClear:T,colSize:$,getFormItemProps:F,getFieldProps:E,fieldConfig:M,cacheForSwr:k,proFieldProps:V,...z}={...g,...a},A=i||z.valueType,I=d.useMemo(()=>h||y0.includes(A),[h,A]),[,R]=d.useState(),[D,O]=d.useState(),N=d.useContext(ur),q=dt(()=>({formItemProps:F==null?void 0:F(),fieldProps:E==null?void 0:E()}),[E,F,z.dependenciesValues,D]),L=dt(()=>{const se={...x?lt({value:z.value}):{},placeholder:S,disabled:a.disabled,...N.fieldProps,...q.fieldProps,...z.fieldProps};return se.style=lt(se==null?void 0:se.style),se},[x,z.value,z.fieldProps,S,a.disabled,N.fieldProps,q.fieldProps]),H=Wp(z),G=dt(()=>({...N.formItemProps,...H,...q.formItemProps,...z.formItemProps}),[q.formItemProps,N.formItemProps,z.formItemProps,H]),W=dt(()=>({messageVariables:v,...f,...G}),[f,G,v]),{prefixName:B}=d.useContext(An),_=dt(()=>{let se=W==null?void 0:W.name;return Array.isArray(se)&&(se=se.join("_")),Array.isArray(B)&&se&&(se=`${B.join(".")}.${se}`),se&&`form-${N.formKey??""}-field-${se}`},[mn(W==null?void 0:W.name),B,N.formKey]),Y=we((...se)=>{var pe;F||E?O([]):z.formItemRender&&R([]),(pe=L==null?void 0:L.onChange)==null||pe.call(L,...se)}),P=dt(()=>{const se={width:y&&!Ec[y]?y:N.grid?"100%":void 0,...L==null?void 0:L.style};return I&&Reflect.deleteProperty(se,"width"),lt(se)},[mn(L==null?void 0:L.style),N.grid,I,y]),U=dt(()=>{const se=y&&Ec[y];return ce(L==null?void 0:L.className,{"pro-field":se,[`pro-field-${y}`]:se&&!I})||void 0},[y,L==null?void 0:L.className,I]),X=dt(()=>lt({...N.proFieldProps,mode:z==null?void 0:z.mode,readonly:b,params:z.params,proFieldKey:_,cacheForSwr:k,...V}),[N.proFieldProps,z==null?void 0:z.mode,z.params,b,_,k,V]),ne=dt(()=>({onChange:Y,allowClear:T,...L,style:P,className:U}),[T,U,Y,L,P]),Z=dt(()=>s.jsx(e,{...z,fieldProps:ne,proFieldProps:X,ref:a==null?void 0:a.fieldRef},a.proFormFieldKey||a.name),[X,ne,z]),re=dt(()=>{var se,pe,ge;return s.jsx(Rd,{label:m&&(V==null?void 0:V.light)!==!0?m:void 0,tooltip:(V==null?void 0:V.light)!==!0&&p,valuePropName:c,...W,ignoreFormItem:x,transform:C,dataFormat:L==null?void 0:L.format,valueType:A,messageVariables:{label:m||"",...W==null?void 0:W.messageVariables},convertValue:j,lightProps:lt({...L,variant:z.variant??(L==null?void 0:L.variant),valueType:A,bordered:w,allowClear:((se=Z==null?void 0:Z.props)==null?void 0:se.allowClear)??T,light:V==null?void 0:V.light,label:m,customLightMode:o,labelFormatter:l,valuePropName:c,footerRender:(pe=Z==null?void 0:Z.props)==null?void 0:pe.footerRender,...z.lightProps,...W.lightProps}),children:Z},a.proFormFieldKey||((ge=W.name)==null?void 0:ge.toString()))},[m,V==null?void 0:V.light,p,c,a.proFormFieldKey,W,x,C,L,A,j,w,Z,T,o,l,z.lightProps]),{ColWrapper:ie}=cr(z);return s.jsx(ie,{children:re})};return a=>{const{dependencies:i}=a;return i?s.jsx(na,{name:i,originDependencies:a==null?void 0:a.originDependencies,children:o=>s.jsx(n,{dependenciesValues:o,dependencies:i,...a})}):s.jsx(n,{dependencies:i,...a})}}var Er=function(){return Er=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Er.apply(this,arguments)};function x0(e){var t,n=(typeof window<"u"?window:{}).URL,r=new n((t=window==null?void 0:window.location)===null||t===void 0?void 0:t.href);return Object.keys(e).forEach(function(a){var i=e[a];i!=null?Array.isArray(i)?(r.searchParams.delete(a),i.forEach(function(o){r.searchParams.append(a,o)})):i instanceof Date?Number.isNaN(i.getTime())||r.searchParams.set(a,i.toISOString()):typeof i=="object"?r.searchParams.set(a,JSON.stringify(i)):r.searchParams.set(a,i):r.searchParams.delete(a)}),r}function b0(e,t){var n;e===void 0&&(e={}),t===void 0&&(t={disabled:!1});var r=d.useState(),a=r[1],i=typeof window<"u"&&((n=window==null?void 0:window.location)===null||n===void 0?void 0:n.search),o=d.useMemo(function(){return t.disabled?{}:new URLSearchParams(i||{})},[t.disabled,i]),l=d.useMemo(function(){if(t.disabled)return{};if(typeof window>"u"||!window.URL)return{};var g=[];o.forEach(function(m,p){g.push({key:p,value:m})}),g=g.reduce(function(m,p){return(m[p.key]=m[p.key]||[]).push(p),m},{}),g=Object.keys(g).map(function(m){var p=g[m];return p.length===1?[m,p[0].value]:[m,p.map(function(S){var y=S.value;return y})]});var f=Er({},e);return g.forEach(function(m){var p=m[0],S=m[1];f[p]=C0(p,S,{},e)}),f},[t.disabled,e,o]);function c(g){if(!(typeof window>"u"||!window.URL)){var f=x0(g);window.location.search!==f.search&&window.history.replaceState({},"",f.toString()),o.toString()!==f.searchParams.toString()&&a({})}}d.useEffect(function(){t.disabled||typeof window>"u"||!window.URL||c(Er(Er({},e),l))},[t.disabled,l]);var h=function(g){c(g)};return d.useEffect(function(){if(t.disabled)return function(){};if(typeof window>"u"||!window.URL)return function(){};var g=function(){a({})};return window.addEventListener("popstate",g),function(){window.removeEventListener("popstate",g)}},[t.disabled]),[l,h]}var S0={true:!0,false:!1};function C0(e,t,n,r){if(!n)return t;var a=n[e],i=t===void 0?r[e]:t;return a===Number?Number(i):a===Boolean||t==="true"||t==="false"?S0[i]:Array.isArray(a)?a.find(function(o){return o==i})||r[e]:i}const w0=e=>{const t=Ie(),n=u.Form.useFormInstance();if(e.render===!1)return null;const{onSubmit:r,render:a,onReset:i,searchConfig:o={},submitButtonProps:l,resetButtonProps:c}=e,{token:h}=hn.useToken(),g=()=>{n.submit(),r==null||r()},f=()=>{n.resetFields(),i==null||i()},{submitText:m=t.getMessage("tableForm.submit","提交"),resetText:p=t.getMessage("tableForm.reset","重置")}=o,S=[];c!==!1&&S.push(d.createElement(u.Button,{...Ve(c??{},["preventDefault","fieldProps"]),key:"rest",onClick:w=>{var v;c!=null&&c.preventDefault||f(),(v=c==null?void 0:c.onClick)==null||v.call(c,w)}},p)),l!==!1&&S.push(d.createElement(u.Button,{type:"primary",...Ve(l||{},["preventDefault","fieldProps"]),key:"submit",onClick:w=>{var v;l!=null&&l.preventDefault||g(),(v=l==null?void 0:l.onClick)==null||v.call(l,w)}},m));const y=a?a({...e,form:n,submit:g,reset:f},S):S;return y?Array.isArray(y)?(y==null?void 0:y.length)<1?null:(y==null?void 0:y.length)===1?y[0]:s.jsx("div",{style:{display:"flex",gap:h.marginXS,alignItems:"center"},children:y}):y:null},{noteOnce:Ic}=Ge,Is=(e,t,n)=>e===!0?t:ht(e,t,n),fs=e=>!e||Array.isArray(e)?e:[e],Ed={};function j0(e){var N,q;const{children:t,contentRender:n,submitter:r,fieldProps:a,formItemProps:i,groupProps:o,transformKey:l,formRef:c,onInit:h,form:g,loading:f,formComponentType:m,extraUrlParams:p=Ed,syncToUrl:S,onUrlSearchChange:y,onReset:w,omitNil:v=!0,isKeyPressSubmit:x,autoFocusFirstInput:C=!0,grid:j,rowProps:b,colProps:T,...$}=e,F=u.Form.useFormInstance(),{componentSize:E}=((q=(N=u.ConfigProvider)==null?void 0:N.useConfig)==null?void 0:q.call(N))||{componentSize:"middle"},M=d.useRef(g||F),{RowWrapper:k}=cr({grid:j,rowProps:b}),V=we(()=>F),z=d.useMemo(()=>({getFieldsFormatValue:(L,H)=>{const G=V();if(!G)return{};const W=G.getFieldsValue(L);return l(W,H!==void 0?H:v)},getFieldFormatValue:(L=[],H)=>{const G=V();if(!G)return;const W=fs(L);if(!W)throw new Error("nameList is require");const B=G.getFieldValue(W),_=W?Ue({},W,B):B,Y=[...W];Y.shift();const P=l(_,H!==void 0?H:v,Y),U=Oe(P,W);if(U&&typeof U=="object"&&!Array.isArray(U)){const X=Object.values(U)[0];return Array.isArray(X),X}return U},getFieldFormatValueObject:(L,H)=>{const G=V();if(!G)return{};const W=fs(L),B=G.getFieldValue(W),_=W?Ue({},W,B):B;return l(_,H!==void 0?H:v,W)},validateFieldsReturnFormatValue:async(L,H)=>{const G=V();if(!G)return{};if(!Array.isArray(L)&&L)throw new Error("nameList must be array");const W=await G.validateFields(L),B=l(W,H!==void 0?H:v);return B||{}}}),[v,l,V]),A=d.useMemo(()=>d.Children.toArray(t).map((L,H)=>H===0&&d.isValidElement(L)&&C?Wi(L,C):L),[C,t]),I=d.useMemo(()=>typeof r=="boolean"||!r?{}:r,[r]),R=d.useMemo(()=>{if(r!==!1)return s.jsx(w0,{...I,onReset:()=>{var H,G,W;const L=l((H=M.current)==null?void 0:H.getFieldsValue(),v);if((G=I==null?void 0:I.onReset)==null||G.call(I,L),w==null||w(L),S){const B=Object.keys(l((W=M.current)==null?void 0:W.getFieldsValue(),!1)).reduce((_,Y)=>({..._,[Y]:L[Y]||void 0}),p);y(Is(S,B||{},"set"))}},submitButtonProps:{loading:f,...I.submitButtonProps}},"submitter")},[r,I,f,l,v,w,S,p,y]),D=d.useMemo(()=>{const L=j?s.jsx(k,{children:A}):A;return n?n(L,R,M.current):L},[j,k,A,n,R]),O=$r(e.initialValues);return d.useEffect(()=>{if(S||!e.initialValues||!O||$.request)return;const L=gn(e.initialValues,O);Ic(L,"initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null "),Ic(L,"The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null ")},[e.initialValues]),d.useImperativeHandle(c,()=>({...M.current,getFieldsFormatValue:(L,H)=>{const G=M.current;if(!G)return{};const W=G.getFieldsValue(L);return l(W,H!==void 0?H:v)},getFieldFormatValue:(L=[],H)=>{const G=M.current;if(!G)return;const W=fs(L);if(!W)throw new Error("nameList is require");const B=G.getFieldValue(W),_=W?Ue({},W,B):B,Y=[...W];Y.shift();const P=l(_,H!==void 0?H:v,Y),U=Oe(P,W);if(U&&typeof U=="object"&&!Array.isArray(U)){const X=Object.values(U)[0];return Array.isArray(X),X}return U},getFieldFormatValueObject:(L,H)=>{const G=M.current;if(!G)return{};const W=fs(L),B=G.getFieldValue(W),_=W?Ue({},W,B):B;return l(_,H!==void 0?H:v,W)},validateFieldsReturnFormatValue:async(L,H)=>{const G=M.current;if(!G)return{};if(!Array.isArray(L)&&L)throw new Error("nameList must be array");const W=await G.validateFields(L),B=l(W,H!==void 0?H:v);return B||{}}}),[v,l,M.current]),d.useEffect(()=>{var H,G;const L=l((G=(H=M.current)==null?void 0:H.getFieldsValue)==null?void 0:G.call(H,!0),v);h==null||h(L,{...M.current,...z})},[]),s.jsx(_r.Provider,{value:{...z,formRef:M},children:s.jsx(u.ConfigProvider,{componentSize:$.size||E,children:s.jsxs(ao.Provider,{value:{grid:j,colProps:T},children:[$.component!==!1&&s.jsx("input",{type:"text",style:{display:"none"}}),D]})})})}let Mc=0;function dr(e){const{extraUrlParams:t=Ed,syncToUrl:n,isKeyPressSubmit:r,syncToUrlAsImportant:a=!1,syncToInitialValues:i=!0,children:o,contentRender:l,submitter:c,fieldProps:h,proFieldProps:g,formItemProps:f,groupProps:m,dateFormatter:p="string",formRef:S,onInit:y,form:w,formComponentType:v,onReset:x,grid:C,rowProps:j,colProps:b,omitNil:T=!0,request:$,params:F,initialValues:E,formKey:M=Mc,readonly:k,onLoadingChange:V,loading:z,...A}=e,I=d.useRef({}),[R,D]=rt(!1,z),O=we(ge=>{V==null||V(ge)}),N=d.useCallback(ge=>{D(fe=>{const J=typeof ge=="function"?ge(fe):ge;return queueMicrotask(()=>{O(J)}),J})},[O]),[q,L]=b0({},{disabled:!n}),H=d.useRef(Or());d.useEffect(()=>{Mc+=0},[]);const[G,W]=Dp({request:$,params:F,proFieldKey:M}),{getPrefixCls:B}=d.useContext(u.ConfigProvider.ConfigContext),_=B("pro-form"),{wrapSSR:Y,hashId:P}=We("ProForm",ge=>({[`.${_}`]:{[`> div:not(${ge.proComponentsCls}-form-light-filter)`]:{".pro-field":{maxWidth:"100%","@media screen and (max-width: 575px)":{maxWidth:"calc(93vw - 48px)"},"&-xs":{width:104},"&-s":{width:216},"&-sm":{width:216},"&-m":{width:328},"&-md":{width:328},"&-l":{width:440},"&-lg":{width:440},"&-xl":{width:552}}}}})),[U,X]=d.useState(()=>n?Is(n,q,"get"):{}),ne=d.useRef({}),Z=d.useRef({}),re=we((ge,fe,J)=>!ge||typeof ge!="object"?ge:OC(di(ge,p,Z.current,fe,J),ne.current));d.useEffect(()=>{i||X({})},[i]);const ie=we(()=>({...q,...t}));d.useEffect(()=>{n&&L(Is(n,ie(),"set"))},[t,ie,n]);const se=d.useMemo(()=>{if(!(typeof window>"u")&&v&&["DrawerForm"].includes(v))return ge=>ge.parentNode||document.body},[v]),pe=we(async()=>{var ge,fe,J,K;if(A.onFinish&&!R)try{N(!0);const te=((fe=(ge=I==null?void 0:I.current)==null?void 0:ge.getFieldsFormatValue)==null?void 0:fe.call(ge))||{},oe=A.onFinish(te);if(oe&&typeof oe=="object"&&typeof oe.then=="function"){try{await oe}catch(xe){throw N(!1),xe}N(!1)}else N(!1);if(n){const xe=Object.keys(((K=(J=I==null?void 0:I.current)==null?void 0:J.getFieldsFormatValue)==null?void 0:K.call(J,!0,!1))||{}).reduce((ae,ee)=>({...ae,[ee]:te[ee]??void 0}),t);Object.keys(q).forEach(ae=>{xe[ae]!==!1&&xe[ae]!==0&&!xe[ae]&&(xe[ae]=void 0)}),L(Is(n,xe,"set"))}}catch{N(!1)}});return d.useImperativeHandle(S,()=>I.current,[!G]),$&&W?s.jsx("div",{style:{paddingTop:50,paddingBottom:50,textAlign:"center"},children:s.jsx(u.Spin,{})}):Y(s.jsx(Hr.Provider,{value:{mode:e.readonly?"read":"edit"},children:s.jsx(Mn,{needDeps:!0,children:s.jsx(ur.Provider,{value:{formRef:I,fieldProps:h,proFieldProps:g,formItemProps:f,groupProps:m,formComponentType:v,getPopupContainer:se,formKey:H.current,setFieldValueType:(ge,{valueType:fe="text",dateFormat:J,transform:K})=>{Array.isArray(ge)&&(K&&(ne.current=Ue(ne.current,ge,K)),Z.current=Ue(Z.current,ge,{valueType:fe,dateFormat:J}))}},children:s.jsx(rr.Provider,{value:{},children:s.jsx(u.Form,{onKeyDown:ge=>{var fe;r&&ge.key==="Enter"&&((fe=I.current)==null||fe.submit())},autoComplete:"off",form:w,...Ve(A,["ref","labelWidth","autoFocusFirstInput","rootClassName"]),ref:ge=>{I.current&&(I.current.nativeElement=ge==null?void 0:ge.nativeElement,I.current.focus=()=>{var J;const fe=(J=ge==null?void 0:ge.nativeElement)==null?void 0:J.querySelector("input, textarea, select");fe==null||fe.focus()})},initialValues:a?{...E,...G,...U}:{...U,...E,...G},onValuesChange:(ge,fe)=>{var J;(J=A==null?void 0:A.onValuesChange)==null||J.call(A,re(ge,!!T),re(fe,!!T))},className:e.className,rootClassName:ce(_,P,e.rootClassName),onFinish:pe,children:s.jsx(j0,{transformKey:re,autoComplete:"off",loading:R||!!($&&!G&&W),onUrlSearchChange:L,...e,formRef:I,initialValues:{...E,...G}})})})})})}))}const v0=e=>({[`${e.componentCls}-collapse-label`]:{boxSizing:"border-box",paddingInline:1,paddingBlock:1},[`${e.componentCls}-container`]:{boxSizing:"border-box",[`${e.antCls}-form-item`]:{marginBlockEnd:0}}});function T0(e){return We("LightWrapper",t=>{const n={...t,componentCls:`.${e}`};return[v0(n)]})}const F0=e=>{var z;const{label:t,size:n,disabled:r,onChange:a,className:i,style:o,children:l,valuePropName:c,placeholder:h,labelFormatter:g,variant:f,footerRender:m,allowClear:p,otherFieldProps:S,valueType:y,placement:w,...v}=e,{getPrefixCls:x}=d.useContext(u.ConfigProvider.ConfigContext),C=x("pro-field-light-wrapper"),{wrapSSR:j,hashId:b}=T0(C),[T,$]=d.useState(e[c]),[F,E]=d.useState(!1),M=(...A)=>{var I;(I=S==null?void 0:S.onChange)==null||I.call(S,...A),a==null||a(...A)},k=e[c],V=d.useMemo(()=>{var I;if(!k)return k;const A=(I=y==null?void 0:y.toLowerCase)==null?void 0:I.call(y);return A!=null&&A.endsWith("range")&&A!=="digitrange"&&!g?Fp(k,y&&qi[y]||"YYYY-MM-DD"):Array.isArray(k)?k.map(R=>typeof R=="object"&&R.label&&R.value?R.label:R):k},[k,y,g]);return j(s.jsx(Ou,{disabled:r,open:F,onOpenChange:E,placement:w,label:s.jsx(Ut,{ellipsis:!0,size:n,onClear:()=>{M==null||M(),$(null)},variant:f,style:o,className:i,label:t,placeholder:h,value:V,disabled:r,formatter:g,allowClear:p}),footer:{onClear:()=>$(null),onConfirm:()=>{M==null||M(T),E(!1)}},footerRender:m,children:s.jsx("div",{className:ce(`${C}-container`,b,i),style:o,children:d.cloneElement(l,{...v,[c]:T,onChange:A=>{$(A!=null&&A.target?A.target.value:A)},...l.props,variant:"borderless",fieldProps:{...(z=l.props)==null?void 0:z.fieldProps,variant:"borderless"}})})}))},$0=e=>{const{fieldProps:t,children:n,labelCol:r,label:a,autoFocus:i,isDefaultDom:o,render:l,proFieldProps:c,formItemRender:h,valueType:g,initialValue:f,onChange:m,valueEnum:p,params:S,name:y,dependenciesValues:w,cacheForSwr:v=!1,valuePropName:x="value",...C}=e,j=d.useContext(Hr),b=d.useMemo(()=>w&&C.request?{...S,...w||{}}:S,[w,S,C.request]),T=we((...E)=>{var M;if(t!=null&&t.onChange){(M=t==null?void 0:t.onChange)==null||M.call(t,...E);return}}),$=d.useMemo(()=>({autoFocus:i,...t,onChange:T}),[i,t,T]),F=d.useMemo(()=>{if(n)return d.isValidElement(n)?d.cloneElement(n,{...C,onChange:(...E)=>{var M;if(t!=null&&t.onChange){(M=t==null?void 0:t.onChange)==null||M.call(t,...E);return}m==null||m(...E)},...(n==null?void 0:n.props)||{}}):s.jsx(s.Fragment,{children:n})},[n,t==null?void 0:t.onChange,m,C]);return F||s.jsx(yj,{text:t==null?void 0:t[x],render:l,formItemRender:h,valueType:g||"text",cacheForSwr:v,fieldProps:$,valueEnum:ht(p),...c,...C,mode:(c==null?void 0:c.mode)||j.mode||"edit",params:b})},bn=Xn==null?void 0:Xn($0),R0=({fieldProps:e,min:t,proFieldProps:n,max:r,...a},i)=>s.jsx(Mn,{valueTypeMap:{digit:{render:(o,l)=>s.jsx(zs,{...l,text:o,placeholder:l.placeholder}),formItemRender:(o,l)=>s.jsx(zs,{...l,text:o,placeholder:l.placeholder})}},children:s.jsx(bn,{valueType:"digit",fieldProps:{min:t,max:r,...e},ref:i,fieldConfig:{defaultProps:{width:"100%"}},proFieldProps:n,...a})}),E0=d.forwardRef(R0),I0={space:u.Space,group:u.Space.Compact};function M0(e,...t){const n=t[0];return n&&n.target&&e in n.target?n.target[e]:n}const k0=e=>{const{children:t,value:n=[],valuePropName:r,onChange:a,fieldProps:i,space:o,type:l="space",transform:c,convertValue:h,lightProps:g,...f}=e,m=we((x,C)=>{var b;const j=[...n];j[C]=M0(r||"value",x),a==null||a(j),(b=i==null?void 0:i.onChange)==null||b.call(i,j)});let p=-1;const S=pn(ht(t,n,e)).map(x=>{var C,j,b;if(d.isValidElement(x)){p+=1;const T=p,F=((C=x==null?void 0:x.type)==null?void 0:C.displayName)==="ProFormComponent"||((j=x==null?void 0:x.props)==null?void 0:j.readonly)?{key:T,ignoreFormItem:!0,...x.props||{},fieldProps:{...(b=x==null?void 0:x.props)==null?void 0:b.fieldProps,onChange:(...E)=>{m(E[0],T)}},value:n==null?void 0:n[T],onChange:void 0}:{key:T,...x.props||{},value:n==null?void 0:n[T],onChange:E=>{var M,k;m(E,T),(k=(M=x.props).onChange)==null||k.call(M,E)}};return d.cloneElement(x,F)}return x}),y=I0[l],{RowWrapper:w}=cr(f),v=d.useCallback(({children:x})=>{const C={...o,align:"start"};return l==="space"&&(o==null?void 0:o.wrap)!==void 0&&(C.wrap=o.wrap),s.jsx(y,{...C,children:x})},[y,o,l]);return s.jsx(w,{Wrapper:v,children:S})},A0=d.forwardRef(({children:e,space:t,valuePropName:n,...r},a)=>(d.useImperativeHandle(a,()=>({})),s.jsx(k0,{space:t,valuePropName:n,...r.fieldProps,onChange:void 0,...r,children:e}))),O0=Xn==null?void 0:Xn(A0),D0=e=>({[e.componentCls]:{boxSizing:"border-box","&-title":{marginBlockEnd:e.marginXL,fontWeight:"bold"},"&-container":{flexWrap:"wrap",maxWidth:"100%",[`> div${e.antCls}-space-item`]:{maxWidth:"100%"}},"&-twoLine":{display:"block",width:"100%",[`${e.componentCls}-title`]:{width:"100%",margin:"8px 0"},[`${e.componentCls}-container`]:{paddingInlineStart:16},[`${e.antCls}-space-item,${e.antCls}-form-item`]:{width:"100%"},[`${e.antCls}-form-item`]:{"&-control":{display:"flex",alignItems:"center",justifyContent:"flex-end","&-input":{alignItems:"center",justifyContent:"flex-end","&-content":{flex:"none"}}}}}}});function P0(e){return We("ProFormGroup",t=>{const n={...t,componentCls:`.${e}`};return[D0(n)]})}const Id=d.forwardRef((e,t)=>{const{groupProps:n}=d.useContext(ur),{children:r,collapsible:a,defaultCollapsed:i,style:o,labelLayout:l,title:c=e.label,tooltip:h,align:g="start",direction:f,size:m=32,titleStyle:p,titleRender:S,spaceProps:y,extra:w,autoFocus:v}={...n,...e},[x,C]=rt(()=>i||!1,e.collapsed),j=we(O=>{var N;(N=e.onCollapse)==null||N.call(e,O)}),b=d.useCallback(O=>{C(N=>{const q=typeof O=="function"?O(N):O;return queueMicrotask(()=>{j(q)}),q})},[j]),{getPrefixCls:T}=d.useContext(u.ConfigProvider.ConfigContext),{ColWrapper:$,RowWrapper:F}=cr(e),E=T("pro-form-group"),{wrapSSR:M,hashId:k}=P0(E),V=a&&s.jsx(me.RightOutlined,{style:{marginInlineEnd:8},rotate:x?void 0:90}),z=s.jsx(er,{label:V?s.jsxs("div",{children:[V,c]}):c,tooltip:h}),A=d.useCallback(({children:O})=>s.jsx(u.Space,{...y,className:ce(`${E}-container ${k}`,y==null?void 0:y.className),size:m,align:g,orientation:f,style:{rowGap:0,...y==null?void 0:y.style},children:O}),[g,E,f,k,m,y]),I=S?S(z,e):z,[R,D]=d.useMemo(()=>{const O=[],N=d.Children.toArray(r).map((q,L)=>{var H;return d.isValidElement(q)&&((H=q==null?void 0:q.props)!=null&&H.hidden)?(O.push(q),null):L===0&&d.isValidElement(q)&&v?Wi(q,v):q});return[s.jsx(F,{Wrapper:A,children:N},"children"),O.length>0?s.jsx("div",{style:{display:"none"},children:O},"hidden"):null]},[r,F,A,v]);return M(s.jsx($,{children:s.jsxs("div",{className:ce(E,k,{[`${E}-twoLine`]:l==="twoLine"}),style:o,ref:t,children:[D,(c||h||w)&&s.jsx("div",{role:"button",tabIndex:0,className:ce(`${E}-title`,k),style:p,onClick:()=>{b(!x)},onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),b(!x))},children:w?s.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[I,s.jsx("span",{role:"presentation",onClick:O=>O.stopPropagation(),onKeyDown:O=>O.stopPropagation(),children:w})]}):I}),s.jsx("div",{style:{display:a&&x?"none":void 0},children:R})]})}))});Id.displayName="ProForm-Group";const N0=e=>({[e.componentCls]:{boxSizing:"border-box","&-sidebar-dragger":{width:"5px",cursor:"ew-resize",padding:"4px 0 0",borderTop:"1px solid transparent",position:"absolute",top:0,left:0,bottom:0,zIndex:100,backgroundColor:"transparent","&-min-disabled":{cursor:"w-resize"},"&-max-disabled":{cursor:"e-resize"}}}});function L0(e){return We("DrawerForm",t=>{const n={...t,componentCls:`.${e}`};return[N0(n)]})}const{noteOnce:_0}=Ge;function z0({children:e,trigger:t,drawerProps:n,onFinish:r,submitTimeout:a,title:i,width:o,resize:l,onOpenChange:c,open:h,...g}){var H,G,W,B;_0(!g.footer||!(n!=null&&n.footer),"DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const f=d.useMemo(()=>{const _={onResize:()=>{},maxWidth:Xi()?window.innerWidth*.8:void 0,minWidth:300};return typeof l=="boolean"?l?_:{}:lt({onResize:(l==null?void 0:l.onResize)??_.onResize,maxWidth:(l==null?void 0:l.maxWidth)??_.maxWidth,minWidth:(l==null?void 0:l.minWidth)??_.minWidth})},[l]),m=d.useContext(u.ConfigProvider.ConfigContext),p=m.getPrefixCls("pro-form-drawer"),{wrapSSR:S,hashId:y}=L0(p),w=_=>`${p}-${_}`,[,v]=d.useState([]),[x,C]=d.useState(!1),[j,b]=d.useState(!1),[T,$]=d.useState(o||(l?f==null?void 0:f.minWidth:800)),[F,E]=rt(!!h,h),M=we(_=>{c==null||c(_)}),k=d.useCallback(_=>{E(Y=>{const P=typeof _=="function"?_(Y):_;return queueMicrotask(()=>{M(P)}),P})},[M]),V=d.useRef(null),z=d.useCallback(_=>{V.current===null&&_&&v([]),V.current=_},[]),A=d.useRef(),I=d.useCallback(()=>{var Y;const _=((Y=g.formRef)==null?void 0:Y.current)??g.form??A.current;_&&(n!=null&&n.destroyOnHidden)&&typeof _.resetFields=="function"&&_.resetFields()},[n==null?void 0:n.destroyOnHidden,g.form,g.formRef]);d.useEffect(()=>{F&&h&&(c==null||c(!0)),j&&$(f==null?void 0:f.minWidth)},[h,F,j]),d.useImperativeHandle(g.formRef,()=>A.current,[A.current]);const R=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async _=>{var Y,P;k(!F),b(!Object.keys(f)),(P=(Y=t.props)==null?void 0:Y.onClick)==null||P.call(Y,_)}}):null,[k,t,F,b,j]),D=d.useMemo(()=>{var _,Y,P,U;return g.submitter===!1?!1:Wn({searchConfig:{submitText:((Y=(_=m.locale)==null?void 0:_.Modal)==null?void 0:Y.okText)??"确认",resetText:((U=(P=m.locale)==null?void 0:P.Modal)==null?void 0:U.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:a&&x,onClick:X=>{var ne;k(!1),(ne=n==null?void 0:n.onClose)==null||ne.call(n,X)}}},g.submitter??{})},[g.submitter,(G=(H=m.locale)==null?void 0:H.Modal)==null?void 0:G.okText,(B=(W=m.locale)==null?void 0:W.Modal)==null?void 0:B.cancelText,a,x,k,n]),O=d.useCallback((_,Y)=>s.jsxs(s.Fragment,{children:[_,V.current&&Y?s.jsx(d.Fragment,{children:zc.createPortal(Y,V.current)},"submitter"):Y]}),[]),N=we(async _=>{const Y=r==null?void 0:r(_);if(a&&Y instanceof Promise){C(!0);const U=setTimeout(()=>C(!1),a);try{const X=await Y;return clearTimeout(U),C(!1),X&&k(!1),X}catch(X){throw clearTimeout(U),C(!1),X}}else if(a){C(!0);const U=setTimeout(()=>C(!1),a);try{const X=await Y;return clearTimeout(U),C(!1),X&&k(!1),X}catch(X){throw clearTimeout(U),C(!1),X}}const P=await Y;return P&&k(!1),P}),q=d.useCallback(_=>{const Y=(document.body.offsetWidth||1e3)-(_.clientX-document.body.offsetLeft),P=(f==null?void 0:f.minWidth)??(o||800),U=(f==null?void 0:f.maxWidth)??window.innerWidth*.8;if(Y<P){$(P);return}if(Y>U){$(U);return}$(Y)},[f==null?void 0:f.maxWidth,f==null?void 0:f.minWidth,o]),L=d.useCallback(()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",L)},[q]);return S(s.jsxs(s.Fragment,{children:[s.jsxs(u.Drawer,{...n,destroyOnHidden:n==null?void 0:n.destroyOnHidden,title:i,size:T,open:F,afterOpenChange:_=>{var Y;!_&&(n!=null&&n.destroyOnHidden)&&I(),(Y=n==null?void 0:n.afterOpenChange)==null||Y.call(n,_),c==null||c(_)},onClose:_=>{var Y;a&&x||(k(!1),(Y=n==null?void 0:n.onClose)==null||Y.call(n,_))},footer:g.submitter!==!1&&s.jsx("div",{ref:z,style:{display:"flex",justifyContent:"flex-end"}}),children:[l?s.jsx("div",{className:ce(w("sidebar-dragger"),y,{[w("sidebar-dragger-min-disabled")]:T===(f==null?void 0:f.minWidth),[w("sidebar-dragger-max-disabled")]:T===(f==null?void 0:f.maxWidth)}),onMouseDown:_=>{var Y;(Y=f==null?void 0:f.onResize)==null||Y.call(f),_.stopPropagation(),_.preventDefault(),document.addEventListener("mousemove",q),document.addEventListener("mouseup",L),b(!0)}}):null,s.jsx(s.Fragment,{children:s.jsx(dr,{formComponentType:"DrawerForm",layout:"vertical",...g,formRef:A,onInit:(_,Y)=>{var P;g.formRef&&(g.formRef.current=Y),(P=g==null?void 0:g.onInit)==null||P.call(g,_,Y),A.current=Y},submitter:D,onFinish:async _=>await N(_),contentRender:O,children:e})})]}),R]}))}const B0=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"30px","&::before":{display:"block",height:0,visibility:"hidden",content:"'.'"},"&-small":{lineHeight:e.lineHeight},"&-container":{display:"flex",flexWrap:"wrap",gap:e.marginXS},"&-item":{whiteSpace:"nowrap",[`${e.antCls}-form-item`]:{marginBlock:0}},"&-line":{minWidth:"198px"},"&-line:not(:first-child)":{marginBlockStart:"16px",marginBlockEnd:8},"&-collapse-icon":{width:e.controlHeight,height:e.controlHeight,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},"&-effective":{[`${e.componentCls}-collapse-icon`]:{backgroundColor:e.colorBgTextHover}}}});function V0(e){return We("LightFilter",t=>{const n={...t,componentCls:`.${e}`};return[B0(n)]})}const H0=e=>{const{items:t,prefixCls:n,size:r="middle",collapse:a,collapseLabel:i,onValuesChange:o,variant:l="borderless",values:c,footerRender:h,placement:g,popoverProps:f}=e,m=Ie(),p=`${n}-light-filter`,{wrapSSR:S,hashId:y}=V0(p),[w,v]=d.useState(!1),[x,C]=d.useState(()=>({...c})),j=d.useMemo(()=>i||(a?s.jsx(me.FilterOutlined,{className:ce(`${p}-collapse-icon`,y)}):s.jsx(Ut,{variant:l,size:r,label:m.getMessage("form.lightFilter.more","更多筛选")})),[i,a,p,y,l,r,m]),{collapseItems:b,outsideItems:T}=d.useMemo(()=>{const $=[],F=[];return t.forEach(E=>{const{secondary:M}=E.props||{};M||a?$.push(E):F.push(E)}),{collapseItems:$,outsideItems:F}},[e.items]);return S(s.jsx("div",{className:ce(p,y,`${p}-${r}`,{[`${p}-effective`]:Object.keys(c).some($=>Array.isArray(c[$])?c[$].length>0:c[$])}),children:s.jsxs("div",{className:ce(`${p}-container`,y),children:[T.map(($,F)=>{if(!($!=null&&$.props))return $;const{key:E}=$,{fieldProps:M}=($==null?void 0:$.props)||{},k=M!=null&&M.placement?M==null?void 0:M.placement:g;return s.jsx("div",{className:ce(`${p}-item`,y),children:d.cloneElement($,{fieldProps:{...$.props.fieldProps,placement:k,variant:"borderless"},proFieldProps:{...$.props.proFieldProps,light:!0,label:$.props.label,variant:l},variant:l})},E||F)}),b.length?s.jsx("div",{className:ce(`${p}-item`,y),children:s.jsx(Ou,{padding:24,open:w,onOpenChange:$=>{v($)},placement:g,popoverProps:f,label:j,footerRender:h,footer:{onConfirm:()=>{o({...x}),v(!1)},onClear:()=>{const $={};b.forEach(F=>{const{name:E}=F.props;$[E]=void 0}),o($)}},children:b.map($=>{const{key:F}=$,{name:E,fieldProps:M}=$.props,k={...M,onChange:z=>(C({...x,[E]:z!=null&&z.target?z.target.value:z}),!1)};x.hasOwnProperty(E)&&(k[$.props.valuePropName||"value"]=x[E]);const V=M!=null&&M.placement?M==null?void 0:M.placement:g;return s.jsx("div",{className:ce(`${p}-line`,y),children:d.cloneElement($,{fieldProps:{...k,placement:V,variant:l}})},F)})})},"more"):null]})}))};function Y0(e){const{size:t,collapse:n,collapseLabel:r,initialValues:a,onValuesChange:i,form:o,placement:l,formRef:c,variant:h,ignoreRules:g,footerRender:f,popoverProps:m,...p}=e,{getPrefixCls:S}=d.useContext(u.ConfigProvider.ConfigContext),y=S("pro-form"),[w,v]=d.useState(()=>({...a})),x=d.useRef();return d.useImperativeHandle(c,()=>x.current,[x.current]),s.jsx(dr,{size:t,initialValues:a,form:o,contentRender:C=>s.jsx(H0,{prefixCls:y,items:C==null?void 0:C.flatMap(j=>{var b;return!j||!(j!=null&&j.type)?j:((b=j==null?void 0:j.type)==null?void 0:b.displayName)==="ProForm-Group"?j.props.children:j}),size:t,variant:h||"borderless",collapse:n,collapseLabel:r,placement:l,popoverProps:m,values:w||{},footerRender:f,onValuesChange:j=>{var T,$;const b={...w,...j};v(b),(T=x.current)==null||T.setFieldsValue(b),($=x.current)==null||$.submit(),i&&i(j,b)}},JSON.stringify(w||{})),formRef:x,formItemProps:{colon:!1,labelAlign:"left"},fieldProps:{style:{width:void 0}},...Ve(p,["labelWidth"]),onValuesChange:(C,j)=>{var b;v(j),i==null||i(C,j),(b=x.current)==null||b.submit()}})}const{noteOnce:U0}=Ge;function K0({children:e,trigger:t,onOpenChange:n,modalProps:r,onFinish:a,submitTimeout:i,title:o,width:l,open:c,...h}){var M,k,V,z;U0(!h.footer||!(r!=null&&r.footer),"ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const g=d.useContext(u.ConfigProvider.ConfigContext),[,f]=d.useState([]),[m,p]=d.useState(!1),[S,y]=rt(!1,c),w=we(A=>{n==null||n(A)}),v=d.useCallback(A=>{y(I=>{const R=typeof A=="function"?A(I):A;return queueMicrotask(()=>{w(R)}),R})},[w]),x=d.useRef(null),C=d.useCallback(A=>{x.current===null&&A&&f([]),x.current=A},[]),j=d.useRef(),b=d.useCallback(()=>{var I;const A=h.form??((I=h.formRef)==null?void 0:I.current)??j.current;A&&(r!=null&&r.destroyOnHidden)&&typeof A.resetFields=="function"&&A.resetFields()},[r==null?void 0:r.destroyOnHidden,h.form,h.formRef]);d.useImperativeHandle(h.formRef,()=>j.current,[j.current]),d.useEffect(()=>{c&&(n==null||n(!0))},[c]);const T=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async A=>{var I,R;v(!S),(R=(I=t.props)==null?void 0:I.onClick)==null||R.call(I,A)}}):null,[v,t,S]),$=d.useMemo(()=>{var A,I,R,D;return h.submitter===!1?!1:_s({searchConfig:{submitText:(r==null?void 0:r.okText)??((I=(A=g.locale)==null?void 0:A.Modal)==null?void 0:I.okText)??"确认",resetText:(r==null?void 0:r.cancelText)??((D=(R=g.locale)==null?void 0:R.Modal)==null?void 0:D.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:i&&m,onClick:O=>{var N;v(!1),(N=r==null?void 0:r.onCancel)==null||N.call(r,O)}}},h.submitter??{})},[(k=(M=g.locale)==null?void 0:M.Modal)==null?void 0:k.cancelText,(z=(V=g.locale)==null?void 0:V.Modal)==null?void 0:z.okText,r,h.submitter,v,m,i]),F=d.useCallback((A,I)=>s.jsxs(s.Fragment,{children:[A,x.current&&I?s.jsx(d.Fragment,{children:zc.createPortal(I,x.current)},"submitter"):I]}),[]),E=d.useCallback(async A=>{const I=a==null?void 0:a(A);if(i&&I instanceof Promise){p(!0);const D=setTimeout(()=>p(!1),i);try{const O=await I;return clearTimeout(D),p(!1),O&&v(!1),O}catch(O){throw clearTimeout(D),p(!1),O}}else if(i){p(!0);const D=setTimeout(()=>p(!1),i);try{const O=await I;return clearTimeout(D),p(!1),O&&v(!1),O}catch(O){throw clearTimeout(D),p(!1),O}}const R=await I;return R&&v(!1),R},[a,v,i]);return s.jsxs(s.Fragment,{children:[s.jsx(u.Modal,{title:o,width:l||800,...r,open:S,onCancel:A=>{var I;i&&m||(v(!1),(I=r==null?void 0:r.onCancel)==null||I.call(r,A))},afterClose:()=>{var A;r!=null&&r.destroyOnHidden&&b(),S&&v(!1),(A=r==null?void 0:r.afterClose)==null||A.call(r)},footer:h.submitter!==!1?s.jsx("div",{ref:C,style:{display:"flex",justifyContent:"flex-end"}}):null,children:s.jsx(dr,{formComponentType:"ModalForm",layout:"vertical",...h,onInit:(A,I)=>{var R;h.formRef&&(h.formRef.current=I),(R=h==null?void 0:h.onInit)==null||R.call(h,A,I),j.current=I},formRef:j,submitter:$,onFinish:async A=>await E(A),contentRender:F,children:e})}),T]})}const ki=be.createContext(null);function W0({children:e,onBatchResize:t}){const n=be.useRef(0),r=be.useRef([]),a=be.useContext(ki),i=be.useCallback((o,l,c)=>{n.current+=1;const h=n.current;r.current.push({size:o,element:l,data:c}),Promise.resolve().then(()=>{h===n.current&&(t==null||t(r.current),r.current=[])}),a==null||a(o,l,c)},[t,a]);return be.createElement(ki.Provider,{value:i},e)}const Zt=new Map;function Md(e){e.forEach(t=>{var r;const{target:n}=t;(r=Zt.get(n))==null||r.forEach(a=>a(n))})}let _a;function kd(){return _a||(_a=new ResizeObserver(Md)),_a}process.env.NODE_ENV;process.env.NODE_ENV;function q0(e,t){Zt.has(e)||(Zt.set(e,new Set),kd().observe(e)),Zt.get(e).add(t)}function G0(e,t){Zt.has(e)&&(Zt.get(e).delete(t),Zt.get(e).size||(kd().unobserve(e),Zt.delete(e)))}function Z0(e,t,n,r){const a=be.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=Uc(c=>{const{width:h,height:g}=c.getBoundingClientRect(),{offsetWidth:f,offsetHeight:m}=c,p=Math.floor(h),S=Math.floor(g);if(a.current.width!==p||a.current.height!==S||a.current.offsetWidth!==f||a.current.offsetHeight!==m){const y={width:p,height:S,offsetWidth:f,offsetHeight:m};a.current=y;const w=f===Math.round(h)?h:f,v=m===Math.round(g)?g:m,x={...y,offsetWidth:w,offsetHeight:v};r==null||r(x,c),Promise.resolve().then(()=>{n==null||n(x,c)})}}),o=typeof t=="function",l=be.useRef(0);be.useEffect(()=>{const c=o?t():t;return c&&e?q0(c,i):e&&o&&(l.current+=1),()=>{c&&G0(c,i)}},[e,o?l.current:t])}function J0(e,t){const{children:n,disabled:r,onResize:a,data:i}=e,o=be.useRef(null),l=be.useContext(ki),c=typeof n=="function",h=c?n(o):n,g=!c&&be.isValidElement(h)&&$f(h),f=g?Rf(h):null,m=Ff(f,o),p=()=>Of(o.current);return be.useImperativeHandle(t,()=>p()),Z0(!r,p,a,(S,y)=>{l==null||l(S,y,i)}),g?be.cloneElement(h,{ref:m}):h}const Ad=be.forwardRef(J0);process.env.NODE_ENV!=="production"&&(Ad.displayName="SingleObserver");function Ai(){return Ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ai.apply(this,arguments)}const X0="rc-observer-key";function Q0(e,t){const{children:n}=e,r=typeof n=="function"?[n]:pn(n);return process.env.NODE_ENV!=="production"&&(r.length>1?Ms(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):r.length===0&&Ms(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),r.map((a,i)=>{const o=(a==null?void 0:a.key)||`${X0}-${i}`;return be.createElement(Ad,Ai({},e,{key:o,ref:i===0?t:void 0}),a)})}const ra=be.forwardRef(Q0);process.env.NODE_ENV!=="production"&&(ra.displayName="ResizeObserver");ra.Collection=W0;const ev=(e,t,n,r)=>e?s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.collapsed","展开"),r&&`(${r})`,s.jsx(me.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}):s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.expand","收起"),s.jsx(me.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}),tv=e=>{const{setCollapsed:t,collapsed:n=!1,submitter:r,style:a,hiddenNum:i}=e,{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=Ie(),{hashId:c}=d.useContext(Yt),h=Lu(e.collapseRender)||ev;return s.jsxs(u.Space,{style:a,size:16,children:[r,e.collapseRender!==!1&&s.jsx("a",{className:ce(o("pro-query-filter-collapse-button"),c),onClick:()=>t(!n),children:h==null?void 0:h(n,e,l,i)})]})},nv=e=>({[e.componentCls]:{boxSizing:"border-box","&&":{padding:24},[`${e.antCls}-form-item`]:{marginBlock:0},[`${e.proComponentsCls}-form-group-title`]:{marginBlock:0},"&-row":{rowGap:24,"&-split":{[`${e.proComponentsCls}-form-group`]:{display:"flex",alignItems:"center",gap:e.marginXS},"&:last-child":{marginBlockEnd:12}},"&-split-line":{"&:after":{position:"absolute",width:"100%",content:'""',height:1,insetBlockEnd:-12,borderBlockEnd:`1px dashed ${e.colorSplit}`}}},"&-collapse-button":{display:"flex",alignItems:"center",color:e.colorPrimary}}});function rv(e){return We("QueryFilter",t=>{const n={...t,componentCls:`.${e}`};return[nv(n)]})}const sv=e=>{const n={...u.theme.getDesignToken(),...e},r={xs:n.screenSMMin??576,sm:n.screenMDMin??768,md:n.screenLGMin??992,lg:n.screenXLMin??1200,xl:n.screenXXLMin??1600,xxl:1/0};return{configSpanBreakpoints:r,breakpoints:{vertical:[[r.xs,1,"vertical"],[r.md,2,"vertical"],[r.xl,3,"vertical"],[1/0,4,"vertical"]],default:[[r.xs,1,"vertical"],[r.sm,2,"vertical"],[r.xl,3,"horizontal"],[1/0,4,"horizontal"]]}}},av=(e,t,n,r)=>{if(n&&typeof n=="number")return{span:n,layout:e};const{breakpoints:a,configSpanBreakpoints:i}=r,l=((n?["xs","sm","md","lg","xl","xxl"].map(c=>[i[c],24/n[c],"horizontal"]):a[e||"default"])||a.default).find(c=>t<c[0]+16);return l?{span:24/l[1],layout:l==null?void 0:l[2]}:{span:8,layout:"horizontal"}},iv=(e,t)=>e==null?void 0:e.flatMap(n=>{var r,a,i;return((r=n==null?void 0:n.type)==null?void 0:r.displayName)==="ProForm-Group"&&!((a=n.props)!=null&&a.title)?n.props.children:t&&d.isValidElement(n)?d.cloneElement(n,{...n.props,formItemProps:{...(i=n.props)==null?void 0:i.formItemProps,rules:[]}}):n}),ov=e=>{var A,I,R;const t=Ie(),{hashId:n}=d.useContext(Yt),r=e.resetText||t.getMessage("tableForm.reset","重置"),a=e.searchText||t.getMessage("tableForm.search","搜索"),[i,o]=rt(()=>e.defaultCollapsed&&!!e.submitter,e.collapsed),l=we(D=>{var O;(O=e.onCollapse)==null||O.call(e,D)}),c=d.useCallback(D=>{o(O=>{const N=typeof D=="function"?D(O):D;return queueMicrotask(()=>{l(N)}),N})},[l]),{optionRender:h,collapseRender:g,split:f,items:m,spanSize:p,showLength:S,searchGutter:y,showHiddenNum:w}=e,v=d.useMemo(()=>!e.submitter||h===!1?null:d.cloneElement(e.submitter,{searchConfig:{resetText:r,submitText:a},render:h&&((D,O)=>h({...e,resetText:r,searchText:a},e,O)),...e.submitter.props}),[e,r,a,h]);let x=0,C=0,j=!1,b=0,T=0;const $=iv(m,e.ignoreRules).map((D,O)=>{var G,W,B,_;const N=d.isValidElement(D)?((G=D==null?void 0:D.props)==null?void 0:G.colSize)??1:1,q=Math.min(p.span*(N||1),24);x+=q,b+=N,O===0&&(j=q===24&&!((W=D==null?void 0:D.props)!=null&&W.hidden));const L=((B=D==null?void 0:D.props)==null?void 0:B.hidden)||i&&(j||b>S)&&!!O;C+=1;const H=d.isValidElement(D)&&(D.key||`${(_=D.props)==null?void 0:_.name}`)||O;return d.isValidElement(D)&&L?e.preserve?{itemDom:d.cloneElement(D,{hidden:!0,key:H||O}),hidden:!0,colSpan:q}:{itemDom:null,colSpan:0,hidden:!0}:{itemDom:D,colSpan:q,hidden:!1}}),F=$.map((D,O)=>{var G,W;const{itemDom:N,colSpan:q}=D;if((G=N==null?void 0:N.props)==null?void 0:G.hidden)return N;const H=d.isValidElement(N)&&(N.key||`${(W=N.props)==null?void 0:W.name}`)||O;return 24-T%24<q&&(x+=24-T%24,T+=24-T%24),T+=q,f&&T%24===0&&O<C-1?s.jsx(u.Col,{span:q,className:ce(`${e.baseClassName}-row-split-line`,`${e.baseClassName}-row-split`,n),children:N},H):s.jsx(u.Col,{className:ce(`${e.baseClassName}-row-split`,n),span:q,children:N},H)}),E=w&&$.filter(D=>D.hidden).length,M=d.useMemo(()=>!(x<24||b<=S),[b,S,x]),k=d.useMemo(()=>{var O,N;const D=T%24+(((O=e.submitterColSpanProps)==null?void 0:O.span)??p.span);return D>24?24-(((N=e.submitterColSpanProps)==null?void 0:N.span)??p.span):24-D},[T,T%24+(((A=e.submitterColSpanProps)==null?void 0:A.span)??p.span),(I=e.submitterColSpanProps)==null?void 0:I.span]),z=d.useContext(u.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter");return s.jsxs(u.Row,{gutter:y,justify:"start",className:ce(`${z}-row`,n),children:[F,v&&s.jsx(u.Col,{span:p.span,offset:k,className:ce((R=e.submitterColSpanProps)==null?void 0:R.className),...e.submitterColSpanProps,style:{textAlign:"end"},children:s.jsx(u.Form.Item,{label:" ",colon:!1,shouldUpdate:!1,className:ce(`${z}-actions`,n),children:s.jsx(tv,{hiddenNum:E,collapsed:i,collapseRender:M?g:!1,submitter:v,setCollapsed:c},"pro-form-query-filter-actions")})},"submitter")]},"resize-observer-row")};var _c;const lv=Xi()?(_c=document==null?void 0:document.body)==null?void 0:_c.clientWidth:1024;function cv(e){const{collapsed:t,layout:n,defaultCollapsed:r=!0,defaultColsNumber:a,defaultFormItemsNumber:i,span:o,searchGutter:l=24,searchText:c,resetText:h,optionRender:g,collapseRender:f,onReset:m,onCollapse:p,labelWidth:S="80",style:y,split:w,preserve:v=!0,ignoreRules:x,showHiddenNum:C=!1,submitterColSpanProps:j,...b}=e,$=d.useContext(u.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter"),{wrapSSR:F,hashId:E}=rv($),{token:M}=u.theme.useToken(),[k,V]=d.useState(()=>typeof(y==null?void 0:y.width)=="number"?y==null?void 0:y.width:lv),z=d.useMemo(()=>sv(M),[M.screenSMMin,M.screenMDMin,M.screenLGMin,M.screenXLMin,M.screenXXLMin]),A=d.useMemo(()=>av(n,k+16,o,z),[n,k,o,z]),I=d.useMemo(()=>{if(i!==void 0)return i;if(a!==void 0){const D=24/A.span-1;return a>D?D:a}return Math.max(1,24/A.span-1)},[a,i,A.span]),R=d.useMemo(()=>{if(S&&A.layout!=="vertical"&&S!=="auto")return{labelCol:{flex:`0 0 ${S}px`},wrapperCol:{style:{maxWidth:`calc(100% - ${S}px)`}},style:{flexWrap:"nowrap"}}},[A.layout,S]);return F(s.jsx(ra,{onResize:D=>{k!==D.width&&D.width>17&&V(D.width)},children:D=>s.jsx("div",{ref:D,className:ce(`${$}-container`,E),style:e.containerStyle,children:s.jsx(dr,{isKeyPressSubmit:!0,preserve:v,...b,className:ce($,E,b.className),onReset:m,style:y,layout:A.layout,fieldProps:{style:{width:"100%"}},formItemProps:R,groupProps:{titleStyle:{display:"inline-block",marginInlineEnd:16}},contentRender:(O,N,q)=>s.jsx(ov,{spanSize:A,collapsed:t,form:q,submitterColSpanProps:j,collapseRender:f,defaultCollapsed:r,onCollapse:p,optionRender:g,submitter:N,items:O,split:w,baseClassName:$,resetText:e.resetText,searchText:e.searchText,searchGutter:l,preserve:v,ignoreRules:x,showLength:I,showHiddenNum:C})})})},"resize-observer"))}const{noteOnce:uv}=Ge;function dv(e){const t=d.useRef(),n=d.useContext(Od),r=d.useContext(Dd),a={...e,...r},{onFinish:i,step:o,formRef:l,title:c,stepProps:h,...g}=a;return uv(!g.submitter,"StepForm 不包含提交按钮,请在 StepsForm 上"),d.useImperativeHandle(l,()=>t.current,[l==null?void 0:l.current]),d.useEffect(()=>{if(!(a.name||a.step))return;const f=(a.name||a.step).toString();return n==null||n.regForm(f,a),()=>{n==null||n.unRegForm(f)}},[]),n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),s.jsx(dr,{formRef:t,onFinish:async f=>{if(g.name&&(n==null||n.onFormFinish(g.name,f)),i){n==null||n.setLoading(!0);try{await(i==null?void 0:i(f))&&(n==null||n.next())}finally{n==null||n.setLoading(!1)}return}n!=null&&n.lastStep||n==null||n.next()},onInit:(f,m)=>{var p;t.current=m,n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),(p=g==null?void 0:g.onInit)==null||p.call(g,f,m)},layout:"vertical",...Ve(g,["layoutType","columns"])})}const fv=e=>({[e.componentCls]:{boxSizing:"border-box","&-container":{width:"max-content",minWidth:"420px",maxWidth:"100%",margin:"auto"},"&-steps-container":{maxWidth:"1160px",margin:"auto",[`${e.antCls}-steps-vertical`]:{height:"100%"}},"&-step":{display:"none",marginBlockStart:"32px","&-active":{display:"block"},"> form":{maxWidth:"100%"}}}});function mv(e){return We("StepsForm",t=>{const n={...t,componentCls:`.${e}`};return[fv(n)]})}const Od=d.createContext(void 0),hv={horizontal({stepsDom:e,formDom:t}){return s.jsxs(s.Fragment,{children:[s.jsx(u.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(u.Col,{span:24,children:e})}),s.jsx(u.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(u.Col,{span:24,children:t})})]})},vertical({stepsDom:e,formDom:t}){return s.jsxs(u.Row,{align:"stretch",wrap:!0,gutter:{xs:8,sm:16,md:24},children:[s.jsx(u.Col,{xxl:4,xl:6,lg:7,md:8,sm:10,xs:12,children:d.cloneElement(e,{style:{height:"100%"}})}),s.jsx(u.Col,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:t})})]})}},Dd=d.createContext(null);function gv(e){const{getPrefixCls:t}=d.useContext(u.ConfigProvider.ConfigContext),n=t("pro-steps-form"),{wrapSSR:r,hashId:a}=mv(n),{current:i,onCurrentChange:o,submitter:l,stepsFormRender:c,stepsRender:h,stepFormRender:g,stepsProps:f,onFinish:m,formProps:p,containerStyle:S,formRef:y,formMapRef:w,layoutRender:v,...x}=e,C=d.useRef(new Map),j=d.useRef(new Map),b=d.useRef([]),[T,$]=d.useState([]),[F,E]=d.useState(!1),M=Ie(),[k,V]=rt(0,e.current),z=we(Z=>{var re;(re=e.onCurrentChange)==null||re.call(e,Z)}),A=d.useCallback(Z=>{V(re=>{const ie=typeof Z=="function"?Z(re):Z;return queueMicrotask(()=>{z(ie)}),ie})},[z]),I=d.useMemo(()=>hv[(f==null?void 0:f.orientation)||"horizontal"],[f==null?void 0:f.orientation]),R=d.useMemo(()=>k===T.length-1,[T.length,k]),D=d.useCallback((Z,re)=>{j.current.has(Z)||$(ie=>[...ie,Z]),j.current.set(Z,re)},[]),O=d.useCallback(Z=>{$(re=>re.filter(ie=>ie!==Z)),j.current.delete(Z),C.current.delete(Z)},[]);d.useImperativeHandle(w,()=>b.current,[b.current]),d.useImperativeHandle(y,()=>{var Z;return(Z=b.current[k||0])==null?void 0:Z.current},[k,b.current]);const N=d.useCallback(async(Z,re)=>{if(C.current.set(Z,re),!R||!m)return;E(!0);const ie=Nu({},...Array.from(C.current.values()));try{await m(ie)&&(A(0),b.current.forEach(pe=>{var ge;return(ge=pe.current)==null?void 0:ge.resetFields()}))}catch(se){console.log(se)}finally{E(!1)}},[R,m,E,A]),q=d.useMemo(()=>{const Z={items:T.map(re=>{const ie=j.current.get(re),se={key:re,title:ie==null?void 0:ie.title,...ie==null?void 0:ie.stepProps};return se.description&&(se.content=se.description,delete se.description),se})};return s.jsx("div",{className:ce(`${n}-steps-container`,a),style:{maxWidth:Math.min(T.length*320,1160)},children:s.jsx(u.Steps,{...f,...Z,current:k,onChange:void 0})})},[T,a,n,k,f]),L=we(()=>{var re;(re=b.current[k].current)==null||re.submit()}),H=we(()=>{k<1||A(k-1)}),G=d.useMemo(()=>l!==!1&&s.jsx(u.Button,{type:"primary",loading:F,...l==null?void 0:l.submitButtonProps,onClick:()=>{var Z;(Z=l==null?void 0:l.onSubmit)==null||Z.call(l),L()},children:M.getMessage("stepsForm.next","下一步")},"next"),[M,F,L,l]),W=d.useMemo(()=>l!==!1&&s.jsx(u.Button,{...l==null?void 0:l.resetButtonProps,onClick:()=>{var Z;H(),(Z=l==null?void 0:l.onReset)==null||Z.call(l)},children:M.getMessage("stepsForm.prev","上一步")},"pre"),[M,H,l]),B=d.useMemo(()=>l!==!1&&s.jsx(u.Button,{type:"primary",loading:F,...l==null?void 0:l.submitButtonProps,onClick:()=>{var Z;(Z=l==null?void 0:l.onSubmit)==null||Z.call(l),L()},children:M.getMessage("stepsForm.submit","提交")},"submit"),[M,F,L,l]),_=we(()=>{T.length!==0&&(k>T.length-2||A(k+1))}),Y=d.useMemo(()=>{var ie;let Z=[];const re=k||0;if(re<1?T.length===1?Z.push(B):Z.push(G):re+1===T.length?Z.push(W,B):Z.push(W,G),Z=Z.filter(d.isValidElement),l&&l.render){const se={form:(ie=b.current[k])==null?void 0:ie.current,onSubmit:L,step:k,onPre:H};return l.render(se,Z)}return l&&(l==null?void 0:l.render)===!1?null:Z},[T.length,G,L,W,H,k,B,l]),P=d.useMemo(()=>pn(e.children).map((Z,re)=>{const ie=Z.props,se=ie.name||`${re}`,pe=k===re,ge=pe?{contentRender:g,submitter:!1}:{};return s.jsx("div",{className:ce(`${n}-step`,a,{[`${n}-step-active`]:pe}),children:s.jsx(Dd.Provider,{value:{...ge,...p,...ie,name:se,step:re},children:Z})},se)}),[p,a,n,e.children,k,g]),U=d.useMemo(()=>h?h(T.map(Z=>{var re;return{key:Z,title:(re=j.current.get(Z))==null?void 0:re.title}}),q):q,[T,q,h]),X=d.useMemo(()=>s.jsxs("div",{className:ce(`${n}-container`,a),style:S,children:[P,c?null:s.jsx(u.Space,{children:Y})]}),[S,P,a,n,c,Y]),ne=d.useMemo(()=>{const Z={stepsDom:U,formDom:X};return c?c(v?v(Z):I(Z),Y):v?v(Z):I(Z)},[U,X,I,c,Y,v]);return r(s.jsx("div",{className:ce(n,a),children:s.jsx(u.Form.Provider,{...x,children:s.jsx(Od.Provider,{value:{loading:F,setLoading:E,regForm:D,keyArray:T,next:_,formArrayRef:b,formMapRef:j,lastStep:R,unRegForm:O,onFormFinish:N},children:ne})})}))}function sa(e){return s.jsx(Mn,{needDeps:!0,children:s.jsx(gv,{...e})})}sa.StepForm=dv;sa.useForm=u.Form.useForm;const pv=({children:e})=>s.jsx(s.Fragment,{children:e}),yv=({steps:e,columns:t,forceUpdate:n,grid:r,...a})=>{const i=Zi(a),o=d.useCallback(c=>{var h,g;(g=(h=i.current).onCurrentChange)==null||g.call(h,c),n([])},[n,i]),l=d.useMemo(()=>e==null?void 0:e.map((c,h)=>d.createElement(Pd,{grid:r,...c,key:h,layoutType:"StepForm",columns:t[h]})),[t,r,e]);return s.jsx(sa,{...a,onCurrentChange:o,children:l})},{noteOnce:kc}=Ge,xv=(e,t)=>{var n;if(e.valueType==="dependency"){const r=(n=e.getFieldProps)==null?void 0:n.call(e);return kc(Array.isArray(e.name??(r==null?void 0:r.name)),'SchemaForm: fieldProps.name should be NamePath[] when valueType is "dependency"'),kc(typeof e.columns=="function",'SchemaForm: columns should be a function when valueType is "dependency"'),Array.isArray(e.name??(r==null?void 0:r.name))?d.createElement(na,{name:e.name,...r,key:e.key},a=>!e.columns||typeof e.columns!="function"?null:t.genItems(e.columns(a))):null}return!0},bv=e=>{var t;return e.valueType==="divider"?d.createElement(u.Divider,{...(t=e.getFieldProps)==null?void 0:t.call(e),key:e.key}):!0},Sv=(e,{action:t,formRef:n,type:r,originItem:a})=>{const i={...Ve(e,["dataIndex","width","render","formItemRender","renderText","title"]),name:e.name||e.key||e.dataIndex,width:e.width,render:e!=null&&e.render?(h,g,f)=>{var m,p,S,y;return(y=e==null?void 0:e.render)==null?void 0:y.call(e,h,g,f,t==null?void 0:t.current,{type:r,...e,key:(m=e.key)==null?void 0:m.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e)})}:void 0},o=()=>{const{key:h,...g}=i;return s.jsx(bn,{...g,ignoreFormItem:!0},h)},l=e!=null&&e.formItemRender?(h,g)=>{var m,p,S,y;const f=lt({...g,onChange:void 0});return(y=e==null?void 0:e.formItemRender)==null?void 0:y.call(e,{type:r,...e,key:(m=e.key)==null?void 0:m.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e),originProps:a},{...f,defaultRender:o,type:r},n.current)}:void 0,c=()=>{if(e!=null&&e.formItemRender){const h=l==null?void 0:l(null,{});if(!h||e.ignoreFormItem)return h}return d.createElement(bn,{...i,key:[e.key,e.index||0].join("-"),formItemRender:l})};return e.dependencies?s.jsx(na,{name:e.dependencies||[],children:c},e.key):c()},Cv=(e,{genItems:t})=>{var n,r;return e.valueType==="formList"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(h0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,name:e.dataIndex,label:e.label,initialValue:e.initialValue,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},wv=(e,{genItems:t})=>{var n,r;return e.valueType==="formSet"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(O0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,initialValue:e.initialValue,name:e.dataIndex,label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},jv=(e,{genItems:t})=>{var n;return e.valueType==="group"?!e.columns||!Array.isArray(e.columns)?null:s.jsx(Iv,{label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(n=e.getFieldProps)==null?void 0:n.call(e),children:t(e.columns)},e.key):!0},vv=e=>e.valueType&&typeof e.valueType=="string"&&["index","indexBorder","option"].includes(e==null?void 0:e.valueType)?null:!0,Ac=[vv,jv,Cv,wv,bv,xv],Tv=(e,t)=>{for(let n=0;n<Ac.length;n++){const r=Ac[n],a=r(e,t);if(a!==!0)return a}return Sv(e,t)},Fv={DrawerForm:z0,QueryFilter:cv,LightFilter:Y0,StepForm:sa.StepForm,StepsForm:yv,ModalForm:K0,Embed:pv,Form:gt};function Pd(e){const{columns:t,layoutType:n="Form",type:r="form",action:a,shouldUpdate:i=(T,$)=>mn(T)!==mn($),formRef:o,...l}=e,c=Fv[n]||gt,[h]=u.Form.useForm(),g=u.Form.useFormInstance(),[,f]=d.useState([]),[m,p]=d.useState(()=>[]),S=Lp(e.form||g||h),y=d.useRef(),w=Zi(e),v=we(T=>T.filter($=>!($.hideInForm&&r==="form")).sort(($,F)=>F.order||$.order?(F.order||0)-($.order||0):(F.index||0)-($.index||0)).map(($,F)=>{const E=ht($.title,$,"form",s.jsx(er,{label:$.title,tooltip:$.tooltip})),M=lt({title:E,label:E,name:$.name,valueType:ht($.valueType,{}),key:$.key||$.dataIndex||F,columns:$.columns,valueEnum:$.valueEnum,dataIndex:$.dataIndex||$.key,initialValue:$.initialValue,width:$.width,index:$.index,readonly:$.readonly,colSize:$.colSize,colProps:$.colProps,rowProps:$.rowProps,className:$.className,tooltip:$.tooltip,dependencies:$.dependencies,proFieldProps:$.proFieldProps,ignoreFormItem:$.ignoreFormItem,getFieldProps:$.fieldProps?()=>ht($.fieldProps,S.current,$):void 0,getFormItemProps:$.formItemProps?()=>ht($.formItemProps,S.current,$):void 0,render:$.render,formItemRender:$.formItemRender,renderText:$.renderText,request:$.request,params:$.params,transform:$.transform,convertValue:$.convertValue,debounceTime:$.debounceTime,defaultKeyWords:$.defaultKeyWords});return Tv(M,{action:a,type:r,originItem:$,formRef:S,genItems:v})}).filter($=>!!$)),x=d.useCallback((T,$)=>{const{onValuesChange:F}=w.current;(i===!0||typeof i=="function"&&i($,y.current))&&p([]),y.current=$,F==null||F(T,$)},[w,i]),C=dt(()=>{if(!(t.length&&Array.isArray(t[0])))return v(t)},[t,l==null?void 0:l.open,a,r,m,S.current]),j=dt(()=>n==="StepsForm"?{forceUpdate:f,columns:t}:{},[t,n]);d.useImperativeHandle(o,()=>S.current,[S.current]);const b=d.useContext(Vt);return s.jsx(Mn,{valueTypeMap:{...b.valueTypeMap,...Sd},children:s.jsx(c,{...j,...l,onInit:(T,$)=>{var F;o&&(o.current=$),(F=l==null?void 0:l.onInit)==null||F.call(l,T,$),S.current=$},form:e.form||h,formRef:S,onValuesChange:x,children:C})})}const Ys="text",$v=({fieldProps:e,proFieldProps:t,...n})=>s.jsx(bn,{valueType:Ys,fieldProps:e,fieldConfig:{valueType:Ys},proFieldProps:t,...n}),Rv=e=>{const[t,n]=rt(e.open||!1,e.open),r=d.useCallback(a=>{n(i=>{var l;const o=typeof a=="function"?a(i):a;return(l=e.onOpenChange)==null||l.call(e,o),o})},[e.onOpenChange]);return s.jsx(u.Form.Item,{shouldUpdate:!0,noStyle:!0,children:a=>{var o;const i=a.getFieldValue(e.name||[]);return s.jsx(u.Popover,{getPopupContainer:l=>l&&l.parentNode?l.parentNode:l,onOpenChange:l=>r(l),content:s.jsxs("div",{style:{padding:"4px 0"},children:[(o=e.statusRender)==null?void 0:o.call(e,i),e.strengthText?s.jsx("div",{style:{marginTop:10},children:s.jsx("span",{children:e.strengthText})}):null]}),styles:{root:{width:240}},placement:"rightTop",...e.popoverProps,open:t,children:e.children})}})},Ev=({fieldProps:e,proFieldProps:t,...n})=>{const[r,a]=d.useState(!1);return e!=null&&e.statusRender&&n.name?s.jsx(Mn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(Gn,{...o,text:i}),formItemRender:(i,o)=>s.jsx(Gn,{...o,text:i})}},children:s.jsx(Rv,{name:n.name,statusRender:e==null?void 0:e.statusRender,popoverProps:e==null?void 0:e.popoverProps,strengthText:e==null?void 0:e.strengthText,open:r,onOpenChange:a,children:s.jsx("div",{children:s.jsx(bn,{valueType:"password",fieldProps:{...Ve(e,["statusRender","popoverProps","strengthText"]),onBlur:i=>{var o;(o=e==null?void 0:e.onBlur)==null||o.call(e,i),a(!1)},onClick:i=>{var o;(o=e==null?void 0:e.onClick)==null||o.call(e,i),a(!0)}},proFieldProps:t,fieldConfig:{valueType:Ys},...n})})})}):s.jsx(Mn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(Gn,{...o,text:i}),formItemRender:(i,o)=>s.jsx(Gn,{...o,text:i})}},children:s.jsx(bn,{valueType:"password",fieldProps:e,proFieldProps:t,fieldConfig:{valueType:Ys},...n})})},Us=$v;Us.Password=Ev;Us.displayName="ProFormComponent";function gt(e){return s.jsx(dr,{layout:"vertical",contentRender:(t,n)=>s.jsxs(s.Fragment,{children:[t,n]}),...e})}gt.Group=Id;gt.useForm=u.Form.useForm;gt.Item=Rd;gt.useWatch=u.Form.useWatch;gt.ErrorList=u.Form.ErrorList;gt.Provider=u.Form.Provider;gt.useFormInstance=u.Form.useFormInstance;gt.EditOrReadOnlyContext=Hr;const Iv=gt.Group,Mv=e=>({[e.componentCls]:{boxSizing:"border-box",marginBlockEnd:16,backgroundColor:Ct(e.colorTextBase,.02),borderRadius:e.borderRadius,border:"none","&-container":{paddingBlock:e.paddingSM,paddingInline:e.paddingLG},"&-info":{display:"flex",alignItems:"center",transition:"all 0.3s",color:e.colorTextTertiary,"&-content":{flex:1},"&-option":{minWidth:48,paddingInlineStart:16}}}});function kv(e){return We("ProTableAlert",t=>{const n={...t,componentCls:`.${e}`};return[Mv(n)]})}const Av=e=>{const{intl:t,onCleanSelected:n}=e;return[s.jsx("a",{onClick:n,children:t.getMessage("alert.clear","清空")},"0")]};function Ov({selectedRowKeys:e=[],onCleanSelected:t,alwaysShowAlert:n,selectedRows:r,alertInfoRender:a=({intl:o})=>s.jsxs(u.Space,{children:[o.getMessage("alert.selected","已选择"),e.length,o.getMessage("alert.item","项"),"  "]}),alertOptionRender:i=Av}){const o=Ie(),l=i&&i({onCleanSelected:t,selectedRowKeys:e,selectedRows:r,intl:o}),{getPrefixCls:c}=d.useContext(u.ConfigProvider.ConfigContext),h=c("pro-table-alert"),{wrapSSR:g,hashId:f}=kv(h);if(a===!1)return null;const m=a({intl:o,selectedRowKeys:e,selectedRows:r,onCleanSelected:t});return m===!1||e.length<1&&!n?null:g(s.jsx("div",{className:ce(h,f),children:s.jsx("div",{className:ce(`${h}-container`,f),children:s.jsxs("div",{className:ce(`${h}-info`,f),children:[s.jsx("div",{className:ce(`${h}-info-content`,f),children:m}),l?s.jsx("div",{className:ce(`${h}-info-option`,f),children:l}):null]})})}))}function Dv(e,t,n){if(e===!1)return!1;const{total:r,current:a,pageSize:i,setPageInfo:o}=t;return{showTotal:(c,h)=>`${n.getMessage("pagination.total.range","第")} ${h[0]}-${h[1]} ${n.getMessage("pagination.total.total","条/总共")} ${c} ${n.getMessage("pagination.total.item","条")}`,total:r,...typeof e=="object"?e:{},current:e!==!0&&e?e.current??a:a,pageSize:e!==!0&&e?e.pageSize??i:i,onChange:(c,h)=>{const{onChange:g}=e;g==null||g(c,h||20),(h!==i||a!==c)&&o({pageSize:h,current:c})}}}function Pv(e,t,n){const r={...n.editableUtils,pageInfo:t.pageInfo,nativeElement:n.nativeElement,focus:n.focus,reload:async a=>{a&&await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reloadAndRest:async()=>{n.onCleanSelected(),await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reset:async()=>{var a;await n.resetAll(),await((a=t==null?void 0:t.reset)==null?void 0:a.call(t)),await(t==null?void 0:t.reload())},fullScreen:()=>n.fullScreen(),clearSelected:()=>n.onCleanSelected(),setPageInfo:a=>t.setPageInfo(a),scrollTo:n.scrollTo};e.current=r}function Nv(e,t){return t.filter(n=>n).length<1?e:t.reduce((n,r)=>r(n),e)}const Nd=(e,t)=>t===void 0?!1:typeof t=="boolean"?t:t[e],Lv=e=>{var t;return e&&typeof e=="object"&&((t=e==null?void 0:e.props)==null?void 0:t.colSpan)},sr=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`,Yr=e=>Array.isArray(e)?e.join(","):e==null?void 0:e.toString(),Oi=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.children?t.push(...Oi(r.children)):t.push(r)}return t},io=(e,t)=>!!e&&!!t,oo=e=>typeof e=="function"||typeof e=="object"&&typeof e.compare=="function",_v=(e,t)=>Object.entries(e).reduce((n,[r,a])=>{const i=t.find(o=>Yr(o.dataIndex)===r);return i!=null&&!io(i.filters,i.onFilter)&&(n[r]=a),n},{}),zv=e=>(Array.isArray(e)?e:[e]).reduce((r,a)=>{var l,c;const i=(l=a.column)==null?void 0:l.sorter;if(i!=null&&oo(i))return r;const o=typeof i=="string"?i:Yr((c=a.column)==null?void 0:c.dataIndex);return o!=null&&(r[o]=a.order),r},{}),Bv=e=>{const t={},n={};return e.forEach(r=>{const a=Yr(r.dataIndex);a&&(r.filters&&!io(r.filters,r.onFilter)&&(t[a]=r.defaultFilteredValue??null),r.sorter&&!oo(r.sorter)&&(typeof r.sorter=="string"?n[r.sorter]=r.defaultSortOrder??null:n[a]=r.defaultSortOrder??null))}),{sort:n,filter:t}},Vv=(e,t)=>{const{sorter:n,sortOrder:r,dataIndex:a}=t;if(r!==void 0)return r;if(n==null||oo(n))return;const i=typeof n=="string"?n:Yr(a);return i?e[i]:void 0},Hv=(e,t)=>{const{filters:n,onFilter:r,filteredValue:a,dataIndex:i}=t;if(a!==void 0)return a;if(n==null||io(n,r))return;const o=Yr(i);return o?e[o]:void 0};function Yv(e={}){var x,C,j,b,T,$;const t=d.useRef(),n=d.useRef(null),r=d.useRef(),a=d.useRef(),[i,o]=d.useState(""),l=d.useRef([]),[c,h]=rt(()=>e.size||e.defaultSize||"middle",e.size),g=d.useCallback(F=>{h(E=>{var k;const M=typeof F=="function"?F(E):F;return(k=e.onSizeChange)==null||k.call(e,M),M})},[e.onSizeChange]),f=d.useMemo(()=>{var E,M;if((E=e==null?void 0:e.columnsState)!=null&&E.defaultValue)return e.columnsState.defaultValue;const F={};return(M=e.columns)==null||M.forEach(({key:k,dataIndex:V,fixed:z,disable:A},I)=>{const R=sr(k??V,I);R&&(F[R]={show:!0,fixed:z,disable:A})}),F},[e.columns]),[m,p]=rt(()=>{var M,k,V,z;const{persistenceType:F,persistenceKey:E}=e.columnsState||{};if(E&&F&&typeof window<"u"){const A=window[F];try{const I=A==null?void 0:A.getItem(E);if(I)return(M=e==null?void 0:e.columnsState)!=null&&M.defaultValue?_s({},(k=e==null?void 0:e.columnsState)==null?void 0:k.defaultValue,JSON.parse(I)):JSON.parse(I)}catch(I){console.warn(I)}}return((V=e.columnsState)==null?void 0:V.value)||((z=e.columnsState)==null?void 0:z.defaultValue)||f},(x=e.columnsState)==null?void 0:x.value),S=(C=e.columnsState)==null?void 0:C.onChange,y=d.useCallback(F=>{p(E=>{const M=typeof F=="function"?F(E):F;return S==null||S(M),M})},[S]);d.useEffect(()=>{var M,k;const{persistenceType:F,persistenceKey:E}=e.columnsState||{};if(E&&F&&typeof window<"u"){const V=window[F];try{const z=V==null?void 0:V.getItem(E);z?(M=e==null?void 0:e.columnsState)!=null&&M.defaultValue?y(_s({},(k=e==null?void 0:e.columnsState)==null?void 0:k.defaultValue,JSON.parse(z))):y(JSON.parse(z)):y(f)}catch(z){console.warn(z)}}},[(j=e.columnsState)==null?void 0:j.persistenceKey,(b=e.columnsState)==null?void 0:b.persistenceType,f]);const w=d.useCallback(()=>{const{persistenceType:F,persistenceKey:E}=e.columnsState||{};if(!E||!F||typeof window>"u")return;const M=window[F];try{M==null||M.removeItem(E)}catch(k){console.warn(k)}},[e.columnsState]);d.useEffect(()=>{var k,V;if(!((k=e.columnsState)!=null&&k.persistenceKey)||!((V=e.columnsState)!=null&&V.persistenceType)||typeof window>"u")return;const{persistenceType:F,persistenceKey:E}=e.columnsState,M=window[F];try{M==null||M.setItem(E,JSON.stringify(m))}catch(z){console.warn(z),w()}},[(T=e.columnsState)==null?void 0:T.persistenceKey,m,($=e.columnsState)==null?void 0:$.persistenceType]);const v={action:t.current,setAction:F=>{t.current=F},sortKeyColumns:l.current,setSortKeyColumns:F=>{l.current=F},propsRef:a,columnsMap:m,keyWords:i,setKeyWords:F=>o(F),setTableSize:g,tableSize:c,prefixName:r.current,setPrefixName:F=>{r.current=F},setColumnsMap:y,columns:e.columns,rootDomRef:n,clearPersistenceStorage:w,defaultColumnKeyMap:f};return Object.defineProperty(v,"prefixName",{get:()=>r.current}),Object.defineProperty(v,"sortKeyColumns",{get:()=>l.current}),Object.defineProperty(v,"action",{get:()=>t.current}),v}const Ln=d.createContext({}),Uv=e=>{const t=Yv(e.initValue);return s.jsx(Ln.Provider,{value:t,children:e.children})},Kv=new xu("turn",{"0%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(90deg)"},"50%":{transform:"rotate(180deg)"},"75%":{transform:"rotate(270deg)"},"100%":{transform:"rotate(360deg)"}}),Wv=e=>({[e.componentCls]:{boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},zIndex:1,[`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]:{marginBlockEnd:0},"&:not(:root):fullscreen":{minHeight:"100vh",overflow:"auto",background:e.colorBgContainer},"&-extra":{marginBlockEnd:16},"&-polling":{[`${e.componentCls}-list-toolbar-setting-item`]:{".anticon.anticon-reload":{transform:"rotate(0deg)",animationName:Kv,animationDuration:"1s",animationTimingFunction:"linear",animationIterationCount:"infinite"}}},[`td${e.antCls}-table-cell`]:{">a":{fontSize:e.fontSize}},[`${e.antCls}-table${e.antCls}-table-tbody${e.antCls}-table-wrapper:only-child${e.antCls}-table`]:{marginBlock:0,marginInline:0},[`${e.antCls}-table${e.antCls}-table-middle ${e.componentCls}`]:{marginBlock:0,marginInline:-8,[`${e.proComponentsCls}-card`]:{backgroundColor:"initial"}},"& &-search":{marginBlockEnd:"16px",background:e.colorBgContainer,"&-ghost":{background:"transparent"},[`&${e.componentCls}-form`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:16,overflow:"unset"},"&-light-filter":{marginBlockEnd:0,paddingBlock:0,paddingInline:0},"&-form-option":{[`${e.antCls}-form-item`]:{},[`${e.antCls}-form-item-label`]:{},[`${e.antCls}-form-item-control-input`]:{}},"@media (max-width: 575px)":{[e.componentCls]:{height:"auto !important",paddingBlockEnd:"24px",[`${e.antCls}-form-item-label`]:{minWidth:"80px",textAlign:"start"}}}},"&-toolbar":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"64px",paddingInline:24,paddingBlock:0,"&-option":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"&-title":{flex:"1",color:e.colorTextLabel,fontWeight:"500",fontSize:"16px",lineHeight:"24px",opacity:"0.85"}}},[`@media (max-width: ${e.screenXS})px`]:{[e.componentCls]:{[`${e.antCls}-table`]:{width:"100%",overflowX:"auto","&-thead > tr,&-tbody > tr":{"> th,> td":{whiteSpace:"pre",">span":{display:"block"}}}}}},"@media (max-width: 575px)":{[`${e.componentCls}-toolbar`]:{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",height:"auto",marginBlockEnd:"16px",marginInlineStart:"16px",paddingBlock:8,paddingInline:8,paddingBlockStart:"16px",lineHeight:"normal","&-title":{marginBlockEnd:16},"&-option":{display:"flex",justifyContent:"space-between",width:"100%"},"&-default-option":{display:"flex",flex:"1",alignItems:"center",justifyContent:"flex-end"}}}});function qv(e){return We("ProTable",t=>{const n={...t,componentCls:`.${e}`};return[Wv(n)]})}function Gv(e){let t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t.startsWith("-")&&(t=t.slice(1)),t}const Zv=(e,t)=>!e&&t!==!1?(t==null?void 0:t.filterType)==="light"?"LightFilter":"QueryFilter":"Form",Jv=(e,t,n)=>!e&&n==="LightFilter"?Ve({...t},["labelWidth","defaultCollapsed","filterType"]):e?{}:Ve({labelWidth:t?t==null?void 0:t.labelWidth:void 0,defaultCollapsed:!0,...t},["filterType"]),Xv=(e,t)=>e?Ve(t,["ignoreRules"]):{ignoreRules:!0,...t},Qv=({onSubmit:e,formRef:t,dateFormatter:n="string",type:r,columns:a,action:i,ghost:o,manualRequest:l,onReset:c,submitButtonLoading:h,search:g,form:f,bordered:m})=>{const{hashId:p}=d.useContext(Yt),S=r==="form",y=async(T,$)=>{e&&e(T,$)},{getPrefixCls:w}=d.useContext(u.ConfigProvider.ConfigContext),v=d.useMemo(()=>a.filter(T=>!(T===u.Table.EXPAND_COLUMN||T===u.Table.SELECTION_COLUMN||T.search===!1&&r!=="form"||r==="form"&&T.hideInForm)).map(T=>{var E;const $=!T.valueType||["textarea","jsonCode","code"].includes(T==null?void 0:T.valueType)&&r==="table"?"text":T==null?void 0:T.valueType,F=(T==null?void 0:T.key)||((E=T==null?void 0:T.dataIndex)==null?void 0:E.toString());return{...T,width:void 0,...T.search&&typeof T.search=="object"?T.search:{},valueType:$,proFieldProps:{...T.proFieldProps,proFieldKey:F?`table-field-${F}`:void 0}}}),[a,r]),x=w("pro-table-search"),C=w("pro-table-form"),j=d.useMemo(()=>Zv(S,g),[g,S]),b=d.useMemo(()=>({submitter:{submitButtonProps:{loading:h}}}),[h]);return s.jsx("div",{className:ce(p,{[w("pro-card")]:!0,[`${w("pro-card")}-border`]:!!m,[`${w("pro-card")}-bordered`]:!!m,[`${w("pro-card")}-ghost`]:!!o,[x]:!0,[C]:S,[w(`pro-table-search-${Gv(j)}`)]:!0,[`${x}-ghost`]:o,[g==null?void 0:g.className]:g!==!1&&(g==null?void 0:g.className)}),children:s.jsx(Pd,{layoutType:j,columns:v,type:r,...b,...Jv(S,g,j),...Xv(S,f||{}),formRef:t,action:i,dateFormatter:n,onInit:(T,$)=>{var F,E,M;if(t.current=$,r!=="form"){const k=(F=i.current)==null?void 0:F.pageInfo,{current:V=k==null?void 0:k.current,pageSize:z=k==null?void 0:k.pageSize}=T;if((M=(E=i.current)==null?void 0:E.setPageInfo)==null||M.call(E,{...k,current:parseInt(V,10),pageSize:parseInt(z,10)}),l)return;y(T,!0)}},onReset:T=>{c==null||c(T)},onFinish:T=>{y(T,!1)},initialValues:f==null?void 0:f.initialValues})})},eT=e=>{const{columns:t,loading:n,formRef:r,type:a,action:i,cardBordered:o,dateFormatter:l,form:c,search:h,pagination:g,ghost:f,manualRequest:m,beforeSearchSubmit:p=j=>j,onSubmit:S,onFormSearchSubmit:y,onReset:w}=e,v=d.useMemo(()=>g?lt({current:g.current,pageSize:g.pageSize}):{},[g]),x=we((j,b)=>{var F,E,M;if((c==null?void 0:c.ignoreRules)===!1&&b){(F=r==null?void 0:r.current)==null||F.validateFields().then(()=>{var z,A;const k={...j,_timestamp:Date.now(),...v},V=Ve(p(k),Object.keys(v));y(V),b||(A=(z=i.current)==null?void 0:z.setPageInfo)==null||A.call(z,{current:1}),S&&!b&&(S==null||S(j))}).catch(k=>{});return}const T={...j,_timestamp:Date.now(),...v},$=Ve(p(T),Object.keys(v));y($),b||(M=(E=i.current)==null?void 0:E.setPageInfo)==null||M.call(E,{current:1}),S&&!b&&(S==null||S(j))}),C=we(j=>{var T;const b=()=>{var F,E;const $=Ve(p({...j,...v}),Object.keys(v));y($),(E=(F=i.current)==null?void 0:F.setPageInfo)==null||E.call(F,{current:1}),w==null||w()};if((c==null?void 0:c.ignoreRules)===!1){(T=r==null?void 0:r.current)==null||T.validateFields().then(b).catch(()=>{});return}b()});return s.jsx(Qv,{submitButtonLoading:n,columns:t,type:a,ghost:f,formRef:r,onSubmit:x,manualRequest:m,onReset:C,dateFormatter:l,search:h,form:{autoFocusFirstInput:!1,...c,extraUrlParams:{...v,...c==null?void 0:c.extraUrlParams}},action:i,bordered:Nd("search",o)})},tT=(e,t)=>{const n={columns:e.columns,loading:e.loading,formRef:e.formRef,type:e.type,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,form:e.form,search:e.search,manualRequest:e.manualRequest};return gn(n,{columns:t.columns,formRef:t.formRef,loading:t.loading,type:t.type,cardBordered:t.cardBordered,dateFormatter:t.dateFormatter,form:t.form,search:t.search,manualRequest:t.manualRequest})},nT=d.memo(eT,tT);function rT(e){const{search:t,type:n,pagination:r,beforeSearchSubmit:a,actionRef:i,columns:o,onFormSearchSubmit:l,ghost:c,onReset:h,onSubmit:g,loading:f,manualRequest:m,form:p,formRef:S,cardBordered:y,dateFormatter:w,searchFormRender:v,proTableProps:x}=e;return d.useMemo(()=>{const C=t===!1&&n!=="form"?null:s.jsx(nT,{pagination:r,beforeSearchSubmit:a,action:i,columns:o,onFormSearchSubmit:j=>{l(j)},ghost:c,onReset:h,onSubmit:g,loading:f,manualRequest:m,search:t,form:p,formRef:S,type:n||"table",cardBordered:y,dateFormatter:w});return v&&C?s.jsx(s.Fragment,{children:v(x,C)}):C},[i,a,y,o,w,p,S,c,f,m,l,h,g,r,x,t,v,n])}const sT=e=>({[e.componentCls]:{boxSizing:"border-box",width:"auto","&-title":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"32px"},"&-overlay":{[`${e.antCls}-popover-inner-content`]:{width:"200px",paddingBlock:0,paddingInline:0,paddingBlockEnd:8},[`${e.antCls}-tree-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${e.antCls}-tree-draggable-icon`]:{cursor:"grab"},[`${e.antCls}-tree-treenode`]:{alignItems:"center","&:hover":{[`${e.componentCls}-list-item-option`]:{display:"block"}},[`${e.antCls}-tree-checkbox`]:{marginInlineEnd:"4px"},[`${e.antCls}-tree-title`]:{width:"100%"}}}},[`${e.componentCls}-action-rest-button`]:{color:e.colorPrimary},[`${e.componentCls}-list`]:{display:"flex",flexDirection:"column",width:"100%",paddingBlockStart:8,[`&${e.componentCls}-list-group`]:{paddingBlockStart:0},"&-title":{marginBlockStart:"6px",marginBlockEnd:"6px",paddingInlineStart:"24px",color:e.colorTextSecondary,fontSize:"12px"},"&-item":{display:"flex",alignItems:"center",maxHeight:24,justifyContent:"space-between","&-title":{flex:1,maxWidth:80,textOverflow:"ellipsis",overflow:"hidden",wordBreak:"break-all",whiteSpace:"nowrap"},"&-option":{display:"none",float:"right",cursor:"pointer","> span":{"> span.anticon":{color:e.colorPrimary}},"> span + span":{marginInlineStart:4}}}}});function aT(e){return We("ColumnSetting",t=>{const n={...t,componentCls:`.${e}`};return[sT(n)]})}const za=({title:e,show:t,children:n,columnKey:r,fixed:a})=>{const{columnsMap:i,setColumnsMap:o}=d.useContext(Ln);return t?s.jsx(u.Tooltip,{title:e,children:s.jsx("span",{onClick:l=>{l.stopPropagation(),l.preventDefault();const c=(i==null?void 0:i[r])||{},h={...i,[r]:{...c,fixed:a}};o(h)},children:n})}):null},iT=({columnKey:e,isLeaf:t,title:n,className:r,fixed:a,showListItemOption:i})=>{const o=Ie(),{hashId:l}=d.useContext(Yt),c=s.jsxs("span",{className:ce(`${r}-list-item-option`,l),children:[s.jsx(za,{columnKey:e,fixed:"left",title:o.getMessage("tableToolBar.leftPin","固定在列首"),show:a!=="left",children:s.jsx(me.VerticalAlignTopOutlined,{})}),s.jsx(za,{columnKey:e,fixed:void 0,title:o.getMessage("tableToolBar.noPin","不固定"),show:!!a,children:s.jsx(me.VerticalAlignMiddleOutlined,{})}),s.jsx(za,{columnKey:e,fixed:"right",title:o.getMessage("tableToolBar.rightPin","固定在列尾"),show:a!=="right",children:s.jsx(me.VerticalAlignBottomOutlined,{})})]});return s.jsxs("span",{className:ce(`${r}-list-item`,l),children:[s.jsx("div",{className:ce(`${r}-list-item-title`,l),children:n}),i&&!t?c:null]},e)},Ba=({list:e,draggable:t,checkable:n,showListItemOption:r,className:a,showTitle:i=!0,title:o,listHeight:l=280})=>{var x,C,j;const{hashId:c}=d.useContext(Yt),{columnsMap:h,setColumnsMap:g,sortKeyColumns:f,setSortKeyColumns:m}=d.useContext(Ln),p=e&&e.length>0,S=d.useMemo(()=>{if(!p)return{};const b=[],T=new Map,$=(F,E)=>F.map(({key:M,dataIndex:k,children:V,...z})=>{var D,O;const A=sr(M,[E==null?void 0:E.columnKey,z.index].filter(Boolean).join("-")),I=(h==null?void 0:h[A||"null"])||{show:!0};I.show!==!1&&!V&&b.push(A);const R={key:A,...Ve(z,["className"]),selectable:!1,disabled:I.disable===!0,disableCheckbox:typeof I.disable=="boolean"?I.disable:(D=I.disable)==null?void 0:D.checkbox,isLeaf:E?!0:void 0};return V&&(R.children=$(V,{...I,columnKey:A}),(O=R.children)!=null&&O.every(N=>b==null?void 0:b.includes(N.key))&&b.push(A)),T.set(M,{...R,parentKey:E==null?void 0:E.columnKey}),R});return{list:$(e),keys:b,map:T}},[h,e,p]),y=we((b,T,$)=>{const F={...h},E=[...f],M=E.findIndex(A=>A===b),k=E.findIndex(A=>A===T),V=$>=M;if(M<0)return;const z=E[M];E.splice(M,1),$===0?E.unshift(z):E.splice(V?k:k+1,0,z),E.forEach((A,I)=>{F[A]={...F[A]||{},order:I}}),g(F),m(E)}),w=we(b=>{const T={...h},$=F=>{var k,V,z,A,I,R;const E={...T[F]};E.show=b.checked,(V=(k=S.map)==null?void 0:k.get(F))!=null&&V.children&&((A=(z=S.map.get(F))==null?void 0:z.children)==null||A.forEach(D=>$(D.key)));const M=(R=(I=S.map)==null?void 0:I.get(F))==null?void 0:R.parentKey;M&&(T[M]={...T[M],show:!0}),T[F]=E};$(b.node.key),g({...T})});if(!p)return null;const v=s.jsx(u.Tree,{itemHeight:24,draggable:t&&!!((x=S.list)!=null&&x.length)&&((C=S.list)==null?void 0:C.length)>1,checkable:n,onDrop:b=>{const T=b.node.key,$=b.dragNode.key,{dropPosition:F,dropToGap:E}=b,M=F===-1||!E?F+1:F;y($,T,M)},blockNode:!0,onCheck:(b,T)=>w(T),checkedKeys:S.keys,showLine:!1,titleRender:b=>{const T={...b,children:void 0};if(!T.title)return null;const $=ht(T.title,T),F=s.jsx(u.Typography.Text,{style:{width:80},ellipsis:{tooltip:$},children:$});return s.jsx(iT,{className:a,...Ve(T,["key"]),showListItemOption:r,title:F,columnKey:T.key})},height:l,treeData:(j=S.list)==null?void 0:j.map(({disabled:b,...T})=>T)});return s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:ce(`${a}-list-title`,c),children:o}),v]})},oT=({localColumns:e,className:t,draggable:n,checkable:r,showListItemOption:a,listsHeight:i})=>{const{hashId:o}=d.useContext(Yt),l=[],c=[],h=[],g=Ie();e.forEach(p=>{if(p.hideInSetting)return;const{fixed:S}=p;if(S==="left"){c.push(p);return}if(S==="right"){l.push(p);return}h.push(p)});const f=l&&l.length>0,m=c&&c.length>0;return s.jsxs("div",{className:ce(`${t}-list`,o,{[`${t}-list-group`]:f||m}),children:[s.jsx(Ba,{title:g.getMessage("tableToolBar.leftFixedTitle","固定在左侧"),list:c,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i}),s.jsx(Ba,{list:h,draggable:n,checkable:r,showListItemOption:a,title:g.getMessage("tableToolBar.noFixedTitle","不固定"),showTitle:m||f,className:t,listHeight:i}),s.jsx(Ba,{title:g.getMessage("tableToolBar.rightFixedTitle","固定在右侧"),list:l,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i})]})};function lT(e){const t=d.useRef(null),n=d.useContext(Ln),r=e.columns,{checkedReset:a=!0}=e,{columnsMap:i,setColumnsMap:o,clearPersistenceStorage:l}=n;d.useEffect(()=>{var x,C,j,b;(C=(x=n.propsRef.current)==null?void 0:x.columnsState)!=null&&C.value&&(t.current=JSON.parse(JSON.stringify(((b=(j=n.propsRef.current)==null?void 0:j.columnsState)==null?void 0:b.value)||{})))},[]);const c=we((x=!0)=>{const C={},j=b=>{b.forEach(({key:T,fixed:$,index:F,children:E,disable:M})=>{var V,z;const k=sr(T,F);k&&(C[k]={show:M?(V=i==null?void 0:i[k])==null?void 0:V.show:x,fixed:$,disable:M,order:(z=i==null?void 0:i[k])==null?void 0:z.order}),E&&j(E)})};j(r),o(C)}),h=we(x=>{x.target.checked?c():c(!1)}),g=we(()=>{var x,C;l==null||l(),o(((C=(x=n.propsRef.current)==null?void 0:x.columnsState)==null?void 0:C.defaultValue)||t.current||n.defaultColumnKeyMap)}),f=Object.values(i).filter(x=>!x||x.show===!1),m=f.length>0&&f.length!==r.length,p=Ie(),{getPrefixCls:S}=d.useContext(u.ConfigProvider.ConfigContext),y=S("pro-table-column-setting"),{wrapSSR:w,hashId:v}=aT(y);return w(s.jsx(u.Popover,{arrow:!1,title:s.jsxs("div",{className:ce(`${y}-title`,v),children:[e.checkable===!1?s.jsx("div",{}):s.jsx(u.Checkbox,{indeterminate:m,checked:f.length===0&&f.length!==r.length,onChange:x=>{h(x)},children:p.getMessage("tableToolBar.columnDisplay","列展示")}),a?s.jsx("a",{onClick:g,className:ce(`${y}-action-rest-button`,v),children:p.getMessage("tableToolBar.reset","重置")}):null,e!=null&&e.extra?s.jsx(u.Space,{size:12,align:"center",children:e.extra}):null]}),classNames:{root:ce(`${y}-overlay`,v)},trigger:"click",placement:"bottomRight",content:s.jsx(oT,{checkable:e.checkable??!0,draggable:e.draggable??!0,showListItemOption:e.showListItemOption??!0,className:y,localColumns:r,listsHeight:e.listsHeight}),children:e.children||s.jsx(u.Tooltip,{title:p.getMessage("tableToolBar.columnSetting","列设置"),children:e.settingIcon??s.jsx(me.SettingOutlined,{})})}))}const cT=e=>{const{hashId:t}=d.useContext(Yt),n=e.hashId??t,{items:r=[],type:a="inline",prefixCls:i,activeKey:o,defaultActiveKey:l}=e,[c,h]=rt(o||l,o),g=d.useCallback(m=>{h(p=>{var y;const S=typeof m=="function"?m(p):m;return(y=e.onChange)==null||y.call(e,S,p),S})},[e.onChange]);if(r.length<1)return null;const f=r.find(m=>m.key===c)||r[0];return a==="inline"?s.jsx("div",{className:ce(`${i}-menu`,`${i}-inline-menu`,n),children:r.map((m,p)=>s.jsx("div",{onClick:()=>{g(m.key)},className:ce(`${i}-inline-menu-item`,f.key===m.key?`${i}-inline-menu-item-active`:void 0,n),children:m.label},m.key||p))}):a==="tab"?s.jsx(u.Tabs,{items:r.map(m=>{var p;return{...m,key:(p=m.key)==null?void 0:p.toString()}}),activeKey:f.key,onTabClick:m=>g(m)}):s.jsx("div",{className:ce(`${i}-menu`,`${i}-dropdownmenu`,n),children:s.jsx(u.Dropdown,{trigger:["click"],menu:{selectedKeys:[f.key],onClick:m=>{g(m.key)},items:r.map((m,p)=>({key:m.key||p,disabled:m.disabled,label:m.label}))},children:s.jsxs(u.Space,{className:ce(`${i}-dropdownmenu-label`,n),children:[f.label,s.jsx(me.DownOutlined,{})]})})})},uT=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"1","&-container":{display:"flex",justifyContent:"space-between",paddingBlock:e.padding,paddingInline:e.paddingXS,"&-mobile":{flexDirection:"column"}},"&-title":{display:"flex",alignItems:"center",justifyContent:"flex-start",color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},"&-search:not(:last-child)":{display:"flex",alignItems:"center",justifyContent:"flex-start"},"&-setting-item":{marginBlock:0,marginInline:4,color:e.colorIconHover,fontSize:e.fontSizeLG,cursor:"pointer","> span":{display:"block",width:"100%",height:"100%"},"&:hover":{color:e.colorPrimary}},"&-left":{display:"flex",flexWrap:"wrap",alignItems:"center",gap:e.marginXS,justifyContent:"flex-start",maxWidth:"calc(100% - 200px)",[`${e.antCls}-tabs`]:{width:"100%"},"&-has-tabs":{overflow:"hidden"}},"&-right":{flex:1,display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:e.marginXS},"&-extra-line":{marginBlockEnd:e.margin},"&-setting-items":{display:"flex",gap:e.marginXS,lineHeight:"32px",alignItems:"center"},"&-filter":{"&:not(:last-child)":{marginInlineEnd:e.margin},display:"flex",alignItems:"center",[`div$${e.antCls}-pro-table-search`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0}},"&-inline-menu-item":{display:"inline-block",marginInlineEnd:e.marginLG,cursor:"pointer",opacity:"0.75","&-active":{fontWeight:"bold",opacity:"1"}},[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,"&::before":{borderBlockEnd:0},[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:0,[`${e.antCls}-tabs-tab`]:{paddingBlockStart:0}}},"&-dropdownmenu-label":{fontWeight:"bold",fontSize:e.fontSizeIcon,textAlign:"center",cursor:"pointer"},"@media (max-width: 768px)":{[e.componentCls]:{"&-container":{display:"flex",flexWrap:"wrap",flexDirection:"column"},"&-left":{marginBlockEnd:"16px",maxWidth:"100%"}}}}});function dT(e){return We("ProTableListToolBar",t=>{const n={...t,componentCls:`.${e}`};return[uT(n)]})}function fT(e){if(d.isValidElement(e))return e;if(e){const t=e,{icon:n,tooltip:r,onClick:a,key:i}=t;return n&&r?s.jsx(u.Tooltip,{title:r,children:s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}):s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}return null}const mT=({prefixCls:e,hashId:t,tabs:n,multipleLine:r,filtersNode:a})=>r?s.jsx("div",{className:ce(`${e}-extra-line`,t),children:n!=null&&n.items&&(n!=null&&n.items.length)?s.jsx(u.Tabs,{style:{width:"100%"},defaultActiveKey:n.defaultActiveKey,activeKey:n.activeKey,items:n.items.map((i,o)=>{var l;return{label:i.tab,...i,key:((l=i.key)==null?void 0:l.toString())||(o==null?void 0:o.toString())}}),onChange:n.onChange,tabBarExtraContent:a}):a}):null,hT=({prefixCls:e,title:t,subTitle:n,tooltip:r,className:a,style:i,search:o,onSearch:l,multipleLine:c=!1,filter:h,actions:g=[],settings:f=[],tabs:m,menu:p})=>{const{getPrefixCls:S}=d.useContext(u.ConfigProvider.ConfigContext),{token:y}=hn.useToken(),w=S("pro-table-list-toolbar",e),{wrapSSR:v,hashId:x}=dT(w),C=Ie(),[j,b]=d.useState(!1),T=C.getMessage("tableForm.inputPlaceholder","请输入"),$=d.useMemo(()=>o?d.isValidElement(o)?o:s.jsx(u.Input.Search,{style:{width:200},placeholder:T,...o,onSearch:async(...R)=>{var O;await((O=o.onSearch)==null?void 0:O.call(o,...R))!==!1&&(l==null||l(R==null?void 0:R[0]))}}):null,[T,l,o]),F=d.useMemo(()=>h?s.jsx("div",{className:ce(`${w}-filter`,x),children:h}):null,[h,x,w]),E=d.useMemo(()=>p||t||n||r,[p,n,t,r]),M=d.useMemo(()=>Array.isArray(g)?g.length<1?null:s.jsx("div",{style:{display:"flex",alignItems:"center",gap:y.marginXS},children:g.map((R,D)=>d.isValidElement(R)?d.cloneElement(R,{key:D,...R==null?void 0:R.props}):s.jsx(d.Fragment,{children:R},D))}):g,[g]),k=d.useMemo(()=>!!(E&&$||!c&&F||M||f!=null&&f.length),[M,F,E,c,$,f==null?void 0:f.length]),V=d.useMemo(()=>r||t||n||p||!E&&$,[E,p,$,n,t,r]),z=d.useMemo(()=>!V&&k?s.jsx("div",{className:ce(`${w}-left`,x)}):!p&&(E||!$)?s.jsx("div",{className:ce(`${w}-left`,x),children:s.jsx("div",{className:ce(`${w}-title`,x),children:s.jsx(er,{tooltip:r,label:t,subTitle:n})})}):s.jsxs("div",{className:ce(`${w}-left`,x,{[`${w}-left-has-tabs`]:(p==null?void 0:p.type)==="tab",[`${w}-left-has-dropdown`]:(p==null?void 0:p.type)==="dropdown",[`${w}-left-has-inline-menu`]:(p==null?void 0:p.type)==="inline"}),children:[E&&!p&&s.jsx("div",{className:ce(`${w}-title`,x),children:s.jsx(er,{tooltip:r,label:t,subTitle:n})}),p&&s.jsx(cT,{...p,prefixCls:w,hashId:x}),!E&&$?s.jsx("div",{className:ce(`${w}-search`,x),children:$}):null]}),[V,k,E,x,p,w,$,n,t,r]),A=d.useMemo(()=>k?s.jsxs("div",{className:ce(`${w}-right`,x),style:j?{}:{alignItems:"center"},children:[c?null:F,E&&$?s.jsx("div",{className:ce(`${w}-search`,x),children:$}):null,M,f!=null&&f.length?s.jsx("div",{className:ce(`${w}-setting-items`,x),children:f.map((R,D)=>{const O=fT(R);return s.jsx("div",{className:ce(`${w}-setting-item`,x),children:O},D)})}):null]}):null,[k,w,x,j,E,$,c,F,M,f]),I=d.useMemo(()=>{if(!k&&!V)return null;const R=ce(`${w}-container`,x,{[`${w}-container-mobile`]:j});return s.jsxs("div",{className:R,children:[z,A]})},[V,k,x,j,z,w,A]);return v(s.jsx(ra,{onResize:R=>{R.width<375!==j&&b(R.width<375)},children:R=>s.jsxs("div",{ref:R,style:i,className:ce(w,x,a),children:[I,s.jsx(mT,{filtersNode:F,hashId:x,prefixCls:w,tabs:m,multipleLine:c})]})}))},gT=d.forwardRef((e,t)=>{const{icon:n=s.jsx(me.ColumnHeightOutlined,{})}=e,r=d.useContext(Ln),a=Ie();return s.jsx(u.Dropdown,{menu:{selectedKeys:[r.tableSize],onClick:({key:i})=>{var o;(o=r.setTableSize)==null||o.call(r,i)},style:{width:80},items:[{key:"large",label:a.getMessage("tableToolBar.densityLarger","宽松")},{key:"middle",label:a.getMessage("tableToolBar.densityMiddle","中等")},{key:"small",label:a.getMessage("tableToolBar.densitySmall","紧凑")}]},trigger:["click"],children:s.jsx(u.Tooltip,{title:a.getMessage("tableToolBar.density","表格密度"),children:s.jsx("span",{ref:t,children:n})})})}),pT=d.memo(gT),yT=d.forwardRef((e,t)=>{const n=Ie(),[r,a]=d.useState(!1);return d.useEffect(()=>{Xi()&&(document.onfullscreenchange=()=>{a(!!document.fullscreenElement)})},[]),r?s.jsx(u.Tooltip,{title:n.getMessage("tableToolBar.exitFullScreen","退出全屏"),children:s.jsx("span",{ref:t,children:s.jsx(me.FullscreenExitOutlined,{})})}):s.jsx(u.Tooltip,{title:n.getMessage("tableToolBar.fullScreen","全屏"),children:s.jsx("span",{ref:t,children:s.jsx(me.FullscreenOutlined,{})})})}),Ld=d.memo(yT);function xT({intl:e},t){return{reload:{text:e.getMessage("tableToolBar.reload","刷新"),icon:t.reloadIcon??s.jsx(me.ReloadOutlined,{})},density:{text:e.getMessage("tableToolBar.density","表格密度"),icon:s.jsx(pT,{icon:t.densityIcon})},fullScreen:{text:e.getMessage("tableToolBar.fullScreen","全屏"),icon:s.jsx(Ld,{})}}}function bT(e,t,n,r){return Object.keys(e).filter(a=>a).map(a=>{const i=e[a];if(!i)return null;let o=i===!0?t[a]:c=>{i==null||i(c,n.current)};if(typeof o!="function"&&(o=()=>{}),a==="setting")return d.createElement(lT,{...e[a],columns:r,key:a});if(a==="fullScreen")return s.jsx("span",{onClick:o,children:s.jsx(Ld,{})},a);const l=xT(t,e)[a];return l?s.jsx("span",{onClick:o,children:s.jsx(u.Tooltip,{title:l.text,children:l.icon})},a):null}).filter(a=>a)}function ST({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:c,columns:h,optionsRender:g,...f}){const m=d.useContext(Ln),p=Ie(),S=d.useMemo(()=>{const v={reload:()=>{var j;return(j=r==null?void 0:r.current)==null?void 0:j.reload()},density:!0,setting:!0,search:!1,fullScreen:()=>{var j,b;return(b=(j=r==null?void 0:r.current)==null?void 0:j.fullScreen)==null?void 0:b.call(j)}};if(a===!1)return[];const x={...v,fullScreen:!1,...a},C=bT(x,{...v,intl:p},r,h);return g?g({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:c,columns:h,optionsRender:g,...f},C):C},[r,h,e,p,c,g,a,f,i,o,n,l,t]),y=n?n(r==null?void 0:r.current,{selectedRowKeys:i,selectedRows:o}):[],w=d.useMemo(()=>{if(!a||!a.search)return!1;const v={value:m.keyWords,onChange:x=>m.setKeyWords(x.target.value)};return a.search===!0?v:{...v,...a.search}},[m,a]);return d.useEffect(()=>{m.keyWords===void 0&&(c==null||c(""))},[m.keyWords,c]),s.jsx(hT,{title:e,tooltip:t,search:w,onSearch:c,actions:y,settings:S,...l})}const CT=e=>{const{hideToolbar:t,tableColumn:n,options:r,searchNode:a,tooltip:i,toolbar:o,selectedRows:l,selectedRowKeys:c,headerTitle:h,actionRef:g,toolBarRender:f,optionsRender:m,onFormSearchSubmit:p}=e,S=d.useCallback(y=>{var x,C,j,b;if(!r||!r.search)return;const{name:w="keyword"}=r.search===!0?{}:r.search;((C=(x=r.search)==null?void 0:x.onSearch)==null?void 0:C.call(x,y))!==!1&&((b=(j=g==null?void 0:g.current)==null?void 0:j.setPageInfo)==null||b.call(j,{current:1}),p(lt({_timestamp:Date.now(),[w]:y})))},[r,p,g]);return t?null:s.jsx(ST,{tooltip:i,columns:n,options:r,headerTitle:h,action:g,onSearch:S,selectedRows:l,selectedRowKeys:c,toolBarRender:f,toolbar:{filter:a,...o},optionsRender:m})},wT=(e,t)=>t.searchNode?!1:gn({hideToolbar:e.hideToolbar,tableColumn:e.tableColumn,options:e.options,tooltip:e.tooltip,toolbar:e.toolbar,selectedRows:e.selectedRows,selectedRowKeys:e.selectedRowKeys,headerTitle:e.headerTitle,actionRef:e.actionRef,toolBarRender:e.toolBarRender},{hideToolbar:t.hideToolbar,tableColumn:t.tableColumn,options:t.options,tooltip:t.tooltip,toolbar:t.toolbar,selectedRows:t.selectedRows,selectedRowKeys:t.selectedRowKeys,headerTitle:t.headerTitle,actionRef:t.actionRef,toolBarRender:t.toolBarRender},["render","formItemRender"]),jT=d.memo(CT,wT);function vT(e){const{toolBarRender:t,headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:c,isLightFilter:h,searchNode:g,options:f,optionsRender:m,actionRef:p,setFormSearch:S,formSearch:y}=e;return d.useMemo(()=>t===!1?null:s.jsx(jT,{headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:c,onFormSearchSubmit:w=>{S({...y||{},...w})},searchNode:h?g:null,options:f,optionsRender:m,actionRef:p,toolBarRender:t}),[p,y,n,r,h,f,m,g,i,a,S,o,t,l,c])}const TT=({pageInfo:e})=>{if(e){const{current:t,defaultCurrent:n,pageSize:r,defaultPageSize:a}=e;return{current:t||n||1,total:0,pageSize:r||a||20}}return{current:1,total:0,pageSize:20}};function FT(e){const[t,n]=rt(()=>TT(e),void 0),r=d.useCallback(i=>{n(o=>{var c;const l=typeof i=="function"?i(o):i;return(c=e==null?void 0:e.onPageInfoChange)==null||c.call(e,l),l})},[e==null?void 0:e.onPageInfoChange]),a=we(i=>{const o={...t,...i};(o.current!==t.current||o.pageSize!==t.pageSize||o.total!==t.total)&&r(o)});return[t,a]}const $T=(e,t,n)=>{var D;const r=d.useRef(!1),a=d.useRef(null),{onLoad:i,manual:o,polling:l,onRequestError:c,debounceTime:h=20,effects:g=[]}=n||{},f=d.useRef(o),m=d.useRef(),[p,S]=rt(t,n==null?void 0:n.dataSource),y=d.useCallback(O=>{S(N=>{const q=typeof O=="function"?O(N):O;return queueMicrotask(()=>{var L;(L=n==null?void 0:n.onDataSourceChange)==null||L.call(n,q)}),q})},[n==null?void 0:n.onDataSourceChange]),w=typeof(n==null?void 0:n.loading)=="object"?(D=n==null?void 0:n.loading)==null?void 0:D.spinning:n==null?void 0:n.loading,[v,x]=rt(!1,w),C=we(O=>{var N;(N=n==null?void 0:n.onLoadingChange)==null||N.call(n,O)}),j=d.useCallback(O=>{x(N=>{const q=typeof O=="function"?O(N):O;return queueMicrotask(()=>{C(q)}),q})},[C]),[b,T]=FT(n),[$,F]=d.useState(!1),E=(O,N)=>{y(O),(b==null?void 0:b.total)!==N&&T({...b,total:N||O.length})},M=$r(b==null?void 0:b.current),k=$r(b==null?void 0:b.pageSize),V=$r(l),z=we(()=>{j(!1),F(!1)}),A=async(O,N)=>{if(f.current){f.current=!1;return}O?F(!0):j(!0);const{pageSize:q,current:L}=b||{};try{const H=(n==null?void 0:n.pageInfo)!==!1?{current:L,pageSize:q}:void 0,{data:G=[],success:W,total:B=0,..._}=await(e==null?void 0:e(H))||{};if(N!=null&&N.aborted)return[];if(W===!1)return[];const Y=Nv(G,[n.postData].filter(P=>P));return N!=null&&N.aborted?[]:(E(Y,B),i==null||i(Y,_),Y)}catch(H){if(N!=null&&N.aborted)return[];if(c===void 0)throw new Error(H);p===void 0&&y([]),c(H)}finally{N!=null&&N.aborted||z()}return[]},I=Gi(async O=>{if(m.current&&clearTimeout(m.current),!e)return;const N=new AbortController;a.current=N;try{const q=await Promise.race([A(O,N.signal),new Promise((H,G)=>{var W,B,_;(_=(B=(W=a.current)==null?void 0:W.signal)==null?void 0:B.addEventListener)==null||_.call(B,"abort",()=>{G("aborted"),I.cancel(),z()})})]);if(N.signal.aborted)return;const L=ht(l,q);return L&&!r.current&&(m.current=setTimeout(()=>{I.run(L)},Math.max(L,2e3))),q}catch(q){if(q==="aborted")return[];throw q}},h||30),R=()=>{var O;(O=a.current)==null||O.abort(),I.cancel(),z()};return d.useEffect(()=>(l||clearTimeout(m.current),!V&&l&&I.run(!0),()=>{clearTimeout(m.current)}),[l]),d.useEffect(()=>(r.current=!1,()=>{r.current=!0}),[]),d.useEffect(()=>{const{current:O,pageSize:N}=b||{};(!M||M===O)&&(!k||k===N)||n.pageInfo&&p&&(p==null?void 0:p.length)>N||O!==void 0&&p&&p.length<=N&&(R(),I.run(!1))},[b==null?void 0:b.current]),d.useEffect(()=>{k&&(R(),I.run(!1))},[b==null?void 0:b.pageSize]),qn(()=>(R(),I.run(!1),o||(f.current=!1),()=>{R()}),[...g,o]),{dataSource:p,setDataSource:y,loading:typeof(n==null?void 0:n.loading)=="object"?{...n==null?void 0:n.loading,spinning:v}:v,reload:async()=>(R(),f.current=!1,await I.run(!1)),pageInfo:b,pollingLoading:$,reset:async()=>{const{pageInfo:O}=n||{},{defaultCurrent:N=1,defaultPageSize:q=20}=O||{};T({current:N,total:0,pageSize:q})},setPageInfo:async O=>{T(O)}}},RT=e=>(t,n)=>{var h,g,f,m;const{fixed:r,index:a}=t,{fixed:i,index:o}=n;if(r==="left"&&i!=="left"||i==="right"&&r!=="right")return-2;if(i==="left"&&r!=="left"||r==="right"&&i!=="right")return 2;const l=t.key||`${a}`,c=n.key||`${o}`;return(h=e==null?void 0:e[l])!=null&&h.order||(g=e==null?void 0:e[c])!=null&&g.order?(((f=e==null?void 0:e[l])==null?void 0:f.order)||0)-(((m=e==null?void 0:e[c])==null?void 0:m.order)||0):(t.index||0)-(n.index||0)},ET=["",null,void 0],Oc=(...e)=>e.filter(t=>t!==void 0).map(t=>typeof t=="number"?t.toString():t).flat(1),IT=e=>{const t=d.useContext(ur),{columnProps:n,prefixName:r,text:a,counter:i,rowData:o,index:l,recordKey:c,subName:h,proFieldProps:g,editableUtils:f}=e,m=gt.useFormInstance(),p=c||l,S=d.useMemo(()=>{var b;return((b=f==null?void 0:f.getRealIndex)==null?void 0:b.call(f,o))??l},[f,l,o]),[y,w]=d.useState(()=>Oc(r,r?h:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l)),v=d.useMemo(()=>y.slice(0,-1),[y]);d.useEffect(()=>{const b=Oc(r,r?h:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l);b.join("-")!==y.join("-")&&w(b)},[n==null?void 0:n.dataIndex,n==null?void 0:n.key,l,c,r,p,h,y,S]);const x=d.useMemo(()=>[m,{...n,rowKey:v,rowIndex:l,isEditable:!0}],[n,m,l,v]),C=d.useCallback(({children:b,...T})=>s.jsx(xp,{popoverProps:{getPopupContainer:t.getPopupContainer||(()=>i.rootDomRef.current||document.body)},errorType:"popover",name:y,...T,children:b},p),[p,y]),j=d.useCallback(()=>{const b={...fi(n==null?void 0:n.formItemProps,...x)};b.messageVariables={label:(n==null?void 0:n.title)||"此项",type:(n==null?void 0:n.valueType)||"文本",...b==null?void 0:b.messageVariables},b.initialValue=(r?null:a)??(b==null?void 0:b.initialValue)??(n==null?void 0:n.initialValue);let T=s.jsx(bn,{cacheForSwr:!0,name:y,proFormFieldKey:p,ignoreFormItem:!0,fieldProps:fi(n==null?void 0:n.fieldProps,...x),...g},y.join("-"));return n!=null&&n.formItemRender&&(T=n.formItemRender({...n,index:l,isEditable:!0,type:"table"},{defaultRender:()=>s.jsx(s.Fragment,{children:T}),type:"form",recordKey:c,record:{...o,...m==null?void 0:m.getFieldValue([p])},isEditable:!0},m,e.editableUtils),n.ignoreFormItem)?s.jsx(s.Fragment,{children:T}):s.jsx(C,{...b,children:T},y.join("-"))},[n,x,r,a,p,y,g,C,l,c,o,m,e.editableUtils]);return y.length===0?null:typeof(n==null?void 0:n.formItemRender)=="function"||typeof(n==null?void 0:n.fieldProps)=="function"||typeof(n==null?void 0:n.formItemProps)=="function"?s.jsx(u.Form.Item,{noStyle:!0,shouldUpdate:(b,T)=>{if(b===T)return!1;const $=[v].flat(1);try{return JSON.stringify(Oe(b,$))!==JSON.stringify(Oe(T,$))}catch{return!0}},children:()=>j()}):j()};function _d(e){var h,g;const{text:t,valueType:n,rowData:r,columnProps:a,index:i}=e;if((!n||["textarea","text"].includes(n.toString()))&&!(a!=null&&a.valueEnum)&&e.mode==="read")return ET.includes(t)?e.columnEmptyText:t;if(typeof n=="function"&&r)return _d({...e,valueType:n(r,e.type)||"text"});const o=(a==null?void 0:a.key)||((h=a==null?void 0:a.dataIndex)==null?void 0:h.toString()),l=a!=null&&a.dependencies?[e.prefixName,e.prefixName?i==null?void 0:i.toString():(g=e.recordKey)==null?void 0:g.toString(),a==null?void 0:a.dependencies].filter(Boolean).flat(1):[],c={valueEnum:ht(a==null?void 0:a.valueEnum,r),request:a==null?void 0:a.request,dependencies:a!=null&&a.dependencies?[l]:void 0,originDependencies:a!=null&&a.dependencies?[a==null?void 0:a.dependencies]:void 0,params:ht(a==null?void 0:a.params,r,a),readonly:a==null?void 0:a.readonly,text:n==="index"||n==="indexBorder"?e.index:t,mode:e.mode,formItemRender:void 0,valueType:n,record:r,proFieldProps:{emptyText:e.columnEmptyText,proFieldKey:o?`table-field-${o}`:void 0}};return e.mode!=="edit"?s.jsx(bn,{mode:"read",ignoreFormItem:!0,fieldProps:fi(a==null?void 0:a.fieldProps,null,a),...c}):s.jsx(IT,{...e,proFieldProps:c},e.recordKey)}const MT=e=>{var r;const{title:t}=e,n=typeof(e==null?void 0:e.ellipsis)=="boolean"?e==null?void 0:e.ellipsis:(r=e==null?void 0:e.ellipsis)==null?void 0:r.showTitle;return t&&typeof t=="function"?t(e,"table",null):s.jsx(er,{label:t,tooltip:e.tooltip,ellipsis:n})};function kT(e,t,n,r){return typeof r=="boolean"?r===!1:(r==null?void 0:r(e,t,n))===!1}const AT=(e,t,n)=>{const r=Array.isArray(n)?Oe(t,n):t[n],a=String(r);return String(a)===String(e)};function OT({columnProps:e,text:t,rowData:n,index:r,columnEmptyText:a,counter:i,type:o,subName:l,marginSM:c,editableUtils:h}){const{action:g,prefixName:f}=i,{isEditable:m,recordKey:p}=h.isEditable({...n,index:r}),{renderText:S=j=>j}=e,y=S(t,n,r,g),w=m&&!kT(t,n,r,e==null?void 0:e.editable)?"edit":"read",v=_d({text:y,valueType:e.valueType||"text",index:r,rowData:n,subName:l,columnProps:{...e,entry:n,entity:n},counter:i,columnEmptyText:a,type:o,recordKey:p,mode:w,prefixName:f,editableUtils:h}),x=w==="edit"?v:Mp(v,e,y,t);if(w==="edit")return e.valueType==="option"?s.jsx("div",{style:{display:"flex",alignItems:"center",gap:c,justifyContent:e.align==="center"?"center":"flex-start"},children:h.actionRender({...n,index:e.index||r})}):x;if(!e.render){const j=d.isValidElement(x)||["string","number"].includes(typeof x);return!Et(x)&&j?x:null}const C=e.render(x,n,r,{...g,...h},{...e,isEditable:m,type:"table"});return Lv(C)?C:C&&e.valueType==="option"&&Array.isArray(C)?s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:8},children:C}):C}function DT(e){const{onFilter:t,dataIndex:n}=e;return t===!0?(r,a)=>AT(r,a,n):Lu(t)}function PT(e){const{filters:t=[],valueEnum:n}=e;return t===!0?yd(ht(n,void 0)).filter(r=>r&&r.value!=="all"):t}function NT(e,t,n){return{fixed:((e==null?void 0:e[t])||{fixed:n.fixed}).fixed}}function LT(e,t,n){return{filteredValue:Hv(e,n),sortOrder:Vv(t,n)}}function _T(e,t,n,r,a){var c;if(typeof e!="object"||e===null||!Reflect.has(e,n))return;const i=e,o=i[n],l=a.get(o)||[];return(c=i[r])==null||c.forEach(h=>{const g=h[n];a.has(g)||a.set(g,l.concat([t,r]))}),o}function zT(e,t,n){let r=t.rowKey??"id";return function(i,o,l){typeof t.rowKey=="function"&&(r=t.rowKey(o,l));const c=_T(o,l,r,t.childrenColumnName,n);return OT({columnProps:e,text:i,rowData:o,index:l,columnEmptyText:t.columnEmptyText,counter:t.counter,type:t.type,marginSM:t.marginSM,subName:n.get(c)??[],editableUtils:t.editableUtils})}}function zd(e){var i;const{columns:t,context:n,parents:r}=e,a=new Map;return(i=t==null?void 0:t.map((o,l)=>{if(o===u.Table.EXPAND_COLUMN||o===u.Table.SELECTION_COLUMN)return o;const{key:c,dataIndex:h,valueEnum:g,valueType:f="text",children:m}=o,p=sr(c||(h==null?void 0:h.toString()),[r==null?void 0:r.key,l].filter(Boolean).join("-"));if(!g&&!f&&!m)return{index:l,...o};const{filteredValue:y,sortOrder:w}=LT(n.proFilter,n.proSort,o),{fixed:v}=NT(n.counter.columnsMap,p,o),x={index:l,key:p,...o,title:MT(o),valueEnum:g,filters:PT(o),onFilter:DT(o),filteredValue:y,sortOrder:w,fixed:v,width:o.width||(o.fixed?200:void 0),children:o.children?zd({columns:(o==null?void 0:o.children)??[],context:n,parents:{...o,key:p}}):void 0,render:zT(o,n,a)};return Bp(x)}))==null?void 0:i.filter(o=>!o.hideInTable)}function BT({dataSource:e,editableUtils:t,pagination:n,getRowKey:r,childrenColumnName:a}){var f;const i=Array.isArray(e)?[...e]:[],o=t==null?void 0:t.newLineRecord,l=o==null?void 0:o.defaultValue;if(!o||!l)return i;const{options:c}=o,h=a;if(c!=null&&c.parentKey){const m={...l,map_row_parentKey:(f=Je(c.parentKey))==null?void 0:f.toString()},p={data:i,getRowKey:r,row:m,key:(c==null?void 0:c.recordKey)??r(m,-1),childrenColumnName:h};return Cr(p,(c==null?void 0:c.position)==="top"?"top":"update")}if((c==null?void 0:c.position)==="top")return[l,...i];const g=n&&typeof n=="object"?n:void 0;if(g!=null&&g.current&&(g!=null&&g.pageSize)){if(g.pageSize>i.length)return i.push(l),i;const m=g.current*g.pageSize-1;return i.splice(m,0,l),i}return i.push(l),i}function VT({propsCardProps:e,notNeedCardDom:t,name:n,hideToolbar:r,toolbarDom:a}){return e===!1||t||n?{}:r?{padding:0}:a?{paddingBlockStart:0}:{padding:0}}function HT({rowKey:e,name:t}){return d.useMemo(()=>typeof e=="function"?e:(n,r)=>r===-1?n==null?void 0:n[e]:t?r==null?void 0:r.toString():(n==null?void 0:n[e])??(r==null?void 0:r.toString()),[t,e])}function YT({propsPagination:e,action:t,intl:n,request:r,type:a}){return d.useMemo(()=>{const i=e===!1?!1:{...e||{}},o={...t.pageInfo,setPageInfo:({pageSize:l,current:c})=>{const{pageInfo:h}=t;if(l===h.pageSize||h.current===1){t.setPageInfo({pageSize:l,current:c});return}r&&t.setDataSource([]),t.setPageInfo({pageSize:l,current:a==="list"?c:1})}};return r&&i&&(delete i.onChange,delete i.onShowSizeChange),Dv(i,o,n)},[t,n,e,r,a])}function UT({propsRowSelection:e,selectedRowKeys:t,selectedRows:n,onCleanSelected:r,tableAlertOptionRender:a,tableAlertRender:i}){return d.useMemo(()=>e===!1?null:s.jsx(Ov,{selectedRowKeys:t,selectedRows:n,onCleanSelected:r,alertOptionRender:a,alertInfoRender:i,alwaysShowAlert:e==null?void 0:e.alwaysShowAlert}),[r,e,t,n,a,i])}const KT={},WT=e=>{var ho,go,po,yo,xo,bo;const{cardBordered:t,request:n,className:r,params:a=KT,defaultData:i,headerTitle:o,postData:l,ghost:c,pagination:h,actionRef:g,toolBarRender:f,optionsRender:m,onLoad:p,onRequestError:S,style:y,cardProps:w,tableStyle:v,tableClassName:x,options:C,search:j,name:b,onLoadingChange:T,rowSelection:$=!1,beforeSearchSubmit:F,tableAlertRender:E,defaultClassName:M,formRef:k,type:V="table",columnEmptyText:z="-",toolbar:A,rowKey:I,manualRequest:R,polling:D,tooltip:O,revalidateOnFocus:N=!1,searchFormRender:q,...L}=e,{wrapSSR:H,hashId:G}=qv(e.defaultClassName),W=ce(M,r,G),B=d.useRef(),_=d.useRef(null),Y=d.useRef(),P=k||Y;d.useImperativeHandle(g,()=>B.current);const[U,X]=rt($?($==null?void 0:$.defaultSelectedRowKeys)||[]:void 0,$?$.selectedRowKeys:void 0),[ne,Z]=d.useState(()=>{if(!(R||j!==!1))return{}}),re=d.useRef(ne),ie=we(ye=>{const Ce=typeof ye=="function"?ye(re.current):ye;re.current=Ce,Z(Ce)}),{columns:se=[],columnsState:pe}=e,{defaultProFilter:ge,defaultProSort:fe}=d.useMemo(()=>{const{sort:ye,filter:Ce}=Bv(Oi(se));return{defaultProFilter:Ce,defaultProSort:ye}},[se]),[J,K]=d.useState(ge),[te,oe]=d.useState(fe);qn(()=>{K(ge),oe(fe)},[ge,fe]);const xe=Ie(),ae=typeof h=="object"?h:{defaultCurrent:1,defaultPageSize:20,pageSize:20,current:1},ee=d.useContext(Ln),de=d.useMemo(()=>{if(n)return async ye=>{const Ce={...ye||{},...re.current||{},...a};return delete Ce._timestamp,await n(Ce,te,J)}},[ne,a,J,te,n]),he=$T(de,i,{pageInfo:h===!1?!1:ae,loading:e.loading,dataSource:e.dataSource,onDataSourceChange:e.onDataSourceChange,onLoad:p,onLoadingChange:T,onRequestError:S,postData:l,revalidateOnFocus:N,manual:ne===void 0,polling:D,effects:[mn(a),mn(ne),mn(J),mn(te)],debounceTime:e.debounceTime,onPageInfoChange:ye=>{var Ce,Ae;!h||!de||((Ce=h==null?void 0:h.onChange)==null||Ce.call(h,ye.current,ye.pageSize),(Ae=h==null?void 0:h.onShowSizeChange)==null||Ae.call(h,ye.current,ye.pageSize))}});d.useEffect(()=>{var Ce;if(e.manualRequest||!e.request||!N||(Ce=e.form)!=null&&Ce.ignoreRules)return;const ye=()=>{document.visibilityState==="visible"&&he.reload()};return document.addEventListener("visibilitychange",ye),()=>document.removeEventListener("visibilitychange",ye)},[]);const je=d.useRef(new Map),Ee=HT({rowKey:I,name:e.name});d.useMemo(()=>{var ye;return(ye=he.dataSource)!=null&&ye.length?he.dataSource.map(Ae=>{const pt=Ee(Ae,-1);return je.current.set(pt,Ae),pt}):[]},[he.dataSource,Ee]);const ke=YT({propsPagination:h,action:he,intl:xe,request:n,type:V});qn(()=>{ke&&(ke.current!==he.pageInfo.current||ke.pageSize!==he.pageInfo.pageSize)&&he.setPageInfo({current:ke.current,pageSize:ke.pageSize})},[ke]),qn(()=>{var ye;e.request&&!FC(a)&&he.dataSource&&!Aa(he.dataSource,i)&&((ye=he==null?void 0:he.pageInfo)==null?void 0:ye.current)!==1&&he.setPageInfo({current:1})},[a]),ee.setPrefixName(e.name),d.useEffect(()=>{(pe==null?void 0:pe.value)!==void 0&&ee.setColumnsMap(pe.value)},[pe==null?void 0:pe.value]);const He=we(()=>{$&&$.onChange&&$.onChange([],[],{type:"none"}),X([])});ee.propsRef.current=e;const Qe=VC({...e.editable,tableName:e.name,getRowKey:Ee,childrenColumnName:((ho=e.expandable)==null?void 0:ho.childrenColumnName)||"children",dataSource:he.dataSource||[],setDataSource:ye=>{var Ce,Ae;(Ae=(Ce=e.editable)==null?void 0:Ce.onValuesChange)==null||Ae.call(Ce,void 0,ye),he.setDataSource(ye)}}),{token:ve}=hn==null?void 0:hn.useToken();Pv(B,he,{nativeElement:((go=ee.rootDomRef)==null?void 0:go.current)||void 0,focus:()=>{var ye,Ce;(Ce=(ye=ee.rootDomRef)==null?void 0:ye.current)==null||Ce.focus()},fullScreen:()=>{var ye,Ce;!((ye=ee.rootDomRef)!=null&&ye.current)||!document.fullscreenEnabled||(document.fullscreenElement?document.exitFullscreen():(Ce=ee.rootDomRef)==null||Ce.current.requestFullscreen())},onCleanSelected:()=>{He()},resetAll:()=>{var Ae,pt,rn,Wt,mr;He(),ee.setKeyWords(void 0),he.setPageInfo({current:1}),K(ge),oe(fe),(Ae=P==null?void 0:P.current)==null||Ae.resetFields();const ye=((rn=(pt=P==null?void 0:P.current)==null?void 0:pt.getFieldsFormatValue)==null?void 0:rn.call(pt,!0))??((mr=(Wt=P==null?void 0:P.current)==null?void 0:Wt.getFieldsValue)==null?void 0:mr.call(Wt,!0))??{},Ce=F?F(ye):ye;ie(Ce??{})},editableUtils:Qe,scrollTo:ye=>{var Ce,Ae;return(Ae=(Ce=_==null?void 0:_.current)==null?void 0:Ce.scrollTo)==null?void 0:Ae.call(Ce,ye)}}),ee.setAction(B.current);const $e=d.useMemo(()=>{var Ce;const ye={counter:ee,columnEmptyText:z,type:V,editableUtils:Qe,marginSM:ve.marginSM,rowKey:I??"id",childrenColumnName:((Ce=e.expandable)==null?void 0:Ce.childrenColumnName)??"children",proFilter:J,proSort:te};return zd({columns:se,context:ye}).sort(RT(ee.columnsMap??{}))},[se,ee==null?void 0:ee.sortKeyColumns,ee==null?void 0:ee.columnsMap,z,V,Qe.editableKeys&&Qe.editableKeys.join(","),J,te]);Pu(()=>{if($e&&$e.length>0){const ye=$e.map(Ce=>sr(Ce.key,Ce.index));ee.setSortKeyColumns(ye)}},[$e],["render","formItemRender"],100),qn(()=>{const{pageInfo:ye}=he,{current:Ce=ye==null?void 0:ye.current,pageSize:Ae=ye==null?void 0:ye.pageSize}=h||{};h&&(Ce||Ae)&&(Ae!==(ye==null?void 0:ye.pageSize)||Ce!==(ye==null?void 0:ye.current))&&he.setPageInfo({pageSize:Ae||ye.pageSize,current:Ce||ye.current})},[h&&h.pageSize,h&&h.current]);const ut={selectedRowKeys:U,...$,onChange:(ye,Ce,Ae)=>{$&&$.onChange&&$.onChange(ye,Ce,Ae),X(ye)}},Q=j!==!1&&(j==null?void 0:j.filterType)==="light",le=we(ye=>{var Ce,Ae;if(C&&C.search){const{name:pt="keyword"}=C.search===!0?{}:C.search;if(((Ae=(Ce=C.search)==null?void 0:Ce.onSearch)==null?void 0:Ae.call(Ce,ee.keyWords))!==!1){ie({...ye,[pt]:ee.keyWords});return}}ie(ye)}),Se=d.useMemo(()=>{var ye;return typeof he.loading=="object"?((ye=he.loading)==null?void 0:ye.spinning)||!1:he.loading},[he.loading]),Le=s.jsx(rT,{search:j,type:V,pagination:ke,beforeSearchSubmit:F,actionRef:B,columns:se,onFormSearchSubmit:le,ghost:c,onReset:e.onReset,onSubmit:e.onSubmit,loading:!!Se,manualRequest:R,form:e.form,formRef:P,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,searchFormRender:q,proTableProps:e}),Ye=d.useMemo(()=>U==null?void 0:U.map(ye=>{var Ce;return(Ce=je.current)==null?void 0:Ce.get(ye)}),[he.dataSource,U]),tn=d.useMemo(()=>C===!1&&!o&&!f&&!A&&!Q,[C,o,f,A,Q]),nn=s.jsx(vT,{toolBarRender:f,headerTitle:o,hideToolbar:tn,selectedRows:Ye,selectedRowKeys:U,tableColumn:$e,tooltip:O,toolbar:A,isLightFilter:Q,searchNode:Le,options:C,optionsRender:m,actionRef:B,setFormSearch:ie,formSearch:ne}),aa=UT({propsRowSelection:$,selectedRowKeys:U,selectedRows:Ye,onCleanSelected:He,tableAlertOptionRender:L.tableAlertOptionRender,tableAlertRender:E}),Yd=d.useMemo(()=>{var ye;return BT({dataSource:he.dataSource,editableUtils:Qe,pagination:ke,getRowKey:Ee,childrenColumnName:((ye=e.expandable)==null?void 0:ye.childrenColumnName)||"children"})},[he.dataSource,Qe==null?void 0:Qe.newLineRecord,Ee,ke,(po=e.expandable)==null?void 0:po.childrenColumnName]),ia=d.useMemo(()=>{const ye=Ce=>Ce.map(Ae=>{var Wt;const pt=sr(Ae.key,Ae.index),rn=(Wt=ee.columnsMap)==null?void 0:Wt[pt];return rn&&rn.show===!1?!1:Ae.children?{...Ae,children:ye(Ae.children)}:Ae}).filter(Boolean);return ye($e)},[ee.columnsMap,$e]),Ud=d.useMemo(()=>Oi(ia).filter(Ce=>!!Ce.filters),[ia]),Kd=ye=>{Aa(ye,te)||oe(ye??{})},Wd=ye=>{Aa(ye,J)||K(ye??{})},lo=()=>({...L,size:ee.tableSize,rowSelection:$===!1?void 0:ut,className:x,style:v,columns:ia,loading:he.loading,dataSource:Yd,pagination:ke,onChange:(ye,Ce,Ae,pt)=>{var mr;(mr=L.onChange)==null||mr.call(L,ye,Ce,Ae,pt);const rn=_v(Ce,Ud);Wd(lt(rn));const Wt=zv(Ae);Kd(lt(Wt))}}),oa=j===!1&&!o&&!f,co=s.jsx(ao.Provider,{value:{grid:!1,colProps:void 0,rowProps:void 0},children:s.jsx(u.Table,{...lo(),rowKey:I,ref:_})}),la=e.tableViewRender?e.tableViewRender({...lo(),rowSelection:$!==!1?ut:void 0},co):co,uo=e.editable&&!b?s.jsxs(s.Fragment,{children:[nn,aa,d.createElement(gt,{...e.editable.formProps,formRef:(yo=e.editable.formProps)==null?void 0:yo.formRef,component:!1,form:e.editable.form,onValuesChange:Qe.onValuesChange,key:"table",submitter:!1,omitNil:!1,dateFormatter:e.dateFormatter},la)]}):s.jsxs(s.Fragment,{children:[nn,aa,la]}),qd=VT({propsCardProps:w,notNeedCardDom:oa,name:e.name,hideToolbar:tn,toolbarDom:nn}),Gd=d.useMemo(()=>w!==!1&&!e.name&&!oa||w!==!1&&V==="list",[w,e.name,V,oa]),ca=w===!1?{}:w??{},fo=Gd?s.jsx(ta,{...ca,ghost:c,variant:Nd("table",t)?"outlined":"borderless",styles:{body:{...qd,...((xo=ca.styles)==null?void 0:xo.body)??{}},header:(bo=ca.styles)==null?void 0:bo.header},children:uo}):uo,Zd=()=>e.tableRender?e.tableRender(e,fo,{toolbar:nn||void 0,alert:aa||void 0,table:la||void 0}):fo,mo=s.jsxs("div",{className:ce(W,{[`${M}-polling`]:he.pollingLoading}),style:y,ref:ee.rootDomRef,"data-testid":"pro-table",children:[Q?null:Le,V!=="form"&&e.tableExtraRender&&s.jsx("div",{className:ce(W,`${M}-extra`),children:e.tableExtraRender(e,he.dataSource||[])}),V!=="form"&&Zd()]});return!C||!(C!=null&&C.fullScreen)?H(mo):H(s.jsx(u.ConfigProvider,{getPopupContainer:()=>ee.rootDomRef.current||document.body,children:mo}))},fr=e=>{const{getPrefixCls:t}=d.useContext(u.ConfigProvider.ConfigContext),n=e.ErrorBoundary===!1?d.Fragment:e.ErrorBoundary||lp,r=d.useContext(Vt);return s.jsx(Uv,{initValue:{...e,columnsState:e.columnsState,columns:e.columns,onSizeChange:e.onSizeChange,size:e.size||void 0,defaultSize:e.defaultSize||void 0},children:s.jsx(Mn,{valueTypeMap:{...r.valueTypeMap,...Sd},needDeps:!0,children:s.jsx(n,{children:s.jsx(WT,{defaultClassName:`${t("pro-table")}`,...e})})})})};fr.Summary=u.Table.Summary;let qT="/api";function Nt(){return Xt.createRequest({baseURL:qT,timeout:15e3})}const Un={create:e=>Nt().post("/ctc/ac/accounts",e),getById:e=>Nt().get("/ctc/ac/accounts",{params:{id:e}}),listByTenant:e=>Nt().get("/ctc/ac/accounts",{params:e}),updateStatus:(e,t)=>Nt().post("/ctc/ac/accounts/status",null,{params:{id:e,status:t}}),changePassword:(e,t)=>Nt().post("/ctc/ac/accounts/password/change",t,{params:{id:e}}),resetPassword:(e,t)=>Nt().post("/ctc/ac/accounts/password/reset",t,{params:{id:e}}),update:(e,t)=>Nt().put("/ctc/ac/accounts",t,{params:{id:e}}),delete:e=>Nt().delete("/ctc/ac/accounts",{params:{id:e}}),assignRole:(e,t)=>Nt().post("/ctc/ac/accounts/assign-role",null,{params:{userId:e,roleId:t}})},GT={list:e=>Nt().post("/ctc/ac/login-log/list",e)};let ZT="/api";function et(){return Xt.createRequest({baseURL:ZT,timeout:15e3})}const tt={listResourcesByApp:e=>et().get("/ctc/authz/resources/page-by-app",{params:e}),listAllResources:()=>et().get("/ctc/authz/resources/list"),pageResources:e=>et().get("/ctc/authz/resources/page",{params:e}),distinctApps:()=>et().get("/ctc/authz/resources/distinct-apps"),getResource:e=>et().get("/ctc/authz/resources",{params:{id:e}}),createResource:e=>et().post("/ctc/authz/resources",e),updateResource:(e,t)=>et().put("/ctc/authz/resources",t,{params:{id:e}}),deleteResource:e=>et().delete("/ctc/authz/resources",{params:{id:e}}),listResourceRoles:e=>et().get("/ctc/authz/resources/roles",{params:{resourceId:e}}),grantRoleResource:(e,t,n)=>{const r=n==null?{}:{dataFilter:n};return et().post("/ctc/authz/roles/grant-resource",r,{params:{roleId:e,resourceId:t}})},revokeRoleResource:(e,t)=>et().delete("/ctc/authz/roles/revoke-resource",{params:{roleId:e,resourceId:t}}),listAllRoles:()=>et().get("/ctc/authz/roles/list"),pageRoles:e=>et().get("/ctc/authz/roles/page",{params:e}),getRole:e=>et().get("/ctc/authz/roles",{params:{id:e}}),createRole:e=>et().post("/ctc/authz/roles",e),updateRole:(e,t)=>et().put("/ctc/authz/roles",t,{params:{id:e}}),deleteRole:e=>et().delete("/ctc/authz/roles",{params:{id:e}}),listUserRoles:e=>et().get("/ctc/authz/users/roles",{params:{userId:e}}),listUserPermissions:e=>et().get("/ctc/authz/users/permissions",{params:{userId:e}}),grantUserRole:(e,t,n)=>{const r={userId:e,roleId:t};return n&&(r.expireAt=n),et().post("/ctc/authz/users/grant-role",null,{params:r})},revokeUserRole:(e,t)=>et().delete("/ctc/authz/users/revoke-role",{params:{userId:e,roleId:t}}),listRolePermissions:e=>et().get("/ctc/authz/roles/resources",{params:{roleId:e}}),check:e=>et().post("/ctc/authz/check",e)},Zn={listAccounts:e=>Un.listByTenant(e),listUserRoles:e=>tt.listUserRoles(e),listUserPermissions:e=>tt.listUserPermissions(e),listRoleResources:e=>tt.listRolePermissions(e)},{Text:JT}=u.Typography,ms={0:{text:"禁用",color:"default"},1:{text:"正常",color:"success"},2:{text:"锁定",color:"warning"}},hs={1:{text:"超级管理员",color:"red"},2:{text:"租户管理员",color:"volcano"},3:{text:"普通成员",color:"blue"},4:{text:"临时账号",color:"orange"}},XT={1:{text:"用户名",color:"blue"},2:{text:"邮箱",color:"purple"},3:{text:"手机",color:"cyan"}};function Hn({value:e}){const t=e==null||e===""?"-":String(e);return t==="-"?s.jsx("span",{children:"-"}):s.jsx(u.Tooltip,{title:t,placement:"topLeft",children:s.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})})}function QT({apiBaseURL:e}){var se,pe,ge,fe;const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,c]=d.useState([]),[h,g]=d.useState(!1),[f,m]=d.useState(!1),[p,S]=d.useState(null),[y]=u.Form.useForm(),[w]=u.Form.useForm(),[v,x]=d.useState(!1),[C,j]=d.useState(null),[b,T]=d.useState("info"),[$,F]=d.useState([]),[E,M]=d.useState(!1),[k,V]=d.useState([]),[z,A]=d.useState([]),[I,R]=d.useState(!1),[D,O]=d.useState(!1),N=async J=>{if(!J){F([]);return}M(!0);try{const K=await GT.list({accountId:Number(J),pageSize:50});F((K==null?void 0:K.records)||[])}catch{F([])}finally{M(!1)}},q=async J=>{if(!J){V([]),A([]);return}R(!0),O(!0);try{const[K,te]=await Promise.all([Zn.listUserRoles(J),Zn.listUserPermissions(J)]);V(Array.isArray(K)?K:[]),A(Array.isArray(te)?te:[])}catch{V([]),A([])}finally{R(!1),O(!1)}},L=J=>{j(J),T("info"),x(!0),N(J.id)},H=()=>{x(!1),j(null),F([]),V([]),A([])},G=J=>{T(J),J==="logs"&&(C!=null&&C.id)&&N(C.id),J==="roles"&&(C!=null&&C.id)&&q(C.id)},W=d.useCallback(()=>{var te;const J=n.getFieldsValue(),K={};J.username&&(K.username=J.username),J.status!==void 0&&(K.status=J.status),J.dateRange&&(K.startDate=J.dateRange[0].format("YYYY-MM-DD"),K.endDate=J.dateRange[1].format("YYYY-MM-DD")),a(K),(te=t.current)==null||te.reload()},[n]),B=d.useCallback(()=>{var J;n.resetFields(),a({}),(J=t.current)==null||J.reload()},[n]),_=async J=>{try{let te=await Un.listByTenant({tenant:r.tenant,pageNum:J.current,pageSize:J.pageSize})||[];const oe=r.username,xe=r.status,ae=r.startDate,ee=r.endDate;return te=te.filter(de=>{var he;return!(oe&&!((he=de.username)!=null&&he.includes(oe))||xe!==void 0&&de.status!==xe||ae&&de.createdAt&&Te(de.createdAt).isBefore(ae,"day")||ee&&de.createdAt&&Te(de.createdAt).isAfter(ee,"day"))}),{data:te,success:!0,total:te.length}}catch(K){return u.message.error("获取账号列表失败:"+((K==null?void 0:K.message)||"未知错误")),{data:[],success:!1,total:0}}},Y=async()=>{var J;try{const K=await y.validateFields();await Un.create(K),u.message.success("创建成功"),g(!1),y.resetFields(),(J=t.current)==null||J.reload()}catch(K){if(K!=null&&K.errorFields)return;u.message.error("创建失败:"+((K==null?void 0:K.message)||"未知错误"))}},P=async(J,K)=>{var oe;const te=K===1?0:1;try{await Un.updateStatus(J,te),u.message.success(te===1?"已启用":"已停用"),(oe=t.current)==null||oe.reload()}catch(xe){u.message.error("操作失败:"+((xe==null?void 0:xe.message)||"未知错误"))}},U=async()=>{var J;try{await Promise.all(l.map(K=>Un.updateStatus(K.id,0))),u.message.success(`已停用 ${l.length} 个账号`),o([]),c([]),(J=t.current)==null||J.reload()}catch(K){u.message.error("批量操作失败:"+((K==null?void 0:K.message)||"未知错误"))}},X=()=>{const J=`ID,账号,昵称,类型,邮箱,手机,租户,状态,创建时间
56
- `,K=l.length>0?l:[];if(K.length===0){u.message.warning("请先选择要导出的数据,或取消选择导出全部");return}const te=J+K.map(ee=>[ee.id,ee.username,ee.nickname,(hs[ee.accountType??3]||{text:String(ee.accountType)}).text,ee.email,ee.phone,ee.tenantCode,(ms[ee.status??1]||{text:String(ee.status)}).text,ee.createdAt].join(",")).join(`
57
- `),oe=new Blob(["\uFEFF"+te],{type:"text/csv;charset=utf-8"}),xe=URL.createObjectURL(oe),ae=document.createElement("a");ae.href=xe,ae.download=`accounts_${Te().format("YYYYMMDD_HHmmss")}.csv`,ae.click(),URL.revokeObjectURL(xe),u.message.success(`已导出 ${K.length} 条数据`)},ne=J=>{S(J),w.resetFields(),m(!0)},Z=async()=>{if(p!=null&&p.id)try{const J=await w.validateFields();await Un.resetPassword(p.id,{newPassword:J.newPassword}),u.message.success(`已重置账号 ${p.username} 的密码`),m(!1),w.resetFields()}catch(J){if(J!=null&&J.errorFields)return;u.message.error("重置失败:"+((J==null?void 0:J.message)||"未知错误"))}},re=[{title:"登录标识",dataIndex:"identifier",width:140},{title:"登录方式",dataIndex:"identityType",width:90,render:(J,K)=>{const te=XT[K.identityType]||{text:`${K.identityType}`,color:"default"};return s.jsx(u.Tag,{color:te.color,children:te.text})}},{title:"结果",dataIndex:"loginStatus",width:80,render:(J,K)=>s.jsx(u.Tag,{color:K.loginStatus===1?"success":"error",children:K.loginStatus===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0},{title:"客户端IP",dataIndex:"clientIp",width:120},{title:"登录时间",dataIndex:"loginTime",width:170,render:J=>J?Te(J).format("YYYY-MM-DD HH:mm:ss"):"-"}],ie=[{title:"账号",dataIndex:"username",width:200,fixed:"left",ellipsis:{showTitle:!1},search:!1,render:(J,K)=>s.jsx(Hn,{value:K.username})},{title:"昵称",dataIndex:"nickname",width:120,ellipsis:{showTitle:!1},search:!1,render:(J,K)=>s.jsx(Hn,{value:K.nickname})},{title:"类型",dataIndex:"accountType",width:104,search:!1,render:(J,K)=>{const te=hs[K.accountType??3]||{text:String(K.accountType??"未知"),color:"default"};return s.jsx(u.Tag,{color:te.color,children:te.text})}},{title:"邮箱",dataIndex:"email",width:150,ellipsis:{showTitle:!1},search:!1,render:(J,K)=>s.jsx(Hn,{value:K.email})},{title:"手机",dataIndex:"phone",width:126,ellipsis:{showTitle:!1},search:!1,render:(J,K)=>s.jsx(Hn,{value:K.phone})},{title:"租户",dataIndex:"tenantCode",width:92,ellipsis:{showTitle:!1},search:!1,render:(J,K)=>s.jsx(Hn,{value:K.tenantCode})},{title:"状态",dataIndex:"status",width:84,search:!1,render:(J,K)=>{const te=ms[K.status??1]||{text:String(K.status??"未知"),color:"default"};return s.jsx(u.Tag,{color:te.color,children:te.text})}},{title:"创建时间",dataIndex:"createdAt",width:160,search:!1,ellipsis:{showTitle:!1},render:(J,K)=>s.jsx(Hn,{value:K.createdAt?Te(K.createdAt).format("YYYY-MM-DD HH:mm:ss"):null})},{title:"操作",valueType:"option",width:150,fixed:"right",search:!1,render:(J,K)=>[s.jsx(u.Button,{type:"link",size:"small",danger:K.status===1,onClick:()=>P(K.id,K.status??1),children:K.status===1?"停用":"启用"},"status"),s.jsx(u.Button,{type:"link",size:"small",onClick:()=>ne(K),children:"重置密码"},"reset"),s.jsx(u.Button,{type:"link",size:"small",onClick:()=>L(K),children:"详情"},"detail")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(u.Form,{form:n,layout:"inline",children:[s.jsx(u.Form.Item,{name:"username",label:"用户名",children:s.jsx(jt.SearchInput,{placeholder:"请输入用户名",onChange:J=>n.setFieldValue("username",J)})}),s.jsx(u.Form.Item,{name:"status",label:"状态",children:s.jsx(u.Select,{placeholder:"全部",allowClear:!0,style:{width:120},options:[{value:1,label:"正常"},{value:0,label:"禁用"},{value:2,label:"锁定"}]})}),s.jsx(u.Form.Item,{name:"dateRange",label:"创建时间",children:s.jsx(u.DatePicker.RangePicker,{style:{width:240}})}),s.jsx(u.Form.Item,{children:s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.SearchOutlined,{}),onClick:W,children:"查询"}),s.jsx(u.Button,{icon:s.jsx(me.UndoOutlined,{}),onClick:B,children:"重置"})]})})]}),s.jsxs(u.Space,{style:{flexShrink:0},children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>g(!0),children:"新增"}),s.jsx(u.Button,{danger:!0,icon:s.jsx(me.DeleteOutlined,{}),disabled:i.length===0,onClick:U,children:"批量停用"}),s.jsx(u.Button,{icon:s.jsx(me.DownloadOutlined,{}),onClick:X,children:"导出"}),s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>{var J;return(J=t.current)==null?void 0:J.reload()},children:"刷新"})]})]})}),s.jsx(fr,{actionRef:t,rowKey:"id",columns:ie,request:_,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:J=>`共 ${J} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(J,K)=>{o(J),c(K)}},tableAlertRender:({selectedRowKeys:J})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:J.length})," 项"]})}),s.jsx(u.Modal,{title:"新建账号",open:h,onOk:Y,onCancel:()=>g(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"username",label:"用户名",rules:[{required:!0,min:3,max:32}],children:s.jsx(u.Input,{placeholder:"3-32 位字母数字下划线"})}),s.jsx(u.Form.Item,{name:"password",label:"初始密码",rules:[{required:!0,min:8}],children:s.jsx(u.Input.Password,{placeholder:"至少 8 位"})}),s.jsx(u.Form.Item,{name:"nickname",label:"昵称",children:s.jsx(u.Input,{placeholder:"可选"})}),s.jsx(u.Form.Item,{name:"email",label:"邮箱",rules:[{type:"email"}],children:s.jsx(u.Input,{placeholder:"可选"})}),s.jsx(u.Form.Item,{name:"phone",label:"手机号",children:s.jsx(u.Input,{placeholder:"可选"})}),s.jsx(u.Form.Item,{name:"accountType",label:"账号类型",initialValue:3,children:s.jsx(u.Select,{options:[{value:1,label:"超级管理员"},{value:2,label:"租户管理员"},{value:3,label:"普通成员"},{value:4,label:"临时账号"}]})}),s.jsx(u.Form.Item,{name:"tenantCode",label:"租户编码",children:s.jsx(u.Input,{placeholder:"如 default / tenant1"})})]})}),s.jsx(u.Modal,{title:p?`重置密码 — ${p.username}`:"重置密码",open:f,onOk:Z,onCancel:()=>m(!1),size:"large",okText:"确认重置",okButtonProps:{danger:!0},destroyOnHidden:!0,children:s.jsx(u.Form,{form:w,layout:"vertical",style:{marginTop:16},children:s.jsx(u.Form.Item,{name:"newPassword",label:"新密码",rules:[{required:!0,min:8,message:"至少 8 位"}],extra:"重置后建议通知账号持有人当面修改",children:s.jsx(u.Input.Password,{placeholder:"至少 8 位"})})})}),s.jsx(u.Drawer,{title:C?`账号详情 — ${C.username}`:"账号详情",open:v,onClose:H,width:"min(1120px, 94vw)",destroyOnHidden:!0,children:C&&s.jsx(u.Tabs,{activeKey:b,onChange:G,tabBarExtraContent:b==="logs"?s.jsx(u.Button,{size:"small",icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>C.id&&N(C.id),children:"刷新日志"}):null,items:[{key:"info",label:"基本信息",children:s.jsxs(u.Descriptions,{title:"账号信息",size:"small",bordered:!0,column:2,children:[s.jsx(u.Descriptions.Item,{label:"账号ID",children:C.id}),s.jsx(u.Descriptions.Item,{label:"用户名",children:C.username}),s.jsx(u.Descriptions.Item,{label:"昵称",children:C.nickname||"-"}),s.jsx(u.Descriptions.Item,{label:"账号类型",children:s.jsx(u.Tag,{color:(se=hs[C.accountType??3])==null?void 0:se.color,children:((pe=hs[C.accountType??3])==null?void 0:pe.text)||C.accountType})}),s.jsx(u.Descriptions.Item,{label:"邮箱",children:C.email||"-"}),s.jsx(u.Descriptions.Item,{label:"手机",children:C.phone||"-"}),s.jsx(u.Descriptions.Item,{label:"租户",children:C.tenantCode||"-"}),s.jsx(u.Descriptions.Item,{label:"状态",children:s.jsx(u.Tag,{color:(ge=ms[C.status??1])==null?void 0:ge.color,children:(fe=ms[C.status??1])==null?void 0:fe.text})}),s.jsx(u.Descriptions.Item,{label:"到期时间",children:C.expireAt?Te(C.expireAt).format("YYYY-MM-DD HH:mm:ss"):"永久"}),s.jsx(u.Descriptions.Item,{label:"创建时间",children:C.createdAt?Te(C.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),s.jsx(u.Descriptions.Item,{label:"更新时间",span:2,children:C.updatedAt?Te(C.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]})},{key:"roles",label:`角色与权限${k.length?`(${k.length})`:""}`,children:s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[s.jsx(u.Card,{size:"small",style:{flex:"0 0 340px"},title:`角色(${k.length})`,loading:I,children:k.length?s.jsx(u.List,{size:"small",dataSource:k,rowKey:J=>J.id,renderItem:J=>s.jsx(u.List.Item,{children:s.jsx(u.List.Item.Meta,{title:s.jsxs(u.Space,{children:[s.jsx(JT,{strong:!0,children:J.roleName||J.roleCode}),s.jsx(u.Tag,{color:"blue",style:{margin:0},children:J.roleCode})]}),description:J.description||"-"})})}):s.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"该账号暂无角色"})}),s.jsx(jt.ListTable,{cardTitle:`直接权限(${z.length})`,rows:z,rowKey:(J,K)=>J.code||J.resourceCode||J.id||K,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该账号暂无直接权限",loading:D,columns:[{title:"资源编码",dataIndex:"code",width:220,render:(J,K)=>s.jsx("span",{style:{fontFamily:"monospace"},children:K.code||K.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(J,K)=>K.name||K.resourceName||"-"}]})]})},{key:"logs",label:`登录日志(${$.length})`,children:s.jsx(jt.ListTable,{rows:$,columns:re,rowKey:"id",loading:E,searchKeys:["identifier","clientIp"],searchPlaceholder:"按登录标识 / 客户端 IP 过滤",emptyTitle:"暂无登录记录"})}]})})]})}let eF="/api";function xr(){return Xt.createRequest({baseURL:eF,timeout:15e3})}const jr={listApplications:e=>xr().get("/meta-app/list",{params:e}),getApplication:e=>xr().get("/meta-app/get",{params:{id:e}}),create:e=>xr().post("/meta-app",e),update:(e,t)=>xr().put("/meta-app",t,{params:{id:e}}),delete:e=>xr().delete("/meta-app",{params:{id:e}})},tF={API:1,MENU:2,BUTTON:3,DATA:4},br={API:{text:"API",color:"orange",int:1},MENU:{text:"菜单",color:"blue",int:2},BUTTON:{text:"按钮",color:"green",int:3},DATA:{text:"数据",color:"purple",int:4}},nF={GET:"green",POST:"blue",PUT:"orange",DELETE:"red",PATCH:"purple"},Va={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function rF({apiBaseURL:e}){var G,W;const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState(!1),[l]=u.Form.useForm(),[c,h]=d.useState(null),[g,f]=d.useState(!1),[m,p]=d.useState([]),[S,y]=d.useState(""),[w,v]=d.useState(!1),[x]=u.Form.useForm(),[C,j]=d.useState("API"),b=d.useCallback(async B=>{try{const _=await tt.listResourcesByApp({appCode:B,pageNum:1,pageSize:1e3});p(_.data||[])}catch(_){u.message.error("拉取资源失败:"+((_==null?void 0:_.message)||"未知错误")),p([])}},[]),T=B=>{h(B),f(!0),B.appCode&&b(B.appCode)},$=d.useCallback(()=>{var Y;const B=n.getFieldsValue(),_={};B.appCode&&(_.appCode=B.appCode),B.appName&&(_.appName=B.appName),a(_),(Y=t.current)==null||Y.reload()},[n]),F=d.useCallback(()=>{var B;n.resetFields(),a({}),(B=t.current)==null||B.reload()},[n]),E=async B=>{try{const _=(B==null?void 0:B.current)||1,Y=(B==null?void 0:B.pageSize)||20,P=await jr.listApplications({appCode:r.appCode,appName:r.appName,pageNum:_,pageSize:Y});return{data:P.records||[],success:!0,total:P.total||0}}catch(_){return u.message.error("获取应用列表失败:"+((_==null?void 0:_.message)||"未知错误")),{data:[],success:!1,total:0}}},M=async()=>{var B;try{const _=await l.validateFields();await jr.create({appCode:_.appCode,appName:_.appName,appType:_.appType||"web",description:_.description,status:1}),u.message.success("应用创建成功"),o(!1),l.resetFields(),(B=t.current)==null||B.reload()}catch(_){if(_!=null&&_.errorFields)return;u.message.error("创建失败:"+((_==null?void 0:_.message)||"未知错误"))}},k=async B=>{var _;try{if(B.id==null){u.message.error("应用 ID 缺失");return}await jr.delete(B.id),u.message.success(`已删除应用 ${B.appCode}`),(c==null?void 0:c.id)===B.id&&(h(null),p([])),(_=t.current)==null||_.reload()}catch(Y){u.message.error("删除失败:"+((Y==null?void 0:Y.message)||"未知错误"))}},V=async B=>{var _;try{if(B.id==null){u.message.error("应用 ID 缺失");return}const Y=B.status===1?0:1;await jr.update(B.id,{status:Y}),u.message.success(Y===1?"已启用":"已停用"),(c==null?void 0:c.id)===B.id&&h({...B,status:Y}),(_=t.current)==null||_.reload()}catch(Y){u.message.error("切换状态失败:"+((Y==null?void 0:Y.message)||"未知错误"))}},z=async()=>{if(c)try{const B=await x.validateFields(),_={resourceCode:B.resourceCode,resourceName:B.resourceName,resourceType:tF[C],appCode:c.appCode,path:B.path,method:B.method,description:B.description,status:1};await tt.createResource(_),u.message.success("资源创建成功"),v(!1),x.resetFields(),b(c.appCode)}catch(B){if(B!=null&&B.errorFields)return;u.message.error("创建失败:"+((B==null?void 0:B.message)||"未知错误"))}},A=async B=>{if(B.id==null){u.message.error("资源 ID 缺失");return}try{await tt.deleteResource(B.id),u.message.success("资源已删除"),c!=null&&c.appCode&&b(c.appCode)}catch(_){u.message.error("删除失败:"+((_==null?void 0:_.message)||"未知错误"))}},I=B=>{j(B),x.resetFields(),v(!0)},R=[{title:"应用",dataIndex:"appName",width:180,search:!1,render:(B,_)=>{const Y=Va[_.status??1]||{text:String(_.status??"未知"),color:"default"},P=(c==null?void 0:c.id)===_.id;return s.jsxs("div",{style:{padding:"4px 0",borderLeft:P?"3px solid #1677ff":"3px solid transparent",paddingLeft:8},children:[s.jsx("div",{style:{fontWeight:500},children:_.appName}),s.jsxs("div",{style:{fontSize:12,color:"#999",marginTop:2},children:[s.jsx(u.Tag,{color:Y.color,style:{marginRight:4,marginInlineEnd:4},children:Y.text}),s.jsx("code",{style:{fontSize:11},children:_.appCode})]})]})}},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(B,_)=>[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>T(_),children:"编辑"},"edit"),s.jsx(u.Button,{type:"link",size:"small",danger:_.status===1,onClick:()=>V(_),children:_.status===1?"停用":"启用"},"toggle"),s.jsx(u.Popconfirm,{title:`确认删除应用 ${_.appName}?`,description:"该应用下的所有资源会一并删除",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>k(_),children:s.jsx(u.Button,{type:"link",danger:!0,size:"small",children:"删除"})},"del")]}],D=[{title:"资源编码",dataIndex:"resourceCode",width:180,ellipsis:!0},{title:"资源名称",dataIndex:"resourceName",width:140,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(B,_)=>_.method?s.jsx(u.Tag,{color:nF[_.method],children:_.method}):"-"},{title:"URL / Path",dataIndex:"path",ellipsis:!0},{title:"描述",dataIndex:"description",width:200,ellipsis:!0},{title:"操作",width:80,fixed:"right",render:(B,_)=>s.jsx(u.Popconfirm,{title:"确认删除该资源?",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>A(_),children:s.jsx(u.Button,{type:"link",danger:!0,size:"small",children:"删除"})})}],O=m.filter(B=>(B.resourceType??1)===1),N=m.filter(B=>B.resourceType===2),q=m.filter(B=>B.resourceType===3),L=m.filter(B=>B.resourceType===4),H=(B,_)=>{const Y=S.trim().toLowerCase(),P=Y?B.filter(U=>`${U.resourceCode||""} ${U.resourceName||""} ${U.path||""}`.toLowerCase().includes(Y)):B;return s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("span",{style:{color:"#666"},children:["共 ",s.jsx("b",{children:B.length})," 条 ",br[_].text," 资源"]}),s.jsxs(u.Space,{children:[s.jsx(u.Input.Search,{allowClear:!0,placeholder:"按资源编码 / 名称过滤",style:{width:220},onChange:U=>y(U.target.value)}),s.jsxs(u.Button,{type:"primary",size:"small",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>I(_),children:["新建",br[_].text]})]})]}),B.length>0?s.jsx(u.Table,{rowKey:"id",columns:D,dataSource:P,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:U=>`共 ${U} 条`},size:"small",scroll:{x:800},locale:{emptyText:s.jsx(jt.EmptyState,{title:`没有匹配的 ${br[_].text} 资源`,description:"换个关键字再试一次",size:"sm"})}}):s.jsx(jt.EmptyState,{title:`该应用暂无 ${br[_].text} 资源`,description:"点击上方按钮新增",size:"sm"})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(u.Form,{form:n,layout:"inline",size:"small",children:[s.jsx(u.Form.Item,{name:"appCode",label:"应用编码",style:{marginBottom:8},children:s.jsx(u.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(u.Form.Item,{name:"appName",label:"应用名称",style:{marginBottom:8},children:s.jsx(u.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(u.Form.Item,{style:{marginBottom:8},children:s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.SearchOutlined,{}),onClick:$,children:"查询"}),s.jsx(u.Button,{icon:s.jsx(me.UndoOutlined,{}),onClick:F,children:"重置"})]})})]}),s.jsxs(u.Space,{style:{flexShrink:0},children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>o(!0),children:"新增应用"}),s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>{var B;(B=t.current)==null||B.reload(),c!=null&&c.appCode&&b(c.appCode)},children:"刷新"})]})]})}),s.jsx(fr,{actionRef:t,rowKey:"id",columns:R,request:E,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:B=>`共 ${B} 条`},onRow:B=>({onClick:()=>T(B),style:{cursor:"pointer"}})}),s.jsx(u.Drawer,{title:c?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600},children:c.appName}),s.jsx(u.Tag,{color:((G=Va[c.status??1])==null?void 0:G.color)||"default",children:((W=Va[c.status??1])==null?void 0:W.text)||"未知"}),s.jsx("code",{style:{fontSize:12,color:"#666"},children:c.appCode})]}):"应用详情",open:g,onClose:()=>f(!1),width:"80vw",destroyOnHidden:!0,extra:c?s.jsxs(u.Space,{children:[s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>b(c.appCode),children:"刷新资源"}),s.jsx(u.Button,{icon:s.jsx(me.EditOutlined,{}),onClick:()=>o(!0),children:"编辑应用"}),s.jsx(u.Button,{danger:c.status===1,icon:s.jsx(me.StopOutlined,{}),onClick:()=>V(c),children:c.status===1?"停用":"启用"})]}):null,children:c&&s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:16,paddingBottom:12,borderBottom:"1px solid #f0f0f0",fontSize:13,color:"#666",display:"flex",gap:16},children:[c.gmtCreate&&s.jsxs("span",{children:["创建:",Te(c.gmtCreate).format("YYYY-MM-DD HH:mm:ss")]}),c.description&&s.jsxs("span",{children:["描述:",c.description]})]}),s.jsx(u.Tabs,{defaultActiveKey:"API",items:[{key:"API",label:s.jsxs("span",{children:[s.jsx(u.Tag,{color:"orange",children:"API"})," API 资产 (",O.length,")"]}),children:H(O,"API")},{key:"MENU",label:s.jsxs("span",{children:[s.jsx(u.Tag,{color:"blue",children:"菜单"})," 菜单 (",N.length,")"]}),children:H(N,"MENU")},{key:"BUTTON",label:s.jsxs("span",{children:[s.jsx(u.Tag,{color:"green",children:"按钮"})," 按钮 (",q.length,")"]}),children:H(q,"BUTTON")},{key:"DATA",label:s.jsxs("span",{children:[s.jsx(u.Tag,{color:"purple",children:"数据"})," 数据 (",L.length,")"]}),children:H(L,"DATA")}]})]})}),s.jsx(u.Modal,{title:"新建应用",open:i,onOk:M,onCancel:()=>o(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:l,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"appCode",label:"应用编码",rules:[{required:!0},{pattern:/^[a-z][a-z0-9_-]*$/,message:"小写字母开头,仅允许小写字母/数字/下划线/短横"}],extra:"唯一标识,如 z-ctc / z-task",children:s.jsx(u.Input,{placeholder:"如 z-opc"})}),s.jsx(u.Form.Item,{name:"appName",label:"应用名称",rules:[{required:!0}],children:s.jsx(u.Input,{placeholder:"如 统一管理平台"})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:2,placeholder:"可选"})})]})}),s.jsx(u.Modal,{title:`新建资源 — ${(c==null?void 0:c.appCode)||""} (${br[C].text})`,open:w,onOk:z,onCancel:()=>v(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:x,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0}],extra:"唯一标识,如 user:read / menu:dashboard",children:s.jsx(u.Input,{placeholder:"如 user:read"})}),s.jsx(u.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0}],children:s.jsx(u.Input,{placeholder:"如 查看用户"})}),C==="API"&&s.jsxs(s.Fragment,{children:[s.jsx(u.Form.Item,{name:"method",label:"HTTP 方法",children:s.jsx(u.Select,{allowClear:!0,placeholder:"选择 HTTP 方法",options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}]})}),s.jsx(u.Form.Item,{name:"path",label:"URL Pattern",children:s.jsx(u.Input,{placeholder:"如 /api/users/*"})})]}),C==="MENU"&&s.jsx(u.Form.Item,{name:"path",label:"菜单路径",children:s.jsx(u.Input,{placeholder:"如 /ctc/dashboard"})}),C==="BUTTON"&&s.jsx(u.Form.Item,{name:"resourceCode",label:"按钮权限编码",extra:"如 btn:user:create",children:s.jsx(u.Input,{placeholder:"如 btn:user:create"})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:2,placeholder:"可选"})})]})})]})}const Di={0:{text:"功能",color:"geekblue"},1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}},sF=[{value:"",label:"任意"},{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}],aF=[{key:"roles",label:"角色",icon:s.jsx(me.TeamOutlined,{})},{key:"points",label:"权限点",icon:s.jsx(me.AuditOutlined,{})},{key:"tree",label:"权限树",icon:s.jsx(me.ApartmentOutlined,{})}];function Pi(e){const t=Di[e]||{text:String(e??"?"),color:"default"};return s.jsx(u.Tag,{color:t.color,style:{margin:0,fontSize:11},children:t.text})}function iF(e,{search:t=""}={}){const n=t.trim().toLowerCase(),r=c=>!n||(c.resourceCode||"").toLowerCase().includes(n)||(c.resourceName||"").toLowerCase().includes(n),a=e.filter(r),i=new Map;a.forEach(c=>{const h=c.appCode||"公共";i.has(h)||i.set(h,[]),i.get(h).push(c)});const o=c=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("span",{children:c.resourceName||c.resourceCode}),Pi(c.resourceType),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:c.resourceCode})]}),l=[];return i.forEach((c,h)=>{const g=new Map;c.forEach(m=>g.set(m.id,{key:m.id,title:o(m),raw:m,children:[]}));const f=[];c.forEach(m=>{const p=g.get(m.id),S=m.parentId??0;S&&g.has(S)?g.get(S).children.push(p):f.push(p)}),l.push({key:`app:${h}`,title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontWeight:600},children:[h,s.jsx(u.Tag,{color:"cyan",style:{margin:0,fontSize:11},children:c.length})]}),selectable:!1,checkable:!1,children:f})}),l}function oF(e){const t=[],n=r=>{r.forEach(a=>{var i;t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function lF(e){const t=[],n=r=>{r.forEach(a=>{var i;a.raw&&t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function Bd({apiBaseURL:e}){const[t,n]=Qd.useSearchParams(),r=["roles","points","tree"].includes(t.get("view"))?t.get("view"):"roles",a=d.useCallback(Q=>{const le=new URLSearchParams(t);Q==="roles"?le.delete("view"):le.set("view",Q),n(le,{replace:!0})},[t,n]),[i,o]=d.useState([]),[l,c]=d.useState(!1),[h,g]=d.useState([]),[f,m]=d.useState(!1),[p,S]=d.useState(""),[y,w]=d.useState(!1),[v,x]=d.useState(null),[C]=u.Form.useForm(),[j,b]=d.useState(null),[T,$]=d.useState([]),[F,E]=d.useState([]),[M,k]=d.useState(""),[V,z]=d.useState(!1),[A,I]=d.useState(!1),[R,D]=d.useState([]),O=d.useRef(void 0),[N]=u.Form.useForm(),[q,L]=d.useState({}),[H,G]=d.useState([]),[W,B]=d.useState([]),[_,Y]=d.useState([]),[P,U]=d.useState(!1),[X,ne]=d.useState(null),[Z]=u.Form.useForm(),[re,ie]=d.useState(!1),[se,pe]=d.useState(null),ge=d.useCallback(async()=>{c(!0);try{const Q=await tt.listAllResources();o(Array.isArray(Q)?Q:[])}catch(Q){u.message.error("加载权限点失败:"+((Q==null?void 0:Q.message)||"未知错误"))}finally{c(!1)}},[]),fe=d.useCallback(async()=>{m(!0);try{const Q=await tt.listAllRoles();g(Array.isArray(Q)?Q:[])}catch(Q){u.message.error("加载角色失败:"+((Q==null?void 0:Q.message)||"未知错误"))}finally{m(!1)}},[]),J=d.useCallback(async()=>{try{const Q=await tt.distinctApps(),le=Array.isArray(Q)?Q:[];Y(le.map(Se=>({value:Se,label:Se})))}catch{Y([])}},[]);d.useEffect(()=>{ge(),fe(),J()},[ge,fe,J]);const K=d.useCallback(async Q=>{b(Q),k(""),I(!0),$([]),E([]);try{const le=await tt.listRolePermissions(Q.id),Se=(Array.isArray(le)?le:[]).map(Le=>Le.id);$(Se),E(Se)}catch(le){u.message.error("加载角色权限点失败:"+((le==null?void 0:le.message)||"未知错误"))}finally{I(!1)}},[]),te=d.useCallback(async()=>{if(!(j!=null&&j.id))return;const Q=new Set(F.map(Number).filter(Ye=>Number.isFinite(Ye))),le=new Set(T.map(Number).filter(Ye=>Number.isFinite(Ye))),Se=[...Q].filter(Ye=>!le.has(Ye)),Le=[...le].filter(Ye=>!Q.has(Ye));if(Se.length===0&&Le.length===0){u.message.info("没有变更");return}z(!0);try{for(const Ye of Se)await tt.grantRoleResource(j.id,Ye);for(const Ye of Le)await tt.revokeRoleResource(j.id,Ye);u.message.success(`已保存:+${Se.length} / -${Le.length}`),$([...Q])}catch(Ye){u.message.error("保存失败:"+((Ye==null?void 0:Ye.message)||"未知错误"))}finally{z(!1)}},[j,F,T]),oe=d.useCallback(async(Q,le)=>{try{await tt.updateRole(Q.id,{status:le?1:0}),u.message.success(le?`角色 ${Q.roleName} 已启用`:`角色 ${Q.roleName} 已停用`),await fe()}catch(Se){u.message.error("更新状态失败:"+((Se==null?void 0:Se.message)||"未知错误"))}},[fe]),xe=d.useCallback(async()=>{try{const Q=await C.validateFields();await tt.createRole({roleCode:Q.roleCode,roleName:Q.roleName,description:Q.description,status:Q.enabled===!1?0:1}),u.message.success("角色创建成功"),w(!1),C.resetFields(),await fe()}catch(Q){if(Q!=null&&Q.errorFields)return;u.message.error("创建失败:"+((Q==null?void 0:Q.message)||"未知错误"))}},[fe,C]),ae=d.useCallback(async()=>{if(v!=null&&v.id)try{const Q=await C.validateFields();await tt.updateRole(v.id,{roleName:Q.roleName,description:Q.description,status:Q.enabled===!1?0:1}),u.message.success("角色已更新"),w(!1),x(null),C.resetFields(),await fe(),(j==null?void 0:j.id)===v.id&&b(le=>le&&{...le,roleName:Q.roleName,status:Q.enabled===!1?0:1})}catch(Q){if(Q!=null&&Q.errorFields)return;u.message.error("更新失败:"+((Q==null?void 0:Q.message)||"未知错误"))}},[j,v,fe,C]),ee=d.useCallback(async Q=>{try{await tt.deleteRole(Q.id),u.message.success("角色已删除"),(j==null?void 0:j.id)===Q.id&&b(null),await fe()}catch(le){u.message.error("删除失败:"+((le==null?void 0:le.message)||"未知错误"))}},[j,fe]),de=d.useMemo(()=>{const Q=p.trim().toLowerCase();return Q?h.filter(le=>(le.roleCode||"").toLowerCase().includes(Q)||(le.roleName||"").toLowerCase().includes(Q)):h},[h,p]),he=d.useCallback(async Q=>{try{const le=await tt.listResourcesByApp({appCode:q.appCode,type:q.type,keyword:q.keyword,pageNum:Q.current,pageSize:Q.pageSize}),Se=(le==null?void 0:le.data)||[];return{data:Se,success:!0,total:(le==null?void 0:le.total)??Se.length}}catch(le){return u.message.error("查询权限点失败:"+((le==null?void 0:le.message)||"未知错误")),{data:[],success:!1,total:0}}},[q]),je=[{title:"编码",dataIndex:"resourceCode",width:200,fixed:"left",render:(Q,le)=>s.jsx(u.Tooltip,{title:le.resourceCode,children:s.jsx("span",{style:{fontFamily:"monospace"},children:le.resourceCode})})},{title:"名称",dataIndex:"resourceName",width:160},{title:"类型",dataIndex:"resourceType",width:80,render:(Q,le)=>Pi(le.resourceType)},{title:"应用",dataIndex:"appCode",width:140,render:(Q,le)=>le.appCode?s.jsx(u.Tag,{color:"cyan",children:le.appCode}):s.jsx(u.Tag,{color:"default",children:"公共"})},{title:"路径",dataIndex:"path",width:220,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(Q,le)=>le.method?s.jsx(u.Tag,{children:le.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,render:(Q,le)=>s.jsx(u.Tag,{color:le.status===1?"success":"default",children:le.status===1?"启用":"禁用"})},{title:"创建时间",dataIndex:"createdAt",width:170,render:Q=>Q||"-"},{title:"操作",width:160,render:(Q,le)=>[s.jsx(u.Button,{type:"link",size:"small",onClick:Se=>{Se.stopPropagation(),ne(le),Z.setFieldsValue(le),U(!0)},children:"编辑"},"edit"),s.jsx(u.Popconfirm,{title:"确认删除该权限点?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:async Se=>{var Le,Ye;(Le=Se==null?void 0:Se.stopPropagation)==null||Le.call(Se);try{await tt.deleteResource(le.id),u.message.success("已删除"),(Ye=O.current)==null||Ye.reload(),ge()}catch(tn){u.message.error("删除失败:"+((tn==null?void 0:tn.message)||"未知错误"))}},children:s.jsx(u.Button,{type:"link",size:"small",danger:!0,onClick:Se=>Se.stopPropagation(),children:"删除"})},"delete"),s.jsx(u.Button,{type:"link",size:"small",onClick:Se=>{Se.stopPropagation(),pe(le),ie(!0)},children:"详情"},"detail")]}],Ee=d.useMemo(()=>iF(i,{search:M}),[i,M]);d.useEffect(()=>{D(oF(Ee))},[Ee]);const ke=d.useRef(null),[He,Qe]=d.useState(void 0);d.useEffect(()=>{const Q=()=>{const Se=ke.current;if(!Se)return;const Le=Se.getBoundingClientRect().top;Qe(Math.max(420,window.innerHeight-Le-24))};Q();const le=setTimeout(Q,300);return window.addEventListener("resize",Q),()=>{clearTimeout(le),window.removeEventListener("resize",Q)}},[]);const ve=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:320,flexShrink:0,display:"flex"},children:s.jsxs(u.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx(u.Input.Search,{allowClear:!0,placeholder:"搜索角色编码 / 名称",onSearch:S,onChange:Q=>!Q.target.value&&S(""),style:{flex:1}}),s.jsx(u.Button,{type:"primary",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>{x(null),C.setFieldsValue({enabled:!0}),w(!0)},children:"新增"})]}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[de.map(Q=>{const le=(j==null?void 0:j.id)===Q.id;return s.jsxs("div",{onClick:()=>K(Q),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:le?"#e6f4ff":"transparent",border:le?"1px solid #91caff":"1px solid transparent"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:le?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Q.roleName||Q.roleCode,Q.status===0?s.jsx(u.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[Q.roleCode,Q.tenantCode?` · ${Q.tenantCode}`:""]})]}),s.jsx("span",{onClick:Se=>Se.stopPropagation(),children:s.jsx(u.Switch,{size:"small",checked:Q.status===1,onChange:Se=>oe(Q,Se)})}),s.jsx("span",{onClick:Se=>Se.stopPropagation(),children:s.jsx(u.Dropdown,{trigger:["click"],menu:{items:[{key:"edit",icon:s.jsx(me.AuditOutlined,{}),label:"编辑"},{type:"divider"},{key:"delete",icon:s.jsx(me.DeleteOutlined,{}),label:"删除",danger:!0}],onClick:({key:Se})=>{Se==="edit"?(x(Q),C.setFieldsValue({roleCode:Q.roleCode,roleName:Q.roleName,description:Q.description,enabled:Q.status!==0}),w(!0)):Se==="delete"&&u.Modal.confirm({title:`删除角色 ${Q.roleName}?`,okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onOk:()=>ee(Q)})}},children:s.jsx(u.Button,{type:"text",size:"small",icon:s.jsx(me.EllipsisOutlined,{})})})})]},Q.id)}),de.length===0?s.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:p?"没有匹配的角色":"还没有角色,点「新增」创建",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(u.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},title:j?`权限点 — ${j.roleName}`:"权限点",extra:j?s.jsxs(u.Space,{children:[s.jsx(u.Button,{size:"small",onClick:()=>E(lF(Ee)),children:"全选"}),s.jsx(u.Button,{size:"small",onClick:()=>E([]),children:"清空"}),s.jsx(u.Button,{size:"small",type:"primary",loading:V,onClick:te,children:"保存"})]}):null,styles:{body:{padding:"12px 8px 12px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:j?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx(u.Input.Search,{allowClear:!0,size:"small",placeholder:"按编码 / 名称过滤权限点",onSearch:k,onChange:Q=>!Q.target.value&&k("")})}),s.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:8},children:["已挂载 ",s.jsx("b",{children:T.length})," / 共 ",i.length," 个权限点 —— 勾选即挂载,取消即卸载。"]}),s.jsx(u.Tree,{checkable:!0,blockNode:!0,treeData:Ee,checkedKeys:F,onCheck:Q=>E(Array.isArray(Q)?Q:Q.checked),expandedKeys:R,onExpand:Q=>D(Q),loading:A})]}):s.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧角色,这里展开它挂载的权限点树",style:{margin:"24px 0"}})})})]}),$e=()=>s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(u.Form,{form:N,layout:"inline",children:[s.jsx(u.Form.Item,{name:"appCode",label:"应用",children:s.jsx(u.Select,{placeholder:"全部应用",allowClear:!0,style:{width:180},options:_,showSearch:!0,optionFilterProp:"label"})}),s.jsx(u.Form.Item,{name:"type",label:"类型",children:s.jsx(u.Select,{placeholder:"全部类型",allowClear:!0,style:{width:120},options:Object.entries(Di).map(([Q,le])=>({value:Number(Q),label:le.text}))})}),s.jsx(u.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(u.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(u.Form.Item,{name:"status",label:"状态",children:s.jsx(u.Select,{placeholder:"全部",allowClear:!0,style:{width:100},options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(u.Form.Item,{children:s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.SearchOutlined,{}),onClick:()=>{const Q=N.getFieldsValue(),le={};Q.appCode&&(le.appCode=Q.appCode),Q.type!==void 0&&Q.type!==null&&(le.type=Q.type),Q.keyword&&(le.keyword=Q.keyword),Q.status!==void 0&&Q.status!==null&&(le.status=Q.status),L(le)},children:"查询"}),s.jsx(u.Button,{icon:s.jsx(me.UndoOutlined,{}),onClick:()=>{N.resetFields(),L({})},children:"重置"})]})})]}),s.jsxs(u.Space,{style:{flexShrink:0},children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.PlusOutlined,{}),onClick:()=>{ne(null),Z.resetFields(),Z.setFieldsValue({resourceType:3,status:1,sortOrder:0}),U(!0)},children:"新增"}),s.jsx(u.Button,{danger:!0,icon:s.jsx(me.DeleteOutlined,{}),disabled:H.length===0,onClick:async()=>{var Q;try{await Promise.all(W.map(le=>tt.deleteResource(le.id))),u.message.success(`已删除 ${W.length} 条`),G([]),B([]),(Q=O.current)==null||Q.reload(),ge()}catch(le){u.message.error("批量删除失败:"+((le==null?void 0:le.message)||"未知错误"))}},children:"批量删除"}),s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>{var Q;return(Q=O.current)==null?void 0:Q.reload()},children:"刷新"})]})]})}),s.jsx(fr,{actionRef:O,rowKey:"id",columns:je,request:he,params:q,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:Q=>`共 ${Q} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:H,onChange:(Q,le)=>{G(Q),B(le)}},tableAlertRender:({selectedRowKeys:Q})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:Q.length})," 项"]})})]}),ut=()=>s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,flexWrap:"wrap"},children:[s.jsxs("span",{style:{fontSize:13,color:"#666"},children:["权限模型全貌:按「应用 → 父子层级」组织的最细权限点,共 ",i.length," 个。"]}),s.jsxs(u.Space,{children:[s.jsx(u.Input.Search,{allowClear:!0,size:"small",style:{width:240},placeholder:"按编码 / 名称过滤",onSearch:k,onChange:Q=>!Q.target.value&&k("")}),s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:ge,children:"刷新"})]})]})}),s.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsx(u.Tree,{blockNode:!0,height:560,treeData:Ee,loading:l,defaultExpandAll:!0})})]});return s.jsxs("div",{ref:ke,className:"perm-mgmt-fullheight",style:{display:"flex",flexDirection:"column",minHeight:420,height:He},children:[s.jsx("style",{children:`
35
+ */var nl;function Gh(){return nl||(nl=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}function t(p,S){g||a.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=S();if(!f){var w=S();i(y,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}w=o({inst:{value:y,getSnapshot:S}});var v=w[0].inst,x=w[1];return u(function(){v.value=y,v.getSnapshot=S,n(v)&&x({inst:v})},[p,y,S]),l(function(){return n(v)&&x({inst:v}),p(function(){n(v)&&x({inst:v})})},[p]),m(y),y}function n(p){var S=p.getSnapshot;p=p.value;try{var y=S();return!i(p,y)}catch{return!0}}function r(p,S){return S()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=d,i=typeof Object.is=="function"?Object.is:e,o=a.useState,l=a.useEffect,u=a.useLayoutEffect,m=a.useDebugValue,g=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;za.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),za}var rl;function Zh(){return rl||(rl=1,process.env.NODE_ENV==="production"?ms.exports=qh():ms.exports=Gh()),ms.exports}var sl=Zh(),al=Object.prototype.hasOwnProperty;function Ci(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ci(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(al.call(e,n)&&++r&&!al.call(t,n)||!(n in t)||!Ci(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Eu=0,Iu=1,Mu=2,il=3,ku=4,Ht=new WeakMap,Qt=()=>{},Ze=Qt(),Js=Object,$e=e=>e===Ze,Pt=e=>typeof e=="function",Yt=(e,t)=>({...e,...t}),wi=e=>Pt(e.then),Ba={},gs={},co="undefined",Zr=typeof window!=co,ji=typeof document!=co,Jh=Zr&&"Deno"in window,Xh=()=>Zr&&typeof window.requestAnimationFrame!=co,Au=(e,t)=>{const n=Ht.get(e);return[()=>!$e(t)&&e.get(t)||Ba,r=>{if(!$e(t)){const a=e.get(t);t in gs||(gs[t]=a),n[5](t,Yt(a,r),a||Ba)}},n[6],()=>!$e(t)&&t in gs?gs[t]:!$e(t)&&e.get(t)||Ba]};let vi=!0;const Qh=()=>vi,[Ti,Fi]=Zr&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Qt,Qt],em=()=>{const e=ji&&document.visibilityState;return $e(e)||e!=="hidden"},tm=e=>(ji&&document.addEventListener("visibilitychange",e),Ti("focus",e),()=>{ji&&document.removeEventListener("visibilitychange",e),Fi("focus",e)}),nm=e=>{const t=()=>{vi=!0,e()},n=()=>{vi=!1};return Ti("online",t),Ti("offline",n),()=>{Fi("online",t),Fi("offline",n)}},rm={isOnline:Qh,isVisible:em},sm={initFocus:tm,initReconnect:nm},ol=!d.useId,$n=!Zr||Jh,am=e=>Xh()?window.requestAnimationFrame(e):setTimeout(e,1),Qn=$n?d.useEffect:d.useLayoutEffect,Va=typeof navigator<"u"&&navigator.connection,ll=!$n&&Va&&(["slow-2g","2g"].includes(Va.effectiveType)||Va.saveData),ps=new WeakMap,im=e=>Js.prototype.toString.call(e),Ha=(e,t)=>e===`[object ${t}]`;let om=0;const Ri=e=>{const t=typeof e,n=im(e),r=Ha(n,"Date"),a=Ha(n,"RegExp"),i=Ha(n,"Object");let o,l;if(Js(e)===e&&!r&&!a){if(o=ps.get(e),o)return o;if(o=++om+"~",ps.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=Ri(e[l])+",";ps.set(e,o)}if(i){o="#";const u=Js.keys(e).sort();for(;!$e(l=u.pop());)$e(e[l])||(o+=l+":"+Ri(e[l])+",");ps.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},uo=e=>{if(Pt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ri(e):"",[e,t]};let lm=0;const Xs=()=>++lm;async function Ou(...e){const[t,n,r,a]=e,i=Yt({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const l=i.rollbackOnError;let u=i.optimisticData;const m=h=>typeof l=="function"?l(h):l!==!1,g=i.throwOnError;if(Pt(n)){const h=n,p=[],S=t.keys();for(const y of S)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&p.push(y);return Promise.all(p.map(f))}return f(n);async function f(h){const[p]=uo(h);if(!p)return;const[S,y]=Au(t,p),[w,v,x,C]=Ht.get(t),j=()=>{const A=w[p];return(Pt(i.revalidate)?i.revalidate(S().data,h):i.revalidate!==!1)&&(delete x[p],delete C[p],A&&A[0])?A[0](Mu).then(()=>S().data):S().data};if(e.length<3)return j();let b=r,T,R=!1;const F=Xs();v[p]=[F,0];const E=!$e(u),M=S(),k=M.data,V=M._c,_=$e(V)?k:V;if(E&&(u=Pt(u)?u(_,k):u,y({data:u,_c:_})),Pt(b))try{b=b(_)}catch(A){T=A,R=!0}if(b&&wi(b))if(b=await b.catch(A=>{T=A,R=!0}),F!==v[p][0]){if(R)throw T;return b}else R&&E&&m(T)&&(o=!0,y({data:_,_c:Ze}));if(o&&!R)if(Pt(o)){const A=o(b,_);y({data:A,error:Ze,_c:Ze})}else y({data:b,error:Ze,_c:Ze});if(v[p][1]=Xs(),Promise.resolve(j()).then(()=>{y({_c:Ze})}),R){if(g)throw T;return}return b}}const cl=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Du=(e,t)=>{if(!Ht.has(e)){const r=Yt(sm,t),a=Object.create(null),i=Ou.bind(Ze,e);let o=Qt;const l=Object.create(null),u=(h,p)=>{const S=l[h]||[];return l[h]=S,S.push(p),()=>{const y=S.indexOf(p);y>=0&&(S[y]=S[S.length-1],S.pop())}},m=(h,p,S)=>{e.set(h,p);const y=l[h];if(y)for(const w of y)w(p,S)},g=h=>{const p=Ht.get(e),[,S,y,w]=p,v=Xs();p[8]++;for(const j in y)delete y[j];for(const j in w)delete w[j];for(const j in S)S[j]=[v,v];const x={};for(const j of[...e.keys()]){const b=e.get(j);e.delete(j);const T=l[j];if(T)for(const R of T)R(x,b)}const C=!h||h.revalidate!==!1;for(const j in a){const b=a[j];for(let T=0;T<b.length;T++)b[T](ku,{revalidate:C&&!T})}},f=()=>{if(!Ht.has(e)&&(Ht.set(e,[a,Object.create(null),Object.create(null),Object.create(null),i,m,u,g,0]),!$n)){const h=r.initFocus(setTimeout.bind(Ze,cl.bind(Ze,a,Eu))),p=r.initReconnect(setTimeout.bind(Ze,cl.bind(Ze,a,Iu)));o=()=>{h&&h(),p&&p(),Ht.delete(e)}}};return f(),[e,i,f,o,g]}const n=Ht.get(e);return[e,n[4],Ze,Ze,n[7]]},cm=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!$e(i)&&o>i||setTimeout(r,l,a)},um=Ci,[fo,dm,,,fm]=Du(new Map),Pu=Yt({onLoadingSlow:Qt,onSuccess:Qt,onError:Qt,onErrorRetry:cm,onDiscarded:Qt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ll?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ll?5e3:3e3,compare:um,isPaused:()=>!1,cache:fo,mutate:dm,unload:fm,fallback:{}},rm),Nu=(e,t)=>{const n=Yt(e,t);if(t){const{use:r,fallback:a,cacheData:i}=e,{use:o,fallback:l,cacheData:u}=t;r&&o&&(n.use=r.concat(o)),a&&l&&(n.fallback=Yt(a,l)),i&&u&&(n.cacheData=Yt(i,u))}return n},$i=d.createContext({}),hm=e=>{const{value:t}=e,n=d.useContext($i),r=Pt(t),a=d.useMemo(()=>r?t(n):t,[r,n,t]),i=d.useMemo(()=>r?a:Nu(n,a),[r,n,a]),o=a&&a.provider,l=d.useRef(Ze);o&&!l.current&&(l.current=Du(o(i.cache||fo),a));const u=l.current;return u&&(i.cache=u[0],i.mutate=u[1],i.unload=u[4]),Qn(()=>{if(u)return u[2]&&u[2](),u[3]},[]),d.createElement($i.Provider,Yt(e,{value:i}))},mm="$inf$",Lu=Zr&&window.__SWR_DEVTOOLS_USE__,gm=Lu?window.__SWR_DEVTOOLS_USE__:[],pm=()=>{Lu&&(window.__SWR_DEVTOOLS_REACT__=d)},ym=e=>Pt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_u=()=>{const e=d.useContext($i);return d.useMemo(()=>Yt(Pu,e),[e])},xm=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=uo(t),[,,,l]=Ht.get(fo);if(o.startsWith(mm))return n(...i);const u=l[o];return $e(u)?n(...i):(delete l[o],u)}),r),bm=gm.concat(xm),Sm=e=>function(...n){const r=_u(),[a,i,o]=ym(n),l=Nu(r,o);let u=e;const{use:m}=l,g=(m||[]).concat(bm);for(let f=g.length;f--;)u=g[f](u);return u(a,i||l.fetcher||null,l)},Cm=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};pm();const ys=d.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ua={dedupe:!0},ul=(e,t,n)=>{var r;return t?((r=e.get(t))==null?void 0:r.has(n))===!0:!1},Ya=(e,t,n)=>{if(!t)return;let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)},wm=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{const a=i=>{n()&&$e(t())&&r(i)};Promise.resolve(e).then(i=>{a({data:i,error:Ze})},i=>{a({error:i})})},Qs=Promise.resolve(Ze);Qs.status="fulfilled";Qs.value=Ze;const jm=()=>Qt,vm=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:f,keepPreviousData:h,strictServerPrefetchWarning:p}=n,[S,y,w,v]=Ht.get(r),[x,C]=uo(e),j=d.useRef(!1),b=d.useRef(!1),T=d.useRef(x),R=d.useRef(t),F=d.useRef(n),E=()=>F.current,M=()=>E().isVisible()&&E().isOnline(),[k,V,_,A]=Au(r,x),I=d.useRef({}).current,$=$e(o)?$e(n.fallback)?Ze:n.fallback[x]:o,D=n.cacheData,O=x?D==null?void 0:D[x]:Ze,z=x?v[x]:Ze,Z=$e(z)&&!$e(O),L=Z?O:z,U=(K,re)=>{for(const fe in I){const be=fe;if(be==="data"){if(!a(K[be],re[be])&&(!$e(K[be])||!a(oe,re[be])))return!1}else if(re[be]!==K[be])return!1}return!0},J=!j.current,G=d.useMemo(()=>{const K=k(),re=A(),fe=_e=>{const ze=Yt(_e);return delete ze._k,(()=>{if(!x||!t||E().isPaused())return!1;if(J&&!$e(l))return l;const Ie=$e($)?ze.data:$;return i&&Z&&$e(Ie)?!1:$e(Ie)||u})()?{isValidating:!0,isLoading:!0,...ze}:ze},be=fe(K),Ee=K===re?be:fe(re);let je=be;return[()=>{const _e=fe(k());return U(_e,je)?(je.data=_e.data,je.isLoading=_e.isLoading,je.isValidating=_e.isValidating,je.error=_e.error,je):(je=_e,_e)},()=>Ee]},[r,x]),H=sl.useSyncExternalStore(d.useCallback(K=>_(x,(re,fe)=>{U(fe,re)||K()}),[r,x]),G[0],G[1]),B=S[x]&&S[x].length>0,W=H.data;let N=$e(W)?$&&wi($)?ys($):$:W;const q=H.error,ee=d.useRef(N),ne=d.useRef(Ze);let X=ne.current;X||(X=new WeakMap,ne.current=X);const ae=d.useRef(null);let oe=h?$e(W)?$e(ee.current)?N:ee.current:W:N;const ue=x&&$e(N),ge=d.useRef(null);!$n&&sl.useSyncExternalStore(jm,()=>(ge.current=!1,ge),()=>(ge.current=!0,ge));const me=ge.current;p&&me&&!i&&ue&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const he=!x||!t||E().isPaused()||B&&!$e(q)?!1:J&&!$e(l)?l:i&&Z&&ue?!1:i?$e(N)?!1:u:$e(N)||u,Q=J&&he,se=$e(H.isValidating)?Q:H.isValidating,Se=$e(H.isLoading)?Q:H.isLoading,Fe=d.useCallback(async K=>{const re=R.current;if(!x||!re||b.current||E().isPaused())return!1;let fe,be,Ee=!0;const je=K||{},_e=!w[x]||!je.dedupe,ze=Z&&!ul(X,D,x)&&!$e(L)&&$e(k().data),ve=()=>ol?!b.current&&x===T.current&&j.current:x===T.current,Ie={isValidating:!1,isLoading:!1},Oe=()=>{V(Ie)},ct=()=>{const Ne=w[x];Ne&&Ne[1]===be&&delete w[x]},rt={isValidating:!0};$e(k().data)&&(rt.isLoading=!0);try{if(_e&&(V(rt),n.loadingTimeout&&$e(k().data)&&setTimeout(()=>{Ee&&ve()&&E().onLoadingSlow(x,n)},n.loadingTimeout),ze&&Ya(X,D,x),w[x]=[ze?L:re(C),Xs()],ze&&v[x]&&delete v[x]),[fe,be]=w[x],fe=await fe,_e&&setTimeout(ct,n.dedupingInterval),!w[x]||w[x][1]!==be)return _e&&ve()&&E().onDiscarded(x),!1;Ie.error=Ze;const Ne=y[x];if(!$e(Ne)&&(be<=Ne[0]||be<=Ne[1]||Ne[1]===0))return Oe(),_e&&ve()&&E().onDiscarded(x),!1;const ot=k().data;Ie.data=a(ot,fe)?ot:fe,_e&&ve()&&E().onSuccess(fe,x,n)}catch(Ne){ct();const ot=E(),{shouldRetryOnError:Lt}=ot;ot.isPaused()||(Ie.error=Ne,_e&&ve()&&(ot.onError(Ne,x,ot),(Lt===!0||Pt(Lt)&&Lt(Ne))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||M())&&ot.onErrorRetry(Ne,x,ot,Hn=>{const _t=S[x];_t&&_t[0]&&_t[0](il,Hn)},{retryCount:(je.retryCount||0)+1,dedupe:!0})))}return Ee=!1,Oe(),!0},[x,r]),ie=d.useCallback((...K)=>Ou(r,T.current,...K),[]);if(Qn(()=>{const K=ae.current;K&&(ae.current=null,Ya(X,K.cacheData,K.key),$e(k().data)&&V({data:K.data,error:Ze,_k:K._k}),v[K.key]&&delete v[K.key])}),Qn(()=>{R.current=t,F.current=n,$e(W)||(ee.current=W)}),Qn(()=>{if(t||!Z||$e(L)||ul(X,D,x)||!$e(k().data))return;Ya(X,D,x);const K=y[x];wm({value:L,getCacheData:()=>k().data,canCommit:()=>!b.current&&x===T.current&&y[x]===K,setCache:re=>V({...re,_k:C})})}),Qn(()=>{if(!x)return;const K=Fe.bind(Ze,Ua);let re=0;E().revalidateOnFocus&&(re=Date.now()+E().focusThrottleInterval);const be=Cm(x,S,(Ee,je={})=>{if(Ee==Eu){const _e=Date.now();E().revalidateOnFocus&&_e>re&&M()&&(re=_e+E().focusThrottleInterval,K())}else if(Ee==Iu)E().revalidateOnReconnect&&M()&&K();else{if(Ee==Mu)return Fe();if(Ee==il)return Fe(je);if(Ee==ku&&(ee.current=Ze,je.revalidate))return Fe()}});return b.current=!1,T.current=x,j.current=!0,V({_k:C}),he&&(w[x]||($e(N)||$n?K():am(K))),()=>{b.current=!0,be()}},[x]),Qn(()=>{let K;function re(){const be=Pt(m)?m(k().data):m;be&&K!==-1&&(K=setTimeout(fe,be))}function fe(){!k().error&&(g||E().isVisible())&&(f||E().isOnline())?Fe(Ua).then(re):re()}return re(),()=>{K&&(clearTimeout(K),K=-1)}},[m,g,f,x]),d.useDebugValue(oe),i){if(!ol&&$n&&ue&&$e(L))throw new Error("Fallback data is required when using Suspense in SSR.");ue&&(R.current=t,F.current=n,b.current=!1);const K=!$e(L)&&ue;let re=Ze;if(K&&Z)re=L&&wi(L)?ys(L):L,N=re,oe=re,$n||(ae.current={data:re,_k:C,key:x,cacheData:D});else{const be=K?ie(L):Qs;ys(be)}if(!$e(q)&&ue)throw q;const fe=ue&&$e(re)?Fe(Ua):Qs;!$e(oe)&&ue&&(fe.status="fulfilled",fe.value=!0),ys(fe)}return{mutate:ie,get data(){return I.data=!0,oe},get error(){return I.error=!0,q},get isValidating(){return I.isValidating=!0,se},get isLoading(){return I.isLoading=!0,Se}}},Tm=Js.defineProperty(hm,"defaultValue",{value:Pu}),zu=Sm(vm),Fm={moneySymbol:"$",form:{lightFilter:{more:"المزيد",clear:"نظف",confirm:"تأكيد",itemUnit:"عناصر"}},tableForm:{search:"ابحث",reset:"إعادة تعيين",submit:"ارسال",collapsed:"مُقلص",expand:"مُوسع",inputPlaceholder:"الرجاء الإدخال",selectPlaceholder:"الرجاء الإختيار"},alert:{clear:"نظف",selected:"محدد",item:"عنصر"},pagination:{total:{range:" ",total:"من",item:"عناصر"}},tableToolBar:{leftPin:"ثبت على اليسار",rightPin:"ثبت على اليمين",noPin:"الغاء التثبيت",leftFixedTitle:"لصق على اليسار",rightFixedTitle:"لصق على اليمين",noFixedTitle:"إلغاء الإلصاق",reset:"إعادة تعيين",columnDisplay:"الأعمدة المعروضة",columnSetting:"الإعدادات",fullScreen:"وضع كامل الشاشة",exitFullScreen:"الخروج من وضع كامل الشاشة",reload:"تحديث",density:"الكثافة",densityDefault:"افتراضي",densityLarger:"أكبر",densityMiddle:"وسط",densitySmall:"مدمج"},stepsForm:{next:"التالي",prev:"السابق",submit:"أنهى"},loginForm:{submitText:"تسجيل الدخول"},editableTable:{action:{save:"أنقذ",cancel:"إلغاء الأمر",delete:"حذف",add:"إضافة صف من البيانات"}},switch:{open:"مفتوح",close:"غلق"}},Rm={moneySymbol:"€",form:{lightFilter:{more:"Més",clear:"Netejar",confirm:"Confirmar",itemUnit:"Elements"}},tableForm:{search:"Cercar",reset:"Netejar",submit:"Enviar",collapsed:"Expandir",expand:"Col·lapsar",inputPlaceholder:"Introduïu valor",selectPlaceholder:"Seleccioneu valor"},alert:{clear:"Netejar",selected:"Seleccionat",item:"Article"},pagination:{total:{range:" ",total:"de",item:"articles"}},tableToolBar:{leftPin:"Pin a l'esquerra",rightPin:"Pin a la dreta",noPin:"Sense Pin",leftFixedTitle:"Fixat a l'esquerra",rightFixedTitle:"Fixat a la dreta",noFixedTitle:"Sense fixar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuració",fullScreen:"Pantalla Completa",exitFullScreen:"Sortir Pantalla Completa",reload:"Refrescar",density:"Densitat",densityDefault:"Per Defecte",densityLarger:"Llarg",densityMiddle:"Mitjà",densitySmall:"Compacte"},stepsForm:{next:"Següent",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Cancel·lar",delete:"Eliminar",add:"afegir una fila de dades"}},switch:{open:"obert",close:"tancat"}},$m={moneySymbol:"Kč",deleteThisLine:"Smazat tento řádek",copyThisLine:"Kopírovat tento řádek",form:{lightFilter:{more:"Víc",clear:"Vymazat",confirm:"Potvrdit",itemUnit:"Položky"}},tableForm:{search:"Hledat",reset:"Resetovat",submit:"Odeslat",collapsed:"Zvětšit",expand:"Zmenšit",inputPlaceholder:"Zadejte prosím",selectPlaceholder:"Vyberte prosím"},alert:{clear:"Vymazat",selected:"Vybráno",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položek"}},tableToolBar:{leftPin:"Připnout doleva",rightPin:"Připnout doprava",noPin:"Odepnuto",leftFixedTitle:"Fixováno nalevo",rightFixedTitle:"Fixováno napravo",noFixedTitle:"Nefixováno",reset:"Resetovat",columnDisplay:"Zobrazení sloupců",columnSetting:"Nastavení",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončit celou obrazovku",reload:"Obnovit",density:"Hustota",densityDefault:"Výchozí",densityLarger:"Větší",densityMiddle:"Střední",densitySmall:"Kompaktní"},stepsForm:{next:"Další",prev:"Předchozí",submit:"Dokončit"},loginForm:{submitText:"Přihlásit se"},editableTable:{onlyOneLineEditor:"Upravit lze pouze jeden řádek",action:{save:"Uložit",cancel:"Zrušit",delete:"Vymazat",add:"Přidat řádek"}},switch:{open:"Otevřít",close:"Zavřít"}},Em={moneySymbol:"€",form:{lightFilter:{more:"Mehr",clear:"Zurücksetzen",confirm:"Bestätigen",itemUnit:"Einträge"}},tableForm:{search:"Suchen",reset:"Zurücksetzen",submit:"Absenden",collapsed:"Zeige mehr",expand:"Zeige weniger",inputPlaceholder:"Bitte eingeben",selectPlaceholder:"Bitte auswählen"},alert:{clear:"Zurücksetzen",selected:"Ausgewählt",item:"Eintrag"},pagination:{total:{range:" ",total:"von",item:"Einträgen"}},tableToolBar:{leftPin:"Links anheften",rightPin:"Rechts anheften",noPin:"Nicht angeheftet",leftFixedTitle:"Links fixiert",rightFixedTitle:"Rechts fixiert",noFixedTitle:"Nicht fixiert",reset:"Zurücksetzen",columnDisplay:"Angezeigte Reihen",columnSetting:"Einstellungen",fullScreen:"Vollbild",exitFullScreen:"Vollbild verlassen",reload:"Aktualisieren",density:"Abstand",densityDefault:"Standard",densityLarger:"Größer",densityMiddle:"Mittel",densitySmall:"Kompakt"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Anmelden"},editableTable:{action:{save:"Retten",cancel:"Abbrechen",delete:"Löschen",add:"Hinzufügen einer Datenzeile"}},switch:{open:"offen",close:"schließen"}},Im={moneySymbol:"£",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},Mm={moneySymbol:"$",deleteThisLine:"Delete this line",copyThisLine:"Copy this line",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},km={moneySymbol:"€",form:{lightFilter:{more:"Más",clear:"Limpiar",confirm:"Confirmar",itemUnit:"artículos"}},tableForm:{search:"Buscar",reset:"Limpiar",submit:"Submit",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Ingrese valor",selectPlaceholder:"Seleccione valor"},alert:{clear:"Limpiar",selected:"Seleccionado",item:"Articulo"},pagination:{total:{range:" ",total:"de",item:"artículos"}},tableToolBar:{leftPin:"Pin a la izquierda",rightPin:"Pin a la derecha",noPin:"Sin Pin",leftFixedTitle:"Fijado a la izquierda",rightFixedTitle:"Fijado a la derecha",noFixedTitle:"Sin Fijar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuración",fullScreen:"Pantalla Completa",exitFullScreen:"Salir Pantalla Completa",reload:"Refrescar",density:"Densidad",densityDefault:"Por Defecto",densityLarger:"Largo",densityMiddle:"Medio",densitySmall:"Compacto"},stepsForm:{next:"Siguiente",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Descartar",delete:"Borrar",add:"añadir una fila de datos"}},switch:{open:"abrir",close:"cerrar"}},Am={moneySymbol:"تومان",form:{lightFilter:{more:"بیشتر",clear:"پاک کردن",confirm:"تایید",itemUnit:"مورد"}},tableForm:{search:"جستجو",reset:"بازنشانی",submit:"تایید",collapsed:"نمایش بیشتر",expand:"نمایش کمتر",inputPlaceholder:"پیدا کنید",selectPlaceholder:"انتخاب کنید"},alert:{clear:"پاک سازی",selected:"انتخاب",item:"مورد"},pagination:{total:{range:" ",total:"از",item:"مورد"}},tableToolBar:{leftPin:"سنجاق به چپ",rightPin:"سنجاق به راست",noPin:"سنجاق نشده",leftFixedTitle:"ثابت شده در چپ",rightFixedTitle:"ثابت شده در راست",noFixedTitle:"شناور",reset:"بازنشانی",columnDisplay:"نمایش همه",columnSetting:"تنظیمات",fullScreen:"تمام صفحه",exitFullScreen:"خروج از حالت تمام صفحه",reload:"تازه سازی",density:"تراکم",densityDefault:"پیش فرض",densityLarger:"بزرگ",densityMiddle:"متوسط",densitySmall:"کوچک"},stepsForm:{next:"بعدی",prev:"قبلی",submit:"اتمام"},loginForm:{submitText:"ورود"},editableTable:{action:{save:"ذخیره",cancel:"لغو",delete:"حذف",add:"یک ردیف داده اضافه کنید"}},switch:{open:"باز",close:"نزدیک"}},Om={moneySymbol:"€",form:{lightFilter:{more:"Plus",clear:"Effacer",confirm:"Confirmer",itemUnit:"Items"}},tableForm:{search:"Rechercher",reset:"Réinitialiser",submit:"Envoyer",collapsed:"Agrandir",expand:"Réduire",inputPlaceholder:"Entrer une valeur",selectPlaceholder:"Sélectionner une valeur"},alert:{clear:"Réinitialiser",selected:"Sélectionné",item:"Item"},pagination:{total:{range:" ",total:"sur",item:"éléments"}},tableToolBar:{leftPin:"Épingler à gauche",rightPin:"Épingler à gauche",noPin:"Sans épingle",leftFixedTitle:"Fixer à gauche",rightFixedTitle:"Fixer à droite",noFixedTitle:"Non fixé",reset:"Réinitialiser",columnDisplay:"Affichage colonne",columnSetting:"Réglages",fullScreen:"Plein écran",exitFullScreen:"Quitter Plein écran",reload:"Rafraichir",density:"Densité",densityDefault:"Par défaut",densityLarger:"Larger",densityMiddle:"Moyenne",densitySmall:"Compacte"},stepsForm:{next:"Suivante",prev:"Précédente",submit:"Finaliser"},loginForm:{submitText:"Se connecter"},editableTable:{action:{save:"Sauvegarder",cancel:"Annuler",delete:"Supprimer",add:"ajouter une ligne de données"}},switch:{open:"ouvert",close:"près"}},Dm={moneySymbol:"₪",deleteThisLine:"מחק שורה זו",copyThisLine:"העתק שורה זו",form:{lightFilter:{more:"יותר",clear:"נקה",confirm:"אישור",itemUnit:"פריטים"}},tableForm:{search:"חיפוש",reset:"איפוס",submit:"שלח",collapsed:"הרחב",expand:"כווץ",inputPlaceholder:"אנא הכנס",selectPlaceholder:"אנא בחר"},alert:{clear:"נקה",selected:"נבחר",item:"פריט"},pagination:{total:{range:" ",total:"מתוך",item:"פריטים"}},tableToolBar:{leftPin:"הצמד לשמאל",rightPin:"הצמד לימין",noPin:"לא מצורף",leftFixedTitle:"מוצמד לשמאל",rightFixedTitle:"מוצמד לימין",noFixedTitle:"לא מוצמד",reset:"איפוס",columnDisplay:"תצוגת עמודות",columnSetting:"הגדרות",fullScreen:"מסך מלא",exitFullScreen:"צא ממסך מלא",reload:"רענן",density:"רזולוציה",densityDefault:"ברירת מחדל",densityLarger:"גדול",densityMiddle:"בינוני",densitySmall:"קטן"},stepsForm:{next:"הבא",prev:"קודם",submit:"סיום"},loginForm:{submitText:"כניסה"},editableTable:{onlyOneLineEditor:"ניתן לערוך רק שורה אחת",action:{save:"שמור",cancel:"ביטול",delete:"מחיקה",add:"הוסף שורת נתונים"}},switch:{open:"פתח",close:"סגור"}},Pm={moneySymbol:"kn",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pretraži",reset:"Poništi",submit:"Potvrdi",collapsed:"Raširi",expand:"Skupi",inputPlaceholder:"Unesite",selectPlaceholder:"Odaberite"},alert:{clear:"Očisti",selected:"Odaberi",item:"stavke"},pagination:{total:{range:" ",total:"od",item:"stavke"}},tableToolBar:{leftPin:"Prikači lijevo",rightPin:"Prikači desno",noPin:"Bez prikačenja",leftFixedTitle:"Fiksiraj lijevo",rightFixedTitle:"Fiksiraj desno",noFixedTitle:"Bez fiksiranja",reset:"Resetiraj",columnDisplay:"Prikaz stupaca",columnSetting:"Postavke",fullScreen:"Puni zaslon",exitFullScreen:"Izađi iz punog zaslona",reload:"Ponovno učitaj",density:"Veličina",densityDefault:"Zadano",densityLarger:"Veliko",densityMiddle:"Srednje",densitySmall:"Malo"},stepsForm:{next:"Sljedeći",prev:"Prethodni",submit:"Kraj"},loginForm:{submitText:"Prijava"},editableTable:{action:{save:"Spremi",cancel:"Odustani",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"otvori",close:"zatvori"}},Nm={moneySymbol:"RP",form:{lightFilter:{more:"Lebih",clear:"Hapus",confirm:"Konfirmasi",itemUnit:"Unit"}},tableForm:{search:"Cari",reset:"Atur ulang",submit:"Kirim",collapsed:"Lebih sedikit",expand:"Lebih banyak",inputPlaceholder:"Masukkan pencarian",selectPlaceholder:"Pilih"},alert:{clear:"Hapus",selected:"Dipilih",item:"Butir"},pagination:{total:{range:" ",total:"Dari",item:"Butir"}},tableToolBar:{leftPin:"Pin kiri",rightPin:"Pin kanan",noPin:"Tidak ada pin",leftFixedTitle:"Rata kiri",rightFixedTitle:"Rata kanan",noFixedTitle:"Tidak tetap",reset:"Atur ulang",columnDisplay:"Tampilan kolom",columnSetting:"Pengaturan",fullScreen:"Layar penuh",exitFullScreen:"Keluar layar penuh",reload:"Atur ulang",density:"Kerapatan",densityDefault:"Standar",densityLarger:"Lebih besar",densityMiddle:"Sedang",densitySmall:"Rapat"},stepsForm:{next:"Selanjutnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Login"},editableTable:{action:{save:"simpan",cancel:"batal",delete:"hapus",add:"Tambahkan baris data"}},switch:{open:"buka",close:"tutup"}},Lm={moneySymbol:"€",form:{lightFilter:{more:"più",clear:"pulisci",confirm:"conferma",itemUnit:"elementi"}},tableForm:{search:"Filtra",reset:"Pulisci",submit:"Invia",collapsed:"Espandi",expand:"Contrai",inputPlaceholder:"Digita",selectPlaceholder:"Seleziona"},alert:{clear:"Rimuovi",selected:"Selezionati",item:"elementi"},pagination:{total:{range:" ",total:"di",item:"elementi"}},tableToolBar:{leftPin:"Fissa a sinistra",rightPin:"Fissa a destra",noPin:"Ripristina posizione",leftFixedTitle:"Fissato a sinistra",rightFixedTitle:"Fissato a destra",noFixedTitle:"Non fissato",reset:"Ripristina",columnDisplay:"Disposizione colonne",columnSetting:"Impostazioni",fullScreen:"Modalità schermo intero",exitFullScreen:"Esci da modalità schermo intero",reload:"Ricarica",density:"Grandezza tabella",densityDefault:"predefinito",densityLarger:"Grande",densityMiddle:"Media",densitySmall:"Compatta"},stepsForm:{next:"successivo",prev:"precedente",submit:"finisci"},loginForm:{submitText:"Accedi"},editableTable:{action:{save:"salva",cancel:"annulla",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"chiudi"}},_m={moneySymbol:"¥",form:{lightFilter:{more:"更に",clear:"クリア",confirm:"確認",itemUnit:"アイテム"}},tableForm:{search:"検索",reset:"リセット",submit:"送信",collapsed:"拡大",expand:"折畳",inputPlaceholder:"入力してください",selectPlaceholder:"選択してください"},alert:{clear:"クリア",selected:"選択した",item:"アイテム"},pagination:{total:{range:"レコード",total:"/合計",item:" "}},tableToolBar:{leftPin:"左に固定",rightPin:"右に固定",noPin:"キャンセル",leftFixedTitle:"左に固定された項目",rightFixedTitle:"右に固定された項目",noFixedTitle:"固定されてない項目",reset:"リセット",columnDisplay:"表示列",columnSetting:"列表示設定",fullScreen:"フルスクリーン",exitFullScreen:"終了",reload:"更新",density:"行高",densityDefault:"デフォルト",densityLarger:"大",densityMiddle:"中",densitySmall:"小"},stepsForm:{next:"次へ",prev:"前へ",submit:"送信"},loginForm:{submitText:"ログイン"},editableTable:{action:{save:"保存",cancel:"キャンセル",delete:"削除",add:"追加"}},switch:{open:"開く",close:"閉じる"}},zm={moneySymbol:"₩",form:{lightFilter:{more:"더보기",clear:"초기화",confirm:"확인",itemUnit:"건수"}},tableForm:{search:"조회",reset:"초기화",submit:"제출",collapsed:"확장",expand:"닫기",inputPlaceholder:"입력해 주세요",selectPlaceholder:"선택해 주세요"},alert:{clear:"취소",selected:"선택",item:"건"},pagination:{total:{range:" ",total:"/ 총",item:"건"}},tableToolBar:{leftPin:"왼쪽으로 핀",rightPin:"오른쪽으로 핀",noPin:"핀 제거",leftFixedTitle:"왼쪽으로 고정",rightFixedTitle:"오른쪽으로 고정",noFixedTitle:"비고정",reset:"초기화",columnDisplay:"컬럼 표시",columnSetting:"설정",fullScreen:"전체 화면",exitFullScreen:"전체 화면 취소",reload:"새로 고침",density:"여백",densityDefault:"기본",densityLarger:"많은 여백",densityMiddle:"중간 여백",densitySmall:"좁은 여백"},stepsForm:{next:"다음",prev:"이전",submit:"종료"},loginForm:{submitText:"로그인"},editableTable:{action:{save:"저장",cancel:"취소",delete:"삭제",add:"데이터 행 추가"}},switch:{open:"열",close:"가까 운"}},Bm={moneySymbol:"₮",form:{lightFilter:{more:"Илүү",clear:"Цэвэрлэх",confirm:"Баталгаажуулах",itemUnit:"Нэгжүүд"}},tableForm:{search:"Хайх",reset:"Шинэчлэх",submit:"Илгээх",collapsed:"Өргөтгөх",expand:"Хураах",inputPlaceholder:"Утга оруулна уу",selectPlaceholder:"Утга сонгоно уу"},alert:{clear:"Цэвэрлэх",selected:"Сонгогдсон",item:"Нэгж"},pagination:{total:{range:" ",total:"Нийт",item:"мөр"}},tableToolBar:{leftPin:"Зүүн тийш бэхлэх",rightPin:"Баруун тийш бэхлэх",noPin:"Бэхлэхгүй",leftFixedTitle:"Зүүн зэрэгцүүлэх",rightFixedTitle:"Баруун зэрэгцүүлэх",noFixedTitle:"Зэрэгцүүлэхгүй",reset:"Шинэчлэх",columnDisplay:"Баганаар харуулах",columnSetting:"Тохиргоо",fullScreen:"Бүтэн дэлгэцээр",exitFullScreen:"Бүтэн дэлгэц цуцлах",reload:"Шинэчлэх",density:"Хэмжээ",densityDefault:"Хэвийн",densityLarger:"Том",densityMiddle:"Дунд",densitySmall:"Жижиг"},stepsForm:{next:"Дараах",prev:"Өмнөх",submit:"Дуусгах"},loginForm:{submitText:"Нэвтрэх"},editableTable:{action:{save:"Хадгалах",cancel:"Цуцлах",delete:"Устгах",add:"Мөр нэмэх"}},switch:{open:"Нээх",close:"Хаах"}},Vm={moneySymbol:"RM",form:{lightFilter:{more:"Lebih banyak",clear:"Jelas",confirm:"Mengesahkan",itemUnit:"Item"}},tableForm:{search:"Cari",reset:"Menetapkan semula",submit:"Hantar",collapsed:"Kembang",expand:"Kuncup",inputPlaceholder:"Sila masuk",selectPlaceholder:"Sila pilih"},alert:{clear:"Padam",selected:"Dipilih",item:"Item"},pagination:{total:{range:" ",total:"daripada",item:"item"}},tableToolBar:{leftPin:"Pin ke kiri",rightPin:"Pin ke kanan",noPin:"Tidak pin",leftFixedTitle:"Tetap ke kiri",rightFixedTitle:"Tetap ke kanan",noFixedTitle:"Tidak Tetap",reset:"Menetapkan semula",columnDisplay:"Lajur",columnSetting:"Settings",fullScreen:"Full Screen",exitFullScreen:"Keluar Full Screen",reload:"Muat Semula",density:"Densiti",densityDefault:"Biasa",densityLarger:"Besar",densityMiddle:"Tengah",densitySmall:"Kecil"},stepsForm:{next:"Seterusnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Log Masuk"},editableTable:{action:{save:"Simpan",cancel:"Membatalkan",delete:"Menghapuskan",add:"tambah baris data"}},switch:{open:"Terbuka",close:"Tutup"}},Hm={moneySymbol:"€",deleteThisLine:"Verwijder deze regel",copyThisLine:"Kopieer deze regel",form:{lightFilter:{more:"Meer filters",clear:"Wissen",confirm:"Bevestigen",itemUnit:"item"}},tableForm:{search:"Zoeken",reset:"Resetten",submit:"Indienen",collapsed:"Uitvouwen",expand:"Inklappen",inputPlaceholder:"Voer in",selectPlaceholder:"Selecteer"},alert:{clear:"Selectie annuleren",selected:"Geselecteerd",item:"item"},pagination:{total:{range:"Van",total:"items/totaal",item:"items"}},tableToolBar:{leftPin:"Vastzetten aan begin",rightPin:"Vastzetten aan einde",noPin:"Niet vastzetten",leftFixedTitle:"Vastzetten aan de linkerkant",rightFixedTitle:"Vastzetten aan de rechterkant",noFixedTitle:"Niet vastzetten",reset:"Resetten",columnDisplay:"Kolomweergave",columnSetting:"Kolominstellingen",fullScreen:"Volledig scherm",exitFullScreen:"Verlaat volledig scherm",reload:"Vernieuwen",density:"Dichtheid",densityDefault:"Normaal",densityLarger:"Ruim",densityMiddle:"Gemiddeld",densitySmall:"Compact"},stepsForm:{next:"Volgende stap",prev:"Vorige stap",submit:"Indienen"},loginForm:{submitText:"Inloggen"},editableTable:{onlyOneLineEditor:"Slechts één regel tegelijk bewerken",action:{save:"Opslaan",cancel:"Annuleren",delete:"Verwijderen",add:"Een regel toevoegen"}},switch:{open:"Openen",close:"Sluiten"}},Um={moneySymbol:"zł",form:{lightFilter:{more:"Więcej",clear:"Wyczyść",confirm:"Potwierdź",itemUnit:"Ilość"}},tableForm:{search:"Szukaj",reset:"Reset",submit:"Zatwierdź",collapsed:"Pokaż wiecej",expand:"Pokaż mniej",inputPlaceholder:"Proszę podać",selectPlaceholder:"Proszę wybrać"},alert:{clear:"Wyczyść",selected:"Wybrane",item:"Wpis"},pagination:{total:{range:" ",total:"z",item:"Wpisów"}},tableToolBar:{leftPin:"Przypnij do lewej",rightPin:"Przypnij do prawej",noPin:"Odepnij",leftFixedTitle:"Przypięte do lewej",rightFixedTitle:"Przypięte do prawej",noFixedTitle:"Nieprzypięte",reset:"Reset",columnDisplay:"Wyświetlane wiersze",columnSetting:"Ustawienia",fullScreen:"Pełen ekran",exitFullScreen:"Zamknij pełen ekran",reload:"Odśwież",density:"Odstęp",densityDefault:"Standard",densityLarger:"Wiekszy",densityMiddle:"Sredni",densitySmall:"Kompaktowy"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Zaloguj się"},editableTable:{action:{save:"Zapisać",cancel:"Anuluj",delete:"Usunąć",add:"dodawanie wiersza danych"}},switch:{open:"otwierać",close:"zamykać"}},Ym={moneySymbol:"R$",form:{lightFilter:{more:"Mais",clear:"Limpar",confirm:"Confirmar",itemUnit:"Itens"}},tableForm:{search:"Filtrar",reset:"Limpar",submit:"Confirmar",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Por favor insira",selectPlaceholder:"Por favor selecione"},alert:{clear:"Limpar",selected:"Selecionado(s)",item:"Item(s)"},pagination:{total:{range:" ",total:"de",item:"itens"}},tableToolBar:{leftPin:"Fixar à esquerda",rightPin:"Fixar à direita",noPin:"Desfixado",leftFixedTitle:"Fixado à esquerda",rightFixedTitle:"Fixado à direita",noFixedTitle:"Não fixado",reset:"Limpar",columnDisplay:"Mostrar Coluna",columnSetting:"Configurações",fullScreen:"Tela Cheia",exitFullScreen:"Sair da Tela Cheia",reload:"Atualizar",density:"Densidade",densityDefault:"Padrão",densityLarger:"Largo",densityMiddle:"Médio",densitySmall:"Compacto"},stepsForm:{next:"Próximo",prev:"Anterior",submit:"Enviar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Salvar",cancel:"Cancelar",delete:"Apagar",add:"adicionar uma linha de dados"}},switch:{open:"abrir",close:"fechar"}},Km={moneySymbol:"RON",deleteThisLine:"Șterge acest rând",copyThisLine:"Copiază acest rând",form:{lightFilter:{more:"Mai multe filtre",clear:"Curăță",confirm:"Confirmă",itemUnit:"elemente"}},tableForm:{search:"Caută",reset:"Resetează",submit:"Trimite",collapsed:"Extinde",expand:"Restrânge",inputPlaceholder:"Introduceți",selectPlaceholder:"Selectați"},alert:{clear:"Anulează selecția",selected:"Selectat",item:"elemente"},pagination:{total:{range:"De la",total:"elemente/total",item:"elemente"}},tableToolBar:{leftPin:"Fixează la început",rightPin:"Fixează la sfârșit",noPin:"Nu fixa",leftFixedTitle:"Fixează în stânga",rightFixedTitle:"Fixează în dreapta",noFixedTitle:"Nu fixa",reset:"Resetează",columnDisplay:"Afișare coloane",columnSetting:"Setări coloane",fullScreen:"Ecran complet",exitFullScreen:"Ieși din ecran complet",reload:"Reîncarcă",density:"Densitate",densityDefault:"Normal",densityLarger:"Larg",densityMiddle:"Mediu",densitySmall:"Compact"},stepsForm:{next:"Pasul următor",prev:"Pasul anterior",submit:"Trimite"},loginForm:{submitText:"Autentificare"},editableTable:{onlyOneLineEditor:"Se poate edita doar un rând simultan",action:{save:"Salvează",cancel:"Anulează",delete:"Șterge",add:"Adaugă un rând"}},switch:{open:"Deschide",close:"Închide"}},Wm={moneySymbol:"₽",form:{lightFilter:{more:"Еще",clear:"Очистить",confirm:"ОК",itemUnit:"Позиции"}},tableForm:{search:"Найти",reset:"Сброс",submit:"Отправить",collapsed:"Развернуть",expand:"Свернуть",inputPlaceholder:"Введите значение",selectPlaceholder:"Выберите значение"},alert:{clear:"Очистить",selected:"Выбрано",item:"элементов"},pagination:{total:{range:" ",total:"из",item:"элементов"}},tableToolBar:{leftPin:"Закрепить слева",rightPin:"Закрепить справа",noPin:"Открепить",leftFixedTitle:"Закреплено слева",rightFixedTitle:"Закреплено справа",noFixedTitle:"Не закреплено",reset:"Сброс",columnDisplay:"Отображение столбца",columnSetting:"Настройки",fullScreen:"Полный экран",exitFullScreen:"Выйти из полноэкранного режима",reload:"Обновить",density:"Размер",densityDefault:"По умолчанию",densityLarger:"Большой",densityMiddle:"Средний",densitySmall:"Сжатый"},stepsForm:{next:"Следующий",prev:"Предыдущий",submit:"Завершить"},loginForm:{submitText:"Вход"},editableTable:{action:{save:"Сохранить",cancel:"Отменить",delete:"Удалить",add:"добавить ряд данных"}},switch:{open:"Открытый чемпионат мира по теннису",close:"По адресу:"}},qm={moneySymbol:"€",deleteThisLine:"Odstrániť tento riadok",copyThisLine:"Skopírujte tento riadok",form:{lightFilter:{more:"Viac",clear:"Vyčistiť",confirm:"Potvrďte",itemUnit:"Položky"}},tableForm:{search:"Vyhladať",reset:"Resetovať",submit:"Odoslať",collapsed:"Rozbaliť",expand:"Zbaliť",inputPlaceholder:"Prosím, zadajte",selectPlaceholder:"Prosím, vyberte"},alert:{clear:"Vyčistiť",selected:"Vybraný",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položiek"}},tableToolBar:{leftPin:"Pripnúť vľavo",rightPin:"Pripnúť vpravo",noPin:"Odopnuté",leftFixedTitle:"Fixované na ľavo",rightFixedTitle:"Fixované na pravo",noFixedTitle:"Nefixované",reset:"Resetovať",columnDisplay:"Zobrazenie stĺpcov",columnSetting:"Nastavenia",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončiť celú obrazovku",reload:"Obnoviť",density:"Hustota",densityDefault:"Predvolené",densityLarger:"Väčšie",densityMiddle:"Stredné",densitySmall:"Kompaktné"},stepsForm:{next:"Ďalšie",prev:"Predchádzajúce",submit:"Potvrdiť"},loginForm:{submitText:"Prihlásiť sa"},editableTable:{onlyOneLineEditor:"Upravovať možno iba jeden riadok",action:{save:"Uložiť",cancel:"Zrušiť",delete:"Odstrániť",add:"pridať riadok údajov"}},switch:{open:"otvoriť",close:"zavrieť"}},Gm={moneySymbol:"RSD",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pronađi",reset:"Resetuj",submit:"Pošalji",collapsed:"Proširi",expand:"Skupi",inputPlaceholder:"Molimo unesite",selectPlaceholder:"Molimo odaberite"},alert:{clear:"Očisti",selected:"Odabrano",item:"Stavka"},pagination:{total:{range:" ",total:"od",item:"stavki"}},tableToolBar:{leftPin:"Zakači levo",rightPin:"Zakači desno",noPin:"Nije zakačeno",leftFixedTitle:"Fiksirano levo",rightFixedTitle:"Fiksirano desno",noFixedTitle:"Nije fiksirano",reset:"Resetuj",columnDisplay:"Prikaz kolona",columnSetting:"Podešavanja",fullScreen:"Pun ekran",exitFullScreen:"Zatvori pun ekran",reload:"Osveži",density:"Veličina",densityDefault:"Podrazumevana",densityLarger:"Veća",densityMiddle:"Srednja",densitySmall:"Kompaktna"},stepsForm:{next:"Dalje",prev:"Nazad",submit:"Gotovo"},loginForm:{submitText:"Prijavi se"},editableTable:{action:{save:"Sačuvaj",cancel:"Poništi",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"Отворите",close:"Затворите"}},Zm={moneySymbol:"SEK",deleteThisLine:"Radera denna rad",copyThisLine:"Kopiera denna rad",form:{lightFilter:{more:"Fler filter",clear:"Rensa",confirm:"Bekräfta",itemUnit:"objekt"}},tableForm:{search:"Sök",reset:"Återställ",submit:"Skicka",collapsed:"Expandera",expand:"Fäll ihop",inputPlaceholder:"Vänligen ange",selectPlaceholder:"Vänligen välj"},alert:{clear:"Avbryt val",selected:"Vald",item:"objekt"},pagination:{total:{range:"Från",total:"objekt/totalt",item:"objekt"}},tableToolBar:{leftPin:"Fäst till vänster",rightPin:"Fäst till höger",noPin:"Inte fäst",leftFixedTitle:"Fäst till vänster",rightFixedTitle:"Fäst till höger",noFixedTitle:"Inte fäst",reset:"Återställ",columnDisplay:"Kolumnvisning",columnSetting:"Kolumninställningar",fullScreen:"Fullskärm",exitFullScreen:"Avsluta fullskärm",reload:"Ladda om",density:"Täthet",densityDefault:"Normal",densityLarger:"Lös",densityMiddle:"Medium",densitySmall:"Kompakt"},stepsForm:{next:"Nästa steg",prev:"Föregående steg",submit:"Skicka"},loginForm:{submitText:"Logga in"},editableTable:{onlyOneLineEditor:"Endast en rad kan redigeras åt gången",action:{save:"Spara",cancel:"Avbryt",delete:"Radera",add:"Lägg till en rad"}},switch:{open:"Öppna",close:"Stäng"}},Jm={moneySymbol:"฿",deleteThisLine:"ลบบรรทัดนี้",copyThisLine:"คัดลอกบรรทัดนี้",form:{lightFilter:{more:"มากกว่า",clear:"ชัดเจน",confirm:"ยืนยัน",itemUnit:"รายการ"}},tableForm:{search:"สอบถาม",reset:"รีเซ็ต",submit:"ส่ง",collapsed:"ขยาย",expand:"ทรุด",inputPlaceholder:"กรุณาป้อน",selectPlaceholder:"โปรดเลือก"},alert:{clear:"ชัดเจน",selected:"เลือกแล้ว",item:"รายการ"},pagination:{total:{range:" ",total:"ของ",item:"รายการ"}},tableToolBar:{leftPin:"ปักหมุดไปทางซ้าย",rightPin:"ปักหมุดไปทางขวา",noPin:"เลิกตรึงแล้ว",leftFixedTitle:"แก้ไขด้านซ้าย",rightFixedTitle:"แก้ไขด้านขวา",noFixedTitle:"ไม่คงที่",reset:"รีเซ็ต",columnDisplay:"การแสดงคอลัมน์",columnSetting:"การตั้งค่า",fullScreen:"เต็มจอ",exitFullScreen:"ออกจากโหมดเต็มหน้าจอ",reload:"รีเฟรช",density:"ความหนาแน่น",densityDefault:"ค่าเริ่มต้น",densityLarger:"ขนาดใหญ่ขึ้น",densityMiddle:"กลาง",densitySmall:"กะทัดรัด"},stepsForm:{next:"ถัดไป",prev:"ก่อนหน้า",submit:"เสร็จ"},loginForm:{submitText:"เข้าสู่ระบบ"},editableTable:{onlyOneLineEditor:"แก้ไขได้เพียงบรรทัดเดียวเท่านั้น",action:{save:"บันทึก",cancel:"ยกเลิก",delete:"ลบ",add:"เพิ่มแถวของข้อมูล"}},switch:{open:"เปิด",close:"ปิด"}},Xm={moneySymbol:"₺",form:{lightFilter:{more:"Daha Fazla",clear:"Temizle",confirm:"Onayla",itemUnit:"Öğeler"}},tableForm:{search:"Filtrele",reset:"Sıfırla",submit:"Gönder",collapsed:"Daha fazla",expand:"Daha az",inputPlaceholder:"Filtrelemek için bir değer girin",selectPlaceholder:"Filtrelemek için bir değer seçin"},alert:{clear:"Temizle",selected:"Seçili",item:"Öğe"},pagination:{total:{range:" ",total:"Toplam",item:"Öğe"}},tableToolBar:{leftPin:"Sola sabitle",rightPin:"Sağa sabitle",noPin:"Sabitlemeyi kaldır",leftFixedTitle:"Sola sabitlendi",rightFixedTitle:"Sağa sabitlendi",noFixedTitle:"Sabitlenmedi",reset:"Sıfırla",columnDisplay:"Kolon Görünümü",columnSetting:"Ayarlar",fullScreen:"Tam Ekran",exitFullScreen:"Tam Ekrandan Çık",reload:"Yenile",density:"Kalınlık",densityDefault:"Varsayılan",densityLarger:"Büyük",densityMiddle:"Orta",densitySmall:"Küçük"},stepsForm:{next:"Sıradaki",prev:"Önceki",submit:"Gönder"},loginForm:{submitText:"Giriş Yap"},editableTable:{action:{save:"Kaydet",cancel:"Vazgeç",delete:"Sil",add:"foegje in rige gegevens ta"}},switch:{open:"açık",close:"kapatmak"}},Qm={moneySymbol:"₴",deleteThisLine:"Видатили рядок",copyThisLine:"Скопіювати рядок",form:{lightFilter:{more:"Ще",clear:"Очистити",confirm:"Ок",itemUnit:"Позиції"}},tableForm:{search:"Пошук",reset:"Очистити",submit:"Відправити",collapsed:"Розгорнути",expand:"Згорнути",inputPlaceholder:"Введіть значення",selectPlaceholder:"Оберіть значення"},alert:{clear:"Очистити",selected:"Обрано",item:"елементів"},pagination:{total:{range:" ",total:"з",item:"елементів"}},tableToolBar:{leftPin:"Закріпити зліва",rightPin:"Закріпити справа",noPin:"Відкріпити",leftFixedTitle:"Закріплено зліва",rightFixedTitle:"Закріплено справа",noFixedTitle:"Не закріплено",reset:"Скинути",columnDisplay:"Відображення стовпців",columnSetting:"Налаштування",fullScreen:"Повноекранний режим",exitFullScreen:"Вийти з повноекранного режиму",reload:"Оновити",density:"Розмір",densityDefault:"За замовчуванням",densityLarger:"Великий",densityMiddle:"Середній",densitySmall:"Стислий"},stepsForm:{next:"Наступний",prev:"Попередній",submit:"Завершити"},loginForm:{submitText:"Вхіх"},editableTable:{onlyOneLineEditor:"Тільки один рядок може бути редагований одночасно",action:{save:"Зберегти",cancel:"Відмінити",delete:"Видалити",add:"додати рядок"}},switch:{open:"Відкрито",close:"Закрито"}},eg={moneySymbol:"UZS",form:{lightFilter:{more:"Yana",clear:"Tozalash",confirm:"OK",itemUnit:"Pozitsiyalar"}},tableForm:{search:"Qidirish",reset:"Qayta tiklash",submit:"Yuborish",collapsed:"Yig‘ish",expand:"Kengaytirish",inputPlaceholder:"Qiymatni kiriting",selectPlaceholder:"Qiymatni tanlang"},alert:{clear:"Tozalash",selected:"Tanlangan",item:"elementlar"},pagination:{total:{range:" ",total:"dan",item:"elementlar"}},tableToolBar:{leftPin:"Chapga mahkamlash",rightPin:"O‘ngga mahkamlash",noPin:"Mahkamlashni olib tashlash",leftFixedTitle:"Chapga mahkamlangan",rightFixedTitle:"O‘ngga mahkamlangan",noFixedTitle:"Mahkamlashsiz",reset:"Qayta tiklash",columnDisplay:"Ustunni ko‘rsatish",columnSetting:"Sozlamalar",fullScreen:"To‘liq ekran",exitFullScreen:"To‘liq ekrandan chiqish",reload:"Yangilash",density:"O‘lcham",densityDefault:"Standart",densityLarger:"Katta",densityMiddle:"O‘rtacha",densitySmall:"Kichik"},stepsForm:{next:"Keyingi",prev:"Oldingi",submit:"Tugatish"},loginForm:{submitText:"Kirish"},editableTable:{action:{save:"Saqlash",cancel:"Bekor qilish",delete:"O‘chirish",add:"maʼlumotlar qatorini qo‘shish"}},switch:{open:"Ochish",close:"Yopish"}},tg={moneySymbol:"₫",form:{lightFilter:{more:"Nhiều hơn",clear:"Trong",confirm:"Xác nhận",itemUnit:"Mục"}},tableForm:{search:"Tìm kiếm",reset:"Làm lại",submit:"Gửi đi",collapsed:"Mở rộng",expand:"Thu gọn",inputPlaceholder:"nhập dữ liệu",selectPlaceholder:"Vui lòng chọn"},alert:{clear:"Xóa",selected:"đã chọn",item:"mục"},pagination:{total:{range:" ",total:"trên",item:"mặt hàng"}},tableToolBar:{leftPin:"Ghim trái",rightPin:"Ghim phải",noPin:"Bỏ ghim",leftFixedTitle:"Cố định trái",rightFixedTitle:"Cố định phải",noFixedTitle:"Chưa cố định",reset:"Làm lại",columnDisplay:"Cột hiển thị",columnSetting:"Cấu hình",fullScreen:"Chế độ toàn màn hình",exitFullScreen:"Thoát chế độ toàn màn hình",reload:"Làm mới",density:"Mật độ hiển thị",densityDefault:"Mặc định",densityLarger:"Mặc định",densityMiddle:"Trung bình",densitySmall:"Chật"},stepsForm:{next:"Sau",prev:"Trước",submit:"Kết thúc"},loginForm:{submitText:"Đăng nhập"},editableTable:{action:{save:"Cứu",cancel:"Hủy",delete:"Xóa",add:"thêm một hàng dữ liệu"}},switch:{open:"mở",close:"đóng"}},ng={moneySymbol:"¥",deleteThisLine:"删除此项",copyThisLine:"复制此项",form:{lightFilter:{more:"更多筛选",clear:"清除",confirm:"确认",itemUnit:"项"}},tableForm:{search:"查询",reset:"重置",submit:"提交",collapsed:"展开",expand:"收起",inputPlaceholder:"请输入",selectPlaceholder:"请选择"},alert:{clear:"取消选择",selected:"已选择",item:"项"},pagination:{total:{range:"第",total:"条/总共",item:"条"}},tableToolBar:{leftPin:"固定在列首",rightPin:"固定在列尾",noPin:"不固定",leftFixedTitle:"固定在左侧",rightFixedTitle:"固定在右侧",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列设置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"宽松",densityMiddle:"中等",densitySmall:"紧凑"},stepsForm:{next:"下一步",prev:"上一步",submit:"提交"},loginForm:{submitText:"登录"},editableTable:{onlyOneLineEditor:"只能同时编辑一行",action:{save:"保存",cancel:"取消",delete:"删除",add:"添加一行数据"}},switch:{open:"打开",close:"关闭"}},rg={moneySymbol:"HK$",deleteThisLine:"刪除此項",copyThisLine:"複製此項",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"搜尋",reset:"重設",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選取",selected:"已選取",item:"項"},pagination:{total:{range:"第",total:"項/總共",item:"項"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重設",columnDisplay:"列顯示",columnSetting:"列設定",fullScreen:"全螢幕",exitFullScreen:"退出全螢幕",reload:"重新整理",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},sg={moneySymbol:"NT$",deleteThisLine:"刪除此项",copyThisLine:"複製此项",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"查詢",reset:"重置",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選擇",selected:"已選擇",item:"項"},pagination:{total:{range:"第",total:"條/總共",item:"條"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列設置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},Pe=(e,t)=>({getMessage:(n,r)=>{const a=De(t,n.replace(/\[(\d+)\]/g,".$1").split("."))||"";if(a)return a;if(e.replace("_","-")==="zh-CN")return r;const o=On["zh-CN"];return o?o.getMessage(n,r):r},locale:e}),ag=Pe("mn_MN",Bm),ig=Pe("ar_EG",Fm),Yr=Pe("zh_CN",ng),og=Pe("en_US",Mm),lg=Pe("en_GB",Im),cg=Pe("vi_VN",tg),ug=Pe("it_IT",Lm),dg=Pe("ja_JP",_m),fg=Pe("es_ES",km),hg=Pe("ca_ES",Rm),mg=Pe("ru_RU",Wm),gg=Pe("sr_RS",Gm),pg=Pe("ms_MY",Vm),yg=Pe("zh_TW",sg),xg=Pe("zh_HK",rg),bg=Pe("fr_FR",Om),Sg=Pe("pt_BR",Ym),Cg=Pe("ko_KR",zm),wg=Pe("id_ID",Nm),jg=Pe("de_DE",Em),vg=Pe("fa_IR",Am),Tg=Pe("tr_TR",Xm),Fg=Pe("pl_PL",Um),Rg=Pe("hr_",Pm),$g=Pe("th_TH",Jm),Eg=Pe("cs_cz",$m),Ig=Pe("sk_SK",qm),Mg=Pe("he_IL",Dm),kg=Pe("uk_UA",Qm),Ag=Pe("uz_UZ",eg),Og=Pe("nl_NL",Hm),Dg=Pe("ro_RO",Km),Pg=Pe("sv_SE",Zm),On={"mn-MN":ag,"ar-EG":ig,"zh-CN":Yr,"en-US":og,"en-GB":lg,"vi-VN":cg,"it-IT":ug,"ja-JP":dg,"es-ES":fg,"ca-ES":hg,"ru-RU":mg,"sr-RS":gg,"ms-MY":pg,"zh-TW":yg,"zh-HK":xg,"fr-FR":bg,"pt-BR":Sg,"ko-KR":Cg,"id-ID":wg,"de-DE":jg,"fa-IR":vg,"tr-TR":Tg,"pl-PL":Fg,"hr-HR":Rg,"th-TH":$g,"cs-CZ":Eg,"sk-SK":Ig,"he-IL":Mg,"uk-UA":kg,"uz-UZ":Ag,"nl-NL":Og,"ro-RO":Dg,"sv-SE":Pg},Ng=Object.keys(On),Bu=e=>{const t=(e||"zh-CN").toLocaleLowerCase();return Ng.find(n=>n.toLocaleLowerCase().includes(t))};function mt(e,t){Lg(e)&&(e="100%");const n=_g(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)}function xs(e){return Math.min(1,Math.max(0,e))}function Lg(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function _g(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Vu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function bs(e){return Number(e)<=1?`${Number(e)*100}%`:e}function En(e){return e.length===1?"0"+e:String(e)}function zg(e,t,n){return{r:mt(e,255)*255,g:mt(t,255)*255,b:mt(n,255)*255}}function dl(e,t,n){e=mt(e,255),t=mt(t,255),n=mt(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0,o=0;const l=(r+a)/2;if(r===a)o=0,i=0;else{const u=r-a;switch(o=l>.5?u/(2-r-a):u/(r+a),r){case e:i=(t-n)/u+(t<n?6:0);break;case t:i=(n-e)/u+2;break;case n:i=(e-t)/u+4;break}i/=6}return{h:i,s:o,l}}function Ka(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Bg(e,t,n){let r,a,i;if(e=mt(e,360),t=mt(t,100),n=mt(n,100),t===0)a=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=Ka(l,o,e+1/3),a=Ka(l,o,e),i=Ka(l,o,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function fl(e,t,n){e=mt(e,255),t=mt(t,255),n=mt(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0;const o=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:u,v:o}}function Vg(e,t,n){e=mt(e,360)*6,t=mt(t,100),n=mt(n,100);const r=Math.floor(e),a=e-r,i=n*(1-t),o=n*(1-a*t),l=n*(1-(1-a)*t),u=r%6,m=[n,o,i,i,l,n][u],g=[l,n,n,o,i,i][u],f=[i,i,l,n,n,o][u];return{r:m*255,g:g*255,b:f*255}}function hl(e,t,n,r){const a=En(Math.round(e).toString(16)),i=En(Math.round(t).toString(16)),o=En(Math.round(n).toString(16));return r&&a.startsWith(a.charAt(1))&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))?a.charAt(0)+i.charAt(0)+o.charAt(0):a+i+o}function Hg(e,t,n,r,a){const i=En(Math.round(e).toString(16)),o=En(Math.round(t).toString(16)),l=En(Math.round(n).toString(16)),u=En(Yg(r));return a&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))&&l.startsWith(l.charAt(1))&&u.startsWith(u.charAt(1))?i.charAt(0)+o.charAt(0)+l.charAt(0)+u.charAt(0):i+o+l+u}function Ug(e,t,n,r){const a=e/100,i=t/100,o=n/100,l=r/100,u=255*(1-a)*(1-l),m=255*(1-i)*(1-l),g=255*(1-o)*(1-l);return{r:u,g:m,b:g}}function ml(e,t,n){let r=1-e/255,a=1-t/255,i=1-n/255,o=Math.min(r,a,i);return o===1?(r=0,a=0,i=0):(r=(r-o)/(1-o)*100,a=(a-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(a),y:Math.round(i),k:Math.round(o)}}function Yg(e){return Math.round(parseFloat(e)*255).toString(16)}function gl(e){return wt(e)/255}function wt(e){return parseInt(e,16)}function Kg(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const Ei={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Wg(e){let t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,l=!1;return typeof e=="string"&&(e=Zg(e)),typeof e=="object"&&(Ct(e.r)&&Ct(e.g)&&Ct(e.b)?(t=zg(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Ct(e.h)&&Ct(e.s)&&Ct(e.v)?(r=bs(e.s),a=bs(e.v),t=Vg(e.h,r,a),o=!0,l="hsv"):Ct(e.h)&&Ct(e.s)&&Ct(e.l)?(r=bs(e.s),i=bs(e.l),t=Bg(e.h,r,i),o=!0,l="hsl"):Ct(e.c)&&Ct(e.m)&&Ct(e.y)&&Ct(e.k)&&(t=Ug(e.c,e.m,e.y,e.k),o=!0,l="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Vu(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const qg="[-\\+]?\\d+%?",Gg="[-\\+]?\\d*\\.\\d+%?",gn="(?:"+Gg+")|(?:"+qg+")",Wa="[\\s|\\(]+("+gn+")[,|\\s]+("+gn+")[,|\\s]+("+gn+")\\s*\\)?",Ss="[\\s|\\(]+("+gn+")[,|\\s]+("+gn+")[,|\\s]+("+gn+")[,|\\s]+("+gn+")\\s*\\)?",jt={hex:/^[0-9a-fA-F]+$/,CSS_UNIT:new RegExp(gn),rgb:new RegExp("rgb"+Wa),rgba:new RegExp("rgba"+Ss),hsl:new RegExp("hsl"+Wa),hsla:new RegExp("hsla"+Ss),hsv:new RegExp("hsv"+Wa),hsva:new RegExp("hsva"+Ss),cmyk:new RegExp("cmyk"+Ss),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Zg(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(Ei[e])e=Ei[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n;if(typeof e=="string"&&e.length<=9&&(e.startsWith("#")||jt.hex.test(e))){if(n=jt.hex8.exec(e),n)return{r:wt(n[1]),g:wt(n[2]),b:wt(n[3]),a:gl(n[4]),format:t?"name":"hex8"};if(n=jt.hex6.exec(e),n)return{r:wt(n[1]),g:wt(n[2]),b:wt(n[3]),format:t?"name":"hex"};if(n=jt.hex4.exec(e),n)return{r:wt(n[1]+n[1]),g:wt(n[2]+n[2]),b:wt(n[3]+n[3]),a:gl(n[4]+n[4]),format:t?"name":"hex8"};if(n=jt.hex3.exec(e),n)return{r:wt(n[1]+n[1]),g:wt(n[2]+n[2]),b:wt(n[3]+n[3]),format:t?"name":"hex"}}return n=jt.rgb.exec(e),n?{r:n[1],g:n[2],b:n[3]}:(n=jt.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=jt.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=jt.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=jt.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=jt.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=jt.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function Ct(e){return typeof e=="number"?!Number.isNaN(e):jt.CSS_UNIT.test(e)}class lt{constructor(t="",n={}){if(t instanceof lt)return t;typeof t=="number"&&(t=Kg(t)),this.originalInput=t;const r=Wg(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,r,a;const i=t.r/255,o=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a}getAlpha(){return this.a}setAlpha(t){return this.a=Vu(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=fl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=fl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${a}%)`:`hsva(${n}, ${r}%, ${a}%, ${this.roundA})`}toHsl(){const t=dl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=dl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${a}%)`:`hsla(${n}, ${r}%, ${a}%, ${this.roundA})`}toHex(t=!1){return hl(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return Hg(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(mt(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(mt(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...ml(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=ml(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+hl(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(Ei))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const a=this.a<1&&this.a>=0;return!n&&a&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),t==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new lt(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=xs(n.l),new lt(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new lt(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=xs(n.l),new lt(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=xs(n.s),new lt(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=xs(n.s),new lt(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new lt(n)}mix(t,n=50){const r=this.toRgb(),a=new lt(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new lt(o)}analogous(t=6,n=30){const r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(new lt(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new lt(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s:a}=n;let{v:i}=n;const o=[],l=1/t;for(;t--;)o.push(new lt({h:r,s:a,v:i})),i=(i+l)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new lt({h:(n+72)%360,s:t.s,l:t.l}),new lt({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new lt(t).toRgb(),a=n.a+r.a*(1-n.a);return new lt({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,a=[this],i=360/t;for(let o=1;o<t;o++)a.push(new lt({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new lt(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}const vt=(e,t)=>new lt(e).setAlpha(t).toRgbString(),yn=c.theme,qa=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none","*, *::before, *::after":{boxSizing:"border-box"}}),Jg=e=>{let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},Xg=e=>{try{return Jg(JSON.stringify(e))}catch{return""}};function Je(e,t){let{token:n={},hashed:r}=d.useContext(Gt);const{token:a,hashId:i,theme:o}=c.theme.useToken(),{getPrefixCls:l,csp:u}=d.useContext(c.ConfigProvider.ConfigContext);n.layout||(n={...a}),n.proComponentsCls=n.proComponentsCls??`.${l("pro")}`,n.antCls=`.${l()}`;const m=d.useMemo(()=>Xg(n),[n]),g=[i,o.id,n.themeId,m].filter(Boolean).join("-"),f=d.useRef(""),h=d.useRef(0);f.current!==g&&(h.current+=1,f.current=g);const p=[e,g,h.current].filter(Boolean);return Bh({path:p,nonce:u==null?void 0:u.nonce,layer:{name:"antd-pro"}},()=>t(n)),{wrapSSR:S=>S,hashId:r?i:""}}const Qg=(e,t)=>{var a,i,o,l,u;const n={...e},r=vt(t.colorBgElevated,.6);return{bgLayout:`linear-gradient(${t.colorBgContainer}, ${t.colorBgLayout} 28%)`,colorTextAppListIcon:t.colorTextSecondary,appListIconHoverBgColor:(a=n==null?void 0:n.sider)==null?void 0:a.colorBgMenuItemSelected,colorBgAppListIconHover:vt(t.colorTextBase,.04),colorTextAppListIconHover:t.colorTextBase,...n,header:{colorBgHeader:r,colorBgScrollHeader:vt(t.colorBgElevated,.8),colorHeaderTitle:t.colorText,colorBgMenuItemHover:vt(t.colorTextBase,.03),colorBgMenuItemSelected:"transparent",colorBgMenuElevated:(((i=n==null?void 0:n.header)==null?void 0:i.colorBgHeader)??r)!==r?(o=n.header)==null?void 0:o.colorBgHeader:t.colorBgElevated,colorTextMenuSelected:vt(t.colorTextBase,.95),colorBgRightActionsItemHover:vt(t.colorTextBase,.03),colorTextRightActionsItem:t.colorTextTertiary,heightLayoutHeader:56,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextMenuActive:t.colorText,...n.header},sider:{paddingInlineLayoutMenu:8,paddingBlockLayoutMenu:0,colorBgCollapsedButton:t.colorBgElevated,colorTextCollapsedButtonHover:t.colorTextSecondary,colorTextCollapsedButton:vt(t.colorTextBase,.25),colorMenuBackground:"transparent",colorMenuItemDivider:vt(t.colorTextBase,.06),colorBgMenuItemHover:vt(t.colorTextBase,.03),colorBgMenuItemSelected:vt(t.colorTextBase,.04),colorTextMenuItemHover:t.colorText,colorTextMenuSelected:vt(t.colorTextBase,.95),colorTextMenuActive:t.colorText,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextSubMenuSelected:vt(t.colorTextBase,.95),...n.sider},pageContainer:{colorBgPageContainer:"transparent",paddingInlinePageContainerContent:((l=n.pageContainer)==null?void 0:l.paddingInlinePageContainerContent)||40,paddingBlockPageContainerContent:((u=n.pageContainer)==null?void 0:u.paddingBlockPageContainerContent)||32,colorBgPageContainerFixed:t.colorBgElevated,...n.pageContainer}}},ep=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t},tp=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Ga=()=>{var e,t;return!(typeof process<"u"&&(((e=process.env.NODE_ENV)==null?void 0:e.toUpperCase())==="TEST"||((t=process.env.NODE_ENV)==null?void 0:t.toUpperCase())==="DEV"))},Wt=d.createContext({intl:{...Yr,locale:"default"},valueTypeMap:{},hashed:!0,dark:!1,token:{...c.theme.getDesignToken(),proComponentsCls:".ant-pro",antCls:".ant",themeId:0},prefixCls:".ant-pro"}),{Consumer:vF}=Wt,np=()=>{const{cache:e}=_u();return d.useEffect(()=>()=>{e.clear()},[]),null},rp=e=>{var M,k;const{children:t,dark:n,valueTypeMap:r,autoClearCache:a=!1,token:i,prefixCls:o,intl:l}=e,{locale:u,getPrefixCls:m,...g}=d.useContext(c.ConfigProvider.ConfigContext),f=(k=(M=c.theme).useToken)==null?void 0:k.call(M),h=d.useContext(Wt),p=o?`.${o}`:`.${m()}-pro`,S="."+m(),y=`${p}`,w=d.useMemo(()=>Qg(i||{},f.token),[i,f.token]),v=d.useMemo(()=>{var I;const V=u==null?void 0:u.locale,_=Bu(V),A=l??(V&&((I=h.intl)==null?void 0:I.locale)==="default"?On[_]:h.intl||On[_]);return{...h,dark:n??h.dark,token:ep(h.token,f.token,{proComponentsCls:p,antCls:S,themeId:f.theme.id,layout:w}),intl:A||Yr}},[u==null?void 0:u.locale,h,n,f.token,f.theme.id,p,S,w,l]),x={...v.token||{},proComponentsCls:p},[C,j]=mh(f.theme,[f.token,x??{}],{salt:y,override:x,cssVar:{key:"pro"}}),b=d.useMemo(()=>!(e.hashed===!1||h.hashed===!1),[h.hashed,e.hashed]),T=d.useMemo(()=>e.hashed===!1||h.hashed===!1||Ga()===!1?"":f.hashId?f.hashId:j,[j,h.hashed,e.hashed]);d.useEffect(()=>{Re.locale((u==null?void 0:u.locale)||"zh-cn")},[u==null?void 0:u.locale]);const R=d.useMemo(()=>({...g.theme,hashId:T,hashed:b&&Ga()}),[g.theme,T,b,Ga()]),F=d.useMemo(()=>({...v,valueTypeMap:r||(v==null?void 0:v.valueTypeMap),token:x,theme:f.theme,hashed:b,hashId:T,prefixCls:o}),[v,r,C,f.theme,b,T,o]),E=d.useMemo(()=>s.jsx(c.ConfigProvider,{...g,theme:R,children:s.jsx(Wt.Provider,{value:F,children:s.jsxs(s.Fragment,{children:[a&&s.jsx(np,{}),t]})})}),[g,R,F,a,t]);return a?s.jsx(Tm,{value:{provider:()=>new Map},children:E}):E},Dn=e=>{const{needDeps:t,dark:n,token:r}=e,a=d.useContext(Wt),{locale:i,theme:o,...l}=d.useContext(c.ConfigProvider.ConfigContext);if(t&&a.hashId!==void 0&&Object.keys(e).sort().join("-")==="children-needDeps")return s.jsx(s.Fragment,{children:e.children});const g={...l,locale:i||Yh,theme:tp({...o,algorithm:n??a.dark?[o==null?void 0:o.algorithm,c.theme.darkAlgorithm].flat(1).filter(Boolean):o==null?void 0:o.algorithm})};return s.jsx(c.ConfigProvider,{...g,children:s.jsx(rp,{...e,token:r})})};function ke(){const{locale:e}=d.useContext(c.ConfigProvider.ConfigContext),{intl:t}=d.useContext(Wt);return t&&t.locale!=="default"?t:e!=null&&e.locale&&On[Bu(e.locale)]||Yr}Wt.displayName="ProProvider";const Gt=Wt,sp=e=>{const{componentCls:t,antCls:n}=e;return{[`${t}-actions`]:{boxSizing:"border-box",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,listStyle:"none",display:"flex",gap:e.marginXS,background:e.colorBgContainer,borderBlockStart:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,minHeight:42,"& > *":{alignItems:"center",justifyContent:"center",flex:1,display:"flex",cursor:"pointer",color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},"& > li > div":{flex:1,width:"100%",marginBlock:e.marginSM,marginInline:0,color:e.colorTextSecondary,textAlign:"center",a:{color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},div:{position:"relative",display:"block",minWidth:32,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimaryHover,transition:"color 0.3s"},[`a:not(${n}-btn),
36
+ > .anticon`]:{display:"inline-block",width:"100%",color:e.colorTextSecondary,lineHeight:"22px",transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},".anticon":{fontSize:e.cardActionIconSize,lineHeight:"22px"}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`}}}}};function ap(e){return Je("ProCardActions",t=>{const n={...t,componentCls:`.${e}`,cardActionIconSize:16};return[sp(n)]})}const ip=e=>{const{actions:t,prefixCls:n}=e,{wrapSSR:r,hashId:a}=ap(n);return Array.isArray(t)&&(t!=null&&t.length)?r(s.jsx("ul",{className:le(`${n}-actions`,a),children:t.map((i,o)=>s.jsx("li",{style:{width:`${100/t.length}%`,padding:0,margin:0},className:le(`${n}-actions-item`,a),children:i},`action-${o}`))})):r(s.jsx("ul",{className:le(`${n}-actions`,a),children:t}))};function ho(e,t){if(!t||!d.isValidElement(e))return e;if(e.type===d.Fragment){const r=d.Children.toArray(e.props.children).map((a,i)=>i===0?ho(a,t):a);return d.cloneElement(e,{},...r)}return d.cloneElement(e,{...e.props,autoFocus:t})}const op=e=>({[e.componentCls]:{boxSizing:"border-box",display:"flex",justifyContent:"space-between",paddingBlock:8,paddingInlineStart:8,paddingInlineEnd:8,borderBlockStart:`1px solid ${e.colorSplit}`}});function lp(e){return Je("DropdownFooter",t=>{const n={...t,componentCls:`.${e}`};return[op(n)]})}const cp=e=>{const t=ke(),{onClear:n,onConfirm:r,disabled:a,footerRender:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-core-dropdown-footer"),{wrapSSR:u,hashId:m}=lp(l),g=[s.jsx(c.Button,{style:{visibility:n?"visible":"hidden"},type:"link",size:"small",disabled:a,onClick:h=>{n&&n(h),h.stopPropagation()},children:t.getMessage("form.lightFilter.clear","清除")},"clear"),s.jsx(c.Button,{"data-type":"confirm",type:"primary",size:"small",onClick:r,disabled:a,children:t.getMessage("form.lightFilter.confirm","确认")},"confirm")];if(i===!1||(i==null?void 0:i(r,n))===!1)return null;const f=(i==null?void 0:i(r,n))||g;return u(s.jsx("div",{className:le(l,m),onClick:h=>h.target.getAttribute("data-type")!=="confirm"&&h.stopPropagation(),children:f}))};class up extends d.Component{constructor(){super(...arguments);ce(this,"state",{hasError:!1,errorInfo:""})}static getDerivedStateFromError(n){return console.warn("ErrorBoundary caught an error",n),{hasError:!0,errorInfo:n.message}}componentDidCatch(n,r){console.warn("ErrorBoundary caught an error",n,r)}render(){return this.state.hasError?s.jsx(c.Result,{status:"error",title:"Something went wrong.",extra:this.state.errorInfo}):this.props.children}}const dp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",gap:e.marginXXS,alignItems:"center",height:"30px",paddingBlock:0,paddingInline:8,fontSize:e.fontSize,lineHeight:"30px",borderRadius:e.borderRadius,cornerShape:"squircle",cursor:"pointer","&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{paddingBlock:0,paddingInline:8,[`&${e.componentCls}-allow-clear:hover:not(${e.componentCls}-disabled)`]:{[`${e.componentCls}-arrow`]:{display:"none"},[`${e.componentCls}-close`]:{display:"inline-flex"}}},[`${e.antCls}-select`]:{[`${e.antCls}-select-clear`]:{borderRadius:"50%"}},[`${e.antCls}-picker`]:{[`${e.antCls}-picker-clear`]:{borderRadius:"50%"}},"&-icon":{color:e.colorIcon,transition:"color 0.3s",fontSize:12,verticalAlign:"middle",[`&${e.componentCls}-close`]:{display:"none",fontSize:12,alignItems:"center",justifyContent:"center",color:e.colorTextPlaceholder,borderRadius:"50%"},"&:hover":{color:e.colorIconHover}},"&-disabled":{color:e.colorTextPlaceholder,cursor:"not-allowed",[`${e.componentCls}-icon`]:{color:e.colorTextPlaceholder}},"&-small":{height:"24px",paddingBlock:0,paddingInline:4,fontSize:e.fontSizeSM,lineHeight:"24px",[`&${e.componentCls}-active`]:{paddingBlock:0,paddingInline:8},[`${e.componentCls}-icon`]:{paddingBlock:0,paddingInline:0},[`${e.componentCls}-close`]:{marginBlockStart:"-2px",paddingBlock:4,paddingInline:4,fontSize:"6px"}},"&-outlined":{height:"32px",paddingBlock:0,paddingInline:8,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,"&-active":{backgroundColor:"none"}},"&-borderless":{height:"32px","&-active":{backgroundColor:e.colorBgTextHover}},"&-filled":{height:"32px",backgroundColor:e.colorBgTextHover,border:`${e.lineWidth}px solid transparent`,"&:hover":{border:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-underlined":{height:"32px",borderRadius:0,borderBottom:`${e.lineWidth}px solid ${e.colorSplit}`,"&:hover":{borderBottom:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-bordered&-small":{height:"24px",paddingBlock:0,paddingInline:8},"&-bordered&-active":{backgroundColor:e.colorBgContainer}}});function fp(e){return Je("FieldLabel",t=>{const n={...t,componentCls:`.${e}`};return[dp(n)]})}const hp=(e,t)=>{var k,V;const{label:n,onClear:r,value:a,disabled:i,onLabelClick:o,ellipsis:l,placeholder:u,className:m,formatter:g,variant:f,style:h,downIcon:p,allowClear:S=!0,valueMaxLength:y=41}=e,{componentSize:w}=((V=(k=c.ConfigProvider)==null?void 0:k.useConfig)==null?void 0:V.call(k))||{componentSize:"middle"},{getPrefixCls:v}=d.useContext(c.ConfigProvider.ConfigContext),x=v("pro-core-field-label"),{wrapSSR:C,hashId:j}=fp(x),b=ke(),T=d.useRef(null),R=d.useRef(null);d.useImperativeHandle(t,()=>({labelRef:R,clearRef:T}));const F=_=>_.every(A=>typeof A=="string")?_.join(","):_.map((A,I)=>{const $=I===_.length-1?"":",";return typeof A=="string"?s.jsxs("span",{children:[A,$]},I):s.jsxs("span",{style:{display:"flex"},children:[A,$]},I)}),E=_=>g?g(_):Array.isArray(_)?F(_):_,M=(_,A)=>{var I,$;if(A!=null&&A!==""&&(!Array.isArray(A)||A.length)){const D=_?s.jsxs("span",{onClick:()=>{o==null||o()},className:le(`${x}-text`,j),children:[_,": "]}):"",O=E(A);if(!l)return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center"},children:[D,E(A)]});const Z=(()=>{const L=Array.isArray(A)&&A.length>1,U=b.getMessage("form.lightFilter.itemUnit","项");return typeof O=="string"&&O.length>y&&L?`...${A.length}${U}`:""})();return s.jsxs("span",{title:typeof O=="string"?O:void 0,style:{display:"inline-flex",alignItems:"center"},children:[D,s.jsx("span",{style:{paddingInlineStart:4,display:"flex"},children:typeof O=="string"?($=(I=O==null?void 0:O.toString())==null?void 0:I.slice)==null?void 0:$.call(I,0,y):O}),Z]})}return _||u};return C(s.jsxs("span",{className:le(x,j,`${x}-${e.size??w??"middle"}`,{[`${x}-${f||"borderless"}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-disabled`]:i,[`${x}-${f}`]:f,[`${x}-allow-clear`]:S},m),style:h,ref:R,onClick:()=>{var _;(_=e==null?void 0:e.onClick)==null||_.call(e)},children:[M(n,a),(a||a===0)&&S&&s.jsx(de.CloseCircleFilled,{role:"button",title:b.getMessage("form.lightFilter.clear","清除"),className:le(`${x}-icon`,j,`${x}-close`),onClick:_=>{i||r==null||r(),_.stopPropagation()},ref:T}),p!==!1?p??s.jsx(de.DownOutlined,{className:le(`${x}-icon`,j,`${x}-arrow`)}):null]}))},Zt=d.forwardRef(hp),mp=e=>({[`${e.componentCls}-label`]:{cursor:"pointer"},[`${e.componentCls}-label-bordered`]:{display:"inline-flex",alignItems:"center",height:e.controlHeight,paddingBlock:0,paddingInline:e.paddingSM,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,boxSizing:"border-box"},[`${e.componentCls}-overlay`]:{minWidth:"200px",marginBlockStart:"4px"},[`${e.componentCls}-content`]:{paddingBlock:16,paddingInline:16}});function gp(e){return Je("FilterDropdown",t=>{const n={...t,componentCls:`.${e}`};return[mp(n)]})}const Hu=e=>{const{children:t,label:n,footer:r,open:a,onOpenChange:i,disabled:o,footerRender:l,placement:u,popoverProps:m}=e,{getPrefixCls:g}=d.useContext(c.ConfigProvider.ConfigContext),f=g("pro-core-field-dropdown"),{wrapSSR:h,hashId:p}=gp(f),S=d.useRef(null),y=d.useMemo(()=>{var w;return{container:{padding:0,...((w=m==null?void 0:m.styles)==null?void 0:w.container)||{}},...(m==null?void 0:m.styles)||{}}},[m==null?void 0:m.styles]);return h(s.jsx(c.Popover,{...m,placement:u,trigger:["click"],open:a||!1,onOpenChange:i,styles:y,content:s.jsxs("div",{ref:S,className:le(`${f}-overlay`,{[`${f}-overlay-${u}`]:u,hashId:p}),children:[s.jsx(c.ConfigProvider,{getPopupContainer:()=>S.current||document.body,children:s.jsx("div",{className:le(`${f}-content`,p),children:t})}),r&&s.jsx(cp,{disabled:o,footerRender:l,...r})]}),children:s.jsx("span",{className:le(`${f}-label`,p),children:n})}))},pp=e=>{const t=`${e.antCls}-progress-bg`;return{[e.componentCls]:{boxSizing:"border-box","&-multiple":{paddingBlockStart:6,paddingBlockEnd:12,paddingInline:8},"&-progress":{"&-success":{[t]:{backgroundColor:e.colorSuccess}},"&-error":{[t]:{backgroundColor:e.colorError}},"&-warning":{[t]:{backgroundColor:e.colorWarning}}},"&-rule":{display:"flex",alignItems:"center","&-icon":{"&-default":{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"22px","&-circle":{width:"6px",height:"6px",backgroundColor:e.colorTextSecondary,borderRadius:"4px"}},"&-loading":{color:e.colorPrimary},"&-error":{color:e.colorError},"&-success":{color:e.colorSuccess}},"&-text":{color:e.colorText}}}}};function yp(e){return Je("InlineErrorFormItem",t=>{const n={...t,componentCls:`.${e}`};return[pp(n)]})}const Uu={marginBlockStart:-5,marginBlockEnd:-5,marginInlineStart:0,marginInlineEnd:0},xp=({inputProps:e,input:t,extra:n,errorList:r,popoverProps:a})=>{var v,x;const[i,o]=d.useState(!1),[l,u]=d.useState({errors:[],warnings:[]}),{getPrefixCls:m}=d.useContext(c.ConfigProvider.ConfigContext),g=m(),f=c.theme.useToken(),{wrapSSR:h,hashId:p}=yp(`${g}-form-item-with-help`);d.useEffect(()=>{e.validateStatus!=="validating"&&u({errors:e.errors??[],warnings:e.warnings??[]})},[e.errors,e.warnings,e.validateStatus]);const S=e.validateStatus==="validating",y=(((v=l.errors)==null?void 0:v.length)??0)+(((x=l.warnings)==null?void 0:x.length)??0)>=1,w=()=>{var C,j;return s.jsxs(s.Fragment,{children:[(C=l.errors)==null?void 0:C.map((b,T)=>s.jsx("div",{className:le(`${g}-form-item-explain-error`,p),children:b},`error-${T}`)),(j=l.warnings)==null?void 0:j.map((b,T)=>s.jsx("div",{className:le(`${g}-form-item-explain-warning`,p),children:b},`warning-${T}`))]})};return s.jsx(c.Popover,{open:y?i:!1,onOpenChange:C=>{C!==i&&o(C)},trigger:(a==null?void 0:a.trigger)||["click"],placement:(a==null?void 0:a.placement)||"topLeft",getPopupContainer:a==null?void 0:a.getPopupContainer,getTooltipContainer:a==null?void 0:a.getTooltipContainer,content:h(s.jsx("div",{className:le(`${g}-form-item`,p,f.hashId),style:{margin:0,padding:0},children:s.jsxs("div",{className:le(`${g}-form-item-with-help`,p,f.hashId),children:[S?s.jsx(de.LoadingOutlined,{}):null,y?w():r]})})),...a,children:s.jsxs(s.Fragment,{children:[t,n]})},"popover")},bp=({rules:e,name:t,children:n,popoverProps:r,...a})=>s.jsx(c.Form.Item,{name:t,rules:e,hasFeedback:!1,shouldUpdate:(i,o)=>{if(i===o)return!1;const l=[t].flat(1);l.length>1&&l.pop();try{return JSON.stringify(De(i,l))!==JSON.stringify(De(o,l))}catch{return!0}},_internalItemRender:{mark:"pro_table_render",render:(i,o)=>s.jsx(xp,{inputProps:i,popoverProps:r,...o})},...a,style:{...Uu,...a==null?void 0:a.style},children:n}),Sp=e=>{const{errorType:t,rules:n,name:r,popoverProps:a,children:i,...o}=e;return r&&(n!=null&&n.length)&&t==="popover"?s.jsx(bp,{name:r,rules:n,popoverProps:a,...o,children:i}):s.jsx(c.Form.Item,{rules:n,shouldUpdate:r?(l,u)=>{if(l===u)return!1;const m=[r].flat(1);m.length>1&&m.pop();try{return JSON.stringify(De(l,m))!==JSON.stringify(De(u,m))}catch{return!0}}:void 0,...o,style:{...Uu,...o.style},name:r,children:i})},Cp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",alignItems:"center",maxWidth:"100%","&-icon":{display:"block",marginInlineStart:"4px",cursor:"pointer","&:hover":{color:e.colorPrimary}},"&-title":{display:"inline-flex",flex:"1"},"&-subtitle ":{marginInlineStart:8,color:e.colorTextSecondary,fontWeight:"normal",fontSize:e.fontSize,whiteSpace:"nowrap"},"&-title-ellipsis":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",wordBreak:"keep-all"}}});function wp(e){return Je("LabelIconTip",t=>{const n={...t,componentCls:`.${e}`};return[Cp(n)]})}const lr=d.memo(e=>{const{label:t,tooltip:n,ellipsis:r,subTitle:a}=e,{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-core-label-tip"),{wrapSSR:l,hashId:u}=wp(o);if(!n&&!a)return s.jsx(s.Fragment,{children:t});const m=typeof n=="string"||d.isValidElement(n)?{title:n}:n,g=(m==null?void 0:m.icon)||s.jsx(de.InfoCircleOutlined,{});return l(s.jsxs("div",{className:le(o,u),onMouseDown:f=>f.stopPropagation(),onMouseLeave:f=>f.stopPropagation(),onMouseMove:f=>f.stopPropagation(),children:[s.jsx("div",{className:le(`${o}-title`,u,{[`${o}-title-ellipsis`]:r}),children:t}),a&&s.jsx("div",{className:le(`${o}-subtitle`,u),children:a}),n&&s.jsx(c.Tooltip,{...m,children:s.jsx("span",{className:le(`${o}-icon`,u),children:g})})]}))}),Jr=d.createContext({});var _s={exports:{}},jp=_s.exports,pl;function vp(){return pl||(pl=1,(function(e,t){(function(n,r){e.exports=r()})(jp,(function(){var n="month",r="quarter";return function(a,i){var o=i.prototype;o.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var l=o.add;o.add=function(m,g){return m=Number(m),this.$utils().p(g)===r?this.add(3*m,n):l.bind(this)(m,g)};var u=o.startOf;o.startOf=function(m,g){var f=this.$utils(),h=!!f.u(g)||g;if(f.p(m)===r){var p=this.quarter()-1;return h?this.month(3*p).startOf(n).startOf("day"):this.month(3*p+2).endOf(n).endOf("day")}return u.bind(this)(m,g)}}}))})(_s)),_s.exports}var Tp=vp();const Fp=qt(Tp),kt=e=>e==null;Re.extend(Fp);const mo={time:"HH:mm:ss",timeRange:"HH:mm:ss",date:"YYYY-MM-DD",dateWeek:"YYYY-wo",dateMonth:"YYYY-MM",dateQuarter:"YYYY-[Q]Q",dateYear:"YYYY",dateRange:"YYYY-MM-DD",dateTime:"YYYY-MM-DD HH:mm:ss",dateTimeRange:"YYYY-MM-DD HH:mm:ss"};function yl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rp(e){if(yl(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(yl(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}const Ii=e=>!!(e!=null&&e._isAMomentObject),xl=(e,t,n)=>{if(!t)return e;if(Re.isDayjs(e)||Ii(e)){if(t==="number")return e.valueOf();if(t==="string")return e.format(mo[n]||"YYYY-MM-DD HH:mm:ss");if(typeof t=="string"&&t!=="string")return e.format(t);if(typeof t=="function")return t(e,n)}return e},Mi=(e,t,n,r,a)=>{const i={};return typeof window>"u"||typeof e!="object"||kt(e)||e instanceof Blob||Array.isArray(e)?e:(Object.keys(e).forEach(o=>{const l=a?[a,o].flat(1):[o],u=De(n,l)||"text";let m="text",g;typeof u=="string"?m=u:(m=u.valueType,g=u.dateFormat);const f=e[o];if(kt(f)&&r||r&&f==="")return;if(Rp(f)&&!Array.isArray(f)&&!Re.isDayjs(f)&&!Ii(f)){i[o]=Mi(f,t,n,r,l);return}const h=t??"string";let p;if(h==="number"||h===!1||typeof h=="function"?p=h:h==="string"?p=g||mo[m]:p=h,Array.isArray(f)){i[o]=f.map((S,y)=>Re.isDayjs(S)||Ii(S)?xl(S,p===void 0&&h==="string"?"string":p,m):Mi(S,t,n,r,[o,`${y}`].flat(1)));return}i[o]=xl(f,p,m)}),i)},bl=(e,t)=>typeof t=="function"?t(Re(e)):Re(e).format(t),$p=(e,t)=>{const[n,r]=Array.isArray(e)?e:[];let a,i;Array.isArray(t)?(a=t[0],i=t[1]):typeof t=="object"&&t.type==="mask"?(a=t.format,i=t.format):(a=t,i=t);const o=n?bl(n,a):"",l=r?bl(r,i):"";return o&&l?`${o} ~ ${l}`:""};function It(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}const Ep=e=>{var t;return!!((t=e==null?void 0:e.valueType)!=null&&t.toString().startsWith("date")||(e==null?void 0:e.valueType)==="select"||e!=null&&e.valueEnum)},Ip=e=>{var t;return((t=e.ellipsis)==null?void 0:t.showTitle)===!1?!1:e.ellipsis},Sl=e=>e==null?"":String(e).trimEnd(),Mp=e=>d.isValidElement(e),kp=(e,t,n,r)=>{const a=Ip(t);if(!a)return!1;const i=Ep(t),o=Mp(r);if((i||o)&&(t==null?void 0:t.tooltip)!==!1){const l=s.jsx("div",{className:"pro-table-tooltip-text",children:e});return It(a)&&It(a.tooltip)?{tooltip:{title:l,...a.tooltip}}:{tooltip:l}}return n?It(a)&&It(a.tooltip)?{tooltip:{title:n,...a.tooltip}}:{tooltip:n}:!1},Ap=(e,t,n,r)=>{if(!t.copyable&&!t.ellipsis)return e;const a=Sl(n),i=r!==void 0?Sl(r):a,o=kp(e,t,a,n);return t.copyable?s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"},children:[s.jsx(c.Typography.Text,{style:{flex:1,minWidth:0,margin:0,padding:0},title:"",ellipsis:o,children:e}),i?s.jsx("span",{style:{flex:"none",userSelect:"none"},children:s.jsx(c.Typography.Text,{style:{margin:0,padding:0},copyable:{text:i,tooltips:["",""]}})}):null]}):s.jsx(c.Typography.Text,{style:{width:"100%",margin:0,padding:0},title:"",ellipsis:o,children:e})};function xt(e,...t){return typeof e=="function"?e(...t):e}const ki=(e,t,n)=>t===void 0?e:xt(e,t,n),we=e=>{const t=d.useRef(null);return t.current=e,d.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])};function go(e,t){const n=we(e),r=d.useRef(),a=d.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i=d.useCallback(async(...o)=>t===0||t===void 0?n(...o):(a(),new Promise(l=>{r.current=setTimeout(async()=>{l(await n(...o))},t)})),[n,a,t]);return d.useEffect(()=>a,[a]),{run:i,cancel:a}}const po=e=>{const t=d.useRef(e);return t.current=e,t};function Op(e,t=100,n){const[r,a]=d.useState(e),i=po(e);return d.useEffect(()=>{const o=setTimeout(()=>{a(i.current)},t);return()=>clearTimeout(o)},n?[t,...n]:void 0),r}function xn(e,t,n){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,a,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(!xn(e[a],t[a],n))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;for(a of e.entries())if(!xn(a[1],t.get(a[0]),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=r;a--!==0;){const o=i[a];if(!(n!=null&&n.includes(o))&&!(o==="_owner"&&e.$$typeof)&&!xn(e[o],t[o],n))return!1}return!0}return e!==e&&t!==t}const Dp=(e,t,n)=>xn(e,t,n);function yo(e,t){const n=d.useRef();return Dp(e,n.current,t)||(n.current=e),n.current}function nr(e,t,n){d.useEffect(e,yo(t||[],n))}function Yu(e,t,n,r){const a=go(async()=>{e()},r||16);d.useEffect(()=>{a.run()},yo(t||[],n))}function gt(e,t){return d.useMemo(e,yo(t))}const Pp=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,xo=()=>typeof process<"u"&&process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Pp;let Cl=0;function Np(e){const t=d.useRef(null),[n]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():(Cl+=1,Cl.toString())),r=async()=>{var l;(l=t.current)==null||l.abort();const o=new AbortController;t.current=o;try{return e.request?await e.request(e.params,o.signal):void 0}catch(u){if(u.name==="AbortError")return;throw u}},{data:a,isValidating:i}=zu(e.request?[n,e.params]:null,r,{revalidateOnFocus:!1,shouldRetryOnError:!1,onError:()=>{}});return e.request?[a,i]:[void 0,!1]}const _r=e=>{const t=d.useRef();return d.useEffect(()=>{t.current=e}),t.current};function Lp(){const[,e]=d.useState(!0);return d.useCallback(()=>e(n=>!n),[])}function _p(e,t){const n=d.useMemo(()=>{const r={current:t};return new Proxy(r,{set(a,i,o){return Object.is(a[i],o)||(a[i]=o,e(n)),!0}})},[]);return n}function zp(e){const t=Lp();return _p(t,e)}const Bp=e=>{let t=!1;return(typeof e=="string"&&e.startsWith("date")&&!e.endsWith("Range")||e==="select"||e==="time")&&(t=!0),t},Ku=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t};let wl=0,Vp=(e=21)=>{if(typeof window>"u"||!window.crypto)return(wl+=1).toFixed(0);let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const Kr=()=>{var e;return(e=window==null?void 0:window.crypto)!=null&&e.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Vp()},Wu=e=>{if(e&&e!==!0)return e},ht=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Hp=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};var zs={exports:{}},Up=zs.exports,jl;function Yp(){return jl||(jl=1,(function(e,t){(function(n,r){e.exports=r()})(Up,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,i=/\d\d/,o=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,u={},m=function(w){return(w=+w)+(w>68?1900:2e3)},g=function(w){return function(v){this[w]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(w){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),C=60*x[1]+(+x[2]||0);return C===0?0:x[0]==="+"?-C:C})(w)}],h=function(w){var v=u[w];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(w,v){var x,C=u.meridiem;if(C){for(var j=1;j<=24;j+=1)if(w.indexOf(C(j,0,v))>-1){x=j>12;break}}else x=w===(v?"pm":"PM");return x},S={A:[l,function(w){this.afternoon=p(w,!1)}],a:[l,function(w){this.afternoon=p(w,!0)}],Q:[a,function(w){this.month=3*(w-1)+1}],S:[a,function(w){this.milliseconds=100*+w}],SS:[i,function(w){this.milliseconds=10*+w}],SSS:[/\d{3}/,function(w){this.milliseconds=+w}],s:[o,g("seconds")],ss:[o,g("seconds")],m:[o,g("minutes")],mm:[o,g("minutes")],H:[o,g("hours")],h:[o,g("hours")],HH:[o,g("hours")],hh:[o,g("hours")],D:[o,g("day")],DD:[i,g("day")],Do:[l,function(w){var v=u.ordinal,x=w.match(/\d+/);if(this.day=x[0],v)for(var C=1;C<=31;C+=1)v(C).replace(/\[|\]/g,"")===w&&(this.day=C)}],w:[o,g("week")],ww:[i,g("week")],M:[o,g("month")],MM:[i,g("month")],MMM:[l,function(w){var v=h("months"),x=(h("monthsShort")||v.map((function(C){return C.slice(0,3)}))).indexOf(w)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[l,function(w){var v=h("months").indexOf(w)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,g("year")],YY:[i,function(w){this.year=m(w)}],YYYY:[/\d{4}/,g("year")],Z:f,ZZ:f};function y(w){var v,x;v=w,x=u&&u.formats;for(var C=(w=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,k,V){var _=V&&V.toUpperCase();return k||x[V]||n[V]||x[_].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,I,$){return I||$.slice(1)}))}))).match(r),j=C.length,b=0;b<j;b+=1){var T=C[b],R=S[T],F=R&&R[0],E=R&&R[1];C[b]=E?{regex:F,parser:E}:T.replace(/^\[|\]$/g,"")}return function(M){for(var k={},V=0,_=0;V<j;V+=1){var A=C[V];if(typeof A=="string")_+=A.length;else{var I=A.regex,$=A.parser,D=M.slice(_),O=I.exec(D)[0];$.call(k,O),M=M.replace(O,"")}}return(function(z){var Z=z.afternoon;if(Z!==void 0){var L=z.hours;Z?L<12&&(z.hours+=12):L===12&&(z.hours=0),delete z.afternoon}})(k),k}}return function(w,v,x){x.p.customParseFormat=!0,w&&w.parseTwoDigitYear&&(m=w.parseTwoDigitYear);var C=v.prototype,j=C.parse;C.parse=function(b){var T=b.date,R=b.utc,F=b.args;this.$u=R;var E=F[1];if(typeof E=="string"){var M=F[2]===!0,k=F[3]===!0,V=M||k,_=F[2];k&&(_=F[2]),u=this.$locale(),!M&&_&&(u=x.Ls[_]),this.$d=(function(D,O,z,Z){try{if(["x","X"].indexOf(O)>-1)return new Date((O==="X"?1e3:1)*D);var L=y(O)(D),U=L.year,J=L.month,G=L.day,H=L.hours,B=L.minutes,W=L.seconds,N=L.milliseconds,q=L.zone,ee=L.week,ne=new Date,X=G||(U||J?1:ne.getDate()),ae=U||ne.getFullYear(),oe=0;U&&!J||(oe=J>0?J-1:ne.getMonth());var ue,ge=H||0,me=B||0,he=W||0,Q=N||0;return q?new Date(Date.UTC(ae,oe,X,ge,me,he,Q+60*q.offset*1e3)):z?new Date(Date.UTC(ae,oe,X,ge,me,he,Q)):(ue=new Date(ae,oe,X,ge,me,he,Q),ee&&(ue=Z(ue).week(ee).toDate()),ue)}catch{return new Date("")}})(T,E,R,x),this.init(),_&&_!==!0&&(this.$L=this.locale(_).$L),V&&T!=this.format(E)&&(this.$d=new Date("")),u={}}else if(E instanceof Array)for(var A=E.length,I=1;I<=A;I+=1){F[1]=E[I-1];var $=x.apply(this,F);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===A&&(this.$d=new Date(""))}else j.call(this,b)}}}))})(zs)),zs.exports}var Kp=Yp();const Wp=qt(Kp);Re.extend(Wp);const vl=e=>!!(e!=null&&e._isAMomentObject),mr=(e,t)=>kt(e)||Re.isDayjs(e)||vl(e)?vl(e)?Re(e):e:Array.isArray(e)?e.map(n=>mr(n,t)):typeof e=="number"?Re(e):Re(e,t),qp=["colon","dependencies","extra","getValueFromEvent","getValueProps","hasFeedback","help","htmlFor","initialValue","noStyle","label","labelAlign","labelCol","name","preserve","normalize","required","rules","shouldUpdate","trigger","validateFirst","validateStatus","validateTrigger","valuePropName","wrapperCol","hidden","validateDebounce","addonBefore","addonAfter","addonWarpStyle"];function Gp(e){const t={};return qp.forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t}const Zp="valueType request formItemRender render text formItemProps valueEnum",Jp="fieldProps isDefaultDom groupProps contentRender submitterProps submitter";function At(e,t=!1){const n=`${Zp} ${Jp}`.split(/[\s\n]+/),r={};return Object.keys(e||{}).forEach(a=>{n.includes(a)&&!t||(r[a]=e[a])}),r}function Xp(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const Qp=({color:e,children:t})=>s.jsx(c.Badge,{color:e,text:t}),rn=e=>Xp(e)==="map"?e:new Map(Object.entries(e||{})),ey={Success:({children:e})=>s.jsx(c.Badge,{status:"success",text:e}),Error:({children:e})=>s.jsx(c.Badge,{status:"error",text:e}),Default:({children:e})=>s.jsx(c.Badge,{status:"default",text:e}),Processing:({children:e})=>s.jsx(c.Badge,{status:"processing",text:e}),Warning:({children:e})=>s.jsx(c.Badge,{status:"warning",text:e}),success:({children:e})=>s.jsx(c.Badge,{status:"success",text:e}),error:({children:e})=>s.jsx(c.Badge,{status:"error",text:e}),default:({children:e})=>s.jsx(c.Badge,{status:"default",text:e}),processing:({children:e})=>s.jsx(c.Badge,{status:"processing",text:e}),warning:({children:e})=>s.jsx(c.Badge,{status:"warning",text:e})},Ln=(e,t,n)=>{if(Array.isArray(e))return s.jsx(c.Space,{separator:",",size:2,wrap:!0,children:e.map((u,m)=>Ln(u,t,m))},n);const r=rn(t);if(!r.has(e)&&!r.has(`${e}`))return(e==null?void 0:e.label)||e;const a=r.get(e)||r.get(`${e}`);if(!a)return s.jsx(d.Fragment,{children:(e==null?void 0:e.label)||e},n);const{status:i,color:o}=a,l=ey[i||"Init"];return l?s.jsx(l,{children:a.text},n):o?s.jsx(Qp,{color:o,children:a.text},n):s.jsx(d.Fragment,{children:a.text||a},n)};var Cs={exports:{}},Tl;function ty(){return Tl||(Tl=1,(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=v();r.configure=v,r.stringify=r,r.default=r,t.stringify=r,t.configure=v,e.exports=r;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function i(x){return x.length<5e3&&!a.test(x)?`"${x}"`:JSON.stringify(x)}function o(x,C){if(x.length>200||C)return x.sort(C);for(let j=1;j<x.length;j++){const b=x[j];let T=j;for(;T!==0&&x[T-1]>b;)x[T]=x[T-1],T--;x[T]=b}return x}const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(x){return l.call(x)!==void 0&&x.length!==0}function m(x,C,j){x.length<j&&(j=x.length);const b=C===","?"":" ";let T=`"0":${b}${x[0]}`;for(let R=1;R<j;R++)T+=`${C}"${R}":${b}${x[R]}`;return T}function g(x){if(n.call(x,"circularValue")){const C=x.circularValue;if(typeof C=="string")return`"${C}"`;if(C==null)return C;if(C===Error||C===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(x){let C;if(n.call(x,"deterministic")&&(C=x.deterministic,typeof C!="boolean"&&typeof C!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return C===void 0?!0:C}function h(x,C){let j;if(n.call(x,C)&&(j=x[C],typeof j!="boolean"))throw new TypeError(`The "${C}" argument must be of type boolean`);return j===void 0?!0:j}function p(x,C){let j;if(n.call(x,C)){if(j=x[C],typeof j!="number")throw new TypeError(`The "${C}" argument must be of type number`);if(!Number.isInteger(j))throw new TypeError(`The "${C}" argument must be an integer`);if(j<1)throw new RangeError(`The "${C}" argument must be >= 1`)}return j===void 0?1/0:j}function S(x){return x===1?"1 item":`${x} items`}function y(x){const C=new Set;for(const j of x)(typeof j=="string"||typeof j=="number")&&C.add(String(j));return C}function w(x){if(n.call(x,"strict")){const C=x.strict;if(typeof C!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(C)return j=>{let b=`Object can not safely be stringified. Received type ${typeof j}`;throw typeof j!="function"&&(b+=` (${j.toString()})`),new Error(b)}}}function v(x){x={...x};const C=w(x);C&&(x.bigint===void 0&&(x.bigint=!1),"circularValue"in x||(x.circularValue=Error));const j=g(x),b=h(x,"bigint"),T=f(x),R=typeof T=="function"?T:void 0,F=p(x,"maximumDepth"),E=p(x,"maximumBreadth");function M(I,$,D,O,z,Z){let L=$[I];switch(typeof L=="object"&&L!==null&&typeof L.toJSON=="function"&&(L=L.toJSON(I)),L=O.call($,I,L),typeof L){case"string":return i(L);case"object":{if(L===null)return"null";if(D.indexOf(L)!==-1)return j;let U="",J=",";const G=Z;if(Array.isArray(L)){if(L.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push(L),z!==""&&(Z+=z,U+=`
37
+ ${Z}`,J=`,
38
+ ${Z}`);const ee=Math.min(L.length,E);let ne=0;for(;ne<ee-1;ne++){const ae=M(String(ne),L,D,O,z,Z);U+=ae!==void 0?ae:"null",U+=J}const X=M(String(ne),L,D,O,z,Z);if(U+=X!==void 0?X:"null",L.length-1>E){const ae=L.length-E-1;U+=`${J}"... ${S(ae)} not stringified"`}return z!==""&&(U+=`
39
+ ${G}`),D.pop(),`[${U}]`}let H=Object.keys(L);const B=H.length;if(B===0)return"{}";if(F<D.length+1)return'"[Object]"';let W="",N="";z!==""&&(Z+=z,J=`,
40
+ ${Z}`,W=" ");const q=Math.min(B,E);T&&!u(L)&&(H=o(H,R)),D.push(L);for(let ee=0;ee<q;ee++){const ne=H[ee],X=M(ne,L,D,O,z,Z);X!==void 0&&(U+=`${N}${i(ne)}:${W}${X}`,N=J)}if(B>E){const ee=B-E;U+=`${N}"...":${W}"${S(ee)} not stringified"`,N=J}return z!==""&&N.length>1&&(U=`
41
+ ${Z}${U}
42
+ ${G}`),D.pop(),`{${U}}`}case"number":return isFinite(L)?String(L):C?C(L):"null";case"boolean":return L===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(L);default:return C?C(L):void 0}}function k(I,$,D,O,z,Z){switch(typeof $=="object"&&$!==null&&typeof $.toJSON=="function"&&($=$.toJSON(I)),typeof $){case"string":return i($);case"object":{if($===null)return"null";if(D.indexOf($)!==-1)return j;const L=Z;let U="",J=",";if(Array.isArray($)){if($.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push($),z!==""&&(Z+=z,U+=`
43
+ ${Z}`,J=`,
44
+ ${Z}`);const B=Math.min($.length,E);let W=0;for(;W<B-1;W++){const q=k(String(W),$[W],D,O,z,Z);U+=q!==void 0?q:"null",U+=J}const N=k(String(W),$[W],D,O,z,Z);if(U+=N!==void 0?N:"null",$.length-1>E){const q=$.length-E-1;U+=`${J}"... ${S(q)} not stringified"`}return z!==""&&(U+=`
45
+ ${L}`),D.pop(),`[${U}]`}D.push($);let G="";z!==""&&(Z+=z,J=`,
46
+ ${Z}`,G=" ");let H="";for(const B of O){const W=k(B,$[B],D,O,z,Z);W!==void 0&&(U+=`${H}${i(B)}:${G}${W}`,H=J)}return z!==""&&H.length>1&&(U=`
47
+ ${Z}${U}
48
+ ${L}`),D.pop(),`{${U}}`}case"number":return isFinite($)?String($):C?C($):"null";case"boolean":return $===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String($);default:return C?C($):void 0}}function V(I,$,D,O,z){switch(typeof $){case"string":return i($);case"object":{if($===null)return"null";if(typeof $.toJSON=="function"){if($=$.toJSON(I),typeof $!="object")return V(I,$,D,O,z);if($===null)return"null"}if(D.indexOf($)!==-1)return j;const Z=z;if(Array.isArray($)){if($.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push($),z+=O;let W=`
49
+ ${z}`;const N=`,
50
+ ${z}`,q=Math.min($.length,E);let ee=0;for(;ee<q-1;ee++){const X=V(String(ee),$[ee],D,O,z);W+=X!==void 0?X:"null",W+=N}const ne=V(String(ee),$[ee],D,O,z);if(W+=ne!==void 0?ne:"null",$.length-1>E){const X=$.length-E-1;W+=`${N}"... ${S(X)} not stringified"`}return W+=`
51
+ ${Z}`,D.pop(),`[${W}]`}let L=Object.keys($);const U=L.length;if(U===0)return"{}";if(F<D.length+1)return'"[Object]"';z+=O;const J=`,
52
+ ${z}`;let G="",H="",B=Math.min(U,E);u($)&&(G+=m($,J,E),L=L.slice($.length),B-=$.length,H=J),T&&(L=o(L,R)),D.push($);for(let W=0;W<B;W++){const N=L[W],q=V(N,$[N],D,O,z);q!==void 0&&(G+=`${H}${i(N)}: ${q}`,H=J)}if(U>E){const W=U-E;G+=`${H}"...": "${S(W)} not stringified"`,H=J}return H!==""&&(G=`
53
+ ${z}${G}
54
+ ${Z}`),D.pop(),`{${G}}`}case"number":return isFinite($)?String($):C?C($):"null";case"boolean":return $===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String($);default:return C?C($):void 0}}function _(I,$,D){switch(typeof $){case"string":return i($);case"object":{if($===null)return"null";if(typeof $.toJSON=="function"){if($=$.toJSON(I),typeof $!="object")return _(I,$,D);if($===null)return"null"}if(D.indexOf($)!==-1)return j;let O="";const z=$.length!==void 0;if(z&&Array.isArray($)){if($.length===0)return"[]";if(F<D.length+1)return'"[Array]"';D.push($);const G=Math.min($.length,E);let H=0;for(;H<G-1;H++){const W=_(String(H),$[H],D);O+=W!==void 0?W:"null",O+=","}const B=_(String(H),$[H],D);if(O+=B!==void 0?B:"null",$.length-1>E){const W=$.length-E-1;O+=`,"... ${S(W)} not stringified"`}return D.pop(),`[${O}]`}let Z=Object.keys($);const L=Z.length;if(L===0)return"{}";if(F<D.length+1)return'"[Object]"';let U="",J=Math.min(L,E);z&&u($)&&(O+=m($,",",E),Z=Z.slice($.length),J-=$.length,U=","),T&&(Z=o(Z,R)),D.push($);for(let G=0;G<J;G++){const H=Z[G],B=_(H,$[H],D);B!==void 0&&(O+=`${U}${i(H)}:${B}`,U=",")}if(L>E){const G=L-E;O+=`${U}"...":"${S(G)} not stringified"`}return D.pop(),`{${O}}`}case"number":return isFinite($)?String($):C?C($):"null";case"boolean":return $===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String($);default:return C?C($):void 0}}function A(I,$,D){if(arguments.length>1){let O="";if(typeof D=="number"?O=" ".repeat(Math.min(D,10)):typeof D=="string"&&(O=D.slice(0,10)),$!=null){if(typeof $=="function")return M("",{"":I},[],$,O,"");if(Array.isArray($))return k("",I,[],y($),O,"")}if(O.length!==0)return V("",I,[],O,"")}return _("",I,[])}return A}})(Cs,Cs.exports)),Cs.exports}var ny=ty();const ry=qt(ny),sy=ry.configure,pn=sy({bigint:!0,circularValue:"Magic circle!",deterministic:!1,maximumDepth:4});var qu=typeof global=="object"&&global&&global.Object===Object&&global,ay=typeof self=="object"&&self&&self.Object===Object&&self,Jt=qu||ay||Function("return this")(),Sn=Jt.Symbol,Gu=Object.prototype,iy=Gu.hasOwnProperty,oy=Gu.toString,Rr=Sn?Sn.toStringTag:void 0;function ly(e){var t=iy.call(e,Rr),n=e[Rr];try{e[Rr]=void 0;var r=!0}catch{}var a=oy.call(e);return r&&(t?e[Rr]=n:delete e[Rr]),a}var cy=Object.prototype,uy=cy.toString;function dy(e){return uy.call(e)}var fy="[object Null]",hy="[object Undefined]",Fl=Sn?Sn.toStringTag:void 0;function gr(e){return e==null?e===void 0?hy:fy:Fl&&Fl in Object(e)?ly(e):dy(e)}function tn(e){return e!=null&&typeof e=="object"}var Cn=Array.isArray;function Zu(e){return e}var my="[object AsyncFunction]",gy="[object Function]",py="[object GeneratorFunction]",yy="[object Proxy]";function bo(e){if(!It(e))return!1;var t=gr(e);return t==gy||t==py||t==my||t==yy}var Za=Jt["__core-js_shared__"],Rl=(function(){var e=/[^.]+$/.exec(Za&&Za.keys&&Za.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function xy(e){return!!Rl&&Rl in e}var by=Function.prototype,Sy=by.toString;function _n(e){if(e!=null){try{return Sy.call(e)}catch{}try{return e+""}catch{}}return""}var Cy=/[\\^$.*+?()[\]{}|]/g,wy=/^\[object .+?Constructor\]$/,jy=Function.prototype,vy=Object.prototype,Ty=jy.toString,Fy=vy.hasOwnProperty,Ry=RegExp("^"+Ty.call(Fy).replace(Cy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $y(e){if(!It(e)||xy(e))return!1;var t=bo(e)?Ry:wy;return t.test(_n(e))}function Ey(e,t){return e==null?void 0:e[t]}function zn(e,t){var n=Ey(e,t);return $y(n)?n:void 0}var Ai=zn(Jt,"WeakMap"),$l=Object.create,Iy=(function(){function e(){}return function(t){if(!It(t))return{};if($l)return $l(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function My(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ky(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Ay=800,Oy=16,Dy=Date.now;function Py(e){var t=0,n=0;return function(){var r=Dy(),a=Oy-(r-n);if(n=r,a>0){if(++t>=Ay)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ny(e){return function(){return e}}var ea=(function(){try{var e=zn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Ly=ea?function(e,t){return ea(e,"toString",{configurable:!0,enumerable:!1,value:Ny(t),writable:!0})}:Zu,_y=Py(Ly);function zy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var By=9007199254740991,Vy=/^(?:0|[1-9]\d*)$/;function Ju(e,t){var n=typeof e;return t=t??By,!!t&&(n=="number"||n!="symbol"&&Vy.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,n){t=="__proto__"&&ea?ea(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Xr(e,t){return e===t||e!==e&&t!==t}var Hy=Object.prototype,Uy=Hy.hasOwnProperty;function Xu(e,t,n){var r=e[t];(!(Uy.call(e,t)&&Xr(r,n))||n===void 0&&!(t in e))&&So(e,t,n)}function Yy(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var l=t[i],u=void 0;u===void 0&&(u=e[l]),a?So(n,l,u):Xu(n,l,u)}return n}var El=Math.max;function Ky(e,t,n){return t=El(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=El(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),My(e,this,l)}}function Wy(e,t){return _y(Ky(e,t,Zu),e+"")}var qy=9007199254740991;function Qu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=qy}function Qr(e){return e!=null&&Qu(e.length)&&!bo(e)}function Gy(e,t,n){if(!It(n))return!1;var r=typeof t;return(r=="number"?Qr(n)&&Ju(t,n.length):r=="string"&&t in n)?Xr(n[t],e):!1}function Zy(e){return Wy(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&Gy(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,i)}return t})}var Jy=Object.prototype;function pa(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Jy;return e===n}function Xy(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Qy="[object Arguments]";function Il(e){return tn(e)&&gr(e)==Qy}var ed=Object.prototype,ex=ed.hasOwnProperty,tx=ed.propertyIsEnumerable,ta=Il((function(){return arguments})())?Il:function(e){return tn(e)&&ex.call(e,"callee")&&!tx.call(e,"callee")};function nx(){return!1}var td=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ml=td&&typeof module=="object"&&module&&!module.nodeType&&module,rx=Ml&&Ml.exports===td,kl=rx?Jt.Buffer:void 0,sx=kl?kl.isBuffer:void 0,cr=sx||nx,ax="[object Arguments]",ix="[object Array]",ox="[object Boolean]",lx="[object Date]",cx="[object Error]",ux="[object Function]",dx="[object Map]",fx="[object Number]",hx="[object Object]",mx="[object RegExp]",gx="[object Set]",px="[object String]",yx="[object WeakMap]",xx="[object ArrayBuffer]",bx="[object DataView]",Sx="[object Float32Array]",Cx="[object Float64Array]",wx="[object Int8Array]",jx="[object Int16Array]",vx="[object Int32Array]",Tx="[object Uint8Array]",Fx="[object Uint8ClampedArray]",Rx="[object Uint16Array]",$x="[object Uint32Array]",nt={};nt[Sx]=nt[Cx]=nt[wx]=nt[jx]=nt[vx]=nt[Tx]=nt[Fx]=nt[Rx]=nt[$x]=!0;nt[ax]=nt[ix]=nt[xx]=nt[ox]=nt[bx]=nt[lx]=nt[cx]=nt[ux]=nt[dx]=nt[fx]=nt[hx]=nt[mx]=nt[gx]=nt[px]=nt[yx]=!1;function Ex(e){return tn(e)&&Qu(e.length)&&!!nt[gr(e)]}function Co(e){return function(t){return e(t)}}var nd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zr=nd&&typeof module=="object"&&module&&!module.nodeType&&module,Ix=zr&&zr.exports===nd,Ja=Ix&&qu.process,ur=(function(){try{var e=zr&&zr.require&&zr.require("util").types;return e||Ja&&Ja.binding&&Ja.binding("util")}catch{}})(),Al=ur&&ur.isTypedArray,ya=Al?Co(Al):Ex,Mx=Object.prototype,kx=Mx.hasOwnProperty;function rd(e,t){var n=Cn(e),r=!n&&ta(e),a=!n&&!r&&cr(e),i=!n&&!r&&!a&&ya(e),o=n||r||a||i,l=o?Xy(e.length,String):[],u=l.length;for(var m in e)(t||kx.call(e,m))&&!(o&&(m=="length"||a&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Ju(m,u)))&&l.push(m);return l}function sd(e,t){return function(n){return e(t(n))}}var Ax=sd(Object.keys,Object),Ox=Object.prototype,Dx=Ox.hasOwnProperty;function ad(e){if(!pa(e))return Ax(e);var t=[];for(var n in Object(e))Dx.call(e,n)&&n!="constructor"&&t.push(n);return t}function Px(e){return Qr(e)?rd(e):ad(e)}function Nx(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Lx=Object.prototype,_x=Lx.hasOwnProperty;function zx(e){if(!It(e))return Nx(e);var t=pa(e),n=[];for(var r in e)r=="constructor"&&(t||!_x.call(e,r))||n.push(r);return n}function id(e){return Qr(e)?rd(e,!0):zx(e)}var Wr=zn(Object,"create");function Bx(){this.__data__=Wr?Wr(null):{},this.size=0}function Vx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Hx="__lodash_hash_undefined__",Ux=Object.prototype,Yx=Ux.hasOwnProperty;function Kx(e){var t=this.__data__;if(Wr){var n=t[e];return n===Hx?void 0:n}return Yx.call(t,e)?t[e]:void 0}var Wx=Object.prototype,qx=Wx.hasOwnProperty;function Gx(e){var t=this.__data__;return Wr?t[e]!==void 0:qx.call(t,e)}var Zx="__lodash_hash_undefined__";function Jx(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wr&&t===void 0?Zx:t,this}function Pn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pn.prototype.clear=Bx;Pn.prototype.delete=Vx;Pn.prototype.get=Kx;Pn.prototype.has=Gx;Pn.prototype.set=Jx;function Xx(){this.__data__=[],this.size=0}function xa(e,t){for(var n=e.length;n--;)if(Xr(e[n][0],t))return n;return-1}var Qx=Array.prototype,eb=Qx.splice;function tb(e){var t=this.__data__,n=xa(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():eb.call(t,n,1),--this.size,!0}function nb(e){var t=this.__data__,n=xa(t,e);return n<0?void 0:t[n][1]}function rb(e){return xa(this.__data__,e)>-1}function sb(e,t){var n=this.__data__,r=xa(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function sn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}sn.prototype.clear=Xx;sn.prototype.delete=tb;sn.prototype.get=nb;sn.prototype.has=rb;sn.prototype.set=sb;var qr=zn(Jt,"Map");function ab(){this.size=0,this.__data__={hash:new Pn,map:new(qr||sn),string:new Pn}}function ib(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ba(e,t){var n=e.__data__;return ib(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ob(e){var t=ba(this,e).delete(e);return this.size-=t?1:0,t}function lb(e){return ba(this,e).get(e)}function cb(e){return ba(this,e).has(e)}function ub(e,t){var n=ba(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Bn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bn.prototype.clear=ab;Bn.prototype.delete=ob;Bn.prototype.get=lb;Bn.prototype.has=cb;Bn.prototype.set=ub;function db(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var od=sd(Object.getPrototypeOf,Object),fb="[object Object]",hb=Function.prototype,mb=Object.prototype,ld=hb.toString,gb=mb.hasOwnProperty,pb=ld.call(Object);function yb(e){if(!tn(e)||gr(e)!=fb)return!1;var t=od(e);if(t===null)return!0;var n=gb.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ld.call(n)==pb}function xb(){this.__data__=new sn,this.size=0}function bb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Sb(e){return this.__data__.get(e)}function Cb(e){return this.__data__.has(e)}var wb=200;function jb(e,t){var n=this.__data__;if(n instanceof sn){var r=n.__data__;if(!qr||r.length<wb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Bn(r)}return n.set(e,t),this.size=n.size,this}function Kt(e){var t=this.__data__=new sn(e);this.size=t.size}Kt.prototype.clear=xb;Kt.prototype.delete=bb;Kt.prototype.get=Sb;Kt.prototype.has=Cb;Kt.prototype.set=jb;var cd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ol=cd&&typeof module=="object"&&module&&!module.nodeType&&module,vb=Ol&&Ol.exports===cd,Dl=vb?Jt.Buffer:void 0,Pl=Dl?Dl.allocUnsafe:void 0;function ud(e,t){if(t)return e.slice();var n=e.length,r=Pl?Pl(n):new e.constructor(n);return e.copy(r),r}function Tb(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}function Fb(){return[]}var Rb=Object.prototype,$b=Rb.propertyIsEnumerable,Nl=Object.getOwnPropertySymbols,Eb=Nl?function(e){return e==null?[]:(e=Object(e),Tb(Nl(e),function(t){return $b.call(e,t)}))}:Fb;function Ib(e,t,n){var r=t(e);return Cn(e)?r:db(r,n(e))}function Oi(e){return Ib(e,Px,Eb)}var Di=zn(Jt,"DataView"),Pi=zn(Jt,"Promise"),Ni=zn(Jt,"Set"),Ll="[object Map]",Mb="[object Object]",_l="[object Promise]",zl="[object Set]",Bl="[object WeakMap]",Vl="[object DataView]",kb=_n(Di),Ab=_n(qr),Ob=_n(Pi),Db=_n(Ni),Pb=_n(Ai),Et=gr;(Di&&Et(new Di(new ArrayBuffer(1)))!=Vl||qr&&Et(new qr)!=Ll||Pi&&Et(Pi.resolve())!=_l||Ni&&Et(new Ni)!=zl||Ai&&Et(new Ai)!=Bl)&&(Et=function(e){var t=gr(e),n=t==Mb?e.constructor:void 0,r=n?_n(n):"";if(r)switch(r){case kb:return Vl;case Ab:return Ll;case Ob:return _l;case Db:return zl;case Pb:return Bl}return t});var Nb=Object.prototype,Lb=Nb.hasOwnProperty;function _b(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Lb.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var na=Jt.Uint8Array;function wo(e){var t=new e.constructor(e.byteLength);return new na(t).set(new na(e)),t}function zb(e,t){var n=wo(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Bb=/\w*$/;function Vb(e){var t=new e.constructor(e.source,Bb.exec(e));return t.lastIndex=e.lastIndex,t}var Hl=Sn?Sn.prototype:void 0,Ul=Hl?Hl.valueOf:void 0;function Hb(e){return Ul?Object(Ul.call(e)):{}}function dd(e,t){var n=t?wo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Ub="[object Boolean]",Yb="[object Date]",Kb="[object Map]",Wb="[object Number]",qb="[object RegExp]",Gb="[object Set]",Zb="[object String]",Jb="[object Symbol]",Xb="[object ArrayBuffer]",Qb="[object DataView]",eS="[object Float32Array]",tS="[object Float64Array]",nS="[object Int8Array]",rS="[object Int16Array]",sS="[object Int32Array]",aS="[object Uint8Array]",iS="[object Uint8ClampedArray]",oS="[object Uint16Array]",lS="[object Uint32Array]";function cS(e,t,n){var r=e.constructor;switch(t){case Xb:return wo(e);case Ub:case Yb:return new r(+e);case Qb:return zb(e);case eS:case tS:case nS:case rS:case sS:case aS:case iS:case oS:case lS:return dd(e,n);case Kb:return new r;case Wb:case Zb:return new r(e);case qb:return Vb(e);case Gb:return new r;case Jb:return Hb(e)}}function fd(e){return typeof e.constructor=="function"&&!pa(e)?Iy(od(e)):{}}var uS="[object Map]";function dS(e){return tn(e)&&Et(e)==uS}var Yl=ur&&ur.isMap,fS=Yl?Co(Yl):dS,hS="[object Set]";function mS(e){return tn(e)&&Et(e)==hS}var Kl=ur&&ur.isSet,gS=Kl?Co(Kl):mS,pS=1,hd="[object Arguments]",yS="[object Array]",xS="[object Boolean]",bS="[object Date]",SS="[object Error]",md="[object Function]",CS="[object GeneratorFunction]",wS="[object Map]",jS="[object Number]",gd="[object Object]",vS="[object RegExp]",TS="[object Set]",FS="[object String]",RS="[object Symbol]",$S="[object WeakMap]",ES="[object ArrayBuffer]",IS="[object DataView]",MS="[object Float32Array]",kS="[object Float64Array]",AS="[object Int8Array]",OS="[object Int16Array]",DS="[object Int32Array]",PS="[object Uint8Array]",NS="[object Uint8ClampedArray]",LS="[object Uint16Array]",_S="[object Uint32Array]",Xe={};Xe[hd]=Xe[yS]=Xe[ES]=Xe[IS]=Xe[xS]=Xe[bS]=Xe[MS]=Xe[kS]=Xe[AS]=Xe[OS]=Xe[DS]=Xe[wS]=Xe[jS]=Xe[gd]=Xe[vS]=Xe[TS]=Xe[FS]=Xe[RS]=Xe[PS]=Xe[NS]=Xe[LS]=Xe[_S]=!0;Xe[SS]=Xe[md]=Xe[$S]=!1;function Bs(e,t,n,r,a,i){var o,l=t&pS;if(o!==void 0)return o;if(!It(e))return e;var u=Cn(e);if(u)o=_b(e);else{var m=Et(e),g=m==md||m==CS;if(cr(e))return ud(e,l);if(m==gd||m==hd||g&&!a)o=g?{}:fd(e);else{if(!Xe[m])return a?e:{};o=cS(e,m,l)}}i||(i=new Kt);var f=i.get(e);if(f)return f;i.set(e,o),gS(e)?e.forEach(function(S){o.add(Bs(S,t,n,S,e,i))}):fS(e)&&e.forEach(function(S,y){o.set(y,Bs(S,t,n,y,e,i))});var h=Oi,p=u?void 0:h(e);return zy(p||e,function(S,y){p&&(y=S,S=e[y]),Xu(o,y,Bs(S,t,n,y,e,i))}),o}var zS=1,BS=4;function VS(e){return Bs(e,zS|BS)}var HS="__lodash_hash_undefined__";function US(e){return this.__data__.set(e,HS),this}function YS(e){return this.__data__.has(e)}function ra(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Bn;++t<n;)this.add(e[t])}ra.prototype.add=ra.prototype.push=US;ra.prototype.has=YS;function KS(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function WS(e,t){return e.has(t)}var qS=1,GS=2;function pd(e,t,n,r,a,i){var o=n&qS,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var m=i.get(e),g=i.get(t);if(m&&g)return m==t&&g==e;var f=-1,h=!0,p=n&GS?new ra:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var S=e[f],y=t[f];if(r)var w=o?r(y,S,f,t,e,i):r(S,y,f,e,t,i);if(w!==void 0){if(w)continue;h=!1;break}if(p){if(!KS(t,function(v,x){if(!WS(p,x)&&(S===v||a(S,v,n,r,i)))return p.push(x)})){h=!1;break}}else if(!(S===y||a(S,y,n,r,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function ZS(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function JS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var XS=1,QS=2,eC="[object Boolean]",tC="[object Date]",nC="[object Error]",rC="[object Map]",sC="[object Number]",aC="[object RegExp]",iC="[object Set]",oC="[object String]",lC="[object Symbol]",cC="[object ArrayBuffer]",uC="[object DataView]",Wl=Sn?Sn.prototype:void 0,Xa=Wl?Wl.valueOf:void 0;function dC(e,t,n,r,a,i,o){switch(n){case uC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case cC:return!(e.byteLength!=t.byteLength||!i(new na(e),new na(t)));case eC:case tC:case sC:return Xr(+e,+t);case nC:return e.name==t.name&&e.message==t.message;case aC:case oC:return e==t+"";case rC:var l=ZS;case iC:var u=r&XS;if(l||(l=JS),e.size!=t.size&&!u)return!1;var m=o.get(e);if(m)return m==t;r|=QS,o.set(e,t);var g=pd(l(e),l(t),r,a,i,o);return o.delete(e),g;case lC:if(Xa)return Xa.call(e)==Xa.call(t)}return!1}var fC=1,hC=Object.prototype,mC=hC.hasOwnProperty;function gC(e,t,n,r,a,i){var o=n&fC,l=Oi(e),u=l.length,m=Oi(t),g=m.length;if(u!=g&&!o)return!1;for(var f=u;f--;){var h=l[f];if(!(o?h in t:mC.call(t,h)))return!1}var p=i.get(e),S=i.get(t);if(p&&S)return p==t&&S==e;var y=!0;i.set(e,t),i.set(t,e);for(var w=o;++f<u;){h=l[f];var v=e[h],x=t[h];if(r)var C=o?r(x,v,h,t,e,i):r(v,x,h,e,t,i);if(!(C===void 0?v===x||a(v,x,n,r,i):C)){y=!1;break}w||(w=h=="constructor")}if(y&&!w){var j=e.constructor,b=t.constructor;j!=b&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof b=="function"&&b instanceof b)&&(y=!1)}return i.delete(e),i.delete(t),y}var pC=1,ql="[object Arguments]",Gl="[object Array]",ws="[object Object]",yC=Object.prototype,Zl=yC.hasOwnProperty;function xC(e,t,n,r,a,i){var o=Cn(e),l=Cn(t),u=o?Gl:Et(e),m=l?Gl:Et(t);u=u==ql?ws:u,m=m==ql?ws:m;var g=u==ws,f=m==ws,h=u==m;if(h&&cr(e)){if(!cr(t))return!1;o=!0,g=!1}if(h&&!g)return i||(i=new Kt),o||ya(e)?pd(e,t,n,r,a,i):dC(e,t,u,n,r,a,i);if(!(n&pC)){var p=g&&Zl.call(e,"__wrapped__"),S=f&&Zl.call(t,"__wrapped__");if(p||S){var y=p?e.value():e,w=S?t.value():t;return i||(i=new Kt),a(y,w,n,r,i)}}return h?(i||(i=new Kt),gC(e,t,n,r,a,i)):!1}function yd(e,t,n,r,a){return e===t?!0:e==null||t==null||!tn(e)&&!tn(t)?e!==e&&t!==t:xC(e,t,n,r,yd,a)}function bC(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),l=o.length;l--;){var u=o[++a];if(n(i[u],u,i)===!1)break}return t}}var SC=bC();function Li(e,t,n){(n!==void 0&&!Xr(e[t],n)||n===void 0&&!(t in e))&&So(e,t,n)}function CC(e){return tn(e)&&Qr(e)}function _i(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function wC(e){return Yy(e,id(e))}function jC(e,t,n,r,a,i,o){var l=_i(e,n),u=_i(t,n),m=o.get(u);if(m){Li(e,n,m);return}var g=i?i(l,u,n+"",e,t,o):void 0,f=g===void 0;if(f){var h=Cn(u),p=!h&&cr(u),S=!h&&!p&&ya(u);g=u,h||p||S?Cn(l)?g=l:CC(l)?g=ky(l):p?(f=!1,g=ud(u,!0)):S?(f=!1,g=dd(u,!0)):g=[]:yb(u)||ta(u)?(g=l,ta(l)?g=wC(l):(!It(l)||bo(l))&&(g=fd(u))):f=!1}f&&(o.set(u,g),a(g,u,r,i,o),o.delete(u)),Li(e,n,g)}function xd(e,t,n,r,a){e!==t&&SC(t,function(i,o){if(a||(a=new Kt),It(i))jC(e,t,o,n,xd,r,a);else{var l=r?r(_i(e,o),i,o+"",e,t,a):void 0;l===void 0&&(l=i),Li(e,o,l)}},id)}var vC="[object Map]",TC="[object Set]",FC=Object.prototype,RC=FC.hasOwnProperty;function $C(e){if(e==null)return!0;if(Qr(e)&&(Cn(e)||typeof e=="string"||typeof e.splice=="function"||cr(e)||ya(e)||ta(e)))return!e.length;var t=Et(e);if(t==vC||t==TC)return!e.size;if(pa(e))return!ad(e).length;for(var n in e)if(RC.call(e,n))return!1;return!0}function Qa(e,t){return yd(e,t)}var sa=Zy(function(e,t,n){xd(e,t,n)});function EC(e){return typeof e!="object"?!1:e===null?!0:!(d.isValidElement(e)||e.constructor===RegExp||e instanceof Map||e instanceof Set||e instanceof HTMLElement||e instanceof Blob||e instanceof File||Array.isArray(e))}function IC(e){return e.split(".").map(t=>/^\d+$/.test(t)?parseInt(t,10):t)}function MC(e){const t={};for(const n in e){const r=e[n];kt(r)||(t[n]=r)}return t}function kC(e){const t={},n={};for(const r in e){const a=e[r];kt(a)||(r.includes(".")?t[r]=a:n[r]=a)}return{dotPathTransforms:t,objectTransforms:n}}function AC(e,t){for(const n in t){const r=t[n];if(typeof r!="function")continue;const a=IC(n),i=De(e,a);if(i===void 0)continue;const o=r(i,a.map(String),e);if(typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=a.slice(0,-1),u=l.length>0?De(e,l):e;if(u&&typeof u=="object"){const m=a[a.length-1];delete u[m],Object.assign(u,o)}}else{let l=e;for(let u=0;u<a.length-1;u++){const m=a[u];if(l[m]===void 0){const g=a[u+1];l[m]=typeof g=="number"?[]:{}}l=l[m]}l[a[a.length-1]]=o}}}function OC(e,t,n){let r=e;for(const a of t){const i=String(a);if(r&&typeof r[i]=="object")r=r[i];else{r=null;break}}if(r&&typeof r[n]=="function")return r[n]}function DC(e){return e.some(t=>!isNaN(Number(t)))}function zi(e,t,n,r,a){if(e!=null&&typeof e=="object"){if(a.has(e))return e;a.add(e)}const i=Array.isArray(e);let o=i?[]:{};if(e==null||e===void 0)return o;const l=i?e.map((u,m)=>m.toString()):Object.keys(e);for(const u of l){const m=t?[...t,u]:[u],g=e[u];let f=n[u];if(!f&&t&&(f=OC(n,t,u)),f&&typeof f=="function"){const h=f(g,u,e);typeof h=="object"&&h!==null&&!Array.isArray(h)?(t?DC(t):!1)?Object.assign(o,h):r.push(h):o[u]=h}else if(EC(g)&&!kt(g)){const h=n[u];if(h&&typeof h=="object"){const p=zi(g,m,h,r,a);Object.keys(p).length>0&&(o[u]=p)}else{const p=zi(g,m,n,r,a);o[u]=p}}else kt(g)||(o[u]=g)}return o}const PC=(e,t)=>{const n=MC(t);if(Object.keys(n).length<1||typeof window>"u"||typeof e!="object"||kt(e)||e instanceof Blob)return e;let r=VS(e);const{dotPathTransforms:a,objectTransforms:i}=kC(t);AC(r,a);const o=[];Object.keys(i).length>0&&(r=zi(r,void 0,i,o,new Set));for(const l of o)Object.assign(r,l);return r},NC=(e,t,n)=>{const r=d.useRef({});function a(i){var l;function o(u,m){u.forEach((g,f)=>{const h=n(g,f);m.set(h,g),g&&typeof g=="object"&&t in g&&o(g[t]||[],m)})}if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){const u=new Map;o(e,u),r.current={data:e,childrenColumnName:t,kvMap:u,getRowKey:n}}return(l=r.current.kvMap)==null?void 0:l.get(i)}return[a]},{noteOnce:LC}=Qe,Jl=e=>c.message.warning(e),tt=e=>Array.isArray(e)?e.join(","):e,jo=(...e)=>e.flat(1).filter(t=>t!=null).map(t=>typeof t=="number"?t.toString():t);function bd(e,t,n,r,a){const i=new Map;return e.forEach((o,l)=>{const u=(a||0)*10+l,m=t(o,u).toString();if(o&&typeof o=="object"&&n in o){const h=o[n]||[];bd(h,t,n,m,u).forEach((S,y)=>i.set(y,S))}const f={...o,map_row_key:m,map_row_parentKey:r};delete f.children,r||delete f.map_row_parentKey,i.set(m,f)}),i}function _C(e,t,n){const r=new Map,a=[],i=o=>{e.forEach(l=>{var u;if(l.map_row_parentKey!=null&&!l.map_row_key){const{map_row_parentKey:m,...g}=l,f=String(m);r.has(f)||r.set(f,[]),o&&((u=r.get(f))==null||u.push(g))}})};return i(n==="top"),e.forEach(o=>{var l,u;if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:m,map_row_key:g,isNewRecord:f,...h}=o,p={...h,map_row_key:g},S=m!=null?String(m):null;if(!S)return;r.has(S)||r.set(S,[]),f&&n==="top"?(l=r.get(S))==null||l.unshift(p):(u=r.get(S))==null||u.push(p)}}),e.forEach(o=>{if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:l,map_row_key:u}=o,m=l!=null?String(l):null;if(!m)return;const g=r.get(m);if(g&&g.length>0){const f=g.findIndex(h=>{const p=h.map_row_key||h.id;return String(p)===String(u)});f>=0&&r.has(u)&&(g[f]={...g[f],[t]:r.get(u)})}}}),i(n==="update"),e.forEach(o=>{if(!o.map_row_parentKey){const{map_row_key:l,...u}=o,m=l&&r.has(l)?{...u,[t]:r.get(l)}:u;a.push(m)}}),a}function Ar(e,t){var u;const{getRowKey:n,row:r,data:a,childrenColumnName:i="children"}=e,o=(u=tt(e.key))==null?void 0:u.toString(),l=bd(a,n,i);if(t==="delete")l.delete(o);else if(t==="top"||t==="update"){const m=l.get(o);m?l.set(o,{...m,...r}):l.set(o,{...r,map_row_key:o,map_row_parentKey:r.map_row_parentKey,isNewRecord:!0})}return _C(l,i,t)}function zC({recordKey:e,onSave:t,row:n,children:r,newLineConfig:a,editorType:i,tableName:o},l){const u=d.useContext(Jr),m=c.Form.useFormInstance(),[g,f]=d.useState(!1),h=we(async()=>{try{const p=i==="Map",S=jo(o,Array.isArray(e)?e[0]:e);f(!0);try{await m.validateFields(S,{recursive:!0})}catch(x){throw f(!1),x}const y=(()=>{var j;const x=(j=u==null?void 0:u.getFieldFormatValueObject)==null?void 0:j.call(u,S);return(x!=null?De(x,S):null)??m.getFieldValue(S)})();if(Array.isArray(e)&&e.length>1){const[,...x]=e,C=De(y,x);Ge(y,x,C)}const w=p?Ge({},S,y):y,v=await(t==null?void 0:t(e,Ku({},n,w),n,a));return f(!1),v}catch(p){throw f(!1),p}});return d.useImperativeHandle(l,()=>({save:h}),[h]),s.jsxs("a",{onClick:async p=>{p.stopPropagation(),p.preventDefault();try{await h()}catch{}},children:[g?s.jsx(de.LoadingOutlined,{style:{marginInlineEnd:8}}):null,r||"保存"]},"save")}const BC=({recordKey:e,onDelete:t,preEditRowRef:n,preEditRowRefs:r,row:a,children:i,deletePopconfirmMessage:o})=>{const[l,u]=d.useState(!1),m=we(async()=>{var g,f;try{u(!0);const h=await(t==null?void 0:t(e,a));return u(!1),h===!1?!1:h}catch{return u(!1),null}finally{const h=(g=tt(e))==null?void 0:g.toString();h&&((f=r==null?void 0:r.current)==null||f.delete(h)),n&&(n.current=null)}});return i!==!1?s.jsx(c.Popconfirm,{title:o||"确定要删除这条记录吗?",onConfirm:m,getPopupContainer:g=>g.parentElement||document.body,children:s.jsxs("a",{children:[l?s.jsx(de.LoadingOutlined,{style:{marginInlineEnd:8}}):null,i||"删除"]})},"delete"):null},VC=e=>{const{recordKey:t,tableName:n,newLineConfig:r,editorType:a,onCancel:i,cancelEditable:o,row:l,cancelText:u,preEditRowRef:m,preEditRowRefs:g}=e,f=d.useContext(Jr),h=c.Form.useFormInstance();return s.jsx("a",{onClick:async p=>{var F,E,M,k;p.stopPropagation(),p.preventDefault();const S=a==="Map",y=(F=tt(t))==null?void 0:F.toString(),w=jo(n,t),v=(()=>{var A;const V=(A=f==null?void 0:f.getFieldFormatValueObject)==null?void 0:A.call(f,w);return(V!=null?De(V,w):null)??(h==null?void 0:h.getFieldValue(w))})(),x=S?Ge({},w,v):v,C=y!=null?(E=g==null?void 0:g.current)==null?void 0:E.get(y):void 0,j=(()=>{var I,$,D;const V=(I=r==null?void 0:r.options)==null?void 0:I.recordKey;if(V==null||t==null)return!1;const _=($=tt(V))==null?void 0:$.toString(),A=(D=tt(t))==null?void 0:D.toString();return!_||!A?!1:_===A})(),b=await(i==null?void 0:i(t,x,l,r));await o(t);const T=C??(m==null?void 0:m.current)??l;return C===null||C===void 0&&(m==null?void 0:m.current)===null&&j?await((M=e.onDelete)==null?void 0:M.call(e,t,l)):T!=null&&h.setFieldsValue(Ge({},w,T)),y&&((k=g==null?void 0:g.current)==null||k.delete(y)),m&&(m.current=null),b},children:u||"取消"},"cancel")};function HC(e,t){const{recordKey:n,newLineConfig:r,saveText:a,deleteText:i}=t,o=d.forwardRef(zC),l=d.createRef();return{save:s.jsx(o,{...t,row:e,ref:l,children:a},"save"+n),saveRef:l,delete:(r==null?void 0:r.options.recordKey)!==n?s.jsx(BC,{...t,row:e,children:i},"delete"+n):void 0,cancel:s.jsx(VC,{...t,row:e},"cancel"+n)}}function UC(e){const t=ke(),n=d.useRef(null),r=d.useRef(new Map),[a,i]=d.useState(void 0),o=we(()=>{const N=new Map,q=(ee,ne)=>{ee==null||ee.forEach((X,ae)=>{const oe=ne==null?ae.toString():`${ne}_${ae}`,ue=tt(e.getRowKey(X,-1));if(ue==null)return;N.set(oe,ue),N.set(ue.toString(),oe);const ge=e.childrenColumnName&&(X==null?void 0:X[e.childrenColumnName]);ge&&q(ge,oe)})};return q(e.dataSource),N}),l=d.useMemo(()=>o(),[]),u=d.useRef(l),m=d.useRef(void 0);Yu(()=>{u.current=o()},[e.dataSource]),m.current=a;const g=e.type||"single",[f]=NC(e.dataSource,"children",e.getRowKey),[h,p]=it([],e.editableKeys),S=d.useCallback(N=>{p(q=>{var ne;const ee=typeof N=="function"?N(q):N;return(ne=e==null?void 0:e.onChange)==null||ne.call(e,(ee==null?void 0:ee.filter(X=>X!==void 0))??[],(ee==null?void 0:ee.map(X=>f(X)).filter(X=>X!==void 0))??[]),ee})},[e.onChange,f]),y=_r(h),w=we((N,q)=>q.includes(N)),v=we(N=>{var oe,ue;const q=(oe=e.getRowKey(N,N.index))==null?void 0:oe.toString(),ee=(ue=e.getRowKey(N,-1))==null?void 0:ue.toString(),ne=(h==null?void 0:h.map(ge=>ge==null?void 0:ge.toString()))||[],X=(y==null?void 0:y.map(ge=>ge==null?void 0:ge.toString()))||[],ae=w(ee,X)||w(q,X);return{recordKey:ee,isEditable:w(ee,ne)||w(q,ne),preIsEditable:ae}}),x=we(()=>h&&h.length>0&&g==="single"&&e.onlyOneLineEditorAlertMessage!==!1?(Jl(e.onlyOneLineEditorAlertMessage||t.getMessage("editableTable.onlyOneLineEditor","只能同时编辑一行")),!1):!0),C=we(N=>{var q;return((q=e.dataSource)==null?void 0:q.find((ee,ne)=>e.getRowKey(ee,ne)===N))??null}),j=we((N,q)=>{var X;if(!x())return!1;if(!(h==null?void 0:h.some(ae=>ae===N||(ae==null?void 0:ae.toString())===(N==null?void 0:N.toString())))){const ae=h?[...h,N]:[N];S(ae)}n.current=q??C(N)??null;const ne=(X=tt(N))==null?void 0:X.toString();return ne&&r.current.set(ne,n.current),!0}),b=we(N=>{const q=tt(N),ee=q!=null?q.toString():null;if(ee==null)return;const ne=(h==null?void 0:h.filter(X=>(X==null?void 0:X.toString())!==ee&&X!==q))??[];S(ne)}),T=we(async(N,q)=>{var ue,ge,me,he;const ee=tt(N),ne=ee!=null?ee.toString():null,X=ne!=null?u.current.get(ne):void 0,ae=h==null?void 0:h.some(Q=>ne==null?!1:(Q==null?void 0:Q.toString())===ne||Q===ee);if(!ae&&X&&(q??!0)&&e.tableName)return await T(X,!1);if(e.onCancel&&ae){const Q=Array.isArray(N)?N[0]:N,se=C(Q),Se=n.current,Fe=(ue=a==null?void 0:a.options)==null?void 0:ue.recordKey,ie=Fe!=null?tt(Fe):null,Y=ie!=null?ie.toString():null,K=a!=null&&Fe!=null&&(Fe===N||Y!=null&&ne!=null&&Y===ne||(Fe==null?void 0:Fe.toString())===(N==null?void 0:N.toString())||String(Fe)===String(N))?a:void 0;try{await e.onCancel(N,se||(K==null?void 0:K.defaultValue)||{},Se||se||(K==null?void 0:K.defaultValue)||{},K)}catch(re){console.error("onCancel error:",re)}}if(a){const Q=a.options.recordKey,se=Q!=null?(ge=tt(Q))==null?void 0:ge.toString():null;(Q===N||se!=null&&ne!=null&&se===ne||(Q==null?void 0:Q.toString())===(N==null?void 0:N.toString())||String(Q)===String(N))&&i(void 0)}const oe=n.current;if(oe&&e.getRowKey(oe,-1)===N&&ae){try{const Q=(me=e.formProps)==null?void 0:me.formRef,se=(Q==null?void 0:Q.current)||e.form;if(se)if(e.tableName){const Se=jo(e.tableName,N);se.setFieldsValue(Ge({},Se,oe))}else{const Se=(he=tt(N))==null?void 0:he.toString();if(Se)try{se.resetFields([[Se]]),se.setFieldsValue({[Se]:void 0})}catch(Fe){console.warn("Failed to clear form fields in cancelEditable:",Fe)}}}catch(Q){console.warn("Failed to reset form fields in cancelEditable:",Q)}n.current=null}return b(N),!0}),R=go(async(...N)=>{var q;(q=e.onValuesChange)==null||q.call(e,...N)},64),F=we(N=>[e.tableName||"",N].flat(1).filter(q=>q||q===0)),E=we((N,q)=>{let ee=N;return h==null||h.forEach(ne=>{if((a==null?void 0:a.options.recordKey)===ne)return;const X=ne.toString(),ae=F(X),oe=De(q,ae);oe&&(ee=Ar({data:ee,getRowKey:e.getRowKey,row:oe,key:X,childrenColumnName:e.childrenColumnName||"children"},"update"))}),ee}),M=we((N,q,ee)=>{var ge;const ne=Object.keys(N||{});if(ne.length===0)return(a==null?void 0:a.defaultValue)||{};const X=((ge=ne.pop())==null?void 0:ge.toString())||"";if(!X)return(a==null?void 0:a.defaultValue)||{};const ae=F(X),oe={...a==null?void 0:a.defaultValue,...De(q,ae)};return u.current.has(tt(X))&&ee.find((he,Q)=>{var Se;return((Se=e.getRowKey(he,Q))==null?void 0:Se.toString())===X})||oe}),k=we((N,q)=>{if(!e.onValuesChange)return;const ee=E(e.dataSource,q),ne=M(N,q,ee);R.run(ne,ee)}),V=d.useRef(new Map);d.useEffect(()=>{const N=new Set((h==null?void 0:h.map(q=>q==null?void 0:q.toString()))??[]);V.current.forEach((q,ee)=>{N.has(ee==null?void 0:ee.toString())||V.current.delete(ee)})},[h]);const _=we(N=>{const q=tt(N);return V.current.get(q)||V.current.get(q.toString())}),A=we(async(N,q)=>{const ee=tt(N),ne=ee.toString(),X=u.current.get(ne);if(!(h==null?void 0:h.some(ue=>(ue==null?void 0:ue.toString())===ne||ue===ee))&&X&&(q??!0)&&e.tableName)return await A(X,!1);const oe=_(N);return oe!=null&&oe.current?(await oe.current.save(),b(N),!0):!1}),I=we(N=>N!=null&&N.parentKey&&!u.current.has(tt(N==null?void 0:N.parentKey).toString())?(console.warn("can't find record by key",N==null?void 0:N.parentKey),!1):m.current&&e.onlyAddOneLineAlertMessage!==!1?(Jl(e.onlyAddOneLineAlertMessage||t.getMessage("editableTable.onlyAddOneLine","只能新增一行")),!1):!!x()),$=we(N=>{if(N==null&&N!==0&&N!=="")throw LC(!1,`请设置 recordCreatorProps.record 并返回一个唯一的key
55
+ https://procomponents.ant.design/components/editable-table#editable-%E6%96%B0%E5%BB%BA%E8%A1%8C`),new Error("请设置 recordCreatorProps.record 并返回一个唯一的key")}),D=we((N,q)=>{var ue,ge;if(!I(q))return!1;const ee=e.getRowKey(N,-1);$(ee);const ne=(ue=tt(ee))==null?void 0:ue.toString();if(ne&&r.current.set(ne,null),!(h==null?void 0:h.some(me=>me===ee||(me==null?void 0:me.toString())===(ee==null?void 0:ee.toString())))){const me=h?[...h,ee]:[ee];S(me)}const ae=typeof(q==null?void 0:q.parentKey)=="function"?q.parentKey():q==null?void 0:q.parentKey;if((q==null?void 0:q.newRecordType)==="dataSource"||e.tableName&&(q==null?void 0:q.newRecordType)!=="cache"){const me={data:e.dataSource,getRowKey:e.getRowKey,row:{...N,map_row_parentKey:ae?(ge=tt(ae))==null?void 0:ge.toString():void 0},key:ee,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Ar(me,(q==null?void 0:q.position)==="top"?"top":"update"))}else i({defaultValue:N,options:{...q,parentKey:ae,recordKey:ee}});return!0}),O=(e==null?void 0:e.saveText)||t.getMessage("editableTable.action.save","保存"),z=(e==null?void 0:e.deleteText)||t.getMessage("editableTable.action.delete","删除"),Z=(e==null?void 0:e.cancelText)||t.getMessage("editableTable.action.cancel","取消"),L=we(async(N,q,ee,ne)=>{var ge,me,he;const X=await((ge=e==null?void 0:e.onSave)==null?void 0:ge.call(e,N,q,ee,ne));if(X===!1)return X;const{options:ae}=ne||m.current||{};if(!(ae!=null&&ae.parentKey)&&(ae==null?void 0:ae.recordKey)===N)(ae==null?void 0:ae.position)==="top"?e.setDataSource([q,...e.dataSource]):e.setDataSource([...e.dataSource,q]);else{const Q={data:e.dataSource,getRowKey:e.getRowKey,row:ae?{...q,map_row_parentKey:(me=tt((ae==null?void 0:ae.parentKey)??""))==null?void 0:me.toString()}:q,key:N,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Ar(Q,(ae==null?void 0:ae.position)==="top"?"top":"update"))}await T(N);const ue=(he=tt(N))==null?void 0:he.toString();return ue&&r.current.delete(ue),X}),U=we(async(N,q)=>{var ae,oe;const ee={data:e.dataSource,getRowKey:e.getRowKey,row:q,key:N,childrenColumnName:e.childrenColumnName||"children"},ne=await((ae=e==null?void 0:e.onDelete)==null?void 0:ae.call(e,N,q));if(ne===!1)return!1;await T(N,!1),e.setDataSource(Ar(ee,"delete"));const X=(oe=tt(N))==null?void 0:oe.toString();return X&&r.current.delete(X),ne}),J=we(async(N,q,ee,ne)=>{var ae;return await((ae=e==null?void 0:e.onCancel)==null?void 0:ae.call(e,N,q,ee,ne))}),G=e.actionRender&&typeof e.actionRender=="function",H=G?e.actionRender:()=>{},B=we(H);return{editableKeys:h,setEditableRowKeys:S,isEditable:v,actionRender:N=>{const q=e.getRowKey(N,N.index),ee={saveText:O,cancelText:Z,deleteText:z,addEditRecord:D,recordKey:q,cancelEditable:T,index:N.index,tableName:e.tableName,newLineConfig:a,onCancel:J,onDelete:U,onSave:L,editableKeys:h,setEditableRowKeys:S,preEditRowRef:n,preEditRowRefs:r,deletePopconfirmMessage:e.deletePopconfirmMessage||`${t.getMessage("deleteThisLine","删除此项")}?`},ne=HC(N,ee);return e.tableName?V.current.set(u.current.get(tt(q))||tt(q),ne.saveRef):V.current.set(tt(q),ne.saveRef),G?B(N,ee,{save:ne.save,delete:ne.delete,cancel:ne.cancel}):[ne.save,ne.delete,ne.cancel]},startEditable:j,cancelEditable:T,addEditRecord:D,saveEditable:A,newLineRecord:a,preEditableKeys:y,onValuesChange:k,getRealIndex:e.getRealIndex}}const YC=new Ru("card-loading",{"0%":{backgroundPosition:"0 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),KC=e=>({[e.componentCls]:{boxSizing:"border-box","&-loading":{overflow:"hidden"},"&-loading &-body":{userSelect:"none"},[`${e.componentCls}-loading-content`]:{width:"100%",p:{marginBlock:0,marginInline:0}},[`${e.componentCls}-loading-block`]:{height:"14px",marginBlock:"4px",background:"linear-gradient(90deg, rgba(54, 61, 64, 0.2), rgba(54, 61, 64, 0.4), rgba(54, 61, 64, 0.2))",backgroundSize:"600% 600%",borderRadius:e.borderRadius,animationName:YC,animationDuration:"1.4s",animationTimingFunction:"ease",animationIterationCount:"infinite"}}});function WC(e){return Je("ProCardLoading",t=>{const n={...t,componentCls:`.${e}`};return[KC(n)]})}const qC=e=>{const{style:t,prefix:n}=e,{wrapSSR:r}=WC(n||"ant-pro-card");return r(s.jsxs("div",{className:`${n}-loading-content`,style:t,children:[s.jsx(c.Row,{gutter:8,children:s.jsx(c.Col,{span:22,children:s.jsx("div",{className:`${n}-loading-block`})})}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:8,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:15,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:6,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:18,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:13,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:9,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:4,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:3,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:16,children:s.jsx("div",{className:`${n}-loading-block`})})]})]}))},Xl=e=>({backgroundColor:e.controlItemBgActive,borderColor:e.controlOutline}),GC=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"flex",flexDirection:"column",boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},width:"100%",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,backgroundColor:e.colorBgContainer,borderRadius:e.borderRadius,transition:"all 0.3s",...qa==null?void 0:qa(e),"&-box-shadow":{boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017",borderColor:"transparent"},"&-col":{width:"100%"},[` ${t}-col${t}-split-vertical`]:{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[` ${t}-col${t}-split-horizontal`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-divider`]:{flex:"none",alignSelf:"stretch",width:e.lineWidth,marginInline:e.marginXS,marginBlock:e.marginLG,backgroundColor:e.colorSplit,[`&${t}-divider-horizontal`]:{width:"auto",alignSelf:"auto",height:e.lineWidth,marginInline:e.marginLG,marginBlock:e.marginXS}},"&-border":{border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-hoverable":{cursor:"pointer",transition:"box-shadow 0.3s, border-color 0.3s","&:hover":{borderColor:"transparent",boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017"},[`&${t}-checked:hover`]:{borderColor:e.controlOutline}},"&-checked":{...Xl(e),"&::after":{visibility:"visible",position:"absolute",insetBlockStart:2,insetInlineEnd:2,opacity:1,width:0,height:0,border:`6px solid ${e.colorPrimary}`,borderBlockEnd:"6px solid transparent",borderInlineStart:"6px solid transparent",borderStartEndRadius:2,content:'""'}},"&:focus":{...Xl(e)},"&&-ghost":{backgroundColor:"transparent",[`> ${t}`]:{"&-header":{paddingInlineEnd:0,paddingBlockEnd:e.padding,paddingInlineStart:0},"&-body":{paddingBlock:0,paddingInline:0,backgroundColor:"transparent"}}},"&&-split > &-body":{paddingBlock:0,paddingInline:0},"&&-contain-card > &-body":{display:"flex"},[`${t}-body-direction-column`]:{flexDirection:"column"},[`${t}-body-wrap`]:{flexWrap:"wrap"},"&&-collapse":{[`> ${t}`]:{"&-header":{paddingBlockEnd:e.padding,borderBlockEnd:0},"&-body":{display:"none"}}},[`${t}-header`]:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:e.paddingLG,paddingBlock:e.padding,paddingBlockEnd:0,"&-border":{"&":{paddingBlockEnd:e.padding},borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-collapsible":{cursor:"pointer"}},[`${t}-title`]:{color:e.colorText,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeight},[`${t}-extra`]:{color:e.colorText},[`${t}-type-inner`]:{[`${t}-header`]:{backgroundColor:e.colorFillAlter}},[`${t}-collapsible-icon`]:{marginInlineEnd:e.marginXS,color:e.colorIconHover,":hover":{color:e.colorPrimaryHover},"& svg":{transition:`transform ${e.motionDurationMid}`}},[`${t}-cover`]:{overflow:"hidden",borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`,"& > *":{width:"100%",display:"block"},"& img":{verticalAlign:"middle"}},[`${t}-body`]:{display:"block",boxSizing:"border-box",height:"100%",paddingInline:e.paddingLG,paddingBlock:e.padding,"&-center":{display:"flex",alignItems:"center",justifyContent:"center"}},"&&-size-small":{[t]:{"&-header":{paddingInline:e.paddingSM,paddingBlock:e.paddingXS,paddingBlockEnd:0,"&-border":{paddingBlockEnd:e.paddingXS}},"&-title":{fontSize:e.fontSize},"&-body":{paddingInline:e.paddingSM,paddingBlock:e.paddingSM}},[` ${t}-divider`]:{marginBlock:e.marginLG,marginInline:e.marginXS,[`&${t}-divider-horizontal`]:{marginBlock:e.marginXS,marginInline:e.marginLG}},[`${t}-header${t}-header-collapsible`]:{paddingBlock:e.paddingXS}}},[`${t}-tabs`]:{[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:e.marginXS,paddingInlineStart:e.padding}},[`${e.antCls}-tabs-bottom > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingInlineStart:e.padding}},[`${e.antCls}-tabs-left`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-left > ${e.antCls}-tabs-nav`]:{marginInlineEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}},[`${e.antCls}-tabs-right`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-right > ${e.antCls}-tabs-nav`]:{[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}}}}},Sd=24,ZC=(e,t)=>{const{componentCls:n}=t;return e===0?{[`${n}-col-0`]:{display:"none"}}:{[`${n}-col-${e}`]:{flexShrink:0,width:`${e/Sd*100}%`}}},JC=e=>Array(Sd+1).fill(1).map((t,n)=>ZC(n,e));function XC(e){return Je("ProCard",t=>{const n={...t,componentCls:`.${e}`};return[GC(n),JC(n)]})}const{useBreakpoint:QC}=c.Grid,Cd=d.forwardRef((e,t)=>{var ze;const{className:n,rootClassName:r,style:a,styles:i,title:o,subTitle:l,extra:u,wrap:m=!1,layout:g,loading:f,gutter:h=0,tooltip:p,split:S,headerBordered:y=!1,variant:w,cover:v,classNames:x,boxShadow:C=!1,children:j,size:b,actions:T,ghost:R=!1,hoverable:F=!1,direction:E,collapsed:M,collapsible:k=!1,collapsibleIconRender:V,colStyle:_,defaultCollapsed:A=!1,onCollapse:I,checked:$,onChecked:D,tabs:O,type:z,...Z}=e,L=w??"outlined",U={header:i==null?void 0:i.header,body:i==null?void 0:i.body,root:i==null?void 0:i.root,extra:i==null?void 0:i.extra,title:i==null?void 0:i.title,actions:i==null?void 0:i.actions,cover:i==null?void 0:i.cover},{getPrefixCls:J}=d.useContext(c.ConfigProvider.ConfigContext),G=QC()||{lg:!0,md:!0,sm:!0,xl:!1,xs:!1,xxl:!1},[H,B]=it(A,M),W=we(ve=>{I==null||I(ve)}),N=d.useCallback(ve=>{B(Ie=>{const Oe=typeof ve=="function"?ve(Ie):ve;return queueMicrotask(()=>{W(Oe)}),Oe})},[W]),q=["xxl","xl","lg","md","sm","xs"],ee=O==null?void 0:O.items,ne=ve=>{const Ie=[0,0];return(Array.isArray(ve)?ve:[ve,0]).forEach((ct,rt)=>{if(typeof ct=="object")for(let Ne=0;Ne<q.length;Ne+=1){const ot=q[Ne];if(G[ot]&&ct[ot]!==void 0){Ie[rt]=ct[ot];break}}else Ie[rt]=ct||0}),Ie},X=(ve,Ie)=>ve?Ie:{},ae=ve=>{let Ie=ve;if(typeof ve=="object")for(let ct=0;ct<q.length;ct+=1){const rt=q[ct];if(G!=null&&G[rt]&&(ve==null?void 0:ve[rt])!==void 0){Ie=ve[rt];break}}const Oe=X(typeof Ie=="string"&&/\d%|\dpx/i.test(Ie),{width:Ie,flexShrink:0});return{span:Ie,colSpanStyle:Oe}},oe=J("pro-card"),{wrapSSR:ue,hashId:ge}=XC(oe),[me,he]=ne(h);let Q=!1;const se=d.Children.toArray(j),Se=se.map((ve,Ie)=>{var Oe;if((Oe=ve==null?void 0:ve.type)!=null&&Oe.isProCard){Q=!0;const{colSpan:ct}=ve.props,{span:rt,colSpanStyle:Ne}=ae(ct),ot=le([`${oe}-col`],ge,{[`${oe}-split-vertical`]:S==="vertical"&&Ie!==se.length-1,[`${oe}-split-horizontal`]:S==="horizontal"&&Ie!==se.length-1,[`${oe}-col-${rt}`]:typeof rt=="number"&&rt>=0&&rt<=24}),Lt=ue(s.jsx("div",{style:{...Ne,...X(me>0,{paddingInlineEnd:me/2,paddingInlineStart:me/2}),...X(he>0,{paddingBlockStart:he/2,paddingBlockEnd:he/2}),..._},className:ot,children:d.cloneElement(ve)}));return d.cloneElement(Lt,{key:`pro-card-col-${(ve==null?void 0:ve.key)||Ie}`})}return ve}),Fe=le(`${oe}`,n,r,ge,x==null?void 0:x.root,{[`${oe}-border`]:L==="outlined",[`${oe}-box-shadow`]:C,[`${oe}-contain-card`]:Q,[`${oe}-loading`]:f,[`${oe}-split`]:S==="vertical"||S==="horizontal",[`${oe}-ghost`]:R,[`${oe}-hoverable`]:F,[`${oe}-size-${b}`]:b,[`${oe}-type-${z}`]:z,[`${oe}-collapse`]:H,[`${oe}-checked`]:$}),ie=le(`${oe}-body`,ge,x==null?void 0:x.body,{[`${oe}-body-center`]:g==="center",[`${oe}-body-direction-column`]:S==="horizontal"||E==="column",[`${oe}-body-wrap`]:m&&Q}),Y=(ze=U.body)==null?void 0:ze.padding,K=d.isValidElement(f)?f:s.jsx(qC,{prefix:oe,style:Y===0||Y==="0px"?{padding:24}:void 0}),re=d.useCallback(()=>{k==="icon"&&N(ve=>!ve)},[k,N]),fe=k&&(V?s.jsx("span",{role:"button",tabIndex:k==="icon"?0:void 0,className:le(`${oe}-collapsible-icon`,ge),onClick:k==="icon"?re:void 0,onKeyDown:k==="icon"?ve=>{(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),re())}:void 0,children:V({collapsed:H})}):s.jsx(de.RightOutlined,{onClick:re,rotate:H?void 0:90,className:le(`${oe}-collapsible-icon`,ge)})),be=le(`${oe}-header`,ge,x==null?void 0:x.header,{[`${oe}-header-border`]:y||z==="inner",[`${oe}-header-collapsible`]:fe}),Ee=le(`${oe}-title`,ge,x==null?void 0:x.title),je=le(`${oe}-extra`,ge,x==null?void 0:x.extra),_e={...U.root,...a};return ue(s.jsxs("div",{className:Fe,style:_e,ref:t,onClick:ve=>{var Ie;D==null||D(ve),(Ie=Z==null?void 0:Z.onClick)==null||Ie.call(Z,ve)},...We(Z,["prefixCls","colSpan"]),children:[(o||u||fe)&&s.jsxs("div",{className:be,style:U.header,onClick:()=>{(k==="header"||k===!0)&&N(!H)},children:[s.jsxs("div",{className:Ee,style:U.title,children:[fe,s.jsx(lr,{label:o,tooltip:p,subTitle:l})]}),u&&s.jsx("div",{className:je,style:U.extra,onClick:ve=>ve.stopPropagation(),children:u})]}),v&&!H&&s.jsx("div",{className:le(`${oe}-cover`,ge,x==null?void 0:x.cover),style:U.cover,children:v}),O?s.jsx("div",{className:le(`${oe}-tabs`,ge),children:s.jsx(c.Tabs,{onChange:O.onChange,...We(O,["cardProps"]),items:ee,children:f?K:j})}):s.jsx("div",{className:ie,style:U.body,children:f?K:Se}),T?s.jsx(ip,{actions:T,prefixCls:oe}):null]}))});function ew(e){return Je("ProCardDivider",()=>({}))}const tw=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),r=`${t("pro-card")}-divider`,{wrapSSR:a,hashId:i}=ew(),{className:o,style:l={},orientation:u="vertical"}=e,m=le(r,o,i,{[`${r}-${u}`]:u});return a(s.jsx("div",{className:m,style:l}))},nw=e=>{const{styles:t,...n}=e;return s.jsx(Cd,{...n,styles:{...t,body:{...t==null?void 0:t.body,padding:0}}})},Sa=Cd;Sa.isProCard=!0;Sa.Divider=tw;Sa.Group=nw;var Vs={exports:{}},rw=Vs.exports,Ql;function sw(){return Ql||(Ql=1,(function(e,t){(function(n,r){e.exports=r()})(rw,(function(){return function(n,r){var a=r.prototype,i=a.format;a.format=function(o){var l=this,u=this.$locale();if(!this.isValid())return i.bind(this)(o);var m=this.$utils(),g=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return u.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return u.ordinal(l.week(),"W");case"w":case"ww":return m.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return m.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return m.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return i.bind(this)(g)}}}))})(Vs)),Vs.exports}var aw=sw();const wd=qt(aw);var Hs={exports:{}},iw=Hs.exports,ec;function ow(){return ec||(ec=1,(function(e,t){(function(n,r){e.exports=r()})(iw,(function(){var n="day";return function(r,a,i){var o=function(m){return m.add(4-m.isoWeekday(),n)},l=a.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),n);var g,f,h,p,S=o(this),y=(g=this.isoWeekYear(),f=this.$u,h=(f?i.utc:i)().year(g).startOf("year"),p=4-h.isoWeekday(),h.isoWeekday()>4&&(p+=7),h.add(p,n));return S.diff(y,"week")+1},l.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var u=l.startOf;l.startOf=function(m,g){var f=this.$utils(),h=!!f.u(g)||g;return f.p(m)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(m,g)}}}))})(Hs)),Hs.exports}var lw=ow();const jd=qt(lw);var Us={exports:{}},cw=Us.exports,tc;function uw(){return tc||(tc=1,(function(e,t){(function(n,r){e.exports=r()})(cw,(function(){return function(n,r,a){var i=r.prototype,o=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,h,p,S,y){var w=f.name?f:f.$locale(),v=o(w[h]),x=o(w[p]),C=v||x.map((function(b){return b.slice(0,S)}));if(!y)return C;var j=w.weekStart;return C.map((function(b,T){return C[(T+(j||0))%7]}))},u=function(){return a.Ls[a.locale()]},m=function(f,h){return f.formats[h]||(function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,y,w){return y||w.slice(1)}))})(f.formats[h.toUpperCase()])},g=function(){var f=this;return{months:function(h){return h?h.format("MMMM"):l(f,"months")},monthsShort:function(h){return h?h.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):l(f,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return m(f.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return g.bind(this)()},a.localeData=function(){var f=u();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(h){return m(f,h)},meridiem:f.meridiem,ordinal:f.ordinal}},a.months=function(){return l(u(),"months")},a.monthsShort=function(){return l(u(),"monthsShort","months",3)},a.weekdays=function(f){return l(u(),"weekdays",null,null,f)},a.weekdaysShort=function(f){return l(u(),"weekdaysShort","weekdays",3,f)},a.weekdaysMin=function(f){return l(u(),"weekdaysMin","weekdays",2,f)}}}))})(Us)),Us.exports}var dw=uw();const vd=qt(dw);var Ys={exports:{}},fw=Ys.exports,nc;function hw(){return nc||(nc=1,(function(e,t){(function(n,r){e.exports=r()})(fw,(function(){return function(n,r){r.prototype.weekday=function(a){var i=this.$locale().weekStart||0,o=this.$W,l=(o<i?o+7:o)-i;return this.$utils().u(a)?l:this.subtract(l,"day").add(a,"day")}}}))})(Ys)),Ys.exports}var mw=hw();const Td=qt(mw);var Ks={exports:{}},gw=Ks.exports,rc;function pw(){return rc||(rc=1,(function(e,t){(function(n,r){e.exports=r()})(gw,(function(){var n="week",r="year";return function(a,i,o){var l=i.prototype;l.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var g=o(this).startOf(r).add(1,r).date(m),f=o(this).endOf(n);if(g.isBefore(f))return 1}var h=o(this).startOf(r).date(m).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},l.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}}))})(Ks)),Ks.exports}var yw=pw();const vo=qt(yw),sc=(e,t)=>typeof t!="object"?e[t]||t:e[t==null?void 0:t.value]||t.label,xw=(e,t)=>{const{label:n,prefixCls:r,onChange:a,value:i,mode:o,defaultValue:l,labelVariant:u,size:m,showSearch:g,disabled:f,style:h,className:p,options:S,onSearch:y,allowClear:w,labelInValue:v,fieldNames:x,lightLabel:C,labelTrigger:j,optionFilterProp:b,optionLabelProp:T="",valueMaxLength:R=41,fetchDataOnSearch:F=!1,fetchData:E,variant:M="outlined",...k}=e,{placeholder:V=n}=e,{label:_="label",value:A="value"}=x||{},{getPrefixCls:I}=d.useContext(c.ConfigProvider.ConfigContext),$=I("pro-field-select-light-select"),[D,O]=d.useState(!1),[z,Z]=d.useState(""),{wrapSSR:L,hashId:U}=Je("LightSelect",B=>({[`.${$}`]:{[`${B.antCls}-select`]:{position:"absolute",width:"153px",height:"28px",visibility:"hidden",opacity:0,"&-selector":{height:28}},[`&.${$}-searchable`]:{[`${B.antCls}-select`]:{width:"200px","&-selector":{height:28}}}}})),J=d.useMemo(()=>{const B={};return S==null||S.forEach(W=>{const N=W[T]||W[_],q=W[A];B[q]=N||q}),B},[_,S,A,T]),G=d.useMemo(()=>Reflect.has(k,"open")?k==null?void 0:k.open:D,[D,k]),H=Array.isArray(i)?i.map(B=>sc(J,B)):sc(J,i);return L(s.jsxs("div",{className:le($,U,{[`${$}-searchable`]:g},`${$}-container-${k.placement||"bottomLeft"}`,p),style:h,onClick:B=>{var N,q,ee;if(f)return;((ee=(q=(N=C==null?void 0:C.current)==null?void 0:N.labelRef)==null?void 0:q.current)==null?void 0:ee.contains(B.target))||O(!0)},children:[s.jsx(c.Select,{...k,allowClear:w,value:i,mode:o,labelInValue:v,size:m,disabled:f,variant:M,onChange:(B,W)=>{a==null||a(B,W),o!=="multiple"&&O(!1)},showSearch:g,onSearch:g?B=>{F&&E&&E(B),y==null||y(B)}:void 0,style:h,popupRender:B=>s.jsxs("div",{ref:t,children:[g&&s.jsx("div",{style:{margin:"4px 8px"},children:s.jsx(c.Input,{value:z,allowClear:!!w,onChange:W=>{Z(W.target.value),F&&E&&E(W.target.value),y==null||y(W.target.value)},onKeyDown:W=>{if(W.key==="Backspace"){W.stopPropagation();return}(W.key==="ArrowUp"||W.key==="ArrowDown")&&W.preventDefault()},style:{width:"100%"},prefix:s.jsx(de.SearchOutlined,{})})}),B]}),open:G,onOpenChange:B=>{var W;B||Z(""),j||O(B),(W=k==null?void 0:k.onOpenChange)==null||W.call(k,B)},prefixCls:r,options:y||!z?S:S==null?void 0:S.filter(B=>{var W,N,q,ee,ne;return b?bn(B[b]).join("").toLowerCase().includes(z):((N=(W=String(B[_]))==null?void 0:W.toLowerCase())==null?void 0:N.includes(z==null?void 0:z.toLowerCase()))||((ne=(ee=(q=B[A])==null?void 0:q.toString())==null?void 0:ee.toLowerCase())==null?void 0:ne.includes(z==null?void 0:z.toLowerCase()))})}),s.jsx(Zt,{ellipsis:!0,label:n,placeholder:V,disabled:f,variant:u,allowClear:!!w,value:H||(i==null?void 0:i.label)||i,onClear:()=>{a==null||a(void 0,void 0)},onClick:()=>{f||O(!D)},ref:C,valueMaxLength:R})]}))},bw=d.forwardRef(xw),Sw=(e,t)=>{const{optionItemRender:n,mode:r,onSearch:a,onFocus:i,onChange:o,autoClearSearchValue:l=!0,searchOnFocus:u=!1,resetAfterSelect:m=!1,fetchDataOnSearch:g=!0,optionFilterProp:f="label",optionLabelProp:h="label",className:p,disabled:S,options:y,fetchData:w,resetData:v,prefixCls:x,onClear:C,searchValue:j,showSearch:b,fieldNames:T,defaultSearchValue:R,preserveOriginalLabel:F=!1,...E}=e,{label:M="label",value:k="value",options:V="options"}=T||{},[_,A]=it(R,j),I=d.useRef();d.useImperativeHandle(t,()=>I.current),d.useEffect(()=>{var U;E.autoFocus&&((U=I==null?void 0:I.current)==null||U.focus())},[E.autoFocus]);const{getPrefixCls:$}=d.useContext(c.ConfigProvider.ConfigContext),D=$("pro-filed-search-select",x),O=le(D,p,{[`${D}-disabled`]:S}),z=(U,J)=>{if(U&&typeof U.label=="string"&&U.label)return U.label;if(U&&U.text&&typeof U.text=="string")return U.text;if(U&&U.label)return String(U.label);if(U&&U.text)return String(U.text);if(J&&J.label){const G=J.label;return(d.isValidElement(G)||G&&typeof G=="object"&&"props"in G)&&G.props&&G.props.label?String(G.props.label):typeof G=="string"?G:String(G)}return""},Z=(U,J)=>Array.isArray(U)&&Array.isArray(J)&&U.length>0?U.map((G,H)=>{const B=J==null?void 0:J[H],W=B==null?void 0:B["data-item"],N=z(W,G);return{...W||{},...G,label:N||G.label}}):[],L=U=>U.map((J,G)=>{const{className:H,optionType:B,...W}=J,N=J[M]??J.text,q=J[k],ee=J[V]??[];return B==="optGroup"||J.options?{label:N,...W,data_title:N,title:N,key:q??`${N==null?void 0:N.toString()}-${G}-${Kr()}`,children:L(ee)}:{title:N,...W,data_title:N,value:q??G,key:q??`${N==null?void 0:N.toString()}-${G}-${Kr()}`,"data-item":J,className:`${D}-option ${H||""}`.trim(),label:(n==null?void 0:n(J))||N}});return s.jsx(c.Select,{ref:I,className:O,allowClear:!0,autoClearSearchValue:l,disabled:S,mode:r,showSearch:b,searchValue:_,optionFilterProp:f,optionLabelProp:h,onClear:()=>{C==null||C(),w(void 0),b&&(a==null||a(""),A(""))},...E,filterOption:E.filterOption==!1?!1:(U,J)=>{var H,B;const G=_===""?"":U||_;return G?E.filterOption&&typeof E.filterOption=="function"?E.filterOption(G,{...J,label:J==null?void 0:J.data_title}):!!((H=J==null?void 0:J.data_title)!=null&&H.toString().toLowerCase().includes(G.toLowerCase())||(B=J==null?void 0:J[f])!=null&&B.toString().toLowerCase().includes(G.toLowerCase())):!0},onSearch:b?U=>{g&&w(U),a==null||a(U),A(U)}:void 0,onChange:(U,J,...G)=>{if(b&&l&&(w(void 0),a==null||a(""),A("")),!e.labelInValue){o==null||o(U,J,...G);return}if(r!=="multiple"&&!Array.isArray(J)){let W=J&&J["data-item"];if(!W&&U&&y){const N=U[k]??U.value,q=ee=>{for(const ne of ee){if((ne[k]??ne.value)===N)return ne;if(ne[V]||ne.options){const ae=q(ne[V]||ne.options||[]);if(ae)return ae}}return null};W=q(y)}if(!U||!W){const N=z(W,U),q=U&&{...U,label:N};o==null||o(q,J,...G)}else{const N=z(W,U);o==null||o({...U,...W,label:N},J,...G)}return}const H=Z(U,J);o==null||o(H,J,...G),m&&v()},onFocus:U=>{u&&(w(void 0),b&&(a==null||a(""),A(""))),i==null||i(U)},options:L(y||[])})},Cw=d.forwardRef(Sw),ww=({label:e,words:t})=>{const{getPrefixCls:n}=d.useContext(c.ConfigProvider.ConfigContext),r=n("pro-select-item-option-content-light"),a=n("pro-select-item-option-content"),{wrapSSR:i}=Je("Highlight",m=>({[`.${r}`]:{color:m.colorPrimary},[`.${a}`]:{flex:"auto",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})),o=new RegExp(t.map(m=>m.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")).join("|"),"gi");let l=e;const u=[];for(;l.length;){const m=o.exec(l);if(!m){u.push(l);break}const g=m.index,f=m[0].length+g;u.push(l.slice(0,g),d.createElement("span",{className:r},l.slice(g,f))),l=l.slice(f)}return i(d.createElement("div",{title:e,className:a},...u))};function Bi(e,t){var n,r;return!!(!t||(n=e==null?void 0:e.label)!=null&&n.toString().toLowerCase().includes(t.toLowerCase())||(r=e==null?void 0:e.value)!=null&&r.toString().toLowerCase().includes(t.toLowerCase())||(e.children||e.options)&&[...e.children||[],e.options||[]].find(i=>Bi(i,t)))}const Fd=e=>{const t=[],n=rn(e);return n.forEach((r,a)=>{const i=n.get(a)||n.get(`${a}`);if(i){if(typeof i=="object"&&(i!=null&&i.text)){t.push({text:i==null?void 0:i.text,value:a,label:i==null?void 0:i.text,disabled:i.disabled});return}t.push({text:i,value:a})}}),t},pr=e=>{var w,v;const{cacheForSwr:t,fieldProps:n}=e,[r,a]=d.useState(e.defaultKeyWords),[i]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():e.request?Kr():"no-fetch"),o=d.useRef(i),l=we(x=>Fd(rn(x)).map(({value:C,text:j,...b})=>({label:j,value:C,key:C,...b}))),u=gt(()=>{if(!n)return;const x=(n==null?void 0:n.options)||(n==null?void 0:n.treeData);if(!x)return;const{children:C,label:j,value:b}=n.fieldNames||{},T=(R,F)=>{if(!(R!=null&&R.length))return;const E=R.length;let M=0;for(;M<E;){const k=R[M++];(k[C]||k[j]||k[b])&&(k[F]=k[F==="children"?C:F==="label"?j:b],T(k[C],F))}};return C&&T(x,"children"),j&&T(x,"label"),b&&T(x,"value"),x},[n]),[m,g]=it(()=>e.valueEnum?l(e.valueEnum):[],u);nr(()=>{var x,C;!e.valueEnum||(x=e.fieldProps)!=null&&x.options||(C=e.fieldProps)!=null&&C.treeData||g(l(e.valueEnum))},[e.valueEnum]);const f=Op([o.current,e.params,r],e.debounceTime??((w=e==null?void 0:e.fieldProps)==null?void 0:w.debounceTime)??0,[e.params,r]),{data:h,mutate:p,isValidating:S}=zu(()=>e.request?f:null,([,x,C])=>e.request({...x,keyWords:C},e),{revalidateIfStale:!t,revalidateOnReconnect:t,shouldRetryOnError:!1,revalidateOnFocus:!1}),y=d.useMemo(()=>{var C,j;const x=m==null?void 0:m.map(b=>{if(typeof b=="string")return{label:b,value:b};if(b.children||b.options){const T=[...b.children||[],...b.options||[]].filter(R=>Bi(R,r));return{...b,children:T,options:T}}return b});return((C=e.fieldProps)==null?void 0:C.filterOption)===!0||((j=e.fieldProps)==null?void 0:j.filterOption)===void 0?x==null?void 0:x.filter(b=>b?r?Bi(b,r):!0:!1):x},[m,r,(v=e.fieldProps)==null?void 0:v.filterOption]);return[S,e.request?h:y,x=>{a(x)},()=>{a(void 0),p([],!1)}]},jw=(e,t)=>{var k,V;const{mode:n,valueEnum:r,render:a,formItemRender:i,request:o,fieldProps:l,light:u,proFieldKey:m,params:g,label:f,variant:h,id:p,lightLabel:S,labelTrigger:y,...w}=e,v=d.useRef(),x=ke(),C=d.useRef(""),{fieldNames:j}=l;d.useEffect(()=>{C.current=l==null?void 0:l.searchValue},[l==null?void 0:l.searchValue]);const[b,T,R,F]=pr(e),{componentSize:E}=((V=(k=c.ConfigProvider)==null?void 0:k.useConfig)==null?void 0:V.call(k))||{componentSize:"middle"};d.useImperativeHandle(t,()=>({...v.current||{},fetchData:_=>R(_)}),[R]);const M=d.useMemo(()=>{if(n!=="read")return;const{label:_="label",value:A="value",options:I="options"}=j||{},$=new Map,D=O=>{if(!(O!=null&&O.length))return $;const z=O.length;let Z=0;for(;Z<z;){const L=O[Z++];$.set(L[A],L[_]),D(L[I])}return $};return D(T)},[j,n,T]);if(n==="read"){const _=s.jsx(s.Fragment,{children:Ln(w.text,rn(r||M))});return a?a(_,{mode:n,...l},_)??null:_}if(n==="edit"||n==="update"){const A=u?s.jsx(bw,{id:p,loading:b,ref:v,allowClear:!0,size:E,options:T,label:f,labelVariant:h,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),lightLabel:S,labelTrigger:y,fetchData:R,...l}):s.jsx(Cw,{className:w.className,style:{minWidth:100,...w.style},id:p,loading:b,ref:v,allowClear:!0,defaultSearchValue:e.defaultKeyWords,notFoundContent:b?s.jsx(c.Spin,{size:"small"}):l==null?void 0:l.notFoundContent,fetchData:I=>{C.current=I??"",R(I),I===void 0&&(C.current="")},resetData:F,optionItemRender:I=>typeof I.label=="string"&&C.current?s.jsx(ww,{label:I.label,words:[C.current]}):I.label,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),label:f,...l,options:T},"SearchSelect");return i?i(w.text,{mode:n,...l,options:T,loading:b},A)??null:A}return null},js=d.forwardRef(jw),vw=({placeholder:e,formItemRender:t,mode:n,render:r,label:a,light:i,variant:o,...l},u)=>{var C;const{getPrefixCls:m}=d.useContext(c.ConfigProvider.ConfigContext),g=m("pro-field-cascader"),[f,h,p]=pr(l),S=ke(),y=d.useRef(),[w,v]=d.useState(!1);d.useImperativeHandle(u,()=>({...y.current||{},fetchData:j=>p(j)}),[p]);const x=d.useMemo(()=>{var E;if(n!=="read")return;const{value:j="value",label:b="label",children:T="children"}=((E=l.fieldProps)==null?void 0:E.fieldNames)||{},R=new Map,F=M=>{if(!(M!=null&&M.length))return R;const k=M.length;let V=0;for(;V<k;){const _=M[V++];R.set(_[j],_[b]),F(_[T])}return R};return F(h)},[n,h,(C=l.fieldProps)==null?void 0:C.fieldNames]);if(n==="read"){const j=s.jsx(s.Fragment,{children:Ln(l.text,rn(l.valueEnum||x))});return r?r(l.text,{mode:n,...l.fieldProps},j)??null:j}if(n==="edit"){const j=l.fieldProps||{};let b=s.jsx(c.Cascader,{ref:y,open:w,suffixIcon:f?s.jsx(de.LoadingOutlined,{}):void 0,placeholder:e||S.getMessage("tableForm.selectPlaceholder","请选择"),allowClear:(j==null?void 0:j.allowClear)!==!1,...j,onOpenChange:T=>{var R;(R=j==null?void 0:j.onOpenChange)==null||R.call(j,T),v(T)},className:le(j==null?void 0:j.className,g),options:h});if(t&&(b=t(l.text,{mode:n,...j,options:h,loading:f},b)??null),i){const{disabled:T,value:R}=j,F=!!R&&(R==null?void 0:R.length)!==0;return s.jsx(Zt,{label:a,disabled:T,variant:o,value:F||w?b:null,style:F?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:F||w?!1:void 0,onClick:()=>{var E;v(!0),(E=j==null?void 0:j.onOpenChange)==null||E.call(j,!0)}})}return b}return null},ac=d.forwardRef(vw),Tw=({layout:e="horizontal",formItemRender:t,mode:n,render:r,...a},i)=>{var w,v,x,C,j;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-checkbox"),u=(v=(w=c.Form.Item)==null?void 0:w.useStatus)==null?void 0:v.call(w),[m,g,f]=pr(a),{wrapSSR:h,hashId:p}=Je("Checkbox",b=>({[`.${l}`]:{"&-error":{span:{color:b.colorError}},"&-warning":{span:{color:b.colorWarning}},"&-vertical":{[`&${b.antCls}-checkbox-group`]:{display:"inline-block"},[`${b.antCls}-checkbox-wrapper+${b.antCls}-checkbox-wrapper`]:{"margin-inline-start":"0 !important"},[`${b.antCls}-checkbox-group-item`]:{display:"flex",marginInlineEnd:0}}}})),{token:S}=(C=(x=c.theme).useToken)==null?void 0:C.call(x),y=d.useRef();if(d.useImperativeHandle(i,()=>({...y.current||{},fetchData:b=>f(b)}),[f]),m)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const b=g!=null&&g.length?g==null?void 0:g.reduce((R,F)=>({...R,[F.value??""]:F.label}),{}):void 0,T=Ln(a.text,rn(a.valueEnum||b));return r?r(a.text,{mode:n,...a.fieldProps},s.jsx(s.Fragment,{children:T}))??null:s.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:S.marginSM},children:T})}if(n==="edit"){const{fieldNames:b,variant:T,...R}=a.fieldProps||{},F=h(s.jsx(c.Checkbox.Group,{...R,variant:T,className:le((j=a.fieldProps)==null?void 0:j.className,p,`${l}-${e}`,{[`${l}-error`]:(u==null?void 0:u.status)==="error",[`${l}-warning`]:(u==null?void 0:u.status)==="warning"}),options:g}));return t?t(a.text,{mode:n,...a.fieldProps,options:g,loading:m},F)??null:F}return null},ic=d.forwardRef(Tw),Fw=(e,t)=>{if(typeof e!="string")return e;try{if(t==="json")return JSON.stringify(JSON.parse(e),null,2)}catch{}return e},Rw=({text:e,mode:t,render:n,language:r="text",formItemRender:a,fieldProps:i},o)=>{const l=Fw(e,r),{token:u}=yn.useToken();if(t==="read"){const m=s.jsx("pre",{ref:o,...i,style:{padding:16,overflow:"auto",fontSize:"85%",lineHeight:1.45,color:u.colorTextSecondary,fontFamily:u.fontFamilyCode,backgroundColor:"rgba(150, 150, 150, 0.1)",borderRadius:3,width:"min-content",...i.style},children:s.jsx("code",{children:l})});return n?n(l,{mode:t,...i,ref:o},m):m}if(t==="edit"||t==="update"){i.value=l;const m=s.jsx(c.Input.TextArea,{rows:5,...i,ref:o});return a?a(l,{mode:t,...i,ref:o},m)??null:m}return null},vs=d.forwardRef(Rw),$w={label:"Recommended",colors:["#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB","#722ED1","#EB2F96","#F5222D4D","#FA8C164D","#FADB144D","#8BBB114D","#52C41A4D","#13A8A84D","#1677FF4D","#2F54EB4D","#722ED14D","#EB2F964D"]},Ew=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-color-picker");if(t==="read"){const u=s.jsx(c.ColorPicker,{value:e,className:le({[l]:!0}),open:!1});return n?n(e,{mode:t,...a},u):u}if(t==="edit"||t==="update"){const u={display:"table-cell",...a.style},m=s.jsx(c.ColorPicker,{ref:i,presets:[$w],...a,style:u,className:le({[l]:!0})});return r?r(e,{mode:t,...a,style:u},m):m}return null},oc=d.forwardRef(Ew);Re.extend(vo);const Iw=(e,t)=>e?typeof t=="function"?t(Re(e)):Re(e).format((Array.isArray(t)?t[0]:t)||"YYYY-MM-DD"):"-",Mw=({text:e,mode:t,format:n="YYYY-MM-DD",label:r,light:a,render:i,formItemRender:o,showTime:l,fieldProps:u,picker:m,lightLabel:g,variant:f},h)=>{const p=ke(),[S,y]=d.useState(!1);if(t==="read"){const w=Iw(e,u.format||n);return i?i(e,{mode:t,...u},s.jsx(s.Fragment,{children:w})):s.jsx(s.Fragment,{children:w})}if(t==="edit"||t==="update"){let w;const{disabled:v,value:x,placeholder:C=p.getMessage("tableForm.selectPlaceholder","请选择")}=u,j=mr(x);return a?w=s.jsx(Zt,{label:r,onClick:()=>{var b;(b=u==null?void 0:u.onOpenChange)==null||b.call(u,!0),y(!0)},style:j?{paddingInlineEnd:0}:void 0,disabled:v,value:j||S?s.jsx(c.DatePicker,{picker:m,showTime:l,format:n,ref:h,...u,value:j,onOpenChange:b=>{var T;y(b),(T=u==null?void 0:u.onOpenChange)==null||T.call(u,b)},open:S}):void 0,allowClear:!1,downIcon:j||S?!1:void 0,variant:f,ref:g}):w=s.jsx(c.DatePicker,{picker:m,showTime:l,format:n,placeholder:C,variant:f,ref:h,...u,value:j}),o?o(e,{mode:t,...u},w):w}return null},Rt=d.forwardRef(Mw);function kw(e){return kt(e)||e===""||(e==null?void 0:e.trim())===""}const Aw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i},o)=>{var g;const l=ke(),u=r||l.getMessage("tableForm.inputPlaceholder","请输入"),m=d.useCallback(f=>{let h=f??void 0;if(!i.stringMode&&typeof h=="string"){const p=Number(h);if(isNaN(p)){const S=h.match(/^(\d+(?:\.\d+)?)/);S?h=Number(S[1]):h=void 0}else h=p}return typeof h=="number"&&!kt(h)&&!kt(i.precision)&&(h=Number(h.toFixed(i.precision))),h},[i]);if(t==="read"){let f={};i!=null&&i.precision&&(f={minimumFractionDigits:Number(i.precision),maximumFractionDigits:Number(i.precision)});const h=new Intl.NumberFormat(void 0,{...f,...(i==null?void 0:i.intlProps)||{}}).format(Number(e)),p=i!=null&&i.stringMode?s.jsx("span",{children:e}):s.jsx("span",{ref:o,children:((g=i==null?void 0:i.formatter)==null?void 0:g.call(i,h))||h});return n?n(e,{mode:t,...i},p):p}if(t==="edit"||t==="update"){const f=s.jsx(c.InputNumber,{ref:o,min:0,placeholder:u,...We(i,["onChange","onBlur"]),onChange:h=>{var p;return(p=i==null?void 0:i.onChange)==null?void 0:p.call(i,m(h))},onBlur:h=>{var y,w,v;const p=h.target.value;if(kw(p)){(y=i==null?void 0:i.onBlur)==null||y.call(i,h);return}const S=m(p);h.target&&typeof S=="number"&&(h.target.value=S.toString(),(w=i==null?void 0:i.onChange)==null||w.call(i,S)),(v=i==null?void 0:i.onBlur)==null||v.call(i,h)}});return a?a(e,{mode:t,...i},f):f}return null},aa=d.forwardRef(Aw),Ow=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i,separator:o="~",separatorWidth:l=30},u)=>{const{value:m,defaultValue:g,onChange:f,id:h}=i,p=ke(),{token:S}=yn.useToken(),[y,w]=it(()=>g,m),v=d.useCallback(C=>{w(j=>{const b=typeof C=="function"?C(j):C;return f==null||f(b),b})},[f]),x=d.useRef(y);if(t==="read"){const C=b=>{var R;const T=new Intl.NumberFormat(void 0,{minimumSignificantDigits:2,...(i==null?void 0:i.intlProps)||{}}).format(Number(b));return((R=i==null?void 0:i.formatter)==null?void 0:R.call(i,T))||T},j=s.jsxs("span",{ref:u,children:[C(e[0])," ",o," ",C(e[1])]});return n?n(e,{mode:t,...i},j):j}if(t==="edit"||t==="update"){const C=()=>{if(Array.isArray(x.current)){const[F,E]=x.current;if(typeof F=="number"&&typeof E=="number"&&F>E){v([E,F]);return}F===void 0&&E===void 0&&v(void 0)}},j=(F,E)=>{const M=[...y||[]];M[F]=E===null?void 0:E,x.current=M,v(M)},b=(i==null?void 0:i.placeholder)||r||[p.getMessage("tableForm.inputPlaceholder","请输入"),p.getMessage("tableForm.inputPlaceholder","请输入")],T=F=>Array.isArray(b)?b[F]:b,R=s.jsxs(c.Space.Compact,{block:!0,onBlur:C,children:[s.jsx(c.InputNumber,{...i,placeholder:T(0),id:h??`${h}-0`,style:{width:`calc((100% - ${l}px) / 2)`},value:y==null?void 0:y[0],defaultValue:g==null?void 0:g[0],onChange:F=>j(0,F)}),s.jsx(c.Input,{style:{width:l,textAlign:"center",borderInlineStart:0,borderInlineEnd:0,pointerEvents:"none",backgroundColor:S==null?void 0:S.colorBgContainer},placeholder:o,disabled:!0}),s.jsx(c.InputNumber,{...i,placeholder:T(1),id:h??`${h}-1`,style:{width:`calc((100% - ${l}px) / 2)`,borderInlineStart:0},value:y==null?void 0:y[1],defaultValue:g==null?void 0:g[1],onChange:F=>j(1,F)})]});return a?a(e,{mode:t,...i},R):R}return null},lc=d.forwardRef(Ow);var Ws={exports:{}},Dw=Ws.exports,cc;function Pw(){return cc||(cc=1,(function(e,t){(function(n,r){e.exports=r()})(Dw,(function(){return function(n,r,a){n=n||{};var i=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(m,g,f,h){return i.fromToBase(m,g,f,h)}a.en.relativeTime=o,i.fromToBase=function(m,g,f,h,p){for(var S,y,w,v=f.$locale().relativeTime||o,x=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],C=x.length,j=0;j<C;j+=1){var b=x[j];b.d&&(S=h?a(m).diff(f,b.d,!0):f.diff(m,b.d,!0));var T=(n.rounding||Math.round)(Math.abs(S));if(w=S>0,T<=b.r||!b.r){T<=1&&j>0&&(b=x[j-1]);var R=v[b.l];p&&(T=p(""+T)),y=typeof R=="string"?R.replace("%d",T):R(T,g,b.l,w);break}}if(g)return y;var F=w?v.future:v.past;return typeof F=="function"?F(y):F.replace("%s",y)},i.to=function(m,g){return l(m,g,this,!0)},i.from=function(m,g){return l(m,g,this)};var u=function(m){return m.$u?a.utc():a()};i.toNow=function(m){return this.to(u(this),m)},i.fromNow=function(m){return this.from(u(this),m)}}}))})(Ws)),Ws.exports}var Nw=Pw();const Lw=qt(Nw);Re.extend(Lw);const _w=({text:e,mode:t,variant:n,render:r,formItemRender:a,format:i,fieldProps:o},l)=>{const u=ke();if(t==="read"){const m=s.jsx(c.Tooltip,{title:Re(e).format((o==null?void 0:o.format)||i||"YYYY-MM-DD HH:mm:ss"),children:Re(e).fromNow()});return r?r(e,{mode:t,...o},s.jsx(s.Fragment,{children:m})):s.jsx(s.Fragment,{children:m})}if(t==="edit"||t==="update"){const m=u.getMessage("tableForm.selectPlaceholder","请选择"),g=mr(o.value),f=s.jsx(c.DatePicker,{ref:l,placeholder:m,showTime:!0,variant:n??(o==null?void 0:o.variant)??"outlined",...o,value:g});return a?a(e,{mode:t,...o},f):f}return null},uc=d.forwardRef(_w),dc=d.forwardRef(({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i,width:o},l)=>{const u=ke(),m=i||u.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const g=s.jsx(c.Image,{ref:l,width:o||32,src:e,...a});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(c.Input,{ref:l,placeholder:m,...a});return r?r(e,{mode:t,...a},g):g}return null}),zw=({border:e=!1,children:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-index-column"),{wrapSSR:i,hashId:o}=Je("IndexColumn",()=>({[`.${a}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px","&-border":{color:"#fff",fontSize:"12px",lineHeight:"12px",backgroundColor:"#314659",borderRadius:"9px","&.top-three":{backgroundColor:"#979797"}}}}));return i(s.jsx("div",{ref:n,className:le(a,o,{[`${a}-border`]:e,"top-three":t>3}),children:t}))},Ts=d.forwardRef(zw),Rd=new Intl.NumberFormat("zh-Hans-CN",{currency:"CNY",style:"currency"}),Bw={style:"currency",currency:"USD"},Vw={style:"currency",currency:"RUB"},Hw={style:"currency",currency:"RSD"},Uw={style:"currency",currency:"MYR"},Yw={style:"currency",currency:"BRL"},Kw={default:Rd,"zh-Hans-CN":{currency:"CNY",style:"currency"},"en-US":Bw,"ru-RU":Vw,"ms-MY":Uw,"sr-RS":Hw,"pt-BR":Yw},fc=(e,t,n,r,a="")=>{let i=t==null?void 0:t.toString().replaceAll(",","");if(typeof i=="string"){const l=Number(i);if(Number.isNaN(l))return i;i=l}if(!i&&i!==0)return"";let o=!1;try{o=e!==!1&&Intl.NumberFormat.supportedLocalesOf([e.replace("_","-")],{localeMatcher:"lookup"}).length>0}catch{}try{const u=new Intl.NumberFormat(o&&e!==!1&&(e==null?void 0:e.replace("_","-"))||"zh-Hans-CN",{...Kw[e||"zh-Hans-CN"]||Rd,maximumFractionDigits:n,...r}).format(i),g=(h=>{const p=h.match(/\d+/);if(p){const S=p[0];return h.slice(h.indexOf(S))}else return h})(u),[f]=u||"";return["+","-"].includes(f)?`${a||""}${f}${g}`:`${a||""}${g}`}catch{return i}},ei=2,Ww=d.forwardRef(({contentRender:e,numberFormatOptions:t,numberPopoverRender:n,open:r,onOpenChange:a,...i},o)=>{const[l,u]=it(()=>i.defaultValue,i.value),[m,g]=d.useState(r??!1),f=d.useRef(!0);d.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),d.useEffect(()=>{r!==void 0&&g(r)},[r]);const h=d.useCallback(y=>{u(w=>{var x;const v=typeof y=="function"?y(w):y;return(x=i.onChange)==null||x.call(i,v),v})},[i.onChange,u]),p=d.useCallback(y=>{a==null||a(y),r===void 0&&queueMicrotask(()=>{f.current&&g(y)})},[r,a]),S=e==null?void 0:e({...i,value:l});return S?s.jsx(c.Popover,{placement:"topLeft",open:m,onOpenChange:p,trigger:["focus","click"],content:S,getPopupContainer:y=>(y==null?void 0:y.parentElement)||document.body,children:s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:h})}):s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:h})}),qw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,proFieldKey:i,valueEnum:o,placeholder:l,locale:u,customSymbol:m=a.customSymbol,numberFormatOptions:g=a==null?void 0:a.numberFormatOptions,numberPopoverRender:f=(a==null?void 0:a.numberPopoverRender)||!1,...h},p)=>{const S=(a==null?void 0:a.precision)??ei;let y=ke();u&&On[u]&&(y=On[u]);const w=l||y.getMessage("tableForm.inputPlaceholder","请输入"),v=d.useMemo(()=>{if(m)return m;if(!(h.moneySymbol===!1||a.moneySymbol===!1))return y.getMessage("moneySymbol","¥")},[m,a.moneySymbol,y,h.moneySymbol]),x=d.useCallback(C=>{const j=new RegExp(`\\B(?=(\\d{${3+Math.max(S-ei,0)}})+(?!\\d))`,"g"),[b,T]=String(C).split("."),R=b.replace(j,",");let F="";return T&&S>0&&(F=`.${T.slice(0,S===void 0?ei:S)}`),`${R}${F}`},[S]);if(t==="read"){const C=s.jsx("span",{ref:p,children:fc(u||!1,e,S,g??a.numberFormatOptions,v)});return n?n(e,{mode:t,...a},C):C}if(t==="edit"||t==="update"){const C=s.jsx(Ww,{contentRender:j=>{if(f===!1||!j.value)return null;const b=fc(v||u||!1,`${x(j.value)}`,S,{...g,notation:"compact"},v);return typeof f=="function"?f==null?void 0:f(j,b):b},ref:p,precision:S,formatter:j=>j&&v?`${v} ${x(j)}`:(j==null?void 0:j.toString())||j,parser:j=>v&&j?j.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),""):j,placeholder:w,...We(a,["numberFormatOptions","precision","numberPopoverRender","customSymbol","moneySymbol","visible","open"]),onBlur:a.onBlur?j=>{var T;let b=j.target.value;v&&b&&(b=b.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),"")),(T=a.onBlur)==null||T.call(a,b)}:void 0});return r?r(e,{mode:t,...a},C):C}return null},hc=d.forwardRef(qw),mc=e=>e.map((t,n)=>{var r;return d.isValidElement(t)?d.cloneElement(t,{key:n,...t==null?void 0:t.props,style:{...(r=t==null?void 0:t.props)==null?void 0:r.style}}):s.jsx(d.Fragment,{children:t},n)}),Gw=({text:e,mode:t,render:n,fieldProps:r},a)=>{const{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-field-option"),{token:l}=yn.useToken();if(d.useImperativeHandle(a,()=>({})),n){const u=n(e,{mode:t,...r},s.jsx(s.Fragment,{}));return!u||(u==null?void 0:u.length)<1||!Array.isArray(u)?null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:mc(u)})}return!e||!Array.isArray(e)?d.isValidElement(e)?e:null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:mc(e)})},gc=d.forwardRef(Gw),Zw=(e,t)=>{const n=ke(),{text:r,mode:a,render:i,formItemRender:o,fieldProps:l,...u}=We(e,["proFieldKey"]),[m,g]=it(()=>u.open||!1,u.open),f=d.useCallback(h=>{g(p=>{var y;const S=typeof h=="function"?h(p):h;return(y=u.onOpenChange)==null||y.call(u,S),S})},[u.onOpenChange]);if(a==="read"){let h=s.jsx(s.Fragment,{children:"-"});return r&&(h=s.jsxs(c.Space,{children:[s.jsx("span",{ref:t,children:m?r:"********"}),s.jsx("a",{onClick:()=>f(!m),children:m?s.jsx(de.EyeOutlined,{}):s.jsx(de.EyeInvisibleOutlined,{})})]})),i?i(r,{mode:a,...l},h):h}if(a==="edit"||a==="update"){const h=s.jsx(c.Input.Password,{placeholder:n.getMessage("tableForm.inputPlaceholder","请输入"),ref:t,...l});return o?o(r,{mode:a,...l},h):h}return null},rr=d.forwardRef(Zw);function Jw(e){return e===0?null:e>0?"+":"-"}function Xw(e){return e===0?"#595959":e>0?"#ff4d4f":"#52c41a"}function Qw(e,t=2){return t>=0?e==null?void 0:e.toFixed(t):e}function ia(e){return typeof e=="symbol"||e instanceof Symbol?NaN:Number(e)}const ej=({text:e,prefix:t,precision:n,suffix:r="%",mode:a,showColor:i=!1,render:o,formItemRender:l,fieldProps:u,placeholder:m,showSymbol:g},f)=>{const h=ke(),p=m||h.getMessage("tableForm.inputPlaceholder","请输入"),S=d.useMemo(()=>typeof e=="string"&&e.includes("%")?ia(e.replace("%","")):ia(e),[e]),y=d.useMemo(()=>typeof g=="function"?g==null?void 0:g(e):g,[g,e]);if(a==="read"){const w=i?{color:Xw(S)}:{},v=s.jsxs("span",{style:w,ref:f,children:[t&&s.jsx("span",{children:t}),y&&s.jsxs(d.Fragment,{children:[Jw(S)," "]}),Qw(Math.abs(S),n),r&&r]});return o?o(e,{mode:a,...u,prefix:t,precision:n,showSymbol:y,suffix:r},v):v}if(a==="edit"||a==="update"){const w=s.jsx(c.InputNumber,{ref:f,formatter:v=>v&&t?`${t} ${v}`.replace(/\B(?=(\d{3})+(?!\d)$)/g,","):v,parser:v=>v?v.replace(/.*\s|,/g,""):"",placeholder:p,...u});return l?l(e,{mode:a,...u},w):w}return null},pc=d.forwardRef(ej);function tj(e){return e===100?"success":e<0?"exception":e<100?"active":"normal"}const nj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=ke(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入"),m=d.useMemo(()=>typeof e=="string"&&e.includes("%")?ia(e.replace("%","")):ia(e),[e]);if(t==="read"){const g=s.jsx(c.Progress,{ref:o,size:"small",style:{minWidth:100,maxWidth:320},percent:m,steps:a==null?void 0:a.steps,status:tj(m),...a});return n?n(m,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(c.InputNumber,{ref:o,placeholder:u,...a});return r?r(e,{mode:t,...a},g):g}return null},yc=d.forwardRef(nj),rj=({radioType:e,formItemRender:t,mode:n,render:r,...a},i)=>{var y,w,v;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-radio"),[u,m,g]=pr(a),f=d.useRef(),h=(w=(y=c.Form.Item)==null?void 0:y.useStatus)==null?void 0:w.call(y);d.useImperativeHandle(i,()=>({...f.current||{},fetchData:x=>g(x)}),[g]);const{wrapSSR:p,hashId:S}=Je("FieldRadioRadio",x=>({[`.${l}-error`]:{span:{color:x.colorError}},[`.${l}-warning`]:{span:{color:x.colorWarning}},[`.${l}-vertical`]:{[`${x.antCls}-radio-wrapper`]:{display:"flex",marginInlineEnd:0}}}));if(u)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const x=m!=null&&m.length?m==null?void 0:m.reduce((j,b)=>({...j,[b.value??""]:b.label}),{}):void 0,C=s.jsx(s.Fragment,{children:Ln(a.text,rn(a.valueEnum||x))});return r?r(a.text,{mode:n,...a.fieldProps},C)??null:C}if(n==="edit"){const x=p(s.jsx(c.Radio.Group,{ref:f,optionType:e,...a.fieldProps,className:le((v=a.fieldProps)==null?void 0:v.className,{[`${l}-error`]:(h==null?void 0:h.status)==="error",[`${l}-warning`]:(h==null?void 0:h.status)==="warning"},S,`${l}-${a.fieldProps.layout||"horizontal"}`),options:m}));return t?t(a.text,{mode:n,...a.fieldProps,options:m,loading:u},x)??null:x}return null},Fs=d.forwardRef(rj),sj=({text:e,mode:t,light:n,label:r,format:a="YYYY-MM-DD",render:i,picker:o,formItemRender:l,showTime:u,lightLabel:m,variant:g,fieldProps:f},h)=>{const p=ke(),[S,y]=Array.isArray(e)?e:[],[w,v]=d.useState(!1),x=d.useCallback(b=>{var T;return typeof(f==null?void 0:f.format)=="function"?(T=f==null?void 0:f.format)==null?void 0:T.call(f,b):(f==null?void 0:f.format)||a||"YYYY-MM-DD"},[f,a]),C=S?Re(S).format(x(Re(S))):"",j=y?Re(y).format(x(Re(y))):"";if(t==="read"){const b=s.jsxs("div",{ref:h,style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return i?i(e,{mode:t,...f},s.jsx("span",{children:b})):b}if(t==="edit"||t==="update"){const b=mr(f.value);let T;const R=F=>{var E;(E=f==null?void 0:f.onChange)==null||E.call(f,F),F||v(!1)};return n?T=s.jsx(Zt,{label:r,onClick:()=>{var F;(F=f==null?void 0:f.onOpenChange)==null||F.call(f,!0),v(!0)},style:b?{paddingInlineEnd:0}:void 0,disabled:f.disabled,value:b||w?s.jsx(c.DatePicker.RangePicker,{picker:o,showTime:u,format:a,...f,placeholder:f.placeholder??[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],value:b,onOpenChange:F=>{var E;b&&v(F),(E=f==null?void 0:f.onOpenChange)==null||E.call(f,F)},onChange:R}):null,variant:g,allowClear:!1,ref:m,downIcon:b||w?!1:void 0}):T=s.jsx(c.DatePicker.RangePicker,{ref:h,format:a,showTime:u,placeholder:[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],...f,value:b}),l?l(e,{mode:t,...f},T):T}return null},$t=d.forwardRef(sj),aj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=s.jsx(c.Rate,{allowHalf:!0,disabled:!0,ref:i,...a,value:e});return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):o}if(t==="edit"||t==="update"){const o=s.jsx(c.Rate,{allowHalf:!0,ref:i,...a});return r?r(e,{mode:t,...a},o):o}return null},xc=d.forwardRef(aj);function ij(e){let t=e,n="",r=!1;t<0&&(t=-t,r=!0);const a=Math.floor(t/(3600*24)),i=Math.floor(t/3600%24),o=Math.floor(t/60%60);return n=`${Math.floor(t%60)}秒`,o>0&&(n=`${o}分钟${n}`),i>0&&(n=`${i}小时${n}`),a>0&&(n=`${a}天${n}`),r&&(n+="前"),n}const oj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=ke(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const m=ij(Number(e)),g=s.jsx("span",{ref:o,children:m});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const m=s.jsx(c.InputNumber,{ref:o,min:0,style:{width:"100%"},placeholder:u,...a});return r?r(e,{mode:t,...a},m):m}return null},bc=d.forwardRef(oj),lj=(e,t)=>{const{mode:n,render:r,formItemRender:a,fieldProps:i,emptyText:o="-",...l}=e,u=d.useRef(),[m,g,f]=pr(e);if(d.useImperativeHandle(t,()=>({...u.current||{},fetchData:h=>f(h)}),[f]),m)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const h=g!=null&&g.length?g==null?void 0:g.reduce((S,y)=>({...S,[y.value??""]:y.label}),{}):void 0,p=s.jsx(s.Fragment,{children:Ln(l.text,rn(l.valueEnum||h))});return r?r(l.text,{mode:n,...i},s.jsx(s.Fragment,{children:p}))??o:p}if(n==="edit"||n==="update"){const h=s.jsx(c.Segmented,{ref:u,...We(i||{},["allowClear"]),options:g});return a?a(l.text,{mode:n,...i,options:g,loading:m},h):h}return null},Sc=d.forwardRef(lj),cj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=e;return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):s.jsx(s.Fragment,{children:o})}if(t==="edit"||t==="update"){const o=s.jsx(c.Slider,{ref:i,...a,style:{minWidth:120,...a==null?void 0:a.style}});return r?r(e,{mode:t,...a},o):o}return null},Cc=d.forwardRef(cj),uj=({text:e,mode:t,render:n,light:r,label:a,formItemRender:i,fieldProps:o,variant:l},u)=>{const m=ke(),g=l??(o==null?void 0:o.variant),f=d.useMemo(()=>e==null||`${e}`.length<1?"-":e?(o==null?void 0:o.checkedChildren)??m.getMessage("switch.open","打开"):(o==null?void 0:o.unCheckedChildren)??m.getMessage("switch.close","关闭"),[o==null?void 0:o.checkedChildren,o==null?void 0:o.unCheckedChildren,e]);if(t==="read")return n?n(e,{mode:t,...o},s.jsx(s.Fragment,{children:f})):f??"-";if(t==="edit"||t==="update"){const h=s.jsx(c.Switch,{ref:u,size:r?"small":void 0,...We(o,["value"]),checked:(o==null?void 0:o.checked)??(o==null?void 0:o.value)});if(r){const{disabled:p}=o;return s.jsx(Zt,{label:a,disabled:p,variant:g,downIcon:!1,value:s.jsx("div",{style:{paddingLeft:8},children:h}),allowClear:!1})}return i?i(e,{mode:t,...o},h):h}return null},wc=d.forwardRef(uj),dj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,emptyText:i="-"},o)=>{const{autoFocus:l,prefix:u="",suffix:m=""}=a||{},g=ke(),f=d.useRef();if(d.useImperativeHandle(o,()=>f.current,[]),d.useEffect(()=>{l&&queueMicrotask(()=>{var h;(h=f.current)==null||h.focus()})},[l]),t==="read"){const h=s.jsxs(s.Fragment,{children:[u,e??i,m]});return n?n(e,{mode:t,...a},h)??i:h}if(t==="edit"||t==="update"){const h=g.getMessage("tableForm.inputPlaceholder","请输入"),p=s.jsx(c.Input,{ref:f,placeholder:h,allowClear:!0,...a});return r?r(e,{mode:t,...a},p):p}return null},Vi=d.forwardRef(dj),fj=({text:e,fieldProps:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-readonly"),i=`${a}-textarea`,{wrapSSR:o,hashId:l}=Je("TextArea",()=>({[`.${i}`]:{display:"inline-block",lineHeight:"1.5715",maxWidth:"100%",whiteSpace:"pre-wrap"}}));return o(s.jsx("span",{ref:n,className:le(l,a,i),...We(t,["autoSize","classNames","styles"]),children:e??"-"}))},hj=d.forwardRef(fj),mj=(e,t)=>{const{text:n,mode:r,render:a,formItemRender:i,fieldProps:o}=e,l=ke();if(r==="read"){const u=s.jsx(hj,{...e,ref:t});return a?a(n,{mode:r,...We(o,["showCount"])},u):u}if(r==="edit"||r==="update"){const u=s.jsx(c.Input.TextArea,{ref:t,rows:3,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},placeholder:l.getMessage("tableForm.inputPlaceholder","请输入"),...o});return i?i(n,{mode:r,...o},u):u}return null},jc=d.forwardRef(mj),gj=({text:e,mode:t,light:n,label:r,format:a="HH:mm:ss",render:i,formItemRender:o,fieldProps:l,lightLabel:u,variant:m},g)=>{const[f,h]=d.useState(!1),p=ke(),S=(l==null?void 0:l.format)||a,y=Re.isDayjs(e)||typeof e=="number";if(t==="read"){const w=s.jsx("span",{ref:g,children:e?Re(e,y?void 0:S).format(S):"-"});return i?i(e,{mode:t,...l},s.jsx("span",{children:w})):w}if(t==="edit"||t==="update"){let w;const{disabled:v,value:x}=l,C=mr(x,S);return n?w=s.jsx(Zt,{onClick:()=>{var j;(j=l==null?void 0:l.onOpenChange)==null||j.call(l,!0),h(!0)},style:C?{paddingInlineEnd:0}:void 0,label:r,disabled:v,variant:m??(l==null?void 0:l.variant),value:C||f?s.jsx(c.TimePicker,{variant:m??(l==null?void 0:l.variant),format:a,ref:g,...l,placeholder:l.placeholder??p.getMessage("tableForm.selectPlaceholder","请选择"),value:C,onOpenChange:j=>{var b;h(j),(b=l==null?void 0:l.onOpenChange)==null||b.call(l,j)},open:f}):null,downIcon:C||f?!1:void 0,allowClear:!1,ref:u}):w=s.jsx(c.DatePicker.TimePicker,{ref:g,format:a,...l,value:C}),o?o(e,{mode:t,...l},w):w}return null},pj=({text:e,light:t,label:n,mode:r,lightLabel:a,format:i="HH:mm:ss",render:o,formItemRender:l,fieldProps:u,variant:m},g)=>{const f=ke(),[h,p]=d.useState(!1),S=(u==null?void 0:u.format)||i,[y,w]=Array.isArray(e)?e:[],v=Re.isDayjs(y)||typeof y=="number",x=Re.isDayjs(w)||typeof w=="number",C=y?Re(y,v?void 0:S).format(S):"",j=w?Re(w,x?void 0:S).format(S):"";if(r==="read"){const b=s.jsxs("div",{ref:g,children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return o?o(e,{mode:r,...u},s.jsx("span",{children:b})):b}if(r==="edit"||r==="update"){const b=mr(u.value,S);let T;if(t){const{disabled:R,placeholder:F=[f.getMessage("tableForm.selectPlaceholder","请选择"),f.getMessage("tableForm.selectPlaceholder","请选择")]}=u;T=s.jsx(Zt,{onClick:()=>{var E;(E=u==null?void 0:u.onOpenChange)==null||E.call(u,!0),p(!0)},style:b?{paddingInlineEnd:0}:void 0,label:n,disabled:R,variant:m,placeholder:F,value:b||h?s.jsx(c.TimePicker.RangePicker,{variant:m??(u==null?void 0:u.variant),format:i,ref:g,...u,placeholder:F,value:b,onOpenChange:E=>{var M;p(E),(M=u==null?void 0:u.onOpenChange)==null||M.call(u,E)},open:h}):null,downIcon:b||h?!1:void 0,allowClear:!1,ref:a})}else T=s.jsx(c.TimePicker.RangePicker,{ref:g,format:i,variant:m,...u,value:b});return l?l(e,{mode:r,...u},T):T}return null},vc=d.forwardRef(pj),Tc=d.forwardRef(gj),yj=({formItemRender:e,mode:t,light:n,label:r,render:a,variant:i,...o},l)=>{var Z,L;const{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),m=u("pro-field-tree-select"),g=d.useRef(null),[f,h]=d.useState(!1),{onClear:p,onChange:S,onBlur:y,showSearch:w,fetchDataOnSearch:v,onSearch:x,autoClearSearchValue:C,searchValue:j,...b}=We(o.fieldProps,["treeData"]),T=typeof w=="object"?w:{},R=(T==null?void 0:T.onSearch)!==void 0?T.onSearch:x,F=(T==null?void 0:T.autoClearSearchValue)!==void 0?T.autoClearSearchValue:C,E=(T==null?void 0:T.searchValue)!==void 0?T.searchValue:j,M=i??(b==null?void 0:b.variant),k=ke(),[V,_,A]=pr({...o,defaultKeyWords:E}),[I,$]=it(void 0,E),D=d.useCallback(U=>{$(J=>{const G=typeof U=="function"?U(J):U;return R==null||R(G),G})},[R]);d.useImperativeHandle(l,()=>({...g.current||{},fetchData:U=>A(U)}));const O=d.useMemo(()=>{if(t!=="read")return;const{value:U="value",label:J="label",children:G="children"}=(b==null?void 0:b.fieldNames)||{},H=new Map,B=W=>{if(!(W!=null&&W.length))return H;const N=W.length;let q=0;for(;q<N;){const ee=W[q++];H.set(ee[U],ee[J]),B(ee[G])}return H};return B(_)},[b==null?void 0:b.fieldNames,t,_]),z=(U,J,G)=>{w&&F&&(A(void 0),D(void 0)),S==null||S(U,J,G)};if(t==="read"){const U=s.jsx(s.Fragment,{children:Ln(o.text,rn(o.valueEnum||O))});return a?a(o.text,{mode:t,...b,treeData:_},U)??null:U}if(t==="edit"){const U=Array.isArray(b==null?void 0:b.value)?(Z=b==null?void 0:b.value)==null?void 0:Z.length:0;let J=s.jsx(c.Spin,{spinning:V,children:s.jsx(c.TreeSelect,{open:f,onOpenChange:G=>{var H;(H=b==null?void 0:b.onOpenChange)==null||H.call(b,G),h(G)},ref:g,popupMatchSelectWidth:!n,placeholder:k.getMessage("tableForm.selectPlaceholder","请选择"),tagRender:n?G=>{var B;if(U<2)return s.jsx(s.Fragment,{children:G.label});const H=(B=b==null?void 0:b.value)==null?void 0:B.findIndex(W=>W===G.value||W.value===G.value);return s.jsxs(s.Fragment,{children:[G.label," ",H<U-1?",":""]})}:void 0,...b,treeData:_,showSearch:w&&{...T,searchValue:I,autoClearSearchValue:F,onSearch:G=>{v&&(o!=null&&o.request)&&A(G),D(G)}},style:{minWidth:60,...b.style},allowClear:b.allowClear!==!1,onClear:()=>{p==null||p(),A(void 0),w&&D(void 0)},onChange:z,onBlur:G=>{D(void 0),A(void 0),y==null||y(G)},className:le(b==null?void 0:b.className,m)})});if(e&&(J=e(o.text,{mode:t,...b,options:_,loading:V},J)??null),n){const{disabled:G,placeholder:H}=b,B=!!b.value&&((L=b.value)==null?void 0:L.length)!==0;return s.jsx(Zt,{label:r,disabled:G,placeholder:H,onClick:()=>{var W;h(!0),(W=b==null?void 0:b.onOpenChange)==null||W.call(b,!0)},variant:M,value:B||f?J:null,style:B?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:!1})}return J}return null},Fc=d.forwardRef(yj);function Be(e){const[t,n]=d.useState(!1),r=d.useRef(null),a=d.useCallback(l=>{var g,f,h,p,S,y;const u=(h=(f=(g=r.current)==null?void 0:g.labelRef)==null?void 0:f.current)==null?void 0:h.contains(l.target),m=(y=(S=(p=r.current)==null?void 0:p.clearRef)==null?void 0:S.current)==null?void 0:y.contains(l.target);return u&&!m},[r]),i=l=>{a(l)&&n(!0)},o=()=>{n(!1)};return e.isLight?s.jsx("div",{onMouseDown:i,onMouseUp:o,children:d.cloneElement(e.children,{labelTrigger:t,lightLabel:r})}):s.jsx(s.Fragment,{children:e.children})}Re.extend(vd);Re.extend(wd);Re.extend(jd);Re.extend(vo);Re.extend(Td);const $d=(e,t,n,r)=>{var l,u,m,g;const{mode:a="read",emptyText:i="-"}=n;if(i!==!1&&a==="read"&&t!=="option"&&t!=="switch"&&typeof e!="boolean"&&typeof e!="number"&&!e){const{fieldProps:f,render:h}=n;return h?h(e,{mode:a,...f},s.jsx(s.Fragment,{children:i})):s.jsx(s.Fragment,{children:i})}if(delete n.emptyText,typeof t=="object")return $d(e,t.type,{...t,...n},r);const o=r&&r[t];if(o){if(delete n.ref,a==="read"){const f=(l=o.render)==null?void 0:l.call(o,e,{text:e,...n,mode:a||"read"},s.jsx(s.Fragment,{children:e}));return n!=null&&n.render?(u=n.render)==null?void 0:u.call(n,e,{text:e,...n},f):f}if(a==="update"||a==="edit"){const f=(m=o.formItemRender)==null?void 0:m.call(o,e,{text:e,...n},s.jsx(s.Fragment,{children:e}));return n!=null&&n.formItemRender?(g=n.formItemRender)==null?void 0:g.call(n,e,{text:e,...n},f):f}}return s.jsx(Vi,{text:e,...n})},xj=({text:e,valueType:t="text",mode:n="read",onChange:r,formItemRender:a,value:i,readonly:o,fieldProps:l,...u},m)=>{const g=d.useContext(Wt),f=we((...S)=>{var y;(y=l==null?void 0:l.onChange)==null||y.call(l,...S),r==null||r(...S)}),h=gt(()=>(i!==void 0||l)&&{value:i,...ht(l),onChange:f},[i,l,f]),p=$d(n==="edit"?(h==null?void 0:h.value)??e??"":e??(h==null?void 0:h.value)??"",t||"text",ht({ref:m,...u,mode:o?"read":n,formItemRender:a?(S,y,w)=>{const{placeholder:v,...x}=y,C=a(S,x,w);return d.isValidElement(C)?d.cloneElement(C,{...h,...C.props||{}}):C}:void 0,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(h==null?void 0:h.placeholder),fieldProps:At(ht({...h,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(h==null?void 0:h.placeholder)}))}),g.valueTypeMap||{});return s.jsx(d.Fragment,{children:p})},bj=d.forwardRef(xj);Re.extend(vd);Re.extend(wd);Re.extend(jd);Re.extend(vo);Re.extend(Td);const Ed={progress:{render:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(yc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(yc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},money:{render:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(hc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(hc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},percent:{render:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(pc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(pc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},image:{render:(e,t)=>s.jsx(dc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(dc,{...t,text:e})},date:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-MM-DD",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-MM-DD",...t,text:e})})},dateWeek:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-wo",picker:"week",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-wo",picker:"week",...t,text:e})})},dateWeekRange:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})})},dateMonthRange:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})})},dateQuarterRange:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})})},dateYearRange:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})})},dateMonth:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-MM",picker:"month",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-MM",picker:"month",...t,text:e})})},dateQuarter:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})})},dateYear:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY",picker:"year",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY",picker:"year",...t,text:e})})},dateRange:{render:(e,t)=>s.jsx($t,{format:"YYYY-MM-DD",...t,text:e}),formItemRender:(e,t)=>s.jsx($t,{format:"YYYY-MM-DD",...t,text:e})},dateTime:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Rt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},dateTimeRange:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx($t,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},time:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Tc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(Tc,{format:"HH:mm:ss",...t,text:e})})},timeRange:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(vc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(vc,{format:"HH:mm:ss",...t,text:e})})},fromNow:{render:(e,t)=>s.jsx(uc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(uc,{...t,text:e})},index:{render:e=>s.jsx(Ts,{children:e+1}),formItemRender:e=>s.jsx(Ts,{children:e+1})},indexBorder:{render:e=>s.jsx(Ts,{border:!0,children:e+1}),formItemRender:e=>s.jsx(Ts,{border:!0,children:e+1})},avatar:{render:e=>s.jsx(c.Avatar,{src:e,size:22,shape:"circle"}),formItemRender:e=>s.jsx(c.Avatar,{src:e,size:22,shape:"circle"})},code:{render:(e,t)=>s.jsx(vs,{...t,text:e}),formItemRender:(e,t)=>s.jsx(vs,{...t,text:e})},jsonCode:{render:(e,t)=>s.jsx(vs,{language:"json",...t,text:e}),formItemRender:(e,t)=>s.jsx(vs,{language:"json",...t,text:e})},textarea:{render:(e,t)=>s.jsx(jc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(jc,{...t,text:e})},digit:{render:(e,t)=>{const n=At(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(aa,{text:a,placeholder:r,mode:t.mode,fieldProps:n})},formItemRender:(e,t)=>{const n=At(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(aa,{text:a,placeholder:r,mode:t.mode,fieldProps:n})}},digitRange:{render:(e,t)=>s.jsx(lc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(lc,{...t,text:e})},second:{render:(e,t)=>s.jsx(bc,{...t,text:e,placeholder:t.placeholder}),formItemRender:(e,t)=>s.jsx(bc,{...t,text:e,placeholder:t.placeholder})},select:{render:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(js,{...t,text:e})}),formItemRender:(e,t)=>s.jsx(Be,{isLight:t.light,children:s.jsx(js,{...t,text:e})})},text:{render:(e,t)=>"valueEnum"in t?s.jsx(Be,{isLight:t.light,children:s.jsx(js,{...t,text:e})}):s.jsx(Vi,{...t,text:e}),formItemRender:(e,t)=>"valueEnum"in t?s.jsx(Be,{isLight:t.light,children:s.jsx(js,{...t,text:e})}):s.jsx(Vi,{...t,text:e})},checkbox:{render:(e,t)=>s.jsx(ic,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ic,{...t,text:e})},radio:{render:(e,t)=>s.jsx(Fs,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Fs,{...t,text:e})},radioButton:{render:(e,t)=>s.jsx(Fs,{radioType:"button",...t,text:e}),formItemRender:(e,t)=>s.jsx(Fs,{radioType:"button",...t,text:e})},rate:{render:(e,t)=>s.jsx(xc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(xc,{...t,text:e})},slider:{render:(e,t)=>s.jsx(Cc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Cc,{...t,text:e})},switch:{render:(e,t)=>s.jsx(wc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(wc,{...t,text:e})},option:{render:(e,t)=>s.jsx(gc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(gc,{...t,text:e})},password:{render:(e,t)=>s.jsx(rr,{...t,text:e}),formItemRender:(e,t)=>s.jsx(rr,{...t,text:e})},cascader:{render:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=At(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})}},treeSelect:{render:(e,t)=>s.jsx(Fc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Fc,{...t,text:e})},color:{render:(e,t)=>s.jsx(oc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(oc,{...t,text:e})},segmented:{render:(e,t)=>s.jsx(Sc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Sc,{...t,text:e})}},To=d.createContext({grid:!1,colProps:void 0,rowProps:void 0}),Sj=({grid:e,rowProps:t,colProps:n})=>({grid:!!e,RowWrapper({children:r,Wrapper:a,...i}={}){return e?s.jsx(c.Row,{gutter:8,...t,...i,children:r}):a?s.jsx(a,{children:r}):r},ColWrapper({children:r,Wrapper:a,variant:i,fieldProps:o,...l}={}){var g;const u=d.useMemo(()=>{const f={...n,...l};return typeof f.span>"u"&&typeof f.xs>"u"&&(f.xs=24),f},[l]),m=(i!==void 0||o!==void 0)&&d.Children.count(r)===1&&d.isValidElement(r)?d.cloneElement(r,{...i!==void 0&&{variant:i},...o&&{fieldProps:{...(g=r==null?void 0:r.props)==null?void 0:g.fieldProps,...o}}}):r;return e?s.jsx(c.Col,{...u,children:m}):a?s.jsx(a,{children:m}):m}}),yr=e=>{const t=d.useMemo(()=>typeof e=="object"?e:{grid:e},[e]),{grid:n,colProps:r}=d.useContext(To);return d.useMemo(()=>Sj({grid:!!(n||t.grid),rowProps:t==null?void 0:t.rowProps,colProps:(t==null?void 0:t.colProps)||r,Wrapper:t==null?void 0:t.Wrapper}),[t==null?void 0:t.Wrapper,t.grid,n,JSON.stringify([r,t==null?void 0:t.colProps,t==null?void 0:t.rowProps])])},In="RC_FORM_INTERNAL_HOOKS",Ke=()=>{Qe(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Nn=xe.createContext({getFieldValue:Ke,getFieldsValue:Ke,getFieldError:Ke,getFieldWarning:Ke,getFieldsError:Ke,isFieldsTouched:Ke,isFieldTouched:Ke,isFieldValidating:Ke,isFieldsValidating:Ke,resetFields:Ke,setFields:Ke,setFieldValue:Ke,setFieldsValue:Ke,validateFields:Ke,submit:Ke,getInternalHooks:()=>(Ke(),{dispatch:Ke,initEntityValue:Ke,registerField:Ke,useSubscribe:Ke,setInitialValues:Ke,destroyForm:Ke,setCallbacks:Ke,registerWatch:Ke,getFields:Ke,setValidateMessages:Ke,setPreserve:Ke,getInitialValue:Ke})}),oa=xe.createContext(null);function Hi(e){return e==null?[]:Array.isArray(e)?e:[e]}function Cj(e){return e&&!!e._init}function Ui(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){const e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}const ti=Ui(),wj=/%[sdj%]/g;let Id=()=>{};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Id=(e,t)=>{typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&t.every(n=>typeof n=="string")&&console.warn(e,t)});function Yi(e){if(!e||!e.length)return null;const t={};return e.forEach(n=>{const r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Tt(e,...t){let n=0;const r=t.length;return typeof e=="function"?e.apply(null,t):typeof e=="string"?e.replace(wj,i=>{if(i==="%%")return"%";if(n>=r)return i;switch(i){case"%s":return String(t[n++]);case"%d":return Number(t[n++]);case"%j":try{return JSON.stringify(t[n++])}catch{return"[Circular]"}break;default:return i}}):e}function jj(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function ft(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||jj(t)&&typeof e=="string"&&!e)}function vj(e,t,n){const r=[];let a=0;const i=e.length;function o(l){r.push(...l||[]),a++,a===i&&n(r)}e.forEach(l=>{t(l,o)})}function Rc(e,t,n){let r=0;const a=e.length;function i(o){if(o&&o.length){n(o);return}const l=r;r=r+1,l<a?t(e[l],i):n([])}i([])}function Tj(e){const t=[];return Object.keys(e).forEach(n=>{t.push(...e[n]||[])}),t}class $c extends Error{constructor(n,r){super("Async Validation Error");ce(this,"errors");ce(this,"fields");this.errors=n,this.fields=r}}function Fj(e,t,n,r,a){if(t.first){const f=new Promise((h,p)=>{const S=w=>(r(w),w.length?p(new $c(w,Yi(w))):h(a)),y=Tj(e);Rc(y,n,S)});return f.catch(h=>h),f}const i=t.firstFields===!0?Object.keys(e):t.firstFields||[],o=Object.keys(e),l=o.length;let u=0;const m=[],g=new Promise((f,h)=>{const p=S=>{if(m.push.apply(m,S),u++,u===l)return r(m),m.length?h(new $c(m,Yi(m))):f(a)};o.length||(r(m),f(a)),o.forEach(S=>{const y=e[S];i.indexOf(S)!==-1?Rc(y,n,p):vj(y,n,p)})});return g.catch(f=>f),g}function Rj(e){return!!(e&&e.message!==void 0)}function $j(e,t){let n=e;for(let r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function Ec(e,t){return n=>{let r;return e.fullFields?r=$j(t,e.fullFields):r=t[n.field||e.fullField],Rj(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function Ic(e,t){if(t){for(const n in t)if(t.hasOwnProperty(n)){const r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]={...e[n],...r}:e[n]=r}}return e}const Zn="enum",Ej=(e,t,n,r,a)=>{e[Zn]=Array.isArray(e[Zn])?e[Zn]:[],e[Zn].indexOf(t)===-1&&r.push(Tt(a.messages[Zn],e.fullField,e[Zn].join(", ")))},Ij=(e,t,n,r,a)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Tt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern=="string"&&(new RegExp(e.pattern).test(t)||r.push(Tt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))))},Mj=(e,t,n,r,a)=>{const i=typeof e.len=="number",o=typeof e.min=="number",l=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let m=t,g=null;const f=typeof t=="number",h=typeof t=="string",p=Array.isArray(t);if(f?g="number":h?g="string":p&&(g="array"),!g)return!1;p&&(m=t.length),h&&(m=t.replace(u,"_").length),i?m!==e.len&&r.push(Tt(a.messages[g].len,e.fullField,e.len)):o&&!l&&m<e.min?r.push(Tt(a.messages[g].min,e.fullField,e.min)):l&&!o&&m>e.max?r.push(Tt(a.messages[g].max,e.fullField,e.max)):o&&l&&(m<e.min||m>e.max)&&r.push(Tt(a.messages[g].range,e.fullField,e.min,e.max))},Md=(e,t,n,r,a,i)=>{e.required&&(!n.hasOwnProperty(e.field)||ft(t,i||e.type))&&r.push(Tt(a.messages.required,e.fullField))};let Rs;const kj=(()=>{if(Rs)return Rs;const e="[a-fA-F\\d:]",t=b=>b&&b.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=`(?:${[`(?:${r}:){7}(?:${r}|:)`,`(?:${r}:){6}(?:${n}|:${r}|:)`,`(?:${r}:){5}(?::${n}|(?::${r}){1,2}|:)`,`(?:${r}:){4}(?:(?::${r}){0,1}:${n}|(?::${r}){1,3}|:)`,`(?:${r}:){3}(?:(?::${r}){0,2}:${n}|(?::${r}){1,4}|:)`,`(?:${r}:){2}(?:(?::${r}){0,3}:${n}|(?::${r}){1,5}|:)`,`(?:${r}:){1}(?:(?::${r}){0,4}:${n}|(?::${r}){1,6}|:)`,`(?::(?:(?::${r}){0,5}:${n}|(?::${r}){1,7}|:))`].join("|")})(?:%[0-9a-zA-Z]{1,})?`,l=new RegExp(`(?:^${n}$)|(?:^${o}$)`),u=new RegExp(`^${n}$`),m=new RegExp(`^${o}$`),g=b=>b&&b.exact?l:new RegExp(`(?:${t(b)}${n}${t(b)})|(?:${t(b)}${o}${t(b)})`,"g");g.v4=b=>b&&b.exact?u:new RegExp(`${t(b)}${n}${t(b)}`,"g"),g.v6=b=>b&&b.exact?m:new RegExp(`${t(b)}${o}${t(b)}`,"g");const f="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",p=g.v4().source,S=g.v6().source,j=`(?:${f}|www\\.)${h}(?:localhost|${p}|${S}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return Rs=new RegExp(`(?:^${j}$)`,"i"),Rs}),ni={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Or={integer(e){return Or.number(e)&&parseInt(e,10)===e},float(e){return Or.number(e)&&!Or.integer(e)},array(e){return Array.isArray(e)},regexp(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number(e){return isNaN(e)?!1:typeof e=="number"},object(e){return typeof e=="object"&&!Or.array(e)},method(e){return typeof e=="function"},email(e){return typeof e=="string"&&e.length<=320&&!!e.match(ni.email)},tel(e){return typeof e=="string"&&e.length<=32&&!!e.match(ni.tel)},url(e){return typeof e=="string"&&e.length<=2048&&!!e.match(kj())},hex(e){return typeof e=="string"&&!!e.match(ni.hex)}},Aj=(e,t,n,r,a)=>{if(e.required&&t===void 0){Md(e,t,n,r,a);return}const i=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],o=e.type;i.indexOf(o)>-1?Or[o](t)||r.push(Tt(a.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(Tt(a.messages.types[o],e.fullField,e.type))},Oj=(e,t,n,r,a)=>{(/^\s+$/.test(t)||t==="")&&r.push(Tt(a.messages.whitespace,e.fullField))},Ae={required:Md,whitespace:Oj,type:Aj,range:Mj,enum:Ej,pattern:Ij},Dj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a)}n(i)},Pj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();Ae.required(e,t,r,i,a,"array"),t!=null&&(Ae.type(e,t,r,i,a),Ae.range(e,t,r,i,a))}n(i)},Nj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&Ae.type(e,t,r,i,a)}n(i)},Lj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t,"date")&&!e.required)return n();if(Ae.required(e,t,r,i,a),!ft(t,"date")){let l;t instanceof Date?l=t:l=new Date(t),Ae.type(e,l,r,i,a),l&&Ae.range(e,l.getTime(),r,i,a)}}n(i)},_j="enum",zj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&Ae[_j](e,t,r,i,a)}n(i)},Bj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&(Ae.type(e,t,r,i,a),Ae.range(e,t,r,i,a))}n(i)},Vj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&(Ae.type(e,t,r,i,a),Ae.range(e,t,r,i,a))}n(i)},Hj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&Ae.type(e,t,r,i,a)}n(i)},Uj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===""&&(t=void 0),ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&(Ae.type(e,t,r,i,a),Ae.range(e,t,r,i,a))}n(i)},Yj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),t!==void 0&&Ae.type(e,t,r,i,a)}n(i)},Kj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t,"string")&&!e.required)return n();Ae.required(e,t,r,i,a),ft(t,"string")||Ae.pattern(e,t,r,i,a)}n(i)},Wj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t)&&!e.required)return n();Ae.required(e,t,r,i,a),ft(t)||Ae.type(e,t,r,i,a)}n(i)},qj=(e,t,n,r,a)=>{const i=[],o=Array.isArray(t)?"array":typeof t;Ae.required(e,t,r,i,a,o),n(i)},Gj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t,"string")&&!e.required)return n();Ae.required(e,t,r,i,a,"string"),ft(t,"string")||(Ae.type(e,t,r,i,a),Ae.range(e,t,r,i,a),Ae.pattern(e,t,r,i,a),e.whitespace===!0&&Ae.whitespace(e,t,r,i,a))}n(i)},$s=(e,t,n,r,a)=>{const i=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(ft(t,i)&&!e.required)return n();Ae.required(e,t,r,o,a,i),ft(t,i)||Ae.type(e,t,r,o,a)}n(o)},$r={string:Gj,method:Hj,number:Uj,boolean:Nj,regexp:Wj,integer:Vj,float:Bj,array:Pj,object:Yj,enum:zj,pattern:Kj,date:Lj,url:$s,hex:$s,email:$s,tel:$s,required:qj,any:Dj},fn=class fn{constructor(t){ce(this,"rules",null);ce(this,"_messages",ti);this.define(t)}define(t){if(!t)throw new Error("Cannot configure a schema with no rules");if(typeof t!="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach(n=>{const r=t[n];this.rules[n]=Array.isArray(r)?r:[r]})}messages(t){return t&&(this._messages=Ic(Ui(),t)),this._messages}validate(t,n={},r=()=>{}){let a=t,i=n,o=r;if(typeof i=="function"&&(o=i,i={}),!this.rules||Object.keys(this.rules).length===0)return o&&o(null,a),Promise.resolve(a);function l(f){let h=[],p={};function S(y){Array.isArray(y)?h=h.concat(...y):h.push(y)}for(let y=0;y<f.length;y++)S(f[y]);h.length?(p=Yi(h),o(h,p)):o(null,a)}if(i.messages){let f=this.messages();f===ti&&(f=Ui()),Ic(f,i.messages),i.messages=f}else i.messages=this.messages();const u={};(i.keys||Object.keys(this.rules)).forEach(f=>{const h=this.rules[f];let p=a[f];h.forEach(S=>{let y=S;typeof y.transform=="function"&&(a===t&&(a={...a}),p=a[f]=y.transform(p),p!=null&&(y.type=y.type||(Array.isArray(p)?"array":typeof p))),typeof y=="function"?y={validator:y}:y={...y},y.validator=this.getValidationMethod(y),y.validator&&(y.field=f,y.fullField=y.fullField||f,y.type=this.getType(y),u[f]=u[f]||[],u[f].push({rule:y,value:p,source:a,field:f}))})});const g={};return Fj(u,i,(f,h)=>{var x;const p=f.rule;let S=(p.type==="object"||p.type==="array")&&(typeof p.fields=="object"||typeof p.defaultField=="object");S=S&&(p.required||!p.required&&f.value),p.field=f.field;function y(C,j){return{...j,fullField:`${p.fullField}.${C}`,fullFields:p.fullFields?[...p.fullFields,C]:[C]}}function w(C=[]){let j=Array.isArray(C)?C:[C];!i.suppressWarning&&j.length&&fn.warning("async-validator:",j),j.length&&p.message!==void 0&&p.message!==null&&(j=[].concat(p.message));let b=j.map(Ec(p,a));if(i.first&&b.length)return g[p.field]=1,h(b);if(!S)h(b);else{if(p.required&&!f.value)return p.message!==void 0?b=[].concat(p.message).map(Ec(p,a)):i.error&&(b=[i.error(p,Tt(i.messages.required,p.field))]),h(b);let T={};p.defaultField&&Object.keys(f.value).map(E=>{T[E]=p.defaultField}),T={...T,...f.rule.fields};const R={};Object.keys(T).forEach(E=>{const M=T[E],k=Array.isArray(M)?M:[M];R[E]=k.map(y.bind(null,E))});const F=new fn(R);F.messages(i.messages),f.rule.options&&(f.rule.options.messages=i.messages,f.rule.options.error=i.error),F.validate(f.value,f.rule.options||i,E=>{const M=[];b&&b.length&&M.push(...b),E&&E.length&&M.push(...E),h(M.length?M:null)})}}let v;if(p.asyncValidator)v=p.asyncValidator(p,f.value,w,f.source,i);else if(p.validator){try{v=p.validator(p,f.value,w,f.source,i)}catch(C){(x=console.error)==null||x.call(console,C),i.suppressValidatorError||setTimeout(()=>{throw C},0),w(C.message)}v===!0?w():v===!1?w(typeof p.message=="function"?p.message(p.fullField||p.field):p.message||`${p.fullField||p.field} fails`):v instanceof Array?w(v):v instanceof Error&&w(v.message)}v&&v.then&&v.then(()=>w(),C=>w(C))},f=>{l(f)},a)}getType(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!$r.hasOwnProperty(t.type))throw new Error(Tt("Unknown rule type %s",t.type));return t.type||"string"}getValidationMethod(t){if(typeof t.validator=="function")return t.validator;const n=Object.keys(t),r=n.indexOf("message");return r!==-1&&n.splice(r,1),n.length===1&&n[0]==="required"?$r.required:$r[this.getType(t)]||void 0}};ce(fn,"register",function(n,r){if(typeof r!="function")throw new Error("Cannot register a validator by type, validator is not a function");$r[n]=r}),ce(fn,"warning",Id),ce(fn,"messages",ti),ce(fn,"validators",$r);let Ki=fn;const yt="'${name}' is not a valid ${type}",kd={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:yt,method:yt,array:yt,object:yt,number:yt,date:yt,boolean:yt,integer:yt,float:yt,regexp:yt,email:yt,tel:yt,url:yt,hex:yt},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},Mc=Ki;function Zj(e,t){return e.replace(/\\?\$\{\w+\}/g,n=>{if(n.startsWith("\\"))return n.slice(1);const r=n.slice(2,-1);return t[r]})}const kc="CODE_LOGIC_ERROR";async function Wi(e,t,n,r,a){const i={...n};if(delete i.ruleIndex,Mc.warning=()=>{},i.validator){const h=i.validator;i.validator=(...p)=>{try{return h(...p)}catch(S){return console.error(S),Promise.reject(kc)}}}let o=null;i&&i.type==="array"&&i.defaultField&&(o=i.defaultField,delete i.defaultField);const l=new Mc({[e]:[i]}),u=tr(kd,r.validateMessages);l.messages(u);let m=[];try{await Promise.resolve(l.validate({[e]:t},{...r}))}catch(h){h.errors&&(m=h.errors.map(({message:p},S)=>{const y=p===kc?u.default:p;return xe.isValidElement(y)?xe.cloneElement(y,{key:`error_${S}`}):y}))}if(!m.length&&o&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((p,S)=>Wi(`${e}.${S}`,p,o,r,a)))).reduce((p,S)=>[...p,...S],[]);const g={...n,name:e,enum:(n.enum||[]).join(", "),...a};return m.map(h=>typeof h=="string"?Zj(h,g):h)}function Jj(e,t,n,r,a,i){const o=e.join("."),l=n.map((m,g)=>{const f=m.validator,h={...m,ruleIndex:g};return f&&(h.validator=(p,S,y)=>{let w=!1;const x=f(p,S,(...C)=>{Promise.resolve().then(()=>{Qe(!w,"Your validator function has already return a promise. `callback` will be ignored."),w||y(...C)})});w=x&&typeof x.then=="function"&&typeof x.catch=="function",Qe(w,"`callback` is deprecated. Please return a promise instead."),w&&x.then(()=>{y()}).catch(C=>{y(C||" ")})}),h}).sort(({warningOnly:m,ruleIndex:g},{warningOnly:f,ruleIndex:h})=>!!m==!!f?g-h:m?1:-1);let u;if(a===!0)u=new Promise(async(m,g)=>{for(let f=0;f<l.length;f+=1){const h=l[f],p=await Wi(o,t,h,r,i);if(p.length){g([{errors:p,rule:h}]);return}}m([])});else{const m=l.map(g=>Wi(o,t,g,r,i).then(f=>({errors:f,rule:g})));u=(a?Qj(m):Xj(m)).then(g=>Promise.reject(g))}return u.catch(m=>m),u}async function Xj(e){return Promise.all(e).then(t=>[].concat(...t))}async function Qj(e){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(a=>{a.errors.length&&n([a]),t+=1,t===e.length&&n([])})})})}function at(e){return Hi(e)}function Ac(e,t){let n={};return t.forEach(r=>{const a=De(e,r);n=Ge(n,r,a)}),n}function ar(e,t,n=!1){return e&&e.some(r=>la(t,r,n))}function la(e,t,n=!1){return!e||!t||!n&&e.length!==t.length?!1:t.every((r,a)=>e[a]===r)}function e0(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);return[...new Set([...n,...r])].every(i=>{const o=e[i],l=t[i];return typeof o=="function"&&typeof l=="function"?!0:o===l})}function t0(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function Oc(e,t,n){const{length:r}=e;if(t<0||t>=r||n<0||n>=r)return e;const a=e[t],i=t-n;return i>0?[...e.slice(0,n),a,...e.slice(n,t),...e.slice(t+1,r)]:i<0?[...e.slice(0,t),...e.slice(t+1,n+1),a,...e.slice(n+1,r)]:e}const Ad=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class n0{constructor(t){ce(this,"namePathList",[]);ce(this,"taskId",0);ce(this,"watcherList",new Set);ce(this,"form");this.form=t}register(t){return this.watcherList.add(t),()=>{this.watcherList.delete(t)}}notify(t){t.forEach(n=>{this.namePathList.every(r=>!la(r,n))&&this.namePathList.push(n)}),this.doBatch()}doBatch(){this.taskId+=1;const t=this.taskId;Ad(()=>{if(t===this.taskId&&this.watcherList.size){const n=this.form.getForm(),r=n.getFieldsValue(),a=n.getFieldsValue(!0);this.watcherList.forEach(i=>{i(r,a,this.namePathList)}),this.namePathList=[]}})}}async function r0(){return new Promise(e=>{Ad(()=>{ro(()=>{e()})})})}function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qi.apply(this,arguments)}const vn=[],Er=[];function ri(e,t,n,r,a,i){return typeof e=="function"?e(t,n,"source"in i?{source:i.source}:{}):r!==a}class Od extends xe.PureComponent{constructor(n){super(n);ce(this,"state",{resetCount:0});ce(this,"cancelRegisterFunc",null);ce(this,"mounted",!1);ce(this,"touched",!1);ce(this,"dirty",!1);ce(this,"validatePromise");ce(this,"prevValidating");ce(this,"errors",vn);ce(this,"warnings",Er);ce(this,"cancelRegister",()=>{const{preserve:n,isListField:r,name:a}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,at(a)),this.cancelRegisterFunc=null});ce(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:a=[]}=r;return n!==void 0?[...a,...n]:[]});ce(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(a=>typeof a=="function"?a(r):a)});ce(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});ce(this,"metaCache",null);ce(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const a={...this.getMeta(),destroy:n};zo(this.metaCache,a)||r(a),this.metaCache=a}else this.metaCache=null});ce(this,"onStoreChange",(n,r,a)=>{const{shouldUpdate:i,dependencies:o=[],onReset:l}=this.props,{store:u}=a,m=this.getNamePath(),g=this.getValue(n),f=this.getValue(u),h=r&&ar(r,m);switch(a.type==="valueUpdate"&&a.source==="external"&&!zo(g,f)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=vn,this.warnings=Er,this.triggerMetaEvent()),a.type){case"reset":if(!r||h){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=vn,this.warnings=Er,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&ri(i,n,u,g,f,a)){this.reRender();return}break}case"setField":{const{data:p}=a;if(h){"touched"in p&&(this.touched=p.touched),"validating"in p&&!("originRCField"in p)&&(this.validatePromise=p.validating?Promise.resolve([]):null),"errors"in p&&(this.errors=p.errors||vn),"warnings"in p&&(this.warnings=p.warnings||Er),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in p&&ar(r,m,!0)){this.reRender();return}if(i&&!m.length&&ri(i,n,u,g,f,a)){this.reRender();return}break}case"dependenciesUpdate":{if(o.map(at).some(S=>ar(a.relatedFields,S))){this.reRender();return}break}default:if(h||(!o.length||m.length||i)&&ri(i,n,u,g,f,a)){this.reRender();return}break}i===!0&&this.reRender()});ce(this,"validateRules",n=>{const r=this.getNamePath(),a=this.getValue(),{triggerName:i,validateOnly:o=!1,delayFrame:l}=n||{},u=Promise.resolve().then(async()=>{if(!this.mounted)return[];const{validateFirst:m=!1,messageVariables:g,validateDebounce:f}=this.props;l&&await r0();let h=this.getRules();if(i&&(h=h.filter(S=>S).filter(S=>{const{validateTrigger:y}=S;return y?Hi(y).includes(i):!0})),f&&i&&(await new Promise(S=>{setTimeout(S,f)}),this.validatePromise!==u))return[];const p=Jj(r,a,h,n,m,g);return p.catch(S=>S).then((S=vn)=>{var y;if(this.validatePromise===u){this.validatePromise=null;const w=[],v=[];(y=S.forEach)==null||y.call(S,({rule:{warningOnly:x},errors:C=vn})=>{x?v.push(...C):w.push(...C)}),this.errors=w,this.warnings=v,this.triggerMetaEvent(),this.reRender()}}),p});return o||(this.validatePromise=u,this.dirty=!0,this.errors=vn,this.warnings=Er,this.triggerMetaEvent(),this.reRender()),u});ce(this,"isFieldValidating",()=>!!this.validatePromise);ce(this,"isFieldTouched",()=>this.touched);ce(this,"isFieldDirty",()=>{if(this.dirty||this.props.initialValue!==void 0)return!0;const{fieldContext:n}=this.props,{getInitialValue:r}=n.getInternalHooks(In);return r(this.getNamePath())!==void 0});ce(this,"getErrors",()=>this.errors);ce(this,"getWarnings",()=>this.warnings);ce(this,"isListField",()=>this.props.isListField);ce(this,"isList",()=>this.props.isList);ce(this,"isPreserve",()=>this.props.preserve);ce(this,"getMeta",()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:this.validatePromise===null}));ce(this,"getOnlyChild",n=>{if(typeof n=="function"){const a=this.getMeta();return{...this.getOnlyChild(n(this.getControlled(),a,this.props.fieldContext)),isFunction:!0}}const r=bn(n);return r.length!==1||!xe.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});ce(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,a=this.getNamePath();return De(n||r(!0),a)});ce(this,"getControlled",(n={})=>{const{name:r,trigger:a="onChange",validateTrigger:i,getValueFromEvent:o,normalize:l,valuePropName:u="value",getValueProps:m,fieldContext:g}=this.props,f=i!==void 0?i:g.validateTrigger,h=this.getNamePath(),{getInternalHooks:p,getFieldsValue:S}=g,{dispatch:y}=p(In),w=this.getValue(),v=m||(T=>({[u]:T})),x=n[a],C=r!==void 0?v(w):{};process.env.NODE_ENV!=="production"&&C&&Object.keys(C).forEach(T=>{Qe(typeof C[T]!="function",`It's not recommended to generate dynamic function prop by \`getValueProps\`. Please pass it to child component directly (prop: ${T})`)});const j={...n,...C};return j[a]=(...T)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();const R=this.getValue();let F;o?F=o(...T):F=t0(u,...T),l&&(F=l(F,R,S(!0))),F!==R&&y({type:"updateValue",namePath:h,value:F}),x&&x(...T)},Hi(f||[]).forEach(T=>{const R=j[T];j[T]=(...F)=>{R&&R(...F);const{rules:E}=this.props;E&&E.length&&y({type:"validateField",namePath:h,triggerName:T})}}),j});if(n.fieldContext){const{getInternalHooks:r}=n.fieldContext,{initEntityValue:a}=r(In);a(this)}}componentDidMount(){const{shouldUpdate:n,fieldContext:r}=this.props;if(this.mounted=!0,r){const{getInternalHooks:a}=r,{registerField:i}=a(In);this.cancelRegisterFunc=i(this)}n===!0&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}reRender(){this.mounted&&this.forceUpdate()}render(){const{resetCount:n}=this.state,{children:r}=this.props,{child:a,isFunction:i}=this.getOnlyChild(r);let o;return i?o=a:xe.isValidElement(a)?o=xe.cloneElement(a,this.getControlled(a.props)):(Qe(!a,"`children` of Field is not validate ReactElement."),o=a),xe.createElement(xe.Fragment,{key:n},o)}}ce(Od,"contextType",Nn);function Dd({name:e,...t}){const n=xe.useContext(Nn),r=xe.useContext(oa),a=e!==void 0?at(e):void 0,i=t.isListField??!!r;let o="keep";return i||(o=`_${(a||[]).join("_")}`),process.env.NODE_ENV!=="production"&&t.preserve===!1&&i&&a.length<=1&&Qe(!1,"`preserve` should not apply on Form.List fields."),xe.createElement(Od,qi({key:o,name:a,isListField:i},t,{fieldContext:n}))}function s0({name:e,initialValue:t,children:n,rules:r,validateTrigger:a,isListField:i}){const o=xe.useContext(Nn),l=xe.useContext(oa),m=xe.useRef({keys:[],id:0}).current,g=xe.useMemo(()=>[...at(o.prefixName)||[],...at(e)],[o.prefixName,e]),f=xe.useMemo(()=>({...o,prefixName:g}),[o,g]),h=xe.useMemo(()=>({getKey:S=>{const y=g.length,w=S[y];return[m.keys[w],S.slice(y+1)]}}),[m,g]);if(typeof n!="function")return Qe(!1,"Form.List only accepts function as children."),null;const p=(S,y,{source:w})=>w==="internal"?!1:S!==y;return xe.createElement(oa.Provider,{value:h},xe.createElement(Nn.Provider,{value:f},xe.createElement(Dd,{name:[],shouldUpdate:p,rules:r,validateTrigger:a,initialValue:t,isList:!0,isListField:i??!!l},({value:S=[],onChange:y},w)=>{const{getFieldValue:v}=o,x=()=>v(g||[])||[],C={add:(b,T)=>{const R=x();T>=0&&T<=R.length?(m.keys=[...m.keys.slice(0,T),m.id,...m.keys.slice(T)],y([...R.slice(0,T),b,...R.slice(T)])):(process.env.NODE_ENV!=="production"&&(T<0||T>R.length)&&Qe(!1,"The second parameter of the add function should be a valid positive number."),m.keys=[...m.keys,m.id],y([...R,b])),m.id+=1},remove:b=>{const T=x(),R=new Set(Array.isArray(b)?b:[b]);R.size<=0||(m.keys=m.keys.filter((F,E)=>!R.has(E)),y(T.filter((F,E)=>!R.has(E))))},move(b,T){if(b===T)return;const R=x();b<0||b>=R.length||T<0||T>=R.length||(m.keys=Oc(m.keys,b,T),y(Oc(R,b,T)))}};let j=S||[];return Array.isArray(j)||(j=[],process.env.NODE_ENV!=="production"&&Qe(!1,`Current value of '${g.join(" > ")}' is not an array type.`)),n(j.map((b,T)=>{let R=m.keys[T];return R===void 0&&(m.keys[T]=m.id,R=m.keys[T],m.id+=1),{name:T,key:R,isListField:!0}}),C,w)})))}function a0(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((a,i)=>{e.forEach((o,l)=>{o.catch(u=>(t=!0,u)).then(u=>{n-=1,r[l]=u,!(n>0)&&(t&&i(r),a(r))})})}):Promise.resolve([])}const Gi="__@field_split__";function Es(e){return e.map(t=>`${typeof t}:${t}`).join(Gi)}class Jn{constructor(){ce(this,"kvs",new Map)}set(t,n){this.kvs.set(Es(t),n)}get(t){return this.kvs.get(Es(t))}getAsPrefix(t){const n=Es(t),r=n+Gi,a=[],i=this.kvs.get(n);return i!==void 0&&a.push(i),this.kvs.forEach((o,l)=>{l.startsWith(r)&&a.push(o)}),a}update(t,n){const r=this.get(t),a=n(r);a?this.set(t,a):this.delete(t)}delete(t){this.kvs.delete(Es(t))}map(t){return[...this.kvs.entries()].map(([n,r])=>{const a=n.split(Gi);return t({key:a.map(i=>{const[,o,l]=i.match(/^([^:]*):(.*)$/);return o==="number"?Number(l):l}),value:r})})}toJSON(){const t={};return this.map(({key:n,value:r})=>(t[n.join(".")]=r,null)),t}}class i0{constructor(t){ce(this,"formHooked",!1);ce(this,"forceRootUpdate");ce(this,"subscribable",!0);ce(this,"store",{});ce(this,"fieldEntities",[]);ce(this,"initialValues",{});ce(this,"callbacks",{});ce(this,"validateMessages",null);ce(this,"preserve",null);ce(this,"lastValidatePromise",null);ce(this,"watcherCenter",new n0(this));ce(this,"getForm",()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks}));ce(this,"getInternalHooks",t=>t===In?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):(Qe(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));ce(this,"useSubscribe",t=>{this.subscribable=t});ce(this,"prevWithoutPreserves",null);ce(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let a=tr(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{a=Ge(a,i,De(t,i))}),this.prevWithoutPreserves=null,this.updateStore(a)}});ce(this,"destroyForm",t=>{if(t)this.updateStore({});else{const n=new Jn;this.getFieldEntities(!0).forEach(r=>{this.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),this.prevWithoutPreserves=n}});ce(this,"getInitialValue",t=>{const n=De(this.initialValues,t);return t.length?tr(n):n});ce(this,"setCallbacks",t=>{this.callbacks=t});ce(this,"setValidateMessages",t=>{this.validateMessages=t});ce(this,"setPreserve",t=>{this.preserve=t});ce(this,"registerWatch",t=>this.watcherCenter.register(t));ce(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});ce(this,"timeoutId",null);ce(this,"warningUnhooked",()=>{process.env.NODE_ENV!=="production"&&!this.timeoutId&&typeof window<"u"&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.formHooked||Qe(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))});ce(this,"updateStore",t=>{this.store=t});ce(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);ce(this,"getFieldsMap",(t=!1)=>{const n=new Jn;return this.getFieldEntities(t).forEach(r=>{const a=r.getNamePath();n.set(a,r)}),n});ce(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(a=>{const i=at(a),o=r.getAsPrefix(i);return o.length?o:[{INVALIDATE_NAME_PATH:i}]}):t.map(a=>{const i=at(a);return r.get(i)||{INVALIDATE_NAME_PATH:at(a)}})});ce(this,"getFieldsValue",(t,n)=>{this.warningUnhooked();let r,a;if(t===!0||Array.isArray(t)?(r=t,a=n):t&&typeof t=="object"&&(a=t.filter),r===!0&&!a)return this.store;const i=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),o=[],l=[];i.forEach(m=>{var f;const g=m.INVALIDATE_NAME_PATH||m.getNamePath();if((f=m.isList)!=null&&f.call(m)){l.push(g);return}if(!a)o.push(g);else{const h="getMeta"in m?m.getMeta():null;a(h)&&o.push(g)}});let u=Ac(this.store,o.map(at));return l.forEach(m=>{De(u,m)||(u=Ge(u,m,[]))}),u});ce(this,"getFieldValue",t=>{this.warningUnhooked();const n=at(t);return De(this.store,n)});ce(this,"getFieldsError",t=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(t).map((r,a)=>r&&!r.INVALIDATE_NAME_PATH?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:at(t[a]),errors:[],warnings:[]})));ce(this,"getFieldError",t=>{this.warningUnhooked();const n=at(t);return this.getFieldsError([n])[0].errors});ce(this,"getFieldWarning",t=>{this.warningUnhooked();const n=at(t);return this.getFieldsError([n])[0].warnings});ce(this,"isFieldsTouched",(...t)=>{this.warningUnhooked();const[n,r]=t;let a,i=!1;t.length===0?a=null:t.length===1?Array.isArray(n)?(a=n.map(at),i=!1):(a=null,i=n):(a=n.map(at),i=r);const o=this.getFieldEntities(!0),l=f=>f.isFieldTouched();if(!a)return i?o.every(f=>l(f)||f.isList()):o.some(l);const u=new Jn;a.forEach(f=>{u.set(f,[])}),o.forEach(f=>{const h=f.getNamePath();a.forEach(p=>{p.every((S,y)=>h[y]===S)&&u.update(p,S=>[...S,f])})});const m=f=>f.some(l),g=u.map(({value:f})=>f);return i?g.every(m):g.some(m)});ce(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));ce(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(a=>a.isFieldValidating());const r=t.map(at);return n.some(a=>{const i=a.getNamePath();return ar(r,i)&&a.isFieldValidating()})});ce(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));ce(this,"resetWithFieldInitialValue",(t={})=>{const n=new Jn,r=this.getFieldEntities(!0);r.forEach(o=>{const{initialValue:l}=o.props,u=o.getNamePath();if(l!==void 0){const m=n.get(u)||new Set;m.add({entity:o,value:l}),n.set(u,m)}});const a=o=>{o.forEach(l=>{const{initialValue:u}=l.props;if(u!==void 0){const m=l.getNamePath();if(this.getInitialValue(m)!==void 0)Qe(!1,`Form already set 'initialValues' with path '${m.join(".")}'. Field can not overwrite it.`);else{const f=n.get(m);if(f&&f.size>1)Qe(!1,`Multiple Field with path '${m.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(f){const h=this.getFieldValue(m);!l.isListField()&&(!t.skipExist||h===void 0)&&this.updateStore(Ge(this.store,m,[...f][0].value))}}}})};let i;t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach(o=>{const l=n.get(o);l&&i.push(...[...l].map(u=>u.entity))})):i=r,a(i)});ce(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(tr(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(at);r.forEach(a=>{const i=this.getInitialValue(a);this.updateStore(Ge(this.store,a,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});ce(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(a=>{const{name:i,...o}=a,l=at(i);r.push(l),"value"in o&&this.updateStore(Ge(this.store,l,o.value)),this.notifyObservers(n,[l],{type:"setField",data:a})}),this.notifyWatch(r)});ce(this,"getFields",()=>this.getFieldEntities(!0).map(r=>{const a=r.getNamePath(),o={...r.getMeta(),name:a,value:this.getFieldValue(a)};return Object.defineProperty(o,"originRCField",{value:!0}),o}));ce(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();De(this.store,r)===void 0&&this.updateStore(Ge(this.store,r,n))}});ce(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);ce(this,"registerField",t=>{this.fieldEntities.push(t);const n=t.getNamePath();if(this.notifyWatch([n]),t.props.initialValue!==void 0){const r=this.store;this.resetWithFieldInitialValue({entities:[t],skipExist:!0}),this.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,a,i=[])=>{if(this.fieldEntities=this.fieldEntities.filter(o=>o!==t),!this.isMergedPreserve(a)&&(!r||i.length>1)){const o=r?void 0:this.getInitialValue(n);if(n.length&&this.getFieldValue(n)!==o&&this.fieldEntities.every(l=>!la(l.getNamePath(),n))){const l=this.store;this.updateStore(Ge(l,n,o,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});ce(this,"dispatch",t=>{switch(t.type){case"updateValue":{const{namePath:n,value:r}=t;this.updateValue(n,r);break}case"validateField":{const{namePath:n,triggerName:r}=t;this.validateFields([n],{triggerName:r});break}}});ce(this,"notifyObservers",(t,n,r)=>{if(this.subscribable){const a={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:i})=>{i(t,n,a)})}else this.forceRootUpdate()});ce(this,"triggerDependenciesUpdate",(t,n)=>{const r=this.getDependencyChildrenFields(n);return r.length&&this.validateFields(r,{delayFrame:!0}),this.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[n,...r]}),r});ce(this,"updateValue",(t,n)=>{const r=at(t),a=this.store;this.updateStore(Ge(this.store,r,n)),this.notifyObservers(a,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);const i=this.triggerDependenciesUpdate(a,r),{onValuesChange:o}=this.callbacks;if(o){const l=Ac(this.store,[r]),u=this.getFieldsValue(),m=Ge(u,r,De(l,r));o(l,m)}this.triggerOnFieldsChange([r,...i])});ce(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=tr(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});ce(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});ce(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],a=new Jn;this.getFieldEntities().forEach(o=>{const{dependencies:l}=o.props;(l||[]).forEach(u=>{const m=at(u);a.update(m,(g=new Set)=>(g.add(o),g))})});const i=o=>{(a.get(o)||new Set).forEach(u=>{if(!n.has(u)){n.add(u);const m=u.getNamePath();u.isFieldDirty()&&m.length&&(r.push(m),i(m))}})};return i(t),r});ce(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const a=this.getFields();if(n){const o=new Jn;n.forEach(({name:l,errors:u})=>{o.set(l,u)}),a.forEach(l=>{l.errors=o.get(l.name)||l.errors})}const i=a.filter(({name:o})=>ar(t,o));i.length&&r(i,a)}});ce(this,"validateFields",(t,n)=>{this.warningUnhooked();let r,a;Array.isArray(t)||typeof t=="string"||typeof n=="string"?(r=t,a=n):a=t;const i=!!r,o=i?r.map(at):[],l=[...o],u=[],m=String(Date.now()),g=new Set,{recursive:f,dirty:h}=a||{};this.getFieldEntities(!0).forEach(w=>{const v=w.getNamePath();if(i||((!w.isList()||!o.some(x=>la(x,v,!0)))&&l.push(v),o.push(v)),!(!w.props.rules||!w.props.rules.length)&&!(h&&!w.isFieldDirty())&&(g.add(v.join(m)),!i||ar(o,v,f))){const x=w.validateRules({validateMessages:{...kd,...this.validateMessages},...a});u.push(x.then(()=>({name:v,errors:[],warnings:[]})).catch(C=>{var T;const j=[],b=[];return(T=C.forEach)==null||T.call(C,({rule:{warningOnly:R},errors:F})=>{R?b.push(...F):j.push(...F)}),j.length?Promise.reject({name:v,errors:j,warnings:b}):{name:v,errors:j,warnings:b}}))}});const p=a0(u);this.lastValidatePromise=p,p.catch(w=>w).then(w=>{const v=w.map(({name:x})=>x);this.notifyObservers(this.store,v,{type:"validateFinish"}),this.triggerOnFieldsChange(v,w)});const S=p.then(()=>this.lastValidatePromise===p?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(w=>{var C,j;const v=w.filter(b=>b&&b.errors.length),x=(j=(C=v[0])==null?void 0:C.errors)==null?void 0:j[0];return Promise.reject({message:x,values:this.getFieldsValue(o),errorFields:v,outOfDate:this.lastValidatePromise!==p})});S.catch(w=>w);const y=o.filter(w=>g.has(w.join(m)));return this.triggerOnFieldsChange(y),S});ce(this,"submit",()=>{this.warningUnhooked(),this.validateFields().then(t=>{const{onFinish:n}=this.callbacks;if(n)try{n(t)}catch(r){console.error(r)}}).catch(t=>{const{onFinishFailed:n}=this.callbacks;n&&n(t)})});this.forceRootUpdate=t}}function Pd(e){const t=xe.useRef(null),[,n]=xe.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},a=new i0(r);t.current=a.getForm()}return[t.current]}const Zi=xe.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),o0=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const a=xe.useContext(Zi),i=xe.useRef({});return xe.createElement(Zi.Provider,{value:{...a,validateMessages:{...a.validateMessages,...e},triggerFormChange:(o,l)=>{t&&t(o,{changedFields:l,forms:i.current}),a.triggerFormChange(o,l)},triggerFormFinish:(o,l)=>{n&&n(o,{values:l,forms:i.current}),a.triggerFormFinish(o,l)},registerForm:(o,l)=>{o&&(i.current={...i.current,[o]:l}),a.registerForm(o,l)},unregisterForm:o=>{const l={...i.current};delete l[o],i.current=l,a.unregisterForm(o)}}},r)};function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ji.apply(this,arguments)}const l0=(e,t)=>{const{name:n,initialValues:r,fields:a,form:i,preserve:o,children:l,component:u="form",validateMessages:m,validateTrigger:g="onChange",onValuesChange:f,onFieldsChange:h,onFinish:p,onFinishFailed:S,clearOnDestroy:y,...w}=e,v=xe.useRef(null),x=xe.useContext(Zi),[C]=Pd(i),{useSubscribe:j,setInitialValues:b,setCallbacks:T,setValidateMessages:R,setPreserve:F,destroyForm:E}=C.getInternalHooks(In);xe.useImperativeHandle(t,()=>({...C,nativeElement:v.current})),xe.useEffect(()=>(x.registerForm(n,C),()=>{x.unregisterForm(n)}),[x,C,n]),R({...x.validateMessages,...m}),T({onValuesChange:f,onFieldsChange:($,...D)=>{x.triggerFormChange(n,$),h&&h($,...D)},onFinish:$=>{x.triggerFormFinish(n,$),p&&p($)},onFinishFailed:S}),F(o);const M=xe.useRef(null);b(r,!M.current),M.current||(M.current=!0),xe.useEffect(()=>()=>E(y),[]);let k;const V=typeof l=="function";if(V){const $=C.getFieldsValue(!0);k=l($,C)}else k=l;j(!V);const _=xe.useRef(null);xe.useEffect(()=>{e0(_.current||[],a||[])||C.setFields(a||[]),_.current=a},[a,C]);const A=xe.useMemo(()=>({...C,validateTrigger:g}),[C,g]),I=xe.createElement(oa.Provider,{value:null},xe.createElement(Nn.Provider,{value:A},k));return u===!1?I:xe.createElement(u,Ji({},w,{ref:v,onSubmit:$=>{$.preventDefault(),$.stopPropagation(),C.submit()},onReset:$=>{var D;$.preventDefault(),C.resetFields(),(D=w.onReset)==null||D.call(w,$)}}),I)};function si(e){try{return JSON.stringify(e)}catch{return Math.random()}}function c0(...e){const[t,n={}]=e,r=Cj(n)?{form:n}:n,a=r.form,[i,o]=d.useState(()=>typeof t=="function"?t({}):void 0),l=d.useMemo(()=>si(i),[i]),u=d.useRef(l);u.current=l;const m=d.useContext(Nn),g=a||m,f=g&&g._init;process.env.NODE_ENV!=="production"&&Qe(e.length===2?a?f:!0:f,"useWatch requires a form instance since it can not auto detect from context.");const{getFieldsValue:h,getInternalHooks:p}=g,{registerWatch:S}=p(In),y=eu((v,x)=>{const C=r.preserve?x??h(!0):v??h(),j=typeof t=="function"?t(C):De(C,at(t));si(i)!==si(j)&&o(j)}),w=typeof t=="function"?t:JSON.stringify(t);return d.useEffect(()=>{f&&y()},[f,w]),d.useEffect(()=>f?S((x,C)=>{y(x,C)}):void 0,[f]),i}const u0=xe.forwardRef(l0),es=u0;es.FormProvider=o0;es.Field=Dd;es.List=s0;es.useForm=Pd;es.useWatch=c0;const xr=d.createContext({}),ts=d.createContext({mode:"edit"}),d0=e=>Array.isArray(e)?e:typeof e=="function"?[e]:bn(e),f0=e=>{var ue,ge,me;const{creatorButtonProps:t,deleteIconProps:n,copyIconProps:r,arrowSort:a,upIconProps:i,downIconProps:o,itemContainerRender:l,itemRender:u,alwaysShowItemLabel:m,prefixCls:g,creatorRecord:f,action:h,actionGuard:p,children:S,actionRender:y,fields:w,meta:v,field:x,index:C,formInstance:j,originName:b,containerClassName:T,containerStyle:R,min:F,max:E,count:M,...k}=e,{hashId:V}=d.useContext(Gt),{componentSize:_}=((ge=(ue=c.ConfigProvider).useConfig)==null?void 0:ge.call(ue))||{componentSize:"middle"},A=d.useContext(dr),I=d.useRef(!1),{mode:$}=d.useContext(ts),[D,O]=d.useState(!1),[z,Z]=d.useState(!1);d.useEffect(()=>()=>{I.current=!0},[]);const L=()=>j.getFieldValue([A.listName,b,C==null?void 0:C.toString()].flat(1).filter(he=>he!=null)),U={getCurrentRowData:L,setCurrentRowData:he=>{var Fe;const Q=((Fe=j==null?void 0:j.getFieldsValue)==null?void 0:Fe.call(j))||{},se=[A.listName,b,C==null?void 0:C.toString()].flat(1).filter(ie=>ie!=null),Se=Ge(Q,se,{...L(),...he||{}});return j.setFieldsValue(Se)}},J=d0(S).map(he=>typeof he=="function"?he==null?void 0:he(x,C,{...h,...U},M):he).map((he,Q)=>{var se;return d.isValidElement(he)?d.cloneElement(he,{key:he.key||((se=he==null?void 0:he.props)==null?void 0:se.name)||Q,...(he==null?void 0:he.props)||{}}):he}),G=d.useMemo(()=>{if($==="read"||r===!1||E===M)return null;const{Icon:he=de.CopyOutlined,tooltipText:Q}=r;return s.jsx(c.Tooltip,{title:Q,children:z?s.jsx(de.LoadingOutlined,{}):s.jsx(he,{className:le(`${g}-action-icon action-copy`,V),onClick:async()=>{Z(!0);const se=j==null?void 0:j.getFieldValue([A.listName,b,x.name].filter(Se=>Se!==void 0).flat(1));await h.add(se,M),Z(!1)}})},"copy")},[r,E,M,z,g,V,j,A.listName,x.name,b,h]),H=d.useMemo(()=>{if($==="read"||n===!1||F===M)return null;const{Icon:he=de.DeleteOutlined,tooltipText:Q}=n;return s.jsx(c.Tooltip,{title:Q,children:D?s.jsx(de.LoadingOutlined,{}):s.jsx(he,{className:le(`${g}-action-icon action-remove`,V),onClick:async()=>{O(!0),await h.remove(x.name),I.current||O(!1)}})},"delete")},[n,F,M,D,g,V,h,x.name]),B=d.useMemo(()=>{if(!a||$==="read"||i===!1)return null;const he=C-1;if(he<0)return null;const{Icon:Q=de.ArrowUpOutlined,tooltipText:se}=i;return s.jsx(c.Tooltip,{title:se,children:s.jsx(Q,{className:le(`${g}-action-icon action-up`,V),onClick:async()=>{await h.move(C,he)}})},"up")},[i,g,V,h,a]),W=d.useMemo(()=>{if(!a||$==="read"||o===!1)return null;const he=C+1;if(he>=M)return null;const{Icon:Q=de.ArrowDownOutlined,tooltipText:se}=o;return s.jsx(c.Tooltip,{title:se,children:s.jsx(Q,{className:le(`${g}-action-icon action-down`,V),onClick:async()=>{await h.move(C,he)}})},"down")},[i,g,V,h,a]),N=d.useMemo(()=>[G,H,B,W].filter(he=>he!=null),[G,H,B,W]),q=(y==null?void 0:y(x,h,N,M))||N,ee=q.length>0&&$!=="read"?s.jsx("div",{className:le(`${g}-action`,{[`${g}-action-small`]:_==="small"},V),children:q}):null,ne={name:k.name,field:x,index:C,record:(me=j==null?void 0:j.getFieldValue)==null?void 0:me.call(j,[A.listName,b,x.name].filter(he=>he!==void 0).flat(1)),fields:w,operation:h,meta:v},{grid:X}=yr(),ae=(l==null?void 0:l(J,ne))||J,oe=(u==null?void 0:u({listDom:s.jsx("div",{className:le(`${g}-container`,T,V),style:{width:X?"100%":void 0,...R},children:ae}),action:ee},ne))||s.jsxs("div",{className:le(`${g}-item`,V,{[`${g}-item-default`]:m===void 0,[`${g}-item-show-label`]:m}),style:{display:"flex",alignItems:"flex-end"},children:[s.jsx("div",{className:le(`${g}-container`,T,V),style:{width:X?"100%":void 0,...R},children:ae}),ee]});return s.jsx(dr.Provider,{value:{...x,listName:[A.listName,b,x.name].filter(he=>he!==void 0).flat(1)},children:oe})},h0=e=>{const t=ke(),{creatorButtonProps:n,prefixCls:r,children:a,creatorRecord:i,action:o,fields:l,actionGuard:u,max:m,fieldExtraRender:g,meta:f,containerClassName:h,containerStyle:p,onAfterAdd:S,onAfterRemove:y}=e,{hashId:w}=d.useContext(Gt),v=d.useRef(new Map),[x,C]=d.useState(!1),j=d.useMemo(()=>l.map(M=>{var V,_,A;(V=v.current)!=null&&V.has(M.key.toString())||(_=v.current)==null||_.set(M.key.toString(),Kr());const k=(A=v.current)==null?void 0:A.get(M.key.toString());return{...M,uuid:k}}),[l]),b=d.useMemo(()=>{const M={...o},k=j.length;return u!=null&&u.beforeAddRow?M.add=async(...V)=>{if(await u.beforeAddRow(...V,k)){const A=o.add(...V);return S==null||S(...V,k+1),A}return!1}:M.add=async(...V)=>{const _=o.add(...V);return S==null||S(...V,k+1),_},u!=null&&u.beforeRemoveRow?M.remove=async(...V)=>{if(await u.beforeRemoveRow(...V,k)){const A=o.remove(...V);return y==null||y(...V,k-1),A}return!1}:M.remove=async(...V)=>{const _=o.remove(...V);return y==null||y(...V,k-1),_},M},[o,u==null?void 0:u.beforeAddRow,u==null?void 0:u.beforeRemoveRow,S,y,j.length]),T=d.useMemo(()=>{if(n===!1||j.length===m)return null;const{position:M="bottom",creatorButtonText:k=t.getMessage("editableTable.action.add","添加一行数据")}=n||{};return s.jsx(c.Button,{className:le(`${r}-creator-button-${M}`,w),type:"dashed",loading:x,block:!0,icon:s.jsx(de.PlusOutlined,{}),...We(n||{},["position","creatorButtonText"]),onClick:async()=>{C(!0);let V=j.length;M==="top"&&(V=0),await b.add(xt(i)??{},V),C(!1)},children:k})},[n,j.length,m,t,r,w,x,b,i]),R=d.useContext(ts),F={width:"max-content",maxWidth:"100%",minWidth:"100%",...p},E=d.useMemo(()=>j.map((M,k)=>d.createElement(f0,{...e,key:M.uuid,field:M,index:k,action:b,count:j.length},a)),[a,e,j,b]);return R.mode==="read"||e.readonly===!0?s.jsx(s.Fragment,{children:E}):s.jsxs("div",{style:F,className:h,children:[n!==!1&&(n==null?void 0:n.position)==="top"&&T,E,g&&g(b,f),n!==!1&&(n==null?void 0:n.position)!=="top"&&T]})},m0=e=>({[`${e.antCls}-pro`]:{[`${e.antCls}-form:not(${e.antCls}-form-horizontal)`]:{[e.componentCls]:{[`&-item:not(${e.componentCls}-item-show-label)`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},[e.componentCls]:{boxSizing:"border-box",maxWidth:"100%","&-item":{"&&-show-label":{[`${e.antCls}-form-item-label`]:{display:"inline-block"}},"&&-default:first-child":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"inline-block"}}}},"&&-default:not(:first-child)":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},"&-action":{display:"flex",height:e.controlHeight,marginBlockEnd:e.marginLG,lineHeight:e.controlHeight+"px","&-small":{height:e.controlHeightSM,lineHeight:e.controlHeightSM}},"&-action-icon":{marginInlineStart:8,cursor:"pointer",transition:"color 0.3s ease-in-out","&:hover":{color:e.colorPrimaryTextHover}},[`${e.proComponentsCls}-card ${e.proComponentsCls}-card-extra`]:{[e.componentCls]:{"&-action":{marginBlockEnd:0}}},"&-creator-button-top":{marginBlockEnd:24}}});function g0(e){return Je("ProFormList",t=>{const n={...t,componentCls:`.${e}`};return[m0(n)]})}const{noteOnce:Dc}=Qe,dr=d.createContext({});function p0(e){const t=d.useRef(),n=d.useContext(c.ConfigProvider.ConfigContext),r=d.useContext(dr),a=n.getPrefixCls("pro-form-list"),i=ke(),{setFieldValueType:o}=d.useContext(xr),{transform:l,actionRender:u,creatorButtonProps:m,label:g,alwaysShowItemLabel:f,tooltip:h,creatorRecord:p,itemRender:S,rules:y,itemContainerRender:w,fieldExtraRender:v,copyIconProps:x={Icon:de.CopyOutlined,tooltipText:i.getMessage("copyThisLine","复制此项")},children:C,deleteIconProps:j={Icon:de.DeleteOutlined,tooltipText:i.getMessage("deleteThisLine","删除此项")},arrowSort:b,upIconProps:T={Icon:de.ArrowUpOutlined,tooltipText:i.getMessage("sortUpThisLine","向上排序")},downIconProps:R={Icon:de.ArrowDownOutlined,tooltipText:i.getMessage("sortDownThisLine","向下排序")},actionRef:F,style:E,prefixCls:M,actionGuard:k,min:V,max:_,colProps:A,wrapperCol:I,rowProps:$,onAfterAdd:D,onAfterRemove:O,isValidateList:z=!1,emptyListMessage:Z="列表不能为空",className:L,containerClassName:U,containerStyle:J,readonly:G,...H}=e,{ColWrapper:B,RowWrapper:W}=yr({colProps:A,rowProps:$}),N=d.useContext(Jr),q=d.useMemo(()=>r.name===void 0?[H.name].flat(1):[r.name,H.name].flat(1),[r.name,H.name]);d.useImperativeHandle(F,()=>({...t.current,get:X=>N.formRef.current.getFieldValue([...q,X]),getList:()=>N.formRef.current.getFieldValue([...q])}),[q,N.formRef]),d.useEffect(()=>{Dc(!!N.formRef,"ProFormList 必须要放到 ProForm 中,否则会造成行为异常。"),Dc(!!N.formRef,"Proformlist must be placed in ProForm, otherwise it will cause abnormal behavior.")},[N.formRef]),d.useEffect(()=>{!o||!e.name||o([e.name].flat(1).filter(X=>X!==void 0),{valueType:"formList",transform:l})},[e.name,o,l]);const{wrapSSR:ee,hashId:ne}=g0(a);return N.formRef?ee(s.jsx(B,{children:s.jsx("div",{className:le(a,ne),style:E,children:s.jsx(c.Form.Item,{label:g,prefixCls:M,tooltip:h,style:E,required:y==null?void 0:y.some(X=>X.required),wrapperCol:I,className:L,...H,name:z?q:void 0,rules:z?[{validator:(X,ae)=>!ae||ae.length===0?Promise.reject(new Error(Z)):Promise.resolve(),required:!0}]:void 0,children:s.jsx(c.Form.List,{rules:y,...H,name:q,children:(X,ae,oe)=>(t.current=ae,s.jsxs(W,{children:[s.jsx(h0,{name:q,readonly:!!G,originName:H.name,copyIconProps:x,deleteIconProps:j,arrowSort:b,upIconProps:T,downIconProps:R,formInstance:N.formRef.current,prefixCls:a,meta:oe,fields:X,itemContainerRender:w,itemRender:S,fieldExtraRender:v,creatorButtonProps:m,creatorRecord:p,actionRender:u,action:ae,actionGuard:k,alwaysShowItemLabel:f,min:V,max:_,count:X.length,onAfterAdd:(ue,ge,me)=>{z&&N.formRef.current.validateFields([q]),D==null||D(ue,ge,me)},onAfterRemove:(ue,ge)=>{z&&ge===0&&N.formRef.current.validateFields([q]),O==null||O(ue,ge)},containerClassName:U,containerStyle:J,children:C}),s.jsx(c.Form.ErrorList,{errors:oe.errors})]}))})})})})):null}const Ca=({name:e,originDependencies:t=e,children:n,ignoreFormListField:r,...a})=>{const i=d.useContext(Jr),o=d.useContext(dr),l=d.useMemo(()=>e.map(u=>{var g;const m=[u];return!r&&o.name!==void 0&&((g=o.listName)!=null&&g.length)&&m.unshift(o.listName),m.flat(1)}),[o.listName,o.name,r,e==null?void 0:e.toString()]);return s.jsx(c.Form.Item,{...a,noStyle:!0,shouldUpdate:(u,m,g)=>{var f;return typeof a.shouldUpdate=="boolean"?a.shouldUpdate:typeof a.shouldUpdate=="function"?(f=a.shouldUpdate)==null?void 0:f.call(a,u,m,g):l.some(h=>!xn(De(u,h),De(m,h)))},children:u=>{var g,f;let m={};for(let h=0;h<e.length;h++){const p=l[h],S=t[h];let y=(g=i.getFieldFormatValueObject)==null?void 0:g.call(i,p);y&&Object.keys(y).length?(m=sa({},m,y),De(y,p)&&(m=Ge(m,[S].flat(1),De(y,p)))):(y=(f=u.getFieldValue)==null?void 0:f.call(u,p),typeof y<"u"&&(m=Ge(m,[S].flat(1),y)))}return n==null?void 0:n(m,{...u,...i})}})};Ca.displayName="ProFormDependency";const y0=d.createContext({}),x0=e=>{var v,x,C;const{children:t,onChange:n,onBlur:r,ignoreFormItem:a,valuePropName:i="value",...o}=e,l=((v=t==null?void 0:t.type)==null?void 0:v.displayName)!=="ProFormComponent",u=!d.isValidElement(t),m=we(function(...j){var b,T,R,F,E;n==null||n(...j),!l&&(u||((T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...j),(E=(F=(R=t==null?void 0:t.props)==null?void 0:R.fieldProps)==null?void 0:F.onChange)==null||E.call(F,...j)))}),g=we(function(...j){var b,T,R,F,E;l||u||(r==null||r(...j),(T=(b=t==null?void 0:t.props)==null?void 0:b.onBlur)==null||T.call(b,...j),(E=(F=(R=t==null?void 0:t.props)==null?void 0:R.fieldProps)==null?void 0:F.onBlur)==null||E.call(F,...j))}),f=gt(()=>{var j;return We(((j=t==null?void 0:t.props)==null?void 0:j.fieldProps)||{},["onBlur","onChange"])},[We(((x=t==null?void 0:t.props)==null?void 0:x.fieldProps)||{},["onBlur","onChange"])]),h=e[i],p=d.useMemo(()=>{if(!l&&!u)return ht({id:o.id,[i]:h,...f,onBlur:g,onChange:m})},[h,f,g,m,o.id,i]),S=d.useMemo(()=>{if(!p&&d.isValidElement(t))return(...j)=>{var b,T;n==null||n(...j),(T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...j)}},[p,t,n]);if(!d.isValidElement(t))return s.jsx(s.Fragment,{children:t});const y=o.variant,w=o.fieldProps;return d.cloneElement(t,ht({...o,[i]:e[i],...t.props,onChange:S,...!l&&p?{fieldProps:{...(C=t.props)==null?void 0:C.fieldProps,...w,...p}}:{},...y!==void 0&&{variant:y},onBlur:l&&!u&&typeof r=="function"?r:void 0}))},Pc=({children:e,addonAfter:t,addonBefore:n,valuePropName:r,addonWarpStyle:a,convertValue:i,help:o,...l})=>{const u=d.useMemo(()=>{let m=g=>{const f=(i==null?void 0:i(g,l.name))??g;return l.getValueProps?l.getValueProps(f):{[r||"value"]:f}};return!i&&!l.getValueProps&&(m=void 0),!t&&!n?s.jsx(c.Form.Item,{...l,valuePropName:r,getValueProps:m,children:e}):s.jsx(c.Form.Item,{...l,help:typeof o!="function"?o:void 0,valuePropName:r,_internalItemRender:{mark:"pro_table_render",render:(g,f)=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",...a},children:[n?s.jsx("div",{style:{marginInlineEnd:8},children:n}):null,f.input,t?s.jsx("div",{style:{marginInlineStart:8},children:t}):null]}),typeof o=="function"?o({errors:g.errors,warnings:g.warnings}):f.errorList,f.extra]})},...l,getValueProps:m,children:e})},[t,n,e,i==null?void 0:i.toString(),l]);return s.jsx(y0.Provider,{value:{name:l.name,label:l.label},children:u})},Nd=e=>{var j,b,T,R,F,E;const{componentSize:t}=((b=(j=c.ConfigProvider)==null?void 0:j.useConfig)==null?void 0:b.call(j))||{componentSize:"middle"},n=t,{valueType:r,transform:a,dataFormat:i,ignoreFormItem:o,lightProps:l,children:u,fieldProps:m,...g}=e,f=d.useContext(dr),h=d.useMemo(()=>e.name===void 0?e.name:f.name!==void 0?[f.name,e.name].flat(1):Array.isArray(e.name)?e.name:[e.name],[f.name,e.name]),{setFieldValueType:p,formItemProps:S}=d.useContext(xr);d.useEffect(()=>{!p||!e.name||p(h,{valueType:r||"text",dateFormat:i,transform:a})},[h,i,e.name,p,a,r]);const y=d.isValidElement(e.children)&&Bp(r||e.children.props.valueType),w=d.useMemo(()=>!!(!(l!=null&&l.light)||l!=null&&l.customLightMode||y),[l==null?void 0:l.customLightMode,y,l==null?void 0:l.light]);if(typeof e.children=="function")return d.createElement(Pc,{...g,name:h,key:g.proFormFieldKey||((T=g.name)==null?void 0:T.toString())},e.children);const v=s.jsx(x0,{valuePropName:e.valuePropName,children:e.children},g.proFormFieldKey||((R=g.name)==null?void 0:R.toString())),x=ht(l||{}),C=w?v:d.createElement($0,{...x,key:g.proFormFieldKey||((F=g.name)==null?void 0:F.toString()),size:n},v);return o?s.jsx(s.Fragment,{children:C}):s.jsx(Pc,{...S,...g,name:h,isListField:f.name!==void 0,children:C},g.proFormFieldKey||((E=g.name)==null?void 0:E.toString()))},Nc={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},b0=["switch","radioButton","radio","rate"];function ir(e,t){e.displayName="ProFormComponent";const n=a=>{const{valueType:i,customLightMode:o,lightFilterLabelFormatter:l,valuePropName:u="value",ignoreWidth:m,defaultProps:g,...f}={...a==null?void 0:a.fieldConfig,...t},{label:h,tooltip:p,placeholder:S,width:y,bordered:w,messageVariables:v,ignoreFormItem:x,transform:C,convertValue:j,readonly:b,allowClear:T,colSize:R,getFormItemProps:F,getFieldProps:E,fieldConfig:M,cacheForSwr:k,proFieldProps:V,..._}={...g,...a},A=i||_.valueType,I=d.useMemo(()=>m||b0.includes(A),[m,A]),[,$]=d.useState(),[D,O]=d.useState(),z=d.useContext(xr),Z=gt(()=>({formItemProps:F==null?void 0:F(),fieldProps:E==null?void 0:E()}),[E,F,_.dependenciesValues,D]),L=gt(()=>{const ue={...x?ht({value:_.value}):{},placeholder:S,disabled:a.disabled,...z.fieldProps,...Z.fieldProps,..._.fieldProps};return ue.style=ht(ue==null?void 0:ue.style),ue},[x,_.value,_.fieldProps,S,a.disabled,z.fieldProps,Z.fieldProps]),U=Gp(_),J=gt(()=>({...z.formItemProps,...U,...Z.formItemProps,..._.formItemProps}),[Z.formItemProps,z.formItemProps,_.formItemProps,U]),G=gt(()=>({messageVariables:v,...f,...J}),[f,J,v]),{prefixName:H}=d.useContext(Nn),B=gt(()=>{let ue=G==null?void 0:G.name;return Array.isArray(ue)&&(ue=ue.join("_")),Array.isArray(H)&&ue&&(ue=`${H.join(".")}.${ue}`),ue&&`form-${z.formKey??""}-field-${ue}`},[pn(G==null?void 0:G.name),H,z.formKey]),W=we((...ue)=>{var ge;F||E?O([]):_.formItemRender&&$([]),(ge=L==null?void 0:L.onChange)==null||ge.call(L,...ue)}),N=gt(()=>{const ue={width:y&&!Nc[y]?y:z.grid?"100%":void 0,...L==null?void 0:L.style};return I&&Reflect.deleteProperty(ue,"width"),ht(ue)},[pn(L==null?void 0:L.style),z.grid,I,y]),q=gt(()=>{const ue=y&&Nc[y];return le(L==null?void 0:L.className,{"pro-field":ue,[`pro-field-${y}`]:ue&&!I})||void 0},[y,L==null?void 0:L.className,I]),ee=gt(()=>ht({...z.proFieldProps,mode:_==null?void 0:_.mode,readonly:b,params:_.params,proFieldKey:B,cacheForSwr:k,...V}),[z.proFieldProps,_==null?void 0:_.mode,_.params,b,B,k,V]),ne=gt(()=>({onChange:W,allowClear:T,...L,style:N,className:q}),[T,q,W,L,N]),X=gt(()=>s.jsx(e,{..._,fieldProps:ne,proFieldProps:ee,ref:a==null?void 0:a.fieldRef},a.proFormFieldKey||a.name),[ee,ne,_]),ae=gt(()=>{var ue,ge,me;return s.jsx(Nd,{label:h&&(V==null?void 0:V.light)!==!0?h:void 0,tooltip:(V==null?void 0:V.light)!==!0&&p,valuePropName:u,...G,ignoreFormItem:x,transform:C,dataFormat:L==null?void 0:L.format,valueType:A,messageVariables:{label:h||"",...G==null?void 0:G.messageVariables},convertValue:j,lightProps:ht({...L,variant:_.variant??(L==null?void 0:L.variant),valueType:A,bordered:w,allowClear:((ue=X==null?void 0:X.props)==null?void 0:ue.allowClear)??T,light:V==null?void 0:V.light,label:h,customLightMode:o,labelFormatter:l,valuePropName:u,footerRender:(ge=X==null?void 0:X.props)==null?void 0:ge.footerRender,..._.lightProps,...G.lightProps}),children:X},a.proFormFieldKey||((me=G.name)==null?void 0:me.toString()))},[h,V==null?void 0:V.light,p,u,a.proFormFieldKey,G,x,C,L,A,j,w,X,T,o,l,_.lightProps]),{ColWrapper:oe}=yr(_);return s.jsx(oe,{children:ae})};return a=>{const{dependencies:i}=a;return i?s.jsx(Ca,{name:i,originDependencies:a==null?void 0:a.originDependencies,children:o=>s.jsx(n,{dependenciesValues:o,dependencies:i,...a})}):s.jsx(n,{dependencies:i,...a})}}var Br=function(){return Br=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Br.apply(this,arguments)};function S0(e){var t,n=(typeof window<"u"?window:{}).URL,r=new n((t=window==null?void 0:window.location)===null||t===void 0?void 0:t.href);return Object.keys(e).forEach(function(a){var i=e[a];i!=null?Array.isArray(i)?(r.searchParams.delete(a),i.forEach(function(o){r.searchParams.append(a,o)})):i instanceof Date?Number.isNaN(i.getTime())||r.searchParams.set(a,i.toISOString()):typeof i=="object"?r.searchParams.set(a,JSON.stringify(i)):r.searchParams.set(a,i):r.searchParams.delete(a)}),r}function C0(e,t){var n;e===void 0&&(e={}),t===void 0&&(t={disabled:!1});var r=d.useState(),a=r[1],i=typeof window<"u"&&((n=window==null?void 0:window.location)===null||n===void 0?void 0:n.search),o=d.useMemo(function(){return t.disabled?{}:new URLSearchParams(i||{})},[t.disabled,i]),l=d.useMemo(function(){if(t.disabled)return{};if(typeof window>"u"||!window.URL)return{};var g=[];o.forEach(function(h,p){g.push({key:p,value:h})}),g=g.reduce(function(h,p){return(h[p.key]=h[p.key]||[]).push(p),h},{}),g=Object.keys(g).map(function(h){var p=g[h];return p.length===1?[h,p[0].value]:[h,p.map(function(S){var y=S.value;return y})]});var f=Br({},e);return g.forEach(function(h){var p=h[0],S=h[1];f[p]=j0(p,S,{},e)}),f},[t.disabled,e,o]);function u(g){if(!(typeof window>"u"||!window.URL)){var f=S0(g);window.location.search!==f.search&&window.history.replaceState({},"",f.toString()),o.toString()!==f.searchParams.toString()&&a({})}}d.useEffect(function(){t.disabled||typeof window>"u"||!window.URL||u(Br(Br({},e),l))},[t.disabled,l]);var m=function(g){u(g)};return d.useEffect(function(){if(t.disabled)return function(){};if(typeof window>"u"||!window.URL)return function(){};var g=function(){a({})};return window.addEventListener("popstate",g),function(){window.removeEventListener("popstate",g)}},[t.disabled]),[l,m]}var w0={true:!0,false:!1};function j0(e,t,n,r){if(!n)return t;var a=n[e],i=t===void 0?r[e]:t;return a===Number?Number(i):a===Boolean||t==="true"||t==="false"?w0[i]:Array.isArray(a)?a.find(function(o){return o==i})||r[e]:i}const v0=e=>{const t=ke(),n=c.Form.useFormInstance();if(e.render===!1)return null;const{onSubmit:r,render:a,onReset:i,searchConfig:o={},submitButtonProps:l,resetButtonProps:u}=e,{token:m}=yn.useToken(),g=()=>{n.submit(),r==null||r()},f=()=>{n.resetFields(),i==null||i()},{submitText:h=t.getMessage("tableForm.submit","提交"),resetText:p=t.getMessage("tableForm.reset","重置")}=o,S=[];u!==!1&&S.push(d.createElement(c.Button,{...We(u??{},["preventDefault","fieldProps"]),key:"rest",onClick:w=>{var v;u!=null&&u.preventDefault||f(),(v=u==null?void 0:u.onClick)==null||v.call(u,w)}},p)),l!==!1&&S.push(d.createElement(c.Button,{type:"primary",...We(l||{},["preventDefault","fieldProps"]),key:"submit",onClick:w=>{var v;l!=null&&l.preventDefault||g(),(v=l==null?void 0:l.onClick)==null||v.call(l,w)}},h));const y=a?a({...e,form:n,submit:g,reset:f},S):S;return y?Array.isArray(y)?(y==null?void 0:y.length)<1?null:(y==null?void 0:y.length)===1?y[0]:s.jsx("div",{style:{display:"flex",gap:m.marginXS,alignItems:"center"},children:y}):y:null},{noteOnce:Lc}=Qe,qs=(e,t,n)=>e===!0?t:xt(e,t,n),Is=e=>!e||Array.isArray(e)?e:[e],Ld={};function T0(e){var z,Z;const{children:t,contentRender:n,submitter:r,fieldProps:a,formItemProps:i,groupProps:o,transformKey:l,formRef:u,onInit:m,form:g,loading:f,formComponentType:h,extraUrlParams:p=Ld,syncToUrl:S,onUrlSearchChange:y,onReset:w,omitNil:v=!0,isKeyPressSubmit:x,autoFocusFirstInput:C=!0,grid:j,rowProps:b,colProps:T,...R}=e,F=c.Form.useFormInstance(),{componentSize:E}=((Z=(z=c.ConfigProvider)==null?void 0:z.useConfig)==null?void 0:Z.call(z))||{componentSize:"middle"},M=d.useRef(g||F),{RowWrapper:k}=yr({grid:j,rowProps:b}),V=we(()=>F),_=d.useMemo(()=>({getFieldsFormatValue:(L,U)=>{const J=V();if(!J)return{};const G=J.getFieldsValue(L);return l(G,U!==void 0?U:v)},getFieldFormatValue:(L=[],U)=>{const J=V();if(!J)return;const G=Is(L);if(!G)throw new Error("nameList is require");const H=J.getFieldValue(G),B=G?Ge({},G,H):H,W=[...G];W.shift();const N=l(B,U!==void 0?U:v,W),q=De(N,G);if(q&&typeof q=="object"&&!Array.isArray(q)){const ee=Object.values(q)[0];return Array.isArray(ee),ee}return q},getFieldFormatValueObject:(L,U)=>{const J=V();if(!J)return{};const G=Is(L),H=J.getFieldValue(G),B=G?Ge({},G,H):H;return l(B,U!==void 0?U:v,G)},validateFieldsReturnFormatValue:async(L,U)=>{const J=V();if(!J)return{};if(!Array.isArray(L)&&L)throw new Error("nameList must be array");const G=await J.validateFields(L),H=l(G,U!==void 0?U:v);return H||{}}}),[v,l,V]),A=d.useMemo(()=>d.Children.toArray(t).map((L,U)=>U===0&&d.isValidElement(L)&&C?ho(L,C):L),[C,t]),I=d.useMemo(()=>typeof r=="boolean"||!r?{}:r,[r]),$=d.useMemo(()=>{if(r!==!1)return s.jsx(v0,{...I,onReset:()=>{var U,J,G;const L=l((U=M.current)==null?void 0:U.getFieldsValue(),v);if((J=I==null?void 0:I.onReset)==null||J.call(I,L),w==null||w(L),S){const H=Object.keys(l((G=M.current)==null?void 0:G.getFieldsValue(),!1)).reduce((B,W)=>({...B,[W]:L[W]||void 0}),p);y(qs(S,H||{},"set"))}},submitButtonProps:{loading:f,...I.submitButtonProps}},"submitter")},[r,I,f,l,v,w,S,p,y]),D=d.useMemo(()=>{const L=j?s.jsx(k,{children:A}):A;return n?n(L,$,M.current):L},[j,k,A,n,$]),O=_r(e.initialValues);return d.useEffect(()=>{if(S||!e.initialValues||!O||R.request)return;const L=xn(e.initialValues,O);Lc(L,"initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null "),Lc(L,"The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null ")},[e.initialValues]),d.useImperativeHandle(u,()=>({...M.current,getFieldsFormatValue:(L,U)=>{const J=M.current;if(!J)return{};const G=J.getFieldsValue(L);return l(G,U!==void 0?U:v)},getFieldFormatValue:(L=[],U)=>{const J=M.current;if(!J)return;const G=Is(L);if(!G)throw new Error("nameList is require");const H=J.getFieldValue(G),B=G?Ge({},G,H):H,W=[...G];W.shift();const N=l(B,U!==void 0?U:v,W),q=De(N,G);if(q&&typeof q=="object"&&!Array.isArray(q)){const ee=Object.values(q)[0];return Array.isArray(ee),ee}return q},getFieldFormatValueObject:(L,U)=>{const J=M.current;if(!J)return{};const G=Is(L),H=J.getFieldValue(G),B=G?Ge({},G,H):H;return l(B,U!==void 0?U:v,G)},validateFieldsReturnFormatValue:async(L,U)=>{const J=M.current;if(!J)return{};if(!Array.isArray(L)&&L)throw new Error("nameList must be array");const G=await J.validateFields(L),H=l(G,U!==void 0?U:v);return H||{}}}),[v,l,M.current]),d.useEffect(()=>{var U,J;const L=l((J=(U=M.current)==null?void 0:U.getFieldsValue)==null?void 0:J.call(U,!0),v);m==null||m(L,{...M.current,..._})},[]),s.jsx(Jr.Provider,{value:{..._,formRef:M},children:s.jsx(c.ConfigProvider,{componentSize:R.size||E,children:s.jsxs(To.Provider,{value:{grid:j,colProps:T},children:[R.component!==!1&&s.jsx("input",{type:"text",style:{display:"none"}}),D]})})})}let _c=0;function br(e){const{extraUrlParams:t=Ld,syncToUrl:n,isKeyPressSubmit:r,syncToUrlAsImportant:a=!1,syncToInitialValues:i=!0,children:o,contentRender:l,submitter:u,fieldProps:m,proFieldProps:g,formItemProps:f,groupProps:h,dateFormatter:p="string",formRef:S,onInit:y,form:w,formComponentType:v,onReset:x,grid:C,rowProps:j,colProps:b,omitNil:T=!0,request:R,params:F,initialValues:E,formKey:M=_c,readonly:k,onLoadingChange:V,loading:_,...A}=e,I=d.useRef({}),[$,D]=it(!1,_),O=we(me=>{V==null||V(me)}),z=d.useCallback(me=>{D(he=>{const Q=typeof me=="function"?me(he):me;return queueMicrotask(()=>{O(Q)}),Q})},[O]),[Z,L]=C0({},{disabled:!n}),U=d.useRef(Kr());d.useEffect(()=>{_c+=0},[]);const[J,G]=Np({request:R,params:F,proFieldKey:M}),{getPrefixCls:H}=d.useContext(c.ConfigProvider.ConfigContext),B=H("pro-form"),{wrapSSR:W,hashId:N}=Je("ProForm",me=>({[`.${B}`]:{[`> div:not(${me.proComponentsCls}-form-light-filter)`]:{".pro-field":{maxWidth:"100%","@media screen and (max-width: 575px)":{maxWidth:"calc(93vw - 48px)"},"&-xs":{width:104},"&-s":{width:216},"&-sm":{width:216},"&-m":{width:328},"&-md":{width:328},"&-l":{width:440},"&-lg":{width:440},"&-xl":{width:552}}}}})),[q,ee]=d.useState(()=>n?qs(n,Z,"get"):{}),ne=d.useRef({}),X=d.useRef({}),ae=we((me,he,Q)=>!me||typeof me!="object"?me:PC(Mi(me,p,X.current,he,Q),ne.current));d.useEffect(()=>{i||ee({})},[i]);const oe=we(()=>({...Z,...t}));d.useEffect(()=>{n&&L(qs(n,oe(),"set"))},[t,oe,n]);const ue=d.useMemo(()=>{if(!(typeof window>"u")&&v&&["DrawerForm"].includes(v))return me=>me.parentNode||document.body},[v]),ge=we(async()=>{var me,he,Q,se;if(A.onFinish&&!$)try{z(!0);const Se=((he=(me=I==null?void 0:I.current)==null?void 0:me.getFieldsFormatValue)==null?void 0:he.call(me))||{},Fe=A.onFinish(Se);if(Fe&&typeof Fe=="object"&&typeof Fe.then=="function"){try{await Fe}catch(ie){throw z(!1),ie}z(!1)}else z(!1);if(n){const ie=Object.keys(((se=(Q=I==null?void 0:I.current)==null?void 0:Q.getFieldsFormatValue)==null?void 0:se.call(Q,!0,!1))||{}).reduce((Y,K)=>({...Y,[K]:Se[K]??void 0}),t);Object.keys(Z).forEach(Y=>{ie[Y]!==!1&&ie[Y]!==0&&!ie[Y]&&(ie[Y]=void 0)}),L(qs(n,ie,"set"))}}catch{z(!1)}});return d.useImperativeHandle(S,()=>I.current,[!J]),R&&G?s.jsx("div",{style:{paddingTop:50,paddingBottom:50,textAlign:"center"},children:s.jsx(c.Spin,{})}):W(s.jsx(ts.Provider,{value:{mode:e.readonly?"read":"edit"},children:s.jsx(Dn,{needDeps:!0,children:s.jsx(xr.Provider,{value:{formRef:I,fieldProps:m,proFieldProps:g,formItemProps:f,groupProps:h,formComponentType:v,getPopupContainer:ue,formKey:U.current,setFieldValueType:(me,{valueType:he="text",dateFormat:Q,transform:se})=>{Array.isArray(me)&&(se&&(ne.current=Ge(ne.current,me,se)),X.current=Ge(X.current,me,{valueType:he,dateFormat:Q}))}},children:s.jsx(dr.Provider,{value:{},children:s.jsx(c.Form,{onKeyDown:me=>{var he;r&&me.key==="Enter"&&((he=I.current)==null||he.submit())},autoComplete:"off",form:w,...We(A,["ref","labelWidth","autoFocusFirstInput","rootClassName"]),ref:me=>{I.current&&(I.current.nativeElement=me==null?void 0:me.nativeElement,I.current.focus=()=>{var Q;const he=(Q=me==null?void 0:me.nativeElement)==null?void 0:Q.querySelector("input, textarea, select");he==null||he.focus()})},initialValues:a?{...E,...J,...q}:{...q,...E,...J},onValuesChange:(me,he)=>{var Q;(Q=A==null?void 0:A.onValuesChange)==null||Q.call(A,ae(me,!!T),ae(he,!!T))},className:e.className,rootClassName:le(B,N,e.rootClassName),onFinish:ge,children:s.jsx(T0,{transformKey:ae,autoComplete:"off",loading:$||!!(R&&!J&&G),onUrlSearchChange:L,...e,formRef:I,initialValues:{...E,...J}})})})})})}))}const F0=e=>({[`${e.componentCls}-collapse-label`]:{boxSizing:"border-box",paddingInline:1,paddingBlock:1},[`${e.componentCls}-container`]:{boxSizing:"border-box",[`${e.antCls}-form-item`]:{marginBlockEnd:0}}});function R0(e){return Je("LightWrapper",t=>{const n={...t,componentCls:`.${e}`};return[F0(n)]})}const $0=e=>{var _;const{label:t,size:n,disabled:r,onChange:a,className:i,style:o,children:l,valuePropName:u,placeholder:m,labelFormatter:g,variant:f,footerRender:h,allowClear:p,otherFieldProps:S,valueType:y,placement:w,...v}=e,{getPrefixCls:x}=d.useContext(c.ConfigProvider.ConfigContext),C=x("pro-field-light-wrapper"),{wrapSSR:j,hashId:b}=R0(C),[T,R]=d.useState(e[u]),[F,E]=d.useState(!1),M=(...A)=>{var I;(I=S==null?void 0:S.onChange)==null||I.call(S,...A),a==null||a(...A)},k=e[u],V=d.useMemo(()=>{var I;if(!k)return k;const A=(I=y==null?void 0:y.toLowerCase)==null?void 0:I.call(y);return A!=null&&A.endsWith("range")&&A!=="digitrange"&&!g?$p(k,y&&mo[y]||"YYYY-MM-DD"):Array.isArray(k)?k.map($=>typeof $=="object"&&$.label&&$.value?$.label:$):k},[k,y,g]);return j(s.jsx(Hu,{disabled:r,open:F,onOpenChange:E,placement:w,label:s.jsx(Zt,{ellipsis:!0,size:n,onClear:()=>{M==null||M(),R(null)},variant:f,style:o,className:i,label:t,placeholder:m,value:V,disabled:r,formatter:g,allowClear:p}),footer:{onClear:()=>R(null),onConfirm:()=>{M==null||M(T),E(!1)}},footerRender:h,children:s.jsx("div",{className:le(`${C}-container`,b,i),style:o,children:d.cloneElement(l,{...v,[u]:T,onChange:A=>{R(A!=null&&A.target?A.target.value:A)},...l.props,variant:"borderless",fieldProps:{...(_=l.props)==null?void 0:_.fieldProps,variant:"borderless"}})})}))},E0=e=>{const{fieldProps:t,children:n,labelCol:r,label:a,autoFocus:i,isDefaultDom:o,render:l,proFieldProps:u,formItemRender:m,valueType:g,initialValue:f,onChange:h,valueEnum:p,params:S,name:y,dependenciesValues:w,cacheForSwr:v=!1,valuePropName:x="value",...C}=e,j=d.useContext(ts),b=d.useMemo(()=>w&&C.request?{...S,...w||{}}:S,[w,S,C.request]),T=we((...E)=>{var M;if(t!=null&&t.onChange){(M=t==null?void 0:t.onChange)==null||M.call(t,...E);return}}),R=d.useMemo(()=>({autoFocus:i,...t,onChange:T}),[i,t,T]),F=d.useMemo(()=>{if(n)return d.isValidElement(n)?d.cloneElement(n,{...C,onChange:(...E)=>{var M;if(t!=null&&t.onChange){(M=t==null?void 0:t.onChange)==null||M.call(t,...E);return}h==null||h(...E)},...(n==null?void 0:n.props)||{}}):s.jsx(s.Fragment,{children:n})},[n,t==null?void 0:t.onChange,h,C]);return F||s.jsx(bj,{text:t==null?void 0:t[x],render:l,formItemRender:m,valueType:g||"text",cacheForSwr:v,fieldProps:R,valueEnum:xt(p),...u,...C,mode:(u==null?void 0:u.mode)||j.mode||"edit",params:b})},wn=ir==null?void 0:ir(E0),I0=({fieldProps:e,min:t,proFieldProps:n,max:r,...a},i)=>s.jsx(Dn,{valueTypeMap:{digit:{render:(o,l)=>s.jsx(aa,{...l,text:o,placeholder:l.placeholder}),formItemRender:(o,l)=>s.jsx(aa,{...l,text:o,placeholder:l.placeholder})}},children:s.jsx(wn,{valueType:"digit",fieldProps:{min:t,max:r,...e},ref:i,fieldConfig:{defaultProps:{width:"100%"}},proFieldProps:n,...a})}),M0=d.forwardRef(I0),k0={space:c.Space,group:c.Space.Compact};function A0(e,...t){const n=t[0];return n&&n.target&&e in n.target?n.target[e]:n}const O0=e=>{const{children:t,value:n=[],valuePropName:r,onChange:a,fieldProps:i,space:o,type:l="space",transform:u,convertValue:m,lightProps:g,...f}=e,h=we((x,C)=>{var b;const j=[...n];j[C]=A0(r||"value",x),a==null||a(j),(b=i==null?void 0:i.onChange)==null||b.call(i,j)});let p=-1;const S=bn(xt(t,n,e)).map(x=>{var C,j,b;if(d.isValidElement(x)){p+=1;const T=p,F=((C=x==null?void 0:x.type)==null?void 0:C.displayName)==="ProFormComponent"||((j=x==null?void 0:x.props)==null?void 0:j.readonly)?{key:T,ignoreFormItem:!0,...x.props||{},fieldProps:{...(b=x==null?void 0:x.props)==null?void 0:b.fieldProps,onChange:(...E)=>{h(E[0],T)}},value:n==null?void 0:n[T],onChange:void 0}:{key:T,...x.props||{},value:n==null?void 0:n[T],onChange:E=>{var M,k;h(E,T),(k=(M=x.props).onChange)==null||k.call(M,E)}};return d.cloneElement(x,F)}return x}),y=k0[l],{RowWrapper:w}=yr(f),v=d.useCallback(({children:x})=>{const C={...o,align:"start"};return l==="space"&&(o==null?void 0:o.wrap)!==void 0&&(C.wrap=o.wrap),s.jsx(y,{...C,children:x})},[y,o,l]);return s.jsx(w,{Wrapper:v,children:S})},D0=d.forwardRef(({children:e,space:t,valuePropName:n,...r},a)=>(d.useImperativeHandle(a,()=>({})),s.jsx(O0,{space:t,valuePropName:n,...r.fieldProps,onChange:void 0,...r,children:e}))),P0=ir==null?void 0:ir(D0),N0=e=>({[e.componentCls]:{boxSizing:"border-box","&-title":{marginBlockEnd:e.marginXL,fontWeight:"bold"},"&-container":{flexWrap:"wrap",maxWidth:"100%",[`> div${e.antCls}-space-item`]:{maxWidth:"100%"}},"&-twoLine":{display:"block",width:"100%",[`${e.componentCls}-title`]:{width:"100%",margin:"8px 0"},[`${e.componentCls}-container`]:{paddingInlineStart:16},[`${e.antCls}-space-item,${e.antCls}-form-item`]:{width:"100%"},[`${e.antCls}-form-item`]:{"&-control":{display:"flex",alignItems:"center",justifyContent:"flex-end","&-input":{alignItems:"center",justifyContent:"flex-end","&-content":{flex:"none"}}}}}}});function L0(e){return Je("ProFormGroup",t=>{const n={...t,componentCls:`.${e}`};return[N0(n)]})}const _d=d.forwardRef((e,t)=>{const{groupProps:n}=d.useContext(xr),{children:r,collapsible:a,defaultCollapsed:i,style:o,labelLayout:l,title:u=e.label,tooltip:m,align:g="start",direction:f,size:h=32,titleStyle:p,titleRender:S,spaceProps:y,extra:w,autoFocus:v}={...n,...e},[x,C]=it(()=>i||!1,e.collapsed),j=we(O=>{var z;(z=e.onCollapse)==null||z.call(e,O)}),b=d.useCallback(O=>{C(z=>{const Z=typeof O=="function"?O(z):O;return queueMicrotask(()=>{j(Z)}),Z})},[j]),{getPrefixCls:T}=d.useContext(c.ConfigProvider.ConfigContext),{ColWrapper:R,RowWrapper:F}=yr(e),E=T("pro-form-group"),{wrapSSR:M,hashId:k}=L0(E),V=a&&s.jsx(de.RightOutlined,{style:{marginInlineEnd:8},rotate:x?void 0:90}),_=s.jsx(lr,{label:V?s.jsxs("div",{children:[V,u]}):u,tooltip:m}),A=d.useCallback(({children:O})=>s.jsx(c.Space,{...y,className:le(`${E}-container ${k}`,y==null?void 0:y.className),size:h,align:g,orientation:f,style:{rowGap:0,...y==null?void 0:y.style},children:O}),[g,E,f,k,h,y]),I=S?S(_,e):_,[$,D]=d.useMemo(()=>{const O=[],z=d.Children.toArray(r).map((Z,L)=>{var U;return d.isValidElement(Z)&&((U=Z==null?void 0:Z.props)!=null&&U.hidden)?(O.push(Z),null):L===0&&d.isValidElement(Z)&&v?ho(Z,v):Z});return[s.jsx(F,{Wrapper:A,children:z},"children"),O.length>0?s.jsx("div",{style:{display:"none"},children:O},"hidden"):null]},[r,F,A,v]);return M(s.jsx(R,{children:s.jsxs("div",{className:le(E,k,{[`${E}-twoLine`]:l==="twoLine"}),style:o,ref:t,children:[D,(u||m||w)&&s.jsx("div",{role:"button",tabIndex:0,className:le(`${E}-title`,k),style:p,onClick:()=>{b(!x)},onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),b(!x))},children:w?s.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[I,s.jsx("span",{role:"presentation",onClick:O=>O.stopPropagation(),onKeyDown:O=>O.stopPropagation(),children:w})]}):I}),s.jsx("div",{style:{display:a&&x?"none":void 0},children:$})]})}))});_d.displayName="ProForm-Group";const _0=e=>({[e.componentCls]:{boxSizing:"border-box","&-sidebar-dragger":{width:"5px",cursor:"ew-resize",padding:"4px 0 0",borderTop:"1px solid transparent",position:"absolute",top:0,left:0,bottom:0,zIndex:100,backgroundColor:"transparent","&-min-disabled":{cursor:"w-resize"},"&-max-disabled":{cursor:"e-resize"}}}});function z0(e){return Je("DrawerForm",t=>{const n={...t,componentCls:`.${e}`};return[_0(n)]})}const{noteOnce:B0}=Qe;function V0({children:e,trigger:t,drawerProps:n,onFinish:r,submitTimeout:a,title:i,width:o,resize:l,onOpenChange:u,open:m,...g}){var U,J,G,H;B0(!g.footer||!(n!=null&&n.footer),"DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const f=d.useMemo(()=>{const B={onResize:()=>{},maxWidth:xo()?window.innerWidth*.8:void 0,minWidth:300};return typeof l=="boolean"?l?B:{}:ht({onResize:(l==null?void 0:l.onResize)??B.onResize,maxWidth:(l==null?void 0:l.maxWidth)??B.maxWidth,minWidth:(l==null?void 0:l.minWidth)??B.minWidth})},[l]),h=d.useContext(c.ConfigProvider.ConfigContext),p=h.getPrefixCls("pro-form-drawer"),{wrapSSR:S,hashId:y}=z0(p),w=B=>`${p}-${B}`,[,v]=d.useState([]),[x,C]=d.useState(!1),[j,b]=d.useState(!1),[T,R]=d.useState(o||(l?f==null?void 0:f.minWidth:800)),[F,E]=it(!!m,m),M=we(B=>{u==null||u(B)}),k=d.useCallback(B=>{E(W=>{const N=typeof B=="function"?B(W):B;return queueMicrotask(()=>{M(N)}),N})},[M]),V=d.useRef(null),_=d.useCallback(B=>{V.current===null&&B&&v([]),V.current=B},[]),A=d.useRef(),I=d.useCallback(()=>{var W;const B=((W=g.formRef)==null?void 0:W.current)??g.form??A.current;B&&(n!=null&&n.destroyOnHidden)&&typeof B.resetFields=="function"&&B.resetFields()},[n==null?void 0:n.destroyOnHidden,g.form,g.formRef]);d.useEffect(()=>{F&&m&&(u==null||u(!0)),j&&R(f==null?void 0:f.minWidth)},[m,F,j]),d.useImperativeHandle(g.formRef,()=>A.current,[A.current]);const $=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async B=>{var W,N;k(!F),b(!Object.keys(f)),(N=(W=t.props)==null?void 0:W.onClick)==null||N.call(W,B)}}):null,[k,t,F,b,j]),D=d.useMemo(()=>{var B,W,N,q;return g.submitter===!1?!1:tr({searchConfig:{submitText:((W=(B=h.locale)==null?void 0:B.Modal)==null?void 0:W.okText)??"确认",resetText:((q=(N=h.locale)==null?void 0:N.Modal)==null?void 0:q.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:a&&x,onClick:ee=>{var ne;k(!1),(ne=n==null?void 0:n.onClose)==null||ne.call(n,ee)}}},g.submitter??{})},[g.submitter,(J=(U=h.locale)==null?void 0:U.Modal)==null?void 0:J.okText,(H=(G=h.locale)==null?void 0:G.Modal)==null?void 0:H.cancelText,a,x,k,n]),O=d.useCallback((B,W)=>s.jsxs(s.Fragment,{children:[B,V.current&&W?s.jsx(d.Fragment,{children:Gc.createPortal(W,V.current)},"submitter"):W]}),[]),z=we(async B=>{const W=r==null?void 0:r(B);if(a&&W instanceof Promise){C(!0);const q=setTimeout(()=>C(!1),a);try{const ee=await W;return clearTimeout(q),C(!1),ee&&k(!1),ee}catch(ee){throw clearTimeout(q),C(!1),ee}}else if(a){C(!0);const q=setTimeout(()=>C(!1),a);try{const ee=await W;return clearTimeout(q),C(!1),ee&&k(!1),ee}catch(ee){throw clearTimeout(q),C(!1),ee}}const N=await W;return N&&k(!1),N}),Z=d.useCallback(B=>{const W=(document.body.offsetWidth||1e3)-(B.clientX-document.body.offsetLeft),N=(f==null?void 0:f.minWidth)??(o||800),q=(f==null?void 0:f.maxWidth)??window.innerWidth*.8;if(W<N){R(N);return}if(W>q){R(q);return}R(W)},[f==null?void 0:f.maxWidth,f==null?void 0:f.minWidth,o]),L=d.useCallback(()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",L)},[Z]);return S(s.jsxs(s.Fragment,{children:[s.jsxs(c.Drawer,{...n,destroyOnHidden:n==null?void 0:n.destroyOnHidden,title:i,size:T,open:F,afterOpenChange:B=>{var W;!B&&(n!=null&&n.destroyOnHidden)&&I(),(W=n==null?void 0:n.afterOpenChange)==null||W.call(n,B),u==null||u(B)},onClose:B=>{var W;a&&x||(k(!1),(W=n==null?void 0:n.onClose)==null||W.call(n,B))},footer:g.submitter!==!1&&s.jsx("div",{ref:_,style:{display:"flex",justifyContent:"flex-end"}}),children:[l?s.jsx("div",{className:le(w("sidebar-dragger"),y,{[w("sidebar-dragger-min-disabled")]:T===(f==null?void 0:f.minWidth),[w("sidebar-dragger-max-disabled")]:T===(f==null?void 0:f.maxWidth)}),onMouseDown:B=>{var W;(W=f==null?void 0:f.onResize)==null||W.call(f),B.stopPropagation(),B.preventDefault(),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",L),b(!0)}}):null,s.jsx(s.Fragment,{children:s.jsx(br,{formComponentType:"DrawerForm",layout:"vertical",...g,formRef:A,onInit:(B,W)=>{var N;g.formRef&&(g.formRef.current=W),(N=g==null?void 0:g.onInit)==null||N.call(g,B,W),A.current=W},submitter:D,onFinish:async B=>await z(B),contentRender:O,children:e})})]}),$]}))}const H0=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"30px","&::before":{display:"block",height:0,visibility:"hidden",content:"'.'"},"&-small":{lineHeight:e.lineHeight},"&-container":{display:"flex",flexWrap:"wrap",gap:e.marginXS},"&-item":{whiteSpace:"nowrap",[`${e.antCls}-form-item`]:{marginBlock:0}},"&-line":{minWidth:"198px"},"&-line:not(:first-child)":{marginBlockStart:"16px",marginBlockEnd:8},"&-collapse-icon":{width:e.controlHeight,height:e.controlHeight,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},"&-effective":{[`${e.componentCls}-collapse-icon`]:{backgroundColor:e.colorBgTextHover}}}});function U0(e){return Je("LightFilter",t=>{const n={...t,componentCls:`.${e}`};return[H0(n)]})}const Y0=e=>{const{items:t,prefixCls:n,size:r="middle",collapse:a,collapseLabel:i,onValuesChange:o,variant:l="borderless",values:u,footerRender:m,placement:g,popoverProps:f}=e,h=ke(),p=`${n}-light-filter`,{wrapSSR:S,hashId:y}=U0(p),[w,v]=d.useState(!1),[x,C]=d.useState(()=>({...u})),j=d.useMemo(()=>i||(a?s.jsx(de.FilterOutlined,{className:le(`${p}-collapse-icon`,y)}):s.jsx(Zt,{variant:l,size:r,label:h.getMessage("form.lightFilter.more","更多筛选")})),[i,a,p,y,l,r,h]),{collapseItems:b,outsideItems:T}=d.useMemo(()=>{const R=[],F=[];return t.forEach(E=>{const{secondary:M}=E.props||{};M||a?R.push(E):F.push(E)}),{collapseItems:R,outsideItems:F}},[e.items]);return S(s.jsx("div",{className:le(p,y,`${p}-${r}`,{[`${p}-effective`]:Object.keys(u).some(R=>Array.isArray(u[R])?u[R].length>0:u[R])}),children:s.jsxs("div",{className:le(`${p}-container`,y),children:[T.map((R,F)=>{if(!(R!=null&&R.props))return R;const{key:E}=R,{fieldProps:M}=(R==null?void 0:R.props)||{},k=M!=null&&M.placement?M==null?void 0:M.placement:g;return s.jsx("div",{className:le(`${p}-item`,y),children:d.cloneElement(R,{fieldProps:{...R.props.fieldProps,placement:k,variant:"borderless"},proFieldProps:{...R.props.proFieldProps,light:!0,label:R.props.label,variant:l},variant:l})},E||F)}),b.length?s.jsx("div",{className:le(`${p}-item`,y),children:s.jsx(Hu,{padding:24,open:w,onOpenChange:R=>{v(R)},placement:g,popoverProps:f,label:j,footerRender:m,footer:{onConfirm:()=>{o({...x}),v(!1)},onClear:()=>{const R={};b.forEach(F=>{const{name:E}=F.props;R[E]=void 0}),o(R)}},children:b.map(R=>{const{key:F}=R,{name:E,fieldProps:M}=R.props,k={...M,onChange:_=>(C({...x,[E]:_!=null&&_.target?_.target.value:_}),!1)};x.hasOwnProperty(E)&&(k[R.props.valuePropName||"value"]=x[E]);const V=M!=null&&M.placement?M==null?void 0:M.placement:g;return s.jsx("div",{className:le(`${p}-line`,y),children:d.cloneElement(R,{fieldProps:{...k,placement:V,variant:l}})},F)})})},"more"):null]})}))};function K0(e){const{size:t,collapse:n,collapseLabel:r,initialValues:a,onValuesChange:i,form:o,placement:l,formRef:u,variant:m,ignoreRules:g,footerRender:f,popoverProps:h,...p}=e,{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-form"),[w,v]=d.useState(()=>({...a})),x=d.useRef();return d.useImperativeHandle(u,()=>x.current,[x.current]),s.jsx(br,{size:t,initialValues:a,form:o,contentRender:C=>s.jsx(Y0,{prefixCls:y,items:C==null?void 0:C.flatMap(j=>{var b;return!j||!(j!=null&&j.type)?j:((b=j==null?void 0:j.type)==null?void 0:b.displayName)==="ProForm-Group"?j.props.children:j}),size:t,variant:m||"borderless",collapse:n,collapseLabel:r,placement:l,popoverProps:h,values:w||{},footerRender:f,onValuesChange:j=>{var T,R;const b={...w,...j};v(b),(T=x.current)==null||T.setFieldsValue(b),(R=x.current)==null||R.submit(),i&&i(j,b)}},JSON.stringify(w||{})),formRef:x,formItemProps:{colon:!1,labelAlign:"left"},fieldProps:{style:{width:void 0}},...We(p,["labelWidth"]),onValuesChange:(C,j)=>{var b;v(j),i==null||i(C,j),(b=x.current)==null||b.submit()}})}const{noteOnce:W0}=Qe;function q0({children:e,trigger:t,onOpenChange:n,modalProps:r,onFinish:a,submitTimeout:i,title:o,width:l,open:u,...m}){var M,k,V,_;W0(!m.footer||!(r!=null&&r.footer),"ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const g=d.useContext(c.ConfigProvider.ConfigContext),[,f]=d.useState([]),[h,p]=d.useState(!1),[S,y]=it(!1,u),w=we(A=>{n==null||n(A)}),v=d.useCallback(A=>{y(I=>{const $=typeof A=="function"?A(I):A;return queueMicrotask(()=>{w($)}),$})},[w]),x=d.useRef(null),C=d.useCallback(A=>{x.current===null&&A&&f([]),x.current=A},[]),j=d.useRef(),b=d.useCallback(()=>{var I;const A=m.form??((I=m.formRef)==null?void 0:I.current)??j.current;A&&(r!=null&&r.destroyOnHidden)&&typeof A.resetFields=="function"&&A.resetFields()},[r==null?void 0:r.destroyOnHidden,m.form,m.formRef]);d.useImperativeHandle(m.formRef,()=>j.current,[j.current]),d.useEffect(()=>{u&&(n==null||n(!0))},[u]);const T=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async A=>{var I,$;v(!S),($=(I=t.props)==null?void 0:I.onClick)==null||$.call(I,A)}}):null,[v,t,S]),R=d.useMemo(()=>{var A,I,$,D;return m.submitter===!1?!1:sa({searchConfig:{submitText:(r==null?void 0:r.okText)??((I=(A=g.locale)==null?void 0:A.Modal)==null?void 0:I.okText)??"确认",resetText:(r==null?void 0:r.cancelText)??((D=($=g.locale)==null?void 0:$.Modal)==null?void 0:D.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:i&&h,onClick:O=>{var z;v(!1),(z=r==null?void 0:r.onCancel)==null||z.call(r,O)}}},m.submitter??{})},[(k=(M=g.locale)==null?void 0:M.Modal)==null?void 0:k.cancelText,(_=(V=g.locale)==null?void 0:V.Modal)==null?void 0:_.okText,r,m.submitter,v,h,i]),F=d.useCallback((A,I)=>s.jsxs(s.Fragment,{children:[A,x.current&&I?s.jsx(d.Fragment,{children:Gc.createPortal(I,x.current)},"submitter"):I]}),[]),E=d.useCallback(async A=>{const I=a==null?void 0:a(A);if(i&&I instanceof Promise){p(!0);const D=setTimeout(()=>p(!1),i);try{const O=await I;return clearTimeout(D),p(!1),O&&v(!1),O}catch(O){throw clearTimeout(D),p(!1),O}}else if(i){p(!0);const D=setTimeout(()=>p(!1),i);try{const O=await I;return clearTimeout(D),p(!1),O&&v(!1),O}catch(O){throw clearTimeout(D),p(!1),O}}const $=await I;return $&&v(!1),$},[a,v,i]);return s.jsxs(s.Fragment,{children:[s.jsx(c.Modal,{title:o,width:l||800,...r,open:S,onCancel:A=>{var I;i&&h||(v(!1),(I=r==null?void 0:r.onCancel)==null||I.call(r,A))},afterClose:()=>{var A;r!=null&&r.destroyOnHidden&&b(),S&&v(!1),(A=r==null?void 0:r.afterClose)==null||A.call(r)},footer:m.submitter!==!1?s.jsx("div",{ref:C,style:{display:"flex",justifyContent:"flex-end"}}):null,children:s.jsx(br,{formComponentType:"ModalForm",layout:"vertical",...m,onInit:(A,I)=>{var $;m.formRef&&(m.formRef.current=I),($=m==null?void 0:m.onInit)==null||$.call(m,A,I),j.current=I},formRef:j,submitter:R,onFinish:async A=>await E(A),contentRender:F,children:e})}),T]})}const Xi=xe.createContext(null);function G0({children:e,onBatchResize:t}){const n=xe.useRef(0),r=xe.useRef([]),a=xe.useContext(Xi),i=xe.useCallback((o,l,u)=>{n.current+=1;const m=n.current;r.current.push({size:o,element:l,data:u}),Promise.resolve().then(()=>{m===n.current&&(t==null||t(r.current),r.current=[])}),a==null||a(o,l,u)},[t,a]);return xe.createElement(Xi.Provider,{value:i},e)}const en=new Map;function zd(e){e.forEach(t=>{var r;const{target:n}=t;(r=en.get(n))==null||r.forEach(a=>a(n))})}let ai;function Bd(){return ai||(ai=new ResizeObserver(zd)),ai}process.env.NODE_ENV;process.env.NODE_ENV;function Z0(e,t){en.has(e)||(en.set(e,new Set),Bd().observe(e)),en.get(e).add(t)}function J0(e,t){en.has(e)&&(en.get(e).delete(t),en.get(e).size||(Bd().unobserve(e),en.delete(e)))}function X0(e,t,n,r){const a=xe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=eu(u=>{const{width:m,height:g}=u.getBoundingClientRect(),{offsetWidth:f,offsetHeight:h}=u,p=Math.floor(m),S=Math.floor(g);if(a.current.width!==p||a.current.height!==S||a.current.offsetWidth!==f||a.current.offsetHeight!==h){const y={width:p,height:S,offsetWidth:f,offsetHeight:h};a.current=y;const w=f===Math.round(m)?m:f,v=h===Math.round(g)?g:h,x={...y,offsetWidth:w,offsetHeight:v};r==null||r(x,u),Promise.resolve().then(()=>{n==null||n(x,u)})}}),o=typeof t=="function",l=xe.useRef(0);xe.useEffect(()=>{const u=o?t():t;return u&&e?Z0(u,i):e&&o&&(l.current+=1),()=>{u&&J0(u,i)}},[e,o?l.current:t])}function Q0(e,t){const{children:n,disabled:r,onResize:a,data:i}=e,o=xe.useRef(null),l=xe.useContext(Xi),u=typeof n=="function",m=u?n(o):n,g=!u&&xe.isValidElement(m)&&Ef(m),f=g?If(m):null,h=$f(f,o),p=()=>Pf(o.current);return xe.useImperativeHandle(t,()=>p()),X0(!r,p,a,(S,y)=>{l==null||l(S,y,i)}),g?xe.cloneElement(m,{ref:h}):m}const Vd=xe.forwardRef(Q0);process.env.NODE_ENV!=="production"&&(Vd.displayName="SingleObserver");function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qi.apply(this,arguments)}const ev="rc-observer-key";function tv(e,t){const{children:n}=e,r=typeof n=="function"?[n]:bn(n);return process.env.NODE_ENV!=="production"&&(r.length>1?Zs(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):r.length===0&&Zs(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),r.map((a,i)=>{const o=(a==null?void 0:a.key)||`${ev}-${i}`;return xe.createElement(Vd,Qi({},e,{key:o,ref:i===0?t:void 0}),a)})}const wa=xe.forwardRef(tv);process.env.NODE_ENV!=="production"&&(wa.displayName="ResizeObserver");wa.Collection=G0;const nv=(e,t,n,r)=>e?s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.collapsed","展开"),r&&`(${r})`,s.jsx(de.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}):s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.expand","收起"),s.jsx(de.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}),rv=e=>{const{setCollapsed:t,collapsed:n=!1,submitter:r,style:a,hiddenNum:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=ke(),{hashId:u}=d.useContext(Gt),m=Wu(e.collapseRender)||nv;return s.jsxs(c.Space,{style:a,size:16,children:[r,e.collapseRender!==!1&&s.jsx("a",{className:le(o("pro-query-filter-collapse-button"),u),onClick:()=>t(!n),children:m==null?void 0:m(n,e,l,i)})]})},sv=e=>({[e.componentCls]:{boxSizing:"border-box","&&":{padding:24},[`${e.antCls}-form-item`]:{marginBlock:0},[`${e.proComponentsCls}-form-group-title`]:{marginBlock:0},"&-row":{rowGap:24,"&-split":{[`${e.proComponentsCls}-form-group`]:{display:"flex",alignItems:"center",gap:e.marginXS},"&:last-child":{marginBlockEnd:12}},"&-split-line":{"&:after":{position:"absolute",width:"100%",content:'""',height:1,insetBlockEnd:-12,borderBlockEnd:`1px dashed ${e.colorSplit}`}}},"&-collapse-button":{display:"flex",alignItems:"center",color:e.colorPrimary}}});function av(e){return Je("QueryFilter",t=>{const n={...t,componentCls:`.${e}`};return[sv(n)]})}const iv=e=>{const n={...c.theme.getDesignToken(),...e},r={xs:n.screenSMMin??576,sm:n.screenMDMin??768,md:n.screenLGMin??992,lg:n.screenXLMin??1200,xl:n.screenXXLMin??1600,xxl:1/0};return{configSpanBreakpoints:r,breakpoints:{vertical:[[r.xs,1,"vertical"],[r.md,2,"vertical"],[r.xl,3,"vertical"],[1/0,4,"vertical"]],default:[[r.xs,1,"vertical"],[r.sm,2,"vertical"],[r.xl,3,"horizontal"],[1/0,4,"horizontal"]]}}},ov=(e,t,n,r)=>{if(n&&typeof n=="number")return{span:n,layout:e};const{breakpoints:a,configSpanBreakpoints:i}=r,l=((n?["xs","sm","md","lg","xl","xxl"].map(u=>[i[u],24/n[u],"horizontal"]):a[e||"default"])||a.default).find(u=>t<u[0]+16);return l?{span:24/l[1],layout:l==null?void 0:l[2]}:{span:8,layout:"horizontal"}},lv=(e,t)=>e==null?void 0:e.flatMap(n=>{var r,a,i;return((r=n==null?void 0:n.type)==null?void 0:r.displayName)==="ProForm-Group"&&!((a=n.props)!=null&&a.title)?n.props.children:t&&d.isValidElement(n)?d.cloneElement(n,{...n.props,formItemProps:{...(i=n.props)==null?void 0:i.formItemProps,rules:[]}}):n}),cv=e=>{var A,I,$;const t=ke(),{hashId:n}=d.useContext(Gt),r=e.resetText||t.getMessage("tableForm.reset","重置"),a=e.searchText||t.getMessage("tableForm.search","搜索"),[i,o]=it(()=>e.defaultCollapsed&&!!e.submitter,e.collapsed),l=we(D=>{var O;(O=e.onCollapse)==null||O.call(e,D)}),u=d.useCallback(D=>{o(O=>{const z=typeof D=="function"?D(O):D;return queueMicrotask(()=>{l(z)}),z})},[l]),{optionRender:m,collapseRender:g,split:f,items:h,spanSize:p,showLength:S,searchGutter:y,showHiddenNum:w}=e,v=d.useMemo(()=>!e.submitter||m===!1?null:d.cloneElement(e.submitter,{searchConfig:{resetText:r,submitText:a},render:m&&((D,O)=>m({...e,resetText:r,searchText:a},e,O)),...e.submitter.props}),[e,r,a,m]);let x=0,C=0,j=!1,b=0,T=0;const R=lv(h,e.ignoreRules).map((D,O)=>{var J,G,H,B;const z=d.isValidElement(D)?((J=D==null?void 0:D.props)==null?void 0:J.colSize)??1:1,Z=Math.min(p.span*(z||1),24);x+=Z,b+=z,O===0&&(j=Z===24&&!((G=D==null?void 0:D.props)!=null&&G.hidden));const L=((H=D==null?void 0:D.props)==null?void 0:H.hidden)||i&&(j||b>S)&&!!O;C+=1;const U=d.isValidElement(D)&&(D.key||`${(B=D.props)==null?void 0:B.name}`)||O;return d.isValidElement(D)&&L?e.preserve?{itemDom:d.cloneElement(D,{hidden:!0,key:U||O}),hidden:!0,colSpan:Z}:{itemDom:null,colSpan:0,hidden:!0}:{itemDom:D,colSpan:Z,hidden:!1}}),F=R.map((D,O)=>{var J,G;const{itemDom:z,colSpan:Z}=D;if((J=z==null?void 0:z.props)==null?void 0:J.hidden)return z;const U=d.isValidElement(z)&&(z.key||`${(G=z.props)==null?void 0:G.name}`)||O;return 24-T%24<Z&&(x+=24-T%24,T+=24-T%24),T+=Z,f&&T%24===0&&O<C-1?s.jsx(c.Col,{span:Z,className:le(`${e.baseClassName}-row-split-line`,`${e.baseClassName}-row-split`,n),children:z},U):s.jsx(c.Col,{className:le(`${e.baseClassName}-row-split`,n),span:Z,children:z},U)}),E=w&&R.filter(D=>D.hidden).length,M=d.useMemo(()=>!(x<24||b<=S),[b,S,x]),k=d.useMemo(()=>{var O,z;const D=T%24+(((O=e.submitterColSpanProps)==null?void 0:O.span)??p.span);return D>24?24-(((z=e.submitterColSpanProps)==null?void 0:z.span)??p.span):24-D},[T,T%24+(((A=e.submitterColSpanProps)==null?void 0:A.span)??p.span),(I=e.submitterColSpanProps)==null?void 0:I.span]),_=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter");return s.jsxs(c.Row,{gutter:y,justify:"start",className:le(`${_}-row`,n),children:[F,v&&s.jsx(c.Col,{span:p.span,offset:k,className:le(($=e.submitterColSpanProps)==null?void 0:$.className),...e.submitterColSpanProps,style:{textAlign:"end"},children:s.jsx(c.Form.Item,{label:" ",colon:!1,shouldUpdate:!1,className:le(`${_}-actions`,n),children:s.jsx(rv,{hiddenNum:E,collapsed:i,collapseRender:M?g:!1,submitter:v,setCollapsed:u},"pro-form-query-filter-actions")})},"submitter")]},"resize-observer-row")};var qc;const uv=xo()?(qc=document==null?void 0:document.body)==null?void 0:qc.clientWidth:1024;function dv(e){const{collapsed:t,layout:n,defaultCollapsed:r=!0,defaultColsNumber:a,defaultFormItemsNumber:i,span:o,searchGutter:l=24,searchText:u,resetText:m,optionRender:g,collapseRender:f,onReset:h,onCollapse:p,labelWidth:S="80",style:y,split:w,preserve:v=!0,ignoreRules:x,showHiddenNum:C=!1,submitterColSpanProps:j,...b}=e,R=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter"),{wrapSSR:F,hashId:E}=av(R),{token:M}=c.theme.useToken(),[k,V]=d.useState(()=>typeof(y==null?void 0:y.width)=="number"?y==null?void 0:y.width:uv),_=d.useMemo(()=>iv(M),[M.screenSMMin,M.screenMDMin,M.screenLGMin,M.screenXLMin,M.screenXXLMin]),A=d.useMemo(()=>ov(n,k+16,o,_),[n,k,o,_]),I=d.useMemo(()=>{if(i!==void 0)return i;if(a!==void 0){const D=24/A.span-1;return a>D?D:a}return Math.max(1,24/A.span-1)},[a,i,A.span]),$=d.useMemo(()=>{if(S&&A.layout!=="vertical"&&S!=="auto")return{labelCol:{flex:`0 0 ${S}px`},wrapperCol:{style:{maxWidth:`calc(100% - ${S}px)`}},style:{flexWrap:"nowrap"}}},[A.layout,S]);return F(s.jsx(wa,{onResize:D=>{k!==D.width&&D.width>17&&V(D.width)},children:D=>s.jsx("div",{ref:D,className:le(`${R}-container`,E),style:e.containerStyle,children:s.jsx(br,{isKeyPressSubmit:!0,preserve:v,...b,className:le(R,E,b.className),onReset:h,style:y,layout:A.layout,fieldProps:{style:{width:"100%"}},formItemProps:$,groupProps:{titleStyle:{display:"inline-block",marginInlineEnd:16}},contentRender:(O,z,Z)=>s.jsx(cv,{spanSize:A,collapsed:t,form:Z,submitterColSpanProps:j,collapseRender:f,defaultCollapsed:r,onCollapse:p,optionRender:g,submitter:z,items:O,split:w,baseClassName:R,resetText:e.resetText,searchText:e.searchText,searchGutter:l,preserve:v,ignoreRules:x,showLength:I,showHiddenNum:C})})})},"resize-observer"))}const{noteOnce:fv}=Qe;function hv(e){const t=d.useRef(),n=d.useContext(Hd),r=d.useContext(Ud),a={...e,...r},{onFinish:i,step:o,formRef:l,title:u,stepProps:m,...g}=a;return fv(!g.submitter,"StepForm 不包含提交按钮,请在 StepsForm 上"),d.useImperativeHandle(l,()=>t.current,[l==null?void 0:l.current]),d.useEffect(()=>{if(!(a.name||a.step))return;const f=(a.name||a.step).toString();return n==null||n.regForm(f,a),()=>{n==null||n.unRegForm(f)}},[]),n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),s.jsx(br,{formRef:t,onFinish:async f=>{if(g.name&&(n==null||n.onFormFinish(g.name,f)),i){n==null||n.setLoading(!0);try{await(i==null?void 0:i(f))&&(n==null||n.next())}finally{n==null||n.setLoading(!1)}return}n!=null&&n.lastStep||n==null||n.next()},onInit:(f,h)=>{var p;t.current=h,n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),(p=g==null?void 0:g.onInit)==null||p.call(g,f,h)},layout:"vertical",...We(g,["layoutType","columns"])})}const mv=e=>({[e.componentCls]:{boxSizing:"border-box","&-container":{width:"max-content",minWidth:"420px",maxWidth:"100%",margin:"auto"},"&-steps-container":{maxWidth:"1160px",margin:"auto",[`${e.antCls}-steps-vertical`]:{height:"100%"}},"&-step":{display:"none",marginBlockStart:"32px","&-active":{display:"block"},"> form":{maxWidth:"100%"}}}});function gv(e){return Je("StepsForm",t=>{const n={...t,componentCls:`.${e}`};return[mv(n)]})}const Hd=d.createContext(void 0),pv={horizontal({stepsDom:e,formDom:t}){return s.jsxs(s.Fragment,{children:[s.jsx(c.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(c.Col,{span:24,children:e})}),s.jsx(c.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(c.Col,{span:24,children:t})})]})},vertical({stepsDom:e,formDom:t}){return s.jsxs(c.Row,{align:"stretch",wrap:!0,gutter:{xs:8,sm:16,md:24},children:[s.jsx(c.Col,{xxl:4,xl:6,lg:7,md:8,sm:10,xs:12,children:d.cloneElement(e,{style:{height:"100%"}})}),s.jsx(c.Col,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:t})})]})}},Ud=d.createContext(null);function yv(e){const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=t("pro-steps-form"),{wrapSSR:r,hashId:a}=gv(n),{current:i,onCurrentChange:o,submitter:l,stepsFormRender:u,stepsRender:m,stepFormRender:g,stepsProps:f,onFinish:h,formProps:p,containerStyle:S,formRef:y,formMapRef:w,layoutRender:v,...x}=e,C=d.useRef(new Map),j=d.useRef(new Map),b=d.useRef([]),[T,R]=d.useState([]),[F,E]=d.useState(!1),M=ke(),[k,V]=it(0,e.current),_=we(X=>{var ae;(ae=e.onCurrentChange)==null||ae.call(e,X)}),A=d.useCallback(X=>{V(ae=>{const oe=typeof X=="function"?X(ae):X;return queueMicrotask(()=>{_(oe)}),oe})},[_]),I=d.useMemo(()=>pv[(f==null?void 0:f.orientation)||"horizontal"],[f==null?void 0:f.orientation]),$=d.useMemo(()=>k===T.length-1,[T.length,k]),D=d.useCallback((X,ae)=>{j.current.has(X)||R(oe=>[...oe,X]),j.current.set(X,ae)},[]),O=d.useCallback(X=>{R(ae=>ae.filter(oe=>oe!==X)),j.current.delete(X),C.current.delete(X)},[]);d.useImperativeHandle(w,()=>b.current,[b.current]),d.useImperativeHandle(y,()=>{var X;return(X=b.current[k||0])==null?void 0:X.current},[k,b.current]);const z=d.useCallback(async(X,ae)=>{if(C.current.set(X,ae),!$||!h)return;E(!0);const oe=Ku({},...Array.from(C.current.values()));try{await h(oe)&&(A(0),b.current.forEach(ge=>{var me;return(me=ge.current)==null?void 0:me.resetFields()}))}catch(ue){console.log(ue)}finally{E(!1)}},[$,h,E,A]),Z=d.useMemo(()=>{const X={items:T.map(ae=>{const oe=j.current.get(ae),ue={key:ae,title:oe==null?void 0:oe.title,...oe==null?void 0:oe.stepProps};return ue.description&&(ue.content=ue.description,delete ue.description),ue})};return s.jsx("div",{className:le(`${n}-steps-container`,a),style:{maxWidth:Math.min(T.length*320,1160)},children:s.jsx(c.Steps,{...f,...X,current:k,onChange:void 0})})},[T,a,n,k,f]),L=we(()=>{var ae;(ae=b.current[k].current)==null||ae.submit()}),U=we(()=>{k<1||A(k-1)}),J=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:F,...l==null?void 0:l.submitButtonProps,onClick:()=>{var X;(X=l==null?void 0:l.onSubmit)==null||X.call(l),L()},children:M.getMessage("stepsForm.next","下一步")},"next"),[M,F,L,l]),G=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{...l==null?void 0:l.resetButtonProps,onClick:()=>{var X;U(),(X=l==null?void 0:l.onReset)==null||X.call(l)},children:M.getMessage("stepsForm.prev","上一步")},"pre"),[M,U,l]),H=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:F,...l==null?void 0:l.submitButtonProps,onClick:()=>{var X;(X=l==null?void 0:l.onSubmit)==null||X.call(l),L()},children:M.getMessage("stepsForm.submit","提交")},"submit"),[M,F,L,l]),B=we(()=>{T.length!==0&&(k>T.length-2||A(k+1))}),W=d.useMemo(()=>{var oe;let X=[];const ae=k||0;if(ae<1?T.length===1?X.push(H):X.push(J):ae+1===T.length?X.push(G,H):X.push(G,J),X=X.filter(d.isValidElement),l&&l.render){const ue={form:(oe=b.current[k])==null?void 0:oe.current,onSubmit:L,step:k,onPre:U};return l.render(ue,X)}return l&&(l==null?void 0:l.render)===!1?null:X},[T.length,J,L,G,U,k,H,l]),N=d.useMemo(()=>bn(e.children).map((X,ae)=>{const oe=X.props,ue=oe.name||`${ae}`,ge=k===ae,me=ge?{contentRender:g,submitter:!1}:{};return s.jsx("div",{className:le(`${n}-step`,a,{[`${n}-step-active`]:ge}),children:s.jsx(Ud.Provider,{value:{...me,...p,...oe,name:ue,step:ae},children:X})},ue)}),[p,a,n,e.children,k,g]),q=d.useMemo(()=>m?m(T.map(X=>{var ae;return{key:X,title:(ae=j.current.get(X))==null?void 0:ae.title}}),Z):Z,[T,Z,m]),ee=d.useMemo(()=>s.jsxs("div",{className:le(`${n}-container`,a),style:S,children:[N,u?null:s.jsx(c.Space,{children:W})]}),[S,N,a,n,u,W]),ne=d.useMemo(()=>{const X={stepsDom:q,formDom:ee};return u?u(v?v(X):I(X),W):v?v(X):I(X)},[q,ee,I,u,W,v]);return r(s.jsx("div",{className:le(n,a),children:s.jsx(c.Form.Provider,{...x,children:s.jsx(Hd.Provider,{value:{loading:F,setLoading:E,regForm:D,keyArray:T,next:B,formArrayRef:b,formMapRef:j,lastStep:$,unRegForm:O,onFormFinish:z},children:ne})})}))}function ja(e){return s.jsx(Dn,{needDeps:!0,children:s.jsx(yv,{...e})})}ja.StepForm=hv;ja.useForm=c.Form.useForm;const xv=({children:e})=>s.jsx(s.Fragment,{children:e}),bv=({steps:e,columns:t,forceUpdate:n,grid:r,...a})=>{const i=po(a),o=d.useCallback(u=>{var m,g;(g=(m=i.current).onCurrentChange)==null||g.call(m,u),n([])},[n,i]),l=d.useMemo(()=>e==null?void 0:e.map((u,m)=>d.createElement(Yd,{grid:r,...u,key:m,layoutType:"StepForm",columns:t[m]})),[t,r,e]);return s.jsx(ja,{...a,onCurrentChange:o,children:l})},{noteOnce:zc}=Qe,Sv=(e,t)=>{var n;if(e.valueType==="dependency"){const r=(n=e.getFieldProps)==null?void 0:n.call(e);return zc(Array.isArray(e.name??(r==null?void 0:r.name)),'SchemaForm: fieldProps.name should be NamePath[] when valueType is "dependency"'),zc(typeof e.columns=="function",'SchemaForm: columns should be a function when valueType is "dependency"'),Array.isArray(e.name??(r==null?void 0:r.name))?d.createElement(Ca,{name:e.name,...r,key:e.key},a=>!e.columns||typeof e.columns!="function"?null:t.genItems(e.columns(a))):null}return!0},Cv=e=>{var t;return e.valueType==="divider"?d.createElement(c.Divider,{...(t=e.getFieldProps)==null?void 0:t.call(e),key:e.key}):!0},wv=(e,{action:t,formRef:n,type:r,originItem:a})=>{const i={...We(e,["dataIndex","width","render","formItemRender","renderText","title"]),name:e.name||e.key||e.dataIndex,width:e.width,render:e!=null&&e.render?(m,g,f)=>{var h,p,S,y;return(y=e==null?void 0:e.render)==null?void 0:y.call(e,m,g,f,t==null?void 0:t.current,{type:r,...e,key:(h=e.key)==null?void 0:h.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e)})}:void 0},o=()=>{const{key:m,...g}=i;return s.jsx(wn,{...g,ignoreFormItem:!0},m)},l=e!=null&&e.formItemRender?(m,g)=>{var h,p,S,y;const f=ht({...g,onChange:void 0});return(y=e==null?void 0:e.formItemRender)==null?void 0:y.call(e,{type:r,...e,key:(h=e.key)==null?void 0:h.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e),originProps:a},{...f,defaultRender:o,type:r},n.current)}:void 0,u=()=>{if(e!=null&&e.formItemRender){const m=l==null?void 0:l(null,{});if(!m||e.ignoreFormItem)return m}return d.createElement(wn,{...i,key:[e.key,e.index||0].join("-"),formItemRender:l})};return e.dependencies?s.jsx(Ca,{name:e.dependencies||[],children:u},e.key):u()},jv=(e,{genItems:t})=>{var n,r;return e.valueType==="formList"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(p0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,name:e.dataIndex,label:e.label,initialValue:e.initialValue,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},vv=(e,{genItems:t})=>{var n,r;return e.valueType==="formSet"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(P0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,initialValue:e.initialValue,name:e.dataIndex,label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},Tv=(e,{genItems:t})=>{var n;return e.valueType==="group"?!e.columns||!Array.isArray(e.columns)?null:s.jsx(kv,{label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(n=e.getFieldProps)==null?void 0:n.call(e),children:t(e.columns)},e.key):!0},Fv=e=>e.valueType&&typeof e.valueType=="string"&&["index","indexBorder","option"].includes(e==null?void 0:e.valueType)?null:!0,Bc=[Fv,Tv,jv,vv,Cv,Sv],Rv=(e,t)=>{for(let n=0;n<Bc.length;n++){const r=Bc[n],a=r(e,t);if(a!==!0)return a}return wv(e,t)},$v={DrawerForm:V0,QueryFilter:dv,LightFilter:K0,StepForm:ja.StepForm,StepsForm:bv,ModalForm:q0,Embed:xv,Form:bt};function Yd(e){const{columns:t,layoutType:n="Form",type:r="form",action:a,shouldUpdate:i=(T,R)=>pn(T)!==pn(R),formRef:o,...l}=e,u=$v[n]||bt,[m]=c.Form.useForm(),g=c.Form.useFormInstance(),[,f]=d.useState([]),[h,p]=d.useState(()=>[]),S=zp(e.form||g||m),y=d.useRef(),w=po(e),v=we(T=>T.filter(R=>!(R.hideInForm&&r==="form")).sort((R,F)=>F.order||R.order?(F.order||0)-(R.order||0):(F.index||0)-(R.index||0)).map((R,F)=>{const E=xt(R.title,R,"form",s.jsx(lr,{label:R.title,tooltip:R.tooltip})),M=ht({title:E,label:E,name:R.name,valueType:xt(R.valueType,{}),key:R.key||R.dataIndex||F,columns:R.columns,valueEnum:R.valueEnum,dataIndex:R.dataIndex||R.key,initialValue:R.initialValue,width:R.width,index:R.index,readonly:R.readonly,colSize:R.colSize,colProps:R.colProps,rowProps:R.rowProps,className:R.className,tooltip:R.tooltip,dependencies:R.dependencies,proFieldProps:R.proFieldProps,ignoreFormItem:R.ignoreFormItem,getFieldProps:R.fieldProps?()=>xt(R.fieldProps,S.current,R):void 0,getFormItemProps:R.formItemProps?()=>xt(R.formItemProps,S.current,R):void 0,render:R.render,formItemRender:R.formItemRender,renderText:R.renderText,request:R.request,params:R.params,transform:R.transform,convertValue:R.convertValue,debounceTime:R.debounceTime,defaultKeyWords:R.defaultKeyWords});return Rv(M,{action:a,type:r,originItem:R,formRef:S,genItems:v})}).filter(R=>!!R)),x=d.useCallback((T,R)=>{const{onValuesChange:F}=w.current;(i===!0||typeof i=="function"&&i(R,y.current))&&p([]),y.current=R,F==null||F(T,R)},[w,i]),C=gt(()=>{if(!(t.length&&Array.isArray(t[0])))return v(t)},[t,l==null?void 0:l.open,a,r,h,S.current]),j=gt(()=>n==="StepsForm"?{forceUpdate:f,columns:t}:{},[t,n]);d.useImperativeHandle(o,()=>S.current,[S.current]);const b=d.useContext(Wt);return s.jsx(Dn,{valueTypeMap:{...b.valueTypeMap,...Ed},children:s.jsx(u,{...j,...l,onInit:(T,R)=>{var F;o&&(o.current=R),(F=l==null?void 0:l.onInit)==null||F.call(l,T,R),S.current=R},form:e.form||m,formRef:S,onValuesChange:x,children:C})})}const ca="text",Ev=({fieldProps:e,proFieldProps:t,...n})=>s.jsx(wn,{valueType:ca,fieldProps:e,fieldConfig:{valueType:ca},proFieldProps:t,...n}),Iv=e=>{const[t,n]=it(e.open||!1,e.open),r=d.useCallback(a=>{n(i=>{var l;const o=typeof a=="function"?a(i):a;return(l=e.onOpenChange)==null||l.call(e,o),o})},[e.onOpenChange]);return s.jsx(c.Form.Item,{shouldUpdate:!0,noStyle:!0,children:a=>{var o;const i=a.getFieldValue(e.name||[]);return s.jsx(c.Popover,{getPopupContainer:l=>l&&l.parentNode?l.parentNode:l,onOpenChange:l=>r(l),content:s.jsxs("div",{style:{padding:"4px 0"},children:[(o=e.statusRender)==null?void 0:o.call(e,i),e.strengthText?s.jsx("div",{style:{marginTop:10},children:s.jsx("span",{children:e.strengthText})}):null]}),styles:{root:{width:240}},placement:"rightTop",...e.popoverProps,open:t,children:e.children})}})},Mv=({fieldProps:e,proFieldProps:t,...n})=>{const[r,a]=d.useState(!1);return e!=null&&e.statusRender&&n.name?s.jsx(Dn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(rr,{...o,text:i}),formItemRender:(i,o)=>s.jsx(rr,{...o,text:i})}},children:s.jsx(Iv,{name:n.name,statusRender:e==null?void 0:e.statusRender,popoverProps:e==null?void 0:e.popoverProps,strengthText:e==null?void 0:e.strengthText,open:r,onOpenChange:a,children:s.jsx("div",{children:s.jsx(wn,{valueType:"password",fieldProps:{...We(e,["statusRender","popoverProps","strengthText"]),onBlur:i=>{var o;(o=e==null?void 0:e.onBlur)==null||o.call(e,i),a(!1)},onClick:i=>{var o;(o=e==null?void 0:e.onClick)==null||o.call(e,i),a(!0)}},proFieldProps:t,fieldConfig:{valueType:ca},...n})})})}):s.jsx(Dn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(rr,{...o,text:i}),formItemRender:(i,o)=>s.jsx(rr,{...o,text:i})}},children:s.jsx(wn,{valueType:"password",fieldProps:e,proFieldProps:t,fieldConfig:{valueType:ca},...n})})},ua=Ev;ua.Password=Mv;ua.displayName="ProFormComponent";function bt(e){return s.jsx(br,{layout:"vertical",contentRender:(t,n)=>s.jsxs(s.Fragment,{children:[t,n]}),...e})}bt.Group=_d;bt.useForm=c.Form.useForm;bt.Item=Nd;bt.useWatch=c.Form.useWatch;bt.ErrorList=c.Form.ErrorList;bt.Provider=c.Form.Provider;bt.useFormInstance=c.Form.useFormInstance;bt.EditOrReadOnlyContext=ts;const kv=bt.Group,Av=e=>({[e.componentCls]:{boxSizing:"border-box",marginBlockEnd:16,backgroundColor:vt(e.colorTextBase,.02),borderRadius:e.borderRadius,border:"none","&-container":{paddingBlock:e.paddingSM,paddingInline:e.paddingLG},"&-info":{display:"flex",alignItems:"center",transition:"all 0.3s",color:e.colorTextTertiary,"&-content":{flex:1},"&-option":{minWidth:48,paddingInlineStart:16}}}});function Ov(e){return Je("ProTableAlert",t=>{const n={...t,componentCls:`.${e}`};return[Av(n)]})}const Dv=e=>{const{intl:t,onCleanSelected:n}=e;return[s.jsx("a",{onClick:n,children:t.getMessage("alert.clear","清空")},"0")]};function Pv({selectedRowKeys:e=[],onCleanSelected:t,alwaysShowAlert:n,selectedRows:r,alertInfoRender:a=({intl:o})=>s.jsxs(c.Space,{children:[o.getMessage("alert.selected","已选择"),e.length,o.getMessage("alert.item","项"),"  "]}),alertOptionRender:i=Dv}){const o=ke(),l=i&&i({onCleanSelected:t,selectedRowKeys:e,selectedRows:r,intl:o}),{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),m=u("pro-table-alert"),{wrapSSR:g,hashId:f}=Ov(m);if(a===!1)return null;const h=a({intl:o,selectedRowKeys:e,selectedRows:r,onCleanSelected:t});return h===!1||e.length<1&&!n?null:g(s.jsx("div",{className:le(m,f),children:s.jsx("div",{className:le(`${m}-container`,f),children:s.jsxs("div",{className:le(`${m}-info`,f),children:[s.jsx("div",{className:le(`${m}-info-content`,f),children:h}),l?s.jsx("div",{className:le(`${m}-info-option`,f),children:l}):null]})})}))}function Nv(e,t,n){if(e===!1)return!1;const{total:r,current:a,pageSize:i,setPageInfo:o}=t;return{showTotal:(u,m)=>`${n.getMessage("pagination.total.range","第")} ${m[0]}-${m[1]} ${n.getMessage("pagination.total.total","条/总共")} ${u} ${n.getMessage("pagination.total.item","条")}`,total:r,...typeof e=="object"?e:{},current:e!==!0&&e?e.current??a:a,pageSize:e!==!0&&e?e.pageSize??i:i,onChange:(u,m)=>{const{onChange:g}=e;g==null||g(u,m||20),(m!==i||a!==u)&&o({pageSize:m,current:u})}}}function Lv(e,t,n){const r={...n.editableUtils,pageInfo:t.pageInfo,nativeElement:n.nativeElement,focus:n.focus,reload:async a=>{a&&await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reloadAndRest:async()=>{n.onCleanSelected(),await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reset:async()=>{var a;await n.resetAll(),await((a=t==null?void 0:t.reset)==null?void 0:a.call(t)),await(t==null?void 0:t.reload())},fullScreen:()=>n.fullScreen(),clearSelected:()=>n.onCleanSelected(),setPageInfo:a=>t.setPageInfo(a),scrollTo:n.scrollTo};e.current=r}function _v(e,t){return t.filter(n=>n).length<1?e:t.reduce((n,r)=>r(n),e)}const Kd=(e,t)=>t===void 0?!1:typeof t=="boolean"?t:t[e],zv=e=>{var t;return e&&typeof e=="object"&&((t=e==null?void 0:e.props)==null?void 0:t.colSpan)},fr=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`,ns=e=>Array.isArray(e)?e.join(","):e==null?void 0:e.toString(),eo=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.children?t.push(...eo(r.children)):t.push(r)}return t},Fo=(e,t)=>!!e&&!!t,Ro=e=>typeof e=="function"||typeof e=="object"&&typeof e.compare=="function",Bv=(e,t)=>Object.entries(e).reduce((n,[r,a])=>{const i=t.find(o=>ns(o.dataIndex)===r);return i!=null&&!Fo(i.filters,i.onFilter)&&(n[r]=a),n},{}),Vv=e=>(Array.isArray(e)?e:[e]).reduce((r,a)=>{var l,u;const i=(l=a.column)==null?void 0:l.sorter;if(i!=null&&Ro(i))return r;const o=typeof i=="string"?i:ns((u=a.column)==null?void 0:u.dataIndex);return o!=null&&(r[o]=a.order),r},{}),Hv=e=>{const t={},n={};return e.forEach(r=>{const a=ns(r.dataIndex);a&&(r.filters&&!Fo(r.filters,r.onFilter)&&(t[a]=r.defaultFilteredValue??null),r.sorter&&!Ro(r.sorter)&&(typeof r.sorter=="string"?n[r.sorter]=r.defaultSortOrder??null:n[a]=r.defaultSortOrder??null))}),{sort:n,filter:t}},Uv=(e,t)=>{const{sorter:n,sortOrder:r,dataIndex:a}=t;if(r!==void 0)return r;if(n==null||Ro(n))return;const i=typeof n=="string"?n:ns(a);return i?e[i]:void 0},Yv=(e,t)=>{const{filters:n,onFilter:r,filteredValue:a,dataIndex:i}=t;if(a!==void 0)return a;if(n==null||Fo(n,r))return;const o=ns(i);return o?e[o]:void 0};function Kv(e={}){var x,C,j,b,T,R;const t=d.useRef(),n=d.useRef(null),r=d.useRef(),a=d.useRef(),[i,o]=d.useState(""),l=d.useRef([]),[u,m]=it(()=>e.size||e.defaultSize||"middle",e.size),g=d.useCallback(F=>{m(E=>{var k;const M=typeof F=="function"?F(E):F;return(k=e.onSizeChange)==null||k.call(e,M),M})},[e.onSizeChange]),f=d.useMemo(()=>{var E,M;if((E=e==null?void 0:e.columnsState)!=null&&E.defaultValue)return e.columnsState.defaultValue;const F={};return(M=e.columns)==null||M.forEach(({key:k,dataIndex:V,fixed:_,disable:A},I)=>{const $=fr(k??V,I);$&&(F[$]={show:!0,fixed:_,disable:A})}),F},[e.columns]),[h,p]=it(()=>{var M,k,V,_;const{persistenceType:F,persistenceKey:E}=e.columnsState||{};if(E&&F&&typeof window<"u"){const A=window[F];try{const I=A==null?void 0:A.getItem(E);if(I)return(M=e==null?void 0:e.columnsState)!=null&&M.defaultValue?sa({},(k=e==null?void 0:e.columnsState)==null?void 0:k.defaultValue,JSON.parse(I)):JSON.parse(I)}catch(I){console.warn(I)}}return((V=e.columnsState)==null?void 0:V.value)||((_=e.columnsState)==null?void 0:_.defaultValue)||f},(x=e.columnsState)==null?void 0:x.value),S=(C=e.columnsState)==null?void 0:C.onChange,y=d.useCallback(F=>{p(E=>{const M=typeof F=="function"?F(E):F;return S==null||S(M),M})},[S]);d.useEffect(()=>{var M,k;const{persistenceType:F,persistenceKey:E}=e.columnsState||{};if(E&&F&&typeof window<"u"){const V=window[F];try{const _=V==null?void 0:V.getItem(E);_?(M=e==null?void 0:e.columnsState)!=null&&M.defaultValue?y(sa({},(k=e==null?void 0:e.columnsState)==null?void 0:k.defaultValue,JSON.parse(_))):y(JSON.parse(_)):y(f)}catch(_){console.warn(_)}}},[(j=e.columnsState)==null?void 0:j.persistenceKey,(b=e.columnsState)==null?void 0:b.persistenceType,f]);const w=d.useCallback(()=>{const{persistenceType:F,persistenceKey:E}=e.columnsState||{};if(!E||!F||typeof window>"u")return;const M=window[F];try{M==null||M.removeItem(E)}catch(k){console.warn(k)}},[e.columnsState]);d.useEffect(()=>{var k,V;if(!((k=e.columnsState)!=null&&k.persistenceKey)||!((V=e.columnsState)!=null&&V.persistenceType)||typeof window>"u")return;const{persistenceType:F,persistenceKey:E}=e.columnsState,M=window[F];try{M==null||M.setItem(E,JSON.stringify(h))}catch(_){console.warn(_),w()}},[(T=e.columnsState)==null?void 0:T.persistenceKey,h,(R=e.columnsState)==null?void 0:R.persistenceType]);const v={action:t.current,setAction:F=>{t.current=F},sortKeyColumns:l.current,setSortKeyColumns:F=>{l.current=F},propsRef:a,columnsMap:h,keyWords:i,setKeyWords:F=>o(F),setTableSize:g,tableSize:u,prefixName:r.current,setPrefixName:F=>{r.current=F},setColumnsMap:y,columns:e.columns,rootDomRef:n,clearPersistenceStorage:w,defaultColumnKeyMap:f};return Object.defineProperty(v,"prefixName",{get:()=>r.current}),Object.defineProperty(v,"sortKeyColumns",{get:()=>l.current}),Object.defineProperty(v,"action",{get:()=>t.current}),v}const Vn=d.createContext({}),Wv=e=>{const t=Kv(e.initValue);return s.jsx(Vn.Provider,{value:t,children:e.children})},qv=new Ru("turn",{"0%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(90deg)"},"50%":{transform:"rotate(180deg)"},"75%":{transform:"rotate(270deg)"},"100%":{transform:"rotate(360deg)"}}),Gv=e=>({[e.componentCls]:{boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},zIndex:1,[`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]:{marginBlockEnd:0},"&:not(:root):fullscreen":{minHeight:"100vh",overflow:"auto",background:e.colorBgContainer},"&-extra":{marginBlockEnd:16},"&-polling":{[`${e.componentCls}-list-toolbar-setting-item`]:{".anticon.anticon-reload":{transform:"rotate(0deg)",animationName:qv,animationDuration:"1s",animationTimingFunction:"linear",animationIterationCount:"infinite"}}},[`td${e.antCls}-table-cell`]:{">a":{fontSize:e.fontSize}},[`${e.antCls}-table${e.antCls}-table-tbody${e.antCls}-table-wrapper:only-child${e.antCls}-table`]:{marginBlock:0,marginInline:0},[`${e.antCls}-table${e.antCls}-table-middle ${e.componentCls}`]:{marginBlock:0,marginInline:-8,[`${e.proComponentsCls}-card`]:{backgroundColor:"initial"}},"& &-search":{marginBlockEnd:"16px",background:e.colorBgContainer,"&-ghost":{background:"transparent"},[`&${e.componentCls}-form`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:16,overflow:"unset"},"&-light-filter":{marginBlockEnd:0,paddingBlock:0,paddingInline:0},"&-form-option":{[`${e.antCls}-form-item`]:{},[`${e.antCls}-form-item-label`]:{},[`${e.antCls}-form-item-control-input`]:{}},"@media (max-width: 575px)":{[e.componentCls]:{height:"auto !important",paddingBlockEnd:"24px",[`${e.antCls}-form-item-label`]:{minWidth:"80px",textAlign:"start"}}}},"&-toolbar":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"64px",paddingInline:24,paddingBlock:0,"&-option":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"&-title":{flex:"1",color:e.colorTextLabel,fontWeight:"500",fontSize:"16px",lineHeight:"24px",opacity:"0.85"}}},[`@media (max-width: ${e.screenXS})px`]:{[e.componentCls]:{[`${e.antCls}-table`]:{width:"100%",overflowX:"auto","&-thead > tr,&-tbody > tr":{"> th,> td":{whiteSpace:"pre",">span":{display:"block"}}}}}},"@media (max-width: 575px)":{[`${e.componentCls}-toolbar`]:{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",height:"auto",marginBlockEnd:"16px",marginInlineStart:"16px",paddingBlock:8,paddingInline:8,paddingBlockStart:"16px",lineHeight:"normal","&-title":{marginBlockEnd:16},"&-option":{display:"flex",justifyContent:"space-between",width:"100%"},"&-default-option":{display:"flex",flex:"1",alignItems:"center",justifyContent:"flex-end"}}}});function Zv(e){return Je("ProTable",t=>{const n={...t,componentCls:`.${e}`};return[Gv(n)]})}function Jv(e){let t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t.startsWith("-")&&(t=t.slice(1)),t}const Xv=(e,t)=>!e&&t!==!1?(t==null?void 0:t.filterType)==="light"?"LightFilter":"QueryFilter":"Form",Qv=(e,t,n)=>!e&&n==="LightFilter"?We({...t},["labelWidth","defaultCollapsed","filterType"]):e?{}:We({labelWidth:t?t==null?void 0:t.labelWidth:void 0,defaultCollapsed:!0,...t},["filterType"]),eT=(e,t)=>e?We(t,["ignoreRules"]):{ignoreRules:!0,...t},tT=({onSubmit:e,formRef:t,dateFormatter:n="string",type:r,columns:a,action:i,ghost:o,manualRequest:l,onReset:u,submitButtonLoading:m,search:g,form:f,bordered:h})=>{const{hashId:p}=d.useContext(Gt),S=r==="form",y=async(T,R)=>{e&&e(T,R)},{getPrefixCls:w}=d.useContext(c.ConfigProvider.ConfigContext),v=d.useMemo(()=>a.filter(T=>!(T===c.Table.EXPAND_COLUMN||T===c.Table.SELECTION_COLUMN||T.search===!1&&r!=="form"||r==="form"&&T.hideInForm)).map(T=>{var E;const R=!T.valueType||["textarea","jsonCode","code"].includes(T==null?void 0:T.valueType)&&r==="table"?"text":T==null?void 0:T.valueType,F=(T==null?void 0:T.key)||((E=T==null?void 0:T.dataIndex)==null?void 0:E.toString());return{...T,width:void 0,...T.search&&typeof T.search=="object"?T.search:{},valueType:R,proFieldProps:{...T.proFieldProps,proFieldKey:F?`table-field-${F}`:void 0}}}),[a,r]),x=w("pro-table-search"),C=w("pro-table-form"),j=d.useMemo(()=>Xv(S,g),[g,S]),b=d.useMemo(()=>({submitter:{submitButtonProps:{loading:m}}}),[m]);return s.jsx("div",{className:le(p,{[w("pro-card")]:!0,[`${w("pro-card")}-border`]:!!h,[`${w("pro-card")}-bordered`]:!!h,[`${w("pro-card")}-ghost`]:!!o,[x]:!0,[C]:S,[w(`pro-table-search-${Jv(j)}`)]:!0,[`${x}-ghost`]:o,[g==null?void 0:g.className]:g!==!1&&(g==null?void 0:g.className)}),children:s.jsx(Yd,{layoutType:j,columns:v,type:r,...b,...Qv(S,g,j),...eT(S,f||{}),formRef:t,action:i,dateFormatter:n,onInit:(T,R)=>{var F,E,M;if(t.current=R,r!=="form"){const k=(F=i.current)==null?void 0:F.pageInfo,{current:V=k==null?void 0:k.current,pageSize:_=k==null?void 0:k.pageSize}=T;if((M=(E=i.current)==null?void 0:E.setPageInfo)==null||M.call(E,{...k,current:parseInt(V,10),pageSize:parseInt(_,10)}),l)return;y(T,!0)}},onReset:T=>{u==null||u(T)},onFinish:T=>{y(T,!1)},initialValues:f==null?void 0:f.initialValues})})},nT=e=>{const{columns:t,loading:n,formRef:r,type:a,action:i,cardBordered:o,dateFormatter:l,form:u,search:m,pagination:g,ghost:f,manualRequest:h,beforeSearchSubmit:p=j=>j,onSubmit:S,onFormSearchSubmit:y,onReset:w}=e,v=d.useMemo(()=>g?ht({current:g.current,pageSize:g.pageSize}):{},[g]),x=we((j,b)=>{var F,E,M;if((u==null?void 0:u.ignoreRules)===!1&&b){(F=r==null?void 0:r.current)==null||F.validateFields().then(()=>{var _,A;const k={...j,_timestamp:Date.now(),...v},V=We(p(k),Object.keys(v));y(V),b||(A=(_=i.current)==null?void 0:_.setPageInfo)==null||A.call(_,{current:1}),S&&!b&&(S==null||S(j))}).catch(k=>{});return}const T={...j,_timestamp:Date.now(),...v},R=We(p(T),Object.keys(v));y(R),b||(M=(E=i.current)==null?void 0:E.setPageInfo)==null||M.call(E,{current:1}),S&&!b&&(S==null||S(j))}),C=we(j=>{var T;const b=()=>{var F,E;const R=We(p({...j,...v}),Object.keys(v));y(R),(E=(F=i.current)==null?void 0:F.setPageInfo)==null||E.call(F,{current:1}),w==null||w()};if((u==null?void 0:u.ignoreRules)===!1){(T=r==null?void 0:r.current)==null||T.validateFields().then(b).catch(()=>{});return}b()});return s.jsx(tT,{submitButtonLoading:n,columns:t,type:a,ghost:f,formRef:r,onSubmit:x,manualRequest:h,onReset:C,dateFormatter:l,search:m,form:{autoFocusFirstInput:!1,...u,extraUrlParams:{...v,...u==null?void 0:u.extraUrlParams}},action:i,bordered:Kd("search",o)})},rT=(e,t)=>{const n={columns:e.columns,loading:e.loading,formRef:e.formRef,type:e.type,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,form:e.form,search:e.search,manualRequest:e.manualRequest};return xn(n,{columns:t.columns,formRef:t.formRef,loading:t.loading,type:t.type,cardBordered:t.cardBordered,dateFormatter:t.dateFormatter,form:t.form,search:t.search,manualRequest:t.manualRequest})},sT=d.memo(nT,rT);function aT(e){const{search:t,type:n,pagination:r,beforeSearchSubmit:a,actionRef:i,columns:o,onFormSearchSubmit:l,ghost:u,onReset:m,onSubmit:g,loading:f,manualRequest:h,form:p,formRef:S,cardBordered:y,dateFormatter:w,searchFormRender:v,proTableProps:x}=e;return d.useMemo(()=>{const C=t===!1&&n!=="form"?null:s.jsx(sT,{pagination:r,beforeSearchSubmit:a,action:i,columns:o,onFormSearchSubmit:j=>{l(j)},ghost:u,onReset:m,onSubmit:g,loading:f,manualRequest:h,search:t,form:p,formRef:S,type:n||"table",cardBordered:y,dateFormatter:w});return v&&C?s.jsx(s.Fragment,{children:v(x,C)}):C},[i,a,y,o,w,p,S,u,f,h,l,m,g,r,x,t,v,n])}const iT=e=>({[e.componentCls]:{boxSizing:"border-box",width:"auto","&-title":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"32px"},"&-overlay":{[`${e.antCls}-popover-inner-content`]:{width:"200px",paddingBlock:0,paddingInline:0,paddingBlockEnd:8},[`${e.antCls}-tree-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${e.antCls}-tree-draggable-icon`]:{cursor:"grab"},[`${e.antCls}-tree-treenode`]:{alignItems:"center","&:hover":{[`${e.componentCls}-list-item-option`]:{display:"block"}},[`${e.antCls}-tree-checkbox`]:{marginInlineEnd:"4px"},[`${e.antCls}-tree-title`]:{width:"100%"}}}},[`${e.componentCls}-action-rest-button`]:{color:e.colorPrimary},[`${e.componentCls}-list`]:{display:"flex",flexDirection:"column",width:"100%",paddingBlockStart:8,[`&${e.componentCls}-list-group`]:{paddingBlockStart:0},"&-title":{marginBlockStart:"6px",marginBlockEnd:"6px",paddingInlineStart:"24px",color:e.colorTextSecondary,fontSize:"12px"},"&-item":{display:"flex",alignItems:"center",maxHeight:24,justifyContent:"space-between","&-title":{flex:1,maxWidth:80,textOverflow:"ellipsis",overflow:"hidden",wordBreak:"break-all",whiteSpace:"nowrap"},"&-option":{display:"none",float:"right",cursor:"pointer","> span":{"> span.anticon":{color:e.colorPrimary}},"> span + span":{marginInlineStart:4}}}}});function oT(e){return Je("ColumnSetting",t=>{const n={...t,componentCls:`.${e}`};return[iT(n)]})}const ii=({title:e,show:t,children:n,columnKey:r,fixed:a})=>{const{columnsMap:i,setColumnsMap:o}=d.useContext(Vn);return t?s.jsx(c.Tooltip,{title:e,children:s.jsx("span",{onClick:l=>{l.stopPropagation(),l.preventDefault();const u=(i==null?void 0:i[r])||{},m={...i,[r]:{...u,fixed:a}};o(m)},children:n})}):null},lT=({columnKey:e,isLeaf:t,title:n,className:r,fixed:a,showListItemOption:i})=>{const o=ke(),{hashId:l}=d.useContext(Gt),u=s.jsxs("span",{className:le(`${r}-list-item-option`,l),children:[s.jsx(ii,{columnKey:e,fixed:"left",title:o.getMessage("tableToolBar.leftPin","固定在列首"),show:a!=="left",children:s.jsx(de.VerticalAlignTopOutlined,{})}),s.jsx(ii,{columnKey:e,fixed:void 0,title:o.getMessage("tableToolBar.noPin","不固定"),show:!!a,children:s.jsx(de.VerticalAlignMiddleOutlined,{})}),s.jsx(ii,{columnKey:e,fixed:"right",title:o.getMessage("tableToolBar.rightPin","固定在列尾"),show:a!=="right",children:s.jsx(de.VerticalAlignBottomOutlined,{})})]});return s.jsxs("span",{className:le(`${r}-list-item`,l),children:[s.jsx("div",{className:le(`${r}-list-item-title`,l),children:n}),i&&!t?u:null]},e)},oi=({list:e,draggable:t,checkable:n,showListItemOption:r,className:a,showTitle:i=!0,title:o,listHeight:l=280})=>{var x,C,j;const{hashId:u}=d.useContext(Gt),{columnsMap:m,setColumnsMap:g,sortKeyColumns:f,setSortKeyColumns:h}=d.useContext(Vn),p=e&&e.length>0,S=d.useMemo(()=>{if(!p)return{};const b=[],T=new Map,R=(F,E)=>F.map(({key:M,dataIndex:k,children:V,..._})=>{var D,O;const A=fr(M,[E==null?void 0:E.columnKey,_.index].filter(Boolean).join("-")),I=(m==null?void 0:m[A||"null"])||{show:!0};I.show!==!1&&!V&&b.push(A);const $={key:A,...We(_,["className"]),selectable:!1,disabled:I.disable===!0,disableCheckbox:typeof I.disable=="boolean"?I.disable:(D=I.disable)==null?void 0:D.checkbox,isLeaf:E?!0:void 0};return V&&($.children=R(V,{...I,columnKey:A}),(O=$.children)!=null&&O.every(z=>b==null?void 0:b.includes(z.key))&&b.push(A)),T.set(M,{...$,parentKey:E==null?void 0:E.columnKey}),$});return{list:R(e),keys:b,map:T}},[m,e,p]),y=we((b,T,R)=>{const F={...m},E=[...f],M=E.findIndex(A=>A===b),k=E.findIndex(A=>A===T),V=R>=M;if(M<0)return;const _=E[M];E.splice(M,1),R===0?E.unshift(_):E.splice(V?k:k+1,0,_),E.forEach((A,I)=>{F[A]={...F[A]||{},order:I}}),g(F),h(E)}),w=we(b=>{const T={...m},R=F=>{var k,V,_,A,I,$;const E={...T[F]};E.show=b.checked,(V=(k=S.map)==null?void 0:k.get(F))!=null&&V.children&&((A=(_=S.map.get(F))==null?void 0:_.children)==null||A.forEach(D=>R(D.key)));const M=($=(I=S.map)==null?void 0:I.get(F))==null?void 0:$.parentKey;M&&(T[M]={...T[M],show:!0}),T[F]=E};R(b.node.key),g({...T})});if(!p)return null;const v=s.jsx(c.Tree,{itemHeight:24,draggable:t&&!!((x=S.list)!=null&&x.length)&&((C=S.list)==null?void 0:C.length)>1,checkable:n,onDrop:b=>{const T=b.node.key,R=b.dragNode.key,{dropPosition:F,dropToGap:E}=b,M=F===-1||!E?F+1:F;y(R,T,M)},blockNode:!0,onCheck:(b,T)=>w(T),checkedKeys:S.keys,showLine:!1,titleRender:b=>{const T={...b,children:void 0};if(!T.title)return null;const R=xt(T.title,T),F=s.jsx(c.Typography.Text,{style:{width:80},ellipsis:{tooltip:R},children:R});return s.jsx(lT,{className:a,...We(T,["key"]),showListItemOption:r,title:F,columnKey:T.key})},height:l,treeData:(j=S.list)==null?void 0:j.map(({disabled:b,...T})=>T)});return s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:le(`${a}-list-title`,u),children:o}),v]})},cT=({localColumns:e,className:t,draggable:n,checkable:r,showListItemOption:a,listsHeight:i})=>{const{hashId:o}=d.useContext(Gt),l=[],u=[],m=[],g=ke();e.forEach(p=>{if(p.hideInSetting)return;const{fixed:S}=p;if(S==="left"){u.push(p);return}if(S==="right"){l.push(p);return}m.push(p)});const f=l&&l.length>0,h=u&&u.length>0;return s.jsxs("div",{className:le(`${t}-list`,o,{[`${t}-list-group`]:f||h}),children:[s.jsx(oi,{title:g.getMessage("tableToolBar.leftFixedTitle","固定在左侧"),list:u,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i}),s.jsx(oi,{list:m,draggable:n,checkable:r,showListItemOption:a,title:g.getMessage("tableToolBar.noFixedTitle","不固定"),showTitle:h||f,className:t,listHeight:i}),s.jsx(oi,{title:g.getMessage("tableToolBar.rightFixedTitle","固定在右侧"),list:l,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i})]})};function uT(e){const t=d.useRef(null),n=d.useContext(Vn),r=e.columns,{checkedReset:a=!0}=e,{columnsMap:i,setColumnsMap:o,clearPersistenceStorage:l}=n;d.useEffect(()=>{var x,C,j,b;(C=(x=n.propsRef.current)==null?void 0:x.columnsState)!=null&&C.value&&(t.current=JSON.parse(JSON.stringify(((b=(j=n.propsRef.current)==null?void 0:j.columnsState)==null?void 0:b.value)||{})))},[]);const u=we((x=!0)=>{const C={},j=b=>{b.forEach(({key:T,fixed:R,index:F,children:E,disable:M})=>{var V,_;const k=fr(T,F);k&&(C[k]={show:M?(V=i==null?void 0:i[k])==null?void 0:V.show:x,fixed:R,disable:M,order:(_=i==null?void 0:i[k])==null?void 0:_.order}),E&&j(E)})};j(r),o(C)}),m=we(x=>{x.target.checked?u():u(!1)}),g=we(()=>{var x,C;l==null||l(),o(((C=(x=n.propsRef.current)==null?void 0:x.columnsState)==null?void 0:C.defaultValue)||t.current||n.defaultColumnKeyMap)}),f=Object.values(i).filter(x=>!x||x.show===!1),h=f.length>0&&f.length!==r.length,p=ke(),{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-table-column-setting"),{wrapSSR:w,hashId:v}=oT(y);return w(s.jsx(c.Popover,{arrow:!1,title:s.jsxs("div",{className:le(`${y}-title`,v),children:[e.checkable===!1?s.jsx("div",{}):s.jsx(c.Checkbox,{indeterminate:h,checked:f.length===0&&f.length!==r.length,onChange:x=>{m(x)},children:p.getMessage("tableToolBar.columnDisplay","列展示")}),a?s.jsx("a",{onClick:g,className:le(`${y}-action-rest-button`,v),children:p.getMessage("tableToolBar.reset","重置")}):null,e!=null&&e.extra?s.jsx(c.Space,{size:12,align:"center",children:e.extra}):null]}),classNames:{root:le(`${y}-overlay`,v)},trigger:"click",placement:"bottomRight",content:s.jsx(cT,{checkable:e.checkable??!0,draggable:e.draggable??!0,showListItemOption:e.showListItemOption??!0,className:y,localColumns:r,listsHeight:e.listsHeight}),children:e.children||s.jsx(c.Tooltip,{title:p.getMessage("tableToolBar.columnSetting","列设置"),children:e.settingIcon??s.jsx(de.SettingOutlined,{})})}))}const dT=e=>{const{hashId:t}=d.useContext(Gt),n=e.hashId??t,{items:r=[],type:a="inline",prefixCls:i,activeKey:o,defaultActiveKey:l}=e,[u,m]=it(o||l,o),g=d.useCallback(h=>{m(p=>{var y;const S=typeof h=="function"?h(p):h;return(y=e.onChange)==null||y.call(e,S,p),S})},[e.onChange]);if(r.length<1)return null;const f=r.find(h=>h.key===u)||r[0];return a==="inline"?s.jsx("div",{className:le(`${i}-menu`,`${i}-inline-menu`,n),children:r.map((h,p)=>s.jsx("div",{onClick:()=>{g(h.key)},className:le(`${i}-inline-menu-item`,f.key===h.key?`${i}-inline-menu-item-active`:void 0,n),children:h.label},h.key||p))}):a==="tab"?s.jsx(c.Tabs,{items:r.map(h=>{var p;return{...h,key:(p=h.key)==null?void 0:p.toString()}}),activeKey:f.key,onTabClick:h=>g(h)}):s.jsx("div",{className:le(`${i}-menu`,`${i}-dropdownmenu`,n),children:s.jsx(c.Dropdown,{trigger:["click"],menu:{selectedKeys:[f.key],onClick:h=>{g(h.key)},items:r.map((h,p)=>({key:h.key||p,disabled:h.disabled,label:h.label}))},children:s.jsxs(c.Space,{className:le(`${i}-dropdownmenu-label`,n),children:[f.label,s.jsx(de.DownOutlined,{})]})})})},fT=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"1","&-container":{display:"flex",justifyContent:"space-between",paddingBlock:e.padding,paddingInline:e.paddingXS,"&-mobile":{flexDirection:"column"}},"&-title":{display:"flex",alignItems:"center",justifyContent:"flex-start",color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},"&-search:not(:last-child)":{display:"flex",alignItems:"center",justifyContent:"flex-start"},"&-setting-item":{marginBlock:0,marginInline:4,color:e.colorIconHover,fontSize:e.fontSizeLG,cursor:"pointer","> span":{display:"block",width:"100%",height:"100%"},"&:hover":{color:e.colorPrimary}},"&-left":{display:"flex",flexWrap:"wrap",alignItems:"center",gap:e.marginXS,justifyContent:"flex-start",maxWidth:"calc(100% - 200px)",[`${e.antCls}-tabs`]:{width:"100%"},"&-has-tabs":{overflow:"hidden"}},"&-right":{flex:1,display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:e.marginXS},"&-extra-line":{marginBlockEnd:e.margin},"&-setting-items":{display:"flex",gap:e.marginXS,lineHeight:"32px",alignItems:"center"},"&-filter":{"&:not(:last-child)":{marginInlineEnd:e.margin},display:"flex",alignItems:"center",[`div$${e.antCls}-pro-table-search`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0}},"&-inline-menu-item":{display:"inline-block",marginInlineEnd:e.marginLG,cursor:"pointer",opacity:"0.75","&-active":{fontWeight:"bold",opacity:"1"}},[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,"&::before":{borderBlockEnd:0},[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:0,[`${e.antCls}-tabs-tab`]:{paddingBlockStart:0}}},"&-dropdownmenu-label":{fontWeight:"bold",fontSize:e.fontSizeIcon,textAlign:"center",cursor:"pointer"},"@media (max-width: 768px)":{[e.componentCls]:{"&-container":{display:"flex",flexWrap:"wrap",flexDirection:"column"},"&-left":{marginBlockEnd:"16px",maxWidth:"100%"}}}}});function hT(e){return Je("ProTableListToolBar",t=>{const n={...t,componentCls:`.${e}`};return[fT(n)]})}function mT(e){if(d.isValidElement(e))return e;if(e){const t=e,{icon:n,tooltip:r,onClick:a,key:i}=t;return n&&r?s.jsx(c.Tooltip,{title:r,children:s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}):s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}return null}const gT=({prefixCls:e,hashId:t,tabs:n,multipleLine:r,filtersNode:a})=>r?s.jsx("div",{className:le(`${e}-extra-line`,t),children:n!=null&&n.items&&(n!=null&&n.items.length)?s.jsx(c.Tabs,{style:{width:"100%"},defaultActiveKey:n.defaultActiveKey,activeKey:n.activeKey,items:n.items.map((i,o)=>{var l;return{label:i.tab,...i,key:((l=i.key)==null?void 0:l.toString())||(o==null?void 0:o.toString())}}),onChange:n.onChange,tabBarExtraContent:a}):a}):null,pT=({prefixCls:e,title:t,subTitle:n,tooltip:r,className:a,style:i,search:o,onSearch:l,multipleLine:u=!1,filter:m,actions:g=[],settings:f=[],tabs:h,menu:p})=>{const{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),{token:y}=yn.useToken(),w=S("pro-table-list-toolbar",e),{wrapSSR:v,hashId:x}=hT(w),C=ke(),[j,b]=d.useState(!1),T=C.getMessage("tableForm.inputPlaceholder","请输入"),R=d.useMemo(()=>o?d.isValidElement(o)?o:s.jsx(c.Input.Search,{style:{width:200},placeholder:T,...o,onSearch:async(...$)=>{var O;await((O=o.onSearch)==null?void 0:O.call(o,...$))!==!1&&(l==null||l($==null?void 0:$[0]))}}):null,[T,l,o]),F=d.useMemo(()=>m?s.jsx("div",{className:le(`${w}-filter`,x),children:m}):null,[m,x,w]),E=d.useMemo(()=>p||t||n||r,[p,n,t,r]),M=d.useMemo(()=>Array.isArray(g)?g.length<1?null:s.jsx("div",{style:{display:"flex",alignItems:"center",gap:y.marginXS},children:g.map(($,D)=>d.isValidElement($)?d.cloneElement($,{key:D,...$==null?void 0:$.props}):s.jsx(d.Fragment,{children:$},D))}):g,[g]),k=d.useMemo(()=>!!(E&&R||!u&&F||M||f!=null&&f.length),[M,F,E,u,R,f==null?void 0:f.length]),V=d.useMemo(()=>r||t||n||p||!E&&R,[E,p,R,n,t,r]),_=d.useMemo(()=>!V&&k?s.jsx("div",{className:le(`${w}-left`,x)}):!p&&(E||!R)?s.jsx("div",{className:le(`${w}-left`,x),children:s.jsx("div",{className:le(`${w}-title`,x),children:s.jsx(lr,{tooltip:r,label:t,subTitle:n})})}):s.jsxs("div",{className:le(`${w}-left`,x,{[`${w}-left-has-tabs`]:(p==null?void 0:p.type)==="tab",[`${w}-left-has-dropdown`]:(p==null?void 0:p.type)==="dropdown",[`${w}-left-has-inline-menu`]:(p==null?void 0:p.type)==="inline"}),children:[E&&!p&&s.jsx("div",{className:le(`${w}-title`,x),children:s.jsx(lr,{tooltip:r,label:t,subTitle:n})}),p&&s.jsx(dT,{...p,prefixCls:w,hashId:x}),!E&&R?s.jsx("div",{className:le(`${w}-search`,x),children:R}):null]}),[V,k,E,x,p,w,R,n,t,r]),A=d.useMemo(()=>k?s.jsxs("div",{className:le(`${w}-right`,x),style:j?{}:{alignItems:"center"},children:[u?null:F,E&&R?s.jsx("div",{className:le(`${w}-search`,x),children:R}):null,M,f!=null&&f.length?s.jsx("div",{className:le(`${w}-setting-items`,x),children:f.map(($,D)=>{const O=mT($);return s.jsx("div",{className:le(`${w}-setting-item`,x),children:O},D)})}):null]}):null,[k,w,x,j,E,R,u,F,M,f]),I=d.useMemo(()=>{if(!k&&!V)return null;const $=le(`${w}-container`,x,{[`${w}-container-mobile`]:j});return s.jsxs("div",{className:$,children:[_,A]})},[V,k,x,j,_,w,A]);return v(s.jsx(wa,{onResize:$=>{$.width<375!==j&&b($.width<375)},children:$=>s.jsxs("div",{ref:$,style:i,className:le(w,x,a),children:[I,s.jsx(gT,{filtersNode:F,hashId:x,prefixCls:w,tabs:h,multipleLine:u})]})}))},yT=d.forwardRef((e,t)=>{const{icon:n=s.jsx(de.ColumnHeightOutlined,{})}=e,r=d.useContext(Vn),a=ke();return s.jsx(c.Dropdown,{menu:{selectedKeys:[r.tableSize],onClick:({key:i})=>{var o;(o=r.setTableSize)==null||o.call(r,i)},style:{width:80},items:[{key:"large",label:a.getMessage("tableToolBar.densityLarger","宽松")},{key:"middle",label:a.getMessage("tableToolBar.densityMiddle","中等")},{key:"small",label:a.getMessage("tableToolBar.densitySmall","紧凑")}]},trigger:["click"],children:s.jsx(c.Tooltip,{title:a.getMessage("tableToolBar.density","表格密度"),children:s.jsx("span",{ref:t,children:n})})})}),xT=d.memo(yT),bT=d.forwardRef((e,t)=>{const n=ke(),[r,a]=d.useState(!1);return d.useEffect(()=>{xo()&&(document.onfullscreenchange=()=>{a(!!document.fullscreenElement)})},[]),r?s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.exitFullScreen","退出全屏"),children:s.jsx("span",{ref:t,children:s.jsx(de.FullscreenExitOutlined,{})})}):s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.fullScreen","全屏"),children:s.jsx("span",{ref:t,children:s.jsx(de.FullscreenOutlined,{})})})}),Wd=d.memo(bT);function ST({intl:e},t){return{reload:{text:e.getMessage("tableToolBar.reload","刷新"),icon:t.reloadIcon??s.jsx(de.ReloadOutlined,{})},density:{text:e.getMessage("tableToolBar.density","表格密度"),icon:s.jsx(xT,{icon:t.densityIcon})},fullScreen:{text:e.getMessage("tableToolBar.fullScreen","全屏"),icon:s.jsx(Wd,{})}}}function CT(e,t,n,r){return Object.keys(e).filter(a=>a).map(a=>{const i=e[a];if(!i)return null;let o=i===!0?t[a]:u=>{i==null||i(u,n.current)};if(typeof o!="function"&&(o=()=>{}),a==="setting")return d.createElement(uT,{...e[a],columns:r,key:a});if(a==="fullScreen")return s.jsx("span",{onClick:o,children:s.jsx(Wd,{})},a);const l=ST(t,e)[a];return l?s.jsx("span",{onClick:o,children:s.jsx(c.Tooltip,{title:l.text,children:l.icon})},a):null}).filter(a=>a)}function wT({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:m,optionsRender:g,...f}){const h=d.useContext(Vn),p=ke(),S=d.useMemo(()=>{const v={reload:()=>{var j;return(j=r==null?void 0:r.current)==null?void 0:j.reload()},density:!0,setting:!0,search:!1,fullScreen:()=>{var j,b;return(b=(j=r==null?void 0:r.current)==null?void 0:j.fullScreen)==null?void 0:b.call(j)}};if(a===!1)return[];const x={...v,fullScreen:!1,...a},C=CT(x,{...v,intl:p},r,m);return g?g({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:m,optionsRender:g,...f},C):C},[r,m,e,p,u,g,a,f,i,o,n,l,t]),y=n?n(r==null?void 0:r.current,{selectedRowKeys:i,selectedRows:o}):[],w=d.useMemo(()=>{if(!a||!a.search)return!1;const v={value:h.keyWords,onChange:x=>h.setKeyWords(x.target.value)};return a.search===!0?v:{...v,...a.search}},[h,a]);return d.useEffect(()=>{h.keyWords===void 0&&(u==null||u(""))},[h.keyWords,u]),s.jsx(pT,{title:e,tooltip:t,search:w,onSearch:u,actions:y,settings:S,...l})}const jT=e=>{const{hideToolbar:t,tableColumn:n,options:r,searchNode:a,tooltip:i,toolbar:o,selectedRows:l,selectedRowKeys:u,headerTitle:m,actionRef:g,toolBarRender:f,optionsRender:h,onFormSearchSubmit:p}=e,S=d.useCallback(y=>{var x,C,j,b;if(!r||!r.search)return;const{name:w="keyword"}=r.search===!0?{}:r.search;((C=(x=r.search)==null?void 0:x.onSearch)==null?void 0:C.call(x,y))!==!1&&((b=(j=g==null?void 0:g.current)==null?void 0:j.setPageInfo)==null||b.call(j,{current:1}),p(ht({_timestamp:Date.now(),[w]:y})))},[r,p,g]);return t?null:s.jsx(wT,{tooltip:i,columns:n,options:r,headerTitle:m,action:g,onSearch:S,selectedRows:l,selectedRowKeys:u,toolBarRender:f,toolbar:{filter:a,...o},optionsRender:h})},vT=(e,t)=>t.searchNode?!1:xn({hideToolbar:e.hideToolbar,tableColumn:e.tableColumn,options:e.options,tooltip:e.tooltip,toolbar:e.toolbar,selectedRows:e.selectedRows,selectedRowKeys:e.selectedRowKeys,headerTitle:e.headerTitle,actionRef:e.actionRef,toolBarRender:e.toolBarRender},{hideToolbar:t.hideToolbar,tableColumn:t.tableColumn,options:t.options,tooltip:t.tooltip,toolbar:t.toolbar,selectedRows:t.selectedRows,selectedRowKeys:t.selectedRowKeys,headerTitle:t.headerTitle,actionRef:t.actionRef,toolBarRender:t.toolBarRender},["render","formItemRender"]),TT=d.memo(jT,vT);function FT(e){const{toolBarRender:t,headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,isLightFilter:m,searchNode:g,options:f,optionsRender:h,actionRef:p,setFormSearch:S,formSearch:y}=e;return d.useMemo(()=>t===!1?null:s.jsx(TT,{headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,onFormSearchSubmit:w=>{S({...y||{},...w})},searchNode:m?g:null,options:f,optionsRender:h,actionRef:p,toolBarRender:t}),[p,y,n,r,m,f,h,g,i,a,S,o,t,l,u])}const RT=({pageInfo:e})=>{if(e){const{current:t,defaultCurrent:n,pageSize:r,defaultPageSize:a}=e;return{current:t||n||1,total:0,pageSize:r||a||20}}return{current:1,total:0,pageSize:20}};function $T(e){const[t,n]=it(()=>RT(e),void 0),r=d.useCallback(i=>{n(o=>{var u;const l=typeof i=="function"?i(o):i;return(u=e==null?void 0:e.onPageInfoChange)==null||u.call(e,l),l})},[e==null?void 0:e.onPageInfoChange]),a=we(i=>{const o={...t,...i};(o.current!==t.current||o.pageSize!==t.pageSize||o.total!==t.total)&&r(o)});return[t,a]}const ET=(e,t,n)=>{var D;const r=d.useRef(!1),a=d.useRef(null),{onLoad:i,manual:o,polling:l,onRequestError:u,debounceTime:m=20,effects:g=[]}=n||{},f=d.useRef(o),h=d.useRef(),[p,S]=it(t,n==null?void 0:n.dataSource),y=d.useCallback(O=>{S(z=>{const Z=typeof O=="function"?O(z):O;return queueMicrotask(()=>{var L;(L=n==null?void 0:n.onDataSourceChange)==null||L.call(n,Z)}),Z})},[n==null?void 0:n.onDataSourceChange]),w=typeof(n==null?void 0:n.loading)=="object"?(D=n==null?void 0:n.loading)==null?void 0:D.spinning:n==null?void 0:n.loading,[v,x]=it(!1,w),C=we(O=>{var z;(z=n==null?void 0:n.onLoadingChange)==null||z.call(n,O)}),j=d.useCallback(O=>{x(z=>{const Z=typeof O=="function"?O(z):O;return queueMicrotask(()=>{C(Z)}),Z})},[C]),[b,T]=$T(n),[R,F]=d.useState(!1),E=(O,z)=>{y(O),(b==null?void 0:b.total)!==z&&T({...b,total:z||O.length})},M=_r(b==null?void 0:b.current),k=_r(b==null?void 0:b.pageSize),V=_r(l),_=we(()=>{j(!1),F(!1)}),A=async(O,z)=>{if(f.current){f.current=!1;return}O?F(!0):j(!0);const{pageSize:Z,current:L}=b||{};try{const U=(n==null?void 0:n.pageInfo)!==!1?{current:L,pageSize:Z}:void 0,{data:J=[],success:G,total:H=0,...B}=await(e==null?void 0:e(U))||{};if(z!=null&&z.aborted)return[];if(G===!1)return[];const W=_v(J,[n.postData].filter(N=>N));return z!=null&&z.aborted?[]:(E(W,H),i==null||i(W,B),W)}catch(U){if(z!=null&&z.aborted)return[];if(u===void 0)throw new Error(U);p===void 0&&y([]),u(U)}finally{z!=null&&z.aborted||_()}return[]},I=go(async O=>{if(h.current&&clearTimeout(h.current),!e)return;const z=new AbortController;a.current=z;try{const Z=await Promise.race([A(O,z.signal),new Promise((U,J)=>{var G,H,B;(B=(H=(G=a.current)==null?void 0:G.signal)==null?void 0:H.addEventListener)==null||B.call(H,"abort",()=>{J("aborted"),I.cancel(),_()})})]);if(z.signal.aborted)return;const L=xt(l,Z);return L&&!r.current&&(h.current=setTimeout(()=>{I.run(L)},Math.max(L,2e3))),Z}catch(Z){if(Z==="aborted")return[];throw Z}},m||30),$=()=>{var O;(O=a.current)==null||O.abort(),I.cancel(),_()};return d.useEffect(()=>(l||clearTimeout(h.current),!V&&l&&I.run(!0),()=>{clearTimeout(h.current)}),[l]),d.useEffect(()=>(r.current=!1,()=>{r.current=!0}),[]),d.useEffect(()=>{const{current:O,pageSize:z}=b||{};(!M||M===O)&&(!k||k===z)||n.pageInfo&&p&&(p==null?void 0:p.length)>z||O!==void 0&&p&&p.length<=z&&($(),I.run(!1))},[b==null?void 0:b.current]),d.useEffect(()=>{k&&($(),I.run(!1))},[b==null?void 0:b.pageSize]),nr(()=>($(),I.run(!1),o||(f.current=!1),()=>{$()}),[...g,o]),{dataSource:p,setDataSource:y,loading:typeof(n==null?void 0:n.loading)=="object"?{...n==null?void 0:n.loading,spinning:v}:v,reload:async()=>($(),f.current=!1,await I.run(!1)),pageInfo:b,pollingLoading:R,reset:async()=>{const{pageInfo:O}=n||{},{defaultCurrent:z=1,defaultPageSize:Z=20}=O||{};T({current:z,total:0,pageSize:Z})},setPageInfo:async O=>{T(O)}}},IT=e=>(t,n)=>{var m,g,f,h;const{fixed:r,index:a}=t,{fixed:i,index:o}=n;if(r==="left"&&i!=="left"||i==="right"&&r!=="right")return-2;if(i==="left"&&r!=="left"||r==="right"&&i!=="right")return 2;const l=t.key||`${a}`,u=n.key||`${o}`;return(m=e==null?void 0:e[l])!=null&&m.order||(g=e==null?void 0:e[u])!=null&&g.order?(((f=e==null?void 0:e[l])==null?void 0:f.order)||0)-(((h=e==null?void 0:e[u])==null?void 0:h.order)||0):(t.index||0)-(n.index||0)},MT=["",null,void 0],Vc=(...e)=>e.filter(t=>t!==void 0).map(t=>typeof t=="number"?t.toString():t).flat(1),kT=e=>{const t=d.useContext(xr),{columnProps:n,prefixName:r,text:a,counter:i,rowData:o,index:l,recordKey:u,subName:m,proFieldProps:g,editableUtils:f}=e,h=bt.useFormInstance(),p=u||l,S=d.useMemo(()=>{var b;return((b=f==null?void 0:f.getRealIndex)==null?void 0:b.call(f,o))??l},[f,l,o]),[y,w]=d.useState(()=>Vc(r,r?m:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l)),v=d.useMemo(()=>y.slice(0,-1),[y]);d.useEffect(()=>{const b=Vc(r,r?m:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l);b.join("-")!==y.join("-")&&w(b)},[n==null?void 0:n.dataIndex,n==null?void 0:n.key,l,u,r,p,m,y,S]);const x=d.useMemo(()=>[h,{...n,rowKey:v,rowIndex:l,isEditable:!0}],[n,h,l,v]),C=d.useCallback(({children:b,...T})=>s.jsx(Sp,{popoverProps:{getPopupContainer:t.getPopupContainer||(()=>i.rootDomRef.current||document.body)},errorType:"popover",name:y,...T,children:b},p),[p,y]),j=d.useCallback(()=>{const b={...ki(n==null?void 0:n.formItemProps,...x)};b.messageVariables={label:(n==null?void 0:n.title)||"此项",type:(n==null?void 0:n.valueType)||"文本",...b==null?void 0:b.messageVariables},b.initialValue=(r?null:a)??(b==null?void 0:b.initialValue)??(n==null?void 0:n.initialValue);let T=s.jsx(wn,{cacheForSwr:!0,name:y,proFormFieldKey:p,ignoreFormItem:!0,fieldProps:ki(n==null?void 0:n.fieldProps,...x),...g},y.join("-"));return n!=null&&n.formItemRender&&(T=n.formItemRender({...n,index:l,isEditable:!0,type:"table"},{defaultRender:()=>s.jsx(s.Fragment,{children:T}),type:"form",recordKey:u,record:{...o,...h==null?void 0:h.getFieldValue([p])},isEditable:!0},h,e.editableUtils),n.ignoreFormItem)?s.jsx(s.Fragment,{children:T}):s.jsx(C,{...b,children:T},y.join("-"))},[n,x,r,a,p,y,g,C,l,u,o,h,e.editableUtils]);return y.length===0?null:typeof(n==null?void 0:n.formItemRender)=="function"||typeof(n==null?void 0:n.fieldProps)=="function"||typeof(n==null?void 0:n.formItemProps)=="function"?s.jsx(c.Form.Item,{noStyle:!0,shouldUpdate:(b,T)=>{if(b===T)return!1;const R=[v].flat(1);try{return JSON.stringify(De(b,R))!==JSON.stringify(De(T,R))}catch{return!0}},children:()=>j()}):j()};function qd(e){var m,g;const{text:t,valueType:n,rowData:r,columnProps:a,index:i}=e;if((!n||["textarea","text"].includes(n.toString()))&&!(a!=null&&a.valueEnum)&&e.mode==="read")return MT.includes(t)?e.columnEmptyText:t;if(typeof n=="function"&&r)return qd({...e,valueType:n(r,e.type)||"text"});const o=(a==null?void 0:a.key)||((m=a==null?void 0:a.dataIndex)==null?void 0:m.toString()),l=a!=null&&a.dependencies?[e.prefixName,e.prefixName?i==null?void 0:i.toString():(g=e.recordKey)==null?void 0:g.toString(),a==null?void 0:a.dependencies].filter(Boolean).flat(1):[],u={valueEnum:xt(a==null?void 0:a.valueEnum,r),request:a==null?void 0:a.request,dependencies:a!=null&&a.dependencies?[l]:void 0,originDependencies:a!=null&&a.dependencies?[a==null?void 0:a.dependencies]:void 0,params:xt(a==null?void 0:a.params,r,a),readonly:a==null?void 0:a.readonly,text:n==="index"||n==="indexBorder"?e.index:t,mode:e.mode,formItemRender:void 0,valueType:n,record:r,proFieldProps:{emptyText:e.columnEmptyText,proFieldKey:o?`table-field-${o}`:void 0}};return e.mode!=="edit"?s.jsx(wn,{mode:"read",ignoreFormItem:!0,fieldProps:ki(a==null?void 0:a.fieldProps,null,a),...u}):s.jsx(kT,{...e,proFieldProps:u},e.recordKey)}const AT=e=>{var r;const{title:t}=e,n=typeof(e==null?void 0:e.ellipsis)=="boolean"?e==null?void 0:e.ellipsis:(r=e==null?void 0:e.ellipsis)==null?void 0:r.showTitle;return t&&typeof t=="function"?t(e,"table",null):s.jsx(lr,{label:t,tooltip:e.tooltip,ellipsis:n})};function OT(e,t,n,r){return typeof r=="boolean"?r===!1:(r==null?void 0:r(e,t,n))===!1}const DT=(e,t,n)=>{const r=Array.isArray(n)?De(t,n):t[n],a=String(r);return String(a)===String(e)};function PT({columnProps:e,text:t,rowData:n,index:r,columnEmptyText:a,counter:i,type:o,subName:l,marginSM:u,editableUtils:m}){const{action:g,prefixName:f}=i,{isEditable:h,recordKey:p}=m.isEditable({...n,index:r}),{renderText:S=j=>j}=e,y=S(t,n,r,g),w=h&&!OT(t,n,r,e==null?void 0:e.editable)?"edit":"read",v=qd({text:y,valueType:e.valueType||"text",index:r,rowData:n,subName:l,columnProps:{...e,entry:n,entity:n},counter:i,columnEmptyText:a,type:o,recordKey:p,mode:w,prefixName:f,editableUtils:m}),x=w==="edit"?v:Ap(v,e,y,t);if(w==="edit")return e.valueType==="option"?s.jsx("div",{style:{display:"flex",alignItems:"center",gap:u,justifyContent:e.align==="center"?"center":"flex-start"},children:m.actionRender({...n,index:e.index||r})}):x;if(!e.render){const j=d.isValidElement(x)||["string","number"].includes(typeof x);return!kt(x)&&j?x:null}const C=e.render(x,n,r,{...g,...m},{...e,isEditable:h,type:"table"});return zv(C)?C:C&&e.valueType==="option"&&Array.isArray(C)?s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:8},children:C}):C}function NT(e){const{onFilter:t,dataIndex:n}=e;return t===!0?(r,a)=>DT(r,a,n):Wu(t)}function LT(e){const{filters:t=[],valueEnum:n}=e;return t===!0?Fd(xt(n,void 0)).filter(r=>r&&r.value!=="all"):t}function _T(e,t,n){return{fixed:((e==null?void 0:e[t])||{fixed:n.fixed}).fixed}}function zT(e,t,n){return{filteredValue:Yv(e,n),sortOrder:Uv(t,n)}}function BT(e,t,n,r,a){var u;if(typeof e!="object"||e===null||!Reflect.has(e,n))return;const i=e,o=i[n],l=a.get(o)||[];return(u=i[r])==null||u.forEach(m=>{const g=m[n];a.has(g)||a.set(g,l.concat([t,r]))}),o}function VT(e,t,n){let r=t.rowKey??"id";return function(i,o,l){typeof t.rowKey=="function"&&(r=t.rowKey(o,l));const u=BT(o,l,r,t.childrenColumnName,n);return PT({columnProps:e,text:i,rowData:o,index:l,columnEmptyText:t.columnEmptyText,counter:t.counter,type:t.type,marginSM:t.marginSM,subName:n.get(u)??[],editableUtils:t.editableUtils})}}function Gd(e){var i;const{columns:t,context:n,parents:r}=e,a=new Map;return(i=t==null?void 0:t.map((o,l)=>{if(o===c.Table.EXPAND_COLUMN||o===c.Table.SELECTION_COLUMN)return o;const{key:u,dataIndex:m,valueEnum:g,valueType:f="text",children:h}=o,p=fr(u||(m==null?void 0:m.toString()),[r==null?void 0:r.key,l].filter(Boolean).join("-"));if(!g&&!f&&!h)return{index:l,...o};const{filteredValue:y,sortOrder:w}=zT(n.proFilter,n.proSort,o),{fixed:v}=_T(n.counter.columnsMap,p,o),x={index:l,key:p,...o,title:AT(o),valueEnum:g,filters:LT(o),onFilter:NT(o),filteredValue:y,sortOrder:w,fixed:v,width:o.width||(o.fixed?200:void 0),children:o.children?Gd({columns:(o==null?void 0:o.children)??[],context:n,parents:{...o,key:p}}):void 0,render:VT(o,n,a)};return Hp(x)}))==null?void 0:i.filter(o=>!o.hideInTable)}function HT({dataSource:e,editableUtils:t,pagination:n,getRowKey:r,childrenColumnName:a}){var f;const i=Array.isArray(e)?[...e]:[],o=t==null?void 0:t.newLineRecord,l=o==null?void 0:o.defaultValue;if(!o||!l)return i;const{options:u}=o,m=a;if(u!=null&&u.parentKey){const h={...l,map_row_parentKey:(f=tt(u.parentKey))==null?void 0:f.toString()},p={data:i,getRowKey:r,row:h,key:(u==null?void 0:u.recordKey)??r(h,-1),childrenColumnName:m};return Ar(p,(u==null?void 0:u.position)==="top"?"top":"update")}if((u==null?void 0:u.position)==="top")return[l,...i];const g=n&&typeof n=="object"?n:void 0;if(g!=null&&g.current&&(g!=null&&g.pageSize)){if(g.pageSize>i.length)return i.push(l),i;const h=g.current*g.pageSize-1;return i.splice(h,0,l),i}return i.push(l),i}function UT({propsCardProps:e,notNeedCardDom:t,name:n,hideToolbar:r,toolbarDom:a}){return e===!1||t||n?{}:r?{padding:0}:a?{paddingBlockStart:0}:{padding:0}}function YT({rowKey:e,name:t}){return d.useMemo(()=>typeof e=="function"?e:(n,r)=>r===-1?n==null?void 0:n[e]:t?r==null?void 0:r.toString():(n==null?void 0:n[e])??(r==null?void 0:r.toString()),[t,e])}function KT({propsPagination:e,action:t,intl:n,request:r,type:a}){return d.useMemo(()=>{const i=e===!1?!1:{...e||{}},o={...t.pageInfo,setPageInfo:({pageSize:l,current:u})=>{const{pageInfo:m}=t;if(l===m.pageSize||m.current===1){t.setPageInfo({pageSize:l,current:u});return}r&&t.setDataSource([]),t.setPageInfo({pageSize:l,current:a==="list"?u:1})}};return r&&i&&(delete i.onChange,delete i.onShowSizeChange),Nv(i,o,n)},[t,n,e,r,a])}function WT({propsRowSelection:e,selectedRowKeys:t,selectedRows:n,onCleanSelected:r,tableAlertOptionRender:a,tableAlertRender:i}){return d.useMemo(()=>e===!1?null:s.jsx(Pv,{selectedRowKeys:t,selectedRows:n,onCleanSelected:r,alertOptionRender:a,alertInfoRender:i,alwaysShowAlert:e==null?void 0:e.alwaysShowAlert}),[r,e,t,n,a,i])}const qT={},GT=e=>{var jn,Yn,os,Kn,Wn,ls;const{cardBordered:t,request:n,className:r,params:a=qT,defaultData:i,headerTitle:o,postData:l,ghost:u,pagination:m,actionRef:g,toolBarRender:f,optionsRender:h,onLoad:p,onRequestError:S,style:y,cardProps:w,tableStyle:v,tableClassName:x,options:C,search:j,name:b,onLoadingChange:T,rowSelection:R=!1,beforeSearchSubmit:F,tableAlertRender:E,defaultClassName:M,formRef:k,type:V="table",columnEmptyText:_="-",toolbar:A,rowKey:I,manualRequest:$,polling:D,tooltip:O,revalidateOnFocus:z=!1,searchFormRender:Z,...L}=e,{wrapSSR:U,hashId:J}=Zv(e.defaultClassName),G=le(M,r,J),H=d.useRef(),B=d.useRef(null),W=d.useRef(),N=k||W;d.useImperativeHandle(g,()=>H.current);const[q,ee]=it(R?(R==null?void 0:R.defaultSelectedRowKeys)||[]:void 0,R?R.selectedRowKeys:void 0),[ne,X]=d.useState(()=>{if(!($||j!==!1))return{}}),ae=d.useRef(ne),oe=we(pe=>{const Ce=typeof pe=="function"?pe(ae.current):pe;ae.current=Ce,X(Ce)}),{columns:ue=[],columnsState:ge}=e,{defaultProFilter:me,defaultProSort:he}=d.useMemo(()=>{const{sort:pe,filter:Ce}=Hv(eo(ue));return{defaultProFilter:Ce,defaultProSort:pe}},[ue]),[Q,se]=d.useState(me),[Se,Fe]=d.useState(he);nr(()=>{se(me),Fe(he)},[me,he]);const ie=ke(),Y=typeof m=="object"?m:{defaultCurrent:1,defaultPageSize:20,pageSize:20,current:1},K=d.useContext(Vn),re=d.useMemo(()=>{if(n)return async pe=>{const Ce={...pe||{},...ae.current||{},...a};return delete Ce._timestamp,await n(Ce,Se,Q)}},[ne,a,Q,Se,n]),fe=ET(re,i,{pageInfo:m===!1?!1:Y,loading:e.loading,dataSource:e.dataSource,onDataSourceChange:e.onDataSourceChange,onLoad:p,onLoadingChange:T,onRequestError:S,postData:l,revalidateOnFocus:z,manual:ne===void 0,polling:D,effects:[pn(a),pn(ne),pn(Q),pn(Se)],debounceTime:e.debounceTime,onPageInfoChange:pe=>{var Ce,P;!m||!re||((Ce=m==null?void 0:m.onChange)==null||Ce.call(m,pe.current,pe.pageSize),(P=m==null?void 0:m.onShowSizeChange)==null||P.call(m,pe.current,pe.pageSize))}});d.useEffect(()=>{var Ce;if(e.manualRequest||!e.request||!z||(Ce=e.form)!=null&&Ce.ignoreRules)return;const pe=()=>{document.visibilityState==="visible"&&fe.reload()};return document.addEventListener("visibilitychange",pe),()=>document.removeEventListener("visibilitychange",pe)},[]);const be=d.useRef(new Map),Ee=YT({rowKey:I,name:e.name});d.useMemo(()=>{var pe;return(pe=fe.dataSource)!=null&&pe.length?fe.dataSource.map(P=>{const te=Ee(P,-1);return be.current.set(te,P),te}):[]},[fe.dataSource,Ee]);const je=KT({propsPagination:m,action:fe,intl:ie,request:n,type:V});nr(()=>{je&&(je.current!==fe.pageInfo.current||je.pageSize!==fe.pageInfo.pageSize)&&fe.setPageInfo({current:je.current,pageSize:je.pageSize})},[je]),nr(()=>{var pe;e.request&&!$C(a)&&fe.dataSource&&!Qa(fe.dataSource,i)&&((pe=fe==null?void 0:fe.pageInfo)==null?void 0:pe.current)!==1&&fe.setPageInfo({current:1})},[a]),K.setPrefixName(e.name),d.useEffect(()=>{(ge==null?void 0:ge.value)!==void 0&&K.setColumnsMap(ge.value)},[ge==null?void 0:ge.value]);const _e=we(()=>{R&&R.onChange&&R.onChange([],[],{type:"none"}),ee([])});K.propsRef.current=e;const ze=UC({...e.editable,tableName:e.name,getRowKey:Ee,childrenColumnName:((jn=e.expandable)==null?void 0:jn.childrenColumnName)||"children",dataSource:fe.dataSource||[],setDataSource:pe=>{var Ce,P;(P=(Ce=e.editable)==null?void 0:Ce.onValuesChange)==null||P.call(Ce,void 0,pe),fe.setDataSource(pe)}}),{token:ve}=yn==null?void 0:yn.useToken();Lv(H,fe,{nativeElement:((Yn=K.rootDomRef)==null?void 0:Yn.current)||void 0,focus:()=>{var pe,Ce;(Ce=(pe=K.rootDomRef)==null?void 0:pe.current)==null||Ce.focus()},fullScreen:()=>{var pe,Ce;!((pe=K.rootDomRef)!=null&&pe.current)||!document.fullscreenEnabled||(document.fullscreenElement?document.exitFullscreen():(Ce=K.rootDomRef)==null||Ce.current.requestFullscreen())},onCleanSelected:()=>{_e()},resetAll:()=>{var P,te,ye,Te,He;_e(),K.setKeyWords(void 0),fe.setPageInfo({current:1}),se(me),Fe(he),(P=N==null?void 0:N.current)==null||P.resetFields();const pe=((ye=(te=N==null?void 0:N.current)==null?void 0:te.getFieldsFormatValue)==null?void 0:ye.call(te,!0))??((He=(Te=N==null?void 0:N.current)==null?void 0:Te.getFieldsValue)==null?void 0:He.call(Te,!0))??{},Ce=F?F(pe):pe;oe(Ce??{})},editableUtils:ze,scrollTo:pe=>{var Ce,P;return(P=(Ce=B==null?void 0:B.current)==null?void 0:Ce.scrollTo)==null?void 0:P.call(Ce,pe)}}),K.setAction(H.current);const Ie=d.useMemo(()=>{var Ce;const pe={counter:K,columnEmptyText:_,type:V,editableUtils:ze,marginSM:ve.marginSM,rowKey:I??"id",childrenColumnName:((Ce=e.expandable)==null?void 0:Ce.childrenColumnName)??"children",proFilter:Q,proSort:Se};return Gd({columns:ue,context:pe}).sort(IT(K.columnsMap??{}))},[ue,K==null?void 0:K.sortKeyColumns,K==null?void 0:K.columnsMap,_,V,ze.editableKeys&&ze.editableKeys.join(","),Q,Se]);Yu(()=>{if(Ie&&Ie.length>0){const pe=Ie.map(Ce=>fr(Ce.key,Ce.index));K.setSortKeyColumns(pe)}},[Ie],["render","formItemRender"],100),nr(()=>{const{pageInfo:pe}=fe,{current:Ce=pe==null?void 0:pe.current,pageSize:P=pe==null?void 0:pe.pageSize}=m||{};m&&(Ce||P)&&(P!==(pe==null?void 0:pe.pageSize)||Ce!==(pe==null?void 0:pe.current))&&fe.setPageInfo({pageSize:P||pe.pageSize,current:Ce||pe.current})},[m&&m.pageSize,m&&m.current]);const Oe={selectedRowKeys:q,...R,onChange:(pe,Ce,P)=>{R&&R.onChange&&R.onChange(pe,Ce,P),ee(pe)}},ct=j!==!1&&(j==null?void 0:j.filterType)==="light",rt=we(pe=>{var Ce,P;if(C&&C.search){const{name:te="keyword"}=C.search===!0?{}:C.search;if(((P=(Ce=C.search)==null?void 0:Ce.onSearch)==null?void 0:P.call(Ce,K.keyWords))!==!1){oe({...pe,[te]:K.keyWords});return}}oe(pe)}),Ne=d.useMemo(()=>{var pe;return typeof fe.loading=="object"?((pe=fe.loading)==null?void 0:pe.spinning)||!1:fe.loading},[fe.loading]),ot=s.jsx(aT,{search:j,type:V,pagination:je,beforeSearchSubmit:F,actionRef:H,columns:ue,onFormSearchSubmit:rt,ghost:u,onReset:e.onReset,onSubmit:e.onSubmit,loading:!!Ne,manualRequest:$,form:e.form,formRef:N,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,searchFormRender:Z,proTableProps:e}),Lt=d.useMemo(()=>q==null?void 0:q.map(pe=>{var Ce;return(Ce=be.current)==null?void 0:Ce.get(pe)}),[fe.dataSource,q]),Hn=d.useMemo(()=>C===!1&&!o&&!f&&!A&&!ct,[C,o,f,A,ct]),_t=s.jsx(FT,{toolBarRender:f,headerTitle:o,hideToolbar:Hn,selectedRows:Lt,selectedRowKeys:q,tableColumn:Ie,tooltip:O,toolbar:A,isLightFilter:ct,searchNode:ot,options:C,optionsRender:h,actionRef:H,setFormSearch:oe,formSearch:ne}),Cr=WT({propsRowSelection:R,selectedRowKeys:q,selectedRows:Lt,onCleanSelected:_e,tableAlertOptionRender:L.tableAlertOptionRender,tableAlertRender:E}),va=d.useMemo(()=>{var pe;return HT({dataSource:fe.dataSource,editableUtils:ze,pagination:je,getRowKey:Ee,childrenColumnName:((pe=e.expandable)==null?void 0:pe.childrenColumnName)||"children"})},[fe.dataSource,ze==null?void 0:ze.newLineRecord,Ee,je,(os=e.expandable)==null?void 0:os.childrenColumnName]),wr=d.useMemo(()=>{const pe=Ce=>Ce.map(P=>{var Te;const te=fr(P.key,P.index),ye=(Te=K.columnsMap)==null?void 0:Te[te];return ye&&ye.show===!1?!1:P.children?{...P,children:pe(P.children)}:P}).filter(Boolean);return pe(Ie)},[K.columnsMap,Ie]),rs=d.useMemo(()=>eo(wr).filter(Ce=>!!Ce.filters),[wr]),Ta=pe=>{Qa(pe,Se)||Fe(pe??{})},Fa=pe=>{Qa(pe,Q)||se(pe??{})},an=()=>({...L,size:K.tableSize,rowSelection:R===!1?void 0:Oe,className:x,style:v,columns:wr,loading:fe.loading,dataSource:va,pagination:je,onChange:(pe,Ce,P,te)=>{var He;(He=L.onChange)==null||He.call(L,pe,Ce,P,te);const ye=Bv(Ce,rs);Fa(ht(ye));const Te=Vv(P);Ta(ht(Te))}}),Un=j===!1&&!o&&!f,ss=s.jsx(To.Provider,{value:{grid:!1,colProps:void 0,rowProps:void 0},children:s.jsx(c.Table,{...an(),rowKey:I,ref:B})}),jr=e.tableViewRender?e.tableViewRender({...an(),rowSelection:R!==!1?Oe:void 0},ss):ss,as=e.editable&&!b?s.jsxs(s.Fragment,{children:[_t,Cr,d.createElement(bt,{...e.editable.formProps,formRef:(Kn=e.editable.formProps)==null?void 0:Kn.formRef,component:!1,form:e.editable.form,onValuesChange:ze.onValuesChange,key:"table",submitter:!1,omitNil:!1,dateFormatter:e.dateFormatter},jr)]}):s.jsxs(s.Fragment,{children:[_t,Cr,jr]}),Ra=UT({propsCardProps:w,notNeedCardDom:Un,name:e.name,hideToolbar:Hn,toolbarDom:_t}),Ve=d.useMemo(()=>w!==!1&&!e.name&&!Un||w!==!1&&V==="list",[w,e.name,V,Un]),vr=w===!1?{}:w??{},is=Ve?s.jsx(Sa,{...vr,ghost:u,variant:Kd("table",t)?"outlined":"borderless",styles:{body:{...Ra,...((Wn=vr.styles)==null?void 0:Wn.body)??{}},header:(ls=vr.styles)==null?void 0:ls.header},children:as}):as,$a=()=>e.tableRender?e.tableRender(e,is,{toolbar:_t||void 0,alert:Cr||void 0,table:jr||void 0}):is,Tr=s.jsxs("div",{className:le(G,{[`${M}-polling`]:fe.pollingLoading}),style:y,ref:K.rootDomRef,"data-testid":"pro-table",children:[ct?null:ot,V!=="form"&&e.tableExtraRender&&s.jsx("div",{className:le(G,`${M}-extra`),children:e.tableExtraRender(e,fe.dataSource||[])}),V!=="form"&&$a()]});return!C||!(C!=null&&C.fullScreen)?U(Tr):U(s.jsx(c.ConfigProvider,{getPopupContainer:()=>K.rootDomRef.current||document.body,children:Tr}))},Sr=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=e.ErrorBoundary===!1?d.Fragment:e.ErrorBoundary||up,r=d.useContext(Wt);return s.jsx(Wv,{initValue:{...e,columnsState:e.columnsState,columns:e.columns,onSizeChange:e.onSizeChange,size:e.size||void 0,defaultSize:e.defaultSize||void 0},children:s.jsx(Dn,{valueTypeMap:{...r.valueTypeMap,...Ed},needDeps:!0,children:s.jsx(n,{children:s.jsx(GT,{defaultClassName:`${t("pro-table")}`,...e})})})})};Sr.Summary=c.Table.Summary;let ZT="/api";function Vt(){return nn.createRequest({baseURL:ZT,timeout:15e3})}const Rn={create:e=>Vt().post("/ctc/ac/accounts",e),getById:e=>Vt().get("/ctc/ac/accounts",{params:{id:e}}),listByTenant:e=>Vt().get("/ctc/ac/accounts",{params:e}),updateStatus:(e,t)=>Vt().post("/ctc/ac/accounts/status",null,{params:{id:e,status:t}}),changePassword:(e,t)=>Vt().post("/ctc/ac/accounts/password/change",t,{params:{id:e}}),resetPassword:(e,t)=>Vt().post("/ctc/ac/accounts/password/reset",t,{params:{id:e}}),update:(e,t)=>Vt().put("/ctc/ac/accounts",t,{params:{id:e}}),delete:e=>Vt().delete("/ctc/ac/accounts",{params:{id:e}}),assignRole:(e,t)=>Vt().post("/ctc/ac/accounts/assign-role",null,{params:{userId:e,roleId:t}})},JT={list:e=>Vt().post("/ctc/ac/login-log/list",e)};let XT="/api";function st(){return nn.createRequest({baseURL:XT,timeout:15e3})}const qe={listResourcesByApp:e=>st().get("/ctc/authz/resources/page-by-app",{params:e}),listAllResources:()=>st().get("/ctc/authz/resources/list"),pageResources:e=>st().get("/ctc/authz/resources/page",{params:e}),distinctApps:()=>st().get("/ctc/authz/resources/distinct-apps"),getResource:e=>st().get("/ctc/authz/resources",{params:{id:e}}),createResource:e=>st().post("/ctc/authz/resources",e),updateResource:(e,t)=>st().put("/ctc/authz/resources",t,{params:{id:e}}),deleteResource:e=>st().delete("/ctc/authz/resources",{params:{id:e}}),listResourceRoles:e=>st().get("/ctc/authz/resources/roles",{params:{resourceId:e}}),grantRoleResource:(e,t,n)=>{const r=n==null?{}:{dataFilter:n};return st().post("/ctc/authz/roles/grant-resource",r,{params:{roleId:e,resourceId:t}})},revokeRoleResource:(e,t)=>st().delete("/ctc/authz/roles/revoke-resource",{params:{roleId:e,resourceId:t}}),listAllRoles:()=>st().get("/ctc/authz/roles/list"),pageRoles:e=>st().get("/ctc/authz/roles/page",{params:e}),getRole:e=>st().get("/ctc/authz/roles",{params:{id:e}}),createRole:e=>st().post("/ctc/authz/roles",e),updateRole:(e,t)=>st().put("/ctc/authz/roles",t,{params:{id:e}}),deleteRole:e=>st().delete("/ctc/authz/roles",{params:{id:e}}),listUserRoles:e=>st().get("/ctc/authz/users/roles",{params:{userId:e}}),listUserPermissions:e=>st().get("/ctc/authz/users/permissions",{params:{userId:e}}),grantUserRole:(e,t,n)=>{const r={userId:e,roleId:t};return n&&(r.expireAt=n),st().post("/ctc/authz/users/grant-role",null,{params:r})},revokeUserRole:(e,t)=>st().delete("/ctc/authz/users/revoke-role",{params:{userId:e,roleId:t}}),listRolePermissions:e=>st().get("/ctc/authz/roles/resources",{params:{roleId:e}}),check:e=>st().post("/ctc/authz/check",e)},sr={listAccounts:e=>Rn.listByTenant(e),listUserRoles:e=>qe.listUserRoles(e),listUserPermissions:e=>qe.listUserPermissions(e),listRoleResources:e=>qe.listRolePermissions(e)},{Text:QT}=c.Typography,Ms={0:{text:"禁用",color:"default"},1:{text:"正常",color:"success"},2:{text:"锁定",color:"warning"}},ks={1:{text:"超级管理员",color:"red"},2:{text:"租户管理员",color:"volcano"},3:{text:"普通成员",color:"blue"},4:{text:"临时账号",color:"orange"}},eF={1:{text:"用户名",color:"blue"},2:{text:"邮箱",color:"purple"},3:{text:"手机",color:"cyan"}};function Xn({value:e}){const t=e==null||e===""?"-":String(e);return t==="-"?s.jsx("span",{children:"-"}):s.jsx(c.Tooltip,{title:t,placement:"topLeft",children:s.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})})}function tF({apiBaseURL:e}){var ue,ge,me,he;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),[w]=c.Form.useForm(),[v,x]=d.useState(!1),[C,j]=d.useState(null),[b,T]=d.useState("info"),[R,F]=d.useState([]),[E,M]=d.useState(!1),[k,V]=d.useState([]),[_,A]=d.useState([]),[I,$]=d.useState(!1),[D,O]=d.useState(!1),z=async Q=>{if(!Q){F([]);return}M(!0);try{const se=await JT.list({accountId:Number(Q),pageSize:50});F((se==null?void 0:se.records)||[])}catch{F([])}finally{M(!1)}},Z=async Q=>{if(!Q){V([]),A([]);return}$(!0),O(!0);try{const[se,Se]=await Promise.all([sr.listUserRoles(Q),sr.listUserPermissions(Q)]);V(Array.isArray(se)?se:[]),A(Array.isArray(Se)?Se:[])}catch{V([]),A([])}finally{$(!1),O(!1)}},L=Q=>{j(Q),T("info"),x(!0),z(Q.id)},U=()=>{x(!1),j(null),F([]),V([]),A([])},J=Q=>{T(Q),Q==="logs"&&(C!=null&&C.id)&&z(C.id),Q==="roles"&&(C!=null&&C.id)&&Z(C.id)},G=d.useCallback(()=>{var Se;const Q=n.getFieldsValue(),se={};Q.username&&(se.username=Q.username),Q.status!==void 0&&(se.status=Q.status),Q.dateRange&&(se.startDate=Q.dateRange[0].format("YYYY-MM-DD"),se.endDate=Q.dateRange[1].format("YYYY-MM-DD")),a(se),(Se=t.current)==null||Se.reload()},[n]),H=d.useCallback(()=>{var Q;n.resetFields(),a({}),(Q=t.current)==null||Q.reload()},[n]),B=async Q=>{try{let Se=await Rn.listByTenant({tenant:r.tenant,pageNum:Q.current,pageSize:Q.pageSize})||[];const Fe=r.username,ie=r.status,Y=r.startDate,K=r.endDate;return Se=Se.filter(re=>{var fe;return!(Fe&&!((fe=re.username)!=null&&fe.includes(Fe))||ie!==void 0&&re.status!==ie||Y&&re.createdAt&&Re(re.createdAt).isBefore(Y,"day")||K&&re.createdAt&&Re(re.createdAt).isAfter(K,"day"))}),{data:Se,success:!0,total:Se.length}}catch(se){return c.message.error("获取账号列表失败:"+((se==null?void 0:se.message)||"未知错误")),{data:[],success:!1,total:0}}},W=async()=>{var Q;try{const se=await y.validateFields();await Rn.create(se),c.message.success("创建成功"),g(!1),y.resetFields(),(Q=t.current)==null||Q.reload()}catch(se){if(se!=null&&se.errorFields)return;c.message.error("创建失败:"+((se==null?void 0:se.message)||"未知错误"))}},N=async(Q,se)=>{var Fe;const Se=se===1?0:1;try{await Rn.updateStatus(Q,Se),c.message.success(Se===1?"已启用":"已停用"),(Fe=t.current)==null||Fe.reload()}catch(ie){c.message.error("操作失败:"+((ie==null?void 0:ie.message)||"未知错误"))}},q=async()=>{var Q;try{await Promise.all(l.map(se=>Rn.updateStatus(se.id,0))),c.message.success(`已停用 ${l.length} 个账号`),o([]),u([]),(Q=t.current)==null||Q.reload()}catch(se){c.message.error("批量操作失败:"+((se==null?void 0:se.message)||"未知错误"))}},ee=()=>{const Q=`ID,账号,昵称,类型,邮箱,手机,租户,状态,创建时间
56
+ `,se=l.length>0?l:[];if(se.length===0){c.message.warning("请先选择要导出的数据,或取消选择导出全部");return}const Se=Q+se.map(K=>[K.id,K.username,K.nickname,(ks[K.accountType??3]||{text:String(K.accountType)}).text,K.email,K.phone,K.tenantCode,(Ms[K.status??1]||{text:String(K.status)}).text,K.createdAt].join(",")).join(`
57
+ `),Fe=new Blob(["\uFEFF"+Se],{type:"text/csv;charset=utf-8"}),ie=URL.createObjectURL(Fe),Y=document.createElement("a");Y.href=ie,Y.download=`accounts_${Re().format("YYYYMMDD_HHmmss")}.csv`,Y.click(),URL.revokeObjectURL(ie),c.message.success(`已导出 ${se.length} 条数据`)},ne=Q=>{S(Q),w.resetFields(),h(!0)},X=async()=>{if(p!=null&&p.id)try{const Q=await w.validateFields();await Rn.resetPassword(p.id,{newPassword:Q.newPassword}),c.message.success(`已重置账号 ${p.username} 的密码`),h(!1),w.resetFields()}catch(Q){if(Q!=null&&Q.errorFields)return;c.message.error("重置失败:"+((Q==null?void 0:Q.message)||"未知错误"))}},ae=[{title:"登录标识",dataIndex:"identifier",width:140},{title:"登录方式",dataIndex:"identityType",width:90,render:(Q,se)=>{const Se=eF[se.identityType]||{text:`${se.identityType}`,color:"default"};return s.jsx(c.Tag,{color:Se.color,children:Se.text})}},{title:"结果",dataIndex:"loginStatus",width:80,render:(Q,se)=>s.jsx(c.Tag,{color:se.loginStatus===1?"success":"error",children:se.loginStatus===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0},{title:"客户端IP",dataIndex:"clientIp",width:120},{title:"登录时间",dataIndex:"loginTime",width:170,render:Q=>Q?Re(Q).format("YYYY-MM-DD HH:mm:ss"):"-"}],oe=[{title:"账号",dataIndex:"username",width:200,fixed:"left",ellipsis:{showTitle:!1},search:!1,render:(Q,se)=>s.jsx(Xn,{value:se.username})},{title:"昵称",dataIndex:"nickname",width:120,ellipsis:{showTitle:!1},search:!1,render:(Q,se)=>s.jsx(Xn,{value:se.nickname})},{title:"类型",dataIndex:"accountType",width:104,search:!1,render:(Q,se)=>{const Se=ks[se.accountType??3]||{text:String(se.accountType??"未知"),color:"default"};return s.jsx(c.Tag,{color:Se.color,children:Se.text})}},{title:"邮箱",dataIndex:"email",width:150,ellipsis:{showTitle:!1},search:!1,render:(Q,se)=>s.jsx(Xn,{value:se.email})},{title:"手机",dataIndex:"phone",width:126,ellipsis:{showTitle:!1},search:!1,render:(Q,se)=>s.jsx(Xn,{value:se.phone})},{title:"租户",dataIndex:"tenantCode",width:92,ellipsis:{showTitle:!1},search:!1,render:(Q,se)=>s.jsx(Xn,{value:se.tenantCode})},{title:"状态",dataIndex:"status",width:84,search:!1,render:(Q,se)=>{const Se=Ms[se.status??1]||{text:String(se.status??"未知"),color:"default"};return s.jsx(c.Tag,{color:Se.color,children:Se.text})}},{title:"创建时间",dataIndex:"createdAt",width:160,search:!1,ellipsis:{showTitle:!1},render:(Q,se)=>s.jsx(Xn,{value:se.createdAt?Re(se.createdAt).format("YYYY-MM-DD HH:mm:ss"):null})},{title:"操作",valueType:"option",width:150,fixed:"right",search:!1,render:(Q,se)=>[s.jsx(c.Button,{type:"link",size:"small",danger:se.status===1,onClick:()=>N(se.id,se.status??1),children:se.status===1?"停用":"启用"},"status"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>ne(se),children:"重置密码"},"reset"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>L(se),children:"详情"},"detail")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",children:[s.jsx(c.Form.Item,{name:"username",label:"用户名",children:s.jsx(Ft.SearchInput,{placeholder:"请输入用户名",onChange:Q=>n.setFieldValue("username",Q)})}),s.jsx(c.Form.Item,{name:"status",label:"状态",children:s.jsx(c.Select,{placeholder:"全部",allowClear:!0,style:{width:120},options:[{value:1,label:"正常"},{value:0,label:"禁用"},{value:2,label:"锁定"}]})}),s.jsx(c.Form.Item,{name:"dateRange",label:"创建时间",children:s.jsx(c.DatePicker.RangePicker,{style:{width:240}})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:G,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:H,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>g(!0),children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(de.DeleteOutlined,{}),disabled:i.length===0,onClick:q,children:"批量停用"}),s.jsx(c.Button,{icon:s.jsx(de.DownloadOutlined,{}),onClick:ee,children:"导出"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var Q;return(Q=t.current)==null?void 0:Q.reload()},children:"刷新"})]})]})}),s.jsx(Sr,{actionRef:t,rowKey:"id",columns:oe,request:B,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:Q=>`共 ${Q} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(Q,se)=>{o(Q),u(se)}},tableAlertRender:({selectedRowKeys:Q})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:Q.length})," 项"]})}),s.jsx(c.Modal,{title:"新建账号",open:m,onOk:W,onCancel:()=>g(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"username",label:"用户名",rules:[{required:!0,min:3,max:32}],children:s.jsx(c.Input,{placeholder:"3-32 位字母数字下划线"})}),s.jsx(c.Form.Item,{name:"password",label:"初始密码",rules:[{required:!0,min:8}],children:s.jsx(c.Input.Password,{placeholder:"至少 8 位"})}),s.jsx(c.Form.Item,{name:"nickname",label:"昵称",children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"email",label:"邮箱",rules:[{type:"email"}],children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"phone",label:"手机号",children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"accountType",label:"账号类型",initialValue:3,children:s.jsx(c.Select,{options:[{value:1,label:"超级管理员"},{value:2,label:"租户管理员"},{value:3,label:"普通成员"},{value:4,label:"临时账号"}]})}),s.jsx(c.Form.Item,{name:"tenantCode",label:"租户编码",children:s.jsx(c.Input,{placeholder:"如 default / tenant1"})})]})}),s.jsx(c.Modal,{title:p?`重置密码 — ${p.username}`:"重置密码",open:f,onOk:X,onCancel:()=>h(!1),size:"large",okText:"确认重置",okButtonProps:{danger:!0},destroyOnHidden:!0,children:s.jsx(c.Form,{form:w,layout:"vertical",style:{marginTop:16},children:s.jsx(c.Form.Item,{name:"newPassword",label:"新密码",rules:[{required:!0,min:8,message:"至少 8 位"}],extra:"重置后建议通知账号持有人当面修改",children:s.jsx(c.Input.Password,{placeholder:"至少 8 位"})})})}),s.jsx(c.Drawer,{title:C?`账号详情 — ${C.username}`:"账号详情",open:v,onClose:U,width:"min(1120px, 94vw)",destroyOnHidden:!0,children:C&&s.jsx(c.Tabs,{activeKey:b,onChange:J,tabBarExtraContent:b==="logs"?s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>C.id&&z(C.id),children:"刷新日志"}):null,items:[{key:"info",label:"基本信息",children:s.jsxs(c.Descriptions,{title:"账号信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"账号ID",children:C.id}),s.jsx(c.Descriptions.Item,{label:"用户名",children:C.username}),s.jsx(c.Descriptions.Item,{label:"昵称",children:C.nickname||"-"}),s.jsx(c.Descriptions.Item,{label:"账号类型",children:s.jsx(c.Tag,{color:(ue=ks[C.accountType??3])==null?void 0:ue.color,children:((ge=ks[C.accountType??3])==null?void 0:ge.text)||C.accountType})}),s.jsx(c.Descriptions.Item,{label:"邮箱",children:C.email||"-"}),s.jsx(c.Descriptions.Item,{label:"手机",children:C.phone||"-"}),s.jsx(c.Descriptions.Item,{label:"租户",children:C.tenantCode||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(me=Ms[C.status??1])==null?void 0:me.color,children:(he=Ms[C.status??1])==null?void 0:he.text})}),s.jsx(c.Descriptions.Item,{label:"到期时间",children:C.expireAt?Re(C.expireAt).format("YYYY-MM-DD HH:mm:ss"):"永久"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:C.createdAt?Re(C.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",span:2,children:C.updatedAt?Re(C.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]})},{key:"roles",label:`角色与权限${k.length?`(${k.length})`:""}`,children:s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[s.jsx(c.Card,{size:"small",style:{flex:"0 0 340px"},title:`角色(${k.length})`,loading:I,children:k.length?s.jsx(c.List,{size:"small",dataSource:k,rowKey:Q=>Q.id,renderItem:Q=>s.jsx(c.List.Item,{children:s.jsx(c.List.Item.Meta,{title:s.jsxs(c.Space,{children:[s.jsx(QT,{strong:!0,children:Q.roleName||Q.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:Q.roleCode})]}),description:Q.description||"-"})})}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该账号暂无角色"})}),s.jsx(Ft.ListTable,{cardTitle:`直接权限(${_.length})`,rows:_,rowKey:(Q,se)=>Q.code||Q.resourceCode||Q.id||se,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该账号暂无直接权限",loading:D,columns:[{title:"资源编码",dataIndex:"code",width:220,render:(Q,se)=>s.jsx("span",{style:{fontFamily:"monospace"},children:se.code||se.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(Q,se)=>se.name||se.resourceName||"-"}]})]})},{key:"logs",label:`登录日志(${R.length})`,children:s.jsx(Ft.ListTable,{rows:R,columns:ae,rowKey:"id",loading:E,searchKeys:["identifier","clientIp"],searchPlaceholder:"按登录标识 / 客户端 IP 过滤",emptyTitle:"暂无登录记录"})}]})})]})}let nF="/api";function Ir(){return nn.createRequest({baseURL:nF,timeout:15e3})}const Dr={listApplications:e=>Ir().get("/meta-app/list",{params:e}),getApplication:e=>Ir().get("/meta-app/get",{params:{id:e}}),create:e=>Ir().post("/meta-app",e),update:(e,t)=>Ir().put("/meta-app",t,{params:{id:e}}),delete:e=>Ir().delete("/meta-app",{params:{id:e}})},rF={API:1,MENU:2,BUTTON:3,DATA:4},Mr={API:{text:"API",color:"orange",int:1},MENU:{text:"菜单",color:"blue",int:2},BUTTON:{text:"按钮",color:"green",int:3},DATA:{text:"数据",color:"purple",int:4}},sF={GET:"green",POST:"blue",PUT:"orange",DELETE:"red",PATCH:"purple"},li={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function aF({apiBaseURL:e}){var J,G;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState(!1),[l]=c.Form.useForm(),[u,m]=d.useState(null),[g,f]=d.useState(!1),[h,p]=d.useState([]),[S,y]=d.useState(""),[w,v]=d.useState(!1),[x]=c.Form.useForm(),[C,j]=d.useState("API"),b=d.useCallback(async H=>{try{const B=await qe.listResourcesByApp({appCode:H,pageNum:1,pageSize:1e3});p(B.data||[])}catch(B){c.message.error("拉取资源失败:"+((B==null?void 0:B.message)||"未知错误")),p([])}},[]),T=H=>{m(H),f(!0),H.appCode&&b(H.appCode)},R=d.useCallback(()=>{var W;const H=n.getFieldsValue(),B={};H.appCode&&(B.appCode=H.appCode),H.appName&&(B.appName=H.appName),a(B),(W=t.current)==null||W.reload()},[n]),F=d.useCallback(()=>{var H;n.resetFields(),a({}),(H=t.current)==null||H.reload()},[n]),E=async H=>{try{const B=(H==null?void 0:H.current)||1,W=(H==null?void 0:H.pageSize)||20,N=await Dr.listApplications({appCode:r.appCode,appName:r.appName,pageNum:B,pageSize:W});return{data:N.records||[],success:!0,total:N.total||0}}catch(B){return c.message.error("获取应用列表失败:"+((B==null?void 0:B.message)||"未知错误")),{data:[],success:!1,total:0}}},M=async()=>{var H;try{const B=await l.validateFields();await Dr.create({appCode:B.appCode,appName:B.appName,appType:B.appType||"web",description:B.description,status:1}),c.message.success("应用创建成功"),o(!1),l.resetFields(),(H=t.current)==null||H.reload()}catch(B){if(B!=null&&B.errorFields)return;c.message.error("创建失败:"+((B==null?void 0:B.message)||"未知错误"))}},k=async H=>{var B;try{if(H.id==null){c.message.error("应用 ID 缺失");return}await Dr.delete(H.id),c.message.success(`已删除应用 ${H.appCode}`),(u==null?void 0:u.id)===H.id&&(m(null),p([])),(B=t.current)==null||B.reload()}catch(W){c.message.error("删除失败:"+((W==null?void 0:W.message)||"未知错误"))}},V=async H=>{var B;try{if(H.id==null){c.message.error("应用 ID 缺失");return}const W=H.status===1?0:1;await Dr.update(H.id,{status:W}),c.message.success(W===1?"已启用":"已停用"),(u==null?void 0:u.id)===H.id&&m({...H,status:W}),(B=t.current)==null||B.reload()}catch(W){c.message.error("切换状态失败:"+((W==null?void 0:W.message)||"未知错误"))}},_=async()=>{if(u)try{const H=await x.validateFields(),B={resourceCode:H.resourceCode,resourceName:H.resourceName,resourceType:rF[C],appCode:u.appCode,path:H.path,method:H.method,description:H.description,status:1};await qe.createResource(B),c.message.success("资源创建成功"),v(!1),x.resetFields(),b(u.appCode)}catch(H){if(H!=null&&H.errorFields)return;c.message.error("创建失败:"+((H==null?void 0:H.message)||"未知错误"))}},A=async H=>{if(H.id==null){c.message.error("资源 ID 缺失");return}try{await qe.deleteResource(H.id),c.message.success("资源已删除"),u!=null&&u.appCode&&b(u.appCode)}catch(B){c.message.error("删除失败:"+((B==null?void 0:B.message)||"未知错误"))}},I=H=>{j(H),x.resetFields(),v(!0)},$=[{title:"应用",dataIndex:"appName",width:180,search:!1,render:(H,B)=>{const W=li[B.status??1]||{text:String(B.status??"未知"),color:"default"},N=(u==null?void 0:u.id)===B.id;return s.jsxs("div",{style:{padding:"4px 0",borderLeft:N?"3px solid #1677ff":"3px solid transparent",paddingLeft:8},children:[s.jsx("div",{style:{fontWeight:500},children:B.appName}),s.jsxs("div",{style:{fontSize:12,color:"#999",marginTop:2},children:[s.jsx(c.Tag,{color:W.color,style:{marginRight:4,marginInlineEnd:4},children:W.text}),s.jsx("code",{style:{fontSize:11},children:B.appCode})]})]})}},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(H,B)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>T(B),children:"编辑"},"edit"),s.jsx(c.Button,{type:"link",size:"small",danger:B.status===1,onClick:()=>V(B),children:B.status===1?"停用":"启用"},"toggle"),s.jsx(c.Popconfirm,{title:`确认删除应用 ${B.appName}?`,description:"该应用下的所有资源会一并删除",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>k(B),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})},"del")]}],D=[{title:"资源编码",dataIndex:"resourceCode",width:180,ellipsis:!0},{title:"资源名称",dataIndex:"resourceName",width:140,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(H,B)=>B.method?s.jsx(c.Tag,{color:sF[B.method],children:B.method}):"-"},{title:"URL / Path",dataIndex:"path",ellipsis:!0},{title:"描述",dataIndex:"description",width:200,ellipsis:!0},{title:"操作",width:80,fixed:"right",render:(H,B)=>s.jsx(c.Popconfirm,{title:"确认删除该资源?",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>A(B),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})}],O=h.filter(H=>(H.resourceType??1)===1),z=h.filter(H=>H.resourceType===2),Z=h.filter(H=>H.resourceType===3),L=h.filter(H=>H.resourceType===4),U=(H,B)=>{const W=S.trim().toLowerCase(),N=W?H.filter(q=>`${q.resourceCode||""} ${q.resourceName||""} ${q.path||""}`.toLowerCase().includes(W)):H;return s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("span",{style:{color:"#666"},children:["共 ",s.jsx("b",{children:H.length})," 条 ",Mr[B].text," 资源"]}),s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按资源编码 / 名称过滤",style:{width:220},onChange:q=>y(q.target.value)}),s.jsxs(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>I(B),children:["新建",Mr[B].text]})]})]}),H.length>0?s.jsx(c.Table,{rowKey:"id",columns:D,dataSource:N,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:q=>`共 ${q} 条`},size:"small",scroll:{x:800},locale:{emptyText:s.jsx(Ft.EmptyState,{title:`没有匹配的 ${Mr[B].text} 资源`,description:"换个关键字再试一次",size:"sm"})}}):s.jsx(Ft.EmptyState,{title:`该应用暂无 ${Mr[B].text} 资源`,description:"点击上方按钮新增",size:"sm"})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",size:"small",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用编码",style:{marginBottom:8},children:s.jsx(c.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(c.Form.Item,{name:"appName",label:"应用名称",style:{marginBottom:8},children:s.jsx(c.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(c.Form.Item,{style:{marginBottom:8},children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:R,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:F,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>o(!0),children:"新增应用"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var H;(H=t.current)==null||H.reload(),u!=null&&u.appCode&&b(u.appCode)},children:"刷新"})]})]})}),s.jsx(Sr,{actionRef:t,rowKey:"id",columns:$,request:E,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:H=>`共 ${H} 条`},onRow:H=>({onClick:()=>T(H),style:{cursor:"pointer"}})}),s.jsx(c.Drawer,{title:u?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600},children:u.appName}),s.jsx(c.Tag,{color:((J=li[u.status??1])==null?void 0:J.color)||"default",children:((G=li[u.status??1])==null?void 0:G.text)||"未知"}),s.jsx("code",{style:{fontSize:12,color:"#666"},children:u.appCode})]}):"应用详情",open:g,onClose:()=>f(!1),width:"80vw",destroyOnHidden:!0,extra:u?s.jsxs(c.Space,{children:[s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>b(u.appCode),children:"刷新资源"}),s.jsx(c.Button,{icon:s.jsx(de.EditOutlined,{}),onClick:()=>o(!0),children:"编辑应用"}),s.jsx(c.Button,{danger:u.status===1,icon:s.jsx(de.StopOutlined,{}),onClick:()=>V(u),children:u.status===1?"停用":"启用"})]}):null,children:u&&s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:16,paddingBottom:12,borderBottom:"1px solid #f0f0f0",fontSize:13,color:"#666",display:"flex",gap:16},children:[u.gmtCreate&&s.jsxs("span",{children:["创建:",Re(u.gmtCreate).format("YYYY-MM-DD HH:mm:ss")]}),u.description&&s.jsxs("span",{children:["描述:",u.description]})]}),s.jsx(c.Tabs,{defaultActiveKey:"API",items:[{key:"API",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"orange",children:"API"})," API 资产 (",O.length,")"]}),children:U(O,"API")},{key:"MENU",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"blue",children:"菜单"})," 菜单 (",z.length,")"]}),children:U(z,"MENU")},{key:"BUTTON",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"green",children:"按钮"})," 按钮 (",Z.length,")"]}),children:U(Z,"BUTTON")},{key:"DATA",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"purple",children:"数据"})," 数据 (",L.length,")"]}),children:U(L,"DATA")}]})]})}),s.jsx(c.Modal,{title:"新建应用",open:i,onOk:M,onCancel:()=>o(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:l,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用编码",rules:[{required:!0},{pattern:/^[a-z][a-z0-9_-]*$/,message:"小写字母开头,仅允许小写字母/数字/下划线/短横"}],extra:"唯一标识,如 z-ctc / z-task",children:s.jsx(c.Input,{placeholder:"如 z-opc"})}),s.jsx(c.Form.Item,{name:"appName",label:"应用名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 统一管理平台"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})})]})}),s.jsx(c.Modal,{title:`新建资源 — ${(u==null?void 0:u.appCode)||""} (${Mr[C].text})`,open:w,onOk:_,onCancel:()=>v(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:x,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0}],extra:"唯一标识,如 user:read / menu:dashboard",children:s.jsx(c.Input,{placeholder:"如 user:read"})}),s.jsx(c.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 查看用户"})}),C==="API"&&s.jsxs(s.Fragment,{children:[s.jsx(c.Form.Item,{name:"method",label:"HTTP 方法",children:s.jsx(c.Select,{allowClear:!0,placeholder:"选择 HTTP 方法",options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}]})}),s.jsx(c.Form.Item,{name:"path",label:"URL Pattern",children:s.jsx(c.Input,{placeholder:"如 /api/users/*"})})]}),C==="MENU"&&s.jsx(c.Form.Item,{name:"path",label:"菜单路径",children:s.jsx(c.Input,{placeholder:"如 /ctc/dashboard"})}),C==="BUTTON"&&s.jsx(c.Form.Item,{name:"resourceCode",label:"按钮权限编码",extra:"如 btn:user:create",children:s.jsx(c.Input,{placeholder:"如 btn:user:create"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})})]})})]})}const to={0:{text:"功能",color:"geekblue"},1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}},iF=[{value:"",label:"任意"},{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}],oF=[{key:"roles",label:"角色",icon:s.jsx(de.TeamOutlined,{})},{key:"points",label:"权限点",icon:s.jsx(de.AuditOutlined,{})},{key:"tree",label:"权限树",icon:s.jsx(de.ApartmentOutlined,{})},{key:"auth",label:"授权",icon:s.jsx(de.SolutionOutlined,{})}];function Gs(e){const t=to[e]||{text:String(e??"?"),color:"default"};return s.jsx(c.Tag,{color:t.color,style:{margin:0,fontSize:11},children:t.text})}function Hc(e,{search:t=""}={}){const n=t.trim().toLowerCase(),r=u=>!n||(u.resourceCode||"").toLowerCase().includes(n)||(u.resourceName||"").toLowerCase().includes(n),a=e.filter(r),i=new Map;a.forEach(u=>{const m=u.appCode||"公共";i.has(m)||i.set(m,[]),i.get(m).push(u)});const o=u=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("span",{children:u.resourceName||u.resourceCode}),Gs(u.resourceType),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:u.resourceCode})]}),l=[];return i.forEach((u,m)=>{const g=new Map;u.forEach(h=>g.set(h.id,{key:h.id,title:o(h),raw:h,children:[]}));const f=[];u.forEach(h=>{const p=g.get(h.id),S=h.parentId??0;S&&g.has(S)?g.get(S).children.push(p):f.push(p)}),l.push({key:`app:${m}`,title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontWeight:600},children:[m,s.jsx(c.Tag,{color:"cyan",style:{margin:0,fontSize:11},children:u.length})]}),selectable:!1,checkable:!1,children:f})}),l}function lF(e){const t=[],n=r=>{r.forEach(a=>{var i;t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function cF(e){const t=[],n=r=>{r.forEach(a=>{var i;a.raw&&t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function Zd({apiBaseURL:e}){const[t,n]=tf.useSearchParams(),r=["roles","points","tree","auth"].includes(t.get("view"))?t.get("view"):"roles",a=d.useCallback(P=>{const te=new URLSearchParams(t);P==="roles"?te.delete("view"):te.set("view",P),n(te,{replace:!0})},[t,n]),[i,o]=d.useState([]),[l,u]=d.useState(!1),[m,g]=d.useState([]),[f,h]=d.useState(!1),[p,S]=d.useState(""),[y,w]=d.useState(!1),[v,x]=d.useState(null),[C]=c.Form.useForm(),[j,b]=d.useState(null),[T,R]=d.useState([]),[F,E]=d.useState([]),[M,k]=d.useState(""),[V,_]=d.useState(null),[A,I]=d.useState([]),[$,D]=d.useState(!1),[O,z]=d.useState(null),[Z,L]=d.useState(""),[U,J]=d.useState([]),[G,H]=d.useState(!1),[B,W]=d.useState(null),[N,q]=d.useState([]),[ee,ne]=d.useState(!1),[X,ae]=d.useState(!1),[oe,ue]=d.useState(!1),[ge,me]=d.useState([]),he=d.useRef(void 0),[Q]=c.Form.useForm(),[se,Se]=d.useState({}),[Fe,ie]=d.useState([]),[Y,K]=d.useState([]),[re,fe]=d.useState([]),[be,Ee]=d.useState(!1),[je,_e]=d.useState(null),[ze]=c.Form.useForm(),[ve,Ie]=d.useState(!1),[Oe,ct]=d.useState(null),rt=d.useCallback(async()=>{u(!0);try{const P=await qe.listAllResources();o(Array.isArray(P)?P:[])}catch(P){c.message.error("加载权限点失败:"+((P==null?void 0:P.message)||"未知错误"))}finally{u(!1)}},[]),Ne=d.useCallback(async()=>{h(!0);try{const P=await qe.listAllRoles();g(Array.isArray(P)?P:[])}catch(P){c.message.error("加载角色失败:"+((P==null?void 0:P.message)||"未知错误"))}finally{h(!1)}},[]),ot=d.useCallback(async()=>{try{const P=await qe.distinctApps(),te=Array.isArray(P)?P:[];fe(te.map(ye=>({value:ye,label:ye})))}catch{fe([])}},[]);d.useEffect(()=>{rt(),Ne(),ot()},[rt,Ne,ot]);const Lt=d.useCallback(async P=>{b(P),k(""),ue(!0),R([]),E([]);try{const te=await qe.listRolePermissions(P.id),ye=(Array.isArray(te)?te:[]).map(Te=>Te.id);R(ye),E(ye)}catch(te){c.message.error("加载角色权限点失败:"+((te==null?void 0:te.message)||"未知错误"))}finally{ue(!1)}},[]),Hn=d.useCallback(async()=>{if(!(j!=null&&j.id))return;const P=new Set(F.map(Number).filter(He=>Number.isFinite(He))),te=new Set(T.map(Number).filter(He=>Number.isFinite(He))),ye=[...P].filter(He=>!te.has(He)),Te=[...te].filter(He=>!P.has(He));if(ye.length===0&&Te.length===0){c.message.info("没有变更");return}ae(!0);try{for(const He of ye)await qe.grantRoleResource(j.id,He);for(const He of Te)await qe.revokeRoleResource(j.id,He);c.message.success(`已保存:+${ye.length} / -${Te.length}`),R([...P])}catch(He){c.message.error("保存失败:"+((He==null?void 0:He.message)||"未知错误"))}finally{ae(!1)}},[j,F,T]),_t=d.useCallback(async(P,te)=>{try{await qe.updateRole(P.id,{status:te?1:0}),c.message.success(te?`角色 ${P.roleName} 已启用`:`角色 ${P.roleName} 已停用`),await Ne()}catch(ye){c.message.error("更新状态失败:"+((ye==null?void 0:ye.message)||"未知错误"))}},[Ne]),Cr=d.useCallback(async()=>{try{const P=await C.validateFields();await qe.createRole({roleCode:P.roleCode,roleName:P.roleName,description:P.description,status:P.enabled===!1?0:1}),c.message.success("角色创建成功"),w(!1),C.resetFields(),await Ne()}catch(P){if(P!=null&&P.errorFields)return;c.message.error("创建失败:"+((P==null?void 0:P.message)||"未知错误"))}},[Ne,C]),va=d.useCallback(async()=>{if(v!=null&&v.id)try{const P=await C.validateFields();await qe.updateRole(v.id,{roleName:P.roleName,description:P.description,status:P.enabled===!1?0:1}),c.message.success("角色已更新"),w(!1),x(null),C.resetFields(),await Ne(),(j==null?void 0:j.id)===v.id&&b(te=>te&&{...te,roleName:P.roleName,status:P.enabled===!1?0:1})}catch(P){if(P!=null&&P.errorFields)return;c.message.error("更新失败:"+((P==null?void 0:P.message)||"未知错误"))}},[j,v,Ne,C]),wr=d.useCallback(async P=>{try{await qe.deleteRole(P.id),c.message.success("角色已删除"),(j==null?void 0:j.id)===P.id&&b(null),await Ne()}catch(te){c.message.error("删除失败:"+((te==null?void 0:te.message)||"未知错误"))}},[j,Ne]),rs=d.useMemo(()=>{const P=p.trim().toLowerCase();return P?m.filter(te=>(te.roleCode||"").toLowerCase().includes(P)||(te.roleName||"").toLowerCase().includes(P)):m},[m,p]),Ta=d.useCallback(async P=>{try{const te=await qe.listResourcesByApp({appCode:se.appCode,type:se.type,keyword:se.keyword,pageNum:P.current,pageSize:P.pageSize}),ye=(te==null?void 0:te.data)||[];return{data:ye,success:!0,total:(te==null?void 0:te.total)??ye.length}}catch(te){return c.message.error("查询权限点失败:"+((te==null?void 0:te.message)||"未知错误")),{data:[],success:!1,total:0}}},[se]),Fa=[{title:"编码",dataIndex:"resourceCode",width:200,fixed:"left",render:(P,te)=>s.jsx(c.Tooltip,{title:te.resourceCode,children:s.jsx("span",{style:{fontFamily:"monospace"},children:te.resourceCode})})},{title:"名称",dataIndex:"resourceName",width:160},{title:"类型",dataIndex:"resourceType",width:80,render:(P,te)=>Gs(te.resourceType)},{title:"应用",dataIndex:"appCode",width:140,render:(P,te)=>te.appCode?s.jsx(c.Tag,{color:"cyan",children:te.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"路径",dataIndex:"path",width:220,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(P,te)=>te.method?s.jsx(c.Tag,{children:te.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,render:(P,te)=>s.jsx(c.Tag,{color:te.status===1?"success":"default",children:te.status===1?"启用":"禁用"})},{title:"创建时间",dataIndex:"createdAt",width:170,render:P=>P||"-"},{title:"操作",width:160,render:(P,te)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:ye=>{ye.stopPropagation(),_e(te),ze.setFieldsValue(te),Ee(!0)},children:"编辑"},"edit"),s.jsx(c.Popconfirm,{title:"确认删除该权限点?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:async ye=>{var Te,He;(Te=ye==null?void 0:ye.stopPropagation)==null||Te.call(ye);try{await qe.deleteResource(te.id),c.message.success("已删除"),(He=he.current)==null||He.reload(),rt()}catch(Ea){c.message.error("删除失败:"+((Ea==null?void 0:Ea.message)||"未知错误"))}},children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:ye=>ye.stopPropagation(),children:"删除"})},"delete"),s.jsx(c.Button,{type:"link",size:"small",onClick:ye=>{ye.stopPropagation(),ct(te),Ie(!0)},children:"详情"},"detail")]}],an=d.useMemo(()=>Hc(i,{search:M}),[i,M]);d.useEffect(()=>{me(lF(an))},[an]);const Un=d.useRef(null),[ss,jr]=d.useState(void 0);d.useEffect(()=>{const P=()=>{const ye=Un.current;if(!ye)return;const Te=ye.getBoundingClientRect().top;jr(Math.max(420,window.innerHeight-Te-24))};P();const te=setTimeout(P,300);return window.addEventListener("resize",P),()=>{clearTimeout(te),window.removeEventListener("resize",P)}},[]);const as=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:320,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"搜索角色编码 / 名称",onSearch:S,onChange:P=>!P.target.value&&S(""),style:{flex:1}}),s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{x(null),C.setFieldsValue({enabled:!0}),w(!0)},children:"新增"})]}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[rs.map(P=>{const te=(j==null?void 0:j.id)===P.id;return s.jsxs("div",{onClick:()=>Lt(P),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:te?"#e6f4ff":"transparent",border:te?"1px solid #91caff":"1px solid transparent"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:te?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[P.roleName||P.roleCode,P.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[P.roleCode,P.tenantCode?` · ${P.tenantCode}`:""]})]}),s.jsx("span",{onClick:ye=>ye.stopPropagation(),children:s.jsx(c.Switch,{size:"small",checked:P.status===1,onChange:ye=>_t(P,ye)})}),s.jsx("span",{onClick:ye=>ye.stopPropagation(),children:s.jsx(c.Dropdown,{trigger:["click"],menu:{items:[{key:"edit",icon:s.jsx(de.AuditOutlined,{}),label:"编辑"},{type:"divider"},{key:"delete",icon:s.jsx(de.DeleteOutlined,{}),label:"删除",danger:!0}],onClick:({key:ye})=>{ye==="edit"?(x(P),C.setFieldsValue({roleCode:P.roleCode,roleName:P.roleName,description:P.description,enabled:P.status!==0}),w(!0)):ye==="delete"&&c.Modal.confirm({title:`删除角色 ${P.roleName}?`,okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onOk:()=>wr(P)})}},children:s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(de.EllipsisOutlined,{})})})})]},P.id)}),rs.length===0?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:p?"没有匹配的角色":"还没有角色,点「新增」创建",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},title:j?`权限点 — ${j.roleName}`:"权限点",extra:j?s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",onClick:()=>E(cF(an)),children:"全选"}),s.jsx(c.Button,{size:"small",onClick:()=>E([]),children:"清空"}),s.jsx(c.Button,{size:"small",type:"primary",loading:X,onClick:Hn,children:"保存"})]}):null,styles:{body:{padding:"12px 8px 12px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:j?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx(c.Input.Search,{allowClear:!0,size:"small",placeholder:"按编码 / 名称过滤权限点",onSearch:k,onChange:P=>!P.target.value&&k("")})}),s.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:8},children:["已挂载 ",s.jsx("b",{children:T.length})," / 共 ",i.length," 个权限点 —— 勾选即挂载,取消即卸载。"]}),s.jsx(c.Tree,{checkable:!0,blockNode:!0,treeData:an,checkedKeys:F,onCheck:P=>E(Array.isArray(P)?P:P.checked),expandedKeys:ge,onExpand:P=>me(P),loading:oe})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧角色,这里展开它挂载的权限点树",style:{margin:"24px 0"}})})})]}),Ra=()=>s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:Q,layout:"inline",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用",children:s.jsx(c.Select,{placeholder:"全部应用",allowClear:!0,style:{width:180},options:re,showSearch:!0,optionFilterProp:"label"})}),s.jsx(c.Form.Item,{name:"type",label:"类型",children:s.jsx(c.Select,{placeholder:"全部类型",allowClear:!0,style:{width:120},options:Object.entries(to).map(([P,te])=>({value:Number(P),label:te.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",children:s.jsx(c.Select,{placeholder:"全部",allowClear:!0,style:{width:100},options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:()=>{const P=Q.getFieldsValue(),te={};P.appCode&&(te.appCode=P.appCode),P.type!==void 0&&P.type!==null&&(te.type=P.type),P.keyword&&(te.keyword=P.keyword),P.status!==void 0&&P.status!==null&&(te.status=P.status),Se(te)},children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:()=>{Q.resetFields(),Se({})},children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{_e(null),ze.resetFields(),ze.setFieldsValue({resourceType:3,status:1,sortOrder:0}),Ee(!0)},children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(de.DeleteOutlined,{}),disabled:Fe.length===0,onClick:async()=>{var P;try{await Promise.all(Y.map(te=>qe.deleteResource(te.id))),c.message.success(`已删除 ${Y.length} 条`),ie([]),K([]),(P=he.current)==null||P.reload(),rt()}catch(te){c.message.error("批量删除失败:"+((te==null?void 0:te.message)||"未知错误"))}},children:"批量删除"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var P;return(P=he.current)==null?void 0:P.reload()},children:"刷新"})]})]})}),s.jsx(Sr,{actionRef:he,rowKey:"id",columns:Fa,request:Ta,params:se,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:P=>`共 ${P} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:Fe,onChange:(P,te)=>{ie(P),K(te)}},tableAlertRender:({selectedRowKeys:P})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:P.length})," 项"]})})]}),Ve=V!=null?i.find(P=>P.id===V):null,vr=(()=>{if(!Ve)return[];const P=new Map(i.map(He=>[He.id,He])),te=[Ve],ye=new Set([Ve.id]);let Te=Ve;for(;Te!=null&&Te.parentId&&P.has(Te.parentId)&&!ye.has(Te.parentId);)Te=P.get(Te.parentId),ye.add(Te.id),te.unshift(Te);return te})(),is=Ve?i.filter(P=>P.parentId===Ve.id):[],$a=()=>{var P;return s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:460,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[s.jsx(c.Input.Search,{allowClear:!0,size:"small",style:{flex:1},placeholder:"按编码 / 名称过滤",onSearch:k,onChange:te=>!te.target.value&&k("")}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:rt,children:"刷新"})]}),s.jsxs("div",{style:{fontSize:12,color:"#999"},children:["权限模型全貌:按「应用 → 父子层级」组织,共 ",i.length," 个。点条目看详情。"]}),s.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:s.jsx(c.Tree,{blockNode:!0,treeData:an,loading:l,defaultExpandAll:!0,selectedKeys:V!=null?[V]:[],onSelect:te=>_(te.length?te[te.length-1]:null)})})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:16,flex:1,minHeight:0,overflowY:"auto"}},title:Ve?`权限点详情 — ${Ve.resourceName||Ve.resourceCode}`:"权限点详情",children:Ve?s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{fontSize:13,color:"#595959"},children:[vr.map((te,ye)=>s.jsxs("span",{children:[ye>0?s.jsx("span",{style:{color:"#bfbfbf",margin:"0 6px"},children:"/"}):null,te.resourceName||te.resourceCode]},te.id)),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999",marginLeft:10},children:Ve.resourceCode})]}),s.jsxs(c.Descriptions,{bordered:!0,size:"small",column:2,children:[s.jsxs(c.Descriptions.Item,{label:"资源名称",span:2,children:[s.jsx("span",{style:{fontWeight:600},children:Ve.resourceName||"-"}),s.jsx("span",{style:{marginLeft:8},children:Gs(Ve.resourceType)})]}),s.jsx(c.Descriptions.Item,{label:"编码",span:2,children:s.jsx("span",{style:{fontFamily:"monospace"},children:Ve.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"应用",children:Ve.appCode?s.jsx(c.Tag,{color:"cyan",style:{margin:0},children:Ve.appCode}):s.jsx(c.Tag,{color:"default",style:{margin:0},children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:Ve.status===1?"success":"default",style:{margin:0},children:Ve.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"ID",children:Ve.id}),s.jsx(c.Descriptions.Item,{label:"排序",children:Ve.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"父权限",children:Ve.parentId&&i.some(te=>te.id===Ve.parentId)?((P=i.find(te=>te.id===Ve.parentId))==null?void 0:P.resourceName)||Ve.parentId:"顶层"}),s.jsxs(c.Descriptions.Item,{label:"子权限点",children:[is.length," 个"]}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:Ve.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:Ve.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:Ve.updatedAt||"-"})]})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧权限点,这里展示它的详情与扩展字段",style:{margin:"48px 0"}})})})]})},Tr=d.useCallback(async()=>{D(!0);try{const P=await Rn.listByTenant({pageNum:1,pageSize:200}),te=Array.isArray(P)?P:(P==null?void 0:P.records)||(P==null?void 0:P.data)||[];I(te)}catch(P){c.message.error("加载用户失败:"+((P==null?void 0:P.message)||"未知错误"))}finally{D(!1)}},[]),jn=d.useCallback(async P=>{ne(!0);try{const te=await qe.listUserPermissions(P),ye=Array.isArray(te)?te:[];q(ye.map(Te=>Te==null?null:typeof Te=="object"?Te.id!=null?Te.id:Te.resourceCode||Te.code:Te).filter(Te=>Te!=null))}catch(te){c.message.error("加载用户权限失败:"+((te==null?void 0:te.message)||"未知错误"))}finally{ne(!1)}},[]),Yn=d.useCallback(async P=>{z(P.id),J([]),q([]),H(!0),ne(!0);try{const te=await qe.listUserRoles(P.id);J((Array.isArray(te)?te:[]).map(ye=>ye.id))}catch(te){c.message.error("加载用户角色失败:"+((te==null?void 0:te.message)||"未知错误"))}finally{H(!1)}jn(P.id)},[jn]);d.useEffect(()=>{Tr()},[Tr]),d.useEffect(()=>{O==null&&A.length>0&&Yn(A[0])},[A,O,Yn]);const os=async(P,te)=>{if(O){W(P.id);try{te?await qe.grantUserRole(O,P.id):await qe.revokeUserRole(O,P.id),J(ye=>te?[...ye,P.id]:ye.filter(Te=>Te!==P.id)),c.message.success(`已${te?"授予":"收回"}角色 ${P.roleName||P.roleCode}`),jn(O)}catch(ye){c.message.error((te?"授予":"收回")+"失败:"+((ye==null?void 0:ye.message)||"未知错误"))}finally{W(null)}}},Kn=d.useMemo(()=>{const P=new Map(i.map(ye=>[ye.id,ye])),te=new Set;return N.forEach(ye=>{if(typeof ye=="number"||/^\d+$/.test(String(ye))){te.add(Number(ye));const Te=P.get(Number(ye));Te&&te.add(Te.resourceCode)}else{te.add(ye);const Te=i.find(He=>He.resourceCode===ye);Te&&te.add(Te.id)}}),te},[N,i]),Wn=d.useMemo(()=>Hc(i),[i]),ls=d.useMemo(()=>Wn.flatMap(P=>(P.children||[]).map(te=>te.key)).filter(P=>Kn.has(P)),[Wn,Kn]),pe=d.useMemo(()=>{const P=Z.trim().toLowerCase();return P?A.filter(te=>`${te.username||""} ${te.nickname||""} ${te.tenantCode||""}`.toLowerCase().includes(P)):A},[A,Z]),Ce=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:300,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"搜索用户名 / 昵称 / 租户",onSearch:L,onChange:P=>!P.target.value&&L("")}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[pe.map(P=>{const te=O===P.id;return s.jsx("div",{onClick:()=>Yn(P),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:te?"#e6f4ff":"transparent",border:te?"1px solid #91caff":"1px solid transparent"},children:s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:te?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[P.nickname||P.username||P.id,P.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[P.username,P.tenantCode?` · ${P.tenantCode}`:""]})]})},P.id)}),pe.length===0&&!$?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"没有用户",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{width:300,flexShrink:0,display:"flex"},children:s.jsx(c.Card,{size:"small",title:`角色 (${U.length})`,loading:G&&O!=null,style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:"8px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:O?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:m.map(P=>{const te=U.includes(P.id),ye=B===P.id;return s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 8px",borderRadius:6,cursor:ye?"wait":"pointer"},children:[s.jsx(c.Checkbox,{checked:te,disabled:ye||f,onChange:Te=>os(P,Te.target.checked)}),s.jsxs("span",{style:{fontSize:13,flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[P.roleName||P.roleCode,P.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:P.roleCode})]},P.id)})}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"先在左侧选人",style:{margin:"24px 0"}})})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:8,overflow:"hidden"}},title:O?`有效权限点 (${Kn.size})`:"有效权限点",extra:O?s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>jn(O),children:"刷新"}):null,children:O?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:12,color:"#999"},children:"该人经角色叠加到手的权限点全貌;勾选状态只读,要改去「角色」tab 调整角色挂载,或在中栏勾选/取消角色。"}),s.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:s.jsx(c.Tree,{checkable:!0,blockNode:!0,treeData:Wn,checkedKeys:ls,loading:ee,defaultExpandAll:!0})})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"先在左侧选人",style:{margin:"24px 0"}})})})]});return s.jsxs("div",{ref:Un,className:"perm-mgmt-fullheight",style:{display:"flex",flexDirection:"column",minHeight:420,height:ss},children:[s.jsx("style",{children:`
58
58
  .perm-mgmt-fullheight .ant-tabs { display: flex; flex-direction: column; height: 100%; }
59
59
  .perm-mgmt-fullheight .ant-tabs-content-holder { flex: 1; min-height: 0; }
60
60
  .perm-mgmt-fullheight .ant-tabs-content,
61
61
  .perm-mgmt-fullheight .ant-tabs-tabpane { height: 100%; }
62
- `}),s.jsx(u.Tabs,{style:{flex:1,minHeight:0},activeKey:r,onChange:a,items:aF.map(Q=>({key:Q.key,label:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[Q.icon,Q.label]}),children:Q.key==="roles"?ve():Q.key==="points"?$e():ut()})),destroyInactiveTabPane:!0}),s.jsx(u.Modal,{title:v?`编辑角色 — ${v.roleCode}`:"新增角色",open:y,onOk:v?ae:xe,onCancel:()=>{w(!1),x(null),C.resetFields()},okText:v?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0,message:"请输入角色编码"}],extra:"唯一标识,英文/下划线;创建后不可改",children:s.jsx(u.Input,{placeholder:"如 admin / dev / viewer",disabled:!!v})}),s.jsx(u.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0,message:"请输入角色名称"}],children:s.jsx(u.Input,{placeholder:"如 管理员"})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:2,placeholder:"可选"})}),s.jsx(u.Form.Item,{name:"enabled",label:"启用",valuePropName:"checked",initialValue:!0,children:s.jsx(u.Switch,{checkedChildren:"启用",unCheckedChildren:"停用"})})]})}),s.jsx(u.Modal,{title:X?`编辑权限点 — ${X.resourceCode}`:"新建权限点",open:P,onOk:async()=>{var Q;try{const le=await Z.validateFields();X?(await tt.updateResource(X.id,le),u.message.success("更新成功")):(await tt.createResource(le),u.message.success("创建成功")),U(!1),ne(null),Z.resetFields(),(Q=O.current)==null||Q.reload(),ge()}catch(le){if(le!=null&&le.errorFields)return;u.message.error("保存失败:"+((le==null?void 0:le.message)||"未知错误"))}},onCancel:()=>{U(!1),ne(null),Z.resetFields()},okText:X?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(u.Form,{form:Z,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0,min:2,max:128,pattern:/^[a-zA-Z0-9_:.-]+$/,message:"2-128 位字母数字下划线冒号"}],extra:"业务唯一,如 user:read / order:create",children:s.jsx(u.Input,{placeholder:"如 user:read",disabled:!!X})}),s.jsx(u.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0,max:128}],children:s.jsx(u.Input,{placeholder:"如 用户查询"})}),s.jsx(u.Form.Item,{name:"resourceType",label:"资源类型",rules:[{required:!0}],initialValue:3,children:s.jsx(u.Select,{options:Object.entries(Di).map(([Q,le])=>({value:Number(Q),label:le.text}))})}),s.jsx(u.Form.Item,{name:"appCode",label:"所属应用",extra:"选择权限点归属的应用;不选则为「公共」",children:s.jsx(u.Select,{placeholder:"公共(跨应用)",allowClear:!0,showSearch:!0,optionFilterProp:"label",options:_})}),s.jsx(u.Form.Item,{name:"path",label:"URL 路径",extra:"菜单 / API 资源对应路径",children:s.jsx(u.Input,{placeholder:"如 /api/ctc/authorization/users"})}),s.jsx(u.Form.Item,{name:"method",label:"HTTP 方法",extra:"API 资源填 HTTP 方法;菜单/数据/按钮可留空",children:s.jsx(u.Select,{options:sF})}),s.jsx(u.Form.Item,{name:"icon",label:"图标 (菜单用)",children:s.jsx(u.Input,{placeholder:"如 UserOutlined"})}),s.jsx(u.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(u.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(u.Form.Item,{name:"description",label:"描述",children:s.jsx(u.Input.TextArea,{rows:2,maxLength:512,showCount:!0})}),s.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(u.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})}),s.jsx(u.Drawer,{title:se?`权限点详情 — ${se.resourceCode}`:"权限点详情",open:re,onClose:()=>ie(!1),size:720,destroyOnHidden:!0,children:se&&s.jsxs(u.Descriptions,{title:"权限点信息",size:"small",bordered:!0,column:2,children:[s.jsx(u.Descriptions.Item,{label:"资源ID",children:se.id}),s.jsx(u.Descriptions.Item,{label:"资源编码",children:s.jsx("span",{style:{fontFamily:"monospace"},children:se.resourceCode})}),s.jsx(u.Descriptions.Item,{label:"资源名称",children:se.resourceName}),s.jsx(u.Descriptions.Item,{label:"资源类型",children:Pi(se.resourceType)}),s.jsx(u.Descriptions.Item,{label:"所属应用",span:2,children:se.appCode?s.jsx(u.Tag,{color:"cyan",children:se.appCode}):s.jsx(u.Tag,{color:"default",children:"公共"})}),s.jsx(u.Descriptions.Item,{label:"URL 路径",span:2,children:se.path||"-"}),s.jsx(u.Descriptions.Item,{label:"HTTP 方法",children:se.method?s.jsx(u.Tag,{children:se.method}):"-"}),s.jsx(u.Descriptions.Item,{label:"图标",children:se.icon||"-"}),s.jsx(u.Descriptions.Item,{label:"排序",children:se.sortOrder??0}),s.jsx(u.Descriptions.Item,{label:"状态",children:s.jsx(u.Tag,{color:se.status===1?"success":"default",children:se.status===1?"启用":"禁用"})}),s.jsx(u.Descriptions.Item,{label:"租户",span:2,children:se.tenantCode||"公共"}),s.jsx(u.Descriptions.Item,{label:"描述",span:2,children:se.description||"-"}),s.jsx(u.Descriptions.Item,{label:"创建时间",children:se.createdAt||"-"}),s.jsx(u.Descriptions.Item,{label:"更新时间",children:se.updatedAt||"-"})]})})]})}function cF(e){return s.jsx(Bd,{...e})}const Dc={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}};function uF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]);d.useEffect(()=>{jr.listApplications({status:1}).then(m=>{const p=((m==null?void 0:m.records)||[]).map(S=>({value:S.appCode,label:`${S.appName} (${S.appCode})`}));o(p)}).catch(()=>o([]))},[]);const l=async m=>{try{const p=await tt.listResourcesByApp({appCode:r.appCode,type:r.type,keyword:r.keyword,pageNum:m.current,pageSize:m.pageSize}),S=(p==null?void 0:p.data)||[],y=(p==null?void 0:p.total)??S.length;return{data:S,success:!0,total:y}}catch(p){return u.message.error("查询资源失败:"+((p==null?void 0:p.message)||"未知错误")),{data:[],success:!1,total:0}}},c=()=>{var S;const m=n.getFieldsValue(),p={};m.appCode&&(p.appCode=m.appCode),m.type!==void 0&&m.type!==null&&(p.type=m.type),m.keyword&&(p.keyword=m.keyword),a(p),(S=t.current)==null||S.reload()},h=()=>{var m;n.resetFields(),a({}),(m=t.current)==null||m.reload()},g=async m=>{var p;try{await tt.deleteResource(m),u.message.success("已删除"),(p=t.current)==null||p.reload()}catch(S){u.message.error("删除失败:"+((S==null?void 0:S.message)||"未知错误"))}},f=[{title:"资源编码",dataIndex:"resourceCode",width:220,fixed:"left",search:!1,render:(m,p)=>s.jsx("span",{style:{fontFamily:"monospace"},children:p.resourceCode})},{title:"资源名称",dataIndex:"resourceName",width:160,search:!1},{title:"类型",dataIndex:"resourceType",width:80,search:!1,render:(m,p)=>{const S=Dc[p.resourceType??3]||{text:String(p.resourceType??"?"),color:"default"};return s.jsx(u.Tag,{color:S.color,children:S.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(m,p)=>p.appCode?s.jsx(u.Tag,{color:"cyan",children:p.appCode}):s.jsx(u.Tag,{color:"default",children:"公共"})},{title:"URL",dataIndex:"path",width:220,ellipsis:!0,search:!1},{title:"方法",dataIndex:"method",width:80,search:!1,render:(m,p)=>p.method?s.jsx(u.Tag,{children:p.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(m,p)=>s.jsx(u.Tag,{color:p.status===1?"success":"default",children:p.status===1?"启用":"禁用"})},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:120,fixed:"right",search:!1,render:(m,p)=>[s.jsx(u.Popconfirm,{title:`删除资源 ${p.resourceCode}?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>g(p.id),children:s.jsx(u.Button,{type:"link",size:"small",danger:!0,children:"删除"})},"delete")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(u.Card,{size:"small",style:{marginBottom:16},styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(u.Form,{form:n,layout:"inline",children:[s.jsx(u.Form.Item,{name:"appCode",label:"应用",children:s.jsx(u.Select,{placeholder:"全部应用",allowClear:!0,style:{width:200},options:i,showSearch:!0,optionFilterProp:"label"})}),s.jsx(u.Form.Item,{name:"type",label:"类型",children:s.jsx(u.Select,{placeholder:"全部类型",allowClear:!0,style:{width:110},options:Object.entries(Dc).map(([m,p])=>({value:Number(m),label:p.text}))})}),s.jsx(u.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(u.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(u.Form.Item,{children:s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"primary",icon:s.jsx(me.SearchOutlined,{}),onClick:c,children:"查询"}),s.jsx(u.Button,{icon:s.jsx(me.UndoOutlined,{}),onClick:h,children:"重置"})]})})]}),s.jsx(u.Space,{style:{flexShrink:0},children:s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>{var m;return(m=t.current)==null?void 0:m.reload()},children:"刷新"})})]})}),s.jsx(fr,{actionRef:t,rowKey:"id",columns:f,request:l,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:15,showSizeChanger:!0,showTotal:m=>`共 ${m} 条`},dateFormatter:"string"})]})}const{Text:dF}=u.Typography;function fF({apiBaseURL:e}){const[t,n]=d.useState([]),[r,a]=d.useState(!1),[i,o]=d.useState(null),[l,c]=d.useState([]),[h,g]=d.useState(!1),[f,m]=d.useState([]),[p,S]=d.useState(!1),[y,w]=d.useState([]),[v,x]=d.useState(null),[C,j]=d.useState(!1),b=async()=>{a(!0);try{const M=await Zn.listAccounts({pageNum:1,pageSize:200}),k=Array.isArray(M)?M:(M==null?void 0:M.records)||(M==null?void 0:M.data)||[];n(k),k.length>0&&!i&&o(k[0].id)}catch{n([])}finally{a(!1)}};d.useEffect(()=>{b()},[]),d.useEffect(()=>{if(!i){c([]),m([]);return}g(!0),S(!0),Zn.listUserRoles(i).then(M=>c(Array.isArray(M)?M:[])).catch(()=>c([])).finally(()=>g(!1)),Zn.listUserPermissions(i).then(M=>m(Array.isArray(M)?M:[])).catch(()=>m([])).finally(()=>S(!1))},[i]),d.useEffect(()=>{if(!v){w([]);return}j(!0),Zn.listRoleResources(v).then(M=>{const k=Array.isArray(M)?M:[],V={};k.forEach(A=>{const I=A.resourceType||"OTHER";V[I]||(V[I]=[]),V[I].push(A)});const z=Object.entries(V).map(([A,I])=>({title:`${A} (${I.length})`,key:`type-${A}`,children:I.map(R=>({title:`${R.resourceName} (${R.resourceCode})`,key:`res-${R.id}`,raw:R}))}));w(z)}).catch(()=>w([])).finally(()=>j(!1))},[v]);const T=t.map(M=>({value:M.id,label:`${M.username||M.nickname||M.id} (${M.tenantCode||"default"})`})),[$,F]=d.useState(""),E=d.useMemo(()=>{const M=$.trim().toLowerCase();return M?l.filter(k=>`${k.roleCode||""} ${k.roleName||""}`.toLowerCase().includes(M)):l},[l,$]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(jt.TableToolbar,{left:s.jsx(u.Select,{showSearch:!0,placeholder:"选择用户",style:{width:320},value:i,onChange:o,loading:r,options:T,filterOption:(M,k)=>k.label.toLowerCase().includes(M.toLowerCase())}),right:s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:b,children:"刷新用户"})}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16},children:[s.jsx(u.Card,{size:"small",title:`用户角色 (${l.length})`,loading:h,extra:s.jsx(u.Input.Search,{allowClear:!0,placeholder:"按角色编码 / 名称过滤",style:{width:220},onChange:M=>F(M.target.value)}),children:l.length===0&&!h?s.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"该用户暂无角色"}):s.jsx(u.List,{size:"small",dataSource:E,renderItem:M=>s.jsx(u.List.Item,{actions:[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>x(M.id),disabled:M.id===v,children:M.id===v?"查看中":"查看资源"},"res")],children:s.jsx(u.List.Item.Meta,{title:s.jsxs(u.Space,{children:[s.jsx(dF,{strong:!0,children:M.roleName||M.roleCode}),s.jsx(u.Tag,{color:"blue",style:{margin:0},children:M.roleCode})]}),description:M.description||"-"})})})}),s.jsx(jt.ListTable,{cardTitle:`用户权限 (${f.length})`,rows:f,rowKey:(M,k)=>M.code||M.resourceCode||M.id||k,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该用户暂无直接权限",columns:[{title:"资源编码",dataIndex:"code",width:200,render:(M,k)=>s.jsx("span",{style:{fontFamily:"monospace"},children:k.code||k.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(M,k)=>k.name||k.resourceName||"-"}],cardProps:{size:"small",loading:p}}),s.jsx(u.Card,{size:"small",title:v?`角色资源 (${y.reduce((M,k)=>{var V;return M+(((V=k.children)==null?void 0:V.length)||0)},0)})`:"角色资源",loading:C,children:v?y.length===0&&!C?s.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"该角色暂无资源"}):s.jsx(u.Tree,{treeData:y,defaultExpandAll:!0,selectable:!1,showLine:!0,blockNode:!0,height:420}):s.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"左侧点击「查看资源」以查看该角色拥有的权限点"})})]})]})}let Vd="/api";function mF(e){Vd=e||"/api"}function Ha(){return Xt.createRequest({baseURL:Vd,timeout:15e3})}const wn={shorten:e=>Ha().post("/ctc/surl/shorten",e),info:e=>Ha().get("/ctc/surl/info",{params:{mapKey:e}}),invalidate:e=>Ha().delete("/ctc/surl",{params:{mapKey:e}}),buildUrl:e=>`${typeof window<"u"&&window.location&&window.location.origin||""}/s/${encodeURIComponent(e)}`},Pc="z_surl_history";function hF({apiBaseURL:e}){e&&mF(e);const[t]=u.Form.useForm(),n=d.useRef(void 0),[r,a]=d.useState(null),[i,o]=d.useState(()=>JSON.parse(localStorage.getItem(Pc)||"[]")),[l,c]=d.useState(!1),[h,g]=d.useState(""),f=d.useMemo(()=>{const v=h.trim().toLowerCase();return v?i.filter(x=>`${x.mapKey||""} ${x.originUrl||""} ${x.remark||""}`.toLowerCase().includes(v)):i},[i,h]),m=v=>{o(v),localStorage.setItem(Pc,JSON.stringify(v))},p=async v=>{var x;c(!0);try{const C=await wn.shorten({originUrl:v.originUrl,ttlMillis:v.ttlMillis||0,remark:v.remark});a(C);const j=wn.buildUrl(C.mapKey),b={mapKey:C.mapKey,originUrl:C.originUrl,expireAt:C.expireAt,hits:C.hits,remark:v.remark,createdAt:new Date().toISOString()};m([b,...i]),u.message.success(`短链生成成功:${j}`),(x=n.current)==null||x.reload()}catch(C){u.message.error("生成失败:"+((C==null?void 0:C.message)||"未知错误"))}finally{c(!1)}},S=async v=>{try{await navigator.clipboard.writeText(v),u.message.success("已复制到剪贴板")}catch{u.message.error("复制失败,请手动复制")}},y=async v=>{var x;try{await wn.invalidate(v),u.message.success("已失效"),m(i.filter(C=>C.mapKey!==v)),(x=n.current)==null||x.reload()}catch(C){m(i.filter(j=>j.mapKey!==v)),u.message.warning("后端失效失败,已从本地移除:"+((C==null?void 0:C.message)||""))}},w=[{title:"短码",dataIndex:"mapKey",width:120,fixed:"left"},{title:"完整短链",dataIndex:"mapKey",width:280,render:(v,x)=>{const C=wn.buildUrl(x.mapKey);return s.jsxs(u.Space,{size:4,children:[s.jsx("a",{href:C,target:"_blank",rel:"noreferrer",children:C}),s.jsx(u.Tooltip,{title:"复制",children:s.jsx(u.Button,{type:"text",size:"small",icon:s.jsx(me.CopyOutlined,{}),onClick:()=>S(C)})})]})}},{title:"原始URL",dataIndex:"originUrl",width:280,ellipsis:!0},{title:"备注",dataIndex:"remark",width:160,ellipsis:!0},{title:"命中次数",dataIndex:"hits",width:90,valueType:"digit"},{title:"过期时间",dataIndex:"expireAt",width:170,render:(v,x)=>x.expireAt?new Date(x.expireAt).toLocaleString():s.jsx(u.Tag,{color:"green",children:"永久"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime"},{title:"操作",valueType:"option",width:100,fixed:"right",render:(v,x)=>[s.jsx(u.Popconfirm,{title:"失效该短链?",onConfirm:()=>y(x.mapKey),children:s.jsx(u.Button,{type:"link",danger:!0,size:"small",children:"失效"})},"del")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs(u.Card,{title:s.jsxs(s.Fragment,{children:[s.jsx(me.LinkOutlined,{})," 生成短链"]}),children:[s.jsxs(gt,{form:t,layout:"inline",onFinish:p,submitter:{render:v=>[s.jsx(u.Button,{onClick:()=>{var x;return(x=v.form)==null?void 0:x.resetFields()},children:"重置"},"reset"),s.jsx(u.Button,{type:"primary",icon:s.jsx(me.PlusOutlined,{}),loading:l,onClick:()=>{var x;return(x=v.form)==null?void 0:x.submit()},children:"生成"},"submit")]},children:[s.jsx(Us,{name:"originUrl",label:"原始URL",width:"md",rules:[{required:!0,message:"请输入要缩短的URL"},{type:"url",message:"请输入合法的URL"}],placeholder:"https://example.com/some/very/long/path?param=1"}),s.jsx(E0,{name:"ttlMillis",label:"有效期(ms)",width:"sm",min:0,placeholder:"0 = 永久",tooldescription:"0 = 永久;其它填毫秒数,如 86400000 = 1天"}),s.jsx(Us,{name:"remark",label:"备注",width:"sm",placeholder:"可选"})]}),r&&s.jsxs("div",{style:{marginTop:16,padding:16,background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx("b",{children:"生成结果:"})}),s.jsxs(u.Space,{orientation:"vertical",style:{width:"100%"},children:[s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"短码:"}),s.jsx(u.Tag,{color:"green",children:r.mapKey})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"完整短链:"}),s.jsx("a",{href:wn.buildUrl(r.mapKey),target:"_blank",rel:"noreferrer",children:wn.buildUrl(r.mapKey)}),s.jsx(u.Button,{type:"link",size:"small",icon:s.jsx(me.CopyOutlined,{}),onClick:()=>S(wn.buildUrl(r.mapKey)),children:"复制"})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"原始URL:"}),s.jsx("span",{style:{wordBreak:"break-all"},children:r.originUrl})]})]})]})]}),s.jsx(u.Card,{title:"历史短链",style:{marginTop:16},extra:s.jsx(u.Input.Search,{allowClear:!0,placeholder:"按短码 / 原始 URL / 备注过滤",style:{width:260},onChange:v=>g(v.target.value)}),children:s.jsx(fr,{actionRef:n,rowKey:"mapKey",columns:w,dataSource:f,search:!1,pagination:{pageSize:10,showSizeChanger:!0},toolBarRender:()=>[s.jsx(u.Button,{onClick:()=>m([]),children:"清空历史"},"clear"),s.jsx(u.Button,{icon:s.jsx(me.ReloadOutlined,{}),onClick:()=>{var v;return(v=n.current)==null?void 0:v.reload()},children:"刷新"},"reload")]})})]})}let gF="/api";function Pt(){return Xt.createRequest({baseURL:gF,timeout:15e3})}const on={listDictType:e=>Pt().get("/dict/type/list",{params:e}),getDictType:e=>Pt().get("/dict/type/get",{params:{id:e}}),createDictType:e=>Pt().post("/dict/type",e),updateDictType:(e,t)=>Pt().put("/dict/type",t,{params:{id:e}}),deleteDictType:e=>Pt().delete("/dict/type",{params:{id:e}}),listDictItem:e=>Pt().get("/dict/item/list",{params:{dictId:e}}),listDictItemByCode:e=>Pt().get("/dict/items/get",{params:{dictCode:e}}),createDictItem:e=>Pt().post("/dict/item",e),updateDictItem:(e,t)=>Pt().put("/dict/item",t,{params:{id:e}}),deleteDictItem:e=>Pt().delete("/dict/item",{params:{id:e}})};function pF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState(null),[o,l]=d.useState([]),[c,h]=d.useState(!1),[g,f]=d.useState(!1),[m,p]=d.useState(null),[S]=u.Form.useForm(),[y,w]=d.useState(!1),[v,x]=d.useState(null),[C]=u.Form.useForm(),j=async()=>{r(!0);try{const I=await on.listDictType({pageNum:1,pageSize:200}),R=(I==null?void 0:I.records)||(I==null?void 0:I.data)||I||[];t(Array.isArray(R)?R:[])}catch(I){u.message.error("加载字典类型失败:"+((I==null?void 0:I.message)||"未知错误")),t([])}finally{r(!1)}};d.useEffect(()=>{j()},[]);const b=async I=>{if(!I){l([]);return}h(!0);try{const R=await on.listDictItem(I);l(Array.isArray(R)?R:[])}catch(R){u.message.error("加载字典项失败:"+((R==null?void 0:R.message)||"未知错误")),l([])}finally{h(!1)}};d.useEffect(()=>{a!=null&&a.id?b(a.id):l([])},[a==null?void 0:a.id]);const T=()=>{p(null),S.resetFields(),f(!0)},$=I=>{p(I),S.setFieldsValue({dictCode:I.dictCode,dictName:I.dictName,status:I.status??1,remark:I.remark}),f(!0)},F=async()=>{try{const I=await S.validateFields();m?(await on.updateDictType(m.id,I),u.message.success("更新成功")):(await on.createDictType(I),u.message.success("创建成功")),f(!1),p(null),S.resetFields(),j()}catch(I){if(I!=null&&I.errorFields)return;u.message.error((m?"更新失败:":"创建失败:")+((I==null?void 0:I.message)||"未知错误"))}},E=async I=>{try{await on.deleteDictType(I),u.message.success("已删除"),(a==null?void 0:a.id)===I&&i(null),j()}catch(R){u.message.error("删除失败:"+((R==null?void 0:R.message)||"未知错误"))}},M=()=>{if(!a){u.message.warning("请先选择左侧的字典类型");return}x(null),C.resetFields(),w(!0)},k=I=>{x(I),C.setFieldsValue({itemCode:I.itemCode,itemName:I.itemName,sortOrder:I.sortOrder??0,status:I.status??1}),w(!0)},V=async()=>{try{const R={...await C.validateFields(),dictId:a.id};v?(await on.updateDictItem(v.id,R),u.message.success("更新成功")):(await on.createDictItem(R),u.message.success("创建成功")),w(!1),x(null),C.resetFields(),b(a.id)}catch(I){if(I!=null&&I.errorFields)return;u.message.error((v?"更新失败:":"创建失败:")+((I==null?void 0:I.message)||"未知错误"))}},z=async I=>{try{await on.deleteDictItem(I),u.message.success("已删除"),b(a.id)}catch(R){u.message.error("删除失败:"+((R==null?void 0:R.message)||"未知错误"))}},A=[{title:"项编码",dataIndex:"itemCode",width:160,render:I=>s.jsx("span",{style:{fontFamily:"monospace"},children:I})},{title:"项名称",dataIndex:"itemName",width:160},{title:"排序",dataIndex:"sortOrder",width:80},{title:"状态",dataIndex:"status",width:80,render:I=>s.jsx(u.Tag,{color:I===1?"success":"default",children:I===1?"启用":"禁用"})},{title:"操作",width:120,render:(I,R)=>s.jsxs(u.Space,{children:[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>k(R),children:"编辑"}),s.jsx(u.Popconfirm,{title:"删除该字典项?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>z(R.id),children:s.jsx(u.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:16},children:[s.jsx(jt.ListTable,{cardTitle:`字典类型 (${e.length})`,cardExtra:s.jsxs(u.Space,{children:[s.jsx(u.Button,{size:"small",icon:s.jsx(me.PlusOutlined,{}),onClick:T,children:"新增"}),s.jsx(u.Button,{size:"small",icon:s.jsx(me.ReloadOutlined,{}),onClick:j})]}),rows:e,rowKey:"id",searchKeys:["dictCode","dictName"],searchPlaceholder:"搜索编码 / 名称",cardProps:{size:"small",loading:n},tableProps:{onRow:I=>({onClick:()=>i(I),style:{cursor:"pointer",background:(a==null?void 0:a.id)===I.id?"#e6f4ff":void 0}})},columns:[{title:"编码",dataIndex:"dictCode",width:100,ellipsis:!0,render:I=>s.jsx("span",{style:{fontFamily:"monospace"},children:I})},{title:"名称",dataIndex:"dictName",width:110,ellipsis:!0},{title:"状态",dataIndex:"status",width:60,render:I=>s.jsx(u.Tag,{color:I===1?"success":"default",children:I===1?"启":"禁"})},{title:"操作",width:100,render:(I,R)=>s.jsxs(u.Space,{onClick:D=>D.stopPropagation(),children:[s.jsx(u.Button,{type:"link",size:"small",onClick:()=>$(R),children:"编辑"}),s.jsx(u.Popconfirm,{title:"删除该类型?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>E(R.id),children:s.jsx(u.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}]}),a?s.jsx(jt.ListTable,{cardTitle:`字典项 — ${a.dictName} (${o.length})`,cardExtra:s.jsxs(u.Space,{children:[s.jsx(u.Button,{size:"small",icon:s.jsx(me.PlusOutlined,{}),onClick:M,disabled:!a,children:"新增项"}),s.jsx(u.Button,{size:"small",icon:s.jsx(me.ReloadOutlined,{}),disabled:!a,onClick:()=>a&&b(a.id)})]}),rows:o,rowKey:"id",loading:c,searchKeys:["itemCode","itemName"],searchPlaceholder:"按项编码 / 项名称过滤",cardProps:{size:"small"},columns:A}):s.jsx(u.Card,{size:"small",title:"字典项",children:s.jsx("div",{style:{padding:40,textAlign:"center",color:"#999"},children:"请在左侧选择一个字典类型以查看其字典项"})})]}),s.jsx(u.Modal,{title:m?"编辑字典类型":"新建字典类型",open:g,onOk:F,onCancel:()=>{f(!1),p(null),S.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(u.Form,{form:S,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"dictCode",label:"字典编码",rules:[{required:!0,max:64}],extra:"业务唯一,如 user_status",children:s.jsx(u.Input,{disabled:!!m,placeholder:"如 user_status"})}),s.jsx(u.Form.Item,{name:"dictName",label:"字典名称",rules:[{required:!0,max:128}],children:s.jsx(u.Input,{placeholder:"如 用户状态"})}),s.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(u.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(u.Form.Item,{name:"remark",label:"备注",children:s.jsx(u.Input.TextArea,{rows:2,maxLength:512})})]})}),s.jsx(u.Modal,{title:v?`编辑字典项 — ${(a==null?void 0:a.dictName)||""}`:`新建字典项 — ${(a==null?void 0:a.dictName)||""}`,open:y,onOk:V,onCancel:()=>{w(!1),x(null),C.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(u.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(u.Form.Item,{name:"itemCode",label:"项编码",rules:[{required:!0,max:64}],extra:"业务唯一",children:s.jsx(u.Input,{placeholder:"如 enabled"})}),s.jsx(u.Form.Item,{name:"itemName",label:"项名称",rules:[{required:!0,max:128}],children:s.jsx(u.Input,{placeholder:"如 启用"})}),s.jsx(u.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(u.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(u.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})})]})}let yF="/api";function Ya(){return Xt.createRequest({baseURL:yF,timeout:15e3})}const Nc={list:e=>Ya().get("/ctc/ac/login-log/list",{params:e}),page:e=>Ya().get("/ctc/ac/login-log/page",{params:e}),recent:()=>Ya().get("/ctc/ac/login-log/recent")};function xF(){return s.jsx("div",{children:s.jsx(u.Tabs,{defaultActiveKey:"login",size:"small",items:[{key:"login",label:s.jsxs("span",{children:[s.jsx(me.LoginOutlined,{})," 登录日志"]}),children:s.jsx(bF,{})},{key:"operation",label:s.jsxs("span",{children:[s.jsx(me.LoginOutlined,{})," 操作日志"]}),children:s.jsx(u.Card,{children:s.jsxs("div",{style:{padding:40,textAlign:"center",color:"#8a8f98"},children:[s.jsx("div",{style:{marginBottom:8,fontSize:14},children:"操作日志 - 规划中"}),s.jsxs("div",{style:{fontSize:12},children:["未来记录: 谁在什么时间对什么资源做了什么操作",s.jsx("br",{}),"(创建/修改/删除/审批/授权等)"]})]})}),disabled:!0}]})})}function bF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState([]),[o,l]=d.useState(!1),[c,h]=d.useState(0),[g,f]=d.useState({page:1,size:20}),[m,p]=d.useState({identifier:"",tenantCode:"",loginStatus:void 0}),S=async()=>{r(!0);try{const b=await Nc.recent();t(Array.isArray(b)?b:[])}catch{t([])}finally{r(!1)}},y=async b=>{const T=b||g;l(!0);try{const $=await Nc.list({...m,...T});i(($==null?void 0:$.list)||[]),h(($==null?void 0:$.total)||0)}catch{i([]),h(0)}finally{l(!1)}};d.useEffect(()=>{S(),y({page:1,size:20})},[]);const w=()=>y({page:1,size:20}),v=(b,T)=>{const $={page:b,size:T||g.size};f($),y($)},x=e.filter(b=>b.loginStatus===1).length,C=e.filter(b=>b.loginStatus!==1).length,j=[{title:"登录标识",dataIndex:"identifier",width:160},{title:"方式",dataIndex:"identityType",width:90,render:b=>s.jsx(u.Tag,{color:b===1?"blue":b===2?"purple":"cyan",children:b===1?"用户名":b===2?"邮箱":b===3?"手机":b||"-"})},{title:"结果",dataIndex:"loginStatus",width:80,render:b=>s.jsx(u.Tag,{color:b===1?"success":"error",children:b===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0,render:b=>b?s.jsx(u.Tooltip,{title:b,children:b}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"IP",dataIndex:"clientIp",width:130},{title:"租户",dataIndex:"tenantCode",width:100},{title:"域",dataIndex:"domainCode",width:100},{title:"UA",dataIndex:"userAgent",ellipsis:!0,render:b=>b?s.jsx(u.Tooltip,{title:b,children:s.jsx("span",{style:{fontFamily:"monospace",fontSize:12},children:b.length>60?b.slice(0,60)+"…":b})}):"-"},{title:"登录时间",dataIndex:"loginTime",width:170,render:b=>b?Te(b).format("YYYY-MM-DD HH:mm:ss"):"-"}];return s.jsxs(u.Space,{orientation:"vertical",size:12,style:{width:"100%"},children:[s.jsxs(u.Row,{gutter:12,children:[s.jsx(u.Col,{span:6,children:s.jsx(u.Card,{size:"small",children:s.jsx(u.Statistic,{title:"最近成功登录 (10 条内)",value:x,styles:{content:{color:"#52c41a",fontSize:20}},prefix:s.jsx(me.LoginOutlined,{})})})}),s.jsx(u.Col,{span:6,children:s.jsx(u.Card,{size:"small",children:s.jsx(u.Statistic,{title:"最近失败登录 (10 条内)",value:C,styles:{content:{color:"#ff4d4f",fontSize:20}}})})}),s.jsx(u.Col,{span:6,children:s.jsx(u.Card,{size:"small",children:s.jsx(u.Statistic,{title:"最近 10 条",value:e.length,styles:{content:{fontSize:20}}})})}),s.jsx(u.Col,{span:6,children:s.jsx(u.Card,{size:"small",children:s.jsx(u.Statistic,{title:"总日志数",value:c,loading:o,styles:{content:{fontSize:20}}})})})]}),s.jsxs(u.Card,{size:"small",title:s.jsxs(u.Space,{children:[s.jsx("span",{children:"登录日志"}),s.jsxs(u.Tag,{color:"cyan",children:[c," 条"]})]}),extra:s.jsxs(u.Space,{children:[s.jsxs("a",{onClick:S,children:[s.jsx(me.ReloadOutlined,{spin:n})," 刷新最近"]}),s.jsxs("a",{onClick:()=>y(),children:[s.jsx(me.ReloadOutlined,{spin:o})," 刷新列表"]})]}),children:[s.jsxs(u.Space,{wrap:!0,style:{marginBottom:12},children:[s.jsx(jt.SearchInput,{placeholder:"登录标识",value:m.identifier,onChange:b=>p({...m,identifier:b}),onSearch:w}),s.jsx(jt.SearchInput,{placeholder:"租户编码",value:m.tenantCode,onChange:b=>p({...m,tenantCode:b}),onSearch:w}),s.jsx(u.Select,{placeholder:"结果",allowClear:!0,style:{width:110},value:m.loginStatus,onChange:b=>p({...m,loginStatus:b}),options:[{value:1,label:"成功"},{value:0,label:"失败"}]}),s.jsxs("a",{onClick:w,children:[s.jsx(me.SearchOutlined,{})," 查询"]})]}),s.jsx(u.Table,{size:"small",rowKey:"id",loading:o,dataSource:a,columns:j,pagination:{current:g.page,pageSize:g.size,total:c,showSizeChanger:!0,showTotal:b=>`共 ${b} 条`,onChange:v}})]})]})}const gs=Xt.createRequest({baseURL:"/api",timeout:1e4}),Ua=e=>e?typeof e.total=="number"?e.total:Array.isArray(e)?e.length:Array.isArray(e.records)?e.records.length:0:0;function SF(){const[e,t]=d.useState({account:null,role:null,tenant:null,surl:null}),[n,r]=d.useState(!0);return d.useEffect(()=>{let a=!0;return Promise.all([gs.get("/ctc/ac/accounts",{params:{pageSize:1}}).then(i=>Ua(i)).catch(()=>0),gs.get("/ctc/authz/roles/list").then(i=>Ua(i)).catch(()=>0),gs.get("/ctc/ac/tenants/list").then(i=>i&&Array.isArray(i)?i.length:0).catch(()=>0),gs.get("/ctc/surl/list",{params:{pageSize:1}}).then(i=>Ua(i)).catch(()=>0)]).then(([i,o,l,c])=>{a&&(t({account:i,role:o,tenant:l,surl:c}),r(!1))}),()=>{a=!1}},[]),s.jsx("div",{style:{padding:24},children:s.jsxs(u.Row,{gutter:[16,16],children:[s.jsx(u.Col,{xs:24,sm:12,lg:6,children:s.jsx(u.Card,{loading:n,children:s.jsx(u.Statistic,{title:"账号数",value:e.account,prefix:s.jsx(me.TeamOutlined,{})})})}),s.jsx(u.Col,{xs:24,sm:12,lg:6,children:s.jsx(u.Card,{loading:n,children:s.jsx(u.Statistic,{title:"角色数",value:e.role,prefix:s.jsx(me.SafetyCertificateOutlined,{})})})}),s.jsx(u.Col,{xs:24,sm:12,lg:6,children:s.jsx(u.Card,{loading:n,children:s.jsx(u.Statistic,{title:"租户数",value:e.tenant,prefix:s.jsx(me.AppstoreOutlined,{})})})}),s.jsx(u.Col,{xs:24,sm:12,lg:6,children:s.jsx(u.Card,{loading:n,children:s.jsx(u.Statistic,{title:"短链数",value:e.surl,prefix:s.jsx(me.LinkOutlined,{})})})})]})})}const Hd=({name:e="4A"})=>s.jsxs(u.Button,{type:"primary",children:["Hello ",e,"(来自 @yuku123/z-ctc-component)"]}),CF={HelloCtc:Hd};Object.defineProperty(exports,"Button",{enumerable:!0,get:()=>u.Button});Object.defineProperty(exports,"Card",{enumerable:!0,get:()=>u.Card});Object.defineProperty(exports,"Form",{enumerable:!0,get:()=>u.Form});Object.defineProperty(exports,"Input",{enumerable:!0,get:()=>u.Input});Object.defineProperty(exports,"Space",{enumerable:!0,get:()=>u.Space});Object.defineProperty(exports,"Table",{enumerable:!0,get:()=>u.Table});exports.AccountManagement=QT;exports.ApplicationManagement=rF;exports.AuditPage=xF;exports.ComponentDocPage=nf;exports.CtcOverview=SF;exports.DictPage=pF;exports.HelloCtc=Hd;exports.MyTenantManagement=hf;exports.OrgManagement=Vc;exports.OrgPage=uf;exports.PermissionManagement=Bd;exports.ResourcePage=uF;exports.RoleManagement=cF;exports.StatusTag=af;exports.SurlManagement=hF;exports.TenantManagement=mf;exports.UserPermissionPage=fF;exports.UserTable=rf;exports.ctcAcDomainApi=_t;exports.ctcAcTenantApi=Kn;exports.default=CF;
62
+ `}),s.jsx(c.Tabs,{style:{flex:1,minHeight:0},activeKey:r,onChange:a,items:oF.map(P=>({key:P.key,label:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[P.icon,P.label]}),children:P.key==="roles"?as():P.key==="points"?Ra():P.key==="auth"?Ce():$a()})),destroyInactiveTabPane:!0}),s.jsx(c.Modal,{title:v?`编辑角色 — ${v.roleCode}`:"新增角色",open:y,onOk:v?va:Cr,onCancel:()=>{w(!1),x(null),C.resetFields()},okText:v?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0,message:"请输入角色编码"}],extra:"唯一标识,英文/下划线;创建后不可改",children:s.jsx(c.Input,{placeholder:"如 admin / dev / viewer",disabled:!!v})}),s.jsx(c.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0,message:"请输入角色名称"}],children:s.jsx(c.Input,{placeholder:"如 管理员"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"enabled",label:"启用",valuePropName:"checked",initialValue:!0,children:s.jsx(c.Switch,{checkedChildren:"启用",unCheckedChildren:"停用"})})]})}),s.jsx(c.Modal,{title:je?`编辑权限点 — ${je.resourceCode}`:"新建权限点",open:be,onOk:async()=>{var P;try{const te=await ze.validateFields();je?(await qe.updateResource(je.id,te),c.message.success("更新成功")):(await qe.createResource(te),c.message.success("创建成功")),Ee(!1),_e(null),ze.resetFields(),(P=he.current)==null||P.reload(),rt()}catch(te){if(te!=null&&te.errorFields)return;c.message.error("保存失败:"+((te==null?void 0:te.message)||"未知错误"))}},onCancel:()=>{Ee(!1),_e(null),ze.resetFields()},okText:je?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:ze,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0,min:2,max:128,pattern:/^[a-zA-Z0-9_:.-]+$/,message:"2-128 位字母数字下划线冒号"}],extra:"业务唯一,如 user:read / order:create",children:s.jsx(c.Input,{placeholder:"如 user:read",disabled:!!je})}),s.jsx(c.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 用户查询"})}),s.jsx(c.Form.Item,{name:"resourceType",label:"资源类型",rules:[{required:!0}],initialValue:3,children:s.jsx(c.Select,{options:Object.entries(to).map(([P,te])=>({value:Number(P),label:te.text}))})}),s.jsx(c.Form.Item,{name:"appCode",label:"所属应用",extra:"选择权限点归属的应用;不选则为「公共」",children:s.jsx(c.Select,{placeholder:"公共(跨应用)",allowClear:!0,showSearch:!0,optionFilterProp:"label",options:re})}),s.jsx(c.Form.Item,{name:"path",label:"URL 路径",extra:"菜单 / API 资源对应路径",children:s.jsx(c.Input,{placeholder:"如 /api/ctc/authorization/users"})}),s.jsx(c.Form.Item,{name:"method",label:"HTTP 方法",extra:"API 资源填 HTTP 方法;菜单/数据/按钮可留空",children:s.jsx(c.Select,{options:iF})}),s.jsx(c.Form.Item,{name:"icon",label:"图标 (菜单用)",children:s.jsx(c.Input,{placeholder:"如 UserOutlined"})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,maxLength:512,showCount:!0})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})}),s.jsx(c.Drawer,{title:Oe?`权限点详情 — ${Oe.resourceCode}`:"权限点详情",open:ve,onClose:()=>Ie(!1),size:720,destroyOnHidden:!0,children:Oe&&s.jsxs(c.Descriptions,{title:"权限点信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"资源ID",children:Oe.id}),s.jsx(c.Descriptions.Item,{label:"资源编码",children:s.jsx("span",{style:{fontFamily:"monospace"},children:Oe.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"资源名称",children:Oe.resourceName}),s.jsx(c.Descriptions.Item,{label:"资源类型",children:Gs(Oe.resourceType)}),s.jsx(c.Descriptions.Item,{label:"所属应用",span:2,children:Oe.appCode?s.jsx(c.Tag,{color:"cyan",children:Oe.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"URL 路径",span:2,children:Oe.path||"-"}),s.jsx(c.Descriptions.Item,{label:"HTTP 方法",children:Oe.method?s.jsx(c.Tag,{children:Oe.method}):"-"}),s.jsx(c.Descriptions.Item,{label:"图标",children:Oe.icon||"-"}),s.jsx(c.Descriptions.Item,{label:"排序",children:Oe.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:Oe.status===1?"success":"default",children:Oe.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"租户",span:2,children:Oe.tenantCode||"公共"}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:Oe.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:Oe.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:Oe.updatedAt||"-"})]})})]})}function uF(e){return s.jsx(Zd,{...e})}const Uc={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}};function dF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]);d.useEffect(()=>{Dr.listApplications({status:1}).then(h=>{const p=((h==null?void 0:h.records)||[]).map(S=>({value:S.appCode,label:`${S.appName} (${S.appCode})`}));o(p)}).catch(()=>o([]))},[]);const l=async h=>{try{const p=await qe.listResourcesByApp({appCode:r.appCode,type:r.type,keyword:r.keyword,pageNum:h.current,pageSize:h.pageSize}),S=(p==null?void 0:p.data)||[],y=(p==null?void 0:p.total)??S.length;return{data:S,success:!0,total:y}}catch(p){return c.message.error("查询资源失败:"+((p==null?void 0:p.message)||"未知错误")),{data:[],success:!1,total:0}}},u=()=>{var S;const h=n.getFieldsValue(),p={};h.appCode&&(p.appCode=h.appCode),h.type!==void 0&&h.type!==null&&(p.type=h.type),h.keyword&&(p.keyword=h.keyword),a(p),(S=t.current)==null||S.reload()},m=()=>{var h;n.resetFields(),a({}),(h=t.current)==null||h.reload()},g=async h=>{var p;try{await qe.deleteResource(h),c.message.success("已删除"),(p=t.current)==null||p.reload()}catch(S){c.message.error("删除失败:"+((S==null?void 0:S.message)||"未知错误"))}},f=[{title:"资源编码",dataIndex:"resourceCode",width:220,fixed:"left",search:!1,render:(h,p)=>s.jsx("span",{style:{fontFamily:"monospace"},children:p.resourceCode})},{title:"资源名称",dataIndex:"resourceName",width:160,search:!1},{title:"类型",dataIndex:"resourceType",width:80,search:!1,render:(h,p)=>{const S=Uc[p.resourceType??3]||{text:String(p.resourceType??"?"),color:"default"};return s.jsx(c.Tag,{color:S.color,children:S.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(h,p)=>p.appCode?s.jsx(c.Tag,{color:"cyan",children:p.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"URL",dataIndex:"path",width:220,ellipsis:!0,search:!1},{title:"方法",dataIndex:"method",width:80,search:!1,render:(h,p)=>p.method?s.jsx(c.Tag,{children:p.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(h,p)=>s.jsx(c.Tag,{color:p.status===1?"success":"default",children:p.status===1?"启用":"禁用"})},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:120,fixed:"right",search:!1,render:(h,p)=>[s.jsx(c.Popconfirm,{title:`删除资源 ${p.resourceCode}?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>g(p.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})},"delete")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(c.Card,{size:"small",style:{marginBottom:16},styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用",children:s.jsx(c.Select,{placeholder:"全部应用",allowClear:!0,style:{width:200},options:i,showSearch:!0,optionFilterProp:"label"})}),s.jsx(c.Form.Item,{name:"type",label:"类型",children:s.jsx(c.Select,{placeholder:"全部类型",allowClear:!0,style:{width:110},options:Object.entries(Uc).map(([h,p])=>({value:Number(h),label:p.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:u,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:m,children:"重置"})]})})]}),s.jsx(c.Space,{style:{flexShrink:0},children:s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var h;return(h=t.current)==null?void 0:h.reload()},children:"刷新"})})]})}),s.jsx(Sr,{actionRef:t,rowKey:"id",columns:f,request:l,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:15,showSizeChanger:!0,showTotal:h=>`共 ${h} 条`},dateFormatter:"string"})]})}const{Text:fF}=c.Typography;function hF({apiBaseURL:e}){const[t,n]=d.useState([]),[r,a]=d.useState(!1),[i,o]=d.useState(null),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState([]),[p,S]=d.useState(!1),[y,w]=d.useState([]),[v,x]=d.useState(null),[C,j]=d.useState(!1),b=async()=>{a(!0);try{const M=await sr.listAccounts({pageNum:1,pageSize:200}),k=Array.isArray(M)?M:(M==null?void 0:M.records)||(M==null?void 0:M.data)||[];n(k),k.length>0&&!i&&o(k[0].id)}catch{n([])}finally{a(!1)}};d.useEffect(()=>{b()},[]),d.useEffect(()=>{if(!i){u([]),h([]);return}g(!0),S(!0),sr.listUserRoles(i).then(M=>u(Array.isArray(M)?M:[])).catch(()=>u([])).finally(()=>g(!1)),sr.listUserPermissions(i).then(M=>h(Array.isArray(M)?M:[])).catch(()=>h([])).finally(()=>S(!1))},[i]),d.useEffect(()=>{if(!v){w([]);return}j(!0),sr.listRoleResources(v).then(M=>{const k=Array.isArray(M)?M:[],V={};k.forEach(A=>{const I=A.resourceType||"OTHER";V[I]||(V[I]=[]),V[I].push(A)});const _=Object.entries(V).map(([A,I])=>({title:`${A} (${I.length})`,key:`type-${A}`,children:I.map($=>({title:`${$.resourceName} (${$.resourceCode})`,key:`res-${$.id}`,raw:$}))}));w(_)}).catch(()=>w([])).finally(()=>j(!1))},[v]);const T=t.map(M=>({value:M.id,label:`${M.username||M.nickname||M.id} (${M.tenantCode||"default"})`})),[R,F]=d.useState(""),E=d.useMemo(()=>{const M=R.trim().toLowerCase();return M?l.filter(k=>`${k.roleCode||""} ${k.roleName||""}`.toLowerCase().includes(M)):l},[l,R]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(Ft.TableToolbar,{left:s.jsx(c.Select,{showSearch:!0,placeholder:"选择用户",style:{width:320},value:i,onChange:o,loading:r,options:T,filterOption:(M,k)=>k.label.toLowerCase().includes(M.toLowerCase())}),right:s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:b,children:"刷新用户"})}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16},children:[s.jsx(c.Card,{size:"small",title:`用户角色 (${l.length})`,loading:m,extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按角色编码 / 名称过滤",style:{width:220},onChange:M=>F(M.target.value)}),children:l.length===0&&!m?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该用户暂无角色"}):s.jsx(c.List,{size:"small",dataSource:E,renderItem:M=>s.jsx(c.List.Item,{actions:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>x(M.id),disabled:M.id===v,children:M.id===v?"查看中":"查看资源"},"res")],children:s.jsx(c.List.Item.Meta,{title:s.jsxs(c.Space,{children:[s.jsx(fF,{strong:!0,children:M.roleName||M.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:M.roleCode})]}),description:M.description||"-"})})})}),s.jsx(Ft.ListTable,{cardTitle:`用户权限 (${f.length})`,rows:f,rowKey:(M,k)=>M.code||M.resourceCode||M.id||k,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该用户暂无直接权限",columns:[{title:"资源编码",dataIndex:"code",width:200,render:(M,k)=>s.jsx("span",{style:{fontFamily:"monospace"},children:k.code||k.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(M,k)=>k.name||k.resourceName||"-"}],cardProps:{size:"small",loading:p}}),s.jsx(c.Card,{size:"small",title:v?`角色资源 (${y.reduce((M,k)=>{var V;return M+(((V=k.children)==null?void 0:V.length)||0)},0)})`:"角色资源",loading:C,children:v?y.length===0&&!C?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该角色暂无资源"}):s.jsx(c.Tree,{treeData:y,defaultExpandAll:!0,selectable:!1,showLine:!0,blockNode:!0,height:420}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"左侧点击「查看资源」以查看该角色拥有的权限点"})})]})]})}let Jd="/api";function mF(e){Jd=e||"/api"}function ci(){return nn.createRequest({baseURL:Jd,timeout:15e3})}const Tn={shorten:e=>ci().post("/ctc/surl/shorten",e),info:e=>ci().get("/ctc/surl/info",{params:{mapKey:e}}),invalidate:e=>ci().delete("/ctc/surl",{params:{mapKey:e}}),buildUrl:e=>`${typeof window<"u"&&window.location&&window.location.origin||""}/s/${encodeURIComponent(e)}`},Yc="z_surl_history";function gF({apiBaseURL:e}){e&&mF(e);const[t]=c.Form.useForm(),n=d.useRef(void 0),[r,a]=d.useState(null),[i,o]=d.useState(()=>JSON.parse(localStorage.getItem(Yc)||"[]")),[l,u]=d.useState(!1),[m,g]=d.useState(""),f=d.useMemo(()=>{const v=m.trim().toLowerCase();return v?i.filter(x=>`${x.mapKey||""} ${x.originUrl||""} ${x.remark||""}`.toLowerCase().includes(v)):i},[i,m]),h=v=>{o(v),localStorage.setItem(Yc,JSON.stringify(v))},p=async v=>{var x;u(!0);try{const C=await Tn.shorten({originUrl:v.originUrl,ttlMillis:v.ttlMillis||0,remark:v.remark});a(C);const j=Tn.buildUrl(C.mapKey),b={mapKey:C.mapKey,originUrl:C.originUrl,expireAt:C.expireAt,hits:C.hits,remark:v.remark,createdAt:new Date().toISOString()};h([b,...i]),c.message.success(`短链生成成功:${j}`),(x=n.current)==null||x.reload()}catch(C){c.message.error("生成失败:"+((C==null?void 0:C.message)||"未知错误"))}finally{u(!1)}},S=async v=>{try{await navigator.clipboard.writeText(v),c.message.success("已复制到剪贴板")}catch{c.message.error("复制失败,请手动复制")}},y=async v=>{var x;try{await Tn.invalidate(v),c.message.success("已失效"),h(i.filter(C=>C.mapKey!==v)),(x=n.current)==null||x.reload()}catch(C){h(i.filter(j=>j.mapKey!==v)),c.message.warning("后端失效失败,已从本地移除:"+((C==null?void 0:C.message)||""))}},w=[{title:"短码",dataIndex:"mapKey",width:120,fixed:"left"},{title:"完整短链",dataIndex:"mapKey",width:280,render:(v,x)=>{const C=Tn.buildUrl(x.mapKey);return s.jsxs(c.Space,{size:4,children:[s.jsx("a",{href:C,target:"_blank",rel:"noreferrer",children:C}),s.jsx(c.Tooltip,{title:"复制",children:s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(de.CopyOutlined,{}),onClick:()=>S(C)})})]})}},{title:"原始URL",dataIndex:"originUrl",width:280,ellipsis:!0},{title:"备注",dataIndex:"remark",width:160,ellipsis:!0},{title:"命中次数",dataIndex:"hits",width:90,valueType:"digit"},{title:"过期时间",dataIndex:"expireAt",width:170,render:(v,x)=>x.expireAt?new Date(x.expireAt).toLocaleString():s.jsx(c.Tag,{color:"green",children:"永久"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime"},{title:"操作",valueType:"option",width:100,fixed:"right",render:(v,x)=>[s.jsx(c.Popconfirm,{title:"失效该短链?",onConfirm:()=>y(x.mapKey),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"失效"})},"del")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs(c.Card,{title:s.jsxs(s.Fragment,{children:[s.jsx(de.LinkOutlined,{})," 生成短链"]}),children:[s.jsxs(bt,{form:t,layout:"inline",onFinish:p,submitter:{render:v=>[s.jsx(c.Button,{onClick:()=>{var x;return(x=v.form)==null?void 0:x.resetFields()},children:"重置"},"reset"),s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),loading:l,onClick:()=>{var x;return(x=v.form)==null?void 0:x.submit()},children:"生成"},"submit")]},children:[s.jsx(ua,{name:"originUrl",label:"原始URL",width:"md",rules:[{required:!0,message:"请输入要缩短的URL"},{type:"url",message:"请输入合法的URL"}],placeholder:"https://example.com/some/very/long/path?param=1"}),s.jsx(M0,{name:"ttlMillis",label:"有效期(ms)",width:"sm",min:0,placeholder:"0 = 永久",tooldescription:"0 = 永久;其它填毫秒数,如 86400000 = 1天"}),s.jsx(ua,{name:"remark",label:"备注",width:"sm",placeholder:"可选"})]}),r&&s.jsxs("div",{style:{marginTop:16,padding:16,background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx("b",{children:"生成结果:"})}),s.jsxs(c.Space,{orientation:"vertical",style:{width:"100%"},children:[s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"短码:"}),s.jsx(c.Tag,{color:"green",children:r.mapKey})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"完整短链:"}),s.jsx("a",{href:Tn.buildUrl(r.mapKey),target:"_blank",rel:"noreferrer",children:Tn.buildUrl(r.mapKey)}),s.jsx(c.Button,{type:"link",size:"small",icon:s.jsx(de.CopyOutlined,{}),onClick:()=>S(Tn.buildUrl(r.mapKey)),children:"复制"})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"原始URL:"}),s.jsx("span",{style:{wordBreak:"break-all"},children:r.originUrl})]})]})]})]}),s.jsx(c.Card,{title:"历史短链",style:{marginTop:16},extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按短码 / 原始 URL / 备注过滤",style:{width:260},onChange:v=>g(v.target.value)}),children:s.jsx(Sr,{actionRef:n,rowKey:"mapKey",columns:w,dataSource:f,search:!1,pagination:{pageSize:10,showSizeChanger:!0},toolBarRender:()=>[s.jsx(c.Button,{onClick:()=>h([]),children:"清空历史"},"clear"),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var v;return(v=n.current)==null?void 0:v.reload()},children:"刷新"},"reload")]})})]})}let pF="/api";function Bt(){return nn.createRequest({baseURL:pF,timeout:15e3})}const un={listDictType:e=>Bt().get("/dict/type/list",{params:e}),getDictType:e=>Bt().get("/dict/type/get",{params:{id:e}}),createDictType:e=>Bt().post("/dict/type",e),updateDictType:(e,t)=>Bt().put("/dict/type",t,{params:{id:e}}),deleteDictType:e=>Bt().delete("/dict/type",{params:{id:e}}),listDictItem:e=>Bt().get("/dict/item/list",{params:{dictId:e}}),listDictItemByCode:e=>Bt().get("/dict/items/get",{params:{dictCode:e}}),createDictItem:e=>Bt().post("/dict/item",e),updateDictItem:(e,t)=>Bt().put("/dict/item",t,{params:{id:e}}),deleteDictItem:e=>Bt().delete("/dict/item",{params:{id:e}})};function yF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState(null),[o,l]=d.useState([]),[u,m]=d.useState(!1),[g,f]=d.useState(!1),[h,p]=d.useState(null),[S]=c.Form.useForm(),[y,w]=d.useState(!1),[v,x]=d.useState(null),[C]=c.Form.useForm(),j=async()=>{r(!0);try{const I=await un.listDictType({pageNum:1,pageSize:200}),$=(I==null?void 0:I.records)||(I==null?void 0:I.data)||I||[];t(Array.isArray($)?$:[])}catch(I){c.message.error("加载字典类型失败:"+((I==null?void 0:I.message)||"未知错误")),t([])}finally{r(!1)}};d.useEffect(()=>{j()},[]);const b=async I=>{if(!I){l([]);return}m(!0);try{const $=await un.listDictItem(I);l(Array.isArray($)?$:[])}catch($){c.message.error("加载字典项失败:"+(($==null?void 0:$.message)||"未知错误")),l([])}finally{m(!1)}};d.useEffect(()=>{a!=null&&a.id?b(a.id):l([])},[a==null?void 0:a.id]);const T=()=>{p(null),S.resetFields(),f(!0)},R=I=>{p(I),S.setFieldsValue({dictCode:I.dictCode,dictName:I.dictName,status:I.status??1,remark:I.remark}),f(!0)},F=async()=>{try{const I=await S.validateFields();h?(await un.updateDictType(h.id,I),c.message.success("更新成功")):(await un.createDictType(I),c.message.success("创建成功")),f(!1),p(null),S.resetFields(),j()}catch(I){if(I!=null&&I.errorFields)return;c.message.error((h?"更新失败:":"创建失败:")+((I==null?void 0:I.message)||"未知错误"))}},E=async I=>{try{await un.deleteDictType(I),c.message.success("已删除"),(a==null?void 0:a.id)===I&&i(null),j()}catch($){c.message.error("删除失败:"+(($==null?void 0:$.message)||"未知错误"))}},M=()=>{if(!a){c.message.warning("请先选择左侧的字典类型");return}x(null),C.resetFields(),w(!0)},k=I=>{x(I),C.setFieldsValue({itemCode:I.itemCode,itemName:I.itemName,sortOrder:I.sortOrder??0,status:I.status??1}),w(!0)},V=async()=>{try{const $={...await C.validateFields(),dictId:a.id};v?(await un.updateDictItem(v.id,$),c.message.success("更新成功")):(await un.createDictItem($),c.message.success("创建成功")),w(!1),x(null),C.resetFields(),b(a.id)}catch(I){if(I!=null&&I.errorFields)return;c.message.error((v?"更新失败:":"创建失败:")+((I==null?void 0:I.message)||"未知错误"))}},_=async I=>{try{await un.deleteDictItem(I),c.message.success("已删除"),b(a.id)}catch($){c.message.error("删除失败:"+(($==null?void 0:$.message)||"未知错误"))}},A=[{title:"项编码",dataIndex:"itemCode",width:160,render:I=>s.jsx("span",{style:{fontFamily:"monospace"},children:I})},{title:"项名称",dataIndex:"itemName",width:160},{title:"排序",dataIndex:"sortOrder",width:80},{title:"状态",dataIndex:"status",width:80,render:I=>s.jsx(c.Tag,{color:I===1?"success":"default",children:I===1?"启用":"禁用"})},{title:"操作",width:120,render:(I,$)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>k($),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该字典项?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>_($.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:16},children:[s.jsx(Ft.ListTable,{cardTitle:`字典类型 (${e.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:T,children:"新增"}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:j})]}),rows:e,rowKey:"id",searchKeys:["dictCode","dictName"],searchPlaceholder:"搜索编码 / 名称",cardProps:{size:"small",loading:n},tableProps:{onRow:I=>({onClick:()=>i(I),style:{cursor:"pointer",background:(a==null?void 0:a.id)===I.id?"#e6f4ff":void 0}})},columns:[{title:"编码",dataIndex:"dictCode",width:100,ellipsis:!0,render:I=>s.jsx("span",{style:{fontFamily:"monospace"},children:I})},{title:"名称",dataIndex:"dictName",width:110,ellipsis:!0},{title:"状态",dataIndex:"status",width:60,render:I=>s.jsx(c.Tag,{color:I===1?"success":"default",children:I===1?"启":"禁"})},{title:"操作",width:100,render:(I,$)=>s.jsxs(c.Space,{onClick:D=>D.stopPropagation(),children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>R($),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该类型?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>E($.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}]}),a?s.jsx(Ft.ListTable,{cardTitle:`字典项 — ${a.dictName} (${o.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:M,disabled:!a,children:"新增项"}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),disabled:!a,onClick:()=>a&&b(a.id)})]}),rows:o,rowKey:"id",loading:u,searchKeys:["itemCode","itemName"],searchPlaceholder:"按项编码 / 项名称过滤",cardProps:{size:"small"},columns:A}):s.jsx(c.Card,{size:"small",title:"字典项",children:s.jsx("div",{style:{padding:40,textAlign:"center",color:"#999"},children:"请在左侧选择一个字典类型以查看其字典项"})})]}),s.jsx(c.Modal,{title:h?"编辑字典类型":"新建字典类型",open:g,onOk:F,onCancel:()=>{f(!1),p(null),S.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(c.Form,{form:S,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dictCode",label:"字典编码",rules:[{required:!0,max:64}],extra:"业务唯一,如 user_status",children:s.jsx(c.Input,{disabled:!!h,placeholder:"如 user_status"})}),s.jsx(c.Form.Item,{name:"dictName",label:"字典名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 用户状态"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(c.Form.Item,{name:"remark",label:"备注",children:s.jsx(c.Input.TextArea,{rows:2,maxLength:512})})]})}),s.jsx(c.Modal,{title:v?`编辑字典项 — ${(a==null?void 0:a.dictName)||""}`:`新建字典项 — ${(a==null?void 0:a.dictName)||""}`,open:y,onOk:V,onCancel:()=>{w(!1),x(null),C.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(c.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"itemCode",label:"项编码",rules:[{required:!0,max:64}],extra:"业务唯一",children:s.jsx(c.Input,{placeholder:"如 enabled"})}),s.jsx(c.Form.Item,{name:"itemName",label:"项名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 启用"})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})})]})}let xF="/api";function ui(){return nn.createRequest({baseURL:xF,timeout:15e3})}const Kc={list:e=>ui().get("/ctc/ac/login-log/list",{params:e}),page:e=>ui().get("/ctc/ac/login-log/page",{params:e}),recent:()=>ui().get("/ctc/ac/login-log/recent")};function bF(){return s.jsx("div",{children:s.jsx(c.Tabs,{defaultActiveKey:"login",size:"small",items:[{key:"login",label:s.jsxs("span",{children:[s.jsx(de.LoginOutlined,{})," 登录日志"]}),children:s.jsx(SF,{})},{key:"operation",label:s.jsxs("span",{children:[s.jsx(de.LoginOutlined,{})," 操作日志"]}),children:s.jsx(c.Card,{children:s.jsxs("div",{style:{padding:40,textAlign:"center",color:"#8a8f98"},children:[s.jsx("div",{style:{marginBottom:8,fontSize:14},children:"操作日志 - 规划中"}),s.jsxs("div",{style:{fontSize:12},children:["未来记录: 谁在什么时间对什么资源做了什么操作",s.jsx("br",{}),"(创建/修改/删除/审批/授权等)"]})]})}),disabled:!0}]})})}function SF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState([]),[o,l]=d.useState(!1),[u,m]=d.useState(0),[g,f]=d.useState({page:1,size:20}),[h,p]=d.useState({identifier:"",tenantCode:"",loginStatus:void 0}),S=async()=>{r(!0);try{const b=await Kc.recent();t(Array.isArray(b)?b:[])}catch{t([])}finally{r(!1)}},y=async b=>{const T=b||g;l(!0);try{const R=await Kc.list({...h,...T});i((R==null?void 0:R.list)||[]),m((R==null?void 0:R.total)||0)}catch{i([]),m(0)}finally{l(!1)}};d.useEffect(()=>{S(),y({page:1,size:20})},[]);const w=()=>y({page:1,size:20}),v=(b,T)=>{const R={page:b,size:T||g.size};f(R),y(R)},x=e.filter(b=>b.loginStatus===1).length,C=e.filter(b=>b.loginStatus!==1).length,j=[{title:"登录标识",dataIndex:"identifier",width:160},{title:"方式",dataIndex:"identityType",width:90,render:b=>s.jsx(c.Tag,{color:b===1?"blue":b===2?"purple":"cyan",children:b===1?"用户名":b===2?"邮箱":b===3?"手机":b||"-"})},{title:"结果",dataIndex:"loginStatus",width:80,render:b=>s.jsx(c.Tag,{color:b===1?"success":"error",children:b===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0,render:b=>b?s.jsx(c.Tooltip,{title:b,children:b}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"IP",dataIndex:"clientIp",width:130},{title:"租户",dataIndex:"tenantCode",width:100},{title:"域",dataIndex:"domainCode",width:100},{title:"UA",dataIndex:"userAgent",ellipsis:!0,render:b=>b?s.jsx(c.Tooltip,{title:b,children:s.jsx("span",{style:{fontFamily:"monospace",fontSize:12},children:b.length>60?b.slice(0,60)+"…":b})}):"-"},{title:"登录时间",dataIndex:"loginTime",width:170,render:b=>b?Re(b).format("YYYY-MM-DD HH:mm:ss"):"-"}];return s.jsxs(c.Space,{orientation:"vertical",size:12,style:{width:"100%"},children:[s.jsxs(c.Row,{gutter:12,children:[s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近成功登录 (10 条内)",value:x,styles:{content:{color:"#52c41a",fontSize:20}},prefix:s.jsx(de.LoginOutlined,{})})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近失败登录 (10 条内)",value:C,styles:{content:{color:"#ff4d4f",fontSize:20}}})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近 10 条",value:e.length,styles:{content:{fontSize:20}}})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"总日志数",value:u,loading:o,styles:{content:{fontSize:20}}})})})]}),s.jsxs(c.Card,{size:"small",title:s.jsxs(c.Space,{children:[s.jsx("span",{children:"登录日志"}),s.jsxs(c.Tag,{color:"cyan",children:[u," 条"]})]}),extra:s.jsxs(c.Space,{children:[s.jsxs("a",{onClick:S,children:[s.jsx(de.ReloadOutlined,{spin:n})," 刷新最近"]}),s.jsxs("a",{onClick:()=>y(),children:[s.jsx(de.ReloadOutlined,{spin:o})," 刷新列表"]})]}),children:[s.jsxs(c.Space,{wrap:!0,style:{marginBottom:12},children:[s.jsx(Ft.SearchInput,{placeholder:"登录标识",value:h.identifier,onChange:b=>p({...h,identifier:b}),onSearch:w}),s.jsx(Ft.SearchInput,{placeholder:"租户编码",value:h.tenantCode,onChange:b=>p({...h,tenantCode:b}),onSearch:w}),s.jsx(c.Select,{placeholder:"结果",allowClear:!0,style:{width:110},value:h.loginStatus,onChange:b=>p({...h,loginStatus:b}),options:[{value:1,label:"成功"},{value:0,label:"失败"}]}),s.jsxs("a",{onClick:w,children:[s.jsx(de.SearchOutlined,{})," 查询"]})]}),s.jsx(c.Table,{size:"small",rowKey:"id",loading:o,dataSource:a,columns:j,pagination:{current:g.page,pageSize:g.size,total:u,showSizeChanger:!0,showTotal:b=>`共 ${b} 条`,onChange:v}})]})]})}const As=nn.createRequest({baseURL:"/api",timeout:1e4}),di=e=>e?typeof e.total=="number"?e.total:Array.isArray(e)?e.length:Array.isArray(e.records)?e.records.length:0:0;function CF(){const[e,t]=d.useState({account:null,role:null,tenant:null,surl:null}),[n,r]=d.useState(!0);return d.useEffect(()=>{let a=!0;return Promise.all([As.get("/ctc/ac/accounts",{params:{pageSize:1}}).then(i=>di(i)).catch(()=>0),As.get("/ctc/authz/roles/list").then(i=>di(i)).catch(()=>0),As.get("/ctc/ac/tenants/list").then(i=>i&&Array.isArray(i)?i.length:0).catch(()=>0),As.get("/ctc/surl/list",{params:{pageSize:1}}).then(i=>di(i)).catch(()=>0)]).then(([i,o,l,u])=>{a&&(t({account:i,role:o,tenant:l,surl:u}),r(!1))}),()=>{a=!1}},[]),s.jsx("div",{style:{padding:24},children:s.jsxs(c.Row,{gutter:[16,16],children:[s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"账号数",value:e.account,prefix:s.jsx(de.TeamOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"角色数",value:e.role,prefix:s.jsx(de.SafetyCertificateOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"租户数",value:e.tenant,prefix:s.jsx(de.AppstoreOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"短链数",value:e.surl,prefix:s.jsx(de.LinkOutlined,{})})})})]})})}const Xd=({name:e="4A"})=>s.jsxs(c.Button,{type:"primary",children:["Hello ",e,"(来自 @yuku123/z-ctc-component)"]}),wF={HelloCtc:Xd};Object.defineProperty(exports,"Button",{enumerable:!0,get:()=>c.Button});Object.defineProperty(exports,"Card",{enumerable:!0,get:()=>c.Card});Object.defineProperty(exports,"Form",{enumerable:!0,get:()=>c.Form});Object.defineProperty(exports,"Input",{enumerable:!0,get:()=>c.Input});Object.defineProperty(exports,"Space",{enumerable:!0,get:()=>c.Space});Object.defineProperty(exports,"Table",{enumerable:!0,get:()=>c.Table});exports.AccountManagement=tF;exports.ApplicationManagement=aF;exports.AuditPage=bF;exports.ComponentDocPage=sf;exports.CtcOverview=CF;exports.DictPage=yF;exports.HelloCtc=Xd;exports.MyTenantManagement=pf;exports.OrgManagement=Jc;exports.OrgPage=ff;exports.PermissionManagement=Zd;exports.ResourcePage=dF;exports.RoleManagement=uF;exports.StatusTag=lf;exports.SurlManagement=gF;exports.TenantManagement=gf;exports.UserPermissionPage=hF;exports.UserTable=af;exports.ctcAcDomainApi=Ut;exports.ctcAcTenantApi=er;exports.default=wF;