@yuku123/z-ctc-component 1.0.9 → 1.0.10
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 +25 -25
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7242 -7032
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var qd=Object.defineProperty;var Gd=(e,t,n)=>t in e?qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>Gd(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("antd"),mt=require("@yuku123/z-frontend-common/ui"),se=require("@ant-design/icons"),d=require("react"),Zt=require("@yuku123/z-frontend-common");require("react-dom/client");const Nc=require("react-dom");function Zd(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 ge=Zd(d),Jd="# 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 Xd(){return a.jsx(mt.ComponentDoc,{markdown:Jd,title:"组件文档 — z-ctc"})}function Qd({dataSource:e,loading:t,onEdit:n,onDelete:r,onRefresh:s}){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=>a.jsx(u.Tag,{color:o===1?"green":"red",children:o===1?"正常":"禁用"})},{title:"操作",key:"action",render:(o,l)=>a.jsxs(u.Space,{children:[a.jsx(u.Button,{size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>n==null?void 0:n(l),children:"编辑"}),a.jsx(u.Button,{size:"small",danger:!0,icon:a.jsx(se.DeleteOutlined,{}),onClick:()=>r==null?void 0:r(l),children:"删除"})]})}];return a.jsx(mt.ListTable,{rows:e,columns:i,loading:t,rowKey:"id",searchKeys:["userName","nickName","phone","email"],searchPlaceholder:"按用户名 / 昵称 / 手机号 / 邮箱过滤"})}const ef={1:{color:"green",text:"正常"},0:{color:"red",text:"禁用"},pending:{color:"orange",text:"待处理"},approved:{color:"blue",text:"已通过"},rejected:{color:"red",text:"已拒绝"}};function tf({status:e,map:t}){const n=(t==null?void 0:t[e])||ef[e]||{color:"default",text:e};return a.jsx(u.Tag,{color:n.color,children:n.text})}let Lc="/api";function nf(e){Lc=e||"/api"}function ut(){return Zt.createRequest({baseURL:Lc,timeout:15e3})}const ua={create:e=>ut().post("/ctc/ac/orgs",e),listByDomain:(e,t)=>ut().get("/ctc/ac/orgs/list",{params:{tenantCode:e,domainCode:t}}),getByCode:(e,t,n)=>ut().get("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}}),update:(e,t,n,r)=>ut().put("/ctc/ac/orgs",r,{params:{tenantCode:e,domainCode:t,orgCode:n}}),delete:(e,t,n)=>ut().delete("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}})},Yr={create:e=>ut().post("/ctc/ac/depts",e),listByOrg:(e,t,n)=>ut().get("/ctc/ac/depts/list",{params:{tenantCode:e,domainCode:t,orgCode:n}}),getByCode:(e,t,n,r)=>ut().get("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),update:(e,t,n,r)=>ut().put("/ctc/ac/depts",r,{params:{tenantCode:e,domainCode:t,deptCode:n}}),delete:(e,t,n,r)=>ut().delete("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}})},da={create:e=>ut().post("/ctc/ac/groups",e),listByDept:(e,t,n)=>ut().get("/ctc/ac/groups/list",{params:{tenantCode:e,domainCode:t,deptCode:n}}),getByCode:(e,t,n,r)=>ut().get("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),update:(e,t,n,r,s)=>ut().put("/ctc/ac/groups",s,{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),delete:(e,t,n,r)=>ut().delete("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}})},rf="z_org_ext_config",go={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Et={org:{label:"组织",color:"#1677ff"},dept:{label:"部门",color:"#52c41a"},group:{label:"组别",color:"#fa8c16"}};function xn(e,t){return`${e}:${t}`}function nn(e,t){return t==="org"?e.orgCode:t==="dept"?e.deptCode:e.groupCode}function Ur(e){return e.orgName||e.deptName||e.groupName||""}function Kr(e){return e.groupCode?"group":e.deptCode?"dept":"org"}function po(e,t){try{return JSON.parse(localStorage.getItem(t)||"{}")[e]||[]}catch{return[]}}function yo(e,t,n){const r=JSON.parse(localStorage.getItem(n)||"{}");r[e]=t,localStorage.setItem(n,JSON.stringify(r))}function _c({tenants:e=[],domains:t=[],selectedTenant:n=null,selectedDomain:r=null,onTenantChange:s,onDomainChange:i,apiBaseURL:o,extConfigStorageKey:l=rf}){var pe,be;d.useEffect(()=>{o&&nf(o)},[o]);const[c,h]=d.useState({}),[g,f]=d.useState({}),[m,p]=d.useState({}),[S,y]=d.useState([]),[j,v]=d.useState([]),[x,w]=d.useState([]),[C,b]=d.useState(null),[T,F]=d.useState([]),[$,M]=d.useState([]),[I,A]=d.useState(!1),[Y,H]=d.useState(null),[k]=u.Form.useForm(),[E,R]=d.useState(!1),[z,_]=d.useState(null),[V,Z]=d.useState(null),[B]=u.Form.useForm(),U=d.useCallback(async(ne,ae)=>{if(!ne||!ae)return[];const Q=await ua.listByDomain(ne,ae),fe=Array.isArray(Q)?Q:[];return h(me=>({...me,[ae]:fe})),fe},[]),J=d.useCallback(async(ne,ae,Q)=>{if(!ne||!ae||!Q)return[];const fe=await Yr.listByOrg(ne,ae,Q),me=Array.isArray(fe)?fe:[];return f(ve=>({...ve,[Q]:me})),me},[]),G=d.useCallback(async(ne,ae,Q)=>{if(!ne||!ae||!Q)return[];const fe=await da.listByDept(ne,ae,Q),me=Array.isArray(fe)?fe:[];return p(ve=>({...ve,[Q]:me})),me},[]);d.useEffect(()=>{if(!n||!r){y([]);return}if(!c[r]){U(n,r);return}const ae=(c[r]||[]).map(Q=>({key:xn("org",Q.orgCode),title:a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[a.jsx(u.Tag,{color:Et.org.color,style:{margin:0},children:"组织"}),Q.orgName||Q.orgCode,Q.status===0&&a.jsx(u.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"org",data:Q},isLeaf:!1}));y(ae)},[n,r,c,U]);const K=async ne=>{const{key:ae,data:Q,type:fe}=ne;let me=[];fe==="org"?me=(await J(n,r,Q.orgCode)).map(Ee=>({key:xn("dept",Ee.deptCode),title:a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[a.jsx(u.Tag,{color:Et.dept.color,style:{margin:0},children:"部门"}),Ee.deptName||Ee.deptCode,Ee.status===0&&a.jsx(u.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"dept",data:Ee},isLeaf:!1})):fe==="dept"&&(me=(await G(n,r,Q.deptCode)).map(Ee=>({key:xn("group",Ee.groupCode),title:a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[a.jsx(u.Tag,{color:Et.group.color,style:{margin:0},children:"组"}),Ee.groupName||Ee.groupCode,Ee.status===0&&a.jsx(u.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"group",data:Ee},isLeaf:!0}))),y(ve=>O(ve,ae,me))},O=(ne,ae,Q)=>ne.map(fe=>fe.key===ae?{...fe,children:Q}:fe.children?{...fe,children:O(fe.children,ae,Q)}:fe),P=(ne,ae)=>{if(!ne||ne.length===0)return;const Q=ne[0];w([Q]);const fe=ae.node.data;b(fe),F(po(Q,l)),fe.type==="org"?M(g[fe.data.orgCode]||[]):fe.type==="dept"?M(m[fe.data.deptCode]||[]):M([])},N=ne=>{var Ee;const ae=ne.data,Q=ae==null?void 0:ae.type,fe=ae==null?void 0:ae.data,me=Q==="org"?[{key:"org",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:Et.org.color,children:"组织"})," 新增组织"]})},{key:"dept",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:Et.dept.color,children:"部门"})," 新增部门"]})}]:Q==="dept"?[{key:"group",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:Et.group.color,children:"组别"})," 新增组别"]})}]:[],ve=Q&&((Ee=Et[Q])==null?void 0:Ee.label)||"节点";return a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},onClick:Te=>Te.stopPropagation(),children:[a.jsx("span",{style:{flex:1},children:ne.title}),me.length>0&&a.jsx(u.Dropdown,{menu:{items:me,onClick:({key:Te})=>L(Te,fe)},trigger:["click"],children:a.jsx(u.Button,{size:"small",type:"text",icon:a.jsx(se.PlusOutlined,{style:{fontSize:11}}),onClick:Te=>Te.stopPropagation()})}),a.jsx(u.Popconfirm,{title:`确定删除该${ve}?`,onConfirm:()=>Q&&D(Q,fe),onCancel:Te=>Te==null?void 0:Te.stopPropagation(),okText:"确定",cancelText:"取消",children:a.jsx(u.Button,{size:"small",type:"text",danger:!0,icon:a.jsx(se.DeleteOutlined,{style:{fontSize:11}}),onClick:Te=>Te.stopPropagation()})})]})},D=async(ne,ae)=>{try{const Q=ae.tenantCode||n,fe=ae.domainCode||r;if(!Q||!fe){u.message.error("租户/域信息缺失, 无法删除");return}ne==="org"?(await ua.delete(Q,fe,ae.orgCode),await U(Q,fe)):ne==="dept"?(await Yr.delete(Q,fe,ae.deptCode,ae.orgCode),ae.orgCode&&await J(Q,fe,ae.orgCode)):ne==="group"&&(await da.delete(Q,fe,ae.deptCode,ae.groupCode),ae.deptCode&&await G(Q,fe,ae.deptCode)),u.message.success("删除成功"),C&&nn(C.data,C.type)===nn(ae,ne)&&(b(null),F([]),M([]),w([]))}catch(Q){u.message.error("删除失败:"+((Q==null?void 0:Q.message)||"未知错误"))}},L=(ne,ae)=>{_(ne),Z(ae),B.resetFields(),ae&&B.setFieldsValue({tenantCode:ae.tenantCode||n,domainCode:ae.domainCode||r,orgCode:ae.orgCode,deptCode:ae.deptCode}),R(!0)},W=async()=>{if(z)try{const ne=await B.validateFields(),ae={...ne,status:ne.status??1,description:ne.description||"",extConfig:"[]"};if(z==="org"){await ua.create(ae);const Q=ae.domainCode||r;Q&&await U(ae.tenantCode,Q)}else if(z==="dept"){await Yr.create(ae);const Q=ae.orgCode;if(Q&&await J(ae.tenantCode,ae.domainCode,Q),(C==null?void 0:C.type)==="org"&&C.data.orgCode===Q){const fe=await Yr.listByOrg(ae.tenantCode,ae.domainCode,Q);M(fe)}}else if(z==="group"){await da.create(ae);const Q=ae.deptCode;Q&&await G(ae.tenantCode,ae.domainCode,Q)}u.message.success("创建成功"),R(!1)}catch(ne){if(ne!=null&&ne.errorFields)return;u.message.error("创建失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},q=async()=>{if(C)try{const ne=await k.validateFields();let ae;if(Y)ae=T.map(fe=>fe.key===Y.key?{key:ne.dataId,value:ne.content}:fe);else{if(T.some(fe=>fe.key===ne.dataId)){u.message.error("Key 已存在");return}ae=[...T,{key:ne.dataId,value:ne.content}]}const Q=xn(C.type,nn(C.data,C.type));yo(Q,ae,l),F(ae),A(!1),H(null),k.resetFields(),u.message.success("保存成功")}catch(ne){if(ne!=null&&ne.errorFields)return;u.message.error("保存失败")}},X=ne=>{if(!C)return;const ae=xn(C.type,nn(C.data,C.type)),Q=T.filter(fe=>fe.key!==ne.key);yo(ae,Q,l),F(Q),u.message.success("删除成功")},ee=(ne,ae)=>{const Q=nn(ne,ae);w([xn(ae,Q)]),b({type:ae,data:ne}),F(po(xn(ae,Q),l)),M(ae==="org"?g[ne.orgCode]||[]:ae==="dept"?m[ne.deptCode]||[]:[])},[re,le]=d.useState(""),ce=d.useMemo(()=>$.map((ne,ae)=>({...ne,key:ae})),[$]),de=d.useMemo(()=>{const ne=re.trim().toLowerCase();return ne?ce.filter(ae=>`${nn(ae,Kr(ae))||""} ${Ur(ae)||""}`.toLowerCase().includes(ne)):ce},[ce,re]),te=[{title:"编码",dataIndex:"code",width:140,render:(ne,ae)=>nn(ae,Kr(ae))},{title:"名称",dataIndex:"name",ellipsis:!0,render:(ne,ae)=>Ur(ae)},{title:"类型",dataIndex:"type",width:100,render:(ne,ae)=>{const Q=Kr(ae);return a.jsx(u.Tag,{color:Et[Q].color,children:Et[Q].label})}},{title:"操作",dataIndex:"action",width:100,render:(ne,ae)=>{const Q=Kr(ae);return a.jsx(u.Button,{type:"link",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>ee(ae,Q),children:"详情"})}}],ue=[{title:"Key",dataIndex:"key",width:200,ellipsis:!0},{title:"Value",dataIndex:"value",ellipsis:!0},{title:"操作",width:140,render:(ne,ae)=>a.jsxs(u.Space,{children:[a.jsx(u.Button,{size:"small",type:"link",icon:a.jsx(se.EditOutlined,{}),onClick:()=>{H(ae),k.setFieldsValue({dataId:ae.key,content:ae.value}),A(!0)},children:"编辑"}),a.jsx(u.Popconfirm,{title:"确认删除",onConfirm:()=>X(ae),children:a.jsx(u.Button,{size:"small",type:"link",danger:!0,icon:a.jsx(se.DeleteOutlined,{}),children:"删除"})})]})}];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,flex:1,minHeight:0},children:[a.jsx("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:12},children:a.jsxs(u.Space,{children:[a.jsx("span",{style:{color:"#666"},children:"租户"}),a.jsxs("select",{value:n||"",onChange:ne=>s&&s(ne.target.value||null),style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4,minWidth:160},children:[a.jsx("option",{value:"",children:"请选择"}),e.map(ne=>a.jsx("option",{value:ne.value||ne.tenantCode,children:ne.label||`${ne.tenantName||ne.tenantCode} (${ne.tenantCode})`},ne.value||ne.tenantCode))]}),a.jsx("span",{style:{color:"#666"},children:"域"}),a.jsxs("select",{value:r||"",onChange:ne=>i&&i(ne.target.value||null),disabled:!n,style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4,minWidth:160},children:[a.jsx("option",{value:"",children:"请选择"}),t.map(ne=>a.jsx("option",{value:ne.value||ne.domainCode,children:ne.label||`${ne.domainName||ne.domainCode} (${ne.domainCode})`},ne.value||ne.domainCode))]})]})}),a.jsxs("div",{style:{display:"flex",gap:16,flex:1,minHeight:0},children:[a.jsx(u.Card,{size:"small",style:{width:340,overflow:"auto",flexShrink:0},title:"组织树",extra:a.jsxs(u.Space,{size:4,children:[r&&a.jsx(u.Tooltip,{title:"新增组织",children:a.jsx(u.Button,{size:"small",type:"primary",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>L("org",{tenantCode:n,domainCode:r})})}),a.jsx(u.Tooltip,{title:"刷新",children:a.jsx(u.Button,{size:"small",icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>U(n,r)})})]}),children:r?S.length>0?a.jsx(u.Tree,{treeData:S,onSelect:P,loadData:K,titleRender:N,blockNode:!0,showLine:!0,showIcon:!1,expandedKeys:j,onExpand:v,selectedKeys:x}):a.jsx(u.Empty,{description:"该域下暂无组织,请点击右上角新增"}):a.jsx(u.Empty,{description:"请先选择租户和域"})}),a.jsx(u.Card,{size:"small",style:{flex:1,overflow:"auto"},children:C?a.jsxs(a.Fragment,{children:[a.jsxs(u.Descriptions,{title:`${Et[C.type].label}信息 — ${Ur(C.data)}`,size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[a.jsx(u.Descriptions.Item,{label:"编码",children:nn(C.data,C.type)}),a.jsx(u.Descriptions.Item,{label:"名称",children:Ur(C.data)}),a.jsx(u.Descriptions.Item,{label:"租户",children:C.data.tenantCode||"-"}),a.jsx(u.Descriptions.Item,{label:"域",children:C.data.domainCode||"-"}),C.type!=="org"&&a.jsx(u.Descriptions.Item,{label:"所属组织",children:C.data.orgCode}),C.type==="group"&&a.jsx(u.Descriptions.Item,{label:"所属部门",children:C.data.deptCode}),a.jsx(u.Descriptions.Item,{label:"状态",span:C.type==="group"?1:2,children:a.jsx(u.Tag,{color:(pe=go[C.data.status??1])==null?void 0:pe.color,children:(be=go[C.data.status??1])==null?void 0:be.text})}),a.jsx(u.Descriptions.Item,{label:"描述",span:2,children:C.data.description||"-"})]}),C.type!=="group"&&a.jsx(u.Card,{type:"inner",title:C.type==="org"?"下级部门 / 组":"下级组",size:"small",style:{marginBottom:16},extra:a.jsx(u.Space,{children:a.jsx(u.Input.Search,{allowClear:!0,placeholder:"按编码 / 名称过滤",style:{width:220},onChange:ne=>le(ne.target.value)})}),children:a.jsx(u.Table,{columns:te,dataSource:de,rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无下级"}})}),a.jsx(u.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:a.jsx(u.Button,{size:"small",type:"primary",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>{H(null),k.resetFields(),A(!0)},children:"新增"}),children:a.jsx(u.Table,{columns:ue,dataSource:T.map((ne,ae)=>({...ne,key:ne.key||ae})),rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无扩展配置"}})})]}):a.jsx(u.Empty,{description:"请从左侧选择组织/部门/组"})})]}),a.jsx(u.Modal,{title:Y?"编辑配置":"新增配置",open:I,onCancel:()=>{A(!1),H(null)},onOk:q,destroyOnHidden:!0,children:a.jsxs(u.Form,{form:k,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:a.jsx(u.Input,{disabled:!!Y})}),a.jsx(u.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:a.jsx(u.Input.TextArea,{rows:4})})]})}),a.jsx(u.Modal,{title:z?`新增${Et[z].label}`:"新增",open:E,onCancel:()=>R(!1),onOk:W,destroyOnHidden:!0,children:a.jsxs(u.Form,{form:B,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"tenantCode",label:"租户",children:a.jsx(u.Input,{disabled:!0})}),a.jsx(u.Form.Item,{name:"domainCode",label:"域",children:a.jsx(u.Input,{disabled:!0})}),(z==="dept"||z==="group")&&a.jsx(u.Form.Item,{name:"orgCode",label:"所属组织",children:a.jsx(u.Input,{disabled:!0})}),z==="group"&&a.jsx(u.Form.Item,{name:"deptCode",label:"所属部门",children:a.jsx(u.Input,{disabled:!0})}),a.jsx(u.Form.Item,{name:z==="org"?"orgCode":z==="dept"?"deptCode":"groupCode",label:"编码",rules:[{required:!0}],children:a.jsx(u.Input,{placeholder:"唯一标识"})}),a.jsx(u.Form.Item,{name:z==="org"?"orgName":z==="dept"?"deptName":"groupName",label:"名称",rules:[{required:!0}],children:a.jsx(u.Input,{})}),a.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:a.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[a.jsx("option",{value:1,children:"正常"}),a.jsx("option",{value:0,children:"停用"})]})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:2})})]})})]})}let zc="/api";function Bc(e){zc=e||"/api"}function Pt(){return Zt.createRequest({baseURL:zc,timeout:15e3})}const Cr={create:e=>Pt().post("/ctc/ac/tenants",e),getByCode:e=>Pt().get("/ctc/ac/tenants",{params:{tenantCode:e}}),updateStatus:(e,t)=>Pt().post("/ctc/ac/tenants/status",null,{params:{tenantCode:e,status:t}}),listAll:()=>Pt().get("/ctc/ac/tenants/list")},Cn={listByTenant:e=>Pt().get("/ctc/ac/domains/list",{params:{tenantCode:e}}),listAll:()=>Pt().get("/ctc/ac/domains/list-all"),getById:e=>Pt().get("/ctc/ac/domains",{params:{id:e}}),create:e=>Pt().post("/ctc/ac/domains",e),update:(e,t)=>Pt().put("/ctc/ac/domains",t,{params:{id:e}}),delete:e=>Pt().delete("/ctc/ac/domains",{params:{id:e}})};function sf({apiBaseURL:e,defaultTenant:t,defaultDomain:n}){d.useEffect(()=>{e&&Bc(e)},[e]);const[r,s]=d.useState([]),[i,o]=d.useState([]),[l,c]=d.useState(null),[h,g]=d.useState(null);d.useEffect(()=>{(async()=>{try{const p=await Cr.listAll(),S=Array.isArray(p)?p:[],y=S.map(v=>({value:v.tenantCode,label:`${v.tenantName||v.tenantCode} (${v.tenantCode})`}));s(y);const j=t||localStorage.getItem("z_tenant");j&&S.some(v=>v.tenantCode===j)?c(j):S.length>0&&c(S[0].tenantCode)}catch{s([])}})()},[t]),d.useEffect(()=>{if(!l){o([]),g(null);return}(async()=>{try{const p=await Cn.listByTenant(l),S=Array.isArray(p)?p:[],y=S.map(v=>({value:v.domainCode,label:`${v.domainName||v.domainCode} (${v.domainCode})`}));o(y);const j=n||localStorage.getItem("z_domain");j&&S.some(v=>v.domainCode===j)?g(j):S.length>0&&g(S[0].domainCode)}catch{o([])}})()},[l,n]);const f=p=>{c(p),localStorage.setItem("z_tenant",p||""),localStorage.removeItem("z_domain")},m=p=>{g(p),localStorage.setItem("z_domain",p||"")};return a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:a.jsx(_c,{tenants:r,domains:i,selectedTenant:l,selectedDomain:h,onTenantChange:f,onDomainChange:m,apiBaseURL:"/api"})})}function Bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ps={exports:{}},af=ps.exports,xo;function Vc(){return xo||(xo=1,(function(e,t){(function(n,r){e.exports=r()})(af,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",l="minute",c="hour",h="day",g="week",f="month",m="quarter",p="year",S="date",y="Invalid Date",j=/^(\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(k){var E=["th","st","nd","rd"],R=k%100;return"["+k+(E[(R-20)%10]||E[R]||E[0])+"]"}},w=function(k,E,R){var z=String(k);return!z||z.length>=E?k:""+Array(E+1-z.length).join(R)+k},C={s:w,z:function(k){var E=-k.utcOffset(),R=Math.abs(E),z=Math.floor(R/60),_=R%60;return(E<=0?"+":"-")+w(z,2,"0")+":"+w(_,2,"0")},m:function k(E,R){if(E.date()<R.date())return-k(R,E);var z=12*(R.year()-E.year())+(R.month()-E.month()),_=E.clone().add(z,f),V=R-_<0,Z=E.clone().add(z+(V?-1:1),f);return+(-(z+(R-_)/(V?_-Z:Z-_))||0)},a:function(k){return k<0?Math.ceil(k)||0:Math.floor(k)},p:function(k){return{M:f,y:p,w:g,d:h,D:S,h:c,m:l,s:o,ms:i,Q:m}[k]||String(k||"").toLowerCase().replace(/s$/,"")},u:function(k){return k===void 0}},b="en",T={};T[b]=x;var F="$isDayjsObject",$=function(k){return k instanceof Y||!(!k||!k[F])},M=function k(E,R,z){var _;if(!E)return b;if(typeof E=="string"){var V=E.toLowerCase();T[V]&&(_=V),R&&(T[V]=R,_=V);var Z=E.split("-");if(!_&&Z.length>1)return k(Z[0])}else{var B=E.name;T[B]=E,_=B}return!z&&_&&(b=_),_||!z&&b},I=function(k,E){if($(k))return k.clone();var R=typeof E=="object"?E:{};return R.date=k,R.args=arguments,new Y(R)},A=C;A.l=M,A.i=$,A.w=function(k,E){return I(k,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var Y=(function(){function k(R){this.$L=M(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[F]=!0}var E=k.prototype;return E.parse=function(R){this.$d=(function(z){var _=z.date,V=z.utc;if(_===null)return new Date(NaN);if(A.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var Z=_.match(j);if(Z){var B=Z[2]-1||0,U=(Z[7]||"0").substring(0,3);return V?new Date(Date.UTC(Z[1],B,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)):new Date(Z[1],B,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)}}return new Date(_)})(R),this.init()},E.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()},E.$utils=function(){return A},E.isValid=function(){return this.$d.toString()!==y},E.isSame=function(R,z){var _=I(R);return this.startOf(z)<=_&&_<=this.endOf(z)},E.isAfter=function(R,z){return I(R)<this.startOf(z)},E.isBefore=function(R,z){return this.endOf(z)<I(R)},E.$g=function(R,z,_){return A.u(R)?this[z]:this.set(_,R)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(R,z){var _=this,V=!!A.u(z)||z,Z=A.p(R),B=function(D,L){var W=A.w(_.$u?Date.UTC(_.$y,L,D):new Date(_.$y,L,D),_);return V?W:W.endOf(h)},U=function(D,L){return A.w(_.toDate()[D].apply(_.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(L)),_)},J=this.$W,G=this.$M,K=this.$D,O="set"+(this.$u?"UTC":"");switch(Z){case p:return V?B(1,0):B(31,11);case f:return V?B(1,G):B(0,G+1);case g:var P=this.$locale().weekStart||0,N=(J<P?J+7:J)-P;return B(V?K-N:K+(6-N),G);case h:case S:return U(O+"Hours",0);case c:return U(O+"Minutes",1);case l:return U(O+"Seconds",2);case o:return U(O+"Milliseconds",3);default:return this.clone()}},E.endOf=function(R){return this.startOf(R,!1)},E.$set=function(R,z){var _,V=A.p(R),Z="set"+(this.$u?"UTC":""),B=(_={},_[h]=Z+"Date",_[S]=Z+"Date",_[f]=Z+"Month",_[p]=Z+"FullYear",_[c]=Z+"Hours",_[l]=Z+"Minutes",_[o]=Z+"Seconds",_[i]=Z+"Milliseconds",_)[V],U=V===h?this.$D+(z-this.$W):z;if(V===f||V===p){var J=this.clone().set(S,1);J.$d[B](U),J.init(),this.$d=J.set(S,Math.min(this.$D,J.daysInMonth())).$d}else B&&this.$d[B](U);return this.init(),this},E.set=function(R,z){return this.clone().$set(R,z)},E.get=function(R){return this[A.p(R)]()},E.add=function(R,z){var _,V=this;R=Number(R);var Z=A.p(z),B=function(G){var K=I(V);return A.w(K.date(K.date()+Math.round(G*R)),V)};if(Z===f)return this.set(f,this.$M+R);if(Z===p)return this.set(p,this.$y+R);if(Z===h)return B(1);if(Z===g)return B(7);var U=(_={},_[l]=r,_[c]=s,_[o]=n,_)[Z]||1,J=this.$d.getTime()+R*U;return A.w(J,this)},E.subtract=function(R,z){return this.add(-1*R,z)},E.format=function(R){var z=this,_=this.$locale();if(!this.isValid())return _.invalidDate||y;var V=R||"YYYY-MM-DDTHH:mm:ssZ",Z=A.z(this),B=this.$H,U=this.$m,J=this.$M,G=_.weekdays,K=_.months,O=_.meridiem,P=function(L,W,q,X){return L&&(L[W]||L(z,V))||q[W].slice(0,X)},N=function(L){return A.s(B%12||12,L,"0")},D=O||function(L,W,q){var X=L<12?"AM":"PM";return q?X.toLowerCase():X};return V.replace(v,(function(L,W){return W||(function(q){switch(q){case"YY":return String(z.$y).slice(-2);case"YYYY":return A.s(z.$y,4,"0");case"M":return J+1;case"MM":return A.s(J+1,2,"0");case"MMM":return P(_.monthsShort,J,K,3);case"MMMM":return P(K,J);case"D":return z.$D;case"DD":return A.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return P(_.weekdaysMin,z.$W,G,2);case"ddd":return P(_.weekdaysShort,z.$W,G,3);case"dddd":return G[z.$W];case"H":return String(B);case"HH":return A.s(B,2,"0");case"h":return N(1);case"hh":return N(2);case"a":return D(B,U,!0);case"A":return D(B,U,!1);case"m":return String(U);case"mm":return A.s(U,2,"0");case"s":return String(z.$s);case"ss":return A.s(z.$s,2,"0");case"SSS":return A.s(z.$ms,3,"0");case"Z":return Z}return null})(L)||Z.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(R,z,_){var V,Z=this,B=A.p(z),U=I(R),J=(U.utcOffset()-this.utcOffset())*r,G=this-U,K=function(){return A.m(Z,U)};switch(B){case p:V=K()/12;break;case f:V=K();break;case m:V=K()/3;break;case g:V=(G-J)/6048e5;break;case h:V=(G-J)/864e5;break;case c:V=G/s;break;case l:V=G/r;break;case o:V=G/n;break;default:V=G}return _?V:A.a(V)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return T[this.$L]},E.locale=function(R,z){if(!R)return this.$L;var _=this.clone(),V=M(R,z,!0);return V&&(_.$L=V),_},E.clone=function(){return A.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},k})(),H=Y.prototype;return I.prototype=H,[["$ms",i],["$s",o],["$m",l],["$H",c],["$W",h],["$M",f],["$y",p],["$D",S]].forEach((function(k){H[k[1]]=function(E){return this.$g(E,k[0],k[1])}})),I.extend=function(k,E){return k.$i||(k(E,Y,I),k.$i=!0),I},I.locale=M,I.isDayjs=$,I.unix=function(k){return I(1e3*k)},I.en=T[b],I.Ls=T,I.p={},I}))})(ps)),ps.exports}var of=Vc();const Se=Bt(of),rn={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},fa=(e,t,n)=>e==="tenant"?`tenant:${t}`:`domain:${t}:${n}`;function lf({apiBaseURL:e}){var re,le,ce,de;d.useEffect(()=>{e&&Bc(e)},[e]);const[t,n]=d.useState([]),[r,s]=d.useState(!1),[i,o]=d.useState({}),[l,c]=d.useState({}),[h,g]=d.useState([]),[f,m]=d.useState([]),[p,S]=d.useState([]),[y,j]=d.useState(null),[v,x]=d.useState([]),[w,C]=d.useState(!1),[b]=u.Form.useForm(),[T,F]=d.useState(!1),[$,M]=d.useState(null),[I]=u.Form.useForm(),[A,Y]=d.useState(!1),[H,k]=d.useState(null),[E]=u.Form.useForm(),R=d.useCallback(async()=>{s(!0);try{const te=await Cr.listAll();n(Array.isArray(te)?te:[])}catch(te){u.message.error("获取租户列表失败:"+((te==null?void 0:te.message)||"未知错误")),n([])}finally{s(!1)}},[]);d.useEffect(()=>{R()},[R]);const z=d.useCallback(async te=>{const ue={};for(const pe of te)try{const be=await Cn.listByTenant(pe.tenantCode);ue[pe.tenantCode]=Array.isArray(be)?be:[]}catch{ue[pe.tenantCode]=[]}o(ue)},[]);d.useEffect(()=>{t.length>0&&z(t)},[t,z]),d.useEffect(()=>{const te=t.map(ue=>{var pe,be;return{key:fa("tenant",ue.tenantCode),title:a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[ue.tenantName||ue.tenantCode,a.jsx(u.Tag,{color:(pe=rn[ue.status??1])==null?void 0:pe.color,style:{margin:0,fontSize:10},children:(be=rn[ue.status??1])==null?void 0:be.text})]}),rawTitle:`${ue.tenantName||ue.tenantCode} (${ue.tenantCode})`,data:{type:"tenant",data:ue},children:(Array.isArray(i[ue.tenantCode])?i[ue.tenantCode]:[]).map(ne=>{var ae,Q;return{key:fa("domain",ue.tenantCode,ne.domainCode),title:a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[ne.domainName,a.jsx(u.Tag,{color:(ae=rn[ne.status])==null?void 0:ae.color,style:{margin:0,fontSize:10},children:(Q=rn[ne.status])==null?void 0:Q.text})]}),rawTitle:`${ne.domainName} (${ne.domainCode})`,data:{type:"domain",data:ne},isLeaf:!0}})}});g(te)},[t,i]);const _=async(te,ue)=>{if(ue.domainCode===`${te}-default`&&ue.domainName==="默认域"){u.message.warning("默认域受保护,不可删除");return}if(ue.id==null){u.message.error("域 ID 缺失");return}try{await Cn.delete(ue.id),u.message.success("删除成功");const be=await Cn.listByTenant(te);o(ne=>({...ne,[te]:Array.isArray(be)?be:[]}))}catch(be){u.message.error("删除失败:"+((be==null?void 0:be.message)||"未知错误"))}},V=async()=>{try{const te=await b.validateFields();await Cr.create({...te,status:1}),u.message.success("创建成功"),C(!1),b.resetFields(),await R()}catch(te){if(te!=null&&te.errorFields)return;u.message.error("创建失败:"+((te==null?void 0:te.message)||"未知错误"))}},Z=async(te,ue)=>{const pe=ue===1?0:1;try{await Cr.updateStatus(te,pe),u.message.success(pe===1?"已启用":"已停用"),await R()}catch(be){u.message.error("操作失败:"+((be==null?void 0:be.message)||"未知错误"))}},B=te=>{M(te),I.resetFields(),I.setFieldsValue({status:1}),F(!0)},U=async()=>{if($)try{const te=await I.validateFields(),ue=$.tenantCode;await Cn.create({domainCode:te.domainCode,domainName:te.domainName,tenantCode:ue,status:te.status??1}),u.message.success(`已为租户「${$.tenantName||ue}」新增域「${te.domainName}」`),F(!1),I.resetFields();const pe=await Cn.listByTenant(ue),be=Array.isArray(pe)?pe:[];o(ae=>({...ae,[ue]:be}));const ne=fa("tenant",ue);S(ae=>ae.includes(ne)?ae:[...ae,ne])}catch(te){if(te!=null&&te.errorFields)return;u.message.error("新增域失败:"+((te==null?void 0:te.message)||"未知错误"))}},J=(te,ue)=>{if(te.length===0)return;const pe=te[0];m([pe]);const be=ue.node.data;j(be),x(l[pe]||[])},G=async()=>{if(f[0])try{const te=await E.validateFields();let ue;if(H)ue=v.map(pe=>pe.key===H.key?{key:te.dataId,value:te.content}:pe);else{if(v.some(pe=>pe.key===te.dataId)){u.message.error("Key 已存在");return}ue=[...v,{key:te.dataId,value:te.content}]}c(pe=>({...pe,[f[0]]:ue})),x(ue),u.message.success(H?"更新成功":"创建成功"),Y(!1),k(null),E.resetFields()}catch(te){if(te!=null&&te.errorFields)return;u.message.error("保存失败")}},K=te=>{const ue=v.filter(pe=>pe.key!==te.key);c(pe=>({...pe,[f[0]]:ue})),x(ue),u.message.success("删除成功")},O=(y==null?void 0:y.type)==="tenant"?y.data:null,P=(y==null?void 0:y.type)==="domain"?y.data:null,N=P?t.find(te=>te.tenantCode===P.tenantCode):null,[D,L]=d.useState(""),W=d.useMemo(()=>v.map((te,ue)=>({...te,_idx:ue})),[v]),q=d.useMemo(()=>{const te=D.trim().toLowerCase();return te?W.filter(ue=>`${ue.key||""} ${ue.value||""}`.toLowerCase().includes(te)):W},[W,D]),X=[{title:"Key",dataIndex:"key",key:"key",width:200},{title:"Value",dataIndex:"value",key:"value",ellipsis:!0},{title:"操作",key:"action",width:160,render:(te,ue)=>a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"link",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>{k(ue),E.setFieldsValue({dataId:ue.key,content:ue.value}),Y(!0)},children:"编辑"}),a.jsx(u.Popconfirm,{title:"确认删除该配置?",onConfirm:()=>K(ue),children:a.jsx(u.Button,{type:"link",danger:!0,size:"small",icon:a.jsx(se.DeleteOutlined,{}),children:"删除"})})]})}],ee=te=>{const ue=te.data;if(ue.type==="tenant"){const ne=ue.data;return a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[a.jsx("span",{style:{flex:1},children:te.title}),a.jsx(u.Tooltip,{title:"新增域",children:a.jsx(u.Button,{size:"small",type:"text",icon:a.jsx(se.PlusOutlined,{style:{fontSize:11}}),onClick:ae=>{ae.stopPropagation(),B(ne)}})})]})}const pe=ue.data,be=pe.tenantCode;return a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[a.jsx("span",{style:{flex:1},children:te.title}),a.jsx(u.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:ne=>{ne==null||ne.stopPropagation(),_(be,pe)},onCancel:ne=>ne==null?void 0:ne.stopPropagation(),okText:"确定",cancelText:"取消",children:a.jsx(u.Button,{size:"small",type:"text",danger:!0,icon:a.jsx(se.DeleteOutlined,{style:{fontSize:11}}),onClick:ne=>ne.stopPropagation()})})]})};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[a.jsxs("div",{style:{display:"flex",gap:16,height:"calc(100vh - 140px)"},children:[a.jsx(u.Card,{title:"租户 / 域",size:"small",style:{width:300,flexShrink:0},styles:{body:{padding:8,overflow:"auto",height:"calc(100% - 40px)"}},extra:a.jsxs(u.Space,{size:4,children:[a.jsx(u.Tooltip,{title:"新增租户",children:a.jsx(u.Button,{size:"small",type:"text",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>{b.resetFields(),C(!0)}})}),a.jsx(u.Tooltip,{title:"租户由 FEATURE049 多租户身份模型在用户加入/创建租户时自动建立, 此处仅维护已有租户 (不能新建)",children:a.jsx(u.Button,{size:"small",type:"text",icon:a.jsx(se.InfoCircleOutlined,{style:{color:"#1890ff"}})})}),a.jsx(u.Tooltip,{title:"刷新",children:a.jsx(u.Button,{size:"small",type:"text",icon:a.jsx(se.ReloadOutlined,{}),onClick:R})})]}),children:h.length>0?a.jsx(u.Tree,{treeData:h,selectedKeys:f,onSelect:J,titleRender:ee,expandedKeys:p,onExpand:S,defaultExpandAll:!0,showLine:!0,blockNode:!0}):a.jsx(u.Empty,{description:r?"加载中...":'暂无租户,点击右上"新增租户"图标创建'})}),a.jsx(u.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},children:y?a.jsxs(a.Fragment,{children:[a.jsx(u.Descriptions,{title:O?"租户信息":"域信息",size:"small",bordered:!0,column:2,style:{marginBottom:16},children:O?a.jsxs(a.Fragment,{children:[a.jsx(u.Descriptions.Item,{label:"编码",children:O.tenantCode}),a.jsx(u.Descriptions.Item,{label:"名称",children:O.tenantName}),a.jsx(u.Descriptions.Item,{label:"描述",span:2,children:O.description||"-"}),a.jsx(u.Descriptions.Item,{label:"状态",children:a.jsx(u.Popconfirm,{title:`确认${O.status===1?"停用":"启用"}该租户?`,onConfirm:()=>Z(O.tenantCode,O.status??1),children:a.jsxs(u.Button,{size:"small",type:"link",danger:O.status===1,children:[a.jsx(u.Tag,{color:(re=rn[O.status??1])==null?void 0:re.color,children:(le=rn[O.status??1])==null?void 0:le.text}),a.jsx("span",{style:{marginLeft:4,fontSize:12},children:"点击切换"})]})})}),a.jsx(u.Descriptions.Item,{label:"创建时间",children:O.createdAt||"-"})]}):a.jsxs(a.Fragment,{children:[a.jsx(u.Descriptions.Item,{label:"编码",children:P.domainCode}),a.jsx(u.Descriptions.Item,{label:"名称",children:P.domainName}),a.jsx(u.Descriptions.Item,{label:"所属租户",children:(N==null?void 0:N.tenantName)||P.tenantCode}),a.jsx(u.Descriptions.Item,{label:"状态",children:a.jsx(u.Tag,{color:(ce=rn[P.status])==null?void 0:ce.color,children:(de=rn[P.status])==null?void 0:de.text})})]})}),a.jsx(u.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:a.jsxs(u.Space,{children:[a.jsx(u.Input.Search,{allowClear:!0,placeholder:"按 Key / Value 过滤",style:{width:220},onChange:te=>L(te.target.value)}),a.jsx(u.Button,{type:"primary",size:"small",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>{k(null),E.resetFields(),Y(!0)},children:"新增"})]}),children:a.jsx(u.Table,{columns:X,dataSource:q,rowKey:te=>`${te.key}_${te._idx}`,pagination:!1,size:"small",locale:{emptyText:'暂无扩展配置,点击右上"新增"添加'}})})]}):a.jsx(u.Empty,{description:"请从左侧选择租户或域",style:{marginTop:80}})})]}),a.jsx(u.Modal,{title:"新建租户",open:w,onOk:V,onCancel:()=>C(!1),size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:b,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"tenantCode",label:"租户编码",rules:[{required:!0,message:"请输入租户编码"},{pattern:/^[a-z0-9_]+$/,message:"仅允许小写字母数字下划线"}],extra:"唯一标识,创建后不可修改",children:a.jsx(u.Input,{placeholder:"如 default / tenant_a"})}),a.jsx(u.Form.Item,{name:"tenantName",label:"租户名称",rules:[{required:!0}],children:a.jsx(u.Input,{placeholder:"如 默认租户"})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:3,placeholder:"可选"})})]})}),a.jsx(u.Modal,{title:H?"编辑配置":"新增配置",open:A,onOk:G,onCancel:()=>{Y(!1),k(null)},destroyOnHidden:!0,children:a.jsxs(u.Form,{form:E,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:a.jsx(u.Input,{disabled:!!H,placeholder:"如 max_users"})}),a.jsx(u.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:a.jsx(u.Input.TextArea,{rows:4,placeholder:"配置值"})})]})}),a.jsx(u.Modal,{title:$?`为「${$.tenantName||$.tenantCode}」新增域`:"新增域",open:T,onOk:U,onCancel:()=>{F(!1),I.resetFields()},size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:I,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{label:"所属租户",children:a.jsx(u.Input,{value:($==null?void 0:$.tenantName)||"",disabled:!0})}),a.jsx(u.Form.Item,{name:"domainCode",label:"域编码",rules:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:"租户内唯一,建议形如 prod / staging / dev",children:a.jsx(u.Input,{placeholder:"如 prod / staging"})}),a.jsx(u.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:a.jsx(u.Input,{placeholder:"如 生产环境"})}),a.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:a.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[a.jsx("option",{value:1,children:"正常"}),a.jsx("option",{value:0,children:"停用"})]})})]})})]})}const Hc=e=>{const t=ge.useRef(e);return t.current=e,ge.useCallback((...r)=>{var s;return(s=t.current)==null?void 0:s.call(t,...r)},[])};function Dr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const bo=process.env.NODE_ENV!=="test"&&Dr()?ge.useLayoutEffect:ge.useEffect,cf=(e,t)=>{const n=ge.useRef(!0);bo(()=>e(n.current),t),bo(()=>(n.current=!1,()=>{n.current=!0}),[])};function Je(e,t){const[n,r]=d.useState(e),s=t!==void 0?t:n;return cf(i=>{i||r(t)},[t]),[s,r]}let Yc=e=>+setTimeout(e,16),Uc=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(Yc=e=>window.requestAnimationFrame(e),Uc=e=>window.cancelAnimationFrame(e));let So=0;const Ks=new Map;function Kc(e){Ks.delete(e)}const Ai=(e,t=1)=>{So+=1;const n=So;function r(s){if(s===0)Kc(n),e();else{const i=Yc(()=>{r(s-1)});Ks.set(n,i)}}return r(t),n};Ai.cancel=e=>{const t=Ks.get(e);return Kc(e),Uc(t)};process.env.NODE_ENV!=="production"&&(Ai.ids=()=>Ks);function uf(e,t,n){const r=ge.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var Wr={exports:{}},De={};/**
|
|
1
|
+
"use strict";var Zd=Object.defineProperty;var Jd=(e,t,n)=>t in e?Zd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>Jd(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"),ht=require("@yuku123/z-frontend-common/ui"),ae=require("@ant-design/icons"),d=require("react"),Jt=require("@yuku123/z-frontend-common");require("react-dom/client");const zc=require("react-dom");function Xd(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 ye=Xd(d),Qd="# 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 ef(){return s.jsx(ht.ComponentDoc,{markdown:Qd,title:"组件文档 — z-ctc"})}function tf({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,{size:"small",icon:s.jsx(ae.EditOutlined,{}),onClick:()=>n==null?void 0:n(l),children:"编辑"}),s.jsx(c.Button,{size:"small",danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),onClick:()=>r==null?void 0:r(l),children:"删除"})]})}];return s.jsx(ht.ListTable,{rows:e,columns:i,loading:t,rowKey:"id",searchKeys:["userName","nickName","phone","email"],searchPlaceholder:"按用户名 / 昵称 / 手机号 / 邮箱过滤"})}const nf={1:{color:"green",text:"正常"},0:{color:"red",text:"禁用"},pending:{color:"orange",text:"待处理"},approved:{color:"blue",text:"已通过"},rejected:{color:"red",text:"已拒绝"}};function rf({status:e,map:t}){const n=(t==null?void 0:t[e])||nf[e]||{color:"default",text:e};return s.jsx(c.Tag,{color:n.color,children:n.text})}let Bc="/api";function sf(e){Bc=e||"/api"}function ut(){return Jt.createRequest({baseURL:Bc,timeout:15e3})}const ua={create:e=>ut().post("/ctc/ac/orgs",e),listByDomain:(e,t)=>ut().get("/ctc/ac/orgs/list",{params:{tenantCode:e,domainCode:t}}),getByCode:(e,t,n)=>ut().get("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}}),update:(e,t,n,r)=>ut().put("/ctc/ac/orgs",r,{params:{tenantCode:e,domainCode:t,orgCode:n}}),delete:(e,t,n)=>ut().delete("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}})},Yr={create:e=>ut().post("/ctc/ac/depts",e),listByOrg:(e,t,n)=>ut().get("/ctc/ac/depts/list",{params:{tenantCode:e,domainCode:t,orgCode:n}}),getByCode:(e,t,n,r)=>ut().get("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),update:(e,t,n,r)=>ut().put("/ctc/ac/depts",r,{params:{tenantCode:e,domainCode:t,deptCode:n}}),delete:(e,t,n,r)=>ut().delete("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}})},da={create:e=>ut().post("/ctc/ac/groups",e),listByDept:(e,t,n)=>ut().get("/ctc/ac/groups/list",{params:{tenantCode:e,domainCode:t,deptCode:n}}),getByCode:(e,t,n,r)=>ut().get("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),update:(e,t,n,r,a)=>ut().put("/ctc/ac/groups",a,{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),delete:(e,t,n,r)=>ut().delete("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}})},af="z_org_ext_config",xo={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Et={org:{label:"组织",color:"#1677ff"},dept:{label:"部门",color:"#52c41a"},group:{label:"组别",color:"#fa8c16"}};function bn(e,t){return`${e}:${t}`}function rn(e,t){return t==="org"?e.orgCode:t==="dept"?e.deptCode:e.groupCode}function Ur(e){return e.orgName||e.deptName||e.groupName||""}function Kr(e){return e.groupCode?"group":e.deptCode?"dept":"org"}function bo(e,t){try{return JSON.parse(localStorage.getItem(t)||"{}")[e]||[]}catch{return[]}}function So(e,t,n){const r=JSON.parse(localStorage.getItem(n)||"{}");r[e]=t,localStorage.setItem(n,JSON.stringify(r))}function Vc({tenants:e=[],domains:t=[],selectedTenant:n=null,selectedDomain:r=null,onTenantChange:a,onDomainChange:i,apiBaseURL:o,extConfigStorageKey:l=af}){var de,ge;d.useEffect(()=>{o&&sf(o)},[o]);const[u,h]=d.useState({}),[g,f]=d.useState({}),[m,p]=d.useState({}),[S,y]=d.useState([]),[j,v]=d.useState([]),[x,C]=d.useState([]),[w,b]=d.useState(null),[T,F]=d.useState([]),[R,E]=d.useState([]),[M,O]=d.useState(!1),[Y,H]=d.useState(null),[D]=c.Form.useForm(),[I,$]=d.useState(!1),[z,_]=d.useState(null),[V,Z]=d.useState(null),[B]=c.Form.useForm(),U=d.useCallback(async(ne,te)=>{if(!ne||!te)return[];const X=await ua.listByDomain(ne,te),fe=Array.isArray(X)?X:[];return h(pe=>({...pe,[te]:fe})),fe},[]),J=d.useCallback(async(ne,te,X)=>{if(!ne||!te||!X)return[];const fe=await Yr.listByOrg(ne,te,X),pe=Array.isArray(fe)?fe:[];return f(ve=>({...ve,[X]:pe})),pe},[]),G=d.useCallback(async(ne,te,X)=>{if(!ne||!te||!X)return[];const fe=await da.listByDept(ne,te,X),pe=Array.isArray(fe)?fe:[];return p(ve=>({...ve,[X]:pe})),pe},[]);d.useEffect(()=>{if(!n||!r){y([]);return}if(!u[r]){U(n,r);return}const te=(u[r]||[]).map(X=>({key:bn("org",X.orgCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Et.org.color,style:{margin:0},children:"组织"}),X.orgName||X.orgCode,X.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"org",data:X},isLeaf:!1}));y(te)},[n,r,u,U]);const K=async ne=>{const{key:te,data:X,type:fe}=ne;let pe=[];fe==="org"?pe=(await J(n,r,X.orgCode)).map(Ee=>({key:bn("dept",Ee.deptCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Et.dept.color,style:{margin:0},children:"部门"}),Ee.deptName||Ee.deptCode,Ee.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"dept",data:Ee},isLeaf:!1})):fe==="dept"&&(pe=(await G(n,r,X.deptCode)).map(Ee=>({key:bn("group",Ee.groupCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Et.group.color,style:{margin:0},children:"组"}),Ee.groupName||Ee.groupCode,Ee.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"group",data:Ee},isLeaf:!0}))),y(ve=>A(ve,te,pe))},A=(ne,te,X)=>ne.map(fe=>fe.key===te?{...fe,children:X}:fe.children?{...fe,children:A(fe.children,te,X)}:fe),k=(ne,te)=>{if(!ne||ne.length===0)return;const X=ne[0];C([X]);const fe=te.node.data;b(fe),F(bo(X,l)),fe.type==="org"?E(g[fe.data.orgCode]||[]):fe.type==="dept"?E(m[fe.data.deptCode]||[]):E([])},N=ne=>{var Ee;const te=ne.data,X=te==null?void 0:te.type,fe=te==null?void 0:te.data,pe=X==="org"?[{key:"org",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Et.org.color,children:"组织"})," 新增组织"]})},{key:"dept",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Et.dept.color,children:"部门"})," 新增部门"]})}]:X==="dept"?[{key:"group",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Et.group.color,children:"组别"})," 新增组别"]})}]:[],ve=X&&((Ee=Et[X])==null?void 0:Ee.label)||"节点";return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},onClick:Te=>Te.stopPropagation(),children:[s.jsx("span",{style:{flex:1},children:ne.title}),pe.length>0&&s.jsx(c.Dropdown,{menu:{items:pe,onClick:({key:Te})=>L(Te,fe)},trigger:["click"],children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(ae.PlusOutlined,{style:{fontSize:11}}),onClick:Te=>Te.stopPropagation()})}),s.jsx(c.Popconfirm,{title:`确定删除该${ve}?`,onConfirm:()=>X&&P(X,fe),onCancel:Te=>Te==null?void 0:Te.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(ae.DeleteOutlined,{style:{fontSize:11}}),onClick:Te=>Te.stopPropagation()})})]})},P=async(ne,te)=>{try{const X=te.tenantCode||n,fe=te.domainCode||r;if(!X||!fe){c.message.error("租户/域信息缺失, 无法删除");return}ne==="org"?(await ua.delete(X,fe,te.orgCode),await U(X,fe)):ne==="dept"?(await Yr.delete(X,fe,te.deptCode,te.orgCode),te.orgCode&&await J(X,fe,te.orgCode)):ne==="group"&&(await da.delete(X,fe,te.deptCode,te.groupCode),te.deptCode&&await G(X,fe,te.deptCode)),c.message.success("删除成功"),w&&rn(w.data,w.type)===rn(te,ne)&&(b(null),F([]),E([]),C([]))}catch(X){c.message.error("删除失败:"+((X==null?void 0:X.message)||"未知错误"))}},L=(ne,te)=>{_(ne),Z(te),B.resetFields(),te&&B.setFieldsValue({tenantCode:te.tenantCode||n,domainCode:te.domainCode||r,orgCode:te.orgCode,deptCode:te.deptCode}),$(!0)},W=async()=>{if(z)try{const ne=await B.validateFields(),te={...ne,status:ne.status??1,description:ne.description||"",extConfig:"[]"};if(z==="org"){await ua.create(te);const X=te.domainCode||r;X&&await U(te.tenantCode,X)}else if(z==="dept"){await Yr.create(te);const X=te.orgCode;if(X&&await J(te.tenantCode,te.domainCode,X),(w==null?void 0:w.type)==="org"&&w.data.orgCode===X){const fe=await Yr.listByOrg(te.tenantCode,te.domainCode,X);E(fe)}}else if(z==="group"){await da.create(te);const X=te.deptCode;X&&await G(te.tenantCode,te.domainCode,X)}c.message.success("创建成功"),$(!1)}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("创建失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},q=async()=>{if(w)try{const ne=await D.validateFields();let te;if(Y)te=T.map(fe=>fe.key===Y.key?{key:ne.dataId,value:ne.content}:fe);else{if(T.some(fe=>fe.key===ne.dataId)){c.message.error("Key 已存在");return}te=[...T,{key:ne.dataId,value:ne.content}]}const X=bn(w.type,rn(w.data,w.type));So(X,te,l),F(te),O(!1),H(null),D.resetFields(),c.message.success("保存成功")}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("保存失败")}},Q=ne=>{if(!w)return;const te=bn(w.type,rn(w.data,w.type)),X=T.filter(fe=>fe.key!==ne.key);So(te,X,l),F(X),c.message.success("删除成功")},ee=(ne,te)=>{const X=rn(ne,te);C([bn(te,X)]),b({type:te,data:ne}),F(bo(bn(te,X),l)),E(te==="org"?g[ne.orgCode]||[]:te==="dept"?m[ne.deptCode]||[]:[])},[re,le]=d.useState(""),ce=d.useMemo(()=>R.map((ne,te)=>({...ne,key:te})),[R]),ue=d.useMemo(()=>{const ne=re.trim().toLowerCase();return ne?ce.filter(te=>`${rn(te,Kr(te))||""} ${Ur(te)||""}`.toLowerCase().includes(ne)):ce},[ce,re]),he=[{title:"编码",dataIndex:"code",width:140,render:(ne,te)=>rn(te,Kr(te))},{title:"名称",dataIndex:"name",ellipsis:!0,render:(ne,te)=>Ur(te)},{title:"类型",dataIndex:"type",width:100,render:(ne,te)=>{const X=Kr(te);return s.jsx(c.Tag,{color:Et[X].color,children:Et[X].label})}},{title:"操作",dataIndex:"action",width:100,render:(ne,te)=>{const X=Kr(te);return s.jsx(c.Button,{type:"link",size:"small",icon:s.jsx(ae.EditOutlined,{}),onClick:()=>ee(te,X),children:"详情"})}}],se=[{title:"Key",dataIndex:"key",width:200,ellipsis:!0},{title:"Value",dataIndex:"value",ellipsis:!0},{title:"操作",width:140,render:(ne,te)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",type:"link",icon:s.jsx(ae.EditOutlined,{}),onClick:()=>{H(te),D.setFieldsValue({dataId:te.key,content:te.value}),O(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除",onConfirm:()=>Q(te),children:s.jsx(c.Button,{size:"small",type:"link",danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,flex:1,minHeight:0},children:[s.jsx("div",{style:{display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:12},children:s.jsxs(c.Space,{children:[s.jsx("span",{style:{color:"#666"},children:"租户"}),s.jsxs("select",{value:n||"",onChange:ne=>a&&a(ne.target.value||null),style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4,minWidth:160},children:[s.jsx("option",{value:"",children:"请选择"}),e.map(ne=>s.jsx("option",{value:ne.value||ne.tenantCode,children:ne.label||`${ne.tenantName||ne.tenantCode} (${ne.tenantCode})`},ne.value||ne.tenantCode))]}),s.jsx("span",{style:{color:"#666"},children:"域"}),s.jsxs("select",{value:r||"",onChange:ne=>i&&i(ne.target.value||null),disabled:!n,style:{padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4,minWidth:160},children:[s.jsx("option",{value:"",children:"请选择"}),t.map(ne=>s.jsx("option",{value:ne.value||ne.domainCode,children:ne.label||`${ne.domainName||ne.domainCode} (${ne.domainCode})`},ne.value||ne.domainCode))]})]})}),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:[r&&s.jsx(c.Tooltip,{title:"新增组织",children:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>L("org",{tenantCode:n,domainCode:r})})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>U(n,r)})})]}),children:r?S.length>0?s.jsx(c.Tree,{treeData:S,onSelect:k,loadData:K,titleRender:N,blockNode:!0,showLine:!0,showIcon:!1,expandedKeys:j,onExpand:v,selectedKeys:x}):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:`${Et[w.type].label}信息 — ${Ur(w.data)}`,size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[s.jsx(c.Descriptions.Item,{label:"编码",children:rn(w.data,w.type)}),s.jsx(c.Descriptions.Item,{label:"名称",children:Ur(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:(de=xo[w.data.status??1])==null?void 0:de.color,children:(ge=xo[w.data.status??1])==null?void 0:ge.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:ne=>le(ne.target.value)})}),children:s.jsx(c.Table,{columns:he,dataSource:ue,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(ae.PlusOutlined,{}),onClick:()=>{H(null),D.resetFields(),O(!0)},children:"新增"}),children:s.jsx(c.Table,{columns:se,dataSource:T.map((ne,te)=>({...ne,key:ne.key||te})),rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无扩展配置"}})})]}):s.jsx(c.Empty,{description:"请从左侧选择组织/部门/组"})})]}),s.jsx(c.Modal,{title:Y?"编辑配置":"新增配置",open:M,onCancel:()=>{O(!1),H(null)},onOk:q,destroyOnHidden:!0,children:s.jsxs(c.Form,{form:D,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!Y})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4})})]})}),s.jsx(c.Modal,{title:z?`新增${Et[z].label}`:"新增",open:I,onCancel:()=>$(!1),onOk:W,destroyOnHidden:!0,children:s.jsxs(c.Form,{form:B,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"tenantCode",label:"租户",children:s.jsx(c.Input,{disabled:!0})}),s.jsx(c.Form.Item,{name:"domainCode",label:"域",children:s.jsx(c.Input,{disabled:!0})}),(z==="dept"||z==="group")&&s.jsx(c.Form.Item,{name:"orgCode",label:"所属组织",children:s.jsx(c.Input,{disabled:!0})}),z==="group"&&s.jsx(c.Form.Item,{name:"deptCode",label:"所属部门",children:s.jsx(c.Input,{disabled:!0})}),s.jsx(c.Form.Item,{name:z==="org"?"orgCode":z==="dept"?"deptCode":"groupCode",label:"编码",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"唯一标识"})}),s.jsx(c.Form.Item,{name:z==="org"?"orgName":z==="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 Hc="/api";function Di(e){Hc=e||"/api"}function Ot(){return Jt.createRequest({baseURL:Hc,timeout:15e3})}const jn={create:e=>Ot().post("/ctc/ac/tenants",e),getByCode:e=>Ot().get("/ctc/ac/tenants",{params:{tenantCode:e}}),updateStatus:(e,t)=>Ot().post("/ctc/ac/tenants/status",null,{params:{tenantCode:e,status:t}}),listAll:()=>Ot().get("/ctc/ac/tenants/list"),listAllForPlatform:()=>Ot().get("/ctc/ac/tenants/list-all")},At={listByTenant:e=>Ot().get("/ctc/ac/domains/list",{params:{tenantCode:e}}),listAll:()=>Ot().get("/ctc/ac/domains/list-all"),getById:e=>Ot().get("/ctc/ac/domains",{params:{id:e}}),create:e=>Ot().post("/ctc/ac/domains",e),update:(e,t)=>Ot().put("/ctc/ac/domains",t,{params:{id:e}}),delete:e=>Ot().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 of({apiBaseURL:e,defaultTenant:t,defaultDomain:n}){d.useEffect(()=>{e&&Di(e)},[e]);const[r,a]=d.useState([]),[i,o]=d.useState([]),[l,u]=d.useState(null),[h,g]=d.useState(null);d.useEffect(()=>{(async()=>{try{const p=await jn.listAll(),S=Array.isArray(p)?p:[],y=S.map(v=>({value:v.tenantCode,label:`${v.tenantName||v.tenantCode} (${v.tenantCode})`}));a(y);const j=t||localStorage.getItem("z_tenant");j&&S.some(v=>v.tenantCode===j)?u(j):S.length>0&&u(S[0].tenantCode)}catch{a([])}})()},[t]),d.useEffect(()=>{if(!l){o([]),g(null);return}(async()=>{try{const p=await At.listByTenant(l),S=Array.isArray(p)?p:[],y=S.map(v=>({value:v.domainCode,label:`${v.domainName||v.domainCode} (${v.domainCode})`}));o(y);const j=n||localStorage.getItem("z_domain");j&&S.some(v=>v.domainCode===j)?g(j):S.length>0&&g(S[0].domainCode)}catch{o([])}})()},[l,n]);const f=p=>{u(p),localStorage.setItem("z_tenant",p||""),localStorage.removeItem("z_domain")},m=p=>{g(p),localStorage.setItem("z_domain",p||"")};return s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:s.jsx(Vc,{tenants:r,domains:i,selectedTenant:l,selectedDomain:h,onTenantChange:f,onDomainChange:m,apiBaseURL:"/api"})})}function Vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ps={exports:{}},lf=ps.exports,Co;function Yc(){return Co||(Co=1,(function(e,t){(function(n,r){e.exports=r()})(lf,(function(){var n=1e3,r=6e4,a=36e5,i="millisecond",o="second",l="minute",u="hour",h="day",g="week",f="month",m="quarter",p="year",S="date",y="Invalid Date",j=/^(\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(D){var I=["th","st","nd","rd"],$=D%100;return"["+D+(I[($-20)%10]||I[$]||I[0])+"]"}},C=function(D,I,$){var z=String(D);return!z||z.length>=I?D:""+Array(I+1-z.length).join($)+D},w={s:C,z:function(D){var I=-D.utcOffset(),$=Math.abs(I),z=Math.floor($/60),_=$%60;return(I<=0?"+":"-")+C(z,2,"0")+":"+C(_,2,"0")},m:function D(I,$){if(I.date()<$.date())return-D($,I);var z=12*($.year()-I.year())+($.month()-I.month()),_=I.clone().add(z,f),V=$-_<0,Z=I.clone().add(z+(V?-1:1),f);return+(-(z+($-_)/(V?_-Z:Z-_))||0)},a:function(D){return D<0?Math.ceil(D)||0:Math.floor(D)},p:function(D){return{M:f,y:p,w:g,d:h,D:S,h:u,m:l,s:o,ms:i,Q:m}[D]||String(D||"").toLowerCase().replace(/s$/,"")},u:function(D){return D===void 0}},b="en",T={};T[b]=x;var F="$isDayjsObject",R=function(D){return D instanceof Y||!(!D||!D[F])},E=function D(I,$,z){var _;if(!I)return b;if(typeof I=="string"){var V=I.toLowerCase();T[V]&&(_=V),$&&(T[V]=$,_=V);var Z=I.split("-");if(!_&&Z.length>1)return D(Z[0])}else{var B=I.name;T[B]=I,_=B}return!z&&_&&(b=_),_||!z&&b},M=function(D,I){if(R(D))return D.clone();var $=typeof I=="object"?I:{};return $.date=D,$.args=arguments,new Y($)},O=w;O.l=E,O.i=R,O.w=function(D,I){return M(D,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var Y=(function(){function D($){this.$L=E($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[F]=!0}var I=D.prototype;return I.parse=function($){this.$d=(function(z){var _=z.date,V=z.utc;if(_===null)return new Date(NaN);if(O.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var Z=_.match(j);if(Z){var B=Z[2]-1||0,U=(Z[7]||"0").substring(0,3);return V?new Date(Date.UTC(Z[1],B,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)):new Date(Z[1],B,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,U)}}return new Date(_)})($),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 O},I.isValid=function(){return this.$d.toString()!==y},I.isSame=function($,z){var _=M($);return this.startOf(z)<=_&&_<=this.endOf(z)},I.isAfter=function($,z){return M($)<this.startOf(z)},I.isBefore=function($,z){return this.endOf(z)<M($)},I.$g=function($,z,_){return O.u($)?this[z]:this.set(_,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,z){var _=this,V=!!O.u(z)||z,Z=O.p($),B=function(P,L){var W=O.w(_.$u?Date.UTC(_.$y,L,P):new Date(_.$y,L,P),_);return V?W:W.endOf(h)},U=function(P,L){return O.w(_.toDate()[P].apply(_.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(L)),_)},J=this.$W,G=this.$M,K=this.$D,A="set"+(this.$u?"UTC":"");switch(Z){case p:return V?B(1,0):B(31,11);case f:return V?B(1,G):B(0,G+1);case g:var k=this.$locale().weekStart||0,N=(J<k?J+7:J)-k;return B(V?K-N:K+(6-N),G);case h:case S:return U(A+"Hours",0);case u:return U(A+"Minutes",1);case l:return U(A+"Seconds",2);case o:return U(A+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,z){var _,V=O.p($),Z="set"+(this.$u?"UTC":""),B=(_={},_[h]=Z+"Date",_[S]=Z+"Date",_[f]=Z+"Month",_[p]=Z+"FullYear",_[u]=Z+"Hours",_[l]=Z+"Minutes",_[o]=Z+"Seconds",_[i]=Z+"Milliseconds",_)[V],U=V===h?this.$D+(z-this.$W):z;if(V===f||V===p){var J=this.clone().set(S,1);J.$d[B](U),J.init(),this.$d=J.set(S,Math.min(this.$D,J.daysInMonth())).$d}else B&&this.$d[B](U);return this.init(),this},I.set=function($,z){return this.clone().$set($,z)},I.get=function($){return this[O.p($)]()},I.add=function($,z){var _,V=this;$=Number($);var Z=O.p(z),B=function(G){var K=M(V);return O.w(K.date(K.date()+Math.round(G*$)),V)};if(Z===f)return this.set(f,this.$M+$);if(Z===p)return this.set(p,this.$y+$);if(Z===h)return B(1);if(Z===g)return B(7);var U=(_={},_[l]=r,_[u]=a,_[o]=n,_)[Z]||1,J=this.$d.getTime()+$*U;return O.w(J,this)},I.subtract=function($,z){return this.add(-1*$,z)},I.format=function($){var z=this,_=this.$locale();if(!this.isValid())return _.invalidDate||y;var V=$||"YYYY-MM-DDTHH:mm:ssZ",Z=O.z(this),B=this.$H,U=this.$m,J=this.$M,G=_.weekdays,K=_.months,A=_.meridiem,k=function(L,W,q,Q){return L&&(L[W]||L(z,V))||q[W].slice(0,Q)},N=function(L){return O.s(B%12||12,L,"0")},P=A||function(L,W,q){var Q=L<12?"AM":"PM";return q?Q.toLowerCase():Q};return V.replace(v,(function(L,W){return W||(function(q){switch(q){case"YY":return String(z.$y).slice(-2);case"YYYY":return O.s(z.$y,4,"0");case"M":return J+1;case"MM":return O.s(J+1,2,"0");case"MMM":return k(_.monthsShort,J,K,3);case"MMMM":return k(K,J);case"D":return z.$D;case"DD":return O.s(z.$D,2,"0");case"d":return String(z.$W);case"dd":return k(_.weekdaysMin,z.$W,G,2);case"ddd":return k(_.weekdaysShort,z.$W,G,3);case"dddd":return G[z.$W];case"H":return String(B);case"HH":return O.s(B,2,"0");case"h":return N(1);case"hh":return N(2);case"a":return P(B,U,!0);case"A":return P(B,U,!1);case"m":return String(U);case"mm":return O.s(U,2,"0");case"s":return String(z.$s);case"ss":return O.s(z.$s,2,"0");case"SSS":return O.s(z.$ms,3,"0");case"Z":return Z}return null})(L)||Z.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,z,_){var V,Z=this,B=O.p(z),U=M($),J=(U.utcOffset()-this.utcOffset())*r,G=this-U,K=function(){return O.m(Z,U)};switch(B){case p:V=K()/12;break;case f:V=K();break;case m:V=K()/3;break;case g:V=(G-J)/6048e5;break;case h:V=(G-J)/864e5;break;case u:V=G/a;break;case l:V=G/r;break;case o:V=G/n;break;default:V=G}return _?V:O.a(V)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return T[this.$L]},I.locale=function($,z){if(!$)return this.$L;var _=this.clone(),V=E($,z,!0);return V&&(_.$L=V),_},I.clone=function(){return O.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()},D})(),H=Y.prototype;return M.prototype=H,[["$ms",i],["$s",o],["$m",l],["$H",u],["$W",h],["$M",f],["$y",p],["$D",S]].forEach((function(D){H[D[1]]=function(I){return this.$g(I,D[0],D[1])}})),M.extend=function(D,I){return D.$i||(D(I,Y,M),D.$i=!0),M},M.locale=E,M.isDayjs=R,M.unix=function(D){return M(1e3*D)},M.en=T[b],M.Ls=T,M.p={},M}))})(ps)),ps.exports}var cf=Yc();const Se=Vt(cf),sn={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},fa=(e,t,n)=>e==="tenant"?`tenant:${t}`:`domain:${t}:${n}`;function uf({apiBaseURL:e,platformView:t=!1}){var le,ce,ue,he;d.useEffect(()=>{e&&Di(e)},[e]);const[n,r]=d.useState([]),[a,i]=d.useState(!1),[o,l]=d.useState({}),[u,h]=d.useState({}),[g,f]=d.useState([]),[m,p]=d.useState([]),[S,y]=d.useState([]),[j,v]=d.useState(null),[x,C]=d.useState([]),[w,b]=d.useState(!1),[T]=c.Form.useForm(),[F,R]=d.useState(!1),[E,M]=d.useState(null),[O]=c.Form.useForm(),[Y,H]=d.useState(!1),[D,I]=d.useState(null),[$]=c.Form.useForm(),z=d.useCallback(async()=>{i(!0);try{const se=t?await jn.listAllForPlatform():await jn.listAll();r(Array.isArray(se)?se:[])}catch(se){c.message.error((t?"获取全平台租户失败(系统租户面板仅平台管理员可访问):":"获取租户列表失败:")+((se==null?void 0:se.message)||"未知错误")),r([])}finally{i(!1)}},[t]);d.useEffect(()=>{z()},[z]);const _=d.useCallback(async se=>{const de=await Promise.all(se.map(async ge=>{try{const ne=await At.listByTenant(ge.tenantCode);return[ge.tenantCode,Array.isArray(ne)?ne:[]]}catch{return[ge.tenantCode,[]]}}));l(Object.fromEntries(de))},[]);d.useEffect(()=>{n.length>0&&_(n)},[n,_]),d.useEffect(()=>{const se=n.map(de=>{var ge,ne;return{key:fa("tenant",de.tenantCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[de.tenantName||de.tenantCode,s.jsx(c.Tag,{color:(ge=sn[de.status??1])==null?void 0:ge.color,style:{margin:0,fontSize:10},children:(ne=sn[de.status??1])==null?void 0:ne.text})]}),rawTitle:`${de.tenantName||de.tenantCode} (${de.tenantCode})`,data:{type:"tenant",data:de},children:(Array.isArray(o[de.tenantCode])?o[de.tenantCode]:[]).map(te=>{var X,fe;return{key:fa("domain",de.tenantCode,te.domainCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[te.domainName,s.jsx(c.Tag,{color:(X=sn[te.status])==null?void 0:X.color,style:{margin:0,fontSize:10},children:(fe=sn[te.status])==null?void 0:fe.text})]}),rawTitle:`${te.domainName} (${te.domainCode})`,data:{type:"domain",data:te},isLeaf:!0}})}});f(se),y(de=>de.length>0?de:se.map(ge=>ge.key))},[n,o]);const V=async(se,de)=>{if(Ka(se,de)){c.message.warning("默认域受保护,不可删除");return}if(de.id==null){c.message.error("域 ID 缺失");return}try{await At.delete(de.id),c.message.success("删除成功");const ge=await At.listByTenant(se);l(ne=>({...ne,[se]:Array.isArray(ge)?ge:[]}))}catch(ge){c.message.error("删除失败:"+((ge==null?void 0:ge.message)||"未知错误"))}},Z=async()=>{try{const se=await T.validateFields();await jn.create({...se,status:1}),c.message.success("创建成功"),b(!1),T.resetFields(),await z()}catch(se){if(se!=null&&se.errorFields)return;c.message.error("创建失败:"+((se==null?void 0:se.message)||"未知错误"))}},B=async(se,de)=>{const ge=de===1?0:1;try{await jn.updateStatus(se,ge),c.message.success(ge===1?"已启用":"已停用"),await z()}catch(ne){c.message.error("操作失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},U=se=>{M(se),O.resetFields(),O.setFieldsValue({status:1}),R(!0)},J=async()=>{if(E)try{const se=await O.validateFields(),de=E.tenantCode;await At.create({domainCode:se.domainCode,domainName:se.domainName,tenantCode:de,status:se.status??1}),c.message.success(`已为租户「${E.tenantName||de}」新增域「${se.domainName}」`),R(!1),O.resetFields();const ge=await At.listByTenant(de),ne=Array.isArray(ge)?ge:[];l(X=>({...X,[de]:ne}));const te=fa("tenant",de);y(X=>X.includes(te)?X:[...X,te])}catch(se){if(se!=null&&se.errorFields)return;c.message.error("新增域失败:"+((se==null?void 0:se.message)||"未知错误"))}},G=(se,de)=>{if(se.length===0)return;const ge=se[0];p([ge]);const ne=de.node.data;v(ne),C(u[ge]||[])},K=async()=>{if(m[0])try{const se=await $.validateFields();let de;if(D)de=x.map(ge=>ge.key===D.key?{key:se.dataId,value:se.content}:ge);else{if(x.some(ge=>ge.key===se.dataId)){c.message.error("Key 已存在");return}de=[...x,{key:se.dataId,value:se.content}]}h(ge=>({...ge,[m[0]]:de})),C(de),c.message.success(D?"更新成功":"创建成功"),H(!1),I(null),$.resetFields()}catch(se){if(se!=null&&se.errorFields)return;c.message.error("保存失败")}},A=se=>{const de=x.filter(ge=>ge.key!==se.key);h(ge=>({...ge,[m[0]]:de})),C(de),c.message.success("删除成功")},k=(j==null?void 0:j.type)==="tenant"?j.data:null,N=(j==null?void 0:j.type)==="domain"?j.data:null,P=N?n.find(se=>se.tenantCode===N.tenantCode):null,[L,W]=d.useState(""),q=d.useMemo(()=>x.map((se,de)=>({...se,_idx:de})),[x]),Q=d.useMemo(()=>{const se=L.trim().toLowerCase();return se?q.filter(de=>`${de.key||""} ${de.value||""}`.toLowerCase().includes(se)):q},[q,L]),ee=[{title:"Key",dataIndex:"key",key:"key",width:200},{title:"Value",dataIndex:"value",key:"value",ellipsis:!0},{title:"操作",key:"action",width:120,render:(se,de)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>{I(de),$.setFieldsValue({dataId:de.key,content:de.value}),H(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除该配置?",onConfirm:()=>A(de),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})]})}],re=se=>{const de=se.data;if(de.type==="tenant"){const te=de.data;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:se.title}),s.jsx(c.Tooltip,{title:"新增域",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(ae.PlusOutlined,{style:{fontSize:11}}),onClick:X=>{X.stopPropagation(),U(te)}})})]})}const ge=de.data,ne=ge.tenantCode;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:se.title}),s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:te=>{te==null||te.stopPropagation(),V(ne,ge)},onCancel:te=>te==null?void 0:te.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(ae.DeleteOutlined,{style:{fontSize:11}}),onClick:te=>te.stopPropagation()})})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs("div",{style:{display:"flex",gap:16,height:"calc(100vh - 140px)"},children:[s.jsx(c.Card,{title:"租户 / 域",size:"small",style:{width:300,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(ae.PlusOutlined,{}),onClick:()=>{T.resetFields(),b(!0)}})}),s.jsx(c.Tooltip,{title:"租户由 FEATURE049 多租户身份模型在用户加入/创建租户时自动建立, 此处仅维护已有租户 (不能新建)",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(ae.InfoCircleOutlined,{style:{color:"#1890ff"}})})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(ae.ReloadOutlined,{}),onClick:z})})]}),children:g.length>0?s.jsx(c.Tree,{treeData:g,selectedKeys:m,onSelect:G,titleRender:re,expandedKeys:S,onExpand:y,defaultExpandAll:!0,showLine:!0,blockNode:!0}):s.jsx(c.Empty,{description:a?"加载中...":'暂无租户,点击右上"新增租户"图标创建'})}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},children:j?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions,{title:k?"租户信息":"域信息",size:"small",bordered:!0,column:2,style:{marginBottom:16},children:k?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:k.tenantCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:k.tenantName}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:k.description||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Popconfirm,{title:`确认${k.status===1?"停用":"启用"}该租户?`,onConfirm:()=>B(k.tenantCode,k.status??1),children:s.jsxs(c.Button,{size:"small",type:"link",danger:k.status===1,children:[s.jsx(c.Tag,{color:(le=sn[k.status??1])==null?void 0:le.color,children:(ce=sn[k.status??1])==null?void 0:ce.text}),s.jsx("span",{style:{marginLeft:4,fontSize:12},children:"点击切换"})]})})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:k.createdAt||"-"})]}):s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:N.domainCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:N.domainName}),s.jsx(c.Descriptions.Item,{label:"所属租户",children:(P==null?void 0:P.tenantName)||N.tenantCode}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(ue=sn[N.status])==null?void 0:ue.color,children:(he=sn[N.status])==null?void 0:he.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:se=>W(se.target.value)}),s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>{I(null),$.resetFields(),H(!0)},children:"新增"})]}),children:s.jsx(c.Table,{columns:ee,dataSource:Q,rowKey:se=>`${se.key}_${se._idx}`,pagination:!1,size:"small",locale:{emptyText:'暂无扩展配置,点击右上"新增"添加'}})})]}):s.jsx(c.Empty,{description:"请从左侧选择租户或域",style:{marginTop:80}})})]}),s.jsx(c.Modal,{title:"新建租户",open:w,onOk:Z,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:D?"编辑配置":"新增配置",open:Y,onOk:K,onCancel:()=>{H(!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:!!D,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:F,onOk:J,onCancel:()=>{R(!1),O.resetFields()},size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:O,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 ma={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function df({apiBaseURL:e}){d.useEffect(()=>{e&&Di(e)},[e]);const[t,n]=d.useState([]),[r,a]=d.useState(""),[i,o]=d.useState(!1),[l,u]=d.useState([]),[h,g]=d.useState(!1),[f,m]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),j=d.useCallback(async()=>{o(!0);try{const R=await jn.listAll(),E=Array.isArray(R)?R:[];n(E),a(M=>{var O;return E.some(Y=>Y.tenantCode===M)?M:((O=E[0])==null?void 0:O.tenantCode)||""})}catch(R){c.message.error("获取我的租户失败:"+((R==null?void 0:R.message)||"未知错误")),n([]),a("")}finally{o(!1)}},[]),v=d.useCallback(async R=>{if(!R){u([]);return}g(!0);try{const E=await At.listByTenant(R);u(Array.isArray(E)?E:[])}catch(E){c.message.error("获取域列表失败:"+((E==null?void 0:E.message)||"未知错误")),u([])}finally{g(!1)}},[]);d.useEffect(()=>{j()},[j]),d.useEffect(()=>{v(r)},[r,v]);const x=d.useMemo(()=>t.find(R=>R.tenantCode===r)||null,[t,r]),C=()=>{S(null),y.resetFields(),y.setFieldsValue({status:1}),m(!0)},w=R=>{S(R),y.resetFields(),y.setFieldsValue({domainCode:R.domainCode,domainName:R.domainName,description:R.description,status:R.status??1}),m(!0)},b=async()=>{if(r)try{const R=await y.validateFields();p?(await At.update(p.id,{domainName:R.domainName,description:R.description||"",status:R.status??1}),c.message.success("已保存")):(await At.create({domainCode:R.domainCode,domainName:R.domainName,description:R.description||"",tenantCode:r,status:R.status??1}),c.message.success(`已新增域「${R.domainName}」`)),m(!1),S(null),y.resetFields(),await v(r)}catch(R){if(R!=null&&R.errorFields)return;c.message.error("保存失败:"+((R==null?void 0:R.message)||"未知错误"))}},T=async R=>{if(Ka(r,R)){c.message.warning("默认域受保护,不可删除");return}try{await At.delete(R.id),c.message.success("已删除"),await v(r)}catch(E){c.message.error("删除失败:"+((E==null?void 0:E.message)||"未知错误"))}},F=[{title:"域编码",dataIndex:"domainCode",key:"domainCode",width:220},{title:"域名称",dataIndex:"domainName",key:"domainName",width:200},{title:"状态",dataIndex:"status",key:"status",width:100,render:R=>{const E=ma[R]||{text:String(R??"-"),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:(R,E)=>s.jsxs(c.Space,{size:0,children:[s.jsx(c.Button,{type:"link",size:"small",icon:s.jsx(ae.EditOutlined,{}),onClick:()=>w(E),children:"编辑"}),Ka(r,E)?s.jsx(c.Tooltip,{title:"默认域受保护,不可删除",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,disabled:!0,icon:s.jsx(ae.DeleteOutlined,{}),children:"删除"})}):s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:()=>T(E),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),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(R=>({value:R.tenantCode,label:`${R.tenantName||R.tenantCode} (${R.tenantCode})`}))}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{j(),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:(ma[x.status??1]||{}).color,children:(ma[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(ae.PlusOutlined,{}),disabled:!r,onClick:C,children:"新增域"})}),children:s.jsx(c.Table,{columns:F,dataSource:l,rowKey:R=>R.id??R.domainCode,loading:h,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:()=>{m(!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 Uc=e=>{const t=ye.useRef(e);return t.current=e,ye.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])};function Dr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const wo=process.env.NODE_ENV!=="test"&&Dr()?ye.useLayoutEffect:ye.useEffect,ff=(e,t)=>{const n=ye.useRef(!0);wo(()=>e(n.current),t),wo(()=>(n.current=!1,()=>{n.current=!0}),[])};function Je(e,t){const[n,r]=d.useState(e),a=t!==void 0?t:n;return ff(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 jo=0;const Ks=new Map;function qc(e){Ks.delete(e)}const Pi=(e,t=1)=>{jo+=1;const n=jo;function r(a){if(a===0)qc(n),e();else{const i=Kc(()=>{r(a-1)});Ks.set(n,i)}}return r(t),n};Pi.cancel=e=>{const t=Ks.get(e);return qc(e),Wc(t)};process.env.NODE_ENV!=="production"&&(Pi.ids=()=>Ks);function mf(e,t,n){const r=ye.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var Wr={exports:{}},De={};/**
|
|
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
|
|
9
|
+
*/var vo;function hf(){if(vo)return De;vo=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"),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 j=y.$$typeof;switch(j){case e:switch(y=y.type,y){case n:case a:case r:case u: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 j}}case t:return j}}}return De.ContextConsumer=i,De.ContextProvider=o,De.Element=e,De.ForwardRef=l,De.Fragment=n,De.Lazy=f,De.Memo=g,De.Portal=t,De.Profiler=a,De.StrictMode=r,De.Suspense=u,De.SuspenseList=h,De.isContextConsumer=function(y){return S(y)===i},De.isContextProvider=function(y){return S(y)===o},De.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},De.isForwardRef=function(y){return S(y)===l},De.isFragment=function(y){return S(y)===n},De.isLazy=function(y){return S(y)===f},De.isMemo=function(y){return S(y)===g},De.isPortal=function(y){return S(y)===t},De.isProfiler=function(y){return S(y)===a},De.isStrictMode=function(y){return S(y)===r},De.isSuspense=function(y){return S(y)===u},De.isSuspenseList=function(y){return S(y)===h},De.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===u||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)},De.typeOf=S,De}var Pe={};/**
|
|
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 wo;function ff(){return wo||(wo=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(typeof y=="object"&&y!==null){var j=y.$$typeof;switch(j){case t:switch(y=y.type,y){case r:case i:case s: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 j}}case n:return j}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=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");Pe.ContextConsumer=o,Pe.ContextProvider=l,Pe.Element=t,Pe.ForwardRef=c,Pe.Fragment=r,Pe.Lazy=m,Pe.Memo=f,Pe.Portal=n,Pe.Profiler=i,Pe.StrictMode=s,Pe.Suspense=h,Pe.SuspenseList=g,Pe.isContextConsumer=function(y){return e(y)===o},Pe.isContextProvider=function(y){return e(y)===l},Pe.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},Pe.isForwardRef=function(y){return e(y)===c},Pe.isFragment=function(y){return e(y)===r},Pe.isLazy=function(y){return e(y)===m},Pe.isMemo=function(y){return e(y)===f},Pe.isPortal=function(y){return e(y)===n},Pe.isProfiler=function(y){return e(y)===i},Pe.isStrictMode=function(y){return e(y)===s},Pe.isSuspense=function(y){return e(y)===h},Pe.isSuspenseList=function(y){return e(y)===g},Pe.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===i||y===s||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)},Pe.typeOf=e})()),Pe}var jo;function hf(){return jo||(jo=1,process.env.NODE_ENV==="production"?Wr.exports=df():Wr.exports=ff()),Wr.exports}var ha=hf();const mf=Symbol.for("react.element"),gf=Symbol.for("react.transitional.element"),pf=Symbol.for("react.fragment");function Wc(e){return e&&typeof e=="object"&&(e.$$typeof===mf||e.$$typeof===gf)&&e.type===pf}var Dc;const yf=Number((Dc=d.version)==null?void 0:Dc.split(".")[0]),xf=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},bf=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{xf(r,n)})}},Sf=(...e)=>uf(()=>bf(...e),e,(t,n)=>t.length!==n.length||t.every((r,s)=>r!==n[s])),Cf=e=>{var n,r;if(!e)return!1;if(qc(e)&&yf>=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 qc(e){return d.isValidElement(e)&&!Wc(e)}const wf=e=>{if(e&&qc(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function jf(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 vo="data-rc-order",To="data-rc-priority",vf="rc-util-key",Ua=new Map;function Gc({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:vf}function Ws(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Tf(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function ki(e){return e?Array.from((Ua.get(e)||e).children).filter(t=>t.tagName==="STYLE"):[]}function Zc(e,t={}){if(!Dr())return null;const{csp:n,prepend:r,priority:s=0}=t,i=Tf(r),o=i==="prependQueue",l=document.createElement("style");l.setAttribute(vo,i),o&&s&&l.setAttribute(To,`${s}`),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||ki(c)).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(vo)))return!1;const m=Number(f.getAttribute(To)||0);return s>=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 Jc(e,t={}){let{styles:n}=t;return n||(n=ki(Ws(t))),n.find(r=>r.getAttribute(Gc(t))===e)}function Ff(e,t={}){const n=Jc(e,t);if(n){const r=Ws(t);r==null||r.removeChild(n)}}function Rf(e,t){const n=Ua.get(e);if(!n||!jf(document,n)){const r=Zc("",t);if(!r)return;const{parentNode:s}=r;Ua.set(e,s),e.removeChild(r)}}function ys(e,t,n={}){var c,h,g;const r=Ws(n);if(!r)return null;const s=ki(r),i={...n,styles:s};Rf(r,i);const o=Jc(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=Zc(e,i);return l?(l.setAttribute(Gc(i),t),l):null}function Fo(e){return e instanceof HTMLElement||e instanceof SVGElement}function $f(e){return e&&typeof e=="object"&&Fo(e.nativeElement)?e.nativeElement:Fo(e)?e:null}let Ka={};const Di=[],Ef=e=>{Di.push(e)};function Ms(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=Di.reduce((r,s)=>s(r??"","warning"),t);n&&console.error(`Warning: ${n}`)}}function If(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=Di.reduce((r,s)=>s(r??"","note"),t);n&&console.warn(`Note: ${n}`)}}function Mf(){Ka={}}function Xc(e,t,n){!t&&!Ka[n]&&(e(!1,n),Ka[n]=!0)}function He(e,t){Xc(Ms,e,t)}function Of(e,t){Xc(If,e,t)}He.preMessage=Ef;He.resetWarned=Mf;He.noteOnce=Of;function Ro(e,t,n=!1){const r=new Set;function s(i,o,l=1){const c=r.has(i);if(He(!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(!s(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=>s(i[f],o[f],h))}return!1}return s(e,t)}var ur={exports:{}},$o;function Af(){if($o)return ur.exports;$o=1,ur.exports=r,ur.exports.isMobile=r,ur.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(s){s||(s={});let i=s.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)||!!s.tablet&&n.test(i);return!o&&s.tablet&&s.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(o=!0),o}return ur.exports}Af();function Le(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function mn(e,t={}){let n=[];return d.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(mn(r)):Wc(r)&&r.props?n=n.concat(mn(r.props.children,t)):n.push(r))}),n}function Me(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 Qc(e,t,n,r){if(!t.length)return n;const[s,...i]=t;let o;if(!e&&typeof s=="number"?o=[]:Array.isArray(e)?o=[...e]:o={...e},r&&n===void 0&&i.length===1){const l=o[s];if(l&&typeof l=="object"){const c=Array.isArray(l)?[...l]:{...l};delete c[i[0]],o[s]=c}}else o[s]=Qc(o[s],i,n,r);return o}function _e(e,t,n,r=!1){return t.length&&r&&n===void 0&&!Me(e,t.slice(0,-1))?e:Qc(e,t,n,r)}function kf(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Eo(e){return Array.isArray(e)?[]:{}}const Df=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Pf(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let s=Eo(e[0]);return e.forEach(i=>{function o(l,c){const h=new Set(c),g=Me(i,l),f=Array.isArray(g);if(f||kf(g)){if(!h.has(g)){h.add(g);const m=Me(s,l);f?s=_e(s,l,r(m,g)):(!m||typeof m!="object")&&(s=_e(s,l,Eo(g))),Df(g).forEach(p=>{Object.getOwnPropertyDescriptor(g,p).enumerable&&o([...l,p],h)})}}else s=_e(s,l,g)}o([])}),s}function Un(...e){return Pf(e)}function eu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=eu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ie(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=eu(e))&&(r&&(r+=" "),r+=t);return r}function $r(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=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(s){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 Nf="%";function Wa(e){return e.join(Nf)}let Io=0;class Lf{constructor(t){oe(this,"instanceId");oe(this,"cache",new Map);oe(this,"updateTimes",new Map);oe(this,"extracted",new Set);this.instanceId=t}get(t){return this.opGet(Wa(t))}opGet(t){return this.cache.get(t)||null}update(t,n){return this.opUpdate(Wa(t),n)}opUpdate(t,n){const r=this.cache.get(t),s=n(r);s===null?(this.cache.delete(t),this.updateTimes.delete(t)):(this.cache.set(t,s),this.updateTimes.set(t,Io),Io+=1)}}const tu="data-token-hash",Fn="data-css-hash",_f="data-cache-path",ln="__cssinjs_instance__";function zf(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${Fn}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(s=>{s[ln]||(s[ln]=e),s[ln]===e&&document.head.insertBefore(s,n)});const r={};Array.from(document.querySelectorAll(`style[${Fn}]`)).forEach(s=>{var o;const i=s.getAttribute(Fn);r[i]?s[ln]===e&&((o=s.parentNode)==null||o.removeChild(s)):r[i]=!0})}return new Lf(e)}const Pi=ge.createContext({hashPriority:"low",cache:zf(),defaultCache:!0,autoPrefix:!1});let Mo=0;class Bf{constructor(t){oe(this,"derivatives");oe(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=Mo,t.length===0&&Ms(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Mo+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const Vf=new WeakMap,ma={};function Hf(e,t){let n=Vf;for(let r=0;r<t.length;r+=1){const s=t[r];n.has(s)||n.set(s,new WeakMap),n=n.get(s)}return n.has(ma)||n.set(ma,e()),n.get(ma)}const Oo=new WeakMap;function wr(e){let t=Oo.get(e)||"";return t||(Object.keys(e).forEach(n=>{const r=e[n];t+=n,r instanceof Bf?t+=r.id:r&&typeof r=="object"?t+=wr(r):t+=r}),t=$r(t),Oo.set(e,t)),t}function Yf(e,t){return $r(`${t}_${wr(e)}`)}const Ao=Dr();function nu(e){const{hashCls:t,hashPriority:n="low"}=e||{};if(!t)return"";const r=`.${t}`;return n==="low"?`:where(${r})`:r}const Uf=e=>e!=null;function ru(e,t){const n=typeof t=="function"?t():t;return n?{...e,csp:{...e.csp,nonce:n}}:e}const Kf=(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(),Wf=(e,t,n)=>{const{hashCls:r,hashPriority:s="low",scope:i}=n||{};if(!Object.keys(e).length)return"";const o=`${nu({hashCls:r,hashPriority:s})}.${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("")}}`},qf=(e,t,n)=>{const{hashCls:r,hashPriority:s="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=Kf(f,i);h[p]=typeof m=="number"&&!(o!=null&&o[f])?`${m}px`:String(m),g[f]=`var(${p})`}}),[g,Wf(h,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:s})]};function Gf(){return!1}let qa=!1;function Zf(){return qa}const Jf=process.env.NODE_ENV==="production"?Gf:Zf;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)=>(qa=!0,setTimeout(()=>{qa=!1},0),t(...n))}}const qr=new Map;function su(e,t,n,r,s){const{cache:i}=ge.useContext(Pi),o=[e,...t],l=Wa(o),c=Jf(),h=m=>{i.opUpdate(l,p=>{const[S=0,y]=p||[void 0,void 0];let j=y;process.env.NODE_ENV!=="production"&&y&&c&&(r==null||r(j,c),j=null);const v=j||n(),x=[S,v];return m?m(x):x})};ge.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]),qr.has(l)||(s==null||s(f),qr.set(l,!0),Promise.resolve().then(()=>{qr.delete(l)})),()=>{i.opUpdate(l,m=>{const[p=0,S]=m||[];return p-1===0?(r==null||r(S,!1),qr.delete(l),null):[p-1,S]})}),[l]),f}const Xf={},Qf=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",wn=new Map;function eh(e){wn.set(e,(wn.get(e)||0)+1)}function th(e,t){typeof document<"u"&&document.querySelectorAll(`style[${tu}="${e}"]`).forEach(r=>{var s;r[ln]===t&&((s=r.parentNode)==null||s.removeChild(r))})}const nh=-1;function rh(e,t){wn.set(e,(wn.get(e)||0)-1);const n=new Set;wn.forEach((r,s)=>{r<=0&&n.add(s)}),wn.size-n.size>nh&&n.forEach(r=>{th(r,t),wn.delete(r)})}const sh=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},ah="token";function ih(e,t,n){const{cache:{instanceId:r},container:s,hashPriority:i}=d.useContext(Pi),{salt:o="",override:l=Xf,formatToken:c,getComputedToken:h,cssVar:g,nonce:f}=n,m=Hf(()=>Object.assign({},...t),t),p=wr(m),S=wr(l),y=wr(g);return su(ah,[o,e.id,p,S,y],()=>{const v=h?h(m,l,e):sh(m,l,e,c),x={...v},w=`${o}_${g.prefix}`,C=$r(w),b=`${Qf}-${C}`;x._tokenKey=Yf(x,w);const[T,F]=qf(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=C,eh(g.key),[T,b,x,F,g.key]},([,,,,v])=>{rh(v,r)},([,,,v,x])=>{if(!v)return;let w={mark:Fn,prepend:"queue",attachTo:s,priority:-999};w=ru(w,f);const C=ys(v,$r(`css-var-${x}`),w);C[ln]=r,C.setAttribute(tu,x)})}var oh={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},Ue="-ms-",jr="-moz-",Ae="-webkit-",au="comm",Ni="rule",Li="decl",lh="@import",ch="@namespace",iu="@keyframes",uh="@layer",dh=Math.abs,vr=String.fromCharCode,Ga=Object.assign;function fh(e,t){return tt(e,0)^45?(((t<<2^tt(e,0))<<2^tt(e,1))<<2^tt(e,2))<<2^tt(e,3):0}function ou(e){return e.trim()}function Kt(e,t){return(e=t.exec(e))?e[0]:e}function je(e,t,n){return e.replace(t,n)}function ga(e,t){return e.indexOf(t)}function tt(e,t){return e.charCodeAt(t)|0}function $n(e,t,n){return e.slice(t,n)}function Mt(e){return e.length}function lu(e){return e.length}function yr(e,t){return t.push(e),e}function hh(e,t){return e.map(t).join("")}function ko(e,t){return e.filter(function(n){return!Kt(n,t)})}var qs=1,Zn=1,cu=0,Rt=0,et=0,nr="";function Gs(e,t,n,r,s,i,o,l){return{value:e,root:t,parent:n,type:r,props:s,children:i,line:qs,column:Zn,length:o,return:"",siblings:l}}function an(e,t){return Ga(Gs("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function _n(e){for(;e.root;)e=an(e.root,{children:[e]});yr(e,e.siblings)}function mh(){return et}function gh(){return et=Rt>0?tt(nr,--Rt):0,Zn--,et===10&&(Zn=1,qs--),et}function At(){return et=Rt<cu?tt(nr,Rt++):0,Zn++,et===10&&(Zn=1,qs++),et}function cn(){return tt(nr,Rt)}function xs(){return Rt}function Zs(e,t){return $n(nr,e,t)}function Er(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 ph(e){return qs=Zn=1,cu=Mt(nr=e),Rt=0,[]}function yh(e){return nr="",e}function pa(e){return ou(Zs(Rt-1,Za(e===91?e+2:e===40?e+1:e)))}function xh(e){for(;(et=cn())&&et<33;)At();return Er(e)>2||Er(et)>3?"":" "}function bh(e,t){for(;--t&&At()&&!(et<48||et>102||et>57&&et<65||et>70&&et<97););return Zs(e,xs()+(t<6&&cn()==32&&At()==32))}function Za(e){for(;At();)switch(et){case e:return Rt;case 34:case 39:e!==34&&e!==39&&Za(et);break;case 40:e===41&&Za(e);break;case 92:At();break}return Rt}function Sh(e,t){for(;At()&&e+et!==57;)if(e+et===84&&cn()===47)break;return"/*"+Zs(t,Rt-1)+"*"+vr(e===47?e:At())}function Ch(e){for(;!Er(cn());)At();return Zs(e,Rt)}function Do(e){return yh(bs("",null,null,null,[""],e=ph(e),0,[0],e))}function bs(e,t,n,r,s,i,o,l,c){for(var h=0,g=0,f=o,m=0,p=0,S=0,y=1,j=1,v=1,x=0,w=0,C="",b=s,T=i,F=r,$=C;j;)switch(S=w,w=At()){case 40:S!=108&&tt($,f-1)==58?(x++,$+="("):$+=pa(w);break;case 41:x--,$+=")";break;case 34:case 39:case 91:$+=pa(w);break;case 9:case 10:case 13:case 32:if(x>0){$+=vr(w);break}$+=xh(S);break;case 92:$+=bh(xs()-1,7);continue;case 47:switch(cn()){case 42:case 47:yr(wh(Sh(At(),xs()),t,n,c),c),(Er(S||1)==5||Er(cn()||1)==5)&&Mt($)&&$n($,-1,void 0)!==" "&&($+=" ");break;default:$+="/"}break;case 123*y:l[h++]=Mt($)*v;case 125*y:case 59:case 0:if(x>0&&w){$+=vr(w);break}switch(w){case 0:case 125:j=0;case 59+g:v==-1&&($=je($,/\f/g,"")),p>0&&(Mt($)-f||y===0)&&yr(p>32?No($+";",r,n,f-1,c):No(je($," ","")+";",r,n,f-2,c),c);break;case 59:$+=";";default:if(yr(F=Po($,t,n,h,g,s,l,C,b=[],T=[],f,i),i),w===123)if(g===0)bs($,t,F,F,b,i,f,l,T);else{switch(m){case 99:if(tt($,3)===110)break;case 108:if(tt($,2)===97)break;default:g=0;case 100:case 109:case 115:}g?bs(e,F,F,r&&yr(Po(e,F,F,0,0,s,l,C,s,b=[],f,T),T),s,T,f,l,r?b:T):bs($,F,F,F,[""],T,0,l,T)}}h=g=p=0,y=v=1,C=$="",f=o;break;case 58:f=1+Mt($),p=S;default:if(y<1){if(w==123)--y;else if(w==125&&y++==0&&gh()==125)continue}switch($+=vr(w),w*y){case 38:v=g>0?1:($+="\f",-1);break;case 44:if(x>0)break;l[h++]=(Mt($)-1)*v,v=1;break;case 64:cn()===45&&($+=pa(At())),m=cn(),g=f=Mt(C=$+=Ch(xs())),w++;break;case 45:S===45&&Mt($)==2&&(y=0)}}return i}function Po(e,t,n,r,s,i,o,l,c,h,g,f){for(var m=s-1,p=s===0?i:[""],S=lu(p),y=0,j=0,v=0;y<r;++y)for(var x=0,w=$n(e,m+1,m=dh(j=o[y])),C=e;x<S;++x)(C=ou(j>0?p[x]+" "+w:je(w,/&\f/g,p[x])))&&(c[v++]=C);return Gs(e,t,n,s===0?Ni:l,c,h,g,f)}function wh(e,t,n,r){return Gs(e,t,n,au,vr(mh()),$n(e,2,-2),0,r)}function No(e,t,n,r,s){return Gs(e,t,n,Li,$n(e,0,r),$n(e,r+1,-1),r,s)}function uu(e,t,n){switch(fh(e,t)){case 5103:return Ae+"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 Ae+e+e;case 4855:return Ae+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return jr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ae+e+jr+e+Ue+e+e;case 5936:switch(tt(e,t+11)){case 114:return Ae+e+Ue+je(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ae+e+Ue+je(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ae+e+Ue+je(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ae+e+Ue+e+e;case 6165:return Ae+e+Ue+"flex-"+e+e;case 5187:return Ae+e+je(e,/(\w+).+(:[^]+)/,Ae+"box-$1$2"+Ue+"flex-$1$2")+e;case 5443:return Ae+e+Ue+"flex-item-"+je(e,/flex-|-self/g,"")+(Kt(e,/flex-|baseline/)?"":Ue+"grid-row-"+je(e,/flex-|-self/g,""))+e;case 4675:return Ae+e+Ue+"flex-line-pack"+je(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ae+e+Ue+je(e,"shrink","negative")+e;case 5292:return Ae+e+Ue+je(e,"basis","preferred-size")+e;case 6060:return Ae+"box-"+je(e,"-grow","")+Ae+e+Ue+je(e,"grow","positive")+e;case 4554:return Ae+je(e,/([^-])(transform)/g,"$1"+Ae+"$2")+e;case 6187:return je(je(je(e,/(zoom-|grab)/,Ae+"$1"),/(image-set)/,Ae+"$1"),e,"")+e;case 5495:case 3959:return je(e,/(image-set\([^]*)/,Ae+"$1$`$1");case 4968:return je(je(e,/(.+:)(flex-)?(.*)/,Ae+"box-pack:$3"+Ue+"flex-pack:$3"),/space-between/,"justify")+Ae+e+e;case 4200:if(!Kt(e,/flex-|baseline/))return Ue+"grid-column-align"+$n(e,t)+e;break;case 2592:case 3360:return Ue+je(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,s){return t=s,Kt(r.props,/grid-\w+-end/)})?~ga(e+(n=n[t].value),"span")?e:Ue+je(e,"-start","")+e+Ue+"grid-row-span:"+(~ga(n,"span")?Kt(n,/\d+/):+Kt(n,/\d+/)-+Kt(e,/\d+/))+";":Ue+je(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Kt(r.props,/grid-\w+-start/)})?e:Ue+je(je(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return je(e,/(.+)-inline(.+)/,Ae+"$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(tt(e,t+1)){case 109:if(tt(e,t+4)!==45)break;case 102:return je(e,/(.+:)(.+)-([^]+)/,"$1"+Ae+"$2-$3$1"+jr+(tt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ga(e,"stretch")?uu(je(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return je(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,s,i,o,l,c,h){return Ue+s+":"+i+h+(o?Ue+s+"-span:"+(l?c:+c-+i)+h:"")+e});case 4949:if(tt(e,t+6)===121)return je(e,":",":"+Ae)+e;break;case 6444:switch(tt(e,tt(e,14)===45?18:11)){case 120:return je(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ae+(tt(e,14)===45?"inline-":"")+"box$3$1"+Ae+"$2$3$1"+Ue+"$2box$3")+e;case 100:return je(e,":",":"+Ue)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return je(e,"scroll-","scroll-snap-")+e}return e}function Ir(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Lo(e,t,n,r){switch(e.type){case uh:if(e.children.length)break;case lh:case ch:case Li:return e.return=e.return||e.value;case au:return"";case iu:return e.return=e.value+"{"+Ir(e.children,r)+"}";case Ni:if(!Mt(e.value=e.props.join(",")))return""}return Mt(n=Ir(e.children,r))?e.return=e.value+"{"+n+"}":""}function jh(e){var t=lu(e);return function(n,r,s,i){for(var o="",l=0;l<t;l++)o+=e[l](n,r,s,i)||"";return o}}function vh(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Li:e.return=uu(e.value,e.length,n);return;case iu:return Ir([an(e,{value:je(e.value,"@","@"+Ae)})],r);case Ni:if(e.length)return hh(n=e.props,function(s){switch(Kt(s,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":_n(an(e,{props:[je(s,/:(read-\w+)/,":"+jr+"$1")]})),_n(an(e,{props:[s]})),Ga(e,{props:ko(n,r)});break;case"::placeholder":_n(an(e,{props:[je(s,/:(plac\w+)/,":"+Ae+"input-$1")]})),_n(an(e,{props:[je(s,/:(plac\w+)/,":"+jr+"$1")]})),_n(an(e,{props:[je(s,/:(plac\w+)/,Ue+"input-$1")]})),_n(an(e,{props:[s]})),Ga(e,{props:ko(n,r)});break}return""})}}function du(e,t){const{path:n,parentSelectors:r}=t;He(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${e}${r.length?` Selector: ${r.join(" | ")}`:""}`)}const Th=(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)!=="'"))&&du(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${t}"'\`.`,n)}},Fh=(e,t,n)=>{e==="animation"&&n.hashId&&t!=="none"&&du(`You seem to be using hashed animation '${t}', in which case 'animationName' with Keyframe as value is recommended.`,n)},_o="data-ant-cssinjs-cache-path",fu="_FILE_STYLE__";let Rn,hu=!0;function Rh(){var e;if(!Rn&&(Rn={},Dr())){const t=document.createElement("div");t.className=_o,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(s=>{const[i,o]=s.split(":");Rn[i]=o});const r=document.querySelector(`style[${_o}]`);r&&(hu=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function $h(e){return Rh(),!!Rn[e]}function Eh(e){const t=Rn[e];let n=null;if(t&&Dr())if(hu)n=fu;else{const r=document.querySelector(`style[${Fn}="${Rn[e]}"]`);r?n=r.innerHTML:delete Rn[e]}return[n,t]}const mu="_skip_check_",gu="_multi_value_";function ya(e,t){return(t?Ir(Do(e),jh([vh,Lo])):Ir(Do(e),Lo)).replace(/\{%%%\:[^;];}/g,";")}function Ih(e){return typeof e=="object"&&e&&(mu in e||gu in e)}function zo(e,t,n="high"){if(!t)return e;const r=nu({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 Ja=(e,t={},{root:n,injectHash:r,parentSelectors:s}={root:!0,parentSelectors:[]})=>{const{hashId:i,layer:o,path:l,hashPriority:c,transformers:h=[],linters:g=[]}=t;let f="",m={};function p(j){const v=j.getName(i);if(!m[v]){const[x]=Ja(j.style,t,{root:!1,parentSelectors:s});m[v]=`@keyframes ${j.getName(i)}${x}`}}function S(j,v=[]){return j.forEach(x=>{Array.isArray(x)?S(x,v):x&&v.push(x)}),v}return S(Array.isArray(e)?e:[e]).forEach(j=>{const v=typeof j=="string"&&!n?{}:j;if(typeof v=="string")f+=`${v}
|
|
18
|
-
`;else if(v._keyframe)p(v);else{const x=h.reduce((w
|
|
19
|
-
`))):f=`{${f}}`,[f,m]};function
|
|
17
|
+
*/var To;function gf(){return To||(To=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(typeof y=="object"&&y!==null){var j=y.$$typeof;switch(j){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 u:case m:case f:return y;case o:return y;default:return j}}case n:return j}}}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"),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");Pe.ContextConsumer=o,Pe.ContextProvider=l,Pe.Element=t,Pe.ForwardRef=u,Pe.Fragment=r,Pe.Lazy=m,Pe.Memo=f,Pe.Portal=n,Pe.Profiler=i,Pe.StrictMode=a,Pe.Suspense=h,Pe.SuspenseList=g,Pe.isContextConsumer=function(y){return e(y)===o},Pe.isContextProvider=function(y){return e(y)===l},Pe.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},Pe.isForwardRef=function(y){return e(y)===u},Pe.isFragment=function(y){return e(y)===r},Pe.isLazy=function(y){return e(y)===m},Pe.isMemo=function(y){return e(y)===f},Pe.isPortal=function(y){return e(y)===n},Pe.isProfiler=function(y){return e(y)===i},Pe.isStrictMode=function(y){return e(y)===a},Pe.isSuspense=function(y){return e(y)===h},Pe.isSuspenseList=function(y){return e(y)===g},Pe.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===u||y.$$typeof===S||y.getModuleId!==void 0)},Pe.typeOf=e})()),Pe}var Fo;function pf(){return Fo||(Fo=1,process.env.NODE_ENV==="production"?Wr.exports=hf():Wr.exports=gf()),Wr.exports}var ha=pf();const yf=Symbol.for("react.element"),xf=Symbol.for("react.transitional.element"),bf=Symbol.for("react.fragment");function Gc(e){return e&&typeof e=="object"&&(e.$$typeof===yf||e.$$typeof===xf)&&e.type===bf}var Lc;const Sf=Number((Lc=d.version)==null?void 0:Lc.split(".")[0]),Cf=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},wf=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{Cf(r,n)})}},jf=(...e)=>mf(()=>wf(...e),e,(t,n)=>t.length!==n.length||t.every((r,a)=>r!==n[a])),vf=e=>{var n,r;if(!e)return!1;if(Zc(e)&&Sf>=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 Tf=e=>{if(e&&Zc(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function Ff(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 Ro="data-rc-order",$o="data-rc-priority",Rf="rc-util-key",Wa=new Map;function Jc({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Rf}function Ws(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function $f(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function Ni(e){return e?Array.from((Wa.get(e)||e).children).filter(t=>t.tagName==="STYLE"):[]}function Xc(e,t={}){if(!Dr())return null;const{csp:n,prepend:r,priority:a=0}=t,i=$f(r),o=i==="prependQueue",l=document.createElement("style");l.setAttribute(Ro,i),o&&a&&l.setAttribute($o,`${a}`),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;const u=Ws(t);if(!u)return null;const{firstChild:h}=u;if(r){if(o){const g=(t.styles||Ni(u)).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(Ro)))return!1;const m=Number(f.getAttribute($o)||0);return a>=m});if(g.length)return u.insertBefore(l,g[g.length-1].nextSibling),l}u.insertBefore(l,h)}else u.appendChild(l);return l}function Qc(e,t={}){let{styles:n}=t;return n||(n=Ni(Ws(t))),n.find(r=>r.getAttribute(Jc(t))===e)}function Ef(e,t={}){const n=Qc(e,t);if(n){const r=Ws(t);r==null||r.removeChild(n)}}function If(e,t){const n=Wa.get(e);if(!n||!Ff(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 u,h,g;const r=Ws(n);if(!r)return null;const a=Ni(r),i={...n,styles:a};If(r,i);const o=Qc(t,i);if(o)return(u=i.csp)!=null&&u.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 Eo(e){return e instanceof HTMLElement||e instanceof SVGElement}function Mf(e){return e&&typeof e=="object"&&Eo(e.nativeElement)?e.nativeElement:Eo(e)?e:null}let qa={};const Li=[],Of=e=>{Li.push(e)};function Ms(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=Li.reduce((r,a)=>a(r??"","warning"),t);n&&console.error(`Warning: ${n}`)}}function Af(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=Li.reduce((r,a)=>a(r??"","note"),t);n&&console.warn(`Note: ${n}`)}}function kf(){qa={}}function eu(e,t,n){!t&&!qa[n]&&(e(!1,n),qa[n]=!0)}function He(e,t){eu(Ms,e,t)}function Df(e,t){eu(Af,e,t)}He.preMessage=Of;He.resetWarned=kf;He.noteOnce=Df;function Io(e,t,n=!1){const r=new Set;function a(i,o,l=1){const u=r.has(i);if(He(!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 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 dr={exports:{}},Mo;function Pf(){if(Mo)return dr.exports;Mo=1,dr.exports=r,dr.exports.isMobile=r,dr.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 dr.exports}Pf();function Le(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function gn(e,t={}){let n=[];return d.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(gn(r)):Gc(r)&&r.props?n=n.concat(gn(r.props.children,t)):n.push(r))}),n}function Me(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 u=Array.isArray(l)?[...l]:{...l};delete u[i[0]],o[a]=u}}else o[a]=tu(o[a],i,n,r);return o}function _e(e,t,n,r=!1){return t.length&&r&&n===void 0&&!Me(e,t.slice(0,-1))?e:tu(e,t,n,r)}function Nf(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Oo(e){return Array.isArray(e)?[]:{}}const Lf=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function _f(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let a=Oo(e[0]);return e.forEach(i=>{function o(l,u){const h=new Set(u),g=Me(i,l),f=Array.isArray(g);if(f||Nf(g)){if(!h.has(g)){h.add(g);const m=Me(a,l);f?a=_e(a,l,r(m,g)):(!m||typeof m!="object")&&(a=_e(a,l,Oo(g))),Lf(g).forEach(p=>{Object.getOwnPropertyDescriptor(g,p).enumerable&&o([...l,p],h)})}}else a=_e(a,l,g)}o([])}),a}function Kn(...e){return _f(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 ie(){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 $r(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 zf="%";function Ga(e){return e.join(zf)}let Ao=0;class Bf{constructor(t){oe(this,"instanceId");oe(this,"cache",new Map);oe(this,"updateTimes",new Map);oe(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,Ao),Ao+=1)}}const ru="data-token-hash",Rn="data-css-hash",Vf="data-cache-path",cn="__cssinjs_instance__";function Hf(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${Rn}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(a=>{a[cn]||(a[cn]=e),a[cn]===e&&document.head.insertBefore(a,n)});const r={};Array.from(document.querySelectorAll(`style[${Rn}]`)).forEach(a=>{var o;const i=a.getAttribute(Rn);r[i]?a[cn]===e&&((o=a.parentNode)==null||o.removeChild(a)):r[i]=!0})}return new Bf(e)}const _i=ye.createContext({hashPriority:"low",cache:Hf(),defaultCache:!0,autoPrefix:!1});let ko=0;class Yf{constructor(t){oe(this,"derivatives");oe(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=ko,t.length===0&&Ms(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),ko+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const Uf=new WeakMap,ga={};function Kf(e,t){let n=Uf;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 Do=new WeakMap;function wr(e){let t=Do.get(e)||"";return t||(Object.keys(e).forEach(n=>{const r=e[n];t+=n,r instanceof Yf?t+=r.id:r&&typeof r=="object"?t+=wr(r):t+=r}),t=$r(t),Do.set(e,t)),t}function Wf(e,t){return $r(`${t}_${wr(e)}`)}const Po=Dr();function su(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 au(e,t){const n=typeof t=="function"?t():t;return n?{...e,csp:{...e.csp,nonce:n}}:e}const Gf=(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(),Zf=(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("")}}`},Jf=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",prefix:i,unitless:o,ignore:l,preserve:u}=n||{},h={},g={};return Object.entries(e).forEach(([f,m])=>{if(u!=null&&u[f])g[f]=m;else if((typeof m=="string"||typeof m=="number")&&!(l!=null&&l[f])){const p=Gf(f,i);h[p]=typeof m=="number"&&!(o!=null&&o[f])?`${m}px`:String(m),g[f]=`var(${p})`}}),[g,Zf(h,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:a})]};function Xf(){return!1}let Za=!1;function Qf(){return Za}const em=process.env.NODE_ENV==="production"?Xf:Qf;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 qr=new Map;function iu(e,t,n,r,a){const{cache:i}=ye.useContext(_i),o=[e,...t],l=Ga(o),u=em(),h=m=>{i.opUpdate(l,p=>{const[S=0,y]=p||[void 0,void 0];let j=y;process.env.NODE_ENV!=="production"&&y&&u&&(r==null||r(j,u),j=null);const v=j||n(),x=[S,v];return m?m(x):x})};ye.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]),qr.has(l)||(a==null||a(f),qr.set(l,!0),Promise.resolve().then(()=>{qr.delete(l)})),()=>{i.opUpdate(l,m=>{const[p=0,S]=m||[];return p-1===0?(r==null||r(S,!1),qr.delete(l),null):[p-1,S]})}),[l]),f}const tm={},nm=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",wn=new Map;function rm(e){wn.set(e,(wn.get(e)||0)+1)}function sm(e,t){typeof document<"u"&&document.querySelectorAll(`style[${ru}="${e}"]`).forEach(r=>{var a;r[cn]===t&&((a=r.parentNode)==null||a.removeChild(r))})}const am=-1;function im(e,t){wn.set(e,(wn.get(e)||0)-1);const n=new Set;wn.forEach((r,a)=>{r<=0&&n.add(a)}),wn.size-n.size>am&&n.forEach(r=>{sm(r,t),wn.delete(r)})}const om=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},lm="token";function cm(e,t,n){const{cache:{instanceId:r},container:a,hashPriority:i}=d.useContext(_i),{salt:o="",override:l=tm,formatToken:u,getComputedToken:h,cssVar:g,nonce:f}=n,m=Kf(()=>Object.assign({},...t),t),p=wr(m),S=wr(l),y=wr(g);return iu(lm,[o,e.id,p,S,y],()=>{const v=h?h(m,l,e):om(m,l,e,u),x={...v},C=`${o}_${g.prefix}`,w=$r(C),b=`${nm}-${w}`;x._tokenKey=Wf(x,C);const[T,F]=Jf(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=w,rm(g.key),[T,b,x,F,g.key]},([,,,,v])=>{im(v,r)},([,,,v,x])=>{if(!v)return;let C={mark:Rn,prepend:"queue",attachTo:a,priority:-999};C=au(C,f);const w=ys(v,$r(`css-var-${x}`),C);w[cn]=r,w.setAttribute(ru,x)})}var um={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},Ue="-ms-",jr="-moz-",Ae="-webkit-",ou="comm",zi="rule",Bi="decl",dm="@import",fm="@namespace",lu="@keyframes",mm="@layer",hm=Math.abs,vr=String.fromCharCode,Ja=Object.assign;function gm(e,t){return tt(e,0)^45?(((t<<2^tt(e,0))<<2^tt(e,1))<<2^tt(e,2))<<2^tt(e,3):0}function cu(e){return e.trim()}function Wt(e,t){return(e=t.exec(e))?e[0]:e}function je(e,t,n){return e.replace(t,n)}function pa(e,t){return e.indexOf(t)}function tt(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 xr(e,t){return t.push(e),e}function pm(e,t){return e.map(t).join("")}function No(e,t){return e.filter(function(n){return!Wt(n,t)})}var qs=1,Jn=1,du=0,Rt=0,et=0,rr="";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:Jn,length:o,return:"",siblings:l}}function on(e,t){return Ja(Gs("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function zn(e){for(;e.root;)e=on(e.root,{children:[e]});xr(e,e.siblings)}function ym(){return et}function xm(){return et=Rt>0?tt(rr,--Rt):0,Jn--,et===10&&(Jn=1,qs--),et}function Dt(){return et=Rt<du?tt(rr,Rt++):0,Jn++,et===10&&(Jn=1,qs++),et}function un(){return tt(rr,Rt)}function xs(){return Rt}function Zs(e,t){return En(rr,e,t)}function Er(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 bm(e){return qs=Jn=1,du=Mt(rr=e),Rt=0,[]}function Sm(e){return rr="",e}function ya(e){return cu(Zs(Rt-1,Xa(e===91?e+2:e===40?e+1:e)))}function Cm(e){for(;(et=un())&&et<33;)Dt();return Er(e)>2||Er(et)>3?"":" "}function wm(e,t){for(;--t&&Dt()&&!(et<48||et>102||et>57&&et<65||et>70&&et<97););return Zs(e,xs()+(t<6&&un()==32&&Dt()==32))}function Xa(e){for(;Dt();)switch(et){case e:return Rt;case 34:case 39:e!==34&&e!==39&&Xa(et);break;case 40:e===41&&Xa(e);break;case 92:Dt();break}return Rt}function jm(e,t){for(;Dt()&&e+et!==57;)if(e+et===84&&un()===47)break;return"/*"+Zs(t,Rt-1)+"*"+vr(e===47?e:Dt())}function vm(e){for(;!Er(un());)Dt();return Zs(e,Rt)}function Lo(e){return Sm(bs("",null,null,null,[""],e=bm(e),0,[0],e))}function bs(e,t,n,r,a,i,o,l,u){for(var h=0,g=0,f=o,m=0,p=0,S=0,y=1,j=1,v=1,x=0,C=0,w="",b=a,T=i,F=r,R=w;j;)switch(S=C,C=Dt()){case 40:S!=108&&tt(R,f-1)==58?(x++,R+="("):R+=ya(C);break;case 41:x--,R+=")";break;case 34:case 39:case 91:R+=ya(C);break;case 9:case 10:case 13:case 32:if(x>0){R+=vr(C);break}R+=Cm(S);break;case 92:R+=wm(xs()-1,7);continue;case 47:switch(un()){case 42:case 47:xr(Tm(jm(Dt(),xs()),t,n,u),u),(Er(S||1)==5||Er(un()||1)==5)&&Mt(R)&&En(R,-1,void 0)!==" "&&(R+=" ");break;default:R+="/"}break;case 123*y:l[h++]=Mt(R)*v;case 125*y:case 59:case 0:if(x>0&&C){R+=vr(C);break}switch(C){case 0:case 125:j=0;case 59+g:v==-1&&(R=je(R,/\f/g,"")),p>0&&(Mt(R)-f||y===0)&&xr(p>32?zo(R+";",r,n,f-1,u):zo(je(R," ","")+";",r,n,f-2,u),u);break;case 59:R+=";";default:if(xr(F=_o(R,t,n,h,g,a,l,w,b=[],T=[],f,i),i),C===123)if(g===0)bs(R,t,F,F,b,i,f,l,T);else{switch(m){case 99:if(tt(R,3)===110)break;case 108:if(tt(R,2)===97)break;default:g=0;case 100:case 109:case 115:}g?bs(e,F,F,r&&xr(_o(e,F,F,0,0,a,l,w,a,b=[],f,T),T),a,T,f,l,r?b:T):bs(R,F,F,F,[""],T,0,l,T)}}h=g=p=0,y=v=1,w=R="",f=o;break;case 58:f=1+Mt(R),p=S;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&xm()==125)continue}switch(R+=vr(C),C*y){case 38:v=g>0?1:(R+="\f",-1);break;case 44:if(x>0)break;l[h++]=(Mt(R)-1)*v,v=1;break;case 64:un()===45&&(R+=ya(Dt())),m=un(),g=f=Mt(w=R+=vm(xs())),C++;break;case 45:S===45&&Mt(R)==2&&(y=0)}}return i}function _o(e,t,n,r,a,i,o,l,u,h,g,f){for(var m=a-1,p=a===0?i:[""],S=uu(p),y=0,j=0,v=0;y<r;++y)for(var x=0,C=En(e,m+1,m=hm(j=o[y])),w=e;x<S;++x)(w=cu(j>0?p[x]+" "+C:je(C,/&\f/g,p[x])))&&(u[v++]=w);return Gs(e,t,n,a===0?zi:l,u,h,g,f)}function Tm(e,t,n,r){return Gs(e,t,n,ou,vr(ym()),En(e,2,-2),0,r)}function zo(e,t,n,r,a){return Gs(e,t,n,Bi,En(e,0,r),En(e,r+1,-1),r,a)}function fu(e,t,n){switch(gm(e,t)){case 5103:return Ae+"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 Ae+e+e;case 4855:return Ae+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return jr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ae+e+jr+e+Ue+e+e;case 5936:switch(tt(e,t+11)){case 114:return Ae+e+Ue+je(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ae+e+Ue+je(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ae+e+Ue+je(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ae+e+Ue+e+e;case 6165:return Ae+e+Ue+"flex-"+e+e;case 5187:return Ae+e+je(e,/(\w+).+(:[^]+)/,Ae+"box-$1$2"+Ue+"flex-$1$2")+e;case 5443:return Ae+e+Ue+"flex-item-"+je(e,/flex-|-self/g,"")+(Wt(e,/flex-|baseline/)?"":Ue+"grid-row-"+je(e,/flex-|-self/g,""))+e;case 4675:return Ae+e+Ue+"flex-line-pack"+je(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ae+e+Ue+je(e,"shrink","negative")+e;case 5292:return Ae+e+Ue+je(e,"basis","preferred-size")+e;case 6060:return Ae+"box-"+je(e,"-grow","")+Ae+e+Ue+je(e,"grow","positive")+e;case 4554:return Ae+je(e,/([^-])(transform)/g,"$1"+Ae+"$2")+e;case 6187:return je(je(je(e,/(zoom-|grab)/,Ae+"$1"),/(image-set)/,Ae+"$1"),e,"")+e;case 5495:case 3959:return je(e,/(image-set\([^]*)/,Ae+"$1$`$1");case 4968:return je(je(e,/(.+:)(flex-)?(.*)/,Ae+"box-pack:$3"+Ue+"flex-pack:$3"),/space-between/,"justify")+Ae+e+e;case 4200:if(!Wt(e,/flex-|baseline/))return Ue+"grid-column-align"+En(e,t)+e;break;case 2592:case 3360:return Ue+je(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,a){return t=a,Wt(r.props,/grid-\w+-end/)})?~pa(e+(n=n[t].value),"span")?e:Ue+je(e,"-start","")+e+Ue+"grid-row-span:"+(~pa(n,"span")?Wt(n,/\d+/):+Wt(n,/\d+/)-+Wt(e,/\d+/))+";":Ue+je(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Wt(r.props,/grid-\w+-start/)})?e:Ue+je(je(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return je(e,/(.+)-inline(.+)/,Ae+"$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(tt(e,t+1)){case 109:if(tt(e,t+4)!==45)break;case 102:return je(e,/(.+:)(.+)-([^]+)/,"$1"+Ae+"$2-$3$1"+jr+(tt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~pa(e,"stretch")?fu(je(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return je(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,a,i,o,l,u,h){return Ue+a+":"+i+h+(o?Ue+a+"-span:"+(l?u:+u-+i)+h:"")+e});case 4949:if(tt(e,t+6)===121)return je(e,":",":"+Ae)+e;break;case 6444:switch(tt(e,tt(e,14)===45?18:11)){case 120:return je(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ae+(tt(e,14)===45?"inline-":"")+"box$3$1"+Ae+"$2$3$1"+Ue+"$2box$3")+e;case 100:return je(e,":",":"+Ue)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return je(e,"scroll-","scroll-snap-")+e}return e}function Ir(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Bo(e,t,n,r){switch(e.type){case mm:if(e.children.length)break;case dm:case fm:case Bi:return e.return=e.return||e.value;case ou:return"";case lu:return e.return=e.value+"{"+Ir(e.children,r)+"}";case zi:if(!Mt(e.value=e.props.join(",")))return""}return Mt(n=Ir(e.children,r))?e.return=e.value+"{"+n+"}":""}function Fm(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 Rm(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Bi:e.return=fu(e.value,e.length,n);return;case lu:return Ir([on(e,{value:je(e.value,"@","@"+Ae)})],r);case zi:if(e.length)return pm(n=e.props,function(a){switch(Wt(a,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":zn(on(e,{props:[je(a,/:(read-\w+)/,":"+jr+"$1")]})),zn(on(e,{props:[a]})),Ja(e,{props:No(n,r)});break;case"::placeholder":zn(on(e,{props:[je(a,/:(plac\w+)/,":"+Ae+"input-$1")]})),zn(on(e,{props:[je(a,/:(plac\w+)/,":"+jr+"$1")]})),zn(on(e,{props:[je(a,/:(plac\w+)/,Ue+"input-$1")]})),zn(on(e,{props:[a]})),Ja(e,{props:No(n,r)});break}return""})}}function mu(e,t){const{path:n,parentSelectors:r}=t;He(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${e}${r.length?` Selector: ${r.join(" | ")}`:""}`)}const $m=(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)}},Em=(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)},Vo="data-ant-cssinjs-cache-path",hu="_FILE_STYLE__";let $n,gu=!0;function Im(){var e;if(!$n&&($n={},Dr())){const t=document.createElement("div");t.className=Vo,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(":");$n[i]=o});const r=document.querySelector(`style[${Vo}]`);r&&(gu=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function Mm(e){return Im(),!!$n[e]}function Om(e){const t=$n[e];let n=null;if(t&&Dr())if(gu)n=hu;else{const r=document.querySelector(`style[${Rn}="${$n[e]}"]`);r?n=r.innerHTML:delete $n[e]}return[n,t]}const pu="_skip_check_",yu="_multi_value_";function xa(e,t){return(t?Ir(Lo(e),Fm([Rm,Bo])):Ir(Lo(e),Bo)).replace(/\{%%%\:[^;];}/g,";")}function Am(e){return typeof e=="object"&&e&&(pu in e||yu in e)}function Ho(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 u=((h=l.match(/^\w+/))==null?void 0:h[0])||"";return l=`${u}${r}${l.slice(u.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:u,transformers:h=[],linters:g=[]}=t;let f="",m={};function p(j){const v=j.getName(i);if(!m[v]){const[x]=Qa(j.style,t,{root:!1,parentSelectors:a});m[v]=`@keyframes ${j.getName(i)}${x}`}}function S(j,v=[]){return j.forEach(x=>{Array.isArray(x)?S(x,v):x&&v.push(x)}),v}return S(Array.isArray(e)?e:[e]).forEach(j=>{const v=typeof j=="string"&&!n?{}:j;if(typeof v=="string")f+=`${v}
|
|
18
|
+
`;else if(v._keyframe)p(v);else{const x=h.reduce((C,w)=>{var b;return((b=w==null?void 0:w.visit)==null?void 0:b.call(w,C))||C},v);Object.keys(x).forEach(C=>{const w=x[C];if(typeof w=="object"&&w&&(C!=="animationName"||!w._keyframe)&&!Am(w)){let b=!1,T=C.trim(),F=!1;(n||r)&&i?T.startsWith("@")?b=!0:T==="&"?T=Ho("",i,u):T=Ho(C,i,u):n&&!i&&(T==="&"||T==="")&&(T="",F=!0);const[R,E]=Qa(w,t,{root:F,injectHash:b,parentSelectors:[...a,T]});m={...m,...E},f+=`${T}${R}`}else{let b=function(F,R){process.env.NODE_ENV!=="production"&&(typeof w!="object"||!(w!=null&&w[pu]))&&[$m,Em,...g].forEach(O=>O(F,R,{path:l,hashId:i,parentSelectors:a}));const E=F.replace(/[A-Z]/g,O=>`-${O.toLowerCase()}`);let M=R;!um[F]&&typeof M=="number"&&M!==0&&(M=`${M}px`),F==="animationName"&&(R!=null&&R._keyframe)&&(p(R),M=R.getName(i)),f+=`${E}:${M};`};const T=(w==null?void 0:w.value)??w;typeof w=="object"&&(w!=null&&w[yu])&&Array.isArray(T)?T.forEach(F=>{b(C,F)}):qf(T)&&b(C,T)}})}}),n?o&&(f&&(f=`@layer ${o.name} {${f}}`),o.dependencies&&(m[`@layer ${o.name}`]=o.dependencies.map(j=>`@layer ${j}, ${o.name};`).join(`
|
|
19
|
+
`))):f=`{${f}}`,[f,m]};function km(e,t){return $r(`${e.join("%")}${t}`)}const Dm="style";function Pm(e,t){const{path:n,hashId:r,layer:a,nonce:i,clientOnly:o,order:l=0}=e,{mock:u,hashPriority:h,container:g,transformers:f,linters:m,cache:p,layer:S,autoPrefix:y}=ye.useContext(_i),j=[r||""];S&&j.push("layer"),j.push(...n);let v=Po;process.env.NODE_ENV!=="production"&&u!==void 0&&(v=u==="client"),iu(Dm,j,()=>{const x=j.join("|");if(Mm(x)){const[R,E]=Om(x);if(R)return[R,E,{},o,l]}const C=t(),[w,b]=Qa(C,{hashId:r,hashPriority:h,layer:S?a:void 0,path:n.join("-"),transformers:f,linters:m}),T=xa(w,y||!1),F=km(j,T);return[T,F,b,o,l]},(x,C)=>{const[,w]=x;C&&Po&&Ef(w,{mark:Rn,attachTo:g})},x=>{const[C,w,b,,T]=x;if(v&&C!==hu){let F={mark:Rn,prepend:S?!1:"queue",attachTo:g,priority:T};F=au(F,i);const R=[],E=[];Object.keys(b).forEach(O=>{O.startsWith("@layer")?R.push(O):E.push(O)}),R.forEach(O=>{ys(xa(b[O],y||!1),`_layer-${O}`,{...F,prepend:!0})});const M=ys(C,w,F);M[cn]=p.instanceId,process.env.NODE_ENV!=="production"&&M.setAttribute(Vf,j.join("|")),E.forEach(O=>{ys(xa(b[O],y||!1),`_effect-${O}`,F)})}})}class xu{constructor(t,n){oe(this,"name");oe(this,"style");oe(this,"_keyframe",!0);this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}function Bn(e){return e.notSplit=!0,e}Bn(["borderTop","borderBottom"]),Bn(["borderTop"]),Bn(["borderBottom"]),Bn(["borderLeft","borderRight"]),Bn(["borderLeft"]),Bn(["borderRight"]);const Nm={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:"页码"},Lm={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},_m={...Lm,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:["开始周","结束周"],..._m},timePickerLocale:{...bu}};ei.lang.ok="确定";const yt="${label}不是一个有效的${type}",zm={locale:"zh-cn",Pagination:Nm,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:{}},Bm=Ss.exports,Yo;function Vm(){return Yo||(Yo=1,(function(e,t){(function(n,r){e.exports=r(Yc())})(Bm,(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}))})(Ss)),Ss.exports}Vm();var Gr={exports:{}},ba={};/**
|
|
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
|
|
27
|
+
*/var Uo;function Hm(){if(Uo)return ba;Uo=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,j=S[1];return i(function(){y.value=p,y.getSnapshot=m,u(y)&&j({inst:y})},[f,p,m]),a(function(){return u(y)&&j({inst:y}),f(function(){u(y)&&j({inst:y})})},[f]),o(p),p}function u(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={};/**
|
|
28
28
|
* @license React
|
|
29
29
|
* use-sync-external-store-shim.development.js
|
|
30
30
|
*
|
|
@@ -32,28 +32,28 @@
|
|
|
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 Ho;function Bh(){return Ho||(Ho=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||s.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 j=S();i(y,j)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}j=o({inst:{value:y,getSnapshot:S}});var v=j[0].inst,x=j[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 s=d,i=typeof Object.is=="function"?Object.is:e,o=s.useState,l=s.useEffect,c=s.useLayoutEffect,h=s.useDebugValue,g=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ba.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ba}var Yo;function Vh(){return Yo||(Yo=1,process.env.NODE_ENV==="production"?Gr.exports=zh():Gr.exports=Bh()),Gr.exports}var Uo=Vh(),Ko=Object.prototype.hasOwnProperty;function Qa(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--&&Qa(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ko.call(e,n)&&++r&&!Ko.call(t,n)||!(n in t)||!Qa(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const xu=0,bu=1,Su=2,Wo=3,Cu=4,Nt=new WeakMap,Wt=()=>{},ze=Wt(),Os=Object,we=e=>e===ze,Ot=e=>typeof e=="function",Lt=(e,t)=>({...e,...t}),ei=e=>Ot(e.then),Sa={},Zr={},_i="undefined",Pr=typeof window!=_i,ti=typeof document!=_i,Hh=Pr&&"Deno"in window,Yh=()=>Pr&&typeof window.requestAnimationFrame!=_i,wu=(e,t)=>{const n=Nt.get(e);return[()=>!we(t)&&e.get(t)||Sa,r=>{if(!we(t)){const s=e.get(t);t in Zr||(Zr[t]=s),n[5](t,Lt(s,r),s||Sa)}},n[6],()=>!we(t)&&t in Zr?Zr[t]:!we(t)&&e.get(t)||Sa]};let ni=!0;const Uh=()=>ni,[ri,si]=Pr&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Wt,Wt],Kh=()=>{const e=ti&&document.visibilityState;return we(e)||e!=="hidden"},Wh=e=>(ti&&document.addEventListener("visibilitychange",e),ri("focus",e),()=>{ti&&document.removeEventListener("visibilitychange",e),si("focus",e)}),qh=e=>{const t=()=>{ni=!0,e()},n=()=>{ni=!1};return ri("online",t),ri("offline",n),()=>{si("online",t),si("offline",n)}},Gh={isOnline:Uh,isVisible:Kh},Zh={initFocus:Wh,initReconnect:qh},qo=!d.useId,jn=!Pr||Hh,Jh=e=>Yh()?window.requestAnimationFrame(e):setTimeout(e,1),Hn=jn?d.useEffect:d.useLayoutEffect,Ca=typeof navigator<"u"&&navigator.connection,Go=!jn&&Ca&&(["slow-2g","2g"].includes(Ca.effectiveType)||Ca.saveData),Jr=new WeakMap,Xh=e=>Os.prototype.toString.call(e),wa=(e,t)=>e===`[object ${t}]`;let Qh=0;const ai=e=>{const t=typeof e,n=Xh(e),r=wa(n,"Date"),s=wa(n,"RegExp"),i=wa(n,"Object");let o,l;if(Os(e)===e&&!r&&!s){if(o=Jr.get(e),o)return o;if(o=++Qh+"~",Jr.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=ai(e[l])+",";Jr.set(e,o)}if(i){o="#";const c=Os.keys(e).sort();for(;!we(l=c.pop());)we(e[l])||(o+=l+":"+ai(e[l])+",");Jr.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},zi=e=>{if(Ot(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ai(e):"",[e,t]};let em=0;const As=()=>++em;async function ju(...e){const[t,n,r,s]=e,i=Lt({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});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(Ot(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]=zi(m);if(!p)return;const[S,y]=wu(t,p),[j,v,x,w]=Nt.get(t),C=()=>{const k=j[p];return(Ot(i.revalidate)?i.revalidate(S().data,m):i.revalidate!==!1)&&(delete x[p],delete w[p],k&&k[0])?k[0](Su).then(()=>S().data):S().data};if(e.length<3)return C();let b=r,T,F=!1;const $=As();v[p]=[$,0];const M=!we(c),I=S(),A=I.data,Y=I._c,H=we(Y)?A:Y;if(M&&(c=Ot(c)?c(H,A):c,y({data:c,_c:H})),Ot(b))try{b=b(H)}catch(k){T=k,F=!0}if(b&&ei(b))if(b=await b.catch(k=>{T=k,F=!0}),$!==v[p][0]){if(F)throw T;return b}else F&&M&&h(T)&&(o=!0,y({data:H,_c:ze}));if(o&&!F)if(Ot(o)){const k=o(b,H);y({data:k,error:ze,_c:ze})}else y({data:b,error:ze,_c:ze});if(v[p][1]=As(),Promise.resolve(C()).then(()=>{y({_c:ze})}),F){if(g)throw T;return}return b}}const Zo=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},vu=(e,t)=>{if(!Nt.has(e)){const r=Lt(Zh,t),s=Object.create(null),i=ju.bind(ze,e);let o=Wt;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 j of y)j(p,S)},g=m=>{const p=Nt.get(e),[,S,y,j]=p,v=As();p[8]++;for(const C in y)delete y[C];for(const C in j)delete j[C];for(const C in S)S[C]=[v,v];const x={};for(const C of[...e.keys()]){const b=e.get(C);e.delete(C);const T=l[C];if(T)for(const F of T)F(x,b)}const w=!m||m.revalidate!==!1;for(const C in s){const b=s[C];for(let T=0;T<b.length;T++)b[T](Cu,{revalidate:w&&!T})}},f=()=>{if(!Nt.has(e)&&(Nt.set(e,[s,Object.create(null),Object.create(null),Object.create(null),i,h,c,g,0]),!jn)){const m=r.initFocus(setTimeout.bind(ze,Zo.bind(ze,s,xu))),p=r.initReconnect(setTimeout.bind(ze,Zo.bind(ze,s,bu)));o=()=>{m&&m(),p&&p(),Nt.delete(e)}}};return f(),[e,i,f,o,g]}const n=Nt.get(e);return[e,n[4],ze,ze,n[7]]},tm=(e,t,n,r,s)=>{const i=n.errorRetryCount,o=s.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!we(i)&&o>i||setTimeout(r,l,s)},nm=Qa,[Bi,rm,,,sm]=vu(new Map),Tu=Lt({onLoadingSlow:Wt,onSuccess:Wt,onError:Wt,onErrorRetry:tm,onDiscarded:Wt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Go?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Go?5e3:3e3,compare:nm,isPaused:()=>!1,cache:Bi,mutate:rm,unload:sm,fallback:{}},Gh),Fu=(e,t)=>{const n=Lt(e,t);if(t){const{use:r,fallback:s,cacheData:i}=e,{use:o,fallback:l,cacheData:c}=t;r&&o&&(n.use=r.concat(o)),s&&l&&(n.fallback=Lt(s,l)),i&&c&&(n.cacheData=Lt(i,c))}return n},ii=d.createContext({}),am=e=>{const{value:t}=e,n=d.useContext(ii),r=Ot(t),s=d.useMemo(()=>r?t(n):t,[r,n,t]),i=d.useMemo(()=>r?s:Fu(n,s),[r,n,s]),o=s&&s.provider,l=d.useRef(ze);o&&!l.current&&(l.current=vu(o(i.cache||Bi),s));const c=l.current;return c&&(i.cache=c[0],i.mutate=c[1],i.unload=c[4]),Hn(()=>{if(c)return c[2]&&c[2](),c[3]},[]),d.createElement(ii.Provider,Lt(e,{value:i}))},im="$inf$",Ru=Pr&&window.__SWR_DEVTOOLS_USE__,om=Ru?window.__SWR_DEVTOOLS_USE__:[],lm=()=>{Ru&&(window.__SWR_DEVTOOLS_REACT__=d)},cm=e=>Ot(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],$u=()=>{const e=d.useContext(ii);return d.useMemo(()=>Lt(Tu,e),[e])},um=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=zi(t),[,,,l]=Nt.get(Bi);if(o.startsWith(im))return n(...i);const c=l[o];return we(c)?n(...i):(delete l[o],c)}),r),dm=om.concat(um),fm=e=>function(...n){const r=$u(),[s,i,o]=cm(n),l=Fu(r,o);let c=e;const{use:h}=l,g=(h||[]).concat(dm);for(let f=g.length;f--;)c=g[f](c);return c(s,i||l.fetcher||null,l)},hm=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const s=r.indexOf(n);s>=0&&(r[s]=r[r.length-1],r.pop())}};lm();const Xr=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}}),ja={dedupe:!0},Jo=(e,t,n)=>{var r;return t?((r=e.get(t))==null?void 0:r.has(n))===!0:!1},va=(e,t,n)=>{if(!t)return;let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)},mm=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{const s=i=>{n()&&we(t())&&r(i)};Promise.resolve(e).then(i=>{s({data:i,error:ze})},i=>{s({error:i})})},ks=Promise.resolve(ze);ks.status="fulfilled";ks.value=ze;const gm=()=>Wt,pm=(e,t,n)=>{const{cache:r,compare:s,suspense:i,fallbackData:o,revalidateOnMount:l,revalidateIfStale:c,refreshInterval:h,refreshWhenHidden:g,refreshWhenOffline:f,keepPreviousData:m,strictServerPrefetchWarning:p}=n,[S,y,j,v]=Nt.get(r),[x,w]=zi(e),C=d.useRef(!1),b=d.useRef(!1),T=d.useRef(x),F=d.useRef(t),$=d.useRef(n),M=()=>$.current,I=()=>M().isVisible()&&M().isOnline(),[A,Y,H,k]=wu(r,x),E=d.useRef({}).current,R=we(o)?we(n.fallback)?ze:n.fallback[x]:o,z=n.cacheData,_=x?z==null?void 0:z[x]:ze,V=x?v[x]:ze,Z=we(V)&&!we(_),B=Z?_:V,U=(Q,fe)=>{for(const me in E){const ve=me;if(ve==="data"){if(!s(Q[ve],fe[ve])&&(!we(Q[ve])||!s(ee,fe[ve])))return!1}else if(fe[ve]!==Q[ve])return!1}return!0},J=!C.current,G=d.useMemo(()=>{const Q=A(),fe=k(),me=Ye=>{const Ge=Lt(Ye);return delete Ge._k,(()=>{if(!x||!t||M().isPaused())return!1;if(J&&!we(l))return l;const Re=we(R)?Ge.data:R;return i&&Z&&we(Re)?!1:we(Re)||c})()?{isValidating:!0,isLoading:!0,...Ge}:Ge},ve=me(Q),Ee=Q===fe?ve:me(fe);let Te=ve;return[()=>{const Ye=me(A());return U(Ye,Te)?(Te.data=Ye.data,Te.isLoading=Ye.isLoading,Te.isValidating=Ye.isValidating,Te.error=Ye.error,Te):(Te=Ye,Ye)},()=>Ee]},[r,x]),K=Uo.useSyncExternalStore(d.useCallback(Q=>H(x,(fe,me)=>{U(me,fe)||Q()}),[r,x]),G[0],G[1]),O=S[x]&&S[x].length>0,P=K.data;let N=we(P)?R&&ei(R)?Xr(R):R:P;const D=K.error,L=d.useRef(N),W=d.useRef(ze);let q=W.current;q||(q=new WeakMap,W.current=q);const X=d.useRef(null);let ee=m?we(P)?we(L.current)?N:L.current:P:N;const re=x&&we(N),le=d.useRef(null);!jn&&Uo.useSyncExternalStore(gm,()=>(le.current=!1,le),()=>(le.current=!0,le));const ce=le.current;p&&ce&&!i&&re&&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 de=!x||!t||M().isPaused()||O&&!we(D)?!1:J&&!we(l)?l:i&&Z&&re?!1:i?we(N)?!1:c:we(N)||c,te=J&&de,ue=we(K.isValidating)?te:K.isValidating,pe=we(K.isLoading)?te:K.isLoading,be=d.useCallback(async Q=>{const fe=F.current;if(!x||!fe||b.current||M().isPaused())return!1;let me,ve,Ee=!0;const Te=Q||{},Ye=!j[x]||!Te.dedupe,Ge=Z&&!Jo(q,z,x)&&!we(B)&&we(A().data),Ce=()=>qo?!b.current&&x===T.current&&C.current:x===T.current,Re={isValidating:!1,isLoading:!1},dt=()=>{Y(Re)},rt=()=>{const Qe=j[x];Qe&&Qe[1]===ve&&delete j[x]},lt={isValidating:!0};we(A().data)&&(lt.isLoading=!0);try{if(Ye&&(Y(lt),n.loadingTimeout&&we(A().data)&&setTimeout(()=>{Ee&&Ce()&&M().onLoadingSlow(x,n)},n.loadingTimeout),Ge&&va(q,z,x),j[x]=[Ge?B:fe(w),As()],Ge&&v[x]&&delete v[x]),[me,ve]=j[x],me=await me,Ye&&setTimeout(rt,n.dedupingInterval),!j[x]||j[x][1]!==ve)return Ye&&Ce()&&M().onDiscarded(x),!1;Re.error=ze;const Qe=y[x];if(!we(Qe)&&(ve<=Qe[0]||ve<=Qe[1]||Qe[1]===0))return dt(),Ye&&Ce()&&M().onDiscarded(x),!1;const st=A().data;Re.data=s(st,me)?st:me,Ye&&Ce()&&M().onSuccess(me,x,n)}catch(Qe){rt();const st=M(),{shouldRetryOnError:Qt}=st;st.isPaused()||(Re.error=Qe,Ye&&Ce()&&(st.onError(Qe,x,st),(Qt===!0||Ot(Qt)&&Qt(Qe))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||I())&&st.onErrorRetry(Qe,x,st,Hr=>{const en=S[x];en&&en[0]&&en[0](Wo,Hr)},{retryCount:(Te.retryCount||0)+1,dedupe:!0})))}return Ee=!1,dt(),!0},[x,r]),ne=d.useCallback((...Q)=>ju(r,T.current,...Q),[]);if(Hn(()=>{const Q=X.current;Q&&(X.current=null,va(q,Q.cacheData,Q.key),we(A().data)&&Y({data:Q.data,error:ze,_k:Q._k}),v[Q.key]&&delete v[Q.key])}),Hn(()=>{F.current=t,$.current=n,we(P)||(L.current=P)}),Hn(()=>{if(t||!Z||we(B)||Jo(q,z,x)||!we(A().data))return;va(q,z,x);const Q=y[x];mm({value:B,getCacheData:()=>A().data,canCommit:()=>!b.current&&x===T.current&&y[x]===Q,setCache:fe=>Y({...fe,_k:w})})}),Hn(()=>{if(!x)return;const Q=be.bind(ze,ja);let fe=0;M().revalidateOnFocus&&(fe=Date.now()+M().focusThrottleInterval);const ve=hm(x,S,(Ee,Te={})=>{if(Ee==xu){const Ye=Date.now();M().revalidateOnFocus&&Ye>fe&&I()&&(fe=Ye+M().focusThrottleInterval,Q())}else if(Ee==bu)M().revalidateOnReconnect&&I()&&Q();else{if(Ee==Su)return be();if(Ee==Wo)return be(Te);if(Ee==Cu&&(L.current=ze,Te.revalidate))return be()}});return b.current=!1,T.current=x,C.current=!0,Y({_k:w}),de&&(j[x]||(we(N)||jn?Q():Jh(Q))),()=>{b.current=!0,ve()}},[x]),Hn(()=>{let Q;function fe(){const ve=Ot(h)?h(A().data):h;ve&&Q!==-1&&(Q=setTimeout(me,ve))}function me(){!A().error&&(g||M().isVisible())&&(f||M().isOnline())?be(ja).then(fe):fe()}return fe(),()=>{Q&&(clearTimeout(Q),Q=-1)}},[h,g,f,x]),d.useDebugValue(ee),i){if(!qo&&jn&&re&&we(B))throw new Error("Fallback data is required when using Suspense in SSR.");re&&(F.current=t,$.current=n,b.current=!1);const Q=!we(B)&&re;let fe=ze;if(Q&&Z)fe=B&&ei(B)?Xr(B):B,N=fe,ee=fe,jn||(X.current={data:fe,_k:w,key:x,cacheData:z});else{const ve=Q?ne(B):ks;Xr(ve)}if(!we(D)&&re)throw D;const me=re&&we(fe)?be(ja):ks;!we(ee)&&re&&(me.status="fulfilled",me.value=!0),Xr(me)}return{mutate:ne,get data(){return E.data=!0,ee},get error(){return E.error=!0,D},get isValidating(){return E.isValidating=!0,ue},get isLoading(){return E.isLoading=!0,pe}}},ym=Os.defineProperty(am,"defaultValue",{value:Tu}),Eu=fm(pm),xm={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:"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"}},Sm={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"}},Cm={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"}},wm={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"}},jm={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"}},vm={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"}},Tm={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:"نزدیک"}},Fm={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"}},Rm={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:"סגור"}},$m={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"}},Em={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"}},Im={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"}},Mm={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:"더보기",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:"가까 운"}},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:"Хаах"}},km={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"}},Dm={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"}},Pm={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ć"}},Nm={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"}},Lm={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"}},_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:"€",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ť"}},Bm={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:"Затворите"}},Vm={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"}},Hm={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:"ปิด"}},Ym={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"}},Um={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:"Закрито"}},Km={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"}},Wm={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"}},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:"关闭"}},Gm={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:"關閉"}},Zm={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:"關閉"}},Oe=(e,t)=>({getMessage:(n,r)=>{const s=Me(t,n.replace(/\[(\d+)\]/g,".$1").split("."))||"";if(s)return s;if(e.replace("_","-")==="zh-CN")return r;const o=En["zh-CN"];return o?o.getMessage(n,r):r},locale:e}),Jm=Oe("mn_MN",Am),Xm=Oe("ar_EG",xm),Mr=Oe("zh_CN",qm),Qm=Oe("en_US",jm),eg=Oe("en_GB",wm),tg=Oe("vi_VN",Wm),ng=Oe("it_IT",Im),rg=Oe("ja_JP",Mm),sg=Oe("es_ES",vm),ag=Oe("ca_ES",bm),ig=Oe("ru_RU",_m),og=Oe("sr_RS",Bm),lg=Oe("ms_MY",km),cg=Oe("zh_TW",Zm),ug=Oe("zh_HK",Gm),dg=Oe("fr_FR",Fm),fg=Oe("pt_BR",Nm),hg=Oe("ko_KR",Om),mg=Oe("id_ID",Em),gg=Oe("de_DE",Cm),pg=Oe("fa_IR",Tm),yg=Oe("tr_TR",Ym),xg=Oe("pl_PL",Pm),bg=Oe("hr_",$m),Sg=Oe("th_TH",Hm),Cg=Oe("cs_cz",Sm),wg=Oe("sk_SK",zm),jg=Oe("he_IL",Rm),vg=Oe("uk_UA",Um),Tg=Oe("uz_UZ",Km),Fg=Oe("nl_NL",Dm),Rg=Oe("ro_RO",Lm),$g=Oe("sv_SE",Vm),En={"mn-MN":Jm,"ar-EG":Xm,"zh-CN":Mr,"en-US":Qm,"en-GB":eg,"vi-VN":tg,"it-IT":ng,"ja-JP":rg,"es-ES":sg,"ca-ES":ag,"ru-RU":ig,"sr-RS":og,"ms-MY":lg,"zh-TW":cg,"zh-HK":ug,"fr-FR":dg,"pt-BR":fg,"ko-KR":hg,"id-ID":mg,"de-DE":gg,"fa-IR":pg,"tr-TR":yg,"pl-PL":xg,"hr-HR":bg,"th-TH":Sg,"cs-CZ":Cg,"sk-SK":wg,"he-IL":jg,"uk-UA":vg,"uz-UZ":Tg,"nl-NL":Fg,"ro-RO":Rg,"sv-SE":$g},Eg=Object.keys(En),Iu=e=>{const t=(e||"zh-CN").toLocaleLowerCase();return Eg.find(n=>n.toLocaleLowerCase().includes(t))};function ot(e,t){Ig(e)&&(e="100%");const n=Mg(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 Qr(e){return Math.min(1,Math.max(0,e))}function Ig(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Mg(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Mu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function es(e){return Number(e)<=1?`${Number(e)*100}%`:e}function vn(e){return e.length===1?"0"+e:String(e)}function Og(e,t,n){return{r:ot(e,255)*255,g:ot(t,255)*255,b:ot(n,255)*255}}function Xo(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(n,255);const r=Math.max(e,t,n),s=Math.min(e,t,n);let i=0,o=0;const l=(r+s)/2;if(r===s)o=0,i=0;else{const c=r-s;switch(o=l>.5?c/(2-r-s):c/(r+s),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 Ta(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 Ag(e,t,n){let r,s,i;if(e=ot(e,360),t=ot(t,100),n=ot(n,100),t===0)s=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=Ta(l,o,e+1/3),s=Ta(l,o,e),i=Ta(l,o,e-1/3)}return{r:r*255,g:s*255,b:i*255}}function Qo(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(n,255);const r=Math.max(e,t,n),s=Math.min(e,t,n);let i=0;const o=r,l=r-s,c=r===0?0:l/r;if(r===s)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 kg(e,t,n){e=ot(e,360)*6,t=ot(t,100),n=ot(n,100);const r=Math.floor(e),s=e-r,i=n*(1-t),o=n*(1-s*t),l=n*(1-(1-s)*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 el(e,t,n,r){const s=vn(Math.round(e).toString(16)),i=vn(Math.round(t).toString(16)),o=vn(Math.round(n).toString(16));return r&&s.startsWith(s.charAt(1))&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))?s.charAt(0)+i.charAt(0)+o.charAt(0):s+i+o}function Dg(e,t,n,r,s){const i=vn(Math.round(e).toString(16)),o=vn(Math.round(t).toString(16)),l=vn(Math.round(n).toString(16)),c=vn(Ng(r));return s&&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 Pg(e,t,n,r){const s=e/100,i=t/100,o=n/100,l=r/100,c=255*(1-s)*(1-l),h=255*(1-i)*(1-l),g=255*(1-o)*(1-l);return{r:c,g:h,b:g}}function tl(e,t,n){let r=1-e/255,s=1-t/255,i=1-n/255,o=Math.min(r,s,i);return o===1?(r=0,s=0,i=0):(r=(r-o)/(1-o)*100,s=(s-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(s),y:Math.round(i),k:Math.round(o)}}function Ng(e){return Math.round(parseFloat(e)*255).toString(16)}function nl(e){return bt(e)/255}function bt(e){return parseInt(e,16)}function Lg(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const oi={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 _g(e){let t={r:0,g:0,b:0},n=1,r=null,s=null,i=null,o=!1,l=!1;return typeof e=="string"&&(e=Vg(e)),typeof e=="object"&&(xt(e.r)&&xt(e.g)&&xt(e.b)?(t=Og(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=es(e.s),s=es(e.v),t=kg(e.h,r,s),o=!0,l="hsv"):xt(e.h)&&xt(e.s)&&xt(e.l)?(r=es(e.s),i=es(e.l),t=Ag(e.h,r,i),o=!0,l="hsl"):xt(e.c)&&xt(e.m)&&xt(e.y)&&xt(e.k)&&(t=Pg(e.c,e.m,e.y,e.k),o=!0,l="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Mu(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 zg="[-\\+]?\\d+%?",Bg="[-\\+]?\\d*\\.\\d+%?",un="(?:"+Bg+")|(?:"+zg+")",Fa="[\\s|\\(]+("+un+")[,|\\s]+("+un+")[,|\\s]+("+un+")\\s*\\)?",ts="[\\s|\\(]+("+un+")[,|\\s]+("+un+")[,|\\s]+("+un+")[,|\\s]+("+un+")\\s*\\)?",St={hex:/^[0-9a-fA-F]+$/,CSS_UNIT:new RegExp(un),rgb:new RegExp("rgb"+Fa),rgba:new RegExp("rgba"+ts),hsl:new RegExp("hsl"+Fa),hsla:new RegExp("hsla"+ts),hsv:new RegExp("hsv"+Fa),hsva:new RegExp("hsva"+ts),cmyk:new RegExp("cmyk"+ts),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 Vg(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(oi[e])e=oi[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:nl(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:nl(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 Xe{constructor(t="",n={}){if(t instanceof Xe)return t;typeof t=="number"&&(t=Lg(t)),this.originalInput=t;const r=_g(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,s;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?s=l/12.92:s=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*s}getAlpha(){return this.a}setAlpha(t){return this.a=Mu(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=Qo(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=Qo(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${s}%)`:`hsva(${n}, ${r}%, ${s}%, ${this.roundA})`}toHsl(){const t=Xo(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=Xo(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),s=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${s}%)`:`hsla(${n}, ${r}%, ${s}%, ${this.roundA})`}toHex(t=!1){return el(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return Dg(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(ot(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(ot(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{...tl(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:s}=tl(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${s})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+el(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(oi))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const s=this.a<1&&this.a>=0;return!n&&s&&(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 Xe(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Qr(n.l),new Xe(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 Xe(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Qr(n.l),new Xe(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=Qr(n.s),new Xe(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Qr(n.s),new Xe(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 Xe(n)}mix(t,n=50){const r=this.toRgb(),s=new Xe(t).toRgb(),i=n/100,o={r:(s.r-r.r)*i+r.r,g:(s.g-r.g)*i+r.g,b:(s.b-r.b)*i+r.b,a:(s.a-r.a)*i+r.a};return new Xe(o)}analogous(t=6,n=30){const r=this.toHsl(),s=360/n,i=[this];for(r.h=(r.h-(s*t>>1)+720)%360;--t;)r.h=(r.h+s)%360,i.push(new Xe(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Xe(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s}=n;let{v:i}=n;const o=[],l=1/t;for(;t--;)o.push(new Xe({h:r,s,v:i})),i=(i+l)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Xe({h:(n+72)%360,s:t.s,l:t.l}),new Xe({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new Xe(t).toRgb(),s=n.a+r.a*(1-n.a);return new Xe({r:(n.r*n.a+r.r*r.a*(1-n.a))/s,g:(n.g*n.a+r.g*r.a*(1-n.a))/s,b:(n.b*n.a+r.b*r.a*(1-n.a))/s,a:s})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,s=[this],i=360/t;for(let o=1;o<t;o++)s.push(new Xe({h:(r+o*i)%360,s:n.s,l:n.l}));return s}equals(t){const n=new Xe(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}const Ct=(e,t)=>new Xe(e).setAlpha(t).toRgbString(),fn=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"}}),Hg=e=>{let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},Yg=e=>{try{return Hg(JSON.stringify(e))}catch{return""}};function Be(e,t){let{token:n={},hashed:r}=d.useContext(Vt);const{token:s,hashId:i,theme:o}=u.theme.useToken(),{getPrefixCls:l,csp:c}=d.useContext(u.ConfigProvider.ConfigContext);n.layout||(n={...s}),n.proComponentsCls=n.proComponentsCls??`.${l("pro")}`,n.antCls=`.${l()}`;const h=d.useMemo(()=>Yg(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 Ah({path:p,nonce:c==null?void 0:c.nonce,layer:{name:"antd-pro"}},()=>t(n)),{wrapSSR:S=>S,hashId:r?i:""}}const Ug=(e,t)=>{var s,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:(s=n==null?void 0:n.sider)==null?void 0:s.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}}},Kg=(...e)=>{const t={},n=e.length;let r,s=0;for(;s<n;s+=1)for(r in e[s])e[s].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[s][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[s][r])?t[r]={...t[r],...e[s][r]}:t[r]=e[s][r]);return t},Wg=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},$a=()=>{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"))},zt=d.createContext({intl:{...Mr,locale:"default"},valueTypeMap:{},hashed:!0,dark:!1,token:{...u.theme.getDesignToken(),proComponentsCls:".ant-pro",antCls:".ant",themeId:0},prefixCls:".ant-pro"}),{Consumer:mF}=zt,qg=()=>{const{cache:e}=$u();return d.useEffect(()=>()=>{e.clear()},[]),null},Gg=e=>{var I,A;const{children:t,dark:n,valueTypeMap:r,autoClearCache:s=!1,token:i,prefixCls:o,intl:l}=e,{locale:c,getPrefixCls:h,...g}=d.useContext(u.ConfigProvider.ConfigContext),f=(A=(I=u.theme).useToken)==null?void 0:A.call(I),m=d.useContext(zt),p=o?`.${o}`:`.${h()}-pro`,S="."+h(),y=`${p}`,j=d.useMemo(()=>Ug(i||{},f.token),[i,f.token]),v=d.useMemo(()=>{var E;const Y=c==null?void 0:c.locale,H=Iu(Y),k=l??(Y&&((E=m.intl)==null?void 0:E.locale)==="default"?En[H]:m.intl||En[H]);return{...m,dark:n??m.dark,token:Kg(m.token,f.token,{proComponentsCls:p,antCls:S,themeId:f.theme.id,layout:j}),intl:k||Mr}},[c==null?void 0:c.locale,m,n,f.token,f.theme.id,p,S,j,l]),x={...v.token||{},proComponentsCls:p},[w,C]=ih(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||$a()===!1?"":f.hashId?f.hashId:C,[C,m.hashed,e.hashed]);d.useEffect(()=>{Se.locale((c==null?void 0:c.locale)||"zh-cn")},[c==null?void 0:c.locale]);const F=d.useMemo(()=>({...g.theme,hashId:T,hashed:b&&$a()}),[g.theme,T,b,$a()]),$=d.useMemo(()=>({...v,valueTypeMap:r||(v==null?void 0:v.valueTypeMap),token:x,theme:f.theme,hashed:b,hashId:T,prefixCls:o}),[v,r,w,f.theme,b,T,o]),M=d.useMemo(()=>a.jsx(u.ConfigProvider,{...g,theme:F,children:a.jsx(zt.Provider,{value:$,children:a.jsxs(a.Fragment,{children:[s&&a.jsx(qg,{}),t]})})}),[g,F,$,s,t]);return s?a.jsx(ym,{value:{provider:()=>new Map},children:M}):M},In=e=>{const{needDeps:t,dark:n,token:r}=e,s=d.useContext(zt),{locale:i,theme:o,...l}=d.useContext(u.ConfigProvider.ConfigContext);if(t&&s.hashId!==void 0&&Object.keys(e).sort().join("-")==="children-needDeps")return a.jsx(a.Fragment,{children:e.children});const g={...l,locale:i||Nh,theme:Wg({...o,algorithm:n??s.dark?[o==null?void 0:o.algorithm,u.theme.darkAlgorithm].flat(1).filter(Boolean):o==null?void 0:o.algorithm})};return a.jsx(u.ConfigProvider,{...g,children:a.jsx(Gg,{...e,token:r})})};function Fe(){const{locale:e}=d.useContext(u.ConfigProvider.ConfigContext),{intl:t}=d.useContext(zt);return t&&t.locale!=="default"?t:e!=null&&e.locale&&En[Iu(e.locale)]||Mr}zt.displayName="ProProvider";const Vt=zt,Zg=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 Jg(e){return Be("ProCardActions",t=>{const n={...t,componentCls:`.${e}`,cardActionIconSize:16};return[Zg(n)]})}const Xg=e=>{const{actions:t,prefixCls:n}=e,{wrapSSR:r,hashId:s}=Jg(n);return Array.isArray(t)&&(t!=null&&t.length)?r(a.jsx("ul",{className:ie(`${n}-actions`,s),children:t.map((i,o)=>a.jsx("li",{style:{width:`${100/t.length}%`,padding:0,margin:0},className:ie(`${n}-actions-item`,s),children:i},`action-${o}`))})):r(a.jsx("ul",{className:ie(`${n}-actions`,s),children:t}))};function Vi(e,t){if(!t||!d.isValidElement(e))return e;if(e.type===d.Fragment){const r=d.Children.toArray(e.props.children).map((s,i)=>i===0?Vi(s,t):s);return d.cloneElement(e,{},...r)}return d.cloneElement(e,{...e.props,autoFocus:t})}const Qg=e=>({[e.componentCls]:{boxSizing:"border-box",display:"flex",justifyContent:"space-between",paddingBlock:8,paddingInlineStart:8,paddingInlineEnd:8,borderBlockStart:`1px solid ${e.colorSplit}`}});function ep(e){return Be("DropdownFooter",t=>{const n={...t,componentCls:`.${e}`};return[Qg(n)]})}const tp=e=>{const t=Fe(),{onClear:n,onConfirm:r,disabled:s,footerRender:i}=e,{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-core-dropdown-footer"),{wrapSSR:c,hashId:h}=ep(l),g=[a.jsx(u.Button,{style:{visibility:n?"visible":"hidden"},type:"link",size:"small",disabled:s,onClick:m=>{n&&n(m),m.stopPropagation()},children:t.getMessage("form.lightFilter.clear","清除")},"clear"),a.jsx(u.Button,{"data-type":"confirm",type:"primary",size:"small",onClick:r,disabled:s,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(a.jsx("div",{className:ie(l,h),onClick:m=>m.target.getAttribute("data-type")!=="confirm"&&m.stopPropagation(),children:f}))};class np extends d.Component{constructor(){super(...arguments);oe(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?a.jsx(u.Result,{status:"error",title:"Something went wrong.",extra:this.state.errorInfo}):this.props.children}}const rp=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 sp(e){return Be("FieldLabel",t=>{const n={...t,componentCls:`.${e}`};return[rp(n)]})}const ap=(e,t)=>{var A,Y;const{label:n,onClear:r,value:s,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:j}=((Y=(A=u.ConfigProvider)==null?void 0:A.useConfig)==null?void 0:Y.call(A))||{componentSize:"middle"},{getPrefixCls:v}=d.useContext(u.ConfigProvider.ConfigContext),x=v("pro-core-field-label"),{wrapSSR:w,hashId:C}=sp(x),b=Fe(),T=d.useRef(null),F=d.useRef(null);d.useImperativeHandle(t,()=>({labelRef:F,clearRef:T}));const $=H=>H.every(k=>typeof k=="string")?H.join(","):H.map((k,E)=>{const R=E===H.length-1?"":",";return typeof k=="string"?a.jsxs("span",{children:[k,R]},E):a.jsxs("span",{style:{display:"flex"},children:[k,R]},E)}),M=H=>g?g(H):Array.isArray(H)?$(H):H,I=(H,k)=>{var E,R;if(k!=null&&k!==""&&(!Array.isArray(k)||k.length)){const z=H?a.jsxs("span",{onClick:()=>{o==null||o()},className:ie(`${x}-text`,C),children:[H,": "]}):"",_=M(k);if(!l)return a.jsxs("span",{style:{display:"inline-flex",alignItems:"center"},children:[z,M(k)]});const Z=(()=>{const B=Array.isArray(k)&&k.length>1,U=b.getMessage("form.lightFilter.itemUnit","项");return typeof _=="string"&&_.length>y&&B?`...${k.length}${U}`:""})();return a.jsxs("span",{title:typeof _=="string"?_:void 0,style:{display:"inline-flex",alignItems:"center"},children:[z,a.jsx("span",{style:{paddingInlineStart:4,display:"flex"},children:typeof _=="string"?(R=(E=_==null?void 0:_.toString())==null?void 0:E.slice)==null?void 0:R.call(E,0,y):_}),Z]})}return H||c};return w(a.jsxs("span",{className:ie(x,C,`${x}-${e.size??j??"middle"}`,{[`${x}-${f||"borderless"}-active`]:(Array.isArray(s)?s.length>0:!!s)||s===0,[`${x}-active`]:(Array.isArray(s)?s.length>0:!!s)||s===0,[`${x}-disabled`]:i,[`${x}-${f}`]:f,[`${x}-allow-clear`]:S},h),style:m,ref:F,onClick:()=>{var H;(H=e==null?void 0:e.onClick)==null||H.call(e)},children:[I(n,s),(s||s===0)&&S&&a.jsx(se.CloseCircleFilled,{role:"button",title:b.getMessage("form.lightFilter.clear","清除"),className:ie(`${x}-icon`,C,`${x}-close`),onClick:H=>{i||r==null||r(),H.stopPropagation()},ref:T}),p!==!1?p??a.jsx(se.DownOutlined,{className:ie(`${x}-icon`,C,`${x}-arrow`)}):null]}))},Ht=d.forwardRef(ap),ip=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 op(e){return Be("FilterDropdown",t=>{const n={...t,componentCls:`.${e}`};return[ip(n)]})}const Ou=e=>{const{children:t,label:n,footer:r,open:s,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}=op(f),S=d.useRef(null),y=d.useMemo(()=>{var j;return{container:{padding:0,...((j=h==null?void 0:h.styles)==null?void 0:j.container)||{}},...(h==null?void 0:h.styles)||{}}},[h==null?void 0:h.styles]);return m(a.jsx(u.Popover,{...h,placement:c,trigger:["click"],open:s||!1,onOpenChange:i,styles:y,content:a.jsxs("div",{ref:S,className:ie(`${f}-overlay`,{[`${f}-overlay-${c}`]:c,hashId:p}),children:[a.jsx(u.ConfigProvider,{getPopupContainer:()=>S.current||document.body,children:a.jsx("div",{className:ie(`${f}-content`,p),children:t})}),r&&a.jsx(tp,{disabled:o,footerRender:l,...r})]}),children:a.jsx("span",{className:ie(`${f}-label`,p),children:n})}))},lp=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 cp(e){return Be("InlineErrorFormItem",t=>{const n={...t,componentCls:`.${e}`};return[lp(n)]})}const Au={marginBlockStart:-5,marginBlockEnd:-5,marginInlineStart:0,marginInlineEnd:0},up=({inputProps:e,input:t,extra:n,errorList:r,popoverProps:s})=>{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}=cp(`${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,j=()=>{var w,C;return a.jsxs(a.Fragment,{children:[(w=l.errors)==null?void 0:w.map((b,T)=>a.jsx("div",{className:ie(`${g}-form-item-explain-error`,p),children:b},`error-${T}`)),(C=l.warnings)==null?void 0:C.map((b,T)=>a.jsx("div",{className:ie(`${g}-form-item-explain-warning`,p),children:b},`warning-${T}`))]})};return a.jsx(u.Popover,{open:y?i:!1,onOpenChange:w=>{w!==i&&o(w)},trigger:(s==null?void 0:s.trigger)||["click"],placement:(s==null?void 0:s.placement)||"topLeft",getPopupContainer:s==null?void 0:s.getPopupContainer,getTooltipContainer:s==null?void 0:s.getTooltipContainer,content:m(a.jsx("div",{className:ie(`${g}-form-item`,p,f.hashId),style:{margin:0,padding:0},children:a.jsxs("div",{className:ie(`${g}-form-item-with-help`,p,f.hashId),children:[S?a.jsx(se.LoadingOutlined,{}):null,y?j():r]})})),...s,children:a.jsxs(a.Fragment,{children:[t,n]})},"popover")},dp=({rules:e,name:t,children:n,popoverProps:r,...s})=>a.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(Me(i,l))!==JSON.stringify(Me(o,l))}catch{return!0}},_internalItemRender:{mark:"pro_table_render",render:(i,o)=>a.jsx(up,{inputProps:i,popoverProps:r,...o})},...s,style:{...Au,...s==null?void 0:s.style},children:n}),fp=e=>{const{errorType:t,rules:n,name:r,popoverProps:s,children:i,...o}=e;return r&&(n!=null&&n.length)&&t==="popover"?a.jsx(dp,{name:r,rules:n,popoverProps:s,...o,children:i}):a.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(Me(l,h))!==JSON.stringify(Me(c,h))}catch{return!0}}:void 0,...o,style:{...Au,...o.style},name:r,children:i})},hp=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 mp(e){return Be("LabelIconTip",t=>{const n={...t,componentCls:`.${e}`};return[hp(n)]})}const Jn=d.memo(e=>{const{label:t,tooltip:n,ellipsis:r,subTitle:s}=e,{getPrefixCls:i}=d.useContext(u.ConfigProvider.ConfigContext),o=i("pro-core-label-tip"),{wrapSSR:l,hashId:c}=mp(o);if(!n&&!s)return a.jsx(a.Fragment,{children:t});const h=typeof n=="string"||d.isValidElement(n)?{title:n}:n,g=(h==null?void 0:h.icon)||a.jsx(se.InfoCircleOutlined,{});return l(a.jsxs("div",{className:ie(o,c),onMouseDown:f=>f.stopPropagation(),onMouseLeave:f=>f.stopPropagation(),onMouseMove:f=>f.stopPropagation(),children:[a.jsx("div",{className:ie(`${o}-title`,c,{[`${o}-title-ellipsis`]:r}),children:t}),s&&a.jsx("div",{className:ie(`${o}-subtitle`,c),children:s}),n&&a.jsx(u.Tooltip,{...h,children:a.jsx("span",{className:ie(`${o}-icon`,c),children:g})})]}))}),Nr=d.createContext({});var Cs={exports:{}},gp=Cs.exports,rl;function pp(){return rl||(rl=1,(function(e,t){(function(n,r){e.exports=r()})(gp,(function(){var n="month",r="quarter";return function(s,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 yp=pp();const xp=Bt(yp),$t=e=>e==null;Se.extend(xp);const Hi={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 sl(e){return Object.prototype.toString.call(e)==="[object Object]"}function bp(e){if(sl(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(sl(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}const li=e=>!!(e!=null&&e._isAMomentObject),al=(e,t,n)=>{if(!t)return e;if(Se.isDayjs(e)||li(e)){if(t==="number")return e.valueOf();if(t==="string")return e.format(Hi[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},ci=(e,t,n,r,s)=>{const i={};return typeof window>"u"||typeof e!="object"||$t(e)||e instanceof Blob||Array.isArray(e)?e:(Object.keys(e).forEach(o=>{const l=s?[s,o].flat(1):[o],c=Me(n,l)||"text";let h="text",g;typeof c=="string"?h=c:(h=c.valueType,g=c.dateFormat);const f=e[o];if($t(f)&&r||r&&f==="")return;if(bp(f)&&!Array.isArray(f)&&!Se.isDayjs(f)&&!li(f)){i[o]=ci(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||Hi[h]:p=m,Array.isArray(f)){i[o]=f.map((S,y)=>Se.isDayjs(S)||li(S)?al(S,p===void 0&&m==="string"?"string":p,h):ci(S,t,n,r,[o,`${y}`].flat(1)));return}i[o]=al(f,p,h)}),i)},il=(e,t)=>typeof t=="function"?t(Se(e)):Se(e).format(t),Sp=(e,t)=>{const[n,r]=Array.isArray(e)?e:[];let s,i;Array.isArray(t)?(s=t[0],i=t[1]):typeof t=="object"&&t.type==="mask"?(s=t.format,i=t.format):(s=t,i=t);const o=n?il(n,s):"",l=r?il(r,i):"";return o&&l?`${o} ~ ${l}`:""};function Ft(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}const Cp=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)},wp=e=>{var t;return((t=e.ellipsis)==null?void 0:t.showTitle)===!1?!1:e.ellipsis},ol=e=>e==null?"":String(e).trimEnd(),jp=e=>d.isValidElement(e),vp=(e,t,n,r)=>{const s=wp(t);if(!s)return!1;const i=Cp(t),o=jp(r);if((i||o)&&(t==null?void 0:t.tooltip)!==!1){const l=a.jsx("div",{className:"pro-table-tooltip-text",children:e});return Ft(s)&&Ft(s.tooltip)?{tooltip:{title:l,...s.tooltip}}:{tooltip:l}}return n?Ft(s)&&Ft(s.tooltip)?{tooltip:{title:n,...s.tooltip}}:{tooltip:n}:!1},Tp=(e,t,n,r)=>{if(!t.copyable&&!t.ellipsis)return e;const s=ol(n),i=r!==void 0?ol(r):s,o=vp(e,t,s,n);return t.copyable?a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"},children:[a.jsx(u.Typography.Text,{style:{flex:1,minWidth:0,margin:0,padding:0},title:"",ellipsis:o,children:e}),i?a.jsx("span",{style:{flex:"none",userSelect:"none"},children:a.jsx(u.Typography.Text,{style:{margin:0,padding:0},copyable:{text:i,tooltips:["",""]}})}):null]}):a.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 ui=(e,t,n)=>t===void 0?e:ht(e,t,n),xe=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 Yi(e,t){const n=xe(e),r=d.useRef(),s=d.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i=d.useCallback(async(...o)=>t===0||t===void 0?n(...o):(s(),new Promise(l=>{r.current=setTimeout(async()=>{l(await n(...o))},t)})),[n,s,t]);return d.useEffect(()=>s,[s]),{run:i,cancel:s}}const Ui=e=>{const t=d.useRef(e);return t.current=e,t};function Fp(e,t=100,n){const[r,s]=d.useState(e),i=Ui(e);return d.useEffect(()=>{const o=setTimeout(()=>{s(i.current)},t);return()=>clearTimeout(o)},n?[t,...n]:void 0),r}function hn(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,s,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!hn(e[s],t[s],n))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s of e.entries())if(!t.has(s[0]))return!1;for(s of e.entries())if(!hn(s[1],t.get(s[0]),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(e[s]!==t[s])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(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=r;s--!==0;){const o=i[s];if(!(n!=null&&n.includes(o))&&!(o==="_owner"&&e.$$typeof)&&!hn(e[o],t[o],n))return!1}return!0}return e!==e&&t!==t}const Rp=(e,t,n)=>hn(e,t,n);function Ki(e,t){const n=d.useRef();return Rp(e,n.current,t)||(n.current=e),n.current}function Kn(e,t,n){d.useEffect(e,Ki(t||[],n))}function ku(e,t,n,r){const s=Yi(async()=>{e()},r||16);d.useEffect(()=>{s.run()},Ki(t||[],n))}function ct(e,t){return d.useMemo(e,Ki(t))}const $p=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Wi=()=>typeof process<"u"&&process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!$p;let ll=0;function Ep(e){const t=d.useRef(null),[n]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():(ll+=1,ll.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:s,isValidating:i}=Eu(e.request?[n,e.params]:null,r,{revalidateOnFocus:!1,shouldRetryOnError:!1,onError:()=>{}});return e.request?[s,i]:[void 0,!1]}const Tr=e=>{const t=d.useRef();return d.useEffect(()=>{t.current=e}),t.current};function Ip(){const[,e]=d.useState(!0);return d.useCallback(()=>e(n=>!n),[])}function Mp(e,t){const n=d.useMemo(()=>{const r={current:t};return new Proxy(r,{set(s,i,o){return Object.is(s[i],o)||(s[i]=o,e(n)),!0}})},[]);return n}function Op(e){const t=Ip();return Mp(t,e)}const Ap=e=>{let t=!1;return(typeof e=="string"&&e.startsWith("date")&&!e.endsWith("Range")||e==="select"||e==="time")&&(t=!0),t},Du=(...e)=>{const t={},n=e.length;let r,s=0;for(;s<n;s+=1)for(r in e[s])e[s].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[s][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[s][r])?t[r]={...t[r],...e[s][r]}:t[r]=e[s][r]);return t};let cl=0,kp=(e=21)=>{if(typeof window>"u"||!window.crypto)return(cl+=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():kp()},Pu=e=>{if(e&&e!==!0)return e},it=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Dp=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:{}},Pp=ws.exports,ul;function Np(){return ul||(ul=1,(function(e,t){(function(n,r){e.exports=r()})(Pp,(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,s=/\d/,i=/\d\d/,o=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,c={},h=function(j){return(j=+j)+(j>68?1900:2e3)},g=function(j){return function(v){this[j]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(j){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),w=60*x[1]+(+x[2]||0);return w===0?0:x[0]==="+"?-w:w})(j)}],m=function(j){var v=c[j];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(j,v){var x,w=c.meridiem;if(w){for(var C=1;C<=24;C+=1)if(j.indexOf(w(C,0,v))>-1){x=C>12;break}}else x=j===(v?"pm":"PM");return x},S={A:[l,function(j){this.afternoon=p(j,!1)}],a:[l,function(j){this.afternoon=p(j,!0)}],Q:[s,function(j){this.month=3*(j-1)+1}],S:[s,function(j){this.milliseconds=100*+j}],SS:[i,function(j){this.milliseconds=10*+j}],SSS:[/\d{3}/,function(j){this.milliseconds=+j}],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(j){var v=c.ordinal,x=j.match(/\d+/);if(this.day=x[0],v)for(var w=1;w<=31;w+=1)v(w).replace(/\[|\]/g,"")===j&&(this.day=w)}],w:[o,g("week")],ww:[i,g("week")],M:[o,g("month")],MM:[i,g("month")],MMM:[l,function(j){var v=m("months"),x=(m("monthsShort")||v.map((function(w){return w.slice(0,3)}))).indexOf(j)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[l,function(j){var v=m("months").indexOf(j)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,g("year")],YY:[i,function(j){this.year=h(j)}],YYYY:[/\d{4}/,g("year")],Z:f,ZZ:f};function y(j){var v,x;v=j,x=c&&c.formats;for(var w=(j=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(I,A,Y){var H=Y&&Y.toUpperCase();return A||x[Y]||n[Y]||x[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(k,E,R){return E||R.slice(1)}))}))).match(r),C=w.length,b=0;b<C;b+=1){var T=w[b],F=S[T],$=F&&F[0],M=F&&F[1];w[b]=M?{regex:$,parser:M}:T.replace(/^\[|\]$/g,"")}return function(I){for(var A={},Y=0,H=0;Y<C;Y+=1){var k=w[Y];if(typeof k=="string")H+=k.length;else{var E=k.regex,R=k.parser,z=I.slice(H),_=E.exec(z)[0];R.call(A,_),I=I.replace(_,"")}}return(function(V){var Z=V.afternoon;if(Z!==void 0){var B=V.hours;Z?B<12&&(V.hours+=12):B===12&&(V.hours=0),delete V.afternoon}})(A),A}}return function(j,v,x){x.p.customParseFormat=!0,j&&j.parseTwoDigitYear&&(h=j.parseTwoDigitYear);var w=v.prototype,C=w.parse;w.parse=function(b){var T=b.date,F=b.utc,$=b.args;this.$u=F;var M=$[1];if(typeof M=="string"){var I=$[2]===!0,A=$[3]===!0,Y=I||A,H=$[2];A&&(H=$[2]),c=this.$locale(),!I&&H&&(c=x.Ls[H]),this.$d=(function(z,_,V,Z){try{if(["x","X"].indexOf(_)>-1)return new Date((_==="X"?1e3:1)*z);var B=y(_)(z),U=B.year,J=B.month,G=B.day,K=B.hours,O=B.minutes,P=B.seconds,N=B.milliseconds,D=B.zone,L=B.week,W=new Date,q=G||(U||J?1:W.getDate()),X=U||W.getFullYear(),ee=0;U&&!J||(ee=J>0?J-1:W.getMonth());var re,le=K||0,ce=O||0,de=P||0,te=N||0;return D?new Date(Date.UTC(X,ee,q,le,ce,de,te+60*D.offset*1e3)):V?new Date(Date.UTC(X,ee,q,le,ce,de,te)):(re=new Date(X,ee,q,le,ce,de,te),L&&(re=Z(re).week(L).toDate()),re)}catch{return new Date("")}})(T,M,F,x),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),Y&&T!=this.format(M)&&(this.$d=new Date("")),c={}}else if(M instanceof Array)for(var k=M.length,E=1;E<=k;E+=1){$[1]=M[E-1];var R=x.apply(this,$);if(R.isValid()){this.$d=R.$d,this.$L=R.$L,this.init();break}E===k&&(this.$d=new Date(""))}else C.call(this,b)}}}))})(ws)),ws.exports}var Lp=Np();const _p=Bt(Lp);Se.extend(_p);const dl=e=>!!(e!=null&&e._isAMomentObject),rr=(e,t)=>$t(e)||Se.isDayjs(e)||dl(e)?dl(e)?Se(e):e:Array.isArray(e)?e.map(n=>rr(n,t)):typeof e=="number"?Se(e):Se(e,t),zp=["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 Bp(e){const t={};return zp.forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t}const Vp="valueType request formItemRender render text formItemProps valueEnum",Hp="fieldProps isDefaultDom groupProps contentRender submitterProps submitter";function It(e,t=!1){const n=`${Vp} ${Hp}`.split(/[\s\n]+/),r={};return Object.keys(e||{}).forEach(s=>{n.includes(s)&&!t||(r[s]=e[s])}),r}function Yp(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 Up=({color:e,children:t})=>a.jsx(u.Badge,{color:e,text:t}),Jt=e=>Yp(e)==="map"?e:new Map(Object.entries(e||{})),Kp={Success:({children:e})=>a.jsx(u.Badge,{status:"success",text:e}),Error:({children:e})=>a.jsx(u.Badge,{status:"error",text:e}),Default:({children:e})=>a.jsx(u.Badge,{status:"default",text:e}),Processing:({children:e})=>a.jsx(u.Badge,{status:"processing",text:e}),Warning:({children:e})=>a.jsx(u.Badge,{status:"warning",text:e}),success:({children:e})=>a.jsx(u.Badge,{status:"success",text:e}),error:({children:e})=>a.jsx(u.Badge,{status:"error",text:e}),default:({children:e})=>a.jsx(u.Badge,{status:"default",text:e}),processing:({children:e})=>a.jsx(u.Badge,{status:"processing",text:e}),warning:({children:e})=>a.jsx(u.Badge,{status:"warning",text:e})},An=(e,t,n)=>{if(Array.isArray(e))return a.jsx(u.Space,{separator:",",size:2,wrap:!0,children:e.map((c,h)=>An(c,t,h))},n);const r=Jt(t);if(!r.has(e)&&!r.has(`${e}`))return(e==null?void 0:e.label)||e;const s=r.get(e)||r.get(`${e}`);if(!s)return a.jsx(d.Fragment,{children:(e==null?void 0:e.label)||e},n);const{status:i,color:o}=s,l=Kp[i||"Init"];return l?a.jsx(l,{children:s.text},n):o?a.jsx(Up,{color:o,children:s.text},n):a.jsx(d.Fragment,{children:s.text||s},n)};var ns={exports:{}},fl;function Wp(){return fl||(fl=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 s=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function i(x){return x.length<5e3&&!s.test(x)?`"${x}"`:JSON.stringify(x)}function o(x,w){if(x.length>200||w)return x.sort(w);for(let C=1;C<x.length;C++){const b=x[C];let T=C;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,w,C){x.length<C&&(C=x.length);const b=w===","?"":" ";let T=`"0":${b}${x[0]}`;for(let F=1;F<C;F++)T+=`${w}"${F}":${b}${x[F]}`;return T}function g(x){if(n.call(x,"circularValue")){const w=x.circularValue;if(typeof w=="string")return`"${w}"`;if(w==null)return w;if(w===Error||w===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 w;if(n.call(x,"deterministic")&&(w=x.deterministic,typeof w!="boolean"&&typeof w!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return w===void 0?!0:w}function m(x,w){let C;if(n.call(x,w)&&(C=x[w],typeof C!="boolean"))throw new TypeError(`The "${w}" argument must be of type boolean`);return C===void 0?!0:C}function p(x,w){let C;if(n.call(x,w)){if(C=x[w],typeof C!="number")throw new TypeError(`The "${w}" argument must be of type number`);if(!Number.isInteger(C))throw new TypeError(`The "${w}" argument must be an integer`);if(C<1)throw new RangeError(`The "${w}" argument must be >= 1`)}return C===void 0?1/0:C}function S(x){return x===1?"1 item":`${x} items`}function y(x){const w=new Set;for(const C of x)(typeof C=="string"||typeof C=="number")&&w.add(String(C));return w}function j(x){if(n.call(x,"strict")){const w=x.strict;if(typeof w!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(w)return C=>{let b=`Object can not safely be stringified. Received type ${typeof C}`;throw typeof C!="function"&&(b+=` (${C.toString()})`),new Error(b)}}}function v(x){x={...x};const w=j(x);w&&(x.bigint===void 0&&(x.bigint=!1),"circularValue"in x||(x.circularValue=Error));const C=g(x),b=m(x,"bigint"),T=f(x),F=typeof T=="function"?T:void 0,$=p(x,"maximumDepth"),M=p(x,"maximumBreadth");function I(E,R,z,_,V,Z){let B=R[E];switch(typeof B=="object"&&B!==null&&typeof B.toJSON=="function"&&(B=B.toJSON(E)),B=_.call(R,E,B),typeof B){case"string":return i(B);case"object":{if(B===null)return"null";if(z.indexOf(B)!==-1)return C;let U="",J=",";const G=Z;if(Array.isArray(B)){if(B.length===0)return"[]";if($<z.length+1)return'"[Array]"';z.push(B),V!==""&&(Z+=V,U+=`
|
|
35
|
+
*/var Ko;function Ym(){return Ko||(Ko=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 j=S();i(y,j)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}j=o({inst:{value:y,getSnapshot:S}});var v=j[0].inst,x=j[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]),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,u=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 Wo;function Um(){return Wo||(Wo=1,process.env.NODE_ENV==="production"?Gr.exports=Hm():Gr.exports=Ym()),Gr.exports}var qo=Um(),Go=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(Go.call(e,n)&&++r&&!Go.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,Zo=3,ju=4,Lt=new WeakMap,qt=()=>{},ze=qt(),Os=Object,we=e=>e===ze,kt=e=>typeof e=="function",_t=(e,t)=>({...e,...t}),ni=e=>kt(e.then),Ca={},Zr={},Vi="undefined",Pr=typeof window!=Vi,ri=typeof document!=Vi,Km=Pr&&"Deno"in window,Wm=()=>Pr&&typeof window.requestAnimationFrame!=Vi,vu=(e,t)=>{const n=Lt.get(e);return[()=>!we(t)&&e.get(t)||Ca,r=>{if(!we(t)){const a=e.get(t);t in Zr||(Zr[t]=a),n[5](t,_t(a,r),a||Ca)}},n[6],()=>!we(t)&&t in Zr?Zr[t]:!we(t)&&e.get(t)||Ca]};let si=!0;const qm=()=>si,[ai,ii]=Pr&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[qt,qt],Gm=()=>{const e=ri&&document.visibilityState;return we(e)||e!=="hidden"},Zm=e=>(ri&&document.addEventListener("visibilitychange",e),ai("focus",e),()=>{ri&&document.removeEventListener("visibilitychange",e),ii("focus",e)}),Jm=e=>{const t=()=>{si=!0,e()},n=()=>{si=!1};return ai("online",t),ai("offline",n),()=>{ii("online",t),ii("offline",n)}},Xm={isOnline:qm,isVisible:Gm},Qm={initFocus:Zm,initReconnect:Jm},Jo=!d.useId,vn=!Pr||Km,eh=e=>Wm()?window.requestAnimationFrame(e):setTimeout(e,1),Yn=vn?d.useEffect:d.useLayoutEffect,wa=typeof navigator<"u"&&navigator.connection,Xo=!vn&&wa&&(["slow-2g","2g"].includes(wa.effectiveType)||wa.saveData),Jr=new WeakMap,th=e=>Os.prototype.toString.call(e),ja=(e,t)=>e===`[object ${t}]`;let nh=0;const oi=e=>{const t=typeof e,n=th(e),r=ja(n,"Date"),a=ja(n,"RegExp"),i=ja(n,"Object");let o,l;if(Os(e)===e&&!r&&!a){if(o=Jr.get(e),o)return o;if(o=++nh+"~",Jr.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=oi(e[l])+",";Jr.set(e,o)}if(i){o="#";const u=Os.keys(e).sort();for(;!we(l=u.pop());)we(e[l])||(o+=l+":"+oi(e[l])+",");Jr.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Hi=e=>{if(kt(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 rh=0;const As=()=>++rh;async function Tu(...e){const[t,n,r,a]=e,i=_t({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const l=i.rollbackOnError;let u=i.optimisticData;const h=m=>typeof l=="function"?l(m):l!==!1,g=i.throwOnError;if(kt(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]=Hi(m);if(!p)return;const[S,y]=vu(t,p),[j,v,x,C]=Lt.get(t),w=()=>{const D=j[p];return(kt(i.revalidate)?i.revalidate(S().data,m):i.revalidate!==!1)&&(delete x[p],delete C[p],D&&D[0])?D[0](wu).then(()=>S().data):S().data};if(e.length<3)return w();let b=r,T,F=!1;const R=As();v[p]=[R,0];const E=!we(u),M=S(),O=M.data,Y=M._c,H=we(Y)?O:Y;if(E&&(u=kt(u)?u(H,O):u,y({data:u,_c:H})),kt(b))try{b=b(H)}catch(D){T=D,F=!0}if(b&&ni(b))if(b=await b.catch(D=>{T=D,F=!0}),R!==v[p][0]){if(F)throw T;return b}else F&&E&&h(T)&&(o=!0,y({data:H,_c:ze}));if(o&&!F)if(kt(o)){const D=o(b,H);y({data:D,error:ze,_c:ze})}else y({data:b,error:ze,_c:ze});if(v[p][1]=As(),Promise.resolve(w()).then(()=>{y({_c:ze})}),F){if(g)throw T;return}return b}}const Qo=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Fu=(e,t)=>{if(!Lt.has(e)){const r=_t(Qm,t),a=Object.create(null),i=Tu.bind(ze,e);let o=qt;const l=Object.create(null),u=(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 j of y)j(p,S)},g=m=>{const p=Lt.get(e),[,S,y,j]=p,v=As();p[8]++;for(const w in y)delete y[w];for(const w in j)delete j[w];for(const w in S)S[w]=[v,v];const x={};for(const w of[...e.keys()]){const b=e.get(w);e.delete(w);const T=l[w];if(T)for(const F of T)F(x,b)}const C=!m||m.revalidate!==!1;for(const w in a){const b=a[w];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,u,g,0]),!vn)){const m=r.initFocus(setTimeout.bind(ze,Qo.bind(ze,a,Su))),p=r.initReconnect(setTimeout.bind(ze,Qo.bind(ze,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],ze,ze,n[7]]},sh=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!we(i)&&o>i||setTimeout(r,l,a)},ah=ti,[Yi,ih,,,oh]=Fu(new Map),Ru=_t({onLoadingSlow:qt,onSuccess:qt,onError:qt,onErrorRetry:sh,onDiscarded:qt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Xo?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Xo?5e3:3e3,compare:ah,isPaused:()=>!1,cache:Yi,mutate:ih,unload:oh,fallback:{}},Xm),$u=(e,t)=>{const n=_t(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=_t(a,l)),i&&u&&(n.cacheData=_t(i,u))}return n},li=d.createContext({}),lh=e=>{const{value:t}=e,n=d.useContext(li),r=kt(t),a=d.useMemo(()=>r?t(n):t,[r,n,t]),i=d.useMemo(()=>r?a:$u(n,a),[r,n,a]),o=a&&a.provider,l=d.useRef(ze);o&&!l.current&&(l.current=Fu(o(i.cache||Yi),a));const u=l.current;return u&&(i.cache=u[0],i.mutate=u[1],i.unload=u[4]),Yn(()=>{if(u)return u[2]&&u[2](),u[3]},[]),d.createElement(li.Provider,_t(e,{value:i}))},ch="$inf$",Eu=Pr&&window.__SWR_DEVTOOLS_USE__,uh=Eu?window.__SWR_DEVTOOLS_USE__:[],dh=()=>{Eu&&(window.__SWR_DEVTOOLS_REACT__=d)},fh=e=>kt(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(()=>_t(Ru,e),[e])},mh=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=Hi(t),[,,,l]=Lt.get(Yi);if(o.startsWith(ch))return n(...i);const u=l[o];return we(u)?n(...i):(delete l[o],u)}),r),hh=uh.concat(mh),gh=e=>function(...n){const r=Iu(),[a,i,o]=fh(n),l=$u(r,o);let u=e;const{use:h}=l,g=(h||[]).concat(hh);for(let f=g.length;f--;)u=g[f](u);return u(a,i||l.fetcher||null,l)},ph=(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())}};dh();const Xr=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},el=(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)},yh=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{const a=i=>{n()&&we(t())&&r(i)};Promise.resolve(e).then(i=>{a({data:i,error:ze})},i=>{a({error:i})})},ks=Promise.resolve(ze);ks.status="fulfilled";ks.value=ze;const xh=()=>qt,bh=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:h,refreshWhenHidden:g,refreshWhenOffline:f,keepPreviousData:m,strictServerPrefetchWarning:p}=n,[S,y,j,v]=Lt.get(r),[x,C]=Hi(e),w=d.useRef(!1),b=d.useRef(!1),T=d.useRef(x),F=d.useRef(t),R=d.useRef(n),E=()=>R.current,M=()=>E().isVisible()&&E().isOnline(),[O,Y,H,D]=vu(r,x),I=d.useRef({}).current,$=we(o)?we(n.fallback)?ze:n.fallback[x]:o,z=n.cacheData,_=x?z==null?void 0:z[x]:ze,V=x?v[x]:ze,Z=we(V)&&!we(_),B=Z?_:V,U=(X,fe)=>{for(const pe in I){const ve=pe;if(ve==="data"){if(!a(X[ve],fe[ve])&&(!we(X[ve])||!a(ee,fe[ve])))return!1}else if(fe[ve]!==X[ve])return!1}return!0},J=!w.current,G=d.useMemo(()=>{const X=O(),fe=D(),pe=Ye=>{const Ge=_t(Ye);return delete Ge._k,(()=>{if(!x||!t||E().isPaused())return!1;if(J&&!we(l))return l;const Re=we($)?Ge.data:$;return i&&Z&&we(Re)?!1:we(Re)||u})()?{isValidating:!0,isLoading:!0,...Ge}:Ge},ve=pe(X),Ee=X===fe?ve:pe(fe);let Te=ve;return[()=>{const Ye=pe(O());return U(Ye,Te)?(Te.data=Ye.data,Te.isLoading=Ye.isLoading,Te.isValidating=Ye.isValidating,Te.error=Ye.error,Te):(Te=Ye,Ye)},()=>Ee]},[r,x]),K=qo.useSyncExternalStore(d.useCallback(X=>H(x,(fe,pe)=>{U(pe,fe)||X()}),[r,x]),G[0],G[1]),A=S[x]&&S[x].length>0,k=K.data;let N=we(k)?$&&ni($)?Xr($):$:k;const P=K.error,L=d.useRef(N),W=d.useRef(ze);let q=W.current;q||(q=new WeakMap,W.current=q);const Q=d.useRef(null);let ee=m?we(k)?we(L.current)?N:L.current:k:N;const re=x&&we(N),le=d.useRef(null);!vn&&qo.useSyncExternalStore(xh,()=>(le.current=!1,le),()=>(le.current=!0,le));const ce=le.current;p&&ce&&!i&&re&&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 ue=!x||!t||E().isPaused()||A&&!we(P)?!1:J&&!we(l)?l:i&&Z&&re?!1:i?we(N)?!1:u:we(N)||u,he=J&&ue,se=we(K.isValidating)?he:K.isValidating,de=we(K.isLoading)?he:K.isLoading,ge=d.useCallback(async X=>{const fe=F.current;if(!x||!fe||b.current||E().isPaused())return!1;let pe,ve,Ee=!0;const Te=X||{},Ye=!j[x]||!Te.dedupe,Ge=Z&&!el(q,z,x)&&!we(B)&&we(O().data),Ce=()=>Jo?!b.current&&x===T.current&&w.current:x===T.current,Re={isValidating:!1,isLoading:!1},dt=()=>{Y(Re)},rt=()=>{const Qe=j[x];Qe&&Qe[1]===ve&&delete j[x]},lt={isValidating:!0};we(O().data)&&(lt.isLoading=!0);try{if(Ye&&(Y(lt),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ee&&Ce()&&E().onLoadingSlow(x,n)},n.loadingTimeout),Ge&&Ta(q,z,x),j[x]=[Ge?B:fe(C),As()],Ge&&v[x]&&delete v[x]),[pe,ve]=j[x],pe=await pe,Ye&&setTimeout(rt,n.dedupingInterval),!j[x]||j[x][1]!==ve)return Ye&&Ce()&&E().onDiscarded(x),!1;Re.error=ze;const Qe=y[x];if(!we(Qe)&&(ve<=Qe[0]||ve<=Qe[1]||Qe[1]===0))return dt(),Ye&&Ce()&&E().onDiscarded(x),!1;const st=O().data;Re.data=a(st,pe)?st:pe,Ye&&Ce()&&E().onSuccess(pe,x,n)}catch(Qe){rt();const st=E(),{shouldRetryOnError:en}=st;st.isPaused()||(Re.error=Qe,Ye&&Ce()&&(st.onError(Qe,x,st),(en===!0||kt(en)&&en(Qe))&&(!E().revalidateOnFocus||!E().revalidateOnReconnect||M())&&st.onErrorRetry(Qe,x,st,Hr=>{const tn=S[x];tn&&tn[0]&&tn[0](Zo,Hr)},{retryCount:(Te.retryCount||0)+1,dedupe:!0})))}return Ee=!1,dt(),!0},[x,r]),ne=d.useCallback((...X)=>Tu(r,T.current,...X),[]);if(Yn(()=>{const X=Q.current;X&&(Q.current=null,Ta(q,X.cacheData,X.key),we(O().data)&&Y({data:X.data,error:ze,_k:X._k}),v[X.key]&&delete v[X.key])}),Yn(()=>{F.current=t,R.current=n,we(k)||(L.current=k)}),Yn(()=>{if(t||!Z||we(B)||el(q,z,x)||!we(O().data))return;Ta(q,z,x);const X=y[x];yh({value:B,getCacheData:()=>O().data,canCommit:()=>!b.current&&x===T.current&&y[x]===X,setCache:fe=>Y({...fe,_k:C})})}),Yn(()=>{if(!x)return;const X=ge.bind(ze,va);let fe=0;E().revalidateOnFocus&&(fe=Date.now()+E().focusThrottleInterval);const ve=ph(x,S,(Ee,Te={})=>{if(Ee==Su){const Ye=Date.now();E().revalidateOnFocus&&Ye>fe&&M()&&(fe=Ye+E().focusThrottleInterval,X())}else if(Ee==Cu)E().revalidateOnReconnect&&M()&&X();else{if(Ee==wu)return ge();if(Ee==Zo)return ge(Te);if(Ee==ju&&(L.current=ze,Te.revalidate))return ge()}});return b.current=!1,T.current=x,w.current=!0,Y({_k:C}),ue&&(j[x]||(we(N)||vn?X():eh(X))),()=>{b.current=!0,ve()}},[x]),Yn(()=>{let X;function fe(){const ve=kt(h)?h(O().data):h;ve&&X!==-1&&(X=setTimeout(pe,ve))}function pe(){!O().error&&(g||E().isVisible())&&(f||E().isOnline())?ge(va).then(fe):fe()}return fe(),()=>{X&&(clearTimeout(X),X=-1)}},[h,g,f,x]),d.useDebugValue(ee),i){if(!Jo&&vn&&re&&we(B))throw new Error("Fallback data is required when using Suspense in SSR.");re&&(F.current=t,R.current=n,b.current=!1);const X=!we(B)&&re;let fe=ze;if(X&&Z)fe=B&&ni(B)?Xr(B):B,N=fe,ee=fe,vn||(Q.current={data:fe,_k:C,key:x,cacheData:z});else{const ve=X?ne(B):ks;Xr(ve)}if(!we(P)&&re)throw P;const pe=re&&we(fe)?ge(va):ks;!we(ee)&&re&&(pe.status="fulfilled",pe.value=!0),Xr(pe)}return{mutate:ne,get data(){return I.data=!0,ee},get error(){return I.error=!0,P},get isValidating(){return I.isValidating=!0,se},get isLoading(){return I.isLoading=!0,de}}},Sh=Os.defineProperty(lh,"defaultValue",{value:Ru}),Mu=gh(bh),Ch={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:"غلق"}},wh={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"}},jh={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"}},vh={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"}},Th={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"}},Fh={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"}},Rh={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"}},$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:"نزدیک"}},Eh={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"}},Ih={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:"סגור"}},Mh={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"}},Oh={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"}},Ah={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"}},kh={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:"閉じる"}},Dh={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:"가까 운"}},Ph={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:"Хаах"}},Nh={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"}},Lh={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"}},_h={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ć"}},zh={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"}},Bh={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"}},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:"По адресу:"}},Hh={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ť"}},Yh={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:"Затворите"}},Uh={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"}},Kh={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:"ปิด"}},Wh={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"}},qh={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:"Закрито"}},Gh={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"}},Zh={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"}},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:"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:"關閉"}},Qh={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:"關閉"}},Oe=(e,t)=>({getMessage:(n,r)=>{const a=Me(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}),eg=Oe("mn_MN",Ph),tg=Oe("ar_EG",Ch),Mr=Oe("zh_CN",Jh),ng=Oe("en_US",Fh),rg=Oe("en_GB",Th),sg=Oe("vi_VN",Zh),ag=Oe("it_IT",Ah),ig=Oe("ja_JP",kh),og=Oe("es_ES",Rh),lg=Oe("ca_ES",wh),cg=Oe("ru_RU",Vh),ug=Oe("sr_RS",Yh),dg=Oe("ms_MY",Nh),fg=Oe("zh_TW",Qh),mg=Oe("zh_HK",Xh),hg=Oe("fr_FR",Eh),gg=Oe("pt_BR",zh),pg=Oe("ko_KR",Dh),yg=Oe("id_ID",Oh),xg=Oe("de_DE",vh),bg=Oe("fa_IR",$h),Sg=Oe("tr_TR",Wh),Cg=Oe("pl_PL",_h),wg=Oe("hr_",Mh),jg=Oe("th_TH",Kh),vg=Oe("cs_cz",jh),Tg=Oe("sk_SK",Hh),Fg=Oe("he_IL",Ih),Rg=Oe("uk_UA",qh),$g=Oe("uz_UZ",Gh),Eg=Oe("nl_NL",Lh),Ig=Oe("ro_RO",Bh),Mg=Oe("sv_SE",Uh),In={"mn-MN":eg,"ar-EG":tg,"zh-CN":Mr,"en-US":ng,"en-GB":rg,"vi-VN":sg,"it-IT":ag,"ja-JP":ig,"es-ES":og,"ca-ES":lg,"ru-RU":cg,"sr-RS":ug,"ms-MY":dg,"zh-TW":fg,"zh-HK":mg,"fr-FR":hg,"pt-BR":gg,"ko-KR":pg,"id-ID":yg,"de-DE":xg,"fa-IR":bg,"tr-TR":Sg,"pl-PL":Cg,"hr-HR":wg,"th-TH":jg,"cs-CZ":vg,"sk-SK":Tg,"he-IL":Fg,"uk-UA":Rg,"uz-UZ":$g,"nl-NL":Eg,"ro-RO":Ig,"sv-SE":Mg},Og=Object.keys(In),Ou=e=>{const t=(e||"zh-CN").toLocaleLowerCase();return Og.find(n=>n.toLocaleLowerCase().includes(t))};function ot(e,t){Ag(e)&&(e="100%");const n=kg(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 Qr(e){return Math.min(1,Math.max(0,e))}function Ag(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function kg(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 es(e){return Number(e)<=1?`${Number(e)*100}%`:e}function Tn(e){return e.length===1?"0"+e:String(e)}function Dg(e,t,n){return{r:ot(e,255)*255,g:ot(t,255)*255,b:ot(n,255)*255}}function tl(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(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 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 Pg(e,t,n){let r,a,i;if(e=ot(e,360),t=ot(t,100),n=ot(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 nl(e,t,n){e=ot(e,255),t=ot(t,255),n=ot(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 Ng(e,t,n){e=ot(e,360)*6,t=ot(t,100),n=ot(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,h=[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:h*255,g:g*255,b:f*255}}function rl(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 Lg(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)),u=Tn(zg(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 _g(e,t,n,r){const a=e/100,i=t/100,o=n/100,l=r/100,u=255*(1-a)*(1-l),h=255*(1-i)*(1-l),g=255*(1-o)*(1-l);return{r:u,g:h,b:g}}function sl(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 zg(e){return Math.round(parseFloat(e)*255).toString(16)}function al(e){return bt(e)/255}function bt(e){return parseInt(e,16)}function Bg(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 Vg(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=Ug(e)),typeof e=="object"&&(xt(e.r)&&xt(e.g)&&xt(e.b)?(t=Dg(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=es(e.s),a=es(e.v),t=Ng(e.h,r,a),o=!0,l="hsv"):xt(e.h)&&xt(e.s)&&xt(e.l)?(r=es(e.s),i=es(e.l),t=Pg(e.h,r,i),o=!0,l="hsl"):xt(e.c)&&xt(e.m)&&xt(e.y)&&xt(e.k)&&(t=_g(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 Hg="[-\\+]?\\d+%?",Yg="[-\\+]?\\d*\\.\\d+%?",dn="(?:"+Yg+")|(?:"+Hg+")",Ra="[\\s|\\(]+("+dn+")[,|\\s]+("+dn+")[,|\\s]+("+dn+")\\s*\\)?",ts="[\\s|\\(]+("+dn+")[,|\\s]+("+dn+")[,|\\s]+("+dn+")[,|\\s]+("+dn+")\\s*\\)?",St={hex:/^[0-9a-fA-F]+$/,CSS_UNIT:new RegExp(dn),rgb:new RegExp("rgb"+Ra),rgba:new RegExp("rgba"+ts),hsl:new RegExp("hsl"+Ra),hsla:new RegExp("hsla"+ts),hsv:new RegExp("hsv"+Ra),hsva:new RegExp("hsva"+ts),cmyk:new RegExp("cmyk"+ts),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 Ug(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:al(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:al(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 Xe{constructor(t="",n={}){if(t instanceof Xe)return t;typeof t=="number"&&(t=Bg(t)),this.originalInput=t;const r=Vg(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=nl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=nl(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=tl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=tl(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 rl(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return Lg(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(ot(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(ot(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{...sl(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=sl(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="#"+rl(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 Xe(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=Qr(n.l),new Xe(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 Xe(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=Qr(n.l),new Xe(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=Qr(n.s),new Xe(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=Qr(n.s),new Xe(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 Xe(n)}mix(t,n=50){const r=this.toRgb(),a=new Xe(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 Xe(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 Xe(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new Xe(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 Xe({h:r,s:a,v:i})),i=(i+l)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new Xe({h:(n+72)%360,s:t.s,l:t.l}),new Xe({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new Xe(t).toRgb(),a=n.a+r.a*(1-n.a);return new Xe({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 Xe({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new Xe(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}const Ct=(e,t)=>new Xe(e).setAlpha(t).toRgbString(),mn=c.theme,$a=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none","*, *::before, *::after":{boxSizing:"border-box"}}),Kg=e=>{let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},Wg=e=>{try{return Kg(JSON.stringify(e))}catch{return""}};function Be(e,t){let{token:n={},hashed:r}=d.useContext(Ht);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 h=d.useMemo(()=>Wg(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 Pm({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=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:((u=n.pageContainer)==null?void 0:u.paddingBlockPageContainerContent)||32,colorBgPageContainerFixed:t.colorBgElevated,...n.pageContainer}}},Gg=(...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},Zg=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"))},Bt=d.createContext({intl:{...Mr,locale:"default"},valueTypeMap:{},hashed:!0,dark:!1,token:{...c.theme.getDesignToken(),proComponentsCls:".ant-pro",antCls:".ant",themeId:0},prefixCls:".ant-pro"}),{Consumer:yF}=Bt,Jg=()=>{const{cache:e}=Iu();return d.useEffect(()=>()=>{e.clear()},[]),null},Xg=e=>{var M,O;const{children:t,dark:n,valueTypeMap:r,autoClearCache:a=!1,token:i,prefixCls:o,intl:l}=e,{locale:u,getPrefixCls:h,...g}=d.useContext(c.ConfigProvider.ConfigContext),f=(O=(M=c.theme).useToken)==null?void 0:O.call(M),m=d.useContext(Bt),p=o?`.${o}`:`.${h()}-pro`,S="."+h(),y=`${p}`,j=d.useMemo(()=>qg(i||{},f.token),[i,f.token]),v=d.useMemo(()=>{var I;const Y=u==null?void 0:u.locale,H=Ou(Y),D=l??(Y&&((I=m.intl)==null?void 0:I.locale)==="default"?In[H]:m.intl||In[H]);return{...m,dark:n??m.dark,token:Gg(m.token,f.token,{proComponentsCls:p,antCls:S,themeId:f.theme.id,layout:j}),intl:D||Mr}},[u==null?void 0:u.locale,m,n,f.token,f.theme.id,p,S,j,l]),x={...v.token||{},proComponentsCls:p},[C,w]=cm(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:w,[w,m.hashed,e.hashed]);d.useEffect(()=>{Se.locale((u==null?void 0:u.locale)||"zh-cn")},[u==null?void 0:u.locale]);const F=d.useMemo(()=>({...g.theme,hashId:T,hashed:b&&Ea()}),[g.theme,T,b,Ea()]),R=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:F,children:s.jsx(Bt.Provider,{value:R,children:s.jsxs(s.Fragment,{children:[a&&s.jsx(Jg,{}),t]})})}),[g,F,R,a,t]);return a?s.jsx(Sh,{value:{provider:()=>new Map},children:E}):E},Mn=e=>{const{needDeps:t,dark:n,token:r}=e,a=d.useContext(Bt),{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||zm,theme:Zg({...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(Xg,{...e,token:r})})};function Fe(){const{locale:e}=d.useContext(c.ConfigProvider.ConfigContext),{intl:t}=d.useContext(Bt);return t&&t.locale!=="default"?t:e!=null&&e.locale&&In[Ou(e.locale)]||Mr}Bt.displayName="ProProvider";const Ht=Bt,Qg=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 ep(e){return Be("ProCardActions",t=>{const n={...t,componentCls:`.${e}`,cardActionIconSize:16};return[Qg(n)]})}const tp=e=>{const{actions:t,prefixCls:n}=e,{wrapSSR:r,hashId:a}=ep(n);return Array.isArray(t)&&(t!=null&&t.length)?r(s.jsx("ul",{className:ie(`${n}-actions`,a),children:t.map((i,o)=>s.jsx("li",{style:{width:`${100/t.length}%`,padding:0,margin:0},className:ie(`${n}-actions-item`,a),children:i},`action-${o}`))})):r(s.jsx("ul",{className:ie(`${n}-actions`,a),children:t}))};function Ui(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?Ui(a,t):a);return d.cloneElement(e,{},...r)}return d.cloneElement(e,{...e.props,autoFocus:t})}const np=e=>({[e.componentCls]:{boxSizing:"border-box",display:"flex",justifyContent:"space-between",paddingBlock:8,paddingInlineStart:8,paddingInlineEnd:8,borderBlockStart:`1px solid ${e.colorSplit}`}});function rp(e){return Be("DropdownFooter",t=>{const n={...t,componentCls:`.${e}`};return[np(n)]})}const sp=e=>{const t=Fe(),{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:h}=rp(l),g=[s.jsx(c.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(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:ie(l,h),onClick:m=>m.target.getAttribute("data-type")!=="confirm"&&m.stopPropagation(),children:f}))};class ap extends d.Component{constructor(){super(...arguments);oe(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 ip=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 op(e){return Be("FieldLabel",t=>{const n={...t,componentCls:`.${e}`};return[ip(n)]})}const lp=(e,t)=>{var O,Y;const{label:n,onClear:r,value:a,disabled:i,onLabelClick:o,ellipsis:l,placeholder:u,className:h,formatter:g,variant:f,style:m,downIcon:p,allowClear:S=!0,valueMaxLength:y=41}=e,{componentSize:j}=((Y=(O=c.ConfigProvider)==null?void 0:O.useConfig)==null?void 0:Y.call(O))||{componentSize:"middle"},{getPrefixCls:v}=d.useContext(c.ConfigProvider.ConfigContext),x=v("pro-core-field-label"),{wrapSSR:C,hashId:w}=op(x),b=Fe(),T=d.useRef(null),F=d.useRef(null);d.useImperativeHandle(t,()=>({labelRef:F,clearRef:T}));const R=H=>H.every(D=>typeof D=="string")?H.join(","):H.map((D,I)=>{const $=I===H.length-1?"":",";return typeof D=="string"?s.jsxs("span",{children:[D,$]},I):s.jsxs("span",{style:{display:"flex"},children:[D,$]},I)}),E=H=>g?g(H):Array.isArray(H)?R(H):H,M=(H,D)=>{var I,$;if(D!=null&&D!==""&&(!Array.isArray(D)||D.length)){const z=H?s.jsxs("span",{onClick:()=>{o==null||o()},className:ie(`${x}-text`,w),children:[H,": "]}):"",_=E(D);if(!l)return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center"},children:[z,E(D)]});const Z=(()=>{const B=Array.isArray(D)&&D.length>1,U=b.getMessage("form.lightFilter.itemUnit","项");return typeof _=="string"&&_.length>y&&B?`...${D.length}${U}`:""})();return s.jsxs("span",{title:typeof _=="string"?_:void 0,style:{display:"inline-flex",alignItems:"center"},children:[z,s.jsx("span",{style:{paddingInlineStart:4,display:"flex"},children:typeof _=="string"?($=(I=_==null?void 0:_.toString())==null?void 0:I.slice)==null?void 0:$.call(I,0,y):_}),Z]})}return H||u};return C(s.jsxs("span",{className:ie(x,w,`${x}-${e.size??j??"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:F,onClick:()=>{var H;(H=e==null?void 0:e.onClick)==null||H.call(e)},children:[M(n,a),(a||a===0)&&S&&s.jsx(ae.CloseCircleFilled,{role:"button",title:b.getMessage("form.lightFilter.clear","清除"),className:ie(`${x}-icon`,w,`${x}-close`),onClick:H=>{i||r==null||r(),H.stopPropagation()},ref:T}),p!==!1?p??s.jsx(ae.DownOutlined,{className:ie(`${x}-icon`,w,`${x}-arrow`)}):null]}))},Yt=d.forwardRef(lp),cp=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 up(e){return Be("FilterDropdown",t=>{const n={...t,componentCls:`.${e}`};return[cp(n)]})}const ku=e=>{const{children:t,label:n,footer:r,open:a,onOpenChange:i,disabled:o,footerRender:l,placement:u,popoverProps:h}=e,{getPrefixCls:g}=d.useContext(c.ConfigProvider.ConfigContext),f=g("pro-core-field-dropdown"),{wrapSSR:m,hashId:p}=up(f),S=d.useRef(null),y=d.useMemo(()=>{var j;return{container:{padding:0,...((j=h==null?void 0:h.styles)==null?void 0:j.container)||{}},...(h==null?void 0:h.styles)||{}}},[h==null?void 0:h.styles]);return m(s.jsx(c.Popover,{...h,placement:u,trigger:["click"],open:a||!1,onOpenChange:i,styles:y,content:s.jsxs("div",{ref:S,className:ie(`${f}-overlay`,{[`${f}-overlay-${u}`]:u,hashId:p}),children:[s.jsx(c.ConfigProvider,{getPopupContainer:()=>S.current||document.body,children:s.jsx("div",{className:ie(`${f}-content`,p),children:t})}),r&&s.jsx(sp,{disabled:o,footerRender:l,...r})]}),children:s.jsx("span",{className:ie(`${f}-label`,p),children:n})}))},dp=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 fp(e){return Be("InlineErrorFormItem",t=>{const n={...t,componentCls:`.${e}`};return[dp(n)]})}const Du={marginBlockStart:-5,marginBlockEnd:-5,marginInlineStart:0,marginInlineEnd:0},mp=({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:h}=d.useContext(c.ConfigProvider.ConfigContext),g=h(),f=c.theme.useToken(),{wrapSSR:m,hashId:p}=fp(`${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,j=()=>{var C,w;return s.jsxs(s.Fragment,{children:[(C=l.errors)==null?void 0:C.map((b,T)=>s.jsx("div",{className:ie(`${g}-form-item-explain-error`,p),children:b},`error-${T}`)),(w=l.warnings)==null?void 0:w.map((b,T)=>s.jsx("div",{className:ie(`${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:m(s.jsx("div",{className:ie(`${g}-form-item`,p,f.hashId),style:{margin:0,padding:0},children:s.jsxs("div",{className:ie(`${g}-form-item-with-help`,p,f.hashId),children:[S?s.jsx(ae.LoadingOutlined,{}):null,y?j():r]})})),...a,children:s.jsxs(s.Fragment,{children:[t,n]})},"popover")},hp=({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(Me(i,l))!==JSON.stringify(Me(o,l))}catch{return!0}},_internalItemRender:{mark:"pro_table_render",render:(i,o)=>s.jsx(mp,{inputProps:i,popoverProps:r,...o})},...a,style:{...Du,...a==null?void 0:a.style},children:n}),gp=e=>{const{errorType:t,rules:n,name:r,popoverProps:a,children:i,...o}=e;return r&&(n!=null&&n.length)&&t==="popover"?s.jsx(hp,{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 h=[r].flat(1);h.length>1&&h.pop();try{return JSON.stringify(Me(l,h))!==JSON.stringify(Me(u,h))}catch{return!0}}:void 0,...o,style:{...Du,...o.style},name:r,children:i})},pp=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 yp(e){return Be("LabelIconTip",t=>{const n={...t,componentCls:`.${e}`};return[pp(n)]})}const Xn=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}=yp(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(ae.InfoCircleOutlined,{});return l(s.jsxs("div",{className:ie(o,u),onMouseDown:f=>f.stopPropagation(),onMouseLeave:f=>f.stopPropagation(),onMouseMove:f=>f.stopPropagation(),children:[s.jsx("div",{className:ie(`${o}-title`,u,{[`${o}-title-ellipsis`]:r}),children:t}),a&&s.jsx("div",{className:ie(`${o}-subtitle`,u),children:a}),n&&s.jsx(c.Tooltip,{...h,children:s.jsx("span",{className:ie(`${o}-icon`,u),children:g})})]}))}),Nr=d.createContext({});var Cs={exports:{}},xp=Cs.exports,il;function bp(){return il||(il=1,(function(e,t){(function(n,r){e.exports=r()})(xp,(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 u=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 u.bind(this)(h,g)}}}))})(Cs)),Cs.exports}var Sp=bp();const Cp=Vt(Sp),$t=e=>e==null;Se.extend(Cp);const Ki={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 ol(e){return Object.prototype.toString.call(e)==="[object Object]"}function wp(e){if(ol(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(ol(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}const ui=e=>!!(e!=null&&e._isAMomentObject),ll=(e,t,n)=>{if(!t)return e;if(Se.isDayjs(e)||ui(e)){if(t==="number")return e.valueOf();if(t==="string")return e.format(Ki[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"||$t(e)||e instanceof Blob||Array.isArray(e)?e:(Object.keys(e).forEach(o=>{const l=a?[a,o].flat(1):[o],u=Me(n,l)||"text";let h="text",g;typeof u=="string"?h=u:(h=u.valueType,g=u.dateFormat);const f=e[o];if($t(f)&&r||r&&f==="")return;if(wp(f)&&!Array.isArray(f)&&!Se.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||Ki[h]:p=m,Array.isArray(f)){i[o]=f.map((S,y)=>Se.isDayjs(S)||ui(S)?ll(S,p===void 0&&m==="string"?"string":p,h):di(S,t,n,r,[o,`${y}`].flat(1)));return}i[o]=ll(f,p,h)}),i)},cl=(e,t)=>typeof t=="function"?t(Se(e)):Se(e).format(t),jp=(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?cl(n,a):"",l=r?cl(r,i):"";return o&&l?`${o} ~ ${l}`:""};function Ft(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}const vp=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)},Tp=e=>{var t;return((t=e.ellipsis)==null?void 0:t.showTitle)===!1?!1:e.ellipsis},ul=e=>e==null?"":String(e).trimEnd(),Fp=e=>d.isValidElement(e),Rp=(e,t,n,r)=>{const a=Tp(t);if(!a)return!1;const i=vp(t),o=Fp(r);if((i||o)&&(t==null?void 0:t.tooltip)!==!1){const l=s.jsx("div",{className:"pro-table-tooltip-text",children:e});return Ft(a)&&Ft(a.tooltip)?{tooltip:{title:l,...a.tooltip}}:{tooltip:l}}return n?Ft(a)&&Ft(a.tooltip)?{tooltip:{title:n,...a.tooltip}}:{tooltip:n}:!1},$p=(e,t,n,r)=>{if(!t.copyable&&!t.ellipsis)return e;const a=ul(n),i=r!==void 0?ul(r):a,o=Rp(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 mt(e,...t){return typeof e=="function"?e(...t):e}const fi=(e,t,n)=>t===void 0?e:mt(e,t,n),be=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 Wi(e,t){const n=be(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 qi=e=>{const t=d.useRef(e);return t.current=e,t};function Ep(e,t=100,n){const[r,a]=d.useState(e),i=qi(e);return d.useEffect(()=>{const o=setTimeout(()=>{a(i.current)},t);return()=>clearTimeout(o)},n?[t,...n]:void 0),r}function hn(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(!hn(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(!hn(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)&&!hn(e[o],t[o],n))return!1}return!0}return e!==e&&t!==t}const Ip=(e,t,n)=>hn(e,t,n);function Gi(e,t){const n=d.useRef();return Ip(e,n.current,t)||(n.current=e),n.current}function Wn(e,t,n){d.useEffect(e,Gi(t||[],n))}function Pu(e,t,n,r){const a=Wi(async()=>{e()},r||16);d.useEffect(()=>{a.run()},Gi(t||[],n))}function ct(e,t){return d.useMemo(e,Gi(t))}const Mp=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Zi=()=>typeof process<"u"&&process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Mp;let dl=0;function Op(e){const t=d.useRef(null),[n]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():(dl+=1,dl.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}=Mu(e.request?[n,e.params]:null,r,{revalidateOnFocus:!1,shouldRetryOnError:!1,onError:()=>{}});return e.request?[a,i]:[void 0,!1]}const Tr=e=>{const t=d.useRef();return d.useEffect(()=>{t.current=e}),t.current};function Ap(){const[,e]=d.useState(!0);return d.useCallback(()=>e(n=>!n),[])}function kp(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 Dp(e){const t=Ap();return kp(t,e)}const Pp=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 fl=0,Np=(e=21)=>{if(typeof window>"u"||!window.crypto)return(fl+=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():Np()},Lu=e=>{if(e&&e!==!0)return e},it=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Lp=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:{}},_p=ws.exports,ml;function zp(){return ml||(ml=1,(function(e,t){(function(n,r){e.exports=r()})(_p,(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={},h=function(j){return(j=+j)+(j>68?1900:2e3)},g=function(j){return function(v){this[j]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(j){(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})(j)}],m=function(j){var v=u[j];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(j,v){var x,C=u.meridiem;if(C){for(var w=1;w<=24;w+=1)if(j.indexOf(C(w,0,v))>-1){x=w>12;break}}else x=j===(v?"pm":"PM");return x},S={A:[l,function(j){this.afternoon=p(j,!1)}],a:[l,function(j){this.afternoon=p(j,!0)}],Q:[a,function(j){this.month=3*(j-1)+1}],S:[a,function(j){this.milliseconds=100*+j}],SS:[i,function(j){this.milliseconds=10*+j}],SSS:[/\d{3}/,function(j){this.milliseconds=+j}],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(j){var v=u.ordinal,x=j.match(/\d+/);if(this.day=x[0],v)for(var C=1;C<=31;C+=1)v(C).replace(/\[|\]/g,"")===j&&(this.day=C)}],w:[o,g("week")],ww:[i,g("week")],M:[o,g("month")],MM:[i,g("month")],MMM:[l,function(j){var v=m("months"),x=(m("monthsShort")||v.map((function(C){return C.slice(0,3)}))).indexOf(j)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[l,function(j){var v=m("months").indexOf(j)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,g("year")],YY:[i,function(j){this.year=h(j)}],YYYY:[/\d{4}/,g("year")],Z:f,ZZ:f};function y(j){var v,x;v=j,x=u&&u.formats;for(var C=(j=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(M,O,Y){var H=Y&&Y.toUpperCase();return O||x[Y]||n[Y]||x[H].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(D,I,$){return I||$.slice(1)}))}))).match(r),w=C.length,b=0;b<w;b+=1){var T=C[b],F=S[T],R=F&&F[0],E=F&&F[1];C[b]=E?{regex:R,parser:E}:T.replace(/^\[|\]$/g,"")}return function(M){for(var O={},Y=0,H=0;Y<w;Y+=1){var D=C[Y];if(typeof D=="string")H+=D.length;else{var I=D.regex,$=D.parser,z=M.slice(H),_=I.exec(z)[0];$.call(O,_),M=M.replace(_,"")}}return(function(V){var Z=V.afternoon;if(Z!==void 0){var B=V.hours;Z?B<12&&(V.hours+=12):B===12&&(V.hours=0),delete V.afternoon}})(O),O}}return function(j,v,x){x.p.customParseFormat=!0,j&&j.parseTwoDigitYear&&(h=j.parseTwoDigitYear);var C=v.prototype,w=C.parse;C.parse=function(b){var T=b.date,F=b.utc,R=b.args;this.$u=F;var E=R[1];if(typeof E=="string"){var M=R[2]===!0,O=R[3]===!0,Y=M||O,H=R[2];O&&(H=R[2]),u=this.$locale(),!M&&H&&(u=x.Ls[H]),this.$d=(function(z,_,V,Z){try{if(["x","X"].indexOf(_)>-1)return new Date((_==="X"?1e3:1)*z);var B=y(_)(z),U=B.year,J=B.month,G=B.day,K=B.hours,A=B.minutes,k=B.seconds,N=B.milliseconds,P=B.zone,L=B.week,W=new Date,q=G||(U||J?1:W.getDate()),Q=U||W.getFullYear(),ee=0;U&&!J||(ee=J>0?J-1:W.getMonth());var re,le=K||0,ce=A||0,ue=k||0,he=N||0;return P?new Date(Date.UTC(Q,ee,q,le,ce,ue,he+60*P.offset*1e3)):V?new Date(Date.UTC(Q,ee,q,le,ce,ue,he)):(re=new Date(Q,ee,q,le,ce,ue,he),L&&(re=Z(re).week(L).toDate()),re)}catch{return new Date("")}})(T,E,F,x),this.init(),H&&H!==!0&&(this.$L=this.locale(H).$L),Y&&T!=this.format(E)&&(this.$d=new Date("")),u={}}else if(E instanceof Array)for(var D=E.length,I=1;I<=D;I+=1){R[1]=E[I-1];var $=x.apply(this,R);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}I===D&&(this.$d=new Date(""))}else w.call(this,b)}}}))})(ws)),ws.exports}var Bp=zp();const Vp=Vt(Bp);Se.extend(Vp);const hl=e=>!!(e!=null&&e._isAMomentObject),sr=(e,t)=>$t(e)||Se.isDayjs(e)||hl(e)?hl(e)?Se(e):e:Array.isArray(e)?e.map(n=>sr(n,t)):typeof e=="number"?Se(e):Se(e,t),Hp=["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 Yp(e){const t={};return Hp.forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t}const Up="valueType request formItemRender render text formItemProps valueEnum",Kp="fieldProps isDefaultDom groupProps contentRender submitterProps submitter";function It(e,t=!1){const n=`${Up} ${Kp}`.split(/[\s\n]+/),r={};return Object.keys(e||{}).forEach(a=>{n.includes(a)&&!t||(r[a]=e[a])}),r}function Wp(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}),Xt=e=>Wp(e)==="map"?e:new Map(Object.entries(e||{})),Gp={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})},kn=(e,t,n)=>{if(Array.isArray(e))return s.jsx(c.Space,{separator:",",size:2,wrap:!0,children:e.map((u,h)=>kn(u,t,h))},n);const r=Xt(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=Gp[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 ns={exports:{}},gl;function Zp(){return gl||(gl=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 w=1;w<x.length;w++){const b=x[w];let T=w;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 h(x,C,w){x.length<w&&(w=x.length);const b=C===","?"":" ";let T=`"0":${b}${x[0]}`;for(let F=1;F<w;F++)T+=`${C}"${F}":${b}${x[F]}`;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 w;if(n.call(x,C)&&(w=x[C],typeof w!="boolean"))throw new TypeError(`The "${C}" argument must be of type boolean`);return w===void 0?!0:w}function p(x,C){let w;if(n.call(x,C)){if(w=x[C],typeof w!="number")throw new TypeError(`The "${C}" argument must be of type number`);if(!Number.isInteger(w))throw new TypeError(`The "${C}" argument must be an integer`);if(w<1)throw new RangeError(`The "${C}" argument must be >= 1`)}return w===void 0?1/0:w}function S(x){return x===1?"1 item":`${x} items`}function y(x){const C=new Set;for(const w of x)(typeof w=="string"||typeof w=="number")&&C.add(String(w));return C}function j(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 w=>{let b=`Object can not safely be stringified. Received type ${typeof w}`;throw typeof w!="function"&&(b+=` (${w.toString()})`),new Error(b)}}}function v(x){x={...x};const C=j(x);C&&(x.bigint===void 0&&(x.bigint=!1),"circularValue"in x||(x.circularValue=Error));const w=g(x),b=m(x,"bigint"),T=f(x),F=typeof T=="function"?T:void 0,R=p(x,"maximumDepth"),E=p(x,"maximumBreadth");function M(I,$,z,_,V,Z){let B=$[I];switch(typeof B=="object"&&B!==null&&typeof B.toJSON=="function"&&(B=B.toJSON(I)),B=_.call($,I,B),typeof B){case"string":return i(B);case"object":{if(B===null)return"null";if(z.indexOf(B)!==-1)return w;let U="",J=",";const G=Z;if(Array.isArray(B)){if(B.length===0)return"[]";if(R<z.length+1)return'"[Array]"';z.push(B),V!==""&&(Z+=V,U+=`
|
|
37
37
|
${Z}`,J=`,
|
|
38
|
-
${Z}`);const L=Math.min(B.length,
|
|
39
|
-
${G}`),z.pop(),`[${U}]`}let K=Object.keys(B);const
|
|
40
|
-
${Z}`,
|
|
38
|
+
${Z}`);const L=Math.min(B.length,E);let W=0;for(;W<L-1;W++){const Q=M(String(W),B,z,_,V,Z);U+=Q!==void 0?Q:"null",U+=J}const q=M(String(W),B,z,_,V,Z);if(U+=q!==void 0?q:"null",B.length-1>E){const Q=B.length-E-1;U+=`${J}"... ${S(Q)} not stringified"`}return V!==""&&(U+=`
|
|
39
|
+
${G}`),z.pop(),`[${U}]`}let K=Object.keys(B);const A=K.length;if(A===0)return"{}";if(R<z.length+1)return'"[Object]"';let k="",N="";V!==""&&(Z+=V,J=`,
|
|
40
|
+
${Z}`,k=" ");const P=Math.min(A,E);T&&!u(B)&&(K=o(K,F)),z.push(B);for(let L=0;L<P;L++){const W=K[L],q=M(W,B,z,_,V,Z);q!==void 0&&(U+=`${N}${i(W)}:${k}${q}`,N=J)}if(A>E){const L=A-E;U+=`${N}"...":${k}"${S(L)} not stringified"`,N=J}return V!==""&&N.length>1&&(U=`
|
|
41
41
|
${Z}${U}
|
|
42
|
-
${G}`),z.pop(),`{${U}}`}case"number":return isFinite(B)?String(B):
|
|
42
|
+
${G}`),z.pop(),`{${U}}`}case"number":return isFinite(B)?String(B):C?C(B):"null";case"boolean":return B===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(B);default:return C?C(B):void 0}}function O(I,$,z,_,V,Z){switch(typeof $=="object"&&$!==null&&typeof $.toJSON=="function"&&($=$.toJSON(I)),typeof $){case"string":return i($);case"object":{if($===null)return"null";if(z.indexOf($)!==-1)return w;const B=Z;let U="",J=",";if(Array.isArray($)){if($.length===0)return"[]";if(R<z.length+1)return'"[Array]"';z.push($),V!==""&&(Z+=V,U+=`
|
|
43
43
|
${Z}`,J=`,
|
|
44
|
-
${Z}`);const
|
|
45
|
-
${B}`),z.pop(),`[${U}]`}z.push(
|
|
46
|
-
${Z}`,G=" ");let K="";for(const
|
|
44
|
+
${Z}`);const A=Math.min($.length,E);let k=0;for(;k<A-1;k++){const P=O(String(k),$[k],z,_,V,Z);U+=P!==void 0?P:"null",U+=J}const N=O(String(k),$[k],z,_,V,Z);if(U+=N!==void 0?N:"null",$.length-1>E){const P=$.length-E-1;U+=`${J}"... ${S(P)} not stringified"`}return V!==""&&(U+=`
|
|
45
|
+
${B}`),z.pop(),`[${U}]`}z.push($);let G="";V!==""&&(Z+=V,J=`,
|
|
46
|
+
${Z}`,G=" ");let K="";for(const A of _){const k=O(A,$[A],z,_,V,Z);k!==void 0&&(U+=`${K}${i(A)}:${G}${k}`,K=J)}return V!==""&&K.length>1&&(U=`
|
|
47
47
|
${Z}${U}
|
|
48
|
-
${B}`),z.pop(),`{${U}}`}case"number":return isFinite(
|
|
48
|
+
${B}`),z.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 Y(I,$,z,_,V){switch(typeof $){case"string":return i($);case"object":{if($===null)return"null";if(typeof $.toJSON=="function"){if($=$.toJSON(I),typeof $!="object")return Y(I,$,z,_,V);if($===null)return"null"}if(z.indexOf($)!==-1)return w;const Z=V;if(Array.isArray($)){if($.length===0)return"[]";if(R<z.length+1)return'"[Array]"';z.push($),V+=_;let k=`
|
|
49
49
|
${V}`;const N=`,
|
|
50
|
-
${V}`,
|
|
51
|
-
${Z}`,z.pop(),`[${
|
|
52
|
-
${V}`;let G="",K="",
|
|
50
|
+
${V}`,P=Math.min($.length,E);let L=0;for(;L<P-1;L++){const q=Y(String(L),$[L],z,_,V);k+=q!==void 0?q:"null",k+=N}const W=Y(String(L),$[L],z,_,V);if(k+=W!==void 0?W:"null",$.length-1>E){const q=$.length-E-1;k+=`${N}"... ${S(q)} not stringified"`}return k+=`
|
|
51
|
+
${Z}`,z.pop(),`[${k}]`}let B=Object.keys($);const U=B.length;if(U===0)return"{}";if(R<z.length+1)return'"[Object]"';V+=_;const J=`,
|
|
52
|
+
${V}`;let G="",K="",A=Math.min(U,E);u($)&&(G+=h($,J,E),B=B.slice($.length),A-=$.length,K=J),T&&(B=o(B,F)),z.push($);for(let k=0;k<A;k++){const N=B[k],P=Y(N,$[N],z,_,V);P!==void 0&&(G+=`${K}${i(N)}: ${P}`,K=J)}if(U>E){const k=U-E;G+=`${K}"...": "${S(k)} not stringified"`,K=J}return K!==""&&(G=`
|
|
53
53
|
${V}${G}
|
|
54
|
-
${Z}`),z.pop(),`{${G}}`}case"number":return isFinite(R)?String(R):w?w(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(R);default:return w?w(R):void 0}}function H(E,R,z){switch(typeof R){case"string":return i(R);case"object":{if(R===null)return"null";if(typeof R.toJSON=="function"){if(R=R.toJSON(E),typeof R!="object")return H(E,R,z);if(R===null)return"null"}if(z.indexOf(R)!==-1)return C;let _="";const V=R.length!==void 0;if(V&&Array.isArray(R)){if(R.length===0)return"[]";if($<z.length+1)return'"[Array]"';z.push(R);const G=Math.min(R.length,M);let K=0;for(;K<G-1;K++){const P=H(String(K),R[K],z);_+=P!==void 0?P:"null",_+=","}const O=H(String(K),R[K],z);if(_+=O!==void 0?O:"null",R.length-1>M){const P=R.length-M-1;_+=`,"... ${S(P)} not stringified"`}return z.pop(),`[${_}]`}let Z=Object.keys(R);const B=Z.length;if(B===0)return"{}";if($<z.length+1)return'"[Object]"';let U="",J=Math.min(B,M);V&&c(R)&&(_+=h(R,",",M),Z=Z.slice(R.length),J-=R.length,U=","),T&&(Z=o(Z,F)),z.push(R);for(let G=0;G<J;G++){const K=Z[G],O=H(K,R[K],z);O!==void 0&&(_+=`${U}${i(K)}:${O}`,U=",")}if(B>M){const G=B-M;_+=`${U}"...":"${S(G)} not stringified"`}return z.pop(),`{${_}}`}case"number":return isFinite(R)?String(R):w?w(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(R);default:return w?w(R):void 0}}function k(E,R,z){if(arguments.length>1){let _="";if(typeof z=="number"?_=" ".repeat(Math.min(z,10)):typeof z=="string"&&(_=z.slice(0,10)),R!=null){if(typeof R=="function")return I("",{"":E},[],R,_,"");if(Array.isArray(R))return A("",E,[],y(R),_,"")}if(_.length!==0)return Y("",E,[],_,"")}return H("",E,[])}return k}})(ns,ns.exports)),ns.exports}var qp=Wp();const Gp=Bt(qp),Zp=Gp.configure,dn=Zp({bigint:!0,circularValue:"Magic circle!",deterministic:!1,maximumDepth:4});var Nu=typeof global=="object"&&global&&global.Object===Object&&global,Jp=typeof self=="object"&&self&&self.Object===Object&&self,Yt=Nu||Jp||Function("return this")(),gn=Yt.Symbol,Lu=Object.prototype,Xp=Lu.hasOwnProperty,Qp=Lu.toString,dr=gn?gn.toStringTag:void 0;function ey(e){var t=Xp.call(e,dr),n=e[dr];try{e[dr]=void 0;var r=!0}catch{}var s=Qp.call(e);return r&&(t?e[dr]=n:delete e[dr]),s}var ty=Object.prototype,ny=ty.toString;function ry(e){return ny.call(e)}var sy="[object Null]",ay="[object Undefined]",hl=gn?gn.toStringTag:void 0;function sr(e){return e==null?e===void 0?ay:sy:hl&&hl in Object(e)?ey(e):ry(e)}function Gt(e){return e!=null&&typeof e=="object"}var pn=Array.isArray;function _u(e){return e}var iy="[object AsyncFunction]",oy="[object Function]",ly="[object GeneratorFunction]",cy="[object Proxy]";function qi(e){if(!Ft(e))return!1;var t=sr(e);return t==oy||t==ly||t==iy||t==cy}var Ea=Yt["__core-js_shared__"],ml=(function(){var e=/[^.]+$/.exec(Ea&&Ea.keys&&Ea.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function uy(e){return!!ml&&ml in e}var dy=Function.prototype,fy=dy.toString;function kn(e){if(e!=null){try{return fy.call(e)}catch{}try{return e+""}catch{}}return""}var hy=/[\\^$.*+?()[\]{}|]/g,my=/^\[object .+?Constructor\]$/,gy=Function.prototype,py=Object.prototype,yy=gy.toString,xy=py.hasOwnProperty,by=RegExp("^"+yy.call(xy).replace(hy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sy(e){if(!Ft(e)||uy(e))return!1;var t=qi(e)?by:my;return t.test(kn(e))}function Cy(e,t){return e==null?void 0:e[t]}function Dn(e,t){var n=Cy(e,t);return Sy(n)?n:void 0}var di=Dn(Yt,"WeakMap"),gl=Object.create,wy=(function(){function e(){}return function(t){if(!Ft(t))return{};if(gl)return gl(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function jy(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 vy(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Ty=800,Fy=16,Ry=Date.now;function $y(e){var t=0,n=0;return function(){var r=Ry(),s=Fy-(r-n);if(n=r,s>0){if(++t>=Ty)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ey(e){return function(){return e}}var Ds=(function(){try{var e=Dn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Iy=Ds?function(e,t){return Ds(e,"toString",{configurable:!0,enumerable:!1,value:Ey(t),writable:!0})}:_u,My=$y(Iy);function Oy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Ay=9007199254740991,ky=/^(?:0|[1-9]\d*)$/;function zu(e,t){var n=typeof e;return t=t??Ay,!!t&&(n=="number"||n!="symbol"&&ky.test(e))&&e>-1&&e%1==0&&e<t}function Gi(e,t,n){t=="__proto__"&&Ds?Ds(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Lr(e,t){return e===t||e!==e&&t!==t}var Dy=Object.prototype,Py=Dy.hasOwnProperty;function Bu(e,t,n){var r=e[t];(!(Py.call(e,t)&&Lr(r,n))||n===void 0&&!(t in e))&&Gi(e,t,n)}function Ny(e,t,n,r){var s=!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]),s?Gi(n,l,c):Bu(n,l,c)}return n}var pl=Math.max;function Ly(e,t,n){return t=pl(t===void 0?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=pl(r.length-t,0),o=Array(i);++s<i;)o[s]=r[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=r[s];return l[t]=n(o),jy(e,this,l)}}function _y(e,t){return My(Ly(e,t,_u),e+"")}var zy=9007199254740991;function Vu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=zy}function _r(e){return e!=null&&Vu(e.length)&&!qi(e)}function By(e,t,n){if(!Ft(n))return!1;var r=typeof t;return(r=="number"?_r(n)&&zu(t,n.length):r=="string"&&t in n)?Lr(n[t],e):!1}function Vy(e){return _y(function(t,n){var r=-1,s=n.length,i=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(s--,i):void 0,o&&By(n[0],n[1],o)&&(i=s<3?void 0:i,s=1),t=Object(t);++r<s;){var l=n[r];l&&e(t,l,r,i)}return t})}var Hy=Object.prototype;function Js(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Hy;return e===n}function Yy(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Uy="[object Arguments]";function yl(e){return Gt(e)&&sr(e)==Uy}var Hu=Object.prototype,Ky=Hu.hasOwnProperty,Wy=Hu.propertyIsEnumerable,Ps=yl((function(){return arguments})())?yl:function(e){return Gt(e)&&Ky.call(e,"callee")&&!Wy.call(e,"callee")};function qy(){return!1}var Yu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xl=Yu&&typeof module=="object"&&module&&!module.nodeType&&module,Gy=xl&&xl.exports===Yu,bl=Gy?Yt.Buffer:void 0,Zy=bl?bl.isBuffer:void 0,Xn=Zy||qy,Jy="[object Arguments]",Xy="[object Array]",Qy="[object Boolean]",ex="[object Date]",tx="[object Error]",nx="[object Function]",rx="[object Map]",sx="[object Number]",ax="[object Object]",ix="[object RegExp]",ox="[object Set]",lx="[object String]",cx="[object WeakMap]",ux="[object ArrayBuffer]",dx="[object DataView]",fx="[object Float32Array]",hx="[object Float64Array]",mx="[object Int8Array]",gx="[object Int16Array]",px="[object Int32Array]",yx="[object Uint8Array]",xx="[object Uint8ClampedArray]",bx="[object Uint16Array]",Sx="[object Uint32Array]",We={};We[fx]=We[hx]=We[mx]=We[gx]=We[px]=We[yx]=We[xx]=We[bx]=We[Sx]=!0;We[Jy]=We[Xy]=We[ux]=We[Qy]=We[dx]=We[ex]=We[tx]=We[nx]=We[rx]=We[sx]=We[ax]=We[ix]=We[ox]=We[lx]=We[cx]=!1;function Cx(e){return Gt(e)&&Vu(e.length)&&!!We[sr(e)]}function Zi(e){return function(t){return e(t)}}var Uu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fr=Uu&&typeof module=="object"&&module&&!module.nodeType&&module,wx=Fr&&Fr.exports===Uu,Ia=wx&&Nu.process,Qn=(function(){try{var e=Fr&&Fr.require&&Fr.require("util").types;return e||Ia&&Ia.binding&&Ia.binding("util")}catch{}})(),Sl=Qn&&Qn.isTypedArray,Xs=Sl?Zi(Sl):Cx,jx=Object.prototype,vx=jx.hasOwnProperty;function Ku(e,t){var n=pn(e),r=!n&&Ps(e),s=!n&&!r&&Xn(e),i=!n&&!r&&!s&&Xs(e),o=n||r||s||i,l=o?Yy(e.length,String):[],c=l.length;for(var h in e)(t||vx.call(e,h))&&!(o&&(h=="length"||s&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||zu(h,c)))&&l.push(h);return l}function Wu(e,t){return function(n){return e(t(n))}}var Tx=Wu(Object.keys,Object),Fx=Object.prototype,Rx=Fx.hasOwnProperty;function qu(e){if(!Js(e))return Tx(e);var t=[];for(var n in Object(e))Rx.call(e,n)&&n!="constructor"&&t.push(n);return t}function $x(e){return _r(e)?Ku(e):qu(e)}function Ex(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ix=Object.prototype,Mx=Ix.hasOwnProperty;function Ox(e){if(!Ft(e))return Ex(e);var t=Js(e),n=[];for(var r in e)r=="constructor"&&(t||!Mx.call(e,r))||n.push(r);return n}function Gu(e){return _r(e)?Ku(e,!0):Ox(e)}var Ar=Dn(Object,"create");function Ax(){this.__data__=Ar?Ar(null):{},this.size=0}function kx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Dx="__lodash_hash_undefined__",Px=Object.prototype,Nx=Px.hasOwnProperty;function Lx(e){var t=this.__data__;if(Ar){var n=t[e];return n===Dx?void 0:n}return Nx.call(t,e)?t[e]:void 0}var _x=Object.prototype,zx=_x.hasOwnProperty;function Bx(e){var t=this.__data__;return Ar?t[e]!==void 0:zx.call(t,e)}var Vx="__lodash_hash_undefined__";function Hx(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===void 0?Vx:t,this}function Mn(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])}}Mn.prototype.clear=Ax;Mn.prototype.delete=kx;Mn.prototype.get=Lx;Mn.prototype.has=Bx;Mn.prototype.set=Hx;function Yx(){this.__data__=[],this.size=0}function Qs(e,t){for(var n=e.length;n--;)if(Lr(e[n][0],t))return n;return-1}var Ux=Array.prototype,Kx=Ux.splice;function Wx(e){var t=this.__data__,n=Qs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Kx.call(t,n,1),--this.size,!0}function qx(e){var t=this.__data__,n=Qs(t,e);return n<0?void 0:t[n][1]}function Gx(e){return Qs(this.__data__,e)>-1}function Zx(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 Xt(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])}}Xt.prototype.clear=Yx;Xt.prototype.delete=Wx;Xt.prototype.get=qx;Xt.prototype.has=Gx;Xt.prototype.set=Zx;var kr=Dn(Yt,"Map");function Jx(){this.size=0,this.__data__={hash:new Mn,map:new(kr||Xt),string:new Mn}}function Xx(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 Xx(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Qx(e){var t=ea(this,e).delete(e);return this.size-=t?1:0,t}function eb(e){return ea(this,e).get(e)}function tb(e){return ea(this,e).has(e)}function nb(e,t){var n=ea(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,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=Jx;Pn.prototype.delete=Qx;Pn.prototype.get=eb;Pn.prototype.has=tb;Pn.prototype.set=nb;function rb(e,t){for(var n=-1,r=t.length,s=e.length;++n<r;)e[s+n]=t[n];return e}var Zu=Wu(Object.getPrototypeOf,Object),sb="[object Object]",ab=Function.prototype,ib=Object.prototype,Ju=ab.toString,ob=ib.hasOwnProperty,lb=Ju.call(Object);function cb(e){if(!Gt(e)||sr(e)!=sb)return!1;var t=Zu(e);if(t===null)return!0;var n=ob.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ju.call(n)==lb}function ub(){this.__data__=new Xt,this.size=0}function db(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function fb(e){return this.__data__.get(e)}function hb(e){return this.__data__.has(e)}var mb=200;function gb(e,t){var n=this.__data__;if(n instanceof Xt){var r=n.__data__;if(!kr||r.length<mb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(r)}return n.set(e,t),this.size=n.size,this}function _t(e){var t=this.__data__=new Xt(e);this.size=t.size}_t.prototype.clear=ub;_t.prototype.delete=db;_t.prototype.get=fb;_t.prototype.has=hb;_t.prototype.set=gb;var Xu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cl=Xu&&typeof module=="object"&&module&&!module.nodeType&&module,pb=Cl&&Cl.exports===Xu,wl=pb?Yt.Buffer:void 0,jl=wl?wl.allocUnsafe:void 0;function Qu(e,t){if(t)return e.slice();var n=e.length,r=jl?jl(n):new e.constructor(n);return e.copy(r),r}function yb(e,t){for(var n=-1,r=e==null?0:e.length,s=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[s++]=o)}return i}function xb(){return[]}var bb=Object.prototype,Sb=bb.propertyIsEnumerable,vl=Object.getOwnPropertySymbols,Cb=vl?function(e){return e==null?[]:(e=Object(e),yb(vl(e),function(t){return Sb.call(e,t)}))}:xb;function wb(e,t,n){var r=t(e);return pn(e)?r:rb(r,n(e))}function fi(e){return wb(e,$x,Cb)}var hi=Dn(Yt,"DataView"),mi=Dn(Yt,"Promise"),gi=Dn(Yt,"Set"),Tl="[object Map]",jb="[object Object]",Fl="[object Promise]",Rl="[object Set]",$l="[object WeakMap]",El="[object DataView]",vb=kn(hi),Tb=kn(kr),Fb=kn(mi),Rb=kn(gi),$b=kn(di),Tt=sr;(hi&&Tt(new hi(new ArrayBuffer(1)))!=El||kr&&Tt(new kr)!=Tl||mi&&Tt(mi.resolve())!=Fl||gi&&Tt(new gi)!=Rl||di&&Tt(new di)!=$l)&&(Tt=function(e){var t=sr(e),n=t==jb?e.constructor:void 0,r=n?kn(n):"";if(r)switch(r){case vb:return El;case Tb:return Tl;case Fb:return Fl;case Rb:return Rl;case $b:return $l}return t});var Eb=Object.prototype,Ib=Eb.hasOwnProperty;function Mb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Ib.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ns=Yt.Uint8Array;function Ji(e){var t=new e.constructor(e.byteLength);return new Ns(t).set(new Ns(e)),t}function Ob(e,t){var n=Ji(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Ab=/\w*$/;function kb(e){var t=new e.constructor(e.source,Ab.exec(e));return t.lastIndex=e.lastIndex,t}var Il=gn?gn.prototype:void 0,Ml=Il?Il.valueOf:void 0;function Db(e){return Ml?Object(Ml.call(e)):{}}function ed(e,t){var n=t?Ji(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Pb="[object Boolean]",Nb="[object Date]",Lb="[object Map]",_b="[object Number]",zb="[object RegExp]",Bb="[object Set]",Vb="[object String]",Hb="[object Symbol]",Yb="[object ArrayBuffer]",Ub="[object DataView]",Kb="[object Float32Array]",Wb="[object Float64Array]",qb="[object Int8Array]",Gb="[object Int16Array]",Zb="[object Int32Array]",Jb="[object Uint8Array]",Xb="[object Uint8ClampedArray]",Qb="[object Uint16Array]",eS="[object Uint32Array]";function tS(e,t,n){var r=e.constructor;switch(t){case Yb:return Ji(e);case Pb:case Nb:return new r(+e);case Ub:return Ob(e);case Kb:case Wb:case qb:case Gb:case Zb:case Jb:case Xb:case Qb:case eS:return ed(e,n);case Lb:return new r;case _b:case Vb:return new r(e);case zb:return kb(e);case Bb:return new r;case Hb:return Db(e)}}function td(e){return typeof e.constructor=="function"&&!Js(e)?wy(Zu(e)):{}}var nS="[object Map]";function rS(e){return Gt(e)&&Tt(e)==nS}var Ol=Qn&&Qn.isMap,sS=Ol?Zi(Ol):rS,aS="[object Set]";function iS(e){return Gt(e)&&Tt(e)==aS}var Al=Qn&&Qn.isSet,oS=Al?Zi(Al):iS,lS=1,nd="[object Arguments]",cS="[object Array]",uS="[object Boolean]",dS="[object Date]",fS="[object Error]",rd="[object Function]",hS="[object GeneratorFunction]",mS="[object Map]",gS="[object Number]",sd="[object Object]",pS="[object RegExp]",yS="[object Set]",xS="[object String]",bS="[object Symbol]",SS="[object WeakMap]",CS="[object ArrayBuffer]",wS="[object DataView]",jS="[object Float32Array]",vS="[object Float64Array]",TS="[object Int8Array]",FS="[object Int16Array]",RS="[object Int32Array]",$S="[object Uint8Array]",ES="[object Uint8ClampedArray]",IS="[object Uint16Array]",MS="[object Uint32Array]",Ve={};Ve[nd]=Ve[cS]=Ve[CS]=Ve[wS]=Ve[uS]=Ve[dS]=Ve[jS]=Ve[vS]=Ve[TS]=Ve[FS]=Ve[RS]=Ve[mS]=Ve[gS]=Ve[sd]=Ve[pS]=Ve[yS]=Ve[xS]=Ve[bS]=Ve[$S]=Ve[ES]=Ve[IS]=Ve[MS]=!0;Ve[fS]=Ve[rd]=Ve[SS]=!1;function js(e,t,n,r,s,i){var o,l=t&lS;if(o!==void 0)return o;if(!Ft(e))return e;var c=pn(e);if(c)o=Mb(e);else{var h=Tt(e),g=h==rd||h==hS;if(Xn(e))return Qu(e,l);if(h==sd||h==nd||g&&!s)o=g?{}:td(e);else{if(!Ve[h])return s?e:{};o=tS(e,h,l)}}i||(i=new _t);var f=i.get(e);if(f)return f;i.set(e,o),oS(e)?e.forEach(function(S){o.add(js(S,t,n,S,e,i))}):sS(e)&&e.forEach(function(S,y){o.set(y,js(S,t,n,y,e,i))});var m=fi,p=c?void 0:m(e);return Oy(p||e,function(S,y){p&&(y=S,S=e[y]),Bu(o,y,js(S,t,n,y,e,i))}),o}var OS=1,AS=4;function kS(e){return js(e,OS|AS)}var DS="__lodash_hash_undefined__";function PS(e){return this.__data__.set(e,DS),this}function NS(e){return this.__data__.has(e)}function Ls(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Pn;++t<n;)this.add(e[t])}Ls.prototype.add=Ls.prototype.push=PS;Ls.prototype.has=NS;function LS(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 _S(e,t){return e.has(t)}var zS=1,BS=2;function ad(e,t,n,r,s,i){var o=n&zS,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&BS?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 j=o?r(y,S,f,t,e,i):r(S,y,f,e,t,i);if(j!==void 0){if(j)continue;m=!1;break}if(p){if(!LS(t,function(v,x){if(!_S(p,x)&&(S===v||s(S,v,n,r,i)))return p.push(x)})){m=!1;break}}else if(!(S===y||s(S,y,n,r,i))){m=!1;break}}return i.delete(e),i.delete(t),m}function VS(e){var t=-1,n=Array(e.size);return e.forEach(function(r,s){n[++t]=[s,r]}),n}function HS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var YS=1,US=2,KS="[object Boolean]",WS="[object Date]",qS="[object Error]",GS="[object Map]",ZS="[object Number]",JS="[object RegExp]",XS="[object Set]",QS="[object String]",eC="[object Symbol]",tC="[object ArrayBuffer]",nC="[object DataView]",kl=gn?gn.prototype:void 0,Ma=kl?kl.valueOf:void 0;function rC(e,t,n,r,s,i,o){switch(n){case nC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case tC:return!(e.byteLength!=t.byteLength||!i(new Ns(e),new Ns(t)));case KS:case WS:case ZS:return Lr(+e,+t);case qS:return e.name==t.name&&e.message==t.message;case JS:case QS:return e==t+"";case GS:var l=VS;case XS:var c=r&YS;if(l||(l=HS),e.size!=t.size&&!c)return!1;var h=o.get(e);if(h)return h==t;r|=US,o.set(e,t);var g=ad(l(e),l(t),r,s,i,o);return o.delete(e),g;case eC:if(Ma)return Ma.call(e)==Ma.call(t)}return!1}var sC=1,aC=Object.prototype,iC=aC.hasOwnProperty;function oC(e,t,n,r,s,i){var o=n&sC,l=fi(e),c=l.length,h=fi(t),g=h.length;if(c!=g&&!o)return!1;for(var f=c;f--;){var m=l[f];if(!(o?m in t:iC.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 j=o;++f<c;){m=l[f];var v=e[m],x=t[m];if(r)var w=o?r(x,v,m,t,e,i):r(v,x,m,e,t,i);if(!(w===void 0?v===x||s(v,x,n,r,i):w)){y=!1;break}j||(j=m=="constructor")}if(y&&!j){var C=e.constructor,b=t.constructor;C!=b&&"constructor"in e&&"constructor"in t&&!(typeof C=="function"&&C instanceof C&&typeof b=="function"&&b instanceof b)&&(y=!1)}return i.delete(e),i.delete(t),y}var lC=1,Dl="[object Arguments]",Pl="[object Array]",rs="[object Object]",cC=Object.prototype,Nl=cC.hasOwnProperty;function uC(e,t,n,r,s,i){var o=pn(e),l=pn(t),c=o?Pl:Tt(e),h=l?Pl:Tt(t);c=c==Dl?rs:c,h=h==Dl?rs:h;var g=c==rs,f=h==rs,m=c==h;if(m&&Xn(e)){if(!Xn(t))return!1;o=!0,g=!1}if(m&&!g)return i||(i=new _t),o||Xs(e)?ad(e,t,n,r,s,i):rC(e,t,c,n,r,s,i);if(!(n&lC)){var p=g&&Nl.call(e,"__wrapped__"),S=f&&Nl.call(t,"__wrapped__");if(p||S){var y=p?e.value():e,j=S?t.value():t;return i||(i=new _t),s(y,j,n,r,i)}}return m?(i||(i=new _t),oC(e,t,n,r,s,i)):!1}function id(e,t,n,r,s){return e===t?!0:e==null||t==null||!Gt(e)&&!Gt(t)?e!==e&&t!==t:uC(e,t,n,r,id,s)}function dC(e){return function(t,n,r){for(var s=-1,i=Object(t),o=r(t),l=o.length;l--;){var c=o[++s];if(n(i[c],c,i)===!1)break}return t}}var fC=dC();function pi(e,t,n){(n!==void 0&&!Lr(e[t],n)||n===void 0&&!(t in e))&&Gi(e,t,n)}function hC(e){return Gt(e)&&_r(e)}function yi(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function mC(e){return Ny(e,Gu(e))}function gC(e,t,n,r,s,i,o){var l=yi(e,n),c=yi(t,n),h=o.get(c);if(h){pi(e,n,h);return}var g=i?i(l,c,n+"",e,t,o):void 0,f=g===void 0;if(f){var m=pn(c),p=!m&&Xn(c),S=!m&&!p&&Xs(c);g=c,m||p||S?pn(l)?g=l:hC(l)?g=vy(l):p?(f=!1,g=Qu(c,!0)):S?(f=!1,g=ed(c,!0)):g=[]:cb(c)||Ps(c)?(g=l,Ps(l)?g=mC(l):(!Ft(l)||qi(l))&&(g=td(c))):f=!1}f&&(o.set(c,g),s(g,c,r,i,o),o.delete(c)),pi(e,n,g)}function od(e,t,n,r,s){e!==t&&fC(t,function(i,o){if(s||(s=new _t),Ft(i))gC(e,t,o,n,od,r,s);else{var l=r?r(yi(e,o),i,o+"",e,t,s):void 0;l===void 0&&(l=i),pi(e,o,l)}},Gu)}var pC="[object Map]",yC="[object Set]",xC=Object.prototype,bC=xC.hasOwnProperty;function SC(e){if(e==null)return!0;if(_r(e)&&(pn(e)||typeof e=="string"||typeof e.splice=="function"||Xn(e)||Xs(e)||Ps(e)))return!e.length;var t=Tt(e);if(t==pC||t==yC)return!e.size;if(Js(e))return!qu(e).length;for(var n in e)if(bC.call(e,n))return!1;return!0}function Oa(e,t){return id(e,t)}var _s=Vy(function(e,t,n){od(e,t,n)});function CC(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 wC(e){return e.split(".").map(t=>/^\d+$/.test(t)?parseInt(t,10):t)}function jC(e){const t={};for(const n in e){const r=e[n];$t(r)||(t[n]=r)}return t}function vC(e){const t={},n={};for(const r in e){const s=e[r];$t(s)||(r.includes(".")?t[r]=s:n[r]=s)}return{dotPathTransforms:t,objectTransforms:n}}function TC(e,t){for(const n in t){const r=t[n];if(typeof r!="function")continue;const s=wC(n),i=Me(e,s);if(i===void 0)continue;const o=r(i,s.map(String),e);if(typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=s.slice(0,-1),c=l.length>0?Me(e,l):e;if(c&&typeof c=="object"){const h=s[s.length-1];delete c[h],Object.assign(c,o)}}else{let l=e;for(let c=0;c<s.length-1;c++){const h=s[c];if(l[h]===void 0){const g=s[c+1];l[h]=typeof g=="number"?[]:{}}l=l[h]}l[s[s.length-1]]=o}}}function FC(e,t,n){let r=e;for(const s of t){const i=String(s);if(r&&typeof r[i]=="object")r=r[i];else{r=null;break}}if(r&&typeof r[n]=="function")return r[n]}function RC(e){return e.some(t=>!isNaN(Number(t)))}function xi(e,t,n,r,s){if(e!=null&&typeof e=="object"){if(s.has(e))return e;s.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=FC(n,t,c)),f&&typeof f=="function"){const m=f(g,c,e);typeof m=="object"&&m!==null&&!Array.isArray(m)?(t?RC(t):!1)?Object.assign(o,m):r.push(m):o[c]=m}else if(CC(g)&&!$t(g)){const m=n[c];if(m&&typeof m=="object"){const p=xi(g,h,m,r,s);Object.keys(p).length>0&&(o[c]=p)}else{const p=xi(g,h,n,r,s);o[c]=p}}else $t(g)||(o[c]=g)}return o}const $C=(e,t)=>{const n=jC(t);if(Object.keys(n).length<1||typeof window>"u"||typeof e!="object"||$t(e)||e instanceof Blob)return e;let r=kS(e);const{dotPathTransforms:s,objectTransforms:i}=vC(t);TC(r,s);const o=[];Object.keys(i).length>0&&(r=xi(r,void 0,i,o,new Set));for(const l of o)Object.assign(r,l);return r},EC=(e,t,n)=>{const r=d.useRef({});function s(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[s]},{noteOnce:IC}=He,Ll=e=>u.message.warning(e),Ke=e=>Array.isArray(e)?e.join(","):e,Xi=(...e)=>e.flat(1).filter(t=>t!=null).map(t=>typeof t=="number"?t.toString():t);function ld(e,t,n,r,s){const i=new Map;return e.forEach((o,l)=>{const c=(s||0)*10+l,h=t(o,c).toString();if(o&&typeof o=="object"&&n in o){const m=o[n]||[];ld(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 MC(e,t,n){const r=new Map,s=[],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;s.push(h)}}),s}function xr(e,t){var c;const{getRowKey:n,row:r,data:s,childrenColumnName:i="children"}=e,o=(c=Ke(e.key))==null?void 0:c.toString(),l=ld(s,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 MC(l,i,t)}function OC({recordKey:e,onSave:t,row:n,children:r,newLineConfig:s,editorType:i,tableName:o},l){const c=d.useContext(Nr),h=u.Form.useFormInstance(),[g,f]=d.useState(!1),m=xe(async()=>{try{const p=i==="Map",S=Xi(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 C;const x=(C=c==null?void 0:c.getFieldFormatValueObject)==null?void 0:C.call(c,S);return(x!=null?Me(x,S):null)??h.getFieldValue(S)})();if(Array.isArray(e)&&e.length>1){const[,...x]=e,w=Me(y,x);_e(y,x,w)}const j=p?_e({},S,y):y,v=await(t==null?void 0:t(e,Du({},n,j),n,s));return f(!1),v}catch(p){throw f(!1),p}});return d.useImperativeHandle(l,()=>({save:m}),[m]),a.jsxs("a",{onClick:async p=>{p.stopPropagation(),p.preventDefault();try{await m()}catch{}},children:[g?a.jsx(se.LoadingOutlined,{style:{marginInlineEnd:8}}):null,r||"保存"]},"save")}const AC=({recordKey:e,onDelete:t,preEditRowRef:n,preEditRowRefs:r,row:s,children:i,deletePopconfirmMessage:o})=>{const[l,c]=d.useState(!1),h=xe(async()=>{var g,f;try{c(!0);const m=await(t==null?void 0:t(e,s));return c(!1),m===!1?!1:m}catch{return c(!1),null}finally{const m=(g=Ke(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?a.jsx(u.Popconfirm,{title:o||"确定要删除这条记录吗?",onConfirm:h,getPopupContainer:g=>g.parentElement||document.body,children:a.jsxs("a",{children:[l?a.jsx(se.LoadingOutlined,{style:{marginInlineEnd:8}}):null,i||"删除"]})},"delete"):null},kC=e=>{const{recordKey:t,tableName:n,newLineConfig:r,editorType:s,onCancel:i,cancelEditable:o,row:l,cancelText:c,preEditRowRef:h,preEditRowRefs:g}=e,f=d.useContext(Nr),m=u.Form.useFormInstance();return a.jsx("a",{onClick:async p=>{var $,M,I,A;p.stopPropagation(),p.preventDefault();const S=s==="Map",y=($=Ke(t))==null?void 0:$.toString(),j=Xi(n,t),v=(()=>{var k;const Y=(k=f==null?void 0:f.getFieldFormatValueObject)==null?void 0:k.call(f,j);return(Y!=null?Me(Y,j):null)??(m==null?void 0:m.getFieldValue(j))})(),x=S?_e({},j,v):v,w=y!=null?(M=g==null?void 0:g.current)==null?void 0:M.get(y):void 0,C=(()=>{var E,R,z;const Y=(E=r==null?void 0:r.options)==null?void 0:E.recordKey;if(Y==null||t==null)return!1;const H=(R=Ke(Y))==null?void 0:R.toString(),k=(z=Ke(t))==null?void 0:z.toString();return!H||!k?!1:H===k})(),b=await(i==null?void 0:i(t,x,l,r));await o(t);const T=w??(h==null?void 0:h.current)??l;return w===null||w===void 0&&(h==null?void 0:h.current)===null&&C?await((I=e.onDelete)==null?void 0:I.call(e,t,l)):T!=null&&m.setFieldsValue(_e({},j,T)),y&&((A=g==null?void 0:g.current)==null||A.delete(y)),h&&(h.current=null),b},children:c||"取消"},"cancel")};function DC(e,t){const{recordKey:n,newLineConfig:r,saveText:s,deleteText:i}=t,o=d.forwardRef(OC),l=d.createRef();return{save:a.jsx(o,{...t,row:e,ref:l,children:s},"save"+n),saveRef:l,delete:(r==null?void 0:r.options.recordKey)!==n?a.jsx(AC,{...t,row:e,children:i},"delete"+n):void 0,cancel:a.jsx(kC,{...t,row:e},"cancel"+n)}}function PC(e){const t=Fe(),n=d.useRef(null),r=d.useRef(new Map),[s,i]=d.useState(void 0),o=xe(()=>{const N=new Map,D=(L,W)=>{L==null||L.forEach((q,X)=>{const ee=W==null?X.toString():`${W}_${X}`,re=Ke(e.getRowKey(q,-1));if(re==null)return;N.set(ee,re),N.set(re.toString(),ee);const le=e.childrenColumnName&&(q==null?void 0:q[e.childrenColumnName]);le&&D(le,ee)})};return D(e.dataSource),N}),l=d.useMemo(()=>o(),[]),c=d.useRef(l),h=d.useRef(void 0);ku(()=>{c.current=o()},[e.dataSource]),h.current=s;const g=e.type||"single",[f]=EC(e.dataSource,"children",e.getRowKey),[m,p]=Je([],e.editableKeys),S=d.useCallback(N=>{p(D=>{var W;const L=typeof N=="function"?N(D):N;return(W=e==null?void 0:e.onChange)==null||W.call(e,(L==null?void 0:L.filter(q=>q!==void 0))??[],(L==null?void 0:L.map(q=>f(q)).filter(q=>q!==void 0))??[]),L})},[e.onChange,f]),y=Tr(m),j=xe((N,D)=>D.includes(N)),v=xe(N=>{var ee,re;const D=(ee=e.getRowKey(N,N.index))==null?void 0:ee.toString(),L=(re=e.getRowKey(N,-1))==null?void 0:re.toString(),W=(m==null?void 0:m.map(le=>le==null?void 0:le.toString()))||[],q=(y==null?void 0:y.map(le=>le==null?void 0:le.toString()))||[],X=j(L,q)||j(D,q);return{recordKey:L,isEditable:j(L,W)||j(D,W),preIsEditable:X}}),x=xe(()=>m&&m.length>0&&g==="single"&&e.onlyOneLineEditorAlertMessage!==!1?(Ll(e.onlyOneLineEditorAlertMessage||t.getMessage("editableTable.onlyOneLineEditor","只能同时编辑一行")),!1):!0),w=xe(N=>{var D;return((D=e.dataSource)==null?void 0:D.find((L,W)=>e.getRowKey(L,W)===N))??null}),C=xe((N,D)=>{var q;if(!x())return!1;if(!(m==null?void 0:m.some(X=>X===N||(X==null?void 0:X.toString())===(N==null?void 0:N.toString())))){const X=m?[...m,N]:[N];S(X)}n.current=D??w(N)??null;const W=(q=Ke(N))==null?void 0:q.toString();return W&&r.current.set(W,n.current),!0}),b=xe(N=>{const D=Ke(N),L=D!=null?D.toString():null;if(L==null)return;const W=(m==null?void 0:m.filter(q=>(q==null?void 0:q.toString())!==L&&q!==D))??[];S(W)}),T=xe(async(N,D)=>{var re,le,ce,de;const L=Ke(N),W=L!=null?L.toString():null,q=W!=null?c.current.get(W):void 0,X=m==null?void 0:m.some(te=>W==null?!1:(te==null?void 0:te.toString())===W||te===L);if(!X&&q&&(D??!0)&&e.tableName)return await T(q,!1);if(e.onCancel&&X){const te=Array.isArray(N)?N[0]:N,ue=w(te),pe=n.current,be=(re=s==null?void 0:s.options)==null?void 0:re.recordKey,ne=be!=null?Ke(be):null,ae=ne!=null?ne.toString():null,Q=s!=null&&be!=null&&(be===N||ae!=null&&W!=null&&ae===W||(be==null?void 0:be.toString())===(N==null?void 0:N.toString())||String(be)===String(N))?s:void 0;try{await e.onCancel(N,ue||(Q==null?void 0:Q.defaultValue)||{},pe||ue||(Q==null?void 0:Q.defaultValue)||{},Q)}catch(fe){console.error("onCancel error:",fe)}}if(s){const te=s.options.recordKey,ue=te!=null?(le=Ke(te))==null?void 0:le.toString():null;(te===N||ue!=null&&W!=null&&ue===W||(te==null?void 0:te.toString())===(N==null?void 0:N.toString())||String(te)===String(N))&&i(void 0)}const ee=n.current;if(ee&&e.getRowKey(ee,-1)===N&&X){try{const te=(ce=e.formProps)==null?void 0:ce.formRef,ue=(te==null?void 0:te.current)||e.form;if(ue)if(e.tableName){const pe=Xi(e.tableName,N);ue.setFieldsValue(_e({},pe,ee))}else{const pe=(de=Ke(N))==null?void 0:de.toString();if(pe)try{ue.resetFields([[pe]]),ue.setFieldsValue({[pe]:void 0})}catch(be){console.warn("Failed to clear form fields in cancelEditable:",be)}}}catch(te){console.warn("Failed to reset form fields in cancelEditable:",te)}n.current=null}return b(N),!0}),F=Yi(async(...N)=>{var D;(D=e.onValuesChange)==null||D.call(e,...N)},64),$=xe(N=>[e.tableName||"",N].flat(1).filter(D=>D||D===0)),M=xe((N,D)=>{let L=N;return m==null||m.forEach(W=>{if((s==null?void 0:s.options.recordKey)===W)return;const q=W.toString(),X=$(q),ee=Me(D,X);ee&&(L=xr({data:L,getRowKey:e.getRowKey,row:ee,key:q,childrenColumnName:e.childrenColumnName||"children"},"update"))}),L}),I=xe((N,D,L)=>{var le;const W=Object.keys(N||{});if(W.length===0)return(s==null?void 0:s.defaultValue)||{};const q=((le=W.pop())==null?void 0:le.toString())||"";if(!q)return(s==null?void 0:s.defaultValue)||{};const X=$(q),ee={...s==null?void 0:s.defaultValue,...Me(D,X)};return c.current.has(Ke(q))&&L.find((de,te)=>{var pe;return((pe=e.getRowKey(de,te))==null?void 0:pe.toString())===q})||ee}),A=xe((N,D)=>{if(!e.onValuesChange)return;const L=M(e.dataSource,D),W=I(N,D,L);F.run(W,L)}),Y=d.useRef(new Map);d.useEffect(()=>{const N=new Set((m==null?void 0:m.map(D=>D==null?void 0:D.toString()))??[]);Y.current.forEach((D,L)=>{N.has(L==null?void 0:L.toString())||Y.current.delete(L)})},[m]);const H=xe(N=>{const D=Ke(N);return Y.current.get(D)||Y.current.get(D.toString())}),k=xe(async(N,D)=>{const L=Ke(N),W=L.toString(),q=c.current.get(W);if(!(m==null?void 0:m.some(re=>(re==null?void 0:re.toString())===W||re===L))&&q&&(D??!0)&&e.tableName)return await k(q,!1);const ee=H(N);return ee!=null&&ee.current?(await ee.current.save(),b(N),!0):!1}),E=xe(N=>N!=null&&N.parentKey&&!c.current.has(Ke(N==null?void 0:N.parentKey).toString())?(console.warn("can't find record by key",N==null?void 0:N.parentKey),!1):h.current&&e.onlyAddOneLineAlertMessage!==!1?(Ll(e.onlyAddOneLineAlertMessage||t.getMessage("editableTable.onlyAddOneLine","只能新增一行")),!1):!!x()),R=xe(N=>{if(N==null&&N!==0&&N!=="")throw IC(!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")}),z=xe((N,D)=>{var re,le;if(!E(D))return!1;const L=e.getRowKey(N,-1);R(L);const W=(re=Ke(L))==null?void 0:re.toString();if(W&&r.current.set(W,null),!(m==null?void 0:m.some(ce=>ce===L||(ce==null?void 0:ce.toString())===(L==null?void 0:L.toString())))){const ce=m?[...m,L]:[L];S(ce)}const X=typeof(D==null?void 0:D.parentKey)=="function"?D.parentKey():D==null?void 0:D.parentKey;if((D==null?void 0:D.newRecordType)==="dataSource"||e.tableName&&(D==null?void 0:D.newRecordType)!=="cache"){const ce={data:e.dataSource,getRowKey:e.getRowKey,row:{...N,map_row_parentKey:X?(le=Ke(X))==null?void 0:le.toString():void 0},key:L,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(xr(ce,(D==null?void 0:D.position)==="top"?"top":"update"))}else i({defaultValue:N,options:{...D,parentKey:X,recordKey:L}});return!0}),_=(e==null?void 0:e.saveText)||t.getMessage("editableTable.action.save","保存"),V=(e==null?void 0:e.deleteText)||t.getMessage("editableTable.action.delete","删除"),Z=(e==null?void 0:e.cancelText)||t.getMessage("editableTable.action.cancel","取消"),B=xe(async(N,D,L,W)=>{var le,ce,de;const q=await((le=e==null?void 0:e.onSave)==null?void 0:le.call(e,N,D,L,W));if(q===!1)return q;const{options:X}=W||h.current||{};if(!(X!=null&&X.parentKey)&&(X==null?void 0:X.recordKey)===N)(X==null?void 0:X.position)==="top"?e.setDataSource([D,...e.dataSource]):e.setDataSource([...e.dataSource,D]);else{const te={data:e.dataSource,getRowKey:e.getRowKey,row:X?{...D,map_row_parentKey:(ce=Ke((X==null?void 0:X.parentKey)??""))==null?void 0:ce.toString()}:D,key:N,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(xr(te,(X==null?void 0:X.position)==="top"?"top":"update"))}await T(N);const re=(de=Ke(N))==null?void 0:de.toString();return re&&r.current.delete(re),q}),U=xe(async(N,D)=>{var X,ee;const L={data:e.dataSource,getRowKey:e.getRowKey,row:D,key:N,childrenColumnName:e.childrenColumnName||"children"},W=await((X=e==null?void 0:e.onDelete)==null?void 0:X.call(e,N,D));if(W===!1)return!1;await T(N,!1),e.setDataSource(xr(L,"delete"));const q=(ee=Ke(N))==null?void 0:ee.toString();return q&&r.current.delete(q),W}),J=xe(async(N,D,L,W)=>{var X;return await((X=e==null?void 0:e.onCancel)==null?void 0:X.call(e,N,D,L,W))}),G=e.actionRender&&typeof e.actionRender=="function",K=G?e.actionRender:()=>{},O=xe(K);return{editableKeys:m,setEditableRowKeys:S,isEditable:v,actionRender:N=>{const D=e.getRowKey(N,N.index),L={saveText:_,cancelText:Z,deleteText:V,addEditRecord:z,recordKey:D,cancelEditable:T,index:N.index,tableName:e.tableName,newLineConfig:s,onCancel:J,onDelete:U,onSave:B,editableKeys:m,setEditableRowKeys:S,preEditRowRef:n,preEditRowRefs:r,deletePopconfirmMessage:e.deletePopconfirmMessage||`${t.getMessage("deleteThisLine","删除此项")}?`},W=DC(N,L);return e.tableName?Y.current.set(c.current.get(Ke(D))||Ke(D),W.saveRef):Y.current.set(Ke(D),W.saveRef),G?O(N,L,{save:W.save,delete:W.delete,cancel:W.cancel}):[W.save,W.delete,W.cancel]},startEditable:C,cancelEditable:T,addEditRecord:z,saveEditable:k,newLineRecord:s,preEditableKeys:y,onValuesChange:A,getRealIndex:e.getRealIndex}}const NC=new pu("card-loading",{"0%":{backgroundPosition:"0 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),LC=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:NC,animationDuration:"1.4s",animationTimingFunction:"ease",animationIterationCount:"infinite"}}});function _C(e){return Be("ProCardLoading",t=>{const n={...t,componentCls:`.${e}`};return[LC(n)]})}const zC=e=>{const{style:t,prefix:n}=e,{wrapSSR:r}=_C(n||"ant-pro-card");return r(a.jsxs("div",{className:`${n}-loading-content`,style:t,children:[a.jsx(u.Row,{gutter:8,children:a.jsx(u.Col,{span:22,children:a.jsx("div",{className:`${n}-loading-block`})})}),a.jsxs(u.Row,{gutter:8,children:[a.jsx(u.Col,{span:8,children:a.jsx("div",{className:`${n}-loading-block`})}),a.jsx(u.Col,{span:15,children:a.jsx("div",{className:`${n}-loading-block`})})]}),a.jsxs(u.Row,{gutter:8,children:[a.jsx(u.Col,{span:6,children:a.jsx("div",{className:`${n}-loading-block`})}),a.jsx(u.Col,{span:18,children:a.jsx("div",{className:`${n}-loading-block`})})]}),a.jsxs(u.Row,{gutter:8,children:[a.jsx(u.Col,{span:13,children:a.jsx("div",{className:`${n}-loading-block`})}),a.jsx(u.Col,{span:9,children:a.jsx("div",{className:`${n}-loading-block`})})]}),a.jsxs(u.Row,{gutter:8,children:[a.jsx(u.Col,{span:4,children:a.jsx("div",{className:`${n}-loading-block`})}),a.jsx(u.Col,{span:3,children:a.jsx("div",{className:`${n}-loading-block`})}),a.jsx(u.Col,{span:16,children:a.jsx("div",{className:`${n}-loading-block`})})]})]}))},_l=e=>({backgroundColor:e.controlItemBgActive,borderColor:e.controlOutline}),BC=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":{..._l(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":{..._l(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}}}}},cd=24,VC=(e,t)=>{const{componentCls:n}=t;return e===0?{[`${n}-col-0`]:{display:"none"}}:{[`${n}-col-${e}`]:{flexShrink:0,width:`${e/cd*100}%`}}},HC=e=>Array(cd+1).fill(1).map((t,n)=>VC(n,e));function YC(e){return Be("ProCard",t=>{const n={...t,componentCls:`.${e}`};return[BC(n),HC(n)]})}const{useBreakpoint:UC}=u.Grid,ud=d.forwardRef((e,t)=>{var Ge;const{className:n,rootClassName:r,style:s,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:j,cover:v,classNames:x,boxShadow:w=!1,children:C,size:b,actions:T,ghost:F=!1,hoverable:$=!1,direction:M,collapsed:I,collapsible:A=!1,collapsibleIconRender:Y,colStyle:H,defaultCollapsed:k=!1,onCollapse:E,checked:R,onChecked:z,tabs:_,type:V,...Z}=e,B=j??"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(u.ConfigProvider.ConfigContext),G=UC()||{lg:!0,md:!0,sm:!0,xl:!1,xs:!1,xxl:!1},[K,O]=Je(k,I),P=xe(Ce=>{E==null||E(Ce)}),N=d.useCallback(Ce=>{O(Re=>{const dt=typeof Ce=="function"?Ce(Re):Ce;return queueMicrotask(()=>{P(dt)}),dt})},[P]),D=["xxl","xl","lg","md","sm","xs"],L=_==null?void 0:_.items,W=Ce=>{const Re=[0,0];return(Array.isArray(Ce)?Ce:[Ce,0]).forEach((rt,lt)=>{if(typeof rt=="object")for(let Qe=0;Qe<D.length;Qe+=1){const st=D[Qe];if(G[st]&&rt[st]!==void 0){Re[lt]=rt[st];break}}else Re[lt]=rt||0}),Re},q=(Ce,Re)=>Ce?Re:{},X=Ce=>{let Re=Ce;if(typeof Ce=="object")for(let rt=0;rt<D.length;rt+=1){const lt=D[rt];if(G!=null&&G[lt]&&(Ce==null?void 0:Ce[lt])!==void 0){Re=Ce[lt];break}}const dt=q(typeof Re=="string"&&/\d%|\dpx/i.test(Re),{width:Re,flexShrink:0});return{span:Re,colSpanStyle:dt}},ee=J("pro-card"),{wrapSSR:re,hashId:le}=YC(ee),[ce,de]=W(m);let te=!1;const ue=d.Children.toArray(C),pe=ue.map((Ce,Re)=>{var dt;if((dt=Ce==null?void 0:Ce.type)!=null&&dt.isProCard){te=!0;const{colSpan:rt}=Ce.props,{span:lt,colSpanStyle:Qe}=X(rt),st=ie([`${ee}-col`],le,{[`${ee}-split-vertical`]:S==="vertical"&&Re!==ue.length-1,[`${ee}-split-horizontal`]:S==="horizontal"&&Re!==ue.length-1,[`${ee}-col-${lt}`]:typeof lt=="number"&<>=0&<<=24}),Qt=re(a.jsx("div",{style:{...Qe,...q(ce>0,{paddingInlineEnd:ce/2,paddingInlineStart:ce/2}),...q(de>0,{paddingBlockStart:de/2,paddingBlockEnd:de/2}),...H},className:st,children:d.cloneElement(Ce)}));return d.cloneElement(Qt,{key:`pro-card-col-${(Ce==null?void 0:Ce.key)||Re}`})}return Ce}),be=ie(`${ee}`,n,r,le,x==null?void 0:x.root,{[`${ee}-border`]:B==="outlined",[`${ee}-box-shadow`]:w,[`${ee}-contain-card`]:te,[`${ee}-loading`]:f,[`${ee}-split`]:S==="vertical"||S==="horizontal",[`${ee}-ghost`]:F,[`${ee}-hoverable`]:$,[`${ee}-size-${b}`]:b,[`${ee}-type-${V}`]:V,[`${ee}-collapse`]:K,[`${ee}-checked`]:R}),ne=ie(`${ee}-body`,le,x==null?void 0:x.body,{[`${ee}-body-center`]:g==="center",[`${ee}-body-direction-column`]:S==="horizontal"||M==="column",[`${ee}-body-wrap`]:h&&te}),ae=(Ge=U.body)==null?void 0:Ge.padding,Q=d.isValidElement(f)?f:a.jsx(zC,{prefix:ee,style:ae===0||ae==="0px"?{padding:24}:void 0}),fe=d.useCallback(()=>{A==="icon"&&N(Ce=>!Ce)},[A,N]),me=A&&(Y?a.jsx("span",{role:"button",tabIndex:A==="icon"?0:void 0,className:ie(`${ee}-collapsible-icon`,le),onClick:A==="icon"?fe:void 0,onKeyDown:A==="icon"?Ce=>{(Ce.key==="Enter"||Ce.key===" ")&&(Ce.preventDefault(),fe())}:void 0,children:Y({collapsed:K})}):a.jsx(se.RightOutlined,{onClick:fe,rotate:K?void 0:90,className:ie(`${ee}-collapsible-icon`,le)})),ve=ie(`${ee}-header`,le,x==null?void 0:x.header,{[`${ee}-header-border`]:y||V==="inner",[`${ee}-header-collapsible`]:me}),Ee=ie(`${ee}-title`,le,x==null?void 0:x.title),Te=ie(`${ee}-extra`,le,x==null?void 0:x.extra),Ye={...U.root,...s};return re(a.jsxs("div",{className:be,style:Ye,ref:t,onClick:Ce=>{var Re;z==null||z(Ce),(Re=Z==null?void 0:Z.onClick)==null||Re.call(Z,Ce)},...Le(Z,["prefixCls","colSpan"]),children:[(o||c||me)&&a.jsxs("div",{className:ve,style:U.header,onClick:()=>{(A==="header"||A===!0)&&N(!K)},children:[a.jsxs("div",{className:Ee,style:U.title,children:[me,a.jsx(Jn,{label:o,tooltip:p,subTitle:l})]}),c&&a.jsx("div",{className:Te,style:U.extra,onClick:Ce=>Ce.stopPropagation(),children:c})]}),v&&!K&&a.jsx("div",{className:ie(`${ee}-cover`,le,x==null?void 0:x.cover),style:U.cover,children:v}),_?a.jsx("div",{className:ie(`${ee}-tabs`,le),children:a.jsx(u.Tabs,{onChange:_.onChange,...Le(_,["cardProps"]),items:L,children:f?Q:C})}):a.jsx("div",{className:ne,style:U.body,children:f?Q:pe}),T?a.jsx(Xg,{actions:T,prefixCls:ee}):null]}))});function KC(e){return Be("ProCardDivider",()=>({}))}const WC=e=>{const{getPrefixCls:t}=d.useContext(u.ConfigProvider.ConfigContext),r=`${t("pro-card")}-divider`,{wrapSSR:s,hashId:i}=KC(),{className:o,style:l={},orientation:c="vertical"}=e,h=ie(r,o,i,{[`${r}-${c}`]:c});return s(a.jsx("div",{className:h,style:l}))},qC=e=>{const{styles:t,...n}=e;return a.jsx(ud,{...n,styles:{...t,body:{...t==null?void 0:t.body,padding:0}}})},ta=ud;ta.isProCard=!0;ta.Divider=WC;ta.Group=qC;var vs={exports:{}},GC=vs.exports,zl;function ZC(){return zl||(zl=1,(function(e,t){(function(n,r){e.exports=r()})(GC,(function(){return function(n,r){var s=r.prototype,i=s.format;s.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 JC=ZC();const dd=Bt(JC);var Ts={exports:{}},XC=Ts.exports,Bl;function QC(){return Bl||(Bl=1,(function(e,t){(function(n,r){e.exports=r()})(XC,(function(){var n="day";return function(r,s,i){var o=function(h){return h.add(4-h.isoWeekday(),n)},l=s.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 ew=QC();const fd=Bt(ew);var Fs={exports:{}},tw=Fs.exports,Vl;function nw(){return Vl||(Vl=1,(function(e,t){(function(n,r){e.exports=r()})(tw,(function(){return function(n,r,s){var i=r.prototype,o=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,m,p,S,y){var j=f.name?f:f.$locale(),v=o(j[m]),x=o(j[p]),w=v||x.map((function(b){return b.slice(0,S)}));if(!y)return w;var C=j.weekStart;return w.map((function(b,T){return w[(T+(C||0))%7]}))},c=function(){return s.Ls[s.locale()]},h=function(f,m){return f.formats[m]||(function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,y,j){return y||j.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)()},s.localeData=function(){var f=c();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(m){return h(f,m)},meridiem:f.meridiem,ordinal:f.ordinal}},s.months=function(){return l(c(),"months")},s.monthsShort=function(){return l(c(),"monthsShort","months",3)},s.weekdays=function(f){return l(c(),"weekdays",null,null,f)},s.weekdaysShort=function(f){return l(c(),"weekdaysShort","weekdays",3,f)},s.weekdaysMin=function(f){return l(c(),"weekdaysMin","weekdays",2,f)}}}))})(Fs)),Fs.exports}var rw=nw();const hd=Bt(rw);var Rs={exports:{}},sw=Rs.exports,Hl;function aw(){return Hl||(Hl=1,(function(e,t){(function(n,r){e.exports=r()})(sw,(function(){return function(n,r){r.prototype.weekday=function(s){var i=this.$locale().weekStart||0,o=this.$W,l=(o<i?o+7:o)-i;return this.$utils().u(s)?l:this.subtract(l,"day").add(s,"day")}}}))})(Rs)),Rs.exports}var iw=aw();const md=Bt(iw);var $s={exports:{}},ow=$s.exports,Yl;function lw(){return Yl||(Yl=1,(function(e,t){(function(n,r){e.exports=r()})(ow,(function(){var n="week",r="year";return function(s,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)}}}))})($s)),$s.exports}var cw=lw();const Qi=Bt(cw),Ul=(e,t)=>typeof t!="object"?e[t]||t:e[t==null?void 0:t.value]||t.label,uw=(e,t)=>{const{label:n,prefixCls:r,onChange:s,value:i,mode:o,defaultValue:l,labelVariant:c,size:h,showSearch:g,disabled:f,style:m,className:p,options:S,onSearch:y,allowClear:j,labelInValue:v,fieldNames:x,lightLabel:w,labelTrigger:C,optionFilterProp:b,optionLabelProp:T="",valueMaxLength:F=41,fetchDataOnSearch:$=!1,fetchData:M,variant:I="outlined",...A}=e,{placeholder:Y=n}=e,{label:H="label",value:k="value"}=x||{},{getPrefixCls:E}=d.useContext(u.ConfigProvider.ConfigContext),R=E("pro-field-select-light-select"),[z,_]=d.useState(!1),[V,Z]=d.useState(""),{wrapSSR:B,hashId:U}=Be("LightSelect",O=>({[`.${R}`]:{[`${O.antCls}-select`]:{position:"absolute",width:"153px",height:"28px",visibility:"hidden",opacity:0,"&-selector":{height:28}},[`&.${R}-searchable`]:{[`${O.antCls}-select`]:{width:"200px","&-selector":{height:28}}}}})),J=d.useMemo(()=>{const O={};return S==null||S.forEach(P=>{const N=P[T]||P[H],D=P[k];O[D]=N||D}),O},[H,S,k,T]),G=d.useMemo(()=>Reflect.has(A,"open")?A==null?void 0:A.open:z,[z,A]),K=Array.isArray(i)?i.map(O=>Ul(J,O)):Ul(J,i);return B(a.jsxs("div",{className:ie(R,U,{[`${R}-searchable`]:g},`${R}-container-${A.placement||"bottomLeft"}`,p),style:m,onClick:O=>{var N,D,L;if(f)return;((L=(D=(N=w==null?void 0:w.current)==null?void 0:N.labelRef)==null?void 0:D.current)==null?void 0:L.contains(O.target))||_(!0)},children:[a.jsx(u.Select,{...A,allowClear:j,value:i,mode:o,labelInValue:v,size:h,disabled:f,variant:I,onChange:(O,P)=>{s==null||s(O,P),o!=="multiple"&&_(!1)},showSearch:g,onSearch:g?O=>{$&&M&&M(O),y==null||y(O)}:void 0,style:m,popupRender:O=>a.jsxs("div",{ref:t,children:[g&&a.jsx("div",{style:{margin:"4px 8px"},children:a.jsx(u.Input,{value:V,allowClear:!!j,onChange:P=>{Z(P.target.value),$&&M&&M(P.target.value),y==null||y(P.target.value)},onKeyDown:P=>{if(P.key==="Backspace"){P.stopPropagation();return}(P.key==="ArrowUp"||P.key==="ArrowDown")&&P.preventDefault()},style:{width:"100%"},prefix:a.jsx(se.SearchOutlined,{})})}),O]}),open:G,onOpenChange:O=>{var P;O||Z(""),C||_(O),(P=A==null?void 0:A.onOpenChange)==null||P.call(A,O)},prefixCls:r,options:y||!V?S:S==null?void 0:S.filter(O=>{var P,N,D,L,W;return b?mn(O[b]).join("").toLowerCase().includes(V):((N=(P=String(O[H]))==null?void 0:P.toLowerCase())==null?void 0:N.includes(V==null?void 0:V.toLowerCase()))||((W=(L=(D=O[k])==null?void 0:D.toString())==null?void 0:L.toLowerCase())==null?void 0:W.includes(V==null?void 0:V.toLowerCase()))})}),a.jsx(Ht,{ellipsis:!0,label:n,placeholder:Y,disabled:f,variant:c,allowClear:!!j,value:K||(i==null?void 0:i.label)||i,onClear:()=>{s==null||s(void 0,void 0)},onClick:()=>{f||_(!z)},ref:w,valueMaxLength:F})]}))},dw=d.forwardRef(uw),fw=(e,t)=>{const{optionItemRender:n,mode:r,onSearch:s,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:j,resetData:v,prefixCls:x,onClear:w,searchValue:C,showSearch:b,fieldNames:T,defaultSearchValue:F,preserveOriginalLabel:$=!1,...M}=e,{label:I="label",value:A="value",options:Y="options"}=T||{},[H,k]=Je(F,C),E=d.useRef();d.useImperativeHandle(t,()=>E.current),d.useEffect(()=>{var U;M.autoFocus&&((U=E==null?void 0:E.current)==null||U.focus())},[M.autoFocus]);const{getPrefixCls:R}=d.useContext(u.ConfigProvider.ConfigContext),z=R("pro-filed-search-select",x),_=ie(z,p,{[`${z}-disabled`]:S}),V=(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,K)=>{const O=J==null?void 0:J[K],P=O==null?void 0:O["data-item"],N=V(P,G);return{...P||{},...G,label:N||G.label}}):[],B=U=>U.map((J,G)=>{const{className:K,optionType:O,...P}=J,N=J[I]??J.text,D=J[A],L=J[Y]??[];return O==="optGroup"||J.options?{label:N,...P,data_title:N,title:N,key:D??`${N==null?void 0:N.toString()}-${G}-${Or()}`,children:B(L)}:{title:N,...P,data_title:N,value:D??G,key:D??`${N==null?void 0:N.toString()}-${G}-${Or()}`,"data-item":J,className:`${z}-option ${K||""}`.trim(),label:(n==null?void 0:n(J))||N}});return a.jsx(u.Select,{ref:E,className:_,allowClear:!0,autoClearSearchValue:l,disabled:S,mode:r,showSearch:b,searchValue:H,optionFilterProp:f,optionLabelProp:m,onClear:()=>{w==null||w(),j(void 0),b&&(s==null||s(""),k(""))},...M,filterOption:M.filterOption==!1?!1:(U,J)=>{var K,O;const G=H===""?"":U||H;return G?M.filterOption&&typeof M.filterOption=="function"?M.filterOption(G,{...J,label:J==null?void 0:J.data_title}):!!((K=J==null?void 0:J.data_title)!=null&&K.toString().toLowerCase().includes(G.toLowerCase())||(O=J==null?void 0:J[f])!=null&&O.toString().toLowerCase().includes(G.toLowerCase())):!0},onSearch:b?U=>{g&&j(U),s==null||s(U),k(U)}:void 0,onChange:(U,J,...G)=>{if(b&&l&&(j(void 0),s==null||s(""),k("")),!e.labelInValue){o==null||o(U,J,...G);return}if(r!=="multiple"&&!Array.isArray(J)){let P=J&&J["data-item"];if(!P&&U&&y){const N=U[A]??U.value,D=L=>{for(const W of L){if((W[A]??W.value)===N)return W;if(W[Y]||W.options){const X=D(W[Y]||W.options||[]);if(X)return X}}return null};P=D(y)}if(!U||!P){const N=V(P,U),D=U&&{...U,label:N};o==null||o(D,J,...G)}else{const N=V(P,U);o==null||o({...U,...P,label:N},J,...G)}return}const K=Z(U,J);o==null||o(K,J,...G),h&&v()},onFocus:U=>{c&&(j(void 0),b&&(s==null||s(""),k(""))),i==null||i(U)},options:B(y||[])})},hw=d.forwardRef(fw),mw=({label:e,words:t})=>{const{getPrefixCls:n}=d.useContext(u.ConfigProvider.ConfigContext),r=n("pro-select-item-option-content-light"),s=n("pro-select-item-option-content"),{wrapSSR:i}=Be("Highlight",h=>({[`.${r}`]:{color:h.colorPrimary},[`.${s}`]:{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:s},...c))};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 gd=e=>{const t=[],n=Jt(e);return n.forEach((r,s)=>{const i=n.get(s)||n.get(`${s}`);if(i){if(typeof i=="object"&&(i!=null&&i.text)){t.push({text:i==null?void 0:i.text,value:s,label:i==null?void 0:i.text,disabled:i.disabled});return}t.push({text:i,value:s})}}),t},ar=e=>{var j,v;const{cacheForSwr:t,fieldProps:n}=e,[r,s]=d.useState(e.defaultKeyWords),[i]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():e.request?Or():"no-fetch"),o=d.useRef(i),l=xe(x=>gd(Jt(x)).map(({value:w,text:C,...b})=>({label:C,value:w,key:w,...b}))),c=ct(()=>{if(!n)return;const x=(n==null?void 0:n.options)||(n==null?void 0:n.treeData);if(!x)return;const{children:w,label:C,value:b}=n.fieldNames||{},T=(F,$)=>{if(!(F!=null&&F.length))return;const M=F.length;let I=0;for(;I<M;){const A=F[I++];(A[w]||A[C]||A[b])&&(A[$]=A[$==="children"?w:$==="label"?C:b],T(A[w],$))}};return w&&T(x,"children"),C&&T(x,"label"),b&&T(x,"value"),x},[n]),[h,g]=Je(()=>e.valueEnum?l(e.valueEnum):[],c);Kn(()=>{var x,w;!e.valueEnum||(x=e.fieldProps)!=null&&x.options||(w=e.fieldProps)!=null&&w.treeData||g(l(e.valueEnum))},[e.valueEnum]);const f=Fp([o.current,e.params,r],e.debounceTime??((j=e==null?void 0:e.fieldProps)==null?void 0:j.debounceTime)??0,[e.params,r]),{data:m,mutate:p,isValidating:S}=Eu(()=>e.request?f:null,([,x,w])=>e.request({...x,keyWords:w},e),{revalidateIfStale:!t,revalidateOnReconnect:t,shouldRetryOnError:!1,revalidateOnFocus:!1}),y=d.useMemo(()=>{var w,C;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(F=>bi(F,r));return{...b,children:T,options:T}}return b});return((w=e.fieldProps)==null?void 0:w.filterOption)===!0||((C=e.fieldProps)==null?void 0:C.filterOption)===void 0?x==null?void 0:x.filter(b=>b?r?bi(b,r):!0:!1):x},[h,r,(v=e.fieldProps)==null?void 0:v.filterOption]);return[S,e.request?m:y,x=>{s(x)},()=>{s(void 0),p([],!1)}]},gw=(e,t)=>{var A,Y;const{mode:n,valueEnum:r,render:s,formItemRender:i,request:o,fieldProps:l,light:c,proFieldKey:h,params:g,label:f,variant:m,id:p,lightLabel:S,labelTrigger:y,...j}=e,v=d.useRef(),x=Fe(),w=d.useRef(""),{fieldNames:C}=l;d.useEffect(()=>{w.current=l==null?void 0:l.searchValue},[l==null?void 0:l.searchValue]);const[b,T,F,$]=ar(e),{componentSize:M}=((Y=(A=u.ConfigProvider)==null?void 0:A.useConfig)==null?void 0:Y.call(A))||{componentSize:"middle"};d.useImperativeHandle(t,()=>({...v.current||{},fetchData:H=>F(H)}),[F]);const I=d.useMemo(()=>{if(n!=="read")return;const{label:H="label",value:k="value",options:E="options"}=C||{},R=new Map,z=_=>{if(!(_!=null&&_.length))return R;const V=_.length;let Z=0;for(;Z<V;){const B=_[Z++];R.set(B[k],B[H]),z(B[E])}return R};return z(T)},[C,n,T]);if(n==="read"){const H=a.jsx(a.Fragment,{children:An(j.text,Jt(r||I))});return s?s(H,{mode:n,...l},H)??null:H}if(n==="edit"||n==="update"){const k=c?a.jsx(dw,{id:p,loading:b,ref:v,allowClear:!0,size:M,options:T,label:f,labelVariant:m,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),lightLabel:S,labelTrigger:y,fetchData:F,...l}):a.jsx(hw,{className:j.className,style:{minWidth:100,...j.style},id:p,loading:b,ref:v,allowClear:!0,defaultSearchValue:e.defaultKeyWords,notFoundContent:b?a.jsx(u.Spin,{size:"small"}):l==null?void 0:l.notFoundContent,fetchData:E=>{w.current=E??"",F(E),E===void 0&&(w.current="")},resetData:$,optionItemRender:E=>typeof E.label=="string"&&w.current?a.jsx(mw,{label:E.label,words:[w.current]}):E.label,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),label:f,...l,options:T},"SearchSelect");return i?i(j.text,{mode:n,...l,options:T,loading:b},k)??null:k}return null},ss=d.forwardRef(gw),pw=({placeholder:e,formItemRender:t,mode:n,render:r,label:s,light:i,variant:o,...l},c)=>{var w;const{getPrefixCls:h}=d.useContext(u.ConfigProvider.ConfigContext),g=h("pro-field-cascader"),[f,m,p]=ar(l),S=Fe(),y=d.useRef(),[j,v]=d.useState(!1);d.useImperativeHandle(c,()=>({...y.current||{},fetchData:C=>p(C)}),[p]);const x=d.useMemo(()=>{var M;if(n!=="read")return;const{value:C="value",label:b="label",children:T="children"}=((M=l.fieldProps)==null?void 0:M.fieldNames)||{},F=new Map,$=I=>{if(!(I!=null&&I.length))return F;const A=I.length;let Y=0;for(;Y<A;){const H=I[Y++];F.set(H[C],H[b]),$(H[T])}return F};return $(m)},[n,m,(w=l.fieldProps)==null?void 0:w.fieldNames]);if(n==="read"){const C=a.jsx(a.Fragment,{children:An(l.text,Jt(l.valueEnum||x))});return r?r(l.text,{mode:n,...l.fieldProps},C)??null:C}if(n==="edit"){const C=l.fieldProps||{};let b=a.jsx(u.Cascader,{ref:y,open:j,suffixIcon:f?a.jsx(se.LoadingOutlined,{}):void 0,placeholder:e||S.getMessage("tableForm.selectPlaceholder","请选择"),allowClear:(C==null?void 0:C.allowClear)!==!1,...C,onOpenChange:T=>{var F;(F=C==null?void 0:C.onOpenChange)==null||F.call(C,T),v(T)},className:ie(C==null?void 0:C.className,g),options:m});if(t&&(b=t(l.text,{mode:n,...C,options:m,loading:f},b)??null),i){const{disabled:T,value:F}=C,$=!!F&&(F==null?void 0:F.length)!==0;return a.jsx(Ht,{label:s,disabled:T,variant:o,value:$||j?b:null,style:$?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:$||j?!1:void 0,onClick:()=>{var M;v(!0),(M=C==null?void 0:C.onOpenChange)==null||M.call(C,!0)}})}return b}return null},Kl=d.forwardRef(pw),yw=({layout:e="horizontal",formItemRender:t,mode:n,render:r,...s},i)=>{var j,v,x,w,C;const{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-field-checkbox"),c=(v=(j=u.Form.Item)==null?void 0:j.useStatus)==null?void 0:v.call(j),[h,g,f]=ar(s),{wrapSSR:m,hashId:p}=Be("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}=(w=(x=u.theme).useToken)==null?void 0:w.call(x),y=d.useRef();if(d.useImperativeHandle(i,()=>({...y.current||{},fetchData:b=>f(b)}),[f]),h)return a.jsx(u.Spin,{size:"small"});if(n==="read"){const b=g!=null&&g.length?g==null?void 0:g.reduce((F,$)=>({...F,[$.value??""]:$.label}),{}):void 0,T=An(s.text,Jt(s.valueEnum||b));return r?r(s.text,{mode:n,...s.fieldProps},a.jsx(a.Fragment,{children:T}))??null:a.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:S.marginSM},children:T})}if(n==="edit"){const{fieldNames:b,variant:T,...F}=s.fieldProps||{},$=m(a.jsx(u.Checkbox.Group,{...F,variant:T,className:ie((C=s.fieldProps)==null?void 0:C.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(s.text,{mode:n,...s.fieldProps,options:g,loading:h},$)??null:$}return null},Wl=d.forwardRef(yw),xw=(e,t)=>{if(typeof e!="string")return e;try{if(t==="json")return JSON.stringify(JSON.parse(e),null,2)}catch{}return e},bw=({text:e,mode:t,render:n,language:r="text",formItemRender:s,fieldProps:i},o)=>{const l=xw(e,r),{token:c}=fn.useToken();if(t==="read"){const h=a.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:a.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=a.jsx(u.Input.TextArea,{rows:5,...i,ref:o});return s?s(l,{mode:t,...i,ref:o},h)??null:h}return null},as=d.forwardRef(bw),Sw={label:"Recommended",colors:["#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB","#722ED1","#EB2F96","#F5222D4D","#FA8C164D","#FADB144D","#8BBB114D","#52C41A4D","#13A8A84D","#1677FF4D","#2F54EB4D","#722ED14D","#EB2F964D"]},Cw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s},i)=>{const{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-field-color-picker");if(t==="read"){const c=a.jsx(u.ColorPicker,{value:e,className:ie({[l]:!0}),open:!1});return n?n(e,{mode:t,...s},c):c}if(t==="edit"||t==="update"){const c={display:"table-cell",...s.style},h=a.jsx(u.ColorPicker,{ref:i,presets:[Sw],...s,style:c,className:ie({[l]:!0})});return r?r(e,{mode:t,...s,style:c},h):h}return null},ql=d.forwardRef(Cw);Se.extend(Qi);const ww=(e,t)=>e?typeof t=="function"?t(Se(e)):Se(e).format((Array.isArray(t)?t[0]:t)||"YYYY-MM-DD"):"-",jw=({text:e,mode:t,format:n="YYYY-MM-DD",label:r,light:s,render:i,formItemRender:o,showTime:l,fieldProps:c,picker:h,lightLabel:g,variant:f},m)=>{const p=Fe(),[S,y]=d.useState(!1);if(t==="read"){const j=ww(e,c.format||n);return i?i(e,{mode:t,...c},a.jsx(a.Fragment,{children:j})):a.jsx(a.Fragment,{children:j})}if(t==="edit"||t==="update"){let j;const{disabled:v,value:x,placeholder:w=p.getMessage("tableForm.selectPlaceholder","请选择")}=c,C=rr(x);return s?j=a.jsx(Ht,{label:r,onClick:()=>{var b;(b=c==null?void 0:c.onOpenChange)==null||b.call(c,!0),y(!0)},style:C?{paddingInlineEnd:0}:void 0,disabled:v,value:C||S?a.jsx(u.DatePicker,{picker:h,showTime:l,format:n,ref:m,...c,value:C,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:C||S?!1:void 0,variant:f,ref:g}):j=a.jsx(u.DatePicker,{picker:h,showTime:l,format:n,placeholder:w,variant:f,ref:m,...c,value:C}),o?o(e,{mode:t,...c},j):j}return null},jt=d.forwardRef(jw);function vw(e){return $t(e)||e===""||(e==null?void 0:e.trim())===""}const Tw=({text:e,mode:t,render:n,placeholder:r,formItemRender:s,fieldProps:i},o)=>{var g;const l=Fe(),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"&&!$t(m)&&!$t(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?a.jsx("span",{children:e}):a.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=a.jsx(u.InputNumber,{ref:o,min:0,placeholder:c,...Le(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,j,v;const p=m.target.value;if(vw(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(),(j=i==null?void 0:i.onChange)==null||j.call(i,S)),(v=i==null?void 0:i.onBlur)==null||v.call(i,m)}});return s?s(e,{mode:t,...i},f):f}return null},zs=d.forwardRef(Tw),Fw=({text:e,mode:t,render:n,placeholder:r,formItemRender:s,fieldProps:i,separator:o="~",separatorWidth:l=30},c)=>{const{value:h,defaultValue:g,onChange:f,id:m}=i,p=Fe(),{token:S}=fn.useToken(),[y,j]=Je(()=>g,h),v=d.useCallback(w=>{j(C=>{const b=typeof w=="function"?w(C):w;return f==null||f(b),b})},[f]),x=d.useRef(y);if(t==="read"){const w=b=>{var F;const T=new Intl.NumberFormat(void 0,{minimumSignificantDigits:2,...(i==null?void 0:i.intlProps)||{}}).format(Number(b));return((F=i==null?void 0:i.formatter)==null?void 0:F.call(i,T))||T},C=a.jsxs("span",{ref:c,children:[w(e[0])," ",o," ",w(e[1])]});return n?n(e,{mode:t,...i},C):C}if(t==="edit"||t==="update"){const w=()=>{if(Array.isArray(x.current)){const[$,M]=x.current;if(typeof $=="number"&&typeof M=="number"&&$>M){v([M,$]);return}$===void 0&&M===void 0&&v(void 0)}},C=($,M)=>{const I=[...y||[]];I[$]=M===null?void 0:M,x.current=I,v(I)},b=(i==null?void 0:i.placeholder)||r||[p.getMessage("tableForm.inputPlaceholder","请输入"),p.getMessage("tableForm.inputPlaceholder","请输入")],T=$=>Array.isArray(b)?b[$]:b,F=a.jsxs(u.Space.Compact,{block:!0,onBlur:w,children:[a.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:$=>C(0,$)}),a.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}),a.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:$=>C(1,$)})]});return s?s(e,{mode:t,...i},F):F}return null},Gl=d.forwardRef(Fw);var Es={exports:{}},Rw=Es.exports,Zl;function $w(){return Zl||(Zl=1,(function(e,t){(function(n,r){e.exports=r()})(Rw,(function(){return function(n,r,s){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)}s.en.relativeTime=o,i.fromToBase=function(h,g,f,m,p){for(var S,y,j,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"}],w=x.length,C=0;C<w;C+=1){var b=x[C];b.d&&(S=m?s(h).diff(f,b.d,!0):f.diff(h,b.d,!0));var T=(n.rounding||Math.round)(Math.abs(S));if(j=S>0,T<=b.r||!b.r){T<=1&&C>0&&(b=x[C-1]);var F=v[b.l];p&&(T=p(""+T)),y=typeof F=="string"?F.replace("%d",T):F(T,g,b.l,j);break}}if(g)return y;var $=j?v.future:v.past;return typeof $=="function"?$(y):$.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?s.utc():s()};i.toNow=function(h){return this.to(c(this),h)},i.fromNow=function(h){return this.from(c(this),h)}}}))})(Es)),Es.exports}var Ew=$w();const Iw=Bt(Ew);Se.extend(Iw);const Mw=({text:e,mode:t,variant:n,render:r,formItemRender:s,format:i,fieldProps:o},l)=>{const c=Fe();if(t==="read"){const h=a.jsx(u.Tooltip,{title:Se(e).format((o==null?void 0:o.format)||i||"YYYY-MM-DD HH:mm:ss"),children:Se(e).fromNow()});return r?r(e,{mode:t,...o},a.jsx(a.Fragment,{children:h})):a.jsx(a.Fragment,{children:h})}if(t==="edit"||t==="update"){const h=c.getMessage("tableForm.selectPlaceholder","请选择"),g=rr(o.value),f=a.jsx(u.DatePicker,{ref:l,placeholder:h,showTime:!0,variant:n??(o==null?void 0:o.variant)??"outlined",...o,value:g});return s?s(e,{mode:t,...o},f):f}return null},Jl=d.forwardRef(Mw),Xl=d.forwardRef(({text:e,mode:t,render:n,formItemRender:r,fieldProps:s,placeholder:i,width:o},l)=>{const c=Fe(),h=i||c.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const g=a.jsx(u.Image,{ref:l,width:o||32,src:e,...s});return n?n(e,{mode:t,...s},g):g}if(t==="edit"||t==="update"){const g=a.jsx(u.Input,{ref:l,placeholder:h,...s});return r?r(e,{mode:t,...s},g):g}return null}),Ow=({border:e=!1,children:t},n)=>{const{getPrefixCls:r}=d.useContext(u.ConfigProvider.ConfigContext),s=r("pro-field-index-column"),{wrapSSR:i,hashId:o}=Be("IndexColumn",()=>({[`.${s}`]:{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(a.jsx("div",{ref:n,className:ie(s,o,{[`${s}-border`]:e,"top-three":t>3}),children:t}))},is=d.forwardRef(Ow),pd=new Intl.NumberFormat("zh-Hans-CN",{currency:"CNY",style:"currency"}),Aw={style:"currency",currency:"USD"},kw={style:"currency",currency:"RUB"},Dw={style:"currency",currency:"RSD"},Pw={style:"currency",currency:"MYR"},Nw={style:"currency",currency:"BRL"},Lw={default:pd,"zh-Hans-CN":{currency:"CNY",style:"currency"},"en-US":Aw,"ru-RU":kw,"ms-MY":Pw,"sr-RS":Dw,"pt-BR":Nw},Ql=(e,t,n,r,s="")=>{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",{...Lw[e||"zh-Hans-CN"]||pd,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)?`${s||""}${f}${g}`:`${s||""}${g}`}catch{return i}},Aa=2,_w=d.forwardRef(({contentRender:e,numberFormatOptions:t,numberPopoverRender:n,open:r,onOpenChange:s,...i},o)=>{const[l,c]=Je(()=>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(j=>{var x;const v=typeof y=="function"?y(j):y;return(x=i.onChange)==null||x.call(i,v),v})},[i.onChange,c]),p=d.useCallback(y=>{s==null||s(y),r===void 0&&queueMicrotask(()=>{f.current&&g(y)})},[r,s]),S=e==null?void 0:e({...i,value:l});return S?a.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:a.jsx(u.InputNumber,{ref:o,...i,value:l,onChange:m})}):a.jsx(u.InputNumber,{ref:o,...i,value:l,onChange:m})}),zw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s,proFieldKey:i,valueEnum:o,placeholder:l,locale:c,customSymbol:h=s.customSymbol,numberFormatOptions:g=s==null?void 0:s.numberFormatOptions,numberPopoverRender:f=(s==null?void 0:s.numberPopoverRender)||!1,...m},p)=>{const S=(s==null?void 0:s.precision)??Aa;let y=Fe();c&&En[c]&&(y=En[c]);const j=l||y.getMessage("tableForm.inputPlaceholder","请输入"),v=d.useMemo(()=>{if(h)return h;if(!(m.moneySymbol===!1||s.moneySymbol===!1))return y.getMessage("moneySymbol","¥")},[h,s.moneySymbol,y,m.moneySymbol]),x=d.useCallback(w=>{const C=new RegExp(`\\B(?=(\\d{${3+Math.max(S-Aa,0)}})+(?!\\d))`,"g"),[b,T]=String(w).split("."),F=b.replace(C,",");let $="";return T&&S>0&&($=`.${T.slice(0,S===void 0?Aa:S)}`),`${F}${$}`},[S]);if(t==="read"){const w=a.jsx("span",{ref:p,children:Ql(c||!1,e,S,g??s.numberFormatOptions,v)});return n?n(e,{mode:t,...s},w):w}if(t==="edit"||t==="update"){const w=a.jsx(_w,{contentRender:C=>{if(f===!1||!C.value)return null;const b=Ql(v||c||!1,`${x(C.value)}`,S,{...g,notation:"compact"},v);return typeof f=="function"?f==null?void 0:f(C,b):b},ref:p,precision:S,formatter:C=>C&&v?`${v} ${x(C)}`:(C==null?void 0:C.toString())||C,parser:C=>v&&C?C.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),""):C,placeholder:j,...Le(s,["numberFormatOptions","precision","numberPopoverRender","customSymbol","moneySymbol","visible","open"]),onBlur:s.onBlur?C=>{var T;let b=C.target.value;v&&b&&(b=b.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),"")),(T=s.onBlur)==null||T.call(s,b)}:void 0});return r?r(e,{mode:t,...s},w):w}return null},ec=d.forwardRef(zw),tc=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}}):a.jsx(d.Fragment,{children:t},n)}),Bw=({text:e,mode:t,render:n,fieldProps:r},s)=>{const{getPrefixCls:i}=d.useContext(u.ConfigProvider.ConfigContext),o=i("pro-field-option"),{token:l}=fn.useToken();if(d.useImperativeHandle(s,()=>({})),n){const c=n(e,{mode:t,...r},a.jsx(a.Fragment,{}));return!c||(c==null?void 0:c.length)<1||!Array.isArray(c)?null:a.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:tc(c)})}return!e||!Array.isArray(e)?d.isValidElement(e)?e:null:a.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:tc(e)})},nc=d.forwardRef(Bw),Vw=(e,t)=>{const n=Fe(),{text:r,mode:s,render:i,formItemRender:o,fieldProps:l,...c}=Le(e,["proFieldKey"]),[h,g]=Je(()=>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(s==="read"){let m=a.jsx(a.Fragment,{children:"-"});return r&&(m=a.jsxs(u.Space,{children:[a.jsx("span",{ref:t,children:h?r:"********"}),a.jsx("a",{onClick:()=>f(!h),children:h?a.jsx(se.EyeOutlined,{}):a.jsx(se.EyeInvisibleOutlined,{})})]})),i?i(r,{mode:s,...l},m):m}if(s==="edit"||s==="update"){const m=a.jsx(u.Input.Password,{placeholder:n.getMessage("tableForm.inputPlaceholder","请输入"),ref:t,...l});return o?o(r,{mode:s,...l},m):m}return null},Wn=d.forwardRef(Vw);function Hw(e){return e===0?null:e>0?"+":"-"}function Yw(e){return e===0?"#595959":e>0?"#ff4d4f":"#52c41a"}function Uw(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 Kw=({text:e,prefix:t,precision:n,suffix:r="%",mode:s,showColor:i=!1,render:o,formItemRender:l,fieldProps:c,placeholder:h,showSymbol:g},f)=>{const m=Fe(),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(s==="read"){const j=i?{color:Yw(S)}:{},v=a.jsxs("span",{style:j,ref:f,children:[t&&a.jsx("span",{children:t}),y&&a.jsxs(d.Fragment,{children:[Hw(S)," "]}),Uw(Math.abs(S),n),r&&r]});return o?o(e,{mode:s,...c,prefix:t,precision:n,showSymbol:y,suffix:r},v):v}if(s==="edit"||s==="update"){const j=a.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:s,...c},j):j}return null},rc=d.forwardRef(Kw);function Ww(e){return e===100?"success":e<0?"exception":e<100?"active":"normal"}const qw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s,placeholder:i},o)=>{const l=Fe(),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=a.jsx(u.Progress,{ref:o,size:"small",style:{minWidth:100,maxWidth:320},percent:h,steps:s==null?void 0:s.steps,status:Ww(h),...s});return n?n(h,{mode:t,...s},g):g}if(t==="edit"||t==="update"){const g=a.jsx(u.InputNumber,{ref:o,placeholder:c,...s});return r?r(e,{mode:t,...s},g):g}return null},sc=d.forwardRef(qw),Gw=({radioType:e,formItemRender:t,mode:n,render:r,...s},i)=>{var y,j,v;const{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=o("pro-field-radio"),[c,h,g]=ar(s),f=d.useRef(),m=(j=(y=u.Form.Item)==null?void 0:y.useStatus)==null?void 0:j.call(y);d.useImperativeHandle(i,()=>({...f.current||{},fetchData:x=>g(x)}),[g]);const{wrapSSR:p,hashId:S}=Be("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 a.jsx(u.Spin,{size:"small"});if(n==="read"){const x=h!=null&&h.length?h==null?void 0:h.reduce((C,b)=>({...C,[b.value??""]:b.label}),{}):void 0,w=a.jsx(a.Fragment,{children:An(s.text,Jt(s.valueEnum||x))});return r?r(s.text,{mode:n,...s.fieldProps},w)??null:w}if(n==="edit"){const x=p(a.jsx(u.Radio.Group,{ref:f,optionType:e,...s.fieldProps,className:ie((v=s.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}-${s.fieldProps.layout||"horizontal"}`),options:h}));return t?t(s.text,{mode:n,...s.fieldProps,options:h,loading:c},x)??null:x}return null},os=d.forwardRef(Gw),Zw=({text:e,mode:t,light:n,label:r,format:s="YYYY-MM-DD",render:i,picker:o,formItemRender:l,showTime:c,lightLabel:h,variant:g,fieldProps:f},m)=>{const p=Fe(),[S,y]=Array.isArray(e)?e:[],[j,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)||s||"YYYY-MM-DD"},[f,s]),w=S?Se(S).format(x(Se(S))):"",C=y?Se(y).format(x(Se(y))):"";if(t==="read"){const b=a.jsxs("div",{ref:m,style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[a.jsx("div",{children:w||"-"}),a.jsx("div",{children:C||"-"})]});return i?i(e,{mode:t,...f},a.jsx("span",{children:b})):b}if(t==="edit"||t==="update"){const b=rr(f.value);let T;const F=$=>{var M;(M=f==null?void 0:f.onChange)==null||M.call(f,$),$||v(!1)};return n?T=a.jsx(Ht,{label:r,onClick:()=>{var $;($=f==null?void 0:f.onOpenChange)==null||$.call(f,!0),v(!0)},style:b?{paddingInlineEnd:0}:void 0,disabled:f.disabled,value:b||j?a.jsx(u.DatePicker.RangePicker,{picker:o,showTime:c,format:s,...f,placeholder:f.placeholder??[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],value:b,onOpenChange:$=>{var M;b&&v($),(M=f==null?void 0:f.onOpenChange)==null||M.call(f,$)},onChange:F}):null,variant:g,allowClear:!1,ref:h,downIcon:b||j?!1:void 0}):T=a.jsx(u.DatePicker.RangePicker,{ref:m,format:s,showTime:c,placeholder:[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],...f,value:b}),l?l(e,{mode:t,...f},T):T}return null},vt=d.forwardRef(Zw),Jw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s},i)=>{if(t==="read"){const o=a.jsx(u.Rate,{allowHalf:!0,disabled:!0,ref:i,...s,value:e});return n?n(e,{mode:t,...s},a.jsx(a.Fragment,{children:o})):o}if(t==="edit"||t==="update"){const o=a.jsx(u.Rate,{allowHalf:!0,ref:i,...s});return r?r(e,{mode:t,...s},o):o}return null},ac=d.forwardRef(Jw);function Xw(e){let t=e,n="",r=!1;t<0&&(t=-t,r=!0);const s=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}`),s>0&&(n=`${s}天${n}`),r&&(n+="前"),n}const Qw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s,placeholder:i},o)=>{const l=Fe(),c=i||l.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const h=Xw(Number(e)),g=a.jsx("span",{ref:o,children:h});return n?n(e,{mode:t,...s},g):g}if(t==="edit"||t==="update"){const h=a.jsx(u.InputNumber,{ref:o,min:0,style:{width:"100%"},placeholder:c,...s});return r?r(e,{mode:t,...s},h):h}return null},ic=d.forwardRef(Qw),ej=(e,t)=>{const{mode:n,render:r,formItemRender:s,fieldProps:i,emptyText:o="-",...l}=e,c=d.useRef(),[h,g,f]=ar(e);if(d.useImperativeHandle(t,()=>({...c.current||{},fetchData:m=>f(m)}),[f]),h)return a.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=a.jsx(a.Fragment,{children:An(l.text,Jt(l.valueEnum||m))});return r?r(l.text,{mode:n,...i},a.jsx(a.Fragment,{children:p}))??o:p}if(n==="edit"||n==="update"){const m=a.jsx(u.Segmented,{ref:c,...Le(i||{},["allowClear"]),options:g});return s?s(l.text,{mode:n,...i,options:g,loading:h},m):m}return null},oc=d.forwardRef(ej),tj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s},i)=>{if(t==="read"){const o=e;return n?n(e,{mode:t,...s},a.jsx(a.Fragment,{children:o})):a.jsx(a.Fragment,{children:o})}if(t==="edit"||t==="update"){const o=a.jsx(u.Slider,{ref:i,...s,style:{minWidth:120,...s==null?void 0:s.style}});return r?r(e,{mode:t,...s},o):o}return null},lc=d.forwardRef(tj),nj=({text:e,mode:t,render:n,light:r,label:s,formItemRender:i,fieldProps:o,variant:l},c)=>{const h=Fe(),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},a.jsx(a.Fragment,{children:f})):f??"-";if(t==="edit"||t==="update"){const m=a.jsx(u.Switch,{ref:c,size:r?"small":void 0,...Le(o,["value"]),checked:(o==null?void 0:o.checked)??(o==null?void 0:o.value)});if(r){const{disabled:p}=o;return a.jsx(Ht,{label:s,disabled:p,variant:g,downIcon:!1,value:a.jsx("div",{style:{paddingLeft:8},children:m}),allowClear:!1})}return i?i(e,{mode:t,...o},m):m}return null},cc=d.forwardRef(nj),rj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:s,emptyText:i="-"},o)=>{const{autoFocus:l,prefix:c="",suffix:h=""}=s||{},g=Fe(),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=a.jsxs(a.Fragment,{children:[c,e??i,h]});return n?n(e,{mode:t,...s},m)??i:m}if(t==="edit"||t==="update"){const m=g.getMessage("tableForm.inputPlaceholder","请输入"),p=a.jsx(u.Input,{ref:f,placeholder:m,allowClear:!0,...s});return r?r(e,{mode:t,...s},p):p}return null},Si=d.forwardRef(rj),sj=({text:e,fieldProps:t},n)=>{const{getPrefixCls:r}=d.useContext(u.ConfigProvider.ConfigContext),s=r("pro-field-readonly"),i=`${s}-textarea`,{wrapSSR:o,hashId:l}=Be("TextArea",()=>({[`.${i}`]:{display:"inline-block",lineHeight:"1.5715",maxWidth:"100%",whiteSpace:"pre-wrap"}}));return o(a.jsx("span",{ref:n,className:ie(l,s,i),...Le(t,["autoSize","classNames","styles"]),children:e??"-"}))},aj=d.forwardRef(sj),ij=(e,t)=>{const{text:n,mode:r,render:s,formItemRender:i,fieldProps:o}=e,l=Fe();if(r==="read"){const c=a.jsx(aj,{...e,ref:t});return s?s(n,{mode:r,...Le(o,["showCount"])},c):c}if(r==="edit"||r==="update"){const c=a.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},uc=d.forwardRef(ij),oj=({text:e,mode:t,light:n,label:r,format:s="HH:mm:ss",render:i,formItemRender:o,fieldProps:l,lightLabel:c,variant:h},g)=>{const[f,m]=d.useState(!1),p=Fe(),S=(l==null?void 0:l.format)||s,y=Se.isDayjs(e)||typeof e=="number";if(t==="read"){const j=a.jsx("span",{ref:g,children:e?Se(e,y?void 0:S).format(S):"-"});return i?i(e,{mode:t,...l},a.jsx("span",{children:j})):j}if(t==="edit"||t==="update"){let j;const{disabled:v,value:x}=l,w=rr(x,S);return n?j=a.jsx(Ht,{onClick:()=>{var C;(C=l==null?void 0:l.onOpenChange)==null||C.call(l,!0),m(!0)},style:w?{paddingInlineEnd:0}:void 0,label:r,disabled:v,variant:h??(l==null?void 0:l.variant),value:w||f?a.jsx(u.TimePicker,{variant:h??(l==null?void 0:l.variant),format:s,ref:g,...l,placeholder:l.placeholder??p.getMessage("tableForm.selectPlaceholder","请选择"),value:w,onOpenChange:C=>{var b;m(C),(b=l==null?void 0:l.onOpenChange)==null||b.call(l,C)},open:f}):null,downIcon:w||f?!1:void 0,allowClear:!1,ref:c}):j=a.jsx(u.DatePicker.TimePicker,{ref:g,format:s,...l,value:w}),o?o(e,{mode:t,...l},j):j}return null},lj=({text:e,light:t,label:n,mode:r,lightLabel:s,format:i="HH:mm:ss",render:o,formItemRender:l,fieldProps:c,variant:h},g)=>{const f=Fe(),[m,p]=d.useState(!1),S=(c==null?void 0:c.format)||i,[y,j]=Array.isArray(e)?e:[],v=Se.isDayjs(y)||typeof y=="number",x=Se.isDayjs(j)||typeof j=="number",w=y?Se(y,v?void 0:S).format(S):"",C=j?Se(j,x?void 0:S).format(S):"";if(r==="read"){const b=a.jsxs("div",{ref:g,children:[a.jsx("div",{children:w||"-"}),a.jsx("div",{children:C||"-"})]});return o?o(e,{mode:r,...c},a.jsx("span",{children:b})):b}if(r==="edit"||r==="update"){const b=rr(c.value,S);let T;if(t){const{disabled:F,placeholder:$=[f.getMessage("tableForm.selectPlaceholder","请选择"),f.getMessage("tableForm.selectPlaceholder","请选择")]}=c;T=a.jsx(Ht,{onClick:()=>{var M;(M=c==null?void 0:c.onOpenChange)==null||M.call(c,!0),p(!0)},style:b?{paddingInlineEnd:0}:void 0,label:n,disabled:F,variant:h,placeholder:$,value:b||m?a.jsx(u.TimePicker.RangePicker,{variant:h??(c==null?void 0:c.variant),format:i,ref:g,...c,placeholder:$,value:b,onOpenChange:M=>{var I;p(M),(I=c==null?void 0:c.onOpenChange)==null||I.call(c,M)},open:m}):null,downIcon:b||m?!1:void 0,allowClear:!1,ref:s})}else T=a.jsx(u.TimePicker.RangePicker,{ref:g,format:i,variant:h,...c,value:b});return l?l(e,{mode:r,...c},T):T}return null},dc=d.forwardRef(lj),fc=d.forwardRef(oj),cj=({formItemRender:e,mode:t,light:n,label:r,render:s,variant:i,...o},l)=>{var Z,B;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:j,fetchDataOnSearch:v,onSearch:x,autoClearSearchValue:w,searchValue:C,...b}=Le(o.fieldProps,["treeData"]),T=typeof j=="object"?j:{},F=(T==null?void 0:T.onSearch)!==void 0?T.onSearch:x,$=(T==null?void 0:T.autoClearSearchValue)!==void 0?T.autoClearSearchValue:w,M=(T==null?void 0:T.searchValue)!==void 0?T.searchValue:C,I=i??(b==null?void 0:b.variant),A=Fe(),[Y,H,k]=ar({...o,defaultKeyWords:M}),[E,R]=Je(void 0,M),z=d.useCallback(U=>{R(J=>{const G=typeof U=="function"?U(J):U;return F==null||F(G),G})},[F]);d.useImperativeHandle(l,()=>({...g.current||{},fetchData:U=>k(U)}));const _=d.useMemo(()=>{if(t!=="read")return;const{value:U="value",label:J="label",children:G="children"}=(b==null?void 0:b.fieldNames)||{},K=new Map,O=P=>{if(!(P!=null&&P.length))return K;const N=P.length;let D=0;for(;D<N;){const L=P[D++];K.set(L[U],L[J]),O(L[G])}return K};return O(H)},[b==null?void 0:b.fieldNames,t,H]),V=(U,J,G)=>{j&&$&&(k(void 0),z(void 0)),S==null||S(U,J,G)};if(t==="read"){const U=a.jsx(a.Fragment,{children:An(o.text,Jt(o.valueEnum||_))});return s?s(o.text,{mode:t,...b,treeData:H},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=a.jsx(u.Spin,{spinning:Y,children:a.jsx(u.TreeSelect,{open:f,onOpenChange:G=>{var K;(K=b==null?void 0:b.onOpenChange)==null||K.call(b,G),m(G)},ref:g,popupMatchSelectWidth:!n,placeholder:A.getMessage("tableForm.selectPlaceholder","请选择"),tagRender:n?G=>{var O;if(U<2)return a.jsx(a.Fragment,{children:G.label});const K=(O=b==null?void 0:b.value)==null?void 0:O.findIndex(P=>P===G.value||P.value===G.value);return a.jsxs(a.Fragment,{children:[G.label," ",K<U-1?",":""]})}:void 0,...b,treeData:H,showSearch:j&&{...T,searchValue:E,autoClearSearchValue:$,onSearch:G=>{v&&(o!=null&&o.request)&&k(G),z(G)}},style:{minWidth:60,...b.style},allowClear:b.allowClear!==!1,onClear:()=>{p==null||p(),k(void 0),j&&z(void 0)},onChange:V,onBlur:G=>{z(void 0),k(void 0),y==null||y(G)},className:ie(b==null?void 0:b.className,h)})});if(e&&(J=e(o.text,{mode:t,...b,options:H,loading:Y},J)??null),n){const{disabled:G,placeholder:K}=b,O=!!b.value&&((B=b.value)==null?void 0:B.length)!==0;return a.jsx(Ht,{label:r,disabled:G,placeholder:K,onClick:()=>{var P;m(!0),(P=b==null?void 0:b.onOpenChange)==null||P.call(b,!0)},variant:I,value:O||f?J:null,style:O?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:!1})}return J}return null},hc=d.forwardRef(cj);function ke(e){const[t,n]=d.useState(!1),r=d.useRef(null),s=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=>{s(l)&&n(!0)},o=()=>{n(!1)};return e.isLight?a.jsx("div",{onMouseDown:i,onMouseUp:o,children:d.cloneElement(e.children,{labelTrigger:t,lightLabel:r})}):a.jsx(a.Fragment,{children:e.children})}Se.extend(hd);Se.extend(dd);Se.extend(fd);Se.extend(Qi);Se.extend(md);const yd=(e,t,n,r)=>{var l,c,h,g;const{mode:s="read",emptyText:i="-"}=n;if(i!==!1&&s==="read"&&t!=="option"&&t!=="switch"&&typeof e!="boolean"&&typeof e!="number"&&!e){const{fieldProps:f,render:m}=n;return m?m(e,{mode:s,...f},a.jsx(a.Fragment,{children:i})):a.jsx(a.Fragment,{children:i})}if(delete n.emptyText,typeof t=="object")return yd(e,t.type,{...t,...n},r);const o=r&&r[t];if(o){if(delete n.ref,s==="read"){const f=(l=o.render)==null?void 0:l.call(o,e,{text:e,...n,mode:s||"read"},a.jsx(a.Fragment,{children:e}));return n!=null&&n.render?(c=n.render)==null?void 0:c.call(n,e,{text:e,...n},f):f}if(s==="update"||s==="edit"){const f=(h=o.formItemRender)==null?void 0:h.call(o,e,{text:e,...n},a.jsx(a.Fragment,{children:e}));return n!=null&&n.formItemRender?(g=n.formItemRender)==null?void 0:g.call(n,e,{text:e,...n},f):f}}return a.jsx(Si,{text:e,...n})},uj=({text:e,valueType:t="text",mode:n="read",onChange:r,formItemRender:s,value:i,readonly:o,fieldProps:l,...c},h)=>{const g=d.useContext(zt),f=xe((...S)=>{var y;(y=l==null?void 0:l.onChange)==null||y.call(l,...S),r==null||r(...S)}),m=ct(()=>(i!==void 0||l)&&{value:i,...it(l),onChange:f},[i,l,f]),p=yd(n==="edit"?(m==null?void 0:m.value)??e??"":e??(m==null?void 0:m.value)??"",t||"text",it({ref:h,...c,mode:o?"read":n,formItemRender:s?(S,y,j)=>{const{placeholder:v,...x}=y,w=s(S,x,j);return d.isValidElement(w)?d.cloneElement(w,{...m,...w.props||{}}):w}:void 0,placeholder:s?void 0:(c==null?void 0:c.placeholder)??(m==null?void 0:m.placeholder),fieldProps:It(it({...m,placeholder:s?void 0:(c==null?void 0:c.placeholder)??(m==null?void 0:m.placeholder)}))}),g.valueTypeMap||{});return a.jsx(d.Fragment,{children:p})},dj=d.forwardRef(uj);Se.extend(hd);Se.extend(dd);Se.extend(fd);Se.extend(Qi);Se.extend(md);const xd={progress:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return a.jsx(sc,{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 a.jsx(sc,{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 a.jsx(ec,{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 a.jsx(ec,{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 a.jsx(rc,{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 a.jsx(rc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},image:{render:(e,t)=>a.jsx(Xl,{...t,text:e}),formItemRender:(e,t)=>a.jsx(Xl,{...t,text:e})},date:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-MM-DD",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-MM-DD",...t,text:e})})},dateWeek:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-wo",picker:"week",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-wo",picker:"week",...t,text:e})})},dateWeekRange:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})})},dateMonthRange:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})})},dateQuarterRange:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})})},dateYearRange:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})})},dateMonth:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-MM",picker:"month",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-MM",picker:"month",...t,text:e})})},dateQuarter:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})})},dateYear:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY",picker:"year",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY",picker:"year",...t,text:e})})},dateRange:{render:(e,t)=>a.jsx(vt,{format:"YYYY-MM-DD",...t,text:e}),formItemRender:(e,t)=>a.jsx(vt,{format:"YYYY-MM-DD",...t,text:e})},dateTime:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(jt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},dateTimeRange:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(vt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},time:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(fc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(fc,{format:"HH:mm:ss",...t,text:e})})},timeRange:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(dc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(dc,{format:"HH:mm:ss",...t,text:e})})},fromNow:{render:(e,t)=>a.jsx(Jl,{...t,text:e}),formItemRender:(e,t)=>a.jsx(Jl,{...t,text:e})},index:{render:e=>a.jsx(is,{children:e+1}),formItemRender:e=>a.jsx(is,{children:e+1})},indexBorder:{render:e=>a.jsx(is,{border:!0,children:e+1}),formItemRender:e=>a.jsx(is,{border:!0,children:e+1})},avatar:{render:e=>a.jsx(u.Avatar,{src:e,size:22,shape:"circle"}),formItemRender:e=>a.jsx(u.Avatar,{src:e,size:22,shape:"circle"})},code:{render:(e,t)=>a.jsx(as,{...t,text:e}),formItemRender:(e,t)=>a.jsx(as,{...t,text:e})},jsonCode:{render:(e,t)=>a.jsx(as,{language:"json",...t,text:e}),formItemRender:(e,t)=>a.jsx(as,{language:"json",...t,text:e})},textarea:{render:(e,t)=>a.jsx(uc,{...t,text:e}),formItemRender:(e,t)=>a.jsx(uc,{...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,s=typeof e=="number"?e:Number(e)||0;return a.jsx(zs,{text:s,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,s=typeof e=="number"?e:Number(e)||0;return a.jsx(zs,{text:s,placeholder:r,mode:t.mode,fieldProps:n})}},digitRange:{render:(e,t)=>a.jsx(Gl,{...t,text:e}),formItemRender:(e,t)=>a.jsx(Gl,{...t,text:e})},second:{render:(e,t)=>a.jsx(ic,{...t,text:e,placeholder:t.placeholder}),formItemRender:(e,t)=>a.jsx(ic,{...t,text:e,placeholder:t.placeholder})},select:{render:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(ss,{...t,text:e})}),formItemRender:(e,t)=>a.jsx(ke,{isLight:t.light,children:a.jsx(ss,{...t,text:e})})},text:{render:(e,t)=>"valueEnum"in t?a.jsx(ke,{isLight:t.light,children:a.jsx(ss,{...t,text:e})}):a.jsx(Si,{...t,text:e}),formItemRender:(e,t)=>"valueEnum"in t?a.jsx(ke,{isLight:t.light,children:a.jsx(ss,{...t,text:e})}):a.jsx(Si,{...t,text:e})},checkbox:{render:(e,t)=>a.jsx(Wl,{...t,text:e}),formItemRender:(e,t)=>a.jsx(Wl,{...t,text:e})},radio:{render:(e,t)=>a.jsx(os,{...t,text:e}),formItemRender:(e,t)=>a.jsx(os,{...t,text:e})},radioButton:{render:(e,t)=>a.jsx(os,{radioType:"button",...t,text:e}),formItemRender:(e,t)=>a.jsx(os,{radioType:"button",...t,text:e})},rate:{render:(e,t)=>a.jsx(ac,{...t,text:e}),formItemRender:(e,t)=>a.jsx(ac,{...t,text:e})},slider:{render:(e,t)=>a.jsx(lc,{...t,text:e}),formItemRender:(e,t)=>a.jsx(lc,{...t,text:e})},switch:{render:(e,t)=>a.jsx(cc,{...t,text:e}),formItemRender:(e,t)=>a.jsx(cc,{...t,text:e})},option:{render:(e,t)=>a.jsx(nc,{...t,text:e}),formItemRender:(e,t)=>a.jsx(nc,{...t,text:e})},password:{render:(e,t)=>a.jsx(Wn,{...t,text:e}),formItemRender:(e,t)=>a.jsx(Wn,{...t,text:e})},cascader:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return a.jsx(Kl,{...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 a.jsx(Kl,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})}},treeSelect:{render:(e,t)=>a.jsx(hc,{...t,text:e}),formItemRender:(e,t)=>a.jsx(hc,{...t,text:e})},color:{render:(e,t)=>a.jsx(ql,{...t,text:e}),formItemRender:(e,t)=>a.jsx(ql,{...t,text:e})},segmented:{render:(e,t)=>a.jsx(oc,{...t,text:e}),formItemRender:(e,t)=>a.jsx(oc,{...t,text:e})}},eo=d.createContext({grid:!1,colProps:void 0,rowProps:void 0}),fj=({grid:e,rowProps:t,colProps:n})=>({grid:!!e,RowWrapper({children:r,Wrapper:s,...i}={}){return e?a.jsx(u.Row,{gutter:8,...t,...i,children:r}):s?a.jsx(s,{children:r}):r},ColWrapper({children:r,Wrapper:s,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?a.jsx(u.Col,{...c,children:h}):s?a.jsx(s,{children:h}):h}}),ir=e=>{const t=d.useMemo(()=>typeof e=="object"?e:{grid:e},[e]),{grid:n,colProps:r}=d.useContext(eo);return d.useMemo(()=>fj({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])])},Tn="RC_FORM_INTERNAL_HOOKS",Ne=()=>{He(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},On=ge.createContext({getFieldValue:Ne,getFieldsValue:Ne,getFieldError:Ne,getFieldWarning:Ne,getFieldsError:Ne,isFieldsTouched:Ne,isFieldTouched:Ne,isFieldValidating:Ne,isFieldsValidating:Ne,resetFields:Ne,setFields:Ne,setFieldValue:Ne,setFieldsValue:Ne,validateFields:Ne,submit:Ne,getInternalHooks:()=>(Ne(),{dispatch:Ne,initEntityValue:Ne,registerField:Ne,useSubscribe:Ne,setInitialValues:Ne,destroyForm:Ne,setCallbacks:Ne,registerWatch:Ne,getFields:Ne,setValidateMessages:Ne,setPreserve:Ne,getInitialValue:Ne})}),Vs=ge.createContext(null);function Ci(e){return e==null?[]:Array.isArray(e)?e:[e]}function hj(e){return e&&!!e._init}function wi(){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 ka=wi(),mj=/%[sdj%]/g;let bd=()=>{};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(bd=(e,t)=>{typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&t.every(n=>typeof n=="string")&&console.warn(e,t)});function ji(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(mj,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 gj(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function nt(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||gj(t)&&typeof e=="string"&&!e)}function pj(e,t,n){const r=[];let s=0;const i=e.length;function o(l){r.push(...l||[]),s++,s===i&&n(r)}e.forEach(l=>{t(l,o)})}function mc(e,t,n){let r=0;const s=e.length;function i(o){if(o&&o.length){n(o);return}const l=r;r=r+1,l<s?t(e[l],i):n([])}i([])}function yj(e){const t=[];return Object.keys(e).forEach(n=>{t.push(...e[n]||[])}),t}class gc extends Error{constructor(n,r){super("Async Validation Error");oe(this,"errors");oe(this,"fields");this.errors=n,this.fields=r}}function xj(e,t,n,r,s){if(t.first){const f=new Promise((m,p)=>{const S=j=>(r(j),j.length?p(new gc(j,ji(j))):m(s)),y=yj(e);mc(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 gc(h,ji(h))):f(s)};o.length||(r(h),f(s)),o.forEach(S=>{const y=e[S];i.indexOf(S)!==-1?mc(y,n,p):pj(y,n,p)})});return g.catch(f=>f),g}function bj(e){return!!(e&&e.message!==void 0)}function Sj(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 pc(e,t){return n=>{let r;return e.fullFields?r=Sj(t,e.fullFields):r=t[n.field||e.fullField],bj(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 yc(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",Cj=(e,t,n,r,s)=>{e[Bn]=Array.isArray(e[Bn])?e[Bn]:[],e[Bn].indexOf(t)===-1&&r.push(wt(s.messages[Bn],e.fullField,e[Bn].join(", ")))},wj=(e,t,n,r,s)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(wt(s.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern=="string"&&(new RegExp(e.pattern).test(t)||r.push(wt(s.messages.pattern.mismatch,e.fullField,t,e.pattern))))},jj=(e,t,n,r,s)=>{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(s.messages[g].len,e.fullField,e.len)):o&&!l&&h<e.min?r.push(wt(s.messages[g].min,e.fullField,e.min)):l&&!o&&h>e.max?r.push(wt(s.messages[g].max,e.fullField,e.max)):o&&l&&(h<e.min||h>e.max)&&r.push(wt(s.messages[g].range,e.fullField,e.min,e.max))},Sd=(e,t,n,r,s,i)=>{e.required&&(!n.hasOwnProperty(e.field)||nt(t,i||e.type))&&r.push(wt(s.messages.required,e.fullField))};let ls;const vj=(()=>{if(ls)return ls;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,C=`(?:${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 ls=new RegExp(`(?:^${C}$)`,"i"),ls}),Da={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},br={integer(e){return br.number(e)&&parseInt(e,10)===e},float(e){return br.number(e)&&!br.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"&&!br.array(e)},method(e){return typeof e=="function"},email(e){return typeof e=="string"&&e.length<=320&&!!e.match(Da.email)},tel(e){return typeof e=="string"&&e.length<=32&&!!e.match(Da.tel)},url(e){return typeof e=="string"&&e.length<=2048&&!!e.match(vj())},hex(e){return typeof e=="string"&&!!e.match(Da.hex)}},Tj=(e,t,n,r,s)=>{if(e.required&&t===void 0){Sd(e,t,n,r,s);return}const i=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],o=e.type;i.indexOf(o)>-1?br[o](t)||r.push(wt(s.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(wt(s.messages.types[o],e.fullField,e.type))},Fj=(e,t,n,r,s)=>{(/^\s+$/.test(t)||t==="")&&r.push(wt(s.messages.whitespace,e.fullField))},$e={required:Sd,whitespace:Fj,type:Tj,range:jj,enum:Cj,pattern:wj},Rj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s)}n(i)},$j=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();$e.required(e,t,r,i,s,"array"),t!=null&&($e.type(e,t,r,i,s),$e.range(e,t,r,i,s))}n(i)},Ej=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&$e.type(e,t,r,i,s)}n(i)},Ij=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,"date")&&!e.required)return n();if($e.required(e,t,r,i,s),!nt(t,"date")){let l;t instanceof Date?l=t:l=new Date(t),$e.type(e,l,r,i,s),l&&$e.range(e,l.getTime(),r,i,s)}}n(i)},Mj="enum",Oj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&$e[Mj](e,t,r,i,s)}n(i)},Aj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&($e.type(e,t,r,i,s),$e.range(e,t,r,i,s))}n(i)},kj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&($e.type(e,t,r,i,s),$e.range(e,t,r,i,s))}n(i)},Dj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&$e.type(e,t,r,i,s)}n(i)},Pj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===""&&(t=void 0),nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&($e.type(e,t,r,i,s),$e.range(e,t,r,i,s))}n(i)},Nj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),t!==void 0&&$e.type(e,t,r,i,s)}n(i)},Lj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,"string")&&!e.required)return n();$e.required(e,t,r,i,s),nt(t,"string")||$e.pattern(e,t,r,i,s)}n(i)},_j=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,s),nt(t)||$e.type(e,t,r,i,s)}n(i)},zj=(e,t,n,r,s)=>{const i=[],o=Array.isArray(t)?"array":typeof t;$e.required(e,t,r,i,s,o),n(i)},Bj=(e,t,n,r,s)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,"string")&&!e.required)return n();$e.required(e,t,r,i,s,"string"),nt(t,"string")||($e.type(e,t,r,i,s),$e.range(e,t,r,i,s),$e.pattern(e,t,r,i,s),e.whitespace===!0&&$e.whitespace(e,t,r,i,s))}n(i)},cs=(e,t,n,r,s)=>{const i=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,i)&&!e.required)return n();$e.required(e,t,r,o,s,i),nt(t,i)||$e.type(e,t,r,o,s)}n(o)},fr={string:Bj,method:Dj,number:Pj,boolean:Ej,regexp:_j,integer:kj,float:Aj,array:$j,object:Nj,enum:Oj,pattern:Lj,date:Ij,url:cs,hex:cs,email:cs,tel:cs,required:zj,any:Rj},on=class on{constructor(t){oe(this,"rules",null);oe(this,"_messages",ka);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=yc(wi(),t)),this._messages}validate(t,n={},r=()=>{}){let s=t,i=n,o=r;if(typeof i=="function"&&(o=i,i={}),!this.rules||Object.keys(this.rules).length===0)return o&&o(null,s),Promise.resolve(s);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=ji(m),o(m,p)):o(null,s)}if(i.messages){let f=this.messages();f===ka&&(f=wi()),yc(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=s[f];m.forEach(S=>{let y=S;typeof y.transform=="function"&&(s===t&&(s={...s}),p=s[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:s,field:f}))})});const g={};return xj(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(w,C){return{...C,fullField:`${p.fullField}.${w}`,fullFields:p.fullFields?[...p.fullFields,w]:[w]}}function j(w=[]){let C=Array.isArray(w)?w:[w];!i.suppressWarning&&C.length&&on.warning("async-validator:",C),C.length&&p.message!==void 0&&p.message!==null&&(C=[].concat(p.message));let b=C.map(pc(p,s));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(pc(p,s)):i.error&&(b=[i.error(p,wt(i.messages.required,p.field))]),m(b);let T={};p.defaultField&&Object.keys(f.value).map(M=>{T[M]=p.defaultField}),T={...T,...f.rule.fields};const F={};Object.keys(T).forEach(M=>{const I=T[M],A=Array.isArray(I)?I:[I];F[M]=A.map(y.bind(null,M))});const $=new on(F);$.messages(i.messages),f.rule.options&&(f.rule.options.messages=i.messages,f.rule.options.error=i.error),$.validate(f.value,f.rule.options||i,M=>{const I=[];b&&b.length&&I.push(...b),M&&M.length&&I.push(...M),m(I.length?I:null)})}}let v;if(p.asyncValidator)v=p.asyncValidator(p,f.value,j,f.source,i);else if(p.validator){try{v=p.validator(p,f.value,j,f.source,i)}catch(w){(x=console.error)==null||x.call(console,w),i.suppressValidatorError||setTimeout(()=>{throw w},0),j(w.message)}v===!0?j():v===!1?j(typeof p.message=="function"?p.message(p.fullField||p.field):p.message||`${p.fullField||p.field} fails`):v instanceof Array?j(v):v instanceof Error&&j(v.message)}v&&v.then&&v.then(()=>j(),w=>j(w))},f=>{l(f)},s)}getType(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!fr.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"?fr.required:fr[this.getType(t)]||void 0}};oe(on,"register",function(n,r){if(typeof r!="function")throw new Error("Cannot register a validator by type, validator is not a function");fr[n]=r}),oe(on,"warning",bd),oe(on,"messages",ka),oe(on,"validators",fr);let vi=on;const ft="'${name}' is not a valid ${type}",Cd={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:ft,method:ft,array:ft,object:ft,number:ft,date:ft,boolean:ft,integer:ft,float:ft,regexp:ft,email:ft,tel:ft,url:ft,hex:ft},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}"}},xc=vi;function Vj(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 bc="CODE_LOGIC_ERROR";async function Ti(e,t,n,r,s){const i={...n};if(delete i.ruleIndex,xc.warning=()=>{},i.validator){const m=i.validator;i.validator=(...p)=>{try{return m(...p)}catch(S){return console.error(S),Promise.reject(bc)}}}let o=null;i&&i.type==="array"&&i.defaultField&&(o=i.defaultField,delete i.defaultField);const l=new xc({[e]:[i]}),c=Un(Cd,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===bc?c.default:p;return ge.isValidElement(y)?ge.cloneElement(y,{key:`error_${S}`}):y}))}if(!h.length&&o&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((p,S)=>Ti(`${e}.${S}`,p,o,r,s)))).reduce((p,S)=>[...p,...S],[]);const g={...n,name:e,enum:(n.enum||[]).join(", "),...s};return h.map(m=>typeof m=="string"?Vj(m,g):m)}function Hj(e,t,n,r,s,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 j=!1;const x=f(p,S,(...w)=>{Promise.resolve().then(()=>{He(!j,"Your validator function has already return a promise. `callback` will be ignored."),j||y(...w)})});j=x&&typeof x.then=="function"&&typeof x.catch=="function",He(j,"`callback` is deprecated. Please return a promise instead."),j&&x.then(()=>{y()}).catch(w=>{y(w||" ")})}),m}).sort(({warningOnly:h,ruleIndex:g},{warningOnly:f,ruleIndex:m})=>!!h==!!f?g-m:h?1:-1);let c;if(s===!0)c=new Promise(async(h,g)=>{for(let f=0;f<l.length;f+=1){const m=l[f],p=await Ti(o,t,m,r,i);if(p.length){g([{errors:p,rule:m}]);return}}h([])});else{const h=l.map(g=>Ti(o,t,g,r,i).then(f=>({errors:f,rule:g})));c=(s?Uj(h):Yj(h)).then(g=>Promise.reject(g))}return c.catch(h=>h),c}async function Yj(e){return Promise.all(e).then(t=>[].concat(...t))}async function Uj(e){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(s=>{s.errors.length&&n([s]),t+=1,t===e.length&&n([])})})})}function Ze(e){return Ci(e)}function Sc(e,t){let n={};return t.forEach(r=>{const s=Me(e,r);n=_e(n,r,s)}),n}function qn(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,s)=>e[s]===r)}function Kj(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 Wj(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function Cc(e,t,n){const{length:r}=e;if(t<0||t>=r||n<0||n>=r)return e;const s=e[t],i=t-n;return i>0?[...e.slice(0,n),s,...e.slice(n,t),...e.slice(t+1,r)]:i<0?[...e.slice(0,t),...e.slice(t+1,n+1),s,...e.slice(n+1,r)]:e}const wd=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class qj{constructor(t){oe(this,"namePathList",[]);oe(this,"taskId",0);oe(this,"watcherList",new Set);oe(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;wd(()=>{if(t===this.taskId&&this.watcherList.size){const n=this.form.getForm(),r=n.getFieldsValue(),s=n.getFieldsValue(!0);this.watcherList.forEach(i=>{i(r,s,this.namePathList)}),this.namePathList=[]}})}}async function Gj(){return new Promise(e=>{wd(()=>{Ai(()=>{e()})})})}function Fi(){return Fi=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},Fi.apply(this,arguments)}const bn=[],hr=[];function Pa(e,t,n,r,s,i){return typeof e=="function"?e(t,n,"source"in i?{source:i.source}:{}):r!==s}class jd extends ge.PureComponent{constructor(n){super(n);oe(this,"state",{resetCount:0});oe(this,"cancelRegisterFunc",null);oe(this,"mounted",!1);oe(this,"touched",!1);oe(this,"dirty",!1);oe(this,"validatePromise");oe(this,"prevValidating");oe(this,"errors",bn);oe(this,"warnings",hr);oe(this,"cancelRegister",()=>{const{preserve:n,isListField:r,name:s}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,Ze(s)),this.cancelRegisterFunc=null});oe(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:s=[]}=r;return n!==void 0?[...s,...n]:[]});oe(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(s=>typeof s=="function"?s(r):s)});oe(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});oe(this,"metaCache",null);oe(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const s={...this.getMeta(),destroy:n};Ro(this.metaCache,s)||r(s),this.metaCache=s}else this.metaCache=null});oe(this,"onStoreChange",(n,r,s)=>{const{shouldUpdate:i,dependencies:o=[],onReset:l}=this.props,{store:c}=s,h=this.getNamePath(),g=this.getValue(n),f=this.getValue(c),m=r&&qn(r,h);switch(s.type==="valueUpdate"&&s.source==="external"&&!Ro(g,f)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=bn,this.warnings=hr,this.triggerMetaEvent()),s.type){case"reset":if(!r||m){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=bn,this.warnings=hr,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&Pa(i,n,c,g,f,s)){this.reRender();return}break}case"setField":{const{data:p}=s;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||bn),"warnings"in p&&(this.warnings=p.warnings||hr),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in p&&qn(r,h,!0)){this.reRender();return}if(i&&!h.length&&Pa(i,n,c,g,f,s)){this.reRender();return}break}case"dependenciesUpdate":{if(o.map(Ze).some(S=>qn(s.relatedFields,S))){this.reRender();return}break}default:if(m||(!o.length||h.length||i)&&Pa(i,n,c,g,f,s)){this.reRender();return}break}i===!0&&this.reRender()});oe(this,"validateRules",n=>{const r=this.getNamePath(),s=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 Gj();let m=this.getRules();if(i&&(m=m.filter(S=>S).filter(S=>{const{validateTrigger:y}=S;return y?Ci(y).includes(i):!0})),f&&i&&(await new Promise(S=>{setTimeout(S,f)}),this.validatePromise!==c))return[];const p=Hj(r,s,m,n,h,g);return p.catch(S=>S).then((S=bn)=>{var y;if(this.validatePromise===c){this.validatePromise=null;const j=[],v=[];(y=S.forEach)==null||y.call(S,({rule:{warningOnly:x},errors:w=bn})=>{x?v.push(...w):j.push(...w)}),this.errors=j,this.warnings=v,this.triggerMetaEvent(),this.reRender()}}),p});return o||(this.validatePromise=c,this.dirty=!0,this.errors=bn,this.warnings=hr,this.triggerMetaEvent(),this.reRender()),c});oe(this,"isFieldValidating",()=>!!this.validatePromise);oe(this,"isFieldTouched",()=>this.touched);oe(this,"isFieldDirty",()=>{if(this.dirty||this.props.initialValue!==void 0)return!0;const{fieldContext:n}=this.props,{getInitialValue:r}=n.getInternalHooks(Tn);return r(this.getNamePath())!==void 0});oe(this,"getErrors",()=>this.errors);oe(this,"getWarnings",()=>this.warnings);oe(this,"isListField",()=>this.props.isListField);oe(this,"isList",()=>this.props.isList);oe(this,"isPreserve",()=>this.props.preserve);oe(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}));oe(this,"getOnlyChild",n=>{if(typeof n=="function"){const s=this.getMeta();return{...this.getOnlyChild(n(this.getControlled(),s,this.props.fieldContext)),isFunction:!0}}const r=mn(n);return r.length!==1||!ge.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});oe(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,s=this.getNamePath();return Me(n||r(!0),s)});oe(this,"getControlled",(n={})=>{const{name:r,trigger:s="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(Tn),j=this.getValue(),v=h||(T=>({[c]:T})),x=n[s],w=r!==void 0?v(j):{};process.env.NODE_ENV!=="production"&&w&&Object.keys(w).forEach(T=>{He(typeof w[T]!="function",`It's not recommended to generate dynamic function prop by \`getValueProps\`. Please pass it to child component directly (prop: ${T})`)});const C={...n,...w};return C[s]=(...T)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();const F=this.getValue();let $;o?$=o(...T):$=Wj(c,...T),l&&($=l($,F,S(!0))),$!==F&&y({type:"updateValue",namePath:m,value:$}),x&&x(...T)},Ci(f||[]).forEach(T=>{const F=C[T];C[T]=(...$)=>{F&&F(...$);const{rules:M}=this.props;M&&M.length&&y({type:"validateField",namePath:m,triggerName:T})}}),C});if(n.fieldContext){const{getInternalHooks:r}=n.fieldContext,{initEntityValue:s}=r(Tn);s(this)}}componentDidMount(){const{shouldUpdate:n,fieldContext:r}=this.props;if(this.mounted=!0,r){const{getInternalHooks:s}=r,{registerField:i}=s(Tn);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:s,isFunction:i}=this.getOnlyChild(r);let o;return i?o=s:ge.isValidElement(s)?o=ge.cloneElement(s,this.getControlled(s.props)):(He(!s,"`children` of Field is not validate ReactElement."),o=s),ge.createElement(ge.Fragment,{key:n},o)}}oe(jd,"contextType",On);function vd({name:e,...t}){const n=ge.useContext(On),r=ge.useContext(Vs),s=e!==void 0?Ze(e):void 0,i=t.isListField??!!r;let o="keep";return i||(o=`_${(s||[]).join("_")}`),process.env.NODE_ENV!=="production"&&t.preserve===!1&&i&&s.length<=1&&He(!1,"`preserve` should not apply on Form.List fields."),ge.createElement(jd,Fi({key:o,name:s,isListField:i},t,{fieldContext:n}))}function Zj({name:e,initialValue:t,children:n,rules:r,validateTrigger:s,isListField:i}){const o=ge.useContext(On),l=ge.useContext(Vs),h=ge.useRef({keys:[],id:0}).current,g=ge.useMemo(()=>[...Ze(o.prefixName)||[],...Ze(e)],[o.prefixName,e]),f=ge.useMemo(()=>({...o,prefixName:g}),[o,g]),m=ge.useMemo(()=>({getKey:S=>{const y=g.length,j=S[y];return[h.keys[j],S.slice(y+1)]}}),[h,g]);if(typeof n!="function")return He(!1,"Form.List only accepts function as children."),null;const p=(S,y,{source:j})=>j==="internal"?!1:S!==y;return ge.createElement(Vs.Provider,{value:m},ge.createElement(On.Provider,{value:f},ge.createElement(vd,{name:[],shouldUpdate:p,rules:r,validateTrigger:s,initialValue:t,isList:!0,isListField:i??!!l},({value:S=[],onChange:y},j)=>{const{getFieldValue:v}=o,x=()=>v(g||[])||[],w={add:(b,T)=>{const F=x();T>=0&&T<=F.length?(h.keys=[...h.keys.slice(0,T),h.id,...h.keys.slice(T)],y([...F.slice(0,T),b,...F.slice(T)])):(process.env.NODE_ENV!=="production"&&(T<0||T>F.length)&&He(!1,"The second parameter of the add function should be a valid positive number."),h.keys=[...h.keys,h.id],y([...F,b])),h.id+=1},remove:b=>{const T=x(),F=new Set(Array.isArray(b)?b:[b]);F.size<=0||(h.keys=h.keys.filter(($,M)=>!F.has(M)),y(T.filter(($,M)=>!F.has(M))))},move(b,T){if(b===T)return;const F=x();b<0||b>=F.length||T<0||T>=F.length||(h.keys=Cc(h.keys,b,T),y(Cc(F,b,T)))}};let C=S||[];return Array.isArray(C)||(C=[],process.env.NODE_ENV!=="production"&&He(!1,`Current value of '${g.join(" > ")}' is not an array type.`)),n(C.map((b,T)=>{let F=h.keys[T];return F===void 0&&(h.keys[T]=h.id,F=h.keys[T],h.id+=1),{name:T,key:F,isListField:!0}}),w,j)})))}function Jj(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((s,i)=>{e.forEach((o,l)=>{o.catch(c=>(t=!0,c)).then(c=>{n-=1,r[l]=c,!(n>0)&&(t&&i(r),s(r))})})}):Promise.resolve([])}const Ri="__@field_split__";function us(e){return e.map(t=>`${typeof t}:${t}`).join(Ri)}class Vn{constructor(){oe(this,"kvs",new Map)}set(t,n){this.kvs.set(us(t),n)}get(t){return this.kvs.get(us(t))}getAsPrefix(t){const n=us(t),r=n+Ri,s=[],i=this.kvs.get(n);return i!==void 0&&s.push(i),this.kvs.forEach((o,l)=>{l.startsWith(r)&&s.push(o)}),s}update(t,n){const r=this.get(t),s=n(r);s?this.set(t,s):this.delete(t)}delete(t){this.kvs.delete(us(t))}map(t){return[...this.kvs.entries()].map(([n,r])=>{const s=n.split(Ri);return t({key:s.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 Xj{constructor(t){oe(this,"formHooked",!1);oe(this,"forceRootUpdate");oe(this,"subscribable",!0);oe(this,"store",{});oe(this,"fieldEntities",[]);oe(this,"initialValues",{});oe(this,"callbacks",{});oe(this,"validateMessages",null);oe(this,"preserve",null);oe(this,"lastValidatePromise",null);oe(this,"watcherCenter",new qj(this));oe(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}));oe(this,"getInternalHooks",t=>t===Tn?(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}):(He(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));oe(this,"useSubscribe",t=>{this.subscribable=t});oe(this,"prevWithoutPreserves",null);oe(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let s=Un(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{s=_e(s,i,Me(t,i))}),this.prevWithoutPreserves=null,this.updateStore(s)}});oe(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}});oe(this,"getInitialValue",t=>{const n=Me(this.initialValues,t);return t.length?Un(n):n});oe(this,"setCallbacks",t=>{this.callbacks=t});oe(this,"setValidateMessages",t=>{this.validateMessages=t});oe(this,"setPreserve",t=>{this.preserve=t});oe(this,"registerWatch",t=>this.watcherCenter.register(t));oe(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});oe(this,"timeoutId",null);oe(this,"warningUnhooked",()=>{process.env.NODE_ENV!=="production"&&!this.timeoutId&&typeof window<"u"&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.formHooked||He(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))});oe(this,"updateStore",t=>{this.store=t});oe(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);oe(this,"getFieldsMap",(t=!1)=>{const n=new Vn;return this.getFieldEntities(t).forEach(r=>{const s=r.getNamePath();n.set(s,r)}),n});oe(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(s=>{const i=Ze(s),o=r.getAsPrefix(i);return o.length?o:[{INVALIDATE_NAME_PATH:i}]}):t.map(s=>{const i=Ze(s);return r.get(i)||{INVALIDATE_NAME_PATH:Ze(s)}})});oe(this,"getFieldsValue",(t,n)=>{this.warningUnhooked();let r,s;if(t===!0||Array.isArray(t)?(r=t,s=n):t&&typeof t=="object"&&(s=t.filter),r===!0&&!s)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(!s)o.push(g);else{const m="getMeta"in h?h.getMeta():null;s(m)&&o.push(g)}});let c=Sc(this.store,o.map(Ze));return l.forEach(h=>{Me(c,h)||(c=_e(c,h,[]))}),c});oe(this,"getFieldValue",t=>{this.warningUnhooked();const n=Ze(t);return Me(this.store,n)});oe(this,"getFieldsError",t=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(t).map((r,s)=>r&&!r.INVALIDATE_NAME_PATH?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:Ze(t[s]),errors:[],warnings:[]})));oe(this,"getFieldError",t=>{this.warningUnhooked();const n=Ze(t);return this.getFieldsError([n])[0].errors});oe(this,"getFieldWarning",t=>{this.warningUnhooked();const n=Ze(t);return this.getFieldsError([n])[0].warnings});oe(this,"isFieldsTouched",(...t)=>{this.warningUnhooked();const[n,r]=t;let s,i=!1;t.length===0?s=null:t.length===1?Array.isArray(n)?(s=n.map(Ze),i=!1):(s=null,i=n):(s=n.map(Ze),i=r);const o=this.getFieldEntities(!0),l=f=>f.isFieldTouched();if(!s)return i?o.every(f=>l(f)||f.isList()):o.some(l);const c=new Vn;s.forEach(f=>{c.set(f,[])}),o.forEach(f=>{const m=f.getNamePath();s.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)});oe(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));oe(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(s=>s.isFieldValidating());const r=t.map(Ze);return n.some(s=>{const i=s.getNamePath();return qn(r,i)&&s.isFieldValidating()})});oe(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));oe(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 s=o=>{o.forEach(l=>{const{initialValue:c}=l.props;if(c!==void 0){const h=l.getNamePath();if(this.getInitialValue(h)!==void 0)He(!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)He(!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(_e(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,s(i)});oe(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(Un(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(Ze);r.forEach(s=>{const i=this.getInitialValue(s);this.updateStore(_e(this.store,s,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});oe(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(s=>{const{name:i,...o}=s,l=Ze(i);r.push(l),"value"in o&&this.updateStore(_e(this.store,l,o.value)),this.notifyObservers(n,[l],{type:"setField",data:s})}),this.notifyWatch(r)});oe(this,"getFields",()=>this.getFieldEntities(!0).map(r=>{const s=r.getNamePath(),o={...r.getMeta(),name:s,value:this.getFieldValue(s)};return Object.defineProperty(o,"originRCField",{value:!0}),o}));oe(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();Me(this.store,r)===void 0&&this.updateStore(_e(this.store,r,n))}});oe(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);oe(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,s,i=[])=>{if(this.fieldEntities=this.fieldEntities.filter(o=>o!==t),!this.isMergedPreserve(s)&&(!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(_e(l,n,o,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});oe(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}}});oe(this,"notifyObservers",(t,n,r)=>{if(this.subscribable){const s={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:i})=>{i(t,n,s)})}else this.forceRootUpdate()});oe(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});oe(this,"updateValue",(t,n)=>{const r=Ze(t),s=this.store;this.updateStore(_e(this.store,r,n)),this.notifyObservers(s,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);const i=this.triggerDependenciesUpdate(s,r),{onValuesChange:o}=this.callbacks;if(o){const l=Sc(this.store,[r]),c=this.getFieldsValue(),h=_e(c,r,Me(l,r));o(l,h)}this.triggerOnFieldsChange([r,...i])});oe(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=Un(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});oe(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});oe(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],s=new Vn;this.getFieldEntities().forEach(o=>{const{dependencies:l}=o.props;(l||[]).forEach(c=>{const h=Ze(c);s.update(h,(g=new Set)=>(g.add(o),g))})});const i=o=>{(s.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});oe(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const s=this.getFields();if(n){const o=new Vn;n.forEach(({name:l,errors:c})=>{o.set(l,c)}),s.forEach(l=>{l.errors=o.get(l.name)||l.errors})}const i=s.filter(({name:o})=>qn(t,o));i.length&&r(i,s)}});oe(this,"validateFields",(t,n)=>{this.warningUnhooked();let r,s;Array.isArray(t)||typeof t=="string"||typeof n=="string"?(r=t,s=n):s=t;const i=!!r,o=i?r.map(Ze):[],l=[...o],c=[],h=String(Date.now()),g=new Set,{recursive:f,dirty:m}=s||{};this.getFieldEntities(!0).forEach(j=>{const v=j.getNamePath();if(i||((!j.isList()||!o.some(x=>Hs(x,v,!0)))&&l.push(v),o.push(v)),!(!j.props.rules||!j.props.rules.length)&&!(m&&!j.isFieldDirty())&&(g.add(v.join(h)),!i||qn(o,v,f))){const x=j.validateRules({validateMessages:{...Cd,...this.validateMessages},...s});c.push(x.then(()=>({name:v,errors:[],warnings:[]})).catch(w=>{var T;const C=[],b=[];return(T=w.forEach)==null||T.call(w,({rule:{warningOnly:F},errors:$})=>{F?b.push(...$):C.push(...$)}),C.length?Promise.reject({name:v,errors:C,warnings:b}):{name:v,errors:C,warnings:b}}))}});const p=Jj(c);this.lastValidatePromise=p,p.catch(j=>j).then(j=>{const v=j.map(({name:x})=>x);this.notifyObservers(this.store,v,{type:"validateFinish"}),this.triggerOnFieldsChange(v,j)});const S=p.then(()=>this.lastValidatePromise===p?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(j=>{var w,C;const v=j.filter(b=>b&&b.errors.length),x=(C=(w=v[0])==null?void 0:w.errors)==null?void 0:C[0];return Promise.reject({message:x,values:this.getFieldsValue(o),errorFields:v,outOfDate:this.lastValidatePromise!==p})});S.catch(j=>j);const y=o.filter(j=>g.has(j.join(h)));return this.triggerOnFieldsChange(y),S});oe(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 Td(e){const t=ge.useRef(null),[,n]=ge.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},s=new Xj(r);t.current=s.getForm()}return[t.current]}const $i=ge.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),Qj=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const s=ge.useContext($i),i=ge.useRef({});return ge.createElement($i.Provider,{value:{...s,validateMessages:{...s.validateMessages,...e},triggerFormChange:(o,l)=>{t&&t(o,{changedFields:l,forms:i.current}),s.triggerFormChange(o,l)},triggerFormFinish:(o,l)=>{n&&n(o,{values:l,forms:i.current}),s.triggerFormFinish(o,l)},registerForm:(o,l)=>{o&&(i.current={...i.current,[o]:l}),s.registerForm(o,l)},unregisterForm:o=>{const l={...i.current};delete l[o],i.current=l,s.unregisterForm(o)}}},r)};function Ei(){return Ei=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},Ei.apply(this,arguments)}const e0=(e,t)=>{const{name:n,initialValues:r,fields:s,form:i,preserve:o,children:l,component:c="form",validateMessages:h,validateTrigger:g="onChange",onValuesChange:f,onFieldsChange:m,onFinish:p,onFinishFailed:S,clearOnDestroy:y,...j}=e,v=ge.useRef(null),x=ge.useContext($i),[w]=Td(i),{useSubscribe:C,setInitialValues:b,setCallbacks:T,setValidateMessages:F,setPreserve:$,destroyForm:M}=w.getInternalHooks(Tn);ge.useImperativeHandle(t,()=>({...w,nativeElement:v.current})),ge.useEffect(()=>(x.registerForm(n,w),()=>{x.unregisterForm(n)}),[x,w,n]),F({...x.validateMessages,...h}),T({onValuesChange:f,onFieldsChange:(R,...z)=>{x.triggerFormChange(n,R),m&&m(R,...z)},onFinish:R=>{x.triggerFormFinish(n,R),p&&p(R)},onFinishFailed:S}),$(o);const I=ge.useRef(null);b(r,!I.current),I.current||(I.current=!0),ge.useEffect(()=>()=>M(y),[]);let A;const Y=typeof l=="function";if(Y){const R=w.getFieldsValue(!0);A=l(R,w)}else A=l;C(!Y);const H=ge.useRef(null);ge.useEffect(()=>{Kj(H.current||[],s||[])||w.setFields(s||[]),H.current=s},[s,w]);const k=ge.useMemo(()=>({...w,validateTrigger:g}),[w,g]),E=ge.createElement(Vs.Provider,{value:null},ge.createElement(On.Provider,{value:k},A));return c===!1?E:ge.createElement(c,Ei({},j,{ref:v,onSubmit:R=>{R.preventDefault(),R.stopPropagation(),w.submit()},onReset:R=>{var z;R.preventDefault(),w.resetFields(),(z=j.onReset)==null||z.call(j,R)}}),E)};function Na(e){try{return JSON.stringify(e)}catch{return Math.random()}}function t0(...e){const[t,n={}]=e,r=hj(n)?{form:n}:n,s=r.form,[i,o]=d.useState(()=>typeof t=="function"?t({}):void 0),l=d.useMemo(()=>Na(i),[i]),c=d.useRef(l);c.current=l;const h=d.useContext(On),g=s||h,f=g&&g._init;process.env.NODE_ENV!=="production"&&He(e.length===2?s?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(Tn),y=Hc((v,x)=>{const w=r.preserve?x??m(!0):v??m(),C=typeof t=="function"?t(w):Me(w,Ze(t));Na(i)!==Na(C)&&o(C)}),j=typeof t=="function"?t:JSON.stringify(t);return d.useEffect(()=>{f&&y()},[f,j]),d.useEffect(()=>f?S((x,w)=>{y(x,w)}):void 0,[f]),i}const n0=ge.forwardRef(e0),zr=n0;zr.FormProvider=Qj;zr.Field=vd;zr.List=Zj;zr.useForm=Td;zr.useWatch=t0;const or=d.createContext({}),Br=d.createContext({mode:"edit"}),r0=e=>Array.isArray(e)?e:typeof e=="function"?[e]:mn(e),s0=e=>{var re,le,ce;const{creatorButtonProps:t,deleteIconProps:n,copyIconProps:r,arrowSort:s,upIconProps:i,downIconProps:o,itemContainerRender:l,itemRender:c,alwaysShowItemLabel:h,prefixCls:g,creatorRecord:f,action:m,actionGuard:p,children:S,actionRender:y,fields:j,meta:v,field:x,index:w,formInstance:C,originName:b,containerClassName:T,containerStyle:F,min:$,max:M,count:I,...A}=e,{hashId:Y}=d.useContext(Vt),{componentSize:H}=((le=(re=u.ConfigProvider).useConfig)==null?void 0:le.call(re))||{componentSize:"middle"},k=d.useContext(er),E=d.useRef(!1),{mode:R}=d.useContext(Br),[z,_]=d.useState(!1),[V,Z]=d.useState(!1);d.useEffect(()=>()=>{E.current=!0},[]);const B=()=>C.getFieldValue([k.listName,b,w==null?void 0:w.toString()].flat(1).filter(de=>de!=null)),U={getCurrentRowData:B,setCurrentRowData:de=>{var be;const te=((be=C==null?void 0:C.getFieldsValue)==null?void 0:be.call(C))||{},ue=[k.listName,b,w==null?void 0:w.toString()].flat(1).filter(ne=>ne!=null),pe=_e(te,ue,{...B(),...de||{}});return C.setFieldsValue(pe)}},J=r0(S).map(de=>typeof de=="function"?de==null?void 0:de(x,w,{...m,...U},I):de).map((de,te)=>{var ue;return d.isValidElement(de)?d.cloneElement(de,{key:de.key||((ue=de==null?void 0:de.props)==null?void 0:ue.name)||te,...(de==null?void 0:de.props)||{}}):de}),G=d.useMemo(()=>{if(R==="read"||r===!1||M===I)return null;const{Icon:de=se.CopyOutlined,tooltipText:te}=r;return a.jsx(u.Tooltip,{title:te,children:V?a.jsx(se.LoadingOutlined,{}):a.jsx(de,{className:ie(`${g}-action-icon action-copy`,Y),onClick:async()=>{Z(!0);const ue=C==null?void 0:C.getFieldValue([k.listName,b,x.name].filter(pe=>pe!==void 0).flat(1));await m.add(ue,I),Z(!1)}})},"copy")},[r,M,I,V,g,Y,C,k.listName,x.name,b,m]),K=d.useMemo(()=>{if(R==="read"||n===!1||$===I)return null;const{Icon:de=se.DeleteOutlined,tooltipText:te}=n;return a.jsx(u.Tooltip,{title:te,children:z?a.jsx(se.LoadingOutlined,{}):a.jsx(de,{className:ie(`${g}-action-icon action-remove`,Y),onClick:async()=>{_(!0),await m.remove(x.name),E.current||_(!1)}})},"delete")},[n,$,I,z,g,Y,m,x.name]),O=d.useMemo(()=>{if(!s||R==="read"||i===!1)return null;const de=w-1;if(de<0)return null;const{Icon:te=se.ArrowUpOutlined,tooltipText:ue}=i;return a.jsx(u.Tooltip,{title:ue,children:a.jsx(te,{className:ie(`${g}-action-icon action-up`,Y),onClick:async()=>{await m.move(w,de)}})},"up")},[i,g,Y,m,s]),P=d.useMemo(()=>{if(!s||R==="read"||o===!1)return null;const de=w+1;if(de>=I)return null;const{Icon:te=se.ArrowDownOutlined,tooltipText:ue}=o;return a.jsx(u.Tooltip,{title:ue,children:a.jsx(te,{className:ie(`${g}-action-icon action-down`,Y),onClick:async()=>{await m.move(w,de)}})},"down")},[i,g,Y,m,s]),N=d.useMemo(()=>[G,K,O,P].filter(de=>de!=null),[G,K,O,P]),D=(y==null?void 0:y(x,m,N,I))||N,L=D.length>0&&R!=="read"?a.jsx("div",{className:ie(`${g}-action`,{[`${g}-action-small`]:H==="small"},Y),children:D}):null,W={name:A.name,field:x,index:w,record:(ce=C==null?void 0:C.getFieldValue)==null?void 0:ce.call(C,[k.listName,b,x.name].filter(de=>de!==void 0).flat(1)),fields:j,operation:m,meta:v},{grid:q}=ir(),X=(l==null?void 0:l(J,W))||J,ee=(c==null?void 0:c({listDom:a.jsx("div",{className:ie(`${g}-container`,T,Y),style:{width:q?"100%":void 0,...F},children:X}),action:L},W))||a.jsxs("div",{className:ie(`${g}-item`,Y,{[`${g}-item-default`]:h===void 0,[`${g}-item-show-label`]:h}),style:{display:"flex",alignItems:"flex-end"},children:[a.jsx("div",{className:ie(`${g}-container`,T,Y),style:{width:q?"100%":void 0,...F},children:X}),L]});return a.jsx(er.Provider,{value:{...x,listName:[k.listName,b,x.name].filter(de=>de!==void 0).flat(1)},children:ee})},a0=e=>{const t=Fe(),{creatorButtonProps:n,prefixCls:r,children:s,creatorRecord:i,action:o,fields:l,actionGuard:c,max:h,fieldExtraRender:g,meta:f,containerClassName:m,containerStyle:p,onAfterAdd:S,onAfterRemove:y}=e,{hashId:j}=d.useContext(Vt),v=d.useRef(new Map),[x,w]=d.useState(!1),C=d.useMemo(()=>l.map(I=>{var Y,H,k;(Y=v.current)!=null&&Y.has(I.key.toString())||(H=v.current)==null||H.set(I.key.toString(),Or());const A=(k=v.current)==null?void 0:k.get(I.key.toString());return{...I,uuid:A}}),[l]),b=d.useMemo(()=>{const I={...o},A=C.length;return c!=null&&c.beforeAddRow?I.add=async(...Y)=>{if(await c.beforeAddRow(...Y,A)){const k=o.add(...Y);return S==null||S(...Y,A+1),k}return!1}:I.add=async(...Y)=>{const H=o.add(...Y);return S==null||S(...Y,A+1),H},c!=null&&c.beforeRemoveRow?I.remove=async(...Y)=>{if(await c.beforeRemoveRow(...Y,A)){const k=o.remove(...Y);return y==null||y(...Y,A-1),k}return!1}:I.remove=async(...Y)=>{const H=o.remove(...Y);return y==null||y(...Y,A-1),H},I},[o,c==null?void 0:c.beforeAddRow,c==null?void 0:c.beforeRemoveRow,S,y,C.length]),T=d.useMemo(()=>{if(n===!1||C.length===h)return null;const{position:I="bottom",creatorButtonText:A=t.getMessage("editableTable.action.add","添加一行数据")}=n||{};return a.jsx(u.Button,{className:ie(`${r}-creator-button-${I}`,j),type:"dashed",loading:x,block:!0,icon:a.jsx(se.PlusOutlined,{}),...Le(n||{},["position","creatorButtonText"]),onClick:async()=>{w(!0);let Y=C.length;I==="top"&&(Y=0),await b.add(ht(i)??{},Y),w(!1)},children:A})},[n,C.length,h,t,r,j,x,b,i]),F=d.useContext(Br),$={width:"max-content",maxWidth:"100%",minWidth:"100%",...p},M=d.useMemo(()=>C.map((I,A)=>d.createElement(s0,{...e,key:I.uuid,field:I,index:A,action:b,count:C.length},s)),[s,e,C,b]);return F.mode==="read"||e.readonly===!0?a.jsx(a.Fragment,{children:M}):a.jsxs("div",{style:$,className:m,children:[n!==!1&&(n==null?void 0:n.position)==="top"&&T,M,g&&g(b,f),n!==!1&&(n==null?void 0:n.position)!=="top"&&T]})},i0=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 o0(e){return Be("ProFormList",t=>{const n={...t,componentCls:`.${e}`};return[i0(n)]})}const{noteOnce:wc}=He,er=d.createContext({});function l0(e){const t=d.useRef(),n=d.useContext(u.ConfigProvider.ConfigContext),r=d.useContext(er),s=n.getPrefixCls("pro-form-list"),i=Fe(),{setFieldValueType:o}=d.useContext(or),{transform:l,actionRender:c,creatorButtonProps:h,label:g,alwaysShowItemLabel:f,tooltip:m,creatorRecord:p,itemRender:S,rules:y,itemContainerRender:j,fieldExtraRender:v,copyIconProps:x={Icon:se.CopyOutlined,tooltipText:i.getMessage("copyThisLine","复制此项")},children:w,deleteIconProps:C={Icon:se.DeleteOutlined,tooltipText:i.getMessage("deleteThisLine","删除此项")},arrowSort:b,upIconProps:T={Icon:se.ArrowUpOutlined,tooltipText:i.getMessage("sortUpThisLine","向上排序")},downIconProps:F={Icon:se.ArrowDownOutlined,tooltipText:i.getMessage("sortDownThisLine","向下排序")},actionRef:$,style:M,prefixCls:I,actionGuard:A,min:Y,max:H,colProps:k,wrapperCol:E,rowProps:R,onAfterAdd:z,onAfterRemove:_,isValidateList:V=!1,emptyListMessage:Z="列表不能为空",className:B,containerClassName:U,containerStyle:J,readonly:G,...K}=e,{ColWrapper:O,RowWrapper:P}=ir({colProps:k,rowProps:R}),N=d.useContext(Nr),D=d.useMemo(()=>r.name===void 0?[K.name].flat(1):[r.name,K.name].flat(1),[r.name,K.name]);d.useImperativeHandle($,()=>({...t.current,get:q=>N.formRef.current.getFieldValue([...D,q]),getList:()=>N.formRef.current.getFieldValue([...D])}),[D,N.formRef]),d.useEffect(()=>{wc(!!N.formRef,"ProFormList 必须要放到 ProForm 中,否则会造成行为异常。"),wc(!!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(q=>q!==void 0),{valueType:"formList",transform:l})},[e.name,o,l]);const{wrapSSR:L,hashId:W}=o0(s);return N.formRef?L(a.jsx(O,{children:a.jsx("div",{className:ie(s,W),style:M,children:a.jsx(u.Form.Item,{label:g,prefixCls:I,tooltip:m,style:M,required:y==null?void 0:y.some(q=>q.required),wrapperCol:E,className:B,...K,name:V?D:void 0,rules:V?[{validator:(q,X)=>!X||X.length===0?Promise.reject(new Error(Z)):Promise.resolve(),required:!0}]:void 0,children:a.jsx(u.Form.List,{rules:y,...K,name:D,children:(q,X,ee)=>(t.current=X,a.jsxs(P,{children:[a.jsx(a0,{name:D,readonly:!!G,originName:K.name,copyIconProps:x,deleteIconProps:C,arrowSort:b,upIconProps:T,downIconProps:F,formInstance:N.formRef.current,prefixCls:s,meta:ee,fields:q,itemContainerRender:j,itemRender:S,fieldExtraRender:v,creatorButtonProps:h,creatorRecord:p,actionRender:c,action:X,actionGuard:A,alwaysShowItemLabel:f,min:Y,max:H,count:q.length,onAfterAdd:(re,le,ce)=>{V&&N.formRef.current.validateFields([D]),z==null||z(re,le,ce)},onAfterRemove:(re,le)=>{V&&le===0&&N.formRef.current.validateFields([D]),_==null||_(re,le)},containerClassName:U,containerStyle:J,children:w}),a.jsx(u.Form.ErrorList,{errors:ee.errors})]}))})})})})):null}const na=({name:e,originDependencies:t=e,children:n,ignoreFormListField:r,...s})=>{const i=d.useContext(Nr),o=d.useContext(er),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 a.jsx(u.Form.Item,{...s,noStyle:!0,shouldUpdate:(c,h,g)=>{var f;return typeof s.shouldUpdate=="boolean"?s.shouldUpdate:typeof s.shouldUpdate=="function"?(f=s.shouldUpdate)==null?void 0:f.call(s,c,h,g):l.some(m=>!hn(Me(c,m),Me(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),Me(y,p)&&(h=_e(h,[S].flat(1),Me(y,p)))):(y=(f=c.getFieldValue)==null?void 0:f.call(c,p),typeof y<"u"&&(h=_e(h,[S].flat(1),y)))}return n==null?void 0:n(h,{...c,...i})}})};na.displayName="ProFormDependency";const c0=d.createContext({}),u0=e=>{var v,x,w;const{children:t,onChange:n,onBlur:r,ignoreFormItem:s,valuePropName:i="value",...o}=e,l=((v=t==null?void 0:t.type)==null?void 0:v.displayName)!=="ProFormComponent",c=!d.isValidElement(t),h=xe(function(...C){var b,T,F,$,M;n==null||n(...C),!l&&(c||((T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...C),(M=($=(F=t==null?void 0:t.props)==null?void 0:F.fieldProps)==null?void 0:$.onChange)==null||M.call($,...C)))}),g=xe(function(...C){var b,T,F,$,M;l||c||(r==null||r(...C),(T=(b=t==null?void 0:t.props)==null?void 0:b.onBlur)==null||T.call(b,...C),(M=($=(F=t==null?void 0:t.props)==null?void 0:F.fieldProps)==null?void 0:$.onBlur)==null||M.call($,...C))}),f=ct(()=>{var C;return Le(((C=t==null?void 0:t.props)==null?void 0:C.fieldProps)||{},["onBlur","onChange"])},[Le(((x=t==null?void 0:t.props)==null?void 0:x.fieldProps)||{},["onBlur","onChange"])]),m=e[i],p=d.useMemo(()=>{if(!l&&!c)return it({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(...C)=>{var b,T;n==null||n(...C),(T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...C)}},[p,t,n]);if(!d.isValidElement(t))return a.jsx(a.Fragment,{children:t});const y=o.variant,j=o.fieldProps;return d.cloneElement(t,it({...o,[i]:e[i],...t.props,onChange:S,...!l&&p?{fieldProps:{...(w=t.props)==null?void 0:w.fieldProps,...j,...p}}:{},...y!==void 0&&{variant:y},onBlur:l&&!c&&typeof r=="function"?r:void 0}))},jc=({children:e,addonAfter:t,addonBefore:n,valuePropName:r,addonWarpStyle:s,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?a.jsx(u.Form.Item,{...l,valuePropName:r,getValueProps:h,children:e}):a.jsx(u.Form.Item,{...l,help:typeof o!="function"?o:void 0,valuePropName:r,_internalItemRender:{mark:"pro_table_render",render:(g,f)=>a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",...s},children:[n?a.jsx("div",{style:{marginInlineEnd:8},children:n}):null,f.input,t?a.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 a.jsx(c0.Provider,{value:{name:l.name,label:l.label},children:c})},Fd=e=>{var C,b,T,F,$,M;const{componentSize:t}=((b=(C=u.ConfigProvider)==null?void 0:C.useConfig)==null?void 0:b.call(C))||{componentSize:"middle"},n=t,{valueType:r,transform:s,dataFormat:i,ignoreFormItem:o,lightProps:l,children:c,fieldProps:h,...g}=e,f=d.useContext(er),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(or);d.useEffect(()=>{!p||!e.name||p(m,{valueType:r||"text",dateFormat:i,transform:s})},[m,i,e.name,p,s,r]);const y=d.isValidElement(e.children)&&Ap(r||e.children.props.valueType),j=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(jc,{...g,name:m,key:g.proFormFieldKey||((T=g.name)==null?void 0:T.toString())},e.children);const v=a.jsx(u0,{valuePropName:e.valuePropName,children:e.children},g.proFormFieldKey||((F=g.name)==null?void 0:F.toString())),x=it(l||{}),w=j?v:d.createElement(S0,{...x,key:g.proFormFieldKey||(($=g.name)==null?void 0:$.toString()),size:n},v);return o?a.jsx(a.Fragment,{children:w}):a.jsx(jc,{...S,...g,name:m,isListField:f.name!==void 0,children:w},g.proFormFieldKey||((M=g.name)==null?void 0:M.toString()))},vc={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},d0=["switch","radioButton","radio","rate"];function Gn(e,t){e.displayName="ProFormComponent";const n=s=>{const{valueType:i,customLightMode:o,lightFilterLabelFormatter:l,valuePropName:c="value",ignoreWidth:h,defaultProps:g,...f}={...s==null?void 0:s.fieldConfig,...t},{label:m,tooltip:p,placeholder:S,width:y,bordered:j,messageVariables:v,ignoreFormItem:x,transform:w,convertValue:C,readonly:b,allowClear:T,colSize:F,getFormItemProps:$,getFieldProps:M,fieldConfig:I,cacheForSwr:A,proFieldProps:Y,...H}={...g,...s},k=i||H.valueType,E=d.useMemo(()=>h||d0.includes(k),[h,k]),[,R]=d.useState(),[z,_]=d.useState(),V=d.useContext(or),Z=ct(()=>({formItemProps:$==null?void 0:$(),fieldProps:M==null?void 0:M()}),[M,$,H.dependenciesValues,z]),B=ct(()=>{const re={...x?it({value:H.value}):{},placeholder:S,disabled:s.disabled,...V.fieldProps,...Z.fieldProps,...H.fieldProps};return re.style=it(re==null?void 0:re.style),re},[x,H.value,H.fieldProps,S,s.disabled,V.fieldProps,Z.fieldProps]),U=Bp(H),J=ct(()=>({...V.formItemProps,...U,...Z.formItemProps,...H.formItemProps}),[Z.formItemProps,V.formItemProps,H.formItemProps,U]),G=ct(()=>({messageVariables:v,...f,...J}),[f,J,v]),{prefixName:K}=d.useContext(On),O=ct(()=>{let re=G==null?void 0:G.name;return Array.isArray(re)&&(re=re.join("_")),Array.isArray(K)&&re&&(re=`${K.join(".")}.${re}`),re&&`form-${V.formKey??""}-field-${re}`},[dn(G==null?void 0:G.name),K,V.formKey]),P=xe((...re)=>{var le;$||M?_([]):H.formItemRender&&R([]),(le=B==null?void 0:B.onChange)==null||le.call(B,...re)}),N=ct(()=>{const re={width:y&&!vc[y]?y:V.grid?"100%":void 0,...B==null?void 0:B.style};return E&&Reflect.deleteProperty(re,"width"),it(re)},[dn(B==null?void 0:B.style),V.grid,E,y]),D=ct(()=>{const re=y&&vc[y];return ie(B==null?void 0:B.className,{"pro-field":re,[`pro-field-${y}`]:re&&!E})||void 0},[y,B==null?void 0:B.className,E]),L=ct(()=>it({...V.proFieldProps,mode:H==null?void 0:H.mode,readonly:b,params:H.params,proFieldKey:O,cacheForSwr:A,...Y}),[V.proFieldProps,H==null?void 0:H.mode,H.params,b,O,A,Y]),W=ct(()=>({onChange:P,allowClear:T,...B,style:N,className:D}),[T,D,P,B,N]),q=ct(()=>a.jsx(e,{...H,fieldProps:W,proFieldProps:L,ref:s==null?void 0:s.fieldRef},s.proFormFieldKey||s.name),[L,W,H]),X=ct(()=>{var re,le,ce;return a.jsx(Fd,{label:m&&(Y==null?void 0:Y.light)!==!0?m:void 0,tooltip:(Y==null?void 0:Y.light)!==!0&&p,valuePropName:c,...G,ignoreFormItem:x,transform:w,dataFormat:B==null?void 0:B.format,valueType:k,messageVariables:{label:m||"",...G==null?void 0:G.messageVariables},convertValue:C,lightProps:it({...B,variant:H.variant??(B==null?void 0:B.variant),valueType:k,bordered:j,allowClear:((re=q==null?void 0:q.props)==null?void 0:re.allowClear)??T,light:Y==null?void 0:Y.light,label:m,customLightMode:o,labelFormatter:l,valuePropName:c,footerRender:(le=q==null?void 0:q.props)==null?void 0:le.footerRender,...H.lightProps,...G.lightProps}),children:q},s.proFormFieldKey||((ce=G.name)==null?void 0:ce.toString()))},[m,Y==null?void 0:Y.light,p,c,s.proFormFieldKey,G,x,w,B,k,C,j,q,T,o,l,H.lightProps]),{ColWrapper:ee}=ir(H);return a.jsx(ee,{children:X})};return s=>{const{dependencies:i}=s;return i?a.jsx(na,{name:i,originDependencies:s==null?void 0:s.originDependencies,children:o=>a.jsx(n,{dependenciesValues:o,dependencies:i,...s})}):a.jsx(n,{dependencies:i,...s})}}var Rr=function(){return Rr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Rr.apply(this,arguments)};function f0(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(s){var i=e[s];i!=null?Array.isArray(i)?(r.searchParams.delete(s),i.forEach(function(o){r.searchParams.append(s,o)})):i instanceof Date?Number.isNaN(i.getTime())||r.searchParams.set(s,i.toISOString()):typeof i=="object"?r.searchParams.set(s,JSON.stringify(i)):r.searchParams.set(s,i):r.searchParams.delete(s)}),r}function h0(e,t){var n;e===void 0&&(e={}),t===void 0&&(t={disabled:!1});var r=d.useState(),s=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=Rr({},e);return g.forEach(function(m){var p=m[0],S=m[1];f[p]=g0(p,S,{},e)}),f},[t.disabled,e,o]);function c(g){if(!(typeof window>"u"||!window.URL)){var f=f0(g);window.location.search!==f.search&&window.history.replaceState({},"",f.toString()),o.toString()!==f.searchParams.toString()&&s({})}}d.useEffect(function(){t.disabled||typeof window>"u"||!window.URL||c(Rr(Rr({},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(){s({})};return window.addEventListener("popstate",g),function(){window.removeEventListener("popstate",g)}},[t.disabled]),[l,h]}var m0={true:!0,false:!1};function g0(e,t,n,r){if(!n)return t;var s=n[e],i=t===void 0?r[e]:t;return s===Number?Number(i):s===Boolean||t==="true"||t==="false"?m0[i]:Array.isArray(s)?s.find(function(o){return o==i})||r[e]:i}const p0=e=>{const t=Fe(),n=u.Form.useFormInstance();if(e.render===!1)return null;const{onSubmit:r,render:s,onReset:i,searchConfig:o={},submitButtonProps:l,resetButtonProps:c}=e,{token:h}=fn.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,{...Le(c??{},["preventDefault","fieldProps"]),key:"rest",onClick:j=>{var v;c!=null&&c.preventDefault||f(),(v=c==null?void 0:c.onClick)==null||v.call(c,j)}},p)),l!==!1&&S.push(d.createElement(u.Button,{type:"primary",...Le(l||{},["preventDefault","fieldProps"]),key:"submit",onClick:j=>{var v;l!=null&&l.preventDefault||g(),(v=l==null?void 0:l.onClick)==null||v.call(l,j)}},m));const y=s?s({...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]:a.jsx("div",{style:{display:"flex",gap:h.marginXS,alignItems:"center"},children:y}):y:null},{noteOnce:Tc}=He,Is=(e,t,n)=>e===!0?t:ht(e,t,n),ds=e=>!e||Array.isArray(e)?e:[e],Rd={};function y0(e){var V,Z;const{children:t,contentRender:n,submitter:r,fieldProps:s,formItemProps:i,groupProps:o,transformKey:l,formRef:c,onInit:h,form:g,loading:f,formComponentType:m,extraUrlParams:p=Rd,syncToUrl:S,onUrlSearchChange:y,onReset:j,omitNil:v=!0,isKeyPressSubmit:x,autoFocusFirstInput:w=!0,grid:C,rowProps:b,colProps:T,...F}=e,$=u.Form.useFormInstance(),{componentSize:M}=((Z=(V=u.ConfigProvider)==null?void 0:V.useConfig)==null?void 0:Z.call(V))||{componentSize:"middle"},I=d.useRef(g||$),{RowWrapper:A}=ir({grid:C,rowProps:b}),Y=xe(()=>$),H=d.useMemo(()=>({getFieldsFormatValue:(B,U)=>{const J=Y();if(!J)return{};const G=J.getFieldsValue(B);return l(G,U!==void 0?U:v)},getFieldFormatValue:(B=[],U)=>{const J=Y();if(!J)return;const G=ds(B);if(!G)throw new Error("nameList is require");const K=J.getFieldValue(G),O=G?_e({},G,K):K,P=[...G];P.shift();const N=l(O,U!==void 0?U:v,P),D=Me(N,G);if(D&&typeof D=="object"&&!Array.isArray(D)){const L=Object.values(D)[0];return Array.isArray(L),L}return D},getFieldFormatValueObject:(B,U)=>{const J=Y();if(!J)return{};const G=ds(B),K=J.getFieldValue(G),O=G?_e({},G,K):K;return l(O,U!==void 0?U:v,G)},validateFieldsReturnFormatValue:async(B,U)=>{const J=Y();if(!J)return{};if(!Array.isArray(B)&&B)throw new Error("nameList must be array");const G=await J.validateFields(B),K=l(G,U!==void 0?U:v);return K||{}}}),[v,l,Y]),k=d.useMemo(()=>d.Children.toArray(t).map((B,U)=>U===0&&d.isValidElement(B)&&w?Vi(B,w):B),[w,t]),E=d.useMemo(()=>typeof r=="boolean"||!r?{}:r,[r]),R=d.useMemo(()=>{if(r!==!1)return a.jsx(p0,{...E,onReset:()=>{var U,J,G;const B=l((U=I.current)==null?void 0:U.getFieldsValue(),v);if((J=E==null?void 0:E.onReset)==null||J.call(E,B),j==null||j(B),S){const K=Object.keys(l((G=I.current)==null?void 0:G.getFieldsValue(),!1)).reduce((O,P)=>({...O,[P]:B[P]||void 0}),p);y(Is(S,K||{},"set"))}},submitButtonProps:{loading:f,...E.submitButtonProps}},"submitter")},[r,E,f,l,v,j,S,p,y]),z=d.useMemo(()=>{const B=C?a.jsx(A,{children:k}):k;return n?n(B,R,I.current):B},[C,A,k,n,R]),_=Tr(e.initialValues);return d.useEffect(()=>{if(S||!e.initialValues||!_||F.request)return;const B=hn(e.initialValues,_);Tc(B,"initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null "),Tc(B,"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,()=>({...I.current,getFieldsFormatValue:(B,U)=>{const J=I.current;if(!J)return{};const G=J.getFieldsValue(B);return l(G,U!==void 0?U:v)},getFieldFormatValue:(B=[],U)=>{const J=I.current;if(!J)return;const G=ds(B);if(!G)throw new Error("nameList is require");const K=J.getFieldValue(G),O=G?_e({},G,K):K,P=[...G];P.shift();const N=l(O,U!==void 0?U:v,P),D=Me(N,G);if(D&&typeof D=="object"&&!Array.isArray(D)){const L=Object.values(D)[0];return Array.isArray(L),L}return D},getFieldFormatValueObject:(B,U)=>{const J=I.current;if(!J)return{};const G=ds(B),K=J.getFieldValue(G),O=G?_e({},G,K):K;return l(O,U!==void 0?U:v,G)},validateFieldsReturnFormatValue:async(B,U)=>{const J=I.current;if(!J)return{};if(!Array.isArray(B)&&B)throw new Error("nameList must be array");const G=await J.validateFields(B),K=l(G,U!==void 0?U:v);return K||{}}}),[v,l,I.current]),d.useEffect(()=>{var U,J;const B=l((J=(U=I.current)==null?void 0:U.getFieldsValue)==null?void 0:J.call(U,!0),v);h==null||h(B,{...I.current,...H})},[]),a.jsx(Nr.Provider,{value:{...H,formRef:I},children:a.jsx(u.ConfigProvider,{componentSize:F.size||M,children:a.jsxs(eo.Provider,{value:{grid:C,colProps:T},children:[F.component!==!1&&a.jsx("input",{type:"text",style:{display:"none"}}),z]})})})}let Fc=0;function lr(e){const{extraUrlParams:t=Rd,syncToUrl:n,isKeyPressSubmit:r,syncToUrlAsImportant:s=!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:j,formComponentType:v,onReset:x,grid:w,rowProps:C,colProps:b,omitNil:T=!0,request:F,params:$,initialValues:M,formKey:I=Fc,readonly:A,onLoadingChange:Y,loading:H,...k}=e,E=d.useRef({}),[R,z]=Je(!1,H),_=xe(ce=>{Y==null||Y(ce)}),V=d.useCallback(ce=>{z(de=>{const te=typeof ce=="function"?ce(de):ce;return queueMicrotask(()=>{_(te)}),te})},[_]),[Z,B]=h0({},{disabled:!n}),U=d.useRef(Or());d.useEffect(()=>{Fc+=0},[]);const[J,G]=Ep({request:F,params:$,proFieldKey:I}),{getPrefixCls:K}=d.useContext(u.ConfigProvider.ConfigContext),O=K("pro-form"),{wrapSSR:P,hashId:N}=Be("ProForm",ce=>({[`.${O}`]:{[`> div:not(${ce.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}}}}})),[D,L]=d.useState(()=>n?Is(n,Z,"get"):{}),W=d.useRef({}),q=d.useRef({}),X=xe((ce,de,te)=>!ce||typeof ce!="object"?ce:$C(ci(ce,p,q.current,de,te),W.current));d.useEffect(()=>{i||L({})},[i]);const ee=xe(()=>({...Z,...t}));d.useEffect(()=>{n&&B(Is(n,ee(),"set"))},[t,ee,n]);const re=d.useMemo(()=>{if(!(typeof window>"u")&&v&&["DrawerForm"].includes(v))return ce=>ce.parentNode||document.body},[v]),le=xe(async()=>{var ce,de,te,ue;if(k.onFinish&&!R)try{V(!0);const pe=((de=(ce=E==null?void 0:E.current)==null?void 0:ce.getFieldsFormatValue)==null?void 0:de.call(ce))||{},be=k.onFinish(pe);if(be&&typeof be=="object"&&typeof be.then=="function"){try{await be}catch(ne){throw V(!1),ne}V(!1)}else V(!1);if(n){const ne=Object.keys(((ue=(te=E==null?void 0:E.current)==null?void 0:te.getFieldsFormatValue)==null?void 0:ue.call(te,!0,!1))||{}).reduce((ae,Q)=>({...ae,[Q]:pe[Q]??void 0}),t);Object.keys(Z).forEach(ae=>{ne[ae]!==!1&&ne[ae]!==0&&!ne[ae]&&(ne[ae]=void 0)}),B(Is(n,ne,"set"))}}catch{V(!1)}});return d.useImperativeHandle(S,()=>E.current,[!J]),F&&G?a.jsx("div",{style:{paddingTop:50,paddingBottom:50,textAlign:"center"},children:a.jsx(u.Spin,{})}):P(a.jsx(Br.Provider,{value:{mode:e.readonly?"read":"edit"},children:a.jsx(In,{needDeps:!0,children:a.jsx(or.Provider,{value:{formRef:E,fieldProps:h,proFieldProps:g,formItemProps:f,groupProps:m,formComponentType:v,getPopupContainer:re,formKey:U.current,setFieldValueType:(ce,{valueType:de="text",dateFormat:te,transform:ue})=>{Array.isArray(ce)&&(ue&&(W.current=_e(W.current,ce,ue)),q.current=_e(q.current,ce,{valueType:de,dateFormat:te}))}},children:a.jsx(er.Provider,{value:{},children:a.jsx(u.Form,{onKeyDown:ce=>{var de;r&&ce.key==="Enter"&&((de=E.current)==null||de.submit())},autoComplete:"off",form:j,...Le(k,["ref","labelWidth","autoFocusFirstInput","rootClassName"]),ref:ce=>{E.current&&(E.current.nativeElement=ce==null?void 0:ce.nativeElement,E.current.focus=()=>{var te;const de=(te=ce==null?void 0:ce.nativeElement)==null?void 0:te.querySelector("input, textarea, select");de==null||de.focus()})},initialValues:s?{...M,...J,...D}:{...D,...M,...J},onValuesChange:(ce,de)=>{var te;(te=k==null?void 0:k.onValuesChange)==null||te.call(k,X(ce,!!T),X(de,!!T))},className:e.className,rootClassName:ie(O,N,e.rootClassName),onFinish:le,children:a.jsx(y0,{transformKey:X,autoComplete:"off",loading:R||!!(F&&!J&&G),onUrlSearchChange:B,...e,formRef:E,initialValues:{...M,...J}})})})})})}))}const x0=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 b0(e){return Be("LightWrapper",t=>{const n={...t,componentCls:`.${e}`};return[x0(n)]})}const S0=e=>{var H;const{label:t,size:n,disabled:r,onChange:s,className:i,style:o,children:l,valuePropName:c,placeholder:h,labelFormatter:g,variant:f,footerRender:m,allowClear:p,otherFieldProps:S,valueType:y,placement:j,...v}=e,{getPrefixCls:x}=d.useContext(u.ConfigProvider.ConfigContext),w=x("pro-field-light-wrapper"),{wrapSSR:C,hashId:b}=b0(w),[T,F]=d.useState(e[c]),[$,M]=d.useState(!1),I=(...k)=>{var E;(E=S==null?void 0:S.onChange)==null||E.call(S,...k),s==null||s(...k)},A=e[c],Y=d.useMemo(()=>{var E;if(!A)return A;const k=(E=y==null?void 0:y.toLowerCase)==null?void 0:E.call(y);return k!=null&&k.endsWith("range")&&k!=="digitrange"&&!g?Sp(A,y&&Hi[y]||"YYYY-MM-DD"):Array.isArray(A)?A.map(R=>typeof R=="object"&&R.label&&R.value?R.label:R):A},[A,y,g]);return C(a.jsx(Ou,{disabled:r,open:$,onOpenChange:M,placement:j,label:a.jsx(Ht,{ellipsis:!0,size:n,onClear:()=>{I==null||I(),F(null)},variant:f,style:o,className:i,label:t,placeholder:h,value:Y,disabled:r,formatter:g,allowClear:p}),footer:{onClear:()=>F(null),onConfirm:()=>{I==null||I(T),M(!1)}},footerRender:m,children:a.jsx("div",{className:ie(`${w}-container`,b,i),style:o,children:d.cloneElement(l,{...v,[c]:T,onChange:k=>{F(k!=null&&k.target?k.target.value:k)},...l.props,variant:"borderless",fieldProps:{...(H=l.props)==null?void 0:H.fieldProps,variant:"borderless"}})})}))},C0=e=>{const{fieldProps:t,children:n,labelCol:r,label:s,autoFocus:i,isDefaultDom:o,render:l,proFieldProps:c,formItemRender:h,valueType:g,initialValue:f,onChange:m,valueEnum:p,params:S,name:y,dependenciesValues:j,cacheForSwr:v=!1,valuePropName:x="value",...w}=e,C=d.useContext(Br),b=d.useMemo(()=>j&&w.request?{...S,...j||{}}:S,[j,S,w.request]),T=xe((...M)=>{var I;if(t!=null&&t.onChange){(I=t==null?void 0:t.onChange)==null||I.call(t,...M);return}}),F=d.useMemo(()=>({autoFocus:i,...t,onChange:T}),[i,t,T]),$=d.useMemo(()=>{if(n)return d.isValidElement(n)?d.cloneElement(n,{...w,onChange:(...M)=>{var I;if(t!=null&&t.onChange){(I=t==null?void 0:t.onChange)==null||I.call(t,...M);return}m==null||m(...M)},...(n==null?void 0:n.props)||{}}):a.jsx(a.Fragment,{children:n})},[n,t==null?void 0:t.onChange,m,w]);return $||a.jsx(dj,{text:t==null?void 0:t[x],render:l,formItemRender:h,valueType:g||"text",cacheForSwr:v,fieldProps:F,valueEnum:ht(p),...c,...w,mode:(c==null?void 0:c.mode)||C.mode||"edit",params:b})},yn=Gn==null?void 0:Gn(C0),w0=({fieldProps:e,min:t,proFieldProps:n,max:r,...s},i)=>a.jsx(In,{valueTypeMap:{digit:{render:(o,l)=>a.jsx(zs,{...l,text:o,placeholder:l.placeholder}),formItemRender:(o,l)=>a.jsx(zs,{...l,text:o,placeholder:l.placeholder})}},children:a.jsx(yn,{valueType:"digit",fieldProps:{min:t,max:r,...e},ref:i,fieldConfig:{defaultProps:{width:"100%"}},proFieldProps:n,...s})}),j0=d.forwardRef(w0),v0={space:u.Space,group:u.Space.Compact};function T0(e,...t){const n=t[0];return n&&n.target&&e in n.target?n.target[e]:n}const F0=e=>{const{children:t,value:n=[],valuePropName:r,onChange:s,fieldProps:i,space:o,type:l="space",transform:c,convertValue:h,lightProps:g,...f}=e,m=xe((x,w)=>{var b;const C=[...n];C[w]=T0(r||"value",x),s==null||s(C),(b=i==null?void 0:i.onChange)==null||b.call(i,C)});let p=-1;const S=mn(ht(t,n,e)).map(x=>{var w,C,b;if(d.isValidElement(x)){p+=1;const T=p,$=((w=x==null?void 0:x.type)==null?void 0:w.displayName)==="ProFormComponent"||((C=x==null?void 0:x.props)==null?void 0:C.readonly)?{key:T,ignoreFormItem:!0,...x.props||{},fieldProps:{...(b=x==null?void 0:x.props)==null?void 0:b.fieldProps,onChange:(...M)=>{m(M[0],T)}},value:n==null?void 0:n[T],onChange:void 0}:{key:T,...x.props||{},value:n==null?void 0:n[T],onChange:M=>{var I,A;m(M,T),(A=(I=x.props).onChange)==null||A.call(I,M)}};return d.cloneElement(x,$)}return x}),y=v0[l],{RowWrapper:j}=ir(f),v=d.useCallback(({children:x})=>{const w={...o,align:"start"};return l==="space"&&(o==null?void 0:o.wrap)!==void 0&&(w.wrap=o.wrap),a.jsx(y,{...w,children:x})},[y,o,l]);return a.jsx(j,{Wrapper:v,children:S})},R0=d.forwardRef(({children:e,space:t,valuePropName:n,...r},s)=>(d.useImperativeHandle(s,()=>({})),a.jsx(F0,{space:t,valuePropName:n,...r.fieldProps,onChange:void 0,...r,children:e}))),$0=Gn==null?void 0:Gn(R0),E0=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 I0(e){return Be("ProFormGroup",t=>{const n={...t,componentCls:`.${e}`};return[E0(n)]})}const $d=d.forwardRef((e,t)=>{const{groupProps:n}=d.useContext(or),{children:r,collapsible:s,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:j,autoFocus:v}={...n,...e},[x,w]=Je(()=>i||!1,e.collapsed),C=xe(_=>{var V;(V=e.onCollapse)==null||V.call(e,_)}),b=d.useCallback(_=>{w(V=>{const Z=typeof _=="function"?_(V):_;return queueMicrotask(()=>{C(Z)}),Z})},[C]),{getPrefixCls:T}=d.useContext(u.ConfigProvider.ConfigContext),{ColWrapper:F,RowWrapper:$}=ir(e),M=T("pro-form-group"),{wrapSSR:I,hashId:A}=I0(M),Y=s&&a.jsx(se.RightOutlined,{style:{marginInlineEnd:8},rotate:x?void 0:90}),H=a.jsx(Jn,{label:Y?a.jsxs("div",{children:[Y,c]}):c,tooltip:h}),k=d.useCallback(({children:_})=>a.jsx(u.Space,{...y,className:ie(`${M}-container ${A}`,y==null?void 0:y.className),size:m,align:g,orientation:f,style:{rowGap:0,...y==null?void 0:y.style},children:_}),[g,M,f,A,m,y]),E=S?S(H,e):H,[R,z]=d.useMemo(()=>{const _=[],V=d.Children.toArray(r).map((Z,B)=>{var U;return d.isValidElement(Z)&&((U=Z==null?void 0:Z.props)!=null&&U.hidden)?(_.push(Z),null):B===0&&d.isValidElement(Z)&&v?Vi(Z,v):Z});return[a.jsx($,{Wrapper:k,children:V},"children"),_.length>0?a.jsx("div",{style:{display:"none"},children:_},"hidden"):null]},[r,$,k,v]);return I(a.jsx(F,{children:a.jsxs("div",{className:ie(M,A,{[`${M}-twoLine`]:l==="twoLine"}),style:o,ref:t,children:[z,(c||h||j)&&a.jsx("div",{role:"button",tabIndex:0,className:ie(`${M}-title`,A),style:p,onClick:()=>{b(!x)},onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),b(!x))},children:j?a.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[E,a.jsx("span",{role:"presentation",onClick:_=>_.stopPropagation(),onKeyDown:_=>_.stopPropagation(),children:j})]}):E}),a.jsx("div",{style:{display:s&&x?"none":void 0},children:R})]})}))});$d.displayName="ProForm-Group";const M0=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 O0(e){return Be("DrawerForm",t=>{const n={...t,componentCls:`.${e}`};return[M0(n)]})}const{noteOnce:A0}=He;function k0({children:e,trigger:t,drawerProps:n,onFinish:r,submitTimeout:s,title:i,width:o,resize:l,onOpenChange:c,open:h,...g}){var U,J,G,K;A0(!g.footer||!(n!=null&&n.footer),"DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const f=d.useMemo(()=>{const O={onResize:()=>{},maxWidth:Wi()?window.innerWidth*.8:void 0,minWidth:300};return typeof l=="boolean"?l?O:{}:it({onResize:(l==null?void 0:l.onResize)??O.onResize,maxWidth:(l==null?void 0:l.maxWidth)??O.maxWidth,minWidth:(l==null?void 0:l.minWidth)??O.minWidth})},[l]),m=d.useContext(u.ConfigProvider.ConfigContext),p=m.getPrefixCls("pro-form-drawer"),{wrapSSR:S,hashId:y}=O0(p),j=O=>`${p}-${O}`,[,v]=d.useState([]),[x,w]=d.useState(!1),[C,b]=d.useState(!1),[T,F]=d.useState(o||(l?f==null?void 0:f.minWidth:800)),[$,M]=Je(!!h,h),I=xe(O=>{c==null||c(O)}),A=d.useCallback(O=>{M(P=>{const N=typeof O=="function"?O(P):O;return queueMicrotask(()=>{I(N)}),N})},[I]),Y=d.useRef(null),H=d.useCallback(O=>{Y.current===null&&O&&v([]),Y.current=O},[]),k=d.useRef(),E=d.useCallback(()=>{var P;const O=((P=g.formRef)==null?void 0:P.current)??g.form??k.current;O&&(n!=null&&n.destroyOnHidden)&&typeof O.resetFields=="function"&&O.resetFields()},[n==null?void 0:n.destroyOnHidden,g.form,g.formRef]);d.useEffect(()=>{$&&h&&(c==null||c(!0)),C&&F(f==null?void 0:f.minWidth)},[h,$,C]),d.useImperativeHandle(g.formRef,()=>k.current,[k.current]);const R=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async O=>{var P,N;A(!$),b(!Object.keys(f)),(N=(P=t.props)==null?void 0:P.onClick)==null||N.call(P,O)}}):null,[A,t,$,b,C]),z=d.useMemo(()=>{var O,P,N,D;return g.submitter===!1?!1:Un({searchConfig:{submitText:((P=(O=m.locale)==null?void 0:O.Modal)==null?void 0:P.okText)??"确认",resetText:((D=(N=m.locale)==null?void 0:N.Modal)==null?void 0:D.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:s&&x,onClick:L=>{var W;A(!1),(W=n==null?void 0:n.onClose)==null||W.call(n,L)}}},g.submitter??{})},[g.submitter,(J=(U=m.locale)==null?void 0:U.Modal)==null?void 0:J.okText,(K=(G=m.locale)==null?void 0:G.Modal)==null?void 0:K.cancelText,s,x,A,n]),_=d.useCallback((O,P)=>a.jsxs(a.Fragment,{children:[O,Y.current&&P?a.jsx(d.Fragment,{children:Nc.createPortal(P,Y.current)},"submitter"):P]}),[]),V=xe(async O=>{const P=r==null?void 0:r(O);if(s&&P instanceof Promise){w(!0);const D=setTimeout(()=>w(!1),s);try{const L=await P;return clearTimeout(D),w(!1),L&&A(!1),L}catch(L){throw clearTimeout(D),w(!1),L}}else if(s){w(!0);const D=setTimeout(()=>w(!1),s);try{const L=await P;return clearTimeout(D),w(!1),L&&A(!1),L}catch(L){throw clearTimeout(D),w(!1),L}}const N=await P;return N&&A(!1),N}),Z=d.useCallback(O=>{const P=(document.body.offsetWidth||1e3)-(O.clientX-document.body.offsetLeft),N=(f==null?void 0:f.minWidth)??(o||800),D=(f==null?void 0:f.maxWidth)??window.innerWidth*.8;if(P<N){F(N);return}if(P>D){F(D);return}F(P)},[f==null?void 0:f.maxWidth,f==null?void 0:f.minWidth,o]),B=d.useCallback(()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",B)},[Z]);return S(a.jsxs(a.Fragment,{children:[a.jsxs(u.Drawer,{...n,destroyOnHidden:n==null?void 0:n.destroyOnHidden,title:i,size:T,open:$,afterOpenChange:O=>{var P;!O&&(n!=null&&n.destroyOnHidden)&&E(),(P=n==null?void 0:n.afterOpenChange)==null||P.call(n,O),c==null||c(O)},onClose:O=>{var P;s&&x||(A(!1),(P=n==null?void 0:n.onClose)==null||P.call(n,O))},footer:g.submitter!==!1&&a.jsx("div",{ref:H,style:{display:"flex",justifyContent:"flex-end"}}),children:[l?a.jsx("div",{className:ie(j("sidebar-dragger"),y,{[j("sidebar-dragger-min-disabled")]:T===(f==null?void 0:f.minWidth),[j("sidebar-dragger-max-disabled")]:T===(f==null?void 0:f.maxWidth)}),onMouseDown:O=>{var P;(P=f==null?void 0:f.onResize)==null||P.call(f),O.stopPropagation(),O.preventDefault(),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",B),b(!0)}}):null,a.jsx(a.Fragment,{children:a.jsx(lr,{formComponentType:"DrawerForm",layout:"vertical",...g,formRef:k,onInit:(O,P)=>{var N;g.formRef&&(g.formRef.current=P),(N=g==null?void 0:g.onInit)==null||N.call(g,O,P),k.current=P},submitter:z,onFinish:async O=>await V(O),contentRender:_,children:e})})]}),R]}))}const D0=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 P0(e){return Be("LightFilter",t=>{const n={...t,componentCls:`.${e}`};return[D0(n)]})}const N0=e=>{const{items:t,prefixCls:n,size:r="middle",collapse:s,collapseLabel:i,onValuesChange:o,variant:l="borderless",values:c,footerRender:h,placement:g,popoverProps:f}=e,m=Fe(),p=`${n}-light-filter`,{wrapSSR:S,hashId:y}=P0(p),[j,v]=d.useState(!1),[x,w]=d.useState(()=>({...c})),C=d.useMemo(()=>i||(s?a.jsx(se.FilterOutlined,{className:ie(`${p}-collapse-icon`,y)}):a.jsx(Ht,{variant:l,size:r,label:m.getMessage("form.lightFilter.more","更多筛选")})),[i,s,p,y,l,r,m]),{collapseItems:b,outsideItems:T}=d.useMemo(()=>{const F=[],$=[];return t.forEach(M=>{const{secondary:I}=M.props||{};I||s?F.push(M):$.push(M)}),{collapseItems:F,outsideItems:$}},[e.items]);return S(a.jsx("div",{className:ie(p,y,`${p}-${r}`,{[`${p}-effective`]:Object.keys(c).some(F=>Array.isArray(c[F])?c[F].length>0:c[F])}),children:a.jsxs("div",{className:ie(`${p}-container`,y),children:[T.map((F,$)=>{if(!(F!=null&&F.props))return F;const{key:M}=F,{fieldProps:I}=(F==null?void 0:F.props)||{},A=I!=null&&I.placement?I==null?void 0:I.placement:g;return a.jsx("div",{className:ie(`${p}-item`,y),children:d.cloneElement(F,{fieldProps:{...F.props.fieldProps,placement:A,variant:"borderless"},proFieldProps:{...F.props.proFieldProps,light:!0,label:F.props.label,variant:l},variant:l})},M||$)}),b.length?a.jsx("div",{className:ie(`${p}-item`,y),children:a.jsx(Ou,{padding:24,open:j,onOpenChange:F=>{v(F)},placement:g,popoverProps:f,label:C,footerRender:h,footer:{onConfirm:()=>{o({...x}),v(!1)},onClear:()=>{const F={};b.forEach($=>{const{name:M}=$.props;F[M]=void 0}),o(F)}},children:b.map(F=>{const{key:$}=F,{name:M,fieldProps:I}=F.props,A={...I,onChange:H=>(w({...x,[M]:H!=null&&H.target?H.target.value:H}),!1)};x.hasOwnProperty(M)&&(A[F.props.valuePropName||"value"]=x[M]);const Y=I!=null&&I.placement?I==null?void 0:I.placement:g;return a.jsx("div",{className:ie(`${p}-line`,y),children:d.cloneElement(F,{fieldProps:{...A,placement:Y,variant:l}})},$)})})},"more"):null]})}))};function L0(e){const{size:t,collapse:n,collapseLabel:r,initialValues:s,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"),[j,v]=d.useState(()=>({...s})),x=d.useRef();return d.useImperativeHandle(c,()=>x.current,[x.current]),a.jsx(lr,{size:t,initialValues:s,form:o,contentRender:w=>a.jsx(N0,{prefixCls:y,items:w==null?void 0:w.flatMap(C=>{var b;return!C||!(C!=null&&C.type)?C:((b=C==null?void 0:C.type)==null?void 0:b.displayName)==="ProForm-Group"?C.props.children:C}),size:t,variant:h||"borderless",collapse:n,collapseLabel:r,placement:l,popoverProps:m,values:j||{},footerRender:f,onValuesChange:C=>{var T,F;const b={...j,...C};v(b),(T=x.current)==null||T.setFieldsValue(b),(F=x.current)==null||F.submit(),i&&i(C,b)}},JSON.stringify(j||{})),formRef:x,formItemProps:{colon:!1,labelAlign:"left"},fieldProps:{style:{width:void 0}},...Le(p,["labelWidth"]),onValuesChange:(w,C)=>{var b;v(C),i==null||i(w,C),(b=x.current)==null||b.submit()}})}const{noteOnce:_0}=He;function z0({children:e,trigger:t,onOpenChange:n,modalProps:r,onFinish:s,submitTimeout:i,title:o,width:l,open:c,...h}){var I,A,Y,H;_0(!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]=Je(!1,c),j=xe(k=>{n==null||n(k)}),v=d.useCallback(k=>{y(E=>{const R=typeof k=="function"?k(E):k;return queueMicrotask(()=>{j(R)}),R})},[j]),x=d.useRef(null),w=d.useCallback(k=>{x.current===null&&k&&f([]),x.current=k},[]),C=d.useRef(),b=d.useCallback(()=>{var E;const k=h.form??((E=h.formRef)==null?void 0:E.current)??C.current;k&&(r!=null&&r.destroyOnHidden)&&typeof k.resetFields=="function"&&k.resetFields()},[r==null?void 0:r.destroyOnHidden,h.form,h.formRef]);d.useImperativeHandle(h.formRef,()=>C.current,[C.current]),d.useEffect(()=>{c&&(n==null||n(!0))},[c]);const T=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async k=>{var E,R;v(!S),(R=(E=t.props)==null?void 0:E.onClick)==null||R.call(E,k)}}):null,[v,t,S]),F=d.useMemo(()=>{var k,E,R,z;return h.submitter===!1?!1:_s({searchConfig:{submitText:(r==null?void 0:r.okText)??((E=(k=g.locale)==null?void 0:k.Modal)==null?void 0:E.okText)??"确认",resetText:(r==null?void 0:r.cancelText)??((z=(R=g.locale)==null?void 0:R.Modal)==null?void 0:z.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:i&&m,onClick:_=>{var V;v(!1),(V=r==null?void 0:r.onCancel)==null||V.call(r,_)}}},h.submitter??{})},[(A=(I=g.locale)==null?void 0:I.Modal)==null?void 0:A.cancelText,(H=(Y=g.locale)==null?void 0:Y.Modal)==null?void 0:H.okText,r,h.submitter,v,m,i]),$=d.useCallback((k,E)=>a.jsxs(a.Fragment,{children:[k,x.current&&E?a.jsx(d.Fragment,{children:Nc.createPortal(E,x.current)},"submitter"):E]}),[]),M=d.useCallback(async k=>{const E=s==null?void 0:s(k);if(i&&E instanceof Promise){p(!0);const z=setTimeout(()=>p(!1),i);try{const _=await E;return clearTimeout(z),p(!1),_&&v(!1),_}catch(_){throw clearTimeout(z),p(!1),_}}else if(i){p(!0);const z=setTimeout(()=>p(!1),i);try{const _=await E;return clearTimeout(z),p(!1),_&&v(!1),_}catch(_){throw clearTimeout(z),p(!1),_}}const R=await E;return R&&v(!1),R},[s,v,i]);return a.jsxs(a.Fragment,{children:[a.jsx(u.Modal,{title:o,width:l||800,...r,open:S,onCancel:k=>{var E;i&&m||(v(!1),(E=r==null?void 0:r.onCancel)==null||E.call(r,k))},afterClose:()=>{var k;r!=null&&r.destroyOnHidden&&b(),S&&v(!1),(k=r==null?void 0:r.afterClose)==null||k.call(r)},footer:h.submitter!==!1?a.jsx("div",{ref:w,style:{display:"flex",justifyContent:"flex-end"}}):null,children:a.jsx(lr,{formComponentType:"ModalForm",layout:"vertical",...h,onInit:(k,E)=>{var R;h.formRef&&(h.formRef.current=E),(R=h==null?void 0:h.onInit)==null||R.call(h,k,E),C.current=E},formRef:C,submitter:F,onFinish:async k=>await M(k),contentRender:$,children:e})}),T]})}const Ii=ge.createContext(null);function B0({children:e,onBatchResize:t}){const n=ge.useRef(0),r=ge.useRef([]),s=ge.useContext(Ii),i=ge.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=[])}),s==null||s(o,l,c)},[t,s]);return ge.createElement(Ii.Provider,{value:i},e)}const qt=new Map;function Ed(e){e.forEach(t=>{var r;const{target:n}=t;(r=qt.get(n))==null||r.forEach(s=>s(n))})}let La;function Id(){return La||(La=new ResizeObserver(Ed)),La}process.env.NODE_ENV;process.env.NODE_ENV;function V0(e,t){qt.has(e)||(qt.set(e,new Set),Id().observe(e)),qt.get(e).add(t)}function H0(e,t){qt.has(e)&&(qt.get(e).delete(t),qt.get(e).size||(Id().unobserve(e),qt.delete(e)))}function Y0(e,t,n,r){const s=ge.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=Hc(c=>{const{width:h,height:g}=c.getBoundingClientRect(),{offsetWidth:f,offsetHeight:m}=c,p=Math.floor(h),S=Math.floor(g);if(s.current.width!==p||s.current.height!==S||s.current.offsetWidth!==f||s.current.offsetHeight!==m){const y={width:p,height:S,offsetWidth:f,offsetHeight:m};s.current=y;const j=f===Math.round(h)?h:f,v=m===Math.round(g)?g:m,x={...y,offsetWidth:j,offsetHeight:v};r==null||r(x,c),Promise.resolve().then(()=>{n==null||n(x,c)})}}),o=typeof t=="function",l=ge.useRef(0);ge.useEffect(()=>{const c=o?t():t;return c&&e?V0(c,i):e&&o&&(l.current+=1),()=>{c&&H0(c,i)}},[e,o?l.current:t])}function U0(e,t){const{children:n,disabled:r,onResize:s,data:i}=e,o=ge.useRef(null),l=ge.useContext(Ii),c=typeof n=="function",h=c?n(o):n,g=!c&&ge.isValidElement(h)&&Cf(h),f=g?wf(h):null,m=Sf(f,o),p=()=>$f(o.current);return ge.useImperativeHandle(t,()=>p()),Y0(!r,p,s,(S,y)=>{l==null||l(S,y,i)}),g?ge.cloneElement(h,{ref:m}):h}const Md=ge.forwardRef(U0);process.env.NODE_ENV!=="production"&&(Md.displayName="SingleObserver");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 K0="rc-observer-key";function W0(e,t){const{children:n}=e,r=typeof n=="function"?[n]:mn(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((s,i)=>{const o=(s==null?void 0:s.key)||`${K0}-${i}`;return ge.createElement(Md,Mi({},e,{key:o,ref:i===0?t:void 0}),s)})}const ra=ge.forwardRef(W0);process.env.NODE_ENV!=="production"&&(ra.displayName="ResizeObserver");ra.Collection=B0;const q0=(e,t,n,r)=>e?a.jsxs(a.Fragment,{children:[n.getMessage("tableForm.collapsed","展开"),r&&`(${r})`,a.jsx(se.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}):a.jsxs(a.Fragment,{children:[n.getMessage("tableForm.expand","收起"),a.jsx(se.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}),G0=e=>{const{setCollapsed:t,collapsed:n=!1,submitter:r,style:s,hiddenNum:i}=e,{getPrefixCls:o}=d.useContext(u.ConfigProvider.ConfigContext),l=Fe(),{hashId:c}=d.useContext(Vt),h=Pu(e.collapseRender)||q0;return a.jsxs(u.Space,{style:s,size:16,children:[r,e.collapseRender!==!1&&a.jsx("a",{className:ie(o("pro-query-filter-collapse-button"),c),onClick:()=>t(!n),children:h==null?void 0:h(n,e,l,i)})]})},Z0=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 J0(e){return Be("QueryFilter",t=>{const n={...t,componentCls:`.${e}`};return[Z0(n)]})}const X0=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"]]}}},Q0=(e,t,n,r)=>{if(n&&typeof n=="number")return{span:n,layout:e};const{breakpoints:s,configSpanBreakpoints:i}=r,l=((n?["xs","sm","md","lg","xl","xxl"].map(c=>[i[c],24/n[c],"horizontal"]):s[e||"default"])||s.default).find(c=>t<c[0]+16);return l?{span:24/l[1],layout:l==null?void 0:l[2]}:{span:8,layout:"horizontal"}},ev=(e,t)=>e==null?void 0:e.flatMap(n=>{var r,s,i;return((r=n==null?void 0:n.type)==null?void 0:r.displayName)==="ProForm-Group"&&!((s=n.props)!=null&&s.title)?n.props.children:t&&d.isValidElement(n)?d.cloneElement(n,{...n.props,formItemProps:{...(i=n.props)==null?void 0:i.formItemProps,rules:[]}}):n}),tv=e=>{var k,E,R;const t=Fe(),{hashId:n}=d.useContext(Vt),r=e.resetText||t.getMessage("tableForm.reset","重置"),s=e.searchText||t.getMessage("tableForm.search","搜索"),[i,o]=Je(()=>e.defaultCollapsed&&!!e.submitter,e.collapsed),l=xe(z=>{var _;(_=e.onCollapse)==null||_.call(e,z)}),c=d.useCallback(z=>{o(_=>{const V=typeof z=="function"?z(_):z;return queueMicrotask(()=>{l(V)}),V})},[l]),{optionRender:h,collapseRender:g,split:f,items:m,spanSize:p,showLength:S,searchGutter:y,showHiddenNum:j}=e,v=d.useMemo(()=>!e.submitter||h===!1?null:d.cloneElement(e.submitter,{searchConfig:{resetText:r,submitText:s},render:h&&((z,_)=>h({...e,resetText:r,searchText:s},e,_)),...e.submitter.props}),[e,r,s,h]);let x=0,w=0,C=!1,b=0,T=0;const F=ev(m,e.ignoreRules).map((z,_)=>{var J,G,K,O;const V=d.isValidElement(z)?((J=z==null?void 0:z.props)==null?void 0:J.colSize)??1:1,Z=Math.min(p.span*(V||1),24);x+=Z,b+=V,_===0&&(C=Z===24&&!((G=z==null?void 0:z.props)!=null&&G.hidden));const B=((K=z==null?void 0:z.props)==null?void 0:K.hidden)||i&&(C||b>S)&&!!_;w+=1;const U=d.isValidElement(z)&&(z.key||`${(O=z.props)==null?void 0:O.name}`)||_;return d.isValidElement(z)&&B?e.preserve?{itemDom:d.cloneElement(z,{hidden:!0,key:U||_}),hidden:!0,colSpan:Z}:{itemDom:null,colSpan:0,hidden:!0}:{itemDom:z,colSpan:Z,hidden:!1}}),$=F.map((z,_)=>{var J,G;const{itemDom:V,colSpan:Z}=z;if((J=V==null?void 0:V.props)==null?void 0:J.hidden)return V;const U=d.isValidElement(V)&&(V.key||`${(G=V.props)==null?void 0:G.name}`)||_;return 24-T%24<Z&&(x+=24-T%24,T+=24-T%24),T+=Z,f&&T%24===0&&_<w-1?a.jsx(u.Col,{span:Z,className:ie(`${e.baseClassName}-row-split-line`,`${e.baseClassName}-row-split`,n),children:V},U):a.jsx(u.Col,{className:ie(`${e.baseClassName}-row-split`,n),span:Z,children:V},U)}),M=j&&F.filter(z=>z.hidden).length,I=d.useMemo(()=>!(x<24||b<=S),[b,S,x]),A=d.useMemo(()=>{var _,V;const z=T%24+(((_=e.submitterColSpanProps)==null?void 0:_.span)??p.span);return z>24?24-(((V=e.submitterColSpanProps)==null?void 0:V.span)??p.span):24-z},[T,T%24+(((k=e.submitterColSpanProps)==null?void 0:k.span)??p.span),(E=e.submitterColSpanProps)==null?void 0:E.span]),H=d.useContext(u.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter");return a.jsxs(u.Row,{gutter:y,justify:"start",className:ie(`${H}-row`,n),children:[$,v&&a.jsx(u.Col,{span:p.span,offset:A,className:ie((R=e.submitterColSpanProps)==null?void 0:R.className),...e.submitterColSpanProps,style:{textAlign:"end"},children:a.jsx(u.Form.Item,{label:" ",colon:!1,shouldUpdate:!1,className:ie(`${H}-actions`,n),children:a.jsx(G0,{hiddenNum:M,collapsed:i,collapseRender:I?g:!1,submitter:v,setCollapsed:c},"pro-form-query-filter-actions")})},"submitter")]},"resize-observer-row")};var Pc;const nv=Wi()?(Pc=document==null?void 0:document.body)==null?void 0:Pc.clientWidth:1024;function rv(e){const{collapsed:t,layout:n,defaultCollapsed:r=!0,defaultColsNumber:s,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:j,preserve:v=!0,ignoreRules:x,showHiddenNum:w=!1,submitterColSpanProps:C,...b}=e,F=d.useContext(u.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter"),{wrapSSR:$,hashId:M}=J0(F),{token:I}=u.theme.useToken(),[A,Y]=d.useState(()=>typeof(y==null?void 0:y.width)=="number"?y==null?void 0:y.width:nv),H=d.useMemo(()=>X0(I),[I.screenSMMin,I.screenMDMin,I.screenLGMin,I.screenXLMin,I.screenXXLMin]),k=d.useMemo(()=>Q0(n,A+16,o,H),[n,A,o,H]),E=d.useMemo(()=>{if(i!==void 0)return i;if(s!==void 0){const z=24/k.span-1;return s>z?z:s}return Math.max(1,24/k.span-1)},[s,i,k.span]),R=d.useMemo(()=>{if(S&&k.layout!=="vertical"&&S!=="auto")return{labelCol:{flex:`0 0 ${S}px`},wrapperCol:{style:{maxWidth:`calc(100% - ${S}px)`}},style:{flexWrap:"nowrap"}}},[k.layout,S]);return $(a.jsx(ra,{onResize:z=>{A!==z.width&&z.width>17&&Y(z.width)},children:z=>a.jsx("div",{ref:z,className:ie(`${F}-container`,M),style:e.containerStyle,children:a.jsx(lr,{isKeyPressSubmit:!0,preserve:v,...b,className:ie(F,M,b.className),onReset:m,style:y,layout:k.layout,fieldProps:{style:{width:"100%"}},formItemProps:R,groupProps:{titleStyle:{display:"inline-block",marginInlineEnd:16}},contentRender:(_,V,Z)=>a.jsx(tv,{spanSize:k,collapsed:t,form:Z,submitterColSpanProps:C,collapseRender:f,defaultCollapsed:r,onCollapse:p,optionRender:g,submitter:V,items:_,split:j,baseClassName:F,resetText:e.resetText,searchText:e.searchText,searchGutter:l,preserve:v,ignoreRules:x,showLength:E,showHiddenNum:w})})})},"resize-observer"))}const{noteOnce:sv}=He;function av(e){const t=d.useRef(),n=d.useContext(Od),r=d.useContext(Ad),s={...e,...r},{onFinish:i,step:o,formRef:l,title:c,stepProps:h,...g}=s;return sv(!g.submitter,"StepForm 不包含提交按钮,请在 StepsForm 上"),d.useImperativeHandle(l,()=>t.current,[l==null?void 0:l.current]),d.useEffect(()=>{if(!(s.name||s.step))return;const f=(s.name||s.step).toString();return n==null||n.regForm(f,s),()=>{n==null||n.unRegForm(f)}},[]),n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),a.jsx(lr,{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",...Le(g,["layoutType","columns"])})}const iv=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 ov(e){return Be("StepsForm",t=>{const n={...t,componentCls:`.${e}`};return[iv(n)]})}const Od=d.createContext(void 0),lv={horizontal({stepsDom:e,formDom:t}){return a.jsxs(a.Fragment,{children:[a.jsx(u.Row,{gutter:{xs:8,sm:16,md:24},children:a.jsx(u.Col,{span:24,children:e})}),a.jsx(u.Row,{gutter:{xs:8,sm:16,md:24},children:a.jsx(u.Col,{span:24,children:t})})]})},vertical({stepsDom:e,formDom:t}){return a.jsxs(u.Row,{align:"stretch",wrap:!0,gutter:{xs:8,sm:16,md:24},children:[a.jsx(u.Col,{xxl:4,xl:6,lg:7,md:8,sm:10,xs:12,children:d.cloneElement(e,{style:{height:"100%"}})}),a.jsx(u.Col,{children:a.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:t})})]})}},Ad=d.createContext(null);function cv(e){const{getPrefixCls:t}=d.useContext(u.ConfigProvider.ConfigContext),n=t("pro-steps-form"),{wrapSSR:r,hashId:s}=ov(n),{current:i,onCurrentChange:o,submitter:l,stepsFormRender:c,stepsRender:h,stepFormRender:g,stepsProps:f,onFinish:m,formProps:p,containerStyle:S,formRef:y,formMapRef:j,layoutRender:v,...x}=e,w=d.useRef(new Map),C=d.useRef(new Map),b=d.useRef([]),[T,F]=d.useState([]),[$,M]=d.useState(!1),I=Fe(),[A,Y]=Je(0,e.current),H=xe(q=>{var X;(X=e.onCurrentChange)==null||X.call(e,q)}),k=d.useCallback(q=>{Y(X=>{const ee=typeof q=="function"?q(X):q;return queueMicrotask(()=>{H(ee)}),ee})},[H]),E=d.useMemo(()=>lv[(f==null?void 0:f.orientation)||"horizontal"],[f==null?void 0:f.orientation]),R=d.useMemo(()=>A===T.length-1,[T.length,A]),z=d.useCallback((q,X)=>{C.current.has(q)||F(ee=>[...ee,q]),C.current.set(q,X)},[]),_=d.useCallback(q=>{F(X=>X.filter(ee=>ee!==q)),C.current.delete(q),w.current.delete(q)},[]);d.useImperativeHandle(j,()=>b.current,[b.current]),d.useImperativeHandle(y,()=>{var q;return(q=b.current[A||0])==null?void 0:q.current},[A,b.current]);const V=d.useCallback(async(q,X)=>{if(w.current.set(q,X),!R||!m)return;M(!0);const ee=Du({},...Array.from(w.current.values()));try{await m(ee)&&(k(0),b.current.forEach(le=>{var ce;return(ce=le.current)==null?void 0:ce.resetFields()}))}catch(re){console.log(re)}finally{M(!1)}},[R,m,M,k]),Z=d.useMemo(()=>{const q={items:T.map(X=>{const ee=C.current.get(X),re={key:X,title:ee==null?void 0:ee.title,...ee==null?void 0:ee.stepProps};return re.description&&(re.content=re.description,delete re.description),re})};return a.jsx("div",{className:ie(`${n}-steps-container`,s),style:{maxWidth:Math.min(T.length*320,1160)},children:a.jsx(u.Steps,{...f,...q,current:A,onChange:void 0})})},[T,s,n,A,f]),B=xe(()=>{var X;(X=b.current[A].current)==null||X.submit()}),U=xe(()=>{A<1||k(A-1)}),J=d.useMemo(()=>l!==!1&&a.jsx(u.Button,{type:"primary",loading:$,...l==null?void 0:l.submitButtonProps,onClick:()=>{var q;(q=l==null?void 0:l.onSubmit)==null||q.call(l),B()},children:I.getMessage("stepsForm.next","下一步")},"next"),[I,$,B,l]),G=d.useMemo(()=>l!==!1&&a.jsx(u.Button,{...l==null?void 0:l.resetButtonProps,onClick:()=>{var q;U(),(q=l==null?void 0:l.onReset)==null||q.call(l)},children:I.getMessage("stepsForm.prev","上一步")},"pre"),[I,U,l]),K=d.useMemo(()=>l!==!1&&a.jsx(u.Button,{type:"primary",loading:$,...l==null?void 0:l.submitButtonProps,onClick:()=>{var q;(q=l==null?void 0:l.onSubmit)==null||q.call(l),B()},children:I.getMessage("stepsForm.submit","提交")},"submit"),[I,$,B,l]),O=xe(()=>{T.length!==0&&(A>T.length-2||k(A+1))}),P=d.useMemo(()=>{var ee;let q=[];const X=A||0;if(X<1?T.length===1?q.push(K):q.push(J):X+1===T.length?q.push(G,K):q.push(G,J),q=q.filter(d.isValidElement),l&&l.render){const re={form:(ee=b.current[A])==null?void 0:ee.current,onSubmit:B,step:A,onPre:U};return l.render(re,q)}return l&&(l==null?void 0:l.render)===!1?null:q},[T.length,J,B,G,U,A,K,l]),N=d.useMemo(()=>mn(e.children).map((q,X)=>{const ee=q.props,re=ee.name||`${X}`,le=A===X,ce=le?{contentRender:g,submitter:!1}:{};return a.jsx("div",{className:ie(`${n}-step`,s,{[`${n}-step-active`]:le}),children:a.jsx(Ad.Provider,{value:{...ce,...p,...ee,name:re,step:X},children:q})},re)}),[p,s,n,e.children,A,g]),D=d.useMemo(()=>h?h(T.map(q=>{var X;return{key:q,title:(X=C.current.get(q))==null?void 0:X.title}}),Z):Z,[T,Z,h]),L=d.useMemo(()=>a.jsxs("div",{className:ie(`${n}-container`,s),style:S,children:[N,c?null:a.jsx(u.Space,{children:P})]}),[S,N,s,n,c,P]),W=d.useMemo(()=>{const q={stepsDom:D,formDom:L};return c?c(v?v(q):E(q),P):v?v(q):E(q)},[D,L,E,c,P,v]);return r(a.jsx("div",{className:ie(n,s),children:a.jsx(u.Form.Provider,{...x,children:a.jsx(Od.Provider,{value:{loading:$,setLoading:M,regForm:z,keyArray:T,next:O,formArrayRef:b,formMapRef:C,lastStep:R,unRegForm:_,onFormFinish:V},children:W})})}))}function sa(e){return a.jsx(In,{needDeps:!0,children:a.jsx(cv,{...e})})}sa.StepForm=av;sa.useForm=u.Form.useForm;const uv=({children:e})=>a.jsx(a.Fragment,{children:e}),dv=({steps:e,columns:t,forceUpdate:n,grid:r,...s})=>{const i=Ui(s),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(kd,{grid:r,...c,key:h,layoutType:"StepForm",columns:t[h]})),[t,r,e]);return a.jsx(sa,{...s,onCurrentChange:o,children:l})},{noteOnce:Rc}=He,fv=(e,t)=>{var n;if(e.valueType==="dependency"){const r=(n=e.getFieldProps)==null?void 0:n.call(e);return Rc(Array.isArray(e.name??(r==null?void 0:r.name)),'SchemaForm: fieldProps.name should be NamePath[] when valueType is "dependency"'),Rc(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},s=>!e.columns||typeof e.columns!="function"?null:t.genItems(e.columns(s))):null}return!0},hv=e=>{var t;return e.valueType==="divider"?d.createElement(u.Divider,{...(t=e.getFieldProps)==null?void 0:t.call(e),key:e.key}):!0},mv=(e,{action:t,formRef:n,type:r,originItem:s})=>{const i={...Le(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 a.jsx(yn,{...g,ignoreFormItem:!0},h)},l=e!=null&&e.formItemRender?(h,g)=>{var m,p,S,y;const f=it({...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:s},{...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(yn,{...i,key:[e.key,e.index||0].join("-"),formItemRender:l})};return e.dependencies?a.jsx(na,{name:e.dependencies||[],children:c},e.key):c()},gv=(e,{genItems:t})=>{var n,r;return e.valueType==="formList"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(l0,{...(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},pv=(e,{genItems:t})=>{var n,r;return e.valueType==="formSet"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement($0,{...(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},yv=(e,{genItems:t})=>{var n;return e.valueType==="group"?!e.columns||!Array.isArray(e.columns)?null:a.jsx(vv,{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},xv=e=>e.valueType&&typeof e.valueType=="string"&&["index","indexBorder","option"].includes(e==null?void 0:e.valueType)?null:!0,$c=[xv,yv,gv,pv,hv,fv],bv=(e,t)=>{for(let n=0;n<$c.length;n++){const r=$c[n],s=r(e,t);if(s!==!0)return s}return mv(e,t)},Sv={DrawerForm:k0,QueryFilter:rv,LightFilter:L0,StepForm:sa.StepForm,StepsForm:dv,ModalForm:z0,Embed:uv,Form:gt};function kd(e){const{columns:t,layoutType:n="Form",type:r="form",action:s,shouldUpdate:i=(T,F)=>dn(T)!==dn(F),formRef:o,...l}=e,c=Sv[n]||gt,[h]=u.Form.useForm(),g=u.Form.useFormInstance(),[,f]=d.useState([]),[m,p]=d.useState(()=>[]),S=Op(e.form||g||h),y=d.useRef(),j=Ui(e),v=xe(T=>T.filter(F=>!(F.hideInForm&&r==="form")).sort((F,$)=>$.order||F.order?($.order||0)-(F.order||0):($.index||0)-(F.index||0)).map((F,$)=>{const M=ht(F.title,F,"form",a.jsx(Jn,{label:F.title,tooltip:F.tooltip})),I=it({title:M,label:M,name:F.name,valueType:ht(F.valueType,{}),key:F.key||F.dataIndex||$,columns:F.columns,valueEnum:F.valueEnum,dataIndex:F.dataIndex||F.key,initialValue:F.initialValue,width:F.width,index:F.index,readonly:F.readonly,colSize:F.colSize,colProps:F.colProps,rowProps:F.rowProps,className:F.className,tooltip:F.tooltip,dependencies:F.dependencies,proFieldProps:F.proFieldProps,ignoreFormItem:F.ignoreFormItem,getFieldProps:F.fieldProps?()=>ht(F.fieldProps,S.current,F):void 0,getFormItemProps:F.formItemProps?()=>ht(F.formItemProps,S.current,F):void 0,render:F.render,formItemRender:F.formItemRender,renderText:F.renderText,request:F.request,params:F.params,transform:F.transform,convertValue:F.convertValue,debounceTime:F.debounceTime,defaultKeyWords:F.defaultKeyWords});return bv(I,{action:s,type:r,originItem:F,formRef:S,genItems:v})}).filter(F=>!!F)),x=d.useCallback((T,F)=>{const{onValuesChange:$}=j.current;(i===!0||typeof i=="function"&&i(F,y.current))&&p([]),y.current=F,$==null||$(T,F)},[j,i]),w=ct(()=>{if(!(t.length&&Array.isArray(t[0])))return v(t)},[t,l==null?void 0:l.open,s,r,m,S.current]),C=ct(()=>n==="StepsForm"?{forceUpdate:f,columns:t}:{},[t,n]);d.useImperativeHandle(o,()=>S.current,[S.current]);const b=d.useContext(zt);return a.jsx(In,{valueTypeMap:{...b.valueTypeMap,...xd},children:a.jsx(c,{...C,...l,onInit:(T,F)=>{var $;o&&(o.current=F),($=l==null?void 0:l.onInit)==null||$.call(l,T,F),S.current=F},form:e.form||h,formRef:S,onValuesChange:x,children:w})})}const Ys="text",Cv=({fieldProps:e,proFieldProps:t,...n})=>a.jsx(yn,{valueType:Ys,fieldProps:e,fieldConfig:{valueType:Ys},proFieldProps:t,...n}),wv=e=>{const[t,n]=Je(e.open||!1,e.open),r=d.useCallback(s=>{n(i=>{var l;const o=typeof s=="function"?s(i):s;return(l=e.onOpenChange)==null||l.call(e,o),o})},[e.onOpenChange]);return a.jsx(u.Form.Item,{shouldUpdate:!0,noStyle:!0,children:s=>{var o;const i=s.getFieldValue(e.name||[]);return a.jsx(u.Popover,{getPopupContainer:l=>l&&l.parentNode?l.parentNode:l,onOpenChange:l=>r(l),content:a.jsxs("div",{style:{padding:"4px 0"},children:[(o=e.statusRender)==null?void 0:o.call(e,i),e.strengthText?a.jsx("div",{style:{marginTop:10},children:a.jsx("span",{children:e.strengthText})}):null]}),styles:{root:{width:240}},placement:"rightTop",...e.popoverProps,open:t,children:e.children})}})},jv=({fieldProps:e,proFieldProps:t,...n})=>{const[r,s]=d.useState(!1);return e!=null&&e.statusRender&&n.name?a.jsx(In,{valueTypeMap:{password:{render:(i,o)=>a.jsx(Wn,{...o,text:i}),formItemRender:(i,o)=>a.jsx(Wn,{...o,text:i})}},children:a.jsx(wv,{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:s,children:a.jsx("div",{children:a.jsx(yn,{valueType:"password",fieldProps:{...Le(e,["statusRender","popoverProps","strengthText"]),onBlur:i=>{var o;(o=e==null?void 0:e.onBlur)==null||o.call(e,i),s(!1)},onClick:i=>{var o;(o=e==null?void 0:e.onClick)==null||o.call(e,i),s(!0)}},proFieldProps:t,fieldConfig:{valueType:Ys},...n})})})}):a.jsx(In,{valueTypeMap:{password:{render:(i,o)=>a.jsx(Wn,{...o,text:i}),formItemRender:(i,o)=>a.jsx(Wn,{...o,text:i})}},children:a.jsx(yn,{valueType:"password",fieldProps:e,proFieldProps:t,fieldConfig:{valueType:Ys},...n})})},Us=Cv;Us.Password=jv;Us.displayName="ProFormComponent";function gt(e){return a.jsx(lr,{layout:"vertical",contentRender:(t,n)=>a.jsxs(a.Fragment,{children:[t,n]}),...e})}gt.Group=$d;gt.useForm=u.Form.useForm;gt.Item=Fd;gt.useWatch=u.Form.useWatch;gt.ErrorList=u.Form.ErrorList;gt.Provider=u.Form.Provider;gt.useFormInstance=u.Form.useFormInstance;gt.EditOrReadOnlyContext=Br;const vv=gt.Group,Tv=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 Fv(e){return Be("ProTableAlert",t=>{const n={...t,componentCls:`.${e}`};return[Tv(n)]})}const Rv=e=>{const{intl:t,onCleanSelected:n}=e;return[a.jsx("a",{onClick:n,children:t.getMessage("alert.clear","清空")},"0")]};function $v({selectedRowKeys:e=[],onCleanSelected:t,alwaysShowAlert:n,selectedRows:r,alertInfoRender:s=({intl:o})=>a.jsxs(u.Space,{children:[o.getMessage("alert.selected","已选择"),e.length,o.getMessage("alert.item","项")," "]}),alertOptionRender:i=Rv}){const o=Fe(),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}=Fv(h);if(s===!1)return null;const m=s({intl:o,selectedRowKeys:e,selectedRows:r,onCleanSelected:t});return m===!1||e.length<1&&!n?null:g(a.jsx("div",{className:ie(h,f),children:a.jsx("div",{className:ie(`${h}-container`,f),children:a.jsxs("div",{className:ie(`${h}-info`,f),children:[a.jsx("div",{className:ie(`${h}-info-content`,f),children:m}),l?a.jsx("div",{className:ie(`${h}-info-option`,f),children:l}):null]})})}))}function Ev(e,t,n){if(e===!1)return!1;const{total:r,current:s,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??s:s,pageSize:e!==!0&&e?e.pageSize??i:i,onChange:(c,h)=>{const{onChange:g}=e;g==null||g(c,h||20),(h!==i||s!==c)&&o({pageSize:h,current:c})}}}function Iv(e,t,n){const r={...n.editableUtils,pageInfo:t.pageInfo,nativeElement:n.nativeElement,focus:n.focus,reload:async s=>{s&&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 s;await n.resetAll(),await((s=t==null?void 0:t.reset)==null?void 0:s.call(t)),await(t==null?void 0:t.reload())},fullScreen:()=>n.fullScreen(),clearSelected:()=>n.onCleanSelected(),setPageInfo:s=>t.setPageInfo(s),scrollTo:n.scrollTo};e.current=r}function Mv(e,t){return t.filter(n=>n).length<1?e:t.reduce((n,r)=>r(n),e)}const Dd=(e,t)=>t===void 0?!1:typeof t=="boolean"?t:t[e],Ov=e=>{var t;return e&&typeof e=="object"&&((t=e==null?void 0:e.props)==null?void 0:t.colSpan)},tr=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`,Vr=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},to=(e,t)=>!!e&&!!t,no=e=>typeof e=="function"||typeof e=="object"&&typeof e.compare=="function",Av=(e,t)=>Object.entries(e).reduce((n,[r,s])=>{const i=t.find(o=>Vr(o.dataIndex)===r);return i!=null&&!to(i.filters,i.onFilter)&&(n[r]=s),n},{}),kv=e=>(Array.isArray(e)?e:[e]).reduce((r,s)=>{var l,c;const i=(l=s.column)==null?void 0:l.sorter;if(i!=null&&no(i))return r;const o=typeof i=="string"?i:Vr((c=s.column)==null?void 0:c.dataIndex);return o!=null&&(r[o]=s.order),r},{}),Dv=e=>{const t={},n={};return e.forEach(r=>{const s=Vr(r.dataIndex);s&&(r.filters&&!to(r.filters,r.onFilter)&&(t[s]=r.defaultFilteredValue??null),r.sorter&&!no(r.sorter)&&(typeof r.sorter=="string"?n[r.sorter]=r.defaultSortOrder??null:n[s]=r.defaultSortOrder??null))}),{sort:n,filter:t}},Pv=(e,t)=>{const{sorter:n,sortOrder:r,dataIndex:s}=t;if(r!==void 0)return r;if(n==null||no(n))return;const i=typeof n=="string"?n:Vr(s);return i?e[i]:void 0},Nv=(e,t)=>{const{filters:n,onFilter:r,filteredValue:s,dataIndex:i}=t;if(s!==void 0)return s;if(n==null||to(n,r))return;const o=Vr(i);return o?e[o]:void 0};function Lv(e={}){var x,w,C,b,T,F;const t=d.useRef(),n=d.useRef(null),r=d.useRef(),s=d.useRef(),[i,o]=d.useState(""),l=d.useRef([]),[c,h]=Je(()=>e.size||e.defaultSize||"middle",e.size),g=d.useCallback($=>{h(M=>{var A;const I=typeof $=="function"?$(M):$;return(A=e.onSizeChange)==null||A.call(e,I),I})},[e.onSizeChange]),f=d.useMemo(()=>{var M,I;if((M=e==null?void 0:e.columnsState)!=null&&M.defaultValue)return e.columnsState.defaultValue;const $={};return(I=e.columns)==null||I.forEach(({key:A,dataIndex:Y,fixed:H,disable:k},E)=>{const R=tr(A??Y,E);R&&($[R]={show:!0,fixed:H,disable:k})}),$},[e.columns]),[m,p]=Je(()=>{var I,A,Y,H;const{persistenceType:$,persistenceKey:M}=e.columnsState||{};if(M&&$&&typeof window<"u"){const k=window[$];try{const E=k==null?void 0:k.getItem(M);if(E)return(I=e==null?void 0:e.columnsState)!=null&&I.defaultValue?_s({},(A=e==null?void 0:e.columnsState)==null?void 0:A.defaultValue,JSON.parse(E)):JSON.parse(E)}catch(E){console.warn(E)}}return((Y=e.columnsState)==null?void 0:Y.value)||((H=e.columnsState)==null?void 0:H.defaultValue)||f},(x=e.columnsState)==null?void 0:x.value),S=(w=e.columnsState)==null?void 0:w.onChange,y=d.useCallback($=>{p(M=>{const I=typeof $=="function"?$(M):$;return S==null||S(I),I})},[S]);d.useEffect(()=>{var I,A;const{persistenceType:$,persistenceKey:M}=e.columnsState||{};if(M&&$&&typeof window<"u"){const Y=window[$];try{const H=Y==null?void 0:Y.getItem(M);H?(I=e==null?void 0:e.columnsState)!=null&&I.defaultValue?y(_s({},(A=e==null?void 0:e.columnsState)==null?void 0:A.defaultValue,JSON.parse(H))):y(JSON.parse(H)):y(f)}catch(H){console.warn(H)}}},[(C=e.columnsState)==null?void 0:C.persistenceKey,(b=e.columnsState)==null?void 0:b.persistenceType,f]);const j=d.useCallback(()=>{const{persistenceType:$,persistenceKey:M}=e.columnsState||{};if(!M||!$||typeof window>"u")return;const I=window[$];try{I==null||I.removeItem(M)}catch(A){console.warn(A)}},[e.columnsState]);d.useEffect(()=>{var A,Y;if(!((A=e.columnsState)!=null&&A.persistenceKey)||!((Y=e.columnsState)!=null&&Y.persistenceType)||typeof window>"u")return;const{persistenceType:$,persistenceKey:M}=e.columnsState,I=window[$];try{I==null||I.setItem(M,JSON.stringify(m))}catch(H){console.warn(H),j()}},[(T=e.columnsState)==null?void 0:T.persistenceKey,m,(F=e.columnsState)==null?void 0:F.persistenceType]);const v={action:t.current,setAction:$=>{t.current=$},sortKeyColumns:l.current,setSortKeyColumns:$=>{l.current=$},propsRef:s,columnsMap:m,keyWords:i,setKeyWords:$=>o($),setTableSize:g,tableSize:c,prefixName:r.current,setPrefixName:$=>{r.current=$},setColumnsMap:y,columns:e.columns,rootDomRef:n,clearPersistenceStorage:j,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 Nn=d.createContext({}),_v=e=>{const t=Lv(e.initValue);return a.jsx(Nn.Provider,{value:t,children:e.children})},zv=new pu("turn",{"0%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(90deg)"},"50%":{transform:"rotate(180deg)"},"75%":{transform:"rotate(270deg)"},"100%":{transform:"rotate(360deg)"}}),Bv=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:zv,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 Vv(e){return Be("ProTable",t=>{const n={...t,componentCls:`.${e}`};return[Bv(n)]})}function Hv(e){let t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t.startsWith("-")&&(t=t.slice(1)),t}const Yv=(e,t)=>!e&&t!==!1?(t==null?void 0:t.filterType)==="light"?"LightFilter":"QueryFilter":"Form",Uv=(e,t,n)=>!e&&n==="LightFilter"?Le({...t},["labelWidth","defaultCollapsed","filterType"]):e?{}:Le({labelWidth:t?t==null?void 0:t.labelWidth:void 0,defaultCollapsed:!0,...t},["filterType"]),Kv=(e,t)=>e?Le(t,["ignoreRules"]):{ignoreRules:!0,...t},Wv=({onSubmit:e,formRef:t,dateFormatter:n="string",type:r,columns:s,action:i,ghost:o,manualRequest:l,onReset:c,submitButtonLoading:h,search:g,form:f,bordered:m})=>{const{hashId:p}=d.useContext(Vt),S=r==="form",y=async(T,F)=>{e&&e(T,F)},{getPrefixCls:j}=d.useContext(u.ConfigProvider.ConfigContext),v=d.useMemo(()=>s.filter(T=>!(T===u.Table.EXPAND_COLUMN||T===u.Table.SELECTION_COLUMN||T.search===!1&&r!=="form"||r==="form"&&T.hideInForm)).map(T=>{var M;const F=!T.valueType||["textarea","jsonCode","code"].includes(T==null?void 0:T.valueType)&&r==="table"?"text":T==null?void 0:T.valueType,$=(T==null?void 0:T.key)||((M=T==null?void 0:T.dataIndex)==null?void 0:M.toString());return{...T,width:void 0,...T.search&&typeof T.search=="object"?T.search:{},valueType:F,proFieldProps:{...T.proFieldProps,proFieldKey:$?`table-field-${$}`:void 0}}}),[s,r]),x=j("pro-table-search"),w=j("pro-table-form"),C=d.useMemo(()=>Yv(S,g),[g,S]),b=d.useMemo(()=>({submitter:{submitButtonProps:{loading:h}}}),[h]);return a.jsx("div",{className:ie(p,{[j("pro-card")]:!0,[`${j("pro-card")}-border`]:!!m,[`${j("pro-card")}-bordered`]:!!m,[`${j("pro-card")}-ghost`]:!!o,[x]:!0,[w]:S,[j(`pro-table-search-${Hv(C)}`)]:!0,[`${x}-ghost`]:o,[g==null?void 0:g.className]:g!==!1&&(g==null?void 0:g.className)}),children:a.jsx(kd,{layoutType:C,columns:v,type:r,...b,...Uv(S,g,C),...Kv(S,f||{}),formRef:t,action:i,dateFormatter:n,onInit:(T,F)=>{var $,M,I;if(t.current=F,r!=="form"){const A=($=i.current)==null?void 0:$.pageInfo,{current:Y=A==null?void 0:A.current,pageSize:H=A==null?void 0:A.pageSize}=T;if((I=(M=i.current)==null?void 0:M.setPageInfo)==null||I.call(M,{...A,current:parseInt(Y,10),pageSize:parseInt(H,10)}),l)return;y(T,!0)}},onReset:T=>{c==null||c(T)},onFinish:T=>{y(T,!1)},initialValues:f==null?void 0:f.initialValues})})},qv=e=>{const{columns:t,loading:n,formRef:r,type:s,action:i,cardBordered:o,dateFormatter:l,form:c,search:h,pagination:g,ghost:f,manualRequest:m,beforeSearchSubmit:p=C=>C,onSubmit:S,onFormSearchSubmit:y,onReset:j}=e,v=d.useMemo(()=>g?it({current:g.current,pageSize:g.pageSize}):{},[g]),x=xe((C,b)=>{var $,M,I;if((c==null?void 0:c.ignoreRules)===!1&&b){($=r==null?void 0:r.current)==null||$.validateFields().then(()=>{var H,k;const A={...C,_timestamp:Date.now(),...v},Y=Le(p(A),Object.keys(v));y(Y),b||(k=(H=i.current)==null?void 0:H.setPageInfo)==null||k.call(H,{current:1}),S&&!b&&(S==null||S(C))}).catch(A=>{});return}const T={...C,_timestamp:Date.now(),...v},F=Le(p(T),Object.keys(v));y(F),b||(I=(M=i.current)==null?void 0:M.setPageInfo)==null||I.call(M,{current:1}),S&&!b&&(S==null||S(C))}),w=xe(C=>{var T;const b=()=>{var $,M;const F=Le(p({...C,...v}),Object.keys(v));y(F),(M=($=i.current)==null?void 0:$.setPageInfo)==null||M.call($,{current:1}),j==null||j()};if((c==null?void 0:c.ignoreRules)===!1){(T=r==null?void 0:r.current)==null||T.validateFields().then(b).catch(()=>{});return}b()});return a.jsx(Wv,{submitButtonLoading:n,columns:t,type:s,ghost:f,formRef:r,onSubmit:x,manualRequest:m,onReset:w,dateFormatter:l,search:h,form:{autoFocusFirstInput:!1,...c,extraUrlParams:{...v,...c==null?void 0:c.extraUrlParams}},action:i,bordered:Dd("search",o)})},Gv=(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 hn(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})},Zv=d.memo(qv,Gv);function Jv(e){const{search:t,type:n,pagination:r,beforeSearchSubmit:s,actionRef:i,columns:o,onFormSearchSubmit:l,ghost:c,onReset:h,onSubmit:g,loading:f,manualRequest:m,form:p,formRef:S,cardBordered:y,dateFormatter:j,searchFormRender:v,proTableProps:x}=e;return d.useMemo(()=>{const w=t===!1&&n!=="form"?null:a.jsx(Zv,{pagination:r,beforeSearchSubmit:s,action:i,columns:o,onFormSearchSubmit:C=>{l(C)},ghost:c,onReset:h,onSubmit:g,loading:f,manualRequest:m,search:t,form:p,formRef:S,type:n||"table",cardBordered:y,dateFormatter:j});return v&&w?a.jsx(a.Fragment,{children:v(x,w)}):w},[i,s,y,o,j,p,S,c,f,m,l,h,g,r,x,t,v,n])}const Xv=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 Qv(e){return Be("ColumnSetting",t=>{const n={...t,componentCls:`.${e}`};return[Xv(n)]})}const _a=({title:e,show:t,children:n,columnKey:r,fixed:s})=>{const{columnsMap:i,setColumnsMap:o}=d.useContext(Nn);return t?a.jsx(u.Tooltip,{title:e,children:a.jsx("span",{onClick:l=>{l.stopPropagation(),l.preventDefault();const c=(i==null?void 0:i[r])||{},h={...i,[r]:{...c,fixed:s}};o(h)},children:n})}):null},eT=({columnKey:e,isLeaf:t,title:n,className:r,fixed:s,showListItemOption:i})=>{const o=Fe(),{hashId:l}=d.useContext(Vt),c=a.jsxs("span",{className:ie(`${r}-list-item-option`,l),children:[a.jsx(_a,{columnKey:e,fixed:"left",title:o.getMessage("tableToolBar.leftPin","固定在列首"),show:s!=="left",children:a.jsx(se.VerticalAlignTopOutlined,{})}),a.jsx(_a,{columnKey:e,fixed:void 0,title:o.getMessage("tableToolBar.noPin","不固定"),show:!!s,children:a.jsx(se.VerticalAlignMiddleOutlined,{})}),a.jsx(_a,{columnKey:e,fixed:"right",title:o.getMessage("tableToolBar.rightPin","固定在列尾"),show:s!=="right",children:a.jsx(se.VerticalAlignBottomOutlined,{})})]});return a.jsxs("span",{className:ie(`${r}-list-item`,l),children:[a.jsx("div",{className:ie(`${r}-list-item-title`,l),children:n}),i&&!t?c:null]},e)},za=({list:e,draggable:t,checkable:n,showListItemOption:r,className:s,showTitle:i=!0,title:o,listHeight:l=280})=>{var x,w,C;const{hashId:c}=d.useContext(Vt),{columnsMap:h,setColumnsMap:g,sortKeyColumns:f,setSortKeyColumns:m}=d.useContext(Nn),p=e&&e.length>0,S=d.useMemo(()=>{if(!p)return{};const b=[],T=new Map,F=($,M)=>$.map(({key:I,dataIndex:A,children:Y,...H})=>{var z,_;const k=tr(I,[M==null?void 0:M.columnKey,H.index].filter(Boolean).join("-")),E=(h==null?void 0:h[k||"null"])||{show:!0};E.show!==!1&&!Y&&b.push(k);const R={key:k,...Le(H,["className"]),selectable:!1,disabled:E.disable===!0,disableCheckbox:typeof E.disable=="boolean"?E.disable:(z=E.disable)==null?void 0:z.checkbox,isLeaf:M?!0:void 0};return Y&&(R.children=F(Y,{...E,columnKey:k}),(_=R.children)!=null&&_.every(V=>b==null?void 0:b.includes(V.key))&&b.push(k)),T.set(I,{...R,parentKey:M==null?void 0:M.columnKey}),R});return{list:F(e),keys:b,map:T}},[h,e,p]),y=xe((b,T,F)=>{const $={...h},M=[...f],I=M.findIndex(k=>k===b),A=M.findIndex(k=>k===T),Y=F>=I;if(I<0)return;const H=M[I];M.splice(I,1),F===0?M.unshift(H):M.splice(Y?A:A+1,0,H),M.forEach((k,E)=>{$[k]={...$[k]||{},order:E}}),g($),m(M)}),j=xe(b=>{const T={...h},F=$=>{var A,Y,H,k,E,R;const M={...T[$]};M.show=b.checked,(Y=(A=S.map)==null?void 0:A.get($))!=null&&Y.children&&((k=(H=S.map.get($))==null?void 0:H.children)==null||k.forEach(z=>F(z.key)));const I=(R=(E=S.map)==null?void 0:E.get($))==null?void 0:R.parentKey;I&&(T[I]={...T[I],show:!0}),T[$]=M};F(b.node.key),g({...T})});if(!p)return null;const v=a.jsx(u.Tree,{itemHeight:24,draggable:t&&!!((x=S.list)!=null&&x.length)&&((w=S.list)==null?void 0:w.length)>1,checkable:n,onDrop:b=>{const T=b.node.key,F=b.dragNode.key,{dropPosition:$,dropToGap:M}=b,I=$===-1||!M?$+1:$;y(F,T,I)},blockNode:!0,onCheck:(b,T)=>j(T),checkedKeys:S.keys,showLine:!1,titleRender:b=>{const T={...b,children:void 0};if(!T.title)return null;const F=ht(T.title,T),$=a.jsx(u.Typography.Text,{style:{width:80},ellipsis:{tooltip:F},children:F});return a.jsx(eT,{className:s,...Le(T,["key"]),showListItemOption:r,title:$,columnKey:T.key})},height:l,treeData:(C=S.list)==null?void 0:C.map(({disabled:b,...T})=>T)});return a.jsxs(a.Fragment,{children:[i&&a.jsx("span",{className:ie(`${s}-list-title`,c),children:o}),v]})},tT=({localColumns:e,className:t,draggable:n,checkable:r,showListItemOption:s,listsHeight:i})=>{const{hashId:o}=d.useContext(Vt),l=[],c=[],h=[],g=Fe();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 a.jsxs("div",{className:ie(`${t}-list`,o,{[`${t}-list-group`]:f||m}),children:[a.jsx(za,{title:g.getMessage("tableToolBar.leftFixedTitle","固定在左侧"),list:c,draggable:n,checkable:r,showListItemOption:s,className:t,listHeight:i}),a.jsx(za,{list:h,draggable:n,checkable:r,showListItemOption:s,title:g.getMessage("tableToolBar.noFixedTitle","不固定"),showTitle:m||f,className:t,listHeight:i}),a.jsx(za,{title:g.getMessage("tableToolBar.rightFixedTitle","固定在右侧"),list:l,draggable:n,checkable:r,showListItemOption:s,className:t,listHeight:i})]})};function nT(e){const t=d.useRef(null),n=d.useContext(Nn),r=e.columns,{checkedReset:s=!0}=e,{columnsMap:i,setColumnsMap:o,clearPersistenceStorage:l}=n;d.useEffect(()=>{var x,w,C,b;(w=(x=n.propsRef.current)==null?void 0:x.columnsState)!=null&&w.value&&(t.current=JSON.parse(JSON.stringify(((b=(C=n.propsRef.current)==null?void 0:C.columnsState)==null?void 0:b.value)||{})))},[]);const c=xe((x=!0)=>{const w={},C=b=>{b.forEach(({key:T,fixed:F,index:$,children:M,disable:I})=>{var Y,H;const A=tr(T,$);A&&(w[A]={show:I?(Y=i==null?void 0:i[A])==null?void 0:Y.show:x,fixed:F,disable:I,order:(H=i==null?void 0:i[A])==null?void 0:H.order}),M&&C(M)})};C(r),o(w)}),h=xe(x=>{x.target.checked?c():c(!1)}),g=xe(()=>{var x,w;l==null||l(),o(((w=(x=n.propsRef.current)==null?void 0:x.columnsState)==null?void 0:w.defaultValue)||t.current||n.defaultColumnKeyMap)}),f=Object.values(i).filter(x=>!x||x.show===!1),m=f.length>0&&f.length!==r.length,p=Fe(),{getPrefixCls:S}=d.useContext(u.ConfigProvider.ConfigContext),y=S("pro-table-column-setting"),{wrapSSR:j,hashId:v}=Qv(y);return j(a.jsx(u.Popover,{arrow:!1,title:a.jsxs("div",{className:ie(`${y}-title`,v),children:[e.checkable===!1?a.jsx("div",{}):a.jsx(u.Checkbox,{indeterminate:m,checked:f.length===0&&f.length!==r.length,onChange:x=>{h(x)},children:p.getMessage("tableToolBar.columnDisplay","列展示")}),s?a.jsx("a",{onClick:g,className:ie(`${y}-action-rest-button`,v),children:p.getMessage("tableToolBar.reset","重置")}):null,e!=null&&e.extra?a.jsx(u.Space,{size:12,align:"center",children:e.extra}):null]}),classNames:{root:ie(`${y}-overlay`,v)},trigger:"click",placement:"bottomRight",content:a.jsx(tT,{checkable:e.checkable??!0,draggable:e.draggable??!0,showListItemOption:e.showListItemOption??!0,className:y,localColumns:r,listsHeight:e.listsHeight}),children:e.children||a.jsx(u.Tooltip,{title:p.getMessage("tableToolBar.columnSetting","列设置"),children:e.settingIcon??a.jsx(se.SettingOutlined,{})})}))}const rT=e=>{const{hashId:t}=d.useContext(Vt),n=e.hashId??t,{items:r=[],type:s="inline",prefixCls:i,activeKey:o,defaultActiveKey:l}=e,[c,h]=Je(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 s==="inline"?a.jsx("div",{className:ie(`${i}-menu`,`${i}-inline-menu`,n),children:r.map((m,p)=>a.jsx("div",{onClick:()=>{g(m.key)},className:ie(`${i}-inline-menu-item`,f.key===m.key?`${i}-inline-menu-item-active`:void 0,n),children:m.label},m.key||p))}):s==="tab"?a.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)}):a.jsx("div",{className:ie(`${i}-menu`,`${i}-dropdownmenu`,n),children:a.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:a.jsxs(u.Space,{className:ie(`${i}-dropdownmenu-label`,n),children:[f.label,a.jsx(se.DownOutlined,{})]})})})},sT=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 aT(e){return Be("ProTableListToolBar",t=>{const n={...t,componentCls:`.${e}`};return[sT(n)]})}function iT(e){if(d.isValidElement(e))return e;if(e){const t=e,{icon:n,tooltip:r,onClick:s,key:i}=t;return n&&r?a.jsx(u.Tooltip,{title:r,children:a.jsx("span",{onClick:()=>{s&&s(i)},children:n},i)}):a.jsx("span",{onClick:()=>{s&&s(i)},children:n},i)}return null}const oT=({prefixCls:e,hashId:t,tabs:n,multipleLine:r,filtersNode:s})=>r?a.jsx("div",{className:ie(`${e}-extra-line`,t),children:n!=null&&n.items&&(n!=null&&n.items.length)?a.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:s}):s}):null,lT=({prefixCls:e,title:t,subTitle:n,tooltip:r,className:s,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}=fn.useToken(),j=S("pro-table-list-toolbar",e),{wrapSSR:v,hashId:x}=aT(j),w=Fe(),[C,b]=d.useState(!1),T=w.getMessage("tableForm.inputPlaceholder","请输入"),F=d.useMemo(()=>o?d.isValidElement(o)?o:a.jsx(u.Input.Search,{style:{width:200},placeholder:T,...o,onSearch:async(...R)=>{var _;await((_=o.onSearch)==null?void 0:_.call(o,...R))!==!1&&(l==null||l(R==null?void 0:R[0]))}}):null,[T,l,o]),$=d.useMemo(()=>h?a.jsx("div",{className:ie(`${j}-filter`,x),children:h}):null,[h,x,j]),M=d.useMemo(()=>p||t||n||r,[p,n,t,r]),I=d.useMemo(()=>Array.isArray(g)?g.length<1?null:a.jsx("div",{style:{display:"flex",alignItems:"center",gap:y.marginXS},children:g.map((R,z)=>d.isValidElement(R)?d.cloneElement(R,{key:z,...R==null?void 0:R.props}):a.jsx(d.Fragment,{children:R},z))}):g,[g]),A=d.useMemo(()=>!!(M&&F||!c&&$||I||f!=null&&f.length),[I,$,M,c,F,f==null?void 0:f.length]),Y=d.useMemo(()=>r||t||n||p||!M&&F,[M,p,F,n,t,r]),H=d.useMemo(()=>!Y&&A?a.jsx("div",{className:ie(`${j}-left`,x)}):!p&&(M||!F)?a.jsx("div",{className:ie(`${j}-left`,x),children:a.jsx("div",{className:ie(`${j}-title`,x),children:a.jsx(Jn,{tooltip:r,label:t,subTitle:n})})}):a.jsxs("div",{className:ie(`${j}-left`,x,{[`${j}-left-has-tabs`]:(p==null?void 0:p.type)==="tab",[`${j}-left-has-dropdown`]:(p==null?void 0:p.type)==="dropdown",[`${j}-left-has-inline-menu`]:(p==null?void 0:p.type)==="inline"}),children:[M&&!p&&a.jsx("div",{className:ie(`${j}-title`,x),children:a.jsx(Jn,{tooltip:r,label:t,subTitle:n})}),p&&a.jsx(rT,{...p,prefixCls:j,hashId:x}),!M&&F?a.jsx("div",{className:ie(`${j}-search`,x),children:F}):null]}),[Y,A,M,x,p,j,F,n,t,r]),k=d.useMemo(()=>A?a.jsxs("div",{className:ie(`${j}-right`,x),style:C?{}:{alignItems:"center"},children:[c?null:$,M&&F?a.jsx("div",{className:ie(`${j}-search`,x),children:F}):null,I,f!=null&&f.length?a.jsx("div",{className:ie(`${j}-setting-items`,x),children:f.map((R,z)=>{const _=iT(R);return a.jsx("div",{className:ie(`${j}-setting-item`,x),children:_},z)})}):null]}):null,[A,j,x,C,M,F,c,$,I,f]),E=d.useMemo(()=>{if(!A&&!Y)return null;const R=ie(`${j}-container`,x,{[`${j}-container-mobile`]:C});return a.jsxs("div",{className:R,children:[H,k]})},[Y,A,x,C,H,j,k]);return v(a.jsx(ra,{onResize:R=>{R.width<375!==C&&b(R.width<375)},children:R=>a.jsxs("div",{ref:R,style:i,className:ie(j,x,s),children:[E,a.jsx(oT,{filtersNode:$,hashId:x,prefixCls:j,tabs:m,multipleLine:c})]})}))},cT=d.forwardRef((e,t)=>{const{icon:n=a.jsx(se.ColumnHeightOutlined,{})}=e,r=d.useContext(Nn),s=Fe();return a.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:s.getMessage("tableToolBar.densityLarger","宽松")},{key:"middle",label:s.getMessage("tableToolBar.densityMiddle","中等")},{key:"small",label:s.getMessage("tableToolBar.densitySmall","紧凑")}]},trigger:["click"],children:a.jsx(u.Tooltip,{title:s.getMessage("tableToolBar.density","表格密度"),children:a.jsx("span",{ref:t,children:n})})})}),uT=d.memo(cT),dT=d.forwardRef((e,t)=>{const n=Fe(),[r,s]=d.useState(!1);return d.useEffect(()=>{Wi()&&(document.onfullscreenchange=()=>{s(!!document.fullscreenElement)})},[]),r?a.jsx(u.Tooltip,{title:n.getMessage("tableToolBar.exitFullScreen","退出全屏"),children:a.jsx("span",{ref:t,children:a.jsx(se.FullscreenExitOutlined,{})})}):a.jsx(u.Tooltip,{title:n.getMessage("tableToolBar.fullScreen","全屏"),children:a.jsx("span",{ref:t,children:a.jsx(se.FullscreenOutlined,{})})})}),Pd=d.memo(dT);function fT({intl:e},t){return{reload:{text:e.getMessage("tableToolBar.reload","刷新"),icon:t.reloadIcon??a.jsx(se.ReloadOutlined,{})},density:{text:e.getMessage("tableToolBar.density","表格密度"),icon:a.jsx(uT,{icon:t.densityIcon})},fullScreen:{text:e.getMessage("tableToolBar.fullScreen","全屏"),icon:a.jsx(Pd,{})}}}function hT(e,t,n,r){return Object.keys(e).filter(s=>s).map(s=>{const i=e[s];if(!i)return null;let o=i===!0?t[s]:c=>{i==null||i(c,n.current)};if(typeof o!="function"&&(o=()=>{}),s==="setting")return d.createElement(nT,{...e[s],columns:r,key:s});if(s==="fullScreen")return a.jsx("span",{onClick:o,children:a.jsx(Pd,{})},s);const l=fT(t,e)[s];return l?a.jsx("span",{onClick:o,children:a.jsx(u.Tooltip,{title:l.text,children:l.icon})},s):null}).filter(s=>s)}function mT({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:s,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:c,columns:h,optionsRender:g,...f}){const m=d.useContext(Nn),p=Fe(),S=d.useMemo(()=>{const v={reload:()=>{var C;return(C=r==null?void 0:r.current)==null?void 0:C.reload()},density:!0,setting:!0,search:!1,fullScreen:()=>{var C,b;return(b=(C=r==null?void 0:r.current)==null?void 0:C.fullScreen)==null?void 0:b.call(C)}};if(s===!1)return[];const x={...v,fullScreen:!1,...s},w=hT(x,{...v,intl:p},r,h);return g?g({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:s,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:c,columns:h,optionsRender:g,...f},w):w},[r,h,e,p,c,g,s,f,i,o,n,l,t]),y=n?n(r==null?void 0:r.current,{selectedRowKeys:i,selectedRows:o}):[],j=d.useMemo(()=>{if(!s||!s.search)return!1;const v={value:m.keyWords,onChange:x=>m.setKeyWords(x.target.value)};return s.search===!0?v:{...v,...s.search}},[m,s]);return d.useEffect(()=>{m.keyWords===void 0&&(c==null||c(""))},[m.keyWords,c]),a.jsx(lT,{title:e,tooltip:t,search:j,onSearch:c,actions:y,settings:S,...l})}const gT=e=>{const{hideToolbar:t,tableColumn:n,options:r,searchNode:s,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,w,C,b;if(!r||!r.search)return;const{name:j="keyword"}=r.search===!0?{}:r.search;((w=(x=r.search)==null?void 0:x.onSearch)==null?void 0:w.call(x,y))!==!1&&((b=(C=g==null?void 0:g.current)==null?void 0:C.setPageInfo)==null||b.call(C,{current:1}),p(it({_timestamp:Date.now(),[j]:y})))},[r,p,g]);return t?null:a.jsx(mT,{tooltip:i,columns:n,options:r,headerTitle:h,action:g,onSearch:S,selectedRows:l,selectedRowKeys:c,toolBarRender:f,toolbar:{filter:s,...o},optionsRender:m})},pT=(e,t)=>t.searchNode?!1:hn({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"]),yT=d.memo(gT,pT);function xT(e){const{toolBarRender:t,headerTitle:n,hideToolbar:r,selectedRows:s,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:a.jsx(yT,{headerTitle:n,hideToolbar:r,selectedRows:s,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:c,onFormSearchSubmit:j=>{S({...y||{},...j})},searchNode:h?g:null,options:f,optionsRender:m,actionRef:p,toolBarRender:t}),[p,y,n,r,h,f,m,g,i,s,S,o,t,l,c])}const bT=({pageInfo:e})=>{if(e){const{current:t,defaultCurrent:n,pageSize:r,defaultPageSize:s}=e;return{current:t||n||1,total:0,pageSize:r||s||20}}return{current:1,total:0,pageSize:20}};function ST(e){const[t,n]=Je(()=>bT(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]),s=xe(i=>{const o={...t,...i};(o.current!==t.current||o.pageSize!==t.pageSize||o.total!==t.total)&&r(o)});return[t,s]}const CT=(e,t,n)=>{var z;const r=d.useRef(!1),s=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]=Je(t,n==null?void 0:n.dataSource),y=d.useCallback(_=>{S(V=>{const Z=typeof _=="function"?_(V):_;return queueMicrotask(()=>{var B;(B=n==null?void 0:n.onDataSourceChange)==null||B.call(n,Z)}),Z})},[n==null?void 0:n.onDataSourceChange]),j=typeof(n==null?void 0:n.loading)=="object"?(z=n==null?void 0:n.loading)==null?void 0:z.spinning:n==null?void 0:n.loading,[v,x]=Je(!1,j),w=xe(_=>{var V;(V=n==null?void 0:n.onLoadingChange)==null||V.call(n,_)}),C=d.useCallback(_=>{x(V=>{const Z=typeof _=="function"?_(V):_;return queueMicrotask(()=>{w(Z)}),Z})},[w]),[b,T]=ST(n),[F,$]=d.useState(!1),M=(_,V)=>{y(_),(b==null?void 0:b.total)!==V&&T({...b,total:V||_.length})},I=Tr(b==null?void 0:b.current),A=Tr(b==null?void 0:b.pageSize),Y=Tr(l),H=xe(()=>{C(!1),$(!1)}),k=async(_,V)=>{if(f.current){f.current=!1;return}_?$(!0):C(!0);const{pageSize:Z,current:B}=b||{};try{const U=(n==null?void 0:n.pageInfo)!==!1?{current:B,pageSize:Z}:void 0,{data:J=[],success:G,total:K=0,...O}=await(e==null?void 0:e(U))||{};if(V!=null&&V.aborted)return[];if(G===!1)return[];const P=Mv(J,[n.postData].filter(N=>N));return V!=null&&V.aborted?[]:(M(P,K),i==null||i(P,O),P)}catch(U){if(V!=null&&V.aborted)return[];if(c===void 0)throw new Error(U);p===void 0&&y([]),c(U)}finally{V!=null&&V.aborted||H()}return[]},E=Yi(async _=>{if(m.current&&clearTimeout(m.current),!e)return;const V=new AbortController;s.current=V;try{const Z=await Promise.race([k(_,V.signal),new Promise((U,J)=>{var G,K,O;(O=(K=(G=s.current)==null?void 0:G.signal)==null?void 0:K.addEventListener)==null||O.call(K,"abort",()=>{J("aborted"),E.cancel(),H()})})]);if(V.signal.aborted)return;const B=ht(l,Z);return B&&!r.current&&(m.current=setTimeout(()=>{E.run(B)},Math.max(B,2e3))),Z}catch(Z){if(Z==="aborted")return[];throw Z}},h||30),R=()=>{var _;(_=s.current)==null||_.abort(),E.cancel(),H()};return d.useEffect(()=>(l||clearTimeout(m.current),!Y&&l&&E.run(!0),()=>{clearTimeout(m.current)}),[l]),d.useEffect(()=>(r.current=!1,()=>{r.current=!0}),[]),d.useEffect(()=>{const{current:_,pageSize:V}=b||{};(!I||I===_)&&(!A||A===V)||n.pageInfo&&p&&(p==null?void 0:p.length)>V||_!==void 0&&p&&p.length<=V&&(R(),E.run(!1))},[b==null?void 0:b.current]),d.useEffect(()=>{A&&(R(),E.run(!1))},[b==null?void 0:b.pageSize]),Kn(()=>(R(),E.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 E.run(!1)),pageInfo:b,pollingLoading:F,reset:async()=>{const{pageInfo:_}=n||{},{defaultCurrent:V=1,defaultPageSize:Z=20}=_||{};T({current:V,total:0,pageSize:Z})},setPageInfo:async _=>{T(_)}}},wT=e=>(t,n)=>{var h,g,f,m;const{fixed:r,index:s}=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||`${s}`,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)},jT=["",null,void 0],Ec=(...e)=>e.filter(t=>t!==void 0).map(t=>typeof t=="number"?t.toString():t).flat(1),vT=e=>{const t=d.useContext(or),{columnProps:n,prefixName:r,text:s,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,j]=d.useState(()=>Ec(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=Ec(r,r?h:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l);b.join("-")!==y.join("-")&&j(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]),w=d.useCallback(({children:b,...T})=>a.jsx(fp,{popoverProps:{getPopupContainer:t.getPopupContainer||(()=>i.rootDomRef.current||document.body)},errorType:"popover",name:y,...T,children:b},p),[p,y]),C=d.useCallback(()=>{const b={...ui(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:s)??(b==null?void 0:b.initialValue)??(n==null?void 0:n.initialValue);let T=a.jsx(yn,{cacheForSwr:!0,name:y,proFormFieldKey:p,ignoreFormItem:!0,fieldProps:ui(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:()=>a.jsx(a.Fragment,{children:T}),type:"form",recordKey:c,record:{...o,...m==null?void 0:m.getFieldValue([p])},isEditable:!0},m,e.editableUtils),n.ignoreFormItem)?a.jsx(a.Fragment,{children:T}):a.jsx(w,{...b,children:T},y.join("-"))},[n,x,r,s,p,y,g,w,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"?a.jsx(u.Form.Item,{noStyle:!0,shouldUpdate:(b,T)=>{if(b===T)return!1;const F=[v].flat(1);try{return JSON.stringify(Me(b,F))!==JSON.stringify(Me(T,F))}catch{return!0}},children:()=>C()}):C()};function Nd(e){var h,g;const{text:t,valueType:n,rowData:r,columnProps:s,index:i}=e;if((!n||["textarea","text"].includes(n.toString()))&&!(s!=null&&s.valueEnum)&&e.mode==="read")return jT.includes(t)?e.columnEmptyText:t;if(typeof n=="function"&&r)return Nd({...e,valueType:n(r,e.type)||"text"});const o=(s==null?void 0:s.key)||((h=s==null?void 0:s.dataIndex)==null?void 0:h.toString()),l=s!=null&&s.dependencies?[e.prefixName,e.prefixName?i==null?void 0:i.toString():(g=e.recordKey)==null?void 0:g.toString(),s==null?void 0:s.dependencies].filter(Boolean).flat(1):[],c={valueEnum:ht(s==null?void 0:s.valueEnum,r),request:s==null?void 0:s.request,dependencies:s!=null&&s.dependencies?[l]:void 0,originDependencies:s!=null&&s.dependencies?[s==null?void 0:s.dependencies]:void 0,params:ht(s==null?void 0:s.params,r,s),readonly:s==null?void 0:s.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"?a.jsx(yn,{mode:"read",ignoreFormItem:!0,fieldProps:ui(s==null?void 0:s.fieldProps,null,s),...c}):a.jsx(vT,{...e,proFieldProps:c},e.recordKey)}const TT=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):a.jsx(Jn,{label:t,tooltip:e.tooltip,ellipsis:n})};function FT(e,t,n,r){return typeof r=="boolean"?r===!1:(r==null?void 0:r(e,t,n))===!1}const RT=(e,t,n)=>{const r=Array.isArray(n)?Me(t,n):t[n],s=String(r);return String(s)===String(e)};function $T({columnProps:e,text:t,rowData:n,index:r,columnEmptyText:s,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=C=>C}=e,y=S(t,n,r,g),j=m&&!FT(t,n,r,e==null?void 0:e.editable)?"edit":"read",v=Nd({text:y,valueType:e.valueType||"text",index:r,rowData:n,subName:l,columnProps:{...e,entry:n,entity:n},counter:i,columnEmptyText:s,type:o,recordKey:p,mode:j,prefixName:f,editableUtils:h}),x=j==="edit"?v:Tp(v,e,y,t);if(j==="edit")return e.valueType==="option"?a.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 C=d.isValidElement(x)||["string","number"].includes(typeof x);return!$t(x)&&C?x:null}const w=e.render(x,n,r,{...g,...h},{...e,isEditable:m,type:"table"});return Ov(w)?w:w&&e.valueType==="option"&&Array.isArray(w)?a.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:8},children:w}):w}function ET(e){const{onFilter:t,dataIndex:n}=e;return t===!0?(r,s)=>RT(r,s,n):Pu(t)}function IT(e){const{filters:t=[],valueEnum:n}=e;return t===!0?gd(ht(n,void 0)).filter(r=>r&&r.value!=="all"):t}function MT(e,t,n){return{fixed:((e==null?void 0:e[t])||{fixed:n.fixed}).fixed}}function OT(e,t,n){return{filteredValue:Nv(e,n),sortOrder:Pv(t,n)}}function AT(e,t,n,r,s){var c;if(typeof e!="object"||e===null||!Reflect.has(e,n))return;const i=e,o=i[n],l=s.get(o)||[];return(c=i[r])==null||c.forEach(h=>{const g=h[n];s.has(g)||s.set(g,l.concat([t,r]))}),o}function kT(e,t,n){let r=t.rowKey??"id";return function(i,o,l){typeof t.rowKey=="function"&&(r=t.rowKey(o,l));const c=AT(o,l,r,t.childrenColumnName,n);return $T({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 Ld(e){var i;const{columns:t,context:n,parents:r}=e,s=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=tr(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:j}=OT(n.proFilter,n.proSort,o),{fixed:v}=MT(n.counter.columnsMap,p,o),x={index:l,key:p,...o,title:TT(o),valueEnum:g,filters:IT(o),onFilter:ET(o),filteredValue:y,sortOrder:j,fixed:v,width:o.width||(o.fixed?200:void 0),children:o.children?Ld({columns:(o==null?void 0:o.children)??[],context:n,parents:{...o,key:p}}):void 0,render:kT(o,n,s)};return Dp(x)}))==null?void 0:i.filter(o=>!o.hideInTable)}function DT({dataSource:e,editableUtils:t,pagination:n,getRowKey:r,childrenColumnName:s}){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=s;if(c!=null&&c.parentKey){const m={...l,map_row_parentKey:(f=Ke(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 xr(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 PT({propsCardProps:e,notNeedCardDom:t,name:n,hideToolbar:r,toolbarDom:s}){return e===!1||t||n?{}:r?{padding:0}:s?{paddingBlockStart:0}:{padding:0}}function NT({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 LT({propsPagination:e,action:t,intl:n,request:r,type:s}){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:s==="list"?c:1})}};return r&&i&&(delete i.onChange,delete i.onShowSizeChange),Ev(i,o,n)},[t,n,e,r,s])}function _T({propsRowSelection:e,selectedRowKeys:t,selectedRows:n,onCleanSelected:r,tableAlertOptionRender:s,tableAlertRender:i}){return d.useMemo(()=>e===!1?null:a.jsx($v,{selectedRowKeys:t,selectedRows:n,onCleanSelected:r,alertOptionRender:s,alertInfoRender:i,alwaysShowAlert:e==null?void 0:e.alwaysShowAlert}),[r,e,t,n,s,i])}const zT={},BT=e=>{var lo,co,uo,fo,ho,mo;const{cardBordered:t,request:n,className:r,params:s=zT,defaultData:i,headerTitle:o,postData:l,ghost:c,pagination:h,actionRef:g,toolBarRender:f,optionsRender:m,onLoad:p,onRequestError:S,style:y,cardProps:j,tableStyle:v,tableClassName:x,options:w,search:C,name:b,onLoadingChange:T,rowSelection:F=!1,beforeSearchSubmit:$,tableAlertRender:M,defaultClassName:I,formRef:A,type:Y="table",columnEmptyText:H="-",toolbar:k,rowKey:E,manualRequest:R,polling:z,tooltip:_,revalidateOnFocus:V=!1,searchFormRender:Z,...B}=e,{wrapSSR:U,hashId:J}=Vv(e.defaultClassName),G=ie(I,r,J),K=d.useRef(),O=d.useRef(null),P=d.useRef(),N=A||P;d.useImperativeHandle(g,()=>K.current);const[D,L]=Je(F?(F==null?void 0:F.defaultSelectedRowKeys)||[]:void 0,F?F.selectedRowKeys:void 0),[W,q]=d.useState(()=>{if(!(R||C!==!1))return{}}),X=d.useRef(W),ee=xe(he=>{const ye=typeof he=="function"?he(X.current):he;X.current=ye,q(ye)}),{columns:re=[],columnsState:le}=e,{defaultProFilter:ce,defaultProSort:de}=d.useMemo(()=>{const{sort:he,filter:ye}=Dv(Oi(re));return{defaultProFilter:ye,defaultProSort:he}},[re]),[te,ue]=d.useState(ce),[pe,be]=d.useState(de);Kn(()=>{ue(ce),be(de)},[ce,de]);const ne=Fe(),ae=typeof h=="object"?h:{defaultCurrent:1,defaultPageSize:20,pageSize:20,current:1},Q=d.useContext(Nn),fe=d.useMemo(()=>{if(n)return async he=>{const ye={...he||{},...X.current||{},...s};return delete ye._timestamp,await n(ye,pe,te)}},[W,s,te,pe,n]),me=CT(fe,i,{pageInfo:h===!1?!1:ae,loading:e.loading,dataSource:e.dataSource,onDataSourceChange:e.onDataSourceChange,onLoad:p,onLoadingChange:T,onRequestError:S,postData:l,revalidateOnFocus:V,manual:W===void 0,polling:z,effects:[dn(s),dn(W),dn(te),dn(pe)],debounceTime:e.debounceTime,onPageInfoChange:he=>{var ye,Ie;!h||!fe||((ye=h==null?void 0:h.onChange)==null||ye.call(h,he.current,he.pageSize),(Ie=h==null?void 0:h.onShowSizeChange)==null||Ie.call(h,he.current,he.pageSize))}});d.useEffect(()=>{var ye;if(e.manualRequest||!e.request||!V||(ye=e.form)!=null&&ye.ignoreRules)return;const he=()=>{document.visibilityState==="visible"&&me.reload()};return document.addEventListener("visibilitychange",he),()=>document.removeEventListener("visibilitychange",he)},[]);const ve=d.useRef(new Map),Ee=NT({rowKey:E,name:e.name});d.useMemo(()=>{var he;return(he=me.dataSource)!=null&&he.length?me.dataSource.map(Ie=>{const pt=Ee(Ie,-1);return ve.current.set(pt,Ie),pt}):[]},[me.dataSource,Ee]);const Te=LT({propsPagination:h,action:me,intl:ne,request:n,type:Y});Kn(()=>{Te&&(Te.current!==me.pageInfo.current||Te.pageSize!==me.pageInfo.pageSize)&&me.setPageInfo({current:Te.current,pageSize:Te.pageSize})},[Te]),Kn(()=>{var he;e.request&&!SC(s)&&me.dataSource&&!Oa(me.dataSource,i)&&((he=me==null?void 0:me.pageInfo)==null?void 0:he.current)!==1&&me.setPageInfo({current:1})},[s]),Q.setPrefixName(e.name),d.useEffect(()=>{(le==null?void 0:le.value)!==void 0&&Q.setColumnsMap(le.value)},[le==null?void 0:le.value]);const Ye=xe(()=>{F&&F.onChange&&F.onChange([],[],{type:"none"}),L([])});Q.propsRef.current=e;const Ge=PC({...e.editable,tableName:e.name,getRowKey:Ee,childrenColumnName:((lo=e.expandable)==null?void 0:lo.childrenColumnName)||"children",dataSource:me.dataSource||[],setDataSource:he=>{var ye,Ie;(Ie=(ye=e.editable)==null?void 0:ye.onValuesChange)==null||Ie.call(ye,void 0,he),me.setDataSource(he)}}),{token:Ce}=fn==null?void 0:fn.useToken();Iv(K,me,{nativeElement:((co=Q.rootDomRef)==null?void 0:co.current)||void 0,focus:()=>{var he,ye;(ye=(he=Q.rootDomRef)==null?void 0:he.current)==null||ye.focus()},fullScreen:()=>{var he,ye;!((he=Q.rootDomRef)!=null&&he.current)||!document.fullscreenEnabled||(document.fullscreenElement?document.exitFullscreen():(ye=Q.rootDomRef)==null||ye.current.requestFullscreen())},onCleanSelected:()=>{Ye()},resetAll:()=>{var Ie,pt,tn,Ut,cr;Ye(),Q.setKeyWords(void 0),me.setPageInfo({current:1}),ue(ce),be(de),(Ie=N==null?void 0:N.current)==null||Ie.resetFields();const he=((tn=(pt=N==null?void 0:N.current)==null?void 0:pt.getFieldsFormatValue)==null?void 0:tn.call(pt,!0))??((cr=(Ut=N==null?void 0:N.current)==null?void 0:Ut.getFieldsValue)==null?void 0:cr.call(Ut,!0))??{},ye=$?$(he):he;ee(ye??{})},editableUtils:Ge,scrollTo:he=>{var ye,Ie;return(Ie=(ye=O==null?void 0:O.current)==null?void 0:ye.scrollTo)==null?void 0:Ie.call(ye,he)}}),Q.setAction(K.current);const Re=d.useMemo(()=>{var ye;const he={counter:Q,columnEmptyText:H,type:Y,editableUtils:Ge,marginSM:Ce.marginSM,rowKey:E??"id",childrenColumnName:((ye=e.expandable)==null?void 0:ye.childrenColumnName)??"children",proFilter:te,proSort:pe};return Ld({columns:re,context:he}).sort(wT(Q.columnsMap??{}))},[re,Q==null?void 0:Q.sortKeyColumns,Q==null?void 0:Q.columnsMap,H,Y,Ge.editableKeys&&Ge.editableKeys.join(","),te,pe]);ku(()=>{if(Re&&Re.length>0){const he=Re.map(ye=>tr(ye.key,ye.index));Q.setSortKeyColumns(he)}},[Re],["render","formItemRender"],100),Kn(()=>{const{pageInfo:he}=me,{current:ye=he==null?void 0:he.current,pageSize:Ie=he==null?void 0:he.pageSize}=h||{};h&&(ye||Ie)&&(Ie!==(he==null?void 0:he.pageSize)||ye!==(he==null?void 0:he.current))&&me.setPageInfo({pageSize:Ie||he.pageSize,current:ye||he.current})},[h&&h.pageSize,h&&h.current]);const dt={selectedRowKeys:D,...F,onChange:(he,ye,Ie)=>{F&&F.onChange&&F.onChange(he,ye,Ie),L(he)}},rt=C!==!1&&(C==null?void 0:C.filterType)==="light",lt=xe(he=>{var ye,Ie;if(w&&w.search){const{name:pt="keyword"}=w.search===!0?{}:w.search;if(((Ie=(ye=w.search)==null?void 0:ye.onSearch)==null?void 0:Ie.call(ye,Q.keyWords))!==!1){ee({...he,[pt]:Q.keyWords});return}}ee(he)}),Qe=d.useMemo(()=>{var he;return typeof me.loading=="object"?((he=me.loading)==null?void 0:he.spinning)||!1:me.loading},[me.loading]),st=a.jsx(Jv,{search:C,type:Y,pagination:Te,beforeSearchSubmit:$,actionRef:K,columns:re,onFormSearchSubmit:lt,ghost:c,onReset:e.onReset,onSubmit:e.onSubmit,loading:!!Qe,manualRequest:R,form:e.form,formRef:N,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,searchFormRender:Z,proTableProps:e}),Qt=d.useMemo(()=>D==null?void 0:D.map(he=>{var ye;return(ye=ve.current)==null?void 0:ye.get(he)}),[me.dataSource,D]),Hr=d.useMemo(()=>w===!1&&!o&&!f&&!k&&!rt,[w,o,f,k,rt]),en=a.jsx(xT,{toolBarRender:f,headerTitle:o,hideToolbar:Hr,selectedRows:Qt,selectedRowKeys:D,tableColumn:Re,tooltip:_,toolbar:k,isLightFilter:rt,searchNode:st,options:w,optionsRender:m,actionRef:K,setFormSearch:ee,formSearch:W}),aa=_T({propsRowSelection:F,selectedRowKeys:D,selectedRows:Qt,onCleanSelected:Ye,tableAlertOptionRender:B.tableAlertOptionRender,tableAlertRender:M}),Bd=d.useMemo(()=>{var he;return DT({dataSource:me.dataSource,editableUtils:Ge,pagination:Te,getRowKey:Ee,childrenColumnName:((he=e.expandable)==null?void 0:he.childrenColumnName)||"children"})},[me.dataSource,Ge==null?void 0:Ge.newLineRecord,Ee,Te,(uo=e.expandable)==null?void 0:uo.childrenColumnName]),ia=d.useMemo(()=>{const he=ye=>ye.map(Ie=>{var Ut;const pt=tr(Ie.key,Ie.index),tn=(Ut=Q.columnsMap)==null?void 0:Ut[pt];return tn&&tn.show===!1?!1:Ie.children?{...Ie,children:he(Ie.children)}:Ie}).filter(Boolean);return he(Re)},[Q.columnsMap,Re]),Vd=d.useMemo(()=>Oi(ia).filter(ye=>!!ye.filters),[ia]),Hd=he=>{Oa(he,pe)||be(he??{})},Yd=he=>{Oa(he,te)||ue(he??{})},ro=()=>({...B,size:Q.tableSize,rowSelection:F===!1?void 0:dt,className:x,style:v,columns:ia,loading:me.loading,dataSource:Bd,pagination:Te,onChange:(he,ye,Ie,pt)=>{var cr;(cr=B.onChange)==null||cr.call(B,he,ye,Ie,pt);const tn=Av(ye,Vd);Yd(it(tn));const Ut=kv(Ie);Hd(it(Ut))}}),oa=C===!1&&!o&&!f,so=a.jsx(eo.Provider,{value:{grid:!1,colProps:void 0,rowProps:void 0},children:a.jsx(u.Table,{...ro(),rowKey:E,ref:O})}),la=e.tableViewRender?e.tableViewRender({...ro(),rowSelection:F!==!1?dt:void 0},so):so,ao=e.editable&&!b?a.jsxs(a.Fragment,{children:[en,aa,d.createElement(gt,{...e.editable.formProps,formRef:(fo=e.editable.formProps)==null?void 0:fo.formRef,component:!1,form:e.editable.form,onValuesChange:Ge.onValuesChange,key:"table",submitter:!1,omitNil:!1,dateFormatter:e.dateFormatter},la)]}):a.jsxs(a.Fragment,{children:[en,aa,la]}),Ud=PT({propsCardProps:j,notNeedCardDom:oa,name:e.name,hideToolbar:Hr,toolbarDom:en}),Kd=d.useMemo(()=>j!==!1&&!e.name&&!oa||j!==!1&&Y==="list",[j,e.name,Y,oa]),ca=j===!1?{}:j??{},io=Kd?a.jsx(ta,{...ca,ghost:c,variant:Dd("table",t)?"outlined":"borderless",styles:{body:{...Ud,...((ho=ca.styles)==null?void 0:ho.body)??{}},header:(mo=ca.styles)==null?void 0:mo.header},children:ao}):ao,Wd=()=>e.tableRender?e.tableRender(e,io,{toolbar:en||void 0,alert:aa||void 0,table:la||void 0}):io,oo=a.jsxs("div",{className:ie(G,{[`${I}-polling`]:me.pollingLoading}),style:y,ref:Q.rootDomRef,"data-testid":"pro-table",children:[rt?null:st,Y!=="form"&&e.tableExtraRender&&a.jsx("div",{className:ie(G,`${I}-extra`),children:e.tableExtraRender(e,me.dataSource||[])}),Y!=="form"&&Wd()]});return!w||!(w!=null&&w.fullScreen)?U(oo):U(a.jsx(u.ConfigProvider,{getPopupContainer:()=>Q.rootDomRef.current||document.body,children:oo}))},Ln=e=>{const{getPrefixCls:t}=d.useContext(u.ConfigProvider.ConfigContext),n=e.ErrorBoundary===!1?d.Fragment:e.ErrorBoundary||np,r=d.useContext(zt);return a.jsx(_v,{initValue:{...e,columnsState:e.columnsState,columns:e.columns,onSizeChange:e.onSizeChange,size:e.size||void 0,defaultSize:e.defaultSize||void 0},children:a.jsx(In,{valueTypeMap:{...r.valueTypeMap,...xd},needDeps:!0,children:a.jsx(n,{children:a.jsx(BT,{defaultClassName:`${t("pro-table")}`,...e})})})})};Ln.Summary=u.Table.Summary;let VT="/api";function Dt(){return Zt.createRequest({baseURL:VT,timeout:15e3})}const Yn={create:e=>Dt().post("/ctc/ac/accounts",e),getById:e=>Dt().get("/ctc/ac/accounts",{params:{id:e}}),listByTenant:e=>Dt().get("/ctc/ac/accounts",{params:e}),updateStatus:(e,t)=>Dt().post("/ctc/ac/accounts/status",null,{params:{id:e,status:t}}),changePassword:(e,t)=>Dt().post("/ctc/ac/accounts/password/change",t,{params:{id:e}}),resetPassword:(e,t)=>Dt().post("/ctc/ac/accounts/password/reset",t,{params:{id:e}}),update:(e,t)=>Dt().put("/ctc/ac/accounts",t,{params:{id:e}}),delete:e=>Dt().delete("/ctc/ac/accounts",{params:{id:e}}),assignRole:(e,t)=>Dt().post("/ctc/ac/accounts/assign-role",null,{params:{userId:e,roleId:t}})},HT={list:e=>Dt().post("/ctc/ac/login-log/list",e)},fs={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"}},YT={1:{text:"用户名",color:"blue"},2:{text:"邮箱",color:"purple"},3:{text:"手机",color:"cyan"}};function UT({apiBaseURL:e}){var O,P,N,D;const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,s]=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(),[j]=u.Form.useForm(),[v,x]=d.useState(!1),[w,C]=d.useState(null),[b,T]=d.useState("info"),[F,$]=d.useState([]),[M,I]=d.useState(!1),A=async L=>{if(!L){$([]);return}I(!0);try{const W=await HT.list({accountId:Number(L),pageSize:50});$((W==null?void 0:W.records)||[])}catch{$([])}finally{I(!1)}},Y=L=>{C(L),T("info"),x(!0),A(L.id)},H=()=>{x(!1),C(null),$([])},k=L=>{T(L),L==="logs"&&(w!=null&&w.id)&&A(w.id)},E=d.useCallback(()=>{var q;const L=n.getFieldsValue(),W={};L.username&&(W.username=L.username),L.status!==void 0&&(W.status=L.status),L.dateRange&&(W.startDate=L.dateRange[0].format("YYYY-MM-DD"),W.endDate=L.dateRange[1].format("YYYY-MM-DD")),s(W),(q=t.current)==null||q.reload()},[n]),R=d.useCallback(()=>{var L;n.resetFields(),s({}),(L=t.current)==null||L.reload()},[n]),z=async L=>{try{let q=await Yn.listByTenant({tenant:r.tenant,pageNum:L.current,pageSize:L.pageSize})||[];const X=r.username,ee=r.status,re=r.startDate,le=r.endDate;return q=q.filter(ce=>{var de;return!(X&&!((de=ce.username)!=null&&de.includes(X))||ee!==void 0&&ce.status!==ee||re&&ce.createdAt&&Se(ce.createdAt).isBefore(re,"day")||le&&ce.createdAt&&Se(ce.createdAt).isAfter(le,"day"))}),{data:q,success:!0,total:q.length}}catch(W){return u.message.error("获取账号列表失败:"+((W==null?void 0:W.message)||"未知错误")),{data:[],success:!1,total:0}}},_=async()=>{var L;try{const W=await y.validateFields();await Yn.create(W),u.message.success("创建成功"),g(!1),y.resetFields(),(L=t.current)==null||L.reload()}catch(W){if(W!=null&&W.errorFields)return;u.message.error("创建失败:"+((W==null?void 0:W.message)||"未知错误"))}},V=async(L,W)=>{var X;const q=W===1?0:1;try{await Yn.updateStatus(L,q),u.message.success(q===1?"已启用":"已停用"),(X=t.current)==null||X.reload()}catch(ee){u.message.error("操作失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},Z=async()=>{var L;try{await Promise.all(l.map(W=>Yn.updateStatus(W.id,0))),u.message.success(`已停用 ${l.length} 个账号`),o([]),c([]),(L=t.current)==null||L.reload()}catch(W){u.message.error("批量操作失败:"+((W==null?void 0:W.message)||"未知错误"))}},B=()=>{const L=`ID,账号,昵称,类型,邮箱,手机,租户,状态,创建时间
|
|
56
|
-
`,W=l.length>0?l:[];if(W.length===0){
|
|
57
|
-
`),X=new Blob(["\uFEFF"+q],{type:"text/csv;charset=utf-8"}),ee=URL.createObjectURL(X),re=document.createElement("a");re.href=ee,re.download=`accounts_${Se().format("YYYYMMDD_HHmmss")}.csv`,re.click(),URL.revokeObjectURL(ee),u.message.success(`已导出 ${W.length} 条数据`)},U=L=>{S(L),j.resetFields(),m(!0)},J=async()=>{if(p!=null&&p.id)try{const L=await j.validateFields();await Yn.resetPassword(p.id,{newPassword:L.newPassword}),u.message.success(`已重置账号 ${p.username} 的密码`),m(!1),j.resetFields()}catch(L){if(L!=null&&L.errorFields)return;u.message.error("重置失败:"+((L==null?void 0:L.message)||"未知错误"))}},G=[{title:"登录标识",dataIndex:"identifier",width:140},{title:"登录方式",dataIndex:"identityType",width:90,render:(L,W)=>{const q=YT[W.identityType]||{text:`${W.identityType}`,color:"default"};return a.jsx(u.Tag,{color:q.color,children:q.text})}},{title:"结果",dataIndex:"loginStatus",width:80,render:(L,W)=>a.jsx(u.Tag,{color:W.loginStatus===1?"success":"error",children:W.loginStatus===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0},{title:"客户端IP",dataIndex:"clientIp",width:120},{title:"登录时间",dataIndex:"loginTime",width:170,render:L=>L?Se(L).format("YYYY-MM-DD HH:mm:ss"):"-"}],K=[{title:"ID",dataIndex:"id",width:60,search:!1},{title:"账号",dataIndex:"username",width:120,fixed:"left",search:!1},{title:"昵称",dataIndex:"nickname",width:120,search:!1},{title:"类型",dataIndex:"accountType",width:110,search:!1,render:(L,W)=>{const q=hs[W.accountType??3]||{text:String(W.accountType??"未知"),color:"default"};return a.jsx(u.Tag,{color:q.color,children:q.text})}},{title:"邮箱",dataIndex:"email",width:160,ellipsis:!0,search:!1},{title:"手机",dataIndex:"phone",width:120,search:!1},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"状态",dataIndex:"status",width:80,search:!1,render:(L,W)=>{const q=fs[W.status??1]||{text:String(W.status??"未知"),color:"default"};return a.jsx(u.Tag,{color:q.color,children:q.text})}},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:220,fixed:"right",search:!1,render:(L,W)=>[a.jsx(u.Tooltip,{title:W.status===1?"停用":"启用",children:a.jsx(u.Button,{type:"text",size:"small",danger:W.status===1,icon:W.status===1?a.jsx(se.StopOutlined,{}):a.jsx(se.CheckCircleOutlined,{}),onClick:()=>V(W.id,W.status??1),children:W.status===1?"停用":"启用"})},"status"),a.jsx(u.Tooltip,{title:"重置密码",children:a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.KeyOutlined,{}),onClick:()=>U(W),children:"重置密码"})},"reset"),a.jsx(u.Tooltip,{title:"账号详情 / 登录日志",children:a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.FileTextOutlined,{}),onClick:()=>Y(W),children:"详情"})},"detail")]}];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[a.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[a.jsxs(u.Form,{form:n,layout:"inline",children:[a.jsx(u.Form.Item,{name:"username",label:"用户名",children:a.jsx(mt.SearchInput,{placeholder:"请输入用户名",size:"large",onChange:L=>n.setFieldValue("username",L)})}),a.jsx(u.Form.Item,{name:"status",label:"状态",children:a.jsx(u.Select,{placeholder:"全部",allowClear:!0,style:{width:120},options:[{value:1,label:"正常"},{value:0,label:"禁用"},{value:2,label:"锁定"}]})}),a.jsx(u.Form.Item,{name:"dateRange",label:"创建时间",children:a.jsx(u.DatePicker.RangePicker,{style:{width:240}})}),a.jsx(u.Form.Item,{children:a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.SearchOutlined,{}),onClick:E,children:"查询"}),a.jsx(u.Button,{icon:a.jsx(se.UndoOutlined,{}),onClick:R,children:"重置"})]})})]}),a.jsxs(u.Space,{style:{flexShrink:0},children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>g(!0),children:"新增"}),a.jsx(u.Button,{danger:!0,icon:a.jsx(se.DeleteOutlined,{}),disabled:i.length===0,onClick:Z,children:"批量停用"}),a.jsx(u.Button,{icon:a.jsx(se.DownloadOutlined,{}),onClick:B,children:"导出"}),a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>{var L;return(L=t.current)==null?void 0:L.reload()},children:"刷新"})]})]})}),a.jsx(Ln,{actionRef:t,rowKey:"id",columns:K,request:z,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:L=>`共 ${L} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(L,W)=>{o(L),c(W)}},tableAlertRender:({selectedRowKeys:L})=>a.jsxs("span",{children:["已选择 ",a.jsx("a",{style:{fontWeight:600},children:L.length})," 项"]})}),a.jsx(u.Modal,{title:"新建账号",open:h,onOk:_,onCancel:()=>g(!1),size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"username",label:"用户名",rules:[{required:!0,min:3,max:32}],children:a.jsx(u.Input,{placeholder:"3-32 位字母数字下划线"})}),a.jsx(u.Form.Item,{name:"password",label:"初始密码",rules:[{required:!0,min:8}],children:a.jsx(u.Input.Password,{placeholder:"至少 8 位"})}),a.jsx(u.Form.Item,{name:"nickname",label:"昵称",children:a.jsx(u.Input,{placeholder:"可选"})}),a.jsx(u.Form.Item,{name:"email",label:"邮箱",rules:[{type:"email"}],children:a.jsx(u.Input,{placeholder:"可选"})}),a.jsx(u.Form.Item,{name:"phone",label:"手机号",children:a.jsx(u.Input,{placeholder:"可选"})}),a.jsx(u.Form.Item,{name:"accountType",label:"账号类型",initialValue:3,children:a.jsx(u.Select,{options:[{value:1,label:"超级管理员"},{value:2,label:"租户管理员"},{value:3,label:"普通成员"},{value:4,label:"临时账号"}]})}),a.jsx(u.Form.Item,{name:"tenantCode",label:"租户编码",children:a.jsx(u.Input,{placeholder:"如 default / tenant1"})})]})}),a.jsx(u.Modal,{title:p?`重置密码 — ${p.username}`:"重置密码",open:f,onOk:J,onCancel:()=>m(!1),size:"large",okText:"确认重置",okButtonProps:{danger:!0},destroyOnHidden:!0,children:a.jsx(u.Form,{form:j,layout:"vertical",style:{marginTop:16},children:a.jsx(u.Form.Item,{name:"newPassword",label:"新密码",rules:[{required:!0,min:8,message:"至少 8 位"}],extra:"重置后建议通知账号持有人当面修改",children:a.jsx(u.Input.Password,{placeholder:"至少 8 位"})})})}),a.jsx(u.Drawer,{title:w?`账号详情 — ${w.username}`:"账号详情",open:v,onClose:H,size:900,destroyOnHidden:!0,children:w&&a.jsxs("div",{style:{display:"flex",gap:16,minHeight:480},children:[a.jsx("div",{style:{width:160,borderRight:"1px solid #f0f0f0",paddingRight:8},children:a.jsx(u.Menu,{mode:"inline",selectedKeys:[b],onClick:({key:L})=>k(L),style:{border:"none",background:"transparent"},items:[{key:"info",icon:a.jsx(se.UserOutlined,{}),label:"基本信息"},{key:"logs",icon:a.jsx(se.FileTextOutlined,{}),label:"登录日志"}]})}),a.jsx("div",{style:{flex:1,minWidth:0},children:b==="info"?a.jsxs(u.Descriptions,{title:"账号信息",size:"small",bordered:!0,column:2,children:[a.jsx(u.Descriptions.Item,{label:"账号ID",children:w.id}),a.jsx(u.Descriptions.Item,{label:"用户名",children:w.username}),a.jsx(u.Descriptions.Item,{label:"昵称",children:w.nickname||"-"}),a.jsx(u.Descriptions.Item,{label:"账号类型",children:a.jsx(u.Tag,{color:(O=hs[w.accountType??3])==null?void 0:O.color,children:((P=hs[w.accountType??3])==null?void 0:P.text)||w.accountType})}),a.jsx(u.Descriptions.Item,{label:"邮箱",children:w.email||"-"}),a.jsx(u.Descriptions.Item,{label:"手机",children:w.phone||"-"}),a.jsx(u.Descriptions.Item,{label:"租户",children:w.tenantCode||"-"}),a.jsx(u.Descriptions.Item,{label:"状态",children:a.jsx(u.Tag,{color:(N=fs[w.status??1])==null?void 0:N.color,children:(D=fs[w.status??1])==null?void 0:D.text})}),a.jsx(u.Descriptions.Item,{label:"到期时间",children:w.expireAt?Se(w.expireAt).format("YYYY-MM-DD HH:mm:ss"):"永久"}),a.jsx(u.Descriptions.Item,{label:"创建时间",children:w.createdAt?Se(w.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),a.jsx(u.Descriptions.Item,{label:"更新时间",span:2,children:w.updatedAt?Se(w.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]}):a.jsx(mt.ListTable,{cardTitle:`登录日志(${F.length})`,cardExtra:a.jsx(u.Button,{size:"small",icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>w.id&&A(w.id),children:"刷新"}),rows:F,columns:G,rowKey:"id",loading:M,searchKeys:["identifier","clientIp"],searchPlaceholder:"按登录标识 / 客户端 IP 过滤",emptyTitle:"暂无登录记录"})})]})})]})}let KT="/api";function mr(){return Zt.createRequest({baseURL:KT,timeout:15e3})}const Sr={listApplications:e=>mr().get("/meta-app/list",{params:e}),getApplication:e=>mr().get("/meta-app/get",{params:{id:e}}),create:e=>mr().post("/meta-app",e),update:(e,t)=>mr().put("/meta-app",t,{params:{id:e}}),delete:e=>mr().delete("/meta-app",{params:{id:e}})};let WT="/api";function qe(){return Zt.createRequest({baseURL:WT,timeout:15e3})}const at={listResourcesByApp:e=>qe().get("/ctc/authz/resources/page-by-app",{params:e}),listAllResources:()=>qe().get("/ctc/authz/resources/list"),pageResources:e=>qe().get("/ctc/authz/resources/page",{params:e}),distinctApps:()=>qe().get("/ctc/authz/resources/distinct-apps"),getResource:e=>qe().get("/ctc/authz/resources",{params:{id:e}}),createResource:e=>qe().post("/ctc/authz/resources",e),updateResource:(e,t)=>qe().put("/ctc/authz/resources",t,{params:{id:e}}),deleteResource:e=>qe().delete("/ctc/authz/resources",{params:{id:e}}),listResourceRoles:e=>qe().get("/ctc/authz/resources/roles",{params:{resourceId:e}}),grantRoleResource:(e,t,n)=>{const r=n==null?null:{dataFilter:n};return qe().post("/ctc/authz/roles/grant-resource",r,{params:{roleId:e,resourceId:t}})},revokeRoleResource:(e,t)=>qe().delete("/ctc/authz/roles/revoke-resource",{params:{roleId:e,resourceId:t}}),listAllRoles:()=>qe().get("/ctc/authz/roles/list"),pageRoles:e=>qe().get("/ctc/authz/roles/page",{params:e}),getRole:e=>qe().get("/ctc/authz/roles",{params:{id:e}}),createRole:e=>qe().post("/ctc/authz/roles",e),updateRole:(e,t)=>qe().put("/ctc/authz/roles",t,{params:{id:e}}),deleteRole:e=>qe().delete("/ctc/authz/roles",{params:{id:e}}),listUserRoles:e=>qe().get("/ctc/authz/users/roles",{params:{userId:e}}),listUserPermissions:e=>qe().get("/ctc/authz/users/permissions",{params:{userId:e}}),grantUserRole:(e,t,n)=>{const r={userId:e,roleId:t};return n&&(r.expireAt=n),qe().post("/ctc/authz/users/grant-role",null,{params:r})},revokeUserRole:(e,t)=>qe().delete("/ctc/authz/users/revoke-role",{params:{userId:e,roleId:t}}),listRolePermissions:e=>qe().get("/ctc/authz/roles/resources",{params:{roleId:e}}),check:e=>qe().post("/ctc/authz/check",e)},qT={API:1,MENU:2,BUTTON:3,DATA:4},gr={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}},GT={GET:"green",POST:"blue",PUT:"orange",DELETE:"red",PATCH:"purple"},Ba={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function ZT({apiBaseURL:e}){var J,G;const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,s]=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(""),[j,v]=d.useState(!1),[x]=u.Form.useForm(),[w,C]=d.useState("API"),b=d.useCallback(async K=>{try{const O=await at.listResourcesByApp({appCode:K,pageNum:1,pageSize:1e3});p(O.data||[])}catch(O){u.message.error("拉取资源失败:"+((O==null?void 0:O.message)||"未知错误")),p([])}},[]),T=K=>{h(K),f(!0),K.appCode&&b(K.appCode)},F=d.useCallback(()=>{var P;const K=n.getFieldsValue(),O={};K.appCode&&(O.appCode=K.appCode),K.appName&&(O.appName=K.appName),s(O),(P=t.current)==null||P.reload()},[n]),$=d.useCallback(()=>{var K;n.resetFields(),s({}),(K=t.current)==null||K.reload()},[n]),M=async K=>{try{const O=(K==null?void 0:K.current)||1,P=(K==null?void 0:K.pageSize)||20,N=await Sr.listApplications({appCode:r.appCode,appName:r.appName,pageNum:O,pageSize:P});return{data:N.records||[],success:!0,total:N.total||0}}catch(O){return u.message.error("获取应用列表失败:"+((O==null?void 0:O.message)||"未知错误")),{data:[],success:!1,total:0}}},I=async()=>{var K;try{const O=await l.validateFields();await Sr.create({appCode:O.appCode,appName:O.appName,appType:O.appType||"web",description:O.description,status:1}),u.message.success("应用创建成功"),o(!1),l.resetFields(),(K=t.current)==null||K.reload()}catch(O){if(O!=null&&O.errorFields)return;u.message.error("创建失败:"+((O==null?void 0:O.message)||"未知错误"))}},A=async K=>{var O;try{if(K.id==null){u.message.error("应用 ID 缺失");return}await Sr.delete(K.id),u.message.success(`已删除应用 ${K.appCode}`),(c==null?void 0:c.id)===K.id&&(h(null),p([])),(O=t.current)==null||O.reload()}catch(P){u.message.error("删除失败:"+((P==null?void 0:P.message)||"未知错误"))}},Y=async K=>{var O;try{if(K.id==null){u.message.error("应用 ID 缺失");return}const P=K.status===1?0:1;await Sr.update(K.id,{status:P}),u.message.success(P===1?"已启用":"已停用"),(c==null?void 0:c.id)===K.id&&h({...K,status:P}),(O=t.current)==null||O.reload()}catch(P){u.message.error("切换状态失败:"+((P==null?void 0:P.message)||"未知错误"))}},H=async()=>{if(c)try{const K=await x.validateFields(),O={resourceCode:K.resourceCode,resourceName:K.resourceName,resourceType:qT[w],appCode:c.appCode,path:K.path,method:K.method,description:K.description,status:1};await at.createResource(O),u.message.success("资源创建成功"),v(!1),x.resetFields(),b(c.appCode)}catch(K){if(K!=null&&K.errorFields)return;u.message.error("创建失败:"+((K==null?void 0:K.message)||"未知错误"))}},k=async K=>{if(K.id==null){u.message.error("资源 ID 缺失");return}try{await at.deleteResource(K.id),u.message.success("资源已删除"),c!=null&&c.appCode&&b(c.appCode)}catch(O){u.message.error("删除失败:"+((O==null?void 0:O.message)||"未知错误"))}},E=K=>{C(K),x.resetFields(),v(!0)},R=[{title:"应用",dataIndex:"appName",width:180,search:!1,render:(K,O)=>{const P=Ba[O.status??1]||{text:String(O.status??"未知"),color:"default"},N=(c==null?void 0:c.id)===O.id;return a.jsxs("div",{style:{padding:"4px 0",borderLeft:N?"3px solid #1677ff":"3px solid transparent",paddingLeft:8},children:[a.jsx("div",{style:{fontWeight:500},children:O.appName}),a.jsxs("div",{style:{fontSize:12,color:"#999",marginTop:2},children:[a.jsx(u.Tag,{color:P.color,style:{marginRight:4,marginInlineEnd:4},children:P.text}),a.jsx("code",{style:{fontSize:11},children:O.appCode})]})]})}},{title:"操作",valueType:"option",width:200,fixed:"right",search:!1,render:(K,O)=>[a.jsx(u.Button,{type:"link",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>T(O),children:"编辑"},"edit"),a.jsx(u.Tooltip,{title:O.status===1?"停用":"启用",children:a.jsx(u.Button,{type:"text",size:"small",danger:O.status===1,icon:a.jsx(se.StopOutlined,{}),onClick:()=>Y(O),children:O.status===1?"停用":"启用"})},"toggle"),a.jsx(u.Popconfirm,{title:`确认删除应用 ${O.appName}?`,description:"该应用下的所有资源会一并删除",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>A(O),children:a.jsx(u.Button,{type:"text",danger:!0,size:"small",icon:a.jsx(se.DeleteOutlined,{}),children:"删除"})},"del")]}],z=[{title:"资源编码",dataIndex:"resourceCode",width:180,ellipsis:!0},{title:"资源名称",dataIndex:"resourceName",width:140,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(K,O)=>O.method?a.jsx(u.Tag,{color:GT[O.method],children:O.method}):"-"},{title:"URL / Path",dataIndex:"path",ellipsis:!0},{title:"描述",dataIndex:"description",width:200,ellipsis:!0},{title:"操作",width:80,fixed:"right",render:(K,O)=>a.jsx(u.Popconfirm,{title:"确认删除该资源?",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>k(O),children:a.jsx(u.Button,{type:"text",danger:!0,size:"small",children:"删除"})})}],_=m.filter(K=>(K.resourceType??1)===1),V=m.filter(K=>K.resourceType===2),Z=m.filter(K=>K.resourceType===3),B=m.filter(K=>K.resourceType===4),U=(K,O)=>{const P=S.trim().toLowerCase(),N=P?K.filter(D=>`${D.resourceCode||""} ${D.resourceName||""} ${D.path||""}`.toLowerCase().includes(P)):K;return a.jsxs("div",{children:[a.jsxs("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("span",{style:{color:"#666"},children:["共 ",a.jsx("b",{children:K.length})," 条 ",gr[O].text," 资源"]}),a.jsxs(u.Space,{children:[a.jsx(u.Input.Search,{allowClear:!0,placeholder:"按资源编码 / 名称过滤",style:{width:220},onChange:D=>y(D.target.value)}),a.jsxs(u.Button,{type:"primary",size:"small",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>E(O),children:["新建",gr[O].text]})]})]}),K.length>0?a.jsx(u.Table,{rowKey:"id",columns:z,dataSource:N,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:D=>`共 ${D} 条`},size:"small",scroll:{x:800},locale:{emptyText:a.jsx(mt.EmptyState,{title:`没有匹配的 ${gr[O].text} 资源`,description:"换个关键字再试一次",size:"sm"})}}):a.jsx(mt.EmptyState,{title:`该应用暂无 ${gr[O].text} 资源`,description:"点击上方按钮新增",size:"sm"})]})};return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[a.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[a.jsxs(u.Form,{form:n,layout:"inline",size:"small",children:[a.jsx(u.Form.Item,{name:"appCode",label:"应用编码",style:{marginBottom:8},children:a.jsx(u.Input,{placeholder:"搜索",allowClear:!0})}),a.jsx(u.Form.Item,{name:"appName",label:"应用名称",style:{marginBottom:8},children:a.jsx(u.Input,{placeholder:"搜索",allowClear:!0})}),a.jsx(u.Form.Item,{style:{marginBottom:8},children:a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.SearchOutlined,{}),onClick:F,children:"查询"}),a.jsx(u.Button,{icon:a.jsx(se.UndoOutlined,{}),onClick:$,children:"重置"})]})})]}),a.jsxs(u.Space,{style:{flexShrink:0},children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>o(!0),children:"新增应用"}),a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>{var K;(K=t.current)==null||K.reload(),c!=null&&c.appCode&&b(c.appCode)},children:"刷新"})]})]})}),a.jsx(Ln,{actionRef:t,rowKey:"id",columns:R,request:M,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:K=>`共 ${K} 条`},onRow:K=>({onClick:()=>T(K),style:{cursor:"pointer"}})}),a.jsx(u.Drawer,{title:c?a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[a.jsx("span",{style:{fontSize:16,fontWeight:600},children:c.appName}),a.jsx(u.Tag,{color:((J=Ba[c.status??1])==null?void 0:J.color)||"default",children:((G=Ba[c.status??1])==null?void 0:G.text)||"未知"}),a.jsx("code",{style:{fontSize:12,color:"#666"},children:c.appCode})]}):"应用详情",open:g,onClose:()=>f(!1),width:"80vw",destroyOnHidden:!0,extra:c?a.jsxs(u.Space,{children:[a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>b(c.appCode),children:"刷新资源"}),a.jsx(u.Button,{icon:a.jsx(se.EditOutlined,{}),onClick:()=>o(!0),children:"编辑应用"}),a.jsx(u.Button,{danger:c.status===1,icon:a.jsx(se.StopOutlined,{}),onClick:()=>Y(c),children:c.status===1?"停用":"启用"})]}):null,children:c&&a.jsxs("div",{children:[a.jsxs("div",{style:{marginBottom:16,paddingBottom:12,borderBottom:"1px solid #f0f0f0",fontSize:13,color:"#666",display:"flex",gap:16},children:[c.gmtCreate&&a.jsxs("span",{children:["创建:",Se(c.gmtCreate).format("YYYY-MM-DD HH:mm:ss")]}),c.description&&a.jsxs("span",{children:["描述:",c.description]})]}),a.jsx(u.Tabs,{defaultActiveKey:"API",items:[{key:"API",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:"orange",children:"API"})," API 资产 (",_.length,")"]}),children:U(_,"API")},{key:"MENU",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:"blue",children:"菜单"})," 菜单 (",V.length,")"]}),children:U(V,"MENU")},{key:"BUTTON",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:"green",children:"按钮"})," 按钮 (",Z.length,")"]}),children:U(Z,"BUTTON")},{key:"DATA",label:a.jsxs("span",{children:[a.jsx(u.Tag,{color:"purple",children:"数据"})," 数据 (",B.length,")"]}),children:U(B,"DATA")}]})]})}),a.jsx(u.Modal,{title:"新建应用",open:i,onOk:I,onCancel:()=>o(!1),size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:l,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"appCode",label:"应用编码",rules:[{required:!0},{pattern:/^[a-z][a-z0-9_-]*$/,message:"小写字母开头,仅允许小写字母/数字/下划线/短横"}],extra:"唯一标识,如 z-ctc / z-task",children:a.jsx(u.Input,{placeholder:"如 z-opc"})}),a.jsx(u.Form.Item,{name:"appName",label:"应用名称",rules:[{required:!0}],children:a.jsx(u.Input,{placeholder:"如 统一管理平台"})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:2,placeholder:"可选"})})]})}),a.jsx(u.Modal,{title:`新建资源 — ${(c==null?void 0:c.appCode)||""} (${gr[w].text})`,open:j,onOk:H,onCancel:()=>v(!1),size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:x,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0}],extra:"唯一标识,如 user:read / menu:dashboard",children:a.jsx(u.Input,{placeholder:"如 user:read"})}),a.jsx(u.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0}],children:a.jsx(u.Input,{placeholder:"如 查看用户"})}),w==="API"&&a.jsxs(a.Fragment,{children:[a.jsx(u.Form.Item,{name:"method",label:"HTTP 方法",children:a.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"}]})}),a.jsx(u.Form.Item,{name:"path",label:"URL Pattern",children:a.jsx(u.Input,{placeholder:"如 /api/users/*"})})]}),w==="MENU"&&a.jsx(u.Form.Item,{name:"path",label:"菜单路径",children:a.jsx(u.Input,{placeholder:"如 /ctc/dashboard"})}),w==="BUTTON"&&a.jsx(u.Form.Item,{name:"resourceCode",label:"按钮权限编码",extra:"如 btn:user:create",children:a.jsx(u.Input,{placeholder:"如 btn:user:create"})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:2,placeholder:"可选"})})]})})]})}const Ic={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Mc={MENU:{text:"菜单",color:"blue"},API:{text:"API",color:"orange"},BUTTON:{text:"按钮",color:"green"},DATA:{text:"数据",color:"purple"}},JT=e=>{const t={},n=[];return e.forEach(r=>{var s,i;t[r.id]={key:r.id,title:a.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[r.resourceName,a.jsx(u.Tag,{color:(s=Mc[r.resourceType||"MENU"])==null?void 0:s.color,style:{margin:0,fontSize:10},children:(i=Mc[r.resourceType||"MENU"])==null?void 0:i.text})]}),rawTitle:r.resourceName,children:[]}}),e.forEach(r=>{n.findIndex(s=>s.key===r.id)===-1&&n.push(t[r.id])}),n};function XT({apiBaseURL:e}){const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,s]=d.useState({}),[i,o]=d.useState([]),[l,c]=d.useState(!1),[h,g]=d.useState(null),[f]=u.Form.useForm(),[m,p]=d.useState([]),[S,y]=d.useState([]),[j,v]=d.useState(!1),[x,w]=d.useState(null),[C,b]=d.useState([]),[T,F]=d.useState([]),[$,M]=d.useState([]),[I,A]=d.useState(!1),Y="z_authz_role_codes",[H,k]=d.useState(()=>JSON.parse(localStorage.getItem(Y)||"[]")),E=(D,L)=>{const W=String(D);if(!H.includes(W)){const q=[...H,W];k(q),localStorage.setItem(Y,JSON.stringify(q))}o(q=>{const X=q.findIndex(ee=>{var re;return((re=ee.id)==null?void 0:re.toString())===W});if(X>=0){const ee=[...q];return ee[X]=L,ee}return[...q,L]})},R=async()=>{try{let D=[];try{D=await at.listAllRoles()}catch(ee){u.message.warning("从后端拉取角色失败,已回退到本地缓存:"+((ee==null?void 0:ee.message)||"未知错误"));for(const re of H){const le=i.find(ce=>{var de;return((de=ce.id)==null?void 0:de.toString())===re});le&&D.push(le)}for(const re of i)D.find(le=>{var ce,de;return((ce=le.id)==null?void 0:ce.toString())===((de=re.id)==null?void 0:de.toString())})||D.push(re)}const L=r.roleCode,W=r.status,q=r.startDate,X=r.endDate;return D=D.filter(ee=>{var re;return!(L&&!((re=ee.roleCode)!=null&&re.includes(L))||W!==void 0&&ee.status!==W||q&&ee.createdAt&&Se(ee.createdAt).isBefore(q,"day")||X&&ee.createdAt&&Se(ee.createdAt).isAfter(X,"day"))}),{data:D,success:!0,total:D.length}}catch(D){return u.message.error("获取角色失败:"+((D==null?void 0:D.message)||"未知错误")),{data:[],success:!1,total:0}}},z=()=>{var W;const D=n.getFieldsValue(),L={};D.roleCode&&(L.roleCode=D.roleCode),D.status!==void 0&&(L.status=D.status),D.dateRange&&(L.startDate=D.dateRange[0].format("YYYY-MM-DD"),L.endDate=D.dateRange[1].format("YYYY-MM-DD")),s(L),(W=t.current)==null||W.reload()},_=()=>{var D;n.resetFields(),s({}),(D=t.current)==null||D.reload()},V=async()=>{var D;try{const L=await f.validateFields(),W=await at.createRole({...L,status:1});u.message.success(`角色创建成功,ID=${W}`),E(W,{id:W,...L,status:1}),c(!1),f.resetFields(),(D=t.current)==null||D.reload()}catch(L){if(L!=null&&L.errorFields)return;u.message.error("创建失败:"+((L==null?void 0:L.message)||"未知错误"))}},Z=D=>{g(D),f.setFieldsValue({roleCode:D.roleCode,roleName:D.roleName,description:D.description})},B=async()=>{var D;if(h!=null&&h.id)try{const L=await f.validateFields();u.message.warning("后端暂未提供 role 更新接口,本地更新占位");const W={...h,...L};E(h.id,W),f.resetFields(),g(null),(D=t.current)==null||D.reload()}catch(L){if(L!=null&&L.errorFields)return;u.message.error("更新失败:"+((L==null?void 0:L.message)||"未知错误"))}},U=D=>{var L;u.message.warning("后端暂未提供 role 删除接口"),o(W=>W.filter(q=>{var X,ee;return((X=q.id)==null?void 0:X.toString())!==((ee=D.id)==null?void 0:ee.toString())})),k(W=>W.filter(q=>{var X;return q!==((X=D.id)==null?void 0:X.toString())})),localStorage.setItem(Y,JSON.stringify(H.filter(W=>{var q;return W!==((q=D.id)==null?void 0:q.toString())}))),(L=t.current)==null||L.reload()},J=()=>{var D;u.message.warning("后端暂未提供 role 删除接口"),S.forEach(L=>{o(W=>W.filter(q=>{var X,ee;return((X=q.id)==null?void 0:X.toString())!==((ee=L.id)==null?void 0:ee.toString())})),k(W=>W.filter(q=>{var X;return q!==((X=L.id)==null?void 0:X.toString())}))}),localStorage.setItem(Y,JSON.stringify(H.filter(L=>!S.find(W=>{var q;return((q=W.id)==null?void 0:q.toString())===L})))),p([]),y([]),(D=t.current)==null||D.reload()},G=()=>{const D=S.length>0?S:i;if(D.length===0){u.message.warning("暂无数据可导出");return}const W=`ID,角色编码,角色名称,描述,租户,状态,创建时间
|
|
58
|
-
`+
|
|
59
|
-
`),q=new Blob(["\uFEFF"+W],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(q),ee=document.createElement("a");ee.href=X,ee.download=`roles_${Se().format("YYYYMMDD_HHmmss")}.csv`,ee.click(),URL.revokeObjectURL(X),u.message.success(`已导出 ${D.length} 条数据`)},K=async()=>{try{const D=[{id:1,resourceCode:"user:read",resourceName:"查看用户",resourceType:"API"},{id:2,resourceCode:"user:write",resourceName:"编辑用户",resourceType:"API"},{id:3,resourceCode:"role:read",resourceName:"查看角色",resourceType:"API"},{id:4,resourceCode:"role:write",resourceName:"编辑角色",resourceType:"API"},{id:5,resourceCode:"menu:dashboard",resourceName:"工作台",resourceType:"MENU"},{id:6,resourceCode:"menu:user",resourceName:"用户管理",resourceType:"MENU"},{id:7,resourceCode:"menu:role",resourceName:"角色管理",resourceType:"MENU"}];b(D),F(JT(D))}catch(D){u.message.error("加载资源失败:"+((D==null?void 0:D.message)||"未知错误"))}},O=async D=>{w(D),M([]),v(!0),await K()},P=async()=>{if(x!=null&&x.id){A(!0);try{for(const D of $)await at.grantRoleResource(x.id,Number(D));u.message.success(`已为角色 ${x.roleName} 授权 ${$.length} 个资源`),v(!1)}catch(D){u.message.error("授权失败:"+((D==null?void 0:D.message)||"未知错误"))}finally{A(!1)}}},N=[{title:"ID",dataIndex:"id",width:60,search:!1},{title:"角色编码",dataIndex:"roleCode",width:140,search:!1},{title:"角色名称",dataIndex:"roleName",width:140,search:!1},{title:"描述",dataIndex:"description",width:220,ellipsis:!0,search:!1},{title:"状态",dataIndex:"status",width:80,search:!1,render:(D,L)=>{const W=Ic[L.status??1]||{text:String(L.status??"未知"),color:"default"};return a.jsx(u.Tag,{color:W.color,children:W.text})}},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:240,fixed:"right",search:!1,render:(D,L)=>[a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>Z(L),children:"编辑"},"edit"),a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.SafetyOutlined,{}),onClick:()=>O(L),children:"授权"},"grant"),a.jsx(u.Popconfirm,{title:`删除角色 ${L.roleName}?`,onConfirm:()=>U(L),children:a.jsx(u.Button,{type:"text",danger:!0,size:"small",icon:a.jsx(se.DeleteOutlined,{}),children:"删除"})},"delete")]}];return d.useEffect(()=>{var D;(D=t.current)==null||D.reload()},[H]),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[a.jsx(u.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[a.jsxs(u.Form,{form:n,layout:"inline",children:[a.jsx(u.Form.Item,{name:"roleCode",label:"角色编码",children:a.jsx(mt.SearchInput,{placeholder:"请输入角色编码",size:"large",onChange:D=>n.setFieldValue("roleCode",D)})}),a.jsx(u.Form.Item,{name:"status",label:"状态",children:a.jsx(u.Select,{placeholder:"全部",allowClear:!0,style:{width:120},options:[{value:1,label:"正常"},{value:0,label:"停用"}]})}),a.jsx(u.Form.Item,{name:"dateRange",label:"创建时间",children:a.jsx(u.DatePicker.RangePicker,{style:{width:240}})}),a.jsx(u.Form.Item,{children:a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.SearchOutlined,{}),onClick:z,children:"查询"}),a.jsx(u.Button,{icon:a.jsx(se.UndoOutlined,{}),onClick:_,children:"重置"})]})})]}),a.jsxs(u.Space,{style:{flexShrink:0},children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>c(!0),children:"新增"}),a.jsx(u.Button,{danger:!0,icon:a.jsx(se.DeleteOutlined,{}),disabled:m.length===0,onClick:J,children:"批量删除"}),a.jsx(u.Button,{icon:a.jsx(se.DownloadOutlined,{}),onClick:G,children:"导出"}),a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>{var D;return(D=t.current)==null?void 0:D.reload()},children:"刷新"})]})]})}),a.jsx(Ln,{actionRef:t,rowKey:"id",columns:N,request:R,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:D=>`共 ${D} 条`},rowSelection:{selectedRowKeys:m,onChange:(D,L)=>{p(D),y(L)}},tableAlertRender:({selectedRowKeys:D})=>a.jsxs("span",{children:["已选择 ",a.jsx("a",{style:{fontWeight:600},children:D.length})," 项"]})}),a.jsx(u.Modal,{title:"新建角色",open:l,onOk:V,onCancel:()=>c(!1),size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:f,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0}],extra:"唯一标识,建议英文下划线",children:a.jsx(u.Input,{placeholder:"如 admin / dev / viewer"})}),a.jsx(u.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0}],children:a.jsx(u.Input,{placeholder:"如 管理员"})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:2,placeholder:"可选"})})]})}),a.jsx(u.Modal,{title:"编辑角色",open:!!h,onOk:B,onCancel:()=>g(null),size:"large",destroyOnHidden:!0,children:a.jsxs(u.Form,{form:f,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0}],children:a.jsx(u.Input,{disabled:!!h})}),a.jsx(u.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0}],children:a.jsx(u.Input,{})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:2})})]})}),a.jsxs(u.Drawer,{title:x?`为角色授权 — ${x.roleName}`:"授权",open:j,onClose:()=>v(!1),size:520,extra:a.jsxs(u.Space,{children:[a.jsx(u.Button,{onClick:()=>v(!1),children:"取消"}),a.jsxs(u.Button,{type:"primary",loading:I,onClick:P,children:["保存 (",$.length,")"]})]}),children:[a.jsx("div",{style:{color:"#666",fontSize:12,marginBottom:12},children:"勾选授予该角色的资源。注:后端 /api/ctc/authorization/resources/list 端点尚未实现, 当前展示为 mock 数据;生产环境替换 fetchResourceTree()。"}),a.jsx(u.Tree,{checkable:!0,treeData:T,checkedKeys:$,onCheck:D=>M(D),blockNode:!0,height:520})]})]})}const pr={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}},QT=[{value:"",label:"任意"},{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}];function eF({apiBaseURL:e}){var G,K;const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,s]=d.useState({}),[i,o]=d.useState([]),[l,c]=d.useState([]),[h,g]=d.useState([]),[f,m]=d.useState(!1),[p,S]=d.useState(null),[y]=u.Form.useForm(),[j,v]=d.useState(!1),[x,w]=d.useState(null),[C,b]=d.useState("info"),[T,F]=d.useState([]),[$,M]=d.useState(!1),I=d.useCallback(async()=>{try{const O=await at.distinctApps(),P=Array.isArray(O)?O:[];g(P.map(N=>({value:N,label:N})))}catch{g([])}},[]);d.useEffect(()=>{I()},[I]);const A=d.useCallback(()=>{var N;const O=n.getFieldsValue(),P={};O.appCode&&(P.appCode=O.appCode),O.type!==void 0&&O.type!==null&&(P.type=O.type),O.keyword&&(P.keyword=O.keyword),O.status!==void 0&&O.status!==null&&(P.status=O.status),s(P),(N=t.current)==null||N.reload()},[n]),Y=d.useCallback(()=>{var O;n.resetFields(),s({}),(O=t.current)==null||O.reload()},[n]),H=async O=>{try{const P=await at.listResourcesByApp({appCode:r.appCode,type:r.type,keyword:r.keyword,pageNum:O.current,pageSize:O.pageSize}),N=(P==null?void 0:P.data)||[],D=(P==null?void 0:P.total)??N.length;return{data:N,success:!0,total:D}}catch(P){return u.message.error("查询权限点失败:"+((P==null?void 0:P.message)||"未知错误")),{data:[],success:!1,total:0}}},k=async()=>{var O;try{const P=await y.validateFields();await at.createResource(P),u.message.success("创建成功"),m(!1),y.resetFields(),(O=t.current)==null||O.reload(),I()}catch(P){if(P!=null&&P.errorFields)return;u.message.error("创建失败:"+((P==null?void 0:P.message)||"未知错误"))}},E=O=>{S(O),y.setFieldsValue(O),m(!0)},R=async()=>{var O;if(p!=null&&p.id)try{const P=await y.validateFields();await at.updateResource(p.id,P),u.message.success("更新成功"),m(!1),S(null),y.resetFields(),(O=t.current)==null||O.reload(),I()}catch(P){if(P!=null&&P.errorFields)return;u.message.error("更新失败:"+((P==null?void 0:P.message)||"未知错误"))}},z=async O=>{var P;try{await at.deleteResource(O),u.message.success("已删除"),(P=t.current)==null||P.reload()}catch(N){u.message.error("删除失败:"+((N==null?void 0:N.message)||"未知错误"))}},_=async()=>{var O;if(l.length!==0)try{await Promise.all(l.map(P=>at.deleteResource(P.id))),u.message.success(`已删除 ${l.length} 条`),o([]),c([]),(O=t.current)==null||O.reload()}catch(P){u.message.error("批量删除失败:"+((P==null?void 0:P.message)||"未知错误"))}},V=async O=>{if(!O){F([]);return}M(!0);try{const P=await at.listResourceRoles(O);F(P||[])}catch{F([])}finally{M(!1)}},Z=O=>{w(O),b("info"),v(!0),V(O.id)},B=()=>{v(!1),w(null),F([])},U=O=>{b(O),O==="roles"&&(x!=null&&x.id)&&V(x.id)},J=[{title:"ID",dataIndex:"id",width:60,search:!1},{title:"编码",dataIndex:"resourceCode",width:200,fixed:"left",search:!1,render:(O,P)=>a.jsx(u.Tooltip,{title:P.resourceCode,children:a.jsx("span",{style:{fontFamily:"monospace"},children:P.resourceCode})})},{title:"名称",dataIndex:"resourceName",width:160,search:!1},{title:"类型",dataIndex:"resourceType",width:80,search:!1,render:(O,P)=>{const N=pr[P.resourceType??3]||{text:String(P.resourceType??"?"),color:"default"};return a.jsx(u.Tag,{color:N.color,children:N.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(O,P)=>P.appCode?a.jsx(u.Tag,{color:"cyan",children:P.appCode}):a.jsx(u.Tag,{color:"default",children:"公共"})},{title:"路径",dataIndex:"path",width:220,ellipsis:!0,search:!1},{title:"方法",dataIndex:"method",width:80,search:!1,render:(O,P)=>P.method?a.jsx(u.Tag,{children:P.method}):a.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(O,P)=>a.jsx(u.Tag,{color:P.status===1?"success":"default",children:P.status===1?"启用":"禁用"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:200,fixed:"right",search:!1,render:(O,P)=>[a.jsx(u.Tooltip,{title:"编辑",children:a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:N=>{N.stopPropagation(),E(P)},children:"编辑"})},"edit"),a.jsx(u.Popconfirm,{title:"确认删除该权限点?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:N=>{var D;(D=N==null?void 0:N.stopPropagation)==null||D.call(N),z(P.id)},children:a.jsx(u.Button,{type:"text",size:"small",danger:!0,icon:a.jsx(se.DeleteOutlined,{}),onClick:N=>N.stopPropagation(),children:"删除"})},"delete"),a.jsx(u.Tooltip,{title:"详情 / 关联角色",children:a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.FileTextOutlined,{}),onClick:N=>{N.stopPropagation(),Z(P)},children:"详情"})},"detail")]}];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[a.jsx(u.Card,{size:"small",style:{marginBottom:16},styles:{body:{padding:"12px 16px"}},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[a.jsxs(u.Form,{form:n,layout:"inline",children:[a.jsx(u.Form.Item,{name:"appCode",label:"应用",children:a.jsx(u.Select,{placeholder:"全部应用",allowClear:!0,style:{width:200},options:h,showSearch:!0,optionFilterProp:"label"})}),a.jsx(u.Form.Item,{name:"type",label:"类型",children:a.jsx(u.Select,{placeholder:"全部类型",allowClear:!0,style:{width:120},options:Object.entries(pr).map(([O,P])=>({value:Number(O),label:P.text}))})}),a.jsx(u.Form.Item,{name:"keyword",label:"关键字",children:a.jsx(u.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:200}})}),a.jsx(u.Form.Item,{name:"status",label:"状态",children:a.jsx(u.Select,{placeholder:"全部",allowClear:!0,style:{width:100},options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),a.jsx(u.Form.Item,{children:a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.SearchOutlined,{}),onClick:A,children:"查询"}),a.jsx(u.Button,{icon:a.jsx(se.UndoOutlined,{}),onClick:Y,children:"重置"})]})})]}),a.jsxs(u.Space,{style:{flexShrink:0},children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.PlusOutlined,{}),onClick:()=>{S(null),y.resetFields(),m(!0)},children:"新增"}),a.jsx(u.Button,{danger:!0,icon:a.jsx(se.DeleteOutlined,{}),disabled:i.length===0,onClick:_,children:"批量删除"}),a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>{var O;return(O=t.current)==null?void 0:O.reload()},children:"刷新"})]})]})}),a.jsx(Ln,{actionRef:t,rowKey:"id",columns:J,request:H,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:O=>`共 ${O} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(O,P)=>{o(O),c(P)}},tableAlertRender:({selectedRowKeys:O})=>a.jsxs("span",{children:["已选择 ",a.jsx("a",{style:{fontWeight:600},children:O.length})," 项"]}),onRow:O=>({onClick:()=>Z(O),style:{cursor:"pointer"}})}),a.jsx(u.Modal,{title:p?`编辑权限点 — ${p.resourceCode}`:"新建权限点",open:f,onOk:p?R:k,onCancel:()=>{m(!1),S(null),y.resetFields()},size:"large",destroyOnHidden:!0,okText:p?"保存":"创建",children:a.jsxs(u.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[a.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:a.jsx(u.Input,{placeholder:"如 user:read",disabled:!!p})}),a.jsx(u.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0,max:128}],children:a.jsx(u.Input,{placeholder:"如 用户查询"})}),a.jsx(u.Form.Item,{name:"resourceType",label:"资源类型",rules:[{required:!0}],initialValue:3,children:a.jsx(u.Select,{options:Object.entries(pr).map(([O,P])=>({value:Number(O),label:P.text}))})}),a.jsx(u.Form.Item,{name:"appCode",label:"所属应用",extra:"选择权限点归属的应用;不选则为「公共」",children:a.jsx(u.Select,{placeholder:"公共(跨应用)",allowClear:!0,showSearch:!0,optionFilterProp:"label",options:h})}),a.jsx(u.Form.Item,{name:"path",label:"URL 路径",extra:"菜单 / API 资源对应路径",children:a.jsx(u.Input,{placeholder:"如 /api/ctc/authorization/users"})}),a.jsx(u.Form.Item,{name:"method",label:"HTTP 方法",extra:"API 资源填 HTTP 方法;菜单/数据/按钮可留空",children:a.jsx(u.Select,{options:QT})}),a.jsx(u.Form.Item,{name:"icon",label:"图标 (菜单用)",children:a.jsx(u.Input,{placeholder:"如 UserOutlined"})}),a.jsx(u.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:a.jsx(u.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),a.jsx(u.Form.Item,{name:"description",label:"描述",children:a.jsx(u.Input.TextArea,{rows:2,maxLength:512,showCount:!0})}),a.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:a.jsx(u.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})}),a.jsx(u.Drawer,{title:x?`权限点详情 — ${x.resourceCode}`:"权限点详情",open:j,onClose:B,size:900,destroyOnHidden:!0,children:x&&a.jsxs("div",{style:{display:"flex",gap:16,minHeight:480},children:[a.jsx("div",{style:{width:160,borderRight:"1px solid #f0f0f0",paddingRight:8},children:a.jsx(u.Menu,{mode:"inline",selectedKeys:[C],onClick:({key:O})=>U(O),style:{border:"none",background:"transparent"},items:[{key:"info",icon:a.jsx(se.InfoCircleOutlined,{}),label:"基本信息"},{key:"roles",icon:a.jsx(se.TeamOutlined,{}),label:`关联角色 (${T.length})`}]})}),a.jsx("div",{style:{flex:1,minWidth:0},children:C==="info"?a.jsxs(u.Descriptions,{title:"权限点信息",size:"small",bordered:!0,column:2,children:[a.jsx(u.Descriptions.Item,{label:"资源ID",children:x.id}),a.jsx(u.Descriptions.Item,{label:"资源编码",children:a.jsx("span",{style:{fontFamily:"monospace"},children:x.resourceCode})}),a.jsx(u.Descriptions.Item,{label:"资源名称",children:x.resourceName}),a.jsx(u.Descriptions.Item,{label:"资源类型",children:a.jsx(u.Tag,{color:(G=pr[x.resourceType??3])==null?void 0:G.color,children:((K=pr[x.resourceType??3])==null?void 0:K.text)||x.resourceType})}),a.jsx(u.Descriptions.Item,{label:"所属应用",span:2,children:x.appCode?a.jsx(u.Tag,{color:"cyan",children:x.appCode}):a.jsx(u.Tag,{color:"default",children:"公共"})}),a.jsx(u.Descriptions.Item,{label:"URL 路径",span:2,children:x.path||"-"}),a.jsx(u.Descriptions.Item,{label:"HTTP 方法",children:x.method?a.jsx(u.Tag,{children:x.method}):"-"}),a.jsx(u.Descriptions.Item,{label:"图标",children:x.icon||"-"}),a.jsx(u.Descriptions.Item,{label:"排序",children:x.sortOrder??0}),a.jsx(u.Descriptions.Item,{label:"状态",children:a.jsx(u.Tag,{color:x.status===1?"success":"default",children:x.status===1?"启用":"禁用"})}),a.jsx(u.Descriptions.Item,{label:"租户",span:2,children:x.tenantCode||"公共"}),a.jsx(u.Descriptions.Item,{label:"描述",span:2,children:x.description||"-"}),a.jsx(u.Descriptions.Item,{label:"创建时间",children:x.createdAt||"-"}),a.jsx(u.Descriptions.Item,{label:"更新时间",children:x.updatedAt||"-"})]}):a.jsx(mt.ListTable,{rows:T,rowKey:"id",loading:$,searchKeys:["roleCode","roleName"],searchPlaceholder:"按角色编码 / 角色名称过滤",emptyTitle:"该权限点暂未被任何角色绑定",columns:[{title:"角色ID",dataIndex:"id",width:80},{title:"角色编码",dataIndex:"roleCode",width:160},{title:"角色名称",dataIndex:"roleName",width:160},{title:"状态",dataIndex:"status",width:80,render:(O,P)=>a.jsx(u.Tag,{color:P.status===1?"success":"default",children:P.status===1?"正常":"停用"})},{title:"租户",dataIndex:"tenantCode",width:100},{title:"描述",dataIndex:"description",ellipsis:!0}]})})]})})]})}const Oc={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}};function tF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=u.Form.useForm(),[r,s]=d.useState({}),[i,o]=d.useState([]);d.useEffect(()=>{Sr.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 at.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),s(p),(S=t.current)==null||S.reload()},h=()=>{var m;n.resetFields(),s({}),(m=t.current)==null||m.reload()},g=async m=>{var p;try{await at.deleteResource(m),u.message.success("已删除"),(p=t.current)==null||p.reload()}catch(S){u.message.error("删除失败:"+((S==null?void 0:S.message)||"未知错误"))}},f=[{title:"ID",dataIndex:"id",width:70,search:!1},{title:"资源编码",dataIndex:"resourceCode",width:220,fixed:"left",search:!1,render:(m,p)=>a.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=Oc[p.resourceType??3]||{text:String(p.resourceType??"?"),color:"default"};return a.jsx(u.Tag,{color:S.color,children:S.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(m,p)=>p.appCode?a.jsx(u.Tag,{color:"cyan",children:p.appCode}):a.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?a.jsx(u.Tag,{children:p.method}):a.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(m,p)=>a.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)=>[a.jsx(u.Popconfirm,{title:`删除资源 ${p.resourceCode}?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>g(p.id),children:a.jsx(u.Button,{type:"text",size:"small",danger:!0,icon:a.jsx(se.DeleteOutlined,{}),children:"删除"})},"delete")]}];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[a.jsx(u.Card,{size:"small",style:{marginBottom:16},styles:{body:{padding:"12px 16px"}},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[a.jsxs(u.Form,{form:n,layout:"inline",children:[a.jsx(u.Form.Item,{name:"appCode",label:"应用",children:a.jsx(u.Select,{placeholder:"全部应用",allowClear:!0,style:{width:200},options:i,showSearch:!0,optionFilterProp:"label"})}),a.jsx(u.Form.Item,{name:"type",label:"类型",children:a.jsx(u.Select,{placeholder:"全部类型",allowClear:!0,style:{width:110},options:Object.entries(Oc).map(([m,p])=>({value:Number(m),label:p.text}))})}),a.jsx(u.Form.Item,{name:"keyword",label:"关键字",children:a.jsx(u.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),a.jsx(u.Form.Item,{children:a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"primary",icon:a.jsx(se.SearchOutlined,{}),onClick:c,children:"查询"}),a.jsx(u.Button,{icon:a.jsx(se.UndoOutlined,{}),onClick:h,children:"重置"})]})})]}),a.jsx(u.Space,{style:{flexShrink:0},children:a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>{var m;return(m=t.current)==null?void 0:m.reload()},children:"刷新"})})]})}),a.jsx(Ln,{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 ms={listAccounts:e=>Yn.listByTenant(e),listUserRoles:e=>at.listUserRoles(e),listUserPermissions:e=>at.listUserPermissions(e),listRoleResources:e=>at.listRolePermissions(e)},{Text:nF}=u.Typography;function rF({apiBaseURL:e}){const[t,n]=d.useState([]),[r,s]=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,j]=d.useState([]),[v,x]=d.useState(null),[w,C]=d.useState(!1),b=async()=>{s(!0);try{const I=await ms.listAccounts({pageNum:1,pageSize:200}),A=Array.isArray(I)?I:(I==null?void 0:I.records)||(I==null?void 0:I.data)||[];n(A),A.length>0&&!i&&o(A[0].id)}catch{n([])}finally{s(!1)}};d.useEffect(()=>{b()},[]),d.useEffect(()=>{if(!i){c([]),m([]);return}g(!0),S(!0),ms.listUserRoles(i).then(I=>c(Array.isArray(I)?I:[])).catch(()=>c([])).finally(()=>g(!1)),ms.listUserPermissions(i).then(I=>m(Array.isArray(I)?I:[])).catch(()=>m([])).finally(()=>S(!1))},[i]),d.useEffect(()=>{if(!v){j([]);return}C(!0),ms.listRoleResources(v).then(I=>{const A=Array.isArray(I)?I:[],Y={};A.forEach(k=>{const E=k.resourceType||"OTHER";Y[E]||(Y[E]=[]),Y[E].push(k)});const H=Object.entries(Y).map(([k,E])=>({title:`${k} (${E.length})`,key:`type-${k}`,children:E.map(R=>({title:`${R.resourceName} (${R.resourceCode})`,key:`res-${R.id}`,raw:R}))}));j(H)}).catch(()=>j([])).finally(()=>C(!1))},[v]);const T=t.map(I=>({value:I.id,label:`${I.username||I.nickname||I.id} (${I.tenantCode||"default"})`})),[F,$]=d.useState(""),M=d.useMemo(()=>{const I=F.trim().toLowerCase();return I?l.filter(A=>`${A.roleCode||""} ${A.roleName||""}`.toLowerCase().includes(I)):l},[l,F]);return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[a.jsx(mt.TableToolbar,{left:a.jsx(u.Select,{showSearch:!0,placeholder:"选择用户",style:{width:320},value:i,onChange:o,loading:r,options:T,filterOption:(I,A)=>A.label.toLowerCase().includes(I.toLowerCase())}),right:a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:b,children:"刷新用户"})}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16},children:[a.jsx(u.Card,{size:"small",title:`用户角色 (${l.length})`,loading:h,extra:a.jsx(u.Input.Search,{allowClear:!0,placeholder:"按角色编码 / 名称过滤",style:{width:220},onChange:I=>$(I.target.value)}),children:l.length===0&&!h?a.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"该用户暂无角色"}):a.jsx(u.List,{size:"small",dataSource:M,renderItem:I=>a.jsx(u.List.Item,{actions:[a.jsx(u.Button,{type:"link",size:"small",onClick:()=>x(I.id),disabled:I.id===v,children:I.id===v?"查看中":"查看资源"},"res")],children:a.jsx(u.List.Item.Meta,{title:a.jsxs(u.Space,{children:[a.jsx(nF,{strong:!0,children:I.roleName||I.roleCode}),a.jsx(u.Tag,{color:"blue",style:{margin:0},children:I.roleCode})]}),description:I.description||"-"})})})}),a.jsx(mt.ListTable,{cardTitle:`用户权限 (${f.length})`,rows:f,rowKey:(I,A)=>I.code||I.resourceCode||I.id||A,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该用户暂无直接权限",columns:[{title:"资源编码",dataIndex:"code",width:200,render:(I,A)=>a.jsx("span",{style:{fontFamily:"monospace"},children:A.code||A.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(I,A)=>A.name||A.resourceName||"-"}],cardProps:{size:"small",loading:p}}),a.jsx(u.Card,{size:"small",title:v?`角色资源 (${y.reduce((I,A)=>{var Y;return I+(((Y=A.children)==null?void 0:Y.length)||0)},0)})`:"角色资源",loading:w,children:v?y.length===0&&!w?a.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"该角色暂无资源"}):a.jsx(u.Tree,{treeData:y,defaultExpandAll:!0,selectable:!1,showLine:!0,blockNode:!0,height:420}):a.jsx(u.Empty,{image:u.Empty.PRESENTED_IMAGE_SIMPLE,description:"左侧点击「查看资源」以查看该角色拥有的权限点"})})]})]})}let _d="/api";function sF(e){_d=e||"/api"}function Va(){return Zt.createRequest({baseURL:_d,timeout:15e3})}const Sn={shorten:e=>Va().post("/ctc/surl/shorten",e),info:e=>Va().get("/ctc/surl/info",{params:{mapKey:e}}),invalidate:e=>Va().delete("/ctc/surl",{params:{mapKey:e}}),buildUrl:e=>`${typeof window<"u"&&window.location&&window.location.origin||""}/s/${encodeURIComponent(e)}`},Ac="z_surl_history";function aF({apiBaseURL:e}){e&&sF(e);const[t]=u.Form.useForm(),n=d.useRef(void 0),[r,s]=d.useState(null),[i,o]=d.useState(()=>JSON.parse(localStorage.getItem(Ac)||"[]")),[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(Ac,JSON.stringify(v))},p=async v=>{var x;c(!0);try{const w=await Sn.shorten({originUrl:v.originUrl,ttlMillis:v.ttlMillis||0,remark:v.remark});s(w);const C=Sn.buildUrl(w.mapKey),b={mapKey:w.mapKey,originUrl:w.originUrl,expireAt:w.expireAt,hits:w.hits,remark:v.remark,createdAt:new Date().toISOString()};m([b,...i]),u.message.success(`短链生成成功:${C}`),(x=n.current)==null||x.reload()}catch(w){u.message.error("生成失败:"+((w==null?void 0:w.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 Sn.invalidate(v),u.message.success("已失效"),m(i.filter(w=>w.mapKey!==v)),(x=n.current)==null||x.reload()}catch(w){m(i.filter(C=>C.mapKey!==v)),u.message.warning("后端失效失败,已从本地移除:"+((w==null?void 0:w.message)||""))}},j=[{title:"短码",dataIndex:"mapKey",width:120,fixed:"left"},{title:"完整短链",dataIndex:"mapKey",width:280,render:(v,x)=>{const w=Sn.buildUrl(x.mapKey);return a.jsxs(u.Space,{size:4,children:[a.jsx("a",{href:w,target:"_blank",rel:"noreferrer",children:w}),a.jsx(u.Tooltip,{title:"复制",children:a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.CopyOutlined,{}),onClick:()=>S(w)})})]})}},{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():a.jsx(u.Tag,{color:"green",children:"永久"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime"},{title:"操作",valueType:"option",width:100,fixed:"right",render:(v,x)=>[a.jsx(u.Popconfirm,{title:"失效该短链?",onConfirm:()=>y(x.mapKey),children:a.jsx(u.Button,{type:"text",danger:!0,size:"small",icon:a.jsx(se.DeleteOutlined,{}),children:"失效"})},"del")]}];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[a.jsxs(u.Card,{title:a.jsxs(a.Fragment,{children:[a.jsx(se.LinkOutlined,{})," 生成短链"]}),children:[a.jsxs(gt,{form:t,layout:"inline",onFinish:p,submitter:{render:v=>[a.jsx(u.Button,{onClick:()=>{var x;return(x=v.form)==null?void 0:x.resetFields()},children:"重置"},"reset"),a.jsx(u.Button,{type:"primary",icon:a.jsx(se.PlusOutlined,{}),loading:l,onClick:()=>{var x;return(x=v.form)==null?void 0:x.submit()},children:"生成"},"submit")]},children:[a.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"}),a.jsx(j0,{name:"ttlMillis",label:"有效期(ms)",width:"sm",min:0,placeholder:"0 = 永久",tooldescription:"0 = 永久;其它填毫秒数,如 86400000 = 1天"}),a.jsx(Us,{name:"remark",label:"备注",width:"sm",placeholder:"可选"})]}),r&&a.jsxs("div",{style:{marginTop:16,padding:16,background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[a.jsx("div",{style:{marginBottom:8},children:a.jsx("b",{children:"生成结果:"})}),a.jsxs(u.Space,{orientation:"vertical",style:{width:"100%"},children:[a.jsxs("div",{children:[a.jsx("span",{style:{color:"#999",marginRight:8},children:"短码:"}),a.jsx(u.Tag,{color:"green",children:r.mapKey})]}),a.jsxs("div",{children:[a.jsx("span",{style:{color:"#999",marginRight:8},children:"完整短链:"}),a.jsx("a",{href:Sn.buildUrl(r.mapKey),target:"_blank",rel:"noreferrer",children:Sn.buildUrl(r.mapKey)}),a.jsx(u.Button,{type:"link",size:"small",icon:a.jsx(se.CopyOutlined,{}),onClick:()=>S(Sn.buildUrl(r.mapKey)),children:"复制"})]}),a.jsxs("div",{children:[a.jsx("span",{style:{color:"#999",marginRight:8},children:"原始URL:"}),a.jsx("span",{style:{wordBreak:"break-all"},children:r.originUrl})]})]})]})]}),a.jsx(u.Card,{title:"历史短链",style:{marginTop:16},extra:a.jsx(u.Input.Search,{allowClear:!0,placeholder:"按短码 / 原始 URL / 备注过滤",style:{width:260},onChange:v=>g(v.target.value)}),children:a.jsx(Ln,{actionRef:n,rowKey:"mapKey",columns:j,dataSource:f,search:!1,pagination:{pageSize:10,showSizeChanger:!0},toolBarRender:()=>[a.jsx(u.Button,{onClick:()=>m([]),children:"清空历史"},"clear"),a.jsx(u.Button,{icon:a.jsx(se.ReloadOutlined,{}),onClick:()=>{var v;return(v=n.current)==null?void 0:v.reload()},children:"刷新"},"reload")]})})]})}let iF="/api";function kt(){return Zt.createRequest({baseURL:iF,timeout:15e3})}const sn={listDictType:e=>kt().get("/dict/type/list",{params:e}),getDictType:e=>kt().get("/dict/type/get",{params:{id:e}}),createDictType:e=>kt().post("/dict/type",e),updateDictType:(e,t)=>kt().put("/dict/type",t,{params:{id:e}}),deleteDictType:e=>kt().delete("/dict/type",{params:{id:e}}),listDictItem:e=>kt().get("/dict/item/list",{params:{dictId:e}}),listDictItemByCode:e=>kt().get("/dict/items/get",{params:{dictCode:e}}),createDictItem:e=>kt().post("/dict/item",e),updateDictItem:(e,t)=>kt().put("/dict/item",t,{params:{id:e}}),deleteDictItem:e=>kt().delete("/dict/item",{params:{id:e}})};function oF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[s,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,j]=d.useState(!1),[v,x]=d.useState(null),[w]=u.Form.useForm(),C=async()=>{r(!0);try{const E=await sn.listDictType({pageNum:1,pageSize:200}),R=(E==null?void 0:E.records)||(E==null?void 0:E.data)||E||[];t(Array.isArray(R)?R:[])}catch(E){u.message.error("加载字典类型失败:"+((E==null?void 0:E.message)||"未知错误")),t([])}finally{r(!1)}};d.useEffect(()=>{C()},[]);const b=async E=>{if(!E){l([]);return}h(!0);try{const R=await sn.listDictItem(E);l(Array.isArray(R)?R:[])}catch(R){u.message.error("加载字典项失败:"+((R==null?void 0:R.message)||"未知错误")),l([])}finally{h(!1)}};d.useEffect(()=>{s!=null&&s.id?b(s.id):l([])},[s==null?void 0:s.id]);const T=()=>{p(null),S.resetFields(),f(!0)},F=E=>{p(E),S.setFieldsValue({dictCode:E.dictCode,dictName:E.dictName,status:E.status??1,remark:E.remark}),f(!0)},$=async()=>{try{const E=await S.validateFields();m?(await sn.updateDictType(m.id,E),u.message.success("更新成功")):(await sn.createDictType(E),u.message.success("创建成功")),f(!1),p(null),S.resetFields(),C()}catch(E){if(E!=null&&E.errorFields)return;u.message.error((m?"更新失败:":"创建失败:")+((E==null?void 0:E.message)||"未知错误"))}},M=async E=>{try{await sn.deleteDictType(E),u.message.success("已删除"),(s==null?void 0:s.id)===E&&i(null),C()}catch(R){u.message.error("删除失败:"+((R==null?void 0:R.message)||"未知错误"))}},I=()=>{if(!s){u.message.warning("请先选择左侧的字典类型");return}x(null),w.resetFields(),j(!0)},A=E=>{x(E),w.setFieldsValue({itemCode:E.itemCode,itemName:E.itemName,sortOrder:E.sortOrder??0,status:E.status??1}),j(!0)},Y=async()=>{try{const R={...await w.validateFields(),dictId:s.id};v?(await sn.updateDictItem(v.id,R),u.message.success("更新成功")):(await sn.createDictItem(R),u.message.success("创建成功")),j(!1),x(null),w.resetFields(),b(s.id)}catch(E){if(E!=null&&E.errorFields)return;u.message.error((v?"更新失败:":"创建失败:")+((E==null?void 0:E.message)||"未知错误"))}},H=async E=>{try{await sn.deleteDictItem(E),u.message.success("已删除"),b(s.id)}catch(R){u.message.error("删除失败:"+((R==null?void 0:R.message)||"未知错误"))}},k=[{title:"ID",dataIndex:"id",width:70},{title:"项编码",dataIndex:"itemCode",width:160,render:E=>a.jsx("span",{style:{fontFamily:"monospace"},children:E})},{title:"项名称",dataIndex:"itemName",width:160},{title:"排序",dataIndex:"sortOrder",width:80},{title:"状态",dataIndex:"status",width:80,render:E=>a.jsx(u.Tag,{color:E===1?"success":"default",children:E===1?"启用":"禁用"})},{title:"操作",width:160,render:(E,R)=>a.jsxs(u.Space,{children:[a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>A(R),children:"编辑"}),a.jsx(u.Popconfirm,{title:"删除该字典项?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>H(R.id),children:a.jsx(u.Button,{type:"text",size:"small",danger:!0,icon:a.jsx(se.DeleteOutlined,{}),children:"删除"})})]})}];return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:16},children:[a.jsx(mt.ListTable,{cardTitle:`字典类型 (${e.length})`,cardExtra:a.jsxs(u.Space,{children:[a.jsx(u.Button,{size:"small",icon:a.jsx(se.PlusOutlined,{}),onClick:T,children:"新增"}),a.jsx(u.Button,{size:"small",icon:a.jsx(se.ReloadOutlined,{}),onClick:C})]}),rows:e,rowKey:"id",searchKeys:["dictCode","dictName"],searchPlaceholder:"搜索编码 / 名称",cardProps:{size:"small",loading:n},tableProps:{onRow:E=>({onClick:()=>i(E),style:{cursor:"pointer",background:(s==null?void 0:s.id)===E.id?"#e6f4ff":void 0}})},columns:[{title:"编码",dataIndex:"dictCode",width:100,ellipsis:!0,render:E=>a.jsx("span",{style:{fontFamily:"monospace"},children:E})},{title:"名称",dataIndex:"dictName",width:110,ellipsis:!0},{title:"状态",dataIndex:"status",width:60,render:E=>a.jsx(u.Tag,{color:E===1?"success":"default",children:E===1?"启":"禁"})},{title:"操作",width:100,render:(E,R)=>a.jsxs(u.Space,{onClick:z=>z.stopPropagation(),children:[a.jsx(u.Button,{type:"text",size:"small",icon:a.jsx(se.EditOutlined,{}),onClick:()=>F(R)}),a.jsx(u.Popconfirm,{title:"删除该类型?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>M(R.id),children:a.jsx(u.Button,{type:"text",size:"small",danger:!0,icon:a.jsx(se.DeleteOutlined,{})})})]})}]}),s?a.jsx(mt.ListTable,{cardTitle:`字典项 — ${s.dictName} (${o.length})`,cardExtra:a.jsxs(u.Space,{children:[a.jsx(u.Button,{size:"small",icon:a.jsx(se.PlusOutlined,{}),onClick:I,disabled:!s,children:"新增项"}),a.jsx(u.Button,{size:"small",icon:a.jsx(se.ReloadOutlined,{}),disabled:!s,onClick:()=>s&&b(s.id)})]}),rows:o,rowKey:"id",loading:c,searchKeys:["itemCode","itemName"],searchPlaceholder:"按项编码 / 项名称过滤",cardProps:{size:"small"},columns:k}):a.jsx(u.Card,{size:"small",title:"字典项",children:a.jsx("div",{style:{padding:40,textAlign:"center",color:"#999"},children:"请在左侧选择一个字典类型以查看其字典项"})})]}),a.jsx(u.Modal,{title:m?"编辑字典类型":"新建字典类型",open:g,onOk:$,onCancel:()=>{f(!1),p(null),S.resetFields()},destroyOnHidden:!0,size:"large",children:a.jsxs(u.Form,{form:S,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"dictCode",label:"字典编码",rules:[{required:!0,max:64}],extra:"业务唯一,如 user_status",children:a.jsx(u.Input,{disabled:!!m,placeholder:"如 user_status"})}),a.jsx(u.Form.Item,{name:"dictName",label:"字典名称",rules:[{required:!0,max:128}],children:a.jsx(u.Input,{placeholder:"如 用户状态"})}),a.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:a.jsx(u.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),a.jsx(u.Form.Item,{name:"remark",label:"备注",children:a.jsx(u.Input.TextArea,{rows:2,maxLength:512})})]})}),a.jsx(u.Modal,{title:v?`编辑字典项 — ${(s==null?void 0:s.dictName)||""}`:`新建字典项 — ${(s==null?void 0:s.dictName)||""}`,open:y,onOk:Y,onCancel:()=>{j(!1),x(null),w.resetFields()},destroyOnHidden:!0,size:"large",children:a.jsxs(u.Form,{form:w,layout:"vertical",style:{marginTop:16},children:[a.jsx(u.Form.Item,{name:"itemCode",label:"项编码",rules:[{required:!0,max:64}],extra:"业务唯一",children:a.jsx(u.Input,{placeholder:"如 enabled"})}),a.jsx(u.Form.Item,{name:"itemName",label:"项名称",rules:[{required:!0,max:128}],children:a.jsx(u.Input,{placeholder:"如 启用"})}),a.jsx(u.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:a.jsx(u.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),a.jsx(u.Form.Item,{name:"status",label:"状态",initialValue:1,children:a.jsx(u.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})})]})}let lF="/api";function Ha(){return Zt.createRequest({baseURL:lF,timeout:15e3})}const kc={list:e=>Ha().get("/ctc/ac/login-log/list",{params:e}),page:e=>Ha().get("/ctc/ac/login-log/page",{params:e}),recent:()=>Ha().get("/ctc/ac/login-log/recent")};function cF(){return a.jsx("div",{children:a.jsx(u.Tabs,{defaultActiveKey:"login",size:"small",items:[{key:"login",label:a.jsxs("span",{children:[a.jsx(se.LoginOutlined,{})," 登录日志"]}),children:a.jsx(uF,{})},{key:"operation",label:a.jsxs("span",{children:[a.jsx(se.LoginOutlined,{})," 操作日志"]}),children:a.jsx(u.Card,{children:a.jsxs("div",{style:{padding:40,textAlign:"center",color:"#8a8f98"},children:[a.jsx("div",{style:{marginBottom:8,fontSize:14},children:"操作日志 - 规划中"}),a.jsxs("div",{style:{fontSize:12},children:["未来记录: 谁在什么时间对什么资源做了什么操作",a.jsx("br",{}),"(创建/修改/删除/审批/授权等)"]})]})}),disabled:!0}]})})}function uF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[s,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 kc.recent();t(Array.isArray(b)?b:[])}catch{t([])}finally{r(!1)}},y=async b=>{const T=b||g;l(!0);try{const F=await kc.list({...m,...T});i((F==null?void 0:F.list)||[]),h((F==null?void 0:F.total)||0)}catch{i([]),h(0)}finally{l(!1)}};d.useEffect(()=>{S(),y({page:1,size:20})},[]);const j=()=>y({page:1,size:20}),v=(b,T)=>{const F={page:b,size:T||g.size};f(F),y(F)},x=e.filter(b=>b.loginStatus===1).length,w=e.filter(b=>b.loginStatus!==1).length,C=[{title:"ID",dataIndex:"id",width:70},{title:"登录标识",dataIndex:"identifier",width:160},{title:"方式",dataIndex:"identityType",width:90,render:b=>a.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=>a.jsx(u.Tag,{color:b===1?"success":"error",children:b===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0,render:b=>b?a.jsx(u.Tooltip,{title:b,children:b}):a.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?a.jsx(u.Tooltip,{title:b,children:a.jsx("span",{style:{fontFamily:"monospace",fontSize:12},children:b.length>60?b.slice(0,60)+"…":b})}):"-"},{title:"登录时间",dataIndex:"loginTime",width:170,render:b=>b?Se(b).format("YYYY-MM-DD HH:mm:ss"):"-"}];return a.jsxs(u.Space,{orientation:"vertical",size:12,style:{width:"100%"},children:[a.jsxs(u.Row,{gutter:12,children:[a.jsx(u.Col,{span:6,children:a.jsx(u.Card,{size:"small",children:a.jsx(u.Statistic,{title:"最近成功登录 (10 条内)",value:x,styles:{content:{color:"#52c41a",fontSize:20}},prefix:a.jsx(se.LoginOutlined,{})})})}),a.jsx(u.Col,{span:6,children:a.jsx(u.Card,{size:"small",children:a.jsx(u.Statistic,{title:"最近失败登录 (10 条内)",value:w,styles:{content:{color:"#ff4d4f",fontSize:20}}})})}),a.jsx(u.Col,{span:6,children:a.jsx(u.Card,{size:"small",children:a.jsx(u.Statistic,{title:"最近 10 条",value:e.length,styles:{content:{fontSize:20}}})})}),a.jsx(u.Col,{span:6,children:a.jsx(u.Card,{size:"small",children:a.jsx(u.Statistic,{title:"总日志数",value:c,loading:o,styles:{content:{fontSize:20}}})})})]}),a.jsxs(u.Card,{size:"small",title:a.jsxs(u.Space,{children:[a.jsx("span",{children:"登录日志"}),a.jsxs(u.Tag,{color:"cyan",children:[c," 条"]})]}),extra:a.jsxs(u.Space,{children:[a.jsxs("a",{onClick:S,children:[a.jsx(se.ReloadOutlined,{spin:n})," 刷新最近"]}),a.jsxs("a",{onClick:()=>y(),children:[a.jsx(se.ReloadOutlined,{spin:o})," 刷新列表"]})]}),children:[a.jsxs(u.Space,{wrap:!0,style:{marginBottom:12},children:[a.jsx(mt.SearchInput,{placeholder:"登录标识",value:m.identifier,onChange:b=>p({...m,identifier:b}),onSearch:j,size:"large"}),a.jsx(mt.SearchInput,{placeholder:"租户编码",value:m.tenantCode,onChange:b=>p({...m,tenantCode:b}),onSearch:j,size:"large"}),a.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:"失败"}]}),a.jsxs("a",{onClick:j,children:[a.jsx(se.SearchOutlined,{})," 查询"]})]}),a.jsx(u.Table,{size:"small",rowKey:"id",loading:o,dataSource:s,columns:C,pagination:{current:g.page,pageSize:g.size,total:c,showSizeChanger:!0,showTotal:b=>`共 ${b} 条`,onChange:v}})]})]})}const gs=Zt.createRequest({baseURL:"/api",timeout:1e4}),Ya=e=>e?typeof e.total=="number"?e.total:Array.isArray(e)?e.length:Array.isArray(e.records)?e.records.length:0:0;function dF(){const[e,t]=d.useState({account:null,role:null,tenant:null,surl:null}),[n,r]=d.useState(!0);return d.useEffect(()=>{let s=!0;return Promise.all([gs.get("/ctc/ac/accounts",{params:{pageSize:1}}).then(i=>Ya(i)).catch(()=>0),gs.get("/ctc/authz/roles/list").then(i=>Ya(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=>Ya(i)).catch(()=>0)]).then(([i,o,l,c])=>{s&&(t({account:i,role:o,tenant:l,surl:c}),r(!1))}),()=>{s=!1}},[]),a.jsx("div",{style:{padding:24},children:a.jsxs(u.Row,{gutter:[16,16],children:[a.jsx(u.Col,{xs:24,sm:12,lg:6,children:a.jsx(u.Card,{loading:n,children:a.jsx(u.Statistic,{title:"账号数",value:e.account,prefix:a.jsx(se.TeamOutlined,{})})})}),a.jsx(u.Col,{xs:24,sm:12,lg:6,children:a.jsx(u.Card,{loading:n,children:a.jsx(u.Statistic,{title:"角色数",value:e.role,prefix:a.jsx(se.SafetyCertificateOutlined,{})})})}),a.jsx(u.Col,{xs:24,sm:12,lg:6,children:a.jsx(u.Card,{loading:n,children:a.jsx(u.Statistic,{title:"租户数",value:e.tenant,prefix:a.jsx(se.AppstoreOutlined,{})})})}),a.jsx(u.Col,{xs:24,sm:12,lg:6,children:a.jsx(u.Card,{loading:n,children:a.jsx(u.Statistic,{title:"短链数",value:e.surl,prefix:a.jsx(se.LinkOutlined,{})})})})]})})}const zd=({name:e="4A"})=>a.jsxs(u.Button,{type:"primary",children:["Hello ",e,"(来自 @yuku123/z-ctc-component)"]}),fF={HelloCtc:zd};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=UT;exports.ApplicationManagement=ZT;exports.AuditPage=cF;exports.ComponentDocPage=Xd;exports.CtcOverview=dF;exports.DictPage=oF;exports.HelloCtc=zd;exports.OrgManagement=_c;exports.OrgPage=sf;exports.PermissionManagement=eF;exports.ResourcePage=tF;exports.RoleManagement=XT;exports.StatusTag=tf;exports.SurlManagement=aF;exports.TenantManagement=lf;exports.UserPermissionPage=rF;exports.UserTable=Qd;exports.ctcAcDomainApi=Cn;exports.ctcAcTenantApi=Cr;exports.default=fF;
|
|
54
|
+
${Z}`),z.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 H(I,$,z){switch(typeof $){case"string":return i($);case"object":{if($===null)return"null";if(typeof $.toJSON=="function"){if($=$.toJSON(I),typeof $!="object")return H(I,$,z);if($===null)return"null"}if(z.indexOf($)!==-1)return w;let _="";const V=$.length!==void 0;if(V&&Array.isArray($)){if($.length===0)return"[]";if(R<z.length+1)return'"[Array]"';z.push($);const G=Math.min($.length,E);let K=0;for(;K<G-1;K++){const k=H(String(K),$[K],z);_+=k!==void 0?k:"null",_+=","}const A=H(String(K),$[K],z);if(_+=A!==void 0?A:"null",$.length-1>E){const k=$.length-E-1;_+=`,"... ${S(k)} not stringified"`}return z.pop(),`[${_}]`}let Z=Object.keys($);const B=Z.length;if(B===0)return"{}";if(R<z.length+1)return'"[Object]"';let U="",J=Math.min(B,E);V&&u($)&&(_+=h($,",",E),Z=Z.slice($.length),J-=$.length,U=","),T&&(Z=o(Z,F)),z.push($);for(let G=0;G<J;G++){const K=Z[G],A=H(K,$[K],z);A!==void 0&&(_+=`${U}${i(K)}:${A}`,U=",")}if(B>E){const G=B-E;_+=`${U}"...":"${S(G)} not stringified"`}return z.pop(),`{${_}}`}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 D(I,$,z){if(arguments.length>1){let _="";if(typeof z=="number"?_=" ".repeat(Math.min(z,10)):typeof z=="string"&&(_=z.slice(0,10)),$!=null){if(typeof $=="function")return M("",{"":I},[],$,_,"");if(Array.isArray($))return O("",I,[],y($),_,"")}if(_.length!==0)return Y("",I,[],_,"")}return H("",I,[])}return D}})(ns,ns.exports)),ns.exports}var Jp=Zp();const Xp=Vt(Jp),Qp=Xp.configure,fn=Qp({bigint:!0,circularValue:"Magic circle!",deterministic:!1,maximumDepth:4});var _u=typeof global=="object"&&global&&global.Object===Object&&global,ey=typeof self=="object"&&self&&self.Object===Object&&self,Ut=_u||ey||Function("return this")(),pn=Ut.Symbol,zu=Object.prototype,ty=zu.hasOwnProperty,ny=zu.toString,fr=pn?pn.toStringTag:void 0;function ry(e){var t=ty.call(e,fr),n=e[fr];try{e[fr]=void 0;var r=!0}catch{}var a=ny.call(e);return r&&(t?e[fr]=n:delete e[fr]),a}var sy=Object.prototype,ay=sy.toString;function iy(e){return ay.call(e)}var oy="[object Null]",ly="[object Undefined]",pl=pn?pn.toStringTag:void 0;function ar(e){return e==null?e===void 0?ly:oy:pl&&pl in Object(e)?ry(e):iy(e)}function Zt(e){return e!=null&&typeof e=="object"}var yn=Array.isArray;function Bu(e){return e}var cy="[object AsyncFunction]",uy="[object Function]",dy="[object GeneratorFunction]",fy="[object Proxy]";function Ji(e){if(!Ft(e))return!1;var t=ar(e);return t==uy||t==dy||t==cy||t==fy}var Ia=Ut["__core-js_shared__"],yl=(function(){var e=/[^.]+$/.exec(Ia&&Ia.keys&&Ia.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function my(e){return!!yl&&yl in e}var hy=Function.prototype,gy=hy.toString;function Dn(e){if(e!=null){try{return gy.call(e)}catch{}try{return e+""}catch{}}return""}var py=/[\\^$.*+?()[\]{}|]/g,yy=/^\[object .+?Constructor\]$/,xy=Function.prototype,by=Object.prototype,Sy=xy.toString,Cy=by.hasOwnProperty,wy=RegExp("^"+Sy.call(Cy).replace(py,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function jy(e){if(!Ft(e)||my(e))return!1;var t=Ji(e)?wy:yy;return t.test(Dn(e))}function vy(e,t){return e==null?void 0:e[t]}function Pn(e,t){var n=vy(e,t);return jy(n)?n:void 0}var mi=Pn(Ut,"WeakMap"),xl=Object.create,Ty=(function(){function e(){}return function(t){if(!Ft(t))return{};if(xl)return xl(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function Fy(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 Ry(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var $y=800,Ey=16,Iy=Date.now;function My(e){var t=0,n=0;return function(){var r=Iy(),a=Ey-(r-n);if(n=r,a>0){if(++t>=$y)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Oy(e){return function(){return e}}var Ds=(function(){try{var e=Pn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),Ay=Ds?function(e,t){return Ds(e,"toString",{configurable:!0,enumerable:!1,value:Oy(t),writable:!0})}:Bu,ky=My(Ay);function Dy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Py=9007199254740991,Ny=/^(?:0|[1-9]\d*)$/;function Vu(e,t){var n=typeof e;return t=t??Py,!!t&&(n=="number"||n!="symbol"&&Ny.test(e))&&e>-1&&e%1==0&&e<t}function Xi(e,t,n){t=="__proto__"&&Ds?Ds(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Lr(e,t){return e===t||e!==e&&t!==t}var Ly=Object.prototype,_y=Ly.hasOwnProperty;function Hu(e,t,n){var r=e[t];(!(_y.call(e,t)&&Lr(r,n))||n===void 0&&!(t in e))&&Xi(e,t,n)}function zy(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?Xi(n,l,u):Hu(n,l,u)}return n}var bl=Math.max;function By(e,t,n){return t=bl(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=bl(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),Fy(e,this,l)}}function Vy(e,t){return ky(By(e,t,Bu),e+"")}var Hy=9007199254740991;function Yu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Hy}function _r(e){return e!=null&&Yu(e.length)&&!Ji(e)}function Yy(e,t,n){if(!Ft(n))return!1;var r=typeof t;return(r=="number"?_r(n)&&Vu(t,n.length):r=="string"&&t in n)?Lr(n[t],e):!1}function Uy(e){return Vy(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&&Yy(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 Ky=Object.prototype;function Js(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ky;return e===n}function Wy(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var qy="[object Arguments]";function Sl(e){return Zt(e)&&ar(e)==qy}var Uu=Object.prototype,Gy=Uu.hasOwnProperty,Zy=Uu.propertyIsEnumerable,Ps=Sl((function(){return arguments})())?Sl:function(e){return Zt(e)&&Gy.call(e,"callee")&&!Zy.call(e,"callee")};function Jy(){return!1}var Ku=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cl=Ku&&typeof module=="object"&&module&&!module.nodeType&&module,Xy=Cl&&Cl.exports===Ku,wl=Xy?Ut.Buffer:void 0,Qy=wl?wl.isBuffer:void 0,Qn=Qy||Jy,ex="[object Arguments]",tx="[object Array]",nx="[object Boolean]",rx="[object Date]",sx="[object Error]",ax="[object Function]",ix="[object Map]",ox="[object Number]",lx="[object Object]",cx="[object RegExp]",ux="[object Set]",dx="[object String]",fx="[object WeakMap]",mx="[object ArrayBuffer]",hx="[object DataView]",gx="[object Float32Array]",px="[object Float64Array]",yx="[object Int8Array]",xx="[object Int16Array]",bx="[object Int32Array]",Sx="[object Uint8Array]",Cx="[object Uint8ClampedArray]",wx="[object Uint16Array]",jx="[object Uint32Array]",We={};We[gx]=We[px]=We[yx]=We[xx]=We[bx]=We[Sx]=We[Cx]=We[wx]=We[jx]=!0;We[ex]=We[tx]=We[mx]=We[nx]=We[hx]=We[rx]=We[sx]=We[ax]=We[ix]=We[ox]=We[lx]=We[cx]=We[ux]=We[dx]=We[fx]=!1;function vx(e){return Zt(e)&&Yu(e.length)&&!!We[ar(e)]}function Qi(e){return function(t){return e(t)}}var Wu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fr=Wu&&typeof module=="object"&&module&&!module.nodeType&&module,Tx=Fr&&Fr.exports===Wu,Ma=Tx&&_u.process,er=(function(){try{var e=Fr&&Fr.require&&Fr.require("util").types;return e||Ma&&Ma.binding&&Ma.binding("util")}catch{}})(),jl=er&&er.isTypedArray,Xs=jl?Qi(jl):vx,Fx=Object.prototype,Rx=Fx.hasOwnProperty;function qu(e,t){var n=yn(e),r=!n&&Ps(e),a=!n&&!r&&Qn(e),i=!n&&!r&&!a&&Xs(e),o=n||r||a||i,l=o?Wy(e.length,String):[],u=l.length;for(var h in e)(t||Rx.call(e,h))&&!(o&&(h=="length"||a&&(h=="offset"||h=="parent")||i&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||Vu(h,u)))&&l.push(h);return l}function Gu(e,t){return function(n){return e(t(n))}}var $x=Gu(Object.keys,Object),Ex=Object.prototype,Ix=Ex.hasOwnProperty;function Zu(e){if(!Js(e))return $x(e);var t=[];for(var n in Object(e))Ix.call(e,n)&&n!="constructor"&&t.push(n);return t}function Mx(e){return _r(e)?qu(e):Zu(e)}function Ox(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ax=Object.prototype,kx=Ax.hasOwnProperty;function Dx(e){if(!Ft(e))return Ox(e);var t=Js(e),n=[];for(var r in e)r=="constructor"&&(t||!kx.call(e,r))||n.push(r);return n}function Ju(e){return _r(e)?qu(e,!0):Dx(e)}var Ar=Pn(Object,"create");function Px(){this.__data__=Ar?Ar(null):{},this.size=0}function Nx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Lx="__lodash_hash_undefined__",_x=Object.prototype,zx=_x.hasOwnProperty;function Bx(e){var t=this.__data__;if(Ar){var n=t[e];return n===Lx?void 0:n}return zx.call(t,e)?t[e]:void 0}var Vx=Object.prototype,Hx=Vx.hasOwnProperty;function Yx(e){var t=this.__data__;return Ar?t[e]!==void 0:Hx.call(t,e)}var Ux="__lodash_hash_undefined__";function Kx(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===void 0?Ux:t,this}function On(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])}}On.prototype.clear=Px;On.prototype.delete=Nx;On.prototype.get=Bx;On.prototype.has=Yx;On.prototype.set=Kx;function Wx(){this.__data__=[],this.size=0}function Qs(e,t){for(var n=e.length;n--;)if(Lr(e[n][0],t))return n;return-1}var qx=Array.prototype,Gx=qx.splice;function Zx(e){var t=this.__data__,n=Qs(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Gx.call(t,n,1),--this.size,!0}function Jx(e){var t=this.__data__,n=Qs(t,e);return n<0?void 0:t[n][1]}function Xx(e){return Qs(this.__data__,e)>-1}function Qx(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 Qt(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])}}Qt.prototype.clear=Wx;Qt.prototype.delete=Zx;Qt.prototype.get=Jx;Qt.prototype.has=Xx;Qt.prototype.set=Qx;var kr=Pn(Ut,"Map");function eb(){this.size=0,this.__data__={hash:new On,map:new(kr||Qt),string:new On}}function tb(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 tb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function nb(e){var t=ea(this,e).delete(e);return this.size-=t?1:0,t}function rb(e){return ea(this,e).get(e)}function sb(e){return ea(this,e).has(e)}function ab(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=eb;Nn.prototype.delete=nb;Nn.prototype.get=rb;Nn.prototype.has=sb;Nn.prototype.set=ab;function ib(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),ob="[object Object]",lb=Function.prototype,cb=Object.prototype,Qu=lb.toString,ub=cb.hasOwnProperty,db=Qu.call(Object);function fb(e){if(!Zt(e)||ar(e)!=ob)return!1;var t=Xu(e);if(t===null)return!0;var n=ub.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Qu.call(n)==db}function mb(){this.__data__=new Qt,this.size=0}function hb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function gb(e){return this.__data__.get(e)}function pb(e){return this.__data__.has(e)}var yb=200;function xb(e,t){var n=this.__data__;if(n instanceof Qt){var r=n.__data__;if(!kr||r.length<yb-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 zt(e){var t=this.__data__=new Qt(e);this.size=t.size}zt.prototype.clear=mb;zt.prototype.delete=hb;zt.prototype.get=gb;zt.prototype.has=pb;zt.prototype.set=xb;var ed=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vl=ed&&typeof module=="object"&&module&&!module.nodeType&&module,bb=vl&&vl.exports===ed,Tl=bb?Ut.Buffer:void 0,Fl=Tl?Tl.allocUnsafe:void 0;function td(e,t){if(t)return e.slice();var n=e.length,r=Fl?Fl(n):new e.constructor(n);return e.copy(r),r}function Sb(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 Cb(){return[]}var wb=Object.prototype,jb=wb.propertyIsEnumerable,Rl=Object.getOwnPropertySymbols,vb=Rl?function(e){return e==null?[]:(e=Object(e),Sb(Rl(e),function(t){return jb.call(e,t)}))}:Cb;function Tb(e,t,n){var r=t(e);return yn(e)?r:ib(r,n(e))}function hi(e){return Tb(e,Mx,vb)}var gi=Pn(Ut,"DataView"),pi=Pn(Ut,"Promise"),yi=Pn(Ut,"Set"),$l="[object Map]",Fb="[object Object]",El="[object Promise]",Il="[object Set]",Ml="[object WeakMap]",Ol="[object DataView]",Rb=Dn(gi),$b=Dn(kr),Eb=Dn(pi),Ib=Dn(yi),Mb=Dn(mi),Tt=ar;(gi&&Tt(new gi(new ArrayBuffer(1)))!=Ol||kr&&Tt(new kr)!=$l||pi&&Tt(pi.resolve())!=El||yi&&Tt(new yi)!=Il||mi&&Tt(new mi)!=Ml)&&(Tt=function(e){var t=ar(e),n=t==Fb?e.constructor:void 0,r=n?Dn(n):"";if(r)switch(r){case Rb:return Ol;case $b:return $l;case Eb:return El;case Ib:return Il;case Mb:return Ml}return t});var Ob=Object.prototype,Ab=Ob.hasOwnProperty;function kb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Ab.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Ns=Ut.Uint8Array;function eo(e){var t=new e.constructor(e.byteLength);return new Ns(t).set(new Ns(e)),t}function Db(e,t){var n=eo(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Pb=/\w*$/;function Nb(e){var t=new e.constructor(e.source,Pb.exec(e));return t.lastIndex=e.lastIndex,t}var Al=pn?pn.prototype:void 0,kl=Al?Al.valueOf:void 0;function Lb(e){return kl?Object(kl.call(e)):{}}function nd(e,t){var n=t?eo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var _b="[object Boolean]",zb="[object Date]",Bb="[object Map]",Vb="[object Number]",Hb="[object RegExp]",Yb="[object Set]",Ub="[object String]",Kb="[object Symbol]",Wb="[object ArrayBuffer]",qb="[object DataView]",Gb="[object Float32Array]",Zb="[object Float64Array]",Jb="[object Int8Array]",Xb="[object Int16Array]",Qb="[object Int32Array]",eS="[object Uint8Array]",tS="[object Uint8ClampedArray]",nS="[object Uint16Array]",rS="[object Uint32Array]";function sS(e,t,n){var r=e.constructor;switch(t){case Wb:return eo(e);case _b:case zb:return new r(+e);case qb:return Db(e);case Gb:case Zb:case Jb:case Xb:case Qb:case eS:case tS:case nS:case rS:return nd(e,n);case Bb:return new r;case Vb:case Ub:return new r(e);case Hb:return Nb(e);case Yb:return new r;case Kb:return Lb(e)}}function rd(e){return typeof e.constructor=="function"&&!Js(e)?Ty(Xu(e)):{}}var aS="[object Map]";function iS(e){return Zt(e)&&Tt(e)==aS}var Dl=er&&er.isMap,oS=Dl?Qi(Dl):iS,lS="[object Set]";function cS(e){return Zt(e)&&Tt(e)==lS}var Pl=er&&er.isSet,uS=Pl?Qi(Pl):cS,dS=1,sd="[object Arguments]",fS="[object Array]",mS="[object Boolean]",hS="[object Date]",gS="[object Error]",ad="[object Function]",pS="[object GeneratorFunction]",yS="[object Map]",xS="[object Number]",id="[object Object]",bS="[object RegExp]",SS="[object Set]",CS="[object String]",wS="[object Symbol]",jS="[object WeakMap]",vS="[object ArrayBuffer]",TS="[object DataView]",FS="[object Float32Array]",RS="[object Float64Array]",$S="[object Int8Array]",ES="[object Int16Array]",IS="[object Int32Array]",MS="[object Uint8Array]",OS="[object Uint8ClampedArray]",AS="[object Uint16Array]",kS="[object Uint32Array]",Ve={};Ve[sd]=Ve[fS]=Ve[vS]=Ve[TS]=Ve[mS]=Ve[hS]=Ve[FS]=Ve[RS]=Ve[$S]=Ve[ES]=Ve[IS]=Ve[yS]=Ve[xS]=Ve[id]=Ve[bS]=Ve[SS]=Ve[CS]=Ve[wS]=Ve[MS]=Ve[OS]=Ve[AS]=Ve[kS]=!0;Ve[gS]=Ve[ad]=Ve[jS]=!1;function js(e,t,n,r,a,i){var o,l=t&dS;if(o!==void 0)return o;if(!Ft(e))return e;var u=yn(e);if(u)o=kb(e);else{var h=Tt(e),g=h==ad||h==pS;if(Qn(e))return td(e,l);if(h==id||h==sd||g&&!a)o=g?{}:rd(e);else{if(!Ve[h])return a?e:{};o=sS(e,h,l)}}i||(i=new zt);var f=i.get(e);if(f)return f;i.set(e,o),uS(e)?e.forEach(function(S){o.add(js(S,t,n,S,e,i))}):oS(e)&&e.forEach(function(S,y){o.set(y,js(S,t,n,y,e,i))});var m=hi,p=u?void 0:m(e);return Dy(p||e,function(S,y){p&&(y=S,S=e[y]),Hu(o,y,js(S,t,n,y,e,i))}),o}var DS=1,PS=4;function NS(e){return js(e,DS|PS)}var LS="__lodash_hash_undefined__";function _S(e){return this.__data__.set(e,LS),this}function zS(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=_S;Ls.prototype.has=zS;function BS(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 VS(e,t){return e.has(t)}var HS=1,YS=2;function od(e,t,n,r,a,i){var o=n&HS,l=e.length,u=t.length;if(l!=u&&!(o&&u>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&YS?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 j=o?r(y,S,f,t,e,i):r(S,y,f,e,t,i);if(j!==void 0){if(j)continue;m=!1;break}if(p){if(!BS(t,function(v,x){if(!VS(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 US(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function KS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var WS=1,qS=2,GS="[object Boolean]",ZS="[object Date]",JS="[object Error]",XS="[object Map]",QS="[object Number]",eC="[object RegExp]",tC="[object Set]",nC="[object String]",rC="[object Symbol]",sC="[object ArrayBuffer]",aC="[object DataView]",Nl=pn?pn.prototype:void 0,Oa=Nl?Nl.valueOf:void 0;function iC(e,t,n,r,a,i,o){switch(n){case aC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case sC:return!(e.byteLength!=t.byteLength||!i(new Ns(e),new Ns(t)));case GS:case ZS:case QS:return Lr(+e,+t);case JS:return e.name==t.name&&e.message==t.message;case eC:case nC:return e==t+"";case XS:var l=US;case tC:var u=r&WS;if(l||(l=KS),e.size!=t.size&&!u)return!1;var h=o.get(e);if(h)return h==t;r|=qS,o.set(e,t);var g=od(l(e),l(t),r,a,i,o);return o.delete(e),g;case rC:if(Oa)return Oa.call(e)==Oa.call(t)}return!1}var oC=1,lC=Object.prototype,cC=lC.hasOwnProperty;function uC(e,t,n,r,a,i){var o=n&oC,l=hi(e),u=l.length,h=hi(t),g=h.length;if(u!=g&&!o)return!1;for(var f=u;f--;){var m=l[f];if(!(o?m in t:cC.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 j=o;++f<u;){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}j||(j=m=="constructor")}if(y&&!j){var w=e.constructor,b=t.constructor;w!=b&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof b=="function"&&b instanceof b)&&(y=!1)}return i.delete(e),i.delete(t),y}var dC=1,Ll="[object Arguments]",_l="[object Array]",rs="[object Object]",fC=Object.prototype,zl=fC.hasOwnProperty;function mC(e,t,n,r,a,i){var o=yn(e),l=yn(t),u=o?_l:Tt(e),h=l?_l:Tt(t);u=u==Ll?rs:u,h=h==Ll?rs:h;var g=u==rs,f=h==rs,m=u==h;if(m&&Qn(e)){if(!Qn(t))return!1;o=!0,g=!1}if(m&&!g)return i||(i=new zt),o||Xs(e)?od(e,t,n,r,a,i):iC(e,t,u,n,r,a,i);if(!(n&dC)){var p=g&&zl.call(e,"__wrapped__"),S=f&&zl.call(t,"__wrapped__");if(p||S){var y=p?e.value():e,j=S?t.value():t;return i||(i=new zt),a(y,j,n,r,i)}}return m?(i||(i=new zt),uC(e,t,n,r,a,i)):!1}function ld(e,t,n,r,a){return e===t?!0:e==null||t==null||!Zt(e)&&!Zt(t)?e!==e&&t!==t:mC(e,t,n,r,ld,a)}function hC(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 gC=hC();function xi(e,t,n){(n!==void 0&&!Lr(e[t],n)||n===void 0&&!(t in e))&&Xi(e,t,n)}function pC(e){return Zt(e)&&_r(e)}function bi(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function yC(e){return zy(e,Ju(e))}function xC(e,t,n,r,a,i,o){var l=bi(e,n),u=bi(t,n),h=o.get(u);if(h){xi(e,n,h);return}var g=i?i(l,u,n+"",e,t,o):void 0,f=g===void 0;if(f){var m=yn(u),p=!m&&Qn(u),S=!m&&!p&&Xs(u);g=u,m||p||S?yn(l)?g=l:pC(l)?g=Ry(l):p?(f=!1,g=td(u,!0)):S?(f=!1,g=nd(u,!0)):g=[]:fb(u)||Ps(u)?(g=l,Ps(l)?g=yC(l):(!Ft(l)||Ji(l))&&(g=rd(u))):f=!1}f&&(o.set(u,g),a(g,u,r,i,o),o.delete(u)),xi(e,n,g)}function cd(e,t,n,r,a){e!==t&&gC(t,function(i,o){if(a||(a=new zt),Ft(i))xC(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 bC="[object Map]",SC="[object Set]",CC=Object.prototype,wC=CC.hasOwnProperty;function jC(e){if(e==null)return!0;if(_r(e)&&(yn(e)||typeof e=="string"||typeof e.splice=="function"||Qn(e)||Xs(e)||Ps(e)))return!e.length;var t=Tt(e);if(t==bC||t==SC)return!e.size;if(Js(e))return!Zu(e).length;for(var n in e)if(wC.call(e,n))return!1;return!0}function Aa(e,t){return ld(e,t)}var _s=Uy(function(e,t,n){cd(e,t,n)});function vC(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 TC(e){return e.split(".").map(t=>/^\d+$/.test(t)?parseInt(t,10):t)}function FC(e){const t={};for(const n in e){const r=e[n];$t(r)||(t[n]=r)}return t}function RC(e){const t={},n={};for(const r in e){const a=e[r];$t(a)||(r.includes(".")?t[r]=a:n[r]=a)}return{dotPathTransforms:t,objectTransforms:n}}function $C(e,t){for(const n in t){const r=t[n];if(typeof r!="function")continue;const a=TC(n),i=Me(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?Me(e,l):e;if(u&&typeof u=="object"){const h=a[a.length-1];delete u[h],Object.assign(u,o)}}else{let l=e;for(let u=0;u<a.length-1;u++){const h=a[u];if(l[h]===void 0){const g=a[u+1];l[h]=typeof g=="number"?[]:{}}l=l[h]}l[a[a.length-1]]=o}}}function EC(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 IC(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((u,h)=>h.toString()):Object.keys(e);for(const u of l){const h=t?[...t,u]:[u],g=e[u];let f=n[u];if(!f&&t&&(f=EC(n,t,u)),f&&typeof f=="function"){const m=f(g,u,e);typeof m=="object"&&m!==null&&!Array.isArray(m)?(t?IC(t):!1)?Object.assign(o,m):r.push(m):o[u]=m}else if(vC(g)&&!$t(g)){const m=n[u];if(m&&typeof m=="object"){const p=Si(g,h,m,r,a);Object.keys(p).length>0&&(o[u]=p)}else{const p=Si(g,h,n,r,a);o[u]=p}}else $t(g)||(o[u]=g)}return o}const MC=(e,t)=>{const n=FC(t);if(Object.keys(n).length<1||typeof window>"u"||typeof e!="object"||$t(e)||e instanceof Blob)return e;let r=NS(e);const{dotPathTransforms:a,objectTransforms:i}=RC(t);$C(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},OC=(e,t,n)=>{const r=d.useRef({});function a(i){var l;function o(u,h){u.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 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:AC}=He,Bl=e=>c.message.warning(e),Ke=e=>Array.isArray(e)?e.join(","):e,to=(...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 u=(a||0)*10+l,h=t(o,u).toString();if(o&&typeof o=="object"&&n in o){const m=o[n]||[];ud(m,t,n,h,u).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 kC(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:h,...g}=l,f=String(h);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: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):(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,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(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,h=l&&r.has(l)?{...u,[t]:r.get(l)}:u;a.push(h)}}),a}function br(e,t){var u;const{getRowKey:n,row:r,data:a,childrenColumnName:i="children"}=e,o=(u=Ke(e.key))==null?void 0:u.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 kC(l,i,t)}function DC({recordKey:e,onSave:t,row:n,children:r,newLineConfig:a,editorType:i,tableName:o},l){const u=d.useContext(Nr),h=c.Form.useFormInstance(),[g,f]=d.useState(!1),m=be(async()=>{try{const p=i==="Map",S=to(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 w;const x=(w=u==null?void 0:u.getFieldFormatValueObject)==null?void 0:w.call(u,S);return(x!=null?Me(x,S):null)??h.getFieldValue(S)})();if(Array.isArray(e)&&e.length>1){const[,...x]=e,C=Me(y,x);_e(y,x,C)}const j=p?_e({},S,y):y,v=await(t==null?void 0:t(e,Nu({},n,j),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(ae.LoadingOutlined,{style:{marginInlineEnd:8}}):null,r||"保存"]},"save")}const PC=({recordKey:e,onDelete:t,preEditRowRef:n,preEditRowRefs:r,row:a,children:i,deletePopconfirmMessage:o})=>{const[l,u]=d.useState(!1),h=be(async()=>{var g,f;try{u(!0);const m=await(t==null?void 0:t(e,a));return u(!1),m===!1?!1:m}catch{return u(!1),null}finally{const m=(g=Ke(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(c.Popconfirm,{title:o||"确定要删除这条记录吗?",onConfirm:h,getPopupContainer:g=>g.parentElement||document.body,children:s.jsxs("a",{children:[l?s.jsx(ae.LoadingOutlined,{style:{marginInlineEnd:8}}):null,i||"删除"]})},"delete"):null},NC=e=>{const{recordKey:t,tableName:n,newLineConfig:r,editorType:a,onCancel:i,cancelEditable:o,row:l,cancelText:u,preEditRowRef:h,preEditRowRefs:g}=e,f=d.useContext(Nr),m=c.Form.useFormInstance();return s.jsx("a",{onClick:async p=>{var R,E,M,O;p.stopPropagation(),p.preventDefault();const S=a==="Map",y=(R=Ke(t))==null?void 0:R.toString(),j=to(n,t),v=(()=>{var D;const Y=(D=f==null?void 0:f.getFieldFormatValueObject)==null?void 0:D.call(f,j);return(Y!=null?Me(Y,j):null)??(m==null?void 0:m.getFieldValue(j))})(),x=S?_e({},j,v):v,C=y!=null?(E=g==null?void 0:g.current)==null?void 0:E.get(y):void 0,w=(()=>{var I,$,z;const Y=(I=r==null?void 0:r.options)==null?void 0:I.recordKey;if(Y==null||t==null)return!1;const H=($=Ke(Y))==null?void 0:$.toString(),D=(z=Ke(t))==null?void 0:z.toString();return!H||!D?!1:H===D})(),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&&w?await((M=e.onDelete)==null?void 0:M.call(e,t,l)):T!=null&&m.setFieldsValue(_e({},j,T)),y&&((O=g==null?void 0:g.current)==null||O.delete(y)),h&&(h.current=null),b},children:u||"取消"},"cancel")};function LC(e,t){const{recordKey:n,newLineConfig:r,saveText:a,deleteText:i}=t,o=d.forwardRef(DC),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(PC,{...t,row:e,children:i},"delete"+n):void 0,cancel:s.jsx(NC,{...t,row:e},"cancel"+n)}}function _C(e){const t=Fe(),n=d.useRef(null),r=d.useRef(new Map),[a,i]=d.useState(void 0),o=be(()=>{const N=new Map,P=(L,W)=>{L==null||L.forEach((q,Q)=>{const ee=W==null?Q.toString():`${W}_${Q}`,re=Ke(e.getRowKey(q,-1));if(re==null)return;N.set(ee,re),N.set(re.toString(),ee);const le=e.childrenColumnName&&(q==null?void 0:q[e.childrenColumnName]);le&&P(le,ee)})};return P(e.dataSource),N}),l=d.useMemo(()=>o(),[]),u=d.useRef(l),h=d.useRef(void 0);Pu(()=>{u.current=o()},[e.dataSource]),h.current=a;const g=e.type||"single",[f]=OC(e.dataSource,"children",e.getRowKey),[m,p]=Je([],e.editableKeys),S=d.useCallback(N=>{p(P=>{var W;const L=typeof N=="function"?N(P):N;return(W=e==null?void 0:e.onChange)==null||W.call(e,(L==null?void 0:L.filter(q=>q!==void 0))??[],(L==null?void 0:L.map(q=>f(q)).filter(q=>q!==void 0))??[]),L})},[e.onChange,f]),y=Tr(m),j=be((N,P)=>P.includes(N)),v=be(N=>{var ee,re;const P=(ee=e.getRowKey(N,N.index))==null?void 0:ee.toString(),L=(re=e.getRowKey(N,-1))==null?void 0:re.toString(),W=(m==null?void 0:m.map(le=>le==null?void 0:le.toString()))||[],q=(y==null?void 0:y.map(le=>le==null?void 0:le.toString()))||[],Q=j(L,q)||j(P,q);return{recordKey:L,isEditable:j(L,W)||j(P,W),preIsEditable:Q}}),x=be(()=>m&&m.length>0&&g==="single"&&e.onlyOneLineEditorAlertMessage!==!1?(Bl(e.onlyOneLineEditorAlertMessage||t.getMessage("editableTable.onlyOneLineEditor","只能同时编辑一行")),!1):!0),C=be(N=>{var P;return((P=e.dataSource)==null?void 0:P.find((L,W)=>e.getRowKey(L,W)===N))??null}),w=be((N,P)=>{var q;if(!x())return!1;if(!(m==null?void 0:m.some(Q=>Q===N||(Q==null?void 0:Q.toString())===(N==null?void 0:N.toString())))){const Q=m?[...m,N]:[N];S(Q)}n.current=P??C(N)??null;const W=(q=Ke(N))==null?void 0:q.toString();return W&&r.current.set(W,n.current),!0}),b=be(N=>{const P=Ke(N),L=P!=null?P.toString():null;if(L==null)return;const W=(m==null?void 0:m.filter(q=>(q==null?void 0:q.toString())!==L&&q!==P))??[];S(W)}),T=be(async(N,P)=>{var re,le,ce,ue;const L=Ke(N),W=L!=null?L.toString():null,q=W!=null?u.current.get(W):void 0,Q=m==null?void 0:m.some(he=>W==null?!1:(he==null?void 0:he.toString())===W||he===L);if(!Q&&q&&(P??!0)&&e.tableName)return await T(q,!1);if(e.onCancel&&Q){const he=Array.isArray(N)?N[0]:N,se=C(he),de=n.current,ge=(re=a==null?void 0:a.options)==null?void 0:re.recordKey,ne=ge!=null?Ke(ge):null,te=ne!=null?ne.toString():null,X=a!=null&&ge!=null&&(ge===N||te!=null&&W!=null&&te===W||(ge==null?void 0:ge.toString())===(N==null?void 0:N.toString())||String(ge)===String(N))?a:void 0;try{await e.onCancel(N,se||(X==null?void 0:X.defaultValue)||{},de||se||(X==null?void 0:X.defaultValue)||{},X)}catch(fe){console.error("onCancel error:",fe)}}if(a){const he=a.options.recordKey,se=he!=null?(le=Ke(he))==null?void 0:le.toString():null;(he===N||se!=null&&W!=null&&se===W||(he==null?void 0:he.toString())===(N==null?void 0:N.toString())||String(he)===String(N))&&i(void 0)}const ee=n.current;if(ee&&e.getRowKey(ee,-1)===N&&Q){try{const he=(ce=e.formProps)==null?void 0:ce.formRef,se=(he==null?void 0:he.current)||e.form;if(se)if(e.tableName){const de=to(e.tableName,N);se.setFieldsValue(_e({},de,ee))}else{const de=(ue=Ke(N))==null?void 0:ue.toString();if(de)try{se.resetFields([[de]]),se.setFieldsValue({[de]:void 0})}catch(ge){console.warn("Failed to clear form fields in cancelEditable:",ge)}}}catch(he){console.warn("Failed to reset form fields in cancelEditable:",he)}n.current=null}return b(N),!0}),F=Wi(async(...N)=>{var P;(P=e.onValuesChange)==null||P.call(e,...N)},64),R=be(N=>[e.tableName||"",N].flat(1).filter(P=>P||P===0)),E=be((N,P)=>{let L=N;return m==null||m.forEach(W=>{if((a==null?void 0:a.options.recordKey)===W)return;const q=W.toString(),Q=R(q),ee=Me(P,Q);ee&&(L=br({data:L,getRowKey:e.getRowKey,row:ee,key:q,childrenColumnName:e.childrenColumnName||"children"},"update"))}),L}),M=be((N,P,L)=>{var le;const W=Object.keys(N||{});if(W.length===0)return(a==null?void 0:a.defaultValue)||{};const q=((le=W.pop())==null?void 0:le.toString())||"";if(!q)return(a==null?void 0:a.defaultValue)||{};const Q=R(q),ee={...a==null?void 0:a.defaultValue,...Me(P,Q)};return u.current.has(Ke(q))&&L.find((ue,he)=>{var de;return((de=e.getRowKey(ue,he))==null?void 0:de.toString())===q})||ee}),O=be((N,P)=>{if(!e.onValuesChange)return;const L=E(e.dataSource,P),W=M(N,P,L);F.run(W,L)}),Y=d.useRef(new Map);d.useEffect(()=>{const N=new Set((m==null?void 0:m.map(P=>P==null?void 0:P.toString()))??[]);Y.current.forEach((P,L)=>{N.has(L==null?void 0:L.toString())||Y.current.delete(L)})},[m]);const H=be(N=>{const P=Ke(N);return Y.current.get(P)||Y.current.get(P.toString())}),D=be(async(N,P)=>{const L=Ke(N),W=L.toString(),q=u.current.get(W);if(!(m==null?void 0:m.some(re=>(re==null?void 0:re.toString())===W||re===L))&&q&&(P??!0)&&e.tableName)return await D(q,!1);const ee=H(N);return ee!=null&&ee.current?(await ee.current.save(),b(N),!0):!1}),I=be(N=>N!=null&&N.parentKey&&!u.current.has(Ke(N==null?void 0:N.parentKey).toString())?(console.warn("can't find record by key",N==null?void 0:N.parentKey),!1):h.current&&e.onlyAddOneLineAlertMessage!==!1?(Bl(e.onlyAddOneLineAlertMessage||t.getMessage("editableTable.onlyAddOneLine","只能新增一行")),!1):!!x()),$=be(N=>{if(N==null&&N!==0&&N!=="")throw AC(!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")}),z=be((N,P)=>{var re,le;if(!I(P))return!1;const L=e.getRowKey(N,-1);$(L);const W=(re=Ke(L))==null?void 0:re.toString();if(W&&r.current.set(W,null),!(m==null?void 0:m.some(ce=>ce===L||(ce==null?void 0:ce.toString())===(L==null?void 0:L.toString())))){const ce=m?[...m,L]:[L];S(ce)}const Q=typeof(P==null?void 0:P.parentKey)=="function"?P.parentKey():P==null?void 0:P.parentKey;if((P==null?void 0:P.newRecordType)==="dataSource"||e.tableName&&(P==null?void 0:P.newRecordType)!=="cache"){const ce={data:e.dataSource,getRowKey:e.getRowKey,row:{...N,map_row_parentKey:Q?(le=Ke(Q))==null?void 0:le.toString():void 0},key:L,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(br(ce,(P==null?void 0:P.position)==="top"?"top":"update"))}else i({defaultValue:N,options:{...P,parentKey:Q,recordKey:L}});return!0}),_=(e==null?void 0:e.saveText)||t.getMessage("editableTable.action.save","保存"),V=(e==null?void 0:e.deleteText)||t.getMessage("editableTable.action.delete","删除"),Z=(e==null?void 0:e.cancelText)||t.getMessage("editableTable.action.cancel","取消"),B=be(async(N,P,L,W)=>{var le,ce,ue;const q=await((le=e==null?void 0:e.onSave)==null?void 0:le.call(e,N,P,L,W));if(q===!1)return q;const{options:Q}=W||h.current||{};if(!(Q!=null&&Q.parentKey)&&(Q==null?void 0:Q.recordKey)===N)(Q==null?void 0:Q.position)==="top"?e.setDataSource([P,...e.dataSource]):e.setDataSource([...e.dataSource,P]);else{const he={data:e.dataSource,getRowKey:e.getRowKey,row:Q?{...P,map_row_parentKey:(ce=Ke((Q==null?void 0:Q.parentKey)??""))==null?void 0:ce.toString()}:P,key:N,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(br(he,(Q==null?void 0:Q.position)==="top"?"top":"update"))}await T(N);const re=(ue=Ke(N))==null?void 0:ue.toString();return re&&r.current.delete(re),q}),U=be(async(N,P)=>{var Q,ee;const L={data:e.dataSource,getRowKey:e.getRowKey,row:P,key:N,childrenColumnName:e.childrenColumnName||"children"},W=await((Q=e==null?void 0:e.onDelete)==null?void 0:Q.call(e,N,P));if(W===!1)return!1;await T(N,!1),e.setDataSource(br(L,"delete"));const q=(ee=Ke(N))==null?void 0:ee.toString();return q&&r.current.delete(q),W}),J=be(async(N,P,L,W)=>{var Q;return await((Q=e==null?void 0:e.onCancel)==null?void 0:Q.call(e,N,P,L,W))}),G=e.actionRender&&typeof e.actionRender=="function",K=G?e.actionRender:()=>{},A=be(K);return{editableKeys:m,setEditableRowKeys:S,isEditable:v,actionRender:N=>{const P=e.getRowKey(N,N.index),L={saveText:_,cancelText:Z,deleteText:V,addEditRecord:z,recordKey:P,cancelEditable:T,index:N.index,tableName:e.tableName,newLineConfig:a,onCancel:J,onDelete:U,onSave:B,editableKeys:m,setEditableRowKeys:S,preEditRowRef:n,preEditRowRefs:r,deletePopconfirmMessage:e.deletePopconfirmMessage||`${t.getMessage("deleteThisLine","删除此项")}?`},W=LC(N,L);return e.tableName?Y.current.set(u.current.get(Ke(P))||Ke(P),W.saveRef):Y.current.set(Ke(P),W.saveRef),G?A(N,L,{save:W.save,delete:W.delete,cancel:W.cancel}):[W.save,W.delete,W.cancel]},startEditable:w,cancelEditable:T,addEditRecord:z,saveEditable:D,newLineRecord:a,preEditableKeys:y,onValuesChange:O,getRealIndex:e.getRealIndex}}const zC=new xu("card-loading",{"0%":{backgroundPosition:"0 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),BC=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:zC,animationDuration:"1.4s",animationTimingFunction:"ease",animationIterationCount:"infinite"}}});function VC(e){return Be("ProCardLoading",t=>{const n={...t,componentCls:`.${e}`};return[BC(n)]})}const HC=e=>{const{style:t,prefix:n}=e,{wrapSSR:r}=VC(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`})})]})]}))},Vl=e=>({backgroundColor:e.controlItemBgActive,borderColor:e.controlOutline}),YC=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",...$a==null?void 0:$a(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":{...Vl(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":{...Vl(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,UC=(e,t)=>{const{componentCls:n}=t;return e===0?{[`${n}-col-0`]:{display:"none"}}:{[`${n}-col-${e}`]:{flexShrink:0,width:`${e/dd*100}%`}}},KC=e=>Array(dd+1).fill(1).map((t,n)=>UC(n,e));function WC(e){return Be("ProCard",t=>{const n={...t,componentCls:`.${e}`};return[YC(n),KC(n)]})}const{useBreakpoint:qC}=c.Grid,fd=d.forwardRef((e,t)=>{var Ge;const{className:n,rootClassName:r,style:a,styles:i,title:o,subTitle:l,extra:u,wrap:h=!1,layout:g,loading:f,gutter:m=0,tooltip:p,split:S,headerBordered:y=!1,variant:j,cover:v,classNames:x,boxShadow:C=!1,children:w,size:b,actions:T,ghost:F=!1,hoverable:R=!1,direction:E,collapsed:M,collapsible:O=!1,collapsibleIconRender:Y,colStyle:H,defaultCollapsed:D=!1,onCollapse:I,checked:$,onChecked:z,tabs:_,type:V,...Z}=e,B=j??"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},[K,A]=Je(D,M),k=be(Ce=>{I==null||I(Ce)}),N=d.useCallback(Ce=>{A(Re=>{const dt=typeof Ce=="function"?Ce(Re):Ce;return queueMicrotask(()=>{k(dt)}),dt})},[k]),P=["xxl","xl","lg","md","sm","xs"],L=_==null?void 0:_.items,W=Ce=>{const Re=[0,0];return(Array.isArray(Ce)?Ce:[Ce,0]).forEach((rt,lt)=>{if(typeof rt=="object")for(let Qe=0;Qe<P.length;Qe+=1){const st=P[Qe];if(G[st]&&rt[st]!==void 0){Re[lt]=rt[st];break}}else Re[lt]=rt||0}),Re},q=(Ce,Re)=>Ce?Re:{},Q=Ce=>{let Re=Ce;if(typeof Ce=="object")for(let rt=0;rt<P.length;rt+=1){const lt=P[rt];if(G!=null&&G[lt]&&(Ce==null?void 0:Ce[lt])!==void 0){Re=Ce[lt];break}}const dt=q(typeof Re=="string"&&/\d%|\dpx/i.test(Re),{width:Re,flexShrink:0});return{span:Re,colSpanStyle:dt}},ee=J("pro-card"),{wrapSSR:re,hashId:le}=WC(ee),[ce,ue]=W(m);let he=!1;const se=d.Children.toArray(w),de=se.map((Ce,Re)=>{var dt;if((dt=Ce==null?void 0:Ce.type)!=null&&dt.isProCard){he=!0;const{colSpan:rt}=Ce.props,{span:lt,colSpanStyle:Qe}=Q(rt),st=ie([`${ee}-col`],le,{[`${ee}-split-vertical`]:S==="vertical"&&Re!==se.length-1,[`${ee}-split-horizontal`]:S==="horizontal"&&Re!==se.length-1,[`${ee}-col-${lt}`]:typeof lt=="number"&<>=0&<<=24}),en=re(s.jsx("div",{style:{...Qe,...q(ce>0,{paddingInlineEnd:ce/2,paddingInlineStart:ce/2}),...q(ue>0,{paddingBlockStart:ue/2,paddingBlockEnd:ue/2}),...H},className:st,children:d.cloneElement(Ce)}));return d.cloneElement(en,{key:`pro-card-col-${(Ce==null?void 0:Ce.key)||Re}`})}return Ce}),ge=ie(`${ee}`,n,r,le,x==null?void 0:x.root,{[`${ee}-border`]:B==="outlined",[`${ee}-box-shadow`]:C,[`${ee}-contain-card`]:he,[`${ee}-loading`]:f,[`${ee}-split`]:S==="vertical"||S==="horizontal",[`${ee}-ghost`]:F,[`${ee}-hoverable`]:R,[`${ee}-size-${b}`]:b,[`${ee}-type-${V}`]:V,[`${ee}-collapse`]:K,[`${ee}-checked`]:$}),ne=ie(`${ee}-body`,le,x==null?void 0:x.body,{[`${ee}-body-center`]:g==="center",[`${ee}-body-direction-column`]:S==="horizontal"||E==="column",[`${ee}-body-wrap`]:h&&he}),te=(Ge=U.body)==null?void 0:Ge.padding,X=d.isValidElement(f)?f:s.jsx(HC,{prefix:ee,style:te===0||te==="0px"?{padding:24}:void 0}),fe=d.useCallback(()=>{O==="icon"&&N(Ce=>!Ce)},[O,N]),pe=O&&(Y?s.jsx("span",{role:"button",tabIndex:O==="icon"?0:void 0,className:ie(`${ee}-collapsible-icon`,le),onClick:O==="icon"?fe:void 0,onKeyDown:O==="icon"?Ce=>{(Ce.key==="Enter"||Ce.key===" ")&&(Ce.preventDefault(),fe())}:void 0,children:Y({collapsed:K})}):s.jsx(ae.RightOutlined,{onClick:fe,rotate:K?void 0:90,className:ie(`${ee}-collapsible-icon`,le)})),ve=ie(`${ee}-header`,le,x==null?void 0:x.header,{[`${ee}-header-border`]:y||V==="inner",[`${ee}-header-collapsible`]:pe}),Ee=ie(`${ee}-title`,le,x==null?void 0:x.title),Te=ie(`${ee}-extra`,le,x==null?void 0:x.extra),Ye={...U.root,...a};return re(s.jsxs("div",{className:ge,style:Ye,ref:t,onClick:Ce=>{var Re;z==null||z(Ce),(Re=Z==null?void 0:Z.onClick)==null||Re.call(Z,Ce)},...Le(Z,["prefixCls","colSpan"]),children:[(o||u||pe)&&s.jsxs("div",{className:ve,style:U.header,onClick:()=>{(O==="header"||O===!0)&&N(!K)},children:[s.jsxs("div",{className:Ee,style:U.title,children:[pe,s.jsx(Xn,{label:o,tooltip:p,subTitle:l})]}),u&&s.jsx("div",{className:Te,style:U.extra,onClick:Ce=>Ce.stopPropagation(),children:u})]}),v&&!K&&s.jsx("div",{className:ie(`${ee}-cover`,le,x==null?void 0:x.cover),style:U.cover,children:v}),_?s.jsx("div",{className:ie(`${ee}-tabs`,le),children:s.jsx(c.Tabs,{onChange:_.onChange,...Le(_,["cardProps"]),items:L,children:f?X:w})}):s.jsx("div",{className:ne,style:U.body,children:f?X:de}),T?s.jsx(tp,{actions:T,prefixCls:ee}):null]}))});function GC(e){return Be("ProCardDivider",()=>({}))}const ZC=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),r=`${t("pro-card")}-divider`,{wrapSSR:a,hashId:i}=GC(),{className:o,style:l={},orientation:u="vertical"}=e,h=ie(r,o,i,{[`${r}-${u}`]:u});return a(s.jsx("div",{className:h,style:l}))},JC=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=ZC;ta.Group=JC;var vs={exports:{}},XC=vs.exports,Hl;function QC(){return Hl||(Hl=1,(function(e,t){(function(n,r){e.exports=r()})(XC,(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 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 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 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 ew=QC();const md=Vt(ew);var Ts={exports:{}},tw=Ts.exports,Yl;function nw(){return Yl||(Yl=1,(function(e,t){(function(n,r){e.exports=r()})(tw,(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 u=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"):u.bind(this)(h,g)}}}))})(Ts)),Ts.exports}var rw=nw();const hd=Vt(rw);var Fs={exports:{}},sw=Fs.exports,Ul;function aw(){return Ul||(Ul=1,(function(e,t){(function(n,r){e.exports=r()})(sw,(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 j=f.name?f:f.$locale(),v=o(j[m]),x=o(j[p]),C=v||x.map((function(b){return b.slice(0,S)}));if(!y)return C;var w=j.weekStart;return C.map((function(b,T){return C[(T+(w||0))%7]}))},u=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,j){return y||j.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=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(m){return h(f,m)},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)}}}))})(Fs)),Fs.exports}var iw=aw();const gd=Vt(iw);var Rs={exports:{}},ow=Rs.exports,Kl;function lw(){return Kl||(Kl=1,(function(e,t){(function(n,r){e.exports=r()})(ow,(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")}}}))})(Rs)),Rs.exports}var cw=lw();const pd=Vt(cw);var $s={exports:{}},uw=$s.exports,Wl;function dw(){return Wl||(Wl=1,(function(e,t){(function(n,r){e.exports=r()})(uw,(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 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(u){return u===void 0&&(u=null),this.week(u)}}}))})($s)),$s.exports}var fw=dw();const no=Vt(fw),ql=(e,t)=>typeof t!="object"?e[t]||t:e[t==null?void 0:t.value]||t.label,mw=(e,t)=>{const{label:n,prefixCls:r,onChange:a,value:i,mode:o,defaultValue:l,labelVariant:u,size:h,showSearch:g,disabled:f,style:m,className:p,options:S,onSearch:y,allowClear:j,labelInValue:v,fieldNames:x,lightLabel:C,labelTrigger:w,optionFilterProp:b,optionLabelProp:T="",valueMaxLength:F=41,fetchDataOnSearch:R=!1,fetchData:E,variant:M="outlined",...O}=e,{placeholder:Y=n}=e,{label:H="label",value:D="value"}=x||{},{getPrefixCls:I}=d.useContext(c.ConfigProvider.ConfigContext),$=I("pro-field-select-light-select"),[z,_]=d.useState(!1),[V,Z]=d.useState(""),{wrapSSR:B,hashId:U}=Be("LightSelect",A=>({[`.${$}`]:{[`${A.antCls}-select`]:{position:"absolute",width:"153px",height:"28px",visibility:"hidden",opacity:0,"&-selector":{height:28}},[`&.${$}-searchable`]:{[`${A.antCls}-select`]:{width:"200px","&-selector":{height:28}}}}})),J=d.useMemo(()=>{const A={};return S==null||S.forEach(k=>{const N=k[T]||k[H],P=k[D];A[P]=N||P}),A},[H,S,D,T]),G=d.useMemo(()=>Reflect.has(O,"open")?O==null?void 0:O.open:z,[z,O]),K=Array.isArray(i)?i.map(A=>ql(J,A)):ql(J,i);return B(s.jsxs("div",{className:ie($,U,{[`${$}-searchable`]:g},`${$}-container-${O.placement||"bottomLeft"}`,p),style:m,onClick:A=>{var N,P,L;if(f)return;((L=(P=(N=C==null?void 0:C.current)==null?void 0:N.labelRef)==null?void 0:P.current)==null?void 0:L.contains(A.target))||_(!0)},children:[s.jsx(c.Select,{...O,allowClear:j,value:i,mode:o,labelInValue:v,size:h,disabled:f,variant:M,onChange:(A,k)=>{a==null||a(A,k),o!=="multiple"&&_(!1)},showSearch:g,onSearch:g?A=>{R&&E&&E(A),y==null||y(A)}:void 0,style:m,popupRender:A=>s.jsxs("div",{ref:t,children:[g&&s.jsx("div",{style:{margin:"4px 8px"},children:s.jsx(c.Input,{value:V,allowClear:!!j,onChange:k=>{Z(k.target.value),R&&E&&E(k.target.value),y==null||y(k.target.value)},onKeyDown:k=>{if(k.key==="Backspace"){k.stopPropagation();return}(k.key==="ArrowUp"||k.key==="ArrowDown")&&k.preventDefault()},style:{width:"100%"},prefix:s.jsx(ae.SearchOutlined,{})})}),A]}),open:G,onOpenChange:A=>{var k;A||Z(""),w||_(A),(k=O==null?void 0:O.onOpenChange)==null||k.call(O,A)},prefixCls:r,options:y||!V?S:S==null?void 0:S.filter(A=>{var k,N,P,L,W;return b?gn(A[b]).join("").toLowerCase().includes(V):((N=(k=String(A[H]))==null?void 0:k.toLowerCase())==null?void 0:N.includes(V==null?void 0:V.toLowerCase()))||((W=(L=(P=A[D])==null?void 0:P.toString())==null?void 0:L.toLowerCase())==null?void 0:W.includes(V==null?void 0:V.toLowerCase()))})}),s.jsx(Yt,{ellipsis:!0,label:n,placeholder:Y,disabled:f,variant:u,allowClear:!!j,value:K||(i==null?void 0:i.label)||i,onClear:()=>{a==null||a(void 0,void 0)},onClick:()=>{f||_(!z)},ref:C,valueMaxLength:F})]}))},hw=d.forwardRef(mw),gw=(e,t)=>{const{optionItemRender:n,mode:r,onSearch:a,onFocus:i,onChange:o,autoClearSearchValue:l=!0,searchOnFocus:u=!1,resetAfterSelect:h=!1,fetchDataOnSearch:g=!0,optionFilterProp:f="label",optionLabelProp:m="label",className:p,disabled:S,options:y,fetchData:j,resetData:v,prefixCls:x,onClear:C,searchValue:w,showSearch:b,fieldNames:T,defaultSearchValue:F,preserveOriginalLabel:R=!1,...E}=e,{label:M="label",value:O="value",options:Y="options"}=T||{},[H,D]=Je(F,w),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),z=$("pro-filed-search-select",x),_=ie(z,p,{[`${z}-disabled`]:S}),V=(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,K)=>{const A=J==null?void 0:J[K],k=A==null?void 0:A["data-item"],N=V(k,G);return{...k||{},...G,label:N||G.label}}):[],B=U=>U.map((J,G)=>{const{className:K,optionType:A,...k}=J,N=J[M]??J.text,P=J[O],L=J[Y]??[];return A==="optGroup"||J.options?{label:N,...k,data_title:N,title:N,key:P??`${N==null?void 0:N.toString()}-${G}-${Or()}`,children:B(L)}:{title:N,...k,data_title:N,value:P??G,key:P??`${N==null?void 0:N.toString()}-${G}-${Or()}`,"data-item":J,className:`${z}-option ${K||""}`.trim(),label:(n==null?void 0:n(J))||N}});return s.jsx(c.Select,{ref:I,className:_,allowClear:!0,autoClearSearchValue:l,disabled:S,mode:r,showSearch:b,searchValue:H,optionFilterProp:f,optionLabelProp:m,onClear:()=>{C==null||C(),j(void 0),b&&(a==null||a(""),D(""))},...E,filterOption:E.filterOption==!1?!1:(U,J)=>{var K,A;const G=H===""?"":U||H;return G?E.filterOption&&typeof E.filterOption=="function"?E.filterOption(G,{...J,label:J==null?void 0:J.data_title}):!!((K=J==null?void 0:J.data_title)!=null&&K.toString().toLowerCase().includes(G.toLowerCase())||(A=J==null?void 0:J[f])!=null&&A.toString().toLowerCase().includes(G.toLowerCase())):!0},onSearch:b?U=>{g&&j(U),a==null||a(U),D(U)}:void 0,onChange:(U,J,...G)=>{if(b&&l&&(j(void 0),a==null||a(""),D("")),!e.labelInValue){o==null||o(U,J,...G);return}if(r!=="multiple"&&!Array.isArray(J)){let k=J&&J["data-item"];if(!k&&U&&y){const N=U[O]??U.value,P=L=>{for(const W of L){if((W[O]??W.value)===N)return W;if(W[Y]||W.options){const Q=P(W[Y]||W.options||[]);if(Q)return Q}}return null};k=P(y)}if(!U||!k){const N=V(k,U),P=U&&{...U,label:N};o==null||o(P,J,...G)}else{const N=V(k,U);o==null||o({...U,...k,label:N},J,...G)}return}const K=Z(U,J);o==null||o(K,J,...G),h&&v()},onFocus:U=>{u&&(j(void 0),b&&(a==null||a(""),D(""))),i==null||i(U)},options:B(y||[])})},pw=d.forwardRef(gw),yw=({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}=Be("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 u=[];for(;l.length;){const h=o.exec(l);if(!h){u.push(l);break}const g=h.index,f=h[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 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=Xt(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},ir=e=>{var j,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=be(x=>yd(Xt(x)).map(({value:C,text:w,...b})=>({label:w,value:C,key:C,...b}))),u=ct(()=>{if(!n)return;const x=(n==null?void 0:n.options)||(n==null?void 0:n.treeData);if(!x)return;const{children:C,label:w,value:b}=n.fieldNames||{},T=(F,R)=>{if(!(F!=null&&F.length))return;const E=F.length;let M=0;for(;M<E;){const O=F[M++];(O[C]||O[w]||O[b])&&(O[R]=O[R==="children"?C:R==="label"?w:b],T(O[C],R))}};return C&&T(x,"children"),w&&T(x,"label"),b&&T(x,"value"),x},[n]),[h,g]=Je(()=>e.valueEnum?l(e.valueEnum):[],u);Wn(()=>{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=Ep([o.current,e.params,r],e.debounceTime??((j=e==null?void 0:e.fieldProps)==null?void 0:j.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,w;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(F=>Ci(F,r));return{...b,children:T,options:T}}return b});return((C=e.fieldProps)==null?void 0:C.filterOption)===!0||((w=e.fieldProps)==null?void 0:w.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)}]},xw=(e,t)=>{var O,Y;const{mode:n,valueEnum:r,render:a,formItemRender:i,request:o,fieldProps:l,light:u,proFieldKey:h,params:g,label:f,variant:m,id:p,lightLabel:S,labelTrigger:y,...j}=e,v=d.useRef(),x=Fe(),C=d.useRef(""),{fieldNames:w}=l;d.useEffect(()=>{C.current=l==null?void 0:l.searchValue},[l==null?void 0:l.searchValue]);const[b,T,F,R]=ir(e),{componentSize:E}=((Y=(O=c.ConfigProvider)==null?void 0:O.useConfig)==null?void 0:Y.call(O))||{componentSize:"middle"};d.useImperativeHandle(t,()=>({...v.current||{},fetchData:H=>F(H)}),[F]);const M=d.useMemo(()=>{if(n!=="read")return;const{label:H="label",value:D="value",options:I="options"}=w||{},$=new Map,z=_=>{if(!(_!=null&&_.length))return $;const V=_.length;let Z=0;for(;Z<V;){const B=_[Z++];$.set(B[D],B[H]),z(B[I])}return $};return z(T)},[w,n,T]);if(n==="read"){const H=s.jsx(s.Fragment,{children:kn(j.text,Xt(r||M))});return a?a(H,{mode:n,...l},H)??null:H}if(n==="edit"||n==="update"){const D=u?s.jsx(hw,{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:F,...l}):s.jsx(pw,{className:j.className,style:{minWidth:100,...j.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??"",F(I),I===void 0&&(C.current="")},resetData:R,optionItemRender:I=>typeof I.label=="string"&&C.current?s.jsx(yw,{label:I.label,words:[C.current]}):I.label,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),label:f,...l,options:T},"SearchSelect");return i?i(j.text,{mode:n,...l,options:T,loading:b},D)??null:D}return null},ss=d.forwardRef(xw),bw=({placeholder:e,formItemRender:t,mode:n,render:r,label:a,light:i,variant:o,...l},u)=>{var C;const{getPrefixCls:h}=d.useContext(c.ConfigProvider.ConfigContext),g=h("pro-field-cascader"),[f,m,p]=ir(l),S=Fe(),y=d.useRef(),[j,v]=d.useState(!1);d.useImperativeHandle(u,()=>({...y.current||{},fetchData:w=>p(w)}),[p]);const x=d.useMemo(()=>{var E;if(n!=="read")return;const{value:w="value",label:b="label",children:T="children"}=((E=l.fieldProps)==null?void 0:E.fieldNames)||{},F=new Map,R=M=>{if(!(M!=null&&M.length))return F;const O=M.length;let Y=0;for(;Y<O;){const H=M[Y++];F.set(H[w],H[b]),R(H[T])}return F};return R(m)},[n,m,(C=l.fieldProps)==null?void 0:C.fieldNames]);if(n==="read"){const w=s.jsx(s.Fragment,{children:kn(l.text,Xt(l.valueEnum||x))});return r?r(l.text,{mode:n,...l.fieldProps},w)??null:w}if(n==="edit"){const w=l.fieldProps||{};let b=s.jsx(c.Cascader,{ref:y,open:j,suffixIcon:f?s.jsx(ae.LoadingOutlined,{}):void 0,placeholder:e||S.getMessage("tableForm.selectPlaceholder","请选择"),allowClear:(w==null?void 0:w.allowClear)!==!1,...w,onOpenChange:T=>{var F;(F=w==null?void 0:w.onOpenChange)==null||F.call(w,T),v(T)},className:ie(w==null?void 0:w.className,g),options:m});if(t&&(b=t(l.text,{mode:n,...w,options:m,loading:f},b)??null),i){const{disabled:T,value:F}=w,R=!!F&&(F==null?void 0:F.length)!==0;return s.jsx(Yt,{label:a,disabled:T,variant:o,value:R||j?b:null,style:R?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:R||j?!1:void 0,onClick:()=>{var E;v(!0),(E=w==null?void 0:w.onOpenChange)==null||E.call(w,!0)}})}return b}return null},Gl=d.forwardRef(bw),Sw=({layout:e="horizontal",formItemRender:t,mode:n,render:r,...a},i)=>{var j,v,x,C,w;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-checkbox"),u=(v=(j=c.Form.Item)==null?void 0:j.useStatus)==null?void 0:v.call(j),[h,g,f]=ir(a),{wrapSSR:m,hashId:p}=Be("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]),h)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const b=g!=null&&g.length?g==null?void 0:g.reduce((F,R)=>({...F,[R.value??""]:R.label}),{}):void 0,T=kn(a.text,Xt(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,...F}=a.fieldProps||{},R=m(s.jsx(c.Checkbox.Group,{...F,variant:T,className:ie((w=a.fieldProps)==null?void 0:w.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:h},R)??null:R}return null},Zl=d.forwardRef(Sw),Cw=(e,t)=>{if(typeof e!="string")return e;try{if(t==="json")return JSON.stringify(JSON.parse(e),null,2)}catch{}return e},ww=({text:e,mode:t,render:n,language:r="text",formItemRender:a,fieldProps:i},o)=>{const l=Cw(e,r),{token:u}=mn.useToken();if(t==="read"){const h=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},h):h}if(t==="edit"||t==="update"){i.value=l;const h=s.jsx(c.Input.TextArea,{rows:5,...i,ref:o});return a?a(l,{mode:t,...i,ref:o},h)??null:h}return null},as=d.forwardRef(ww),jw={label:"Recommended",colors:["#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB","#722ED1","#EB2F96","#F5222D4D","#FA8C164D","#FADB144D","#8BBB114D","#52C41A4D","#13A8A84D","#1677FF4D","#2F54EB4D","#722ED14D","#EB2F964D"]},vw=({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:ie({[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},h=s.jsx(c.ColorPicker,{ref:i,presets:[jw],...a,style:u,className:ie({[l]:!0})});return r?r(e,{mode:t,...a,style:u},h):h}return null},Jl=d.forwardRef(vw);Se.extend(no);const Tw=(e,t)=>e?typeof t=="function"?t(Se(e)):Se(e).format((Array.isArray(t)?t[0]:t)||"YYYY-MM-DD"):"-",Fw=({text:e,mode:t,format:n="YYYY-MM-DD",label:r,light:a,render:i,formItemRender:o,showTime:l,fieldProps:u,picker:h,lightLabel:g,variant:f},m)=>{const p=Fe(),[S,y]=d.useState(!1);if(t==="read"){const j=Tw(e,u.format||n);return i?i(e,{mode:t,...u},s.jsx(s.Fragment,{children:j})):s.jsx(s.Fragment,{children:j})}if(t==="edit"||t==="update"){let j;const{disabled:v,value:x,placeholder:C=p.getMessage("tableForm.selectPlaceholder","请选择")}=u,w=sr(x);return a?j=s.jsx(Yt,{label:r,onClick:()=>{var b;(b=u==null?void 0:u.onOpenChange)==null||b.call(u,!0),y(!0)},style:w?{paddingInlineEnd:0}:void 0,disabled:v,value:w||S?s.jsx(c.DatePicker,{picker:h,showTime:l,format:n,ref:m,...u,value:w,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:w||S?!1:void 0,variant:f,ref:g}):j=s.jsx(c.DatePicker,{picker:h,showTime:l,format:n,placeholder:C,variant:f,ref:m,...u,value:w}),o?o(e,{mode:t,...u},j):j}return null},jt=d.forwardRef(Fw);function Rw(e){return $t(e)||e===""||(e==null?void 0:e.trim())===""}const $w=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i},o)=>{var g;const l=Fe(),u=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"&&!$t(m)&&!$t(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(c.InputNumber,{ref:o,min:0,placeholder:u,...Le(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,j,v;const p=m.target.value;if(Rw(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(),(j=i==null?void 0:i.onChange)==null||j.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($w),Ew=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i,separator:o="~",separatorWidth:l=30},u)=>{const{value:h,defaultValue:g,onChange:f,id:m}=i,p=Fe(),{token:S}=mn.useToken(),[y,j]=Je(()=>g,h),v=d.useCallback(C=>{j(w=>{const b=typeof C=="function"?C(w):C;return f==null||f(b),b})},[f]),x=d.useRef(y);if(t==="read"){const C=b=>{var F;const T=new Intl.NumberFormat(void 0,{minimumSignificantDigits:2,...(i==null?void 0:i.intlProps)||{}}).format(Number(b));return((F=i==null?void 0:i.formatter)==null?void 0:F.call(i,T))||T},w=s.jsxs("span",{ref:u,children:[C(e[0])," ",o," ",C(e[1])]});return n?n(e,{mode:t,...i},w):w}if(t==="edit"||t==="update"){const C=()=>{if(Array.isArray(x.current)){const[R,E]=x.current;if(typeof R=="number"&&typeof E=="number"&&R>E){v([E,R]);return}R===void 0&&E===void 0&&v(void 0)}},w=(R,E)=>{const M=[...y||[]];M[R]=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=R=>Array.isArray(b)?b[R]:b,F=s.jsxs(c.Space.Compact,{block:!0,onBlur:C,children:[s.jsx(c.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:R=>w(0,R)}),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: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:R=>w(1,R)})]});return a?a(e,{mode:t,...i},F):F}return null},Xl=d.forwardRef(Ew);var Es={exports:{}},Iw=Es.exports,Ql;function Mw(){return Ql||(Ql=1,(function(e,t){(function(n,r){e.exports=r()})(Iw,(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,j,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,w=0;w<C;w+=1){var b=x[w];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(j=S>0,T<=b.r||!b.r){T<=1&&w>0&&(b=x[w-1]);var F=v[b.l];p&&(T=p(""+T)),y=typeof F=="string"?F.replace("%d",T):F(T,g,b.l,j);break}}if(g)return y;var R=j?v.future:v.past;return typeof R=="function"?R(y):R.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 u=function(h){return h.$u?a.utc():a()};i.toNow=function(h){return this.to(u(this),h)},i.fromNow=function(h){return this.from(u(this),h)}}}))})(Es)),Es.exports}var Ow=Mw();const Aw=Vt(Ow);Se.extend(Aw);const kw=({text:e,mode:t,variant:n,render:r,formItemRender:a,format:i,fieldProps:o},l)=>{const u=Fe();if(t==="read"){const h=s.jsx(c.Tooltip,{title:Se(e).format((o==null?void 0:o.format)||i||"YYYY-MM-DD HH:mm:ss"),children:Se(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=u.getMessage("tableForm.selectPlaceholder","请选择"),g=sr(o.value),f=s.jsx(c.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},ec=d.forwardRef(kw),tc=d.forwardRef(({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i,width:o},l)=>{const u=Fe(),h=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:h,...a});return r?r(e,{mode:t,...a},g):g}return null}),Dw=({border:e=!1,children:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-index-column"),{wrapSSR:i,hashId:o}=Be("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:ie(a,o,{[`${a}-border`]:e,"top-three":t>3}),children:t}))},is=d.forwardRef(Dw),xd=new Intl.NumberFormat("zh-Hans-CN",{currency:"CNY",style:"currency"}),Pw={style:"currency",currency:"USD"},Nw={style:"currency",currency:"RUB"},Lw={style:"currency",currency:"RSD"},_w={style:"currency",currency:"MYR"},zw={style:"currency",currency:"BRL"},Bw={default:xd,"zh-Hans-CN":{currency:"CNY",style:"currency"},"en-US":Pw,"ru-RU":Nw,"ms-MY":_w,"sr-RS":Lw,"pt-BR":zw},nc=(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",{...Bw[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})(u),[f]=u||"";return["+","-"].includes(f)?`${a||""}${f}${g}`:`${a||""}${g}`}catch{return i}},ka=2,Vw=d.forwardRef(({contentRender:e,numberFormatOptions:t,numberPopoverRender:n,open:r,onOpenChange:a,...i},o)=>{const[l,u]=Je(()=>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=>{u(j=>{var x;const v=typeof y=="function"?y(j):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:h,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:m})}):s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:m})}),Hw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,proFieldKey:i,valueEnum:o,placeholder:l,locale:u,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)??ka;let y=Fe();u&&In[u]&&(y=In[u]);const j=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 w=new RegExp(`\\B(?=(\\d{${3+Math.max(S-ka,0)}})+(?!\\d))`,"g"),[b,T]=String(C).split("."),F=b.replace(w,",");let R="";return T&&S>0&&(R=`.${T.slice(0,S===void 0?ka:S)}`),`${F}${R}`},[S]);if(t==="read"){const C=s.jsx("span",{ref:p,children:nc(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(Vw,{contentRender:w=>{if(f===!1||!w.value)return null;const b=nc(v||u||!1,`${x(w.value)}`,S,{...g,notation:"compact"},v);return typeof f=="function"?f==null?void 0:f(w,b):b},ref:p,precision:S,formatter:w=>w&&v?`${v} ${x(w)}`:(w==null?void 0:w.toString())||w,parser:w=>v&&w?w.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),""):w,placeholder:j,...Le(a,["numberFormatOptions","precision","numberPopoverRender","customSymbol","moneySymbol","visible","open"]),onBlur:a.onBlur?w=>{var T;let b=w.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},rc=d.forwardRef(Hw),sc=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)}),Yw=({text:e,mode:t,render:n,fieldProps:r},a)=>{const{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-field-option"),{token:l}=mn.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:sc(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:sc(e)})},ac=d.forwardRef(Yw),Uw=(e,t)=>{const n=Fe(),{text:r,mode:a,render:i,formItemRender:o,fieldProps:l,...u}=Le(e,["proFieldKey"]),[h,g]=Je(()=>u.open||!1,u.open),f=d.useCallback(m=>{g(p=>{var y;const S=typeof m=="function"?m(p):m;return(y=u.onOpenChange)==null||y.call(u,S),S})},[u.onOpenChange]);if(a==="read"){let m=s.jsx(s.Fragment,{children:"-"});return r&&(m=s.jsxs(c.Space,{children:[s.jsx("span",{ref:t,children:h?r:"********"}),s.jsx("a",{onClick:()=>f(!h),children:h?s.jsx(ae.EyeOutlined,{}):s.jsx(ae.EyeInvisibleOutlined,{})})]})),i?i(r,{mode:a,...l},m):m}if(a==="edit"||a==="update"){const m=s.jsx(c.Input.Password,{placeholder:n.getMessage("tableForm.inputPlaceholder","请输入"),ref:t,...l});return o?o(r,{mode:a,...l},m):m}return null},qn=d.forwardRef(Uw);function Kw(e){return e===0?null:e>0?"+":"-"}function Ww(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 Bs(e){return typeof e=="symbol"||e instanceof Symbol?NaN:Number(e)}const Gw=({text:e,prefix:t,precision:n,suffix:r="%",mode:a,showColor:i=!1,render:o,formItemRender:l,fieldProps:u,placeholder:h,showSymbol:g},f)=>{const m=Fe(),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 j=i?{color:Ww(S)}:{},v=s.jsxs("span",{style:j,ref:f,children:[t&&s.jsx("span",{children:t}),y&&s.jsxs(d.Fragment,{children:[Kw(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 j=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},j):j}return null},ic=d.forwardRef(Gw);function Zw(e){return e===100?"success":e<0?"exception":e<100?"active":"normal"}const Jw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Fe(),u=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(c.Progress,{ref:o,size:"small",style:{minWidth:100,maxWidth:320},percent:h,steps:a==null?void 0:a.steps,status:Zw(h),...a});return n?n(h,{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},oc=d.forwardRef(Jw),Xw=({radioType:e,formItemRender:t,mode:n,render:r,...a},i)=>{var y,j,v;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-radio"),[u,h,g]=ir(a),f=d.useRef(),m=(j=(y=c.Form.Item)==null?void 0:y.useStatus)==null?void 0:j.call(y);d.useImperativeHandle(i,()=>({...f.current||{},fetchData:x=>g(x)}),[g]);const{wrapSSR:p,hashId:S}=Be("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=h!=null&&h.length?h==null?void 0:h.reduce((w,b)=>({...w,[b.value??""]:b.label}),{}):void 0,C=s.jsx(s.Fragment,{children:kn(a.text,Xt(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:ie((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:u},x)??null:x}return null},os=d.forwardRef(Xw),Qw=({text:e,mode:t,light:n,label:r,format:a="YYYY-MM-DD",render:i,picker:o,formItemRender:l,showTime:u,lightLabel:h,variant:g,fieldProps:f},m)=>{const p=Fe(),[S,y]=Array.isArray(e)?e:[],[j,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?Se(S).format(x(Se(S))):"",w=y?Se(y).format(x(Se(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:w||"-"})]});return i?i(e,{mode:t,...f},s.jsx("span",{children:b})):b}if(t==="edit"||t==="update"){const b=sr(f.value);let T;const F=R=>{var E;(E=f==null?void 0:f.onChange)==null||E.call(f,R),R||v(!1)};return n?T=s.jsx(Yt,{label:r,onClick:()=>{var R;(R=f==null?void 0:f.onOpenChange)==null||R.call(f,!0),v(!0)},style:b?{paddingInlineEnd:0}:void 0,disabled:f.disabled,value:b||j?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:R=>{var E;b&&v(R),(E=f==null?void 0:f.onOpenChange)==null||E.call(f,R)},onChange:F}):null,variant:g,allowClear:!1,ref:h,downIcon:b||j?!1:void 0}):T=s.jsx(c.DatePicker.RangePicker,{ref:m,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},vt=d.forwardRef(Qw),ej=({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},lc=d.forwardRef(ej);function tj(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 nj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Fe(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const h=tj(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(c.InputNumber,{ref:o,min:0,style:{width:"100%"},placeholder:u,...a});return r?r(e,{mode:t,...a},h):h}return null},cc=d.forwardRef(nj),rj=(e,t)=>{const{mode:n,render:r,formItemRender:a,fieldProps:i,emptyText:o="-",...l}=e,u=d.useRef(),[h,g,f]=ir(e);if(d.useImperativeHandle(t,()=>({...u.current||{},fetchData:m=>f(m)}),[f]),h)return s.jsx(c.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:kn(l.text,Xt(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(c.Segmented,{ref:u,...Le(i||{},["allowClear"]),options:g});return a?a(l.text,{mode:n,...i,options:g,loading:h},m):m}return null},uc=d.forwardRef(rj),sj=({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},dc=d.forwardRef(sj),aj=({text:e,mode:t,render:n,light:r,label:a,formItemRender:i,fieldProps:o,variant:l},u)=>{const h=Fe(),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(c.Switch,{ref:u,size:r?"small":void 0,...Le(o,["value"]),checked:(o==null?void 0:o.checked)??(o==null?void 0:o.value)});if(r){const{disabled:p}=o;return s.jsx(Yt,{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},fc=d.forwardRef(aj),ij=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,emptyText:i="-"},o)=>{const{autoFocus:l,prefix:u="",suffix:h=""}=a||{},g=Fe(),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:[u,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(c.Input,{ref:f,placeholder:m,allowClear:!0,...a});return r?r(e,{mode:t,...a},p):p}return null},wi=d.forwardRef(ij),oj=({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}=Be("TextArea",()=>({[`.${i}`]:{display:"inline-block",lineHeight:"1.5715",maxWidth:"100%",whiteSpace:"pre-wrap"}}));return o(s.jsx("span",{ref:n,className:ie(l,a,i),...Le(t,["autoSize","classNames","styles"]),children:e??"-"}))},lj=d.forwardRef(oj),cj=(e,t)=>{const{text:n,mode:r,render:a,formItemRender:i,fieldProps:o}=e,l=Fe();if(r==="read"){const u=s.jsx(lj,{...e,ref:t});return a?a(n,{mode:r,...Le(o,["showCount"])},u):u}if(r==="edit"||r==="update"){const u=s.jsx(c.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},u):u}return null},mc=d.forwardRef(cj),uj=({text:e,mode:t,light:n,label:r,format:a="HH:mm:ss",render:i,formItemRender:o,fieldProps:l,lightLabel:u,variant:h},g)=>{const[f,m]=d.useState(!1),p=Fe(),S=(l==null?void 0:l.format)||a,y=Se.isDayjs(e)||typeof e=="number";if(t==="read"){const j=s.jsx("span",{ref:g,children:e?Se(e,y?void 0:S).format(S):"-"});return i?i(e,{mode:t,...l},s.jsx("span",{children:j})):j}if(t==="edit"||t==="update"){let j;const{disabled:v,value:x}=l,C=sr(x,S);return n?j=s.jsx(Yt,{onClick:()=>{var w;(w=l==null?void 0:l.onOpenChange)==null||w.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(c.TimePicker,{variant:h??(l==null?void 0:l.variant),format:a,ref:g,...l,placeholder:l.placeholder??p.getMessage("tableForm.selectPlaceholder","请选择"),value:C,onOpenChange:w=>{var b;m(w),(b=l==null?void 0:l.onOpenChange)==null||b.call(l,w)},open:f}):null,downIcon:C||f?!1:void 0,allowClear:!1,ref:u}):j=s.jsx(c.DatePicker.TimePicker,{ref:g,format:a,...l,value:C}),o?o(e,{mode:t,...l},j):j}return null},dj=({text:e,light:t,label:n,mode:r,lightLabel:a,format:i="HH:mm:ss",render:o,formItemRender:l,fieldProps:u,variant:h},g)=>{const f=Fe(),[m,p]=d.useState(!1),S=(u==null?void 0:u.format)||i,[y,j]=Array.isArray(e)?e:[],v=Se.isDayjs(y)||typeof y=="number",x=Se.isDayjs(j)||typeof j=="number",C=y?Se(y,v?void 0:S).format(S):"",w=j?Se(j,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:w||"-"})]});return o?o(e,{mode:r,...u},s.jsx("span",{children:b})):b}if(r==="edit"||r==="update"){const b=sr(u.value,S);let T;if(t){const{disabled:F,placeholder:R=[f.getMessage("tableForm.selectPlaceholder","请选择"),f.getMessage("tableForm.selectPlaceholder","请选择")]}=u;T=s.jsx(Yt,{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:F,variant:h,placeholder:R,value:b||m?s.jsx(c.TimePicker.RangePicker,{variant:h??(u==null?void 0:u.variant),format:i,ref:g,...u,placeholder:R,value:b,onOpenChange:E=>{var M;p(E),(M=u==null?void 0:u.onOpenChange)==null||M.call(u,E)},open:m}):null,downIcon:b||m?!1:void 0,allowClear:!1,ref:a})}else T=s.jsx(c.TimePicker.RangePicker,{ref:g,format:i,variant:h,...u,value:b});return l?l(e,{mode:r,...u},T):T}return null},hc=d.forwardRef(dj),gc=d.forwardRef(uj),fj=({formItemRender:e,mode:t,light:n,label:r,render:a,variant:i,...o},l)=>{var Z,B;const{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),h=u("pro-field-tree-select"),g=d.useRef(null),[f,m]=d.useState(!1),{onClear:p,onChange:S,onBlur:y,showSearch:j,fetchDataOnSearch:v,onSearch:x,autoClearSearchValue:C,searchValue:w,...b}=Le(o.fieldProps,["treeData"]),T=typeof j=="object"?j:{},F=(T==null?void 0:T.onSearch)!==void 0?T.onSearch:x,R=(T==null?void 0:T.autoClearSearchValue)!==void 0?T.autoClearSearchValue:C,E=(T==null?void 0:T.searchValue)!==void 0?T.searchValue:w,M=i??(b==null?void 0:b.variant),O=Fe(),[Y,H,D]=ir({...o,defaultKeyWords:E}),[I,$]=Je(void 0,E),z=d.useCallback(U=>{$(J=>{const G=typeof U=="function"?U(J):U;return F==null||F(G),G})},[F]);d.useImperativeHandle(l,()=>({...g.current||{},fetchData:U=>D(U)}));const _=d.useMemo(()=>{if(t!=="read")return;const{value:U="value",label:J="label",children:G="children"}=(b==null?void 0:b.fieldNames)||{},K=new Map,A=k=>{if(!(k!=null&&k.length))return K;const N=k.length;let P=0;for(;P<N;){const L=k[P++];K.set(L[U],L[J]),A(L[G])}return K};return A(H)},[b==null?void 0:b.fieldNames,t,H]),V=(U,J,G)=>{j&&R&&(D(void 0),z(void 0)),S==null||S(U,J,G)};if(t==="read"){const U=s.jsx(s.Fragment,{children:kn(o.text,Xt(o.valueEnum||_))});return a?a(o.text,{mode:t,...b,treeData:H},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:Y,children:s.jsx(c.TreeSelect,{open:f,onOpenChange:G=>{var K;(K=b==null?void 0:b.onOpenChange)==null||K.call(b,G),m(G)},ref:g,popupMatchSelectWidth:!n,placeholder:O.getMessage("tableForm.selectPlaceholder","请选择"),tagRender:n?G=>{var A;if(U<2)return s.jsx(s.Fragment,{children:G.label});const K=(A=b==null?void 0:b.value)==null?void 0:A.findIndex(k=>k===G.value||k.value===G.value);return s.jsxs(s.Fragment,{children:[G.label," ",K<U-1?",":""]})}:void 0,...b,treeData:H,showSearch:j&&{...T,searchValue:I,autoClearSearchValue:R,onSearch:G=>{v&&(o!=null&&o.request)&&D(G),z(G)}},style:{minWidth:60,...b.style},allowClear:b.allowClear!==!1,onClear:()=>{p==null||p(),D(void 0),j&&z(void 0)},onChange:V,onBlur:G=>{z(void 0),D(void 0),y==null||y(G)},className:ie(b==null?void 0:b.className,h)})});if(e&&(J=e(o.text,{mode:t,...b,options:H,loading:Y},J)??null),n){const{disabled:G,placeholder:K}=b,A=!!b.value&&((B=b.value)==null?void 0:B.length)!==0;return s.jsx(Yt,{label:r,disabled:G,placeholder:K,onClick:()=>{var k;m(!0),(k=b==null?void 0:b.onOpenChange)==null||k.call(b,!0)},variant:M,value:A||f?J:null,style:A?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:!1})}return J}return null},pc=d.forwardRef(fj);function ke(e){const[t,n]=d.useState(!1),r=d.useRef(null),a=d.useCallback(l=>{var g,f,m,p,S,y;const u=(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 u&&!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})}Se.extend(gd);Se.extend(md);Se.extend(hd);Se.extend(no);Se.extend(pd);const bd=(e,t,n,r)=>{var l,u,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?(u=n.render)==null?void 0:u.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})},mj=({text:e,valueType:t="text",mode:n="read",onChange:r,formItemRender:a,value:i,readonly:o,fieldProps:l,...u},h)=>{const g=d.useContext(Bt),f=be((...S)=>{var y;(y=l==null?void 0:l.onChange)==null||y.call(l,...S),r==null||r(...S)}),m=ct(()=>(i!==void 0||l)&&{value:i,...it(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",it({ref:h,...u,mode:o?"read":n,formItemRender:a?(S,y,j)=>{const{placeholder:v,...x}=y,C=a(S,x,j);return d.isValidElement(C)?d.cloneElement(C,{...m,...C.props||{}}):C}:void 0,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(m==null?void 0:m.placeholder),fieldProps:It(it({...m,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(m==null?void 0:m.placeholder)}))}),g.valueTypeMap||{});return s.jsx(d.Fragment,{children:p})},hj=d.forwardRef(mj);Se.extend(gd);Se.extend(md);Se.extend(hd);Se.extend(no);Se.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(oc,{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(oc,{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(rc,{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(rc,{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(ic,{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(ic,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},image:{render:(e,t)=>s.jsx(tc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(tc,{...t,text:e})},date:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-MM-DD",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-MM-DD",...t,text:e})})},dateWeek:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-wo",picker:"week",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-wo",picker:"week",...t,text:e})})},dateWeekRange:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})})},dateMonthRange:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})})},dateQuarterRange:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})})},dateYearRange:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})})},dateMonth:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-MM",picker:"month",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-MM",picker:"month",...t,text:e})})},dateQuarter:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})})},dateYear:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY",picker:"year",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY",picker:"year",...t,text:e})})},dateRange:{render:(e,t)=>s.jsx(vt,{format:"YYYY-MM-DD",...t,text:e}),formItemRender:(e,t)=>s.jsx(vt,{format:"YYYY-MM-DD",...t,text:e})},dateTime:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(jt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},dateTimeRange:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(vt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},time:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(gc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(gc,{format:"HH:mm:ss",...t,text:e})})},timeRange:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(hc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(hc,{format:"HH:mm:ss",...t,text:e})})},fromNow:{render:(e,t)=>s.jsx(ec,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ec,{...t,text:e})},index:{render:e=>s.jsx(is,{children:e+1}),formItemRender:e=>s.jsx(is,{children:e+1})},indexBorder:{render:e=>s.jsx(is,{border:!0,children:e+1}),formItemRender:e=>s.jsx(is,{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(as,{...t,text:e}),formItemRender:(e,t)=>s.jsx(as,{...t,text:e})},jsonCode:{render:(e,t)=>s.jsx(as,{language:"json",...t,text:e}),formItemRender:(e,t)=>s.jsx(as,{language:"json",...t,text:e})},textarea:{render:(e,t)=>s.jsx(mc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(mc,{...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(Xl,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Xl,{...t,text:e})},second:{render:(e,t)=>s.jsx(cc,{...t,text:e,placeholder:t.placeholder}),formItemRender:(e,t)=>s.jsx(cc,{...t,text:e,placeholder:t.placeholder})},select:{render:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(ss,{...t,text:e})}),formItemRender:(e,t)=>s.jsx(ke,{isLight:t.light,children:s.jsx(ss,{...t,text:e})})},text:{render:(e,t)=>"valueEnum"in t?s.jsx(ke,{isLight:t.light,children:s.jsx(ss,{...t,text:e})}):s.jsx(wi,{...t,text:e}),formItemRender:(e,t)=>"valueEnum"in t?s.jsx(ke,{isLight:t.light,children:s.jsx(ss,{...t,text:e})}):s.jsx(wi,{...t,text:e})},checkbox:{render:(e,t)=>s.jsx(Zl,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Zl,{...t,text:e})},radio:{render:(e,t)=>s.jsx(os,{...t,text:e}),formItemRender:(e,t)=>s.jsx(os,{...t,text:e})},radioButton:{render:(e,t)=>s.jsx(os,{radioType:"button",...t,text:e}),formItemRender:(e,t)=>s.jsx(os,{radioType:"button",...t,text:e})},rate:{render:(e,t)=>s.jsx(lc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(lc,{...t,text:e})},slider:{render:(e,t)=>s.jsx(dc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(dc,{...t,text:e})},switch:{render:(e,t)=>s.jsx(fc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(fc,{...t,text:e})},option:{render:(e,t)=>s.jsx(ac,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ac,{...t,text:e})},password:{render:(e,t)=>s.jsx(qn,{...t,text:e}),formItemRender:(e,t)=>s.jsx(qn,{...t,text:e})},cascader:{render:(e,t)=>{const n=It(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(Gl,{...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(Gl,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})}},treeSelect:{render:(e,t)=>s.jsx(pc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(pc,{...t,text:e})},color:{render:(e,t)=>s.jsx(Jl,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Jl,{...t,text:e})},segmented:{render:(e,t)=>s.jsx(uc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(uc,{...t,text:e})}},ro=d.createContext({grid:!1,colProps:void 0,rowProps:void 0}),gj=({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]),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(c.Col,{...u,children:h}):a?s.jsx(a,{children:h}):h}}),or=e=>{const t=d.useMemo(()=>typeof e=="object"?e:{grid:e},[e]),{grid:n,colProps:r}=d.useContext(ro);return d.useMemo(()=>gj({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",Ne=()=>{He(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},An=ye.createContext({getFieldValue:Ne,getFieldsValue:Ne,getFieldError:Ne,getFieldWarning:Ne,getFieldsError:Ne,isFieldsTouched:Ne,isFieldTouched:Ne,isFieldValidating:Ne,isFieldsValidating:Ne,resetFields:Ne,setFields:Ne,setFieldValue:Ne,setFieldsValue:Ne,validateFields:Ne,submit:Ne,getInternalHooks:()=>(Ne(),{dispatch:Ne,initEntityValue:Ne,registerField:Ne,useSubscribe:Ne,setInitialValues:Ne,destroyForm:Ne,setCallbacks:Ne,registerWatch:Ne,getFields:Ne,setValidateMessages:Ne,setPreserve:Ne,getInitialValue:Ne})}),Vs=ye.createContext(null);function ji(e){return e==null?[]:Array.isArray(e)?e:[e]}function pj(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(),yj=/%[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(yj,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 xj(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function nt(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||xj(t)&&typeof e=="string"&&!e)}function bj(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 yc(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 Sj(e){const t=[];return Object.keys(e).forEach(n=>{t.push(...e[n]||[])}),t}class xc extends Error{constructor(n,r){super("Async Validation Error");oe(this,"errors");oe(this,"fields");this.errors=n,this.fields=r}}function Cj(e,t,n,r,a){if(t.first){const f=new Promise((m,p)=>{const S=j=>(r(j),j.length?p(new xc(j,Ti(j))):m(a)),y=Sj(e);yc(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 u=0;const h=[],g=new Promise((f,m)=>{const p=S=>{if(h.push.apply(h,S),u++,u===l)return r(h),h.length?m(new xc(h,Ti(h))):f(a)};o.length||(r(h),f(a)),o.forEach(S=>{const y=e[S];i.indexOf(S)!==-1?yc(y,n,p):bj(y,n,p)})});return g.catch(f=>f),g}function wj(e){return!!(e&&e.message!==void 0)}function jj(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 bc(e,t){return n=>{let r;return e.fullFields?r=jj(t,e.fullFields):r=t[n.field||e.fullField],wj(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 Sc(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 Vn="enum",vj=(e,t,n,r,a)=>{e[Vn]=Array.isArray(e[Vn])?e[Vn]:[],e[Vn].indexOf(t)===-1&&r.push(wt(a.messages[Vn],e.fullField,e[Vn].join(", ")))},Tj=(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))))},Fj=(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 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(u,"_").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)||nt(t,i||e.type))&&r.push(wt(a.messages.required,e.fullField))};let ls;const Rj=(()=>{if(ls)return ls;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}$`),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?u: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,w=`(?:${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 ls=new RegExp(`(?:^${w}$)`,"i"),ls}),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},Sr={integer(e){return Sr.number(e)&&parseInt(e,10)===e},float(e){return Sr.number(e)&&!Sr.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"&&!Sr.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(Rj())},hex(e){return typeof e=="string"&&!!e.match(Pa.hex)}},$j=(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?Sr[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))},Ej=(e,t,n,r,a)=>{(/^\s+$/.test(t)||t==="")&&r.push(wt(a.messages.whitespace,e.fullField))},$e={required:wd,whitespace:Ej,type:$j,range:Fj,enum:vj,pattern:Tj},Ij=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a)}n(i)},Mj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();$e.required(e,t,r,i,a,"array"),t!=null&&($e.type(e,t,r,i,a),$e.range(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(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&$e.type(e,t,r,i,a)}n(i)},Aj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,"date")&&!e.required)return n();if($e.required(e,t,r,i,a),!nt(t,"date")){let l;t instanceof Date?l=t:l=new Date(t),$e.type(e,l,r,i,a),l&&$e.range(e,l.getTime(),r,i,a)}}n(i)},kj="enum",Dj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&$e[kj](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(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&($e.type(e,t,r,i,a),$e.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(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&($e.type(e,t,r,i,a),$e.range(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(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&$e.type(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(t===""&&(t=void 0),nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&($e.type(e,t,r,i,a),$e.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(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),t!==void 0&&$e.type(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(nt(t,"string")&&!e.required)return n();$e.required(e,t,r,i,a),nt(t,"string")||$e.pattern(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(nt(t)&&!e.required)return n();$e.required(e,t,r,i,a),nt(t)||$e.type(e,t,r,i,a)}n(i)},Hj=(e,t,n,r,a)=>{const i=[],o=Array.isArray(t)?"array":typeof t;$e.required(e,t,r,i,a,o),n(i)},Yj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,"string")&&!e.required)return n();$e.required(e,t,r,i,a,"string"),nt(t,"string")||($e.type(e,t,r,i,a),$e.range(e,t,r,i,a),$e.pattern(e,t,r,i,a),e.whitespace===!0&&$e.whitespace(e,t,r,i,a))}n(i)},cs=(e,t,n,r,a)=>{const i=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(nt(t,i)&&!e.required)return n();$e.required(e,t,r,o,a,i),nt(t,i)||$e.type(e,t,r,o,a)}n(o)},mr={string:Yj,method:Lj,number:_j,boolean:Oj,regexp:Vj,integer:Nj,float:Pj,array:Mj,object:zj,enum:Dj,pattern:Bj,date:Aj,url:cs,hex:cs,email:cs,tel:cs,required:Hj,any:Ij},ln=class ln{constructor(t){oe(this,"rules",null);oe(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=Sc(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()),Sc(f,i.messages),i.messages=f}else i.messages=this.messages();const u={};(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),u[f]=u[f]||[],u[f].push({rule:y,value:p,source:a,field:f}))})});const g={};return Cj(u,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,w){return{...w,fullField:`${p.fullField}.${C}`,fullFields:p.fullFields?[...p.fullFields,C]:[C]}}function j(C=[]){let w=Array.isArray(C)?C:[C];!i.suppressWarning&&w.length&&ln.warning("async-validator:",w),w.length&&p.message!==void 0&&p.message!==null&&(w=[].concat(p.message));let b=w.map(bc(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(bc(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 F={};Object.keys(T).forEach(E=>{const M=T[E],O=Array.isArray(M)?M:[M];F[E]=O.map(y.bind(null,E))});const R=new ln(F);R.messages(i.messages),f.rule.options&&(f.rule.options.messages=i.messages,f.rule.options.error=i.error),R.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,j,f.source,i);else if(p.validator){try{v=p.validator(p,f.value,j,f.source,i)}catch(C){(x=console.error)==null||x.call(console,C),i.suppressValidatorError||setTimeout(()=>{throw C},0),j(C.message)}v===!0?j():v===!1?j(typeof p.message=="function"?p.message(p.fullField||p.field):p.message||`${p.fullField||p.field} fails`):v instanceof Array?j(v):v instanceof Error&&j(v.message)}v&&v.then&&v.then(()=>j(),C=>j(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&&!mr.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"?mr.required:mr[this.getType(t)]||void 0}};oe(ln,"register",function(n,r){if(typeof r!="function")throw new Error("Cannot register a validator by type, validator is not a function");mr[n]=r}),oe(ln,"warning",Cd),oe(ln,"messages",Da),oe(ln,"validators",mr);let Fi=ln;const ft="'${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:ft,method:ft,array:ft,object:ft,number:ft,date:ft,boolean:ft,integer:ft,float:ft,regexp:ft,email:ft,tel:ft,url:ft,hex:ft},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}"}},Cc=Fi;function Uj(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 wc="CODE_LOGIC_ERROR";async function Ri(e,t,n,r,a){const i={...n};if(delete i.ruleIndex,Cc.warning=()=>{},i.validator){const m=i.validator;i.validator=(...p)=>{try{return m(...p)}catch(S){return console.error(S),Promise.reject(wc)}}}let o=null;i&&i.type==="array"&&i.defaultField&&(o=i.defaultField,delete i.defaultField);const l=new Cc({[e]:[i]}),u=Kn(jd,r.validateMessages);l.messages(u);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===wc?u.default:p;return ye.isValidElement(y)?ye.cloneElement(y,{key:`error_${S}`}):y}))}if(!h.length&&o&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((p,S)=>Ri(`${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"?Uj(m,g):m)}function Kj(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 j=!1;const x=f(p,S,(...C)=>{Promise.resolve().then(()=>{He(!j,"Your validator function has already return a promise. `callback` will be ignored."),j||y(...C)})});j=x&&typeof x.then=="function"&&typeof x.catch=="function",He(j,"`callback` is deprecated. Please return a promise instead."),j&&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 u;if(a===!0)u=new Promise(async(h,g)=>{for(let f=0;f<l.length;f+=1){const m=l[f],p=await Ri(o,t,m,r,i);if(p.length){g([{errors:p,rule:m}]);return}}h([])});else{const h=l.map(g=>Ri(o,t,g,r,i).then(f=>({errors:f,rule:g})));u=(a?qj(h):Wj(h)).then(g=>Promise.reject(g))}return u.catch(h=>h),u}async function Wj(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 Ze(e){return ji(e)}function jc(e,t){let n={};return t.forEach(r=>{const a=Me(e,r);n=_e(n,r,a)}),n}function Gn(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 Gj(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 Zj(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function vc(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 Jj{constructor(t){oe(this,"namePathList",[]);oe(this,"taskId",0);oe(this,"watcherList",new Set);oe(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 Xj(){return new Promise(e=>{vd(()=>{Pi(()=>{e()})})})}function $i(){return $i=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},$i.apply(this,arguments)}const Sn=[],hr=[];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 ye.PureComponent{constructor(n){super(n);oe(this,"state",{resetCount:0});oe(this,"cancelRegisterFunc",null);oe(this,"mounted",!1);oe(this,"touched",!1);oe(this,"dirty",!1);oe(this,"validatePromise");oe(this,"prevValidating");oe(this,"errors",Sn);oe(this,"warnings",hr);oe(this,"cancelRegister",()=>{const{preserve:n,isListField:r,name:a}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,Ze(a)),this.cancelRegisterFunc=null});oe(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:a=[]}=r;return n!==void 0?[...a,...n]:[]});oe(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(a=>typeof a=="function"?a(r):a)});oe(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});oe(this,"metaCache",null);oe(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const a={...this.getMeta(),destroy:n};Io(this.metaCache,a)||r(a),this.metaCache=a}else this.metaCache=null});oe(this,"onStoreChange",(n,r,a)=>{const{shouldUpdate:i,dependencies:o=[],onReset:l}=this.props,{store:u}=a,h=this.getNamePath(),g=this.getValue(n),f=this.getValue(u),m=r&&Gn(r,h);switch(a.type==="valueUpdate"&&a.source==="external"&&!Io(g,f)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=Sn,this.warnings=hr,this.triggerMetaEvent()),a.type){case"reset":if(!r||m){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=Sn,this.warnings=hr,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&Na(i,n,u,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||Sn),"warnings"in p&&(this.warnings=p.warnings||hr),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in p&&Gn(r,h,!0)){this.reRender();return}if(i&&!h.length&&Na(i,n,u,g,f,a)){this.reRender();return}break}case"dependenciesUpdate":{if(o.map(Ze).some(S=>Gn(a.relatedFields,S))){this.reRender();return}break}default:if(m||(!o.length||h.length||i)&&Na(i,n,u,g,f,a)){this.reRender();return}break}i===!0&&this.reRender()});oe(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:h=!1,messageVariables:g,validateDebounce:f}=this.props;l&&await Xj();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!==u))return[];const p=Kj(r,a,m,n,h,g);return p.catch(S=>S).then((S=Sn)=>{var y;if(this.validatePromise===u){this.validatePromise=null;const j=[],v=[];(y=S.forEach)==null||y.call(S,({rule:{warningOnly:x},errors:C=Sn})=>{x?v.push(...C):j.push(...C)}),this.errors=j,this.warnings=v,this.triggerMetaEvent(),this.reRender()}}),p});return o||(this.validatePromise=u,this.dirty=!0,this.errors=Sn,this.warnings=hr,this.triggerMetaEvent(),this.reRender()),u});oe(this,"isFieldValidating",()=>!!this.validatePromise);oe(this,"isFieldTouched",()=>this.touched);oe(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});oe(this,"getErrors",()=>this.errors);oe(this,"getWarnings",()=>this.warnings);oe(this,"isListField",()=>this.props.isListField);oe(this,"isList",()=>this.props.isList);oe(this,"isPreserve",()=>this.props.preserve);oe(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}));oe(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=gn(n);return r.length!==1||!ye.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});oe(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,a=this.getNamePath();return Me(n||r(!0),a)});oe(this,"getControlled",(n={})=>{const{name:r,trigger:a="onChange",validateTrigger:i,getValueFromEvent:o,normalize:l,valuePropName:u="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),j=this.getValue(),v=h||(T=>({[u]:T})),x=n[a],C=r!==void 0?v(j):{};process.env.NODE_ENV!=="production"&&C&&Object.keys(C).forEach(T=>{He(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 w={...n,...C};return w[a]=(...T)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();const F=this.getValue();let R;o?R=o(...T):R=Zj(u,...T),l&&(R=l(R,F,S(!0))),R!==F&&y({type:"updateValue",namePath:m,value:R}),x&&x(...T)},ji(f||[]).forEach(T=>{const F=w[T];w[T]=(...R)=>{F&&F(...R);const{rules:E}=this.props;E&&E.length&&y({type:"validateField",namePath:m,triggerName:T})}}),w});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:ye.isValidElement(a)?o=ye.cloneElement(a,this.getControlled(a.props)):(He(!a,"`children` of Field is not validate ReactElement."),o=a),ye.createElement(ye.Fragment,{key:n},o)}}oe(Td,"contextType",An);function Fd({name:e,...t}){const n=ye.useContext(An),r=ye.useContext(Vs),a=e!==void 0?Ze(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&&He(!1,"`preserve` should not apply on Form.List fields."),ye.createElement(Td,$i({key:o,name:a,isListField:i},t,{fieldContext:n}))}function Qj({name:e,initialValue:t,children:n,rules:r,validateTrigger:a,isListField:i}){const o=ye.useContext(An),l=ye.useContext(Vs),h=ye.useRef({keys:[],id:0}).current,g=ye.useMemo(()=>[...Ze(o.prefixName)||[],...Ze(e)],[o.prefixName,e]),f=ye.useMemo(()=>({...o,prefixName:g}),[o,g]),m=ye.useMemo(()=>({getKey:S=>{const y=g.length,j=S[y];return[h.keys[j],S.slice(y+1)]}}),[h,g]);if(typeof n!="function")return He(!1,"Form.List only accepts function as children."),null;const p=(S,y,{source:j})=>j==="internal"?!1:S!==y;return ye.createElement(Vs.Provider,{value:m},ye.createElement(An.Provider,{value:f},ye.createElement(Fd,{name:[],shouldUpdate:p,rules:r,validateTrigger:a,initialValue:t,isList:!0,isListField:i??!!l},({value:S=[],onChange:y},j)=>{const{getFieldValue:v}=o,x=()=>v(g||[])||[],C={add:(b,T)=>{const F=x();T>=0&&T<=F.length?(h.keys=[...h.keys.slice(0,T),h.id,...h.keys.slice(T)],y([...F.slice(0,T),b,...F.slice(T)])):(process.env.NODE_ENV!=="production"&&(T<0||T>F.length)&&He(!1,"The second parameter of the add function should be a valid positive number."),h.keys=[...h.keys,h.id],y([...F,b])),h.id+=1},remove:b=>{const T=x(),F=new Set(Array.isArray(b)?b:[b]);F.size<=0||(h.keys=h.keys.filter((R,E)=>!F.has(E)),y(T.filter((R,E)=>!F.has(E))))},move(b,T){if(b===T)return;const F=x();b<0||b>=F.length||T<0||T>=F.length||(h.keys=vc(h.keys,b,T),y(vc(F,b,T)))}};let w=S||[];return Array.isArray(w)||(w=[],process.env.NODE_ENV!=="production"&&He(!1,`Current value of '${g.join(" > ")}' is not an array type.`)),n(w.map((b,T)=>{let F=h.keys[T];return F===void 0&&(h.keys[T]=h.id,F=h.keys[T],h.id+=1),{name:T,key:F,isListField:!0}}),C,j)})))}function e0(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 Ei="__@field_split__";function us(e){return e.map(t=>`${typeof t}:${t}`).join(Ei)}class Hn{constructor(){oe(this,"kvs",new Map)}set(t,n){this.kvs.set(us(t),n)}get(t){return this.kvs.get(us(t))}getAsPrefix(t){const n=us(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(us(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 t0{constructor(t){oe(this,"formHooked",!1);oe(this,"forceRootUpdate");oe(this,"subscribable",!0);oe(this,"store",{});oe(this,"fieldEntities",[]);oe(this,"initialValues",{});oe(this,"callbacks",{});oe(this,"validateMessages",null);oe(this,"preserve",null);oe(this,"lastValidatePromise",null);oe(this,"watcherCenter",new Jj(this));oe(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}));oe(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}):(He(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));oe(this,"useSubscribe",t=>{this.subscribable=t});oe(this,"prevWithoutPreserves",null);oe(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let a=Kn(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{a=_e(a,i,Me(t,i))}),this.prevWithoutPreserves=null,this.updateStore(a)}});oe(this,"destroyForm",t=>{if(t)this.updateStore({});else{const n=new Hn;this.getFieldEntities(!0).forEach(r=>{this.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),this.prevWithoutPreserves=n}});oe(this,"getInitialValue",t=>{const n=Me(this.initialValues,t);return t.length?Kn(n):n});oe(this,"setCallbacks",t=>{this.callbacks=t});oe(this,"setValidateMessages",t=>{this.validateMessages=t});oe(this,"setPreserve",t=>{this.preserve=t});oe(this,"registerWatch",t=>this.watcherCenter.register(t));oe(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});oe(this,"timeoutId",null);oe(this,"warningUnhooked",()=>{process.env.NODE_ENV!=="production"&&!this.timeoutId&&typeof window<"u"&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.formHooked||He(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))});oe(this,"updateStore",t=>{this.store=t});oe(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);oe(this,"getFieldsMap",(t=!1)=>{const n=new Hn;return this.getFieldEntities(t).forEach(r=>{const a=r.getNamePath();n.set(a,r)}),n});oe(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(a=>{const i=Ze(a),o=r.getAsPrefix(i);return o.length?o:[{INVALIDATE_NAME_PATH:i}]}):t.map(a=>{const i=Ze(a);return r.get(i)||{INVALIDATE_NAME_PATH:Ze(a)}})});oe(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 u=jc(this.store,o.map(Ze));return l.forEach(h=>{Me(u,h)||(u=_e(u,h,[]))}),u});oe(this,"getFieldValue",t=>{this.warningUnhooked();const n=Ze(t);return Me(this.store,n)});oe(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:Ze(t[a]),errors:[],warnings:[]})));oe(this,"getFieldError",t=>{this.warningUnhooked();const n=Ze(t);return this.getFieldsError([n])[0].errors});oe(this,"getFieldWarning",t=>{this.warningUnhooked();const n=Ze(t);return this.getFieldsError([n])[0].warnings});oe(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(Ze),i=!1):(a=null,i=n):(a=n.map(Ze),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 Hn;a.forEach(f=>{u.set(f,[])}),o.forEach(f=>{const m=f.getNamePath();a.forEach(p=>{p.every((S,y)=>m[y]===S)&&u.update(p,S=>[...S,f])})});const h=f=>f.some(l),g=u.map(({value:f})=>f);return i?g.every(h):g.some(h)});oe(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));oe(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(a=>a.isFieldValidating());const r=t.map(Ze);return n.some(a=>{const i=a.getNamePath();return Gn(r,i)&&a.isFieldValidating()})});oe(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));oe(this,"resetWithFieldInitialValue",(t={})=>{const n=new Hn,r=this.getFieldEntities(!0);r.forEach(o=>{const{initialValue:l}=o.props,u=o.getNamePath();if(l!==void 0){const h=n.get(u)||new Set;h.add({entity:o,value:l}),n.set(u,h)}});const a=o=>{o.forEach(l=>{const{initialValue:u}=l.props;if(u!==void 0){const h=l.getNamePath();if(this.getInitialValue(h)!==void 0)He(!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)He(!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(_e(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(u=>u.entity))})):i=r,a(i)});oe(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(Kn(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(Ze);r.forEach(a=>{const i=this.getInitialValue(a);this.updateStore(_e(this.store,a,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});oe(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(a=>{const{name:i,...o}=a,l=Ze(i);r.push(l),"value"in o&&this.updateStore(_e(this.store,l,o.value)),this.notifyObservers(n,[l],{type:"setField",data:a})}),this.notifyWatch(r)});oe(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}));oe(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();Me(this.store,r)===void 0&&this.updateStore(_e(this.store,r,n))}});oe(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);oe(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(_e(l,n,o,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});oe(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}}});oe(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()});oe(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});oe(this,"updateValue",(t,n)=>{const r=Ze(t),a=this.store;this.updateStore(_e(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=jc(this.store,[r]),u=this.getFieldsValue(),h=_e(u,r,Me(l,r));o(l,h)}this.triggerOnFieldsChange([r,...i])});oe(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=Kn(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});oe(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});oe(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],a=new Hn;this.getFieldEntities().forEach(o=>{const{dependencies:l}=o.props;(l||[]).forEach(u=>{const h=Ze(u);a.update(h,(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 h=u.getNamePath();u.isFieldDirty()&&h.length&&(r.push(h),i(h))}})};return i(t),r});oe(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const a=this.getFields();if(n){const o=new Hn;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})=>Gn(t,o));i.length&&r(i,a)}});oe(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(Ze):[],l=[...o],u=[],h=String(Date.now()),g=new Set,{recursive:f,dirty:m}=a||{};this.getFieldEntities(!0).forEach(j=>{const v=j.getNamePath();if(i||((!j.isList()||!o.some(x=>Hs(x,v,!0)))&&l.push(v),o.push(v)),!(!j.props.rules||!j.props.rules.length)&&!(m&&!j.isFieldDirty())&&(g.add(v.join(h)),!i||Gn(o,v,f))){const x=j.validateRules({validateMessages:{...jd,...this.validateMessages},...a});u.push(x.then(()=>({name:v,errors:[],warnings:[]})).catch(C=>{var T;const w=[],b=[];return(T=C.forEach)==null||T.call(C,({rule:{warningOnly:F},errors:R})=>{F?b.push(...R):w.push(...R)}),w.length?Promise.reject({name:v,errors:w,warnings:b}):{name:v,errors:w,warnings:b}}))}});const p=e0(u);this.lastValidatePromise=p,p.catch(j=>j).then(j=>{const v=j.map(({name:x})=>x);this.notifyObservers(this.store,v,{type:"validateFinish"}),this.triggerOnFieldsChange(v,j)});const S=p.then(()=>this.lastValidatePromise===p?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(j=>{var C,w;const v=j.filter(b=>b&&b.errors.length),x=(w=(C=v[0])==null?void 0:C.errors)==null?void 0:w[0];return Promise.reject({message:x,values:this.getFieldsValue(o),errorFields:v,outOfDate:this.lastValidatePromise!==p})});S.catch(j=>j);const y=o.filter(j=>g.has(j.join(h)));return this.triggerOnFieldsChange(y),S});oe(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 Rd(e){const t=ye.useRef(null),[,n]=ye.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},a=new t0(r);t.current=a.getForm()}return[t.current]}const Ii=ye.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),n0=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const a=ye.useContext(Ii),i=ye.useRef({});return ye.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 r0=(e,t)=>{const{name:n,initialValues:r,fields:a,form:i,preserve:o,children:l,component:u="form",validateMessages:h,validateTrigger:g="onChange",onValuesChange:f,onFieldsChange:m,onFinish:p,onFinishFailed:S,clearOnDestroy:y,...j}=e,v=ye.useRef(null),x=ye.useContext(Ii),[C]=Rd(i),{useSubscribe:w,setInitialValues:b,setCallbacks:T,setValidateMessages:F,setPreserve:R,destroyForm:E}=C.getInternalHooks(Fn);ye.useImperativeHandle(t,()=>({...C,nativeElement:v.current})),ye.useEffect(()=>(x.registerForm(n,C),()=>{x.unregisterForm(n)}),[x,C,n]),F({...x.validateMessages,...h}),T({onValuesChange:f,onFieldsChange:($,...z)=>{x.triggerFormChange(n,$),m&&m($,...z)},onFinish:$=>{x.triggerFormFinish(n,$),p&&p($)},onFinishFailed:S}),R(o);const M=ye.useRef(null);b(r,!M.current),M.current||(M.current=!0),ye.useEffect(()=>()=>E(y),[]);let O;const Y=typeof l=="function";if(Y){const $=C.getFieldsValue(!0);O=l($,C)}else O=l;w(!Y);const H=ye.useRef(null);ye.useEffect(()=>{Gj(H.current||[],a||[])||C.setFields(a||[]),H.current=a},[a,C]);const D=ye.useMemo(()=>({...C,validateTrigger:g}),[C,g]),I=ye.createElement(Vs.Provider,{value:null},ye.createElement(An.Provider,{value:D},O));return u===!1?I:ye.createElement(u,Mi({},j,{ref:v,onSubmit:$=>{$.preventDefault(),$.stopPropagation(),C.submit()},onReset:$=>{var z;$.preventDefault(),C.resetFields(),(z=j.onReset)==null||z.call(j,$)}}),I)};function La(e){try{return JSON.stringify(e)}catch{return Math.random()}}function s0(...e){const[t,n={}]=e,r=pj(n)?{form:n}:n,a=r.form,[i,o]=d.useState(()=>typeof t=="function"?t({}):void 0),l=d.useMemo(()=>La(i),[i]),u=d.useRef(l);u.current=l;const h=d.useContext(An),g=a||h,f=g&&g._init;process.env.NODE_ENV!=="production"&&He(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(),w=typeof t=="function"?t(C):Me(C,Ze(t));La(i)!==La(w)&&o(w)}),j=typeof t=="function"?t:JSON.stringify(t);return d.useEffect(()=>{f&&y()},[f,j]),d.useEffect(()=>f?S((x,C)=>{y(x,C)}):void 0,[f]),i}const a0=ye.forwardRef(r0),zr=a0;zr.FormProvider=n0;zr.Field=Fd;zr.List=Qj;zr.useForm=Rd;zr.useWatch=s0;const lr=d.createContext({}),Br=d.createContext({mode:"edit"}),i0=e=>Array.isArray(e)?e:typeof e=="function"?[e]:gn(e),o0=e=>{var re,le,ce;const{creatorButtonProps:t,deleteIconProps:n,copyIconProps:r,arrowSort:a,upIconProps:i,downIconProps:o,itemContainerRender:l,itemRender:u,alwaysShowItemLabel:h,prefixCls:g,creatorRecord:f,action:m,actionGuard:p,children:S,actionRender:y,fields:j,meta:v,field:x,index:C,formInstance:w,originName:b,containerClassName:T,containerStyle:F,min:R,max:E,count:M,...O}=e,{hashId:Y}=d.useContext(Ht),{componentSize:H}=((le=(re=c.ConfigProvider).useConfig)==null?void 0:le.call(re))||{componentSize:"middle"},D=d.useContext(tr),I=d.useRef(!1),{mode:$}=d.useContext(Br),[z,_]=d.useState(!1),[V,Z]=d.useState(!1);d.useEffect(()=>()=>{I.current=!0},[]);const B=()=>w.getFieldValue([D.listName,b,C==null?void 0:C.toString()].flat(1).filter(ue=>ue!=null)),U={getCurrentRowData:B,setCurrentRowData:ue=>{var ge;const he=((ge=w==null?void 0:w.getFieldsValue)==null?void 0:ge.call(w))||{},se=[D.listName,b,C==null?void 0:C.toString()].flat(1).filter(ne=>ne!=null),de=_e(he,se,{...B(),...ue||{}});return w.setFieldsValue(de)}},J=i0(S).map(ue=>typeof ue=="function"?ue==null?void 0:ue(x,C,{...m,...U},M):ue).map((ue,he)=>{var se;return d.isValidElement(ue)?d.cloneElement(ue,{key:ue.key||((se=ue==null?void 0:ue.props)==null?void 0:se.name)||he,...(ue==null?void 0:ue.props)||{}}):ue}),G=d.useMemo(()=>{if($==="read"||r===!1||E===M)return null;const{Icon:ue=ae.CopyOutlined,tooltipText:he}=r;return s.jsx(c.Tooltip,{title:he,children:V?s.jsx(ae.LoadingOutlined,{}):s.jsx(ue,{className:ie(`${g}-action-icon action-copy`,Y),onClick:async()=>{Z(!0);const se=w==null?void 0:w.getFieldValue([D.listName,b,x.name].filter(de=>de!==void 0).flat(1));await m.add(se,M),Z(!1)}})},"copy")},[r,E,M,V,g,Y,w,D.listName,x.name,b,m]),K=d.useMemo(()=>{if($==="read"||n===!1||R===M)return null;const{Icon:ue=ae.DeleteOutlined,tooltipText:he}=n;return s.jsx(c.Tooltip,{title:he,children:z?s.jsx(ae.LoadingOutlined,{}):s.jsx(ue,{className:ie(`${g}-action-icon action-remove`,Y),onClick:async()=>{_(!0),await m.remove(x.name),I.current||_(!1)}})},"delete")},[n,R,M,z,g,Y,m,x.name]),A=d.useMemo(()=>{if(!a||$==="read"||i===!1)return null;const ue=C-1;if(ue<0)return null;const{Icon:he=ae.ArrowUpOutlined,tooltipText:se}=i;return s.jsx(c.Tooltip,{title:se,children:s.jsx(he,{className:ie(`${g}-action-icon action-up`,Y),onClick:async()=>{await m.move(C,ue)}})},"up")},[i,g,Y,m,a]),k=d.useMemo(()=>{if(!a||$==="read"||o===!1)return null;const ue=C+1;if(ue>=M)return null;const{Icon:he=ae.ArrowDownOutlined,tooltipText:se}=o;return s.jsx(c.Tooltip,{title:se,children:s.jsx(he,{className:ie(`${g}-action-icon action-down`,Y),onClick:async()=>{await m.move(C,ue)}})},"down")},[i,g,Y,m,a]),N=d.useMemo(()=>[G,K,A,k].filter(ue=>ue!=null),[G,K,A,k]),P=(y==null?void 0:y(x,m,N,M))||N,L=P.length>0&&$!=="read"?s.jsx("div",{className:ie(`${g}-action`,{[`${g}-action-small`]:H==="small"},Y),children:P}):null,W={name:O.name,field:x,index:C,record:(ce=w==null?void 0:w.getFieldValue)==null?void 0:ce.call(w,[D.listName,b,x.name].filter(ue=>ue!==void 0).flat(1)),fields:j,operation:m,meta:v},{grid:q}=or(),Q=(l==null?void 0:l(J,W))||J,ee=(u==null?void 0:u({listDom:s.jsx("div",{className:ie(`${g}-container`,T,Y),style:{width:q?"100%":void 0,...F},children:Q}),action:L},W))||s.jsxs("div",{className:ie(`${g}-item`,Y,{[`${g}-item-default`]:h===void 0,[`${g}-item-show-label`]:h}),style:{display:"flex",alignItems:"flex-end"},children:[s.jsx("div",{className:ie(`${g}-container`,T,Y),style:{width:q?"100%":void 0,...F},children:Q}),L]});return s.jsx(tr.Provider,{value:{...x,listName:[D.listName,b,x.name].filter(ue=>ue!==void 0).flat(1)},children:ee})},l0=e=>{const t=Fe(),{creatorButtonProps:n,prefixCls:r,children:a,creatorRecord:i,action:o,fields:l,actionGuard:u,max:h,fieldExtraRender:g,meta:f,containerClassName:m,containerStyle:p,onAfterAdd:S,onAfterRemove:y}=e,{hashId:j}=d.useContext(Ht),v=d.useRef(new Map),[x,C]=d.useState(!1),w=d.useMemo(()=>l.map(M=>{var Y,H,D;(Y=v.current)!=null&&Y.has(M.key.toString())||(H=v.current)==null||H.set(M.key.toString(),Or());const O=(D=v.current)==null?void 0:D.get(M.key.toString());return{...M,uuid:O}}),[l]),b=d.useMemo(()=>{const M={...o},O=w.length;return u!=null&&u.beforeAddRow?M.add=async(...Y)=>{if(await u.beforeAddRow(...Y,O)){const D=o.add(...Y);return S==null||S(...Y,O+1),D}return!1}:M.add=async(...Y)=>{const H=o.add(...Y);return S==null||S(...Y,O+1),H},u!=null&&u.beforeRemoveRow?M.remove=async(...Y)=>{if(await u.beforeRemoveRow(...Y,O)){const D=o.remove(...Y);return y==null||y(...Y,O-1),D}return!1}:M.remove=async(...Y)=>{const H=o.remove(...Y);return y==null||y(...Y,O-1),H},M},[o,u==null?void 0:u.beforeAddRow,u==null?void 0:u.beforeRemoveRow,S,y,w.length]),T=d.useMemo(()=>{if(n===!1||w.length===h)return null;const{position:M="bottom",creatorButtonText:O=t.getMessage("editableTable.action.add","添加一行数据")}=n||{};return s.jsx(c.Button,{className:ie(`${r}-creator-button-${M}`,j),type:"dashed",loading:x,block:!0,icon:s.jsx(ae.PlusOutlined,{}),...Le(n||{},["position","creatorButtonText"]),onClick:async()=>{C(!0);let Y=w.length;M==="top"&&(Y=0),await b.add(mt(i)??{},Y),C(!1)},children:O})},[n,w.length,h,t,r,j,x,b,i]),F=d.useContext(Br),R={width:"max-content",maxWidth:"100%",minWidth:"100%",...p},E=d.useMemo(()=>w.map((M,O)=>d.createElement(o0,{...e,key:M.uuid,field:M,index:O,action:b,count:w.length},a)),[a,e,w,b]);return F.mode==="read"||e.readonly===!0?s.jsx(s.Fragment,{children:E}):s.jsxs("div",{style:R,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]})},c0=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 u0(e){return Be("ProFormList",t=>{const n={...t,componentCls:`.${e}`};return[c0(n)]})}const{noteOnce:Tc}=He,tr=d.createContext({});function d0(e){const t=d.useRef(),n=d.useContext(c.ConfigProvider.ConfigContext),r=d.useContext(tr),a=n.getPrefixCls("pro-form-list"),i=Fe(),{setFieldValueType:o}=d.useContext(lr),{transform:l,actionRender:u,creatorButtonProps:h,label:g,alwaysShowItemLabel:f,tooltip:m,creatorRecord:p,itemRender:S,rules:y,itemContainerRender:j,fieldExtraRender:v,copyIconProps:x={Icon:ae.CopyOutlined,tooltipText:i.getMessage("copyThisLine","复制此项")},children:C,deleteIconProps:w={Icon:ae.DeleteOutlined,tooltipText:i.getMessage("deleteThisLine","删除此项")},arrowSort:b,upIconProps:T={Icon:ae.ArrowUpOutlined,tooltipText:i.getMessage("sortUpThisLine","向上排序")},downIconProps:F={Icon:ae.ArrowDownOutlined,tooltipText:i.getMessage("sortDownThisLine","向下排序")},actionRef:R,style:E,prefixCls:M,actionGuard:O,min:Y,max:H,colProps:D,wrapperCol:I,rowProps:$,onAfterAdd:z,onAfterRemove:_,isValidateList:V=!1,emptyListMessage:Z="列表不能为空",className:B,containerClassName:U,containerStyle:J,readonly:G,...K}=e,{ColWrapper:A,RowWrapper:k}=or({colProps:D,rowProps:$}),N=d.useContext(Nr),P=d.useMemo(()=>r.name===void 0?[K.name].flat(1):[r.name,K.name].flat(1),[r.name,K.name]);d.useImperativeHandle(R,()=>({...t.current,get:q=>N.formRef.current.getFieldValue([...P,q]),getList:()=>N.formRef.current.getFieldValue([...P])}),[P,N.formRef]),d.useEffect(()=>{Tc(!!N.formRef,"ProFormList 必须要放到 ProForm 中,否则会造成行为异常。"),Tc(!!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(q=>q!==void 0),{valueType:"formList",transform:l})},[e.name,o,l]);const{wrapSSR:L,hashId:W}=u0(a);return N.formRef?L(s.jsx(A,{children:s.jsx("div",{className:ie(a,W),style:E,children:s.jsx(c.Form.Item,{label:g,prefixCls:M,tooltip:m,style:E,required:y==null?void 0:y.some(q=>q.required),wrapperCol:I,className:B,...K,name:V?P:void 0,rules:V?[{validator:(q,Q)=>!Q||Q.length===0?Promise.reject(new Error(Z)):Promise.resolve(),required:!0}]:void 0,children:s.jsx(c.Form.List,{rules:y,...K,name:P,children:(q,Q,ee)=>(t.current=Q,s.jsxs(k,{children:[s.jsx(l0,{name:P,readonly:!!G,originName:K.name,copyIconProps:x,deleteIconProps:w,arrowSort:b,upIconProps:T,downIconProps:F,formInstance:N.formRef.current,prefixCls:a,meta:ee,fields:q,itemContainerRender:j,itemRender:S,fieldExtraRender:v,creatorButtonProps:h,creatorRecord:p,actionRender:u,action:Q,actionGuard:O,alwaysShowItemLabel:f,min:Y,max:H,count:q.length,onAfterAdd:(re,le,ce)=>{V&&N.formRef.current.validateFields([P]),z==null||z(re,le,ce)},onAfterRemove:(re,le)=>{V&&le===0&&N.formRef.current.validateFields([P]),_==null||_(re,le)},containerClassName:U,containerStyle:J,children:C}),s.jsx(c.Form.ErrorList,{errors:ee.errors})]}))})})})})):null}const na=({name:e,originDependencies:t=e,children:n,ignoreFormListField:r,...a})=>{const i=d.useContext(Nr),o=d.useContext(tr),l=d.useMemo(()=>e.map(u=>{var g;const h=[u];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(c.Form.Item,{...a,noStyle:!0,shouldUpdate:(u,h,g)=>{var f;return typeof a.shouldUpdate=="boolean"?a.shouldUpdate:typeof a.shouldUpdate=="function"?(f=a.shouldUpdate)==null?void 0:f.call(a,u,h,g):l.some(m=>!hn(Me(u,m),Me(h,m)))},children:u=>{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),Me(y,p)&&(h=_e(h,[S].flat(1),Me(y,p)))):(y=(f=u.getFieldValue)==null?void 0:f.call(u,p),typeof y<"u"&&(h=_e(h,[S].flat(1),y)))}return n==null?void 0:n(h,{...u,...i})}})};na.displayName="ProFormDependency";const f0=d.createContext({}),m0=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),h=be(function(...w){var b,T,F,R,E;n==null||n(...w),!l&&(u||((T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...w),(E=(R=(F=t==null?void 0:t.props)==null?void 0:F.fieldProps)==null?void 0:R.onChange)==null||E.call(R,...w)))}),g=be(function(...w){var b,T,F,R,E;l||u||(r==null||r(...w),(T=(b=t==null?void 0:t.props)==null?void 0:b.onBlur)==null||T.call(b,...w),(E=(R=(F=t==null?void 0:t.props)==null?void 0:F.fieldProps)==null?void 0:R.onBlur)==null||E.call(R,...w))}),f=ct(()=>{var w;return Le(((w=t==null?void 0:t.props)==null?void 0:w.fieldProps)||{},["onBlur","onChange"])},[Le(((x=t==null?void 0:t.props)==null?void 0:x.fieldProps)||{},["onBlur","onChange"])]),m=e[i],p=d.useMemo(()=>{if(!l&&!u)return it({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(...w)=>{var b,T;n==null||n(...w),(T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...w)}},[p,t,n]);if(!d.isValidElement(t))return s.jsx(s.Fragment,{children:t});const y=o.variant,j=o.fieldProps;return d.cloneElement(t,it({...o,[i]:e[i],...t.props,onChange:S,...!l&&p?{fieldProps:{...(C=t.props)==null?void 0:C.fieldProps,...j,...p}}:{},...y!==void 0&&{variant:y},onBlur:l&&!u&&typeof r=="function"?r:void 0}))},Fc=({children:e,addonAfter:t,addonBefore:n,valuePropName:r,addonWarpStyle:a,convertValue:i,help:o,...l})=>{const u=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(c.Form.Item,{...l,valuePropName:r,getValueProps:h,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:h,children:e})},[t,n,e,i==null?void 0:i.toString(),l]);return s.jsx(f0.Provider,{value:{name:l.name,label:l.label},children:u})},$d=e=>{var w,b,T,F,R,E;const{componentSize:t}=((b=(w=c.ConfigProvider)==null?void 0:w.useConfig)==null?void 0:b.call(w))||{componentSize:"middle"},n=t,{valueType:r,transform:a,dataFormat:i,ignoreFormItem:o,lightProps:l,children:u,fieldProps:h,...g}=e,f=d.useContext(tr),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(lr);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)&&Pp(r||e.children.props.valueType),j=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(Fc,{...g,name:m,key:g.proFormFieldKey||((T=g.name)==null?void 0:T.toString())},e.children);const v=s.jsx(m0,{valuePropName:e.valuePropName,children:e.children},g.proFormFieldKey||((F=g.name)==null?void 0:F.toString())),x=it(l||{}),C=j?v:d.createElement(j0,{...x,key:g.proFormFieldKey||((R=g.name)==null?void 0:R.toString()),size:n},v);return o?s.jsx(s.Fragment,{children:C}):s.jsx(Fc,{...S,...g,name:m,isListField:f.name!==void 0,children:C},g.proFormFieldKey||((E=g.name)==null?void 0:E.toString()))},Rc={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},h0=["switch","radioButton","radio","rate"];function Zn(e,t){e.displayName="ProFormComponent";const n=a=>{const{valueType:i,customLightMode:o,lightFilterLabelFormatter:l,valuePropName:u="value",ignoreWidth:h,defaultProps:g,...f}={...a==null?void 0:a.fieldConfig,...t},{label:m,tooltip:p,placeholder:S,width:y,bordered:j,messageVariables:v,ignoreFormItem:x,transform:C,convertValue:w,readonly:b,allowClear:T,colSize:F,getFormItemProps:R,getFieldProps:E,fieldConfig:M,cacheForSwr:O,proFieldProps:Y,...H}={...g,...a},D=i||H.valueType,I=d.useMemo(()=>h||h0.includes(D),[h,D]),[,$]=d.useState(),[z,_]=d.useState(),V=d.useContext(lr),Z=ct(()=>({formItemProps:R==null?void 0:R(),fieldProps:E==null?void 0:E()}),[E,R,H.dependenciesValues,z]),B=ct(()=>{const re={...x?it({value:H.value}):{},placeholder:S,disabled:a.disabled,...V.fieldProps,...Z.fieldProps,...H.fieldProps};return re.style=it(re==null?void 0:re.style),re},[x,H.value,H.fieldProps,S,a.disabled,V.fieldProps,Z.fieldProps]),U=Yp(H),J=ct(()=>({...V.formItemProps,...U,...Z.formItemProps,...H.formItemProps}),[Z.formItemProps,V.formItemProps,H.formItemProps,U]),G=ct(()=>({messageVariables:v,...f,...J}),[f,J,v]),{prefixName:K}=d.useContext(An),A=ct(()=>{let re=G==null?void 0:G.name;return Array.isArray(re)&&(re=re.join("_")),Array.isArray(K)&&re&&(re=`${K.join(".")}.${re}`),re&&`form-${V.formKey??""}-field-${re}`},[fn(G==null?void 0:G.name),K,V.formKey]),k=be((...re)=>{var le;R||E?_([]):H.formItemRender&&$([]),(le=B==null?void 0:B.onChange)==null||le.call(B,...re)}),N=ct(()=>{const re={width:y&&!Rc[y]?y:V.grid?"100%":void 0,...B==null?void 0:B.style};return I&&Reflect.deleteProperty(re,"width"),it(re)},[fn(B==null?void 0:B.style),V.grid,I,y]),P=ct(()=>{const re=y&&Rc[y];return ie(B==null?void 0:B.className,{"pro-field":re,[`pro-field-${y}`]:re&&!I})||void 0},[y,B==null?void 0:B.className,I]),L=ct(()=>it({...V.proFieldProps,mode:H==null?void 0:H.mode,readonly:b,params:H.params,proFieldKey:A,cacheForSwr:O,...Y}),[V.proFieldProps,H==null?void 0:H.mode,H.params,b,A,O,Y]),W=ct(()=>({onChange:k,allowClear:T,...B,style:N,className:P}),[T,P,k,B,N]),q=ct(()=>s.jsx(e,{...H,fieldProps:W,proFieldProps:L,ref:a==null?void 0:a.fieldRef},a.proFormFieldKey||a.name),[L,W,H]),Q=ct(()=>{var re,le,ce;return s.jsx($d,{label:m&&(Y==null?void 0:Y.light)!==!0?m:void 0,tooltip:(Y==null?void 0:Y.light)!==!0&&p,valuePropName:u,...G,ignoreFormItem:x,transform:C,dataFormat:B==null?void 0:B.format,valueType:D,messageVariables:{label:m||"",...G==null?void 0:G.messageVariables},convertValue:w,lightProps:it({...B,variant:H.variant??(B==null?void 0:B.variant),valueType:D,bordered:j,allowClear:((re=q==null?void 0:q.props)==null?void 0:re.allowClear)??T,light:Y==null?void 0:Y.light,label:m,customLightMode:o,labelFormatter:l,valuePropName:u,footerRender:(le=q==null?void 0:q.props)==null?void 0:le.footerRender,...H.lightProps,...G.lightProps}),children:q},a.proFormFieldKey||((ce=G.name)==null?void 0:ce.toString()))},[m,Y==null?void 0:Y.light,p,u,a.proFormFieldKey,G,x,C,B,D,w,j,q,T,o,l,H.lightProps]),{ColWrapper:ee}=or(H);return s.jsx(ee,{children:Q})};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 Rr=function(){return Rr=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},Rr.apply(this,arguments)};function g0(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 p0(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=Rr({},e);return g.forEach(function(m){var p=m[0],S=m[1];f[p]=x0(p,S,{},e)}),f},[t.disabled,e,o]);function u(g){if(!(typeof window>"u"||!window.URL)){var f=g0(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(Rr(Rr({},e),l))},[t.disabled,l]);var h=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,h]}var y0={true:!0,false:!1};function x0(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"?y0[i]:Array.isArray(a)?a.find(function(o){return o==i})||r[e]:i}const b0=e=>{const t=Fe(),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:h}=mn.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=[];u!==!1&&S.push(d.createElement(c.Button,{...Le(u??{},["preventDefault","fieldProps"]),key:"rest",onClick:j=>{var v;u!=null&&u.preventDefault||f(),(v=u==null?void 0:u.onClick)==null||v.call(u,j)}},p)),l!==!1&&S.push(d.createElement(c.Button,{type:"primary",...Le(l||{},["preventDefault","fieldProps"]),key:"submit",onClick:j=>{var v;l!=null&&l.preventDefault||g(),(v=l==null?void 0:l.onClick)==null||v.call(l,j)}},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:$c}=He,Is=(e,t,n)=>e===!0?t:mt(e,t,n),ds=e=>!e||Array.isArray(e)?e:[e],Ed={};function S0(e){var V,Z;const{children:t,contentRender:n,submitter:r,fieldProps:a,formItemProps:i,groupProps:o,transformKey:l,formRef:u,onInit:h,form:g,loading:f,formComponentType:m,extraUrlParams:p=Ed,syncToUrl:S,onUrlSearchChange:y,onReset:j,omitNil:v=!0,isKeyPressSubmit:x,autoFocusFirstInput:C=!0,grid:w,rowProps:b,colProps:T,...F}=e,R=c.Form.useFormInstance(),{componentSize:E}=((Z=(V=c.ConfigProvider)==null?void 0:V.useConfig)==null?void 0:Z.call(V))||{componentSize:"middle"},M=d.useRef(g||R),{RowWrapper:O}=or({grid:w,rowProps:b}),Y=be(()=>R),H=d.useMemo(()=>({getFieldsFormatValue:(B,U)=>{const J=Y();if(!J)return{};const G=J.getFieldsValue(B);return l(G,U!==void 0?U:v)},getFieldFormatValue:(B=[],U)=>{const J=Y();if(!J)return;const G=ds(B);if(!G)throw new Error("nameList is require");const K=J.getFieldValue(G),A=G?_e({},G,K):K,k=[...G];k.shift();const N=l(A,U!==void 0?U:v,k),P=Me(N,G);if(P&&typeof P=="object"&&!Array.isArray(P)){const L=Object.values(P)[0];return Array.isArray(L),L}return P},getFieldFormatValueObject:(B,U)=>{const J=Y();if(!J)return{};const G=ds(B),K=J.getFieldValue(G),A=G?_e({},G,K):K;return l(A,U!==void 0?U:v,G)},validateFieldsReturnFormatValue:async(B,U)=>{const J=Y();if(!J)return{};if(!Array.isArray(B)&&B)throw new Error("nameList must be array");const G=await J.validateFields(B),K=l(G,U!==void 0?U:v);return K||{}}}),[v,l,Y]),D=d.useMemo(()=>d.Children.toArray(t).map((B,U)=>U===0&&d.isValidElement(B)&&C?Ui(B,C):B),[C,t]),I=d.useMemo(()=>typeof r=="boolean"||!r?{}:r,[r]),$=d.useMemo(()=>{if(r!==!1)return s.jsx(b0,{...I,onReset:()=>{var U,J,G;const B=l((U=M.current)==null?void 0:U.getFieldsValue(),v);if((J=I==null?void 0:I.onReset)==null||J.call(I,B),j==null||j(B),S){const K=Object.keys(l((G=M.current)==null?void 0:G.getFieldsValue(),!1)).reduce((A,k)=>({...A,[k]:B[k]||void 0}),p);y(Is(S,K||{},"set"))}},submitButtonProps:{loading:f,...I.submitButtonProps}},"submitter")},[r,I,f,l,v,j,S,p,y]),z=d.useMemo(()=>{const B=w?s.jsx(O,{children:D}):D;return n?n(B,$,M.current):B},[w,O,D,n,$]),_=Tr(e.initialValues);return d.useEffect(()=>{if(S||!e.initialValues||!_||F.request)return;const B=hn(e.initialValues,_);$c(B,"initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null "),$c(B,"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:(B,U)=>{const J=M.current;if(!J)return{};const G=J.getFieldsValue(B);return l(G,U!==void 0?U:v)},getFieldFormatValue:(B=[],U)=>{const J=M.current;if(!J)return;const G=ds(B);if(!G)throw new Error("nameList is require");const K=J.getFieldValue(G),A=G?_e({},G,K):K,k=[...G];k.shift();const N=l(A,U!==void 0?U:v,k),P=Me(N,G);if(P&&typeof P=="object"&&!Array.isArray(P)){const L=Object.values(P)[0];return Array.isArray(L),L}return P},getFieldFormatValueObject:(B,U)=>{const J=M.current;if(!J)return{};const G=ds(B),K=J.getFieldValue(G),A=G?_e({},G,K):K;return l(A,U!==void 0?U:v,G)},validateFieldsReturnFormatValue:async(B,U)=>{const J=M.current;if(!J)return{};if(!Array.isArray(B)&&B)throw new Error("nameList must be array");const G=await J.validateFields(B),K=l(G,U!==void 0?U:v);return K||{}}}),[v,l,M.current]),d.useEffect(()=>{var U,J;const B=l((J=(U=M.current)==null?void 0:U.getFieldsValue)==null?void 0:J.call(U,!0),v);h==null||h(B,{...M.current,...H})},[]),s.jsx(Nr.Provider,{value:{...H,formRef:M},children:s.jsx(c.ConfigProvider,{componentSize:F.size||E,children:s.jsxs(ro.Provider,{value:{grid:w,colProps:T},children:[F.component!==!1&&s.jsx("input",{type:"text",style:{display:"none"}}),z]})})})}let Ec=0;function cr(e){const{extraUrlParams:t=Ed,syncToUrl:n,isKeyPressSubmit:r,syncToUrlAsImportant:a=!1,syncToInitialValues:i=!0,children:o,contentRender:l,submitter:u,fieldProps:h,proFieldProps:g,formItemProps:f,groupProps:m,dateFormatter:p="string",formRef:S,onInit:y,form:j,formComponentType:v,onReset:x,grid:C,rowProps:w,colProps:b,omitNil:T=!0,request:F,params:R,initialValues:E,formKey:M=Ec,readonly:O,onLoadingChange:Y,loading:H,...D}=e,I=d.useRef({}),[$,z]=Je(!1,H),_=be(ce=>{Y==null||Y(ce)}),V=d.useCallback(ce=>{z(ue=>{const he=typeof ce=="function"?ce(ue):ce;return queueMicrotask(()=>{_(he)}),he})},[_]),[Z,B]=p0({},{disabled:!n}),U=d.useRef(Or());d.useEffect(()=>{Ec+=0},[]);const[J,G]=Op({request:F,params:R,proFieldKey:M}),{getPrefixCls:K}=d.useContext(c.ConfigProvider.ConfigContext),A=K("pro-form"),{wrapSSR:k,hashId:N}=Be("ProForm",ce=>({[`.${A}`]:{[`> div:not(${ce.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}}}}})),[P,L]=d.useState(()=>n?Is(n,Z,"get"):{}),W=d.useRef({}),q=d.useRef({}),Q=be((ce,ue,he)=>!ce||typeof ce!="object"?ce:MC(di(ce,p,q.current,ue,he),W.current));d.useEffect(()=>{i||L({})},[i]);const ee=be(()=>({...Z,...t}));d.useEffect(()=>{n&&B(Is(n,ee(),"set"))},[t,ee,n]);const re=d.useMemo(()=>{if(!(typeof window>"u")&&v&&["DrawerForm"].includes(v))return ce=>ce.parentNode||document.body},[v]),le=be(async()=>{var ce,ue,he,se;if(D.onFinish&&!$)try{V(!0);const de=((ue=(ce=I==null?void 0:I.current)==null?void 0:ce.getFieldsFormatValue)==null?void 0:ue.call(ce))||{},ge=D.onFinish(de);if(ge&&typeof ge=="object"&&typeof ge.then=="function"){try{await ge}catch(ne){throw V(!1),ne}V(!1)}else V(!1);if(n){const ne=Object.keys(((se=(he=I==null?void 0:I.current)==null?void 0:he.getFieldsFormatValue)==null?void 0:se.call(he,!0,!1))||{}).reduce((te,X)=>({...te,[X]:de[X]??void 0}),t);Object.keys(Z).forEach(te=>{ne[te]!==!1&&ne[te]!==0&&!ne[te]&&(ne[te]=void 0)}),B(Is(n,ne,"set"))}}catch{V(!1)}});return d.useImperativeHandle(S,()=>I.current,[!J]),F&&G?s.jsx("div",{style:{paddingTop:50,paddingBottom:50,textAlign:"center"},children:s.jsx(c.Spin,{})}):k(s.jsx(Br.Provider,{value:{mode:e.readonly?"read":"edit"},children:s.jsx(Mn,{needDeps:!0,children:s.jsx(lr.Provider,{value:{formRef:I,fieldProps:h,proFieldProps:g,formItemProps:f,groupProps:m,formComponentType:v,getPopupContainer:re,formKey:U.current,setFieldValueType:(ce,{valueType:ue="text",dateFormat:he,transform:se})=>{Array.isArray(ce)&&(se&&(W.current=_e(W.current,ce,se)),q.current=_e(q.current,ce,{valueType:ue,dateFormat:he}))}},children:s.jsx(tr.Provider,{value:{},children:s.jsx(c.Form,{onKeyDown:ce=>{var ue;r&&ce.key==="Enter"&&((ue=I.current)==null||ue.submit())},autoComplete:"off",form:j,...Le(D,["ref","labelWidth","autoFocusFirstInput","rootClassName"]),ref:ce=>{I.current&&(I.current.nativeElement=ce==null?void 0:ce.nativeElement,I.current.focus=()=>{var he;const ue=(he=ce==null?void 0:ce.nativeElement)==null?void 0:he.querySelector("input, textarea, select");ue==null||ue.focus()})},initialValues:a?{...E,...J,...P}:{...P,...E,...J},onValuesChange:(ce,ue)=>{var he;(he=D==null?void 0:D.onValuesChange)==null||he.call(D,Q(ce,!!T),Q(ue,!!T))},className:e.className,rootClassName:ie(A,N,e.rootClassName),onFinish:le,children:s.jsx(S0,{transformKey:Q,autoComplete:"off",loading:$||!!(F&&!J&&G),onUrlSearchChange:B,...e,formRef:I,initialValues:{...E,...J}})})})})})}))}const C0=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 w0(e){return Be("LightWrapper",t=>{const n={...t,componentCls:`.${e}`};return[C0(n)]})}const j0=e=>{var H;const{label:t,size:n,disabled:r,onChange:a,className:i,style:o,children:l,valuePropName:u,placeholder:h,labelFormatter:g,variant:f,footerRender:m,allowClear:p,otherFieldProps:S,valueType:y,placement:j,...v}=e,{getPrefixCls:x}=d.useContext(c.ConfigProvider.ConfigContext),C=x("pro-field-light-wrapper"),{wrapSSR:w,hashId:b}=w0(C),[T,F]=d.useState(e[u]),[R,E]=d.useState(!1),M=(...D)=>{var I;(I=S==null?void 0:S.onChange)==null||I.call(S,...D),a==null||a(...D)},O=e[u],Y=d.useMemo(()=>{var I;if(!O)return O;const D=(I=y==null?void 0:y.toLowerCase)==null?void 0:I.call(y);return D!=null&&D.endsWith("range")&&D!=="digitrange"&&!g?jp(O,y&&Ki[y]||"YYYY-MM-DD"):Array.isArray(O)?O.map($=>typeof $=="object"&&$.label&&$.value?$.label:$):O},[O,y,g]);return w(s.jsx(ku,{disabled:r,open:R,onOpenChange:E,placement:j,label:s.jsx(Yt,{ellipsis:!0,size:n,onClear:()=>{M==null||M(),F(null)},variant:f,style:o,className:i,label:t,placeholder:h,value:Y,disabled:r,formatter:g,allowClear:p}),footer:{onClear:()=>F(null),onConfirm:()=>{M==null||M(T),E(!1)}},footerRender:m,children:s.jsx("div",{className:ie(`${C}-container`,b,i),style:o,children:d.cloneElement(l,{...v,[u]:T,onChange:D=>{F(D!=null&&D.target?D.target.value:D)},...l.props,variant:"borderless",fieldProps:{...(H=l.props)==null?void 0:H.fieldProps,variant:"borderless"}})})}))},v0=e=>{const{fieldProps:t,children:n,labelCol:r,label:a,autoFocus:i,isDefaultDom:o,render:l,proFieldProps:u,formItemRender:h,valueType:g,initialValue:f,onChange:m,valueEnum:p,params:S,name:y,dependenciesValues:j,cacheForSwr:v=!1,valuePropName:x="value",...C}=e,w=d.useContext(Br),b=d.useMemo(()=>j&&C.request?{...S,...j||{}}:S,[j,S,C.request]),T=be((...E)=>{var M;if(t!=null&&t.onChange){(M=t==null?void 0:t.onChange)==null||M.call(t,...E);return}}),F=d.useMemo(()=>({autoFocus:i,...t,onChange:T}),[i,t,T]),R=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 R||s.jsx(hj,{text:t==null?void 0:t[x],render:l,formItemRender:h,valueType:g||"text",cacheForSwr:v,fieldProps:F,valueEnum:mt(p),...u,...C,mode:(u==null?void 0:u.mode)||w.mode||"edit",params:b})},xn=Zn==null?void 0:Zn(v0),T0=({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(xn,{valueType:"digit",fieldProps:{min:t,max:r,...e},ref:i,fieldConfig:{defaultProps:{width:"100%"}},proFieldProps:n,...a})}),F0=d.forwardRef(T0),R0={space:c.Space,group:c.Space.Compact};function $0(e,...t){const n=t[0];return n&&n.target&&e in n.target?n.target[e]:n}const E0=e=>{const{children:t,value:n=[],valuePropName:r,onChange:a,fieldProps:i,space:o,type:l="space",transform:u,convertValue:h,lightProps:g,...f}=e,m=be((x,C)=>{var b;const w=[...n];w[C]=$0(r||"value",x),a==null||a(w),(b=i==null?void 0:i.onChange)==null||b.call(i,w)});let p=-1;const S=gn(mt(t,n,e)).map(x=>{var C,w,b;if(d.isValidElement(x)){p+=1;const T=p,R=((C=x==null?void 0:x.type)==null?void 0:C.displayName)==="ProFormComponent"||((w=x==null?void 0:x.props)==null?void 0:w.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,O;m(E,T),(O=(M=x.props).onChange)==null||O.call(M,E)}};return d.cloneElement(x,R)}return x}),y=R0[l],{RowWrapper:j}=or(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(j,{Wrapper:v,children:S})},I0=d.forwardRef(({children:e,space:t,valuePropName:n,...r},a)=>(d.useImperativeHandle(a,()=>({})),s.jsx(E0,{space:t,valuePropName:n,...r.fieldProps,onChange:void 0,...r,children:e}))),M0=Zn==null?void 0:Zn(I0),O0=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 A0(e){return Be("ProFormGroup",t=>{const n={...t,componentCls:`.${e}`};return[O0(n)]})}const Id=d.forwardRef((e,t)=>{const{groupProps:n}=d.useContext(lr),{children:r,collapsible:a,defaultCollapsed:i,style:o,labelLayout:l,title:u=e.label,tooltip:h,align:g="start",direction:f,size:m=32,titleStyle:p,titleRender:S,spaceProps:y,extra:j,autoFocus:v}={...n,...e},[x,C]=Je(()=>i||!1,e.collapsed),w=be(_=>{var V;(V=e.onCollapse)==null||V.call(e,_)}),b=d.useCallback(_=>{C(V=>{const Z=typeof _=="function"?_(V):_;return queueMicrotask(()=>{w(Z)}),Z})},[w]),{getPrefixCls:T}=d.useContext(c.ConfigProvider.ConfigContext),{ColWrapper:F,RowWrapper:R}=or(e),E=T("pro-form-group"),{wrapSSR:M,hashId:O}=A0(E),Y=a&&s.jsx(ae.RightOutlined,{style:{marginInlineEnd:8},rotate:x?void 0:90}),H=s.jsx(Xn,{label:Y?s.jsxs("div",{children:[Y,u]}):u,tooltip:h}),D=d.useCallback(({children:_})=>s.jsx(c.Space,{...y,className:ie(`${E}-container ${O}`,y==null?void 0:y.className),size:m,align:g,orientation:f,style:{rowGap:0,...y==null?void 0:y.style},children:_}),[g,E,f,O,m,y]),I=S?S(H,e):H,[$,z]=d.useMemo(()=>{const _=[],V=d.Children.toArray(r).map((Z,B)=>{var U;return d.isValidElement(Z)&&((U=Z==null?void 0:Z.props)!=null&&U.hidden)?(_.push(Z),null):B===0&&d.isValidElement(Z)&&v?Ui(Z,v):Z});return[s.jsx(R,{Wrapper:D,children:V},"children"),_.length>0?s.jsx("div",{style:{display:"none"},children:_},"hidden"):null]},[r,R,D,v]);return M(s.jsx(F,{children:s.jsxs("div",{className:ie(E,O,{[`${E}-twoLine`]:l==="twoLine"}),style:o,ref:t,children:[z,(u||h||j)&&s.jsx("div",{role:"button",tabIndex:0,className:ie(`${E}-title`,O),style:p,onClick:()=>{b(!x)},onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),b(!x))},children:j?s.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[I,s.jsx("span",{role:"presentation",onClick:_=>_.stopPropagation(),onKeyDown:_=>_.stopPropagation(),children:j})]}):I}),s.jsx("div",{style:{display:a&&x?"none":void 0},children:$})]})}))});Id.displayName="ProForm-Group";const k0=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 D0(e){return Be("DrawerForm",t=>{const n={...t,componentCls:`.${e}`};return[k0(n)]})}const{noteOnce:P0}=He;function N0({children:e,trigger:t,drawerProps:n,onFinish:r,submitTimeout:a,title:i,width:o,resize:l,onOpenChange:u,open:h,...g}){var U,J,G,K;P0(!g.footer||!(n!=null&&n.footer),"DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const f=d.useMemo(()=>{const A={onResize:()=>{},maxWidth:Zi()?window.innerWidth*.8:void 0,minWidth:300};return typeof l=="boolean"?l?A:{}:it({onResize:(l==null?void 0:l.onResize)??A.onResize,maxWidth:(l==null?void 0:l.maxWidth)??A.maxWidth,minWidth:(l==null?void 0:l.minWidth)??A.minWidth})},[l]),m=d.useContext(c.ConfigProvider.ConfigContext),p=m.getPrefixCls("pro-form-drawer"),{wrapSSR:S,hashId:y}=D0(p),j=A=>`${p}-${A}`,[,v]=d.useState([]),[x,C]=d.useState(!1),[w,b]=d.useState(!1),[T,F]=d.useState(o||(l?f==null?void 0:f.minWidth:800)),[R,E]=Je(!!h,h),M=be(A=>{u==null||u(A)}),O=d.useCallback(A=>{E(k=>{const N=typeof A=="function"?A(k):A;return queueMicrotask(()=>{M(N)}),N})},[M]),Y=d.useRef(null),H=d.useCallback(A=>{Y.current===null&&A&&v([]),Y.current=A},[]),D=d.useRef(),I=d.useCallback(()=>{var k;const A=((k=g.formRef)==null?void 0:k.current)??g.form??D.current;A&&(n!=null&&n.destroyOnHidden)&&typeof A.resetFields=="function"&&A.resetFields()},[n==null?void 0:n.destroyOnHidden,g.form,g.formRef]);d.useEffect(()=>{R&&h&&(u==null||u(!0)),w&&F(f==null?void 0:f.minWidth)},[h,R,w]),d.useImperativeHandle(g.formRef,()=>D.current,[D.current]);const $=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async A=>{var k,N;O(!R),b(!Object.keys(f)),(N=(k=t.props)==null?void 0:k.onClick)==null||N.call(k,A)}}):null,[O,t,R,b,w]),z=d.useMemo(()=>{var A,k,N,P;return g.submitter===!1?!1:Kn({searchConfig:{submitText:((k=(A=m.locale)==null?void 0:A.Modal)==null?void 0:k.okText)??"确认",resetText:((P=(N=m.locale)==null?void 0:N.Modal)==null?void 0:P.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:a&&x,onClick:L=>{var W;O(!1),(W=n==null?void 0:n.onClose)==null||W.call(n,L)}}},g.submitter??{})},[g.submitter,(J=(U=m.locale)==null?void 0:U.Modal)==null?void 0:J.okText,(K=(G=m.locale)==null?void 0:G.Modal)==null?void 0:K.cancelText,a,x,O,n]),_=d.useCallback((A,k)=>s.jsxs(s.Fragment,{children:[A,Y.current&&k?s.jsx(d.Fragment,{children:zc.createPortal(k,Y.current)},"submitter"):k]}),[]),V=be(async A=>{const k=r==null?void 0:r(A);if(a&&k instanceof Promise){C(!0);const P=setTimeout(()=>C(!1),a);try{const L=await k;return clearTimeout(P),C(!1),L&&O(!1),L}catch(L){throw clearTimeout(P),C(!1),L}}else if(a){C(!0);const P=setTimeout(()=>C(!1),a);try{const L=await k;return clearTimeout(P),C(!1),L&&O(!1),L}catch(L){throw clearTimeout(P),C(!1),L}}const N=await k;return N&&O(!1),N}),Z=d.useCallback(A=>{const k=(document.body.offsetWidth||1e3)-(A.clientX-document.body.offsetLeft),N=(f==null?void 0:f.minWidth)??(o||800),P=(f==null?void 0:f.maxWidth)??window.innerWidth*.8;if(k<N){F(N);return}if(k>P){F(P);return}F(k)},[f==null?void 0:f.maxWidth,f==null?void 0:f.minWidth,o]),B=d.useCallback(()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",B)},[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:R,afterOpenChange:A=>{var k;!A&&(n!=null&&n.destroyOnHidden)&&I(),(k=n==null?void 0:n.afterOpenChange)==null||k.call(n,A),u==null||u(A)},onClose:A=>{var k;a&&x||(O(!1),(k=n==null?void 0:n.onClose)==null||k.call(n,A))},footer:g.submitter!==!1&&s.jsx("div",{ref:H,style:{display:"flex",justifyContent:"flex-end"}}),children:[l?s.jsx("div",{className:ie(j("sidebar-dragger"),y,{[j("sidebar-dragger-min-disabled")]:T===(f==null?void 0:f.minWidth),[j("sidebar-dragger-max-disabled")]:T===(f==null?void 0:f.maxWidth)}),onMouseDown:A=>{var k;(k=f==null?void 0:f.onResize)==null||k.call(f),A.stopPropagation(),A.preventDefault(),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",B),b(!0)}}):null,s.jsx(s.Fragment,{children:s.jsx(cr,{formComponentType:"DrawerForm",layout:"vertical",...g,formRef:D,onInit:(A,k)=>{var N;g.formRef&&(g.formRef.current=k),(N=g==null?void 0:g.onInit)==null||N.call(g,A,k),D.current=k},submitter:z,onFinish:async A=>await V(A),contentRender:_,children:e})})]}),$]}))}const L0=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 _0(e){return Be("LightFilter",t=>{const n={...t,componentCls:`.${e}`};return[L0(n)]})}const z0=e=>{const{items:t,prefixCls:n,size:r="middle",collapse:a,collapseLabel:i,onValuesChange:o,variant:l="borderless",values:u,footerRender:h,placement:g,popoverProps:f}=e,m=Fe(),p=`${n}-light-filter`,{wrapSSR:S,hashId:y}=_0(p),[j,v]=d.useState(!1),[x,C]=d.useState(()=>({...u})),w=d.useMemo(()=>i||(a?s.jsx(ae.FilterOutlined,{className:ie(`${p}-collapse-icon`,y)}):s.jsx(Yt,{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=[],R=[];return t.forEach(E=>{const{secondary:M}=E.props||{};M||a?F.push(E):R.push(E)}),{collapseItems:F,outsideItems:R}},[e.items]);return S(s.jsx("div",{className:ie(p,y,`${p}-${r}`,{[`${p}-effective`]:Object.keys(u).some(F=>Array.isArray(u[F])?u[F].length>0:u[F])}),children:s.jsxs("div",{className:ie(`${p}-container`,y),children:[T.map((F,R)=>{if(!(F!=null&&F.props))return F;const{key:E}=F,{fieldProps:M}=(F==null?void 0:F.props)||{},O=M!=null&&M.placement?M==null?void 0:M.placement:g;return s.jsx("div",{className:ie(`${p}-item`,y),children:d.cloneElement(F,{fieldProps:{...F.props.fieldProps,placement:O,variant:"borderless"},proFieldProps:{...F.props.proFieldProps,light:!0,label:F.props.label,variant:l},variant:l})},E||R)}),b.length?s.jsx("div",{className:ie(`${p}-item`,y),children:s.jsx(ku,{padding:24,open:j,onOpenChange:F=>{v(F)},placement:g,popoverProps:f,label:w,footerRender:h,footer:{onConfirm:()=>{o({...x}),v(!1)},onClear:()=>{const F={};b.forEach(R=>{const{name:E}=R.props;F[E]=void 0}),o(F)}},children:b.map(F=>{const{key:R}=F,{name:E,fieldProps:M}=F.props,O={...M,onChange:H=>(C({...x,[E]:H!=null&&H.target?H.target.value:H}),!1)};x.hasOwnProperty(E)&&(O[F.props.valuePropName||"value"]=x[E]);const Y=M!=null&&M.placement?M==null?void 0:M.placement:g;return s.jsx("div",{className:ie(`${p}-line`,y),children:d.cloneElement(F,{fieldProps:{...O,placement:Y,variant:l}})},R)})})},"more"):null]})}))};function B0(e){const{size:t,collapse:n,collapseLabel:r,initialValues:a,onValuesChange:i,form:o,placement:l,formRef:u,variant:h,ignoreRules:g,footerRender:f,popoverProps:m,...p}=e,{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-form"),[j,v]=d.useState(()=>({...a})),x=d.useRef();return d.useImperativeHandle(u,()=>x.current,[x.current]),s.jsx(cr,{size:t,initialValues:a,form:o,contentRender:C=>s.jsx(z0,{prefixCls:y,items:C==null?void 0:C.flatMap(w=>{var b;return!w||!(w!=null&&w.type)?w:((b=w==null?void 0:w.type)==null?void 0:b.displayName)==="ProForm-Group"?w.props.children:w}),size:t,variant:h||"borderless",collapse:n,collapseLabel:r,placement:l,popoverProps:m,values:j||{},footerRender:f,onValuesChange:w=>{var T,F;const b={...j,...w};v(b),(T=x.current)==null||T.setFieldsValue(b),(F=x.current)==null||F.submit(),i&&i(w,b)}},JSON.stringify(j||{})),formRef:x,formItemProps:{colon:!1,labelAlign:"left"},fieldProps:{style:{width:void 0}},...Le(p,["labelWidth"]),onValuesChange:(C,w)=>{var b;v(w),i==null||i(C,w),(b=x.current)==null||b.submit()}})}const{noteOnce:V0}=He;function H0({children:e,trigger:t,onOpenChange:n,modalProps:r,onFinish:a,submitTimeout:i,title:o,width:l,open:u,...h}){var M,O,Y,H;V0(!h.footer||!(r!=null&&r.footer),"ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const g=d.useContext(c.ConfigProvider.ConfigContext),[,f]=d.useState([]),[m,p]=d.useState(!1),[S,y]=Je(!1,u),j=be(D=>{n==null||n(D)}),v=d.useCallback(D=>{y(I=>{const $=typeof D=="function"?D(I):D;return queueMicrotask(()=>{j($)}),$})},[j]),x=d.useRef(null),C=d.useCallback(D=>{x.current===null&&D&&f([]),x.current=D},[]),w=d.useRef(),b=d.useCallback(()=>{var I;const D=h.form??((I=h.formRef)==null?void 0:I.current)??w.current;D&&(r!=null&&r.destroyOnHidden)&&typeof D.resetFields=="function"&&D.resetFields()},[r==null?void 0:r.destroyOnHidden,h.form,h.formRef]);d.useImperativeHandle(h.formRef,()=>w.current,[w.current]),d.useEffect(()=>{u&&(n==null||n(!0))},[u]);const T=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async D=>{var I,$;v(!S),($=(I=t.props)==null?void 0:I.onClick)==null||$.call(I,D)}}):null,[v,t,S]),F=d.useMemo(()=>{var D,I,$,z;return h.submitter===!1?!1:_s({searchConfig:{submitText:(r==null?void 0:r.okText)??((I=(D=g.locale)==null?void 0:D.Modal)==null?void 0:I.okText)??"确认",resetText:(r==null?void 0:r.cancelText)??((z=($=g.locale)==null?void 0:$.Modal)==null?void 0:z.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:i&&m,onClick:_=>{var V;v(!1),(V=r==null?void 0:r.onCancel)==null||V.call(r,_)}}},h.submitter??{})},[(O=(M=g.locale)==null?void 0:M.Modal)==null?void 0:O.cancelText,(H=(Y=g.locale)==null?void 0:Y.Modal)==null?void 0:H.okText,r,h.submitter,v,m,i]),R=d.useCallback((D,I)=>s.jsxs(s.Fragment,{children:[D,x.current&&I?s.jsx(d.Fragment,{children:zc.createPortal(I,x.current)},"submitter"):I]}),[]),E=d.useCallback(async D=>{const I=a==null?void 0:a(D);if(i&&I instanceof Promise){p(!0);const z=setTimeout(()=>p(!1),i);try{const _=await I;return clearTimeout(z),p(!1),_&&v(!1),_}catch(_){throw clearTimeout(z),p(!1),_}}else if(i){p(!0);const z=setTimeout(()=>p(!1),i);try{const _=await I;return clearTimeout(z),p(!1),_&&v(!1),_}catch(_){throw clearTimeout(z),p(!1),_}}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:D=>{var I;i&&m||(v(!1),(I=r==null?void 0:r.onCancel)==null||I.call(r,D))},afterClose:()=>{var D;r!=null&&r.destroyOnHidden&&b(),S&&v(!1),(D=r==null?void 0:r.afterClose)==null||D.call(r)},footer:h.submitter!==!1?s.jsx("div",{ref:C,style:{display:"flex",justifyContent:"flex-end"}}):null,children:s.jsx(cr,{formComponentType:"ModalForm",layout:"vertical",...h,onInit:(D,I)=>{var $;h.formRef&&(h.formRef.current=I),($=h==null?void 0:h.onInit)==null||$.call(h,D,I),w.current=I},formRef:w,submitter:F,onFinish:async D=>await E(D),contentRender:R,children:e})}),T]})}const Oi=ye.createContext(null);function Y0({children:e,onBatchResize:t}){const n=ye.useRef(0),r=ye.useRef([]),a=ye.useContext(Oi),i=ye.useCallback((o,l,u)=>{n.current+=1;const h=n.current;r.current.push({size:o,element:l,data:u}),Promise.resolve().then(()=>{h===n.current&&(t==null||t(r.current),r.current=[])}),a==null||a(o,l,u)},[t,a]);return ye.createElement(Oi.Provider,{value:i},e)}const Gt=new Map;function Md(e){e.forEach(t=>{var r;const{target:n}=t;(r=Gt.get(n))==null||r.forEach(a=>a(n))})}let _a;function Od(){return _a||(_a=new ResizeObserver(Md)),_a}process.env.NODE_ENV;process.env.NODE_ENV;function U0(e,t){Gt.has(e)||(Gt.set(e,new Set),Od().observe(e)),Gt.get(e).add(t)}function K0(e,t){Gt.has(e)&&(Gt.get(e).delete(t),Gt.get(e).size||(Od().unobserve(e),Gt.delete(e)))}function W0(e,t,n,r){const a=ye.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=Uc(u=>{const{width:h,height:g}=u.getBoundingClientRect(),{offsetWidth:f,offsetHeight:m}=u,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 j=f===Math.round(h)?h:f,v=m===Math.round(g)?g:m,x={...y,offsetWidth:j,offsetHeight:v};r==null||r(x,u),Promise.resolve().then(()=>{n==null||n(x,u)})}}),o=typeof t=="function",l=ye.useRef(0);ye.useEffect(()=>{const u=o?t():t;return u&&e?U0(u,i):e&&o&&(l.current+=1),()=>{u&&K0(u,i)}},[e,o?l.current:t])}function q0(e,t){const{children:n,disabled:r,onResize:a,data:i}=e,o=ye.useRef(null),l=ye.useContext(Oi),u=typeof n=="function",h=u?n(o):n,g=!u&&ye.isValidElement(h)&&vf(h),f=g?Tf(h):null,m=jf(f,o),p=()=>Mf(o.current);return ye.useImperativeHandle(t,()=>p()),W0(!r,p,a,(S,y)=>{l==null||l(S,y,i)}),g?ye.cloneElement(h,{ref:m}):h}const Ad=ye.forwardRef(q0);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 G0="rc-observer-key";function Z0(e,t){const{children:n}=e,r=typeof n=="function"?[n]:gn(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)||`${G0}-${i}`;return ye.createElement(Ad,Ai({},e,{key:o,ref:i===0?t:void 0}),a)})}const ra=ye.forwardRef(Z0);process.env.NODE_ENV!=="production"&&(ra.displayName="ResizeObserver");ra.Collection=Y0;const J0=(e,t,n,r)=>e?s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.collapsed","展开"),r&&`(${r})`,s.jsx(ae.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(ae.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}),X0=e=>{const{setCollapsed:t,collapsed:n=!1,submitter:r,style:a,hiddenNum:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=Fe(),{hashId:u}=d.useContext(Ht),h=Lu(e.collapseRender)||J0;return s.jsxs(c.Space,{style:a,size:16,children:[r,e.collapseRender!==!1&&s.jsx("a",{className:ie(o("pro-query-filter-collapse-button"),u),onClick:()=>t(!n),children:h==null?void 0:h(n,e,l,i)})]})},Q0=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 ev(e){return Be("QueryFilter",t=>{const n={...t,componentCls:`.${e}`};return[Q0(n)]})}const tv=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"]]}}},nv=(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"}},rv=(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}),sv=e=>{var D,I,$;const t=Fe(),{hashId:n}=d.useContext(Ht),r=e.resetText||t.getMessage("tableForm.reset","重置"),a=e.searchText||t.getMessage("tableForm.search","搜索"),[i,o]=Je(()=>e.defaultCollapsed&&!!e.submitter,e.collapsed),l=be(z=>{var _;(_=e.onCollapse)==null||_.call(e,z)}),u=d.useCallback(z=>{o(_=>{const V=typeof z=="function"?z(_):z;return queueMicrotask(()=>{l(V)}),V})},[l]),{optionRender:h,collapseRender:g,split:f,items:m,spanSize:p,showLength:S,searchGutter:y,showHiddenNum:j}=e,v=d.useMemo(()=>!e.submitter||h===!1?null:d.cloneElement(e.submitter,{searchConfig:{resetText:r,submitText:a},render:h&&((z,_)=>h({...e,resetText:r,searchText:a},e,_)),...e.submitter.props}),[e,r,a,h]);let x=0,C=0,w=!1,b=0,T=0;const F=rv(m,e.ignoreRules).map((z,_)=>{var J,G,K,A;const V=d.isValidElement(z)?((J=z==null?void 0:z.props)==null?void 0:J.colSize)??1:1,Z=Math.min(p.span*(V||1),24);x+=Z,b+=V,_===0&&(w=Z===24&&!((G=z==null?void 0:z.props)!=null&&G.hidden));const B=((K=z==null?void 0:z.props)==null?void 0:K.hidden)||i&&(w||b>S)&&!!_;C+=1;const U=d.isValidElement(z)&&(z.key||`${(A=z.props)==null?void 0:A.name}`)||_;return d.isValidElement(z)&&B?e.preserve?{itemDom:d.cloneElement(z,{hidden:!0,key:U||_}),hidden:!0,colSpan:Z}:{itemDom:null,colSpan:0,hidden:!0}:{itemDom:z,colSpan:Z,hidden:!1}}),R=F.map((z,_)=>{var J,G;const{itemDom:V,colSpan:Z}=z;if((J=V==null?void 0:V.props)==null?void 0:J.hidden)return V;const U=d.isValidElement(V)&&(V.key||`${(G=V.props)==null?void 0:G.name}`)||_;return 24-T%24<Z&&(x+=24-T%24,T+=24-T%24),T+=Z,f&&T%24===0&&_<C-1?s.jsx(c.Col,{span:Z,className:ie(`${e.baseClassName}-row-split-line`,`${e.baseClassName}-row-split`,n),children:V},U):s.jsx(c.Col,{className:ie(`${e.baseClassName}-row-split`,n),span:Z,children:V},U)}),E=j&&F.filter(z=>z.hidden).length,M=d.useMemo(()=>!(x<24||b<=S),[b,S,x]),O=d.useMemo(()=>{var _,V;const z=T%24+(((_=e.submitterColSpanProps)==null?void 0:_.span)??p.span);return z>24?24-(((V=e.submitterColSpanProps)==null?void 0:V.span)??p.span):24-z},[T,T%24+(((D=e.submitterColSpanProps)==null?void 0:D.span)??p.span),(I=e.submitterColSpanProps)==null?void 0:I.span]),H=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter");return s.jsxs(c.Row,{gutter:y,justify:"start",className:ie(`${H}-row`,n),children:[R,v&&s.jsx(c.Col,{span:p.span,offset:O,className:ie(($=e.submitterColSpanProps)==null?void 0:$.className),...e.submitterColSpanProps,style:{textAlign:"end"},children:s.jsx(c.Form.Item,{label:" ",colon:!1,shouldUpdate:!1,className:ie(`${H}-actions`,n),children:s.jsx(X0,{hiddenNum:E,collapsed:i,collapseRender:M?g:!1,submitter:v,setCollapsed:u},"pro-form-query-filter-actions")})},"submitter")]},"resize-observer-row")};var _c;const av=Zi()?(_c=document==null?void 0:document.body)==null?void 0:_c.clientWidth:1024;function iv(e){const{collapsed:t,layout:n,defaultCollapsed:r=!0,defaultColsNumber:a,defaultFormItemsNumber:i,span:o,searchGutter:l=24,searchText:u,resetText:h,optionRender:g,collapseRender:f,onReset:m,onCollapse:p,labelWidth:S="80",style:y,split:j,preserve:v=!0,ignoreRules:x,showHiddenNum:C=!1,submitterColSpanProps:w,...b}=e,F=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter"),{wrapSSR:R,hashId:E}=ev(F),{token:M}=c.theme.useToken(),[O,Y]=d.useState(()=>typeof(y==null?void 0:y.width)=="number"?y==null?void 0:y.width:av),H=d.useMemo(()=>tv(M),[M.screenSMMin,M.screenMDMin,M.screenLGMin,M.screenXLMin,M.screenXXLMin]),D=d.useMemo(()=>nv(n,O+16,o,H),[n,O,o,H]),I=d.useMemo(()=>{if(i!==void 0)return i;if(a!==void 0){const z=24/D.span-1;return a>z?z:a}return Math.max(1,24/D.span-1)},[a,i,D.span]),$=d.useMemo(()=>{if(S&&D.layout!=="vertical"&&S!=="auto")return{labelCol:{flex:`0 0 ${S}px`},wrapperCol:{style:{maxWidth:`calc(100% - ${S}px)`}},style:{flexWrap:"nowrap"}}},[D.layout,S]);return R(s.jsx(ra,{onResize:z=>{O!==z.width&&z.width>17&&Y(z.width)},children:z=>s.jsx("div",{ref:z,className:ie(`${F}-container`,E),style:e.containerStyle,children:s.jsx(cr,{isKeyPressSubmit:!0,preserve:v,...b,className:ie(F,E,b.className),onReset:m,style:y,layout:D.layout,fieldProps:{style:{width:"100%"}},formItemProps:$,groupProps:{titleStyle:{display:"inline-block",marginInlineEnd:16}},contentRender:(_,V,Z)=>s.jsx(sv,{spanSize:D,collapsed:t,form:Z,submitterColSpanProps:w,collapseRender:f,defaultCollapsed:r,onCollapse:p,optionRender:g,submitter:V,items:_,split:j,baseClassName:F,resetText:e.resetText,searchText:e.searchText,searchGutter:l,preserve:v,ignoreRules:x,showLength:I,showHiddenNum:C})})})},"resize-observer"))}const{noteOnce:ov}=He;function lv(e){const t=d.useRef(),n=d.useContext(kd),r=d.useContext(Dd),a={...e,...r},{onFinish:i,step:o,formRef:l,title:u,stepProps:h,...g}=a;return ov(!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(cr,{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",...Le(g,["layoutType","columns"])})}const cv=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 uv(e){return Be("StepsForm",t=>{const n={...t,componentCls:`.${e}`};return[cv(n)]})}const kd=d.createContext(void 0),dv={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})})]})}},Dd=d.createContext(null);function fv(e){const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=t("pro-steps-form"),{wrapSSR:r,hashId:a}=uv(n),{current:i,onCurrentChange:o,submitter:l,stepsFormRender:u,stepsRender:h,stepFormRender:g,stepsProps:f,onFinish:m,formProps:p,containerStyle:S,formRef:y,formMapRef:j,layoutRender:v,...x}=e,C=d.useRef(new Map),w=d.useRef(new Map),b=d.useRef([]),[T,F]=d.useState([]),[R,E]=d.useState(!1),M=Fe(),[O,Y]=Je(0,e.current),H=be(q=>{var Q;(Q=e.onCurrentChange)==null||Q.call(e,q)}),D=d.useCallback(q=>{Y(Q=>{const ee=typeof q=="function"?q(Q):q;return queueMicrotask(()=>{H(ee)}),ee})},[H]),I=d.useMemo(()=>dv[(f==null?void 0:f.orientation)||"horizontal"],[f==null?void 0:f.orientation]),$=d.useMemo(()=>O===T.length-1,[T.length,O]),z=d.useCallback((q,Q)=>{w.current.has(q)||F(ee=>[...ee,q]),w.current.set(q,Q)},[]),_=d.useCallback(q=>{F(Q=>Q.filter(ee=>ee!==q)),w.current.delete(q),C.current.delete(q)},[]);d.useImperativeHandle(j,()=>b.current,[b.current]),d.useImperativeHandle(y,()=>{var q;return(q=b.current[O||0])==null?void 0:q.current},[O,b.current]);const V=d.useCallback(async(q,Q)=>{if(C.current.set(q,Q),!$||!m)return;E(!0);const ee=Nu({},...Array.from(C.current.values()));try{await m(ee)&&(D(0),b.current.forEach(le=>{var ce;return(ce=le.current)==null?void 0:ce.resetFields()}))}catch(re){console.log(re)}finally{E(!1)}},[$,m,E,D]),Z=d.useMemo(()=>{const q={items:T.map(Q=>{const ee=w.current.get(Q),re={key:Q,title:ee==null?void 0:ee.title,...ee==null?void 0:ee.stepProps};return re.description&&(re.content=re.description,delete re.description),re})};return s.jsx("div",{className:ie(`${n}-steps-container`,a),style:{maxWidth:Math.min(T.length*320,1160)},children:s.jsx(c.Steps,{...f,...q,current:O,onChange:void 0})})},[T,a,n,O,f]),B=be(()=>{var Q;(Q=b.current[O].current)==null||Q.submit()}),U=be(()=>{O<1||D(O-1)}),J=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:R,...l==null?void 0:l.submitButtonProps,onClick:()=>{var q;(q=l==null?void 0:l.onSubmit)==null||q.call(l),B()},children:M.getMessage("stepsForm.next","下一步")},"next"),[M,R,B,l]),G=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{...l==null?void 0:l.resetButtonProps,onClick:()=>{var q;U(),(q=l==null?void 0:l.onReset)==null||q.call(l)},children:M.getMessage("stepsForm.prev","上一步")},"pre"),[M,U,l]),K=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:R,...l==null?void 0:l.submitButtonProps,onClick:()=>{var q;(q=l==null?void 0:l.onSubmit)==null||q.call(l),B()},children:M.getMessage("stepsForm.submit","提交")},"submit"),[M,R,B,l]),A=be(()=>{T.length!==0&&(O>T.length-2||D(O+1))}),k=d.useMemo(()=>{var ee;let q=[];const Q=O||0;if(Q<1?T.length===1?q.push(K):q.push(J):Q+1===T.length?q.push(G,K):q.push(G,J),q=q.filter(d.isValidElement),l&&l.render){const re={form:(ee=b.current[O])==null?void 0:ee.current,onSubmit:B,step:O,onPre:U};return l.render(re,q)}return l&&(l==null?void 0:l.render)===!1?null:q},[T.length,J,B,G,U,O,K,l]),N=d.useMemo(()=>gn(e.children).map((q,Q)=>{const ee=q.props,re=ee.name||`${Q}`,le=O===Q,ce=le?{contentRender:g,submitter:!1}:{};return s.jsx("div",{className:ie(`${n}-step`,a,{[`${n}-step-active`]:le}),children:s.jsx(Dd.Provider,{value:{...ce,...p,...ee,name:re,step:Q},children:q})},re)}),[p,a,n,e.children,O,g]),P=d.useMemo(()=>h?h(T.map(q=>{var Q;return{key:q,title:(Q=w.current.get(q))==null?void 0:Q.title}}),Z):Z,[T,Z,h]),L=d.useMemo(()=>s.jsxs("div",{className:ie(`${n}-container`,a),style:S,children:[N,u?null:s.jsx(c.Space,{children:k})]}),[S,N,a,n,u,k]),W=d.useMemo(()=>{const q={stepsDom:P,formDom:L};return u?u(v?v(q):I(q),k):v?v(q):I(q)},[P,L,I,u,k,v]);return r(s.jsx("div",{className:ie(n,a),children:s.jsx(c.Form.Provider,{...x,children:s.jsx(kd.Provider,{value:{loading:R,setLoading:E,regForm:z,keyArray:T,next:A,formArrayRef:b,formMapRef:w,lastStep:$,unRegForm:_,onFormFinish:V},children:W})})}))}function sa(e){return s.jsx(Mn,{needDeps:!0,children:s.jsx(fv,{...e})})}sa.StepForm=lv;sa.useForm=c.Form.useForm;const mv=({children:e})=>s.jsx(s.Fragment,{children:e}),hv=({steps:e,columns:t,forceUpdate:n,grid:r,...a})=>{const i=qi(a),o=d.useCallback(u=>{var h,g;(g=(h=i.current).onCurrentChange)==null||g.call(h,u),n([])},[n,i]),l=d.useMemo(()=>e==null?void 0:e.map((u,h)=>d.createElement(Pd,{grid:r,...u,key:h,layoutType:"StepForm",columns:t[h]})),[t,r,e]);return s.jsx(sa,{...a,onCurrentChange:o,children:l})},{noteOnce:Ic}=He,gv=(e,t)=>{var n;if(e.valueType==="dependency"){const r=(n=e.getFieldProps)==null?void 0:n.call(e);return Ic(Array.isArray(e.name??(r==null?void 0:r.name)),'SchemaForm: fieldProps.name should be NamePath[] when valueType is "dependency"'),Ic(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},pv=e=>{var t;return e.valueType==="divider"?d.createElement(c.Divider,{...(t=e.getFieldProps)==null?void 0:t.call(e),key:e.key}):!0},yv=(e,{action:t,formRef:n,type:r,originItem:a})=>{const i={...Le(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(xn,{...g,ignoreFormItem:!0},h)},l=e!=null&&e.formItemRender?(h,g)=>{var m,p,S,y;const f=it({...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,u=()=>{if(e!=null&&e.formItemRender){const h=l==null?void 0:l(null,{});if(!h||e.ignoreFormItem)return h}return d.createElement(xn,{...i,key:[e.key,e.index||0].join("-"),formItemRender:l})};return e.dependencies?s.jsx(na,{name:e.dependencies||[],children:u},e.key):u()},xv=(e,{genItems:t})=>{var n,r;return e.valueType==="formList"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(d0,{...(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},bv=(e,{genItems:t})=>{var n,r;return e.valueType==="formSet"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(M0,{...(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},Sv=(e,{genItems:t})=>{var n;return e.valueType==="group"?!e.columns||!Array.isArray(e.columns)?null:s.jsx(Rv,{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},Cv=e=>e.valueType&&typeof e.valueType=="string"&&["index","indexBorder","option"].includes(e==null?void 0:e.valueType)?null:!0,Mc=[Cv,Sv,xv,bv,pv,gv],wv=(e,t)=>{for(let n=0;n<Mc.length;n++){const r=Mc[n],a=r(e,t);if(a!==!0)return a}return yv(e,t)},jv={DrawerForm:N0,QueryFilter:iv,LightFilter:B0,StepForm:sa.StepForm,StepsForm:hv,ModalForm:H0,Embed:mv,Form:gt};function Pd(e){const{columns:t,layoutType:n="Form",type:r="form",action:a,shouldUpdate:i=(T,F)=>fn(T)!==fn(F),formRef:o,...l}=e,u=jv[n]||gt,[h]=c.Form.useForm(),g=c.Form.useFormInstance(),[,f]=d.useState([]),[m,p]=d.useState(()=>[]),S=Dp(e.form||g||h),y=d.useRef(),j=qi(e),v=be(T=>T.filter(F=>!(F.hideInForm&&r==="form")).sort((F,R)=>R.order||F.order?(R.order||0)-(F.order||0):(R.index||0)-(F.index||0)).map((F,R)=>{const E=mt(F.title,F,"form",s.jsx(Xn,{label:F.title,tooltip:F.tooltip})),M=it({title:E,label:E,name:F.name,valueType:mt(F.valueType,{}),key:F.key||F.dataIndex||R,columns:F.columns,valueEnum:F.valueEnum,dataIndex:F.dataIndex||F.key,initialValue:F.initialValue,width:F.width,index:F.index,readonly:F.readonly,colSize:F.colSize,colProps:F.colProps,rowProps:F.rowProps,className:F.className,tooltip:F.tooltip,dependencies:F.dependencies,proFieldProps:F.proFieldProps,ignoreFormItem:F.ignoreFormItem,getFieldProps:F.fieldProps?()=>mt(F.fieldProps,S.current,F):void 0,getFormItemProps:F.formItemProps?()=>mt(F.formItemProps,S.current,F):void 0,render:F.render,formItemRender:F.formItemRender,renderText:F.renderText,request:F.request,params:F.params,transform:F.transform,convertValue:F.convertValue,debounceTime:F.debounceTime,defaultKeyWords:F.defaultKeyWords});return wv(M,{action:a,type:r,originItem:F,formRef:S,genItems:v})}).filter(F=>!!F)),x=d.useCallback((T,F)=>{const{onValuesChange:R}=j.current;(i===!0||typeof i=="function"&&i(F,y.current))&&p([]),y.current=F,R==null||R(T,F)},[j,i]),C=ct(()=>{if(!(t.length&&Array.isArray(t[0])))return v(t)},[t,l==null?void 0:l.open,a,r,m,S.current]),w=ct(()=>n==="StepsForm"?{forceUpdate:f,columns:t}:{},[t,n]);d.useImperativeHandle(o,()=>S.current,[S.current]);const b=d.useContext(Bt);return s.jsx(Mn,{valueTypeMap:{...b.valueTypeMap,...Sd},children:s.jsx(u,{...w,...l,onInit:(T,F)=>{var R;o&&(o.current=F),(R=l==null?void 0:l.onInit)==null||R.call(l,T,F),S.current=F},form:e.form||h,formRef:S,onValuesChange:x,children:C})})}const Ys="text",vv=({fieldProps:e,proFieldProps:t,...n})=>s.jsx(xn,{valueType:Ys,fieldProps:e,fieldConfig:{valueType:Ys},proFieldProps:t,...n}),Tv=e=>{const[t,n]=Je(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})}})},Fv=({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(qn,{...o,text:i}),formItemRender:(i,o)=>s.jsx(qn,{...o,text:i})}},children:s.jsx(Tv,{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(xn,{valueType:"password",fieldProps:{...Le(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(qn,{...o,text:i}),formItemRender:(i,o)=>s.jsx(qn,{...o,text:i})}},children:s.jsx(xn,{valueType:"password",fieldProps:e,proFieldProps:t,fieldConfig:{valueType:Ys},...n})})},Us=vv;Us.Password=Fv;Us.displayName="ProFormComponent";function gt(e){return s.jsx(cr,{layout:"vertical",contentRender:(t,n)=>s.jsxs(s.Fragment,{children:[t,n]}),...e})}gt.Group=Id;gt.useForm=c.Form.useForm;gt.Item=$d;gt.useWatch=c.Form.useWatch;gt.ErrorList=c.Form.ErrorList;gt.Provider=c.Form.Provider;gt.useFormInstance=c.Form.useFormInstance;gt.EditOrReadOnlyContext=Br;const Rv=gt.Group,$v=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 Ev(e){return Be("ProTableAlert",t=>{const n={...t,componentCls:`.${e}`};return[$v(n)]})}const Iv=e=>{const{intl:t,onCleanSelected:n}=e;return[s.jsx("a",{onClick:n,children:t.getMessage("alert.clear","清空")},"0")]};function Mv({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=Iv}){const o=Fe(),l=i&&i({onCleanSelected:t,selectedRowKeys:e,selectedRows:r,intl:o}),{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),h=u("pro-table-alert"),{wrapSSR:g,hashId:f}=Ev(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:ie(h,f),children:s.jsx("div",{className:ie(`${h}-container`,f),children:s.jsxs("div",{className:ie(`${h}-info`,f),children:[s.jsx("div",{className:ie(`${h}-info-content`,f),children:m}),l?s.jsx("div",{className:ie(`${h}-info-option`,f),children:l}):null]})})}))}function Ov(e,t,n){if(e===!1)return!1;const{total:r,current:a,pageSize:i,setPageInfo:o}=t;return{showTotal:(u,h)=>`${n.getMessage("pagination.total.range","第")} ${h[0]}-${h[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,h)=>{const{onChange:g}=e;g==null||g(u,h||20),(h!==i||a!==u)&&o({pageSize:h,current:u})}}}function Av(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 kv(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],Dv=e=>{var t;return e&&typeof e=="object"&&((t=e==null?void 0:e.props)==null?void 0:t.colSpan)},nr=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`,Vr=e=>Array.isArray(e)?e.join(","):e==null?void 0:e.toString(),ki=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.children?t.push(...ki(r.children)):t.push(r)}return t},so=(e,t)=>!!e&&!!t,ao=e=>typeof e=="function"||typeof e=="object"&&typeof e.compare=="function",Pv=(e,t)=>Object.entries(e).reduce((n,[r,a])=>{const i=t.find(o=>Vr(o.dataIndex)===r);return i!=null&&!so(i.filters,i.onFilter)&&(n[r]=a),n},{}),Nv=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&&ao(i))return r;const o=typeof i=="string"?i:Vr((u=a.column)==null?void 0:u.dataIndex);return o!=null&&(r[o]=a.order),r},{}),Lv=e=>{const t={},n={};return e.forEach(r=>{const a=Vr(r.dataIndex);a&&(r.filters&&!so(r.filters,r.onFilter)&&(t[a]=r.defaultFilteredValue??null),r.sorter&&!ao(r.sorter)&&(typeof r.sorter=="string"?n[r.sorter]=r.defaultSortOrder??null:n[a]=r.defaultSortOrder??null))}),{sort:n,filter:t}},_v=(e,t)=>{const{sorter:n,sortOrder:r,dataIndex:a}=t;if(r!==void 0)return r;if(n==null||ao(n))return;const i=typeof n=="string"?n:Vr(a);return i?e[i]:void 0},zv=(e,t)=>{const{filters:n,onFilter:r,filteredValue:a,dataIndex:i}=t;if(a!==void 0)return a;if(n==null||so(n,r))return;const o=Vr(i);return o?e[o]:void 0};function Bv(e={}){var x,C,w,b,T,F;const t=d.useRef(),n=d.useRef(null),r=d.useRef(),a=d.useRef(),[i,o]=d.useState(""),l=d.useRef([]),[u,h]=Je(()=>e.size||e.defaultSize||"middle",e.size),g=d.useCallback(R=>{h(E=>{var O;const M=typeof R=="function"?R(E):R;return(O=e.onSizeChange)==null||O.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 R={};return(M=e.columns)==null||M.forEach(({key:O,dataIndex:Y,fixed:H,disable:D},I)=>{const $=nr(O??Y,I);$&&(R[$]={show:!0,fixed:H,disable:D})}),R},[e.columns]),[m,p]=Je(()=>{var M,O,Y,H;const{persistenceType:R,persistenceKey:E}=e.columnsState||{};if(E&&R&&typeof window<"u"){const D=window[R];try{const I=D==null?void 0:D.getItem(E);if(I)return(M=e==null?void 0:e.columnsState)!=null&&M.defaultValue?_s({},(O=e==null?void 0:e.columnsState)==null?void 0:O.defaultValue,JSON.parse(I)):JSON.parse(I)}catch(I){console.warn(I)}}return((Y=e.columnsState)==null?void 0:Y.value)||((H=e.columnsState)==null?void 0:H.defaultValue)||f},(x=e.columnsState)==null?void 0:x.value),S=(C=e.columnsState)==null?void 0:C.onChange,y=d.useCallback(R=>{p(E=>{const M=typeof R=="function"?R(E):R;return S==null||S(M),M})},[S]);d.useEffect(()=>{var M,O;const{persistenceType:R,persistenceKey:E}=e.columnsState||{};if(E&&R&&typeof window<"u"){const Y=window[R];try{const H=Y==null?void 0:Y.getItem(E);H?(M=e==null?void 0:e.columnsState)!=null&&M.defaultValue?y(_s({},(O=e==null?void 0:e.columnsState)==null?void 0:O.defaultValue,JSON.parse(H))):y(JSON.parse(H)):y(f)}catch(H){console.warn(H)}}},[(w=e.columnsState)==null?void 0:w.persistenceKey,(b=e.columnsState)==null?void 0:b.persistenceType,f]);const j=d.useCallback(()=>{const{persistenceType:R,persistenceKey:E}=e.columnsState||{};if(!E||!R||typeof window>"u")return;const M=window[R];try{M==null||M.removeItem(E)}catch(O){console.warn(O)}},[e.columnsState]);d.useEffect(()=>{var O,Y;if(!((O=e.columnsState)!=null&&O.persistenceKey)||!((Y=e.columnsState)!=null&&Y.persistenceType)||typeof window>"u")return;const{persistenceType:R,persistenceKey:E}=e.columnsState,M=window[R];try{M==null||M.setItem(E,JSON.stringify(m))}catch(H){console.warn(H),j()}},[(T=e.columnsState)==null?void 0:T.persistenceKey,m,(F=e.columnsState)==null?void 0:F.persistenceType]);const v={action:t.current,setAction:R=>{t.current=R},sortKeyColumns:l.current,setSortKeyColumns:R=>{l.current=R},propsRef:a,columnsMap:m,keyWords:i,setKeyWords:R=>o(R),setTableSize:g,tableSize:u,prefixName:r.current,setPrefixName:R=>{r.current=R},setColumnsMap:y,columns:e.columns,rootDomRef:n,clearPersistenceStorage:j,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({}),Vv=e=>{const t=Bv(e.initValue);return s.jsx(Ln.Provider,{value:t,children:e.children})},Hv=new xu("turn",{"0%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(90deg)"},"50%":{transform:"rotate(180deg)"},"75%":{transform:"rotate(270deg)"},"100%":{transform:"rotate(360deg)"}}),Yv=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:Hv,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 Uv(e){return Be("ProTable",t=>{const n={...t,componentCls:`.${e}`};return[Yv(n)]})}function Kv(e){let t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t.startsWith("-")&&(t=t.slice(1)),t}const Wv=(e,t)=>!e&&t!==!1?(t==null?void 0:t.filterType)==="light"?"LightFilter":"QueryFilter":"Form",qv=(e,t,n)=>!e&&n==="LightFilter"?Le({...t},["labelWidth","defaultCollapsed","filterType"]):e?{}:Le({labelWidth:t?t==null?void 0:t.labelWidth:void 0,defaultCollapsed:!0,...t},["filterType"]),Gv=(e,t)=>e?Le(t,["ignoreRules"]):{ignoreRules:!0,...t},Zv=({onSubmit:e,formRef:t,dateFormatter:n="string",type:r,columns:a,action:i,ghost:o,manualRequest:l,onReset:u,submitButtonLoading:h,search:g,form:f,bordered:m})=>{const{hashId:p}=d.useContext(Ht),S=r==="form",y=async(T,F)=>{e&&e(T,F)},{getPrefixCls:j}=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 F=!T.valueType||["textarea","jsonCode","code"].includes(T==null?void 0:T.valueType)&&r==="table"?"text":T==null?void 0:T.valueType,R=(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:F,proFieldProps:{...T.proFieldProps,proFieldKey:R?`table-field-${R}`:void 0}}}),[a,r]),x=j("pro-table-search"),C=j("pro-table-form"),w=d.useMemo(()=>Wv(S,g),[g,S]),b=d.useMemo(()=>({submitter:{submitButtonProps:{loading:h}}}),[h]);return s.jsx("div",{className:ie(p,{[j("pro-card")]:!0,[`${j("pro-card")}-border`]:!!m,[`${j("pro-card")}-bordered`]:!!m,[`${j("pro-card")}-ghost`]:!!o,[x]:!0,[C]:S,[j(`pro-table-search-${Kv(w)}`)]:!0,[`${x}-ghost`]:o,[g==null?void 0:g.className]:g!==!1&&(g==null?void 0:g.className)}),children:s.jsx(Pd,{layoutType:w,columns:v,type:r,...b,...qv(S,g,w),...Gv(S,f||{}),formRef:t,action:i,dateFormatter:n,onInit:(T,F)=>{var R,E,M;if(t.current=F,r!=="form"){const O=(R=i.current)==null?void 0:R.pageInfo,{current:Y=O==null?void 0:O.current,pageSize:H=O==null?void 0:O.pageSize}=T;if((M=(E=i.current)==null?void 0:E.setPageInfo)==null||M.call(E,{...O,current:parseInt(Y,10),pageSize:parseInt(H,10)}),l)return;y(T,!0)}},onReset:T=>{u==null||u(T)},onFinish:T=>{y(T,!1)},initialValues:f==null?void 0:f.initialValues})})},Jv=e=>{const{columns:t,loading:n,formRef:r,type:a,action:i,cardBordered:o,dateFormatter:l,form:u,search:h,pagination:g,ghost:f,manualRequest:m,beforeSearchSubmit:p=w=>w,onSubmit:S,onFormSearchSubmit:y,onReset:j}=e,v=d.useMemo(()=>g?it({current:g.current,pageSize:g.pageSize}):{},[g]),x=be((w,b)=>{var R,E,M;if((u==null?void 0:u.ignoreRules)===!1&&b){(R=r==null?void 0:r.current)==null||R.validateFields().then(()=>{var H,D;const O={...w,_timestamp:Date.now(),...v},Y=Le(p(O),Object.keys(v));y(Y),b||(D=(H=i.current)==null?void 0:H.setPageInfo)==null||D.call(H,{current:1}),S&&!b&&(S==null||S(w))}).catch(O=>{});return}const T={...w,_timestamp:Date.now(),...v},F=Le(p(T),Object.keys(v));y(F),b||(M=(E=i.current)==null?void 0:E.setPageInfo)==null||M.call(E,{current:1}),S&&!b&&(S==null||S(w))}),C=be(w=>{var T;const b=()=>{var R,E;const F=Le(p({...w,...v}),Object.keys(v));y(F),(E=(R=i.current)==null?void 0:R.setPageInfo)==null||E.call(R,{current:1}),j==null||j()};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(Zv,{submitButtonLoading:n,columns:t,type:a,ghost:f,formRef:r,onSubmit:x,manualRequest:m,onReset:C,dateFormatter:l,search:h,form:{autoFocusFirstInput:!1,...u,extraUrlParams:{...v,...u==null?void 0:u.extraUrlParams}},action:i,bordered:Nd("search",o)})},Xv=(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 hn(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})},Qv=d.memo(Jv,Xv);function eT(e){const{search:t,type:n,pagination:r,beforeSearchSubmit:a,actionRef:i,columns:o,onFormSearchSubmit:l,ghost:u,onReset:h,onSubmit:g,loading:f,manualRequest:m,form:p,formRef:S,cardBordered:y,dateFormatter:j,searchFormRender:v,proTableProps:x}=e;return d.useMemo(()=>{const C=t===!1&&n!=="form"?null:s.jsx(Qv,{pagination:r,beforeSearchSubmit:a,action:i,columns:o,onFormSearchSubmit:w=>{l(w)},ghost:u,onReset:h,onSubmit:g,loading:f,manualRequest:m,search:t,form:p,formRef:S,type:n||"table",cardBordered:y,dateFormatter:j});return v&&C?s.jsx(s.Fragment,{children:v(x,C)}):C},[i,a,y,o,j,p,S,u,f,m,l,h,g,r,x,t,v,n])}const tT=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 nT(e){return Be("ColumnSetting",t=>{const n={...t,componentCls:`.${e}`};return[tT(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(c.Tooltip,{title:e,children:s.jsx("span",{onClick:l=>{l.stopPropagation(),l.preventDefault();const u=(i==null?void 0:i[r])||{},h={...i,[r]:{...u,fixed:a}};o(h)},children:n})}):null},rT=({columnKey:e,isLeaf:t,title:n,className:r,fixed:a,showListItemOption:i})=>{const o=Fe(),{hashId:l}=d.useContext(Ht),u=s.jsxs("span",{className:ie(`${r}-list-item-option`,l),children:[s.jsx(za,{columnKey:e,fixed:"left",title:o.getMessage("tableToolBar.leftPin","固定在列首"),show:a!=="left",children:s.jsx(ae.VerticalAlignTopOutlined,{})}),s.jsx(za,{columnKey:e,fixed:void 0,title:o.getMessage("tableToolBar.noPin","不固定"),show:!!a,children:s.jsx(ae.VerticalAlignMiddleOutlined,{})}),s.jsx(za,{columnKey:e,fixed:"right",title:o.getMessage("tableToolBar.rightPin","固定在列尾"),show:a!=="right",children:s.jsx(ae.VerticalAlignBottomOutlined,{})})]});return s.jsxs("span",{className:ie(`${r}-list-item`,l),children:[s.jsx("div",{className:ie(`${r}-list-item-title`,l),children:n}),i&&!t?u:null]},e)},Ba=({list:e,draggable:t,checkable:n,showListItemOption:r,className:a,showTitle:i=!0,title:o,listHeight:l=280})=>{var x,C,w;const{hashId:u}=d.useContext(Ht),{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=(R,E)=>R.map(({key:M,dataIndex:O,children:Y,...H})=>{var z,_;const D=nr(M,[E==null?void 0:E.columnKey,H.index].filter(Boolean).join("-")),I=(h==null?void 0:h[D||"null"])||{show:!0};I.show!==!1&&!Y&&b.push(D);const $={key:D,...Le(H,["className"]),selectable:!1,disabled:I.disable===!0,disableCheckbox:typeof I.disable=="boolean"?I.disable:(z=I.disable)==null?void 0:z.checkbox,isLeaf:E?!0:void 0};return Y&&($.children=F(Y,{...I,columnKey:D}),(_=$.children)!=null&&_.every(V=>b==null?void 0:b.includes(V.key))&&b.push(D)),T.set(M,{...$,parentKey:E==null?void 0:E.columnKey}),$});return{list:F(e),keys:b,map:T}},[h,e,p]),y=be((b,T,F)=>{const R={...h},E=[...f],M=E.findIndex(D=>D===b),O=E.findIndex(D=>D===T),Y=F>=M;if(M<0)return;const H=E[M];E.splice(M,1),F===0?E.unshift(H):E.splice(Y?O:O+1,0,H),E.forEach((D,I)=>{R[D]={...R[D]||{},order:I}}),g(R),m(E)}),j=be(b=>{const T={...h},F=R=>{var O,Y,H,D,I,$;const E={...T[R]};E.show=b.checked,(Y=(O=S.map)==null?void 0:O.get(R))!=null&&Y.children&&((D=(H=S.map.get(R))==null?void 0:H.children)==null||D.forEach(z=>F(z.key)));const M=($=(I=S.map)==null?void 0:I.get(R))==null?void 0:$.parentKey;M&&(T[M]={...T[M],show:!0}),T[R]=E};F(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,F=b.dragNode.key,{dropPosition:R,dropToGap:E}=b,M=R===-1||!E?R+1:R;y(F,T,M)},blockNode:!0,onCheck:(b,T)=>j(T),checkedKeys:S.keys,showLine:!1,titleRender:b=>{const T={...b,children:void 0};if(!T.title)return null;const F=mt(T.title,T),R=s.jsx(c.Typography.Text,{style:{width:80},ellipsis:{tooltip:F},children:F});return s.jsx(rT,{className:a,...Le(T,["key"]),showListItemOption:r,title:R,columnKey:T.key})},height:l,treeData:(w=S.list)==null?void 0:w.map(({disabled:b,...T})=>T)});return s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:ie(`${a}-list-title`,u),children:o}),v]})},sT=({localColumns:e,className:t,draggable:n,checkable:r,showListItemOption:a,listsHeight:i})=>{const{hashId:o}=d.useContext(Ht),l=[],u=[],h=[],g=Fe();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}h.push(p)});const f=l&&l.length>0,m=u&&u.length>0;return s.jsxs("div",{className:ie(`${t}-list`,o,{[`${t}-list-group`]:f||m}),children:[s.jsx(Ba,{title:g.getMessage("tableToolBar.leftFixedTitle","固定在左侧"),list:u,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 aT(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,w,b;(C=(x=n.propsRef.current)==null?void 0:x.columnsState)!=null&&C.value&&(t.current=JSON.parse(JSON.stringify(((b=(w=n.propsRef.current)==null?void 0:w.columnsState)==null?void 0:b.value)||{})))},[]);const u=be((x=!0)=>{const C={},w=b=>{b.forEach(({key:T,fixed:F,index:R,children:E,disable:M})=>{var Y,H;const O=nr(T,R);O&&(C[O]={show:M?(Y=i==null?void 0:i[O])==null?void 0:Y.show:x,fixed:F,disable:M,order:(H=i==null?void 0:i[O])==null?void 0:H.order}),E&&w(E)})};w(r),o(C)}),h=be(x=>{x.target.checked?u():u(!1)}),g=be(()=>{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=Fe(),{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-table-column-setting"),{wrapSSR:j,hashId:v}=nT(y);return j(s.jsx(c.Popover,{arrow:!1,title:s.jsxs("div",{className:ie(`${y}-title`,v),children:[e.checkable===!1?s.jsx("div",{}):s.jsx(c.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:ie(`${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:ie(`${y}-overlay`,v)},trigger:"click",placement:"bottomRight",content:s.jsx(sT,{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(ae.SettingOutlined,{})})}))}const iT=e=>{const{hashId:t}=d.useContext(Ht),n=e.hashId??t,{items:r=[],type:a="inline",prefixCls:i,activeKey:o,defaultActiveKey:l}=e,[u,h]=Je(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===u)||r[0];return a==="inline"?s.jsx("div",{className:ie(`${i}-menu`,`${i}-inline-menu`,n),children:r.map((m,p)=>s.jsx("div",{onClick:()=>{g(m.key)},className:ie(`${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(c.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:ie(`${i}-menu`,`${i}-dropdownmenu`,n),children:s.jsx(c.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(c.Space,{className:ie(`${i}-dropdownmenu-label`,n),children:[f.label,s.jsx(ae.DownOutlined,{})]})})})},oT=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 lT(e){return Be("ProTableListToolBar",t=>{const n={...t,componentCls:`.${e}`};return[oT(n)]})}function cT(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 uT=({prefixCls:e,hashId:t,tabs:n,multipleLine:r,filtersNode:a})=>r?s.jsx("div",{className:ie(`${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,dT=({prefixCls:e,title:t,subTitle:n,tooltip:r,className:a,style:i,search:o,onSearch:l,multipleLine:u=!1,filter:h,actions:g=[],settings:f=[],tabs:m,menu:p})=>{const{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),{token:y}=mn.useToken(),j=S("pro-table-list-toolbar",e),{wrapSSR:v,hashId:x}=lT(j),C=Fe(),[w,b]=d.useState(!1),T=C.getMessage("tableForm.inputPlaceholder","请输入"),F=d.useMemo(()=>o?d.isValidElement(o)?o:s.jsx(c.Input.Search,{style:{width:200},placeholder:T,...o,onSearch:async(...$)=>{var _;await((_=o.onSearch)==null?void 0:_.call(o,...$))!==!1&&(l==null||l($==null?void 0:$[0]))}}):null,[T,l,o]),R=d.useMemo(()=>h?s.jsx("div",{className:ie(`${j}-filter`,x),children:h}):null,[h,x,j]),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(($,z)=>d.isValidElement($)?d.cloneElement($,{key:z,...$==null?void 0:$.props}):s.jsx(d.Fragment,{children:$},z))}):g,[g]),O=d.useMemo(()=>!!(E&&F||!u&&R||M||f!=null&&f.length),[M,R,E,u,F,f==null?void 0:f.length]),Y=d.useMemo(()=>r||t||n||p||!E&&F,[E,p,F,n,t,r]),H=d.useMemo(()=>!Y&&O?s.jsx("div",{className:ie(`${j}-left`,x)}):!p&&(E||!F)?s.jsx("div",{className:ie(`${j}-left`,x),children:s.jsx("div",{className:ie(`${j}-title`,x),children:s.jsx(Xn,{tooltip:r,label:t,subTitle:n})})}):s.jsxs("div",{className:ie(`${j}-left`,x,{[`${j}-left-has-tabs`]:(p==null?void 0:p.type)==="tab",[`${j}-left-has-dropdown`]:(p==null?void 0:p.type)==="dropdown",[`${j}-left-has-inline-menu`]:(p==null?void 0:p.type)==="inline"}),children:[E&&!p&&s.jsx("div",{className:ie(`${j}-title`,x),children:s.jsx(Xn,{tooltip:r,label:t,subTitle:n})}),p&&s.jsx(iT,{...p,prefixCls:j,hashId:x}),!E&&F?s.jsx("div",{className:ie(`${j}-search`,x),children:F}):null]}),[Y,O,E,x,p,j,F,n,t,r]),D=d.useMemo(()=>O?s.jsxs("div",{className:ie(`${j}-right`,x),style:w?{}:{alignItems:"center"},children:[u?null:R,E&&F?s.jsx("div",{className:ie(`${j}-search`,x),children:F}):null,M,f!=null&&f.length?s.jsx("div",{className:ie(`${j}-setting-items`,x),children:f.map(($,z)=>{const _=cT($);return s.jsx("div",{className:ie(`${j}-setting-item`,x),children:_},z)})}):null]}):null,[O,j,x,w,E,F,u,R,M,f]),I=d.useMemo(()=>{if(!O&&!Y)return null;const $=ie(`${j}-container`,x,{[`${j}-container-mobile`]:w});return s.jsxs("div",{className:$,children:[H,D]})},[Y,O,x,w,H,j,D]);return v(s.jsx(ra,{onResize:$=>{$.width<375!==w&&b($.width<375)},children:$=>s.jsxs("div",{ref:$,style:i,className:ie(j,x,a),children:[I,s.jsx(uT,{filtersNode:R,hashId:x,prefixCls:j,tabs:m,multipleLine:u})]})}))},fT=d.forwardRef((e,t)=>{const{icon:n=s.jsx(ae.ColumnHeightOutlined,{})}=e,r=d.useContext(Ln),a=Fe();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})})})}),mT=d.memo(fT),hT=d.forwardRef((e,t)=>{const n=Fe(),[r,a]=d.useState(!1);return d.useEffect(()=>{Zi()&&(document.onfullscreenchange=()=>{a(!!document.fullscreenElement)})},[]),r?s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.exitFullScreen","退出全屏"),children:s.jsx("span",{ref:t,children:s.jsx(ae.FullscreenExitOutlined,{})})}):s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.fullScreen","全屏"),children:s.jsx("span",{ref:t,children:s.jsx(ae.FullscreenOutlined,{})})})}),Ld=d.memo(hT);function gT({intl:e},t){return{reload:{text:e.getMessage("tableToolBar.reload","刷新"),icon:t.reloadIcon??s.jsx(ae.ReloadOutlined,{})},density:{text:e.getMessage("tableToolBar.density","表格密度"),icon:s.jsx(mT,{icon:t.densityIcon})},fullScreen:{text:e.getMessage("tableToolBar.fullScreen","全屏"),icon:s.jsx(Ld,{})}}}function pT(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(aT,{...e[a],columns:r,key:a});if(a==="fullScreen")return s.jsx("span",{onClick:o,children:s.jsx(Ld,{})},a);const l=gT(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 yT({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:h,optionsRender:g,...f}){const m=d.useContext(Ln),p=Fe(),S=d.useMemo(()=>{const v={reload:()=>{var w;return(w=r==null?void 0:r.current)==null?void 0:w.reload()},density:!0,setting:!0,search:!1,fullScreen:()=>{var w,b;return(b=(w=r==null?void 0:r.current)==null?void 0:w.fullScreen)==null?void 0:b.call(w)}};if(a===!1)return[];const x={...v,fullScreen:!1,...a},C=pT(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:u,columns:h,optionsRender:g,...f},C):C},[r,h,e,p,u,g,a,f,i,o,n,l,t]),y=n?n(r==null?void 0:r.current,{selectedRowKeys:i,selectedRows:o}):[],j=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&&(u==null||u(""))},[m.keyWords,u]),s.jsx(dT,{title:e,tooltip:t,search:j,onSearch:u,actions:y,settings:S,...l})}const xT=e=>{const{hideToolbar:t,tableColumn:n,options:r,searchNode:a,tooltip:i,toolbar:o,selectedRows:l,selectedRowKeys:u,headerTitle:h,actionRef:g,toolBarRender:f,optionsRender:m,onFormSearchSubmit:p}=e,S=d.useCallback(y=>{var x,C,w,b;if(!r||!r.search)return;const{name:j="keyword"}=r.search===!0?{}:r.search;((C=(x=r.search)==null?void 0:x.onSearch)==null?void 0:C.call(x,y))!==!1&&((b=(w=g==null?void 0:g.current)==null?void 0:w.setPageInfo)==null||b.call(w,{current:1}),p(it({_timestamp:Date.now(),[j]:y})))},[r,p,g]);return t?null:s.jsx(yT,{tooltip:i,columns:n,options:r,headerTitle:h,action:g,onSearch:S,selectedRows:l,selectedRowKeys:u,toolBarRender:f,toolbar:{filter:a,...o},optionsRender:m})},bT=(e,t)=>t.searchNode?!1:hn({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"]),ST=d.memo(xT,bT);function CT(e){const{toolBarRender:t,headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,isLightFilter:h,searchNode:g,options:f,optionsRender:m,actionRef:p,setFormSearch:S,formSearch:y}=e;return d.useMemo(()=>t===!1?null:s.jsx(ST,{headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,onFormSearchSubmit:j=>{S({...y||{},...j})},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,u])}const wT=({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 jT(e){const[t,n]=Je(()=>wT(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=be(i=>{const o={...t,...i};(o.current!==t.current||o.pageSize!==t.pageSize||o.total!==t.total)&&r(o)});return[t,a]}const vT=(e,t,n)=>{var z;const r=d.useRef(!1),a=d.useRef(null),{onLoad:i,manual:o,polling:l,onRequestError:u,debounceTime:h=20,effects:g=[]}=n||{},f=d.useRef(o),m=d.useRef(),[p,S]=Je(t,n==null?void 0:n.dataSource),y=d.useCallback(_=>{S(V=>{const Z=typeof _=="function"?_(V):_;return queueMicrotask(()=>{var B;(B=n==null?void 0:n.onDataSourceChange)==null||B.call(n,Z)}),Z})},[n==null?void 0:n.onDataSourceChange]),j=typeof(n==null?void 0:n.loading)=="object"?(z=n==null?void 0:n.loading)==null?void 0:z.spinning:n==null?void 0:n.loading,[v,x]=Je(!1,j),C=be(_=>{var V;(V=n==null?void 0:n.onLoadingChange)==null||V.call(n,_)}),w=d.useCallback(_=>{x(V=>{const Z=typeof _=="function"?_(V):_;return queueMicrotask(()=>{C(Z)}),Z})},[C]),[b,T]=jT(n),[F,R]=d.useState(!1),E=(_,V)=>{y(_),(b==null?void 0:b.total)!==V&&T({...b,total:V||_.length})},M=Tr(b==null?void 0:b.current),O=Tr(b==null?void 0:b.pageSize),Y=Tr(l),H=be(()=>{w(!1),R(!1)}),D=async(_,V)=>{if(f.current){f.current=!1;return}_?R(!0):w(!0);const{pageSize:Z,current:B}=b||{};try{const U=(n==null?void 0:n.pageInfo)!==!1?{current:B,pageSize:Z}:void 0,{data:J=[],success:G,total:K=0,...A}=await(e==null?void 0:e(U))||{};if(V!=null&&V.aborted)return[];if(G===!1)return[];const k=kv(J,[n.postData].filter(N=>N));return V!=null&&V.aborted?[]:(E(k,K),i==null||i(k,A),k)}catch(U){if(V!=null&&V.aborted)return[];if(u===void 0)throw new Error(U);p===void 0&&y([]),u(U)}finally{V!=null&&V.aborted||H()}return[]},I=Wi(async _=>{if(m.current&&clearTimeout(m.current),!e)return;const V=new AbortController;a.current=V;try{const Z=await Promise.race([D(_,V.signal),new Promise((U,J)=>{var G,K,A;(A=(K=(G=a.current)==null?void 0:G.signal)==null?void 0:K.addEventListener)==null||A.call(K,"abort",()=>{J("aborted"),I.cancel(),H()})})]);if(V.signal.aborted)return;const B=mt(l,Z);return B&&!r.current&&(m.current=setTimeout(()=>{I.run(B)},Math.max(B,2e3))),Z}catch(Z){if(Z==="aborted")return[];throw Z}},h||30),$=()=>{var _;(_=a.current)==null||_.abort(),I.cancel(),H()};return d.useEffect(()=>(l||clearTimeout(m.current),!Y&&l&&I.run(!0),()=>{clearTimeout(m.current)}),[l]),d.useEffect(()=>(r.current=!1,()=>{r.current=!0}),[]),d.useEffect(()=>{const{current:_,pageSize:V}=b||{};(!M||M===_)&&(!O||O===V)||n.pageInfo&&p&&(p==null?void 0:p.length)>V||_!==void 0&&p&&p.length<=V&&($(),I.run(!1))},[b==null?void 0:b.current]),d.useEffect(()=>{O&&($(),I.run(!1))},[b==null?void 0:b.pageSize]),Wn(()=>($(),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:F,reset:async()=>{const{pageInfo:_}=n||{},{defaultCurrent:V=1,defaultPageSize:Z=20}=_||{};T({current:V,total:0,pageSize:Z})},setPageInfo:async _=>{T(_)}}},TT=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}`,u=n.key||`${o}`;return(h=e==null?void 0:e[l])!=null&&h.order||(g=e==null?void 0:e[u])!=null&&g.order?(((f=e==null?void 0:e[l])==null?void 0:f.order)||0)-(((m=e==null?void 0:e[u])==null?void 0:m.order)||0):(t.index||0)-(n.index||0)},FT=["",null,void 0],Oc=(...e)=>e.filter(t=>t!==void 0).map(t=>typeof t=="number"?t.toString():t).flat(1),RT=e=>{const t=d.useContext(lr),{columnProps:n,prefixName:r,text:a,counter:i,rowData:o,index:l,recordKey:u,subName:h,proFieldProps:g,editableUtils:f}=e,m=gt.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,j]=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("-")&&j(b)},[n==null?void 0:n.dataIndex,n==null?void 0:n.key,l,u,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(gp,{popoverProps:{getPopupContainer:t.getPopupContainer||(()=>i.rootDomRef.current||document.body)},errorType:"popover",name:y,...T,children:b},p),[p,y]),w=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(xn,{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:u,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,u,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(c.Form.Item,{noStyle:!0,shouldUpdate:(b,T)=>{if(b===T)return!1;const F=[v].flat(1);try{return JSON.stringify(Me(b,F))!==JSON.stringify(Me(T,F))}catch{return!0}},children:()=>w()}):w()};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 FT.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):[],u={valueEnum:mt(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:mt(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(xn,{mode:"read",ignoreFormItem:!0,fieldProps:fi(a==null?void 0:a.fieldProps,null,a),...u}):s.jsx(RT,{...e,proFieldProps:u},e.recordKey)}const $T=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(Xn,{label:t,tooltip:e.tooltip,ellipsis:n})};function ET(e,t,n,r){return typeof r=="boolean"?r===!1:(r==null?void 0:r(e,t,n))===!1}const IT=(e,t,n)=>{const r=Array.isArray(n)?Me(t,n):t[n],a=String(r);return String(a)===String(e)};function MT({columnProps:e,text:t,rowData:n,index:r,columnEmptyText:a,counter:i,type:o,subName:l,marginSM:u,editableUtils:h}){const{action:g,prefixName:f}=i,{isEditable:m,recordKey:p}=h.isEditable({...n,index:r}),{renderText:S=w=>w}=e,y=S(t,n,r,g),j=m&&!ET(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:j,prefixName:f,editableUtils:h}),x=j==="edit"?v:$p(v,e,y,t);if(j==="edit")return e.valueType==="option"?s.jsx("div",{style:{display:"flex",alignItems:"center",gap:u,justifyContent:e.align==="center"?"center":"flex-start"},children:h.actionRender({...n,index:e.index||r})}):x;if(!e.render){const w=d.isValidElement(x)||["string","number"].includes(typeof x);return!$t(x)&&w?x:null}const C=e.render(x,n,r,{...g,...h},{...e,isEditable:m,type:"table"});return Dv(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 OT(e){const{onFilter:t,dataIndex:n}=e;return t===!0?(r,a)=>IT(r,a,n):Lu(t)}function AT(e){const{filters:t=[],valueEnum:n}=e;return t===!0?yd(mt(n,void 0)).filter(r=>r&&r.value!=="all"):t}function kT(e,t,n){return{fixed:((e==null?void 0:e[t])||{fixed:n.fixed}).fixed}}function DT(e,t,n){return{filteredValue:zv(e,n),sortOrder:_v(t,n)}}function PT(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(h=>{const g=h[n];a.has(g)||a.set(g,l.concat([t,r]))}),o}function NT(e,t,n){let r=t.rowKey??"id";return function(i,o,l){typeof t.rowKey=="function"&&(r=t.rowKey(o,l));const u=PT(o,l,r,t.childrenColumnName,n);return MT({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 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===c.Table.EXPAND_COLUMN||o===c.Table.SELECTION_COLUMN)return o;const{key:u,dataIndex:h,valueEnum:g,valueType:f="text",children:m}=o,p=nr(u||(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:j}=DT(n.proFilter,n.proSort,o),{fixed:v}=kT(n.counter.columnsMap,p,o),x={index:l,key:p,...o,title:$T(o),valueEnum:g,filters:AT(o),onFilter:OT(o),filteredValue:y,sortOrder:j,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:NT(o,n,a)};return Lp(x)}))==null?void 0:i.filter(o=>!o.hideInTable)}function LT({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,h=a;if(u!=null&&u.parentKey){const m={...l,map_row_parentKey:(f=Ke(u.parentKey))==null?void 0:f.toString()},p={data:i,getRowKey:r,row:m,key:(u==null?void 0:u.recordKey)??r(m,-1),childrenColumnName:h};return br(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 m=g.current*g.pageSize-1;return i.splice(m,0,l),i}return i.push(l),i}function _T({propsCardProps:e,notNeedCardDom:t,name:n,hideToolbar:r,toolbarDom:a}){return e===!1||t||n?{}:r?{padding:0}:a?{paddingBlockStart:0}:{padding:0}}function zT({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 BT({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:h}=t;if(l===h.pageSize||h.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),Ov(i,o,n)},[t,n,e,r,a])}function VT({propsRowSelection:e,selectedRowKeys:t,selectedRows:n,onCleanSelected:r,tableAlertOptionRender:a,tableAlertRender:i}){return d.useMemo(()=>e===!1?null:s.jsx(Mv,{selectedRowKeys:t,selectedRows:n,onCleanSelected:r,alertOptionRender:a,alertInfoRender:i,alwaysShowAlert:e==null?void 0:e.alwaysShowAlert}),[r,e,t,n,a,i])}const HT={},YT=e=>{var fo,mo,ho,go,po,yo;const{cardBordered:t,request:n,className:r,params:a=HT,defaultData:i,headerTitle:o,postData:l,ghost:u,pagination:h,actionRef:g,toolBarRender:f,optionsRender:m,onLoad:p,onRequestError:S,style:y,cardProps:j,tableStyle:v,tableClassName:x,options:C,search:w,name:b,onLoadingChange:T,rowSelection:F=!1,beforeSearchSubmit:R,tableAlertRender:E,defaultClassName:M,formRef:O,type:Y="table",columnEmptyText:H="-",toolbar:D,rowKey:I,manualRequest:$,polling:z,tooltip:_,revalidateOnFocus:V=!1,searchFormRender:Z,...B}=e,{wrapSSR:U,hashId:J}=Uv(e.defaultClassName),G=ie(M,r,J),K=d.useRef(),A=d.useRef(null),k=d.useRef(),N=O||k;d.useImperativeHandle(g,()=>K.current);const[P,L]=Je(F?(F==null?void 0:F.defaultSelectedRowKeys)||[]:void 0,F?F.selectedRowKeys:void 0),[W,q]=d.useState(()=>{if(!($||w!==!1))return{}}),Q=d.useRef(W),ee=be(me=>{const xe=typeof me=="function"?me(Q.current):me;Q.current=xe,q(xe)}),{columns:re=[],columnsState:le}=e,{defaultProFilter:ce,defaultProSort:ue}=d.useMemo(()=>{const{sort:me,filter:xe}=Lv(ki(re));return{defaultProFilter:xe,defaultProSort:me}},[re]),[he,se]=d.useState(ce),[de,ge]=d.useState(ue);Wn(()=>{se(ce),ge(ue)},[ce,ue]);const ne=Fe(),te=typeof h=="object"?h:{defaultCurrent:1,defaultPageSize:20,pageSize:20,current:1},X=d.useContext(Ln),fe=d.useMemo(()=>{if(n)return async me=>{const xe={...me||{},...Q.current||{},...a};return delete xe._timestamp,await n(xe,de,he)}},[W,a,he,de,n]),pe=vT(fe,i,{pageInfo:h===!1?!1:te,loading:e.loading,dataSource:e.dataSource,onDataSourceChange:e.onDataSourceChange,onLoad:p,onLoadingChange:T,onRequestError:S,postData:l,revalidateOnFocus:V,manual:W===void 0,polling:z,effects:[fn(a),fn(W),fn(he),fn(de)],debounceTime:e.debounceTime,onPageInfoChange:me=>{var xe,Ie;!h||!fe||((xe=h==null?void 0:h.onChange)==null||xe.call(h,me.current,me.pageSize),(Ie=h==null?void 0:h.onShowSizeChange)==null||Ie.call(h,me.current,me.pageSize))}});d.useEffect(()=>{var xe;if(e.manualRequest||!e.request||!V||(xe=e.form)!=null&&xe.ignoreRules)return;const me=()=>{document.visibilityState==="visible"&&pe.reload()};return document.addEventListener("visibilitychange",me),()=>document.removeEventListener("visibilitychange",me)},[]);const ve=d.useRef(new Map),Ee=zT({rowKey:I,name:e.name});d.useMemo(()=>{var me;return(me=pe.dataSource)!=null&&me.length?pe.dataSource.map(Ie=>{const pt=Ee(Ie,-1);return ve.current.set(pt,Ie),pt}):[]},[pe.dataSource,Ee]);const Te=BT({propsPagination:h,action:pe,intl:ne,request:n,type:Y});Wn(()=>{Te&&(Te.current!==pe.pageInfo.current||Te.pageSize!==pe.pageInfo.pageSize)&&pe.setPageInfo({current:Te.current,pageSize:Te.pageSize})},[Te]),Wn(()=>{var me;e.request&&!jC(a)&&pe.dataSource&&!Aa(pe.dataSource,i)&&((me=pe==null?void 0:pe.pageInfo)==null?void 0:me.current)!==1&&pe.setPageInfo({current:1})},[a]),X.setPrefixName(e.name),d.useEffect(()=>{(le==null?void 0:le.value)!==void 0&&X.setColumnsMap(le.value)},[le==null?void 0:le.value]);const Ye=be(()=>{F&&F.onChange&&F.onChange([],[],{type:"none"}),L([])});X.propsRef.current=e;const Ge=_C({...e.editable,tableName:e.name,getRowKey:Ee,childrenColumnName:((fo=e.expandable)==null?void 0:fo.childrenColumnName)||"children",dataSource:pe.dataSource||[],setDataSource:me=>{var xe,Ie;(Ie=(xe=e.editable)==null?void 0:xe.onValuesChange)==null||Ie.call(xe,void 0,me),pe.setDataSource(me)}}),{token:Ce}=mn==null?void 0:mn.useToken();Av(K,pe,{nativeElement:((mo=X.rootDomRef)==null?void 0:mo.current)||void 0,focus:()=>{var me,xe;(xe=(me=X.rootDomRef)==null?void 0:me.current)==null||xe.focus()},fullScreen:()=>{var me,xe;!((me=X.rootDomRef)!=null&&me.current)||!document.fullscreenEnabled||(document.fullscreenElement?document.exitFullscreen():(xe=X.rootDomRef)==null||xe.current.requestFullscreen())},onCleanSelected:()=>{Ye()},resetAll:()=>{var Ie,pt,nn,Kt,ur;Ye(),X.setKeyWords(void 0),pe.setPageInfo({current:1}),se(ce),ge(ue),(Ie=N==null?void 0:N.current)==null||Ie.resetFields();const me=((nn=(pt=N==null?void 0:N.current)==null?void 0:pt.getFieldsFormatValue)==null?void 0:nn.call(pt,!0))??((ur=(Kt=N==null?void 0:N.current)==null?void 0:Kt.getFieldsValue)==null?void 0:ur.call(Kt,!0))??{},xe=R?R(me):me;ee(xe??{})},editableUtils:Ge,scrollTo:me=>{var xe,Ie;return(Ie=(xe=A==null?void 0:A.current)==null?void 0:xe.scrollTo)==null?void 0:Ie.call(xe,me)}}),X.setAction(K.current);const Re=d.useMemo(()=>{var xe;const me={counter:X,columnEmptyText:H,type:Y,editableUtils:Ge,marginSM:Ce.marginSM,rowKey:I??"id",childrenColumnName:((xe=e.expandable)==null?void 0:xe.childrenColumnName)??"children",proFilter:he,proSort:de};return zd({columns:re,context:me}).sort(TT(X.columnsMap??{}))},[re,X==null?void 0:X.sortKeyColumns,X==null?void 0:X.columnsMap,H,Y,Ge.editableKeys&&Ge.editableKeys.join(","),he,de]);Pu(()=>{if(Re&&Re.length>0){const me=Re.map(xe=>nr(xe.key,xe.index));X.setSortKeyColumns(me)}},[Re],["render","formItemRender"],100),Wn(()=>{const{pageInfo:me}=pe,{current:xe=me==null?void 0:me.current,pageSize:Ie=me==null?void 0:me.pageSize}=h||{};h&&(xe||Ie)&&(Ie!==(me==null?void 0:me.pageSize)||xe!==(me==null?void 0:me.current))&&pe.setPageInfo({pageSize:Ie||me.pageSize,current:xe||me.current})},[h&&h.pageSize,h&&h.current]);const dt={selectedRowKeys:P,...F,onChange:(me,xe,Ie)=>{F&&F.onChange&&F.onChange(me,xe,Ie),L(me)}},rt=w!==!1&&(w==null?void 0:w.filterType)==="light",lt=be(me=>{var xe,Ie;if(C&&C.search){const{name:pt="keyword"}=C.search===!0?{}:C.search;if(((Ie=(xe=C.search)==null?void 0:xe.onSearch)==null?void 0:Ie.call(xe,X.keyWords))!==!1){ee({...me,[pt]:X.keyWords});return}}ee(me)}),Qe=d.useMemo(()=>{var me;return typeof pe.loading=="object"?((me=pe.loading)==null?void 0:me.spinning)||!1:pe.loading},[pe.loading]),st=s.jsx(eT,{search:w,type:Y,pagination:Te,beforeSearchSubmit:R,actionRef:K,columns:re,onFormSearchSubmit:lt,ghost:u,onReset:e.onReset,onSubmit:e.onSubmit,loading:!!Qe,manualRequest:$,form:e.form,formRef:N,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,searchFormRender:Z,proTableProps:e}),en=d.useMemo(()=>P==null?void 0:P.map(me=>{var xe;return(xe=ve.current)==null?void 0:xe.get(me)}),[pe.dataSource,P]),Hr=d.useMemo(()=>C===!1&&!o&&!f&&!D&&!rt,[C,o,f,D,rt]),tn=s.jsx(CT,{toolBarRender:f,headerTitle:o,hideToolbar:Hr,selectedRows:en,selectedRowKeys:P,tableColumn:Re,tooltip:_,toolbar:D,isLightFilter:rt,searchNode:st,options:C,optionsRender:m,actionRef:K,setFormSearch:ee,formSearch:W}),aa=VT({propsRowSelection:F,selectedRowKeys:P,selectedRows:en,onCleanSelected:Ye,tableAlertOptionRender:B.tableAlertOptionRender,tableAlertRender:E}),Hd=d.useMemo(()=>{var me;return LT({dataSource:pe.dataSource,editableUtils:Ge,pagination:Te,getRowKey:Ee,childrenColumnName:((me=e.expandable)==null?void 0:me.childrenColumnName)||"children"})},[pe.dataSource,Ge==null?void 0:Ge.newLineRecord,Ee,Te,(ho=e.expandable)==null?void 0:ho.childrenColumnName]),ia=d.useMemo(()=>{const me=xe=>xe.map(Ie=>{var Kt;const pt=nr(Ie.key,Ie.index),nn=(Kt=X.columnsMap)==null?void 0:Kt[pt];return nn&&nn.show===!1?!1:Ie.children?{...Ie,children:me(Ie.children)}:Ie}).filter(Boolean);return me(Re)},[X.columnsMap,Re]),Yd=d.useMemo(()=>ki(ia).filter(xe=>!!xe.filters),[ia]),Ud=me=>{Aa(me,de)||ge(me??{})},Kd=me=>{Aa(me,he)||se(me??{})},io=()=>({...B,size:X.tableSize,rowSelection:F===!1?void 0:dt,className:x,style:v,columns:ia,loading:pe.loading,dataSource:Hd,pagination:Te,onChange:(me,xe,Ie,pt)=>{var ur;(ur=B.onChange)==null||ur.call(B,me,xe,Ie,pt);const nn=Pv(xe,Yd);Kd(it(nn));const Kt=Nv(Ie);Ud(it(Kt))}}),oa=w===!1&&!o&&!f,oo=s.jsx(ro.Provider,{value:{grid:!1,colProps:void 0,rowProps:void 0},children:s.jsx(c.Table,{...io(),rowKey:I,ref:A})}),la=e.tableViewRender?e.tableViewRender({...io(),rowSelection:F!==!1?dt:void 0},oo):oo,lo=e.editable&&!b?s.jsxs(s.Fragment,{children:[tn,aa,d.createElement(gt,{...e.editable.formProps,formRef:(go=e.editable.formProps)==null?void 0:go.formRef,component:!1,form:e.editable.form,onValuesChange:Ge.onValuesChange,key:"table",submitter:!1,omitNil:!1,dateFormatter:e.dateFormatter},la)]}):s.jsxs(s.Fragment,{children:[tn,aa,la]}),Wd=_T({propsCardProps:j,notNeedCardDom:oa,name:e.name,hideToolbar:Hr,toolbarDom:tn}),qd=d.useMemo(()=>j!==!1&&!e.name&&!oa||j!==!1&&Y==="list",[j,e.name,Y,oa]),ca=j===!1?{}:j??{},co=qd?s.jsx(ta,{...ca,ghost:u,variant:Nd("table",t)?"outlined":"borderless",styles:{body:{...Wd,...((po=ca.styles)==null?void 0:po.body)??{}},header:(yo=ca.styles)==null?void 0:yo.header},children:lo}):lo,Gd=()=>e.tableRender?e.tableRender(e,co,{toolbar:tn||void 0,alert:aa||void 0,table:la||void 0}):co,uo=s.jsxs("div",{className:ie(G,{[`${M}-polling`]:pe.pollingLoading}),style:y,ref:X.rootDomRef,"data-testid":"pro-table",children:[rt?null:st,Y!=="form"&&e.tableExtraRender&&s.jsx("div",{className:ie(G,`${M}-extra`),children:e.tableExtraRender(e,pe.dataSource||[])}),Y!=="form"&&Gd()]});return!C||!(C!=null&&C.fullScreen)?U(uo):U(s.jsx(c.ConfigProvider,{getPopupContainer:()=>X.rootDomRef.current||document.body,children:uo}))},_n=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=e.ErrorBoundary===!1?d.Fragment:e.ErrorBoundary||ap,r=d.useContext(Bt);return s.jsx(Vv,{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(YT,{defaultClassName:`${t("pro-table")}`,...e})})})})};_n.Summary=c.Table.Summary;let UT="/api";function Nt(){return Jt.createRequest({baseURL:UT,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}})},KT={list:e=>Nt().post("/ctc/ac/login-log/list",e)},fs={0:{text:"禁用",color:"default"},1:{text:"正常",color:"success"},2:{text:"锁定",color:"warning"}},ms={1:{text:"超级管理员",color:"red"},2:{text:"租户管理员",color:"volcano"},3:{text:"普通成员",color:"blue"},4:{text:"临时账号",color:"orange"}},WT={1:{text:"用户名",color:"blue"},2:{text:"邮箱",color:"purple"},3:{text:"手机",color:"cyan"}};function qT({apiBaseURL:e}){var A,k,N,P;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,u]=d.useState([]),[h,g]=d.useState(!1),[f,m]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),[j]=c.Form.useForm(),[v,x]=d.useState(!1),[C,w]=d.useState(null),[b,T]=d.useState("info"),[F,R]=d.useState([]),[E,M]=d.useState(!1),O=async L=>{if(!L){R([]);return}M(!0);try{const W=await KT.list({accountId:Number(L),pageSize:50});R((W==null?void 0:W.records)||[])}catch{R([])}finally{M(!1)}},Y=L=>{w(L),T("info"),x(!0),O(L.id)},H=()=>{x(!1),w(null),R([])},D=L=>{T(L),L==="logs"&&(C!=null&&C.id)&&O(C.id)},I=d.useCallback(()=>{var q;const L=n.getFieldsValue(),W={};L.username&&(W.username=L.username),L.status!==void 0&&(W.status=L.status),L.dateRange&&(W.startDate=L.dateRange[0].format("YYYY-MM-DD"),W.endDate=L.dateRange[1].format("YYYY-MM-DD")),a(W),(q=t.current)==null||q.reload()},[n]),$=d.useCallback(()=>{var L;n.resetFields(),a({}),(L=t.current)==null||L.reload()},[n]),z=async L=>{try{let q=await Un.listByTenant({tenant:r.tenant,pageNum:L.current,pageSize:L.pageSize})||[];const Q=r.username,ee=r.status,re=r.startDate,le=r.endDate;return q=q.filter(ce=>{var ue;return!(Q&&!((ue=ce.username)!=null&&ue.includes(Q))||ee!==void 0&&ce.status!==ee||re&&ce.createdAt&&Se(ce.createdAt).isBefore(re,"day")||le&&ce.createdAt&&Se(ce.createdAt).isAfter(le,"day"))}),{data:q,success:!0,total:q.length}}catch(W){return c.message.error("获取账号列表失败:"+((W==null?void 0:W.message)||"未知错误")),{data:[],success:!1,total:0}}},_=async()=>{var L;try{const W=await y.validateFields();await Un.create(W),c.message.success("创建成功"),g(!1),y.resetFields(),(L=t.current)==null||L.reload()}catch(W){if(W!=null&&W.errorFields)return;c.message.error("创建失败:"+((W==null?void 0:W.message)||"未知错误"))}},V=async(L,W)=>{var Q;const q=W===1?0:1;try{await Un.updateStatus(L,q),c.message.success(q===1?"已启用":"已停用"),(Q=t.current)==null||Q.reload()}catch(ee){c.message.error("操作失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},Z=async()=>{var L;try{await Promise.all(l.map(W=>Un.updateStatus(W.id,0))),c.message.success(`已停用 ${l.length} 个账号`),o([]),u([]),(L=t.current)==null||L.reload()}catch(W){c.message.error("批量操作失败:"+((W==null?void 0:W.message)||"未知错误"))}},B=()=>{const L=`ID,账号,昵称,类型,邮箱,手机,租户,状态,创建时间
|
|
56
|
+
`,W=l.length>0?l:[];if(W.length===0){c.message.warning("请先选择要导出的数据,或取消选择导出全部");return}const q=L+W.map(le=>[le.id,le.username,le.nickname,(ms[le.accountType??3]||{text:String(le.accountType)}).text,le.email,le.phone,le.tenantCode,(fs[le.status??1]||{text:String(le.status)}).text,le.createdAt].join(",")).join(`
|
|
57
|
+
`),Q=new Blob(["\uFEFF"+q],{type:"text/csv;charset=utf-8"}),ee=URL.createObjectURL(Q),re=document.createElement("a");re.href=ee,re.download=`accounts_${Se().format("YYYYMMDD_HHmmss")}.csv`,re.click(),URL.revokeObjectURL(ee),c.message.success(`已导出 ${W.length} 条数据`)},U=L=>{S(L),j.resetFields(),m(!0)},J=async()=>{if(p!=null&&p.id)try{const L=await j.validateFields();await Un.resetPassword(p.id,{newPassword:L.newPassword}),c.message.success(`已重置账号 ${p.username} 的密码`),m(!1),j.resetFields()}catch(L){if(L!=null&&L.errorFields)return;c.message.error("重置失败:"+((L==null?void 0:L.message)||"未知错误"))}},G=[{title:"登录标识",dataIndex:"identifier",width:140},{title:"登录方式",dataIndex:"identityType",width:90,render:(L,W)=>{const q=WT[W.identityType]||{text:`${W.identityType}`,color:"default"};return s.jsx(c.Tag,{color:q.color,children:q.text})}},{title:"结果",dataIndex:"loginStatus",width:80,render:(L,W)=>s.jsx(c.Tag,{color:W.loginStatus===1?"success":"error",children:W.loginStatus===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0},{title:"客户端IP",dataIndex:"clientIp",width:120},{title:"登录时间",dataIndex:"loginTime",width:170,render:L=>L?Se(L).format("YYYY-MM-DD HH:mm:ss"):"-"}],K=[{title:"账号",dataIndex:"username",width:120,fixed:"left",search:!1},{title:"昵称",dataIndex:"nickname",width:120,search:!1},{title:"类型",dataIndex:"accountType",width:110,search:!1,render:(L,W)=>{const q=ms[W.accountType??3]||{text:String(W.accountType??"未知"),color:"default"};return s.jsx(c.Tag,{color:q.color,children:q.text})}},{title:"邮箱",dataIndex:"email",width:160,ellipsis:!0,search:!1},{title:"手机",dataIndex:"phone",width:120,search:!1},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"状态",dataIndex:"status",width:80,search:!1,render:(L,W)=>{const q=fs[W.status??1]||{text:String(W.status??"未知"),color:"default"};return s.jsx(c.Tag,{color:q.color,children:q.text})}},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(L,W)=>[s.jsx(c.Button,{type:"link",size:"small",danger:W.status===1,onClick:()=>V(W.id,W.status??1),children:W.status===1?"停用":"启用"},"status"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>U(W),children:"重置密码"},"reset"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>Y(W),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(ht.SearchInput,{placeholder:"请输入用户名",onChange:L=>n.setFieldValue("username",L)})}),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(ae.SearchOutlined,{}),onClick:I,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(ae.UndoOutlined,{}),onClick:$,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>g(!0),children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),disabled:i.length===0,onClick:Z,children:"批量停用"}),s.jsx(c.Button,{icon:s.jsx(ae.DownloadOutlined,{}),onClick:B,children:"导出"}),s.jsx(c.Button,{icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{var L;return(L=t.current)==null?void 0:L.reload()},children:"刷新"})]})]})}),s.jsx(_n,{actionRef:t,rowKey:"id",columns:K,request:z,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:L=>`共 ${L} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(L,W)=>{o(L),u(W)}},tableAlertRender:({selectedRowKeys:L})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:L.length})," 项"]})}),s.jsx(c.Modal,{title:"新建账号",open:h,onOk:_,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:J,onCancel:()=>m(!1),size:"large",okText:"确认重置",okButtonProps:{danger:!0},destroyOnHidden:!0,children:s.jsx(c.Form,{form:j,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:H,size:900,destroyOnHidden:!0,children:C&&s.jsxs("div",{style:{display:"flex",gap:16,minHeight:480},children:[s.jsx("div",{style:{width:160,borderRight:"1px solid #f0f0f0",paddingRight:8},children:s.jsx(c.Menu,{mode:"inline",selectedKeys:[b],onClick:({key:L})=>D(L),style:{border:"none",background:"transparent"},items:[{key:"info",icon:s.jsx(ae.UserOutlined,{}),label:"基本信息"},{key:"logs",icon:s.jsx(ae.FileTextOutlined,{}),label:"登录日志"}]})}),s.jsx("div",{style:{flex:1,minWidth:0},children:b==="info"?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:(A=ms[C.accountType??3])==null?void 0:A.color,children:((k=ms[C.accountType??3])==null?void 0:k.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:(N=fs[C.status??1])==null?void 0:N.color,children:(P=fs[C.status??1])==null?void 0:P.text})}),s.jsx(c.Descriptions.Item,{label:"到期时间",children:C.expireAt?Se(C.expireAt).format("YYYY-MM-DD HH:mm:ss"):"永久"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:C.createdAt?Se(C.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",span:2,children:C.updatedAt?Se(C.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]}):s.jsx(ht.ListTable,{cardTitle:`登录日志(${F.length})`,cardExtra:s.jsx(c.Button,{size:"small",icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>C.id&&O(C.id),children:"刷新"}),rows:F,columns:G,rowKey:"id",loading:E,searchKeys:["identifier","clientIp"],searchPlaceholder:"按登录标识 / 客户端 IP 过滤",emptyTitle:"暂无登录记录"})})]})})]})}let GT="/api";function gr(){return Jt.createRequest({baseURL:GT,timeout:15e3})}const Cr={listApplications:e=>gr().get("/meta-app/list",{params:e}),getApplication:e=>gr().get("/meta-app/get",{params:{id:e}}),create:e=>gr().post("/meta-app",e),update:(e,t)=>gr().put("/meta-app",t,{params:{id:e}}),delete:e=>gr().delete("/meta-app",{params:{id:e}})};let ZT="/api";function qe(){return Jt.createRequest({baseURL:ZT,timeout:15e3})}const at={listResourcesByApp:e=>qe().get("/ctc/authz/resources/page-by-app",{params:e}),listAllResources:()=>qe().get("/ctc/authz/resources/list"),pageResources:e=>qe().get("/ctc/authz/resources/page",{params:e}),distinctApps:()=>qe().get("/ctc/authz/resources/distinct-apps"),getResource:e=>qe().get("/ctc/authz/resources",{params:{id:e}}),createResource:e=>qe().post("/ctc/authz/resources",e),updateResource:(e,t)=>qe().put("/ctc/authz/resources",t,{params:{id:e}}),deleteResource:e=>qe().delete("/ctc/authz/resources",{params:{id:e}}),listResourceRoles:e=>qe().get("/ctc/authz/resources/roles",{params:{resourceId:e}}),grantRoleResource:(e,t,n)=>{const r=n==null?null:{dataFilter:n};return qe().post("/ctc/authz/roles/grant-resource",r,{params:{roleId:e,resourceId:t}})},revokeRoleResource:(e,t)=>qe().delete("/ctc/authz/roles/revoke-resource",{params:{roleId:e,resourceId:t}}),listAllRoles:()=>qe().get("/ctc/authz/roles/list"),pageRoles:e=>qe().get("/ctc/authz/roles/page",{params:e}),getRole:e=>qe().get("/ctc/authz/roles",{params:{id:e}}),createRole:e=>qe().post("/ctc/authz/roles",e),updateRole:(e,t)=>qe().put("/ctc/authz/roles",t,{params:{id:e}}),deleteRole:e=>qe().delete("/ctc/authz/roles",{params:{id:e}}),listUserRoles:e=>qe().get("/ctc/authz/users/roles",{params:{userId:e}}),listUserPermissions:e=>qe().get("/ctc/authz/users/permissions",{params:{userId:e}}),grantUserRole:(e,t,n)=>{const r={userId:e,roleId:t};return n&&(r.expireAt=n),qe().post("/ctc/authz/users/grant-role",null,{params:r})},revokeUserRole:(e,t)=>qe().delete("/ctc/authz/users/revoke-role",{params:{userId:e,roleId:t}}),listRolePermissions:e=>qe().get("/ctc/authz/roles/resources",{params:{roleId:e}}),check:e=>qe().post("/ctc/authz/check",e)},JT={API:1,MENU:2,BUTTON:3,DATA:4},pr={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}},XT={GET:"green",POST:"blue",PUT:"orange",DELETE:"red",PATCH:"purple"},Va={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function QT({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,h]=d.useState(null),[g,f]=d.useState(!1),[m,p]=d.useState([]),[S,y]=d.useState(""),[j,v]=d.useState(!1),[x]=c.Form.useForm(),[C,w]=d.useState("API"),b=d.useCallback(async K=>{try{const A=await at.listResourcesByApp({appCode:K,pageNum:1,pageSize:1e3});p(A.data||[])}catch(A){c.message.error("拉取资源失败:"+((A==null?void 0:A.message)||"未知错误")),p([])}},[]),T=K=>{h(K),f(!0),K.appCode&&b(K.appCode)},F=d.useCallback(()=>{var k;const K=n.getFieldsValue(),A={};K.appCode&&(A.appCode=K.appCode),K.appName&&(A.appName=K.appName),a(A),(k=t.current)==null||k.reload()},[n]),R=d.useCallback(()=>{var K;n.resetFields(),a({}),(K=t.current)==null||K.reload()},[n]),E=async K=>{try{const A=(K==null?void 0:K.current)||1,k=(K==null?void 0:K.pageSize)||20,N=await Cr.listApplications({appCode:r.appCode,appName:r.appName,pageNum:A,pageSize:k});return{data:N.records||[],success:!0,total:N.total||0}}catch(A){return c.message.error("获取应用列表失败:"+((A==null?void 0:A.message)||"未知错误")),{data:[],success:!1,total:0}}},M=async()=>{var K;try{const A=await l.validateFields();await Cr.create({appCode:A.appCode,appName:A.appName,appType:A.appType||"web",description:A.description,status:1}),c.message.success("应用创建成功"),o(!1),l.resetFields(),(K=t.current)==null||K.reload()}catch(A){if(A!=null&&A.errorFields)return;c.message.error("创建失败:"+((A==null?void 0:A.message)||"未知错误"))}},O=async K=>{var A;try{if(K.id==null){c.message.error("应用 ID 缺失");return}await Cr.delete(K.id),c.message.success(`已删除应用 ${K.appCode}`),(u==null?void 0:u.id)===K.id&&(h(null),p([])),(A=t.current)==null||A.reload()}catch(k){c.message.error("删除失败:"+((k==null?void 0:k.message)||"未知错误"))}},Y=async K=>{var A;try{if(K.id==null){c.message.error("应用 ID 缺失");return}const k=K.status===1?0:1;await Cr.update(K.id,{status:k}),c.message.success(k===1?"已启用":"已停用"),(u==null?void 0:u.id)===K.id&&h({...K,status:k}),(A=t.current)==null||A.reload()}catch(k){c.message.error("切换状态失败:"+((k==null?void 0:k.message)||"未知错误"))}},H=async()=>{if(u)try{const K=await x.validateFields(),A={resourceCode:K.resourceCode,resourceName:K.resourceName,resourceType:JT[C],appCode:u.appCode,path:K.path,method:K.method,description:K.description,status:1};await at.createResource(A),c.message.success("资源创建成功"),v(!1),x.resetFields(),b(u.appCode)}catch(K){if(K!=null&&K.errorFields)return;c.message.error("创建失败:"+((K==null?void 0:K.message)||"未知错误"))}},D=async K=>{if(K.id==null){c.message.error("资源 ID 缺失");return}try{await at.deleteResource(K.id),c.message.success("资源已删除"),u!=null&&u.appCode&&b(u.appCode)}catch(A){c.message.error("删除失败:"+((A==null?void 0:A.message)||"未知错误"))}},I=K=>{w(K),x.resetFields(),v(!0)},$=[{title:"应用",dataIndex:"appName",width:180,search:!1,render:(K,A)=>{const k=Va[A.status??1]||{text:String(A.status??"未知"),color:"default"},N=(u==null?void 0:u.id)===A.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:A.appName}),s.jsxs("div",{style:{fontSize:12,color:"#999",marginTop:2},children:[s.jsx(c.Tag,{color:k.color,style:{marginRight:4,marginInlineEnd:4},children:k.text}),s.jsx("code",{style:{fontSize:11},children:A.appCode})]})]})}},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(K,A)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>T(A),children:"编辑"},"edit"),s.jsx(c.Button,{type:"link",size:"small",danger:A.status===1,onClick:()=>Y(A),children:A.status===1?"停用":"启用"},"toggle"),s.jsx(c.Popconfirm,{title:`确认删除应用 ${A.appName}?`,description:"该应用下的所有资源会一并删除",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>O(A),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})},"del")]}],z=[{title:"资源编码",dataIndex:"resourceCode",width:180,ellipsis:!0},{title:"资源名称",dataIndex:"resourceName",width:140,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(K,A)=>A.method?s.jsx(c.Tag,{color:XT[A.method],children:A.method}):"-"},{title:"URL / Path",dataIndex:"path",ellipsis:!0},{title:"描述",dataIndex:"description",width:200,ellipsis:!0},{title:"操作",width:80,fixed:"right",render:(K,A)=>s.jsx(c.Popconfirm,{title:"确认删除该资源?",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>D(A),children:s.jsx(c.Button,{type:"text",danger:!0,size:"small",children:"删除"})})}],_=m.filter(K=>(K.resourceType??1)===1),V=m.filter(K=>K.resourceType===2),Z=m.filter(K=>K.resourceType===3),B=m.filter(K=>K.resourceType===4),U=(K,A)=>{const k=S.trim().toLowerCase(),N=k?K.filter(P=>`${P.resourceCode||""} ${P.resourceName||""} ${P.path||""}`.toLowerCase().includes(k)):K;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:K.length})," 条 ",pr[A].text," 资源"]}),s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按资源编码 / 名称过滤",style:{width:220},onChange:P=>y(P.target.value)}),s.jsxs(c.Button,{type:"primary",size:"small",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>I(A),children:["新建",pr[A].text]})]})]}),K.length>0?s.jsx(c.Table,{rowKey:"id",columns:z,dataSource:N,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:P=>`共 ${P} 条`},size:"small",scroll:{x:800},locale:{emptyText:s.jsx(ht.EmptyState,{title:`没有匹配的 ${pr[A].text} 资源`,description:"换个关键字再试一次",size:"sm"})}}):s.jsx(ht.EmptyState,{title:`该应用暂无 ${pr[A].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(ae.SearchOutlined,{}),onClick:F,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(ae.UndoOutlined,{}),onClick:R,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>o(!0),children:"新增应用"}),s.jsx(c.Button,{icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{var K;(K=t.current)==null||K.reload(),u!=null&&u.appCode&&b(u.appCode)},children:"刷新"})]})]})}),s.jsx(_n,{actionRef:t,rowKey:"id",columns:$,request:E,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:K=>`共 ${K} 条`},onRow:K=>({onClick:()=>T(K),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=Va[u.status??1])==null?void 0:J.color)||"default",children:((G=Va[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(ae.ReloadOutlined,{}),onClick:()=>b(u.appCode),children:"刷新资源"}),s.jsx(c.Button,{icon:s.jsx(ae.EditOutlined,{}),onClick:()=>o(!0),children:"编辑应用"}),s.jsx(c.Button,{danger:u.status===1,icon:s.jsx(ae.StopOutlined,{}),onClick:()=>Y(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:["创建:",Se(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 资产 (",_.length,")"]}),children:U(_,"API")},{key:"MENU",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"blue",children:"菜单"})," 菜单 (",V.length,")"]}),children:U(V,"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:"数据"})," 数据 (",B.length,")"]}),children:U(B,"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)||""} (${pr[C].text})`,open:j,onOk:H,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 Ac={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},kc={MENU:{text:"菜单",color:"blue"},API:{text:"API",color:"orange"},BUTTON:{text:"按钮",color:"green"},DATA:{text:"数据",color:"purple"}},eF=e=>{const t={},n=[];return e.forEach(r=>{var a,i;t[r.id]={key:r.id,title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[r.resourceName,s.jsx(c.Tag,{color:(a=kc[r.resourceType||"MENU"])==null?void 0:a.color,style:{margin:0,fontSize:10},children:(i=kc[r.resourceType||"MENU"])==null?void 0:i.text})]}),rawTitle:r.resourceName,children:[]}}),e.forEach(r=>{n.findIndex(a=>a.key===r.id)===-1&&n.push(t[r.id])}),n};function tF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,u]=d.useState(!1),[h,g]=d.useState(null),[f]=c.Form.useForm(),[m,p]=d.useState([]),[S,y]=d.useState([]),[j,v]=d.useState(!1),[x,C]=d.useState(null),[w,b]=d.useState([]),[T,F]=d.useState([]),[R,E]=d.useState([]),[M,O]=d.useState(!1),Y="z_authz_role_codes",[H,D]=d.useState(()=>JSON.parse(localStorage.getItem(Y)||"[]")),I=(P,L)=>{const W=String(P);if(!H.includes(W)){const q=[...H,W];D(q),localStorage.setItem(Y,JSON.stringify(q))}o(q=>{const Q=q.findIndex(ee=>{var re;return((re=ee.id)==null?void 0:re.toString())===W});if(Q>=0){const ee=[...q];return ee[Q]=L,ee}return[...q,L]})},$=async()=>{try{let P=[];try{P=await at.listAllRoles()}catch(ee){c.message.warning("从后端拉取角色失败,已回退到本地缓存:"+((ee==null?void 0:ee.message)||"未知错误"));for(const re of H){const le=i.find(ce=>{var ue;return((ue=ce.id)==null?void 0:ue.toString())===re});le&&P.push(le)}for(const re of i)P.find(le=>{var ce,ue;return((ce=le.id)==null?void 0:ce.toString())===((ue=re.id)==null?void 0:ue.toString())})||P.push(re)}const L=r.roleCode,W=r.status,q=r.startDate,Q=r.endDate;return P=P.filter(ee=>{var re;return!(L&&!((re=ee.roleCode)!=null&&re.includes(L))||W!==void 0&&ee.status!==W||q&&ee.createdAt&&Se(ee.createdAt).isBefore(q,"day")||Q&&ee.createdAt&&Se(ee.createdAt).isAfter(Q,"day"))}),{data:P,success:!0,total:P.length}}catch(P){return c.message.error("获取角色失败:"+((P==null?void 0:P.message)||"未知错误")),{data:[],success:!1,total:0}}},z=()=>{var W;const P=n.getFieldsValue(),L={};P.roleCode&&(L.roleCode=P.roleCode),P.status!==void 0&&(L.status=P.status),P.dateRange&&(L.startDate=P.dateRange[0].format("YYYY-MM-DD"),L.endDate=P.dateRange[1].format("YYYY-MM-DD")),a(L),(W=t.current)==null||W.reload()},_=()=>{var P;n.resetFields(),a({}),(P=t.current)==null||P.reload()},V=async()=>{var P;try{const L=await f.validateFields(),W=await at.createRole({...L,status:1});c.message.success(`角色创建成功,ID=${W}`),I(W,{id:W,...L,status:1}),u(!1),f.resetFields(),(P=t.current)==null||P.reload()}catch(L){if(L!=null&&L.errorFields)return;c.message.error("创建失败:"+((L==null?void 0:L.message)||"未知错误"))}},Z=P=>{g(P),f.setFieldsValue({roleCode:P.roleCode,roleName:P.roleName,description:P.description})},B=async()=>{var P;if(h!=null&&h.id)try{const L=await f.validateFields();c.message.warning("后端暂未提供 role 更新接口,本地更新占位");const W={...h,...L};I(h.id,W),f.resetFields(),g(null),(P=t.current)==null||P.reload()}catch(L){if(L!=null&&L.errorFields)return;c.message.error("更新失败:"+((L==null?void 0:L.message)||"未知错误"))}},U=P=>{var L;c.message.warning("后端暂未提供 role 删除接口"),o(W=>W.filter(q=>{var Q,ee;return((Q=q.id)==null?void 0:Q.toString())!==((ee=P.id)==null?void 0:ee.toString())})),D(W=>W.filter(q=>{var Q;return q!==((Q=P.id)==null?void 0:Q.toString())})),localStorage.setItem(Y,JSON.stringify(H.filter(W=>{var q;return W!==((q=P.id)==null?void 0:q.toString())}))),(L=t.current)==null||L.reload()},J=()=>{var P;c.message.warning("后端暂未提供 role 删除接口"),S.forEach(L=>{o(W=>W.filter(q=>{var Q,ee;return((Q=q.id)==null?void 0:Q.toString())!==((ee=L.id)==null?void 0:ee.toString())})),D(W=>W.filter(q=>{var Q;return q!==((Q=L.id)==null?void 0:Q.toString())}))}),localStorage.setItem(Y,JSON.stringify(H.filter(L=>!S.find(W=>{var q;return((q=W.id)==null?void 0:q.toString())===L})))),p([]),y([]),(P=t.current)==null||P.reload()},G=()=>{const P=S.length>0?S:i;if(P.length===0){c.message.warning("暂无数据可导出");return}const W=`ID,角色编码,角色名称,描述,租户,状态,创建时间
|
|
58
|
+
`+P.map(re=>[re.id,re.roleCode,re.roleName,re.description,re.tenantCode,(Ac[re.status??1]||{text:String(re.status)}).text,re.createdAt].join(",")).join(`
|
|
59
|
+
`),q=new Blob(["\uFEFF"+W],{type:"text/csv;charset=utf-8"}),Q=URL.createObjectURL(q),ee=document.createElement("a");ee.href=Q,ee.download=`roles_${Se().format("YYYYMMDD_HHmmss")}.csv`,ee.click(),URL.revokeObjectURL(Q),c.message.success(`已导出 ${P.length} 条数据`)},K=async()=>{try{const P=[{id:1,resourceCode:"user:read",resourceName:"查看用户",resourceType:"API"},{id:2,resourceCode:"user:write",resourceName:"编辑用户",resourceType:"API"},{id:3,resourceCode:"role:read",resourceName:"查看角色",resourceType:"API"},{id:4,resourceCode:"role:write",resourceName:"编辑角色",resourceType:"API"},{id:5,resourceCode:"menu:dashboard",resourceName:"工作台",resourceType:"MENU"},{id:6,resourceCode:"menu:user",resourceName:"用户管理",resourceType:"MENU"},{id:7,resourceCode:"menu:role",resourceName:"角色管理",resourceType:"MENU"}];b(P),F(eF(P))}catch(P){c.message.error("加载资源失败:"+((P==null?void 0:P.message)||"未知错误"))}},A=async P=>{C(P),E([]),v(!0),await K()},k=async()=>{if(x!=null&&x.id){O(!0);try{for(const P of R)await at.grantRoleResource(x.id,Number(P));c.message.success(`已为角色 ${x.roleName} 授权 ${R.length} 个资源`),v(!1)}catch(P){c.message.error("授权失败:"+((P==null?void 0:P.message)||"未知错误"))}finally{O(!1)}}},N=[{title:"角色编码",dataIndex:"roleCode",width:140,search:!1},{title:"角色名称",dataIndex:"roleName",width:140,search:!1},{title:"描述",dataIndex:"description",width:220,ellipsis:!0,search:!1},{title:"状态",dataIndex:"status",width:80,search:!1,render:(P,L)=>{const W=Ac[L.status??1]||{text:String(L.status??"未知"),color:"default"};return s.jsx(c.Tag,{color:W.color,children:W.text})}},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:150,fixed:"right",search:!1,render:(P,L)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>Z(L),children:"编辑"},"edit"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>A(L),children:"授权"},"grant"),s.jsx(c.Popconfirm,{title:`删除角色 ${L.roleName}?`,onConfirm:()=>U(L),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})},"delete")]}];return d.useEffect(()=>{var P;(P=t.current)==null||P.reload()},[H]),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:"roleCode",label:"角色编码",children:s.jsx(ht.SearchInput,{placeholder:"请输入角色编码",onChange:P=>n.setFieldValue("roleCode",P)})}),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:"停用"}]})}),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(ae.SearchOutlined,{}),onClick:z,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(ae.UndoOutlined,{}),onClick:_,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>u(!0),children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),disabled:m.length===0,onClick:J,children:"批量删除"}),s.jsx(c.Button,{icon:s.jsx(ae.DownloadOutlined,{}),onClick:G,children:"导出"}),s.jsx(c.Button,{icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{var P;return(P=t.current)==null?void 0:P.reload()},children:"刷新"})]})]})}),s.jsx(_n,{actionRef:t,rowKey:"id",columns:N,request:$,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:P=>`共 ${P} 条`},rowSelection:{selectedRowKeys:m,onChange:(P,L)=>{p(P),y(L)}},tableAlertRender:({selectedRowKeys:P})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:P.length})," 项"]})}),s.jsx(c.Modal,{title:"新建角色",open:l,onOk:V,onCancel:()=>u(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:f,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0}],extra:"唯一标识,建议英文下划线",children:s.jsx(c.Input,{placeholder:"如 admin / dev / viewer"})}),s.jsx(c.Form.Item,{name:"roleName",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:"编辑角色",open:!!h,onOk:B,onCancel:()=>g(null),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:f,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!h})}),s.jsx(c.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0}],children:s.jsx(c.Input,{})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2})})]})}),s.jsxs(c.Drawer,{title:x?`为角色授权 — ${x.roleName}`:"授权",open:j,onClose:()=>v(!1),size:520,extra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{onClick:()=>v(!1),children:"取消"}),s.jsxs(c.Button,{type:"primary",loading:M,onClick:k,children:["保存 (",R.length,")"]})]}),children:[s.jsx("div",{style:{color:"#666",fontSize:12,marginBottom:12},children:"勾选授予该角色的资源。注:后端 /api/ctc/authorization/resources/list 端点尚未实现, 当前展示为 mock 数据;生产环境替换 fetchResourceTree()。"}),s.jsx(c.Tree,{checkable:!0,treeData:T,checkedKeys:R,onCheck:P=>E(P),blockNode:!0,height:520})]})]})}const yr={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}},nF=[{value:"",label:"任意"},{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}];function rF({apiBaseURL:e}){var G,K;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,u]=d.useState([]),[h,g]=d.useState([]),[f,m]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),[j,v]=d.useState(!1),[x,C]=d.useState(null),[w,b]=d.useState("info"),[T,F]=d.useState([]),[R,E]=d.useState(!1),M=d.useCallback(async()=>{try{const A=await at.distinctApps(),k=Array.isArray(A)?A:[];g(k.map(N=>({value:N,label:N})))}catch{g([])}},[]);d.useEffect(()=>{M()},[M]);const O=d.useCallback(()=>{var N;const A=n.getFieldsValue(),k={};A.appCode&&(k.appCode=A.appCode),A.type!==void 0&&A.type!==null&&(k.type=A.type),A.keyword&&(k.keyword=A.keyword),A.status!==void 0&&A.status!==null&&(k.status=A.status),a(k),(N=t.current)==null||N.reload()},[n]),Y=d.useCallback(()=>{var A;n.resetFields(),a({}),(A=t.current)==null||A.reload()},[n]),H=async A=>{try{const k=await at.listResourcesByApp({appCode:r.appCode,type:r.type,keyword:r.keyword,pageNum:A.current,pageSize:A.pageSize}),N=(k==null?void 0:k.data)||[],P=(k==null?void 0:k.total)??N.length;return{data:N,success:!0,total:P}}catch(k){return c.message.error("查询权限点失败:"+((k==null?void 0:k.message)||"未知错误")),{data:[],success:!1,total:0}}},D=async()=>{var A;try{const k=await y.validateFields();await at.createResource(k),c.message.success("创建成功"),m(!1),y.resetFields(),(A=t.current)==null||A.reload(),M()}catch(k){if(k!=null&&k.errorFields)return;c.message.error("创建失败:"+((k==null?void 0:k.message)||"未知错误"))}},I=A=>{S(A),y.setFieldsValue(A),m(!0)},$=async()=>{var A;if(p!=null&&p.id)try{const k=await y.validateFields();await at.updateResource(p.id,k),c.message.success("更新成功"),m(!1),S(null),y.resetFields(),(A=t.current)==null||A.reload(),M()}catch(k){if(k!=null&&k.errorFields)return;c.message.error("更新失败:"+((k==null?void 0:k.message)||"未知错误"))}},z=async A=>{var k;try{await at.deleteResource(A),c.message.success("已删除"),(k=t.current)==null||k.reload()}catch(N){c.message.error("删除失败:"+((N==null?void 0:N.message)||"未知错误"))}},_=async()=>{var A;if(l.length!==0)try{await Promise.all(l.map(k=>at.deleteResource(k.id))),c.message.success(`已删除 ${l.length} 条`),o([]),u([]),(A=t.current)==null||A.reload()}catch(k){c.message.error("批量删除失败:"+((k==null?void 0:k.message)||"未知错误"))}},V=async A=>{if(!A){F([]);return}E(!0);try{const k=await at.listResourceRoles(A);F(k||[])}catch{F([])}finally{E(!1)}},Z=A=>{C(A),b("info"),v(!0),V(A.id)},B=()=>{v(!1),C(null),F([])},U=A=>{b(A),A==="roles"&&(x!=null&&x.id)&&V(x.id)},J=[{title:"编码",dataIndex:"resourceCode",width:200,fixed:"left",search:!1,render:(A,k)=>s.jsx(c.Tooltip,{title:k.resourceCode,children:s.jsx("span",{style:{fontFamily:"monospace"},children:k.resourceCode})})},{title:"名称",dataIndex:"resourceName",width:160,search:!1},{title:"类型",dataIndex:"resourceType",width:80,search:!1,render:(A,k)=>{const N=yr[k.resourceType??3]||{text:String(k.resourceType??"?"),color:"default"};return s.jsx(c.Tag,{color:N.color,children:N.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(A,k)=>k.appCode?s.jsx(c.Tag,{color:"cyan",children:k.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"路径",dataIndex:"path",width:220,ellipsis:!0,search:!1},{title:"方法",dataIndex:"method",width:80,search:!1,render:(A,k)=>k.method?s.jsx(c.Tag,{children:k.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(A,k)=>s.jsx(c.Tag,{color:k.status===1?"success":"default",children:k.status===1?"启用":"禁用"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(A,k)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:N=>{N.stopPropagation(),I(k)},children:"编辑"},"edit"),s.jsx(c.Popconfirm,{title:"确认删除该权限点?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:N=>{var P;(P=N==null?void 0:N.stopPropagation)==null||P.call(N),z(k.id)},children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:N=>N.stopPropagation(),children:"删除"})},"delete"),s.jsx(c.Button,{type:"link",size:"small",onClick:N=>{N.stopPropagation(),Z(k)},children:"详情"},"detail")]}];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:h,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(yr).map(([A,k])=>({value:Number(A),label:k.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:200}})}),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(ae.SearchOutlined,{}),onClick:O,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(ae.UndoOutlined,{}),onClick:Y,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(ae.PlusOutlined,{}),onClick:()=>{S(null),y.resetFields(),m(!0)},children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),disabled:i.length===0,onClick:_,children:"批量删除"}),s.jsx(c.Button,{icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{var A;return(A=t.current)==null?void 0:A.reload()},children:"刷新"})]})]})}),s.jsx(_n,{actionRef:t,rowKey:"id",columns:J,request:H,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:A=>`共 ${A} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(A,k)=>{o(A),u(k)}},tableAlertRender:({selectedRowKeys:A})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:A.length})," 项"]}),onRow:A=>({onClick:()=>Z(A),style:{cursor:"pointer"}})}),s.jsx(c.Modal,{title:p?`编辑权限点 — ${p.resourceCode}`:"新建权限点",open:f,onOk:p?$:D,onCancel:()=>{m(!1),S(null),y.resetFields()},size:"large",destroyOnHidden:!0,okText:p?"保存":"创建",children:s.jsxs(c.Form,{form:y,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:!!p})}),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(yr).map(([A,k])=>({value:Number(A),label:k.text}))})}),s.jsx(c.Form.Item,{name:"appCode",label:"所属应用",extra:"选择权限点归属的应用;不选则为「公共」",children:s.jsx(c.Select,{placeholder:"公共(跨应用)",allowClear:!0,showSearch:!0,optionFilterProp:"label",options:h})}),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:nF})}),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:x?`权限点详情 — ${x.resourceCode}`:"权限点详情",open:j,onClose:B,size:900,destroyOnHidden:!0,children:x&&s.jsxs("div",{style:{display:"flex",gap:16,minHeight:480},children:[s.jsx("div",{style:{width:160,borderRight:"1px solid #f0f0f0",paddingRight:8},children:s.jsx(c.Menu,{mode:"inline",selectedKeys:[w],onClick:({key:A})=>U(A),style:{border:"none",background:"transparent"},items:[{key:"info",icon:s.jsx(ae.InfoCircleOutlined,{}),label:"基本信息"},{key:"roles",icon:s.jsx(ae.TeamOutlined,{}),label:`关联角色 (${T.length})`}]})}),s.jsx("div",{style:{flex:1,minWidth:0},children:w==="info"?s.jsxs(c.Descriptions,{title:"权限点信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"资源ID",children:x.id}),s.jsx(c.Descriptions.Item,{label:"资源编码",children:s.jsx("span",{style:{fontFamily:"monospace"},children:x.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"资源名称",children:x.resourceName}),s.jsx(c.Descriptions.Item,{label:"资源类型",children:s.jsx(c.Tag,{color:(G=yr[x.resourceType??3])==null?void 0:G.color,children:((K=yr[x.resourceType??3])==null?void 0:K.text)||x.resourceType})}),s.jsx(c.Descriptions.Item,{label:"所属应用",span:2,children:x.appCode?s.jsx(c.Tag,{color:"cyan",children:x.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"URL 路径",span:2,children:x.path||"-"}),s.jsx(c.Descriptions.Item,{label:"HTTP 方法",children:x.method?s.jsx(c.Tag,{children:x.method}):"-"}),s.jsx(c.Descriptions.Item,{label:"图标",children:x.icon||"-"}),s.jsx(c.Descriptions.Item,{label:"排序",children:x.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:x.status===1?"success":"default",children:x.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"租户",span:2,children:x.tenantCode||"公共"}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:x.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:x.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:x.updatedAt||"-"})]}):s.jsx(ht.ListTable,{rows:T,rowKey:"id",loading:R,searchKeys:["roleCode","roleName"],searchPlaceholder:"按角色编码 / 角色名称过滤",emptyTitle:"该权限点暂未被任何角色绑定",columns:[{title:"角色编码",dataIndex:"roleCode",width:160},{title:"角色名称",dataIndex:"roleName",width:160},{title:"状态",dataIndex:"status",width:80,render:(A,k)=>s.jsx(c.Tag,{color:k.status===1?"success":"default",children:k.status===1?"正常":"停用"})},{title:"租户",dataIndex:"tenantCode",width:100},{title:"描述",dataIndex:"description",ellipsis:!0}]})})]})})]})}const Dc={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}};function sF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]);d.useEffect(()=>{Cr.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 at.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 c.message.error("查询资源失败:"+((p==null?void 0:p.message)||"未知错误")),{data:[],success:!1,total:0}}},u=()=>{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 at.deleteResource(m),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:(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(c.Tag,{color:S.color,children:S.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(m,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:(m,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:(m,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:(m,p)=>[s.jsx(c.Popconfirm,{title:`删除资源 ${p.resourceCode}?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>g(p.id),children:s.jsx(c.Button,{type:"text",size:"small",danger:!0,icon:s.jsx(ae.DeleteOutlined,{}),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(Dc).map(([m,p])=>({value:Number(m),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(ae.SearchOutlined,{}),onClick:u,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(ae.UndoOutlined,{}),onClick:h,children:"重置"})]})})]}),s.jsx(c.Space,{style:{flexShrink:0},children:s.jsx(c.Button,{icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{var m;return(m=t.current)==null?void 0:m.reload()},children:"刷新"})})]})}),s.jsx(_n,{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 hs={listAccounts:e=>Un.listByTenant(e),listUserRoles:e=>at.listUserRoles(e),listUserPermissions:e=>at.listUserPermissions(e),listRoleResources:e=>at.listRolePermissions(e)},{Text:aF}=c.Typography;function iF({apiBaseURL:e}){const[t,n]=d.useState([]),[r,a]=d.useState(!1),[i,o]=d.useState(null),[l,u]=d.useState([]),[h,g]=d.useState(!1),[f,m]=d.useState([]),[p,S]=d.useState(!1),[y,j]=d.useState([]),[v,x]=d.useState(null),[C,w]=d.useState(!1),b=async()=>{a(!0);try{const M=await hs.listAccounts({pageNum:1,pageSize:200}),O=Array.isArray(M)?M:(M==null?void 0:M.records)||(M==null?void 0:M.data)||[];n(O),O.length>0&&!i&&o(O[0].id)}catch{n([])}finally{a(!1)}};d.useEffect(()=>{b()},[]),d.useEffect(()=>{if(!i){u([]),m([]);return}g(!0),S(!0),hs.listUserRoles(i).then(M=>u(Array.isArray(M)?M:[])).catch(()=>u([])).finally(()=>g(!1)),hs.listUserPermissions(i).then(M=>m(Array.isArray(M)?M:[])).catch(()=>m([])).finally(()=>S(!1))},[i]),d.useEffect(()=>{if(!v){j([]);return}w(!0),hs.listRoleResources(v).then(M=>{const O=Array.isArray(M)?M:[],Y={};O.forEach(D=>{const I=D.resourceType||"OTHER";Y[I]||(Y[I]=[]),Y[I].push(D)});const H=Object.entries(Y).map(([D,I])=>({title:`${D} (${I.length})`,key:`type-${D}`,children:I.map($=>({title:`${$.resourceName} (${$.resourceCode})`,key:`res-${$.id}`,raw:$}))}));j(H)}).catch(()=>j([])).finally(()=>w(!1))},[v]);const T=t.map(M=>({value:M.id,label:`${M.username||M.nickname||M.id} (${M.tenantCode||"default"})`})),[F,R]=d.useState(""),E=d.useMemo(()=>{const M=F.trim().toLowerCase();return M?l.filter(O=>`${O.roleCode||""} ${O.roleName||""}`.toLowerCase().includes(M)):l},[l,F]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(ht.TableToolbar,{left:s.jsx(c.Select,{showSearch:!0,placeholder:"选择用户",style:{width:320},value:i,onChange:o,loading:r,options:T,filterOption:(M,O)=>O.label.toLowerCase().includes(M.toLowerCase())}),right:s.jsx(c.Button,{icon:s.jsx(ae.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:h,extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按角色编码 / 名称过滤",style:{width:220},onChange:M=>R(M.target.value)}),children:l.length===0&&!h?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(aF,{strong:!0,children:M.roleName||M.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:M.roleCode})]}),description:M.description||"-"})})})}),s.jsx(ht.ListTable,{cardTitle:`用户权限 (${f.length})`,rows:f,rowKey:(M,O)=>M.code||M.resourceCode||M.id||O,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该用户暂无直接权限",columns:[{title:"资源编码",dataIndex:"code",width:200,render:(M,O)=>s.jsx("span",{style:{fontFamily:"monospace"},children:O.code||O.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(M,O)=>O.name||O.resourceName||"-"}],cardProps:{size:"small",loading:p}}),s.jsx(c.Card,{size:"small",title:v?`角色资源 (${y.reduce((M,O)=>{var Y;return M+(((Y=O.children)==null?void 0:Y.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 Bd="/api";function oF(e){Bd=e||"/api"}function Ha(){return Jt.createRequest({baseURL:Bd,timeout:15e3})}const Cn={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 lF({apiBaseURL:e}){e&&oF(e);const[t]=c.Form.useForm(),n=d.useRef(void 0),[r,a]=d.useState(null),[i,o]=d.useState(()=>JSON.parse(localStorage.getItem(Pc)||"[]")),[l,u]=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;u(!0);try{const C=await Cn.shorten({originUrl:v.originUrl,ttlMillis:v.ttlMillis||0,remark:v.remark});a(C);const w=Cn.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]),c.message.success(`短链生成成功:${w}`),(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 Cn.invalidate(v),c.message.success("已失效"),m(i.filter(C=>C.mapKey!==v)),(x=n.current)==null||x.reload()}catch(C){m(i.filter(w=>w.mapKey!==v)),c.message.warning("后端失效失败,已从本地移除:"+((C==null?void 0:C.message)||""))}},j=[{title:"短码",dataIndex:"mapKey",width:120,fixed:"left"},{title:"完整短链",dataIndex:"mapKey",width:280,render:(v,x)=>{const C=Cn.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(ae.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:"text",danger:!0,size:"small",icon:s.jsx(ae.DeleteOutlined,{}),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(ae.LinkOutlined,{})," 生成短链"]}),children:[s.jsxs(gt,{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(ae.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(F0,{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(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:Cn.buildUrl(r.mapKey),target:"_blank",rel:"noreferrer",children:Cn.buildUrl(r.mapKey)}),s.jsx(c.Button,{type:"link",size:"small",icon:s.jsx(ae.CopyOutlined,{}),onClick:()=>S(Cn.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(_n,{actionRef:n,rowKey:"mapKey",columns:j,dataSource:f,search:!1,pagination:{pageSize:10,showSizeChanger:!0},toolBarRender:()=>[s.jsx(c.Button,{onClick:()=>m([]),children:"清空历史"},"clear"),s.jsx(c.Button,{icon:s.jsx(ae.ReloadOutlined,{}),onClick:()=>{var v;return(v=n.current)==null?void 0:v.reload()},children:"刷新"},"reload")]})})]})}let cF="/api";function Pt(){return Jt.createRequest({baseURL:cF,timeout:15e3})}const an={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 uF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState(null),[o,l]=d.useState([]),[u,h]=d.useState(!1),[g,f]=d.useState(!1),[m,p]=d.useState(null),[S]=c.Form.useForm(),[y,j]=d.useState(!1),[v,x]=d.useState(null),[C]=c.Form.useForm(),w=async()=>{r(!0);try{const I=await an.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(()=>{w()},[]);const b=async I=>{if(!I){l([]);return}h(!0);try{const $=await an.listDictItem(I);l(Array.isArray($)?$:[])}catch($){c.message.error("加载字典项失败:"+(($==null?void 0:$.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)},F=I=>{p(I),S.setFieldsValue({dictCode:I.dictCode,dictName:I.dictName,status:I.status??1,remark:I.remark}),f(!0)},R=async()=>{try{const I=await S.validateFields();m?(await an.updateDictType(m.id,I),c.message.success("更新成功")):(await an.createDictType(I),c.message.success("创建成功")),f(!1),p(null),S.resetFields(),w()}catch(I){if(I!=null&&I.errorFields)return;c.message.error((m?"更新失败:":"创建失败:")+((I==null?void 0:I.message)||"未知错误"))}},E=async I=>{try{await an.deleteDictType(I),c.message.success("已删除"),(a==null?void 0:a.id)===I&&i(null),w()}catch($){c.message.error("删除失败:"+(($==null?void 0:$.message)||"未知错误"))}},M=()=>{if(!a){c.message.warning("请先选择左侧的字典类型");return}x(null),C.resetFields(),j(!0)},O=I=>{x(I),C.setFieldsValue({itemCode:I.itemCode,itemName:I.itemName,sortOrder:I.sortOrder??0,status:I.status??1}),j(!0)},Y=async()=>{try{const $={...await C.validateFields(),dictId:a.id};v?(await an.updateDictItem(v.id,$),c.message.success("更新成功")):(await an.createDictItem($),c.message.success("创建成功")),j(!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)||"未知错误"))}},H=async I=>{try{await an.deleteDictItem(I),c.message.success("已删除"),b(a.id)}catch($){c.message.error("删除失败:"+(($==null?void 0:$.message)||"未知错误"))}},D=[{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:()=>O($),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该字典项?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>H($.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(ht.ListTable,{cardTitle:`字典类型 (${e.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(ae.PlusOutlined,{}),onClick:T,children:"新增"}),s.jsx(c.Button,{size:"small",icon:s.jsx(ae.ReloadOutlined,{}),onClick:w})]}),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:z=>z.stopPropagation(),children:[s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(ae.EditOutlined,{}),onClick:()=>F($)}),s.jsx(c.Popconfirm,{title:"删除该类型?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>E($.id),children:s.jsx(c.Button,{type:"text",size:"small",danger:!0,icon:s.jsx(ae.DeleteOutlined,{})})})]})}]}),a?s.jsx(ht.ListTable,{cardTitle:`字典项 — ${a.dictName} (${o.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(ae.PlusOutlined,{}),onClick:M,disabled:!a,children:"新增项"}),s.jsx(c.Button,{size:"small",icon:s.jsx(ae.ReloadOutlined,{}),disabled:!a,onClick:()=>a&&b(a.id)})]}),rows:o,rowKey:"id",loading:u,searchKeys:["itemCode","itemName"],searchPlaceholder:"按项编码 / 项名称过滤",cardProps:{size:"small"},columns:D}):s.jsx(c.Card,{size:"small",title:"字典项",children:s.jsx("div",{style:{padding:40,textAlign:"center",color:"#999"},children:"请在左侧选择一个字典类型以查看其字典项"})})]}),s.jsx(c.Modal,{title:m?"编辑字典类型":"新建字典类型",open:g,onOk:R,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:!!m,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:Y,onCancel:()=>{j(!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 dF="/api";function Ya(){return Jt.createRequest({baseURL:dF,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 fF(){return s.jsx("div",{children:s.jsx(c.Tabs,{defaultActiveKey:"login",size:"small",items:[{key:"login",label:s.jsxs("span",{children:[s.jsx(ae.LoginOutlined,{})," 登录日志"]}),children:s.jsx(mF,{})},{key:"operation",label:s.jsxs("span",{children:[s.jsx(ae.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 mF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState([]),[o,l]=d.useState(!1),[u,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 F=await Nc.list({...m,...T});i((F==null?void 0:F.list)||[]),h((F==null?void 0:F.total)||0)}catch{i([]),h(0)}finally{l(!1)}};d.useEffect(()=>{S(),y({page:1,size:20})},[]);const j=()=>y({page:1,size:20}),v=(b,T)=>{const F={page:b,size:T||g.size};f(F),y(F)},x=e.filter(b=>b.loginStatus===1).length,C=e.filter(b=>b.loginStatus!==1).length,w=[{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?Se(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(ae.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(ae.ReloadOutlined,{spin:n})," 刷新最近"]}),s.jsxs("a",{onClick:()=>y(),children:[s.jsx(ae.ReloadOutlined,{spin:o})," 刷新列表"]})]}),children:[s.jsxs(c.Space,{wrap:!0,style:{marginBottom:12},children:[s.jsx(ht.SearchInput,{placeholder:"登录标识",value:m.identifier,onChange:b=>p({...m,identifier:b}),onSearch:j}),s.jsx(ht.SearchInput,{placeholder:"租户编码",value:m.tenantCode,onChange:b=>p({...m,tenantCode:b}),onSearch:j}),s.jsx(c.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:j,children:[s.jsx(ae.SearchOutlined,{})," 查询"]})]}),s.jsx(c.Table,{size:"small",rowKey:"id",loading:o,dataSource:a,columns:w,pagination:{current:g.page,pageSize:g.size,total:u,showSizeChanger:!0,showTotal:b=>`共 ${b} 条`,onChange:v}})]})]})}const gs=Jt.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 hF(){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,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(ae.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(ae.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(ae.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(ae.LinkOutlined,{})})})})]})})}const Vd=({name:e="4A"})=>s.jsxs(c.Button,{type:"primary",children:["Hello ",e,"(来自 @yuku123/z-ctc-component)"]}),gF={HelloCtc:Vd};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=qT;exports.ApplicationManagement=QT;exports.AuditPage=fF;exports.ComponentDocPage=ef;exports.CtcOverview=hF;exports.DictPage=uF;exports.HelloCtc=Vd;exports.MyTenantManagement=df;exports.OrgManagement=Vc;exports.OrgPage=of;exports.PermissionManagement=rF;exports.ResourcePage=sF;exports.RoleManagement=tF;exports.StatusTag=rf;exports.SurlManagement=lF;exports.TenantManagement=uf;exports.UserPermissionPage=iF;exports.UserTable=tf;exports.ctcAcDomainApi=At;exports.ctcAcTenantApi=jn;exports.default=gF;
|