@jiaozhiye/qm-design-react 1.11.20 → 1.11.21

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/lib/index.esm.js CHANGED
@@ -1 +1 @@
1
- import*as e from"react";import t,{createContext as n,version as r,isValidElement as i,useRef as l,useLayoutEffect as a,useEffect as o,useState as s,useCallback as c,Component as d,forwardRef as u,useImperativeHandle as p}from"react";import m from"dayjs";import"dayjs/locale/zh-cn";import h from"dayjs/plugin/localeData";import f from"dayjs/plugin/advancedFormat";import g from"dayjs/plugin/customParseFormat";import v from"dayjs/plugin/quarterOfYear";import y from"dayjs/plugin/weekOfYear";import b from"dayjs/plugin/weekday";import{ConfigProvider as x,Button as E,Tooltip as w,Popconfirm as C,Space as S,Empty as N,Spin as T,Upload as I,message as R,Input as O,Tabs as k,Drawer as L,Modal as A,Form as P,Row as _,Col as D,Select as H,Checkbox as F,Dropdown as M,InputNumber as $,Divider as q,Radio as j,Menu as K,Popover as V,Tree as z,Switch as W,Pagination as B,Rate as U,Tag as G,TreeSelect as Y,Cascader as X,Image as Q,notification as Z,Slider as J}from"antd";export{Affix,Alert,Anchor,AutoComplete,Avatar,BackTop,Badge,Breadcrumb,Button,Card,Carousel,Cascader,Checkbox,Col,Collapse,Comment,ConfigProvider,Descriptions,Divider,Drawer,Dropdown,Empty,Form,Grid,Image,Input,InputNumber,Layout,List,Mentions,Menu,Modal,PageHeader,Pagination,Popconfirm,Popover,Progress,Radio,Rate,Result,Row,Segmented,Select,Skeleton,Slider,Space,Spin,Statistic,Steps,Switch,Table,Tabs,Tag,Timeline,Tooltip,Transfer,Tree,TreeSelect,Typography,Upload,message,notification}from"antd";import ee from"dayjs/plugin/weekYear";import te from"antd/es/calendar/generateCalendar";import ne from"antd/es/date-picker/generatePicker";import re from"antd/es/locale/zh_CN";import ie from"antd/es/locale/en_GB";import{isArray as le,isPlainObject as ae,isNumber as oe,isFunction as se,isString as ce,isUndefined as de,get as ue,transform as pe,isEqual as me,set as he,xor as fe,isRegExp as ge,intersection as ve,map as ye,groupBy as be,flatten as xe,spread as Ee,mergeWith as we,isDate as Ce,sumBy as Se,maxBy as Ne,minBy as Te,merge as Ie,union as Re,pickBy as Oe,uniqBy as ke,debounce as Le,throttle as Ae}from"lodash-es";import Pe from"classnames";import{UpOutlined as _e,DownOutlined as De,UploadOutlined as He,LinkOutlined as Fe,EditOutlined as Me,CheckOutlined as $e,EyeOutlined as qe,DownloadOutlined as je,DeleteOutlined as Ke,FullscreenExitOutlined as Ve,FullscreenOutlined as ze,UnorderedListOutlined as We,HolderOutlined as Be,InfoCircleFilled as Ue,ReloadOutlined as Ge,PrinterOutlined as Ye,ImportOutlined as Xe,SettingOutlined as Qe,CopyOutlined as Ze,CheckSquareOutlined as Je,CloseCircleOutlined as et,MonitorOutlined as tt,FolderOpenOutlined as nt,PlusOutlined as rt,CloseOutlined as it,FilterOutlined as lt,SortAscendingOutlined as at,LeftOutlined as ot,RightOutlined as st,EyeInvisibleOutlined as ct,ColumnHeightOutlined as dt,FolderOutlined as ut,BarsOutlined as pt,SaveOutlined as mt,InfoCircleOutlined as ht,BgColorsOutlined as ft,CaretDownOutlined as gt,ExpandAltOutlined as vt,CaretRightOutlined as yt,LineChartOutlined as bt,PieChartOutlined as xt,FunnelPlotOutlined as Et,AppstoreAddOutlined as wt,StepBackwardOutlined as Ct,StepForwardOutlined as St,SearchOutlined as Nt,ClearOutlined as Tt,ZoomInOutlined as It,ZoomOutOutlined as Rt,RotateRightOutlined as Ot,RotateLeftOutlined as kt,InboxOutlined as Lt,ExclamationCircleOutlined as At,PauseOutlined as Pt,QuestionCircleOutlined as _t,MenuOutlined as Dt,BorderOutlined as Ht}from"@ant-design/icons";import Ft,{flushSync as Mt}from"react-dom";import $t from"react-countup";import qt from"resize-observer-polyfill";import jt from"sortablejs";import Kt from"add-dom-event-listener";import Vt from"scroll-into-view-if-needed";import zt from"react-draggable";import Wt from"memoize-one";import*as Bt from"prop-types";import Ut from"prop-types";import{ReactSortable as Gt}from"react-sortablejs";import Yt from"big.js";import Xt from"exceljs";import Qt from"localforage";import Zt from"@rc-component/trigger";import Jt,{ColorBlock as en}from"@rc-component/color-picker";import tn from"@rc-component/portal";import nn from"copy-to-clipboard";import rn from"china-area-data";import ln from"cropperjs";import an from"html2canvas";const on=n({locale:"zh-cn",size:"middle"});var sn={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?",shortcutKey:"快捷键"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",countLimit:"数量不能超过 {count} 个",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传",remove:"删除文件",batchDownload:"批量下载"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选",nullValue:"空值"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",nullText:"空值",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",matchCase:"大小写匹配",matchFullchar:"全字符匹配",queryLabel:"查找内容",queryPrev:"查找上一个",queryNext:"查找下一个",queryAll:"查找全部",findTotal:"查找到 {total} 个单元格",cellText:"单元格",valText:"值"},pivotGrid:{text:"多维表",settingTitle:"多维表看板"}},pivotGrid:{saved:{text:"配置",add:"添加配置项",title:"已保存的配置信息"},export:{text:"导出",group:"导出分组",list:"导出列表"},count:{statistic:"统计",records:"记录数",unique:"唯一值",empty:"空值",notEmpty:"非空值",sum:"合计值",max:"最大值",min:"最小值",avg:"平均值"},field:{text:"字段管理",title:"字段自定义设置"},fillColor:{text:"填色",add:"添加条件",title:"设置填色条件",cell:"单元格",row:"整行",col:"整列"},filter:{text:"筛选",title:"设置筛选条件",matchAll:"满足所有条件",matchAny:"满足任一条件"},group:{text:"分组",title:"设置分组条件",foldAll:"折叠所有",unfoldAll:"展开所有",empty:"(内容为空)",ascend:"选项顺序",descend:"选项倒序"},lineHeight:{text:"行高",size:["常规","中等","高"]},search:{text:"查找",title:"设置查找条件"},sorter:{text:"排序",title:"设置排序条件",ascend:"字段升序",descend:"字段降序"},viewMode:{table:"表格视图",gantt:"甘特视图",card:"看板视图"}}}};let cn=sn;function dn(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const un=(...e)=>{const[t,n]=e;let r;const i=t.split(".");let l=cn;for(let e=0,t=i.length;e<t;e++){if(r=l[i[e]],e===t-1)return dn(r,n);if(!r)return"";l=r}return""},pn=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((n,r)=>(n[r]=void 0!==t[r]?t[r]:e[r],n)),{})),mn=(t,n)=>{const r=e.useRef(!0);e.useLayoutEffect((()=>t(r.current)),n),e.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function hn(e,t){mn((t=>{if(!t)return e()}),t)}m.extend(h),m.extend(f),m.extend(g),m.extend(v),m.extend(y),m.extend(b);var fn={},gn=[];function vn(e,t){if(!e&&void 0!==console){var n=gn.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function yn(e,t){if(!e&&void 0!==console){var n=gn.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function bn(e,t,n){t||fn[n]||(e(!1,n),fn[n]=!0)}function xn(e,t){bn(vn,e,t)}function En(e,t){bn(yn,e,t)}xn.preMessage=function(e){gn.push(e)},xn.resetWarned=function(){fn={}},xn.noteOnce=En,m.extend(g),m.extend(f),m.extend(b),m.extend(h),m.extend(y),m.extend(ee),m.extend((function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=(e||"").replace("Wo","wo");return r.bind(this)(t)}}));var wn={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},Cn=function(e){return wn[e]||e.split("_")[0]},Sn=function(){En(!1,"Not match any format. Please help to fire a issue about this.")},Nn={getNow:function(){return m()},getFixedDate:function(e){return m(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return m().locale(Cn(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(Cn(e)).weekday(0)},getWeek:function(e,t){return t.locale(Cn(e)).week()},getShortWeekDays:function(e){return m().locale(Cn(e)).localeData().weekdaysMin()},getShortMonths:function(e){return m().locale(Cn(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(Cn(e)).format(n)},parse:function(e,t,n){for(var r=Cn(e),i=0;i<n.length;i+=1){var l=n[i],a=t;if(l.includes("wo")||l.includes("Wo")){for(var o=a.split("-")[0],s=a.split("-")[1],c=m(o,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var u=c.add(d,"week");if(u.format("Wo")===s)return u}return Sn(),null}var p=m(a,l).locale(r);if(p.isValid())return p}return t&&Sn(),null}}};const Tn=te(Nn),In=ne(Nn);function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rn.apply(null,arguments)}const On=e.forwardRef(((t,n)=>e.createElement(In,Rn({},t,{picker:"time",mode:void 0,ref:n}))));On.displayName="TimePicker";const kn=e.forwardRef(((t,n)=>e.createElement(In.RangePicker,Rn({},t,{picker:"time",mode:void 0,ref:n}))));kn.displayName="RangePicker",On.RangePicker=kn;var Ln={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?",shortcutKey:"Shortcut Key"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",countLimit:"Quantity cannot exceed {count}",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload",remove:"Delete files",batchDownload:"Batch download"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter",nullValue:"Null Value"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",nullText:"null value",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",matchCase:"Case matching",matchFullchar:"Full character matching",queryLabel:"Find content",queryPrev:"Find previous",queryNext:"Find next",queryAll:"Find all",findTotal:"Found {total} cells",cellText:"Cell",valText:"Value"},pivotGrid:{text:"Pivot Grid",settingTitle:"Pivot Grid Dashboard"}},pivotGrid:{saved:{text:"Config",add:"Add configuration",title:"Saved configuration list"},export:{text:"Export",group:"Export group",list:"Export list"},count:{statistic:"Statistics",records:"count",unique:"unique",empty:"empty",notEmpty:"not empty",sum:"sum value",max:"max value",min:"min value",avg:"avg value"},field:{text:"Field manage",title:"Field customization settings"},fillColor:{text:"Fill color",add:"Add condition",title:"Set fill color conditions",cell:"Cell",row:"Row",col:"Col"},filter:{text:"Filter",title:"Set filter conditions",matchAll:"Meet all conditions",matchAny:"Meet any conditions"},group:{text:"Group",title:"Set group conditions",foldAll:"Fold all",unfoldAll:"unfold all",empty:"(Empty content)",ascend:"Order ascend",descend:"Order descend"},lineHeight:{text:"Line height",size:["Common size","Middle size","Large size"]},search:{text:"Search",title:"Set search conditions"},sorter:{text:"Sorter",title:"Set sorter conditions",ascend:"Field ascend",descend:"Field descend"},viewMode:{table:"Table view",gantt:"Gantt view",card:"Card view"}}}};const An={[Ln.name]:{qm:Ln,antd:ie},[sn.name]:{qm:sn,antd:re}},Pn=e=>{const n=pn({locale:"zh-cn",size:"middle"},e),{locale:r,size:i,global:l}=n;t.useMemo((()=>{return e=Object.assign({},An,null==l?void 0:l.langPackage)[r].qm,cn=e||cn,void(cn.name&&m.locale(cn.name));var e}),[r]);const a=t.useMemo((()=>Object.assign({},An,null==l?void 0:l.langPackage)),[l]),[o,s]=t.useState({locale:r,size:i,global:l});return hn((()=>{s((e=>Object.assign({},e,{locale:r,size:i})))}),[i,r]),t.createElement(on.Provider,{value:o},t.createElement(x,{locale:a[o.locale].antd,componentSize:o.size,autoInsertSpaceInButton:null==l?void 0:l.autoInsertSpaceInButton},n.children))};function _n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function Dn(e,t,n,r){var i,l=arguments.length,a=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(l<3?i(a):l>3?i(t,n,a):i(t,n))||a);return l>3&&a&&Object.defineProperty(t,n,a),a}function Hn(e,t,n,r){return new(n||(n=Promise))((function(i,l){function a(e){try{s(r.next(e))}catch(e){l(e)}}function o(e){try{s(r.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}s((r=r.apply(e,t||[])).next())}))}function Fn(){const{locale:t}=e.useContext(on);return{t:un,$locale:t}}function Mn(t){const n=e.useRef();n.current=t;return e.useCallback(((...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])}function $n(t){const{size:n}=e.useContext(on);return{$size:e.useMemo((()=>{var e,r;return null!==(r=null!==(e=t.size)&&void 0!==e?e:n)&&void 0!==r?r:""}),[t.size,n])}}Pn.displayName="QmConfigProvider";var qn="undefined"==typeof window;const jn=e=>t.isValidElement(e),Kn=e=>jn(e)&&e.type===t.Fragment,Vn=()=>{},zn=()=>!0,Wn=e=>Hn(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),Bn=e=>{Promise.resolve().then(e)},Un=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),Gn=e=>!!(!e&&0!==e||le(e)&&!e.length||ae(e)&&!Object.keys(e).length),Yn=(e,t)=>t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e),Xn=(e,t)=>{const n=Object.assign({},e);for(const e of t)delete n[e];return n};const Qn=(e,t=new WeakMap)=>{if(ae(e)||le(e)){const n=Array.isArray(e),r=n?[]:{};if(t.get(e))return e;t.set(e,r);const i=n?void 0:Object.keys(e);return function(e,t){let n=-1;const r=e.length;for(;++n<r;)t(e[n],n)}(i||e,((n,l)=>{i&&(l=n),r[l]=Qn(e[l],t)})),r}return e},Zn=e=>oe(e)?`${e}px`:e.toString();class Jn extends Error{constructor(e){super(e),this.name="QmDesignError"}}function er(e,t){throw new Jn(`[${e}] ${t}`)}function tr(e,t){console.warn(new Jn(`[${e}] ${t}`))}const nr=e=>{const{loading:n,shortcutKey:r,authConfig:i,click:l,confirm:a}=e,{t:o}=Fn(),{$size:s}=$n(e);t.useEffect((()=>(r&&document.addEventListener("keyup",u),()=>document.removeEventListener("keyup",u))),[]);const[c,d]=t.useState(!1),u=Mn((e=>{var t;const n=r.split("+").map((e=>e.trim().toLowerCase())),i=n.includes("alt"),l=n.includes("ctrl"),a=n.includes("shift"),o=n[n.length-1];i&&!e.altKey||l&&!e.ctrlKey||a&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),m.disabled||null===(t=m.onClick)||void 0===t||t.call(m,e))})),p=se(l)?{onClick:t=>Hn(void 0,void 0,void 0,(function*(){var n;d(!0);try{yield null===(n=e.click)||void 0===n?void 0:n.call(e,t)}catch(e){tr("Button","`click`方法执行出错")}d(!1)}))}:null,m=Object.assign(Object.assign(Object.assign({},Xn(e,["shortcutKey","authConfig","click","confirm"])),{size:s,loading:c||n||!1}),p);if(i){const{visible:e=1,disabled:t}=i||{};if(!e)return null;t&&(m.disabled=!0)}const h=t.createElement(E,m,e.children);return a?t.createElement(C,{title:a.title||o("qm.button.confirmTitle"),disabled:m.disabled,onConfirm:e=>{var t,n;null===(t=a.onConfirm)||void 0===t||t.call(a),null===(n=m.onClick)||void 0===n||n.call(m,e)},onCancel:e=>{var t;null===(t=a.onCancel)||void 0===t||t.call(a,e)}},t.createElement(E,Rn({},m,{onClick:Vn}),e.children)):!r||m.disabled?h:t.createElement(w,{placement:"top",title:`${o("qm.button.shortcutKey")}: ${r}`},h)};var rr;nr.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(rr||(rr={}));const ir=e=>{const{$size:n}=$n(e),r=oe(e.size)?e.size:rr[n||"default"],i=Object.assign(Object.assign({},Xn(e,["size"])),{size:r});return t.createElement(S,i,e.children)};ir.displayName="QmSpace";const lr=e=>`qm-${e}`,ar=e=>{const{label:n,extra:r,collapse:i,bordered:l=!0,disabled:a,id:o,className:s,style:c,onCollapseChange:d}=e,{$size:u}=$n(e),{t:p}=Fn(),m=lr("divider"),h={[m]:!0,[`${m}-borderless`]:!l,[`${m}--lg`]:"large"===u,[`${m}--sm`]:"small"===u};return t.createElement("div",{id:o,className:Pe(h,s),style:c},t.createElement("span",{className:`${m}__title`},n),t.createElement("div",{className:`${m}__extra`},r),void 0!==i&&t.createElement(E,{type:"link",className:`${m}__collapse`,disabled:a,onClick:()=>{null==d||d(!i)}},p(i?"qm.divider.collect":"qm.divider.spread"),i?t.createElement(_e,null):t.createElement(De,null)))};ar.displayName="QmDivider";const or=()=>({height:0,opacity:0}),sr=e=>({height:e.scrollHeight,opacity:1}),cr=e=>({height:e?e.offsetHeight:0}),dr=(e,t)=>!0===(null==t?void 0:t.deadline)||"height"===t.propertyName;function ur(e){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(e)}function pr(e){var t=function(e,t){if("object"!==ur(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ur(t)?t:String(t)}function mr(e,t,n){return(t=pr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(n),!0).forEach((function(t){mr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,l,a,o=[],s=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=l.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yr(e){return e instanceof HTMLElement||e instanceof SVGElement}function br(e){var n,r=function(e){return e&&"object"===ur(e)&&yr(e.nativeElement)?e.nativeElement:yr(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=Ft.findDOMNode)||void 0===n?void 0:n.call(Ft,e):null)}var xr,Er={exports:{}},wr={};Er.exports=(xr||(xr=1,function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function f(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var f=e.type;switch(f){case r:case l:case i:case d:case u:return f;default:var g=f&&f.$$typeof;switch(g){case s:case o:case c:case m:case p:case a:return g;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference");var g=o,v=a,y=t,b=c,x=r,E=m,w=p,C=n,S=l,N=i,T=d,I=u,R=!1,O=!1;wr.ContextConsumer=g,wr.ContextProvider=v,wr.Element=y,wr.ForwardRef=b,wr.Fragment=x,wr.Lazy=E,wr.Memo=w,wr.Portal=C,wr.Profiler=S,wr.StrictMode=N,wr.Suspense=T,wr.SuspenseList=I,wr.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},wr.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},wr.isContextConsumer=function(e){return f(e)===o},wr.isContextProvider=function(e){return f(e)===a},wr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},wr.isForwardRef=function(e){return f(e)===c},wr.isFragment=function(e){return f(e)===r},wr.isLazy=function(e){return f(e)===m},wr.isMemo=function(e){return f(e)===p},wr.isPortal=function(e){return f(e)===n},wr.isProfiler=function(e){return f(e)===l},wr.isStrictMode=function(e){return f(e)===i},wr.isSuspense=function(e){return f(e)===d},wr.isSuspenseList=function(e){return f(e)===u},wr.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===l||t===i||t===d||t===u||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===a||t.$$typeof===o||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},wr.typeOf=f}()),wr);var Cr=function(e,t){"function"==typeof e?e(t):"object"===ur(e)&&e&&"current"in e&&(e.current=t)},Sr=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(Boolean);return r.length<=1?r[0]:function(e){t.forEach((function(t){Cr(t,e)}))}},Nr=function(e){var t,n,r=Er.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===Er.exports.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===Er.exports.ForwardRef)};function Tr(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}Number(r.split(".")[0]);var Ir=e.createContext({});function Rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pr(r.key),r)}}function kr(e,t,n){return t&&Or(e.prototype,t),n&&Or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}function Ar(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lr(e,t)}function Pr(e){return Pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pr(e)}function _r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pr(e);if(t){var i=Pr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ur(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _r(e)}(this,n)}}var Hr=function(t){Ar(r,e.Component);var n=Dr(r);function r(){return Rr(this,r),n.apply(this,arguments)}return kr(r,[{key:"render",value:function(){return this.props.children}}]),r}();function Fr(t){var n=e.useRef(!1),r=vr(e.useState(t),2),i=r[0],l=r[1];return e.useEffect((function(){return n.current=!1,function(){n.current=!0}}),[]),[i,function(e,t){t&&n.current||l(e)}]}var Mr="none",$r="appear",qr="enter",jr="leave",Kr="none",Vr="prepare",zr="start",Wr="active",Br="end",Ur="prepared";function Gr(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Xr,Qr,Zr,Jr=(Xr=Gr(),Qr="undefined"!=typeof window?window:{},Zr={animationend:Yr("Animation","AnimationEnd"),transitionend:Yr("Transition","TransitionEnd")},Xr&&("AnimationEvent"in Qr||delete Zr.animationend.animation,"TransitionEvent"in Qr||delete Zr.transitionend.transition),Zr),ei={};if(Gr()){var ti=document.createElement("div");ei=ti.style}var ni={};function ri(e){if(ni[e])return ni[e];var t=Jr[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var l=n[i];if(Object.prototype.hasOwnProperty.call(t,l)&&l in ei)return ni[e]=t[l],ni[e]}return""}var ii=ri("animationend"),li=ri("transitionend"),ai=!(!ii||!li),oi=ii||"animationend",si=li||"transitionend";function ci(e,t){return e?"object"===ur(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var di=function(t){var n=l(),r=l(t);r.current=t;var i=e.useCallback((function(e){r.current(e)}),[]);function a(e){e&&(e.removeEventListener(si,i),e.removeEventListener(oi,i))}return e.useEffect((function(){return function(){a(n.current)}}),[]),[function(e){n.current&&n.current!==e&&a(n.current),e&&e!==n.current&&(e.addEventListener(si,i),e.addEventListener(oi,i),n.current=e)},a]},ui=Gr()?a:o,pi=function(e){return+setTimeout(e,16)},mi=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(pi=function(e){return window.requestAnimationFrame(e)},mi=function(e){return window.cancelAnimationFrame(e)});var hi=0,fi=new Map;function gi(e){fi.delete(e)}var vi=function(e){var t=hi+=1;return function n(r){if(0===r)gi(t),e();else{var i=pi((function(){n(r-1)}));fi.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};vi.cancel=function(e){var t=fi.get(e);return gi(e),mi(t)},vi.ids=function(){return fi};var yi=[Vr,zr,Wr,Br],bi=[Vr,Ur],xi=!1,Ei=!0;function wi(e){return e===Wr||e===Br}var Ci=function(t,n,r){var i=vr(Fr(Kr),2),l=i[0],a=i[1],o=function(){var t=e.useRef(null);function n(){vi.cancel(t.current)}return e.useEffect((function(){return function(){n()}}),[]),[function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n();var l=vi((function(){i<=1?r({isCanceled:function(){return l!==t.current}}):e(r,i-1)}));t.current=l},n]}(),s=vr(o,2),c=s[0],d=s[1];var u=n?bi:yi;return ui((function(){if(l!==Kr&&l!==Br){var e=u.indexOf(l),t=u[e+1],n=r(l);n===xi?a(t,!0):t&&c((function(e){function r(){e.isCanceled()||a(t,!0)}!0===n?r():Promise.resolve(n).then(r)}))}}),[t,l]),e.useEffect((function(){return function(){d()}}),[]),[function(){a(Vr,!0)},l]};var Si=function(t){var n=t;"object"===ur(t)&&(n=t.transitionSupport);var r=e.forwardRef((function(t,r){var i=t.visible,a=void 0===i||i,s=t.removeOnLeave,c=void 0===s||s,d=t.forceRender,u=t.children,p=t.motionName,m=t.leavedClassName,h=t.eventProps,f=function(e,t){return!(!e.motionName||!n||!1===t)}(t,e.useContext(Ir).motion),g=l(),v=l();var y=function(t,n,r,i){var a=i.motionEnter,s=void 0===a||a,c=i.motionAppear,d=void 0===c||c,u=i.motionLeave,p=void 0===u||u,m=i.motionDeadline,h=i.motionLeaveImmediately,f=i.onAppearPrepare,g=i.onEnterPrepare,v=i.onLeavePrepare,y=i.onAppearStart,b=i.onEnterStart,x=i.onLeaveStart,E=i.onAppearActive,w=i.onEnterActive,C=i.onLeaveActive,S=i.onAppearEnd,N=i.onEnterEnd,T=i.onLeaveEnd,I=i.onVisibleChanged,R=vr(Fr(),2),O=R[0],k=R[1],L=vr(Fr(Mr),2),A=L[0],P=L[1],_=vr(Fr(null),2),D=_[0],H=_[1],F=l(!1),M=l(null);function $(){return r()}var q=l(!1);function j(){P(Mr,!0),H(null,!0)}function K(e){var t=$();if(!e||e.deadline||e.target===t){var n,r=q.current;A===$r&&r?n=null==S?void 0:S(t,e):A===qr&&r?n=null==N?void 0:N(t,e):A===jr&&r&&(n=null==T?void 0:T(t,e)),A!==Mr&&r&&!1!==n&&j()}}var V=vr(di(K),1)[0],z=function(e){var t,n,r;switch(e){case $r:return mr(t={},Vr,f),mr(t,zr,y),mr(t,Wr,E),t;case qr:return mr(n={},Vr,g),mr(n,zr,b),mr(n,Wr,w),n;case jr:return mr(r={},Vr,v),mr(r,zr,x),mr(r,Wr,C),r;default:return{}}},W=e.useMemo((function(){return z(A)}),[A]),B=vr(Ci(A,!t,(function(e){if(e===Vr){var t=W[Vr];return t?t($()):xi}var n;return G in W&&H((null===(n=W[G])||void 0===n?void 0:n.call(W,$(),null))||null),G===Wr&&(V($()),m>0&&(clearTimeout(M.current),M.current=setTimeout((function(){K({deadline:!0})}),m))),G===Ur&&j(),Ei})),2),U=B[0],G=B[1],Y=wi(G);q.current=Y,ui((function(){k(n);var e,r=F.current;F.current=!0,!r&&n&&d&&(e=$r),r&&n&&s&&(e=qr),(r&&!n&&p||!r&&h&&!n&&p)&&(e=jr);var i=z(e);e&&(t||i[Vr])?(P(e),U()):P(Mr)}),[n]),o((function(){(A===$r&&!d||A===qr&&!s||A===jr&&!p)&&P(Mr)}),[d,s,p]),o((function(){return function(){F.current=!1,clearTimeout(M.current)}}),[]);var X=e.useRef(!1);o((function(){O&&(X.current=!0),void 0!==O&&A===Mr&&((X.current||O)&&(null==I||I(O)),X.current=!0)}),[O,A]);var Q=D;return W[Vr]&&G===zr&&(Q=fr({transition:"none"},Q)),[A,G,Q,null!=O?O:n]}(f,a,(function(){try{return g.current instanceof HTMLElement?g.current:br(v.current)}catch(e){return null}}),t),b=vr(y,4),x=b[0],E=b[1],w=b[2],C=b[3],S=e.useRef(C);C&&(S.current=!0);var N,T=e.useCallback((function(e){g.current=e,Cr(r,e)}),[r]),I=fr(fr({},h),{},{visible:a});if(u)if(x===Mr)N=C?u(fr({},I),T):!c&&S.current&&m?u(fr(fr({},I),{},{className:m}),T):d||!c&&!m?u(fr(fr({},I),{},{style:{display:"none"}}),T):null;else{var R,O;E===Vr?O="prepare":wi(E)?O="active":E===zr&&(O="start");var k=ci(p,"".concat(x,"-").concat(O));N=u(fr(fr({},I),{},{className:Pe(ci(p,x),(R={},mr(R,k,k&&O),mr(R,p,"string"==typeof p),R)),style:w}),T)}else N=null;e.isValidElement(N)&&Nr(N)&&(N.ref||(N=e.cloneElement(N,{ref:T})));return e.createElement(Hr,{ref:v},N)}));return r.displayName="CSSMotion",r}(ai);function Ni(){return Ni=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},Ni.apply(this,arguments)}var Ti="add",Ii="keep",Ri="remove",Oi="removed";function ki(e){var t;return fr(fr({},t=e&&"object"===ur(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Li(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(ki)}var Ai=["component","children","onVisibleChanged","onAllRemoved"],Pi=["status"],_i=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Si,r=function(t){Ar(i,e.Component);var r=Dr(i);function i(){var e;Rr(this,i);for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];return mr(_r(e=r.call.apply(r,[this].concat(n))),"state",{keyEntities:[]}),mr(_r(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:fr(fr({},e),{},{status:Oi})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==Oi})).length})),e}return kr(i,[{key:"render",value:function(){var t=this,r=this.state.keyEntities,i=this.props,l=i.component,a=i.children,o=i.onVisibleChanged,s=i.onAllRemoved,c=Tr(i,Ai),d=l||e.Fragment,u={};return _i.forEach((function(e){u[e]=c[e],delete c[e]})),delete c.keys,e.createElement(d,c,r.map((function(r){var i=r.status,l=Tr(r,Pi),c=i===Ti||i===Ii;return e.createElement(n,Ni({},u,{key:l.key,visible:c,eventProps:l,onVisibleChanged:function(e){(null==o||o(e,{key:l.key}),e)||0===t.removeKey(l.key)&&s&&s()}}),a)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,i=Li(n),l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,l=Li(e),a=Li(t);l.forEach((function(e){for(var t=!1,l=r;l<i;l+=1){var o=a[l];if(o.key===e.key){r<l&&(n=n.concat(a.slice(r,l).map((function(e){return fr(fr({},e),{},{status:Ti})}))),r=l),n.push(fr(fr({},o),{},{status:Ii})),r+=1,t=!0;break}}t||n.push(fr(fr({},e),{},{status:Ri}))})),r<i&&(n=n.concat(a.slice(r).map((function(e){return fr(fr({},e),{},{status:Ti})}))));var o={};return n.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Ri}))).forEach((function(t){t.key===e&&(t.status=Ii)}))})),n}(r,i);return{keyEntities:l.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==Oi||e.status!==Ri}))}}}]),i}();mr(r,"defaultProps",{component:"div"})}(ai);const Di=t.forwardRef(((e,n)=>{const{forceRender:r,className:i,style:l,boxStyle:a,isActive:o}=e,[s,c]=t.useState(o||r);if(t.useEffect((()=>{(r||o)&&c(!0)}),[r,o]),!s)return null;const d=lr("collapse");return t.createElement("div",{ref:n,className:Pe(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},i),style:l},t.createElement("div",{className:`${d}-content-box`,style:a},e.children))}));Di.displayName="PanelContent";const Hi=e=>{const{defaultActive:n,label:r,extra:i,className:l,style:a,containerStyle:o,bordered:s,disabled:c,forceRender:d,destroyOnClose:u=!1,onChange:p}=e,[m,h]=t.useState(!!n),f=lr("collapse"),g=Pe({[`${f}`]:!0,[`${f}-active`]:m,[`${f}-disabled`]:c},l);return t.createElement("div",{className:g,style:a},t.createElement(ar,{label:r,extra:i,collapse:m,bordered:s,disabled:c,onCollapseChange:e=>{h(e),null==p||p(e)}}),t.createElement(Si,Rn({visible:m},((e=lr("motion-collapse"))=>({motionName:e,onAppearStart:or,onEnterStart:or,onAppearActive:sr,onEnterActive:sr,onLeaveStart:cr,onLeaveActive:or,onAppearEnd:dr,onEnterEnd:dr,onLeaveEnd:dr,motionDeadline:500}))(),{forceRender:d,removeOnLeave:u}),(({className:n,style:r},i)=>t.createElement(Di,{ref:i,prefixCls:f,className:n,style:r,boxStyle:o,isActive:m,forceRender:d},e.children))))};Hi.displayName="QmCollapse";const Fi=t.createContext(void 0);function Mi(t,n){((t,n)=>{const r=e.useRef(!0);e.useEffect((()=>t(r.current)),n),e.useEffect((()=>(r.current=!1,()=>{r.current=!0})),[])})((e=>{if(!e)return t()}),n)}const $i=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},qi=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},ji=e=>e.preventDefault(),Ki=(e,t)=>{if(qn||!e||!t)return null;"float"===(t=Un(t))&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=window.getComputedStyle(e);return r?r[t]:""}catch(n){return e.style[t]}},Vi=(e,t,n)=>{!qn&&e&&t&&(ae(t)?Object.keys(t).forEach((n=>{Vi(e,n,t[n])})):(t=Un(t),e.style[t]=n))},zi=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Wi=(e,t)=>Math.abs(zi(e)-zi(t)),Bi=e=>{let t=0,n=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}},Ui=(e,t)=>{var n;let r=e;for(;r;){if(null===(n=r.classList)||void 0===n?void 0:n.contains(t))return r;r=r.parentNode}return null},Gi=(e,t)=>{if(qn||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},Yi=e=>Math.pow(e,3),Xi=e=>e<.5?Yi(2*e)/2:1-Yi(2*(1-e))/2,Qi=e=>{const{minValues:n,onDragChange:r,onDragging:i}=e,{splitRef:l,direction:a}=t.useContext(Fi),{t:o}=Fn(),s=t.useRef(qn?null:document.onselectstart),c=t.useMemo((()=>"horizontal"===a),[a]),d=t.useMemo((()=>c?"X":"Y"),[c]),u=t.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),p=e=>{u.current=Object.assign({},u.current,e)},m=e=>{if(1!==e.buttons)return h();const t=e[`page${d}`]-u.current[`start${d}`],r=[n[0],u.current[`containerSize${d}`]-n[1]];let l=u.current[`firstElementSize${d}`]+t;l=Math.max(r[0],l),l=Math.min(r[1],l),i(l)},h=()=>{p({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),qi(document,"mousemove",m),qi(document,"mouseup",h),f()},f=()=>{document.onselectstart!==s.current&&(document.onselectstart=s.current)},g={[`${lr("split")}__resize-bar`]:!0,vertical:"vertical"===a,horizontal:"horizontal"===a};return t.createElement("div",{className:Pe(g),title:o("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=l.current,n=t.children[0];p({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),$i(document,"mousemove",m),$i(document,"mouseup",h),r(!0),s.current=document.onselectstart,document.onselectstart=()=>!1}})};Qi.displayName="ResizeBar";const Zi=t.forwardRef(((e,n)=>{const{offset:r,className:i,style:l}=e,{direction:a,dragging:o}=t.useContext(Fi),s="vertical"===a?"height":"width",c={[lr("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===a,vertical:"vertical"===a,[i]:!!i},d=void 0!==r?{[s]:Zn(r)}:{flex:1,[s]:0};return t.createElement("div",{ref:n,className:Pe(c),style:Object.assign(Object.assign({},d),l)},e.children)}));Zi.displayName="SplitPane";const Ji=e=>{const{direction:n="horizontal",defaultValue:r="50%",uniqueKey:i,className:l,style:a,onDragStart:o,onDrag:s=Vn,onDragEnd:c}=e,{global:d}=t.useContext(on),u=t.useRef(null),p=t.useRef(null),m=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,h=e=>Number.parseInt(e,10),f=e=>{var t;const n=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return n>=0?n:0},g=t.useMemo((()=>i?`split_${i}`:""),[i]),[v,y]=t.useState(!1),[b,x]=t.useState(m(r));Mi((()=>{v?null==o||o(h(b)):(null==c||c(h(b)),localStorage.setItem(g,b),C(g,b))}),[v]),t.useEffect((()=>{E()}),[]);const E=()=>{if(!g)return;const e=localStorage.getItem(g);e?x(m(e)):w(g).then((e=>{localStorage.setItem(g,m(e||r)),E()})).catch((()=>{}))},w=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),C=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),S=t.useMemo((()=>({splitRef:u,direction:n,dragging:v})),[n,v]),N=[];t.Children.map(e.children,(e=>{var t;jn(e)&&!Kn(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const[T,I]=N,R=t.useMemo((()=>[f(T),f(I)]),[T,I]),O={[lr("split")]:!0,vertical:"vertical"===n};return t.createElement(Fi.Provider,{value:S},t.createElement("div",{ref:u,className:Pe(O,l),style:a},t.createElement(Zi,Rn({},T.props,{ref:p,offset:b})),t.createElement(Qi,{minValues:R,onDragChange:e=>y(e),onDragging:e=>{x(`${e}px`),s(e)}}),t.createElement(Zi,I.props)))};Ji.displayName="QmSplit",Ji.Pane=Zi;const el=e=>{const{className:n,style:r}=e,{$size:i}=$n(e),l=lr("countup"),a={[l]:!0,[`${l}--lg`]:"large"===i,[`${l}--sm`]:"small"===i};return t.createElement($t,Rn({},e,{className:Pe(a,n),style:r}),e.children)};el.displayName="QmCountup";const tl=e=>{const{className:n}=e,{$size:r}=$n(e),i=lr("empty"),l=Object.assign(Object.assign({},e),{image:N.PRESENTED_IMAGE_SIMPLE}),a={[i]:!0,[`${i}--lg`]:"large"===r,[`${i}--sm`]:"small"===r};return t.createElement(N,Rn({},l,{className:Pe(a,n)}))};tl.displayName="QmEmpty";const nl=e=>{const n=pn({tip:"Loading..."},e),{fullHeight:r,className:i,style:l}=n,a=lr("spin"),o={[a]:!0,[`${a}-fullHeight`]:!!r},s=Object.assign(Object.assign({wrapperClassName:Pe(o,i)},Xn(n,["fullHeight"])),{style:Object.assign(Object.assign({},l),{maxHeight:"none"})});return t.createElement(T,s,n.children)};nl.displayName="QmSpin";const rl=t.createContext(void 0),il=new Map;const ll=new qt((function(e){e.forEach((e=>{var t;const{target:n}=e;null===(t=il.get(n))||void 0===t||t.forEach((e=>e(n)))}))}));function al(e,t){il.has(e)||(il.set(e,new Set),ll.observe(e)),il.get(e).add(t)}function ol(e,t){il.has(e)&&(il.get(e).delete(t),il.get(e).size||(ll.unobserve(e),il.delete(e)))}function sl(t){const[n,r]=e.useState({width:0,height:0});return e.useLayoutEffect((()=>{const e=t.current,n=e=>{r({width:e.offsetWidth,height:e.offsetHeight})};return e&&al(e,n),()=>{e&&ol(e,n)}}),[t]),n}function cl(t,n){const r=e.useRef(null);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{r.current&&clearTimeout(r.current),r.current=setTimeout((()=>t.apply(this,e)),n)}),[t,n])}const dl=(e,...n)=>t.isValidElement(e)?t.cloneElement(e,...n):null,ul=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],pl=e=>({_s:e,status:ul[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),ml=e=>e?6:5,hl=(e,t,n,r,i)=>{clearTimeout(r.current);const l=pl(e);t(l),n.current=l,null==i||i({current:l})},fl=(e={})=>{const{enter:t=!0,exit:n=!0,preEnter:r,preExit:i,timeout:a,initialEntered:d,mountOnEnter:u,unmountOnExit:p,onStateChange:m}=e||{},[h,f]=s((()=>pl(d?2:ml(u)))),g=l(h),v=l(),[y,b]=(e=>ae(e)?[e.enter,e.exit]:[e,e])(a),x=c((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return ml(t)}})(g.current._s,p);e&&hl(e,f,g,v,m)}),[m,p]),E=c((e=>{const l=e=>{switch(hl(e,f,g,v,m),e){case 1:y>=0&&(v.current=setTimeout(x,y));break;case 4:b>=0&&(v.current=setTimeout(x,b));break;case 0:case 3:v.current=setTimeout((()=>l(e+1)),0)}},a=g.current.isEnter;"boolean"!=typeof e&&(e=!a),e?!a&&l(t?r?0:1:2):a&&l(n?i?3:4:ml(p))}),[x,m,t,n,r,i,y,b,p]);return o((()=>()=>clearTimeout(v.current)),[]),[h,E,x]},gl=e=>{const{name:n,in:r,timeout:i,preEnter:l=!0,preExit:a}=e,[o,s]=fl({timeout:i,preEnter:l,preExit:a,initialEntered:r});return hn((()=>{s()}),[r]),t.createElement(t.Fragment,null,t.Children.map(e.children,(e=>t.isValidElement(e)?dl(e,{className:Pe(e.props.className,n,o.status)}):e)))},vl=6,yl={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",reverse:"width",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",reverse:"height",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},bl=e=>{const{thumb:n,always:r,className:i,barSize:l=vl,direction:a="vertical",onDrag:o=Vn}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=t.useContext(rl),u=yl[a],p=t.useRef(n),m=t.useRef(null),h=t.useRef(null),f=t.useRef({}),g=t.useRef(!1),v=t.useRef(!1),y=t.useRef(qn?null:document.onselectstart),[b,x]=t.useState(!1);t.useLayoutEffect((()=>{p.current=n}),[n]),t.useEffect((()=>{const e=c.current;return $i(e,"mousemove",S),$i(e,"mouseleave",N),()=>{C(),qi(document,"mouseup",w),qi(e,"mousemove",S),qi(e,"mouseleave",N)}}),[]);const E=e=>{if(!m.current||!h.current)return;if(!g.current)return;const t=f.current[u.axis];if(!t)return;const n=100*(-1*(m.current.getBoundingClientRect()[u.direction]-e[u.client])-(h.current[u.offset]-t))/m.current[u.offset];d.current[u.scroll]=n*d.current[u.scrollSize]/100,o(!0)},w=()=>{g.current=!1,f.current={[u.axis]:0},qi(document,"mousemove",E),qi(document,"mouseup",w),C(),v.current&&x(!1),o(!1)},C=()=>{document.onselectstart!==y.current&&(document.onselectstart=y.current)},S=()=>{v.current=!1,x(!!p.current.size)},N=()=>{v.current=!0,x(g.current)},T=lr("scrollbar"),I={[`${T}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},R={[u.reverse]:l},O={[u.size]:n.size,transform:`translate${u.axis}(${n.offset}%)`};return t.createElement(gl,{name:"fade",in:r||s||b,timeout:300},t.createElement("div",{ref:m,className:Pe(I,i),style:R},t.createElement("div",{ref:h,className:`${T}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),$i(document,"mousemove",E),$i(document,"mouseup",w),g.current=!0,y.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(f.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},xl=20,El=t.forwardRef(((e,n)=>{const{wrapClassName:r,wrapStyle:i,innerStyle:l,barWidth:a,always:o,native:s,showTopScrollbar:c,minSize:d=xl,onScroll:u}=e,p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[f,g]=t.useState({size:0,offset:0,ratio:1}),[v,y]=t.useState({size:0,offset:0,ratio:1}),[b,x]=t.useState(!1),E=sl(p),w=sl(h);hn((()=>{!s&&C()}),[w.width,w.height,E.width,E.height]);const C=cl((()=>{if(!m.current)return;const e=m.current.offsetHeight-4,t=m.current.offsetWidth-4,n=Math.pow(e,2)/m.current.scrollHeight,r=Math.pow(t,2)/m.current.scrollWidth,i=Math.max(n,d),l=Math.max(r,d),a=n/(e-n)/(i/(e-i)),o=r/(t-r)/(l/(t-l)),s=i+4<e?i:0,c=l+4<t?l:0,u=100*m.current.scrollTop/e*a,p=100*m.current.scrollLeft/t*o;g(Object.assign({},f,{size:c,ratio:o,offset:p})),y(Object.assign({},v,{size:s,ratio:a,offset:u}))}),5),S=e=>{x(e)},N=(e,t)=>{oe(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollTop,i=window.requestAnimationFrame,l=()=>{const a=(Date.now()-n)/500;a<1?(e.scrollTop=r+(t-r)*Xi(a),i(l)):e.scrollTop=t};i(l)})(m.current,e):m.current.scrollTop=e:tr("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},T=(e,t)=>{oe(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollLeft,i=window.requestAnimationFrame,l=()=>{const a=(Date.now()-n)/500;a<1?(e.scrollLeft=r+(t-r)*Xi(a),i(l)):e.scrollLeft=t};i(l)})(m.current,e):m.current.scrollLeft=e:tr("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};t.useImperativeHandle(n,(()=>{var e,t;return{container:p.current,scrollTop:(null===(e=m.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=m.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:N,SET_SCROLL_LEFT:T}}));const I=t.useMemo((()=>({dragging:b,scrollbarElement:p,wrapElement:m})),[b]),R=lr("scrollbar"),O={[`${R}__wrap`]:!0,[`${R}__wrap--hidden`]:!s};return t.createElement("div",{ref:p,className:Pe(R,e.className),style:e.style},t.createElement("div",{ref:m,className:Pe(O,r),style:i,onScroll:e=>{const{scrollTop:t,scrollLeft:n}=e.target;!s&&(()=>{if(!m.current)return;const e=m.current.offsetHeight-4,t=m.current.offsetWidth-4,n=100*m.current.scrollTop/e*v.ratio,r=100*m.current.scrollLeft/t*f.ratio;g(Object.assign({},f,{offset:r})),y(Object.assign({},v,{offset:n}))})(),null==u||u({scrollTop:t,scrollLeft:n})}},t.createElement("div",{ref:h,className:`${R}__view`,style:l},e.children)),!s&&t.createElement(rl.Provider,{value:I},c&&t.createElement(bl,{className:"top",direction:"horizontal",thumb:f,barSize:a,always:o,onDrag:S}),t.createElement(bl,{direction:"horizontal",thumb:f,barSize:a,always:o,onDrag:S}),t.createElement(bl,{direction:"vertical",thumb:v,barSize:a,always:o,onDrag:S})))}));El.displayName="QmScrollbar";const wl=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const n=window.URL.createObjectURL(e);let r=document.createElement("a");r.href=n,r.download=decodeURI(t),r.click(),r=null}},Cl=(e,{fileName:t,headers:n,params:r})=>Hn(void 0,void 0,void 0,(function*(){const i=r?new URLSearchParams(r).toString():"",l=i?e.includes("?")?"&":"?":"",a=yield fetch(e+`${l+i}`,{method:"GET",headers:n});if(!a.ok)throw new Error(un("qm.download.error"));const o=yield a.blob(),s=a.headers.get("content-disposition"),c=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));wl(o,c)})),Sl=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},Nl=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},Tl=e=>{var n,r;const i=pn({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:l=[],fileDirection:a="vertical",batchDownload:o,draggable:s,editable:c,disabled:d,readOnly:u,button:p={},className:m,onPreview:h,onSortChange:f,onEditChange:g,onDownload:v,onChange:y}=i,{t:b}=Fn(),{$size:x}=$n(i),w=t.useRef(null),C=t.useRef(null),[S,N]=t.useState({}),T=t.useMemo((()=>d||u),[d,u]);t.useEffect((()=>(A(),()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.destroy()})),[]);const k=(e,t)=>{N((n=>Object.assign({},n,{[e]:null!=t?t:!n[e]})))},L=Mn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...l],[r]=e.splice(t,1);e.splice(n,0,r),null==f||f(e),null==y||y({file:l[t],fileList:e})}})),A=()=>{s&&(C.current=jt.create(Ui(w.current,lr("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:L}))},P=e=>Hn(void 0,void 0,void 0,(function*(){if(v)return void(yield v(e));const{downloadWithHeaders:t,headers:n}=i;try{e.url&&(yield Cl(e.url,Object.assign({fileName:e.name},t?{headers:n}:null)))}catch(e){R.error(b("qm.download.error"))}})),_=lr("upload-file"),D={[_]:!0,[`${_}--lg`]:"large"===x,[`${_}--sm`]:"small"===x,[`${_}--horizontal`]:"horizontal"===a};return t.createElement(I,Rn({className:Pe(D,m)},Xn(i,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((n,r)=>Hn(void 0,void 0,void 0,(function*(){const{fileTypes:l=[],fileSize:a,maxCount:o,fileList:s=[],beforeUpload:c}=i,d=!l.length||l.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!a||e.size/1024/1024<a,p=!(o>1)||s.length<o,m=d&&u&&p;if(d||R.warning(b("qm.upload.tooltip",{type:l.join(",")})),u||R.warning(b("qm.upload.sizeLimit",{size:a})),p||R.warning(b("qm.upload.countLimit",{count:o})),!m)return I.LIST_IGNORE;if(c){const i=c(e,t);if(!0===i)return n(e);if(!1===i)return r("not upload");if(i&&"function"==typeof i.then)try{const e=yield i;n(e)}catch(e){r(e)}}else n(e)})))),disabled:T,onChange:y,onPreview:e=>Hn(void 0,void 0,void 0,(function*(){if("function"==typeof h)return h(e,(t=>P(t||e)));d||(yield P(e))})),onDownload:e=>Hn(void 0,void 0,void 0,(function*(){yield P(e)})),itemRender:(e,n,r,a)=>((e,n)=>{const{iconRender:r}=i,{uid:a,name:o,url:u,status:p="done"}=e,m="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return t.createElement("div",{className:Pe("ant-upload-list-item",`ant-upload-list-item-${p}`,"ant-upload-list-item-list-type-text",{handle:s})},t.createElement("div",{className:"ant-upload-list-item-info"},t.createElement("span",{className:"ant-upload-span"},t.createElement("div",{className:"ant-upload-text-icon"},r?r(e):t.createElement(Fe,null)),t.createElement("div",{className:"ant-upload-list-item-name"},S[a]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:Sl(o),onBlur:t=>{const{value:n}=t.target;if(n!==Sl(o)){const t=Object.assign({},e,{name:`${n}.${Nl(o)}`}),r=l.map((e=>e.uid!==a?e:t));null==g||g(t,r),null==y||y({file:t,fileList:r})}k(a,!1)}}):t.createElement("a",{rel:"noreferrer",target:"_blank",title:o,href:u,onClick:e=>{e.preventDefault(),c?T||k(a,!0):n.preview()}},o)),t.createElement("span",{className:"ant-upload-list-item-card-actions"},c&&!T&&t.createElement("button",{type:"button",className:m,onClick:()=>k(a)},S[a]?t.createElement($e,null):t.createElement(Me,null)),c&&t.createElement("button",{type:"button",className:Pe(m,"preview"),onClick:()=>n.preview()},t.createElement(qe,null)),t.createElement("button",{type:"button",className:Pe(m,"download"),disabled:d,onClick:()=>n.download()},t.createElement(je,null)),t.createElement("button",{type:"button",className:Pe(m,"delete"),disabled:T,onClick:()=>n.remove()},t.createElement(Ke,null))))))})(n,a)}),t.createElement("span",{className:"inner",ref:w},i.children||u&&l.length?i.children:t.createElement(E,{type:null!==(n=p.type)&&void 0!==n?n:"default",icon:null!==(r=p.icon)&&void 0!==r?r:t.createElement(He,null),disabled:T},p.text||b("qm.upload.text")),o&&!!l.length&&t.createElement(E,{disabled:d,style:{marginLeft:8},onClick:e=>Hn(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof o)yield o(l);else for(const e of l)yield P(e)}))},b("qm.upload.batchDownload"))))};Tl.displayName="QmUploadFile";const Il=e=>{const n=pn({icon:t.createElement(je,null),withCredentials:!1},e),{$size:r}=$n(n),{t:i}=Fn(),[l,a]=t.useState(!1),o=Xn(n,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t.createElement(E,Rn({},o,{size:r,loading:l,onClick:()=>Hn(void 0,void 0,void 0,(function*(){var e;a(!0);try{const{action:e,fileName:t,headers:r,params:l,beforeDownload:a=zn,onSuccess:o}=n,s=ce(e)?e:yield Hn(void 0,void 0,void 0,(function*(){const e=n.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!s)return tr("Download","参数 `action` 有误!");if(!a(s))return;yield Cl(s,{fileName:t,headers:r,params:l}),yield Wn(100),null==o||o(),R.success(i("qm.download.success"))}catch(t){null===(e=n.onError)||void 0===e||e.call(n,t),R.error(i("qm.download.error"))}a(!1)}))}),n.children||i("qm.download.text"))};function Rl(t,n){const r=e.useRef(null),i=e.useRef(0);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{const r=Date.now();(!i.current||r-i.current>n)&&(t.apply(this,e),i.current=r)}),[t,n])}Il.displayName="QmDownload";const Ol=e=>{const{activeKey:n,labels:r,onTabClick:i}=e;return t.createElement(t.Fragment,null,r.map(((e,r)=>{const l={item:!0,actived:r===n};return t.createElement("div",{key:r,className:Pe(l),onClick:e=>i(r,e)},t.createElement("span",null,e))})))},kl=e=>{const{label:n,showDivider:r,className:i,style:l}=e,a={[lr("anchor-item")]:!0};return t.createElement("div",{className:Pe(a,i),style:l},r&&t.createElement(ar,{label:n,style:{marginBottom:10}}),e.children)};kl.displayName="AnchorItem";const Ll=t.forwardRef(((e,n)=>{const{labelList:r=[],defaultActiveIndex:i,labelWidth:l,tabPosition:a="left",onTabClick:o,className:s,style:c}=e,{$size:d}=$n(e),u=t.useRef(null),p=t.useRef(),m=t.useRef("ready"),h=t.useRef(0),[f,g]=t.useState(i||0),v=t.useMemo((()=>!!(null==r?void 0:r.length)),[r]);t.useEffect((()=>{y();const e=Kt(u.current,"scroll",E);return()=>{e.remove()}}),[]);const y=()=>{f>0&&(u.current.scrollTop=Wi(x(f),u.current))},b=e=>{const t=Math.abs(e),n=(v?r.map((e=>document.getElementById(e.id))):Array.from((null===(i=u.current)||void 0===i?void 0:i.children)||[])).map((e=>Wi(e,u.current)));var i;let l=-1;for(let e=0;e<n.length;e++){const r=n[e],i=n[e+1]||1e4;t>=r-1&&t<i&&(l=e)}return l},x=e=>v?document.getElementById(r[e].id):u.current.children[e],E=Rl((e=>{if("ready"!==m.current)return;const t=b(e.target.scrollTop);-1!==t&&g(t)}),60),w=e=>{const t=x(e);t&&(g(e),m.current="stop",p.current&&clearTimeout(p.current),Vt(t,{block:"start",behavior:"smooth",boundary:u.current}),p.current=setTimeout((()=>m.current="ready"),500))};t.useImperativeHandle(n,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>h.current?h.current:e,w(e)}})));const C=lr("anchor"),S={[C]:!0,[`${C}-left`]:"left"===a,[`${C}-top`]:"top"===a,[`${C}--lg`]:"large"===d,[`${C}--sm`]:"small"===d},N=[];t.Children.map(e.children,(e=>{var t;jn(e)&&!Kn(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const T=v?r.map((e=>e.label)):N.map((e=>e.props.label)),I=v?r.map((e=>e.id)):N.map(((e,t)=>e.props["data-id"]||t.toString()));return h.current=T.length,t.createElement("div",{className:Pe(S,s),style:c},t.createElement("div",{className:Pe("anchor-nav"),style:{width:l?Zn(l):""}},t.createElement(Ol,{activeKey:f,labels:T,onTabClick:(e,t)=>{w(e),null==o||o({label:T[e],id:I[e]},t)}})),t.createElement("div",{ref:u,className:Pe("anchor-container")},v?e.children:N))}));Ll.displayName="QmAnchor",Ll.Item=kl;const Al=e=>t.createElement(k.TabPane,e,e.children);Al.displayName="TabPane";const Pl=e=>{const n=pn({tabPosition:"top"},e),{items:r,tabPosition:i,tabBarGutter:l,className:a,authConfig:o}=n,{$size:s}=$n(n),c=lr("tabs"),d={[c]:!0,[`${c}--lg`]:"large"===s,[`${c}--sm`]:"small"===s},u=Object.assign(Object.assign({},Xn(n,["items","authConfig"])),{size:s,tabBarGutter:null!=l?l:["top","bottom"].includes(i)?30:0}),p=[];t.Children.map(n.children,(e=>{var t;jn(e)&&!Kn(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&p.push(e)}));const m=r?[...r]:p.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(o){const{fieldList:e=[]}=o||{};for(let t=0;t<m.length;t++){const n=m[t],r=e.find((e=>e.dataIndex===n.key)),{visible:i=1,disabled:l}=r||{};i?l&&(n.disabled=!0):(m.splice(t,1),t--)}}return t.createElement(k,Rn({},u,{items:m,className:Pe(d,a)}))};Pl.displayName="QmTabs",Pl.TabPane=Al;const _l=t.forwardRef(((e,n)=>{var r;const i=pn({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:l,open:a,className:o,loading:s,showHeader:c,showFullScreen:d,maskClosable:u,destroyOnClose:p,onClose:m,onClosed:h,onFullChange:f}=i,{global:g}=t.useContext(on),{$size:v}=$n(i),y=t.useRef(null),b=t.useRef(null),x=t.useRef(!1),[E,w]=t.useState(!1),[C,S]=t.useState(!1),[N,T]=t.useState(!1);Mi((()=>{(null!=a?a:l)&&(!p&&x.current||de(s)&&S(!0))}),[null!=a?a:l]),Mi((()=>{b.current&&Vi(b.current,E?{width:"100%"}:{width:Zn(i.width||"72%")})}),[E]);const I=()=>{b.current=Ui(y.current,"ant-drawer-content-wrapper"),w(!E),null==f||f(!E)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>T(!0),STOP_LOADING:()=>T(!1)})));const R=lr("drawer"),O={[R]:!0,"no-header":!c,[`${R}--lg`]:"large"===v,[`${R}--sm`]:"small"===v};return t.createElement(L,Rn({},Xn(i,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=a?a:l,maskClosable:null!==(r=null!=u?u:null==g?void 0:g.maskClosable)&&void 0!==r&&r,className:Pe(O,o),title:t.createElement(t.Fragment,null,t.createElement("span",{ref:y,className:"text"},c&&i.title),d&&t.createElement("button",{type:"button",className:"full-screen",onClick:I},t.createElement(E?Ve:ze))),footer:null,afterOpenChange:e=>{e?(x.current=!0,de(s)&&setTimeout((()=>S(!1)),100)):(w(!1),null==h||h())},onClose:m}),i.children,(s||N||C)&&t.createElement(nl,{spinning:!0,className:Pe("spinning")}))}));_l.displayName="QmDrawer";const Dl="10vh";var Hl;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Hl||(Hl={}));const Fl=t.forwardRef(((e,n)=>{var r;const i=pn({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Dl}},e),{visible:l,open:a,width:o,height:s,className:c,loading:d,draggable:u,showHeader:p,showFullScreen:m,maskClosable:h,destroyOnClose:f,bodyStyle:g,onFullChange:v,onClose:y,onClosed:b}=i,{global:x}=t.useContext(on),{$size:E}=$n(i),w=t.createRef(),C=t.useRef(!1),S=t.useMemo((()=>`calc(100vh - ${Dl} - ${Dl} - ${Hl[p?E:"none"]}px)`),[E,p]),[N,T]=t.useState(!1),[I,R]=t.useState(!1),[O,k]=t.useState(!1),[L,P]=t.useState(!0),[_,D]=t.useState({left:0,top:0,bottom:0,right:0}),[H,F]=t.useState();Mi((()=>{if(null!=a?a:l){if(!f&&C.current||de(d)&&R(!0),!f&&C.current)return;setTimeout((()=>{C.current=!0,de(d)&&R(!1)}),400)}}),[null!=a?a:l]),Mi((()=>{F(N?{x:0,y:0}:void 0)}),[N]);const M=e=>{const t=Ui(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body");N?(Vi(t,{width:Zn(o||"60%"),height:"auto",top:Dl}),Vi(n,{height:s?Zn(s):S,maxHeight:"auto"===s?S:""})):(Vi(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Vi(n,{height:`calc(100vh - ${Hl[p?E:"none"]}px)`,maxHeight:""})),T(!N),null==v||v(!N)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>k(!0),STOP_LOADING:()=>k(!1)})));const $=lr("modal"),q={height:s?Zn(s):S,maxHeight:"auto"===s?S:"",overflow:"auto"},j={[$]:!0,"no-header":!p,[`${$}--lg`]:"large"===E,[`${$}--sm`]:"small"===E};return t.createElement(A,Rn({},Xn(i,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=a?a:l,maskClosable:null!==(r=null!=h?h:null==x?void 0:x.maskClosable)&&void 0!==r&&r,className:Pe(j,c),title:t.createElement("div",{onMouseOver:()=>{L&&P(!1)},onMouseOut:()=>{P(!0)}},t.createElement("span",{className:"text"},p&&i.title),m&&t.createElement("button",{type:"button",className:"full-screen",onClick:M},t.createElement(N?Ve:ze))),footer:null,bodyStyle:Object.assign({},q,g),onCancel:y,afterClose:()=>{null==b||b(),T(!1)},modalRender:e=>t.createElement(zt,{nodeRef:w,bounds:_,position:H,disabled:!u||L||N,onStart:(e,t)=>((e,t)=>{const{clientWidth:n,clientHeight:r}=window.document.documentElement,i=w.current.getBoundingClientRect();i&&D({left:-i.left+t.x,right:n-(i.right-t.x)-1,top:-i.top+t.y,bottom:r-(i.bottom-t.y)-1})})(0,t)},t.createElement("div",{ref:w},e))}),i.children,(d||O||I)&&t.createElement(nl,{spinning:!0,className:Pe("spinning")}))}));Fl.displayName="QmModal";const Ml=n(void 0),$l=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ql={operations:function(e){const t=e.split(" "),n=[];let r=0;n[r]=[];for(let e=0;e<t.length;e++)$l.includes(t[e])?(n[r]=n[r].join(" "),r++,n[r]=[]):n[r].push(t[e]);return n[r]=n[r].join(" "),n},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e,t=" "){return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let n=0,r=(e=Array.isArray(e)?e:[e]).length;n<r;n++)t+="number"==typeof e[n]?e[n]:"'"+e[n]+"'",n<r-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,n){return e.split(t).join(n)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),e=this.find_replace(e," NIN "," nin ")}};const jl=["==","<",">","<=",">=","!=","like","likes","in","nin"];var Kl=function(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const n=e.charAt(r);"("===n&&t++,")"===n&&t--}return 0===t},Vl=function(e,t){let n="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?n+=" "+e[t]+" ":n+=e[t];const r=n.split(" ").filter((e=>""!==e));for(let e=0;e<r.length;e++)jl.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),jl.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return e=r.join(" ")};const zl=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,Wl=["string","number","boolean","symbol"],Bl=e=>Wl.includes(typeof e),Ul=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Gl=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(zl,"\\$1"),"i");window.__query__=(...e)=>((e,t,n)=>{e=null!=e?e:"";let r=!0;switch(t){case"like":r=null!==e.toString().match(Gl(n));break;case"likes":r=n.split(/,|,/).some((t=>null!==e.toString().match(Gl(t))));break;case"in":Bl(n)&&(n=[n]),Array.isArray(n)&&(r=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":Bl(n)&&(n=[n]),Array.isArray(n)&&(r=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":r=(Ul(e)?e.slice(0,10):e)!=n;break;case"<":r=(Ul(e)?e.slice(0,10):e)<n;break;case"<=":r=(Ul(e)?e.slice(0,10):e)<=n;break;case">":r=(Ul(e)?e.slice(0,10):e)>n;break;case">=":r=(Ul(e)?e.slice(0,10):e)>=n;break;default:r=(Ul(e)?e.slice(0,10):e)==n}return r})(e[0],e[1],e[2]);const Yl=ql.stringify,Xl=ql.array_format,Ql=Kl,Zl=(e,t,n)=>{let r=[];t=ql.replace_symbols(t);try{if(n){const n=new Function("record",`return ${Vl(t,"record")};`);r=Pa(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${Vl(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)n(e,t)&&r.push(e[t])}}catch(t){tr("Table","组件 `initialFilter` 参数有误!"),r=e}return r},Jl=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Jl(e.children)):t.push(e)})),t},ea=e=>e.filter((e=>(e.children&&(e.children=ea(e.children)),!e.hidden&&!e.noAuth))),ta=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...ta(e.children))})),t},na=(e,t)=>e.map((e=>(e.children&&(e.children=na(e.children,t)),null==t||t(e),e))),ra=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=ra(n.children,t);if(e)return e}}return null},ia=e=>{const t=e.children;return t?t[0].children?ia(t[0]):t[0]:e},la=e=>{const t=e.children;return t?t[t.length-1].children?la(t[t.length-1]):t[t.length-1]:e},aa=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),oa=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=oa(n.children,t);if(e)return e}}return null},sa=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...sa(e.children))})),t},ca=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...ca(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(t(e))})),n},da=e=>{let t=1;const n=(e,r)=>{var i;if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{e.fixed?r.fixed=e.fixed:delete r.fixed,n(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=null!==(i=e.colSpan)&&void 0!==i?i:1};e.forEach((e=>{e.level=1,n(e,null)}));const r=[];for(let e=0;e<t;e++)r.push([]);return ta(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},ua=e=>Object.assign(e,{__prevent__:!0}),pa=e=>{delete e.__prevent__},ma=(e,t,n={left:0,top:0})=>{if(e){const r=e.parentNode;if(n.top+=e.offsetTop,n.left+=e.offsetLeft,r&&r!==document.documentElement&&r!==document.body&&(n.top-=r.scrollTop,n.left-=r.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return ma(e.offsetParent,t,n)}return n},ha=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,fa=(e,t)=>pe(e,((e,n,r)=>{me(n,t[r])||(e[r]=ae(n)&&ae(t[r])?fa(n,t[r]):n)})),ga=(e,t)=>{var n;return null!==(n=ue(e,t))&&void 0!==n?n:""},va=(e,t,n,r)=>{r>=0&&null!=n&&(n=Number(n).toFixed(r)),he(e,t,null!=n?n:"")},ya=(e,t)=>{if(!t.includes("|"))return ga(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(ga(e,t))})),n.every((e=>!e))?"":n.join(" | ")},ba=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),xa=e=>{const t=(e=e.toString()).split("."),n="-"===t[0].charAt(0)?"-":"";let r=n?t[0].slice(1):t[0],i="";for(;r.length>3;)i=`,${r.slice(-3)}${i}`,r=r.slice(0,r.length-3);return r&&(i=r+i),`${n}${i}${t[1]?`.${t[1]}`:""}`},Ea=(e,t)=>{const n=e.toString();if(!ba(n)||0===t)return e;const r=Number.parseFloat(n).toString(),i=r.indexOf(".");if(-1===i)return r+"."+"0".repeat(t);const l=Math.max(0,t-(r.length-i-1));return r+"0".repeat(l)},wa=(e,t)=>e?m(e,t):null,Ca=(e,t)=>e?m(e).format(t):"",Sa=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Na=e=>{const n=[];if(t.isValidElement(e)){const{children:r}=e.props;t.Children.forEach(r,(e=>{n.push(...Na(e))}))}else n.push(e);return n},Ta=e=>Na(e).join(""),Ia=e=>e.filter((e=>!e._group)),Ra=(e,t=!1)=>{let n="";if(Array.isArray(e)){let r=0;for(let i=0,l=e.length;i<l;i++){const l=e[i];if(!l.fieldName)continue;const a=Array.isArray(l.condition)?Xl(l.condition):Yl(l.condition,"^");n+=`${l.bracketLeft} ${t?`${l.fieldName}|${l.fieldType}`:l.fieldName} ${l.expression} ${a} ${l.bracketRight} ${l.logic} `,r=l.logic.length}n=n.slice(0,-1*r-2)}else{const r=5;for(const r in e){const[i,l]=r.includes("|")?r.split("|"):[r,""],a=e[r];for(const e in a){n+=`${t?`${i}|${l}`:i} ${e} ${Array.isArray(a[e])?Xl(a[e]):Yl(a[e],"^")} and `}}n=n.slice(0,-1*r)}return n.replace(/\s+/g," ").trim()},Oa=(e=[],t=[])=>{const n={};return e.forEach((e=>{const r=JSON.stringify((e=>{const n=[];return t.forEach((t=>n.push(ga(e,t)))),n})(e));n[r]=n[r]||[],n[r].push(e)})),Object.keys(n).map((e=>n[e]))},ka=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].dataIndex===t)return[e[n]];if(Array.isArray(e[n].children)){const r=ka(e[n].children,t);if(r)return[e[n],r].flat()}}},La=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].rowKey===t)return[t];if(Array.isArray(e[n].children)){const r=La(e[n].children,t);if(r)return[e[n].rowKey,r].flat()}}},Aa=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=Aa(n.children,t);if(e)return e}if(t(n))return n}return null},Pa=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Pa(e.children,t),t(e)||e.children&&e.children.length))),_a=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Da=(e,t,n=!1)=>{const r=new Set;return function e(t,i,l=1){if(r.has(t))return!1;if(t===i)return!0;if(n&&l>1)return!1;r.add(t);const a=l+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],i[n],a))return!1;return!0}if(t&&i&&"object"==typeof t&&"object"==typeof i){const n=Object.keys(t);return n.length===Object.keys(i).length&&n.every((n=>e(t[n],i[n],a)))}return!1}(e,t)},Ha=e=>["","small","middle","large"].includes(e),Fa=80,Ma="1",$a="0",qa=400,ja=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],Ka={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var Va,za,Wa;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(Va||(Va={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(za||(za={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(Wa||(Wa={}));const Ba={items:Ut.arrayOf(Ut.shape({type:Ut.string.isRequired,fieldName:Ut.string.isRequired})),initialValues:Ut.object,initialExtras:Ut.object,layout:Ut.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!Ha(e[t]||""))return er("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:Ut.number,className:Ut.string,style:Ut.object,compactMode:Ut.bool,labelWidth:Ut.oneOfType([Ut.number,Ut.string]),labelAlign:Ut.oneOf(["left","right"]),labelWrap:Ut.bool,formType:Ut.oneOf(["default","search","onlyShow"]),disabled:Ut.bool,uniqueKey:Ut.string,defaultRows:Ut.number,defaultExpand:Ut.bool,searchButtonCols:Ut.number,scrollToFirstError:Ut.bool,authConfig:Ut.object,isAutoFocus:Ut.bool,isCollapse:Ut.bool,isFieldsDefine:Ut.bool,isSearchBtn:Ut.bool,isSubmitBtn:Ut.bool,fieldsChange:Ut.func,onValuesChange:Ut.func,onFieldsChange:Ut.func,onFinish:Ut.func,onFinishFailed:Ut.func,onReset:Ut.func,onCollapse:Ut.func},Ua={layout:"horizontal",labelWidth:Fa,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Vn,onFieldsChange:Vn,onFinish:Vn,onFinishFailed:Vn,onReset:Vn,onCollapse:Vn},Ga=(e,t)=>{if(!e)return null;if(t===za.week){const t=e.match(/^(\d{4})-(\d+)/);return t?m().year(Number(t[1])).week(Number(t[2])):null}if(t===za.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?m().year(Number(t[1])).quarter(Number(t[2])):null}return m(e,t)},Ya=(e,t)=>e?m(e).format(t):"",Xa=e=>""===e||null==e,Qa=(e,t)=>{var n;if(!e)return"";if(!t.includes("|"))return e[t];const r=t.split("|");let i="";for(let t=0,l=r.length;t<l;t++){i+=(null!==(n=e[r[t].trim()])&&void 0!==n?n:"")+(t===l-1?"":" | ")}return i},Za=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),l=n[r].split("|");i.forEach(((t,n)=>e[t]=e[l[n]]))}else e[t[r]]=e[n[r]]},Ja=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),l=n[r].split("|");i.forEach(((t,n)=>e[t]=e[l[n]]))}else e[t[r]]=e[n[r]]},eo=(e,t,n)=>e.map((e=>{const r={value:e[t],text:e[n]};return e.disabled&&(r.disabled=!0),de(e.isLeaf)||(r.isLeaf=!!e.isLeaf),de(e.selectable)||(r.selectable=!!e.selectable),Array.isArray(e.children)&&(r.children=eo(e.children,t,n)),r})),to=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=to(n.children,t);if(e)return e}}return null},no=(e,t,n=0)=>{const r=[];return e.forEach((e=>{e.value==t.split(",")[n]&&r.push(e),Array.isArray(e.children)&&r.push(...no(e.children,t,n+1))})),r},ro=e=>jn(e)||"string"==typeof e,io=e=>jn(e)?Na(e).join(""):null!=e?e:"",lo=(e,t,n,r)=>{var i;const l={};return l.filters=(null===(i=e.filters)||void 0===i?void 0:i.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],l.table={columns:e.columns||[],rowKey:e.valueName},l.fieldsDefine={valueKey:e.valueKey||e.valueName},l.fieldAliasMap={[r?"textKey":t]:e.displayName[0],[r?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(l.table.fetch={api:n(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(l.echoRequest={fetchApi:n(e.echoSetting.api),formatter:t=>{var n;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(n=t.key)&&void 0!==n?n:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(l.echoRequest.fieldAliasMap={[r?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(l.tree={fetch:{api:n(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const n={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>n[e.tableField]=e.treeField)),n}}),e.emmediateSetting&&(l.columns=e.emmediateSetting.columns,l.request={fetchApi:n(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),l};var ao={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{"曾":"ZENG","沈":"SHEN","嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬤":"MO","嬷":"MO","蹒":"PAN","蹊":"XI","丬":"PAN","霰":"XIAN","莘":"XIN","豉":"CHI","饧":"XING","筠":"JUN","长":"CHANG","帧":"ZHEN","峙":"SHI","郍":"NA","芎":"XIONG","谁":"SHUI"}};const oo="阿",so="鿿",co=1,uo=2,po=3;let mo,ho=null;function fo(e){return e||null===ho?("object"==typeof Intl&&Intl.Collator?(mo=new Intl.Collator(["zh-Hans-CN","zh-CN"]),ho=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):ho=!1,ho):ho}function go(e){const t=ao.UNIHANS,n=ao.PINYINS,r=ao.EXCEPTIONS,i={source:e};if(e in r)return i.type=uo,i.target=r[e],i;let l,a=-1;if(e.charCodeAt(0)<256)return i.type=co,i.target=e,i;if(l=mo.compare(e,oo),l<0)return i.type=po,i.target=e,i;if(0===l)i.type=uo,a=0;else{if(l=mo.compare(e,so),l>0)return i.type=po,i.target=e,i;0===l&&(i.type=uo,a=t.length-1)}if(i.type=uo,a<0){let n=0,r=t.length-1;for(;n<=r;){a=~~((n+r)/2);const i=t[a];if(l=mo.compare(e,i),0===l)break;l>0?n=a+1:r=a-1}}return l<0&&a--,i.target=n[a],i.target||(i.type=po,i.target=i.source),i}function vo(e){return"string"==typeof e&&fo()?e.split("").map((e=>go(e))):e}var yo={isSupported:fo,parse:vo,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(ao)})))},genToken:go,convertToPinyin:(e,t,n)=>vo(e).map((e=>t&&e.type===uo?e.target.toLowerCase():e.target)).join(n||"")};var bo={patcher:function(e){e.EXCEPTIONS={"嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬷":"MO","蹊":"XI","丬":"PAN","霰":"XIAN","豉":"CHI","饧":"XING","帧":"ZHEN","芎":"XIONG","谁":"SHUI","钶":"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&("FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target)}};yo.isSupported()&&bo.shouldPatch(yo.genToken)&&yo.patchDict(bo);const xo=e=>{const{value:n,bordered:r}=e;return t.createElement(O,{value:n,title:n,bordered:r,readOnly:!0})};xo.displayName="FormItemView";const{Option:Eo}=H,wo=e=>{const{$$form:n}=t.useContext(Ml),{value:r,items:i,multiple:l,loading:a,onChange:o,onValuesChange:s}=e,{t:c}=Fn(),{fieldName:d,options:u={},style:p={},placeholder:m=c("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:f=!0,readOnly:g,disabled:v,onClear:y}=e.option,{itemList:b=[],filterable:x=!0,listHeight:E=qa,collapseTags:w,maxTagTextLength:C,dropdownStyle:S,openPyt:N=!0}=u,T=Gn(b)?i:b,I=e=>{var t;return(null===(t=T.find((t=>t.value===e)))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},R=e=>l?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return n.isOnlyShow?t.createElement(xo,{value:R(r),bordered:h}):t.createElement(H,Rn({value:r,mode:l?"multiple":void 0,popupClassName:`form-popper__${d}`,dropdownStyle:S,placeholder:m,style:p,loading:a,bordered:h,allowClear:f,disabled:v,showSearch:x,listHeight:E,maxTagCount:w?"responsive":void 0,maxTagTextLength:C},l?{title:R(r)}:null,{filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"",i=yo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,R(e),T)})(e)},onClear:y}),T.map((e=>t.createElement(Eo,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Co extends d{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:m,validateTrigger:h,rules:f=[],onChange:g=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(l),className:Pe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Zn(d)},required:e.getFormItemRequired(f)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:f,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(wo,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{g(t,n,r),e.setViewValue(o,n)}}))),m&&t.createElement(D,null,e.renderFormItemButton(o,m)),p&&t.createElement(D,{flex:Zn(p.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Co.contextType=Ml;const So=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{label:a,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToCheckbox:u,falseValue:p=$a,trueValue:m=Ma}=o,{t:h}=Fn(),f=e=>h(e===m?"am.form.trueText":"am.form.falseText");return t.createElement(F,{checked:r===m,style:s,disabled:d||n.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==i||i(e),l(e,f(e))})(t?m:p)}},u?a:null)};class No extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option,{labelToCheckbox:h}=o;return t.createElement(P.Item,{label:h?" ":e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(So,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}No.contextType=Ml;const To=e=>{const{uniqueKey:n,items:r,fieldsChange:i}=e,{global:l}=t.useContext(on),{$$form:a}=t.useContext(Ml),{$size:o}=$n(e),{t:s}=Fn(),c=t.useRef(null),[d,u]=t.useState(!1),p=t.useMemo((()=>n?`form_${n}`:""),[n]);t.useLayoutEffect((()=>{f()}),[]);const m=()=>{if(!p)return;const e=JSON.parse(localStorage.getItem(p));var t;if(e||(t=p,Hn(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(p,JSON.stringify(e)),f()):(null==l?void 0:l.getComponentConfigApi)&&h(r)})).catch((()=>{})),!e)return;return fe(e.map((e=>e.fieldName)),r.map((e=>e.fieldName))).length>0?r.map((t=>{const{fieldName:n}=t,r=e.find((e=>e.fieldName===n));return r?(de(r.hidden)||(t.hidden=r.hidden),t):t})):e.map((e=>{const t=r.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))},h=e=>{if(!p)return;const t=e.map((e=>{const t={};return de(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(p));var r,i;me(t,n)||(localStorage.setItem(p,JSON.stringify(t)),r=p,i=t,Hn(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.saveComponentConfigApi;if(e)try{yield e({[r]:i})}catch(e){}})))},f=()=>{const e=m();e&&g(e)},g=e=>{null==i||i([...e])},v=()=>t.createElement("div",{className:Pe("ant-dropdown-menu","fields-list")},t.createElement("div",{className:"reset"},t.createElement(nr,{type:"text",size:"small",onClick:()=>(e=>{const t=e.map((e=>{const t=r.find((t=>t.fieldName===e.fieldName))||Qn(e);return Object.assign(t,{hidden:e.hidden})}));g(t),h(t)})(a.getOriginItems())},s("qm.table.columnFilter.reset"))),t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));if(me(t,n))return;a.setExpandHandle(!0);const i=_a(e);g(i),h(i)}},r.map((e=>{var n;return t.createElement("li",{key:e.fieldName,className:"item",style:e.noAuth?{display:"none"}:void 0},t.createElement(F,{disabled:(null===(n=e.rules)||void 0===n?void 0:n.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,g(r),h(r)}}),t.createElement(Be,{className:"handle",title:s("qm.form.draggable")}),t.createElement("span",{className:"title"},a.getFormItemLabel(e.label)))})))),y=lr("form-fields-filter"),b={[y]:!0,[`${y}--lg`]:"large"===o,[`${y}--sm`]:"small"===o};return t.createElement(M,{open:d,trigger:["click"],dropdownRender:()=>v(),overlayClassName:Pe(b),placement:"bottomRight",overlayStyle:{minWidth:160},getPopupContainer:()=>c.current,onOpenChange:e=>{u(e)}},t.createElement("a",{ref:c,style:{padding:"5px 0"}},t.createElement(We,null)))};To.displayName="FieldsFilter";const Io=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(Ml),{value:i,onChange:l,onValuesChange:a}=e,{t:o}=Fn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h,onFocus:f,onBlur:g,onEnter:v,onClear:y}=e.option,{prefix:b,suffix:x,password:E,maxLength:w,pattern:C,toUpper:S,toTrim:N,autoFocus:T,autoComplete:I,secretType:R}=s,k=R&&(m||h),L=t.useRef(),A=t.useRef(!1);t.useEffect((()=>{var e;const t=()=>null==y?void 0:y(),n=null===(e=L.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return p&&n&&n.addEventListener("click",t),()=>{null==n||n.removeEventListener("click",t)}}),[]);const P=e=>{null==l||l(e),a(e)},_=E?O.Password:O,D=k?((e="",t)=>(e=e.toString(),"finance"===t&&(e=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","))(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e))(i,R):i;return r.isOnlyShow?t.createElement(xo,{value:(e=>e&&E?new Array(e.length).fill("*").join(""):e)(D),bordered:u}):t.createElement(_,{ref:e=>{L.current=e,"function"==typeof n&&n(e)},value:D,autoComplete:E?"new-password":I,autoFocus:T,placeholder:d,style:c,title:E?"":D,prefix:b,suffix:x,maxLength:w,bordered:u,allowClear:p,readOnly:m,disabled:h,onFocus:e=>{null==f||f(e.target.value,e)},onBlur:t=>{var n;let r=null!==(n=t.target.value)&&void 0!==n?n:"";if(N){const e=r.trim();r!==e&&(r=e,P(r))}(t=>{const{onBlur:n}=e;null==n||n(t)})(r),null==g||g(r,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==v||v(n,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=L.current)||void 0===t||t.blur())}},onCompositionStart:()=>{A.current=!0},onCompositionEnd:()=>{A.current=!1},onChange:e=>{let t=e.target.value;ge(C)&&(t=C.test(t)?t:null!=i?i:""),S&&!A.current&&(t=t.toUpperCase()),P(t)}})}));Io.displayName="VInput";class Ro extends d{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Io,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,t)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Ro.contextType=Ml;const Oo=e=>{const{$$form:n}=t.useContext(Ml),{value:r=[],onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{options:o={},placeholder:s=a("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{prefix:m,suffix:h,maxLength:f}=o,g=e=>{const t=e.every((e=>!e))?[]:e;null==i||i(t),l(t,v(t))},v=e=>e.join(" - ");return n.isOnlyShow?t.createElement(xo,{value:v(r),bordered:c}):t.createElement(O.Group,null,t.createElement(O,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],prefix:m,suffix:h,maxLength:f,allowClear:d,bordered:c,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t.createElement(O,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],prefix:m,suffix:h,maxLength:f,bordered:c,allowClear:d,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class ko extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(s),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(o)},required:e.getFormItemRequired(u)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Oo,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(l,n)}}))),c&&t.createElement(D,{flex:Zn(c.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},c)))))}}ko.contextType=Ml;const Lo=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(Ml),{value:i,onChange:l,onValuesChange:a}=e,{t:o}=Fn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,readOnly:p,disabled:m,onFocus:h,onBlur:f,onEnter:g}=e.option,{step:v=1,min:y,max:b,precision:x,autoFocus:E,stringMode:w,textAlign:C="left",controls:S=!0,formatter:N,parser:T}=s,I=t.useRef(),R=t.useRef(i),O=e=>{const t=Xa(e)?"":oe(e)?e.toFixed(x):new Yt(e).toFixed(x);return"function"==typeof N?N(t):t},k={[C]:!0,controls:S};return r.isOnlyShow?t.createElement(xo,{value:O(i),bordered:u}):t.createElement($,{ref:e=>{I.current=e,"function"==typeof n&&n(e)},value:i,className:Pe(k),placeholder:d,style:Object.assign({width:"100%"},c),step:v,min:y,max:b,controls:S,precision:x,autoFocus:E,stringMode:w,formatter:N,parser:T,bordered:u,readOnly:p,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{Bn((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(R.current),null==f||f(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==g||g(i,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=I.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!w&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{R.current=e,null==l||l(e),a(e,O(e))})(t)}})}));Lo.displayName="VInputNumber";class Ao extends d{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Lo,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Ao.contextType=Ml;const Po=e=>{const{$$form:n}=t.useContext(Ml),{value:r=[],onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{options:o={},placeholder:s=a("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{step:m=1,min:h=0,max:f,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=o,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),w(e)},w=e=>{const t=e.every((e=>null===e))?[]:[...e];null==i||i(t),l(t,C(t))},C=e=>Xa(e)?"":e.map((e=>Xa(e)?"":Number(e).toFixed(y))),S={[g]:!0,controls:v};return n.isOnlyShow?t.createElement(xo,{value:C(r),bordered:c}):t.createElement(O.Group,null,t.createElement($,{value:r[0],className:Pe("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:s[0],step:m,min:h,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{w([e,r[1]])},onBlur:()=>{E(r)}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t.createElement($,{value:r[1],className:Pe("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:s[1],step:m,min:h,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{w([r[0],e])},onBlur:()=>{E(r)}}))};class _o extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(s),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(o)},required:e.getFormItemRequired(u)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Po,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(l,n)}}))),c&&t.createElement(D,{flex:Zn(c.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},c)))))}}var Do;_o.contextType=Ml,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Do||(Do={}));const Ho=n(void 0),Fo={dataIndex:Ut.string.isRequired,title:Ut.string.isRequired,description:Ut.string,colSpan:Ut.number,width:Ut.number,minWidth:Ut.number,fixed:Ut.oneOf(["left","right"]),align:Ut.oneOf(["left","center","right"]),theadAlign:Ut.oneOf(["left","center","right"]),printFixed:Ut.bool,hidden:Ut.bool,noAuth:Ut.bool,noFixed:Ut.bool,ellipsis:Ut.bool,className:Ut.string,theadClassName:Ut.string,children:Ut.array,sorter:Ut.oneOfType([Ut.bool,Ut.func]),filter:Ut.shape({type:Ut.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:Ut.arrayOf(Ut.shape({text:Ut.string,value:Ut.oneOfType([Ut.string,Ut.number])})),style:Ut.object}),precision:Ut.number,displayPrecision:Ut.number,formatType:Ut.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:Ut.bool,canCopy:Ut.bool,editRender:Ut.func,dictItems:Ut.arrayOf(Ut.shape({text:Ut.string,value:Ut.oneOfType([Ut.string,Ut.number])})),summation:Ut.shape({sumBySelection:Ut.bool,displayWhenNotSelect:Ut.bool,dataKey:Ut.string,unit:Ut.string,render:Ut.func}),groupSummary:Ut.shape({dataKey:Ut.string,unit:Ut.string,render:Ut.func}),shouldCellUpdate:Ut.func,headRender:Ut.func,render:Ut.func};Ut.arrayOf(Ut.shape(Fo)).isRequired,Ut.func,Ut.array,Ut.oneOfType([Ut.string,Ut.func]).isRequired,Ut.number,Ut.bool,Ut.bool,Ut.shape({api:Ut.func.isRequired,params:Ut.object.isRequired,formatter:Ut.func,beforeFetch:Ut.func,afterFetch:Ut.func,stopToFirst:Ut.bool,dataKey:Ut.string,callback:Ut.func}),Ut.bool,Ut.bool,Ut.string,Ut.string,Ut.object,Ut.bool,Ut.bool,Ut.bool,Ut.oneOfType([Ut.object,Ut.func]),Ut.oneOfType([Ut.object,Ut.func]),Ut.array,Ut.func,Ut.bool,Ut.object,Ut.object,Ut.shape({type:Ut.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:Ut.array,selectedRowKeys:Ut.array,hideSelectAll:Ut.bool,checkStrictly:Ut.bool,filterable:Ut.bool,selectByClickRow:Ut.bool,selectFirstRowOnChange:Ut.bool,clearableAfterFetched:Ut.bool,selectAllOnCurrentPage:Ut.bool,fetchSelectedRows:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),fetchAllRowKeys:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),disabled:Ut.func,onChange:Ut.func,onSelect:Ut.func,onSelectAll:Ut.func}),Ut.shape({currentRowKey:Ut.oneOfType([Ut.number,Ut.string]),disabled:Ut.func,onChange:Ut.func}),Ut.shape({virtual:Ut.bool,overscan:Ut.number,doubleXScrollbar:Ut.bool}),Ut.shape({expandIconColumn:Ut.string}),Ut.shape({defaultExpandAllRows:Ut.bool,defaultExpandedRowKeys:Ut.array,expandedRowKeys:Ut.array,hideExpandAll:Ut.bool,rowExpandable:Ut.func,expandedRowClassName:Ut.string,expandedRowRender:Ut.func,onExpand:Ut.func,onChange:Ut.func}),Ut.shape({cellMerge:Ut.bool,onCellMerge:Ut.func,onSelectChange:Ut.func}),Ut.shape({groupItems:Ut.arrayOf(Ut.shape({dataIndex:Ut.string.isRequired,titleIndex:Ut.string,color:Ut.string,backgroundColor:Ut.string})),fetch:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),onChange:Ut.func}),Ut.func,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.shape({current:Ut.number,pageSize:Ut.number,pageSizeOptions:Ut.array,showSizeChanger:Ut.bool,showQuickJumper:Ut.bool}),Ut.shape({fileName:Ut.string,fetch:Ut.shape({api:Ut.func.isRequired,params:Ut.object}),beforeExport:Ut.func,cellStyle:Ut.bool,hideIcon:Ut.bool}),Ut.shape({showLogo:Ut.bool}),Ut.shape({fetch:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),fieldList:Ut.arrayOf(Ut.object)}),Ut.shape({position:Ut.oneOf(["top","bottom"]),hideAlert:Ut.bool,hideClearButton:Ut.bool}),Ut.oneOf(["left","right"]),Ut.func,Ut.func,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func;const Mo={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},$o=10,qo="1",jo="0",Ko="YYYY-MM-DD",Vo="YYYY-MM-DD HH:mm:ss",zo="YYYYMMDDHHmmss",Wo={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var Bo;!function(e){e.left="flex-start",e.right="flex-end"}(Bo||(Bo={}));const Uo=Object.assign({},e).useId;let Go=0;var Yo=Uo?function(e){const t=Uo();return e||t}:function(t){const[n]=e.useState(`qm_unique_${Go}`);return e.useEffect((()=>{Go+=1}),[]),t||n};let Xo=[];const Qo={_getInstance:function(e){var t;return null!==(t=Xo.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=Xo[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==Xo.findIndex((e=>e===t))&&(this.deregister(e),Xo=[t,...Xo])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),Xo=[{id:e,vm:t},...Xo])},deregister:function(e){e&&(Xo=Xo.filter((t=>t.id!==e)))}};class Zo{constructor(){this.state={required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]},this.addToRequired=e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)},this.removeFromRequired=e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)},this.addToValidate=e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)},this.removeFromValidate=e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)},this.addToEdited=e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)},this.removeFromEdited=e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)},this.addToInserted=e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)},this.removeFromInserted=e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)},this.addToUpdated=e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)},this.removeFromUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)},this.addToRemoved=e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)},this.removeFromRemoved=e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)},this.clearAllLog=()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]}}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}const Jo={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollX:50,virtualScrollY:100,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored",popupClassName:"table-editable__popper"};function es(e){return void 0!==e}function ts(t,n){const{defaultValue:r,value:i,onChange:l,postState:a}=n||{},[o,s]=e.useState((()=>es(i)?i:es(r)?"function"==typeof r?r():r:"function"==typeof t?t():t)),c=es(i)?i:o,d=a?a(c):c,u=Mn(l),[p,m]=e.useState([c]);hn((()=>{const e=p[0];o!==e&&u(o,e)}),[p]),hn((()=>{es(i)||s(i)}),[i]);return[d,Mn((e=>{s(e),m([c])}))]}const ns=e=>e.map((e=>{const t=Object.assign({},e);return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=ns(t.children)),t})),rs=(e,n)=>{const{fetch:r,columns:i,border:l,rowSelection:a,summation:o,expandable:s,treeConfig:c,webPagination:d,scrollPagination:u,showSuperSearch:p,showFastSearch:m,showGroupSummary:h,showTableImport:f,showClipboard:g,showSelectCollection:v,showPivotGrid:y,footRender:b}=e,{tableRef:x,getRowKey:E,tableFullData:w,tableFlatData:C,selectionKeys:S,sorter:N,filters:T,superFilters:I,pagination:R,mergedTdCells:O}=n,{selectionRows:k,summaries:L}=x.current,{expandIconColumn:A=""}=c||{},{t:P}=Fn(),_=e=>{const t=(e=>{const t=[],n=[],r=[];for(let i=0;i<e.length;i++){const l=e[i];"left"===l.fixed?t.push(l):"right"===l.fixed?n.push(l):r.push(l)}return[...t,...r,...n]})(ns(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:Jo.selectionColumn,title:"radio"===t?P("qm.table.config.selectionText"):"",width:Jo.selectionColumnWidth,fixed:"left",type:t}})(a),r=(null==(i=s)?void 0:i.expandedRowRender)?{dataIndex:Jo.expandableColumn,title:"",width:Jo.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return n&&t.unshift(n),r&&t.unshift(r),ea(t)},D=(e,t,n,r,i)=>{const l=`${t},${n}`;e.has(l)||e.set(l,{row:t,col:n,rowSpan:r,colSpan:i})},H=t.useMemo((()=>!!(null==r?void 0:r.api)),[null==r?void 0:r.api]),F=t.useMemo((()=>!H&&!!d),[H,d]),M=t.useMemo((()=>H&&!!u),[H,u]),$=t.useMemo((()=>(H||F)&&!M),[H,F,M]),q=t.useMemo((()=>_(i)),[i]),j=t.useMemo((()=>Jl(q)),[q]),K=t.useMemo((()=>j.filter((e=>"function"==typeof e.editRender))),[j]),V=t.useMemo((()=>j.filter((e=>!!e.summation))),[j]),z=t.useMemo((()=>j.filter((e=>"left"===e.fixed))),[j]),W=t.useMemo((()=>j.filter((e=>"right"===e.fixed))),[j]),B=t.useMemo((()=>(e=>{const t=new Map;return e.forEach((e=>{const n=C.findIndex((t=>E(t,t.index)===e.rowKey)),r=j.findIndex((t=>t.dataIndex===e.dataIndex));if(!(n<0||r<0)){D(t,n,r,e.rowSpan,e.colSpan);for(let i=0;i<e.rowSpan;i++)for(let l=0;l<e.colSpan;l++)0===i&&0===l||D(t,n+i,r+l,0,0)}})),Array.from(t.values()).sort(((e,t)=>e.row-t.row||e.col-t.col))})(O)),[O,j,w]),U=t.useMemo((()=>{var e,t;const n=j.filter((e=>![Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn].includes(e.dataIndex)));return A&&n.some((e=>e.dataIndex===A))?A:null!==(t=null===(e=n[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[j,A]),G=t.useMemo((()=>V.length>0),[V]),Y=t.useMemo((()=>!!b||G),[b,G]),X=t.useMemo((()=>da(q).length>1),[q]),Q=t.useMemo((()=>l||X),[l,X]),Z=t.useMemo((()=>j.some((e=>e.sorter))),[j]),J=t.useMemo((()=>j.some((e=>e.filter))),[j]),ee=t.useMemo((()=>V.some((e=>!!e.summation.dataKey))),[V]),te=t.useMemo((()=>!H&&!!f),[H,f]),ne=t.useMemo((()=>!!g&&K.length>0),[g,K]),re=t.useMemo((()=>!!v&&"checkbox"===(null==a?void 0:a.type)),[v,a]),ie=t.useMemo((()=>!!p&&J),[p,J]),le=t.useMemo((()=>!H&&!!m),[H,m]),ae=t.useMemo((()=>!H&&!!y),[H,y]),oe=t.useMemo((()=>!!h&&j.some((e=>!!e.groupSummary))),[j]),se=t.useMemo((()=>{var e;return!!(null===(e=null==o?void 0:o.groupItems)||void 0===e?void 0:e.length)}),[o]),ce=t.useMemo((()=>!C.length),[C]),de=t.useMemo((()=>(()=>{const e={};return V.forEach((t=>{const{dataIndex:n,precision:r,displayPrecision:i,summation:l}=t,{sumBySelection:a,displayWhenNotSelect:o,unit:s}=l,c=se?Ia(x.current.tableFullData):x.current.tableFullData,d=!k.length&&!!o;let u=(!a||d?c:k).reduce(((e,t)=>{if(null==t?void 0:t[Jo.summaryIgnore])return e;const r=ga(t,n);return ba(r)?e.plus(r):e}),new Yt(0));!Object.keys(L).includes(n)||a&&!d||(u=new Yt(ga(L,n))),va(e,n,u.toNumber());let p=r>=0?u.toFixed(r):u.toString();i>=0&&""!==p&&(p=Ea(p,i)),p=xa(p),va(e,`${n}_text`,s?`${p} ${s}`:p)})),[e]})()),[C,S,L]),ue=t.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(V)),[V]),pe=t.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((n=>{null!==e[n]&&t.push(`${n}|${e[n]}`)})),t.join(",")})(N),n=((e,t)=>{const n=[];if(Object.keys(e).length)for(const t in e){const[r,i]=t.split("|"),l=e[t];Object.keys(l).forEach((e=>{n.push({type:i,bracketLeft:"",fieldName:r,expression:e,value:l[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{n.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),n.length&&(n[n.length-1].logic=""),n})(T,I),i=t?{[Jo.sorterFieldName]:t}:null,l=n.length?{[Jo.filterFieldName]:n}:null,a=ue?{[Jo.groupSummary.summaryFieldName]:ue,usedJH:1}:null,o=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:null,s={[Jo.currentPageName]:R.current,[Jo.pageSizeName]:R.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),l),a),o),s)}),[null==r?void 0:r.params,R.current,R.pageSize,N,T,I,ue]);return{isFetch:H,isWebPagination:F,isScrollPagination:M,showPagination:$,tableColumns:q,flattenColumns:j,editableColumns:K,summationColumns:V,leftFixedColumns:z,rightFixedColumns:W,derivedMergeCells:B,treeExpandIndex:U,showSummary:G,showFooter:Y,isHeadGroup:X,bordered:Q,isHeadSorter:Z,isHeadFilter:J,isServiceSummation:ee,isSelectCollection:re,isTableImport:te,isTableClipboard:ne,isSuperSearch:ie,isFastSearch:le,isPivotGrid:ae,isGroupSummary:oe,isGroupSubtotal:se,isTableEmpty:ce,summationRows:de,fetchParams:pe}},is=(e,n)=>{const{rowKey:r,height:i,dataSource:l,summation:a,fetch:o,initialSorter:s,initialFilter:c,rowSelection:d,expandable:u,tableConfig:p,authConfig:m,ignorePageIndex:h,columnsChange:f,onChange:g,onDataChange:v,onDataLoad:y,onScrollEnd:b,onFetchError:x}=e,{getRowKey:E,tableRef:w,tableElementRef:C,tableBodyRef:S,$size:N,tableColumns:T,flattenColumns:I,tableFullData:R,pagination:O,layout:k,filters:L,sorter:A,superFilters:P,fetchParams:_,selectionKeys:D,rowExpandedKeys:H,highlightKey:F,summationColumns:M,isFetch:$,isWebPagination:q,isScrollPagination:j,isServiceSummation:K,isGroupSubtotal:V,doLayout:z,setTableFullData:W,setTableOriginData:B,setTableFlatData:U,setAllTableData:G,setDeriveRowKeys:Y,setPagination:X,setPingRight:Q,setPingLeft:Z,setSpinning:J,setSorter:ee,setFilters:te,setSuperFilters:ne,setSelectionKeys:re,setRowExpandedKeys:ie,setHighlightKey:le,setSelectionRows:ae,setScrollXLoad:oe,setScrollYLoad:se,setFieldAuth:ce,setResizeState:de,setSummaries:pe,setPermission:me,setRecordsMap:he,resetTableScroll:fe,clearElementStore:ge,clearRecordsMap:ye}=n,{t:be}=Fn(),{store:xe}=w.current,Ee=t.useRef(Object.assign({},_)),we=t.useRef(!1),Ce=sl(C);hn((()=>{Oe(),z()}),[T]),hn((()=>{Se()}),[Ce.width,Ce.height,N,i,k.tableAutoHeight]),Mi((()=>{lt(),at(),ot(),$||(q&&Ze(),Be(l)),s&&ee(s),c&&te(c)}),[l,null==o?void 0:o.params]),Mi((()=>{const e=je(_,Ee.current);e||$&&(null==d?void 0:d.clearableAfterFetched)&&st(),!e&&_[Jo.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?Ze():$&&ze(),Ee.current=_}),[_]),Mi((()=>{q&&tt(),j||fe(),Me()}),[O.current,O.pageSize]),Mi((()=>{$||Te(R.length),z()}),[R]),Mi((()=>{w.current.isTreeTable&&tt()}),[H]);const Se=()=>{const{scrollBarRef:e,resizeState:t}=w.current,{width:n,height:r}=Ce;z(),k.tableBodyWidth>n&&Q(!0),e.current.scrollLeft>0&&Z(!0),de(Object.assign({},t,{width:n,height:r}))},Ne=()=>{F&&S.current.setClickedValues([F,""]),"radio"===(null==d?void 0:d.type)&&D.length&&S.current.setClickedValues([D[0],""])},Te=e=>{e!==O.total&&X((t=>Object.assign({},t,{total:e})))},Ie=e=>{we.current=e},Re=cl((e=>{Ye(),null==b||b(e)})),Oe=()=>{oe(I.length>Jo.virtualScrollX)},ke=(e=[])=>{let t=e.length>Jo.virtualScrollY;w.current.isTreeTable&&(t=!0),(null==p?void 0:p.virtual)&&(t=!0),se(t)},Le=e=>V?Ae(Pe(e,0)):e,Ae=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Ae(e.children)),delete e.children,t.push(e)})),t},Pe=(e,t)=>{var n;const i=null===(n=a.groupItems)||void 0===n?void 0:n[t];if(!i)return e.forEach(((t,n)=>{t._rowSpan=0===n?e.length:0,t._colSpan=1})),e;return Oa(e,[i.dataIndex]).map((e=>{const n={children:Pe(e,t+1),_group:i.dataIndex};return"function"!=typeof r&&va(n,r.toString(),Sa()),i.titleIndex&&va(n,i.titleIndex,ga(e[0],i.titleIndex)),va(n,i.dataIndex,ga(e[0],i.dataIndex)),M.forEach((e=>{var t;const{dataIndex:r}=e,i=null===(t=n.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[Jo.summaryIgnore])return e;const n=Number(ga(t,r));return Number.isNaN(n)?e:e+n}),0);va(n,r,i)})),n}))},_e=e=>{re(e),ae((e=>{const{selectionRows:t,recordsMap:n}=w.current,r=new Map;t.forEach((e=>r.set(E(e,e.index),e)));const i=[];for(let t=0,l=e.length;t<l;t++){const l=r.get(e[t])||n.get(e[t]);l&&i.push(l)}return i})(e))},De=e=>{const{type:t,checkStrictly:n=!0}=d||{},r=Array.isArray(e)?e:D;let i=[];return w.current.isTreeTable&&!n&&r.forEach((e=>{i.push(...((e,t)=>{var n;const{disabled:r}=d||{},{deriveRowKeys:i,recordsMap:l}=w.current,a=oa(i,e);let o=[];if(!a)return o;let s=He((null==a?void 0:a.children)||[]);return r&&(s=s.filter((e=>!l.has(e)||!r(l.get(e))))),o=[...new Set([...t,...s])],((null===(n=La(i,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=oa(i,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=r?[...o,e]:o.filter((t=>t!==e))})),o})(e,r))})),i="radio"===t?r.slice(0,1):[...new Set([...r,...i])],i},He=e=>{const t=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&t.push(...He(e[n].children)),t.push(e[n].rowKey);return t},Fe=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Fe(e.children,t)),e.rowKey===t&&e.parentRowKey&&n.push(e.parentRowKey)})),n.length&&n.push(...Fe(e,n[n.length-1])),n},Me=cl((()=>{null==g||g(O,qe(L),$e(A),P,{currentDataSource:et()})})),$e=e=>{const t={};for(const n in e)null!==e[n]&&(t[n]=e[n]);return t},qe=e=>{const t={};for(const n in e){if(!n.includes("|"))continue;const[r,i]=n.split("|");t[`${r}|${i}`]=e[n]}return t},je=(e,t)=>{const n=Object.keys(fa(e,t));return 1===n.length&&(n.includes(Jo.currentPageName)||n.includes(Jo.pageSizeName))},Ke=()=>Hn(void 0,void 0,void 0,(function*(){var t;if(!m)return;let n=Xn(m,["fetch"]);if(m.fetch){const{api:e,params:r,dataKey:i}=m.fetch;try{const l=yield e(r);200===l.code&&(n=null!==(t=i?ue(l.data,i):l.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:r=1}=n;me((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!r})))}if(Array.isArray(n.fieldList)){const t=na(e.columns,(e=>{const{dataIndex:t}=e,r=n.fieldList.find((e=>e.dataIndex===t));if(r){const{visible:n=1,disabled:i,secretName:l}=r,a=ra(w.current.originColumns,t);ce(t,{visible:n,disabled:i,secretName:l}),n||(e.noAuth=!0,a.noAuth=!0),l&&(e.formatType=`secret-${l}`,a.formatType=`secret-${l}`)}}));null==f||f(t)}})),Ve=()=>Hn(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:r=(e=>e),beforeFetch:i=zn,afterFetch:l,callback:s}=o;if(!i(_))return;const c=!!(null===(e=null==a?void 0:a.fetch)||void 0===e?void 0:e.api);J(!0);try{const[e,i]=c?yield Promise.all([o.api(r(_)),a.fetch.api(r(_))]):[yield o.api(r(_))];if(w.current.unMounted)return;if(c?200===e.code&&200===i.code:200===e.code){const r=null!==(t=o.dataKey)&&void 0!==t?t:Jo.dataKey;let a=null!==(n=ue(e.data,r))&&void 0!==n?n:[];a="function"==typeof l?yield l(a):a;const c=ue(e.data,r.replace(/[^.]+$/,Jo.totalKey))||a.length||0,d=Math.max(Math.ceil(c/O.pageSize),1);if(_[Jo.currentPageName]>d)return Xe(Object.assign(Object.assign({},O),{current:d}));Be(we.current?w.current.tableFullData.concat(a):a),Te(c),Ue((null==i?void 0:i.data)||e.data),null==s||s(e.data,e)}}catch(e){null==x||x(e)}var d,u;d=o,u="stopToFirst",Object.prototype.hasOwnProperty.call(d,u)&&(o.stopToFirst=!1),J(!1),Ie(!1)})),ze=cl(Ve),We=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=We(e.children)),e.index=t,h||(e.pageIndex=(e=>{const{current:t,pageSize:n}=O;return!$||j?e:(t-1)*n+e})(t)),e))),Be=e=>{const t=Le(We(e));nt(t),rt(t),_e(De()),ie((e=>{const{isTreeTable:t,allRowKeys:n,allParentRowKeys:r,deriveRowKeys:i,recordsMap:l}=w.current,{defaultExpandAllRows:a,rowExpandable:o,expandedRowRender:s}=u||{};let c=Array.isArray(e)?e:[...H];if(a)c=t?r:n;else if(t){s&&tr("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];F&&e.unshift(F),e.forEach((e=>{const t=La(i,e)||[];c.push(...t.length>1?t.slice(0,-1).reverse():t)})),c=[...new Set(c)]}return o&&c.filter((e=>{const t=l.get(e);return!!t&&o(t)})),c})()),Ge(),null==y||y(t)},Ue=e=>{var t,n,r;if(!K)return;const i=null!==(n=null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:Jo.summationKey,l=null!==(r=i?ue(e,i):e)&&void 0!==r?r:{},o={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{va(o,e.dataIndex,Number(ga(l,e.summation.dataKey)))})),pe(o)},Ge=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=et();if(e.length){const t=E(e[0],e[0].index);_e([t])}else _e([])}},Ye=()=>{if(!j)return;const e=Qe();we.current||O.current>=e||(Ie(!0),Xe(Object.assign(Object.assign({},O),{current:O.current+1})))},Xe=({current:e,pageSize:t})=>{X((n=>Object.assign({},n,{current:e,pageSize:t})))},Qe=()=>{const{pageSize:e,total:t}=O;return Math.ceil(t/e)||1},Ze=()=>{Xe(Object.assign({},O,{current:1}))},Je=()=>{const{current:e,pageSize:t}=O;return w.current.tableFullData.slice((e-1)*t,e*t)},et=()=>q?Je():w.current.tableFullData,tt=()=>{const{allTableData:e,isTreeTable:t}=w.current,n=q?sa(Je()):e,r=t?(e=>{const t=new Map,n=[];return e.forEach((e=>{const r=E(e,e.index);if(!e._parentRowKey)return n.push(e),t.set(r,!0);H.includes(e._parentRowKey)&&t.get(e._parentRowKey)&&(n.push(e),t.set(r,!0))})),t.clear(),n})(n):n;ke(r),U(r)},nt=e=>{W(e),G(e),Y(e),it(),tt()},rt=e=>{B(e)},it=()=>{ye(),w.current.allTableData.forEach((e=>he(E(e,e.index),e)))},lt=()=>{ee({})},at=()=>{te({})},ot=()=>{ne([])},st=()=>{_e([])};return{initialTable:()=>{Ke(),Ne(),Oe(),ke(),$?Ve():Be(l)},checkDataIndex:()=>{const e=I.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&tr("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:nt,getTableData:Ve,createTableList:et,createTableData:Be,createGroupData:Le,setSelectionKeysEffect:_e,findParentRowKeys:Fe,getAllChildRowKeys:He,doFieldValidate:(e,t,n,r,i)=>{if(!Array.isArray(e))return tr("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(xe.removeFromRequired({x:n,y:r}),xe.removeFromValidate({x:n,y:r}),e.forEach((e=>{var l;e.required&&Gn(t)&&xe.addToRequired({x:n,y:r,text:e.message||i+be("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(l=e.validator)||void 0===l?void 0:l.call(e,t))||xe.addToValidate({x:n,y:r,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:r,removed:i}=xe.state,l=ve(n,i),a=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:a(e),validate:a(t),inserted:n.filter((e=>!l.includes(e))),updated:r.filter((e=>![...ve(r,n),...ve(r,i)].includes(e))),removed:i.filter((e=>!l.includes(e)))}},dataChange:()=>{null==v||v(w.current.tableFullData)},tableChange:Me,toLastPage:()=>{const e=Qe();O.current!==e&&Xe(Object.assign({},O,{current:e}))},toFirstPage:Ze,getPageCount:Qe,pagerChangeHandle:Xe,scrollBottomDebouncer:Re,clearTableSorter:lt,clearTableFilter:at,clearSuperFilters:ot,clearRowSelection:st,clearRowHighlight:()=>{le("")},clearTableLog:()=>{xe.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=w.current;ge(),xe.destroy(),e.deregister(t)}}},ls=(e,n)=>{const{height:r,minHeight:i,maxHeight:l,ellipsis:a,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,topElementRef:u,tableElementRef:p,tableBodyRef:m,$size:h,tableColumns:f,flattenColumns:g,leftFixedColumns:v,derivedMergeCells:y,tableFlatData:b,layout:x,showFooter:E,showPagination:w,isFullScreen:C,setLayout:S,setElementStore:N}=n,T=t.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=x,n={};return i&&Object.assign(n,{minHeight:`${ha(i)}px`}),l&&Object.assign(n,{maxHeight:`${ha(l)}px`}),C?Object.assign(Object.assign({},n),{maxHeight:"",minHeight:"",height:`${e}px`}):r?Object.assign(Object.assign({},n),{height:"auto"!==r?`${ha(r)}px`:`${t}px`}):n}),[r,l,i,C,x]),I=(e,t)=>{const{scrollBarRef:n,scrollYLoad:r,rowHeight:i}=d.current;if(void 0!==t&&t>=0)if(t<b.length)if(r)m.current.scrollToYIndex(t);else{const e=R(c(b[t],b[t].index));e&&n.current.SET_SCROLL_TOP(e.offsetTop)}else n.current.SET_SCROLL_TOP(t*i);else if(r){const t=b.findIndex((t=>e===c(t,t.index)));t>=0&&m.current.scrollToYIndex(t)}else{const t=R(e);t&&n.current.SET_SCROLL_TOP(t.offsetTop)}},R=e=>d.current.elementStore.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);return{createElementStore:()=>{N("$toper",u.current),N("$table",p.current)},tableStyles:T,getSpan:(e,t,n,r,i)=>{let l=1,a=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:n,columnIndex:r,tableData:i});Array.isArray(o)?(l=o[0],a=o[1]):ae(o)&&(l=o.rowSpan,a=o.colSpan)}if(y.length>0){const e=y.find((e=>e.row===n&&e.col===r));e&&(l=e.rowSpan,a=e.colSpan)}return{rowSpan:l,colSpan:a}},getStickyLeft:e=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=ra(f,e);e=t?ia(t).dataIndex:""}let t=0;for(let n=0;n<g.length;n++){const r=g[n];if(r.dataIndex===e)break;t+=r.width||r.renderWidth||0}return t},getStickyRight:(e,t)=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=ra(f,e);e=t?la(t).dataIndex:""}const n="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let n=[];return e.forEach((e=>{e.colSpan>0&&n.length>0&&(t.push(n),n=[]),n.push(e)})),n.length>0&&t.push(n),t.map((e=>{const[t,n]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...n,...t.reverse()]})).flat()})(g):g;let r=0;for(let t=n.length-1;t>=0;t--){const i=n[t];if(i.dataIndex===e)break;r+=i.width||i.renderWidth||0}return r},scrollXToColumn:(e,t)=>{const n=void 0===t?g.findIndex((t=>t.dataIndex===e)):t;if(n<0)return;const{scrollBarRef:r}=d.current,i=v.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),l=g.slice(0,n).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);r.current.SET_SCROLL_LEFT(l-i)},scrollYToRecord:I,calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current;try{const n=t.winHeight-e.$table.getBoundingClientRect().top-(w?Do["small"!==h?"middle":h]+$o:0)-$o;S((e=>Object.assign({},e,{tableAutoHeight:n})))}catch(e){}},resetTableScroll:()=>{I("",0)},doLayout:()=>{(()=>{const{elementStore:e,scrollXLoad:t}=d.current,n=e.$table.clientWidth,{defaultColumnWidth:r}=Jo,i=[];let l=0;if(g.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,l+=e.width):(e.renderWidth=void 0,i.push(e))})),i.length>0){const e=g.reduce(((e,t)=>e+(t.width||t.minWidth||r)),0);if(e<=n){const t=n-e;if(1===i.length)i[0].renderWidth=(i[0].minWidth||r)+t;else{const e=t/i.reduce(((e,t)=>e+(t.minWidth||r)),0);let n=0;i.forEach(((t,i)=>{if(0===i)return;const l=Math.floor((t.minWidth||r)*e);n+=l,t.renderWidth=(t.minWidth||r)+l})),i[0].renderWidth=(i[0].minWidth||r)+t-n}}else i.forEach((e=>{e.renderWidth=e.minWidth||r}));S((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,n)})))}else l=g.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||r)),0),S((e=>Object.assign(Object.assign({},e),{tableBodyWidth:l})));S((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&m.current.resetItemXSize(g)})(),Bn((()=>(()=>{const{elementStore:e,scrollYLoad:t,resizeState:n}=d.current;if(!e.$table.offsetParent)return;const r=e.$table.offsetHeight,i=o?e.$header.offsetHeight:x.headerHeight,l=E?e.$footer.offsetHeight:x.footerHeight,a=r-i-l,s=e.$tableBody.offsetHeight;let c=0;if(C){const t=e.$toper?e.$toper.offsetHeight+$o:0,r=e.$pager?e.$pager.offsetHeight+$o:0;c=n.winHeight-t-r-20}S((e=>Object.assign({},e,{headerHeight:i,footerHeight:l,viewportHeight:a,tableBodyHeight:s,tableFullHeight:c})))})()))}}};function as({handler:t,delay:n=0}){const r=Rl(t,n),i=Mn(n>0?r:t);e.useEffect((()=>(window.addEventListener("resize",i),()=>window.removeEventListener("resize",i))),[i])}const os=e=>{const{total:n}=e,{tableRef:r,prefixCls:i,selectionKeys:l,isHeadSorter:a,isHeadFilter:o,clearTableSorter:s,clearTableFilter:c,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:p,setActivedCell:m}=t.useContext(Ho),{infoBarConfig:h,rowSelection:f,rowHighlight:g}=r.current.props,{allTableData:v,invalidRowKeys:y}=r.current,{hideAlert:b,hideClearButton:x}=h||{},{t:E}=Fn(),w=t.useMemo((()=>!b),[b]),C=t.useMemo((()=>!x&&!!(a||o||f||g)),[x,a,o,f,g]),S={[`${i}__alert`]:!0};return w?t.createElement("div",{className:Pe(S)},t.createElement("i",{className:"svgicon icon"},t.createElement(Ue,null)),t.createElement("span",null,E("qm.table.alert.total",{total:r.current.isTreeTable?v.length:n}),f?`,${E("qm.table.alert.selected",{total:Math.max(l.length-y.length,0)})}`:""),C&&t.createElement("em",{onClick:()=>{c(),d(),u(),p(),Bn((()=>s())),m({})}},E("qm.table.alert.clear"))):null},ss=t.forwardRef(((e,n)=>{const{isFullScreen:r,open:i=!0}=e,{prefixCls:l,setFullScreen:a}=t.useContext(Ho),{t:o}=Fn(),s=()=>{a(!r)};return t.useImperativeHandle(n,(()=>({clickHandle:s}))),i?t.createElement("span",{className:`${l}-full-screen`,title:o(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},r?t.createElement(Ve,null):t.createElement(ze,null))):null}));ss.displayName="FullScreen";const cs=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i,getTableData:l}=t.useContext(Ho),{t:a}=Fn(),o=()=>{l()};return t.useImperativeHandle(n,(()=>({clickHandle:o}))),r?t.createElement("span",{className:`${i}-reload`,title:a("qm.table.refresh.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ge,null))):null}));cs.displayName="Reload";const ds=()=>{const e={dateFormat:e=>{const t=e?m(e).format(Ko):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?m(e).format(Vo):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?m(e).format(Vo.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>ba(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>xa(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,n,r)=>{var i,l,a,o;const{dictItems:s,precision:c,displayPrecision:d,formatType:u,editRender:p}=n,m=s||(null===(i=null==p?void 0:p(r,n))||void 0===i?void 0:i.items)||[];let h=null!==(o=null!==(a=null===(l=m.find((e=>e.value==t)))||void 0===l?void 0:l.text)&&void 0!==a?a:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(h=t.map((e=>{var t,n;return null!==(n=null===(t=m.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==n?n:e})).join(",")),c>=0&&""!==h&&(h=ba(h)?new Yt(h).toFixed(c):h),d>=0&&""!==h&&(h=Ea(h,d)),u){const t=e[`${Un(u)}Format`];t?h=t(h):tr("Table","字段的格式化类型 `formatType` 配置不正确")}return h},n=e=>jn(e)?Na(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,r,i,l)=>{const a=ga(e,r.dataIndex),o=r.render?r.render(a,e,r,i,l):t(a,r,e);return n(o)}}},us=t.forwardRef(((e,n)=>{var r,i,l,a;const{tableColumns:o,open:s=!0}=e,{global:c}=t.useContext(on),{tableRef:d,prefixCls:u,flattenColumns:p,summationRows:m,showSummary:h,getSpan:f}=t.useContext(Ho),{tablePrint:g,showHeader:v}=d.current.props,{t:y}=Fn(),{getTitleFromCellValue:b}=ds(),x=null!==(i=null===(r=null==c?void 0:c.print)||void 0===r?void 0:r.leftLogo)&&void 0!==i?i:"",E=null!==(a=null===(l=null==c?void 0:c.print)||void 0===l?void 0:l.rightLogo)&&void 0!==a?a:"",w=!(!x&&!E),C=t.useMemo((()=>Qn(aa(o,[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn]))),[o]),S=t.useMemo((()=>Qn(aa(p,[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn]))),[p]),N=t.useMemo((()=>Qn(o.filter((e=>e.printFixed)))),[o]),T=e=>{const t=Object.assign({},ka(C,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?T(t):t},I=(e,t)=>ye(be(xe(e),t),Ee(((...e)=>we(...e,((e,n)=>{if(Array.isArray(e))return I(e.concat(n),t)}))))),R=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(T(e))})),n=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const n=e.filter((e=>e.dataIndex===t));return n.length<=1?n[0]:I(n,"dataIndex")[0]})))(n),t.push(da(n))})),t},O=()=>{const e=(e=>{const t=[];let n=[],r=0,i=0;for(;i<e.length;){const l=e[i];r+=l.width||l.renderWidth,r<=Jo.printWidth?(n.push(l),i===e.length-1&&t.push(n),i++):i>0?(e.splice(0,i),N.length&&e.unshift(...N),t.push(n),n=[],r=0,i=0):(l.width=Jo.printWidth,n.push(l),t.push(n),i++)}return t})([...S]),t=R(e);let n=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let r=0;r<e.length;r++)n+=k(t[r],e[r],d.current.tableFullData),n+='<div class="page-break"></div>';return n+"</body></html>"},k=(e,t,n)=>{const{showLogo:r=!0}=g;let i='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${t.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,v&&(i+=["<thead>",r&&w?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',x?`<img src="${x}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',E?`<img src="${E}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Ta(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(i+=`<tbody>${sa(n).map((e=>`<tr>${t.map(((t,r)=>{const{rowSpan:i,colSpan:l}=f(e,t,e.index,r,n);if(!i||!l)return null;return`<td rowspan="${i}" colspan="${l}">${0===r&&e._level?`<span style="padding-left:${e._level*Jo.treeTable.textIndent}px"></span>`:""}${b(e,t,e.index,r)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),h&&m.length&&(i+=["<tfoot>",m.map((e=>`<tr>${t.map(((t,r)=>{const{dataIndex:i,summation:l}=t,a=(null==l?void 0:l.render)?l.render(n):ga(e,`${i}_text`);return`<td>${0===r&&""===a?y("qm.table.config.summaryText"):jn(a)?Na(a).join(""):a}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},L=()=>{var e;null===(e=((e,t)=>{const{filename:n,type:r,isDownload:i}=e,l=`${n}.${r}`;if(window.Blob){const e=new Blob([t],{type:`text/${r}`});if(!i)return Promise.resolve({type:r,content:t,blob:e});wl(e,l)}})({filename:"print",type:"html",isDownload:!1},O()))||void 0===e||e.then((({content:e,blob:t})=>{let n=document.createElement("iframe");n.setAttribute("frameborder","0"),n.setAttribute("width","100%"),n.setAttribute("height","0"),n.style.display="none",document.body.appendChild(n),d.current.isIE?(n.contentDocument.write(e),n.contentDocument.execCommand("print"),n.parentNode.removeChild(n),n=null):(n.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{n.parentNode.removeChild(n),n=null}))},n.src=URL.createObjectURL(t))}))};return t.useImperativeHandle(n,(()=>({clickHandle:L}))),s?t.createElement("span",{className:`${u}-print`,title:y("qm.table.print.text"),onClick:()=>L()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ye,null))):null}));us.displayName="TablePrint";const ps="606060",ms="thin",hs="d4d4d4",fs=(e,t)=>{t&&(e.height=Math.floor(.75*t))},gs=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},vs=()=>({top:{style:ms,color:{argb:hs}},left:{style:ms,color:{argb:hs}},bottom:{style:ms,color:{argb:hs}},right:{style:ms,color:{argb:hs}}}),ys=e=>{const{children:t}=e;return t&&t.length?ys(t[0]):e},bs=e=>{const{precision:t,formatType:n}=e,r=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:r?`0${r}%`:"0%"}:"finance"===n?{numFmt:r?`#,##0${r}`:"#,##0"}:r?{numFmt:`0${r}`}:null},xs=()=>{const{tableRef:e,getSpan:n,showSummary:r,isHeadGroup:i}=t.useContext(Ho),{spanMethod:l,showHeader:a}=e.current.props,{t:o}=Fn(),s=(e,t)=>{var n,r,i;return null!==(i=null!==(r=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==r?r:t)&&void 0!==i?i:""};return{exportXLSX:(t,s,c,d)=>Hn(void 0,void 0,void 0,(function*(){const{columns:u,footSummation:p}=t,{rowHeight:m}=e.current,h=Jl(u),f=da(u),g=[],v=[],y=[],b=[];let x=0;const E={};h.forEach((e=>{const{dataIndex:t,width:n,renderWidth:r}=e;E[t]=Ta(e.title),y.push({key:t,width:(n||r||Jo.defaultColumnWidth)/8})})),a&&(i?f.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:r,rowSpan:i}=e,l=ys(e),a=h.findIndex((({dataIndex:e})=>e===l.dataIndex));n[l.dataIndex]=Ta(e.title),0!==r&&(r>1||i>1)&&b.push({s:{r:t,c:a},e:{r:t+i-1,c:a+r-1}})})),g.push(n)})):(h.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;(n>1||r>1)&&b.push({s:{r:x,c:t},e:{r:x+r-1,c:t+n-1}})})),g.push(E)),x+=g.length);const w=sa(s).map(((e,t)=>{const r={};return h.forEach(((i,a)=>{if("function"==typeof l){const{rowSpan:r,colSpan:l}=n(e,i,t,a,s);(l>1||r>1)&&b.push({s:{r:t+x,c:a},e:{r:t+x+r-1,c:a+l-1}})}const o=["percent","finance"].includes(i.formatType);r[i.dataIndex]=o?ga(e,i.dataIndex):d(e,t,i,a)})),r._level=e._level,r}));x+=w.length,r&&p&&c(h,s).forEach(((e,t)=>{const n={};h.forEach(((t,r)=>{const{dataIndex:i,summation:l}=t,a=(null==l?void 0:l.render)?l.render(s):ga(e,i);n[i]=0===r&&""===a?o("qm.table.config.summaryText"):jn(a)?Na(a).join(""):a})),v.push(n)}));const{sheetName:C,useStyle:S}=t,N=new Xt.Workbook,T=N.addWorksheet(C);T.columns=y,a&&T.addRows(g).forEach((e=>{S&&fs(e,m),e.eachCell((e=>{const t=T.getColumn(e.col),n=ra(u,t.key),{align:r,theadAlign:i}=n;gs(e,i||r),S&&Object.assign(e,{font:{bold:!0,color:{argb:ps}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:vs()})}))})),T.addRows(w).forEach(((e,t)=>{const{_level:n}=w[t];S&&fs(e,m),e.eachCell((e=>{const t=T.getColumn(e.col),r=ra(u,t.key),{align:i}=r;gs(e,i),Object.assign(e,bs(r)),S&&Object.assign(e,{font:{color:{argb:ps}},border:vs()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),r&&p&&T.addRows(v).forEach((e=>{S&&fs(e,m),e.eachCell((e=>{const t=T.getColumn(e.col),n=ra(u,t.key),{align:r}=n;gs(e,r),Object.assign(e,bs(n)),S&&Object.assign(e,{font:{color:{argb:ps}},border:vs()})}))})),b.forEach((({s:e,e:t})=>{T.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const I=yield N.xlsx.writeBuffer();return new Blob([I],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const n=e=>{let t=e;const n=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),r=-1!==e.indexOf('"');return r&&(t=t.replace(/"/g,'""')),(n||r)&&(t='"'+t+'"'),t},r="\ufeff"+(e=>{let t,r,i,l,a="";for(t=0;t<e.rows.length;t+=1){for(i=e.rows[t],r=0;r<i.cells.length;r+=1)l=i.cells[r],a=a+(r?",":"")+n(l.textContent.trim());a+="\r\n"}return a})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var i;return((e,t,n)=>{t=t||"",n=n||512;const r=window.atob(e),i=[];let l;for(l=0;l<r.length;l+=n){const e=r.slice(l,l+n),t=new Array(e.length);let a;for(a=0;a<e.length;a+=1)t[a]=e.charCodeAt(a);const o=new window.Uint8Array(t);i.push(o)}return new window.Blob(i,{type:t})})((i=r,window.btoa(unescape(encodeURIComponent(i)))),"application/csv")},importXLSX:(e,t)=>{const{columns:n,file:r}=e,i=Jl(n),l=new FileReader;l.onerror=()=>{R.error(o("qm.table.import.error"))},l.onload=e=>{const n=i.map((e=>Ta(e.title))),r=new Xt.Workbook,l=e.target;l?r.xlsx.load(l.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),l=e.findIndex((e=>e&&e.length>0)),a=e[l],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,a);if(c){const r=e.slice(l+1).map((e=>{const t={};e.forEach(((e,n)=>{var r;let i=e;Array.isArray(null==i?void 0:i.richText)&&(i=i.richText.map((e=>e.text)).join("")),ae(i)&&"text"in i&&(i=i.text),Ce(i)&&(i=Ca(i,Vo)),(null==i?void 0:i.formula)&&(i=null!==(r=i.result)&&void 0!==r?r:i.value),t[a[n]]=i}));const r={};return n.forEach(((e,n)=>{var l;const{dataIndex:a,dictItems:o}=i[n];Array.isArray(o)&&((null===(l=t[e])||void 0===l?void 0:l.toString().includes(","))?t[e]=t[e].split(",").map((e=>s(o,e))).filter((e=>""!==e)):t[e]=s(o,t[e])),va(r,a,t[e])})),r}));null==t||t(r)}else R.error(o("qm.table.import.error"))}else R.error(o("qm.table.import.error"))})):R.error(o("qm.table.import.error"))},l.readAsArrayBuffer(r)}}},Es=e=>{const{fileType:n,onChange:r}=e,{prefixCls:i}=t.useContext(Ho),{t:l}=Fn();let a,o;const s=e=>{const t=e.name,n=t.lastIndexOf("."),r=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:r}},c=()=>Hn(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return a||(a=document.createElement("form"),o=document.createElement("input"),a.className=`${i}--file-form`,o.name="file",o.type="file",a.appendChild(o),document.body.appendChild(a)),new Promise(((e,n)=>{const r=!t.type;o.multiple=!!t.multiple,o.accept=r?"":`.${t.type}`,o.onchange=i=>{const{files:c}=i.target,d=c[0];let u="";if(!r)for(let e=0;e<c.length;e++){const{type:n}=s(c[e]);if(t.type!==n){u=n;break}}u?(R.warning(l("qm.upload.notType",{type:u})),n()):e(d),document.body.removeChild(a),a=null,o=null},a.reset(),o.click()}))})({type:n});null==r||r(e.name,e)}catch(e){}}));return t.createElement(nr,{onClick:()=>c()},l("qm.upload.text"))},ws=e=>{const{columns:n,onClose:r}=e,{tableRef:i,prefixCls:l,createTableData:a,dataChange:o}=t.useContext(Ho),{beforeTableImport:s}=i.current.props,{t:c}=Fn(),{importXLSX:d}=xs(),u=t.useRef(null),[p,m]=t.useState(!1),[h,f]=t.useState(!0),g=e=>e.filter((e=>![Jo.expandableColumn,Jo.selectionColumn,"index","pageIndex",Jo.operationColumn].includes(e.dataIndex))),v={posIndex:"条"},[y,b]=t.useState([{type:"INPUT",label:c("qm.table.export.fileName"),fieldName:"fileName",render:(e,n)=>{const{fileName:r}=n.GET_FIELDS_VALUE(["fileName"]);return t.createElement(t.Fragment,null,r?t.createElement("span",null,r):t.createElement(Es,{fileType:n.state.formData.fileType,onChange:(e,t)=>{n.SET_FIELDS_VALUE({fileName:e,file:t}),t&&f(!1)}}))}},{type:"SELECT",label:c("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:c("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:c("qm.table.import.fillText"),value:"fill"},{text:c("qm.table.import.addText"),value:"add"},{text:c("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{y.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&u.current.SET_FIELDS_EXTRA(v),b([...y])}},{type:"INPUT_NUMBER",label:c("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:i.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]);return t.createElement("div",{className:`${l}-import__setting`},t.createElement(oh,{ref:u,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:v,items:y,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r(),style:{marginRight:8}},c("qm.table.export.closeButton")),t.createElement(nr,{type:"primary",loading:p,disabled:h,onClick:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();e||(m(!0),d({columns:g(n),file:t.file},(e=>Hn(void 0,void 0,void 0,(function*(){const{tableFullData:n,store:l}=i.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof s)try{e=yield s(e)}catch(e){}if("fill"===t.importType&&a(e),"add"===t.importType&&a([...n,...e]),"insert"===t.importType){const r=t.posIndex,i=n.slice(0,r).concat(e).concat(n.slice(r));a(i)}e.forEach((e=>{l.addToInserted(e)})),o(),R.success(c("qm.table.import.success",{total:e.length})),m(!1),r()})))))}))},c("qm.table.import.text"))))},Cs=t.forwardRef(((e,n)=>{const{tableColumns:r,open:i=!0}=e,{prefixCls:l}=t.useContext(Ho),{t:a}=Fn(),[o,s]=t.useState(!1),c=()=>{s(!0)};t.useImperativeHandle(n,(()=>({clickHandle:c})));const d={[`${l}-import`]:!0},u={visible:o,title:a("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>s(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:Pe(d),title:a("qm.table.import.textNoSpace"),onClick:()=>c()},t.createElement("i",{className:"svgicon icon"},t.createElement(Xe,null))),t.createElement(Fl,u,t.createElement(ws,{columns:r,onClose:()=>s(!1)})))}));function Ss(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function Ns(e,t,n,r){var i=Ft.unstable_batchedUpdates?function(e){Ft.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,i,r)}}}Cs.displayName="TableImport";var Ts=u((function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,a=l(),s=l();p(t,(function(){return{}}));var c=l(!1);return!c.current&&Gr()&&(s.current=r(),a.current=s.current.parentNode,c.current=!0),o((function(){null==n||n(e)})),o((function(){return null===s.current.parentNode&&null!==a.current&&a.current.appendChild(s.current),function(){var e;null===(e=s.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(s.current)}}),[]),s.current?Ft.createPortal(i,s.current):null}));function Is(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Rs;function Os(e){var t=e.prefixCls,n=e.motion,r=e.animation,i=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:i?{motionName:i}:null)}function ks(t){var n=t.prefixCls,r=t.visible,i=t.zIndex,l=t.mask,a=t.maskMotion,o=t.maskAnimation,s=t.maskTransitionName;if(!l)return null;var c={};return(a||s||o)&&(c=fr({motionAppear:!0},Os({motion:a,prefixCls:n,transitionName:s,animation:o}))),e.createElement(Si,Ni({},c,{visible:r,removeOnLeave:!0}),(function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:Pe("".concat(n,"-mask"),r)})}))}function Ls(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function As(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ls(Object(n),!0).forEach((function(t){_s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ls(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ps(e){return Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ps(e)}function _s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ds={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Hs(){if(void 0!==Rs)return Rs;Rs="";var e=document.createElement("p").style;for(var t in Ds)t+"Transform"in e&&(Rs=t);return Rs}function Fs(){return Hs()?"".concat(Hs(),"TransitionProperty"):"transitionProperty"}function Ms(){return Hs()?"".concat(Hs(),"Transform"):"transform"}function $s(e,t){var n=Fs();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function qs(e,t){var n=Ms();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var js,Ks=/matrix\((.*)\)/,Vs=/matrix3d\((.*)\)/;function zs(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Ws(e,t,n){var r=n;if("object"!==Ps(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):js(e,t);for(var i in t)t.hasOwnProperty(i)&&Ws(e,i,t[i])}function Bs(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}function Us(e){return Bs(e)}function Gs(e){return Bs(e,!0)}function Ys(e){var t=function(e){var t,n,r,i=e.ownerDocument,l=i.body,a=i&&i.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),r=Math.floor(t.top),{left:n-=a.clientLeft||l.clientLeft||0,top:r-=a.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=Us(r),t.top+=Gs(r),t}function Xs(e){return null!=e&&e==e.window}function Qs(e){return Xs(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Zs=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Js=/^(top|right|bottom|left)$/,ec="currentStyle",tc="runtimeStyle",nc="left";function rc(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function ic(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function lc(e,t,n){"static"===Ws(e,"position")&&(e.style.position="relative");var r=-999,i=-999,l=rc("left",n),a=rc("top",n),o=ic(l),s=ic(a);"left"!==l&&(r=999),"top"!==a&&(i=999);var c,d="",u=Ys(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[Fs()]||"",$s(e,"none")),"left"in t&&(e.style[o]="",e.style[l]="".concat(r,"px")),"top"in t&&(e.style[s]="",e.style[a]="".concat(i,"px")),zs(e);var p=Ys(e),m={};for(var h in t)if(t.hasOwnProperty(h)){var f=rc(h,n),g="left"===h?r:i,v=u[h]-p[h];m[f]=f===h?g+v:g-v}Ws(e,m),zs(e),("left"in t||"top"in t)&&$s(e,d);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=rc(b,n),E=t[b]-u[b];y[x]=b===x?m[x]+E:m[x]-E}Ws(e,y)}function ac(e,t){var n=Ys(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue(Ms());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(e),i={x:r.x,y:r.y};"left"in t&&(i.x=r.x+t.left-n.left),"top"in t&&(i.y=r.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue(Ms());if(r&&"none"!==r){var i,l=r.match(Ks);l?((i=(l=l[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,qs(e,"matrix(".concat(i.join(","),")"))):((i=r.match(Vs)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,qs(e,"matrix3d(".concat(i.join(","),")")))}else qs(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function oc(e,t){for(var n=0;n<e.length;n++)t(e[n])}function sc(e){return"border-box"===js(e,"boxSizing")}"undefined"!=typeof window&&(js=window.getComputedStyle?function(e,t,n){var r=n,i="",l=Qs(e);return(r=r||l.defaultView.getComputedStyle(e,null))&&(i=r.getPropertyValue(t)||r[t]),i}:function(e,t){var n=e[ec]&&e[ec][t];if(Zs.test(n)&&!Js.test(t)){var r=e.style,i=r[nc],l=e[tc][nc];e[tc][nc]=e[ec][nc],r[nc]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[nc]=i,e[tc][nc]=l}return""===n?"auto":n});var cc=["margin","border","padding"],dc=-1,uc=2,pc=1;function mc(e,t,n){var r,i,l,a=0;for(i=0;i<t.length;i++)if(r=t[i])for(l=0;l<n.length;l++){var o=void 0;o="border"===r?"".concat(r).concat(n[l],"Width"):r+n[l],a+=parseFloat(js(e,o))||0}return a}var hc={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function fc(e,t,n){var r=n;if(Xs(e))return"width"===t?hc.viewportWidth(e):hc.viewportHeight(e);if(9===e.nodeType)return"width"===t?hc.docWidth(e):hc.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],l="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),a=sc(e),o=0;(null==l||l<=0)&&(l=void 0,(null==(o=js(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===r&&(r=a?pc:dc);var s=void 0!==l||a,c=l||o;return r===dc?s?c-mc(e,["border","padding"],i):o:s?r===pc?c:c+(r===uc?-mc(e,["border"],i):mc(e,["margin"],i)):o+mc(e,cc.slice(r),i)}oc(["Width","Height"],(function(e){hc["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],hc["viewport".concat(e)](n))},hc["viewport".concat(e)]=function(t){var n="client".concat(e),r=t.document,i=r.body,l=r.documentElement[n];return"CSS1Compat"===r.compatMode&&l||i&&i[n]||l}}));var gc={position:"absolute",visibility:"hidden",display:"block"};function vc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0];return 0!==i.offsetWidth?r=fc.apply(void 0,t):function(e,t,n){var r,i={},l=e.style;for(r in t)t.hasOwnProperty(r)&&(i[r]=l[r],l[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(l[r]=i[r])}(i,gc,(function(){r=fc.apply(void 0,t)})),r}function yc(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}oc(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);hc["outer".concat(t)]=function(t,n){return t&&vc(t,e,n?0:pc)};var n="width"===e?["Left","Right"]:["Top","Bottom"];hc[e]=function(t,r){var i=r;return void 0!==i?t?(sc(t)&&(i+=mc(t,["padding","border"],n)),Ws(t,e,i)):void 0:t&&vc(t,e,dc)}}));var bc={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Qs,offset:function(e,t,n){if(void 0===t)return Ys(e);!function(e,t,n){if(n.ignoreShake){var r=Ys(e),i=r.left.toFixed(0),l=r.top.toFixed(0),a=t.left.toFixed(0),o=t.top.toFixed(0);if(i===a&&l===o)return}n.useCssRight||n.useCssBottom?lc(e,t,n):n.useCssTransform&&Ms()in document.body.style?ac(e,t):lc(e,t,n)}(e,t,n||{})},isWindow:Xs,each:oc,css:Ws,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:yc,getWindowScrollLeft:function(e){return Us(e)},getWindowScrollTop:function(e){return Gs(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)bc.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};yc(bc,hc);var xc=bc.getParent;function Ec(e){if(bc.isWindow(e)||9===e.nodeType)return null;var t,n=bc.getDocument(e).body,r=bc.css(e,"position");if(!("fixed"===r||"absolute"===r))return"html"===e.nodeName.toLowerCase()?null:xc(e);for(t=xc(e);t&&t!==n&&9!==t.nodeType;t=xc(t))if("static"!==(r=bc.css(t,"position")))return t;return null}var wc=bc.getParent;function Cc(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=Ec(e),i=bc.getDocument(e),l=i.defaultView||i.parentWindow,a=i.body,o=i.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===a||r===o||"visible"===bc.css(r,"overflow")){if(r===a||r===o)break}else{var s=bc.offset(r);s.left+=r.clientLeft,s.top+=r.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+r.clientWidth),n.bottom=Math.min(n.bottom,s.top+r.clientHeight),n.left=Math.max(n.left,s.left)}r=Ec(r)}var c=null;bc.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===bc.css(e,"position")&&(e.style.position="fixed"));var d=bc.getWindowScrollLeft(l),u=bc.getWindowScrollTop(l),p=bc.viewportWidth(l),m=bc.viewportHeight(l),h=o.scrollWidth,f=o.scrollHeight,g=window.getComputedStyle(a);if("hidden"===g.overflowX&&(h=l.innerWidth),"hidden"===g.overflowY&&(f=l.innerHeight),e.style&&(e.style.position=c),t||function(e){if(bc.isWindow(e)||9===e.nodeType)return!1;var t=bc.getDocument(e),n=t.body,r=null;for(r=wc(e);r&&r!==n&&r!==t;r=wc(r))if("fixed"===bc.css(r,"position"))return!0;return!1}(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,u),n.right=Math.min(n.right,d+p),n.bottom=Math.min(n.bottom,u+m);else{var v=Math.max(h,d+p);n.right=Math.min(n.right,v);var y=Math.max(f,u+m);n.bottom=Math.min(n.bottom,y)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Sc(e){var t,n,r;if(bc.isWindow(e)||9===e.nodeType){var i=bc.getWindow(e);t={left:bc.getWindowScrollLeft(i),top:bc.getWindowScrollTop(i)},n=bc.viewportWidth(i),r=bc.viewportHeight(i)}else t=bc.offset(e),n=bc.outerWidth(e),r=bc.outerHeight(e);return t.width=n,t.height=r,t}function Nc(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,l=e.height,a=e.left,o=e.top;return"c"===n?o+=l/2:"b"===n&&(o+=l),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:o}}function Tc(e,t,n,r,i){var l=Nc(t,n[1]),a=Nc(e,n[0]),o=[a.left-l.left,a.top-l.top];return{left:Math.round(e.left-o[0]+r[0]-i[0]),top:Math.round(e.top-o[1]+r[1]-i[1])}}function Ic(e,t,n){return e.left<n.left||e.left+t.width>n.right}function Rc(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function Oc(e,t,n){var r=[];return bc.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function kc(e,t){return e[t]=-e[t],e}function Lc(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Ac(e,t){e[0]=Lc(e[0],t.width),e[1]=Lc(e[1],t.height)}function Pc(e,t,n,r){var i=n.points,l=n.offset||[0,0],a=n.targetOffset||[0,0],o=n.overflow,s=n.source||e;l=[].concat(l),a=[].concat(a);var c={},d=0,u=Cc(s,!(!(o=o||{})||!o.alwaysByViewport)),p=Sc(s);Ac(l,p),Ac(a,t);var m=Tc(p,t,i,l,a),h=bc.merge(p,m);if(u&&(o.adjustX||o.adjustY)&&r){if(o.adjustX&&Ic(m,p,u)){var f=Oc(i,/[lr]/gi,{l:"r",r:"l"}),g=kc(l,0),v=kc(a,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(Tc(p,t,f,g,v),p,u)||(d=1,i=f,l=g,a=v)}if(o.adjustY&&Rc(m,p,u)){var y=Oc(i,/[tb]/gi,{t:"b",b:"t"}),b=kc(l,1),x=kc(a,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(Tc(p,t,y,b,x),p,u)||(d=1,i=y,l=b,a=x)}d&&(m=Tc(p,t,i,l,a),bc.mix(h,m));var E=Ic(m,p,u),w=Rc(m,p,u);if(E||w){var C=i;E&&(C=Oc(i,/[lr]/gi,{l:"r",r:"l"})),w&&(C=Oc(i,/[tb]/gi,{t:"b",b:"t"})),i=C,l=n.offset||[0,0],a=n.targetOffset||[0,0]}c.adjustX=o.adjustX&&E,c.adjustY=o.adjustY&&w,(c.adjustX||c.adjustY)&&(h=function(e,t,n,r){var i=bc.clone(e),l={width:t.width,height:t.height};return r.adjustX&&i.left<n.left&&(i.left=n.left),r.resizeWidth&&i.left>=n.left&&i.left+l.width>n.right&&(l.width-=i.left+l.width-n.right),r.adjustX&&i.left+l.width>n.right&&(i.left=Math.max(n.right-l.width,n.left)),r.adjustY&&i.top<n.top&&(i.top=n.top),r.resizeHeight&&i.top>=n.top&&i.top+l.height>n.bottom&&(l.height-=i.top+l.height-n.bottom),r.adjustY&&i.top+l.height>n.bottom&&(i.top=Math.max(n.bottom-l.height,n.top)),bc.mix(i,l)}(m,p,u,c))}return h.width!==p.width&&bc.css(s,"width",bc.width(s)+h.width-p.width),h.height!==p.height&&bc.css(s,"height",bc.height(s)+h.height-p.height),bc.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:l,targetOffset:a,overflow:c}}function _c(e,t,n){var r=n.target||t,i=Sc(r),l=!function(e,t){var n=Cc(e,t),r=Sc(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return Pc(e,i,n,l)}_c.__getOffsetParent=Ec,_c.__getVisibleRectForElement=Cc;var Dc=Gr()?e.useLayoutEffect:e.useEffect,Hc=function(t,n){var r=e.useRef(!0);Dc((function(){return t(r.current)}),n),Dc((function(){return r.current=!1,function(){r.current=!0}}),[])};function Fc(e,t){var n=null,r=null;var i=new qt((function(e){var i=vr(e,1)[0].target;if(document.documentElement.contains(i)){var l=i.getBoundingClientRect(),a=l.width,o=l.height,s=Math.floor(a),c=Math.floor(o);n===s&&r===c||Promise.resolve().then((function(){t({width:s,height:c})})),n=s,r=c}}));return e&&i.observe(e),function(){i.disconnect()}}function Mc(e){return"function"!=typeof e?null:e()}function $c(e){return"object"===ur(e)&&e?e:null}var qc=function(e,n){var r=e.children,i=e.disabled,l=e.target,a=e.align,o=e.onAlign,s=e.monitorWindowResize,c=e.monitorBufferTime,d=void 0===c?0:c,u=t.useRef({}),p=t.useRef(),m=t.Children.only(r),h=t.useRef({});h.current.disabled=i,h.current.target=l,h.current.align=a,h.current.onAlign=o;var f=function(e,n){var r=t.useRef(!1),i=t.useRef(null);function l(){window.clearTimeout(i.current)}return[function t(a){if(l(),r.current&&!0!==a)i.current=window.setTimeout((function(){r.current=!1,t()}),n);else{if(!1===e(a))return;r.current=!0,i.current=window.setTimeout((function(){r.current=!1}),n)}},function(){r.current=!1,l()}]}((function(){var e=h.current,t=e.disabled,n=e.target,r=e.align,i=e.onAlign,l=p.current;if(!t&&n&&l){var a,o=Mc(n),s=$c(n);u.current.element=o,u.current.point=s,u.current.align=r;var c=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),l=i.width,a=i.height;if(l||a)return!0}}return!1}(o)?a=_c(l,o,r):s&&(a=function(e,t,n){var r,i,l=bc.getDocument(e),a=l.defaultView||l.parentWindow,o=bc.getWindowScrollLeft(a),s=bc.getWindowScrollTop(a),c=bc.viewportWidth(a),d=bc.viewportHeight(a),u={left:r="pageX"in t?t.pageX:o+t.clientX,top:i="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=o+c&&i>=0&&i<=s+d,m=[n.points[0],"cc"];return Pc(e,u,As(As({},n),{},{points:m}),p)}(l,s,r)),function(e,t){e!==document.activeElement&&Ss(t,e)&&"function"==typeof e.focus&&e.focus()}(c,l),i&&a&&i(l,a),!0}return!1}),d),g=vr(f,2),v=g[0],y=g[1],b=vr(t.useState(),2),x=b[0],E=b[1],w=vr(t.useState(),2),C=w[0],S=w[1];return Hc((function(){E(Mc(l)),S($c(l))})),t.useEffect((function(){var e,t;u.current.element===x&&((e=u.current.point)===(t=C)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(t);if(xn(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(n&&l>1)return!1;r.add(t);var o=l+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],i[s],o))return!1;return!0}if(t&&i&&"object"===ur(t)&&"object"===ur(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every((function(n){return e(t[n],i[n],o)}))}return!1}(e,t)}(u.current.align,a)||v()})),t.useEffect((function(){return Fc(p.current,v)}),[p.current]),t.useEffect((function(){return Fc(x,v)}),[x]),t.useEffect((function(){i?y():v()}),[i]),t.useEffect((function(){if(s)return Ns(window,"resize",v).remove}),[s]),t.useEffect((function(){return function(){y()}}),[]),t.useImperativeHandle(n,(function(){return{forceAlign:function(){return v(!0)}}})),t.isValidElement(m)&&(m=t.cloneElement(m,{ref:Sr(m.ref,p)})),m},jc=t.forwardRef(qc);function Kc(){Kc=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var l=t&&t.prototype instanceof p?t:p,a=Object.create(l.prototype),o=new N(i||[]);return r(a,"_invoke",{value:E(e,n,o)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function m(){}function h(){}var f={};s(f,l,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==t&&n.call(v,l)&&(f=v);var y=h.prototype=p.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,l,a,o){var s=d(e[r],e,l);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==ur(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,o)}))}o(s.arg)}var l;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return l=l?l.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(i,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw l;return I()}for(n.method=i,n.arg=l;;){var a=n.delegate;if(a){var o=w(a,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=d(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function w(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var l=i.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return m.prototype=h,r(y,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:m,configurable:!0}),m.displayName=s(h,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,l){void 0===l&&(l=Promise);var a=new x(c(t,n,r,i),l);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),s(y,o,"Generator"),s(y,l,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=T,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],a=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var o=n.call(l,"catchLoc"),s=n.call(l,"finallyLoc");if(o&&s){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(o){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return r(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var l=i;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var a=l?l.completion:{};return a.type=e,a.arg=t,l?(this.method="next",this.next=l.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Vc(e,t,n,r,i,l,a){try{var o=e[l](a),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,i)}function zc(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var l=e.apply(t,n);function a(e){Vc(l,r,i,a,o,"next",e)}function o(e){Vc(l,r,i,a,o,"throw",e)}a(void 0)}))}}jc.displayName="Align";var Wc=["measure","alignPre","align",null,"motion"],Bc=e.forwardRef((function(t,n){var r=t.visible,i=t.prefixCls,a=t.className,c=t.style,d=t.children,u=t.zIndex,p=t.stretch,m=t.destroyPopupOnHide,h=t.forceRender,f=t.align,g=t.point,v=t.getRootDomNode,y=t.getClassNameFromAlign,b=t.onAlign,x=t.onMouseEnter,E=t.onMouseLeave,w=t.onMouseDown,C=t.onTouchStart,S=t.onClick,N=l(),T=l(),I=vr(s(),2),R=I[0],O=I[1],k=function(t){var n=vr(e.useState({width:0,height:0}),2),r=n[0],i=n[1];return[e.useMemo((function(){var e={};if(t){var n=r.width,i=r.height;-1!==t.indexOf("height")&&i?e.height=i:-1!==t.indexOf("minHeight")&&i&&(e.minHeight=i),-1!==t.indexOf("width")&&n?e.width=n:-1!==t.indexOf("minWidth")&&n&&(e.minWidth=n)}return e}),[t,r]),function(e){var t=e.offsetWidth,n=e.offsetHeight,r=e.getBoundingClientRect(),l=r.width,a=r.height;Math.abs(t-l)<1&&Math.abs(n-a)<1&&(t=l,n=a),i({width:t,height:n})}]}(p),L=vr(k,2),A=L[0],P=L[1];var _=function(e,t){var n=vr(Fr(null),2),r=n[0],i=n[1],a=l();function s(e){i(e,!0)}function c(){vi.cancel(a.current)}return o((function(){s("measure")}),[e]),o((function(){"measure"===r&&t(),r&&(a.current=vi(zc(Kc().mark((function e(){var t,n;return Kc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Wc.indexOf(r),(n=Wc[t+1])&&-1!==t&&s(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),o((function(){return function(){c()}}),[]),[r,function(e){c(),a.current=vi((function(){s((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r,(function(){p&&P(v())})),D=vr(_,2),H=D[0],F=D[1],M=vr(s(0),2),$=M[0],q=M[1],j=l();function K(){var e;null===(e=N.current)||void 0===e||e.forceAlign()}function V(e,t){var n=y(t);R!==n&&O(n),q((function(e){return e+1})),"align"===H&&(null==b||b(e,t))}Hc((function(){"alignPre"===H&&q(0)}),[H]),Hc((function(){"align"===H&&($<3?K():F((function(){var e;null===(e=j.current)||void 0===e||e.call(j)})))}),[$]);var z=fr({},Os(t));function W(){return new Promise((function(e){j.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=z[e];z[e]=function(e,n){return F(),null==t?void 0:t(e,n)}})),e.useEffect((function(){z.motionName||"motion"!==H||F()}),[z.motionName,H]),e.useImperativeHandle(n,(function(){return{forceAlign:K,getElement:function(){return T.current}}}));var B=fr(fr({},A),{},{zIndex:u,opacity:"motion"!==H&&"stable"!==H&&r?0:void 0,pointerEvents:r||"stable"===H?void 0:"none"},c),U=!0;null==f||!f.points||"align"!==H&&"stable"!==H||(U=!1);var G=d;return e.Children.count(d)>1&&(G=e.createElement("div",{className:"".concat(i,"-content")},d)),e.createElement(Si,Ni({visible:r,ref:T,leavedClassName:"".concat(i,"-hidden")},z,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:m,forceRender:h}),(function(t,n){var r=t.className,l=t.style,o=Pe(i,a,R,r);return e.createElement(jc,{target:g||v,key:"popup",ref:N,monitorWindowResize:!0,disabled:U,align:f,onAlign:V},e.createElement("div",{ref:n,className:o,onMouseEnter:x,onMouseLeave:E,onMouseDownCapture:w,onTouchStartCapture:C,onClick:S,style:fr(fr({},l),B)},G))}))}));Bc.displayName="PopupInner";var Uc=e.forwardRef((function(t,n){var r=t.prefixCls,i=t.visible,l=t.zIndex,a=t.children,o=t.mobile,s=(o=void 0===o?{}:o).popupClassName,c=o.popupStyle,d=o.popupMotion,u=void 0===d?{}:d,p=o.popupRender,m=t.onClick,h=e.useRef();e.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return h.current}}}));var f=fr({zIndex:l},c),g=a;return e.Children.count(a)>1&&(g=e.createElement("div",{className:"".concat(r,"-content")},a)),p&&(g=p(g)),e.createElement(Si,Ni({visible:i,ref:h,removeOnLeave:!0},u),(function(t,n){var i=t.className,l=t.style,a=Pe(r,s,i);return e.createElement("div",{ref:n,className:a,onClick:m,style:fr(fr({},l),f)},g)}))}));Uc.displayName="MobilePopupInner";var Gc=["visible","mobile"],Yc=e.forwardRef((function(t,n){var r=t.visible,i=t.mobile,l=Tr(t,Gc),a=vr(s(r),2),c=a[0],d=a[1],u=vr(s(!1),2),p=u[0],m=u[1],h=fr(fr({},l),{},{visible:c});o((function(){d(r),r&&i&&m(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|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|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[r,i]);var f=p?e.createElement(Uc,Ni({},h,{mobile:i,ref:n})):e.createElement(Bc,Ni({},h,{ref:n}));return e.createElement("div",null,e.createElement(ks,h),f)}));Yc.displayName="Popup";var Xc=e.createContext(null);function Qc(){}function Zc(){return""}function Jc(e){return e?e.ownerDocument:window.document}var ed=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var td=function(t){var n=function(n){Ar(i,e.Component);var r=Dr(i);function i(t){var n,l;return Rr(this,i),mr(_r(n=r.call(this,t)),"popupRef",e.createRef()),mr(_r(n),"triggerRef",e.createRef()),mr(_r(n),"portalContainer",void 0),mr(_r(n),"attachId",void 0),mr(_r(n),"clickOutsideHandler",void 0),mr(_r(n),"touchOutsideHandler",void 0),mr(_r(n),"contextMenuOutsideHandler1",void 0),mr(_r(n),"contextMenuOutsideHandler2",void 0),mr(_r(n),"mouseDownTimeout",void 0),mr(_r(n),"focusTime",void 0),mr(_r(n),"preClickTime",void 0),mr(_r(n),"preTouchTime",void 0),mr(_r(n),"delayTimer",void 0),mr(_r(n),"hasPopupMouseDown",void 0),mr(_r(n),"onMouseEnter",(function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)})),mr(_r(n),"onMouseMove",(function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)})),mr(_r(n),"onMouseLeave",(function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),mr(_r(n),"onPopupMouseEnter",(function(){n.clearDelayTimer()})),mr(_r(n),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&Ss(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),mr(_r(n),"onFocus",(function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))})),mr(_r(n),"onMouseDown",(function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()})),mr(_r(n),"onTouchStart",(function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()})),mr(_r(n),"onBlur",(function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)})),mr(_r(n),"onContextMenu",(function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)})),mr(_r(n),"onContextMenuClose",(function(){n.isContextMenuToShow()&&n.close()})),mr(_r(n),"onClick",(function(e){if(n.fireEvents("onClick",e),n.focusTime){var t;if(n.preClickTime&&n.preTouchTime?t=Math.min(n.preClickTime,n.preTouchTime):n.preClickTime?t=n.preClickTime:n.preTouchTime&&(t=n.preTouchTime),Math.abs(t-n.focusTime)<20)return;n.focusTime=0}n.preClickTime=0,n.preTouchTime=0,n.isClickToShow()&&(n.isClickToHide()||n.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!n.state.popupVisible;(n.isClickToHide()&&!r||r&&n.isClickToShow())&&n.setPopupVisible(!n.state.popupVisible,e)})),mr(_r(n),"onPopupMouseDown",(function(){var e;(n.hasPopupMouseDown=!0,clearTimeout(n.mouseDownTimeout),n.mouseDownTimeout=window.setTimeout((function(){n.hasPopupMouseDown=!1}),0),n.context)&&(e=n.context).onPopupMouseDown.apply(e,arguments)})),mr(_r(n),"onDocumentClick",(function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),i=n.getPopupDomNode();Ss(r,t)&&!n.isContextMenuOnly()||Ss(i,t)||n.hasPopupMouseDown||n.close()}})),mr(_r(n),"getRootDomNode",(function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=br(n.triggerRef.current);if(t)return t}catch(e){}return Ft.findDOMNode(_r(n))})),mr(_r(n),"getPopupClassNameFromAlign",(function(e){var t=[],r=n.props,i=r.popupPlacement,l=r.builtinPlacements,a=r.prefixCls,o=r.alignPoint,s=r.getPopupClassNameFromAlign;return i&&l&&t.push(function(e,t,n,r){for(var i=n.points,l=Object.keys(e),a=0;a<l.length;a+=1){var o=l[a];if(Is(e[o].points,i,r))return"".concat(t,"-placement-").concat(o)}return""}(l,a,e,o)),s&&t.push(s(e)),t.join(" ")})),mr(_r(n),"getComponent",(function(){var t=n.props,r=t.prefixCls,i=t.destroyPopupOnHide,l=t.popupClassName,a=t.onPopupAlign,o=t.popupMotion,s=t.popupAnimation,c=t.popupTransitionName,d=t.popupStyle,u=t.mask,p=t.maskAnimation,m=t.maskTransitionName,h=t.maskMotion,f=t.zIndex,g=t.popup,v=t.stretch,y=t.alignPoint,b=t.mobile,x=t.forceRender,E=t.onPopupClick,w=n.state,C=w.popupVisible,S=w.point,N=n.getPopupAlign(),T={};return n.isMouseEnterToShow()&&(T.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(T.onMouseLeave=n.onPopupMouseLeave),T.onMouseDown=n.onPopupMouseDown,T.onTouchStart=n.onPopupMouseDown,e.createElement(Yc,Ni({prefixCls:r,destroyPopupOnHide:i,visible:C,point:y&&S,className:l,align:N,onAlign:a,animation:s,getClassNameFromAlign:n.getPopupClassNameFromAlign},T,{stretch:v,getRootDomNode:n.getRootDomNode,style:d,mask:u,zIndex:f,transitionName:c,maskAnimation:p,maskTransitionName:m,maskMotion:h,ref:n.popupRef,motion:o,mobile:b,forceRender:x,onClick:E}),"function"==typeof g?g():g)})),mr(_r(n),"attachParent",(function(e){vi.cancel(n.attachId);var t,r=n.props,i=r.getPopupContainer,l=r.getDocument,a=n.getRootDomNode();i?(a||0===i.length)&&(t=i(a)):t=l(n.getRootDomNode()).body,t?t.appendChild(e):n.attachId=vi((function(){n.attachParent(e)}))})),mr(_r(n),"getContainer",(function(){if(!n.portalContainer){var e=(0,n.props.getDocument)(n.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",n.portalContainer=e}return n.attachParent(n.portalContainer),n.portalContainer})),mr(_r(n),"setPoint",(function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),mr(_r(n),"handlePortalUpdate",(function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)})),mr(_r(n),"triggerContextValue",{onPopupMouseDown:n.onPopupMouseDown}),l="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,n.state={prevPopupVisible:l,popupVisible:l},ed.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),n}return kr(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Ns(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Ns(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Ns(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Ns(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),vi.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?function(e,t,n){return fr(fr({},e[t]||{}),n)}(r,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:r}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var r=this,i=1e3*t;if(this.clearDelayTimer(),i){var l=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(e,l),r.clearDelayTimer()}),i)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var n=this.state.popupVisible,r=this.props,i=r.children,l=r.forceRender,a=r.alignPoint,o=r.className,s=r.autoDestroy,c=e.Children.only(i),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,a&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=Pe(c&&c.props&&c.props.className,o);u&&(d.className=u);var p=fr({},d);Nr(c)&&(p.ref=Sr(this.triggerRef,c.ref));var m,h=e.cloneElement(c,p);return(n||this.popupRef.current||l)&&(m=e.createElement(t,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!n&&s&&(m=null),e.createElement(Xc.Provider,{value:this.triggerContextValue},h,m)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,r={};return void 0!==n&&t.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=t.popupVisible),r}}]),i}();return mr(n,"contextType",Xc),mr(n,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Zc,getDocument:Jc,onPopupVisibleChange:Qc,afterPopupVisibleChange:Qc,onPopupAlign:Qc,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),n}(Ts);const nd=e=>{const{columns:n,onChange:r}=e,{prefixCls:i,$size:l}=t.useContext(Ho),{t:a}=Fn(),o=t.useRef([]),[s,c]=t.useState(!1),[d,u]=t.useState(n);Mi((()=>{m()}),[d]),t.useEffect((()=>{p()}),[n]);const p=()=>{const e=[];n.forEach(((t,r)=>{const i=t.colSpan;i>1&&n.slice(r+1,r+i).every((({colSpan:e})=>0===e))&&e.push(n.slice(r,r+i))})),o.current=e},m=()=>{const e=[];d.forEach((t=>{const{colSpan:n,dataIndex:r}=t;if(0===n)return;if(1===n)return e.push(t);const i=o.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===i)return e.push(t);e.push(...o.current[i].map((({dataIndex:e},n)=>{const r=d.find((t=>t.dataIndex===e));return n>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==r||r(e)},h={[`${i}__popper`]:!0,"column-filter__popper":!0,[`${i}--lg`]:"large"===l,[`${i}--sm`]:"small"===l},f=[`${i}-column-filter`,{selected:s}];return t.createElement(td,{action:["click"],popupVisible:s,popup:t.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"main"},t.createElement(Gt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:d,setList:e=>{const t=e.map((e=>e.dataIndex)),n=d.map((e=>e.dataIndex));me(t,n)||u(_a(e))}},d.map((e=>((e,n)=>{const{colSpan:r}=e;if(0===r)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=["svgicon","handle",`${n}-handle`];return t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(F,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,u([...d])}}),t.createElement("i",{className:Pe(i),title:a("qm.table.columnFilter.draggable")},t.createElement(Be,null)),t.createElement("span",{className:"text"},Ta(e.title)))})(e,"main")))))),popupClassName:Pe(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{c(e)},builtinPlacements:Wo,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Pe(f),title:a("qm.table.columnFilter.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(Qe,null)),t.createElement("span",null,a("qm.table.columnFilter.text"))))},rd=e=>{const{defaultValue:n,onClose:r,onOk:i}=e,{tableRef:l,prefixCls:a,selectionKeys:o,pagination:s,showSummary:c}=t.useContext(Ho),{rowSelection:d}=l.current.props,{t:u}=Fn(),p=t.useRef(null),[h,f]=t.useState(!1),g=t.useMemo((()=>Object.assign({},{fileName:`${m().format(zo)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:o.length?"selected":"all","startIndex|endIndex":[1,s.total],footSummation:c?1:0,useStyle:0},n,{columns:Qn(n.columns||[])})),[]),[v,y]=t.useState([{type:"INPUT",label:u("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:u("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:u("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:u("qm.table.export.all"),value:"all"},{text:u("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==d?void 0:d.type)},{text:u("qm.table.export.custom"),value:"custom"}]},onChange:e=>{v.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,y([...v])}},options:{min:1},disabled:!0},{type:"INPUT",label:u("qm.table.columnFilter.text"),fieldName:"columns",render:(e,n)=>t.createElement(nd,{columns:n.state.formData.columns,onChange:e=>{n.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:u("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!c,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:u("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]);return t.createElement("div",{className:`${a}-export__setting`},t.createElement(oh,{ref:p,initialValues:g,items:v,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r(),style:{marginRight:8}},u("qm.table.export.closeButton")),t.createElement(nr,{type:"primary",loading:h,onClick:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield p.current.GET_FORM_DATA();if(!e){f(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);i(t),yield Wn(1e3),f(!1),r()}}))},u("qm.table.export.text"))))},id=t.forwardRef(((e,n)=>{var r;const{tableColumns:i,open:l=!0}=e,{global:a}=t.useContext(on),{tableRef:o,prefixCls:s,flattenColumns:c,pagination:d,fetchParams:u,isFetch:p,isGroupSubtotal:h,showSummary:f,getSpan:g}=t.useContext(Ho),{exportExcel:v,fetch:y,showHeader:b}=o.current.props,{t:x}=Fn(),{getTitleFromCellValue:E}=ds(),[w,C]=t.useState(!1),[S,N]=t.useState(!1),T=t.useMemo((()=>{var e;return!!(null===(e=null==v?void 0:v.fetch)||void 0===e?void 0:e.api)}),[v]),I=t.useMemo((()=>!d.total||S),[d.total,S]),O=t.useMemo((()=>aa(i,[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn])),[i]),k=t.useMemo((()=>aa(c,[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn])),[c]),L=(e,t="",n=0)=>e.map(((e,r)=>{const i=Object.assign(Object.assign({},e),{index:r,pageIndex:r}),l=t?`${t}.${i.index+1}`:`${i.index+1}`;return i.indexPath=l,i._level=n,Array.isArray(e.children)&&(i.children=L(e.children,l,n+1)),k.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&va(i,t,ga(i,t))})),i})),A=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,i=(h?Ia(t):t).reduce(((e,t)=>{if(null==t?void 0:t[Jo.summaryIgnore])return e;const n=Number(ga(t,r));return Number.isNaN(n)?e:e+n}),0);va(n,r,i)})),[n]},P=(e,t,n,r)=>{const{precision:i,formatType:l}=n;let a=E(e,n,t,r);return i>=0&&!l&&""!==a&&(a=Number(a)),a},{exportXLSX:_,exportCSV:D}=xs(),H=e=>Hn(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:r=(e=>e),afterFetch:i,dataKey:l}=y;let a=[];try{N(!0);const o=yield n(Object.assign(Object.assign({},r(u)),{[Jo.currentPageName]:1,[Jo.pageSizeName]:null!=e?e:d.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=ue(o.data,l))&&void 0!==t?t:[];e="function"==typeof i?yield i(e):e,a=L(e)}}catch(e){}return N(!1),a})),F=e=>{var t;const n=null===(t=null==a?void 0:a.table)||void 0===t?void 0:t.recordExportLog;try{null==n||n({fileName:e})}catch(e){}},M=(e,t)=>{const{columns:n,footSummation:r}=e,i=da(n),l=Jl(n);let a='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${l.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,b&&(a+=["<thead>",i.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Ta(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(a+=`<tbody>${sa(t).map((e=>`<tr>${l.map(((n,r)=>{const{rowSpan:i,colSpan:l}=g(e,n,e.index,r,t);return i&&l?`<td rowspan="${i}" colspan="${l}">${P(e,e.index,n,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),f&&r&&(a+=["<tfoot>",A(l,t).map((e=>`<tr>${l.map(((n,r)=>{const{dataIndex:i,summation:l}=n,a=(null==l?void 0:l.render)?l.render(t):ga(e,i);return`<td>${0===r&&""===a?x("qm.table.config.summaryText"):jn(a)?Na(a).join(""):a}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},$=null!==(r=null==v?void 0:v.fileName)&&void 0!==r?r:`${m().format(zo)}.xlsx`,q=$.slice($.lastIndexOf(".")+1).toLowerCase(),j=()=>{if(I)return R.warning(x("qm.table.export.warnText"));var e;T?(e=$,Hn(void 0,void 0,void 0,(function*(){N(!0);try{const{api:t,params:n}=v.fetch,r=yield t(Object.assign(Object.assign(Object.assign({columns:k.map((e=>{const{title:t,dataIndex:n,hidden:r}=e,{type:i}=e.filter||{};return{title:t,dataIndex:n,type:i,hidden:r}}))},u),n),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[Jo.currentPageName]:void 0,[Jo.pageSizeName]:void 0}));r.data&&(wl(r.data,e),F(e))}catch(e){}N(!1)}))):C(!0)};t.useImperativeHandle(n,(()=>({clickHandle:j})));const K={[`${s}-export`]:!0},V={visible:w,title:x("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>C(!1)},z={fileName:$.slice(0,$.lastIndexOf(".")),fileType:q,columns:O,useStyle:(null==v?void 0:v.cellStyle)?1:0};return t.createElement(t.Fragment,null,l&&t.createElement("span",{className:Pe(K),title:x("qm.table.export.textNoSpace"),onClick:()=>j()},t.createElement("i",{className:"svgicon icon"},t.createElement(je,null))),t.createElement(Fl,V,t.createElement(rd,{defaultValue:z,onClose:()=>C(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ea(e.columns)}),Hn(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:n,exportType:r,startIndex:i=1,endIndex:l}=t,{tableFullData:a,selectionRows:s}=o.current;let c=[];if(p?("all"===r&&(c=yield H()),"custom"===r&&(c=yield H(l),c=c.slice(i-1))):("all"===r&&(c=a.slice(0)),"custom"===r&&(c=a.slice(i-1,l||void 0))),"selected"===r&&(c=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==v?void 0:v.beforeExport))try{c=null==v?void 0:v.beforeExport(c)}catch(e){}if("xlsx"===n){const n=yield _(t,c,A,P);wl(n,`${e}.xlsx`),F(`${e}.xlsx`)}if("csv"===n){const n=D(t,M(t,c));wl(n,`${e}.csv`),F(`${e}.csv`)}}))}})))}));id.displayName="TableExport";const ld=e=>{const{columns:n,onClose:r}=e,{tableRef:i,tableBodyRef:l,prefixCls:a,dataChange:o}=t.useContext(Ho),{beforeClipboard:s}=i.current.props,{t:c}=Fn(),d=t.useRef(null),[u,p]=t.useState([{type:"INPUT_NUMBER",label:c("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:c("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:n.map(((e,t)=>({value:t,text:Ta(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:c("qm.table.clipboard.content"),fieldName:"content",placeholder:c("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[m,h]=t.useState(!1);return t.createElement("div",{className:`${a}-clipboard__setting`},t.createElement("h3",{className:"info"},c("qm.table.clipboard.supportText")),t.createElement(oh,{ref:d,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:u,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r(),style:{marginRight:8}},c("qm.table.export.closeButton")),t.createElement(nr,{type:"primary",loading:m,onClick:()=>Hn(void 0,void 0,void 0,(function*(){var e;const[t,a]=yield d.current.GET_FORM_DATA();if(t)return;const{tableFullData:u,store:p,fieldAuth:m}=i.current;h(!0);const f=a.content.trim().replace(/(\r|\n)$/,"");let g=f.replace(/"[^"]+"/g,"^");((null===(e=f.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{g=g.replace(/\^/,e)}));let v=g.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof s)try{v=yield s(v,v[0].map(((e,t)=>n[a.colIndex+t].dataIndex)))}catch(t){}v.forEach(((e,t)=>{e.forEach(((e,r)=>{var i,l;const o=u[a.rowIndex-1+t],s=n[a.colIndex+r];if(o&&s){let t=!1;if(s.editRender){const e=s.editRender(o,s);t=!(e.disabled||(null===(i=e.extra)||void 0===i?void 0:i.disabled)||(null===(l=m[s.dataIndex])||void 0===l?void 0:l.disabled))}t&&s.dictItems&&(t=s.dictItems.some((t=>t.value==e))),t&&(va(o,s.dataIndex,e),p.addToUpdated(o))}}))})),l.current.forceUpdate(),o(),R.success(c("qm.table.clipboard.success",{total:v.length})),h(!1),r()}))},c("qm.table.clipboard.text"))))},ad=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i,flattenColumns:l}=t.useContext(Ho),{t:a}=Fn(),[o,s]=t.useState(!1),c=t.useMemo((()=>(e=>e.filter((e=>![Jo.expandableColumn,Jo.selectionColumn,"index","pageIndex",Jo.operationColumn].includes(e.dataIndex))))(l)),[l]),d=()=>{s(!0)};t.useImperativeHandle(n,(()=>({clickHandle:d})));const u={[`${i}-clipboard`]:!0},p={visible:o,title:a("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>s(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:Pe(u),title:a("qm.table.clipboard.textNoSpace"),onClick:()=>d()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ze,null))),t.createElement(Fl,p,t.createElement(ld,{columns:c,onClose:()=>s(!1)})))}));ad.displayName="TableClipboard";const od=e=>{const{columns:n,onClose:r}=e,{tableRef:i,$size:l,selectionKeys:a,setSelectionKeysEffect:o}=t.useContext(Ho),{rowKey:s,rowSelection:c}=i.current.props,{t:d}=Fn(),u=t.useRef(null),p=sl(u),m=e=>e.map((e=>{var t;const n={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(n.children=m(e.children)),n})),[h,f]=t.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...m(n.filter((e=>![Jo.expandableColumn,Jo.selectionColumn,"index","pageIndex",Jo.operationColumn].includes(e.dataIndex))))]),[g]=t.useState((()=>{const{disabled:e}=c||{},t=i.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[v,y]=t.useState(300),b=cl((()=>{const e=u.current;y(e.offsetHeight-2*Do[l]-30)}),5);return hn((()=>{b()}),[p.width]),t.createElement("div",{ref:u,style:{height:"100%"}},t.createElement(Ip,{size:l,columns:h,dataSource:g,rowKey:s,height:v,rowSelection:{type:"checkbox",selectedRowKeys:a,onChange:e=>o(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>f(e)}),t.createElement("div",{style:{height:10}}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r()},d("qm.table.selectCollection.closeButton"))))},sd=t.forwardRef(((e,n)=>{const{columns:r,open:i=!0}=e,{tableRef:l,getRowKey:a,prefixCls:o,selectionKeys:s,isFetch:c,isTableEmpty:d,setSelectionKeysEffect:u,setSelectionRows:p}=t.useContext(Ho),{rowSelection:m}=l.current.props,{t:h}=Fn(),[f,g]=t.useState(!1),v=t.useRef(!1);Mi((()=>{!v.current&&y()}),[d]);const y=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=m;if(c&&t)try{const r=yield t.api(Object.assign({},{selectedKeys:s},t.params));if(200===r.code){let i=Array.isArray(r.data)?r.data:null!==(e=ue(r.data,t.dataKey))&&void 0!==e?e:[];i=i.filter((e=>!n(e))),u(i.map(((e,t)=>a(e,t)))),p(i),v.current=!0}}catch(e){}})),b=()=>{g(!0)};t.useImperativeHandle(n,(()=>({clickHandle:b})));const x={visible:f,title:h("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>g(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:`${o}-select-collection`,title:h("qm.table.selectCollection.text"),onClick:()=>b()},t.createElement("i",{className:"svgicon icon"},t.createElement(Je,null))),t.createElement(Fl,x,t.createElement(od,{columns:r,onClose:()=>g(!1)})))}));sd.displayName="SelectCollection";const cd=e=>{const{onClose:n}=e,{global:r}=t.useContext(on),{tableRef:i,getRowKey:l,prefixCls:a,$size:o,tableFlatData:s,flattenColumns:c,setActivedCell:d,scrollXToColumn:u,scrollYToRecord:p}=t.useContext(Ho),{uniqueKey:m}=i.current.props,{t:h}=Fn(),{getTitleFromCellValue:f}=ds(),g=t.useRef(""),[v,y]=t.useState(""),[b,x]=t.useState([]),[E,w]=t.useState(0),[C,S]=t.useState(!1),[N,T]=t.useState({case:0,fullchar:0}),I=t.useMemo((()=>`${b.length>0?E+1:E}/${b.length}`),[E,b]);Mi((()=>{_(b[E])}),[E,b]);const R=e=>{T(Object.assign({},N,e))},k=(e,t,n)=>new Promise(((r,i)=>{A.confirm({title:h("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{n(),r()}})})),L=Mn((e=>Hn(void 0,void 0,void 0,(function*(){if(!v)return g.current=v,P();const t=((e,t)=>{const n=new RegExp(N.fullchar?`^${t}$`:t,N.case?"":"i"),r=[];return e.forEach(((e,t)=>{c.forEach(((i,a)=>{const{dataIndex:o}=i;if([Jo.expandableColumn,Jo.selectionColumn,"index","pageIndex",Jo.operationColumn].includes(o))return;const s=f(e,i,e.index,a);n.test(s)&&r.push({value:s,rowKey:l(e,e.index),dataIndex:o,rowIndex:t,colIndex:a})}))})),r})(s,v);if(!t.length)return A.warning({title:h("qm.button.confirmPrompt"),content:h("qm.table.fastSearch.notMatch")});if(x(t),"all"===e&&S(!0),v!==g.current)return g.current=v,w(0);if("next"===e){const e=E+1;e>t.length-1?yield k(h("qm.table.fastSearch.toTheEnd"),(()=>w(0)),(()=>{})):w(e)}if("prev"===e){const e=E-1;e<0?yield k(h("qm.table.fastSearch.toStart"),(()=>w(t.length-1)),(()=>{})):w(e)}})))),P=()=>{w(0),x([]),d({})},_=e=>{e&&(p(e.rowKey),u(e.dataIndex),d(e))},D=t.useMemo((()=>m?`fastSearch_${m}`:""),[m]),[H,M]=t.useState([]),[$,q]=t.useState(""),[j,K]=t.useState("");Mi((()=>{if(j){const{input:e,config:t}=H.find((e=>e.value===j)).condition;y(e),T(t),setTimeout((()=>L()))}}),[j]),t.useEffect((()=>{V()}),[]);const V=()=>Hn(void 0,void 0,void 0,(function*(){if(!D)return;let e=yield Qt.getItem(D);e||(e=yield z(D),Array.isArray(e)&&(yield Qt.setItem(D,e))),Array.isArray(e)&&e.length&&M(e)})),z=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),W=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return t.createElement("div",{className:`${a}-fast-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement("div",{className:"search-box"},t.createElement("span",{className:"label"},h("qm.table.fastSearch.queryLabel"),":"),t.createElement(O,{value:v,placeholder:h("qm.table.fastSearch.queryCondition"),allowClear:!0,style:{width:"100%"},onChange:e=>y(e.target.value)})),t.createElement("div",{className:"condition"},t.createElement(F,{checked:!!N.case,onChange:e=>R({case:e.target.checked})},h("qm.table.fastSearch.matchCase")),t.createElement(F,{checked:!!N.fullchar,onChange:e=>R({fullchar:e.target.checked})},h("qm.table.fastSearch.matchFullchar"))),t.createElement("div",{className:"all-list"},C&&t.createElement("table",{className:"rtable",tabIndex:-1,cellSpacing:"0",cellPadding:"0"},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",{style:{width:40,minWidth:40}},"#"),t.createElement("th",{style:{width:130,minWidth:130}},h("qm.table.fastSearch.cellText")),t.createElement("th",null,h("qm.table.fastSearch.valText")))),t.createElement("tbody",null,b.map(((e,n)=>t.createElement("tr",{key:n,className:Pe({active:E===n}),onClick:()=>w(n)},t.createElement("td",null,n+1),t.createElement("td",null,"Row:",e.rowIndex+1,", Col:",e.colIndex+1),t.createElement("td",null,e.value)))))))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:o,value:$,placeholder:h("qm.table.highSearch.configText"),disabled:!v,onChange:e=>{const{value:t}=e.target;q(t)}}),t.createElement(nr,{type:"primary",disabled:!$||!v,style:{marginLeft:"10px"},onClick:()=>Hn(void 0,void 0,void 0,(function*(){if(!D)return tr("Table","必须设置组件参数 `uniqueKey` 才能保存");if(!v)return;const e=Sa(),t=[...H,{text:$,value:e,condition:{input:v,config:N}}];M(t),q(""),yield Qt.setItem(D,t),yield W(D,t)}))},h("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Jo.rowHeightMaps[o]}px`}},t.createElement("span",null,h("qm.table.fastSearch.savedSetting"))),t.createElement("ul",null,H.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===j}),title:e.text,onClick:()=>{return t=e.value,void K(t!==j?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:h("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Hn(void 0,void 0,void 0,(function*(){if(!n)return;const e=H.filter((e=>e.value!==n));M(e),yield Qt.setItem(D,e),yield W(D,e)}))}},t.createElement(et,null))))),!H.length&&t.createElement("div",{style:{padding:$o}},t.createElement(tl,null)))))),t.createElement("div",{className:"bottom-bar",style:{position:"absolute",left:0,bottom:0,right:0,height:`${Do[o]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",boxSizing:"border-box"}},t.createElement("div",null,h("qm.table.fastSearch.findTotal",{total:I})),t.createElement("div",null,t.createElement(nr,{onClick:()=>L("all"),style:{marginRight:8}},h("qm.table.fastSearch.queryAll")),t.createElement(nr,{type:"primary",onClick:()=>L("prev"),style:{marginRight:8}},h("qm.table.fastSearch.queryPrev")),t.createElement(nr,{type:"primary",onClick:()=>L("next"),style:{marginRight:8}},h("qm.table.fastSearch.queryNext")),t.createElement(nr,{onClick:()=>n()},h("qm.table.fastSearch.closeButton")))))},dd=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i,$size:l}=t.useContext(Ho),{t:a}=Fn(),[o,s]=t.useState(!1),c=()=>{s(!0)};t.useImperativeHandle(n,(()=>({clickHandle:c})));const d={visible:o,title:a("qm.table.fastSearch.settingTitle"),width:650,loading:!1,bodyStyle:{paddingBottom:`${Do[l]+20}px`},onClose:()=>s(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${i}-super-search`,title:a("qm.table.fastSearch.text"),onClick:()=>c()},t.createElement("i",{className:"svgicon icon"},t.createElement(tt,null))),t.createElement(Fl,d,t.createElement(cd,{onClose:()=>s(!1)})))}));dd.displayName="FastSearch";var ud={selectionColumnDefine:{title:"",dataIndex:"__selection__",width:80,fixed:"left"},indentWidth:16,groupMargin:15,separator:"^"};const pd=e=>[ud.selectionColumnDefine,...e].filter((e=>!e.hidden)),md=e=>e.some((e=>Array.isArray(e.children))),hd=e=>void 0!==e._groupLevel,fd=(e,t)=>t.split(ud.separator).reduce(((e,t)=>null==e?void 0:e[t]),e),gd=e=>Array.isArray(e)?0:"object"==typeof e&&null!==e?1+Math.max(0,...Object.values(e).map(gd)):0,vd=(e,t="")=>Array.isArray(e)?[]:Object.keys(e).reduce(((n,r)=>{const i=t?`${t}${ud.separator}${r}`:r;if(n.push(i),Array.isArray(e[r]))return n;const l=vd(e[r],i);return n.concat(l)}),[]),yd=(e,t=[],n)=>{const r=(e,t)=>{if(0===t.length)return e;const[{[Object.keys(t[0])[0]]:i}]=t,l=Object.keys(t[0])[0],a=t.slice(1),o=Object.groupBy(e,(e=>n(e,l))),s=Object.keys(o).sort(((e,t)=>{const n=(r=e,l=t,Number.isNaN(r-l)?r.toString().localeCompare(l.toString()):r-l);var r,l;return"ascend"===i?n:-n})),c={};return s.forEach((e=>{c[`#${e}`]=r(o[e],a)})),c};return r(e,t)},bd={sum:e=>xa(e.reduce(((e,t)=>e+t),0)),avg:e=>e.length>0?(e.reduce(((e,t)=>e+t),0)/e.length).toFixed(2):0,max:e=>e.length>0?Math.max(...e):void 0,min:e=>e.length>0?Math.min(...e):void 0,count:e=>xa(e.length),unique:e=>new Set(e).size,empty:e=>e.filter((e=>Gn(e))).length,notEmpty:e=>e.filter((e=>!Gn(e))).length},xd=t.createContext(void 0),Ed=e=>{const{prefixCls:n,pivotProps:r,size:i,getRowKey:l,flatColumns:a,tableData:o}=e,{initialGroup:s,initialCount:c}=r,d=e=>{const t=new Map;return sa(e).forEach((e=>t.set(l(e,e.index),e))),t},u=t.useRef({props:r,originGridData:o,flatGroupData:[],isTree:md(o),keyRecordMap:d(o)}),[p,m]=t.useState({pivotRef:u,prefixCls:n,size:i,viewMode:"table",columns:a,gridData:o,groupGridData:[],groupList:s?(e=>{const t=[],n=a.map((e=>e.dataIndex));return e.forEach((e=>{n.includes(e.fieldName)&&["ascend","descend"].includes(e.order)&&t.push(e)})),t})(s):[],filterList:[],sorterList:[],colorList:[],expandedKeys:[],searchResults:[],switchIndex:0,fillColorCells:new Map,countMethod:c?(e=>{const t=["count","unique","empty","notEmpty","sum","max","min","avg"],n=a.map((e=>e.dataIndex)),r={};for(const i in e)n.includes(i)&&t.includes(e[i])&&(r[i]=e[i]);return r})(c):{},summationData:{}}),h=e=>{m((t=>{const n=Object.assign({},t);let r=!1;return Object.keys(e).forEach((i=>{const l=i;Object.is(t[l],e[l])||(n[l]=e[l],r=!0)})),r?n:t}))};hn((()=>{v(o),f("originGridData",o),f("isTree",md(o)),f("keyRecordMap",d(o))}),[o]),hn((()=>{g(a)}),[a]),hn((()=>{h({size:i})}),[i]);const f=(e,t)=>{p.pivotRef.current[e]=t};f("props",r);const g=e=>{h({columns:e})},v=e=>{h({gridData:e})},y=e=>{h({groupGridData:e})},b=e=>{h({groupList:e})},x=e=>{h({filterList:e})},E=e=>{h({sorterList:e})},w=e=>{h({colorList:e})},C=e=>{h({expandedKeys:e})},S=e=>{h({searchResults:e})},N=e=>{h({switchIndex:e})},T=e=>{const t=new Map;e.forEach((e=>t.set(`${e.rowKey}|${e.dataIndex}`,e.color))),h({fillColorCells:t})},I=e=>{var t;h({countMethod:(t=Object.assign({},p.countMethod,e),Object.fromEntries(Object.entries(t).filter((([e,t])=>void 0!==t))))})},R=e=>{h({summationData:e})},O=t.useMemo((()=>Object.assign(Object.assign({},p),{setContext:h,getRowKey:l,setPivotGridRef:f,setColumns:g,setGridData:v,setGroupGridData:y,setGroupList:b,setFilterList:x,setSorterList:E,setColorList:w,setExpandedKeys:C,setSearchResults:S,setSwitchIndex:N,setFillColor:T,setCountMethod:I,setSummationData:R})),[p]);return t.createElement(xd.Provider,{value:O},e.children)},wd=()=>t.useContext(xd),Cd=()=>{const{prefixCls:e,pivotRef:n,groupList:r,columns:i,gridData:l,setGroupList:a,setExpandedKeys:o,setGroupGridData:s,setPivotGridRef:c}=wd(),{originGridData:d}=n.current,{onGroupChange:u,onDataChange:p}=n.current.props,{t:m}=Fn(),h=t.useRef([]),f=t.useRef([]),g=t.useMemo((()=>r.filter((e=>e.fieldName&&e.order))),[r]),v=t.useMemo((()=>i.map((e=>({label:Ta(e.title),value:e.dataIndex,disabled:r.some((t=>t.fieldName===e.dataIndex))})))),[r,i]),y=t.useMemo((()=>{const e=g.map((e=>({[e.fieldName]:e.order})));return me(e,h.current)?h.current:(h.current=e,e)}),[g]),b=[{label:m("qm.pivotGrid.group.ascend"),value:"ascend"},{label:m("qm.pivotGrid.group.descend"),value:"descend"}];t.useEffect((()=>{o(f.current)}),[y,d]),t.useLayoutEffect((()=>{const e=yd(l,y,((e,t)=>{let n=ga(e,t);return ae(n)&&(n=Object.values(n)),Array.isArray(n)&&(n=n.join(",")),Gn(n)?m("qm.pivotGrid.group.empty"):n}));var t;s(e),t=vd(e),f.current=t,c("flatGroupData",((e,t=[])=>{const n=[];return function e(r,i,l=""){if(Array.isArray(r))r.forEach(((e,t)=>{e._varIndex=t,l?e._parentRowKey=l:delete e._parentRowKey})),n.push(...sa(r));else for(const a in r){const o=l?`${l}${ud.separator}${a}`:a,s=Object.keys(t[i])[0];n.push({id:o,_fieldName:s,_groupLevel:i}),e(r[a],i+1,o)}}(e,0),n})(e,y))}),[y,l]),Mi((()=>{null==u||u(g)}),[y]),Mi((()=>{null==p||p(l)}),[l]);const x=()=>{a([...r,{fieldName:"",order:"ascend"}])},E=(e,t,n)=>{Object.assign(t,{[e]:n}),a([...r])},w=e=>t.createElement(t.Fragment,null,t.createElement(Be,{className:"icon handle"}),t.createElement(H,{value:e.fieldName||void 0,placeholder:m("qm.table.editable.selectPlaceholder"),options:v,style:{width:160,margin:"0 10px"},onChange:t=>E("fieldName",e,t)}),t.createElement(H,{value:e.order,options:b,placeholder:m("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>E("order",e,t)}),t.createElement(it,{className:"icon close",onClick:()=>(e=>{a(r.filter((t=>t!==e)))})(e)}));return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,m("qm.pivotGrid.group.title")),!!g.length&&t.createElement("div",null,t.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o([])},m("qm.pivotGrid.group.foldAll")),t.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o(f.current)},m("qm.pivotGrid.group.unfoldAll")))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));me(t,n)||a(e)}},r.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},w(e)))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:x},t.createElement(rt,{className:"icon"}),m("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!g.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(nt,{className:"icon"}),m("qm.pivotGrid.group.text"),g.length?`(${g.length})`:null))},Sd=()=>{const{prefixCls:e,pivotRef:n,columns:r,filterList:i,setFilterList:l,setGridData:a}=wd(),{originGridData:o,isTree:s}=n.current,{onFilterChange:c}=n.current.props,{t:d}=Fn(),u=t.useRef([]),p=t.useMemo((()=>i.filter((e=>e.fieldName&&("nil"===e.expression||!Gn(e.value))))),[i]),m=t.useMemo((()=>r.map((e=>({label:Ta(e.title),value:e.dataIndex})))),[r]),[h,f]=t.useState("and"),g=t.useMemo((()=>{const e=p.map((e=>{var t;return`${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}));return me(e,u.current)?u.current:(u.current=e,e)}),[p]);Mi((()=>{l(i.map((e=>Object.assign(Object.assign({},e),{logic:h}))))}),[h]),Mi((()=>{v(),null==c||c(p)}),[g]);const v=cl((()=>{const e=Ra(p.map((e=>Object.assign(Object.assign({},Xn(e,["value"])),{expression:"nil"!==e.expression?e.expression:"==",condition:e.value}))));a(e?Zl(o,e,s):o)}),200),y=[{label:d("qm.pivotGrid.filter.matchAll"),value:"and"},{label:d("qm.pivotGrid.filter.matchAny"),value:"or"}],b=()=>{l([...i,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:h}])},x=(e,t,n)=>{var a;if(Object.assign(t,{[e]:n}),"fieldName"===e){const e=(null===(a=r.find((e=>e.dataIndex===n)).filter)||void 0===a?void 0:a.type)||"text";Object.assign(t,{type:e,expression:w(e)[0].value,value:""})}"expression"===e&&"nil"===n&&Object.assign(t,{value:""}),l([...i])},E=e=>t.createElement(t.Fragment,null,t.createElement(H,{value:e.fieldName||void 0,options:m,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>x("fieldName",e,t)}),t.createElement(H,{value:e.expression||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),options:w(e.type),style:{width:100,margin:"0 10px"},onChange:t=>x("expression",e,t)}),C(e),t.createElement(it,{className:"icon close",onClick:()=>(e=>{l(i.filter((t=>t!==e)))})(e)})),w=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:d("qm.table.highSearch.gtText")},{value:"<",label:d("qm.table.highSearch.ltText")},{value:">=",label:d("qm.table.highSearch.gteText")},{value:"<=",label:d("qm.table.highSearch.lteText")},{value:"==",label:d("qm.table.highSearch.eqText")},{value:"!=",label:d("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:d("qm.table.highSearch.inText")},{value:"nin",label:d("qm.table.highSearch.ninText")},{value:"==",label:d("qm.table.highSearch.eqText")},{value:"!=",label:d("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",label:d("qm.table.highSearch.likeText")},{value:"==",label:d("qm.table.highSearch.eqText")},{value:"!=",label:d("qm.table.highSearch.neqText")},{value:"nil",label:d("qm.table.highSearch.nullText")}]}return t},C=e=>{var n,i;switch(e.type){case"number":return t.createElement($,{defaultValue:e.value,style:{width:150},onChange:t=>{x("value",e,Gn(t)?"":t)}});case"date":return t.createElement(In,{popupClassName:Jo.popupClassName,defaultValue:null!==(n=wa(e.value,"YYYY-MM-DD"))&&void 0!==n?n:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{x("value",e,Ca(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const n=(null===(i=r.find((t=>t.dataIndex===e.fieldName)))||void 0===i?void 0:i.dictItems)||[];return t.createElement(H,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{x("value",e,t)}},n.map((e=>t.createElement(H.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return t.createElement(O,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{x("value",e,t.target.value)}})}};return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,d("qm.pivotGrid.filter.title")),!!p.length&&t.createElement(H,{value:h,options:y,style:{width:130},onChange:e=>f(e)})),t.createElement("div",{className:"list"},i.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},E(e))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:b},t.createElement(rt,{className:"icon"}),d("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!p.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(lt,{className:"icon"}),d("qm.pivotGrid.filter.text"),p.length?`(${p.length})`:null))},Nd=()=>{const{prefixCls:e,pivotRef:n,columns:r,gridData:i,sorterList:l,setSorterList:a,setGridData:o}=wd(),{onSorterChange:s}=n.current.props,{t:c}=Fn(),d=t.useMemo((()=>l.filter((e=>e.fieldName&&e.order))),[l]),u=t.useMemo((()=>r.map((e=>({label:Ta(e.title),value:e.dataIndex,disabled:l.some((t=>t.fieldName===e.dataIndex))})))),[l,r]);Mi((()=>{h(),null==s||s(d)}),[t.useMemo((()=>d.map((e=>Object.values(e).join(":"))).join(",")),[d])]);const p=[{label:c("qm.pivotGrid.sorter.ascend"),value:"ascend"},{label:c("qm.pivotGrid.sorter.descend"),value:"descend"}],m=(e,t)=>"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():0,h=()=>{var e;o((e=d,i.sort(((t,n)=>{for(const r of e){const{fieldName:e,order:i}=r,l=ga(t,e),a=ga(n,e),o=m(l,a);if(0!==o)return"ascend"===i?o:-o}return 0})).slice(0)))},f=()=>{a([...l,{fieldName:"",order:"ascend"}])},g=(e,t,n)=>{Object.assign(t,{[e]:n}),a([...l])},v=e=>t.createElement(t.Fragment,null,t.createElement(Be,{className:"icon handle"}),t.createElement(H,{value:e.fieldName||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),options:u,style:{width:160,margin:"0 10px"},onChange:t=>g("fieldName",e,t)}),t.createElement(H,{value:e.order,options:p,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>g("order",e,t)}),t.createElement(it,{className:"icon close",onClick:()=>(e=>{a(l.filter((t=>t!==e)))})(e)}));return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,c("qm.pivotGrid.sorter.title"))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.fieldName)),n=l.map((e=>e.fieldName));me(t,n)||a(e)}},l.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},v(e)))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:f},t.createElement(rt,{className:"icon"}),c("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!d.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(at,{className:"icon"}),c("qm.pivotGrid.sorter.text"),d.length?`(${d.length})`:null))},Td=()=>{const{prefixCls:e,getRowKey:n,gridData:r,columns:i,searchResults:l,switchIndex:a,setSearchResults:o,setSwitchIndex:s}=wd(),{t:c}=Fn(),{getTitleFromCellValue:d}=ds(),[u,p]=t.useState(!1),m=t.useMemo((()=>l.length),[l]);Mi((()=>{u||setTimeout((()=>{s(0),o([])}),200)}),[u]);const h=(e,t)=>{const r=[];return e.forEach(((e,l)=>{i.forEach(((i,a)=>{const o=d(e,i,l,a)+"";o.includes(t)&&r.push({value:o,rowKey:n(e,e.index),dataIndex:i.dataIndex})})),Array.isArray(e.children)&&r.push(...h(e.children,t))})),r},f=cl((e=>{const t=e.target.value.trim();s(0),o(t?h(r,t):[])}),200),g=e=>{const{keyCode:t}=e;e.preventDefault(),13===t&&v()},v=()=>{if(!m)return;s((a+1)%m)},y=()=>t.createElement("div",{className:"search-switch"},t.createElement("button",{className:"button-icon",onClick:()=>(()=>{if(!m)return;s((a-1+m)%m)})()},t.createElement(ot,null)),t.createElement("span",{className:"num"},m>0?a+1:a,"/",m),t.createElement("button",{className:"button-icon",onClick:()=>v()},t.createElement(st,null)));return t.createElement(M,{open:u,trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,c("qm.pivotGrid.search.title")),t.createElement("button",{className:"button-icon",onClick:()=>p(!1)},t.createElement(it,null))),t.createElement("div",{className:"list search",style:{margin:"10px 0"}},t.createElement(O,{autoFocus:!0,style:{width:280},suffix:y(),onChange:f,onKeyUp:g}))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300},destroyPopupOnHide:!0},t.createElement("span",{onClick:()=>p(!u)},t.createElement(tt,{className:"icon"}),c("qm.pivotGrid.search.text")))},Id=(e,t)=>e.map((e=>(e.children&&(e.children=Id(e.children,t)),t(e)))),Rd=()=>{const{prefixCls:e,pivotRef:n,columns:r,setColumns:i}=wd(),{uniqueKey:l,onColumnsChange:a}=n.current.props,{t:o}=Fn(),s=t.useMemo((()=>l?`grid_field_${l}`:""),[l]);t.useLayoutEffect((()=>{c()}),[]),Mi((()=>{u(r)}),[r]);const c=()=>{const e=p();e&&(null==a||a(e))},d=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=d(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),u=e=>{if(!s)return;const t=d(e),n=JSON.parse(localStorage.getItem(s));me(t,n)||localStorage.setItem(s,JSON.stringify(t))},p=()=>{if(!s)return;const e=JSON.parse(localStorage.getItem(s));if(!e)return;return fe(e.map((e=>e.dataIndex)),r.map((e=>e.dataIndex))).length>0?Id(r,(t=>{const n=e.find((e=>e.dataIndex===t.dataIndex));return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Id(e,(e=>{const t=r.find((t=>t.dataIndex===e.dataIndex));return t&&void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},m=t.useMemo((()=>{let e=0;for(let t=0;t<r.length-1&&("left"!==r[t].fixed||r[t+1].fixed||(e=t+1),!(e>0));t++);const t=[];for(let n=0;n<r.length;n++)n===e&&t.push({title:"",dataIndex:"__divider__"}),t.push(r[n]);return t}),[r]),h=()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container","scroll-y"),style:{padding:5}},t.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},t.createElement("span",null,o("qm.pivotGrid.field.title"))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"dataIndex",handle:".handle",tag:"ul",animation:200,list:m,setList:e=>{const t=e.map((e=>e.dataIndex)),n=m.map((e=>e.dataIndex));me(t,n)||(e=>{const t=e.findIndex((e=>"__divider__"===e.dataIndex)),n=[];for(let r=0;r<e.length;r++){const i=e[r];r<t?i.fixed="left":delete i.fixed,r!==t&&n.push(i)}i(n),null==a||a(n)})(_a(e))}},m.map((e=>"__divider__"!==e.dataIndex?t.createElement("li",{key:e.dataIndex,className:"ant-dropdown-menu-item sort-item"},t.createElement(Be,{className:"handle"}),t.createElement("span",{className:"label"},t.createElement("span",{className:"title"},Ta(e.title)),t.createElement("button",{className:"button-icon",onClick:()=>(e=>{e.hidden=!e.hidden;const t=[...r];i(t),null==a||a(t)})(e)},e.hidden?t.createElement(ct,null):t.createElement(qe,null)))):t.createElement("li",{key:e.dataIndex,className:"divider"}))))));return t.createElement(M,{trigger:["click"],dropdownRender:()=>h(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:240}},t.createElement("span",null,t.createElement(Qe,{className:"icon"}),o("qm.pivotGrid.field.text")))},Od=()=>{const{prefixCls:e,size:n,setContext:r}=wd(),{t:i}=Fn(),l=[{label:i("qm.pivotGrid.lineHeight.size")[0],value:"small"},{label:i("qm.pivotGrid.lineHeight.size")[1],value:"middle"},{label:i("qm.pivotGrid.lineHeight.size")[2],value:"large"}];return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container"),style:{padding:5}},t.createElement("div",{className:"list"},l.map((e=>t.createElement("li",{key:e.value,className:Pe("ant-dropdown-menu-item check-item",{active:n===e.value}),onClick:()=>r({size:e.value})},t.createElement("span",{className:"label"},e.label),t.createElement("i",{className:"icon"},t.createElement($e,null))))))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:160}},t.createElement("span",null,t.createElement(dt,{className:"icon"}),i("qm.pivotGrid.lineHeight.text")))},kd="606060",Ld="thin",Ad="d4d4d4",Pd=(e,t)=>{t&&(e.height=Math.floor(.75*t))},_d=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Dd=()=>({top:{style:Ld,color:{argb:Ad}},left:{style:Ld,color:{argb:Ad}},bottom:{style:Ld,color:{argb:Ad}},right:{style:Ld,color:{argb:Ad}}}),Hd=e=>{const{precision:t,formatType:n}=e,r=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:r?`0${r}%`:"0%"}:"finance"===n?{numFmt:r?`#,##0${r}`:"#,##0"}:r?{numFmt:`0${r}`}:null},Fd=()=>{const{prefixCls:e,pivotRef:n,columns:r,countMethod:i,summationData:l}=wd(),{t:a}=Fn(),{exportXLSX:o}=(()=>{const{size:e}=wd(),{t:t}=Fn(),{rowHeightMaps:n}=Jo,r=(e,t)=>{var n,r,i;return null!==(i=null!==(r=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==r?r:t)&&void 0!==i?i:""};return{exportXLSX:(r,i,l,a)=>Hn(void 0,void 0,void 0,(function*(){const{columns:o,footSummation:s}=r,c=n[e],d=Jl(o),u=[],p=[],m=[];let h=0;const f={};d.forEach((e=>{const{dataIndex:t,width:n,renderWidth:r}=e;f[t]=Ta(e.title),m.push({key:t,width:(n||r)/8})})),u.push(f),h+=u.length;const g=i.map(((e,t)=>{const n={};return d.forEach(((r,i)=>{const l=["percent","finance"].includes(r.formatType);n[r.dataIndex]=l?ga(e,r.dataIndex):a(e,t,r,i)})),n._level=e._level,n._groupLevel=e._groupLevel,n}));h+=g.length,s&&l(d,i).forEach(((e,n)=>{const r={};d.forEach(((n,l)=>{const{dataIndex:a,summation:o}=n,s=(null==o?void 0:o.render)?o.render(i):ga(e,a);r[a]=0===l&&""===s?t("qm.table.config.summaryText"):jn(s)?Na(s).join(""):s})),p.push(r)}));const{sheetName:v,useStyle:y}=r,b=new Xt.Workbook,x=b.addWorksheet(v);x.columns=m,x.addRows(u).forEach((e=>{y&&Pd(e,c),e.eachCell((e=>{const t=x.getColumn(e.col),n=ra(o,t.key),{align:r,theadAlign:i}=n;_d(e,i||r),y&&Object.assign(e,{font:{bold:!0,color:{argb:kd}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Dd()})}))})),x.addRows(g).forEach(((e,t)=>{const{_level:n,_groupLevel:r}=g[t];y&&Pd(e,c),e.eachCell(((e,t)=>{const i=x.getColumn(e.col),l=ra(o,i.key),{align:a}=l;_d(e,1===t||void 0===r?a:"right"),Object.assign(e,Hd(l)),y&&Object.assign(e,{font:{color:{argb:kd}},border:Dd()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),s&&x.addRows(p).forEach((e=>{y&&Pd(e,c),e.eachCell(((e,t)=>{const n=x.getColumn(e.col),r=ra(o,n.key),{align:i}=r;_d(e,1===t?i:"right"),Object.assign(e,Hd(r)),y&&Object.assign(e,{font:{color:{argb:kd}},border:Dd()})}))})),[].forEach((({s:e,e:t})=>{x.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const E=yield b.xlsx.writeBuffer();return new Blob([E],{type:"application/octet-stream"})})),importXLSX:(e,n)=>{const{columns:i,file:l}=e,a=Jl(i),o=new FileReader;o.onerror=()=>{R.error(t("qm.table.import.error"))},o.onload=e=>{const i=a.map((e=>Ta(e.title))),l=new Xt.Workbook,o=e.target;o?l.xlsx.load(o.result).then((e=>{const l=e.worksheets[0];if(l){const e=l.getSheetValues(),o=e.findIndex((e=>e&&e.length>0)),s=e[o],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(i,s);if(c){const t=e.slice(o+1).map((e=>{const t={};e.forEach(((e,n)=>{var r;let i=e;Array.isArray(null==i?void 0:i.richText)&&(i=i.richText.map((e=>e.text)).join("")),ae(i)&&"text"in i&&(i=i.text),Ce(i)&&(i=Ca(i,Vo)),(null==i?void 0:i.formula)&&(i=null!==(r=i.result)&&void 0!==r?r:i.value),t[s[n]]=i}));const n={};return i.forEach(((e,i)=>{var l;const{dataIndex:o,dictItems:s}=a[i];Array.isArray(s)&&((null===(l=t[e])||void 0===l?void 0:l.toString().includes(","))?t[e]=t[e].split(",").map((e=>r(s,e))).filter((e=>""!==e)):t[e]=r(s,t[e])),va(n,o,t[e])})),n}));null==n||n(t)}else R.error(t("qm.table.import.error"))}else R.error(t("qm.table.import.error"))})):R.error(t("qm.table.import.error"))},o.readAsArrayBuffer(l)}}})(),{getTitleFromCellValue:s}=ds(),c=[{text:a("qm.pivotGrid.count.records"),value:"count"},{text:a("qm.pivotGrid.count.unique"),value:"unique"},{text:a("qm.pivotGrid.count.empty"),value:"empty"},{text:a("qm.pivotGrid.count.notEmpty"),value:"notEmpty"},{text:a("qm.pivotGrid.count.sum"),value:"sum"},{text:a("qm.pivotGrid.count.max"),value:"max"},{text:a("qm.pivotGrid.count.min"),value:"min"},{text:a("qm.pivotGrid.count.avg"),value:"avg"}],d={columns:ea(r),fileName:m().format(zo),fileType:"xlsx",sheetName:"sheet1",footSummation:!1,useStyle:!1},u=(e,t,n,r)=>{const{dataIndex:i,precision:l,formatType:a}=n;if(hd(e))return ga(e,i);let o=s(e,n,t,r);return l>=0&&!a&&""!==o&&(o=Number(o)),o},p=()=>{if(!i||!Object.keys(i).length)return[];const e={};return d.columns.map((e=>e.dataIndex)).forEach(((t,n)=>{if(n>0){let n="";(null==i?void 0:i[t])&&(n=c.find((e=>e.value===i[t])).text+" "+l.total[t]),va(e,t,n)}})),[e]},h=e=>Hn(void 0,void 0,void 0,(function*(){const t=yield o(Object.assign(Object.assign({},d),{footSummation:!!Object.keys(i).length}),e,p,u);wl(t,`${m().format(zo)}.xlsx`)})),f=[{key:"1",label:t.createElement(t.Fragment,null,t.createElement(ut,{style:{marginRight:4}})," ",a("qm.pivotGrid.export.group")),onClick:()=>{h((()=>{const e=[];let t=0;return n.current.flatGroupData.forEach((n=>{const a=Object.assign({},n);hd(n)?(a._level=n._groupLevel,d.columns.map((e=>e.dataIndex)).forEach(((e,t)=>{if(0===t)va(a,e,s(n._record,r.find((e=>e.dataIndex===n._fieldName)),0,0));else{let t="";(null==i?void 0:i[e])&&(t=c.find((t=>t.value===i[e])).text+" "+fd(l,n.id).subtotal[e]),va(a,e,t)}})),t=n._groupLevel):t>0&&(a._level=n._level+t+1),e.push(a)})),e})())}},{key:"2",label:t.createElement(t.Fragment,null,t.createElement(pt,{style:{marginRight:4}})," ",a("qm.pivotGrid.export.list")),onClick:()=>{h(Array.from(n.current.keyRecordMap.values()))}}];return t.createElement(M,{trigger:["click"],menu:{items:f},className:Pe("action-btn"),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:140}},t.createElement("span",null,t.createElement(je,{className:"icon"}),a("qm.pivotGrid.export.text")))},Md=()=>{const{prefixCls:e,pivotRef:n,groupList:r,filterList:i,sorterList:l,colorList:a,countMethod:o,setContext:s}=wd(),{uniqueKey:c}=n.current.props,{t:d}=Fn(),u=t.useMemo((()=>c?`grid_conf_${c}`:""),[c]),p=t.useRef({}),[h,f]=t.useState([]),[g,v]=t.useState({}),[y,b]=t.useState(""),x=(e,t)=>{v((n=>Object.assign({},n,{[e]:null!=t?t:!n[e]})))};t.useLayoutEffect((()=>{E()}),[]),Mi((()=>{w()}),[h]);const E=()=>Hn(void 0,void 0,void 0,(function*(){try{if(!u)return;const e=yield Qt.getItem(u);Array.isArray(e)&&(f(e),v(e.reduce(((e,t)=>(t.id&&(e[t.id]=!1),e)),{})))}catch(e){}})),w=()=>Hn(void 0,void 0,void 0,(function*(){try{if(!u)return;yield Qt.setItem(u,h)}catch(e){}})),C=()=>{const e=Sa();f([{id:e,label:m().format(zo),value:{groupList:r,filterList:i,sorterList:l,colorList:a,countMethod:o}},...h]),Bn((()=>x(e,!0)))},S=()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container"),style:{padding:5}},t.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},t.createElement("span",null,d("qm.pivotGrid.saved.title"))),t.createElement("div",{className:"list"},t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.id,className:Pe("ant-dropdown-menu-item sort-item",{active:e.id===y}),onClick:()=>(e=>{if(g[e.id])return;const t=y!==e.id,n=t?e.value:p.current;s({groupList:n.groupList,filterList:n.filterList,sorterList:n.sorterList,colorList:n.colorList,countMethod:n.countMethod}),b(t?e.id:"")})(e)},t.createElement("div",{className:"label",style:{width:200}},g[e.id]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:e.label,style:{width:"100%",marginLeft:-8},onBlur:t=>{const{value:n}=t.target;n!==e.label&&(e.label=n,f([...h])),x(e.id,!1)}}):t.createElement("span",null,e.label)),t.createElement("button",{className:"button-icon",onClick:t=>{t.stopPropagation(),x(e.id)}},g[e.id]?t.createElement($e,null):t.createElement(Me,null)),t.createElement("button",{className:"button-icon",style:{marginLeft:4},onClick:t=>{var n;t.stopPropagation(),n=e.id,f(h.filter((e=>e.id!==n)))}},t.createElement(it,null))))))),t.createElement("div",{className:"add-record",style:{padding:10}},t.createElement("span",{className:"insert",onClick:C},t.createElement(rt,{className:"icon"}),d("qm.pivotGrid.saved.add"))));return t.createElement(M,{trigger:["click"],dropdownRender:()=>S(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomRight",overlayStyle:{minWidth:280},onOpenChange:e=>{var t;t=e?{groupList:r,filterList:i,sorterList:l,colorList:a,countMethod:o}:{},p.current=t}},t.createElement("span",null,t.createElement(mt,{className:"icon"}),d("qm.pivotGrid.saved.text")))},$d=()=>{const{gridData:e}=wd(),{t:n}=Fn();return t.createElement("div",{className:"alert-info"},t.createElement(ht,{className:"icon"}),n("qm.table.alert.total",{total:(()=>{let t=0;return function e(n){n.forEach((n=>{Array.isArray(n.children)&&e(n.children),t+=1}))}(e),t})()}))},qd=8;const jd={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Kd={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},Vd=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function zd(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:l,visibleFirst:a}=e,o=t/2,s={};return Object.keys(jd).forEach((e=>{const c=r&&Kd[e]||jd[e],d=Object.assign(Object.assign({},c),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,Vd.has(e)&&(d.autoArrow=!1),e){case"top":case"topLeft":case"topRight":d.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+i}const u=function(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?qd:r}}({contentRadius:l,limitVerticalRadius:!0});if(r)switch(e){case"topLeft":case"bottomLeft":d.offset[0]=-u.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=u.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=2*-u.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":d.offset[1]=2*u.arrowOffsetHorizontal-o}d.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};const i=r&&"object"==typeof r?r:{},l={};switch(e){case"top":case"bottom":l.shiftX=2*t.arrowOffsetHorizontal+n,l.shiftY=!0,l.adjustY=!0;break;case"left":case"right":l.shiftY=2*t.arrowOffsetVertical+n,l.shiftX=!0,l.adjustX=!0}const a=Object.assign(Object.assign({},l),i);return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}(e,u,t,n),a&&(d.htmlRegion="visibleFirst")})),s}const Wd=e=>{const{value:n,defaultValue:r,disabled:i,disabledAlpha:l,className:a,style:o,onChange:s,onChangeComplete:c}=e,[d,u]=ts("",{value:n,defaultValue:r}),p=e=>({hex:e.toHexString(),rgb:e.toRgbString(),hsb:e.toHsbString()}),m=zd({offset:0,arrowWidth:16,borderRadius:6}),h=lr("color-picker");return t.createElement(Zt,{action:["click"],prefixCls:h,popupPlacement:"bottomLeft",builtinPlacements:m,popup:()=>t.createElement(Jt,{prefixCls:h,value:d,disabled:i,disabledAlpha:l,onChange:(e,t)=>{u(e.toRgbString()),null==s||s(p(e),t)},onChangeComplete:(e,t)=>{null==c||c(p(e),t)}})},t.createElement("div",{className:Pe(`${h}-btn`,a),style:o},t.createElement(en,{color:d,prefixCls:h})))};Wd.displayName="ColorPicker";const Bd=()=>{const{prefixCls:e,pivotRef:n,getRowKey:r,columns:i,colorList:l,setColorList:a,setFillColor:o}=wd(),{flatGroupData:s}=n.current,{t:c}=Fn(),d=t.useRef([]),u=t.useMemo((()=>l.filter((e=>e.fieldName&&e.color&&("nil"===e.expression||!Gn(e.value)||"col"===e.mode)))),[l]),p=t.useMemo((()=>i.map((e=>({label:Ta(e.title),value:e.dataIndex})))),[i]),m=t.useMemo((()=>pd(i)),[i]),h=[{label:c("qm.pivotGrid.fillColor.cell"),value:"cell"},{label:c("qm.pivotGrid.fillColor.row"),value:"row"},{label:c("qm.pivotGrid.fillColor.col"),value:"col"}];Mi((()=>{f()}),[t.useMemo((()=>{const e=u.map((e=>{var t;return{[e.color]:`${e.mode},${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}}));return me(e,d.current)?d.current:(d.current=e,e)}),[u])]);const f=cl((()=>{const e=[];u.forEach((t=>{const n=Ra([Object.assign(Object.assign({},Xn(t,["value"])),{expression:"nil"!==t.expression?t.expression:"==",condition:t.value})]),i=Zl(s.filter((e=>!hd(e))),n);if("cell"===t.mode||"col"===t.mode)for(let n=0;n<i.length;n++)e.push({color:t.color,rowKey:r(i[n],i[n].index),dataIndex:t.fieldName});if("row"===t.mode)for(let n=0;n<i.length;n++){const l=r(i[n],i[n].index);for(let n=0;n<m.length;n++)e.push({color:t.color,rowKey:l,dataIndex:m[n].dataIndex})}})),o(e)}),200),g=()=>{a([...l,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:"and",color:"",mode:"cell"}])},v=(e,t,n)=>{var r;if(Object.assign(t,{[e]:n}),"fieldName"===e){const e=(null===(r=i.find((e=>e.dataIndex===n)).filter)||void 0===r?void 0:r.type)||"text";Object.assign(t,{type:e,expression:y(e)[0].value,value:""})}"expression"===e&&"nil"===n&&Object.assign(t,{value:""}),a([...l])},y=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:c("qm.table.highSearch.gtText")},{value:"<",label:c("qm.table.highSearch.ltText")},{value:">=",label:c("qm.table.highSearch.gteText")},{value:"<=",label:c("qm.table.highSearch.lteText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:c("qm.table.highSearch.inText")},{value:"nin",label:c("qm.table.highSearch.ninText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",label:c("qm.table.highSearch.likeText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"nil",label:c("qm.table.highSearch.nullText")}]}return t},b=e=>t.createElement(t.Fragment,null,t.createElement(Be,{className:"icon handle"}),t.createElement(Wd,{defaultValue:e.color,style:{marginLeft:5},onChangeComplete:t=>v("color",e,t.hex)}),t.createElement(H,{value:e.mode,options:h,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:90,marginLeft:10,marginRight:20},onChange:t=>v("mode",e,t)}),t.createElement(H,{value:e.fieldName||void 0,options:p,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>v("fieldName",e,t)}),"col"!==e.mode&&t.createElement(H,{value:e.expression||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),options:y(e.type),style:{width:100,margin:"0 10px"},onChange:t=>v("expression",e,t)}),"col"!==e.mode&&(e=>{var n,r;switch(e.type){case"number":return t.createElement($,{defaultValue:e.value,style:{width:150},onChange:t=>{v("value",e,Gn(t)?"":t)}});case"date":return t.createElement(In,{popupClassName:Jo.popupClassName,defaultValue:null!==(n=wa(e.value,"YYYY-MM-DD"))&&void 0!==n?n:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{v("value",e,Ca(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const n=(null===(r=i.find((t=>t.dataIndex===e.fieldName)))||void 0===r?void 0:r.dictItems)||[];return t.createElement(H,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{v("value",e,t)}},n.map((e=>t.createElement(H.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return t.createElement(O,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{v("value",e,t.target.value)}})}})(e),t.createElement(it,{className:"icon close",onClick:()=>(e=>{a(l.filter((t=>t!==e)))})(e)}));return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,c("qm.pivotGrid.fillColor.title"))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.fieldName)),n=l.map((e=>e.fieldName));me(t,n)||a(e)}},l.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},b(e)))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:g},t.createElement(rt,{className:"icon"}),c("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!u.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(ft,{className:"icon"}),c("qm.pivotGrid.fillColor.text"),u.length?`(${u.length})`:null))},Ud=()=>t.createElement("div",{className:"top-bar"},t.createElement(ir,{size:4},t.createElement($d,null),t.createElement(q,{type:"vertical"}),t.createElement(Rd,null),t.createElement(Cd,null),t.createElement(Sd,null),t.createElement(Nd,null),t.createElement(q,{type:"vertical"}),t.createElement(Od,null),t.createElement(Bd,null),t.createElement(Td,null),t.createElement(q,{type:"vertical"}),t.createElement(Fd,null)),t.createElement(ir,{size:4},t.createElement(Md,null))),Gd=t.createContext(void 0),Yd=e=>{var n,r;const{scrollbar:i}=e,{pivotRef:l,getRowKey:a,columns:o,groupGridData:s,setPivotGridRef:c}=wd(),{rowSelection:d,treeExpandable:u,rowHighlight:p}=l.current.props,m=null===(n=null==u?void 0:u.defaultExpandAllRows)||void 0===n||n,h=t.useRef({bodyEl:null,rowVirtualizer:null}),[f,g]=t.useState({gridRef:h,scrollbarRef:i,selectionKeys:null!==(r=null==d?void 0:d.defaultSelectedRowKeys)&&void 0!==r?r:[],treeExpandKeys:m?ca(l.current.originGridData,(e=>a(e,e.index))):[],highlightKey:"",checkedColumnKey:"",updateLayout:0,clicked:[],isPingLeft:!1}),v=t.useMemo((()=>Math.max(0,gd(s)-1)),[s]),y=e=>{g((t=>{const n=Object.assign({},t);let r=!1;return Object.keys(e).forEach((i=>{const l=i;Object.is(t[l],e[l])||(n[l]=e[l],r=!0)})),r?n:t}))},b=(e,t)=>{f.gridRef.current[e]=t};t.useLayoutEffect((()=>{I(),S()}),[o]),t.useLayoutEffect((()=>{(null==d?void 0:d.selectedRowKeys)&&y({selectionKeys:d.selectedRowKeys})}),[null==d?void 0:d.selectedRowKeys]),t.useLayoutEffect((()=>{void 0!==(null==p?void 0:p.currentRowKey)&&y({highlightKey:p.currentRowKey})}),[null==p?void 0:p.currentRowKey]);const x=e=>{Array.isArray(null==d?void 0:d.selectedRowKeys)||y({selectionKeys:e})},E=e=>{y({treeExpandKeys:e})},w=e=>{void 0===(null==p?void 0:p.currentRowKey)&&y({highlightKey:e})},C=e=>{y({checkedColumnKey:e})},S=()=>{y({updateLayout:f.updateLayout+1})},N=e=>{Da(e,f.clicked,!0)||y({clicked:e})},T=e=>{y({isPingLeft:e})},I=()=>{const e=i.current.container.clientWidth,{defaultColumnWidth:t}=Jo,n=[];let r=0;if(o.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,r+=e.width):(e.renderWidth=void 0,n.push(e))})),n.length>0){const r=o.reduce(((e,n)=>e+(n.width||n.minWidth||t)),0);if(r<=e){const i=e-r;if(1===n.length)n[0].renderWidth=(n[0].minWidth||t)+i;else{const e=i/n.reduce(((e,n)=>e+(n.minWidth||t)),0);let r=0;n.forEach(((n,i)=>{if(0===i)return;const l=Math.floor((n.minWidth||t)*e);r+=l,n.renderWidth=(n.minWidth||t)+l})),n[0].renderWidth=(n[0].minWidth||t)+i-r}}else n.forEach((e=>{e.renderWidth=e.minWidth||t}))}else r=o.reduce(((e,n)=>e+(n.renderWidth=n.width||n.minWidth||t)),0)},R=t.useMemo((()=>Object.assign(Object.assign({},f),{indentDepth:v,setContext:y,setGridLayoutRef:b,setSelectionKeys:x,setTreeExpandKeys:E,setHighlightKey:w,setCheckColumnKey:C,forceUpdateLayout:S,setClicked:N,setPingLeft:T,updateColumnsWidth:I})),[f,v]);return t.createElement(Gd.Provider,{value:R},e.children)},Xd=()=>t.useContext(Gd),Qd=e=>{var n;const{column:r}=e,{columns:i,setColumns:l}=wd(),{scrollbarRef:a}=Xd(),o=t.useRef(null),[s,c]=t.useState(!1),d=t.useRef(document.onselectstart),u=t.useRef({startX:0,originSizeX:0,columnWidth:0}),p=e=>{u.current=Object.assign({},u.current,e)},m=e=>{if(1!==e.buttons)return h();const t=e.clientX-u.current.startX,n=(r.width||r.renderWidth)+t;n<(r.minWidth||Jo.defaultColumnWidth)||(p({columnWidth:n}),o.current.style.left=`${u.current.originSizeX+t}px`)},h=()=>{a.current.container.style.cursor="",r.width=u.current.columnWidth,l([...i]),Bn((()=>c(!1))),qi(document,"mousemove",m),qi(document,"mouseup",h),p({startX:0,originSizeX:0,columnWidth:0}),f()},f=()=>{document.onselectstart!==d.current&&(document.onselectstart=d.current)};return t.createElement(t.Fragment,null,t.createElement("div",{className:"resize-bar",onMouseDown:e=>{e.preventDefault(),a.current.container.style.cursor="col-resize";const t=ma(e.target,a.current.container).left-a.current.scrollLeft+3;p({startX:e.clientX,originSizeX:t,columnWidth:r.width||r.renderWidth||0}),$i(document,"mousemove",m),$i(document,"mouseup",h),c(!0),Bn((()=>o.current.style.left=`${t}px`)),d.current=document.onselectstart,document.onselectstart=()=>!1}}),t.createElement(tn,{open:s,getContainer:null===(n=a.current)||void 0===n?void 0:n.container},t.createElement("div",{ref:o,className:"resize-line"})))},Zd=e=>{var n;const{left:r}=e,{scrollbarRef:i,isPingLeft:l,setPingLeft:a}=Xd(),o=Mn((e=>{a(e.target.scrollLeft>1)}));return t.useEffect((()=>{const e=i.current.container.children[0];return e.addEventListener("scroll",o),()=>{e.removeEventListener("scroll",o)}}),[]),t.createElement(tn,{open:!0,getContainer:null===(n=i.current)||void 0===n?void 0:n.container},t.createElement("div",{className:Pe("fixed-line",{active:l}),style:{left:r}}))},Jd=()=>{const{pivotRef:e,columns:n}=wd(),{indentDepth:r,updateLayout:i,checkedColumnKey:l,selectionKeys:a,setSelectionKeys:o,setCheckColumnKey:s}=Xd(),{rowSelection:c}=e.current.props,{selectionColumn:d}=Jo,{indentWidth:u,selectionColumnDefine:p}=ud,m=t.useMemo((()=>pd(n)),[n]),h=t.useMemo((()=>m.filter((e=>"left"===e.fixed))),[m]),f=t.useMemo((()=>m.filter((e=>"left"!==e.fixed))),[m]),g=t.useMemo((()=>"radio"!==(null==c?void 0:c.type)),[c]),v=t.useMemo((()=>h.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?r*u:0)),0)),[r,i,h]),y=t.useMemo((()=>a.length>0&&a.length===e.current.keyRecordMap.size),[a]),b=t.useMemo((()=>a.length>0&&a.length<e.current.keyRecordMap.size),[a]),x=(n,i)=>t.createElement("div",{className:Pe(i?"fixed-left":"no-fixed"),style:{width:i?v:""}},n.map(((a,m)=>{const{dataIndex:h,title:f,align:v,width:x,renderWidth:E}=a,w={"selection-column":h===d,"col--center":"center"===v,"col--right":"right"===v,"col--checked":l===h},C=i&&1===m||!i&&m===n.length-1?r*u:0,S={width:`${(x||E||0)+C}px`,minWidth:`${(x||E||0)+C}px`};return t.createElement("div",{key:h,className:Pe("table-cell",w),style:S,onClick:()=>{return e=h,void([p.dataIndex].includes(e)||s(l!==e?e:""));var e}},h!==d?t.createElement("span",{className:"cell"},f):g?t.createElement(F,{checked:y,indeterminate:b,onChange:t=>(t=>{var n;const r=t?Array.from(e.current.keyRecordMap.keys()):[];o(r),null===(n=null==c?void 0:c.onChange)||void 0===n||n.call(c,r,t?Array.from(e.current.keyRecordMap.values()):[])})(t.target.checked)}):"#",h!==d&&t.createElement(Qd,{column:a}))})));return t.createElement("div",{className:"header"},x(h,!0),(e=>x(e))(f),t.createElement(Zd,{left:v}))};function eu(e,t,n){var r;let i,l=null!==(r=n.initialDeps)&&void 0!==r?r:[];return()=>{var r,a,o,s,c;let d;n.key&&(null===(r=n.debug)||void 0===r?void 0:r.call(n))&&(d=Date.now());const u=e(),p=u.length!==l.length||u.some(((e,t)=>l[t]!==e));if(!(null===(a=n.noCache)||void 0===a?void 0:a.call(n))&&!p)return i;let m;if(l=u,n.key&&(null===(o=n.debug)||void 0===o?void 0:o.call(n))&&(m=Date.now()),i=t(...u),n.key&&(null===(s=n.debug)||void 0===s?void 0:s.call(n))){const e=Math.round(100*(Date.now()-d))/100,t=Math.round(100*(Date.now()-m))/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} / ${i(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null===(c=null==n?void 0:n.onChange)||void 0===c||c.call(n,i),i}}function tu(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const nu=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,i)),n)}},ru=e=>e,iu=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},lu=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(n.getBoundingClientRect())}));return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},au={passive:!0},ou="undefined"==typeof window||"onscrollend"in window,su=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const l=e.options.useScrollendEvent&&ou?()=>{}:nu(r,(()=>{t(i,!1)}),e.options.isScrollingResetDelay),a=r=>()=>{const{horizontal:a,isRtl:o}=e.options;i=a?n.scrollLeft*(o?-1:1):n.scrollTop,l(),t(i,r)},o=a(!0),s=a(!1);return s(),n.addEventListener("scroll",o,au),n.addEventListener("scrollend",s,au),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",s)}},cu=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},du=(e,{adjustments:t=0,behavior:n},r)=>{var i,l;const a=e+t;null===(l=null===(i=r.scrollElement)||void 0===i?void 0:i.scrollTo)||void 0===l||l.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class uu{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{this._measureElement(e.target,e)}))})):null);return{disconnect:()=>{var n;null===(n=t())||void 0===n||n.disconnect(),e=null},observe:e=>{var n;return null===(n=t())||void 0===n?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null===(n=t())||void 0===n?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options=Object.assign({debug:!1,noCache:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ru,rangeExtractor:iu,onChange:()=>{},measureElement:cu,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0},e)},this.notify=e=>{var t,n;null===(n=(t=this.options).onChange)||void 0===n||n.call(t,this,e)},this.maybeNotify=eu((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"maybeNotify",noCache:()=>this.options.noCache,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e,t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n)return void this.maybeNotify();this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=null!==(t=null===(e=this.scrollElement)||void 0===e?void 0:e.window)&&void 0!==t?t:null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=null!==(e=this.scrollRect)&&void 0!==e?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=null!==(e=this.scrollOffset)&&void 0!==e?e:"function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const l=r.get(t.lane);if(null==l||t.end>l.end?r.set(t.lane,t):t.end<l.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=eu((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i})),{key:!1}),this.getMeasurements=eu((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const o=this.measurementsCache.slice(0,a);for(let i=a;i<e;i++){const e=r(i),a=1===this.options.lanes?o[i-1]:this.getFurthestMeasurement(o,i),s=a?a.end+this.options.gap:t+n,c=l.get(e),d="number"==typeof c?c:this.options.estimateSize(i),u=s+d,p=a?a.lane:i%this.options.lanes;o[i]={index:i,start:s,size:d,end:u,key:e,lane:p}}return this.measurementsCache=o,o}),{key:"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=eu((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=t=>e[t].start,l=pu(0,r,i,n);let a=l;for(;a<r&&e[a].end<n+t;)a++;return{startIndex:l,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:n}):null),{key:"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=eu((()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,n,r,i)=>null===r||null===i?[]:e({startIndex:r,endIndex:i,overscan:t,count:n})),{key:"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const i=r.key,l=this.elementsCache.get(i);l!==e&&(l&&this.observer.unobserve(l),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var n;const r=this.measurementsCache[e];if(!r)return;const i=t-(null!==(n=this.itemSizeCache.get(r.key))&&void 0!==n?n:r.size);0!==i&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=eu((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n}),{key:"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return tu(t[pu(0,t.length-1,(e=>tu(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize(),r=this.getScrollOffset();"auto"===t&&e>=r+n&&(t="end"),"end"===t&&(e-=n);const i=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-n;return Math.max(Math.min(l,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),i=this.getScrollOffset();if("auto"===t)if(n.end>=i+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=i+this.options.scrollPaddingStart))return[i,t];t="start"}const l=n.start-this.options.scrollPaddingStart+(n.size-r)/2;switch(t){case"center":return[this.getOffsetForAlignment(l,t),t];case"end":return[this.getOffsetForAlignment(n.end+this.options.scrollPaddingEnd,t),t];default:return[this.getOffsetForAlignment(n.start-this.options.scrollPaddingStart,t),t]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[i,l]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const[i]=tu(this.getOffsetForIndex(e,l));t=i,r=this.getScrollOffset(),Math.abs(t-r)<1||this.scrollToIndex(e,{align:l,behavior:n})}else this.scrollToIndex(e,{align:l,behavior:n});var t,r})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e,t;const n=this.getMeasurements();let r;return r=0===n.length?this.options.paddingStart:1===this.options.lanes?null!==(t=null===(e=n[n.length-1])||void 0===e?void 0:e.end)&&void 0!==t?t:0:Math.max(...n.slice(-this.options.lanes).map((e=>e.end))),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const pu=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,l=n(i);if(l<r)e=i+1;else{if(!(l>r))return i;t=i-1}}return e>0?e-1:0};const mu="undefined"!=typeof document?t.useLayoutEffect:t.useEffect,hu=e=>(e=>{const n=t.useReducer((()=>({})),{})[1],r=Object.assign(Object.assign({},e),{onChange:(t,r)=>{var i;r?Mt(n):n(),null===(i=e.onChange)||void 0===i||i.call(e,t,r)}}),[i]=t.useState((()=>new uu(r)));return i.setOptions(r),mu((()=>i._didMount()),[]),mu((()=>i._willUpdate())),i})(Object.assign({observeElementRect:lu,observeElementOffset:su,scrollToFn:du},e)),fu=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,gu=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),vu=(e,t)=>{var n;const r=e.target;return!("button"in e&&e.button>0)&&(!(r&&!fu(r).contains(r))&&!(null===(n=t.current)||void 0===n?void 0:n.contains(r)))};function yu({ref:t,handler:n,enabled:r=!0,omitClassNames:i=[]}){const l=Mn(n),a=e.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});e.useEffect((()=>{if(!r)return;const e=e=>{vu(e,t)&&(a.current.isPointerDown=!0)},o=e=>{a.current.ignoreEmulatedMouseEvents?a.current.ignoreEmulatedMouseEvents=!1:n&&a.current.isPointerDown&&vu(e,t)&&gu(e,i)&&(a.current.isPointerDown=!1,l(e))},s=e=>{a.current.ignoreEmulatedMouseEvents=!0,n&&a.current.isPointerDown&&vu(e,t)&&gu(e,i)&&(a.current.isPointerDown=!1,l(e))},c=fu(t.current);return c.addEventListener("mousedown",e,!0),c.addEventListener("mouseup",o,!0),c.addEventListener("touchstart",e,!0),c.addEventListener("touchend",s,!0),()=>{c.removeEventListener("mousedown",e,!0),c.removeEventListener("mouseup",o,!0),c.removeEventListener("touchstart",e,!0),c.removeEventListener("touchend",s,!0)}}),[n,t,l,a,r])}const bu=e=>{const{pivotRef:n,getRowKey:r,size:i}=wd(),{scrollbarRef:l,clicked:a,setHighlightKey:o,setClicked:s}=Xd(),{flatGroupData:c}=n.current,{rowHighlight:d}=n.current.props,u=t.useMemo((()=>2*Jo.rowHeightMaps[i]),[i]),p=t.useMemo((()=>c.filter((e=>!hd(e)))),[c]),m=Mn((t=>{var n;const{keyCode:i}=t;if(!Gn(a)&&(27===i&&(o(""),s([])),38===i||40===i)){ji(t);const c=p.length;let m=p.findIndex((e=>r(e,e.index)===a[0]));const h=38===i?(--m+c)%c:++m%c,f=p[h],g=r(f,f.index);d&&(o(g),null===(n=d.onChange)||void 0===n||n.call(d,g,f)),((t,n,r)=>{const i=p.length,a=e.find((e=>e.key===r)),o=l.current.scrollTop,s=l.current.container.offsetHeight,c=a.top,d=a.height;"top"===t?c<o?l.current.SET_SCROLL_TOP(c):n===i-1&&l.current.SET_SCROLL_TOP(c-(s-d)):c+d>o+(s-u)?l.current.SET_SCROLL_TOP(c-(s-u-d)):0===n&&l.current.SET_SCROLL_TOP(c)})(38===i?"top":"bottom",h,g),s([g,a[1]])}}));t.useLayoutEffect((()=>(window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m))),[])},xu=e=>{const{column:n,keyPath:r,type:i}=e,{prefixCls:l,countMethod:a,summationData:o,setCountMethod:s}=wd(),{t:c}=Fn(),{dataIndex:d,filter:u}=n,[p,m]=t.useState(!1),h=t.useMemo((()=>{const e=[{text:c("qm.pivotGrid.count.records"),value:"count",fn:bd.count},{text:c("qm.pivotGrid.count.unique"),value:"unique",fn:bd.unique},{text:c("qm.pivotGrid.count.empty"),value:"empty",fn:bd.empty},{text:c("qm.pivotGrid.count.notEmpty"),value:"notEmpty",fn:bd.notEmpty},{text:c("qm.pivotGrid.count.sum"),value:"sum",fn:bd.sum},{text:c("qm.pivotGrid.count.max"),value:"max",fn:bd.max},{text:c("qm.pivotGrid.count.min"),value:"min",fn:bd.min},{text:c("qm.pivotGrid.count.avg"),value:"avg",fn:bd.avg}];return"number"===(null==u?void 0:u.type)?e:e.slice(0,-4)}),[]),f=t.useMemo((()=>{var e,t,n;const l=a[d];if(!l)return c("qm.pivotGrid.count.statistic");return`${h.find((e=>e.value===l)).text} ${null!==(n=null===(t=null===(s=o,u=r,e=u?fd(s,u):s)||void 0===e?void 0:e[i])||void 0===t?void 0:t[d])&&void 0!==n?n:""}`;var s,u}),[o,a]);return t.createElement(M,{open:p,trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container"),style:{padding:5}},t.createElement("div",{className:"list"},h.map((e=>{const n=e.value===a[d];return t.createElement("li",{key:e.value,className:Pe("ant-dropdown-menu-item check-item",{active:n}),onClick:()=>{s({[d]:n?void 0:e.value}),m(!1)}},t.createElement("span",{className:"label"},e.text),t.createElement("i",{className:"icon"},t.createElement($e,null)))})))),className:Pe("count-select",{show:!!a[d]}),overlayClassName:`${l}__popper`,placement:"bottomRight",overlayStyle:{minWidth:140},onOpenChange:e=>m(e)},t.createElement("span",null,f," ",t.createElement(gt,{className:"icon"})))},Eu=(e,n)=>{const{pivotRef:r,columns:i,expandedKeys:l,searchResults:a,switchIndex:o,fillColorCells:s,setExpandedKeys:c}=wd(),{gridRef:d,indentDepth:u,highlightKey:p,checkedColumnKey:m,selectionKeys:h,treeExpandKeys:f,setSelectionKeys:g,setTreeExpandKeys:v,setHighlightKey:y,setClicked:b}=Xd(),{keyRecordMap:x,isTree:E}=r.current,{bodyEl:w,rowVirtualizer:C}=d.current,{rowSelection:S,treeExpandable:N,rowHighlight:T,onRowEdit:I,onRowClick:R}=r.current.props,{t:O}=Fn(),{renderText:k,getTitleFromCellNode:L}=ds(),{selectionColumn:A,treeTable:P}=Jo,{indentWidth:_}=ud,D=t.useMemo((()=>n?0:pd(i).length-e.length),[i,e]),H=t.useMemo((()=>"radio"!==(null==S?void 0:S.type)),[S]),M=(e,t)=>{var n,r;const i=H?e?[...h,t]:h.filter((e=>e!==t)):[t];g(i),null===(n=null==S?void 0:S.onSelect)||void 0===n||n.call(S,e,x.get(t)),null===(r=null==S?void 0:S.onChange)||void 0===r||r.call(S,i,$(i))},$=e=>{const t=[];return e.forEach((e=>t.push(x.get(e)))),t},q=(e,t)=>{var n,r;return(null===(n=a[o])||void 0===n?void 0:n.rowKey)===e&&(null===(r=a[o])||void 0===r?void 0:r.dataIndex)===t},K=(e,t)=>{const n=w.querySelectorAll(`li.table-row[data-row-key='${e}']`);Array.from(n).forEach((e=>{e.classList[t&&!(null==C?void 0:C.isScrolling)?"add":"remove"]("row--hover")}))},V=e=>t.createElement("button",{className:Pe("button-icon",{expand:l.includes(e.id)}),onClick:()=>{return t=e.id,void c(l.includes(t)?l.filter((e=>e!==t)):[...l,t]);var t}},t.createElement(yt,null)),z=(e,n,r,l)=>{const{dataIndex:a,width:o,renderWidth:s}=e,c={"expandable-column":a===A},d=1===n?(u-r._groupLevel)*_:0,p={width:`${(o||s||0)+d}px`,minWidth:`${(o||s||0)+d}px`};return t.createElement("div",{key:a,className:Pe("label-cell",c),style:p},a!==A?t.createElement(t.Fragment,null,1===n&&t.createElement("span",{className:"title"},(e=>{const{_record:n,_fieldName:r}=e,l=ga(n,r),a=i.find((e=>e.dataIndex===r));return Gn(l)||!a?t.createElement("span",{className:"empty"},O("qm.pivotGrid.group.empty")):a.render?a.render(l,n,a,0,0):k(l,a,n)})(r)),t.createElement(xu,{column:e,keyPath:r.id,type:"subtotal"})):V(r))},W=(e,n)=>{var r;return t.createElement(De,{className:Pe("cell--expand",{fold:!f.includes(n)}),style:{visibility:(null===(r=e.children)||void 0===r?void 0:r.length)>0?"visible":"hidden"},onClick:()=>(e=>{var t,n;const r=f.includes(e),i=r?f.filter((t=>t!==e)):[...f,e];v(i),null===(t=null==N?void 0:N.onExpand)||void 0===t||t.call(N,!r,x.get(e)),null===(n=null==N?void 0:N.onChange)||void 0===n||n.call(N,i)})(n)})},B=(e,n,r,i,l)=>{const{dataIndex:a,width:o,renderWidth:c,align:d,render:u}=e,p=ga(r,a),f=u?u(p,r,e,r.index,n):k(p,e,r),g=L(f),v=h.includes(l),x={"selection-column":a===A,"col--center":"center"===d,"col--right":"right"===d,"col--checked":m===a,active:q(l,a)},w={width:`${o||c||0}px`,minWidth:`${o||c||0}px`,backgroundColor:s.get(`${l}|${a}`)};return t.createElement("div",{key:a,"data-col-index":n,title:g,className:Pe("table-cell",x),style:w,onClick:t=>{var n;a!==A&&(b([l,a]),T&&(y(l),null===(n=T.onChange)||void 0===n||n.call(T,l,r)),null==R||R(r,e,t))}},a!==A?t.createElement(t.Fragment,null,E&&1===n&&t.createElement(t.Fragment,null,(C=r._level)?t.createElement("span",{key:C,className:`cell--indent indent-level-${C}`,style:{paddingLeft:C*P.textIndent+"px"}}):null,W(r,l)),t.createElement("span",{className:"cell"},f)):t.createElement("div",{className:"action"},t.createElement("span",{className:"drag-icon"}),t.createElement("div",{className:"middle"},t.createElement("span",{className:"order"},((e,t)=>E?0===e._level?e._varIndex+1:null:t+1)(r,i)),H?t.createElement(F,{className:"checkbox",checked:v,onChange:e=>M(e.target.checked,l)}):t.createElement(j,{className:"checkbox",checked:v,onChange:e=>M(e.target.checked,l)})),t.createElement("span",{className:"expand-icon",onClick:()=>null==I?void 0:I(r,i)},I?t.createElement(vt,null):null)));var C};return{renderGroupRow:(n,r)=>t.createElement("div",{className:"label-row"},e.map(((e,t)=>z(e,D+t,n)))),renderRow:(n,r,i)=>{const l={"row--selection":h.includes(i),"row--highlight":p===i};return t.createElement("li",{key:i,"data-row-key":i,className:Pe("table-row",l),onMouseEnter:()=>K(i,!0),onMouseLeave:()=>K(i)},e.map(((e,t)=>B(e,D+t,n,r,i))))}}},wu=e=>{const{tbodyColumns:n,layout:r,displayList:i,virtualRows:l,notGroup:a}=e,{indentDepth:o,updateLayout:s}=Xd(),{indentWidth:c}=ud,d=t.useMemo((()=>n.filter((e=>"left"===e.fixed))),[n]),u=t.useMemo((()=>d.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?o*c:0)),0)),[o,s,d]),{renderGroupRow:p,renderRow:m}=Eu(d,!0);return t.createElement("div",{className:"left-panel",style:{width:u}},t.createElement("div",{className:Pe("container",{"no-group":a})},l.map((e=>{const n=e.index,l=r[n],a=i[n];if(hd(a))return t.createElement("div",{key:a.id,className:Pe("group-label",`level${a._groupLevel}`),style:{top:l.top,left:l.left,right:0,height:l.height}},p(a,l.key));const o=n===r.length-1||hd(i[n+1]);return t.createElement("div",{key:l.key,className:Pe("row-item",{last:o}),style:{top:l.top,left:l.left,right:0,height:l.height}},m(a,a._varIndex,l.key))}))))},Cu=e=>{const{tbodyColumns:n,layout:r,displayList:i,virtualRows:l,notGroup:a}=e;wd();const o=t.useMemo((()=>n.filter((e=>"left"!==e.fixed))),[n]),{renderGroupRow:s,renderRow:c}=Eu(o);return t.createElement("div",{className:"main-panel"},t.createElement("div",{className:Pe("container",{"no-group":a})},l.map((e=>{const n=e.index,l=r[n],a=i[n];if(hd(a))return t.createElement("div",{key:a.id,className:Pe("group-label",`level${a._groupLevel}`),style:{top:l.top,left:0,right:l.right,height:l.height}},s(a,l.key));const o=n===r.length-1||hd(i[n+1]);return t.createElement("div",{key:l.key,className:Pe("row-item",{last:o}),style:{top:l.top,left:0,right:l.right,height:l.height}},c(a,a._varIndex,l.key))}))))},Su=()=>{const{pivotRef:e,getRowKey:n,prefixCls:r,size:i,columns:l,groupGridData:a,expandedKeys:o,searchResults:s,switchIndex:c}=wd(),{scrollbarRef:d,treeExpandKeys:u,setGridLayoutRef:p}=Xd(),{flatGroupData:m}=e.current,{contextMenues:h}=e.current.props,{groupMargin:f}=ud,{rowHeightMaps:g}=Jo,v=t.useRef(null),y=t.useMemo((()=>pd(l)),[l]),b=t.useMemo((()=>Array.isArray(a)),[a]),{contextMenu:x,closeMenu:E}=(({ref:e,popup:n,getTriggerContainer:r,prevent:i,prefixCls:l="",enabled:a=!0})=>{const o=t.useRef(null),s=t.useRef(null),c=e=>{s.current=e},[d,u]=t.useState(!1),[p,m]=t.useState(null),h={width:150,height:200,zIndex:9999};yu({ref:o,handler:()=>f()});const f=()=>{u(!1),m(null),c(null)},g=Mn((e=>{if(e.preventDefault(),null==i?void 0:i(e.target))return f();c(e),u(!0),Bn((()=>{var t;const{width:n,height:r}=(null===(t=o.current)||void 0===t?void 0:t.getBoundingClientRect())||h,i=n,l=r,a=window.innerWidth,s=window.innerHeight;let c=e.clientX,d=e.clientY;c+i>a&&(c=Math.max(c-i,0)),d+l>s&&(d=Math.max(d-l,0)),m({x:c,y:d})}))}));t.useEffect((()=>{const t=(null==r?void 0:r(e.current))||e.current;return a&&t&&t.addEventListener("contextmenu",g),()=>{t&&t.removeEventListener("contextmenu",g)}}),[e]);const v={position:"fixed",top:`${(null==p?void 0:p.y)||0}px`,left:`${(null==p?void 0:p.x)||0}px`,zIndex:h.zIndex};return{contextMenu:t.createElement(tn,{open:d},t.createElement("div",{ref:o,className:`${l}__context-menu`,style:v},s.current?n(s.current):null)),closeMenu:f}})({ref:v,prevent:e=>e.offsetParent.classList.contains("group-label"),prefixCls:r,enabled:!!h,popup:e=>{var r;const i=Ui(e.target,"table-cell"),l=(null===(r=null==i?void 0:i.parentNode)||void 0===r?void 0:r.getAttribute("data-row-key"))||"",a=m.find((e=>n(e,e.index)==l)),o=Number((null==i?void 0:i.getAttribute("data-col-index"))||-1),s=y[o];return t.createElement("ul",{className:"ant-dropdown-menu",style:{padding:5}},h.map((e=>{var n;const r=(null===(n=e.disabled)||void 0===n?void 0:n.call(e,a,s))||!1;return t.createElement("li",{key:e.key,className:Pe("ant-dropdown-menu-item",{"ant-dropdown-menu-item-disabled":r}),onClick:()=>{var t;r||(Bn((()=>E())),null===(t=e.onClick)||void 0===t||t.call(e,a,s))}},e.prefix&&t.createElement("span",{className:"prefix"},e.prefix),t.createElement("span",{className:"label"},e.label),e.suffix&&t.createElement("span",{className:"suffix"},e.suffix))})))}}),w=e=>{var t;const n=m[e];for(let r=e+1;r<m.length;r++)if(null===(t=m[r]._parentRowKey)||void 0===t?void 0:t.startsWith(n.id)){Object.assign(n,{_record:m[r]});break}},C=t.useMemo((()=>{const e=new Map,t=[];return m.forEach(((r,i)=>{if(hd(r)){if(0===r._groupLevel)return e.set(r.id,o.includes(r.id)),w(i),void t.push(r);const n=r.id.slice(0,r.id.lastIndexOf(ud.separator));return void(o.includes(n)&&e.get(n)&&(e.set(r.id,o.includes(r.id)),w(i),t.push(r)))}const l=n(r,r.index);r._parentRowKey&&!e.get(r._parentRowKey)||(e.set(l,u.includes(l)),t.push(r))})),e.clear(),t}),[a,o,u]),S=t.useMemo((()=>((e,{getRowKey:t,rowHeight:n})=>{const r=[],i=[],l=n,a=ud.indentWidth,o=ud.groupMargin;let s=o;for(e.forEach((e=>{if(void 0!==e._groupLevel){for(;i.length>0&&i[i.length-1]._level>=e._groupLevel;){const e=i.pop();if(e.height=e._childHeight+l,r[e._index].height=e.height,i.length>0){const t=i[i.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}i[i.length-1];const t={key:e.id,top:s,left:a*e._groupLevel,right:a*e._groupLevel,height:l,_childHeight:0,_subGroupCount:0,_index:r.length,_level:e._groupLevel};r.push(t),i.push(t),s+=l}else{const n=i[i.length-1]||{left:0,right:0},a={key:t(e,e.index),top:s,left:n.left,right:n.right,height:l};r.push(a),s+=l,i.length>0&&(n._childHeight+=l)}}));i.length>0;){const e=i.pop();if(e.height=e._childHeight+l,r[e._index].height=e.height,i.length>0){const t=i[i.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}return r})(C,{getRowKey:n,rowHeight:g[i]})),[C,i]);bu(S);const N=t.useMemo((()=>{if(b)return S.reduce(((e,t)=>e+t.height),0)+2*f;const e=S.filter((e=>0===e._level));return e.reduce(((e,t)=>e+t.height),0)+(e.length-1)*f+2*f}),[b,S]),{rowVirtualizer:T,virtualRows:I}=(e=>{const{layout:n,isGroup:r}=e,{size:i}=wd(),{scrollbarRef:l}=Xd(),{rowHeightMaps:a}=Jo,o=t.useMemo((()=>{var e,t;return null!==(t=null===(e=l.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null}),[l.current]),s=hu({count:n.length,getScrollElement:()=>o,estimateSize:e=>n[e].height,overscan:1,noCache:r,rangeExtractor:e=>{var t;if(!r)return iu(e);const c=l.current.scrollTop,d=(null===(t=s.scrollElement)||void 0===t?void 0:t.offsetHeight)||o.offsetHeight,u=[];for(let e=0;e<n.length;e++){const t=n[e];c>t.top+t.height+a[i]||c+d+a[i]<t.top||u.push(e)}return u}}),c=s.getVirtualItems();return{rowVirtualizer:s,virtualRows:c}})({layout:S,isGroup:!b});Mi((()=>{const e=m.findIndex((e=>{var t;return n(e,e.index)===(null===(t=s[c])||void 0===t?void 0:t.rowKey)}));e>=0&&d.current.SET_SCROLL_TOP(e*g[i]);const t=y.findIndex((e=>{var t;return e.dataIndex===(null===(t=s[c])||void 0===t?void 0:t.dataIndex)}));if(t>=0){const e=y.slice(0,t).filter((e=>"left"!==e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);d.current.SET_SCROLL_LEFT(e)}}),[c,s]),t.useLayoutEffect((()=>{p("bodyEl",v.current),p("rowVirtualizer",T)}),[]);const R={tbodyColumns:y,layout:S,displayList:C,virtualRows:I,notGroup:b};return t.createElement("div",{ref:v,className:"body",style:{height:N}},t.createElement(wu,R),t.createElement(Cu,R),x)},Nu=()=>{const{columns:e,groupGridData:n,countMethod:r,setSummationData:i}=wd(),{indentDepth:l,updateLayout:a}=Xd(),{selectionColumn:o}=Jo,{indentWidth:s}=ud,c=t.useMemo((()=>pd(e)),[e]),d=t.useMemo((()=>c.filter((e=>"left"===e.fixed))),[c]),u=t.useMemo((()=>c.filter((e=>"left"!==e.fixed))),[c]),p=t.useMemo((()=>d.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?l*s:0)),0)),[l,a,d]);Mi((()=>{i(((e,t)=>{const n=[],r=e=>{const n={};for(const r in t){const i=e.map((e=>Yn(e,r)||0));n[r]=t[r](i)}return n},i=e=>{if(Array.isArray(e))return n.push(...e),{total:r(e)};const l={},a={};Object.keys(t).forEach((e=>{a[e]=[]}));for(const r in e){const o=e[r];if(Array.isArray(o)){n.push(...o);const e={};for(const n in t){const r=o.map((e=>Yn(e,n)||0));e[n]=t[n](r),a[n].push(...r)}l[r]={subtotal:e}}else{const e=i(o);l[r]=e;for(const n in t){const t=e.subtotal[n];void 0!==t&&a[n].push(t)}}}if(0===n.length)return l;const o={};for(const e in t)o[e]=t[e](a[e]);return l.subtotal=o,l},l=Array.isArray(e)?{total:r(e)}:i(e);return n.length>0&&(l.total=r(n)),delete l.subtotal,l})(n,(e=>{const t={};for(const n in e)e[n]&&Object.assign(t,{[n]:bd[e[n]]});return t})(r)))}),[r,n]);const m=(e,n)=>t.createElement("div",{className:Pe(n?"fixed-left":"no-fixed"),style:{width:n?p:""}},e.map(((r,i)=>{const{dataIndex:a,width:c,renderWidth:d}=r,u={"selection-column":a===o,"col--right":!0},p=n&&1===i||!n&&i===e.length-1?l*s:0,m={width:`${(c||d||0)+p}px`,minWidth:`${(c||d||0)+p}px`};return t.createElement("div",{key:a,className:Pe("table-cell",u),style:m},a!==o?t.createElement(xu,{column:r,keyPath:"",type:"total"}):null)})));return t.createElement("div",{className:"footer"},m(d,!0),(e=>m(e))(u))},Tu=()=>{const{prefixCls:e,size:n}=wd(),r=t.useRef(null);return t.createElement(Yd,{scrollbar:r},t.createElement(El,{ref:r,className:Pe(`${e}__layout`,n)},t.createElement(Jd,null),t.createElement(Su,null),t.createElement(Nu,null)))},Iu=()=>t.createElement("div",{className:"wrapper"},t.createElement(Tu,null)),Ru={rowKey:"id",columns:[],dataSource:[]},Ou=e=>{const n=pn(Ru,e),{rowKey:r,fromTable:i,columns:l,dataSource:a,height:o,maxHeight:s,className:c,style:d}=n,{$size:u}=$n(n),p=Mn(((e,t)=>{const n="function"==typeof r?r(e,t):null==e?void 0:e[r];return void 0===n?(tr("PivotGrid","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),m=(e,t="",n=0)=>e.map(((e,r)=>{const i=p(e,e.index);return e.index=r,e._level=n,Array.isArray(e.children)&&(e.children=m(e.children,i,n+1)),t?Object.assign(e,{_parentRowKey:t}):e})),h=e=>{let t=!1;const n=(e=>e.filter((e=>![Jo.expandableColumn,Jo.selectionColumn,"index","pageIndex",Jo.operationColumn].includes(e.dataIndex))))(e).map((e=>{"left"===e.fixed&&(t=!0);const n=Object.assign(Object.assign({},e),{fixed:"left"===e.fixed?"left":void 0,editRender:void 0});return i&&(void 0===n.fixed&&delete n.fixed,delete n.editRender),n}));return!t&&n.length&&(n[0].fixed="left",tr("PivotGrid","至少需要有一项 `fixed: left` 的固定列")),n},f=t.useMemo((()=>h(l)),[l]),g=t.useMemo((()=>m(a)),[a]),v=lr("pivot-grid"),y={[v]:!0,"is-from-table":i},b={height:o,maxHeight:o||s?s:500},x={prefixCls:v,size:u,getRowKey:p,flatColumns:f,tableData:g,pivotProps:Xn(n,["columns","dataSource","rowKey","size","height","maxHeight","className","style"])};return t.createElement("div",{className:Pe(y,c),style:Object.assign(Object.assign({},d),b)},t.createElement(Ed,x,t.createElement(Ud,null),t.createElement(Iu,null)))};Ou.displayName="PivotGrid";const ku=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{tableRef:i,prefixCls:l,flattenColumns:a}=t.useContext(Ho),{rowKey:o,uniqueKey:s}=i.current.props,{t:c}=Fn(),{tableFullData:d}=i.current,[u,p]=t.useState(!1),m=()=>{p(!0)};t.useImperativeHandle(n,(()=>({clickHandle:m})));const h={visible:u,title:c("qm.table.pivotGrid.settingTitle"),width:"80vw",loading:!1,bodyStyle:{padding:0},onClose:()=>p(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${l}-pivot-grid`,title:c("qm.table.pivotGrid.text"),onClick:()=>m()},t.createElement("i",{className:"svgicon icon"},t.createElement(bt,null))),t.createElement(Fl,h,t.createElement(Ou,{fromTable:!0,rowKey:o,uniqueKey:s,columns:a,dataSource:d})))}));ku.displayName="PivotGrid";const Lu=e=>{const{columns:n,group:r,summary:i}=e,{tableRef:l,$size:a,pagination:o,fetchParams:s,isFetch:c}=t.useContext(Ho),{fetch:d}=l.current.props,{t:u}=Fn(),p=e=>{var t;const r=n.find((t=>t.dataIndex===e));return{title:r.title,precision:r.precision,dictItems:null!==(t=r.dictItems)&&void 0!==t?t:[]}},h=r.map((e=>Object.assign({dataIndex:e.group},p(e.group)))),f=i.map((e=>e.summary===Jo.groupSummary.total.value?{dataIndex:e.summary,title:Jo.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},p(e.summary)),{formula:e.formula}))),g=t.useMemo((()=>Object.assign({},s,{[Jo.sorterFieldName]:void 0,[Jo.groupSummary.summaryFieldName]:i.map((e=>`${e.formula}|${e.summary}`)).join(","),[Jo.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[Jo.currentPageName]:1})),[s,r,i]),[v,y]=t.useState(((e,t)=>[{title:u("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...t.map((e=>{var t;const r=null===(t=n.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let i=r?{summation:r}:null;return e.dataIndex===Jo.groupSummary.total.value&&(i={dataIndex:Jo.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?i:null)}))])(h,f)),[b]=t.useState(c?[]:(e=>{const t=Oa(e,r.map((e=>e.group))),n=[];return t.forEach((e=>{const t={};v.forEach((n=>{const{dataIndex:r}=n;"index"!==r&&va(t,r,ga(e[0],r))})),i.forEach((n=>{const r=n.summary!==Jo.groupSummary.total.value?n.summary:Jo.groupSummary.recordTotalIndex,i=n.formula;"count"===i&&va(t,r,e.length),"sum"===i&&va(t,r,Se(e,r)),"max"===i&&va(t,r,Ne(e,r)[r]),"min"===i&&va(t,r,Te(e,r)[r]),"avg"===i&&va(t,r,(Se(e,r)/e.length).toFixed(2))})),n.push(t)})),n})(l.current.tableFullData)),x=Object.assign(Object.assign({size:a,height:400},c?{fetch:{api:d.api,params:g,dataKey:null==d?void 0:d.dataKey}}:{dataSource:b}),{columns:v,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${m().format(zo)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>y(e)});return t.createElement(Ip,x)},Au=e=>{const{onClose:n}=e,{global:r}=t.useContext(on),{tableRef:i,prefixCls:l,$size:a,flattenColumns:o}=t.useContext(Ho),{uniqueKey:s}=i.current.props,{t:c}=Fn(),d=t.useRef(null),u=t.useRef(null),[p,m]=t.useState(!1),[h,f]=t.useState([]),[g,v]=t.useState(""),[y,b]=t.useState("");Mi((()=>{if(y){const{group:e,summary:t}=h.find((e=>e.value===y)).list;T(e),L(t)}else{const e=H();T((null==e?void 0:e.group)||[]),L((null==e?void 0:e.summary)||[])}}),[y]),t.useEffect((()=>{F()}),[]);const x=t.useMemo((()=>s?`summary_${s}`:""),[s]),E=t.useMemo((()=>o.filter((e=>![Jo.expandableColumn,Jo.selectionColumn,"index","pageIndex",Jo.operationColumn].includes(e.dataIndex)))),[o]),w=E.filter((e=>!e.groupSummary)).map((e=>({text:Ta(e.title),value:e.dataIndex}))),C=[Jo.groupSummary.total,...E.filter((e=>!!e.groupSummary)).map((e=>({text:Ta(e.title),value:e.dataIndex})))],S=[{text:c("qm.table.groupSummary.sumText"),value:"sum"},{text:c("qm.table.groupSummary.maxText"),value:"max"},{text:c("qm.table.groupSummary.minText"),value:"min"},{text:c("qm.table.groupSummary.avgText"),value:"avg"},{text:c("qm.table.groupSummary.countText"),value:"count"}],[N,T]=t.useState([]),[I,R]=t.useState([{title:c("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(nr,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(n)}},c("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:c("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:w.map((e=>Object.assign(Object.assign({},e),{disabled:N.findIndex((t=>t.group===e.value))>-1})))})}]),[k,L]=t.useState([]),[A,P]=t.useState([{title:c("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(nr,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(n)}},c("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:c("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:C.map((e=>Object.assign(Object.assign({},e),{disabled:k.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:c("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===Jo.groupSummary.total.value?S.slice(S.length-1):S})}]),_=t.useMemo((()=>{const e=N.length&&N.every((e=>Object.values(e).every((e=>""!==e)))),t=k.length&&k.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[N,k]),D=()=>{x&&sessionStorage.setItem(x,JSON.stringify({group:N.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}))},H=()=>{if(!x)return;const e=sessionStorage.getItem(x);return e?JSON.parse(e):null},F=()=>Hn(void 0,void 0,void 0,(function*(){if(!x)return;const e=H();if(e){const{group:t,summary:n}=e;T(t),L(n)}let t=yield Qt.getItem(x);t||(t=yield M(x),Array.isArray(t)&&(yield Qt.setItem(x,t))),Array.isArray(t)&&t.length&&(f(t),!e&&b(t[0].value))})),M=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),$=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),q={visible:p,title:c("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>m(!1)};return t.createElement("div",{className:`${l}-group-summary__setting`},t.createElement("div",{className:"main"},t.createElement("div",{style:{width:"30%"}},t.createElement(Ip,{ref:d,size:a,columns:I,dataSource:N,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>R(e),onDataChange:e=>{T(e)}},t.createElement(nr,{type:"primary",icon:t.createElement(rt,null),onClick:()=>{d.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"container line"},t.createElement(Ip,{ref:u,size:a,columns:A,dataSource:k,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{L(e)}},t.createElement(nr,{type:"primary",icon:t.createElement(rt,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:g,placeholder:c("qm.table.groupSummary.configText"),disabled:_,onChange:e=>{const{value:t}=e.target;v(t)}}),t.createElement(nr,{type:"primary",disabled:!g||_,style:{marginLeft:"10px"},onClick:()=>Hn(void 0,void 0,void 0,(function*(){if(!x)return tr("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Sa(),t=[...h,{text:g,value:e,list:{group:N.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}}];f(t),b(e),v(""),yield Qt.setItem(x,t),yield $(x,t)}))},c("qm.table.groupSummary.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Jo.rowHeightMaps[a]}px`}},t.createElement("span",null,c("qm.table.groupSummary.savedSetting"))),t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===y}),title:e.text,onClick:()=>{return t=e.value,void b(t!==y?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:c("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Hn(void 0,void 0,void 0,(function*(){if(!n)return;const e=h.filter((e=>e.value!==n));f(e),n===y&&b(""),yield Qt.setItem(x,e),yield $(x,e)}))}},t.createElement(et,null))))),!h.length&&t.createElement("div",{style:{padding:$o}},t.createElement(tl,null)))))),t.createElement(Fl,q,t.createElement(Lu,{columns:E,group:N,summary:k})),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>n(),style:{marginRight:8}},c("qm.table.groupSummary.closeButton")),t.createElement(nr,{type:"primary",disabled:_,onClick:()=>(D(),void m(!0))},c("qm.table.groupSummary.confirmButton"))))},Pu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i}=t.useContext(Ho),{t:l}=Fn(),[a,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={visible:a,title:l("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${i}-group-summary`,title:l("qm.table.groupSummary.text"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(xt,null))),t.createElement(Fl,c,t.createElement(Au,{onClose:()=>o(!1)})))}));Pu.displayName="GroupSummary";const _u=e=>{const{onClose:n}=e,{global:r}=t.useContext(on),{tableRef:i,$size:l,prefixCls:a,flattenColumns:o,setSuperFilters:s,clearTableFilter:c}=t.useContext(Ho),{uniqueKey:d}=i.current.props,{t:u}=Fn(),p=t.useRef(null),[m,h]=t.useState([]),[f,g]=t.useState([]),[v,y]=t.useState(""),[b,x]=t.useState("");Mi((()=>{h(b?f.find((e=>e.value===b)).list:H()||[])}),[b]),t.useEffect((()=>{F()}),[]);const E=t.useMemo((()=>d?`superSearch_${d}`:""),[d]),w=t.useMemo((()=>o.filter((e=>!!e.filter))),[o]),C=Ra(m),S=t.useMemo((()=>!(C&&Ql(C))),[C]),N=t.useMemo((()=>!!m.length&&S),[m,S]),T=[{value:"and",text:u("qm.table.highSearch.andText")},{value:"or",text:u("qm.table.highSearch.orText")}],I=o.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:Ta(e.title)}))),R=e=>["in","nin"].includes(e),k=(e,t)=>{let n;switch(e){case"number":n="number";break;case"date":n="date";break;case"checkbox":case"radio":n=t?"select-multiple":"select";break;default:n="text"}return n},L=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:u("qm.table.highSearch.gtText")},{value:"<",text:u("qm.table.highSearch.ltText")},{value:">=",text:u("qm.table.highSearch.gteText")},{value:"<=",text:u("qm.table.highSearch.lteText")},{value:"==",text:u("qm.table.highSearch.eqText")},{value:"!=",text:u("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",text:u("qm.table.highSearch.inText")},{value:"nin",text:u("qm.table.highSearch.ninText")},{value:"==",text:u("qm.table.highSearch.eqText")},{value:"!=",text:u("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:u("qm.table.highSearch.likeText")},{value:"==",text:u("qm.table.highSearch.eqText")},{value:"!=",text:u("qm.table.highSearch.neqText")}]}return t},[A,P]=t.useState([{title:u("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(nr,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(n)}},u("qm.table.highSearch.removeText")))},{title:u("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:u("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:I,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:u("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,r;const i=Object.values(t)[0],l=null===(n=w.find((e=>e.dataIndex===i)))||void 0===n?void 0:n.filter.type,a=L(l);e.fieldType=l,e.expression=i?null===(r=a[0])||void 0===r?void 0:r.value:"",e.condition=R(e.expression)?[]:"",i||(e.bracketLeft=e.bracketRight="")}})},{title:u("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:u("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=w.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:L(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=R(e.expression)?[]:""}}}},{title:u("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,r;const i=w.find((t=>t.dataIndex===e.fieldName)),l=null==i?void 0:i.filter.type,a=null!==(r=null!==(n=null===(t=null==i?void 0:i.filter)||void 0===t?void 0:t.items)&&void 0!==n?n:null==i?void 0:i.dictItems)&&void 0!==r?r:[];return{type:k(l,R(e.expression)),editable:!0,items:a,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:u("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:u("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:T,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),_=()=>{c(),s(m.map((e=>Xn(e,["index","pageIndex"])))),D(),n()},D=()=>{E&&sessionStorage.setItem(E,JSON.stringify(m.filter((e=>!!e.fieldName))))},H=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},F=()=>Hn(void 0,void 0,void 0,(function*(){if(!E)return;const e=H();e&&h(e);let t=yield Qt.getItem(E);t||(t=yield M(E),Array.isArray(t)&&(yield Qt.setItem(E,t))),Array.isArray(t)&&t.length&&(g(t),!e&&x(t[0].value))})),M=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),$=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return t.createElement("div",{className:`${a}-super-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement(Ip,{ref:p,size:l,columns:A,dataSource:m,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(n)&&("bracketLeft"===n&&(e[n]=e[n]?"":"("),"bracketRight"===n&&(e[n]=e[n]?"":")"),h([...m]))},onDataChange:e=>{h(e)}},t.createElement(nr,{type:"primary",icon:t.createElement(rt,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),Jo.highSearch.showSQL&&C&&t.createElement("code",{className:"lang-js"},C)),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:l,value:v,placeholder:u("qm.table.highSearch.configText"),disabled:S,onChange:e=>{const{value:t}=e.target;y(t)}}),t.createElement(nr,{type:"primary",disabled:!v||S,style:{marginLeft:"10px"},onClick:()=>Hn(void 0,void 0,void 0,(function*(){if(!E)return tr("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Sa(),t=[...f,{text:v,value:e,list:m.filter((e=>!!e.fieldName))}];g(t),x(e),y(""),yield Qt.setItem(E,t),yield $(E,t)}))},u("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${Jo.rowHeightMaps[l]}px`}},t.createElement("span",null,u("qm.table.highSearch.savedSetting"))),t.createElement("ul",null,f.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===b}),title:e.text,onClick:()=>{return t=e.value,void x(t!==b?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:u("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Hn(void 0,void 0,void 0,(function*(){if(!n)return;const e=f.filter((e=>e.value!==n));g(e),n===b&&x(""),yield Qt.setItem(E,e),yield $(E,e)}))}},t.createElement(et,null))))),!f.length&&t.createElement("div",{style:{padding:$o}},t.createElement(tl,null)))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>n(),style:{marginRight:8}},u("qm.table.highSearch.closeButton")),t.createElement(nr,{type:"primary",disabled:N,onClick:()=>_()},u("qm.table.highSearch.searchButton"))))},Du=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i}=t.useContext(Ho),{t:l}=Fn(),[a,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={visible:a,title:l("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${i}-super-search`,title:l("qm.table.highSearch.text"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(Et,null))),t.createElement(Fl,c,t.createElement(_u,{onClose:()=>o(!1)})))}));Du.displayName="SuperSearch";const Hu=t.forwardRef(((e,n)=>{const{tableColumns:r,showFullScreen:i,showReload:l,showPrint:a,showImport:o,showExport:s,showClipboard:c,showCollection:d,showFastSearch:u,showSuperSearch:p,showPivotGrid:m,showGroupSummary:h,showToolBox:f}=e,{global:g}=t.useContext(on),{tableRef:v,$size:y,prefixCls:b,isFullScreen:x}=t.useContext(Ho),{uniqueKey:E,exportExcel:w}=v.current.props,{t:C}=Fn(),S=t.useRef(null),N=t.useRef(null),T=t.useRef(null),I=t.useRef(null),R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(null),_=t.useRef(null),D=t.useRef(!1),H=t.useMemo((()=>E?`toolBox_${E}`:""),[E]),[$,q]=t.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,pivotGrid:!1,groupSummary:!1}),j={fullScreen:i,reload:l,print:a,import:o,export:s&&!(null==w?void 0:w.hideIcon),clipboard:c,collection:d,fastSearch:u,superSearch:p,pivotGrid:m,groupSummary:h},[V,z]=t.useState(!1);Mi((()=>{D.current&&(B(),D.current=!1)}),[$]),t.useEffect((()=>{W()}),[]),t.useImperativeHandle(n,(()=>({exportHandle:()=>{if(!R.current)return tr("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const W=()=>{if(!H||!f)return;const e=JSON.parse(localStorage.getItem(H));e||U(H).then((e=>{e&&(q(Object.assign({},$,e)),localStorage.setItem(H,JSON.stringify(e)))})).catch((()=>{})),e&&q(Object.assign({},$,e))},B=()=>{if(!H||!f)return;const e={};for(const t in $)$[t]&&(e[t]=$[t]);localStorage.setItem(H,JSON.stringify(e)),G(H,e)},U=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==g?void 0:g.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),G=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==g?void 0:g.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),Y=e=>Hn(void 0,void 0,void 0,(function*(){z(!1),yield Wn(100),e.current.clickHandle()})),X=(e,t)=>{D.current=!0,q(Object.assign({},$,{[t]:e}))},Q={"top-toolbox__popper":!0,[`${b}--lg`]:"large"===y,[`${b}--sm`]:"small"===y};return t.createElement(t.Fragment,null,i&&t.createElement(ss,{ref:S,isFullScreen:x,open:!f||$.fullScreen}),l&&t.createElement(cs,{ref:N,open:!f||$.reload}),a&&t.createElement(us,{ref:T,tableColumns:r,open:!f||$.print}),o&&t.createElement(Cs,{ref:I,tableColumns:r,open:!f||$.import}),s&&t.createElement(id,{ref:R,tableColumns:r,open:(!f||$.export)&&!(null==w?void 0:w.hideIcon)}),c&&t.createElement(ad,{ref:O,open:!f||$.clipboard}),d&&t.createElement(sd,{ref:k,columns:r,open:!f||$.collection}),u&&t.createElement(dd,{ref:L,open:!f||$.fastSearch}),m&&t.createElement(ku,{ref:A,open:!f||$.pivotGrid}),h&&t.createElement(Pu,{ref:P,open:!f||$.groupSummary}),p&&t.createElement(Du,{ref:_,open:!f||$.superSearch}),f&&t.createElement(M,{open:V,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.fullScreen,style:{marginRight:6},onChange:e=>X(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.screen.full"))),onClick:()=>Y(S)},{key:"reload",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.reload,style:{marginRight:6},onChange:e=>X(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.refresh.text"))),onClick:()=>Y(N)},{key:"print",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.print,style:{marginRight:6},onChange:e=>X(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.print.text"))),onClick:()=>Y(T)},{key:"import",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.import,style:{marginRight:6},onChange:e=>X(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.import.textNoSpace"))),onClick:()=>Y(I)},{key:"export",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.export,style:{marginRight:6},onChange:e=>X(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.export.textNoSpace"))),onClick:()=>Y(R)},{key:"clipboard",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.clipboard,style:{marginRight:6},onChange:e=>X(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.clipboard.textNoSpace"))),onClick:()=>Y(O)},{key:"collection",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.collection,style:{marginRight:6},onChange:e=>X(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.selectCollection.text"))),onClick:()=>Y(k)},{key:"fastSearch",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.fastSearch,style:{marginRight:6},onChange:e=>X(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.fastSearch.text"))),onClick:()=>Y(L)},{key:"pivotGrid",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.pivotGrid,style:{marginRight:6},onChange:e=>X(e.target.checked,"pivotGrid"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.pivotGrid.text"))),onClick:()=>Y(A)},{key:"groupSummary",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.groupSummary,style:{marginRight:6},onChange:e=>X(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.groupSummary.text"))),onClick:()=>Y(P)},{key:"superSearch",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.superSearch,style:{marginRight:6},onChange:e=>X(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.highSearch.text"))),onClick:()=>Y(_)}];return t.createElement(K,{items:e.filter((e=>j[e.key]))})})(),overlayClassName:Pe(Q),overlayStyle:{minWidth:120},onOpenChange:e=>{z(e)}},t.createElement("span",{className:`${b}-toolbox`,title:C("qm.table.toolbox.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(wt,null)))))}));Hu.displayName="ToolBox";const Fu=(e,t)=>e.map((e=>(e.children&&(e.children=Fu(e.children,t)),t(e)))),Mu=t.forwardRef(((e,n)=>{const{columns:r}=e,{global:i}=t.useContext(on),{tableRef:l,prefixCls:a,$size:o}=t.useContext(Ho),{showColumnDefine:s,uniqueKey:c,onlyShowIcon:d,columnsChange:u}=l.current.props,{t:p}=Fn(),m=t.useRef([]),[h,f]=t.useState(!1),g=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),v=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),y=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),b=t.useMemo((()=>c?`table_${c}`:""),[c]);Mi((()=>{w(r)}),[r]),t.useLayoutEffect((()=>{C()}),[]),t.useImperativeHandle(n,(()=>({initialHandler:C})));const x=()=>{if(!b)return;const e=JSON.parse(localStorage.getItem(b));var t;if(e||(t=b,Hn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(b,JSON.stringify(e)),C()):(null==i?void 0:i.getComponentConfigApi)&&w(r)})).catch((()=>{})),!e)return;return fe(ta(e).map((e=>e.dataIndex)),ta(r).map((e=>e.dataIndex))).length>0?Fu(r,(t=>{const n=ra(e,t.dataIndex);return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Fu(e,(e=>{const t=ra(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},E=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=E(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),w=e=>{if(!b)return;const t=E(e),n=JSON.parse(localStorage.getItem(b));var r,a;l.current.columnsDefined&&!me(t,n)&&(localStorage.setItem(b,JSON.stringify(t)),r=b,a=t,Hn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.saveComponentConfigApi;if(e)try{yield e({[r]:a})}catch(e){}})))},C=()=>{const e=x();var t;e&&(t=S(e),m.current=t,null==u||u(e))},S=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((n,r)=>{const i=n.colSpan;i>1&&e.slice(r+1,r+i).every((({colSpan:e})=>0===e))&&t.push(e.slice(r,r+i))})),t},N=()=>{const e=t=>t.map((t=>{const n=ra(r,t.dataIndex)||Qn(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==u||u(e(l.current.originColumns))},T=e=>{const t=[];e.forEach((n=>{const{colSpan:r,dataIndex:i}=n;if(0===r)return;if(1===r)return t.push(n);const l=m.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===l)return t.push(n);t.push(...m.current[l].map((({dataIndex:t},r)=>{const i=e.find((e=>e.dataIndex===t));return r>0&&(void 0!==n.hidden&&(i.hidden=n.hidden),void 0!==n.fixed?i.fixed=n.fixed:i.fixed&&delete i.fixed),i})))})),r.forEach(((e,n)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(n,0,e)})),null==u||u(t)},I=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,T(r))},R=(e,n)=>{var i;const{colSpan:l,noFixed:a}=e;if(0===l)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const o=Ta(e.title),s=["svgicon","handle",`${n}-handle`],c=t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(F,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,T(r)}}),t.createElement("i",{className:Pe(s),title:p("qm.table.columnFilter.draggable")},t.createElement(Be,null)),t.createElement("span",{className:"text",title:o},o),"main"===n?t.createElement("span",{className:Pe("fixed",a?"disabled":"")},t.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedLeft"),onClick:()=>I(e,"left")},t.createElement(Ct,null)),t.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedRight"),onClick:()=>I(e,"right")},t.createElement(St,null))):"sub"!==n?t.createElement("span",{className:Pe("fixed",a?"disabled":"")},t.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.cancelFixed"),onClick:()=>I(e)},t.createElement(et,null))):null);return!e.hidden&&(null===(i=e.children)||void 0===i?void 0:i.length)?t.createElement(V,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:O(e.children,e.dataIndex)},c):c},O=(e,n)=>t.createElement("div",{className:"column-filter--wrap"},t.createElement(Gt,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:t=>{const i=t.map((e=>e.dataIndex)),l=e.map((e=>e.dataIndex));me(i,l)||((e,t)=>{ra(r,t).children=e,null==u||u([...r])})(_a(t),n)}},e.map((e=>R(e,"sub"))))),k={[`${a}__popper`]:!0,"column-filter__popper":!0,[`${a}--lg`]:"large"===o,[`${a}--sm`]:"small"===o},L=[`${a}-column-filter`,{selected:h}];return s?t.createElement(td,{action:["click"],popupVisible:h,popup:t.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"reset"},t.createElement(nr,{type:"text",size:"small",onClick:N},p("qm.table.columnFilter.reset"))),t.createElement("div",{className:"left"},t.createElement(Gt,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),n=g.map((e=>e.dataIndex));me(t,n)||T([..._a(e),...y,...v])}},g.map((e=>R(e,"left"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"main"},t.createElement(Gt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),n=y.map((e=>e.dataIndex));me(t,n)||T([...g,..._a(e),...v])}},y.map((e=>R(e,"main"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"right"},t.createElement(Gt,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:v,setList:e=>{const t=e.map((e=>e.dataIndex)),n=v.map((e=>e.dataIndex));me(t,n)||T([...g,...y,..._a(e)])}},v.map((e=>R(e,"right")))))),popupClassName:Pe(k),popupStyle:{minWidth:160},onPopupVisibleChange:e=>{f(e)},builtinPlacements:Wo,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Pe(L),title:d?p("qm.table.columnFilter.text"):void 0},t.createElement("i",{className:"svgicon icon"},t.createElement(Qe,null)),!d&&t.createElement("span",null,p("qm.table.columnFilter.text")))):null}));Mu.displayName="ColumnFilter";const $u=(e,t,n)=>{let r;for(let i=0;i<e.length;i++){const l=e[i];if(l.children)if(l.children.some((e=>e[n]===t)))r=l[n];else{const e=$u(l.children,t,n);e&&(r=e)}}return r},qu=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&qu(e.children,t),t(e)||e.children&&e.children.length))),ju=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...ju(e.children,t)),t(e)&&n.push(e)})),n},Ku=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=Ku(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},Vu=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:Vu(e.children,t,n,r)}):e)),zu=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...zu(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},Wu=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][n]===t)return[t];if(Array.isArray(e[r].children)){const i=Wu(e[r].children,t,n);if(i)return[e[r][n],i].flat()}}},Bu=(e,t)=>{var n;const r=(null===(n=e.children)||void 0===n?void 0:n.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...Bu(e,t)))),r},Uu=t.forwardRef(((e,n)=>{const{className:r,style:i,filterable:l=!0,multiple:a,draggable:o,dataSource:s,fetch:c,autoFocus:d,asyncLoad:u,checkStrictly:p,checkStrategy:m="SHOW_CHILD",placeholder:h,fieldsDefine:f,value:g,height:v,defaultSelectedKeys:y=[],defaultExpandedKeys:b=[],defaultExpandAll:x=!0,showSearchBar:E=!0,showCollapse:w=!0,onSelectChange:C,onCheckChange:S,onDragStart:N,onDragChange:T,onExpand:I}=e,{$size:R}=$n(e),{t:k}=Fn(),L=(null==f?void 0:f.valueKey)||"value",A=(null==f?void 0:f.textKey)||"text";null==f||f.children;const P=t.useRef(null),_=t.useRef(null),D=sl(P),[H,F]=t.useState(v),[M,$]=t.useState(!1),q=cl((()=>{F(P.current.offsetHeight-ee.current.offsetHeight-10)}),5);hn((()=>{v||q()}),[D.height]);const[j,K]=t.useState([]),[V,W]=t.useState({}),[B,U]=t.useState([]),[G,Y]=t.useState([]),[X,Q]=t.useState(""),[Z,J]=t.useState(x),ee=t.useRef(null),te=t.useRef([]),ne=t.useRef([]);t.useEffect((()=>{Array.isArray(s)&&(re(s),U(ie(s)),W({}))}),[s]),t.useEffect((()=>{var e;oe(),d&&(null===(e=_.current)||void 0===e||e.focus())}),[]),Mi((()=>{oe()}),[null==c?void 0:c.params]),Mi((()=>{Y(ae())}),[V]),t.useImperativeHandle(n,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],r=Ku(j,(t=>e===t[L]));r&&(Array.isArray(r.children)?r.children.push(...n):r.children=[...n],re([...j]))},REMOVE_RECORD:e=>{var t;const n=$u(j,e,L);if(void 0===n&&j.find((t=>t[L]===e)))re(j.filter((t=>t[L]!==e)));else{const r=Ku(j,(e=>n===e[L]));if(!r)return;const i=null===(t=r.children)||void 0===t?void 0:t.findIndex((t=>e===t[L]));i>=0&&(r.children.splice(i,1),re([...j]))}},UPDATE_RECORD:(e,t)=>{const n=Ku(j,(t=>e===t[L]));n&&(Ie(n,t),re([...j]))}})));const re=e=>{K(e),te.current=e,ne.current=zu(e,L)},ie=e=>{if(a)return y;const t=ju(e,(e=>y.includes(e[A])));return 1===t.length?[t[0][L]]:[]},le=e=>{var t;return(null===(t=Wu(j,e,L))||void 0===t?void 0:t.slice(0,-1))||[]},ae=()=>{if(x)return ne.current;const e=[];return B.forEach((t=>{if(a){if("SHOW_ALL"===m&&!ne.current.includes(t)&&e.push(...le(t)),"SHOW_CHILD"===m&&e.push(...le(t)),"SHOW_PARENT"===m){const n=to(j,t);if(n){const r=le(t),i=Bu(n,L);e.push(...r,...[t,...i].filter((e=>ne.current.includes(e))))}}}else e.push(...le(t))})),[...new Set([...b,...e])]},oe=()=>Hn(void 0,void 0,void 0,(function*(){var e;if(!c)return;const{api:t,params:n,dataKey:r,afterFetch:i,callback:l}=c;try{$(!0);const a=yield t(n);if(200===a.code){let t=Array.isArray(a.data)?a.data:null!==(e=ue(a.data,r))&&void 0!==e?e:[];t="function"==typeof i?yield i(t):t,re(t),U(ie(t)),W({}),null==l||l(t)}}catch(e){}$(!1)})),se=e=>`${e}|${yo.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ce=lr("search-tree"),de={[ce]:!0,[`${ce}--lg`]:"large"===R,[`${ce}--sm`]:"small"===R};return t.createElement("div",{ref:P,className:Pe(de,r),style:i},t.createElement("div",{ref:ee,className:"topper"},E&&t.createElement(O,{ref:_,value:X,size:R,placeholder:h||k("qm.form.inputPlaceholder"),suffix:t.createElement(Nt,null),allowClear:!0,onChange:e=>(e=>{if(!l)return;const t=qu(te.current,(t=>{if(!e)return!0;const n=t[A]||"";return-1!==se(n).indexOf(e)}));Q(e),K(t),Y(x||e?zu(t,L):ae())})(e.target.value)}),w&&t.createElement("a",{className:"trigger",onClick:()=>{J(!Z),Y(Z?[]:ne.current)}},Z?t.createElement(_e,null):t.createElement(De,null)," ",k(Z?"qm.form.collect":"qm.form.spread"))),t.createElement(nl,{spinning:M},t.createElement(z,{fieldNames:{title:A,key:L,children:"children"},multiple:a,draggable:o,blockNode:o,checkable:a,selectable:!a,height:H,disabled:e.disabled,checkStrictly:p,selectedKeys:null!=g?g:B,checkedKeys:null!=g?g:B,expandedKeys:G,treeData:j,loadData:u?({key:e,children:t})=>Hn(void 0,void 0,void 0,(function*(){var n;if(!c||t)return;const{api:r,params:i,dataKey:l,formatter:a=(e=>e),afterFetch:o}=c;try{const t=yield r(a(Object.assign(Object.assign({},i),{[L]:e})));if(200===t.code){let r=Array.isArray(t.data)?t.data:null!==(n=ue(t.data,l))&&void 0!==n?n:[];r="function"==typeof o?yield o(r):r;const i=Vu(te.current,e,L,r);re(i)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!X)return!1;const t=e[A]||"";return-1!==se(t).indexOf(X)},onDragStart:N,onDragEnter:e=>{Y(e.expandedKeys)},onDrop:e=>{const t=e.node.key,n=e.dragNode.key,r=e.node.pos.split("-"),i=e.dropPosition-Number(r[r.length-1]),l=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][L]===t)return n(e[r],r,e);e[r].children&&l(e[r].children,t,n)}},a=[...j];let o;if(l(a,n,((e,t,n)=>{n.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===i)l(a,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,n=[];l(a,t,((t,r,i)=>{n=i,e=r})),-1===i?n.splice(e,0,o):n.splice(e+1,0,o)}else l(a,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));re(a)},onDragEnd:e=>{null==T||T(e,j)},onExpand:(e,t)=>{Gn(e)&&J(!1),ne.current.every((t=>e.includes(t)))&&J(!0),Y(e),null==I||I(e,t)},onSelect:e=>{U(e);const t=ju(te.current,(t=>e.includes(ue(t,L))));null==C||C(a?t:t[0])},onCheck:e=>{p&&(e=e.checked),U(e),p||("SHOW_CHILD"===m&&(e=e.filter((e=>!ne.current.includes(e)))),"SHOW_PARENT"===m&&(e=e.filter(((e,t,n)=>!n.includes($u(j,e,L))))));const t=ju(te.current,(t=>e.includes(ue(t,L))));null==S||S(a?t:t[0])}})))}));Uu.displayName="QmSearchTree";const Gu=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"})),Yu=e=>{const{column:n,filters:r}=e,{$size:i,prefixCls:l,setFilters:a,clearSuperFilters:o}=t.useContext(Ho),{t:s}=Fn(),c=t.useRef(null),d=t.useRef(null),u=t.useRef(null),[p,m]=t.useState(!1),[h,f]=t.useState(!1),[g,v]=t.useState({}),y=t.useMemo((()=>{const{dataIndex:e,filter:t}=n;return`${e}|${t.type}`}),[n]),b=t.useMemo((()=>{let e=!1;for(const t in r[y])if(!Gn(r[y][t])||h){e=!0;break}return e}),[y,r,h]);t.useLayoutEffect((()=>{p&&setTimeout((()=>x()),20)}),[p]),t.useEffect((()=>{var e;me(g[y],r[y])||v({[y]:r[y]||{}}),f(""===(null===(e=r[y])||void 0===e?void 0:e["=="]))}),[r]);const x=()=>{switch(n.filter.type){case"text":c.current.focus();break;case"number":d.current.focus();break;case"textarea":u.current.focus()}},E=e=>{e&&v(e),o(),a((e=>{for(const t in e){for(const n in e[t])if(Gn(e[t][n])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][n])continue;delete e[t][n]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},r),g),e))),m(!1)},w={text:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O,{ref:c,size:i,placeholder:s("qm.table.filter.searchText",{text:Ta(e.title)}),style:{width:"180px"},value:null!==(r=null===(n=g[y])||void 0===n?void 0:n.like)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;v((e=>Object.assign({},e,{[y]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&E()}}),t.createElement("div",{style:{marginTop:8}},t.createElement(F,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;v((e=>Object.assign({},e,{[y]:{"==":n,like:null}}))),f(t)}},s("qm.table.filter.nullValue"))))},textarea:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O.TextArea,{ref:u,size:i,placeholder:s("qm.table.filter.searchAreaText",{text:Ta(e.title)}),style:{width:"220px"},value:null!==(r=null===(n=g[y])||void 0===n?void 0:n.likes)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;v((e=>Object.assign({},e,{[y]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),E())}}),t.createElement("div",{style:{marginTop:8}},t.createElement(F,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;v((e=>Object.assign({},e,{[y]:{"==":n,like:null}}))),f(t)}},s("qm.table.filter.nullValue"))))},number:e=>{const n=e=>{var t,n;return{value:null!==(n=null===(t=g[y])||void 0===t?void 0:t[e])&&void 0!==n?n:"",size:i,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||v((n=>Object.assign({},n,{[y]:Object.assign({},n[y],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&E()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement($,Rn({ref:d},n(">"),{placeholder:s("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement($,Rn({},n("<"),{placeholder:s("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement($,Rn({},n("=="),{placeholder:s("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement($,Rn({},n("!="),{placeholder:s("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const n=e=>{var t;return{value:wa(null===(t=g[y])||void 0===t?void 0:t[e],Ko),format:Ko,size:i,onChange:t=>{v((n=>Object.assign({},n,{[y]:Object.assign({},n[y],{[e]:Ca(t,Ko)})})))},onKeyDown:e=>{13===e.keyCode&&E()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(In,Rn({},n(">"),{placeholder:s("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(In,Rn({},n("<"),{placeholder:s("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(In,Rn({},n("=="),{placeholder:s("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(In,Rn({},n("!="),{placeholder:s("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("ul",null,t.createElement(j.Group,{style:{width:"100%"},value:null===(n=g[y])||void 0===n?void 0:n["=="],onChange:e=>{const{value:t}=e.target;v((e=>Object.assign({},e,{[y]:{"==":t}})))}},l.map((e=>t.createElement("li",{key:e.value},t.createElement(j,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("ul",null,t.createElement(F.Group,{style:{width:"100%"},value:null===(n=g[y])||void 0===n?void 0:n.in,onChange:e=>{v((t=>Object.assign({},t,{[y]:{in:e}})))}},l.map((e=>t.createElement("li",{key:e.value},t.createElement(F,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("div",{style:Object.assign({height:200},r.style)},t.createElement(Uu,{multiple:!0,value:(null===(n=g[y])||void 0===n?void 0:n.in)||[],dataSource:l,onCheckChange:e=>{const t=e.map((e=>e.value));v((e=>Object.assign({},e,{[y]:{in:t}})))}}))}},C=()=>t.createElement(S,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t.createElement(nr,{size:i,onClick:()=>(E({[y]:{}}),void f(!1))},s("qm.table.filter.reset")),t.createElement(nr,{type:"primary",size:i,onClick:()=>E()},s("qm.table.filter.search"))),N={"head-filter__popper":!0,[`${l}--lg`]:"large"===i,[`${l}--sm`]:"small"===i},T=["cell--filter",{selected:p,actived:b}];return t.createElement(td,{action:["click"],popupVisible:p,popup:(()=>{const e=n.filter.type,r=w[e];return r?t.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t.createElement("div",null,r(n)),C()):(tr("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:Pe(N),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{m(e)},builtinPlacements:Wo,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("div",{className:Pe(T),title:s("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t.createElement("span",{className:"svgicon icon"},t.createElement(Gu,null))))},Xu=e=>{const{column:n}=e,{tableRef:r,bordered:i}=t.useContext(Ho),{columns:l,resizable:a,columnsChange:o=Vn}=r.current.props,s=t.useMemo((()=>la(n)),[n]),c={resizable:!0,"is--line":a&&!i};return t.createElement("div",{className:Pe(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n,scrollBarRef:i}=r.current,a=n.$resizableBar,c=t.offsetWidth/2,d=e.clientX,u=ma(t,n.$table).left-i.current.scrollLeft+c;n.$table.classList.add("c--resize"),a.style.left=`${u}px`,a.style.display="block";const p=s.width||s.renderWidth;let m=p;return document.onmousemove=function(e){if("number"!=typeof p)return;const t=e.clientX-d,n=p+t;n<(s.minWidth||Jo.defaultColumnWidth)||(m=Math.floor(n),a.style.left=`${t+u}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),a.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof m&&(ra(l,s.dataIndex).width=m,o([...l]))},!1}})},Qu=e=>{const{selectionKeys:n}=e,{tableRef:r,getRowKey:i,fetchParams:l,createTableList:a,setSelectionKeysEffect:o,setInvalidRowKeys:s,setSpinning:c,isFetch:d,isWebPagination:u}=t.useContext(Ho),{rowSelection:p}=r.current.props,{fetchAllRowKeys:m,selectAllOnCurrentPage:h,filterable:f,onSelectAll:g}=p,{t:v}=Fn(),y=t.useRef([]),b=t.useMemo((()=>d&&!!m),[d,m]),x=t.useMemo((()=>!b&&!!h),[b,h]),E=t.useMemo((()=>(null==f||f)&&!x),[f,x]),C=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>i(e,e.index)))},S=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:n}=p;if(b)return y.current.length?y.current:Re(t,C());if(!x)return n?t.filter((t=>!n(e.get(t)))):t;const l=n?a().filter((e=>!n(e))).map((e=>i(e,e.index))):a().map((e=>i(e,e.index)));return Re(l,C())})(),N=n.filter((e=>!S.includes(e))),T=n.length-N.length,I=T>0&&T<S.length,R=!!T&&T===S.length;s(N);const O=()=>Hn(void 0,void 0,void 0,(function*(){var e;const t=m;let n=[];c(!0);try{const r=yield t.api(l);if(200===r.code){n=Array.isArray(r.data)?r.data:null!==(e=ue(r.data,t.dataKey))&&void 0!==e?e:[];const{disabled:l}=p;l&&(n=fe(n,a().filter((e=>l(e))).map((e=>i(e,e.index))))),y.current=n}}catch(e){}return c(!1),n})),k=e=>Hn(void 0,void 0,void 0,(function*(){let t=[];t=b?e?yield O():[]:e?S.slice(0):[],t=[...new Set([...t,...N])],o(t),null==g||g(e,t)})),L=()=>{const e=[{key:1,label:v("qm.table.selection.all"),onClick:()=>{k(!0)}},{key:2,label:v("qm.table.selection.invert"),onClick:()=>Hn(void 0,void 0,void 0,(function*(){let e=[];e=fe(n,b?yield O():S),e=[...new Set([...e,...N])],o(e)}))},{key:3,label:v("qm.table.selection.clear"),onClick:()=>{k(!1)}}];return t.createElement(K,{items:e})};return t.createElement("div",{className:"cell--selection"},t.createElement(F,{checked:R,indeterminate:I,disabled:!S.length,onChange:e=>k(e.target.checked)}),E&&t.createElement(M,{overlayClassName:"all-selection__popper",dropdownRender:()=>L()},t.createElement(De,{className:"svgicon icon"})),x&&t.createElement(w,{placement:"top",title:v("qm.table.selection.currentPage")},t.createElement(ht,{className:"info"})))},Zu=e=>{const{style:n}=e,{tableRef:r,setRowExpandedKeys:i}=t.useContext(Ho),{expandable:l}=r.current.props,[a,o]=t.useState((null==l?void 0:l.defaultExpandAllRows)||!1);Mi((()=>{i(a?[...r.current.allParentRowKeys]:[])}),[a]);const s={[`${lr("expand")}--icon`]:!0,expanded:a,collapsed:!a};return t.createElement("span",{className:Pe(s),title:"",onClick:e=>{e.stopPropagation(),o(!a)},style:n})},Ju=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),ep=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),tp=e=>{const{tableColumns:n}=e,{tableRef:r,prefixCls:i,layout:l,flattenColumns:a,sorter:o,filters:s,superFilters:c,selectionKeys:d,isFetch:u,isGroupSubtotal:p,treeExpandIndex:m,tableChange:h,setSorter:f,setElementStore:g,resetTableScroll:v,getStickyLeft:y,getStickyRight:b,createGroupData:x,createTableFullData:E}=t.useContext(Ho),{ellipsis:C,resizable:S,multipleSort:N,rowSelection:T,expandable:I}=r.current.props,[R,O]=Jo.sortDirections,{tableOriginData:k}=r.current,{t:L}=Fn(),A=t.useRef(null),P=t.useMemo((()=>k.some((e=>Array.isArray(e.children)))),[k]),_=t.useMemo((()=>!u),[u]),D=t.useMemo((()=>!u),[u]),H=t.useMemo((()=>!(null==I?void 0:I.hideExpandAll)),[I]),F=t.useMemo((()=>!!T&&(u?!(!T.selectAllOnCurrentPage&&!T.fetchAllRowKeys):!T.hideSelectAll)),[u,T]);Mi((()=>{z(),h(),v()}),[o]),Mi((()=>{G(),h(),v()}),[s]),Mi((()=>{G(),h(),v()}),[c]),t.useEffect((()=>{!Gn(o)&&Bn((()=>z())),!Gn(s)&&Bn((()=>G()))}),[]),t.useLayoutEffect((()=>{M()}),[]);const M=()=>{g("$header",A.current)},$=(e,n,i)=>{var l,a,s;const{dataIndex:c,colSpan:d,rowSpan:u,fixed:p,align:m,theadAlign:h,theadClassName:f="",sorter:g,filter:v,required:x,headRender:E}=e;if(0===d)return null;const w=h||m,N=["header--column",{"col--ellipsis":null!==(l=e.ellipsis)&&void 0!==l?l:C,"col--center":"center"===w,"col--right":"right"===w,"column--required":!!x,"column-has-sorter":g,"column-has-filter":v,"column--sort":!!o[c],"cell-fix-left":"left"===p,"cell-fix-right":"right"===p,"cell-fix-left-last":"left"===p&&!(null===(a=i[n+(null!=d?d:1)])||void 0===a?void 0:a.fixed),"cell-fix-right-first":"right"===p&&!(null===(s=i[n-1])||void 0===s?void 0:s.fixed),[f]:!!f}],T={left:"left"===p?`${y(c)}px`:"",right:"right"===p?`${b(c,"thead")}px`:""},I=S&&![Jo.expandableColumn,Jo.selectionColumn].includes(c);return t.createElement("th",{key:c,className:Pe(N),colSpan:d,rowSpan:u,style:Object.assign({},T),onClick:t=>V(t,e)},t.createElement("div",{className:"cell--wrapper"},E?t.createElement("div",{className:"cell--text cell"},E(e,r.current.tableFullData)):t.createElement(t.Fragment,null,t.createElement("div",{className:"cell--text"},q(e)),v?K(e):null)),I&&t.createElement(Xu,{column:e}))},q=e=>{const{dataIndex:n,type:i,sorter:l,title:a,description:s}=e;if(n===Jo.selectionColumn&&"checkbox"===i){if("checkbox"===i)return t.createElement("div",{className:"cell"},F?t.createElement(Qu,{selectionKeys:d}):L("qm.table.config.selectionText"));if("radio"===i)return t.createElement("div",{className:"cell"},a)}const c=[];return c.push(t.createElement("div",{key:0,className:"cell",title:Ta(a)},r.current.isTreeTable&&n===m&&H?t.createElement(Zu,null):null,n===Jo.expandableColumn&&H?t.createElement(Zu,null):a)),s&&c.push(t.createElement(w,{key:1,placement:"top",title:s},t.createElement(ht,{className:"tip"}))),l&&c.push(j(o[n])),c},j=e=>{const n=["svgicon cell--sorter__asc",{actived:e===R}],r=["svgicon cell--sorter__desc",{actived:e===O}];return t.createElement("div",{key:2,className:"cell--sorter",title:L("qm.table.sorter.text")},t.createElement("span",{className:Pe(n)},t.createElement(Ju,null)),t.createElement("span",{className:Pe(r)},t.createElement(ep,null)))},K=e=>t.createElement(Yu,{column:e,filters:s}),V=(e,t)=>{const{sorter:n,dataIndex:r}=t;if(n){const e=o[r],t=e?e===O?null:O:R;N?(delete o[r],f(Object.assign({},o,{[r]:t}))):f(Object.assign({},{[r]:t}))}},z=()=>{_&&W()},W=e=>{const t=Oe(o,(e=>null!==e));U(t),e||Object.keys(t).length||U({index:R})},B=(e,t)=>Number.isNaN(e-t)?e.toString().localeCompare(t.toString()):e-t,U=e=>{const{tableFullData:t}=r.current,n=((e,t)=>e.sort(((e,n)=>{for(const r in t){const i=a.find((e=>e.dataIndex===r)),l=t[r],o=ga(e,r),s=ga(n,r),c="function"!=typeof(null==i?void 0:i.sorter)?B(o,s):i.sorter(e,n);if(0!==c)return"ascend"===l?c:-c}return 0})).slice(0))(p?x(Ia(t)):t,e);E(n)},G=()=>{D&&Y()},Y=()=>{const e=c.length?Ra(c):Ra(s),t=""!==e?p?x(Zl(Ia(k),e,P)):Zl(k,e,P):k;E(t),W(!0)},X=da(n),{tableBodyWidth:Q}=l;return t.createElement("div",{ref:A,className:`${i}--header-wrapper`},t.createElement("table",{className:`${i}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},t.createElement("colgroup",null,a.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})}))),t.createElement("thead",null,(e=>e.map(((e,n)=>t.createElement("tr",{key:n,className:"header--row"},e.map(((t,n)=>$(t,n,e)))))))(X))))},np=t.createContext([]),rp=(e,t,n,r,i,l,a,o,s,c)=>{var d;const{clientX:u,clientY:p}=e,{top:m,height:h}=e.target.getBoundingClientRect(),f=(((null==i?void 0:i.x)||0)-u-12)/r,g=s.filter((e=>{var t,n;return null===(n=null===(t=o[e])||void 0===t?void 0:t.children)||void 0===n?void 0:n.length}));let v=ip(o,n.eventKey);if(p<m+h/2){const e=a.findIndex((e=>e===v.key)),t=a[e<=0?0:e-1];v=ip(o,t)}const y=v.key,b=v,x=v.key;let E=0,w=0;if(!g.includes(y))for(let e=0;e<f&&ap(v);e+=1)v=v.parent,w+=1;const C=t.data,S=v.node;let N=!0;return op(v)&&0===v.level&&p<m+h/2&&l({dragNode:C,dropNode:S,dropPosition:-1})&&v.key===n.eventKey?E=-1:(b.children||[]).length&&g.includes(x)?l({dragNode:C,dropNode:S,dropPosition:0})?E=0:N=!1:0===w?f>-1.5?l({dragNode:C,dropNode:S,dropPosition:1})?E=1:N=!1:l({dragNode:C,dropNode:S,dropPosition:0})?E=c?1:0:l({dragNode:C,dropNode:S,dropPosition:1})?E=1:N=!1:l({dragNode:C,dropNode:S,dropPosition:1})?E=1:N=!1,{dropPosition:E,dropLevelOffset:w,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:x,dropContainerKey:0===E?null:(null===(d=v.parent)||void 0===d?void 0:d.key)||null,dropAllowed:N}},ip=(e,t)=>e[t],lp=e=>e.split("-"),ap=e=>{if(e.parent){const t=lp(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1},op=e=>{const t=lp(e.pos);return 0===Number(t[t.length-1])},sp=({openDragSort:e})=>{const{tableRef:n,getRowKey:r,rowExpandedKeys:i,setRowExpandedKeys:l,createTableFullData:a,dataChange:o}=t.useContext(Ho),{tableFullData:s,allRowKeys:c,isTreeTable:d}=n.current,u=zn,p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),f=t.useRef(),[g,v]=t.useState({}),[y,b]=t.useState(null),[x,E]=t.useState([]),[w,C]=t.useState(0),[S,N]=t.useState({dropPosition:null,dropLevelOffset:null,dropContainerKey:null,dropTargetKey:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),T=e=>{N((t=>Object.assign({},t,e)))};t.useLayoutEffect((()=>{e&&v((e=>{const t={},n=(e,i=null,l=0)=>{const a=[];return e.forEach(((e,o)=>{const s=r(e,e.index),c={index:o,key:s,level:l,node:e,parent:i,pos:(d=(null==i?void 0:i.pos)||"0",u=o,`${d}-${u}`),nodes:[...(null==i?void 0:i.nodes)||[],e]};var d,u;Array.isArray(e.children)&&(c.children=n(e.children,c,l+1)),t[s]=c,a.push(c)})),a};return n(e),t})(s))}),[s]),t.useEffect((()=>()=>{window.removeEventListener("dragend",O)}),[]);const I=()=>{T({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},R=()=>{null!==y&&(b(null),T({dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null})),m.current=null,h.current=null},O=e=>{k(),window.removeEventListener("dragend",O)},k=(e,t,n)=>{T({dragOverNodeKey:null}),R(),p.current=null,window.removeEventListener("dragend",O)},L=e=>{const t=e.node.eventKey,n=e.dragNode.eventKey,i=e.node.pos.split("-"),l=e.dropPosition-Number(i[i.length-1]),c=(e,t,n)=>{for(let i=0;i<e.length;i++){if(r(e[i],e[i].index)===t)return n(e[i],i,e);e[i].children&&c(e[i].children,t,n)}},d=[...s];let u;if(c(d,n,((e,t,n)=>{n.splice(t,1),u=e})),e.dropToGap){let e,n=[];c(d,t,((t,r,i)=>{n=i,e=r})),-1===l?n.splice(e,0,u):n.splice(e+1,0,u)}else c(d,t,(e=>{e.children=e.children||[],e.children.unshift(u)}));a(d),o()};return{onNodeDragStart:(e,t)=>{const{eventKey:n}=t;p.current=t,m.current={x:e.clientX,y:e.clientY};const r=((e,t)=>{if(!e)return[];const n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n})(i,n);b(n),E(((e,t)=>{const n=[];return function e(t=[]){t.forEach((({key:t,children:r})=>{n.push(t),e(r)}))}(ip(t,e).children),n})(n,g)),C(2*Jo.treeTable.textIndent),l(r),window.addEventListener("dragend",O)},onNodeDragEnter:(e,t)=>{const{eventKey:n}=t;if(h.current!==n&&(h.current=n),!p.current)return void I();const{dropPosition:r,dropLevelOffset:a,dropTargetKey:o,dropContainerKey:s,dropTargetPos:v,dropAllowed:b,dragOverNodeKey:E}=rp(e,p.current,t,w,m.current,u,c,g,i,!d);-1===x.indexOf(o)&&b?(f.current||(f.current={}),Object.keys(f.current).forEach((e=>{clearTimeout(f.current[e])})),p.current.eventKey!==n&&(e.persist(),f.current[n]=window.setTimeout((()=>{var e;if(null===y)return;let t=[...i];const r=ip(g,n);r&&(null===(e=r.children)||void 0===e?void 0:e.length)&&(t=((e,t)=>{const n=(e||[]).slice();return-1===n.indexOf(t)&&n.push(t),n})(i,n)),l(t)}),800)),p.current.eventKey!==o||0!==a?T({dragOverNodeKey:E,dropPosition:r,dropLevelOffset:a,dropTargetKey:o,dropContainerKey:s,dropTargetPos:v,dropAllowed:b}):I()):I()},onNodeDragOver:(e,t)=>{if(!p.current)return;const{dropPosition:n,dropLevelOffset:r,dropTargetKey:l,dropContainerKey:a,dropAllowed:o,dropTargetPos:s,dragOverNodeKey:h}=rp(e,p.current,t,w,m.current,u,c,g,i,!d);-1===x.indexOf(l)&&o&&(p.current.eventKey===l&&0===r?null===S.dropPosition&&null===S.dropLevelOffset&&null===S.dropTargetKey&&null===S.dropContainerKey&&null===S.dropTargetPos&&!1===S.dropAllowed&&null===S.dragOverNodeKey||I():n===S.dropPosition&&r===S.dropLevelOffset&&l===S.dropTargetKey&&a===S.dropContainerKey&&s===S.dropTargetPos&&o===S.dropAllowed&&h===S.dragOverNodeKey||T({dropPosition:n,dropLevelOffset:r,dropTargetKey:l,dropContainerKey:a,dropTargetPos:s,dropAllowed:o,dragOverNodeKey:h}))},onNodeDragLeave:(e,t)=>{h.current!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(I(),h.current=null)},onNodeDragEnd:k,onNodeDrop:(e,t,n=!1)=>{const{dropPosition:r,dropTargetKey:i,dropTargetPos:l,dropAllowed:a,dragOverNodeKey:o}=S;if(!a)return;if(T({dragOverNodeKey:null}),R(),null===i)return;const s=Object.assign(Object.assign({},((e,{dragOverNodeKey:t,dropPosition:n,keyEntities:r})=>{const i=ip(r,e);return{eventKey:e,pos:i?i.pos:"",dragOver:t===e&&0===n,dragOverGapTop:t===e&&-1===n,dragOverGapBottom:t===e&&1===n}})(i,{dropPosition:r,dragOverNodeKey:o,keyEntities:g})),{data:ip(g,i).node});-1!==x.indexOf(i)&&tr("Table Draggable","无法拖放到 `dragNode` 的子节点");const c=lp(l),d={event:e,node:s,dragNode:p.current,dragNodesKeys:[p.current.eventKey].concat(x),dropToGap:0!==r,dropPosition:r+Number(c[c.length-1])};n||L(d),p.current=null},indent:w,dropOptions:S}};function cp(){const[,t]=e.useReducer((e=>e+1),0);return t}const dp=t.forwardRef(((e,n)=>{const{rowKey:r,rowIndex:i,row:l,className:a,style:o,indent:s,filter:c,dropOption:d,onNodeDragStart:u,onNodeDragEnter:p,onNodeDragOver:m,onNodeDragLeave:h,onNodeDragEnd:f,onNodeDrop:g}=e,v=t.useRef({eventKey:r,data:l,props:e}),y=t.useRef(!1),[b,x]=t.useState(!1),{dropPosition:E,dropLevelOffset:w,dragOverNodeKey:C,dropTargetKey:S,dropContainerKey:N}=d,T=C===r&&0===E,I=C===r&&-1===E,R=C===r&&1===E,O=l._level||0,k={};switch(E){case-1:Object.assign(k,{top:0,left:-w*s+O*s});break;case 1:Object.assign(k,{bottom:0,left:-w*s+O*s});break;case 0:Object.assign(k,{bottom:0,left:s+O*s})}const L={"body--row-draggable":!0,"body--row-dragging":b,"drop-target":S===r,"drop-container":N===r,"drag-over":T,"drag-over-gap-top":I,"drag-over-gap-bottom":R};return t.createElement("tr",{ref:n,"data-row-key":r,"data-row-index":i,className:Pe(a,L),style:o,draggable:!0,onMouseDown:e=>{var t;c&&(t=e.target.matches(c),y.current=t)},onDragStart:e=>{if(e.stopPropagation(),y.current)return e.preventDefault();x(!0),u(e,v.current);try{e.dataTransfer.setData("text/plain","")}catch(e){}},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),p(e,v.current)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),m(e,v.current)},onDragLeave:e=>{e.stopPropagation(),h(e,v.current)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),x(!1),g(e,v.current)},onDragEnd:e=>{e.stopPropagation(),x(!1),f(e,v.current)}},e.children,C===r&&null!==E&&null!==w&&t.createElement("td",{className:"drop-indicator",style:k}))}));dp.displayName="DraggableTr";const up=e=>{const{selectionKeys:n,column:r,record:i,rowKey:l}=e,{tableRef:a,getAllChildRowKeys:o}=t.useContext(Ho),{rowSelection:s}=a.current.props,c=t.useMemo((()=>r.type||""),[r.type]),d=e=>{var t,r;const i=null===(t=s.checkStrictly)||void 0===t||t;if(!a.current.isTreeTable||i)return!1;const l=oa(a.current.deriveRowKeys,e);return((e,t)=>{const n=new Set(t);let r=!1,i=!1;for(const t of e)if(n.has(t)?r=!0:i=!0,r&&i)break;return r&&i})(o(null!==(r=null==l?void 0:l.children)&&void 0!==r?r:[]),n)};return"radio"===c?(()=>{const e=s.disabled,r=null==e?void 0:e(i),a=!r&&n[0]===l;return t.createElement(j,{checked:a,disabled:r})})():(()=>{const e=s.disabled,r=null==e?void 0:e(i),a=!!n.includes(l);return t.createElement(F,{checked:a,indeterminate:d(l),disabled:r})})()},pp=e=>{const{record:n,rowKey:r,style:i}=e,{tableRef:l,rowExpandedKeys:a,setRowExpandedKeys:o}=t.useContext(Ho),{expandable:s={}}=l.current.props,[c]=t.useState("function"==typeof s.rowExpandable&&!s.rowExpandable(n)),d=t.useMemo((()=>a.includes(r)),[a,r]);Mi((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,n)}),[d]);const u={[`${lr("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t.createElement("span",{className:Pe(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?a.filter((e=>e!==r)):[...a,r];o(t)},style:i})},mp=t.forwardRef(((e,n)=>{const{size:r,defaultValue:i,value:l,min:a,max:o,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,stringMode:m,allowClear:h,readOnly:f,disabled:g,formatter:v=(e=>e.toString()),parser:y=(e=>e),onFocus:b}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>o&&(t=o.toString()),t&&Number(t)<a&&(t=a.toString()),p>=0&&""!==t&&(t=new Yt(t).toFixed(p)),t},E=void 0!==l,[w,C]=t.useState(null!=i?i:""),S=v(E?l:w),N=y(S);Mi((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[w]);return t.createElement(O,{ref:n,size:r,value:S,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:h,readOnly:f,disabled:g,onChange:t=>{const n=y(t.target.value.replace(/\s+/g,""));let r=/^-?\d*(\.\d*)?$/.test(n)||""===n||"-"===n;if(0===p&&n.includes(".")&&(r=!1),a>=0&&n.startsWith("-")&&(r=!1),r){if(!m&&(Number(n)>Number.MAX_SAFE_INTEGER||Number(n)<Number.MIN_SAFE_INTEGER))return;(t=>{var n;E?null===(n=e.onChange)||void 0===n||n.call(e,t):C(t)})(n)}},onFocus:b,onBlur:()=>{var t;const n=x(N);null===(t=e.onBlur)||void 0===t||t.call(e,n,N)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(N),N))}})}));mp.displayName="InputNumber";const hp=e=>{var n,r,i;const{multiple:l,tree:a={},defaultSelectedKeys:o,className:s,style:c,onClose:d}=e,{$size:u}=$n(e),{t:p}=Fn(),[m,h]=t.useState(),[f]=t.useState(null===(n=a.fetch)||void 0===n?void 0:n.params),g={[`${lr("tree-helper")}--wrapper`]:!0},v=a.fetch?Object.assign(Object.assign({},Xn(a.fetch,["params","valueKey","textKey"])),{params:f}):void 0;return t.createElement("div",{className:Pe(g,s),style:c},t.createElement(Uu,{multiple:l,fetch:v,fieldsDefine:{valueKey:null===(r=a.fetch)||void 0===r?void 0:r.valueKey,textKey:null===(i=a.fetch)||void 0===i?void 0:i.textKey},autoFocus:!0,asyncLoad:a.asyncLoad,checkStrictly:a.checkStrictly,checkStrategy:a.checkStrategy,defaultSelectedKeys:o,defaultExpandAll:a.defaultExpandAll,onSelectChange:e=>h(e),onCheckChange:e=>h(e)}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Do[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>d(null),style:{marginRight:8}},p("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!m,onClick:()=>d(m)},p("qm.dialog.confirm"))))};hp.displayName="TreeHelper";const{Search:fp}=O,gp=t.forwardRef(((e,n)=>{var r,i,l,a,o,s;const{column:c,record:d,rowKey:u,columnKey:p}=e,{tableRef:m,tableBodyRef:h,$size:f,flattenColumns:g,updateTableFlatData:v,doFieldValidate:y,dataChange:b}=t.useContext(Ho),x=t.useContext(np),{t:w}=Fn(),C=cp(),{store:S,fieldAuth:N}=m.current,T=(null===(r=c.editRender)||void 0===r?void 0:r.call(c,d,c))||{},I=t.useRef(null),R=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(!1),_=t.useRef({}),D=t.useRef({}),M=t.useRef([]),[$,q]=t.useState(!1),[j,K]=t.useState(!1),[V,z]=t.useState(T.items||[]),[B,U]=t.useState(),G=(T.editable||me(x,[u,p]))&&!T.disabled&&!(null===(i=N[p])||void 0===i?void 0:i.disabled),Y=`${u}|${p}`,X=2===x.length?`${x[0]}|${x[1]}`:"",Q=![...S.state.required,...S.state.validate].some((({x:e,y:t})=>e===u&&t===p)),Z=(null===(l=S.state.required.find((({x:e,y:t})=>e===u&&t===p)))||void 0===l?void 0:l.text)||"",J=(null===(a=S.state.validate.find((({x:e,y:t})=>e===u&&t===p)))||void 0===a?void 0:a.text)||"",ee=S.state.edited.some((({x:e,y:t})=>e===u&&t===p)),te=G||!Q||$||j,ne=!!(null===(o=T.helper)||void 0===o?void 0:o.combinedDataIndex)&&("search-helper"===T.type||"tree-helper"===T.type),re=null===(s=T.type)||void 0===s?void 0:s.endsWith("multiple");t.useLayoutEffect((()=>{te&&X===Y&&oe()}),[x]),t.useLayoutEffect((()=>{const{items:e}=T;re&&e&&le(e.map((e=>({[D.current.valueKey]:e.value,[D.current.textKey]:e.text}))))}),[]);const ie=()=>{v(),b()},le=e=>{M.current=e},oe=()=>{var e,t,n,r;const{type:i}=T;switch(i){case"text":null===(e=R.current)||void 0===e||e.focus();break;case"number":null===(t=k.current)||void 0===t||t.select();break;case"search-helper":null===(n=L.current)||void 0===n||n.focus();break;case"tree-helper":null===(r=A.current)||void 0===r||r.focus()}},se=()=>{var e,t,n,r;const{type:i}=T;switch(i){case"text":null===(e=R.current)||void 0===e||e.blur();break;case"number":null===(t=k.current)||void 0===t||t.blur();break;case"search-helper":null===(n=L.current)||void 0===n||n.blur();break;case"tree-helper":null===(r=A.current)||void 0===r||r.blur()}};t.useImperativeHandle(n,(()=>({focus:oe,blur:se,isEditable:()=>!T.disabled,isOpening:()=>$})));const ce=(e,t,n)=>{const{cornerSign:r=!0}=T.extra||{};S.addToUpdated(e),r&&S.addToEdited({x:t,y:n})},de=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",pe={text:(e,n,r)=>{var i;const{dataIndex:l}=n,{type:a,extra:o={},rules:s=[],onInput:c,onChange:d,onEnter:m,onBlur:h}=T,g=ga(e,l),v=Object.assign({},{minRows:1,maxRows:4},o.autoSize),b=r?{rows:v.minRows,autoSize:v}:null,x=o.password?O.Password:r?O.TextArea:O;return t.createElement(x,Rn({ref:R,size:f,value:g,maxLength:o.maxLength,showCount:o.showCount},b,{autoComplete:o.password?"new-password":"off",placeholder:null!==(i=o.placeholder)&&void 0!==i?i:w("qm.table.editable.inputPlaceholder"),allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,suffix:o.suffix,onChange:t=>{var r;const i=null!==(r=t.target.value)&&void 0!==r?r:"";va(e,l,i),y(s,i,u,p,Ta(n.title)),C(),null==c||c({[Y]:i}),P.current=!0},onBlur:t=>{var n;const r=null!==(n=t.target.value)&&void 0!==n?n:"";P.current&&(P.current=!1,ce(e,u,p),null==d||d({[Y]:r},e),null==h||h({[Y]:r},e),ie())},onKeyUp:t=>{var n;if(13===t.keyCode&&!t.shiftKey){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==m||m({[Y]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&m&&e.preventDefault()}}))},textarea:(e,t)=>pe.text(e,t,!0),number:(e,n)=>{var r,i;const{dataIndex:l,precision:a,formatType:o}=n,{type:s,extra:c={},rules:d=[],onInput:m,onChange:h,onEnter:g,onBlur:v}=T,b=ga(e,l);let x,E;return"finance"===o&&(x=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},E=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===o&&(x=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new Yt(e).times(100).toNumber()}`,E=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new Yt(e).times(.01).toString()),t.createElement(mp,{ref:k,size:f,value:b,min:c.min,max:c.max,precision:a,stringMode:c.stringMode,prefix:c.prefix,suffix:null!==(r=c.suffix)&&void 0!==r?r:"percent"===o?"%":void 0,placeholder:null!==(i=c.placeholder)&&void 0!==i?i:w("qm.table.editable.inputPlaceholder"),maxLength:c.maxLength,allowClear:c.allowClear,readOnly:c.readOnly,disabled:c.disabled,formatter:x,parser:E,onChange:t=>{va(e,l,t),y(d,t,u,p,Ta(n.title)),C(),null==m||m({[Y]:t}),P.current=!0},onBlur:(t,n)=>{if(!P.current)return;P.current=!1;let r=c.stringMode?t:de(t);"percent"===o&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),va(e,l,r),ce(e,u,p),null==h||h({[Y]:r},e),null==v||v({[Y]:r},e),ie()},onEnter:(t,n)=>{let r=c.stringMode?t:de(t);"percent"===o&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),null==g||g({[Y]:r},e)}})},select:(e,n,r)=>{var i,l;const{dataIndex:a,dictItems:o=[]}=n,{type:s,extra:c={},rules:d=[],items:m,onChange:h,onEnter:g}=T,v=m||o,b=ga(e,a);let x=b;return t.createElement(H,{mode:r?"multiple":void 0,size:f,popupClassName:Jo.popupClassName,value:b||void 0,placeholder:null!==(i=c.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:c.allowClear,listHeight:c.listHeight,maxTagCount:c.collapseTags?"responsive":void 0,maxTagTextLength:c.maxTagTextLength,disabled:c.disabled,style:{width:"100%"},showSearch:null===(l=c.filterable)||void 0===l||l,filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"";return`${r}|${yo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onDropdownVisibleChange:e=>q(e),onChange:t=>{va(e,a,t),y(d,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e),ie()},onSelect:e=>{x=e},onInputKeyDown:t=>{13===t.keyCode&&Bn((()=>null==g?void 0:g({[Y]:x},e)))}},v.map((e=>t.createElement(H.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>pe.select(e,t,!0),date:(e,n,r)=>{var i;const{dataIndex:l}=n,{type:a,extra:o={},rules:s=[],onChange:c}=T,d=r||"exactdate",m=ga(e,l);return t.createElement(In,{size:f,popupClassName:Jo.popupClassName,value:null!==(i=wa(m,za[d]))&&void 0!==i?i:void 0,picker:Va[d],format:o.format,showTime:"datetime"===d,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:n}=o;return t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day")})(e),placeholder:o.placeholder,allowClear:o.allowClear,disabled:o.disabled,style:{width:"100%"},onChange:t=>{const r=Ca(t,za[d]);va(e,l,r),y(s,r,u,p,Ta(n.title)),ce(e,u,p),null==c||c({[Y]:r},e),ie()}})},datetime:(e,t)=>pe.date(e,t,"datetime"),month:(e,t)=>pe.date(e,t,"month"),year:(e,t)=>pe.date(e,t,"year"),time:(e,n)=>{var r;const{dataIndex:i}=n,{type:l,extra:a={},rules:o=[],onChange:s}=T,c="HH:mm:ss",d=ga(e,i);return t.createElement(On,{size:f,popupClassName:Jo.popupClassName,value:null!==(r=wa(d,c))&&void 0!==r?r:void 0,format:a.format||c,placeholder:a.placeholder,allowClear:a.allowClear,disabled:a.disabled,style:{width:"100%"},onChange:t=>{const r=Ca(t,c);va(e,i,r),y(o,r,u,p,Ta(n.title)),ce(e,u,p),null==s||s({[Y]:r},e),ie()}})},checkbox:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],onChange:o}=T,{trueValue:s=qo,falseValue:c=jo,disabled:d}=l,m=ga(e,r);return t.createElement(F,{checked:m===s,disabled:d,onChange:t=>{const i=t.target.checked?s:c;va(e,r,i),y(a,i,u,p,Ta(n.title)),ce(e,u,p),null==o||o({[Y]:i},e),ie()}})},switch:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],onChange:o}=T,{trueValue:s=qo,falseValue:c=jo,disabled:d}=l,m=ga(e,r);return t.createElement(W,{checked:m===s,disabled:d,onChange:t=>{const i=t?s:c;va(e,r,i),y(a,i,u,p,Ta(n.title)),ce(e,u,p),null==o||o({[Y]:i},e),ie()}})},"search-helper":(e,n)=>{var r,i;const{dataIndex:l,precision:a}=n,{type:o,extra:s={},rules:c=[],helper:d={},onInput:m,onChange:h,onEnter:v}=T,b=ya(e,ne?d.combinedDataIndex:l),x=d.fieldAliasMap;x||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof x?x():x||{};Object.keys(E).includes(l)||tr("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ne&&(d.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||tr("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[l].includes("|")&&tr("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=e=>{const{filterAliasMap:t}=d,n=""!==e?e:void 0,r=("function"==typeof t?t():t)||[],i={[l]:n};return(Array.isArray(r)?r:[r]).forEach((e=>{if(ae(e))for(const t in e)i[t]="function"==typeof e[t]?e[t](n):n;else i[e]=n})),i},S=e=>{const{autoQueryAssign:t=!0}=d;t&&(_.current=C(e)),q(!0)},N=(t,r)=>{const{beforeOpen:i}=d,l=(null!=i?i:zn)({[Y]:b},e,n);(null==l?void 0:l.then)?l.then((()=>{S(t),null==r||r()})).catch((()=>{})):!1!==l&&(S(t),null==r||r())},I=e=>{const t={};for(const n in E){const r=E[n];n!==l&&(t[n]=ya(e,r))}const n=E[l]?ya(e,E[l]):"";O(n,t);const{closed:r}=d;q(!1),null==r||r(e)},R=()=>{const{onlySelect:e=!0}=d;P.current&&O(e?"":b),q(!1)},O=(t="",r)=>{var i;if(ae(r)&&Object.keys(r).length)for(const t in r){const n=r[t],l=g.find((e=>e.dataIndex===t));if(l){va(e,t,n,l.precision);const r=null===(i=l.editRender)||void 0===i?void 0:i.call(l,e,l);r&&Array.isArray(r.rules)&&y(r.rules,n,u,t,Ta(l.title))}else va(e,t,n)}ne&&!t&&((e,t,n,r)=>{if(!t.includes("|"))return va(e,t,n,r);const i=n.split("|")||[];t.split("|").forEach(((t,n)=>{var r;t&&va(e,t,null===(r=i[n])||void 0===r?void 0:r.trim())}))})(e,d.combinedDataIndex,""),va(e,l,t,a),y(c,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e),ie(),_.current={},P.current=!1,U(void 0)},k={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:Jo.popupClassName,bodyStyle:{paddingBottom:`${Do[f]+20}px`},onClose:()=>{R()}},A=Object.assign(Object.assign({},d),{size:f,initialValue:Object.assign({},_.current,d.initialValue),onClose:e=>{e?I(e):R()}});return t.createElement(t.Fragment,null,t.createElement(fp,{ref:L,value:null!=B?B:b,placeholder:null!==(i=s.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:r=!0,table:i}=d;if(P.current&&!$)return n&&r&&(null===(t=null==i?void 0:i.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=d,{beforeFetch:r=zn}=t.fetch;return new Promise(((i,l)=>Hn(void 0,void 0,void 0,(function*(){var a;const o=Ie({},t.fetch.params,Object.assign(Object.assign({},n),C(e)),{currentPage:1,pageSize:500});if(!r(o))return l();K(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(a=ue(e.data,t.fetch.dataKey))&&void 0!==a?a:[];i(n)}else l()}catch(e){l(e)}finally{Bn((()=>K(!1)))}}))))})(n).then((e=>((e=[],t)=>{const n=e.filter((e=>ya(e,E[l]).toString().includes(t)));if(1===n.length)return I(n[0]);N(t)})(e,n))).catch((()=>O(""))):void O(n)},onChange:e=>{const{value:t}=e.target;null==m||m({[Y]:t}),P.current=!0,U(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const n=null!==(t=e.target.value)&&void 0!==t?t:"";!$&&N(n)}},onDoubleClick:e=>{const{value:t}=e.target;N(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&N(e)}}),t.createElement(Fl,k,t.createElement(Rp,A)))},"search-helper-multiple":(e,n)=>{var r,i;const{dataIndex:l}=n,{type:a,items:o=[],extra:s={},rules:c=[],helper:d={},onInput:m,onChange:h,onEnter:g}=T,v=ga(e,l),b=d.fieldAliasMap;b||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes("valueKey")&&Object.keys(x).includes("textKey")||tr("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),D.current=x;const C=t=>{const{beforeOpen:r}=d,i=(null!=r?r:zn)({[Y]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{q(!1)},N=t=>{va(e,l,t),y(c,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e,M.current),ie()},I={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:Jo.popupClassName,bodyStyle:{paddingBottom:`${Do[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},d),{size:f,multiple:!0,initialValue:Ie({},d.initialValue),defaultSelectedKeys:v,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:r}=x;le(ke([...M.current.filter((e=>t.includes(e[r]))),...e],r));const i=M.current.map((e=>({text:e[n],value:e[r]}))),l=ke([...i,...o],"value").filter((e=>t.includes(e.value)));z(l),N(l.map((e=>e.value)));const{closed:a}=d;q(!1),null==a||a(M.current)})(e,t):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement(H,{mode:"multiple",open:!1,value:v,placeholder:null!==(i=s.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,maxTagCount:s.collapseTags?"responsive":void 0,maxTagTextLength:s.maxTagTextLength,disabled:s.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!$&&C()},onDoubleClick:()=>{s.disabled||C()},onChange:e=>{const{valueKey:t}=x;le(M.current.filter((n=>e.includes(n[t])))),N(e)}},V.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:s.disabled,icon:t.createElement(Nt,null),onClick:()=>{C()}})))),t.createElement(Fl,I,t.createElement(Rp,R)))},"tree-helper":(e,n)=>{var r,i,l;const{dataIndex:a,precision:o}=n,{type:s,extra:c={},rules:d=[],helper:m={},onChange:h,onEnter:v}=T,b=ya(e,ne?m.combinedDataIndex:a),x=m.fieldAliasMap;x||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof x?x():x||{};Object.keys(E).includes(a)||tr("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ne&&(m.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||tr("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[a].includes("|")&&tr("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=t=>{const{beforeOpen:r}=m,i=(null!=r?r:zn)({[Y]:b},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{q(!1)},N=(t="",r)=>{var i;if(ae(r)&&Object.keys(r).length)for(const t in r){const n=r[t],l=g.find((e=>e.dataIndex===t));if(l){va(e,t,n,l.precision);const r=null===(i=l.editRender)||void 0===i?void 0:i.call(l,e,l);r&&Array.isArray(r.rules)&&y(r.rules,n,u,t,Ta(l.title))}else va(e,t,n)}va(e,a,t,o),y(d,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e),ie()},I={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=m.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:Jo.popupClassName,bodyStyle:{paddingBottom:`${Do[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},m),{defaultSelectedKeys:[b],size:f,onClose:e=>{e?(e=>{const t={};for(const n in E){const r=E[n];n!==a&&(t[n]=ya(e,r))}const n=E[a]?ya(e,E[a]):"";N(n,t);const{closed:r}=m;q(!1),null==r||r(e)})(e):S()}});return t.createElement(t.Fragment,null,t.createElement(fp,{ref:A,value:b,allowClear:null===(i=c.allowClear)||void 0===i||i,readOnly:c.readOnly,disabled:c.disabled,placeholder:null!==(l=c.placeholder)&&void 0!==l?l:w("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!$&&C())},onDoubleClick:()=>{C()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?C():N(""))}}),t.createElement(Fl,I,t.createElement(hp,R)))},"tree-helper-multiple":(e,n)=>{var r,i;const{dataIndex:l}=n,{type:a,extra:o={},items:s=[],rules:c=[],helper:d={},onInput:m,onChange:h,onEnter:g}=T,v=ga(e,l),b=d.fieldAliasMap;b||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes("valueKey")&&Object.keys(x).includes("textKey")||tr("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),D.current=x;const C=t=>{const{beforeOpen:r}=d,i=(null!=r?r:zn)({[Y]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{q(!1)},N=t=>{va(e,l,t),y(c,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e,M.current),ie()},I={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:Jo.popupClassName,bodyStyle:{paddingBottom:`${Do[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},d),{size:f,multiple:!0,initialValue:Ie({},d.initialValue),defaultSelectedKeys:v,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=x;le(e);const r=M.current.map((e=>({text:e[t],value:e[n]})));z(r),N(r.map((e=>e.value)));const{closed:i}=d;q(!1),null==i||i(M.current)})(e):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement(H,{mode:"multiple",open:!1,value:v,placeholder:null!==(i=o.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!$&&C()},onDoubleClick:()=>{o.disabled||C()},onChange:e=>{const{valueKey:t}=x;le(M.current.filter((n=>e.includes(n[t])))),N(e)}},V.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:o.disabled,icon:t.createElement(Nt,null),onClick:()=>{C()}})))),t.createElement(Fl,I,t.createElement(hp,R)))},custom:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],render:o,onChange:s}=T;if(!o)return tr("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const c=ga(e,r),d=t=>{va(e,r,t),y(a,t,u,p,Ta(n.title)),ce(e,u,p),null==s||s({[Y]:t},e),ie()},m=o(e,n,d);return t.isValidElement(m)?t.cloneElement(m,{value:c,disabled:l.disabled,readOnly:l.readOnly,popupClassName:Jo.popupClassName,onChange:d}):null}};return t.createElement(t.Fragment,null,te?(()=>{const{type:e}=T,n=pe[e];if(!n)return tr("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!Q}];return t.createElement("div",{ref:I,className:Pe(r)},n(d,c),!Q&&t.createElement("div",{className:"cell-error"},Z||J))})():(()=>{const{disabled:n,extra:r={}}=T,{disabledColor:i,disabledBgColor:l}=r,a=["cell--show",{"is-cell-bg":n&&l}];return t.createElement(t.Fragment,null,t.createElement("span",{className:Pe(a),style:{color:n?i:""}},e.children),n&&l&&t.createElement("i",{className:"cell--bg",style:{background:l}}))})(),ee&&t.createElement("i",{className:"cell--sign"}))}));gp.displayName="CellEdit";const vp=e=>{const{text:n,options:r,showMessage:i=!0,onCopy:l}=e,{t:a}=Fn();return dl(e.children,{onClick:o=>{const s=t.Children.only(e.children),c=nn(n,r);null==l||l(n,c),c&&i&&R.success(a("qm.clipboard.success")),s&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(o)}})};vp.displayName="QmCopyToClipboard";const yp=t.forwardRef(((n,r)=>{const{column:i,row:l,rowIndex:a,columnIndex:o,rowKey:s,showTitle:c}=n,{tableRef:d,selectionKeys:u,treeExpandIndex:p,updateMark:m}=t.useContext(Ho),{dataIndex:h,canCopy:f,render:g,editRender:v,shouldCellUpdate:y}=i,{t:b}=Fn(),{renderText:x,getTitleFromCellNode:E}=ds(),w=t.useRef(null),C=ga(l,h),[S,N]=function(t,n,r){const i=e.useRef({});return"value"in i.current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value}((()=>{const e=g?g(C,l,i,a,o):x(C,i,l);return[e,v?t.createElement(gp,{ref:r,column:i,record:l,rowKey:s,columnKey:h},e):null]}),[m,l,C,g,v],((e,t)=>{if(y){const[,n]=e,[,r]=t;return y(r,n,l)}return!Da(e,t,!0)}));t.useEffect((()=>{if([Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn].includes(h))return;const e=w.current.parentNode;c?e.title=E(S):e.removeAttribute("title")}),[c,S]);const T=e=>Array.isArray(e.children);return t.createElement("div",{ref:w,className:"cell"},(()=>{if(h===Jo.expandableColumn)return t.createElement(pp,{record:l,rowKey:s});if(h===Jo.selectionColumn)return t.createElement(up,{selectionKeys:u,column:i,record:l,rowKey:s});if(N)return N;if(d.current.isTreeTable&&h===p)return t.createElement(t.Fragment,null,(e=l._level)?t.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*Jo.treeTable.textIndent+"px"}}):null,t.createElement(pp,{key:"expand",record:l,rowKey:s,style:T(l)?{}:{visibility:"hidden"}}),S);var e;if(f){const e=E(S);return t.createElement("div",{className:"cell--copy"},t.createElement("span",{className:"text"},S),e&&t.createElement(vp,{text:e},t.createElement(Ze,{className:"icon",title:b("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return S})())}));yp.displayName="Cell";const bp={open:!1,offsetX:0,offsetY:0},xp=t.forwardRef(((e,n)=>{const{rowVirtualize:r}=e,{tableRef:i,getRowKey:l,prefixCls:a,tableFlatData:o,flattenColumns:s,mergedTdCells:c,setMergedCells:d}=t.useContext(Ho),{areaSelection:u={}}=i.current.props,{elementStore:p,scrollYLoad:m}=i.current,{t:h}=Fn(),f=t.useRef(document.onselectstart),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=e=>{y.current=e},[x,E]=t.useState(null),[w,C]=t.useState(null),[S,N]=t.useState(null),T=e=>{if(!e)return N(null);let t=!1;for(const n in e)if((null==S?void 0:S[n])!==e[n]){t=!0;break}t&&N(Object.assign({},S,e))};yu({ref:g,handler:()=>K()}),t.useEffect((()=>{const e=Kt(p.$tableBody,"mousedown",H),t=Kt(p.$tableBody,"contextmenu",_),n=Kt(document,"keydown",D);return()=>{e.remove(),t.remove(),n.remove()}}),[]);const I=()=>{E(null),T(null),b(null),C(null)};t.useImperativeHandle(n,(()=>({blur:I})));const R=e=>{let t=e;for(;t;){if(!p.$tableBody.contains(t))return null;if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},O=e=>({rowIndex:parseInt(e.parentNode.getAttribute("data-row-index"),10),colIndex:parseInt(e.getAttribute("data-col-index"),10),rowspan:Number(e.getAttribute("rowspan")||1),colspan:Number(e.getAttribute("colspan")||1),l:e.offsetLeft,t:e.offsetTop,w:e.offsetWidth,h:e.offsetHeight}),k=e=>({colStart:e.colIndex,colEnd:e.colIndex+e.colspan,rowStart:e.rowIndex,rowEnd:e.rowIndex+e.rowspan}),L=e=>{let[t,n,r,i]=[1/0,-1/0,1/0,-1/0];for(const l of e)t=Math.min(t,l.rowStart),n=Math.max(n,l.rowEnd),r=Math.min(r,l.colStart),i=Math.max(i,l.colEnd);return{rowStart:t,rowEnd:n,colStart:r,colEnd:i}},A=cl((e=>{let t=L([k(e),y.current]);c.forEach((e=>{const n=o.findIndex((t=>l(t,t.index)===e.rowKey)),r=s.findIndex((t=>t.dataIndex===e.dataIndex)),i={rowStart:n,rowEnd:n+e.rowSpan,colStart:r,colEnd:r+e.colSpan};var a,c;c=i,(a=t).rowEnd<=c.rowStart||a.rowStart>=c.rowEnd||a.colEnd<=c.colStart||a.colStart>=c.colEnd||(t=L([t,i]))})),T(t)}),5),P=e=>{var t;d(e),null===(t=u.onCellMerge)||void 0===t||t.call(u,e),Bn((()=>I()))},_=Mn((e=>{u.cellMerge&&x&&q(e.clientX,e.clientY)?(e.preventDefault(),j(e)):(null==w?void 0:w.open)&&K()})),D=Mn((e=>{27===e.keyCode&&I()})),H=Mn((e=>{e.stopPropagation();const t=R(e.target);if(1!==e.buttons||!t)return;K();const n=O(t);E(n);const r=k(n);b(r),T(r),document.addEventListener("mousemove",F),document.addEventListener("mouseup",M),f.current=document.onselectstart,document.onselectstart=()=>!1})),F=Mn((e=>{const t=R(e.target);t&&A(O(t))})),M=Mn((()=>{var e;null===(e=u.onSelectChange)||void 0===e||e.call(u,(()=>{const e=[];if(!x||!S)return e;for(let t=S.rowStart;t<S.rowEnd;t++)for(let n=S.colStart;n<S.colEnd;n++)e.push({rowKey:l(o[t],o[t].index),dataIndex:s[n].dataIndex,cellValue:ga(o[t],s[n].dataIndex)});return e})()),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",M),$()})),$=()=>{document.onselectstart!==f.current&&(document.onselectstart=f.current)},q=(e,t)=>{const{top:n,left:r}=p.$tableBody.parentNode.getBoundingClientRect(),[i,l]=[e-r,t-n],{el:a,et:o,ew:s,eh:c}=U();return!(i<a||i>a+s||l<o||l>o+c)},j=e=>{const{top:t,left:n,height:r}=v.current.getBoundingClientRect();C({open:!0,offsetX:e.clientX-n,offsetY:-1*(r-(e.clientY-t))})},K=()=>{C((e=>Object.assign(Object.assign({},e),{open:!1})))},V=e=>({rowIndex:o.findIndex((t=>l(t,t.index)===e.rowKey)),colIndex:s.findIndex((t=>t.dataIndex===e.dataIndex)),rowSpan:e.rowSpan,colSpan:e.colSpan}),z=()=>{if(!x||!S||(t=S,(e=x).rowIndex===t.rowStart&&e.colIndex===t.colStart&&e.rowspan===t.rowEnd-t.rowStart&&e.colspan===t.colEnd-t.colStart))return I();var e,t;const n={rowKey:l(o[S.rowStart],o[S.rowStart].index),dataIndex:s[S.colStart].dataIndex,rowSpan:S.rowEnd-S.rowStart,colSpan:S.colEnd-S.colStart};P([...c.filter((e=>!((e,t)=>{const n=V(e),r=V(t),[i,l,a,o]=[n.rowIndex,n.colIndex,n.rowIndex+n.rowSpan-1,n.colIndex+n.colSpan-1],[s,c,d,u]=[r.rowIndex,r.colIndex,r.rowIndex+r.rowSpan-1,r.colIndex+r.colSpan-1];return i<=s&&l<=c&&a>=d&&o>=u||s<=i&&c<=l&&d>=a&&u>=o})(e,n))),n])},W=()=>{const e=l(o[S.rowStart],o[S.rowStart].index),t=s[S.colStart].dataIndex;P(c.filter((n=>!(n.rowKey===e&&n.dataIndex===t))))},B=e=>{if(m){return Array.from(r.itemSizeCache.values()).slice(0,e).reduce(((e,t)=>e+t),0)}if(e>=o.length)return p.$tableBody.parentNode.offsetHeight;const t=l(o[e],o[e].index),n=p.$tableBody.querySelector(`tbody > tr[data-row-key="${t}"]`);return n?n.offsetTop:i.current.rowHeight*e},U=()=>{const{w:e,h:t,l:n,t:r}=x,i=s.slice(0,S.colStart).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),l=B(S.rowStart);return{sl:n,st:r,sw:e,sh:t,el:i,et:l,ew:s.slice(0,S.colEnd).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)-i,eh:B(S.rowEnd)-l}};return t.createElement("div",{className:`${a}--area-select`},(()=>{if(!x||!S)return null;const{sl:e,st:n,sw:r,sh:i,el:l,et:a,ew:o,eh:s}=U(),{open:c,offsetX:d,offsetY:u}=w||bp,p=t.createElement("ul",{ref:g,className:"ant-dropdown-menu"},t.createElement("li",{className:"ant-dropdown-menu-item",onClick:z},h("qm.table.areaSelect.mergeCell")),t.createElement("li",{className:"ant-dropdown-menu-item",onClick:W},h("qm.table.areaSelect.cancelMerge")));return t.createElement(t.Fragment,null,t.createElement("div",{className:"active-area",style:{left:e,top:n,width:r,height:i}}),t.createElement(td,{popupVisible:c,popup:p,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:Jo.popupClassName,builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,u+4],overflow:{adjustX:1,adjustY:1}}}},t.createElement("div",{ref:v,className:"checked-area",style:{left:l,top:a,width:o,height:s}})))})())}));xp.displayName="AreaSelect";const Ep=t.forwardRef(((e,n)=>{const{tableRef:r,getRowKey:i,prefixCls:l,tableFlatData:a,flattenColumns:o,editableColumns:s,leftFixedColumns:c,rightFixedColumns:d,derivedMergeCells:u,sorter:p,layout:m,showFooter:h,selectionKeys:f,rowExpandedKeys:g,highlightKey:v,activedCell:y,isPingLeft:b,isPingRight:x,isTableEmpty:E,isGroupSubtotal:w,setElementStore:C,setSelectionKeysEffect:S,setHighlightKey:N,setActivedCell:T,getStickyLeft:I,getStickyRight:R,setPingLeft:O,setPingRight:k,setFullScreen:L,findParentRowKeys:A,getAllChildRowKeys:P,scrollBottomDebouncer:_}=t.useContext(Ho),{height:D,minHeight:H,maxHeight:F,rowHeight:M,rowSelection:$,rowHighlight:q,expandable:j,stripe:K,summation:V,rowStyle:z,cellStyle:W,spanMethod:B,tableConfig:U,areaSelection:G,ellipsis:Y,showHeader:X,rowDraggable:Q,onRowClick:Z,onRowDblclick:J,onRowContextmenu:ee,onRowEnter:te}=r.current.props,ne=t.useRef(null),re=t.useRef({}),ie=t.useRef(null),le=t.useRef({prevST:0,prevSL:0}),{onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:ce,onNodeDragLeave:de,onNodeDragEnd:ue,onNodeDrop:pe,indent:he,dropOptions:fe}=sp({openDragSort:Q}),{rowVirtualizer:ge,columnVirtualizer:ve,virtualRows:ye,virtualColumns:be,resetItemXSize:xe,getYIndexes:Ee,virtualTranslateY:we,virtualTranslateX:Ce,calcVirtualYSize:Se,calcVirtualXSize:Ne,scrollToYIndex:Te}=((e,n)=>{var r;const{tableRef:i}=t.useContext(Ho),{props:l,scrollBarRef:a,rowHeight:o}=i.current,s=(null===(r=l.tableConfig)||void 0===r?void 0:r.overscan)||1,c=t.useMemo((()=>{var e,t;return null!==(t=null===(e=a.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null}),[a.current]),d=t.useMemo((()=>{const e=[],t=[];return n.forEach(((n,r)=>{"left"===n.fixed&&e.push(r),"right"===n.fixed&&t.push(r)})),[e,t]}),[n]),u=hu({count:e.length,getScrollElement:()=>c,estimateSize:()=>o,indexAttribute:"data-row-index",overscan:s,enabled:i.current.scrollYLoad}),p=u.getVirtualItems(),m=hu({horizontal:!0,count:n.length,getScrollElement:()=>c,estimateSize:e=>n[e].width||n[e].renderWidth||0,indexAttribute:"data-col-index",overscan:s,enabled:i.current.scrollXLoad,rangeExtractor:e=>[...new Set([...d[0],...iu(e),...d[1]])]}),h=m.getVirtualItems();return{rowVirtualizer:u,columnVirtualizer:m,virtualRows:p,virtualColumns:h,resetItemXSize:e=>{e.forEach(((e,t)=>{m.resizeItem(t,e.width||e.renderWidth||Jo.defaultColumnWidth)}))},getYIndexes:()=>u.getVirtualIndexes()||[],getXIndexes:()=>m.getVirtualIndexes()||[],virtualTranslateY:()=>{var e,t;return null!==(t=null===(e=p[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},virtualTranslateX:()=>{var e,t,n,r,i,l,a;const o=d[0].length;return o?(null===(n=h[o])||void 0===n?void 0:n.index)===o?null!==(i=null===(r=h[0])||void 0===r?void 0:r.start)&&void 0!==i?i:0:(null!==(a=null===(l=h[o])||void 0===l?void 0:l.start)&&void 0!==a?a:0)-h.slice(0,o).reduce(((e,t)=>e+t.size),0):null!==(t=null===(e=h[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},calcVirtualYSize:()=>u.getTotalSize()||void 0,calcVirtualXSize:()=>m.getTotalSize()||void 0,scrollToYIndex:e=>{u.scrollToIndex(e)},scrollToXIndex:e=>{m.scrollToIndex(e)}}})(a,o),Ie=Ee(),Re=e=>{if(e&&!Y)return ge.measureElement(e)},Oe=t.useMemo((()=>u.length&&r.current.scrollYLoad?((e,t)=>{const n=[],r=new Set(t);return e.forEach((({row:e,col:t,rowSpan:i,colSpan:l})=>{const a=e+i-1,o=[];for(let t=e;t<=a;t++)r.has(t)&&o.push(t);if(0===o.length)return;const s=o.length;o.forEach(((e,r)=>{0===r&&n.push({row:e,col:t,rowSpan:s,colSpan:l});for(let i=t;i<t+l;i++)0===r&&i===t||n.push({row:e,col:i,rowSpan:0,colSpan:0})}))})),n})(u,Ie):u),[u,Ie.join(",")]),[ke,Le]=t.useState([]),Ae=cp();yu({ref:ne,omitClassNames:[`.${Jo.popupClassName}`],handler:()=>{var e;Be([]),null===(e=ie.current)||void 0===e||e.blur()}}),t.useImperativeHandle(n,(()=>({setClickedValues:Be,createFocus:qe,forceUpdate:Ae,resetItemXSize:xe,scrollToYIndex:Te}))),Mi((()=>{ke.length&&r.current.tableManager.focus(r.current.uid)}),[ke]),t.useLayoutEffect((()=>{$e();const e=Kt(document,"keydown",He);return()=>e.remove()}),[]);const _e=t.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:n,tableFullHeight:r,tableAutoHeight:i}=m,l={};return E&&Object.assign(l,{minHeight:"100px"}),H&&Object.assign(l,{minHeight:ha(H)-e-n+"px"}),F&&Object.assign(l,{maxHeight:ha(F)-e-n+"px"}),D||r||i?Object.assign(Object.assign({},l),{maxHeight:"",minHeight:"",height:`${t}px`}):l}),[D,F,H,E,m]),De=Mn((e=>{const{elementStore:t}=r.current,{prevST:n,prevSL:i}=le.current,{scrollTop:l,scrollLeft:a}=e;if(a!==i){X&&(t.$header.scrollLeft=a),h&&(t.$footer.scrollLeft=a);const e=a>0,n=Math.ceil(a)+m.tableWidth<m.tableBodyWidth;b!==e&&O(e),x!==n&&k(n)}l!==n&&Math.ceil(l)+m.viewportHeight>=ne.current.parentNode.offsetHeight&&_({type:"scroll",target:e,preventDefault:Vn,stopPropagation:Vn}),le.current={prevST:l,prevSL:a}})),He=Mn((e=>{var t,n,l,o,c,d,u;const{keyCode:p}=e;if(r.current.uid===(null===(t=r.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id)&&(27===p&&(Be([]),N(""),T({}),L(!1)),ke.length&&(Gi(document.activeElement,ne.current)||"INPUT"!==(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)))){if(13===p&&("radio"===(null==$?void 0:$.type)||q)){const t=null!==(o=null!==(l=f[0])&&void 0!==l?l:v)&&void 0!==o?o:null,n=null!==(c=a.find((e=>i(e,e.index)===t)))&&void 0!==c?c:null;n&&(null==te||te(n,e))}if(!Ve(ke[0],ke[1])){if(38===p||40===p){ji(e);const t=a.length;let n=a.findIndex((e=>i(e,e.index)===ke[0]));const r=38===p?(--n+t)%t:++n%t,l=a[r],o=i(l,l.index),s=Ke(o,ke[1]);"radio"!==(null==$?void 0:$.type)||(null===(d=$.disabled)||void 0===d?void 0:d.call($,l))||s||S([o]),!q||(null===(u=q.disabled)||void 0===u?void 0:u.call(q,l))||s||N(o),Fe(38===p?"top":"bottom",r),je(...ke),Be([o,ke[1]])}if(9===p||e.shiftKey&&9===p){if(ji(e),!s.length)return Be([]);const t=s.length;let n=s.findIndex((e=>e.dataIndex===ke[1]));const r=e.shiftKey&&9===p?(--n+t)%t:++n%t;je(...ke),Me(e.shiftKey&&9===p?"left":"right",r),Be([ke[0],s[r].dataIndex])}}}})),Fe=(e,t)=>{const{scrollBarRef:n,scrollYLoad:i}=r.current;if(i)return ge.scrollToIndex(t);const l=a.length,o=t,s=ne.current.querySelectorAll("tbody > tr"),c=a.map(((e,t)=>t)).slice(0,o).reduce(((e,t)=>e+s[t].offsetHeight),0),d=s[o].offsetHeight;"top"===e?c<n.current.scrollTop?n.current.SET_SCROLL_TOP(c):t===l-1&&n.current.SET_SCROLL_TOP(c-(m.viewportHeight-d)):c+d>n.current.scrollTop+m.viewportHeight?n.current.SET_SCROLL_TOP(c-(m.viewportHeight-d)):0===t&&n.current.SET_SCROLL_TOP(c)},Me=(e,t)=>{const{scrollBarRef:n}=r.current,i=s.length,l=o.findIndex((e=>e.dataIndex===s[t].dataIndex)),a=o.slice(0,l).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),u=o[l].width||o[l].renderWidth,p=c.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),h=d.reduce(((e,t)=>e+(t.width||t.renderWidth)),0);"left"===e?a<n.current.scrollLeft+p?n.current.SET_SCROLL_LEFT(a-p):t===i-1&&n.current.SET_SCROLL_LEFT(a-(m.tableWidth-u)+h):a+u>n.current.scrollLeft+(m.tableWidth-h)?n.current.SET_SCROLL_LEFT(a-(m.tableWidth-u)+h):0===t&&n.current.SET_SCROLL_LEFT(a-p)},$e=()=>{C("$tableBody",ne.current)},qe=(e,t)=>{var n;null===(n=re.current[`${e}-${t}`])||void 0===n||n.focus()},je=(e,t)=>{var n;null===(n=re.current[`${e}-${t}`])||void 0===n||n.blur()},Ke=(e,t)=>{var n,r;return null!==(r=null===(n=re.current[`${e}-${t}`])||void 0===n?void 0:n.isEditable())&&void 0!==r&&r},Ve=(e,t)=>{var n,r;return null!==(r=null===(n=re.current[`${e}-${t}`])||void 0===n?void 0:n.isOpening())&&void 0!==r&&r},ze=e=>{const t=V.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},We=(e,t,n)=>{var l;const{dataIndex:a}=n;if([Jo.expandableColumn,Jo.operationColumn].includes(a))return;const o=i(t,t.index);Be([o,a]);const s=Ke(o,a),{type:c,selectByClickRow:d=!0,disabled:u=Vn}=$||{};!c||u(t)||s||(d||a===Jo.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:i=!0,onSelect:l}=$||{};if("radio"===n&&S([e]),"checkbox"===n){const n=!f.includes(e),a=r.current.isTreeTable&&!i?Ge(e,f,n):Ue(e,f,n);S(a),null==l||l(n,t,a)}})(o,t),[Jo.selectionColumn].includes(a)||(!q||(null===(l=q.disabled)||void 0===l?void 0:l.call(q,t))||s||N(o),null==Z||Z(t,n,e))},Be=e=>{me(e,ke)||Le(e)},Ue=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),Ge=(e,t,n)=>{var i;const{disabled:l}=$||{},{deriveRowKeys:a,recordsMap:o}=r.current,s=oa(a,e);let c=[],d=P((null==s?void 0:s.children)||[]);l&&(d=d.filter((e=>!o.has(e)||!l(o.get(e))))),c=n?[...new Set([...t,e,...d])]:t.filter((t=>![e,...d].includes(t)));return((null===(i=La(a,e))||void 0===i?void 0:i.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=oa(a,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>c.includes(e.rowKey)));c=r?[...c,e]:c.filter((t=>t!==e))})),c},Ye=(e,n,i)=>{const{scrollXLoad:l}=r.current,{disabled:a}=$||{},s=["body--row",Object.assign({"body--row-striped":K&&n%2!=0,"body--row-selected":f.includes(i)&&!(null==a?void 0:a(e)),"body--row-current":v===i},w?ze(e._group):null)],c=(l?be:o).map(((t,r)=>Xe(l?o[t.index]:t,l?t.index:r,e,n,i)));return Q?t.createElement(dp,{key:i,ref:Re,className:Pe(s),rowKey:i,rowIndex:n,row:e,indent:he,filter:".cell--edit input",dropOption:fe,onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:ce,onNodeDragLeave:de,onNodeDragEnd:ue,onNodeDrop:pe},c):t.createElement("tr",{key:i,ref:Re,"data-row-key":i,"data-row-index":n,className:Pe(s)},c)},Xe=(e,n,r,i,l)=>{var a,o,s;const{dataIndex:u,fixed:m,align:h,className:f=""}=e,{rowSpan:g,colSpan:v}=Qe(r,e,i,n);if(!g||!v)return null;const b=null!==(a=e.ellipsis)&&void 0!==a?a:Y,x=["body--column",{"col--ellipsis":b,"col--center":"center"===h,"col--right":"right"===h,"col-active":y.rowKey===l&&y.dataIndex===u,"column--sort":!!p[u],"cell-fix-left":"left"===m,"cell-fix-right":"right"===m,"cell-fix-left-last":"left"===m&&(null===(o=c[c.length-v])||void 0===o?void 0:o.dataIndex)===u,"cell-fix-right-first":"right"===m&&(null===(s=d[0])||void 0===s?void 0:s.dataIndex)===u,[f]:!!f}],E={left:"left"===m?`${I(u)}px`:"",right:"right"===m?`${R(u)}px`:""},C=z?"function"==typeof z?z(r,i):z:null,S=W?"function"==typeof W?W(r,e,i,n):W:null,N=w?(e=>{var t;const{backgroundColor:n,color:r}=null!==(t=V.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:r}})(r._group):null,T=Object.assign({},E,{height:M},N,C,S);return t.createElement("td",{key:u,"data-col-index":n,rowSpan:g>1?g:void 0,colSpan:v>1?v:void 0,className:Pe(x),style:T,onClick:t=>We(t,r,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:r}=n;[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn].includes(r)||null==J||J(t,n,e)})(t,r,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:r}=n;[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn].includes(r)||null==ee||ee(t,n,e)})(t,r,e)},t.createElement(yp,{ref:e=>re.current[`${l}-${u}`]=e,row:r,column:e,rowIndex:i,columnIndex:n,rowKey:l,showTitle:b}))},Qe=(e,t,n,r)=>{var i;let l=1,o=1;const s=B;if("function"==typeof s){const c=s({row:e,column:t,rowIndex:n,columnIndex:r,tableData:a});Array.isArray(c)?(l=c[0],o=c[1]):ae(c)&&(l=c.rowSpan,o=c.colSpan);const d=null!==(i=Ie[0])&&void 0!==i?i:0;if(e===a[d]&&0===l)for(let e=d;e<a.length;e++){const n=s({row:a[e],column:t,rowIndex:e,columnIndex:r,tableData:a});if((Array.isArray(n)?n[0]:n.rowSpan)>0)break;l++}}if(Oe.length>0){const e=Oe.find((e=>e.row===n&&e.col===r));e&&(l=e.rowSpan,o=e.colSpan)}return{rowSpan:l,colSpan:o}};return t.createElement(t.Fragment,null,t.createElement(El,{ref:r.current.scrollBarRef,wrapClassName:`${l}--body-wrapper`,wrapStyle:_e,innerStyle:{height:Se(),width:Ne()},showTopScrollbar:null==U?void 0:U.doubleXScrollbar,onScroll:De},t.createElement(np.Provider,{value:ke},t.createElement("table",{ref:ne,style:{width:0,marginTop:we(),marginLeft:Ce()},className:Pe(`${l}--body`,{"virtual-container":r.current.scrollYLoad||r.current.scrollXLoad}),tabIndex:-1,cellSpacing:"0",cellPadding:"0"},(()=>{const{scrollXLoad:e}=r.current;return t.createElement("colgroup",null,(e?be:o).map((n=>{const{dataIndex:r,width:i,renderWidth:l}=e?o[n.index]:n;return t.createElement("col",{key:r,style:{width:`${i||l}px`,minWidth:`${i||l}px`}})})))})(),t.createElement("tbody",null,(e=>{const{scrollYLoad:n,scrollXLoad:l}=r.current,s=[];return(n?e:a).forEach(((e,r)=>{const c=n?a[e.index]:e,d=n?e.index:r,u=i(c,c.index);if(s.push(Ye(c,d,u)),null==j?void 0:j.expandedRowRender){const{expandedRowClassName:e,rowExpandable:n=zn}=j;g.includes(u)&&n(c)&&s.push(t.createElement("tr",{key:`expand_${u}`,className:"body--row-expanded"},t.createElement("td",{colSpan:(l?be:o).length,className:"body--column",style:{paddingLeft:$?2*Jo.selectionColumnWidth:Jo.selectionColumnWidth}},t.createElement("div",{className:Pe("cell",e)},j.expandedRowRender(c,d)))))}})),s})(ye)))),!!G&&t.createElement(xp,{ref:ie,rowVirtualize:ge})))}));Ep.displayName="TableBody";const wp=()=>{const{tableRef:e,prefixCls:n,sorter:r,layout:i,flattenColumns:l,leftFixedColumns:a,rightFixedColumns:o,summationRows:s,setElementStore:c,getStickyLeft:d,getStickyRight:u}=t.useContext(Ho),{footRender:p}=e.current.props,{t:m}=Fn(),h=t.useRef(null);t.useLayoutEffect((()=>{f()}),[]);const f=()=>{c("$footer",h.current)},g=(n,i,l)=>{var s,c;const{dataIndex:p,fixed:h,align:f,summation:g}=n,v=["footer--column","col--ellipsis",{"col--center":"center"===f,"col--right":"right"===f,"column--sort":!!r[p],"cell-fix-left":"left"===h,"cell-fix-right":"right"===h,"cell-fix-left-last":"left"===h&&(null===(s=a[a.length-1])||void 0===s?void 0:s.dataIndex)===p,"cell-fix-right-first":"right"===h&&(null===(c=o[0])||void 0===c?void 0:c.dataIndex)===p}],y={left:"left"===h?`${d(p)}px`:"",right:"right"===h?`${u(p)}px`:""},b=(null==g?void 0:g.render)?g.render(e.current.tableFullData):ga(i,`${p}_text`),x=0===l&&""===b?m("qm.table.config.summaryText"):b;return t.createElement("td",{key:p,title:x,className:Pe(v),style:Object.assign({},y)},t.createElement("div",{className:"cell"},x))},{tableBodyWidth:v}=i;return t.createElement("div",{ref:h,className:`${n}--footer-wrapper`},p?p(l,e.current.tableFullData):t.createElement("table",{className:`${n}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:v?`${v}px`:""}},t.createElement("colgroup",null,l.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})}))),t.createElement("tfoot",null,s.map(((e,n)=>t.createElement("tr",{key:n,className:"footer--row"},l.map(((t,n)=>g(t,e,n)))))))))};var Cp;!function(e){e.small="small",e.middle="default",e.large="default"}(Cp||(Cp={}));const Sp=e=>{var n,r,i,l;const{current:a,pageSize:o,total:s,onChange:c}=e,{global:d}=t.useContext(on),{tableRef:u,prefixCls:p,$size:m,setElementStore:h}=t.useContext(Ho),{uniqueKey:f,paginationConfig:g,infoBarConfig:v}=u.current.props,y=t.useRef(null),b=t.useMemo((()=>f?`tablePager_${f}`:""),[f]);t.useLayoutEffect((()=>{x(),S()}),[]);const x=()=>{h("$pager",y.current)},E=null!==(n=null==g?void 0:g.showSizeChanger)&&void 0!==n?n:Jo.pagination.showSizeChanger,w=null!==(r=null==g?void 0:g.showQuickJumper)&&void 0!==r?r:Jo.pagination.showQuickJumper,C=(null==g?void 0:g.pageSizeOptions)||(null===(l=null===(i=null==d?void 0:d.table)||void 0===i?void 0:i.pagination)||void 0===l?void 0:l.pageSizeOptions)||Jo.pagination.pageSizeOptions,S=()=>Hn(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield N(b);e&&e!==o&&(c(a,e),localStorage.setItem(b,e.toString()))})),N=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),T=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),I={[`${p}-pager`]:!0};return t.createElement("div",{ref:y,className:Pe(I)},t.createElement("div",{className:"pager-alert"},"bottom"===(null==v?void 0:v.position)&&t.createElement(os,{total:s})),t.createElement(B,{size:Cp[m],showSizeChanger:E,showQuickJumper:w,pageSizeOptions:C,current:a,pageSize:o,total:s,onChange:(e,t)=>{c(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},Np=()=>{const{prefixCls:e,layout:n}=t.useContext(Ho),r=t.useMemo((()=>{const{headerHeight:e,viewportHeight:t}=n;return{top:`${e}px`,height:`${t}px`}}),[n]);return t.createElement("div",{className:`${e}--empty`,style:r},t.createElement(tl,null))},Tp=()=>{const{prefixCls:e,setElementStore:n}=t.useContext(Ho),r=t.useRef(null);t.useLayoutEffect((()=>{i()}),[]);const i=()=>{n("$resizableBar",r.current)};return t.createElement("div",{ref:r,className:`${e}--resizable-bar`})},Ip=t.forwardRef(((e,n)=>{const r=pn(Mo,e),{rowKey:i,columns:l,loading:a,resizable:o,customClass:s,areaSelection:c,tablePrint:d,exportExcel:u,infoBarConfig:p,topSpaceAlign:m,showTableInfo:h,showFullScreen:f,showRefresh:g,showToolBox:v,showHeader:y,className:b,style:x}=r,{$size:E}=$n(r),w=t.useRef(null),C=t.useRef(null),S=t.useRef(null),N=t.useRef(null),T=t.useRef(null),I=lr("table"),R=Mn(((e,t)=>{const n="function"==typeof i?i(e,t):null==e?void 0:e[i];return void 0===n?(tr("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),{tableRef:O,tableFullData:k,setElementStore:L,setOriginColumns:A,setTableFullData:P,setTableOriginData:_,setAllTableData:D,setDeriveRowKeys:H,setInvalidRowKeys:F,setFieldAuth:M,setColumnsDefined:$,setScrollXLoad:q,setScrollYLoad:j,setResizeState:K,setHandleState:V,setSummaries:z,setSelectionRows:W,setRecordsMap:B,setUnMounted:U,clearElementStore:G,clearRecordsMap:Y}=((e,{getRowKey:n,$size:r})=>{const{rowHeight:i,dynamicThead:l}=e,a=t.useRef({props:e,uid:Yo(),tableManager:Qo,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],allParentRowKeys:[],deriveRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!l,scrollBarRef:t.createRef(),rowHeight:i||Jo.rowHeightMaps[r],store:new Zo,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},isTreeTable:!1,scrollXLoad:!1,scrollYLoad:!1,selectionRows:[],recordsMap:new Map,unMounted:!1,isIE:!qn&&/MSIE|Trident/.test(navigator.userAgent)});var o;o=e,a.current.props=o;const s=(e,t,r="",i=0)=>e.map((e=>{const l=n(e,e.index),a=r?`${r}.${e.index+1}`:`${e.index+1}`,o={level:i,rowKey:l,indexPath:a};return e.indexPath=a,e._level=i,e._parentRowKey=i?t:null,Array.isArray(e.children)&&(o.children=s(e.children,l,a,i+1)),t?Object.assign(o,{parentRowKey:t}):o}));return Object.assign(Object.assign({tableRef:a},a.current),{setElementStore:(e,t)=>{a.current.elementStore[e]=t},setOriginColumns:e=>{a.current.originColumns=e},setTableFullData:e=>{a.current.tableFullData=e},setTableOriginData:e=>{a.current.tableOriginData=e},setAllTableData:e=>{const t=sa(e);a.current.allTableData=t,a.current.allRowKeys=t.map((e=>n(e,e.index)))},setDeriveRowKeys:e=>{const t=e.some((e=>Array.isArray(e.children)));a.current.isTreeTable=t,a.current.deriveRowKeys=t?s(e,""):[],a.current.allParentRowKeys=t?ca(e,(e=>n(e,e.index))):[]},setInvalidRowKeys:e=>{a.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{a.current.fieldAuth[e]=t},setColumnsDefined:e=>{a.current.columnsDefined=e},setResizeState:e=>{a.current.resizeState=e},setHandleState:e=>{a.current.handleState=e},setSummaries:e=>{a.current.summaries=e},setScrollXLoad:e=>{a.current.scrollXLoad=e},setScrollYLoad:e=>{a.current.scrollYLoad=e},setSelectionRows:e=>{a.current.selectionRows=e},setRecordsMap:(e,t)=>{a.current.recordsMap.set(e,t)},setUnMounted:e=>{a.current.unMounted=e},clearElementStore:()=>{for(const e in a.current.elementStore)a.current.elementStore[e]=null},clearRecordsMap:()=>{a.current.recordsMap.clear()}})})(r,{getRowKey:R,$size:E}),{tableFlatData:X,setTableFlatData:Q,filters:Z,setFilters:J,sorter:ee,setSorter:te,superFilters:ne,setSuperFilters:re,pagination:ie,setPagination:le,selectionKeys:oe,setSelectionKeys:se,rowExpandedKeys:ce,setRowExpandedKeys:de,highlightKey:ue,setHighlightKey:pe,updateMark:fe,forceUpdate:ge,activedCell:ve,setActivedCell:ye,mergedTdCells:be,setMergedCells:xe,layout:Ee,setLayout:we,permission:Ce,setPermission:Se,spinning:Ne,setSpinning:Te,isPingLeft:Ie,setPingLeft:Re,isPingRight:Oe,setPingRight:ke,isFullScreen:Le,setFullScreen:Ae,updateTableFlatData:_e}=(e=>{var n,r,i,l,a,o,s,c,d,u,p;const{uniqueKey:m,initialSorter:h={},initialFilter:f={},paginationConfig:g,rowSelection:v,expandable:y,rowHighlight:b,mergedCells:x}=e,{global:E}=t.useContext(on),w={current:null!==(n=null==g?void 0:g.current)&&void 0!==n?n:Jo.pagination.current,pageSize:null!==(o=null!==(i=null!==(r=(()=>{if(m)return Number(localStorage.getItem(`tablePager_${m}`))||void 0})())&&void 0!==r?r:null==g?void 0:g.pageSize)&&void 0!==i?i:null===(a=null===(l=null==E?void 0:E.table)||void 0===l?void 0:l.pagination)||void 0===a?void 0:a.pageSize)&&void 0!==o?o:Jo.pagination.pageSize,total:0},C=null!==(c=null!==(s=null==v?void 0:v.selectedRowKeys)&&void 0!==s?s:null==v?void 0:v.defaultSelectedRowKeys)&&void 0!==c?c:[],S=null!==(u=null!==(d=null==y?void 0:y.expandedRowKeys)&&void 0!==d?d:null==y?void 0:y.defaultExpandedRowKeys)&&void 0!==u?u:[],[N,T]=t.useState([]),[I,R]=t.useReducer(((e,t)=>me(e,t)?e:t),f),[O,k]=t.useReducer(((e,t)=>me(e,t)?e:t),h),[L,A]=t.useReducer(((e,t)=>me(e,t)?e:t),[]),[P,_]=t.useState(w),[D,H]=t.useReducer(((e,t)=>me(e,t)?e:t),C),[F,M]=t.useReducer(((e,t)=>me(e,t)?e:t),S),[$,q]=t.useState(null!==(p=null==b?void 0:b.currentRowKey)&&void 0!==p?p:""),[j,K]=t.useReducer((e=>e+1),0),[V,z]=t.useReducer(((e,t)=>me(e,t)?e:t),{}),[W,B]=ts([],{value:x}),[U,G]=t.useState({gutterWidth:0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[Y,X]=t.useState({export:!0,import:!0,print:!0}),[Q,Z]=t.useState(!1),[J,ee]=t.useState(!1),[te,ne]=t.useState(!1),[re,ie]=t.useState(!1);return{tableFlatData:N,setTableFlatData:T,filters:I,setFilters:R,sorter:O,setSorter:k,superFilters:L,setSuperFilters:A,pagination:P,setPagination:_,selectionKeys:D,setSelectionKeys:H,rowExpandedKeys:F,setRowExpandedKeys:M,highlightKey:$,setHighlightKey:q,updateMark:j,forceUpdate:K,activedCell:V,setActivedCell:z,mergedTdCells:W,setMergedCells:B,layout:U,permission:Y,setPermission:X,setLayout:G,spinning:Q,setSpinning:Z,isPingLeft:J,setPingLeft:ee,isPingRight:te,setPingRight:ne,isFullScreen:re,setFullScreen:ie,updateTableFlatData:()=>T([...N])}})(r),{isFetch:De,isWebPagination:He,isScrollPagination:Fe,showPagination:Me,tableColumns:$e,flattenColumns:qe,editableColumns:je,summationColumns:Ke,leftFixedColumns:Ve,rightFixedColumns:ze,derivedMergeCells:We,treeExpandIndex:Be,showSummary:Ue,showFooter:Ge,isHeadGroup:Ye,bordered:Xe,isHeadSorter:Qe,isHeadFilter:Ze,isServiceSummation:Je,isSelectCollection:et,isTableImport:tt,isTableClipboard:nt,isSuperSearch:rt,isFastSearch:it,isPivotGrid:lt,isGroupSummary:at,isGroupSubtotal:ot,isTableEmpty:st,summationRows:ct,fetchParams:dt}=rs(r,{getRowKey:R,tableRef:O,tableFullData:k,tableFlatData:X,sorter:ee,filters:Z,superFilters:ne,selectionKeys:oe,pagination:ie,mergedTdCells:be}),{createElementStore:ut,tableStyles:pt,getSpan:mt,getStickyLeft:ht,getStickyRight:ft,scrollXToColumn:gt,scrollYToRecord:vt,calcTableHeight:yt,resetTableScroll:bt,doLayout:xt}=ls(r,{getRowKey:R,tableRef:O,topElementRef:w,tableElementRef:C,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,leftFixedColumns:Ve,derivedMergeCells:We,tableFlatData:X,layout:Ee,showFooter:Ge,showPagination:Me,isFullScreen:Le,setLayout:we,setElementStore:L}),{initialTable:Et,checkDataIndex:wt,createTableFullData:Ct,getTableData:St,createTableList:Nt,createTableData:Tt,createGroupData:It,setSelectionKeysEffect:Rt,findParentRowKeys:Ot,getAllChildRowKeys:kt,doFieldValidate:Lt,getTableLog:At,dataChange:Pt,tableChange:_t,toLastPage:Dt,toFirstPage:Ht,getPageCount:Ft,pagerChangeHandle:Mt,scrollBottomDebouncer:$t,clearTableSorter:qt,clearTableFilter:jt,clearSuperFilters:Kt,clearRowSelection:Vt,clearRowHighlight:zt,clearTableLog:Wt,destroy:Bt}=is(r,{getRowKey:R,tableRef:O,tableElementRef:C,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,tableFullData:k,pagination:ie,layout:Ee,filters:Z,sorter:ee,superFilters:ne,fetchParams:dt,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,summationColumns:Ke,isFetch:De,isWebPagination:He,isScrollPagination:Fe,isServiceSummation:Je,isGroupSubtotal:ot,doLayout:xt,setTableFlatData:Q,setTableFullData:P,setTableOriginData:_,setAllTableData:D,setDeriveRowKeys:H,setPagination:le,setPingRight:ke,setPingLeft:Re,setSpinning:Te,setSorter:te,setFilters:J,setSuperFilters:re,setSelectionKeys:se,setRowExpandedKeys:de,setHighlightKey:pe,setSelectionRows:W,setScrollXLoad:q,setScrollYLoad:j,setFieldAuth:M,setResizeState:K,setSummaries:z,setPermission:Se,setRecordsMap:B,resetTableScroll:bt,clearElementStore:G,clearRecordsMap:Y});((e,n)=>{const{columns:r,summation:i,rowSelection:l,expandable:a,rowHighlight:o}=e,{tableRef:s,tableBodyRef:c,$size:d,pagination:u,selectionKeys:p,rowExpandedKeys:m,highlightKey:h,summationRows:f,showSummary:g,isWebPagination:v,isScrollPagination:y,checkDataIndex:b,toLastPage:x,toFirstPage:E,getPageCount:w,setHandleState:C,scrollYToRecord:S,setSelectionKeysEffect:N,setOriginColumns:T,setRowExpandedKeys:I,setHighlightKey:R,setResizeState:O,setUnMounted:k,calcTableHeight:L,initialTable:A,destroy:P}=n,_=t.useRef(f);Mi((()=>{if(!l)return;const{onChange:e}=l;"radio"===l.type&&c.current.setClickedValues(p.length?[p[0],""]:[]),p.__prevent__||null==e||e(p,s.current.selectionRows),pa(p)}),[p]),Mi((()=>{if(!a)return;const{onChange:e}=a;m.__prevent__||null==e||e(m,m.map((e=>s.current.recordsMap.get(e)))),pa(m)}),[m]),Mi((()=>{var e,t;o&&(c.current.setClickedValues(h?[h,""]:[]),null===(e=o.onChange)||void 0===e||e.call(o,h,null!==(t=s.current.recordsMap.get(h))&&void 0!==t?t:null))}),[h]),Mi((()=>{var e;me(f,_.current)||(_.current=f,g&&i&&(null===(e=i.onChange)||void 0===e||e.call(i,f)))}),[f]),Mi((()=>{const e=l.selectedRowKeys||[];me(e,p)||N(ua(e))}),[null==l?void 0:l.selectedRowKeys]),Mi((()=>{const e=a.expandedRowKeys||[];me(e,m)||I(ua(e))}),[null==a?void 0:a.expandedRowKeys]),Mi((()=>{const{currentRowKey:e}=o;e!==h&&R(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),Mi((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(v&&("after"===e?x():E()),S("","after"===e?1e5:0)),t&&u.current>w()&&x(),(e||t)&&C({insert:null,remove:!1})}),[u.total]),Mi((()=>{L()}),[d]),Mi((()=>{(s.current.scrollYLoad||y)&&(e.height||e.maxHeight||tr("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,y]),as({handler:()=>{const{resizeState:e}=s.current,{winHeight:t}=e,n=window.innerHeight;n!==t&&(O(Object.assign({},e,{winHeight:n})),L())},delay:16}),t.useEffect((()=>(T(Qn(r)),A(),b(),Bn((()=>L())),()=>{P(),k(!0)})),[])})(r,{tableRef:O,tableBodyRef:S,$size:E,pagination:ie,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,showSummary:Ue,summationRows:ct,isWebPagination:He,isScrollPagination:Fe,checkDataIndex:wt,toLastPage:Dt,toFirstPage:Ht,getPageCount:Ft,setHandleState:V,scrollYToRecord:vt,setOriginColumns:A,setSelectionKeysEffect:Rt,setRowExpandedKeys:de,setHighlightKey:pe,setResizeState:K,setUnMounted:U,calcTableHeight:yt,initialTable:Et,destroy:Bt});const Ut=t.useMemo((()=>({getRowKey:R,tableRef:O,tableBodyRef:S,prefixCls:I,$size:E,tableFlatData:X,flattenColumns:qe,editableColumns:je,leftFixedColumns:Ve,rightFixedColumns:ze,treeExpandIndex:Be,sorter:ee,filters:Z,superFilters:ne,layout:Ee,bordered:Xe,showFooter:Ge,showSummary:Ue,summationRows:ct,pagination:ie,fetchParams:dt,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,activedCell:ve,mergedTdCells:be,derivedMergeCells:We,updateMark:fe,isFetch:De,isPingLeft:Ie,isPingRight:Oe,isHeadSorter:Qe,isHeadFilter:Ze,isFullScreen:Le,isTableEmpty:st,isHeadGroup:Ye,isGroupSubtotal:ot,isWebPagination:He,dataChange:Pt,tableChange:_t,getTableData:St,setElementStore:L,createTableList:Nt,createTableFullData:Ct,updateTableFlatData:_e,setSorter:te,setFilters:J,setSuperFilters:re,setHighlightKey:pe,setRowExpandedKeys:de,setSelectionRows:W,setSelectionKeysEffect:Rt,setInvalidRowKeys:F,setActivedCell:ye,setMergedCells:xe,getSpan:mt,getStickyLeft:ht,getStickyRight:ft,scrollXToColumn:gt,scrollYToRecord:vt,setPagination:le,setPingLeft:Re,setPingRight:ke,setSpinning:Te,setFullScreen:Ae,doFieldValidate:Lt,createTableData:Tt,createGroupData:It,findParentRowKeys:Ot,getAllChildRowKeys:kt,scrollBottomDebouncer:$t,resetTableScroll:bt,clearTableSorter:qt,clearTableFilter:jt,clearSuperFilters:Kt,clearRowSelection:Vt,clearRowHighlight:zt})),[E,X,qe,ee,Z,ne,Ee,Xe,Ge,Ue,ct,ie,dt,oe,ce,ue,ve,We,fe,De,Ie,Oe,Qe,Ze,Le,st,Ye,ot,He]);((e,n)=>{const{getRowKey:r,tableRef:i,toolBoxRef:l,tableBodyRef:a,columnFilterRef:o,flattenColumns:s,editableColumns:c,pagination:d,fetchParams:u,selectionKeys:p,rowExpandedKeys:m,highlightKey:h,isFetch:f,dataChange:g,getTableData:v,createTableData:y,createTableFullData:b,calcTableHeight:x,scrollXToColumn:E,scrollYToRecord:w,doFieldValidate:C,setTableOriginData:S,setHandleState:N,setColumnsDefined:T,setSelectionKeysEffect:I,setRowExpandedKeys:R,setHighlightKey:O,setSelectionRows:k,setOriginColumns:L,forceUpdate:A,getTableLog:P,clearRowSelection:_,clearRowHighlight:D,clearTableSorter:H,clearTableFilter:F,clearSuperFilters:M,clearTableLog:$}=n,{columns:q,columnsChange:j}=i.current.props,K=(e,t,n)=>e.filter((e=>{const i=r(e,e.index);e.children&&(e.children=K(e.children,t,n));const l=t.includes(i);return l&&(null==n||n(e,i)),!l}));t.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{x()},DO_REFRESH:e=>Hn(void 0,void 0,void 0,(function*(){f&&(yield v(),null==e||e())})),GET_LOG:()=>P(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{f||(_(),D(),H(),F(),M(),$(),y([]))},CLEAR_LOG:()=>{$(),A()},CREATE_FOCUS:(e,t)=>{a.current.createFocus(e,t)},FORCE_UPDATE:()=>{A()},DO_EXPORT:()=>{l.current.exportHandle()},SCROLL_TO_RECORD:e=>{w(e)},SCROLL_TO_COLUMN:e=>{E(e)},SET_SELECTION:(e,t)=>{I(t?ua([...e]):e)},SET_EXPANDABLE:(e,t)=>{R(t?ua([...e]):e)},SET_HIGHLIGHT:e=>{O(e)},SET_SELECTION_ROWS:e=>{k(e)},SET_TABLE_DATA:e=>{b(e)},DEFINE_INITIAL_COLUMNS:e=>{L(e),T(!0),o.current.initialHandler()},SET_TABLE_COLUMN:(e,t,n)=>{const r=ra(q,e);if(!r)return tr("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!ae(t))return tr("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(r.noAuth)return tr("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&he(r,e,t[e]);n&&(j?j([...q]):tr("Table","需要设置 `columnsChange` 参数"),A())},INSERT_RECORDS:(e,t)=>{const{store:n,tableFullData:l}=i.current,a=(Array.isArray(e)?e:[e]).filter((e=>ae(e)));if(!a.length)return;a.forEach((e=>{s.forEach((t=>{const{dataIndex:n}=t;[Jo.expandableColumn,Jo.selectionColumn,Jo.operationColumn].includes(n)||va(e,n,ga(e,n))})),n.addToInserted(e)}));const o="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey),d=l;if(c)o?d.unshift(...a):d.push(...a);else{const e=Aa(l,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?o?e.children.unshift(...a):e.children.push(...a):e.children=a)}c&&N(Object.assign({},i.current.handleState,{insert:o?"before":"after"})),y(d),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:n}=i.current,l=(Array.isArray(e)?e:[e]).map((e=>ae(e)?r(e,e.index):e));if(!l.length)return;let a=!1;const o=K(n,l,((e,n)=>{t.addToRemoved(e),c.forEach((r=>{const{dataIndex:i,editRender:l}=r,a=null==l?void 0:l(e,r);if(!a)return;const{rules:o=[],disabled:s}=a;!s&&o.length&&(t.removeFromRequired({x:n,y:i}),t.removeFromValidate({x:n,y:i}),t.removeFromEdited({x:n,y:i}))})),a=!0}));a&&(N(Object.assign({},i.current.handleState,{remove:!0})),b(o),I(p.filter((e=>!l.includes(e)))),l.includes(h)&&D(),R(m.filter((e=>!l.includes(e)))),g(),Bn((()=>{S(K(i.current.tableOriginData,l))})))},VALIDATE_FIELDS:(e,t)=>{i.current.allTableData.forEach((n=>{c.forEach((i=>{const{dataIndex:l,title:a,editRender:o}=i,s=null==o?void 0:o(n,i);if(!s)return;const c=r(n,n.index);if(e&&!e.includes(c))return;if(t&&!t.includes(l))return;const{rules:d=[],disabled:u}=s;u||C(d,ga(n,l),c,l,Ta(a))}))}));const{required:n,validate:l}=P(),a=[...n,...l];return a.length&&w(a[0].rowKey),A(),{required:n,validate:l}}})))})(n,{getRowKey:R,tableRef:O,toolBoxRef:N,tableBodyRef:S,columnFilterRef:T,flattenColumns:qe,editableColumns:je,pagination:ie,fetchParams:dt,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,isFetch:De,dataChange:Pt,getTableData:St,createTableData:Tt,createTableFullData:Ct,calcTableHeight:yt,scrollXToColumn:gt,scrollYToRecord:vt,doFieldValidate:Lt,setTableOriginData:_,setHandleState:V,setColumnsDefined:$,setSelectionKeysEffect:Rt,setRowExpandedKeys:de,setHighlightKey:pe,setSelectionRows:W,setOriginColumns:A,forceUpdate:ge,getTableLog:At,clearRowSelection:Vt,clearRowHighlight:zt,clearTableSorter:qt,clearTableFilter:jt,clearSuperFilters:Kt,clearTableLog:Wt}),t.useLayoutEffect((()=>{ut(),O.current.tableManager.register(O.current.uid,null!=n?n:{current:null})}),[]);const Gt={[`${I}--wrapper`]:!0,[`${I}--lg`]:"large"===E,[`${I}--sm`]:"small"===E,[`${I}--maximize`]:Le,[s]:!!s},Yt={[I]:!0,"is--border":Xe,"is--fixed":Ve.length||ze.length,"is--sortable":Qe,"is--filterable":Ze,"is--head-group":Ye,"is--area-select":!!c,"is--ping-left":Ie,"is--ping-right":Oe};return t.createElement(Ho.Provider,{value:Ut},t.createElement("div",{className:Pe(Gt,b),style:x},h&&t.createElement("div",{ref:w,className:`${I}-top`},t.createElement("div",{className:`${I}-top__space`},"bottom"!==(null==p?void 0:p.position)&&t.createElement(os,{total:ie.total}),t.createElement("div",{className:`${I}-top__space-slot`,style:{justifyContent:Bo[m]}},r.children)),t.createElement("div",{className:`${I}-top__actions`},t.createElement(Hu,{ref:N,showFullScreen:f,showReload:g&&De,showPrint:Ce.print&&!!d,showImport:Ce.import&&tt,showExport:Ce.export&&!!u,showClipboard:nt,showCollection:et,showFastSearch:it,showSuperSearch:rt,showPivotGrid:lt,showGroupSummary:at,showToolBox:v,tableColumns:$e}),t.createElement(Mu,{ref:T,columns:l}))),t.createElement(nl,{spinning:null!=a?a:Ne},t.createElement("div",{ref:C,className:Pe(Yt),style:pt},t.createElement("div",{className:`${I}--main-wrapper`},y&&t.createElement(tp,{tableColumns:$e}),t.createElement(Ep,{ref:S}),Ge&&t.createElement(wp,null)),Xe&&t.createElement("div",{className:`${I}--border-line`}),st&&t.createElement(Np,null),o&&t.createElement(Tp,null))),Me&&t.createElement(Sp,Rn({},ie,{onChange:(e,t)=>Mt({current:e,pageSize:t})}))))}));Ip.displayName="QmTable";const Rp=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:l,selectionRows:a,defaultSelectedKeys:o=[],filters:s=[],table:c={},className:d,style:u,onClose:p}=e,{$size:m}=$n(e),{t:h}=Fn(),f=t.useRef(null),g=t.useRef(null),v=t.useRef(null),y=sl(f),[b,x]=t.useState(c),[E,w]=t.useState(),[C,S]=t.useState(o),[N,T]=t.useState(!1),[I,R]=t.useState(300),[O,k]=t.useState(s),[L,A]=t.useState((e=>[{title:h("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[P,_]=t.useState(Ie({},null===(n=c.fetch)||void 0===n?void 0:n.params,l)),[D,H]=t.useState([]),F=()=>{const e=f.current,t=e.querySelector(".form-wrap");R(e.offsetHeight-t.offsetHeight-2*Do[m]-30)},M=cl(F,5);hn((()=>{M()}),[y.width]),Mi((()=>{me(s,O)||k(s)}),[s]),t.useEffect((()=>{$()}),[P]),t.useEffect((()=>{a&&v.current.SET_SELECTION_ROWS(a)}),[a]),t.useEffect((()=>{var e;l&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(l))}),[]);const $=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=b;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:l,beforeFetch:a=zn}=n;if(a(P)){T(!0);try{const t=yield r(P);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,l))&&void 0!==e?e:[];i||(S([]),yield Wn(0)),H(n)}}catch(e){}T(!1)}})),q=e=>{i||(w(e),p(e))},j=e=>{_(Object.assign({},P,e))},K={[`${lr("search-helper")}--wrapper`]:!0},V=b.webPagination?{dataSource:D,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:P})};return t.createElement("div",{ref:f,className:Pe(K,d),style:u},t.createElement("div",{className:"form-wrap"},O.length?t.createElement(oh,{ref:g,items:O,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>F(),onFinish:e=>j(e),onReset:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||j(t)}))}):null),t.createElement("div",null,t.createElement(Ip,Rn({ref:v,uniqueKey:r,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},V,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{S(e),w(i?t:t[0])}},topSpaceAlign:"left",paginationConfig:b.paginationConfig,columnsChange:e=>A(e),onRowDblclick:q,onRowEnter:q}),b.topBarExtra)),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Do[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>p(null),style:{marginRight:8}},h("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!E,onClick:()=>p(E,i?C:void 0)},h("qm.dialog.confirm"))))};Rp.displayName="QmSearchHelper";const{Search:Op}=O;class kp extends d{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||tr("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||tr("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&tr("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Hn(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t&&!Gn(u)){this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Za(e,this.alias,c),d&&Ja(e,this.extras,d),this._record=e,this.setFieldsValue(e),a){const t=Qa(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==l||l([e])}}}catch(e){}this.setState({loading:!1})}})),this.todoOpen=e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)},this.createFilters=e=>{const{fieldName:t}=this.props.option,{filterAliasMap:n}=this.searchHelper,r=""!==e?e:void 0,i=("function"==typeof n?n():n)||[],l={[t]:r};return(Array.isArray(i)?i:[i]).forEach((e=>{if(ae(e))for(const t in e)l[t]="function"==typeof e[t]?e[t](r):r;else l[e]=r})),l},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=zn,formatter:i=(e=>e)}=t.fetch;return new Promise(((l,a)=>Hn(this,void 0,void 0,(function*(){var o;const s=Ie({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});if(!r(s))return a();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=ue(e.data,t.fetch.dataKey))&&void 0!==o?o:[];l(n)}else a()}catch(e){a(e)}finally{Bn((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=Qa(e,this.alias[r]);void 0!==i&&(t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i))}for(const n in this.extras){const r=Qa(e,this.extras[n]);void 0!==r&&t.SET_FIELDS_EXTRA({[n]:r})}},this.resetSearchHelperValue=(e=[],t)=>Hn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,r=e.filter((e=>{var r;return null===(r=Qa(e,this.alias[n]))||void 0===r?void 0:r.toString().toLowerCase().includes(t.toLowerCase())}));if(1===r.length)return this.closeSearchHelper(r[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:r}=this.searchHelper,i=(null!=r?r:zn)(n.state.formData);(null==i?void 0:i.then)?i.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==i&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias)r!==n&&t.SET_FIELDS_VALUE({[r]:Qa(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Qa(e,this.extras[n])});const r=Qa(e,this.alias[n]);this.triggerChange(r),this.searchHelperChangeHandle(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.closeButNotSelect=()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this._prevValue=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:l}=this.props,{type:a,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=un("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:un("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${Do[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:Object.assign({},this.deriveParams,c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(xo,{value:l,bordered:p}):t.createElement(t.Fragment,null,t.createElement(Op,{ref:e=>this[`${a}_Ref`]=e,value:l,title:l,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:m,readOnly:h,disabled:f,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:i=!0,table:l}=this.searchHelper;this.triggerBlur(n),this._is_change&&!r&&(n?i?(null===(t=null==l?void 0:l.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e,n))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(n):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!r&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):Bn((()=>this.clearSearchHelperValue())))}}),t.createElement(Fl,b,t.createElement(Rp,x)))}}kp.contextType=Ml;class Lp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=lo(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[]}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(kp,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Lp.contextType=Ml;const Ap=e=>{class n extends d{constructor(){super(...arguments),this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var n,r;const i=e.target,l=null==t?void 0:t.target,a=!i||!l,o=(null===(n=this.$el)||void 0===n?void 0:n.contains(i))||(null===(r=this.$el)||void 0===r?void 0:r.contains(l)),s=this.$el===i,c=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),d=c.some((e=>null==e?void 0:e.contains(i)))||c.includes(l);let u;u=!(a||o||s||d),this.setState({clickOutside:u})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=Kt(document,"mousedown",this.mousedownHandler),this.event2=Kt(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:n}=this.props,{clickOutside:r}=this.state;return t.createElement(e,Rn({ref:n},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return n.displayName=`OutsideClick(${e.displayName||e.name})`,t.forwardRef(((e,r)=>t.createElement(n,Rn({},e,{forwardedRef:r}))))};let Pp=class extends d{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||tr("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||tr("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(ke([...this._records.filter((e=>t.includes(e[n]))),...e],n));const r=this.recordsToDict();this.setItemList(r),this.triggerChange(r.map((e=>e.value)));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;me(n,r)||me(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:l={},formatter:a=(e=>e),dataKey:o,callback:s,fieldAliasMap:c}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof c?c():c||{},{value:u}=this.props;if(i){if(Gn(u))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(a(Object.assign(Object.assign({},l),{keys:u})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=ue(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==r&&(e[r]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==n&&(e[n]=e[d.textKey])})),i=i.filter((e=>u.includes(e[r])));const l=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(l),this.setViewValue(u),null==s||s(i)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:l,visible2:a,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:m={},placeholder:h=un("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,w={visible:l,title:un("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${Do[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:Ie({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),S=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},un("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=lr("form-multiple-search-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(xo,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(td,{popupVisible:!y&&a,popup:N,popupClassName:Pe(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Ka,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement(H,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:h,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},m),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Nt,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(Fl,w,t.createElement(Rp,C)))}};Pp.contextType=Ml,Pp=Dn([Ap],Pp);class _p extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=lo(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Pp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(a,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}_p.contextType=Ml;const Dp=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Dp(e.children)),e.children&&t.push(e.value)})),t},Hp=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=Hp(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},Fp=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Fp(e.children,t),t(e)||e.children&&e.children.length))),Mp=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:l,selectionRows:a,defaultSelectedKeys:o=[],filters:s=[],table:c={},tree:d={},className:u,style:p,onClose:m}=e,{$size:h}=$n(e),{t:f}=Fn(),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=sl(g),[x,E]=t.useState(c),[w,C]=t.useState(),[S,N]=t.useState(o),[T,I]=t.useState(!1),[R,k]=t.useState(300),[L,A]=t.useState(300),[P,_]=t.useState(s),[D,H]=t.useState((e=>[{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[F,M]=t.useState(Ie({},null===(n=c.fetch)||void 0===n?void 0:n.params,l)),[$,q]=t.useState([]),j=()=>{const e=g.current,t=e.querySelector(".form-wrap"),n=e.querySelector(".input-wrap");k(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*Do[h]-30)},K=cl(j,5);hn((()=>{K()}),[b.width]),Mi((()=>{me(s,P)||_(s)}),[s]),t.useEffect((()=>{V()}),[F]),t.useEffect((()=>{a&&y.current.SET_SELECTION_ROWS(a)}),[a]),t.useEffect((()=>{var e;l&&(null===(e=v.current)||void 0===e||e.SET_FIELDS_VALUE(l)),te()}),[]);const V=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=x;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:l,beforeFetch:a=zn}=n;if(a(F)){I(!0);try{const t=yield r(F);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,l))&&void 0!==e?e:[];i||(N([]),yield Wn(0)),q(n)}}catch(e){}I(!1)}})),W=e=>{i||(C(e),m(e))},B=e=>{M(Object.assign({},F,e))},[U,G]=t.useState([]),[Y,X]=t.useState([]),[Q,Z]=t.useState(""),J=t.useRef(U),ee=t.useRef([]);Mi((()=>{X(Dp(U))}),[U]);const te=()=>Hn(void 0,void 0,void 0,(function*(){var e;if(!d.fetch)return;const{api:t,params:n,dataKey:r,valueKey:i="value",textKey:l="text"}=d.fetch;try{const a=yield t(n);if(200===a.code){const t=Array.isArray(a.data)?a.data:null!==(e=ue(a.data,r))&&void 0!==e?e:[],n=eo(t,i,l);G(n),J.current=n,ee.current=t}}catch(e){}})),ne=e=>`${e}|${yo.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${lr("tree-table-helper")}--wrapper`]:!0},ie=x.webPagination?{dataSource:$,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},x.fetch),{params:F})};return t.createElement("div",{ref:g,className:Pe(re,u),style:p},t.createElement(Ji,{defaultValue:200,style:{height:"100%"}},t.createElement(Ji.Pane,{min:100,style:{overflowY:"auto"}},t.createElement(O,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:f("qm.form.inputPlaceholder"),suffix:t.createElement(Nt,null),allowClear:!0,onChange:e=>(e=>{const t=Fp(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==ne(n).indexOf(e)}));Z(e),G(t)})(e.target.value)}),t.createElement(z,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:Y,treeData:U,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==ne(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return tr("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const r in t)n[r]=ue(e,t[r]);B(n)})(Hp(ee.current,(n=>ue(n,t)===e[0]))||{})}})),t.createElement(Ji.Pane,{className:"split-pane"},t.createElement("div",{className:"form-wrap"},P.length?t.createElement(oh,{ref:v,items:P,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>j(),onFinish:e=>B(e),onReset:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA();e||B(t)}))}):null),t.createElement("div",null,t.createElement(Ip,Rn({ref:y,uniqueKey:r,height:L,columns:D,rowKey:x.rowKey||"pageIndex"},ie,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:S,onChange:(e,t)=>{N(e),C(i?t:t[0])}},topSpaceAlign:"left",paginationConfig:x.paginationConfig,columnsChange:e=>H(e),onRowDblclick:W,onRowEnter:W}),x.topBarExtra)))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Do[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>m(null),style:{marginRight:8}},f("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!w,onClick:()=>m(w,i?S:void 0)},f("qm.dialog.confirm"))))};Mp.displayName="TreeTableHelper";const{Search:$p}=O;class qp extends d{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||tr("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||tr("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&tr("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Hn(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t&&!Gn(u)){this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Za(e,this.alias,c),d&&Ja(e,this.extras,d),this._record=e,this.setFieldsValue(e),a){const t=Qa(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==l||l([e])}}}catch(e){}this.setState({loading:!1})}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=Qa(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Qa(e,this.extras[n])})},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias)r!==n&&t.SET_FIELDS_VALUE({[r]:Qa(e,this.alias[r])});for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Qa(e,this.extras[n])});const r=Qa(e,this.alias[n]);this.triggerChange(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const n in this.alias)n!==t&&e.SET_FIELDS_VALUE({[n]:void 0});for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this._prevValue=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:l=""}=this.props,{type:a,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=un("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:un("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${Do[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:Ie({},c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return n.isOnlyShow?t.createElement(xo,{value:l,bordered:p}):t.createElement(t.Fragment,null,t.createElement($p,{ref:e=>this[`${a}_Ref`]=e,value:l,title:l,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:m,readOnly:h,disabled:f,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),t.createElement(Fl,b,t.createElement(Mp,x)))}}qp.contextType=Ml;class jp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=lo(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(qp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n)=>{f(t,n),e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}jp.contextType=Ml;let Kp=class extends d{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||tr("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||tr("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(ke([...this._records.filter((e=>t.includes(e[n]))),...e],n));const r=this.recordsToDict();this.setItemList(r),this.triggerChange(r.map((e=>e.value)));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;me(n,r)||me(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:l={},formatter:a=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof s?s():s||{},{value:d}=this.props;if(i){if(Gn(d))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(a(Object.assign(Object.assign({},l),{keys:d})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=ue(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==c?void 0:c.valueKey)&&c.valueKey!==r&&(e[r]=e[c.valueKey]),(null==c?void 0:c.textKey)&&c.textKey!==n&&(e[n]=e[c.textKey])})),i=i.filter((e=>d.includes(e[r])));const l=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(l),this.setViewValue(d)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:l,visible2:a,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:m={},placeholder:h=un("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,w={visible:l,title:un("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${Do[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:Ie({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),S=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},un("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=lr("form-multiple-tree-table-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(xo,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(td,{popupVisible:!y&&a,popup:N,popupClassName:Pe(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Ka,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement(H,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:h,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},m),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Nt,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(Fl,w,t.createElement(Mp,C)))}};Kp.contextType=Ml,Kp=Dn([Ap],Kp);class Vp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=lo(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Kp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(a,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Vp.contextType=Ml;const zp="_startSign",Wp="_endSign",Bp=e=>{var n;const{uniqueKey:r,initialValue:i,filters:l=[],table:a={},onClose:o}=e,{$size:s}=$n(e),{t:c}=Fn(),d=t.useRef(null),u=t.useRef(null),p=t.useRef(null),m=sl(d),[h,f]=t.useState(a),[g,v]=t.useState(!1),[y,b]=t.useState([]),[x,E]=t.useState(300),[w,C]=t.useState(l),[S,N]=t.useState((e=>[{title:c("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},{title:c("qm.form.rangeSearchHelper")[0],dataIndex:zp,width:80,align:"right",render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)},...e||(a.columns||[]),{title:c("qm.form.rangeSearchHelper")[1],dataIndex:Wp,fixed:"right",width:80,render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)}])()),[T,I]=t.useState(Ie({},null===(n=a.fetch)||void 0===n?void 0:n.params,i)),[O,k]=t.useState([]),L=t.useMemo((()=>y.map((e=>null==e?void 0:e.pageIndex))),[y]),A=t.useMemo((()=>2===L.length&&L.every((e=>void 0!==e))),[L]),P=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");E(e.offsetHeight-t.offsetHeight-2*Do[s]-30)},_=cl(P,5);hn((()=>{_()}),[m.width]),Mi((()=>{me(l,w)||C(l)}),[l]),t.useEffect((()=>{D()}),[T]);const D=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=h;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:l=zn}=n;if(l(T)){v(!0);try{const t=yield r(T);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[];k(n)}}catch(e){}v(!1)}})),H=(e,t)=>{delete e[t]},F=()=>{y.forEach((e=>{e&&(H(e,zp),H(e,Wp))})),b([])},M=e=>{F(),I(Object.assign({},T,e))},$=lr("range-helper"),q=h.webPagination?{dataSource:O,loading:g,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:T})};return t.createElement("div",{ref:d,className:`${$}--wrapper`},t.createElement("div",{className:"form-wrap"},w.length?t.createElement(oh,{ref:u,items:w,initialValues:i,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>C(e),onCollapse:()=>P(),onFinish:e=>M(e),onReset:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();e||M(t)}))}):null),t.createElement("div",null,t.createElement(Ip,Rn({ref:p,height:x,columns:S,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=L[0]&&e.pageIndex<=L[1]?{backgroundColor:"#f5f5f5"}:{}},q,{columnsChange:e=>N(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[zp,Wp].includes(n)&&(n===zp&&(e[n]?(H(e,n),b([void 0,y[1]])):e.pageIndex>L[1]?R.warning(c("qm.searchHelper.rangeStartTip")):(y[0]&&H(y[0],n),e[n]="[",b([e,y[1]]))),n===Wp&&(e[n]?(H(e,n),b([y[0],void 0])):e.pageIndex<L[0]?R.warning(c("qm.searchHelper.rangeEndTip")):(y[1]&&H(y[1],n),e[n]="]",b([y[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===L[0]&&(e[zp]="["),e.pageIndex===L[1]&&(e[Wp]="]")}))}}),t.createElement(nr,{type:"primary",icon:t.createElement(Tt,null),title:c("qm.table.alert.clear"),onClick:()=>F()}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Do[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>o(null),style:{marginRight:8}},c("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!A,onClick:()=>o(y.map((e=>(e=>{const t={};for(const n in e)[zp,Wp].includes(n)||(t[n]=e[n]);return t})(e))))},c("qm.dialog.confirm"))))};Bp.displayName="RangeTableHelper";const Up=new Array(2).fill("");class Gp extends d{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Up},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||tr("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||tr("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;this._is_change=!1,null==t||t(e),n(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(Up),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:n}=this.alias,r=e.map((e=>({value:e[t],text:e[n]})));this.setRecords(e),this.setItemList(r),this.setTextValue(r.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:Gn(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=zn,formatter:i=(e=>e)}=t.fetch;return new Promise(((l,a)=>Hn(this,void 0,void 0,(function*(){var o;const s=Ie({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!r(s))return a();this.setState({loading:!0});const e=yield t.fetch.api(s);if(Bn((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=ue(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return l(n)}}catch(e){this.setState({loading:!1})}a()}))))},this.resetSearchHelperValue=(e=[])=>Hn(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:n}=this.alias,r=e.filter((e=>{var r;const i=null===(r=e[n])||void 0===r?void 0:r.toString().toLowerCase();return t.some((e=>null==i?void 0:i.includes(e.toLowerCase())))}));if(2===r.length)return this.closeSearchHelper(r);this.openSearchHelper()})),this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;me(t,n)||me(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:i}=this.props.option;if(!me(r[i],this._ceho_data)&&(this._ceho_data=r[i],this.setItemList(r[i]),n.length)){const e=Up.map(((e,t)=>{var l,a;return null!==(a=null===(l=r[i].find((e=>e.value===n[t])))||void 0===l?void 0:l.text)&&void 0!==a?a:""}));this.setTextValue(e)}}getItemList(){var e;return Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:n}=this.alias,{fetchApi:r,params:i={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(r){if(Gn(c))return this.setRecords([]);this.setState({loading:!0});try{const o=yield r(l(Object.assign(Object.assign({},i),{keys:c})));if(200===o.code){let r=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,a))&&void 0!==e?e:[];r.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==n&&(e[n]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),r=r.filter((e=>c.includes(e[n]))).slice(0,2);const i=r.map((e=>({value:e[n],text:e[t]})));this.setRecords(r),this.setItemList(i),this.setTextValue(i.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}))}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){var e;const{$$form:n}=this.context;this.props;const{visible:r,loading:i,textValue:l}=this.state,{fieldName:a,options:o={},searchHelper:s={},placeholder:c=un("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:m=!0}=this.searchHelper||s,h=l.every((e=>Xa(e)))?"":l.join(" - "),f={visible:r,title:un("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Do[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},g=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:Ie({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(xo,{value:h,bordered:d}):t.createElement(t.Fragment,null,t.createElement(O.Group,null,t.createElement(O,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:c[0],allowClear:!1,bordered:d,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?l.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):l.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;m||(this._is_change=!0,this.setTextValue([t,l[1]]))}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:p,readOnly:!0}),t.createElement(O.Search,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:c[1],loading:i,bordered:d,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?l.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):l.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:m||(this._is_change=!0,this.setTextValue([l[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),t.createElement(Fl,f,t.createElement(Bp,g)))}}Gp.contextType=Ml;class Yp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=lo(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(c),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Gp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{h(t,r),e.setViewValue(a,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(a,u)),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Yp.contextType=Ml;const Xp=e=>{const{$$form:n}=t.useContext(Ml),{value:r,items:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,m=Gn(p)?i:p,h=e=>m.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return n.isOnlyShow?t.createElement(xo,{value:h(r),bordered:c}):t.createElement(F.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u,onChange:e=>{(e=>{null==l||l(e),a(e,h(e))})(e)}},m.map((e=>t.createElement(F,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Qp extends d{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}getItemList(){var e;return Hn(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Xp,{option:this.props.option,items:n,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Qp.contextType=Ml;const Zp=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},style:o={},allowClear:s=!0,readOnly:c,disabled:d=n.isFormDisabled}=e.option,{allowHalf:u,count:p=5,tooltips:m}=a,h=e=>m?m[Math.ceil(e)-1]:e.toString();return t.createElement(U,{value:r,count:p,style:o,allowHalf:u,allowClear:s,tooltips:m,disabled:d||n.isOnlyShow,onChange:e=>{(e=>{null==i||i(e),l(e,h(e))})(e)}})};class Jp extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Zp,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Jp.contextType=Ml;const em=e=>{const{$$form:n}=t.useContext(Ml),{value:r,items:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u=n.isFormDisabled}=e.option,{itemList:p=[]}=o,m=Gn(p)?i:p,h=e=>{var t,n;return null!==(n=null===(t=m.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==n?n:""};return n.isOnlyShow?t.createElement(xo,{value:h(r),bordered:c}):t.createElement(j.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u||n.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),a(e,h(e))})(t)}},m.map((e=>t.createElement(j,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class tm extends d{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(em,{option:this.props.option,items:n,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}tm.contextType=Ml;const nm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{label:a,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToSwitch:u,falseValue:p=$a,trueValue:m=Ma}=o,{t:h}=Fn();return t.createElement(t.Fragment,null,t.createElement(W,{checked:r===m,style:s,disabled:d||n.isOnlyShow,checkedChildren:t.createElement($e,null),unCheckedChildren:t.createElement(it,null),onChange:e=>{(e=>{null==i||i(e),l(e,h(e===m?"am.form.trueText":"am.form.falseText"))})(e?m:p)}}),u?t.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},a):null)};class rm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option,{labelToSwitch:h}=o;return t.createElement(P.Item,{label:h?" ":e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(nm,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}rm.contextType=Ml;const im=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{options:o={},style:s={},placeholder:c=a("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u,readOnly:p,disabled:m,onFocus:h,onBlur:f,onEnter:g}=e.option,{showCount:v,maxLength:y,autoSize:b}=o,x=Object.assign({},{minRows:1,maxRows:3},b);return t.createElement(O.TextArea,{value:r,placeholder:c,style:s,maxLength:y,showCount:v,autoSize:x,bordered:d,allowClear:u,readOnly:p||n.isOnlyShow,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),null==f||f(n,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==g||g(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==i||i(e),l(e)})(t)}})};class lm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(im,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}lm.contextType=Ml;const am=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.datePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:f}=e.option,{dateType:g="date",format:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=s,w=t.createRef(),C=e=>{e&&"date"===g&&(e=e.slice(0,10)+" 00:00:00"),null==i||i(e),l(e,S(e))},S=e=>Xa(e)?"":["date","exactdate"].includes(g)?e.slice(0,10):e,N=e=>{let t=Ya(m().subtract(e,"day"),za[g]);"date"===g&&(t=t.slice(0,10)),C(t),w.current.blur(),w.current.focus()};return n.isOnlyShow?t.createElement(xo,{value:S(r),bordered:u}):t.createElement(In,{ref:w,style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:Va[g],format:v,bordered:u,showToday:!1,showTime:"datetime"===g&&{defaultValue:m("00:00:00","HH:mm:ss")},allowClear:p,disabled:f,inputReadOnly:h,disabledDate:null!=y?y:e=>((e,[t,n])=>t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day"))(e,[b,x]),renderExtraFooter:E&&g.includes("date")?()=>"function"==typeof E?E():t.createElement(t.Fragment,null,t.createElement(G,{color:"processing",onClick:()=>N(0)},a("qm.form.datePickers")[0]),t.createElement(G,{color:"processing",onClick:()=>N(1)},a("qm.form.datePickers")[1]),t.createElement(G,{color:"processing",onClick:()=>N(7)},a("qm.form.datePickers")[2]),t.createElement(G,{color:"processing",onClick:()=>N(30)},a("qm.form.datePickers")[3])):void 0,value:Ga(r,za[g]),onChange:(e,t)=>{C(Ya(e,za[g]))}})};class om extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(am,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}om.contextType=Ml;const sm=e=>[m().subtract(e,"day"),m()],cm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:f=n.isFormDisabled}=e.option,{dateType:g="date",format:v,disableds:y=[!1,!1],allowEmpty:b,disabledDate:x,minDateTime:E,maxDateTime:w,shortCuts:C=!0}=s,S={[a("qm.form.dateRangePickers")[0]]:sm(7),[a("qm.form.dateRangePickers")[1]]:sm(30),[a("qm.form.dateRangePickers")[2]]:sm(90),[a("qm.form.dateRangePickers")[3]]:sm(180)},N=e=>Xa(e)?"":e.map((e=>["date","exactdate"].includes(g)?null==e?void 0:e.slice(0,10):e)).join(" - ");return n.isOnlyShow?t.createElement(xo,{value:N(r),bordered:u}):t.createElement(In.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:Va[g],format:v,bordered:u,showTime:"datetime"===g&&{defaultValue:[m("00:00:00","HH:mm:ss"),m("23:59:59","HH:mm:ss")]},allowClear:p,allowEmpty:b,disabled:f?[!0,!0]:y,inputReadOnly:h,disabledDate:null!=x?x:e=>((e,[t,n])=>t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day"))(e,[E,w]),ranges:C&&g.includes("date")?S:void 0,value:Gn(r)?null:[Ga(null==r?void 0:r[0],za[g]),Ga(null==r?void 0:r[1],za[g])],onChange:(e,t)=>{(e=>{"date"===g&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==i||i(e),l(e,N(e))})([Ya(null==e?void 0:e[0],za[g]),Ya(null==e?void 0:e[1],za[g])])}})};class dm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(cm,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}dm.contextType=Ml;const um=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.timePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=e.option,{timeType:f="hour-minute-second",hourStep:g=1,minuteStep:v=1,secondStep:y=1}=s;return n.isOnlyShow?t.createElement(xo,{value:r,bordered:u}):t.createElement(On,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!0,hourStep:g,minuteStep:v,secondStep:y,allowClear:p,disabled:h,inputReadOnly:m,format:Wa[f],value:Ga(r,Wa[f]),onChange:(e,t)=>{(e=>{const t=Ya(e,Wa[f]);null==i||i(t),l(t)})(e)}})};class pm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(um,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}pm.contextType=Ml;const mm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h=n.isFormDisabled}=e.option,{timeType:f="hour-minute-second",disableds:g=[!1,!1],allowEmpty:v,hourStep:y=1,minuteStep:b=1,secondStep:x=1}=s,E=e=>Xa(e)?"":e.join(" - ");return n.isOnlyShow?t.createElement(xo,{value:E(r),bordered:u}):t.createElement(On.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!1,hourStep:y,minuteStep:b,secondStep:x,allowClear:p,allowEmpty:v,disabled:h?[!0,!0]:g,inputReadOnly:m,format:Wa[f],value:Gn(r)?null:[Ga(null==r?void 0:r[0],Wa[f]),Ga(null==r?void 0:r[1],Wa[f])],onChange:(e,t)=>{(e=>{const t=[Ya(null==e?void 0:e[0],Wa[f]),Ya(null==e?void 0:e[1],Wa[f])];null==i||i(t),l(t,E(t))})(e)}})};class hm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(mm,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}hm.contextType=Ml;class fm extends d{constructor(e){super(e),this.searchRef=t.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=Wt(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.paramsChangeHandler=(e,t)=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting(),me(e,t)||this.getItemList()})),this.echoSearchHelper=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:n}=this.props.option,{fieldAliasMap:r,fieldsDefine:i,echoRequest:l}=this.searchHelper;if(r||tr("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(e)||tr("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&tr("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&tr("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getItemText=()=>Hn(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t&&!Gn(u))try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Za(e,this.alias,c),d&&Ja(e,this.extras,d),this._record=e,this.setFieldsValue(e),a){const t=Qa(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==l||l([e])}}}catch(e){}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias){const i=Qa(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Qa(e,this.extras[n])})},this.fetchHandle=Le(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:n}=this.context,{fieldName:r}=this.props.option;for(const t in this.alias)t!==r&&n.SET_FIELDS_VALUE({[t]:Qa(e,this.alias[t])});for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:Qa(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=Qa(e,this.alias[r]);this.triggerChange(i),this.setState({inputText:void 0}),t&&t()},this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(e){var t,n,r,i,l,a;const o=(null===(n=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===n?void 0:n.params)||(null===(r=e.option.request)||void 0===r?void 0:r.params),s=(null===(l=null===(i=this.props.option.searchHelper)||void 0===i?void 0:i.request)||void 0===l?void 0:l.params)||(null===(a=this.props.option.request)||void 0===a?void 0:a.params);this.paramsChangeHandler(s,o),this.echoSearchHelper()}getItemList(e){var t;return Hn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:r,params:i={},formatter:l=(e=>e),dataKey:a}=this.searchHelper.request||this.props.option.request||{};if(r){this.setState({loading:!0});try{const o=yield r(l(Object.assign(Object.assign({},i),{[n]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=ue(o.data,a))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:n,loading:r,itemList:i,inputText:l}=this.state,{value:a}=this.props,{fieldName:o,options:s={},style:c={},placeholder:d=un("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=this.props.option,{listHeight:f=qa}=s,{hideHeader:g,onlySelect:v=!0}=this.searchHelper||s,y=this.searchHelper.columns||[],b=lr("form-immediate"),x=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,E=t.createElement(T,{spinning:r},i.length?t.createElement("table",{cellSpacing:0,cellPadding:0,className:Pe("table")},!g&&t.createElement("thead",null,t.createElement("tr",null,y.filter((e=>!e.hidden)).map((e=>t.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),t.createElement("tbody",null,i.map(((e,n)=>t.createElement("tr",{key:n,className:this.state.activeIndex===n?"active":"",onMouseEnter:()=>{this.setState({activeIndex:n})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},y.filter((e=>!e.hidden)).map((n=>t.createElement("td",{key:n.dataIndex},ue(e,n.dataIndex))))))))):t.createElement(tl,null));return t.createElement(on.Consumer,null,(r=>{const s={[b]:!0,[`${b}--lg`]:"large"===(null==r?void 0:r.size),[`${b}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(xo,{value:a,bordered:u}):t.createElement(td,{action:h?[]:["click"],popupVisible:!h&&n,popup:E,popupClassName:Pe(s,`form-popper__${o}`),popupStyle:{minWidth:x,maxHeight:f},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ka,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:d,allowClear:p,bordered:u,readOnly:m,disabled:h,style:Object.assign({width:"100%"},c),value:null!=l?l:a,title:a,onFocus:()=>{!i.length&&this.fetchHandle(a)},onBlur:e=>{v&&!this._clicking&&l!==a&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(i[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const n=40===e.keyCode?++t%i.length:(--t+i.length)%i.length;this.setState({activeIndex:n})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),v?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}fm.contextType=Ml;class gm extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=lo(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(fm,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="",n)=>{f(t,n),e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}gm.contextType=Ml;class vm extends d{render(){var e;const{$$form:n}=this.context,{type:r,label:i,fieldName:l,className:a,style:o={},collapse:s={}}=this.props.option,{expand:c}=n.state,{showLimit:d,remarkItems:u=[],onCollapse:p=Vn}=s,m=[];if(u.length){const t=null!==(e=n.getBlockDerivedItems().find((e=>e[0].fieldName===l)))&&void 0!==e?e:[],r=null!=d?d:t.length-1;t.slice(r+1).forEach((e=>{var t;const r=u.find((t=>t.fieldName===e.fieldName));if(!r)return;const i=r.showLabel?`${e.label}:`:"",l=null!==(t=n.getViewValue(e.fieldName))&&void 0!==t?t:"";""!==l&&m.push(Object.assign(Object.assign({},e),{text:`${i}${l}`}))}))}return t.createElement(P.Item,{labelCol:{span:0},wrapperCol:{span:24}},t.createElement(ar,{id:l,label:i,className:a,extra:m.map((e=>e.text)).join(" | "),style:Object.assign({},o),collapse:c[l],onCollapseChange:e=>{n.setState((t=>({expand:Object.assign({},t.expand,{[l]:e})}))),p(e)}}))}}vm.contextType=Ml;const ym=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:ym(e.children,t,n,r)}):e)),bm=e=>{var n;const{$$form:r}=t.useContext(Ml),{value:i,items:l,multiple:a,loading:o,onChange:s,onValuesChange:c}=e,{t:d}=Fn(),{fieldName:u,options:p={},style:m={},placeholder:h=d("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,asyncLoad:v,readOnly:y,disabled:b}=e.option,{itemList:x,filterable:E=!0,listHeight:w=qa,checkStrictly:C,checkStrategy:S="SHOW_CHILD",collapseTags:N,echoRequest:T,defaultExpandAll:I=!v,defaultExpandedKeys:R,dropdownStyle:O,openPyt:k=!0}=p,[L,A]=t.useState(Gn(x)?l:x),[P,_]=t.useState([]),[D,H]=t.useState(!1),[F,M]=t.useState(!1),$=t.useRef(null),q=t.useRef(null),j=t.useRef(L),K=t.useRef(F),V=t.useRef(null),z=e=>{M(e),K.current=e};yu({ref:q,handler:()=>z(!1)}),t.useEffect((()=>{i!==V.current&&(U(),V.current=i),(()=>{var e;q.current=(null===(e=$.current)||void 0===e?void 0:e.querySelector(".ant-select-selection-overflow-item-rest"))||null})()}),[i]),Mi((()=>{const e=Gn(x)?l:x;v?me(e,j.current)||(A((t=>[...e,...t.filter((e=>!!e.style))])),j.current=e):A(e)}),[x,l]),Mi((()=>{A((e=>[...e,...P.filter((t=>!e.some((e=>e.value===t.value))))]))}),[P]);const W=e=>{var t;return(null===(t=to(L,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},B=e=>(C&&Array.isArray(i)&&i.every((e=>ae(e)))&&(e=e.map((e=>e.value))),a?(null==e?void 0:e.map((e=>W(e))).join(","))||"":W(e)),U=()=>Hn(void 0,void 0,void 0,(function*(){var e;if(!T)return;if(!v)return tr("Form","TREE_SELECT 的 echoRequest 选项必须组合 `asyncLoad` 一起使用");const{fetchApi:t,params:n,dataKey:r,callback:l,formatter:a=(e=>e)}=T||{},{textKey:o="text",valueKey:s="value"}=v;if(t&&!Gn(i))try{const c=yield t(a(Object.assign(Object.assign({},n),{[s]:i})));if(200===c.code){const t=Array.isArray(c.data)?c.data:null!==(e=ue(c.data,r))&&void 0!==e?e:[];if(t.length){const e=eo(t,s,o);_(e.map((e=>Object.assign(Object.assign({},e),{style:{display:"none"}})))),null==l||l(t)}}}catch(e){}}));return r.isOnlyShow?t.createElement(xo,{value:B(i),bordered:f}):t.createElement(td,{popupVisible:!b&&F,popup:(()=>{if(!a)return null;const e=(null==i?void 0:i.map((e=>W(e))))||[];return t.createElement("ul",{className:"ant-dropdown-menu"},e.length?e.map(((e,n)=>t.createElement("li",{key:`${e}-${n}`,className:"ant-dropdown-menu-item"},e))):t.createElement("li",{className:"ant-dropdown-menu-item"},d("qm.table.config.emptyText")))})(),popupStyle:{minWidth:null===(n=$.current)||void 0===n?void 0:n.offsetWidth},onPopupVisibleChange:e=>z(e),builtinPlacements:Ka,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",{ref:$,style:{width:"100%"}},t.createElement(Y,Rn({open:D,fieldNames:{label:"text",value:"value",children:"children"},value:i,multiple:a,treeCheckable:a,treeCheckStrictly:C,showCheckedStrategy:Y[S],popupClassName:`form-popper__${u}`,dropdownStyle:O,placeholder:h,listHeight:w,style:m,loading:o,bordered:f,allowClear:g,disabled:b,treeDefaultExpandAll:I,treeDefaultExpandedKeys:R,showSearch:E,maxTagCount:N?"responsive":void 0,loadData:v?({key:e,children:t})=>Hn(void 0,void 0,void 0,(function*(){var n;if(!v||t)return;const{fetchApi:r,params:i,dataKey:l,textKey:a="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=v;if(r)try{const t=yield r(c(Object.assign(Object.assign({},i),{[o]:e})));if(200===t.code){const r=Array.isArray(t.data)?t.data:null!==(n=ue(t.data,l))&&void 0!==n?n:[],i=ym(L,e,o,eo(r,o,a));A(i),null==s||s(r)}}catch(e){}})):void 0,treeData:L},a?{title:B(i)}:null,{filterTreeNode:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=yo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(k?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onMouseDown:e=>{e.target.classList.contains("ant-select-selection-overflow-item-rest")&&(z(!0),H(!1))},onDropdownVisibleChange:e=>{if(!e)return H(e);Bn((()=>{K.current||H(e)}))},onChange:e=>{(e=>{null==s||s(e),c(e,B(e),L)})(e),V.current=e}}))))};class xm extends d{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=eo(n,l,a);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(l),className:Pe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Zn(d)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(bm,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Zn(p.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}xm.contextType=Ml;const Em=e=>{const{$$form:n}=t.useContext(Ml),{value:r,multiple:i,items:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,asyncLoad:m,readOnly:h,disabled:f}=e.option,{itemList:g,changeOnSelect:v,checkStrictly:y,checkStrategy:b="SHOW_PARENT",filterable:x=!0,dropdownStyle:E,openPyt:w=!0}=s,[C,S]=t.useState(Gn(g)?l:g),N=t.useRef(C);Mi((()=>{const e=Gn(g)?l:g;m?me(e,N.current)||(S(e),N.current=e):S(e)}),[g,l]);const T=e=>no(C,null!=e?e:"").map((e=>e.text)).join("/"),I=e=>i?(null==e?void 0:e.map((e=>T(e))).join(","))||"":T(e);return n.isOnlyShow?t.createElement(xo,{value:I(r),bordered:u}):t.createElement(X,Rn({value:(e=>Gn(e)?[]:i?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:C,multiple:i,maxTagCount:"responsive",changeOnSelect:v||y,showCheckedStrategy:X[b],popupClassName:`form-popper__${o}`,dropdownStyle:E,placeholder:d,style:c,bordered:u,allowClear:p,disabled:f,showSearch:x&&!m&&{filter:(e,t)=>t.some((t=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=yo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(w?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:m?e=>Hn(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!m||n.children)return;const{fetchApi:r,params:i,dataKey:l,textKey:a="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=m;if(r)try{const e=yield r(c(Object.assign(Object.assign({},i),{[o]:n.value})));if(200===e.code){const r=Array.isArray(e.data)?e.data:null!==(t=ue(e.data,l))&&void 0!==t?t:[],i=ym(C,n.value,o,eo(r,o,a));S(i),null==s||s(r)}}catch(e){}})):void 0},i?{title:I(r)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:r}=e;null==n||n(t),r(t,I(t),C)})(((e=[])=>i?e.map((e=>e.join(","))):e.join(","))(t))}}))};class wm extends d{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=eo(n,l,a);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:n}=this.props,{itemList:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(l),className:Pe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Zn(d)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(Em,{option:this.props.option,multiple:n,items:r,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Zn(p.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}wm.contextType=Ml;const Cm=["110000","120000","310000","500000"],Sm=["810000","820000"],Nm=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Tm=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Im=e=>yo.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Rm=(e,t,n=1)=>{if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Cm,...Sm].includes(e))):Object.keys(e[t])).map((r=>({l:Im(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Rm(e,r,n+1)})))},Om=(e,t)=>t.map((t=>({l:Im(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class km extends d{constructor(e){super(e),this.searchRef=t.createRef(),this.scrollRef=t.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),Vt(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:Om(rn,Cm)},{l:"Z2",n:"港澳",c:"",p:"",children:Om(rn,Sm)}]}createProvince(){var e;return(null!==(e=Rm(rn,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Tm.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Cm,...Sm].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t.createElement(j.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},t.createElement(j.Button,{value:"0"},un("qm.form.citySelectType.0")),t.createElement(j.Button,{value:"1"},un("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:n}=this.state;return("0"===n?Nm:Tm).map((n=>t.createElement("li",{key:n.value,className:Pe({tag:!0,actived:n.value===e}),onClick:()=>this.scrollHandle(n.value.toString())},n.text)))}renderSelect(){const{value:e}=this.props;return t.createElement(H,{size:"small",placeholder:un("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var n;return((null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t.createElement(H.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:n}=this.state;return("0"===n?this.provinces:this.letterCities).map(((n,r)=>{var i;return t.createElement("div",{key:r},t.createElement("dt",{ref:e=>this[`${n.l}Ref`]=e},n.n,":"),t.createElement("dd",null,null===(i=n.children)||void 0===i?void 0:i.map((n=>t.createElement("li",{key:n.c,className:Pe({actived:n.c===e}),onClick:()=>this.clickHadnle(n.c)},n.n)))))}))}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:l={},style:a={},placeholder:o=un("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=lr("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=this.createTextValue(r),f=t.createElement("div",{className:"container",style:Object.assign({},a)},t.createElement("div",{className:"city-drop"},t.createElement("div",{className:"city-drop-toper"},t.createElement("div",{className:"city-drop-toper__type"},this.renderType()),t.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),t.createElement("div",{className:"city-drop-letter"},this.renderLetter()),t.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},t.createElement("dl",null,this.renderCity(r)))));return t.createElement(on.Consumer,null,(r=>{const l={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(xo,{value:h,bordered:s}):t.createElement(td,{action:u?[]:["click"],popupVisible:!u&&n,popup:f,popupClassName:Pe(l,`form-popper__${i}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ka,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,readOnly:d,disabled:u,style:Object.assign({width:"100%"},a),value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}km.contextType=Ml;class Lm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(km,{option:this.props.option,onValuesChange:(t,n)=>{m(t,n),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Lm.contextType=Ml;const Am=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:Am(e,n)})))};class Pm extends d{constructor(e){super(e),this.searchRef=t.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const n=Am(rn,"86")||[];this.state={results:n,visible:!1,values:[],tabs:[n.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:n}=this.props;t!==n&&this.state.values.join(",")!==(null!=n?n:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var n,r;return null===(r=null===(n=this.state.tabs[t])||void 0===n?void 0:n.find((t=>t.value===e)))||void 0===r?void 0:r.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const n=this.state.tabs.slice(0,1);for(let r=0;r<t.length;r++){const i=to(e,t[r]);if(i&&Gn(i.children)){this.isFetch&&this.getStreetList(t[r]);break}Array.isArray(null==i?void 0:i.children)&&(n[r+1]=null==i?void 0:i.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:n})}getStreetList(e){var t;return Hn(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:r,formatter:i=(e=>e),dataKey:l,valueKey:a="value",textKey:o="text"}=n;if(r)try{const n=yield r(i({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=ue(n.data,l))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[a]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,n=this.state.tabs.map(((n,r)=>{var i;const l=(null===(i=n.find((t=>t.value===e[r])))||void 0===i?void 0:i.text)||`${un("qm.form.selectPlaceholder").replace("...","")}(${un("qm.form.regionSelectLabel")[r]})`;return t.createElement(Pl.TabPane,{key:r.toString(),tab:l},t.createElement("div",{className:"region-box"},n.map((n=>t.createElement("span",{key:n.value,className:Pe({"region-box__item":!0,actived:e.includes(n.value.toString())}),title:n.text,onClick:()=>{let{values:e}=this.state;e[r]=n.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},n.text)))))}));return n.length?t.createElement(Pl,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},n):t.createElement(tl,null)}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:l={},style:a={},placeholder:o=un("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=lr("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=t.createElement("div",{className:"container"},this.renderTabs());let f=this.prevText;if(!n){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(f=e,this.prevText=f)}return t.createElement(on.Consumer,null,(r=>{const l={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(xo,{value:f,bordered:s}):t.createElement(td,{action:u?[]:["click"],popupVisible:!u&&n,popup:h,popupClassName:Pe(l,`form-popper__${i}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Ka,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,style:Object.assign({width:"100%"},a),readOnly:d,disabled:u,value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&Bn((()=>this.initial()))}})))}))}}Pm.contextType=Ml;class _m extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Pm,{option:this.props.option,onValuesChange:(t,n)=>{m(t,n),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}_m.contextType=Ml;const Dm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:m,draggable:h,editable:f,batchDownload:g,fileDirection:v,onPreview:y,onDownload:b,onRemove:x,onSortChange:E,onEditChange:w}=a,{action:C,headers:S,params:N,withCredentials:T=!1,dataKey:I="",downloadWithHeaders:O,fieldAliasMap:k,beforeUpload:L,button:A}=o,P="function"==typeof k?k():k||{},{t:_}=Fn();return t.createElement(Tl,{name:"file",action:C,multiple:d,headers:S,data:N,withCredentials:T,downloadWithHeaders:O,beforeUpload:L,maxCount:u,fileTypes:p,fileSize:m,draggable:h,editable:f,batchDownload:g,fileDirection:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,button:A,showUploadList:{showDownloadIcon:!0,downloadIcon:t.createElement(je,null)},fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in P)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[P[i]])||"";return e.response&&200!==n.code&&R.error(n.message||_("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(I?ue(n.data,I):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&l(t)})(e)},onPreview:y,onDownload:b,onRemove:x,onSortChange:E,onEditChange:w})};class Hm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Dm,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,"")}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Hm.contextType=Ml;const Fm=t.forwardRef(((e,n)=>{const r=pn({src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0},e),{className:i,style:l,src:a,alt:o,imgStyle:s}=r,c=_n(r,["className","style","src","alt","imgStyle"]),d=t.useRef(null),u=t.useRef(null);t.useEffect((()=>{const e={};for(const t in c)void 0!==r[t]&&(e[t]=r[t]);return u.current=new ln(d.current,e),()=>{y(),u.current=null}}),[]);const p=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.reset()},m=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.clear()},h=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.crop()},f=(e,t=!1)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.replace(e,t)},g=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.enable()},v=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.disable()},y=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.destroy()},b=(e,t)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.move(e,t)},x=(e,t=e)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.moveTo(e,t)},E=(e,t)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.zoom(e)},w=(e,t)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.zoomTo(e,t)},C=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotate(e)},S=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotateTo(e)},N=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleX(e)},T=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleY(e)},I=(e,t=e)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.scale(e,t)},R=(e=!1)=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getData(e)},O=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setData(e)},k=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getContainerData()},L=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getImageData()},A=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCanvasData()},P=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCanvasData(e)},_=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCropBoxData()},D=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCropBoxData(e)},H=(e={})=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getCroppedCanvas(e)},F=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setAspectRatio(e)},M=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setDragMode(e)};t.useImperativeHandle(n,(()=>({reset:p,clear:m,initCrop:h,replace:f,enable:g,disable:v,destroy:y,move:b,moveTo:x,relativeZoom:E,zoomTo:w,rotate:C,rotateTo:S,scaleX:N,scaleY:T,scale:I,getData:R,setData:O,getContainerData:k,getImageData:L,getCanvasData:A,setCanvasData:P,getCropBoxData:_,setCropBoxData:D,getCroppedCanvas:H,setAspectRatio:F,setDragMode:M})));const $={[lr("cropper")]:!0};return t.createElement("div",{className:Pe($,i),style:l},t.createElement("img",{ref:d,src:a,alt:o,style:Object.assign({maxWidth:"100%"},s)}))}));Fm.displayName="Cropper";const Mm=e=>{const{fileTypes:n=[],fileSize:r,fixedSize:i,quality:l,beforeCrop:a,className:o}=e,{t:s}=Fn(),c=t.useRef(null),d=t.useRef(),u=t.useRef(),p=t.useRef(),m=t.useRef(),[h,f]=t.useState(""),g=e=>{c.current.relativeZoom(e)},v=e=>{c.current.rotate(e)},y=()=>{f("")},b=lr("cropper-preview");return t.createElement(t.Fragment,null,(()=>{const n=Array.isArray(e.children)?e.children[0]:e.children;if(!n)return null;const r=n.props,{beforeUpload:i}=r,l=_n(r,["beforeUpload"]);return d.current=i,t.createElement(n.type,Object.assign(Object.assign({},l),{beforeUpload:(e,t)=>new Promise(((n,r)=>Hn(void 0,void 0,void 0,(function*(){const r=()=>n(I.LIST_IGNORE);if(a&&!(yield a(e,t)))return void r();u.current=e,p.current=n,m.current=r;const i=new FileReader;i.onload=()=>{f(i.result),i.onload=null},i.readAsDataURL(e)}))))}))})(),h&&t.createElement(A,{open:!0,wrapClassName:Pe(b,o),title:s("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{Hn(void 0,void 0,void 0,(function*(){const{type:e,name:t,uid:r}=u.current;c.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((i=>Hn(void 0,void 0,void 0,(function*(){let l=new File([i],t,{type:e});if(Object.assign(l,{uid:r}),n.length&&!n.includes(l.name.slice(l.name.lastIndexOf(".")+1).toLowerCase()))return R.warning(s("qm.upload.tooltip",{type:n.join(",")})),m.current("file type is error");if("function"!=typeof d.current)return p.current(l);const a=d.current(l,[l]);if("boolean"==typeof a||a){if(!0===a)return p.current(l);if(!1===a)return m.current("not upload");if(a&&"function"==typeof a.then)try{const e=yield a,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(l=e),p.current(l)}catch(e){m.current(e)}}else tr("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,l),yield Wn(100),y()}))},onCancel:y,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:i?`calc(380px * ${i[1]/i[0]})`:"auto"};return t.createElement("div",{className:"cropper-preview"},t.createElement("div",{className:"cropper-area"},t.createElement("div",{className:"img-cropper"},t.createElement(Fm,{ref:c,aspectRatio:i?i[0]/i[1]:i,src:h,dragMode:"move",preview:".preview"})),t.createElement("div",{className:"actions"},t.createElement(S,{size:"small"},t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(It,null),onClick:()=>g(.2)},s("qm.uploadCropper.zoomIn")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Rt,null),onClick:()=>g(-.2)},s("qm.uploadCropper.zoomOut")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Ot,null),onClick:()=>v(90)},s("qm.uploadCropper.rotatePlus")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(kt,null),onClick:()=>v(-90)},s("qm.uploadCropper.rotateSubtract"))))),t.createElement("div",{className:"preview-area"},t.createElement("div",{className:"preview",style:e})))})()))},$m=e=>{const n=pn({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:r=[],openCropper:i=!0,fixedSize:l,quality:a=1,fileTypes:o,fileSize:s,maxCount:c,draggable:d,disabled:u,readOnly:p,className:m,popupClassName:h,beforeCrop:f,onSortChange:g,onChange:v}=n,{t:y}=Fn(),{$size:b}=$n(n),x=t.useRef(null),E=t.useRef(null),w=t.useRef(!1),[C,S]=t.useState(!1),[N,T]=t.useState(0),O=t.useMemo((()=>u||p),[u,p]),k=t.useMemo((()=>!c||r.length<c),[r,c]);t.useEffect((()=>(A(),document.addEventListener("paste",_),()=>{var e;null===(e=E.current)||void 0===e||e.destroy(),document.removeEventListener("paste",_)})),[]),Mi((()=>{k||(w.current=!1)}),[r]);const L=Mn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...r],[i]=e.splice(t,1);e.splice(n,0,i),null==g||g(e),null==v||v({file:r[t],fileList:e})}})),A=()=>{d&&(E.current=jt.create(Ui(x.current,lr("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:L}))},P=(e,t)=>new Promise(((r,i)=>Hn(void 0,void 0,void 0,(function*(){const{fileTypes:l=[],fileSize:a,beforeUpload:o}=n,s=!l.length||l.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),c=!a||e.size/1024/1024<a,d=s&&c;if(s||R.warning(y("qm.upload.tooltip",{type:l.join(",")})),c||R.warning(y("qm.upload.sizeLimit",{size:a})),!d)return I.LIST_IGNORE;if(o){const n=o(e,t);if(!0===n)return r(e);if(!1===n)return i("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;r(e)}catch(e){i(e)}}else r(e)})))),_=Mn((e=>Hn(void 0,void 0,void 0,(function*(){const{action:t,data:i,headers:l}=n;if(w.current&&k&&t)for(const n of e.clipboardData.items)if("file"===n.kind&&n.type.startsWith("image/")){const e=n.getAsFile(),a=Date.now(),o=new File([e],`screenshot-${a}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${a}`});try{yield P(o,[...r,o]);const e=new FormData;if(e.append("file",o),i)for(const t in i)e.append(t,i[t]);const n="string"==typeof t?t:yield t(o),a=yield fetch(n,{method:"POST",body:e,headers:l});if(!a.ok)throw new Error(y("qm.upload.uploadError"));const s=yield a.json();null==v||v({file:o,fileList:[...r,{uid:o.uid,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate,name:o.name,type:o.type,size:o.size,response:s,status:"done",percent:100,originFileObj:o}]})}catch(e){}}})))),D=lr("upload-img"),H={[D]:!0,[`${D}--lg`]:"large"===b,[`${D}--sm`]:"small"===b},F=t.createElement(I,Rn({className:Pe(H,m)},Xn(n,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=r.findIndex((t=>t.url===e.url));t<0||(T(t),S(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,n,r,i)=>t.createElement("div",{className:Pe("upload-item",{handle:d})},e,!O&&t.createElement(it,{title:y("qm.upload.remove"),className:"icon",onClick:()=>i.remove()}))}),t.createElement("span",{className:"inner",ref:x},k&&!(p&&r.length)&&t.createElement(t.Fragment,null,t.createElement("p",{className:"ant-upload-drag-icon"},t.createElement(Lt,null)),t.createElement("p",{className:"ant-upload-text"},y("qm.uploadCropper.dragableText")),t.createElement("button",{className:Pe("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{w.current=!0},onBlur:()=>{w.current=!1}},y("qm.uploadCropper.pasteText")))));return t.createElement(t.Fragment,null,i?t.createElement(Mm,{className:h,fixedSize:l,quality:a,fileTypes:o,fileSize:s,beforeCrop:f},F):F,t.createElement("div",{style:{display:"none"}},t.createElement(Q.PreviewGroup,{key:r.map((e=>e.uid||"")).join(","),preview:{visible:C,current:N,rootClassName:h,onVisibleChange:e=>S(e)}},r.map(((e,n)=>t.createElement(Q,{key:e.uid||n,src:e.url,alt:""}))))))};$m.displayName="QmUploadImg";const qm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:m,openCropper:h,fileTypes:f,fileSize:g,draggable:v,onRemove:y,onSortChange:b}=a,{action:x,headers:E,params:w,withCredentials:C=!1,dataKey:S="",popupClassName:N,fieldAliasMap:T,beforeUpload:I}=o,O="function"==typeof T?T():T||{},{t:k}=Fn();return t.createElement($m,{name:"file",action:x,multiple:d,headers:E,data:w,withCredentials:C,popupClassName:N,beforeUpload:I,maxCount:u,fixedSize:p,quality:m,openCropper:h,fileTypes:f,fileSize:g,draggable:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in O)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[O[i]])||"";return e.response&&200!==n.code&&R.error(n.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(S?ue(n.data,S):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&l(t)})(e)},onRemove:y,onSortChange:b})};class jm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(qm,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,"")}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}jm.contextType=Ml;const Km={onActivate:Bt.func,onAddUndo:Bt.func,onBeforeAddUndo:Bt.func,onBeforeExecCommand:Bt.func,onBeforeGetContent:Bt.func,onBeforeRenderUI:Bt.func,onBeforeSetContent:Bt.func,onBeforePaste:Bt.func,onBlur:Bt.func,onChange:Bt.func,onClearUndos:Bt.func,onClick:Bt.func,onContextMenu:Bt.func,onCommentChange:Bt.func,onCopy:Bt.func,onCut:Bt.func,onDblclick:Bt.func,onDeactivate:Bt.func,onDirty:Bt.func,onDrag:Bt.func,onDragDrop:Bt.func,onDragEnd:Bt.func,onDragGesture:Bt.func,onDragOver:Bt.func,onDrop:Bt.func,onExecCommand:Bt.func,onFocus:Bt.func,onFocusIn:Bt.func,onFocusOut:Bt.func,onGetContent:Bt.func,onHide:Bt.func,onInit:Bt.func,onKeyDown:Bt.func,onKeyPress:Bt.func,onKeyUp:Bt.func,onLoadContent:Bt.func,onMouseDown:Bt.func,onMouseEnter:Bt.func,onMouseLeave:Bt.func,onMouseMove:Bt.func,onMouseOut:Bt.func,onMouseOver:Bt.func,onMouseUp:Bt.func,onNodeChange:Bt.func,onObjectResizeStart:Bt.func,onObjectResized:Bt.func,onObjectSelected:Bt.func,onPaste:Bt.func,onPostProcess:Bt.func,onPostRender:Bt.func,onPreProcess:Bt.func,onProgressState:Bt.func,onRedo:Bt.func,onRemove:Bt.func,onReset:Bt.func,onSaveContent:Bt.func,onSelectionChange:Bt.func,onSetAttrib:Bt.func,onSetContent:Bt.func,onShow:Bt.func,onSubmit:Bt.func,onUndo:Bt.func,onVisualAid:Bt.func,onSkinLoadError:Bt.func,onThemeLoadError:Bt.func,onModelLoadError:Bt.func,onPluginLoadError:Bt.func,onIconsLoadError:Bt.func,onLanguageLoadError:Bt.func},Vm=Object.assign({apiKey:Bt.string,id:Bt.string,inline:Bt.bool,init:Bt.object,initialValue:Bt.string,onEditorChange:Bt.func,value:Bt.string,tagName:Bt.string,cloudChannel:Bt.string,plugins:Bt.oneOfType([Bt.string,Bt.array]),toolbar:Bt.oneOfType([Bt.string,Bt.array]),disabled:Bt.bool,textareaName:Bt.string,tinymceScriptSrc:Bt.string,rollback:Bt.oneOfType([Bt.number,Bt.oneOf([!1])]),scriptLoading:Bt.shape({async:Bt.bool,defer:Bt.bool,delay:Bt.number})},Km),zm=e=>"function"==typeof e,Wm=e=>e in Km,Bm=e=>e.substr(2),Um=(e,t,n,r,i)=>((e,t,n,r,i,l,a)=>{const o=Object.keys(i).filter(Wm),s=Object.keys(l).filter(Wm),c=o.filter((e=>void 0===l[e])),d=s.filter((e=>void 0===i[e]));c.forEach((e=>{const t=Bm(e),r=a[t];n(t,r),delete a[t]})),d.forEach((n=>{const i=r(e,n),l=Bm(n);a[l]=i,t(l,i)}))})(i,e.on.bind(e),e.off.bind(e),((t,n)=>r=>{var i;return null===(i=t(n))||void 0===i?void 0:i(r,e)}),t,n,r);let Gm=0;const Ym=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return Gm++,e+"_"+n+Gm+String(t)},Xm=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Qm=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),Zm=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},Jm=()=>({listeners:[],scriptId:Ym("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),eh=(()=>{let e=Jm();return{load:(t,n,r,i,l,a)=>{const o=()=>((e,t,n,r,i,l)=>{const a=t.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=e,a.src=n,a.async=r,a.defer=i;const o=()=>{a.removeEventListener("load",o),l()};a.addEventListener("load",o),t.head&&t.head.appendChild(a)})(e.scriptId,t,n,r,i,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?a():(e.listeners.push(a),e.scriptLoading||(e.scriptLoading=!0,l>0?setTimeout(o,l):o()))},reinitialize:()=>{e=Jm()}}})(),th=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class nh extends e.Component{constructor(t){var n,r,i;super(t),this.rollbackTimer=void 0,this.valueCursor=void 0,this.rollbackChange=()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0},this.handleBeforeInput=e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}},this.handleBeforeInputSpecial=e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)},this.handleEditorChange=e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}},this.handleEditorChangeSpecial=e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)},this.initialise=(e=0)=>{var t,n,r;const i=this.elementRef.current;if(!i)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,n=e.parentNode;for(;null!=n;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected})(i)){if(0===e)setTimeout((()=>this.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>this.initialise(e+1)),100)}return}const l=th(this.view);if(!l)throw new Error("tinymce should have been loaded into global scope");const a=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:i,readonly:this.props.disabled,inline:this.inline,plugins:(o=null===(t=this.props.init)||void 0===t?void 0:t.plugins,s=this.props.plugins,Qm(o).concat(Qm(s))),toolbar:null!==(n=this.props.toolbar)&&void 0!==n?n:null===(r=this.props.init)||void 0===r?void 0:r.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!Xm(i)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&zm(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,n;const r=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==r&&(this.currentContent=r,e.setContent(r),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const i=null!==(n=this.props.disabled)&&void 0!==n&&n;Zm(this.editor,i?"readonly":"design"),this.props.init&&zm(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(i.style.visibility=""),Xm(i)&&(i.value=this.getInitialValue()),l.init(a)},this.id=this.props.id||Ym("tiny-react"),this.elementRef=e.createRef(),this.inline=null!==(i=null!==(n=this.props.inline)&&void 0!==n?n:null===(r=this.props.init)||void 0===r?void 0:r.inline)&&void 0!==i&&i,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,n;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const n=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const r of[t,n])if(r)try{e.selection.moveToBookmark(r),this.valueCursor=r;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(n=this.props.disabled)&&void 0!==n&&n;Zm(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,r,i,l;null!==th(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&eh.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),null!==(t=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)&&void 0!==t&&t,null!==(r=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.defer)&&void 0!==r&&r,null!==(l=null===(i=this.props.scriptLoading)||void 0===i?void 0:i.delay)&&void 0!==l?l:0,this.initialise)}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,n;return(null===(n=null===(t=null===(e=th(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:t="div"}=this.props;return e.createElement(t,{ref:this.elementRef,id:this.id})}renderIframe(){return e.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){Um(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,n=t(e),r=t(this.props);!n&&r?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):n&&!r&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}var rh;nh.propTypes=Vm,nh.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(rh||(rh={}));const ih=e=>{var n;const{className:r,style:i,tinymce:l={},upload:a={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:d,onResizeEditor:u,onChange:p}=e,{global:m}=t.useContext(on),{$size:h}=$n(e),{$locale:f,t:g}=Fn(),v=400,y="preview importcss searchreplace autolink save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",b="file edit view insert format tools table help",x="undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl",E=Object.assign(Object.assign({height:l.height||v,plugins:l.plugins||y,toolbar:l.toolbar||x,menubar:l.menubar||b,font_family_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",font_size_formats:"10px 12px 14px 16px 18px 20px 24px 36px 48px 56px 72px",language:rh[f],skin:"tinymce-5"},Xn(l,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>Hn(void 0,void 0,void 0,(function*(){const{action:n,headers:r,dataKey:i}=a,l=`data:image/jpeg;base64,${e.base64()}`,s=new FormData;s.append("file",e.blob(),e.filename());const c=e.blob().size;if(n&&c/1024/1024>o)try{const e=yield fetch(n,{method:"POST",body:s,headers:r});if(!e.ok)throw new Error(g("qm.upload.uploadError"));const l=yield e.json();if(200===l.code){const e=i?ue(l.data,i):l.data;t(e)}}catch(e){R.error(g("qm.uploadCropper.uploadError"))}else t(l)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:n,offsetHeight:r}=e.editorContainer;null==u||u({width:n,height:r},t)}))}}),w=lr("tinymce"),C={[w]:!0,[`${w}--lg`]:"large"===h,[`${w}--sm`]:"small"===h},S={init:E,value:d,disabled:c,tinymceScriptSrc:s||(null===(n=null==m?void 0:m.tinymce)||void 0===n?void 0:n.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return t.createElement("div",{className:Pe(C,r),style:i},t.createElement(nh,S))};ih.displayName="QmTinymce";const lh=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o,style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{tinymce:u,thresholdSize:p,onResizeEditor:m}=a;return t.createElement(ih,{value:r,tinymce:u,upload:o,thresholdSize:p,style:Object.assign({width:"100%"},s),disabled:d||c||n.isOnlyShow,onResizeEditor:m,onChange:e=>{(e=>{null==i||i(e),l(e)})(e)}})};class ah extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(lh,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Fa)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}ah.contextType=Ml;class oh extends d{constructor(e){var n;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=t.createRef(),this.formRef=t.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(n=this.props.cols)&&void 0!==n?n:4,collapse:!!this.props.defaultExpand},this.resizeObserveHandler=()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let n=Math.floor(t/300);n=24%n==0?n:n-1,n=n<1?1:n,n=n>8?8:n,n!==this.state.flexCols&&this.setState({flexCols:n})},this.resizeListenerHandle=Le(this.resizeObserveHandler,10),this.getFormItems=Wt((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=Wt((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{ae(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onValuesChange)||void 0===r||r.call(n,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onFieldsChange)||void 0===r||r.call(n,e,t)},this.finishHandle=e=>{var t,n;null===(n=(t=this.props).onFinish)||void 0===n||n.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var n,r;null===(r=(n=this.props).onFinishFailed)||void 0===r||r.call(n,t)},this.openValidateInfo=e=>{const n=t.createElement("ul",null,e.map((e=>{const{label:n}=this.formItems.find((t=>t.fieldName===e.name[0]));return t.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof n?`${n}: `:"")+e.errors.join(","),"]")})));Z.error({message:un("qm.form.validatePrompt"),description:n,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&Vt(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})},this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){var e,t;return null!==(t=null!==(e=this.props.size)&&void 0!==e?e:this.context.size)&&void 0!==t?t:""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isFormDisabled(){return this.props.disabled}get isCompactMode(){var e;const t=this.context.global;return null!==(e=this.props.compactMode)&&void 0!==e?e:"small"===this.$size&&!!(null==t?void 0:t.compactModeInSmallSize)}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){al(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){ol(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&tr("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return Object.assign({},n)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>ae(e.extra))).forEach((n=>{var r;t[n.fieldName]=null!==(r=e[n.fieldName])&&void 0!==r?r:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>ae(e.collapse))).forEach((t=>{var n;e[t.fieldName]=null!==(n=t.collapse.defaultExpand)&&void 0!==n&&n})),Object.assign({},e)}getInitialValue(e,t){var n;const{type:r,options:i}=e;return t=null!=t?t:void 0,ja.includes(r)&&(t=null!=t?t:[]),"CHECKBOX"!==r&&"SWITCH"!==r||(t=null!==(n=null!=t?t:null==i?void 0:i.falseValue)&&void 0!==n?n:$a),t}createFormValue(e){const t={};return this.flattenItems.forEach((n=>{t[n.fieldName]=this.getInitialValue(n,e[n.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=Qn(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((n=>({viewData:Object.assign({},n.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){var t,n;e!==this.state.collapse&&(this.setState({collapse:e}),null===(n=(t=this.props).onCollapse)||void 0===n||n.call(t,e),Bn((()=>{var t,n;return null===(n=(t=this.props).onCollapse)||void 0===n?void 0:n.call(t,e)})))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:n}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!n||setTimeout((()=>this.CREATE_FOCUS(n)))}getFormItemLabel(e){var t,n,r,i,l;if(ro(e))return io(e);if(ae(e)){const{fieldName:a,label:o,options:s={}}=e;if(ro(o))return io(o);const{itemList:c=[]}=s,d=null!==(r=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([a])[a])&&void 0!==n?n:this._initialValues[a])&&void 0!==r?r:null===(i=c[0])||void 0===i?void 0:i.value;return(null===(l=c.find((e=>e.value===d)))||void 0===l?void 0:l.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,n=this.dividers.length;t<n;t++){const n=this.formItems.findIndex((e=>e===this.dividers[t]));let r=this.formItems.findIndex((e=>e===this.dividers[t+1]));r=r>-1?r:void 0,e.push(this.formItems.slice(n,r).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var n,r;if("DIVIDER"===e)return!0;const i=this.getBlockDerivedItems();for(let e=0,l=i.length;e<l;e++){const l=i[e],a=this.dividers.find((e=>e.fieldName===l[0].fieldName)),o=null!==(r=null===(n=null==a?void 0:a.collapse)||void 0===n?void 0:n.showLimit)&&void 0!==r?r:l.length-1;for(let e=1;e<l.length;e++){if(l[e].fieldName===t&&e>o)return this.state.expand[l[0].fieldName]}}return!0}formatFormValue(e){var t,n;for(const r in e){const i=e[r];if(Xa(i)&&(e[r]=""),Array.isArray(i)&&i.forEach(((t,n)=>{Xa(t)&&(e[r][n]="")})),r.includes("|")&&Array.isArray(i)){const[l,a]=r.split("|");e[l]=null!==(t=i[0])&&void 0!==t?t:"",e[a]=null!==(n=i[1])&&void 0!==n?n:""}}if(this.isFilterType)for(const t in e)Gn(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Hn(this,void 0,void 0,(function*(){const{authConfig:r}=this.props;if(!r)return;let i=Xn(r,["fetch"]);if(r.fetch){const{api:t,params:n,dataKey:l}=r.fetch;try{const r=yield t(n);200===r.code&&(i=null!==(e=l?ue(r.data,l):r.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(i.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,n=i.fieldList.find((e=>e.dataIndex===t));if(n){const r=this.originItems.find((e=>e.fieldName===t)),{visible:i=1,disabled:l,secretName:a}=n;i||(e.noAuth=!0,r.noAuth=!0),l&&(e.disabled=!0,r.disabled=!0),a&&(e.options?e.options.secretType=a:e.options={secretType:a},r.options=Object.assign({},r.options,{secretType:a})),this.setFieldAuth(t,{visible:i,disabled:l,secretName:a})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return t.createElement(Ro,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t.createElement(ko,{option:e})}INPUT_NUMBER(e){return t.createElement(Ao,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t.createElement(_o,{option:e})}SEARCH_HELPER(e){return t.createElement(Lp,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t.createElement(_p,{option:e})}TREE_TABLE_HELPER(e){return t.createElement(jp,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t.createElement(Vp,{option:e})}RANGE_SEARCH_HELPER(e){return t.createElement(Yp,{option:e})}CHECKBOX(e){return t.createElement(No,{option:e})}MULTIPLE_CHECKBOX(e){return t.createElement(Qp,{option:e})}RATE(e){return t.createElement(Jp,{option:e})}RADIO(e){return t.createElement(tm,{option:e})}SWITCH(e){return t.createElement(rm,{option:e})}TEXT_AREA(e){return t.createElement(lm,{option:e})}DATE(e){return t.createElement(om,{option:e})}RANGE_DATE(e){return t.createElement(dm,{option:e})}TIME(e){return t.createElement(pm,{option:e})}RANGE_TIME(e){return t.createElement(hm,{option:e})}SELECT(e){return t.createElement(Co,{option:e})}MULTIPLE_SELECT(e){return t.createElement(Co,{option:e,multiple:!0})}IMMEDIATE(e){return t.createElement(gm,{option:e})}DIVIDER(e){return t.createElement(vm,{option:e})}TREE_SELECT(e){return t.createElement(xm,{option:e})}MULTIPLE_TREE_SELECT(e){return t.createElement(xm,{option:e,multiple:!0})}CASCADER(e){return t.createElement(wm,{option:e})}MULTIPLE_CASCADER(e){return t.createElement(wm,{option:e,multiple:!0})}CITY_SELECT(e){return t.createElement(Lm,{option:e})}REGION_SELECT(e){return t.createElement(_m,{option:e})}UPLOAD_FILE(e){return t.createElement(Hm,{option:e})}UPLOAD_IMG(e){return t.createElement(jm,{option:e})}TINYMCE(e){return t.createElement(ah,{option:e})}renderFormLabel(e){if(ro(e)||!ae(e))return e;const{type:n,fieldName:r,label:i,options:l={},onChange:a=Vn}=e,{itemList:o=[]}=l;return"SELECT"===n?t.createElement(P.Item,{name:r,noStyle:!0},t.createElement(wo,{option:e,items:o,loading:!1,onValuesChange:(e,t)=>a(e,t)})):"CHECKBOX"===n?t.createElement(t.Fragment,null,t.createElement("span",{style:{paddingRight:5}},i),t.createElement(P.Item,{name:r,noStyle:!0},t.createElement(So,{option:e,onValuesChange:e=>a(e)}))):null}renderFormItemExtra(e){const{fieldName:n,isTooltip:r,style:i={},render:l}=e,{extra:a}=this.state;if(r)return t.createElement(w,{className:"extra-tooltip",title:a[n]},t.createElement(At,{style:{marginLeft:4}}));const o=this.formItems.find((e=>e.fieldName===n));return t.createElement("div",{className:"extra-text",title:l?"":a[n],style:i},t.createElement("span",{className:"extra-overflow-cut"},l?l(o,this):a[n]))}renderFormItemButton(e,t){const n=this.formItems.find((t=>t.fieldName===e)),r="function"==typeof t?t(n):t;return this.isOnlyShow?null:r}renderFormItem(e){const{label:n,fieldName:r,invisible:i,tooltip:l,className:a,labelWidth:o=this.props.labelWidth,validateTrigger:s,rules:c=[],style:d={},render:u}=e;return t.createElement(P.Item,{label:this.renderFormLabel(n),name:r,rules:c,tooltip:l,hidden:i,className:Pe(a),style:Object.assign({width:"100%"},d),labelCol:{flex:this.verticalLayout?"initial":Zn(o)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(n)}},this.formRef.current?u(e,this):t.createElement(t.Fragment,null))}createFormItem(e){return se(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(tr("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:n,defaultRows:r,isFieldsDefine:i}=this.props,l=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:n=0}=e;for(let e=0;e<t;e++)l.push({});l.push(e);for(let e=0;e<n;e++)l.push({})}));const a=24/e,o=[],s=l.reduce(((e,t)=>{const{selfCol:n=1}=t,r=e+n;return o.push(r),r}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=l.map(((n,r)=>{let{selfCol:i=1}=n;const{type:l,fieldName:s}=n;i=i>=24||"DIVIDER"===l||"TINYMCE"===l?e:i;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(n);return u&&d.push(o[r]),t.createElement(D,{key:null!=s?s:r,className:s,span:i*a,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},l?this.createFormItem(Qn(n)):null)}));return i&&"default"===n&&u.push(t.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(e=0){const{flexCols:n,collapse:r}=this.state,{searchButtonCols:i,isSearchBtn:l,isFieldsDefine:a=!0}=this.props;if(!this.isFilterType)return null;const o=24/n,s=i||1,c=n-e%n-s;return l?t.createElement(D,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t.createElement(S,{style:{marginBottom:12}},t.createElement(nr,{type:"primary",size:this.$size,icon:t.createElement(Nt,null),onClick:()=>this.SUBMIT_FORM()},un("qm.form.search")),t.createElement(nr,{size:this.$size,icon:t.createElement(Ge,null),onClick:()=>this.RESET_FORM()},un("qm.form.reset")),a?this.createFieldsDefine():null,this.showFilterCollapse&&t.createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t.createElement(_e,null):t.createElement(De,null)," ",un(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:n,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const i=24/e;return r&&"default"===n?t.createElement(_,{gutter:0},t.createElement(D,{key:"-",span:i},t.createElement(P.Item,null,t.createElement(S,{style:{marginBottom:12}},t.createElement(nr,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},un("qm.form.save")),t.createElement(nr,{size:this.$size,onClick:()=>this.RESET_FORM()},un("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:n,fieldsChange:r}=this.props;return t.createElement(To,{uniqueKey:e,items:n,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){const[n,r]=yield this.VALIDATE_FIELDS(),i=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[un("qm.form.searchHelperTips")],warnings:[]})));n||i.length?t((n||[]).concat(i)):e(r)}))))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}GET_FORM_DATA(){return Hn(this,void 0,void 0,(function*(){try{const e=yield this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}))}VALIDATE_FIELDS(e){return Hn(this,void 0,void 0,(function*(){try{return[null,yield this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}))}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}SUBMIT_FORM(){return Hn(this,void 0,void 0,(function*(){try{yield this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}))}RESET_FORM(){var e,t;const n=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),r=this.flattenItems.map((e=>e.fieldName)).filter((e=>!n.includes(e)));r.length&&this.formRef.current.resetFields(r),this.setState((e=>{const t=Object.keys(e.other),n=Object.keys(this._initialOthers),r=t.filter((e=>!n.includes(e))),i={};return r.forEach((e=>i[e]=void 0)),{other:Object.assign({},this._initialOthers,i)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(t=(e=this.props).onReset)||void 0===t||t.call(e)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){tr("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:r,fieldsChange:i}=this.props,l=r.find((t=>t.fieldName===e));if(!l)return tr("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!ae(t))return tr("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(l.noAuth)return tr("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||he(l,n,t[n]));n&&(i?i([...r]):tr("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:n,layout:r,disabled:i,labelWidth:l,labelAlign:a,labelWrap:o,customClass:s}=this.props,c=lr("form"),d={required:"${label}"+un("qm.form.requiredTips")},u={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return t.createElement("div",{ref:this.wrapperRef,className:Pe(u,e),style:n},t.createElement(P,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:a,labelWrap:o,colon:!1,disabled:i,labelCol:{flex:this.verticalLayout?"initial":Zn(l)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t.createElement(Ml.Provider,{value:this.provide},t.createElement(_,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}oh.contextType=on,oh.propTypes=Ba,oh.defaultProps=Ua;const sh=e=>null!=e;function ch(e,n,r,i){const[l,a]=t.useState(void 0);t.useLayoutEffect((()=>{const t="function"==typeof e?e():e;a(t||null)}));const[o,s]=t.useState(null),c=()=>{if(l){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:r,right:i,bottom:l,left:a}=e.getBoundingClientRect();return r>=0&&a>=0&&i<=t&&l<=n})(l)&&n&&l.scrollIntoView(i);const{left:e,top:t,width:r,height:a}=l.getBoundingClientRect(),o={left:e,top:t,width:r,height:a,radius:0};s((e=>JSON.stringify(e)!==JSON.stringify(o)?o:e))}else s(null)};t.useLayoutEffect((()=>{c()}),[l,n]),as({handler:c});return[t.useMemo((()=>{if(!o)return o;const e=(null==r?void 0:r.offset)||6,t=(null==r?void 0:r.radius)||2;return{left:o.left-e,top:o.top-e,width:o.width+2*e,height:o.height+2*e,radius:t}}),[o,r]),l]}const dh={fill:"transparent",pointerEvents:"auto"},uh=e=>{const{prefixCls:n,rootClassName:r,pos:i,showMask:l,style:a={},fill:o="rgba(0,0,0,0.5)",open:s,animated:c,zIndex:d}=e,u=`${n}-mask-${Yo()}`,p="object"==typeof c?null==c?void 0:c.placeholder:c;return t.createElement(tn,{open:s,autoLock:!0},t.createElement("div",{className:Pe(`${n}-mask`,r),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},a)},l?t.createElement("svg",{style:{width:"100%",height:"100%"}},t.createElement("defs",null,t.createElement("mask",{id:u},t.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),i&&t.createElement("rect",{x:i.left,y:i.top,rx:i.radius,width:i.width,height:i.height,fill:"black",className:p?`${n}-placeholder-animated`:""}))),t.createElement("rect",Rn({},i?null:dh,{x:"0",y:"0",width:"100%",height:"100%",fill:o,mask:`url(#${u})`})),i&&t.createElement(t.Fragment,null,t.createElement("rect",Rn({},dh,{x:"0",y:"0",width:"100%",height:`${i.top}px`})),t.createElement("rect",Rn({},dh,{x:"0",y:"0",width:i.left,height:"100%"})),t.createElement("rect",Rn({},dh,{x:"0",y:i.top+i.height,width:"100%",height:`calc(100vh - ${i.top+i.height}px)`})),t.createElement("rect",Rn({},dh,{x:i.left+i.width,y:"0",width:`calc(100vw - ${i.left+i.width}px)`,height:"100%"})))):null))},ph=e=>{const{prefixCls:n,zIndex:r,open:i,onPause:l,onPlay:a}=e,[o,s]=ts(void 0,{value:i,postState:e=>null==e||e}),c=t.useRef(null),d=t.useRef(!1),u=Mn((e=>{p(e),e.shiftKey&&32===e.keyCode&&m()}));t.useEffect((()=>{const e=Kt(document,"keyup",u);return()=>e.remove()}),[]);const p=e=>{e.stopPropagation(),e.preventDefault()},m=()=>{d.current?d.current=!1:(s(!o),o?null==l||l():null==a||a())};return t.createElement("div",{ref:c,className:`${n}-control`,style:{zIndex:r+1},onMouseDown:e=>{p(e);const t=c.current,n=t.offsetWidth,r=t.offsetHeight,i=window.innerWidth,l=window.innerHeight,a=e.clientX-Bi(t).x,o=e.clientY-Bi(t).y;return document.onmousemove=e=>{let s=e.clientX-a,c=e.clientY-o;s<0&&(s=0),s>i-n-1&&(s=i-n-1),c<0&&(c=0),c>l-r-1&&(c=l-r-1),Vi(t,{left:`${s}px`,top:`${c}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>m()},o?t.createElement(Pt,null):t.createElement(yt,null))},mh=e=>{const{prefixCls:n,current:r,total:i=0,cover:l,title:a,description:o,helper:s={},type:c,zIndex:d,onClose:u,onPrev:p,onNext:m,onFinish:h,className:f,indicatorsRender:g}=e,{t:v}=Fn(),y="primary"!==c?"primary":"default",b=Mn((e=>{C(e),40===e.keyCode&&(r<i-1?null==m||m():null==h||h()),38===e.keyCode&&r>0&&(null==p||p())}));t.useEffect((()=>{const e=Kt(document,"keyup",b);return()=>e.remove()}),[]);const x=sh(l)?t.createElement("div",{className:`${n}-cover`},l):null,E=sh(o)?t.createElement("div",{className:`${n}-description`},o):null;let w;w=g?g(r,i):[...Array.from({length:i}).keys()].map(((e,i)=>t.createElement("span",{key:e,className:Pe(i===r&&`${n}-indicator-active`,`${n}-indicator`)})));const C=e=>{e.stopPropagation(),e.preventDefault()};return t.createElement("div",{className:Pe(`${n}-content`,f)},t.createElement("div",{className:`${n}-inner`},t.createElement(it,{className:`${n}-close`,onClick:u}),s.content&&t.createElement(V,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},t.createElement(_t,{className:Pe(`${n}-close`,"help-icon")})),x,t.createElement("div",{className:`${n}-header`},t.createElement("div",{className:`${n}-title`},a)),E,t.createElement("div",{className:`${n}-footer`},i>1&&t.createElement("div",{className:`${n}-indicators`},w),t.createElement(ir,{className:`${n}-buttons`},0!==r?t.createElement(nr,{className:`${n}-prev-btn`,size:"small",onMouseDown:C,onClick:p},v("qm.tour.prevStep")):null,r===i-1?t.createElement(nr,{className:`${n}-finish-btn`,type:y,size:"small",onClick:h},v("qm.tour.finish")):t.createElement(nr,{className:`${n}-next-btn`,type:y,size:"small",onMouseDown:C,onClick:m},v("qm.tour.nextStep"))))))},hh=e=>{const{current:n,renderPanel:r}=e;return t.createElement(t.Fragment,null,"function"==typeof r?r(e,n):t.createElement(mh,e))},fh={left:"50%",top:"50%",width:1,height:1},gh=t.forwardRef(((e,n)=>{const{steps:r=[],defaultCurrent:i,current:l,onChange:a,onClose:o,onFinish:s,open:c,type:d="default",mask:u=!0,arrow:p=!0,control:m=!0,overlayClassName:h,overlayStyle:f,placement:g,helper:v,zIndex:y,renderPanel:b,indicatorsRender:x,gap:E,animated:w=!0,scrollIntoViewOptions:C=!0}=e,S=_n(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),N=t.useRef(),[T,I]=ts(0,{value:l,defaultValue:i}),[R,O]=ts(void 0,{value:c,postState:e=>!(T<0||T>=r.length)&&(null!=e&&e)}),[k,L]=ts(1051,{value:y,defaultValue:y}),[A,P]=t.useState(),_=t.useRef(R);t.useLayoutEffect((()=>{R&&!_.current&&I(0),_.current=R,P(R)}),[R]),t.useImperativeHandle(n,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>L(e)})));const{target:D,type:H,placement:F,trigger:M,delay:$,style:q,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:W,action:B}=r[T]||{},U=W||k,G=H||d,Y=R&&(null!=V?V:u),X=null!=z?z:C,[Q,Z]=ch(D,!!c,E,X),J=((e,t,n)=>{var r;return null!==(r=null!=n?n:t)&&void 0!==r?r:null===e?"center":"bottom"})(Z,g,F),ee=!!Z&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;t.useLayoutEffect((()=>{var e;null===(e=N.current)||void 0===e||e.forceAlign()}),[te,T]),Mi((()=>{R&&(ie(),null==B||B(Z,T))}),[R,Z]);const ne=e=>{I(e),null==a||a(e)},re=()=>{O(!1),null==o||o(T)},ie=()=>{if(!Z)return;const e=[];!function t(n){if(1===n.nodeType){var r;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===Ki(r=n,"display")||"hidden"===Ki(r,"visibility")||"0"===Ki(r,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const le=()=>Hn(void 0,void 0,void 0,(function*(){if(!M||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),n=Z.offsetWidth,r=Z.offsetHeight,[i,l]=[e+n/2,t+r/2],a=new MouseEvent(M,{bubbles:!0,cancelable:!0,button:0,clientX:i,clientY:l}),o=document.elementFromPoint(i,l);o&&(o.dispatchEvent(a),yield Wn(null!=$?$:320))})),ae="boolean"==typeof Y?Y:!!Y,oe="boolean"==typeof Y?void 0:Y,se=Object.assign({},f,q),ce=lr("tour"),de=[{[`${ce}-primary`]:"primary"===G},h,K],ue=zd({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(uh,{zIndex:U,prefixCls:ce,pos:Q,showMask:ae,style:null==oe?void 0:oe.style,fill:null==oe?void 0:oe.color,open:A,animated:w,rootClassName:h}),t.createElement(tn,{open:A,autoLock:!0},t.createElement(Zt,Rn({ref:N},S,{zIndex:U,builtinPlacements:ue,popupStyle:se,popupPlacement:J,popupVisible:A,popupClassName:Pe(de),prefixCls:ce,popup:()=>t.createElement(hh,Rn({key:"content",arrow:ee,prefixCls:ce,total:r.length,helper:v,renderPanel:b,indicatorsRender:x,onPrev:()=>Hn(void 0,void 0,void 0,(function*(){yield le(),ne(T-1)})),onNext:()=>Hn(void 0,void 0,void 0,(function*(){yield le(),ne(T+1)})),onClose:re,current:T,onFinish:()=>{re(),null==s||s()}},Object.assign({},r[T],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),t.createElement("div",{className:Pe(h,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Q||fh),{position:"fixed",pointerEvents:"none"})}))),m&&t.createElement(tn,{open:R},t.createElement(ph,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));gh.displayName="QmTour";var vh={previewWidth:1100,defaultDistance:.45,logoHeight:60};const yh=n(void 0);var bh=null;function xh(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),n=e.match(/MSIE\D?\d+/i),r=e.match(/OPR\D?\d+/i),i=e.match(/Firefox\D?\d+/i),l=e.match(/x64/i);if(!t&&!n&&l)return!0;if(i){if((i=i[0].match(/\d+/))[0]>=41||l)return!0}else if(r){if((r=r[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!n){var a=e.match(/Chrome\D?\d+/i);if(a&&(a=a[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Eh(e,t){var n;try{var r=navigator.userAgent,i=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(xh()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void R.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!n)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{i&&r.match(/x64/i);if(e||t?n=i?e:t:bh?n=bh:((n=document.createElement("object")).setAttribute("width",0),n.setAttribute("height",0),n.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),i?n.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):n.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(n),bh=n),!n||!n.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&xh(),n}catch(e){R.error("getLodop 出错:"+e)}}xh();const wh=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:n,deviceYDPI:r}=window.screen;if(n&&r)t[0]=n,t[1]=r;else{let n=document.createElement("DIV");n.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth.toString()),t[1]=parseInt(n.offsetHeight.toString()),null===(e=n.parentNode)||void 0===e||e.removeChild(n),n=null}return t})()[0];return Math.ceil(t)},Ch=t.forwardRef(((e,n)=>{const{templateRender:r,directPrint:i}=e,{global:l}=t.useContext(on),{$$preview:a}=t.useContext(yh),{state:o,isWindowsPrinter:s,pageSize:c}=a,d=t.useRef(null),u=t.useRef({}),p=t.useRef([]),m=t.useRef([]),h=t.useRef([]),[f,g]=t.useState(!0);t.useImperativeHandle(n,(()=>({createPreviewDom:O,createExportHtml:L,createPrintHtml:k,SHOW_PREVIEW:A,DIRECT_PRINT:P}))),Mi((()=>{R()}),[o.form.printerType,o.form.setting.direction,o.form.setting.distance,o.form.setting.fixedLogo]),t.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const v=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*vh.defaultDistance+10*vh.defaultDistance:0;return("vertical"===e?c[0]:c[1])-t}),[o,s,c]),y=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*vh.defaultDistance+10*vh.defaultDistance:0;return("vertical"===e?c[1]:c[0])-t}),[o,s,c]),b=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return wh(v-10*(e.left-vh.defaultDistance)-10*(e.right-vh.defaultDistance))}),[o,v]),x=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return wh(y-10*(e.top-vh.defaultDistance)-10*(e.bottom-vh.defaultDistance))}),[o,y]),E=o.form.scale,w=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return{left:wh(10*e.left),right:wh(10*e.right),top:wh(10*e.top),bottom:wh(10*e.bottom)}}),[o]),C=t.useMemo((()=>{const{form:{printerType:e}}=o,{left:t,right:n,top:r,bottom:i}=w,l=b+t+n,a=vh.previewWidth-l<=0?0:(vh.previewWidth-l)/2,s=Math.abs((1-E)*l/2);let c=0;return E>1&&(c=s>a?-1*a:-1*s),E<1&&(c=l-2*s>vh.previewWidth?0:a>0?s:(vh.previewWidth-(l-2*s))/2),{width:`${b}px`,height:""+("stylus"===e?"auto":x+"px"),paddingLeft:`${t}px`,paddingRight:`${n}px`,paddingTop:`${r}px`,paddingBottom:`${i}px`,transform:`translateX(${c}px) scale(${E})`,opacity:f?0:1}}),[o,f,w,E,x,b]);p.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const S=()=>{var e,t,n,r;const i=null!==(t=null===(e=null==l?void 0:l.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",a=null!==(r=null===(n=null==l?void 0:l.print)||void 0===n?void 0:n.rightLogo)&&void 0!==r?r:"";return[`<tr style="height: ${vh.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>","</tr>"].join("")},N=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},T=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(n=u.current.templateEl.children[0]).children[0]?n.insertBefore(t,n.children[0]):n.appendChild(t),e=null},I=()=>{const e=u.current.templateEl.children[0].children,t=[],n=[];for(let r=0;r<e.length;r++){if("template-cols"===e[r].getAttribute("type"))continue;const i=e[r].clientHeight;e[r].style.height=i+"px",n.push(i),t.push(e[r].outerHTML)}m.current=n,p.current=t},R=()=>{var e;if(!p.current.length)return;const{form:{setting:t,printerType:n}}=o;if(i)return h.current.push([N(),S(),...p.current]);const r=t.fixedLogo?x-vh.logoHeight:x;let l=[];if(h.current=[],"stylus"===n)h.current.push([N(),...t.fixedLogo?[S()]:[],...p.current]);else{let e=0;for(let n=0,i=m.current.length;n<i;n++){const a=p.current[n],o=m.current[n];t.fixedLogo||0!==n||(e+=vh.logoHeight),e+=o,e<=r?l.push(a):(h.current.push([N(),...t.fixedLogo?[S()]:[],...l]),l=[],e=0,n-=1),n===i-1&&l.length&&h.current.push([N(),...t.fixedLogo?[S()]:[],...l])}}t.fixedLogo||null===(e=h.current[0])||void 0===e||e.splice(1,0,S());for(let e=0,t=h.current.length;e<t&&e!==t-1;e++)h.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');a.setState({currentPage:1,totalPage:h.current.length}),O()},O=()=>{var e,t;const{currentPage:n}=o;let r=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;r+=null!==(t=null===(e=h.current[n-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",r+="</table>",u.current.previewEl.innerHTML=r,u.current.previewEl.parentNode.scrollTop=0},k=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...h.current[e-1]].join("")}else for(let e=0;e<h.current.length;e++)t+=h.current[e].join("");return t+="</table>",t},L=()=>{const e=[];for(let t=0;t<p.current.length;t++)e[t]=p.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+S()+N()+e.join("")+"</table>"},A=()=>Hn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();u.current.previewEl.innerHTML||(T(),yield Wn(0),I(),R(),g(!1))})),P=()=>Hn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();T(),yield Wn(0),I(),R(),g(!1),a.doPrint(k()),yield Wn(0),a.doClose()})),_=()=>{tr("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D={[lr("print-container")]:!0,"no-visible":i};return t.createElement("div",{ref:d,className:Pe(D)},t.createElement(nl,{wrapperClassName:"spin",spinning:f,tip:"Loading..."},t.createElement("div",{className:"preview"},t.createElement("div",{className:"origin-template",style:{width:`${b}px`,marginLeft:`-${Math.floor(b/2)}px`}},null==r?void 0:r()),t.createElement("div",{className:"workspace",style:C}))))}));Ch.displayName="Container";class Sh extends d{constructor(){super(...arguments),this.formRef=t.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:un("qm.print.setPanel.printParameter")},{type:"SELECT",label:un("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:un("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:un("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:un("qm.print.setPanel.vertical"),value:"vertical"},{text:un("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:un("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:un("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:un("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:un("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:vh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:vh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:vh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:vh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]}],this.getInitialvalue=()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})},this.getInitialExtra=()=>({disleft:un("qm.print.setPanel.sizeUnit"),disright:un("qm.print.setPanel.sizeUnit"),distop:un("qm.print.setPanel.sizeUnit"),disbottom:un("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Hn(this,void 0,void 0,(function*(){const[e,t]=yield this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),this.cancelHandle=()=>{this.props.onClose()}}render(){const{formList:e}=this.state;return t.createElement(t.Fragment,null,t.createElement(oh,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},un("qm.dialog.close")),t.createElement(nr,{type:"primary",onClick:()=>this.confirmHandle()},un("qm.dialog.confirm"))))}}Sh.contextType=on;class Nh extends d{constructor(){var e,n,r;super(...arguments),this.provide={$$preview:this},this.containRef=t.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(n=this.props.defaultConfig)||void 0===n?void 0:n.copies)||1,scale:1,setting:{distance:{left:vh.defaultDistance,right:vh.defaultDistance,top:vh.defaultDistance,bottom:vh.defaultDistance},pageSize:"210*297",direction:(null===(r=this.props.defaultConfig)||void 0===r?void 0:r.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0},this.pageChangeHandle=e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))},this.exportClickHandle=()=>{this.doExport(this.containRef.current.createExportHtml())},this.printClickHandle=()=>Hn(this,void 0,void 0,(function*(){if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e=Object.assign(Object.assign({},this.state.form),{printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text});yield Qt.setItem(this.printerKey,e),yield this.savePrintConfig(this.printerKey,e)}catch(e){}})),this.doClose=()=>{var e,t;null===(t=(e=this.props).onClose)||void 0===t||t.call(e)},this.getPrintConfig=e=>Hn(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Hn(this,void 0,void 0,(function*(){const n=this.context.global,r=null==n?void 0:n.saveComponentConfigApi;if(r)try{yield r({[e]:t})}catch(e){}})),this.createStyle=()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ',this.doPrint=e=>{const t=Eh();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i,printerName:l,printerType:a,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=vh,{left:d,right:u,top:p,bottom:m}=i.distance;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(l),t.SET_PRINT_COPIES(o),i.doubleSide&&("auto"===i.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===a&&("vertical"===i.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===i.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===a&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(p-c)+"mm",10*(d-c)+"mm",`RightMargin: ${10*(u-c)}mm`,`BottomMargin: ${"stylus"!==a?10*(m-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?r&&this.doClose():R.error(un("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=Eh();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i}}=this.state;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?r&&this.doClose():R.error(un("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===i.direction?1:2),t.SAVE_TO_FILE(`${m().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:un("qm.print.laserPrinter"),value:"laser"},{text:un("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Eh(),t=[{text:un("qm.print.defaultPrinter"),value:-1}];try{const n=e.GET_PRINTER_COUNT();for(let r=0;r<n;r++)t.push({text:e.GET_PRINTER_NAME(r),value:r})}catch(e){tr("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}componentDidMount(){var e,t;return Hn(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield Qt.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),ae(n)&&(yield Qt.setItem(this.printerKey,n))),ae(n)&&Object.keys(n).length&&Ie(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:n}=this.props,{visible:r,form:i,currentPage:l,totalPage:a,printPage:o}=this.state,s=lr("print-preview"),c={visible:r,title:un("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[s]:!0};return e?t.createElement(t.Fragment,null,t.createElement("div",{className:Pe(d)},t.createElement("div",{className:"outer"},t.createElement("div",{className:"header"},t.createElement("span",null,un("qm.print.printer"),":",t.createElement(H,{value:i.printerName,onChange:e=>{this.setState((t=>Ie({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,un("qm.print.type"),":",t.createElement(H,{value:i.printerType,onChange:e=>{this.setState((t=>Ie({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,un("qm.print.copies"),":",t.createElement($,{value:i.copies,min:1,precision:0,onChange:e=>{this.setState((t=>Ie({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),t.createElement("span",null,un("qm.print.printPage.0"),t.createElement($,{value:o,min:1,max:a,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),un("qm.print.printPage.1")),t.createElement("span",null,t.createElement(B,{size:"small",current:l,pageSize:1,total:a,onChange:this.pageChangeHandle})),t.createElement("span",null,t.createElement(nr,{type:"text",icon:t.createElement(Qe,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},un("qm.print.setting"))),t.createElement("span",null,t.createElement(nr,{type:"text",icon:t.createElement(je,null),className:"text-btn",onClick:()=>this.exportClickHandle()},un("qm.print.export"))),t.createElement("span",null,t.createElement(nr,{icon:t.createElement(Ye,null),type:"primary",onClick:this.printClickHandle},un("qm.print.print")))),t.createElement("div",{className:"main"},t.createElement(yh.Provider,{value:this.provide},t.createElement(Ch,{ref:this.containRef,templateRender:n,directPrint:!1}))),t.createElement("div",{className:"footer"},t.createElement("span",null,un("qm.print.scale"),":",t.createElement(J,{value:i.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>Ie({},t,{form:{scale:e}})))}}),t.createElement("em",{className:"scale-text"},`${Math.floor(100*i.scale)}%`)),t.createElement("span",null,un("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t.createElement("span",null,un("qm.print.pageNumber"),":",un("qm.print.pagination",{currentPage:l,totalPage:a}))))),t.createElement(Fl,c,t.createElement(Sh,{setting:i.setting,onChange:e=>{this.setState((t=>Ie({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t.createElement(yh.Provider,{value:this.provide},t.createElement(Ch,{ref:this.containRef,templateRender:n,directPrint:!0}))}}Nh.contextType=on;class Th extends d{constructor(){super(...arguments),this.previewRef=t.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Hn(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const n=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof n&&!n)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:n,uniqueKey:r,defaultConfig:i,preview:l,closeAfterPrint:a}=this.props,o={visible:e,title:un("qm.print.preview"),width:`${vh.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:n,uniqueKey:r,defaultConfig:i,preview:l,closeAfterPrint:a,onClose:()=>{this.setState({visible:!1})}};return l?t.createElement(Fl,o,t.createElement(Nh,s)):e?t.createElement(Nh,s):null},this.DO_PRINT=()=>Hn(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield Wn(0),this.setState({visible:!0}),yield Wn(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:n,icon:r,type:i,disabled:l,shape:a}=this.props,o={size:n||this.context.size||"",type:i,shape:a,icon:r,loading:e,disabled:l,click:this.clickHandle};return t.createElement(t.Fragment,null,this.props.children&&t.createElement(nr,o,this.props.children),this.createRender())}}function Ih(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Rh(e){const t=Ih(e);return t?t.frameElement:null}function Oh(e){const t=Ah(e);return kh([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function kh(e){return e.reduce(((e,t)=>null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}))}function Lh(e,t){const n=Rh(e);if(n&&n!==t){const r=[e.getBoundingClientRect()];let i=n,l=!1;for(;i;){const e=Oh(i);if(r.push(e),i=Rh(i),l)break;i&&Ih(i)===t&&(l=!0)}return kh(r)}return e.getBoundingClientRect()}function Ah(e){const t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}Th.propTypes={size:(e,t,n)=>{if(!Ha(e[t]||""))return er("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:Ut.elementType},Th.defaultProps={preview:!0,type:"primary",icon:t.createElement(Ye,null)},Th.contextType=on;const Ph=Object.assign;class _h{constructor(e,t){this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=Mh.border,this.padding.style.borderColor=Mh.padding,this.content.style.backgroundColor=Mh.background,Ph(this.node.style,{borderColor:Mh.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),t.appendChild(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,t){Fh(t,"margin",this.node),Fh(t,"border",this.border),Fh(t,"padding",this.padding),Ph(this.content.style,{height:e.height-t.borderTop-t.borderBottom-t.paddingTop-t.paddingBottom+"px",width:e.width-t.borderLeft-t.borderRight-t.paddingLeft-t.paddingRight+"px"}),Ph(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Dh{constructor(e,t){this.tip=e.createElement("div"),Ph(this.tip.style,{display:"flex",flexFlow:"row nowrap",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"3px 5px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),Ph(this.nameSpan.style,{color:"#ee78e6",borderRight:"1px solid #aaaaaa",paddingRight:"0.5rem",marginRight:"0.5rem"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),Ph(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,n){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(n)+"px"}updatePosition(e,t){const n=this.tip.getBoundingClientRect(),r=function(e,t,n){const r=Math.max(n.height,20),i=Math.max(n.width,60),l=5;let a;a=e.top+e.height+r<=t.top+t.height?e.top+e.height<t.top+0?t.top+l:e.top+e.height+l:e.top-r<=t.top+t.height?e.top-r-l<t.top+l?t.top+l:e.top-r-l:t.top+t.height-r-l;let o=e.left+l;e.left<t.left&&(o=t.left+l);e.left+i>t.left+t.width&&(o=t.left+t.width-i-l);return a+="px",o+="px",{style:{top:a,left:o}}}(e,t,{width:n.width,height:n.height});Ph(this.tip.style,r.style)}}class Hh{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const n=e.document;this.container=n.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Dh(n,this.container),this.rects=[],n.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const n=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>n.length;){const e=this.rects.pop();null==e||e.remove()}if(0===n.length)return;for(;this.rects.length<n.length;)this.rects.push(new _h(this.window.document,this.container));const r={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};n.forEach(((e,t)=>{const n=Lh(e,this.window),i=Ah(e);r.top=Math.min(r.top,n.top-i.marginTop),r.right=Math.max(r.right,n.left+n.width+i.marginRight),r.bottom=Math.max(r.bottom,n.top+n.height+i.marginBottom),r.left=Math.min(r.left,n.left-i.marginLeft);this.rects[t].update(n,i)})),t||(t=n[0].nodeName.toLowerCase(),n[0]),this.tip.updateText(t,r.right-r.left,r.bottom-r.top);const i=Lh(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:r.top,left:r.left,height:r.bottom-r.top,width:r.right-r.left},{top:i.top+this.tipBoundsWindow.scrollY,left:i.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Fh(e,t,n){Ph(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const Mh={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"};let $h=null,qh=null;function jh(){null!=window.document&&($h=null,null!==qh&&(qh.remove(),qh=null))}class Kh{constructor(e){this._lastHoveredNode=null,this.iframesListeningTo=new Set,this.onClick=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onMouseEvent=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onPointerDown=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))},this.onPointerMove=e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>Gi(t,window.document.querySelector(e)))))return this._selectIgnore=!0,jh();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var n,r,i;n=[t],r=null,i=!1,null!=window.document?(null!==$h&&clearTimeout($h),null!=n&&(null===qh&&(qh=new Hh),qh.inspect(n,r),i&&($h=setTimeout((()=>jh()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=Ae((e=>{var t;this._selectIgnore||null===(t=this.onSelect)||void 0===t||t.call(this,e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let n=e;const r=[];for(;n!==t&&null!==n;){let e=n.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,r=Array.from(n.classList).reverse();e<r.length;e++)t.test(r[e])&&n.classList.remove(r[e]);if(n.id&&/^rc-\w+/.test(n.id)&&n.removeAttribute("id"),n.id)e+=`#${n.id}`;else{const t=Array.from(n.parentElement.children).filter((e=>e.tagName===n.tagName)),r=n.className.trim();if(t.filter((e=>e.className.includes(r))).length<=1){if(r){const t=r.split(/\s+/);let n="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(n+=`.${t[e]}`);e+=n}}else n.getAttribute("name")?e+=`[name=${n.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(n)+1})`}n.nodeType!==Node.TEXT_NODE&&r.unshift(e),n=n.parentElement}return r.join(" > ")}(e))}),200,{leading:!1}),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){jh(),this.removeListenersOnWindow(window),this.iframesListeningTo.forEach((function(e){try{this.removeListenersOnWindow(e.contentWindow)}catch(e){}})),this.iframesListeningTo=new Set,this._isRunning=!1}registerListenersOnWindow(e){e&&"function"==typeof e.addEventListener&&(e.addEventListener("click",this.onClick,!0),e.addEventListener("mousedown",this.onMouseEvent,!0),e.addEventListener("mouseover",this.onMouseEvent,!0),e.addEventListener("mouseup",this.onMouseEvent,!0),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0))}removeListenersOnWindow(e){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("click",this.onClick,!0),e.removeEventListener("mousedown",this.onMouseEvent,!0),e.removeEventListener("mouseover",this.onMouseEvent,!0),e.removeEventListener("mouseup",this.onMouseEvent,!0),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0))}getEventTarget(e){return e.composed?e.composedPath()[0]:e.target}}function Vh(e){return document.querySelector(e)}const zh=e=>{const{action:n,onConfirm:r,onCancel:i,onFinish:l}=e,{t:a}=Fn();return t.createElement(t.Fragment,null,t.createElement("div",{style:{height:100}},a("qm.table.config.emptyText")),t.createElement(ir,{style:{width:"100%",justifyContent:"flex-end"}},t.createElement(nr,{size:"small",onClick:()=>null==i?void 0:i()},a("qm.guideTracker.closeButton")),t.createElement(nr,{size:"small",onClick:()=>null==r?void 0:r()},a("add"===n?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),t.createElement(nr,{size:"small",onClick:()=>null==l?void 0:l()},a("qm.guideTracker.finishButton"))))},Wh={left:"50%",top:"50%",width:1,height:1},Bh=t.forwardRef(((e,n)=>{const{open:r,current:i,defaultCurrent:l,steps:a=[],placement:o="bottom",control:s=!0,overlayClassName:c,overlayStyle:d,destroyOnHide:u,contentRender:p,zIndex:m,helper:h={},selectFilter:f=(e=>e),onSelect:g,onChange:v,onClose:y,onFinish:b}=e,{t:x}=Fn(),E=t.useRef(),w=t.useRef(a.length),[S,N]=ts(0,{value:i,defaultValue:l}),[T,I]=ts(void 0,{value:r,postState:e=>null!=e&&e}),[R,O]=ts(1051,{value:m,defaultValue:m}),[k,L]=t.useState({}),[A,P]=t.useState(!1),[_,D]=t.useState(T),[H,F]=t.useState(!1),[$,q]=ch(k.node,!!r),[j,K]=t.useState(22),z=t.useRef(!1),W=t.useMemo((()=>S>=a.length?"add":"edit"),[S,a]),B=t.useMemo((()=>`${S+1} / ${a.length}`),[S,a]);t.useLayoutEffect((()=>{E.current=new Kh({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),L({id:Sa(),node:e,path:t}),N(w.current),P(!0),G(),null==g||g(t,e)}})}),[]),t.useEffect((()=>(T?U():G(),T?setTimeout((()=>D(!0)),16):D(!1),()=>{G()})),[T]),t.useEffect((()=>{w.current=a.length}),[a]);const U=()=>{E.current.startHandle()},G=()=>{E.current.stopHandle()},Y=e=>{e.stopPropagation(),e.preventDefault()};t.useImperativeHandle(n,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),GET_CURRENT_STEP:()=>({current:S,selector:k.path})})));const X=lr("guide-tracker"),Q=[{[`${X}-primary`]:!0}],Z=zd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(tn,{open:T&&A,autoLock:!0},t.createElement(Zt,{zIndex:R,builtinPlacements:Z,popupPlacement:o,popupVisible:T&&A,popupClassName:Pe(Q,c),popupStyle:d,prefixCls:X,popup:()=>{const e=()=>{P(!1),U()};return t.createElement("div",{className:`${X}-content`},t.createElement("div",{className:`${X}-inner`},t.createElement(it,{className:`${X}-close`,onClick:()=>{null==y||y(S),e()}}),t.createElement(M,{open:H,trigger:["click"],dropdownRender:()=>a.length?t.createElement("div",{className:"ant-dropdown-menu step-list"},t.createElement(Gt,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.id)),n=a.map((e=>e.id));if(me(t,n))return;const r=t.findIndex((e=>e===k.id)),i=-1!==r?r:S;N(i),null==v||v(_a(e),i)}},a.map(((e,n)=>t.createElement("li",{key:n,className:Pe("item",{actived:e.id===k.id})},t.createElement(Be,{className:"handle",title:x("qm.form.draggable")}),t.createElement("span",{className:"box"},t.createElement("span",{className:"title",title:e.title,onClick:()=>{n!==S&&(L({id:e.id,node:Vh(e.selector),path:e.selector}),N(n),K(22===j?j+1:j-1),null==v||v(a,n))}},e.title),t.createElement(C,{title:x("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const t=a.filter((t=>t.id!==e.id)),r=n===S;let i=n<=S?S-1:S;if(i=i<0?0:i,i=i>t.length?t.length:i,r&&t[i]){const{id:e,selector:n}=t[i];L({id:e,node:Vh(n),path:n})}N(i),null==v||v(t,i)}},t.createElement(it,{className:"close-icon"})))))))):t.createElement(t.Fragment,null),overlayClassName:`${X}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>F(e)},t.createElement(Dt,{className:Pe(`${X}-close`,"menu-icon"),style:{width:j}})),h.content&&t.createElement(V,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:h.content,title:h.title},t.createElement(_t,{className:Pe(`${X}-close`,"help-icon")})),t.createElement("div",{className:"panel-label"},t.createElement("span",{className:"title"},x("qm.guideTracker.label")),t.createElement("span",{className:"step"},x("qm.guideTracker.currentStep"),B)),p?p({id:k.id,selector:k.path,actionStatus:W,DO_CLOSE:e},S):t.createElement(zh,{action:W,onConfirm:()=>{null==v||v("add"===W?[...a,{id:k.id,selector:k.path,title:"Guide Title"}]:[...a],S),e()},onCancel:()=>{null==y||y(S),e()},onFinish:()=>{e(),null==y||y(S),null==b||b()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},t.createElement("div",{className:Pe(`${X}-target-placeholder`),style:Object.assign(Object.assign({},$||Wh),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:Y,onClick:Y}))),s&&t.createElement(tn,{open:_},t.createElement(ph,{zIndex:R,prefixCls:X,onPause:()=>{z.current=A,P(!1),G()},onPlay:()=>{z.current?P(!0):U()}})))}));Bh.displayName="QmGuideTracker";const Uh=n=>{var r,i,l,a,o,s,c,d;const{content:u,image:p,width:m,height:h,font:f={},gap:g=[100,100],offset:v=[50,50],rotate:y=-22,zIndex:b=9,alpha:x=1,antiTamper:E=!0,grayscale:w,className:C,style:S}=n,N=t.useRef(null),T=t.useRef(new Map),I=null!==(r=f.fontSize)&&void 0!==r?r:16,R=null!==(i=f.fontWeight)&&void 0!==i?i:"normal",O=null!==(l=f.fontStyle)&&void 0!==l?l:"normal",k=null!==(a=f.fontFamily)&&void 0!==a?a:"sans-serif",L=null!==(o=f.color)&&void 0!==o?o:"rgba(0, 0, 0, 0.15)",A=null!==(s=f.textAlign)&&void 0!==s?s:"center",P=Array.isArray(u)?u:[u],_=g[0],D=g[1],H=_/2,F=D/2,M=null!==(c=v[0])&&void 0!==c?c:H,$=null!==(d=v[1])&&void 0!==d?d:F,q=t.useMemo((()=>{const e=M-H,t=$-F;return{position:"absolute",left:e>0?`${e}px`:0,top:t>0?`${t}px`:0,width:e>0?`calc(100% - ${e}px)`:"100%",height:t>0?`calc(100% - ${t}px)`:"100%",pointerEvents:"none",backgroundRepeat:"repeat",backgroundPosition:`${e>0?0:e}px ${t>0?0:t}px`,zIndex:b}}),[H,F,M,$,b]),j=(e,t)=>{var n;if(N.current){const r=T.current.get(N.current);r&&(N.current.contains(r)&&N.current.removeChild(r),T.current.delete(N.current));const i=document.createElement("div");i.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var n})).join(";"))(Object.assign(Object.assign({},q),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(n=N.current)||void 0===n||n.append(i),T.current.set(N.current,i)}},K=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[r,i]=(e=>{let t=120,n=64;if(!p&&e.measureText){e.font=`${I}px ${k}`;const r=P.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...r)),n=I*P.length+3*(P.length-1)}return[null!=m?m:t,null!=h?h:n]})(t),l=r*n,a=i*n,o=(_+r)*n,s=(D+i)*n,c=_/2*n,d=D/2*n,u=o/2,f=s/2,g=2*(_+r);e.width=2*o,e.height=2*s,t.globalAlpha=x,t.save(),t.translate(u,f),t.rotate(Math.PI/180*y),t.translate(-u,-f);const v=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),w&&(e=>{const t=e.getContext("2d");if(!t)return;const n=t.getImageData(0,0,e.width,e.height),{data:r}=n;for(let e=0;e<r.length;e+=4){const t=(r[e]+r[e+1]+r[e+2])/3;r[e]=t,r[e+1]=t,r[e+2]=t}t.putImageData(n,0,0)})(e),j(e.toDataURL(),g)},b=()=>{const e=Number(I)*n;t.font=`${O} normal ${R} ${e}px/${i}px ${k}`,t.fillStyle=L,t.textAlign=A,t.textBaseline="top",t.translate(l/2,0),P.forEach(((r,i)=>{t.fillText(null!=r?r:"",c,d+i*(e+3*n))})),v()};if(p){const e=new Image;e.onload=()=>{t.drawImage(e,c,d,l,a),v()},e.onerror=()=>{b()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=p}else b()},V=e=>Array.from(T.current.values()).includes(e);t.useEffect((()=>{K()}),[u,p,m,h,f,g,v,y,b,x,E,w]),function(t,n,r={}){const i=window&&"MutationObserver"in window,l=e.useRef(),a=()=>{l.current&&(l.current.disconnect(),l.current=void 0)};e.useLayoutEffect((()=>(a(),i&&t.current&&(l.current=new MutationObserver(n),l.current.observe(t.current,r)),()=>a())),[t])}(N,(e=>{if(E)for(const t of e){const e=Array.from(t.removedNodes).some((e=>V(e))),n="attributes"===t.type&&V(t.target);if(e||n){K();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=lr("watermark");return t.createElement("div",{ref:N,className:Pe(z,C),style:Object.assign({position:"relative"},S)},n.children)},Gh=new Map,Yh=new WeakMap;let Xh,Qh=0;function Zh(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Yh.has(n)||(Qh+=1,Yh.set(n,Qh.toString())),Yh.get(n)):"0"):e[t]}`;var n})).toString()}function Jh(e,t,n={},r=Xh){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:l,elements:a}=function(e){const t=Zh(e);let n=Gh.get(t);if(!n){const r=new Map;let i=[];const l=new IntersectionObserver((t=>{t.forEach((t=>{var n;const l=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=l),null===(n=r.get(t.target))||void 0===n||n.forEach((e=>{e(l,t)}))}))}),e);i=l.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:l,elements:r},Gh.set(t,n)}return n}(n),o=a.get(e)||[];return a.has(e)||a.set(e,o),o.push(t),l.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(a.delete(e),l.unobserve(e)),0===a.size&&(l.disconnect(),Gh.delete(i))}}const ef=e=>{const{forceRender:n,height:r,placeholder:i=null,unmountIfInvisible:l,className:a,style:o}=e,{ref:s,inView:c,entry:d}=(({root:e,rootMargin:n,threshold:r,triggerOnce:i,fallbackInView:l,trackVisibility:a,skip:o,delay:s,onChange:c}={})=>{var d;const[u,p]=t.useState(null),[m,h]=t.useState({inView:!1,entry:void 0}),f=t.useRef(c);t.useEffect((()=>{if(o||!u)return;let t;return t=Jh(u,((e,n)=>{var r;h({inView:e,entry:n}),null===(r=f.current)||void 0===r||r.call(f,e,n),n.isIntersecting&&i&&t&&(t(),t=void 0)}),{root:e,rootMargin:n,threshold:r,trackVisibility:a,delay:s},l),()=>{t&&t()}}),[Array.isArray(r)?r.toString():r,u,e,n,i,o,a,l,s]);const g=null===(d=m.entry)||void 0===d?void 0:d.target,v=t.useRef();u||!g||i||o||v.current===g||(v.current=g,h({inView:!1,entry:void 0}));const y=[p,m.inView,m.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y})(Object.assign({},e,{triggerOnce:!l}));t.useEffect((()=>{r||tr("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[lr("lazy-load")]:!0};return t.createElement("div",{ref:s,className:Pe(u,a),style:o},n||c?e.children:t.createElement("div",{className:"placeholder",style:{height:r}},i))};class tf{constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class nf{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,r=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new nf(e[1],n,r,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const r=e.x-t.x,i=e.y-t.y,l=t.x-n.x,a=t.y-n.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,c=(t.x+n.x)/2,d=(t.y+n.y)/2,u=Math.sqrt(r*r+i*i),p=Math.sqrt(l*l+a*a),m=p/(u+p),h=c+(o-c)*m,f=d+(s-d)*m,g=t.x-h,v=t.y-f;return{c1:new tf(o+g,s+v),c2:new tf(c+g,d+v)}}constructor(e,t,n,r,i,l){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=r,this.startWidth=i,this.endWidth=l}length(){let e,t,n=0;for(let r=0;r<=10;r+=1){const i=r/10,l=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){const r=l-e,i=a-t;n+=Math.sqrt(r*r+i*i)}e=l,t=a}return n}point(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e}}class rf{constructor(e,t){this.width=320,this.height=200,this.ratio=Math.max(window.devicePixelRatio||1,1),this.penColor="rgba(0,0,0,1)",this.backgroundColor="rgba(0,0,0,0)",this.canAddHistory=!1,this.openSmooth=!0,this.dotSize=0,this.throttle=16,this.minDistance=5,this.velocityFilterWeight=.7,this.compositeOperation="source-over",this.minWidth=.5,this.maxWidth=2.5,this.fontSize=16,this.eraserSize=20,this.lineHeight=1.25,this.degreeOfBlur=5,this.textInputPos={x:0,y:0},this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)},this.setTextInput=()=>{this.openSmooth||(this.textInput.setAttribute("class","signature__text-input"),this.textInput.setAttribute("contentEditable","true"),this.textInput.setAttribute("spellCheck","false"),this.canvas.parentNode.appendChild(this.textInput))},this.isTouchEvent=e=>"touches"in e,this.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)},this.removeListener=()=>{this.canvas.style.touchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("touchstart",this.onDrawStart),this.canvas.removeEventListener("touchmove",this.onDrawMove),document.removeEventListener("touchend",this.onDrawEnd),document.removeEventListener("touchcancel",this.onDrawEnd),this.canvas.removeEventListener("mousedown",this.onDrawStart),this.canvas.removeEventListener("mousemove",this.onDrawMove),document.removeEventListener("mouseup",this.onDrawEnd),this.textInput.removeEventListener("blur",this.onInputBlur)},this._isLeftButtonPressed=(e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,n;return{event:e,type:e.type,x:this.isTouchEvent(e)?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:this.isTouchEvent(e)?null===(n=e.touches[0])||void 0===n?void 0:n.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=(e,t=!0)=>{if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);const n=this._createPoint(e.x,e.y,e.pressure),r=this._data[this._data.length-1],i=r.points,l=i.length>0&&i[i.length-1],a=!!l&&n.distanceTo(l)<=this.minDistance,o=this._getPointGroupOptions(r);if(!l||!l||!a){const e=this._addPoint(n,o);t&&(l?e&&this._drawCurve(e,o):this._drawDot(n,o)),i.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}},this._strokeEnd=(e,t=!1)=>{this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const n=this.ctx,r=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=t.penColor,n.fill()},this._drawCurve=(e,t)=>{const n=this.ctx,r=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<i;n+=1){const l=n/i,a=l*l,o=a*l,s=1-l,c=s*s,d=c*s;let u=d*e.startPoint.x;u+=3*c*l*e.control1.x,u+=3*s*a*e.control2.x,u+=o*e.endPoint.x;let p=d*e.startPoint.y;p+=3*c*l*e.control1.y,p+=3*s*a*e.control2.y,p+=o*e.endPoint.y;const m=Math.min(e.startWidth+o*r,t.maxWidth);this._drawCurveSegment(u,p,m)}n.closePath(),n.fill()},this._drawCurveSegment=(e,t,n)=>{const r=this.ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1)},this._createPoint=(e,t,n)=>{const r=this.canvas.getBoundingClientRect();return new tf(e-r.left,t-r.top,n,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),r=nf.fromPoints(n,e);return n.shift(),r}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,n)=>{const r=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(r,n),l={end:i,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=i,l},this.onDrawStart=e=>{var t;e.preventDefault(),this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&(this._strokeBegin(this._pointerEventToSignatureEvent(e)),this.ctx.strokeStyle=this.penColor,this.ctx.lineWidth=this.maxWidth,"line"===this.mode&&this.createPencil(e),"eraser"===this.mode&&this.createEraser(e),"text"===this.mode&&this.createTextInput(e),null===(t=this.onStart)||void 0===t||t.call(this,e))},this.onDrawMove=e=>{e.preventDefault(),"text"!==this.mode&&(this._isLeftButtonPressed(e,!0)&&this._drawingStroke?window.requestAnimationFrame?window.requestAnimationFrame((()=>this.drawHandler(e))):this.drawHandler(e):this._strokeEnd(this._pointerEventToSignatureEvent(e)))},this.onDrawEnd=e=>{var t;this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),null===(t=this.onEnd)||void 0===t||t.call(this,e))},this.onInputBlur=e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()},this.drawHandler=e=>{switch(this.mode){case"line":this.drawLine(e);break;case"square":this.drawSquare(e);break;case"round":this.drawRound(e);break;case"arrow":this.drawArrow(e);break;case"mosaic":this.drawMosaic(e);break;case"text":this.drawText(e);break;case"eraser":this.drawEraser(e)}this.canAddHistory=!0},this.drawSquare=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,n,r-t,i-n),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=Math.min(r,t),a=Math.min(i,n),o=.5*(Math.max(r,t)-l),s=.5*(Math.max(i,n)-a),c=l+o,d=a+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(c,d,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=180*Math.atan2(n-i,t-r)/Math.PI,a=(l+25)*Math.PI/180,o=(l-25)*Math.PI/180,s=15*Math.cos(a),c=15*Math.sin(a),d=15*Math.cos(o),u=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(r,i),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(r,i);const p=r+s,m=i+c;this.ctx.lineTo(p,m);const h=r+d,f=i+u;this.ctx.lineTo(h,f),this.ctx.lineTo(r,i),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,n)=>{const r=e.width,i=e.data,l=[];return l[0]=i[4*(n*r+t)],l[1]=i[4*(n*r+t)+1],l[2]=i[4*(n*r+t)+2],l[3]=i[4*(n*r+t)+3],l},this.setAxisColor=(e,t,n,r)=>{const i=e.width,l=e.data;l[4*(n*i+t)]=r[0],l[4*(n*i+t)+1]=r[1],l[4*(n*i+t)+2]=r[2],l[4*(n*i+t)+3]=r[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=this.ctx.getImageData(t*this.ratio,n*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),i=r.width,l=r.height,a=i/this.degreeOfBlur,o=l/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=this.getAxisColor(r,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let i=0;i<this.degreeOfBlur;i++)for(let l=0;l<this.degreeOfBlur;l++)this.setAxisColor(r,t*this.degreeOfBlur+l,e*this.degreeOfBlur+i,n)}this.ctx.putImageData(r,t*this.ratio,n*this.ratio)},this.drawText=e=>{const{x:t,y:n}=this.textInputPos;if(0===t&&0===n)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const r=this.fontSize*this.lineHeight,i=this.width-t,l=e.target.innerText,a=[];let o="";for(let e=0;e<l.length;e++){const t=o+l[e];this.ctx.measureText(t).width>i&&o.length>0?(a.push(o),o=l[e]):o=t}a.push(o),a.forEach(((e,i)=>{this.ctx.fillText(e,t+1,n+i*r+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawPencil=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawEraser=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=n?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())},this.setInputStyle=()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}},this.drawBgColor=()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))},this.clearWorkSpace=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},this.addHistory=()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))},this.getLastHistory=()=>this._historyList[this._historyList.length-1],this.setLastHistory=()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()},this.clear=()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())},this.undo=()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()},this.setDrawMode=e=>{this.mode=e},this.setLineWidth=e=>{this.maxWidth=e},this.setPenColor=e=>{this.penColor=e},this.setFontSize=e=>{this.fontSize=e},this.isEmpty=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=this.canvas.width,e.height=this.canvas.height,1!==this.ratio&&t.scale(this.ratio,this.ratio),this.backgroundColor&&(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=(e="image/png",t=1)=>{if(this.canvas.width===this.width)return this.canvas.toDataURL(e,t);const n=document.createElement("canvas");n.width=this.width,n.height=this.height;return n.getContext("2d").drawImage(this.canvas,0,0,n.width,n.height),n.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=(e=.8)=>this.toDataURL("image/jpeg",e),this.initial(e,t)}initial(e,t={}){e&&(this.canvas=e,this.ctx=e.getContext("2d"),this.textInput=document.createElement("div"),this.width=t.width||e.clientWidth||this.width,this.height=t.height||e.clientHeight||this.height,this.penColor=t.penColor||this.penColor,this.fontSize=t.fontSize||this.fontSize,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this.backgroundColor=this.openSmooth&&t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,r,i,l=0,a=null;const o=()=>{l=Date.now(),a=null,n=e.apply(r,i),a||(r=null,i=[])};return function(...s){const c=Date.now(),d=t-(c-l);return r=this,i=s,d<=0||d>t?(a&&(clearTimeout(a),a=null),l=c,n=e.apply(r,i),a||(r=null,i=[])):a||(a=window.setTimeout(o,d)),n}}(this._strokeUpdate,this.throttle):this._strokeUpdate,this.minWidth=t.minWidth||this.minWidth,this.maxWidth=t.maxWidth||this.maxWidth,this.onStart=t.onStart,this.onEnd=t.onEnd,this.setCanvasSize(),this.setTextInput(),this.drawBgColor(),this.addListener())}update(){this.setCanvasSize(),this.clear()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}rf.dataURLToBlob=e=>{const t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),i=r.length,l=new Uint8Array(i);for(let e=0;e<i;++e)l[e]=r.charCodeAt(e);return new Blob([l],{type:n})},rf.canvasToDataURL=e=>e.toDataURL("image/png",1),rf.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const lf=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),af=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M839.111111 269.198222V122.908444A9.159111 9.159111 0 0 0 829.980444 113.777778H208.213333A9.159111 9.159111 0 0 0 199.111111 122.908444v146.289778c0 5.034667 4.124444 9.159111 9.130667 9.159111h64a9.159111 9.159111 0 0 0 9.159111-9.159111V196.067556h192v640h-105.159111a9.159111 9.159111 0 0 0-9.130667 9.130666v64c0 5.034667 4.124444 9.159111 9.130667 9.159111h301.738666a9.159111 9.159111 0 0 0 9.130667-9.159111v-64a9.159111 9.159111 0 0 0-9.130667-9.130666h-105.159111v-640h192v73.130666c0 5.034667 4.124444 9.159111 9.159111 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111z"})),of=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M887.65217391 606.59279489a31.26857185 31.26857185 0 0 1-31.26857185-31.26857087v-363.48819946L158.38608696 909.83354065a31.26857185 31.26857185 0 1 1-44.21962762-44.21962761l697.99751609-698.06906805h-363.48819945a31.26857185 31.26857185 0 0 1 0-62.46559075h439.04795087c17.17267109 0 31.26857185 13.95279489 31.26857086 31.19701891v439.04795087a31.26857185 31.26857185 0 0 1-31.3401238 31.26857087z"})),sf=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M606.4 103.424a64 64 0 0 1 0.704 0.64l320.256 280.32a64 64 0 0 1 7.104 89.024l-330.432 398.72 320.448 0.128a32 32 0 0 1 0 64.064H397.632a32.128 32.128 0 0 1-6.208-0.64h-20.736a64 64 0 0 1-42.304-16.064l-238.08-210.112A64 64 0 0 1 83.84 620.16l432.32-509.312a64 64 0 0 1 90.24-7.36zM242.048 537.536l-87.04 101.76a32 32 0 0 0 3.584 45.248l213.12 180.672a32 32 0 0 0 20.736 7.616l-0.64-0.064a32.192 32.192 0 0 1 5.76-0.512h102.016a32 32 0 0 0 18.176-10.496l40.96-47.232-316.672-276.992zM592.96 177.28a32 32 0 0 0-45.12 3.456L283.712 488.96l316.928 277.248 264.512-304.96a32 32 0 0 0 1.024-40.704l-3.904-4.16-268.928-238.72a32 32 0 0 0-0.384-0.32z"})),cf=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M607.75537778 291.05948444H223.6416l115.34336-115.41617778a36.37248 36.37248 0 1 0-51.48216889-51.44576L132.61937778 279.04455111c-13.54410667 13.50769778-21.04433778 31.67573333-21.11715556 50.97244444a71.72551111 71.72551111 0 0 0 21.11715556 51.51857778l154.88341333 154.91982222a36.29966222 36.29966222 0 0 0 51.48216889 0 36.37248 36.37248 0 0 0 0-51.48216889l-121.46005333-121.16878222H607.75537778c130.70791111 0 237.02186667 106.16832 237.02186667 236.65777777s-106.31395555 236.65777778-237.02186667 236.65777778h-254.13404445a36.40888889 36.40888889 0 0 0 0 72.81777779h254.13404445c170.83050667 0 309.83964445-138.82709333 309.83964444-309.47555557 0-170.64846222-139.00913778-309.47555555-309.83964444-309.47555555"})),df=t.forwardRef(((e,n)=>{const{open:r,width:i,height:l,imageName:a,penColor:o,penMode:s,minWidth:c,maxWidth:d,backgroundColor:u,className:p,style:h,onOk:f,onCancel:g}=e,{t:v}=Fn(),y=t.useRef(),b=t.useRef(null),x=t.useRef(null),E=t.useRef(null),w=[2,4,6],C=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[N,T]=ts(void 0,{value:r,postState:e=>null!=e&&e}),I=t.useMemo((()=>!!e.children),[e.children]),[R,O]=t.useState(s||(I?"square":"line")),[k,L]=t.useState(w[0]),[A,P]=t.useState(I?S[0]:S[4]),[_,D]=t.useState(C[1]),[F,$]=t.useState("bottomLeft"),[q,j]=t.useState(!1),[K,V]=t.useState(!1);t.useEffect((()=>{var e,t;const n={width:null!=i?i:null===(e=x.current)||void 0===e?void 0:e.offsetWidth,height:null!=l?l:null===(t=x.current)||void 0===t?void 0:t.offsetHeight,maxWidth:k,mode:R,penColor:A,fontSize:_,backgroundColor:u,openSmooth:!I};return n.openSmooth&&Object.assign(n,{penColor:o,minWidth:c,maxWidth:d}),y.current=new rf(b.current,n),()=>y.current.destroy()}),[]);const z=e=>{var t,n;const[r,a]=[null!=i?i:null===(t=x.current)||void 0===t?void 0:t.offsetWidth,null!=l?l:null===(n=x.current)||void 0===n?void 0:n.offsetHeight],{width:o,height:s}=y.current;let c=!1;r&&r!==o&&(y.current.width=r,c=!0),a&&a!==s&&(y.current.height=a,c=!0),(c||e)&&y.current.update()};Mi((()=>{I&&N&&z()}),[N,I]),Mi((()=>{y.current.setDrawMode(R)}),[R]),Mi((()=>{y.current.setLineWidth(k)}),[k]),Mi((()=>{y.current.setPenColor(A)}),[A]),Mi((()=>{y.current.setFontSize(_)}),[_]);const W=()=>Hn(void 0,void 0,void 0,(function*(){const e=I?x.current.parentNode:b.current;if(e)try{const t=yield an(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return rf.canvasToDataURL(t)}catch(e){tr("Signature","生成合成图片失败!")}})),B=()=>{y.current.clear(),null==g||g()};t.useImperativeHandle(n,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>y.current.clear(),UNDO:()=>y.current.undo(),IS_EMPTY:()=>y.current.isEmpty(),UPDATE:z,GET_DATE_URL:W})));const U=e=>{e&&$((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},G=e=>t.createElement("div",{className:Pe("ant-dropdown-menu","content")},"text"!==e?t.createElement("div",{className:"lineWidth"},w.map((e=>t.createElement("span",{key:e,className:Pe("dot",`s${e}`,{active:e===k}),onClick:()=>L(e)})))):t.createElement("div",{className:"fontSize"},t.createElement(H,{size:"small",value:_,options:C.map((e=>({value:e,label:e.toString()}))),onChange:e=>D(e)})),t.createElement("span",{className:"divider"}),t.createElement("div",{className:"penColor"},S.map((e=>t.createElement("span",{key:e,className:Pe("dot",{active:e===A}),style:{backgroundColor:e},onClick:()=>P(e)},t.createElement($e,{className:"icon"})))))),Y=lr("signature"),X={[Y]:!0,"is-annotation":I},Q=i?Object.assign(Object.assign({},h),{width:i}):h;return t.createElement("div",{className:Pe(X,p),style:Q},I&&t.createElement(t.Fragment,null,t.createElement("div",{ref:x,className:"content"},e.children),K&&t.createElement(nl,{spinning:!0,className:"spinning"})),t.createElement("div",{className:Pe("signature",{show:N})},t.createElement("canvas",{ref:b,className:R}),I&&t.createElement("div",{ref:E,className:"signature__tool-bar"},t.createElement("div",{className:"wrapper"},t.createElement("div",{className:Pe("actions",{hidden:q})},t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("square")},t.createElement(Ht,null))),t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("round")},t.createElement(lf,null))),t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("arrow")},t.createElement(of,null))),t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("line")},t.createElement(Me,null))),t.createElement(M,{dropdownRender:()=>G("text"),overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("text")},t.createElement(af,null))),t.createElement("button",{className:"btn",onClick:()=>Hn(void 0,void 0,void 0,(function*(){yield Hn(void 0,void 0,void 0,(function*(){V(!0);const e=yield W();if(e){const t=a?a.slice(0,a.lastIndexOf(".")>0?a.lastIndexOf("."):void 0):m().format(zo);wl(rf.dataURLToBlob(e),`${t}.png`)}V(!1)})),B()}))},t.createElement(je,null)),t.createElement("button",{className:"btn",onClick:()=>O("eraser")},t.createElement(sf,null)),t.createElement("button",{className:"btn",onClick:()=>y.current.undo()},t.createElement(cf,null)),t.createElement("button",{className:"btn",onClick:()=>y.current.clear()},t.createElement(Tt,null)),t.createElement("span",{className:"divider"}),t.createElement("button",{className:"btn",onClick:()=>null==g?void 0:g()},t.createElement(it,null)),t.createElement("button",{className:"btn",onClick:()=>Hn(void 0,void 0,void 0,(function*(){V(!0),yield Wn(10);const e=yield W();V(!1),B(),null==f||f(e)}))},t.createElement($e,null))),t.createElement("button",{className:"btn btn-fold",title:v(q?"qm.divider.spread":"qm.divider.collect"),onClick:()=>j(!q)},q?t.createElement(ot,null):t.createElement(st,null))))))}));df.displayName="QmSignature";const uf=t.forwardRef(((e,n)=>{const{dataIndex:r,className:i,style:l}=e;return t.createElement("li",{ref:n,"data-index":r,className:Pe("list-item",i),style:l},e.children)}));uf.displayName="ListItem";const pf=t.forwardRef(((e,n)=>{var r,i;const{dataSource:l=[],height:a,maxHeight:o,itemHeight:s,renderItem:c,onScroll:d,className:u}=e,p=t.useRef(null),m=hu({count:l.length,getScrollElement:()=>{var e,t;return null!==(t=null===(e=p.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null},estimateSize:()=>s||40,overscan:3,onChange:(e,t)=>null==d?void 0:d(e,t)}),h=m.getVirtualItems();t.useImperativeHandle(n,(()=>({SCROLL_TO_INDEX:e=>m.scrollToIndex(e),SCROLL_TO_OFFSET:e=>m.scrollToOffset(e)})));const f=lr("virtual-list");return t.createElement(El,{ref:p,className:Pe(f,u),style:Object.assign(Object.assign({},e.style),{height:a,maxHeight:o})},t.createElement("div",{className:"container",style:{height:m.getTotalSize()}},t.createElement("ul",{style:{transform:`translateY(${null!==(i=null===(r=h[0])||void 0===r?void 0:r.start)&&void 0!==i?i:0}px)`}},h.map((e=>t.createElement(uf,{ref:m.measureElement,key:e.index,dataIndex:e.index,style:{height:s}},null==c?void 0:c(l[e.index],e.index)))))))}));pf.displayName="VirtualList";const mf="1.11.20";export{Tn as Calendar,In as DatePicker,Ll as DcpAnchor,nr as DcpButton,Hi as DcpCollapse,Wd as DcpColorPicker,Pn as DcpConfigProvider,vp as DcpCopyToClipboard,el as DcpCountup,Fm as DcpCropper,ar as DcpDivider,Il as DcpDownload,_l as DcpDrawer,tl as DcpEmpty,oh as DcpForm,Bh as DcpGuideTracker,ef as DcpLazyLoad,Fl as DcpModal,Ou as DcpPivotGrid,Th as DcpPrint,Bp as DcpRangeTableHelper,El as DcpScrollbar,Rp as DcpSearchHelper,Uu as DcpSearchTree,df as DcpSignature,ir as DcpSpace,nl as DcpSpin,Ji as DcpSplit,Ip as DcpTable,Pl as DcpTabs,ih as DcpTinymce,gh as DcpTour,gl as DcpTransition,hp as DcpTreeHelper,Mp as DcpTreeTableHelper,Tl as DcpUploadFile,$m as DcpUploadImg,pf as DcpVirtualList,Uh as DcpWatermark,Ll as QmAnchor,nr as QmButton,Hi as QmCollapse,Wd as QmColorPicker,Pn as QmConfigProvider,vp as QmCopyToClipboard,el as QmCountup,Fm as QmCropper,ar as QmDivider,Il as QmDownload,_l as QmDrawer,tl as QmEmpty,oh as QmForm,Bh as QmGuideTracker,ef as QmLazyLoad,Fl as QmModal,Ou as QmPivotGrid,Th as QmPrint,Bp as QmRangeTableHelper,El as QmScrollbar,Rp as QmSearchHelper,Uu as QmSearchTree,df as QmSignature,ir as QmSpace,nl as QmSpin,Ji as QmSplit,Ip as QmTable,Pl as QmTabs,ih as QmTinymce,gh as QmTour,gl as QmTransition,hp as QmTreeHelper,Mp as QmTreeTableHelper,Tl as QmUploadFile,$m as QmUploadImg,pf as QmVirtualList,Uh as QmWatermark,On as TimePicker,yo as pinyin,mf as version};
1
+ import*as e from"react";import t,{createContext as n,version as r,isValidElement as i,useRef as l,useLayoutEffect as a,useEffect as o,useState as s,useCallback as c,Component as d,forwardRef as u,useImperativeHandle as p}from"react";import m from"dayjs";import"dayjs/locale/zh-cn";import h from"dayjs/plugin/localeData";import f from"dayjs/plugin/advancedFormat";import g from"dayjs/plugin/customParseFormat";import v from"dayjs/plugin/quarterOfYear";import y from"dayjs/plugin/weekOfYear";import b from"dayjs/plugin/weekday";import{ConfigProvider as x,Button as E,Tooltip as w,Popconfirm as C,Space as S,Empty as N,Spin as T,Upload as I,message as R,Input as O,Tabs as k,Drawer as L,Modal as A,Form as P,Row as _,Col as D,Select as H,Checkbox as F,Dropdown as M,InputNumber as $,Divider as q,Radio as j,Menu as K,Popover as V,Tree as z,Switch as W,Pagination as B,Rate as U,Tag as G,TreeSelect as Y,Cascader as X,Image as Q,notification as Z,Slider as J}from"antd";export{Affix,Alert,Anchor,AutoComplete,Avatar,BackTop,Badge,Breadcrumb,Button,Card,Carousel,Cascader,Checkbox,Col,Collapse,Comment,ConfigProvider,Descriptions,Divider,Drawer,Dropdown,Empty,Form,Grid,Image,Input,InputNumber,Layout,List,Mentions,Menu,Modal,PageHeader,Pagination,Popconfirm,Popover,Progress,Radio,Rate,Result,Row,Segmented,Select,Skeleton,Slider,Space,Spin,Statistic,Steps,Switch,Table,Tabs,Tag,Timeline,Tooltip,Transfer,Tree,TreeSelect,Typography,Upload,message,notification}from"antd";import ee from"dayjs/plugin/weekYear";import te from"antd/es/calendar/generateCalendar";import ne from"antd/es/date-picker/generatePicker";import re from"antd/es/locale/zh_CN";import ie from"antd/es/locale/en_GB";import{isArray as le,isPlainObject as ae,isNumber as oe,isFunction as se,isString as ce,isUndefined as de,get as ue,transform as pe,isEqual as me,set as he,xor as fe,isRegExp as ge,intersection as ve,map as ye,groupBy as be,flatten as xe,spread as Ee,mergeWith as we,isDate as Ce,sumBy as Se,maxBy as Ne,minBy as Te,merge as Ie,union as Re,pickBy as Oe,uniqBy as ke,debounce as Le,throttle as Ae}from"lodash-es";import Pe from"classnames";import{UpOutlined as _e,DownOutlined as De,UploadOutlined as He,LinkOutlined as Fe,EditOutlined as Me,CheckOutlined as $e,EyeOutlined as qe,DownloadOutlined as je,DeleteOutlined as Ke,FullscreenExitOutlined as Ve,FullscreenOutlined as ze,UnorderedListOutlined as We,HolderOutlined as Be,InfoCircleFilled as Ue,ReloadOutlined as Ge,PrinterOutlined as Ye,ImportOutlined as Xe,SettingOutlined as Qe,CopyOutlined as Ze,CheckSquareOutlined as Je,CloseCircleOutlined as et,MonitorOutlined as tt,FolderOpenOutlined as nt,PlusOutlined as rt,CloseOutlined as it,FilterOutlined as lt,SortAscendingOutlined as at,LeftOutlined as ot,RightOutlined as st,EyeInvisibleOutlined as ct,ColumnHeightOutlined as dt,FolderOutlined as ut,BarsOutlined as pt,SaveOutlined as mt,InfoCircleOutlined as ht,BgColorsOutlined as ft,CaretDownOutlined as gt,ExpandAltOutlined as vt,CaretRightOutlined as yt,LineChartOutlined as bt,PieChartOutlined as xt,FunnelPlotOutlined as Et,AppstoreAddOutlined as wt,StepBackwardOutlined as Ct,StepForwardOutlined as St,SearchOutlined as Nt,ClearOutlined as Tt,ZoomInOutlined as It,ZoomOutOutlined as Rt,RotateRightOutlined as Ot,RotateLeftOutlined as kt,InboxOutlined as Lt,ExclamationCircleOutlined as At,PauseOutlined as Pt,QuestionCircleOutlined as _t,MenuOutlined as Dt,BorderOutlined as Ht}from"@ant-design/icons";import Ft,{flushSync as Mt}from"react-dom";import $t from"react-countup";import qt from"resize-observer-polyfill";import jt from"sortablejs";import Kt from"add-dom-event-listener";import Vt from"scroll-into-view-if-needed";import zt from"react-draggable";import Wt from"memoize-one";import*as Bt from"prop-types";import Ut from"prop-types";import{ReactSortable as Gt}from"react-sortablejs";import Yt from"big.js";import Xt from"exceljs";import Qt from"localforage";import Zt from"@rc-component/trigger";import Jt,{ColorBlock as en}from"@rc-component/color-picker";import tn from"@rc-component/portal";import nn from"copy-to-clipboard";import rn from"china-area-data";import ln from"cropperjs";import an from"html2canvas";const on=n({locale:"zh-cn",size:"middle"});var sn={name:"zh-cn",qm:{button:{confirmPrompt:"提示",confirmTitle:"确认执行删除吗?",shortcutKey:"快捷键"},divider:{collect:"收起",spread:"展开"},dialog:{fullScreen:"全屏",cancelFullScreen:"取消全屏",close:"关 闭",confirm:"确 定",cancel:"取 消"},form:{search:"搜 索",reset:"重 置",save:"保 存",spread:"展开",collect:"收起",trueText:"是",falseText:"否",draggable:"拖动排序",requiredTips:"不能为空",searchHelperTips:"搜索帮助正在加载值",inputPlaceholder:"请输入...",selectPlaceholder:"请选择...",treePlaceholder:"树节点过滤",rangeInputNumberPlaceholder:["开始值","结束值"],rangeSearchHelper:["起始位置","结束位置"],datePlaceholder:"选择日期",timePlaceholder:"选择时间",weekPlaceholder:"选择周",monthPlaceholder:"选择月",quarterPlaceholder:"选择季度",yearPlaceholder:"选择年",daterangePlaceholder:["开始日期","结束日期"],timerangePlaceholder:["开始时间","结束时间"],monthrangePlaceholder:["开始月份","结束月份"],yearrangePlaceholder:["开始年份","结束年份"],datePickers:["今天","昨天","一周前","一个月前"],dateRangePickers:["最近一周","最近一个月","最近三个月","最近六个月"],citySelectType:["按省份","按城市"],regionSelectLabel:["省","市","区","街道"],validatePrompt:"表单校验提示"},clipboard:{success:"复制成功",error:"复制失败"},download:{text:"下载",success:"文件下载成功",error:"文件下载失败!"},upload:{tooltip:"只能上传 {type} 格式",notType:"不支持的文件类型 {type}",sizeLimit:"大小不能超过 {size}M",countLimit:"数量不能超过 {count} 个",uploadError:"文件上传失败!",downError:"文件下载失败!",text:"点击上传",remove:"删除文件",batchDownload:"批量下载"},uploadCropper:{dragableText:"拖放或点击",pasteText:"Ctrl+V 粘贴",tooltip:"只能上传 {type} 格式的图片",preview:"图片预览",cropper:"图片裁剪",uploadError:"图片上传失败!",downError:"图片下载失败!",text:"上传图片",zoomIn:"放大",zoomOut:"缩小",rotatePlus:"顺时针",rotateSubtract:"逆时针"},print:{preview:"打印预览",pageSetting:"页面设置",printError:"打印失败!",exportError:"导出失败!",defaultPrinter:"默认打印机",laserPrinter:"激光打印机",stylusPrinter:"针式打印机",printer:"打印机",type:"类型",copies:"份数",printPage:["打印第","几页"],setting:"设置",export:"导出",print:"打印",scale:"缩放",paper:"纸张",pageNumber:"页码",pagination:"第{currentPage}页 / 共{totalPage}页",setPanel:{printParameter:"打印参数",pagerType:"纸张类型",carbonPaper:"三联复写纸(针式)",printDirection:"打印方向",vertical:"纵向",horizontal:"横向",doublePrint:"双面打印",autoDoublePrint:"自动双面打印",manualDoublePrint:"手动双面打印",fixedLogo:"固定Logo",printMargin:"打印边距",leftMargin:"左边距",rightMargin:"右边距",topMargin:"上边距",bottomMargin:"下边距",sizeUnit:"厘米",noEmpty:"不能为空"}},split:{resize:"拖动改变大小"},searchHelper:{text:"搜索帮助",orderIndex:"序号",rangeStartTip:"起始位置不能大于结束位置",rangeEndTip:"结束位置不能小于起始位置"},tour:{prevStep:"上一步",nextStep:"下一步",finish:"结束引导"},guideTracker:{addButton:"添 加",editButton:"保 存",closeButton:"关 闭",finishButton:"结束并保存",label:"新手引导录入",currentStep:"当前步骤:"},table:{config:{selectionText:"选择",summaryText:"合计",copyText:"复制",emptyText:"暂无数据..."},alert:{total:"共 {total} 条",selected:"已选择 {total} 项",clear:"清空"},selection:{all:"全选所有",invert:"反选所有",clear:"清空所有",currentPage:"当前页全选"},columnFilter:{text:"列定义",reset:"重置",draggable:"拖动排序",fixedLeft:"固定左侧",fixedRight:"固定右侧",cancelFixed:"取消固定"},editable:{inputPlaceholder:"请输入",selectPlaceholder:"请选择",datePlaceholder:"选择日期",datetimePlaceholder:"选择时间"},sorter:{text:"排序",asc:"升序",desc:"降序"},filter:{search:"搜 索",reset:"重 置",searchText:"搜索{text}",searchAreaText:"搜索{text},用逗号隔开",gtPlaceholder:"大于",ltPlaceholder:"小于",eqPlaceholder:"等于",neqPlaceholder:"不等于",text:"筛选",nullValue:"空值"},screen:{full:"全屏",cancelFull:"取消全屏"},import:{text:"导 入",textNoSpace:"导入",success:"成功导入 {total} 条记录",error:"导入失败,请检查字段名和数据格式是否正确",settingTitle:"导入设置",importType:"导入模式",insertPos:"插入位置",fillText:"新增",addText:"追加",insertText:"插入"},export:{text:"导 出",textNoSpace:"导出",closeButton:"关 闭",settingTitle:"导出设置",fileName:"文件名",fileType:"文件类型",sheetName:"标题",all:"全部",selected:"选中",custom:"自定义",footSummation:"底部合计",useStyle:"使用样式",warnText:"暂无表格数据或正在导出"},clipboard:{text:"粘 贴",textNoSpace:"粘贴",success:"成功粘贴 {total} 条记录",settingTitle:"粘贴设置",rowIndex:"粘贴起始行",colIndex:"粘贴起始列",content:"粘贴内容",placeholder:"请在此处 ctrl+v 粘贴数据",supportText:"说明:只支持粘贴 Excel 数据"},areaSelect:{mergeCell:"合并单元格",cancelMerge:"取消合并"},print:{text:"打印"},refresh:{text:"刷新"},toolbox:{text:"工具箱"},selectCollection:{text:"行选集合",settingTitle:"行选列表",closeButton:"关 闭"},groupSummary:{text:"汇总",settingTitle:"汇总设置",savedSetting:"保存的汇总设置",saveButton:"保 存",closeButton:"关 闭",confirmButton:"显示汇总",removeText:"移除",configText:"配置名称",resultText:"汇总结果",sumText:"列值汇总",maxText:"列最大值",minText:"列最小值",avgText:"列平均值",countText:"条数汇总",operation:"操作",index:"序号",groupItem:"分组项",summaryColumn:"汇总列",calcFormula:"计算公式"},highSearch:{text:"高级检索",settingTitle:"高级检索设置",searchButton:"开始检索",closeButton:"关 闭",removeText:"移除",andText:"并且",orText:"或者",gtText:"大于",ltText:"小于",gteText:"大于等于",lteText:"小于等于",eqText:"等于",neqText:"不等于",inText:"包含",ninText:"不包含",likeText:"模糊匹配",nullText:"空值",configText:"配置名称",saveButton:"保 存",savedSetting:"保存的高级检索设置",operation:"操作",bracket:"括号",fieldName:"字段名",fieldType:"字段类型",expression:"运算",condition:"条件值",logic:"逻辑",noEmpty:"字段名不能为空"},fastSearch:{text:"数据定位查找",settingTitle:"数据定位查找设置",closeButton:"关 闭",savedSetting:"保存的数据查找设置",queryCondition:"请输入查询条件",notMatch:"没有符合条件的记录!",toTheEnd:"已查找到表格末尾,是否从头开始查找?",toStart:"已查找到表格开始,是否从末尾开始查找",matchCase:"大小写匹配",matchFullchar:"全字符匹配",queryLabel:"查找内容",queryPrev:"查找上一个",queryNext:"查找下一个",queryAll:"查找全部",findTotal:"查找到 {total} 个单元格",cellText:"单元格",valText:"值"},pivotGrid:{text:"多维表",settingTitle:"多维表看板"}},pivotGrid:{saved:{text:"配置",add:"添加配置项",title:"已保存的配置信息"},export:{text:"导出",group:"导出分组",list:"导出列表"},count:{statistic:"统计",records:"记录数",unique:"唯一值",empty:"空值",notEmpty:"非空值",sum:"合计值",max:"最大值",min:"最小值",avg:"平均值"},field:{text:"字段管理",title:"字段自定义设置"},fillColor:{text:"填色",add:"添加条件",title:"设置填色条件",cell:"单元格",row:"整行",col:"整列"},filter:{text:"筛选",title:"设置筛选条件",matchAll:"满足所有条件",matchAny:"满足任一条件"},group:{text:"分组",title:"设置分组条件",foldAll:"折叠所有",unfoldAll:"展开所有",empty:"(内容为空)",ascend:"选项顺序",descend:"选项倒序"},lineHeight:{text:"行高",size:["常规","中等","高"]},search:{text:"查找",title:"设置查找条件"},sorter:{text:"排序",title:"设置排序条件",ascend:"字段升序",descend:"字段降序"},viewMode:{table:"表格视图",gantt:"甘特视图",card:"看板视图"}}}};let cn=sn;function dn(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,n)=>t[n])):e}const un=(...e)=>{const[t,n]=e;let r;const i=t.split(".");let l=cn;for(let e=0,t=i.length;e<t;e++){if(r=l[i[e]],e===t-1)return dn(r,n);if(!r)return"";l=r}return""},pn=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((n,r)=>(n[r]=void 0!==t[r]?t[r]:e[r],n)),{})),mn=(t,n)=>{const r=e.useRef(!0);e.useLayoutEffect((()=>t(r.current)),n),e.useLayoutEffect((()=>(r.current=!1,()=>{r.current=!0})),[])};function hn(e,t){mn((t=>{if(!t)return e()}),t)}m.extend(h),m.extend(f),m.extend(g),m.extend(v),m.extend(y),m.extend(b);var fn={},gn=[];function vn(e,t){if(!e&&void 0!==console){var n=gn.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);n&&console.error("Warning: ".concat(n))}}function yn(e,t){if(!e&&void 0!==console){var n=gn.reduce((function(e,t){return t(null!=e?e:"","note")}),t);n&&console.warn("Note: ".concat(n))}}function bn(e,t,n){t||fn[n]||(e(!1,n),fn[n]=!0)}function xn(e,t){bn(vn,e,t)}function En(e,t){bn(yn,e,t)}xn.preMessage=function(e){gn.push(e)},xn.resetWarned=function(){fn={}},xn.noteOnce=En,m.extend(g),m.extend(f),m.extend(b),m.extend(h),m.extend(y),m.extend(ee),m.extend((function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=(e||"").replace("Wo","wo");return r.bind(this)(t)}}));var wn={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},Cn=function(e){return wn[e]||e.split("_")[0]},Sn=function(){En(!1,"Not match any format. Please help to fire a issue about this.")},Nn={getNow:function(){return m()},getFixedDate:function(e){return m(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return m().locale(Cn(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(Cn(e)).weekday(0)},getWeek:function(e,t){return t.locale(Cn(e)).week()},getShortWeekDays:function(e){return m().locale(Cn(e)).localeData().weekdaysMin()},getShortMonths:function(e){return m().locale(Cn(e)).localeData().monthsShort()},format:function(e,t,n){return t.locale(Cn(e)).format(n)},parse:function(e,t,n){for(var r=Cn(e),i=0;i<n.length;i+=1){var l=n[i],a=t;if(l.includes("wo")||l.includes("Wo")){for(var o=a.split("-")[0],s=a.split("-")[1],c=m(o,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var u=c.add(d,"week");if(u.format("Wo")===s)return u}return Sn(),null}var p=m(a,l).locale(r);if(p.isValid())return p}return t&&Sn(),null}}};const Tn=te(Nn),In=ne(Nn);function Rn(){return Rn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rn.apply(null,arguments)}const On=e.forwardRef(((t,n)=>e.createElement(In,Rn({},t,{picker:"time",mode:void 0,ref:n}))));On.displayName="TimePicker";const kn=e.forwardRef(((t,n)=>e.createElement(In.RangePicker,Rn({},t,{picker:"time",mode:void 0,ref:n}))));kn.displayName="RangePicker",On.RangePicker=kn;var Ln={name:"en",qm:{button:{confirmPrompt:"Prompt",confirmTitle:"Are you sure you want to delete it?",shortcutKey:"Shortcut Key"},divider:{collect:"Collapse",spread:"Expand"},dialog:{fullScreen:"Full Screen",cancelFullScreen:"Cancel Full Screen",close:"Close",confirm:"Confirm",cancel:"Cancel"},form:{search:"Search",reset:"Reset",save:"Save",spread:"Expand",collect:"Collapse",trueText:"Yes",falseText:"No",draggable:"Drag and sort",requiredTips:" is required",searchHelperTips:"Search Helper is loading value",inputPlaceholder:"Please enter...",selectPlaceholder:"Please select...",treePlaceholder:"Tree node filter",rangeInputNumberPlaceholder:["Start value","End value"],rangeSearchHelper:["Start","End"],datePlaceholder:"Select date",timePlaceholder:"Select time",weekPlaceholder:"Select week",monthPlaceholder:"Select month",quarterPlaceholder:"Select quarter",yearPlaceholder:"Select year",daterangePlaceholder:["Start date","End date"],timerangePlaceholder:["Start time","End time"],monthrangePlaceholder:["Start month","End month"],yearrangePlaceholder:["Start year","End year"],datePickers:["Today","Yesterday","A Week Ago","A Month Ago"],dateRangePickers:["Nearly A Week","Nearly A Month","Nearly Three Months","Nearly Six Months"],citySelectType:["Province","City"],regionSelectLabel:["Province","City","Region","Street"],validatePrompt:"Form validation tips"},clipboard:{success:"Copy successful",error:"Copy failed"},download:{text:"Download",success:"File downloaded successfully",error:"File download failed!"},upload:{tooltip:"Can only upload {type} format",notType:"Unsupported file types {type}",sizeLimit:"Size cannot exceed {size}M",countLimit:"Quantity cannot exceed {count}",uploadError:"Failed to upload files!",downError:"File download failed!",text:"click and upload",remove:"Delete files",batchDownload:"Batch download"},uploadCropper:{dragableText:"Drop or click",pasteText:"Ctrl+V Paste",tooltip:"Can only upload {type} format",preview:"Preview image",cropper:"Cropper image",uploadError:"Failed to upload images!",downError:"Image download failed!",text:"Upload image",zoomIn:"Zoom in",zoomOut:"Zoom out",rotatePlus:"Rotate plus",rotateSubtract:"Rotate subtract"},print:{preview:"Print preview",pageSetting:"Page setting",printError:"Print failed!",exportError:"Export failed!",defaultPrinter:"Default printer",laserPrinter:"Laser printer",stylusPrinter:"Stylus printer",printer:"Printer",type:"Type",copies:"Copies",printPage:["Print","page"],setting:"Setting",export:"Export",print:"Print",scale:"Scale",paper:"Paper",pageNumber:"Number",pagination:"{currentPage} / {totalPage} page",setPanel:{printParameter:"Print parameter",pagerType:"Pager type",carbonPaper:"Triple carbon paper(stylus)",printDirection:"Print direction",vertical:"Vertical",horizontal:"Horizontal",doublePrint:"Double print",autoDoublePrint:"Auto double print",manualDoublePrint:"Manual double print",fixedLogo:"Fixed Logo",printMargin:"Print margin",leftMargin:"Left margin",rightMargin:"Light margin",topMargin:"Top margin",bottomMargin:"Bottom margin",sizeUnit:"cm",noEmpty:"Can not be empty"}},split:{resize:"Drag to change size"},searchHelper:{text:"Search helper",orderIndex:"Index",rangeStartTip:"Start position cannot be greater than end position",rangeEndTip:"End position cannot be less than start position"},tour:{prevStep:"Prev",nextStep:"Next",finish:"Finish"},guideTracker:{addButton:"Add To",editButton:"Save",closeButton:"Close",finishButton:"Finish And Save",label:"Operation guide collection",currentStep:"Current Step: "},table:{config:{selectionText:"#",summaryText:"Summation",copyText:"Copy",emptyText:"No Data..."},alert:{total:"Total {total} items",selected:"Selected {total}",clear:"Clear"},selection:{all:"Select all",invert:"Invert select",clear:"Clear all",currentPage:"Select all on current page"},columnFilter:{text:"Define",reset:"Reset",draggable:"Drag and sort",fixedLeft:"Fixed left",fixedRight:"Fixed right",cancelFixed:"Cancel fixed"},editable:{inputPlaceholder:"Please input",selectPlaceholder:"Please select",datePlaceholder:"Select date",datetimePlaceholder:"Select time"},sorter:{text:"Sort",asc:"Ascending",desc:"Descending"},filter:{search:"Search",reset:"Reset",searchText:"Search {text}",searchAreaText:"Search {text}, separated by commas",gtPlaceholder:"is greater than",ltPlaceholder:"is lesser than",eqPlaceholder:"is equal to",neqPlaceholder:"is not equal to",text:"Filter",nullValue:"Null Value"},screen:{full:"Full Screen",cancelFull:"Cancel Full Screen"},import:{text:"Import",textNoSpace:"Import",success:"Successfully imported {total} records",error:"Import failed, please check that the field name and data format are correct.",settingTitle:"Import setting",importType:"Import type",insertPos:"Insertion position",fillText:"fill",addText:"add",insertText:"insert"},export:{text:"Export",textNoSpace:"Export",closeButton:"Close",settingTitle:"Export setting",fileName:"File name",fileType:"File type",sheetName:"Title",all:"All",selected:"Selected",custom:"Custom",footSummation:"Summation",useStyle:"Use style",warnText:"No table data or exporting"},clipboard:{text:"Paste",textNoSpace:"Paste",success:"Successfully paste {total} records",settingTitle:"Paste setting",rowIndex:"Start row index",colIndex:"Start col index",content:"content",placeholder:"Please paste data here with ctrl+v",supportText:"Note: only excel data can be pasted"},areaSelect:{mergeCell:"Cell Merge",cancelMerge:"Cancel Merge"},print:{text:"Print"},refresh:{text:"Reload"},toolbox:{text:"Tool box"},selectCollection:{text:"Selected row collection",settingTitle:"Selected row list",closeButton:"Close"},groupSummary:{text:"Summary",settingTitle:"Summary setting",savedSetting:"Saved configuration",saveButton:"Save",closeButton:"Close",confirmButton:"Show summary",removeText:"Remove",configText:"Configuration name",resultText:"Summary result",sumText:"column value summary",maxText:"column max value",minText:"column min value",avgText:"column avg value",countText:"records summary",operation:"Operation",index:"Index",groupItem:"Group item",summaryColumn:"Summary column",calcFormula:"Calculate formula"},highSearch:{text:"Super search",settingTitle:"Super search setting",searchButton:"Start search",closeButton:"Close",removeText:"Remove",andText:"and",orText:"or",gtText:"is greater than",ltText:"is lesser than",gteText:"is equal or greater than",lteText:"is equal or lesser than",eqText:"is equal to",neqText:"is not equal to",inText:"include",ninText:"not include",likeText:"fuzzy matching",nullText:"null value",configText:"Configuration name",saveButton:"Save",savedSetting:"Saved configuration",operation:"Operation",bracket:"Bracket",fieldName:"Field name",fieldType:"Field type",expression:"Expression",condition:"Condition value",logic:"Logic",noEmpty:"Can not be empty"},fastSearch:{text:"Records location search",settingTitle:"Records location search setting",closeButton:"Close",savedSetting:"Saved configuration",queryCondition:"Please enter query condition",notMatch:"There are no qualified records!",toTheEnd:"It has been found to the end. Do you want to find it from the beginning?",toStart:"The start has been found. Do you want to start from the end?",matchCase:"Case matching",matchFullchar:"Full character matching",queryLabel:"Find content",queryPrev:"Find previous",queryNext:"Find next",queryAll:"Find all",findTotal:"Found {total} cells",cellText:"Cell",valText:"Value"},pivotGrid:{text:"Pivot Grid",settingTitle:"Pivot Grid Dashboard"}},pivotGrid:{saved:{text:"Config",add:"Add configuration",title:"Saved configuration list"},export:{text:"Export",group:"Export group",list:"Export list"},count:{statistic:"Statistics",records:"count",unique:"unique",empty:"empty",notEmpty:"not empty",sum:"sum value",max:"max value",min:"min value",avg:"avg value"},field:{text:"Field manage",title:"Field customization settings"},fillColor:{text:"Fill color",add:"Add condition",title:"Set fill color conditions",cell:"Cell",row:"Row",col:"Col"},filter:{text:"Filter",title:"Set filter conditions",matchAll:"Meet all conditions",matchAny:"Meet any conditions"},group:{text:"Group",title:"Set group conditions",foldAll:"Fold all",unfoldAll:"unfold all",empty:"(Empty content)",ascend:"Order ascend",descend:"Order descend"},lineHeight:{text:"Line height",size:["Common size","Middle size","Large size"]},search:{text:"Search",title:"Set search conditions"},sorter:{text:"Sorter",title:"Set sorter conditions",ascend:"Field ascend",descend:"Field descend"},viewMode:{table:"Table view",gantt:"Gantt view",card:"Card view"}}}};const An={[Ln.name]:{qm:Ln,antd:ie},[sn.name]:{qm:sn,antd:re}},Pn=e=>{const n=pn({locale:"zh-cn",size:"middle"},e),{locale:r,size:i,global:l}=n;t.useMemo((()=>{return e=Object.assign({},An,null==l?void 0:l.langPackage)[r].qm,cn=e||cn,void(cn.name&&m.locale(cn.name));var e}),[r]);const a=t.useMemo((()=>Object.assign({},An,null==l?void 0:l.langPackage)),[l]),[o,s]=t.useState({locale:r,size:i,global:l});return hn((()=>{s((e=>Object.assign({},e,{locale:r,size:i})))}),[i,r]),t.createElement(on.Provider,{value:o},t.createElement(x,{locale:a[o.locale].antd,componentSize:o.size,autoInsertSpaceInButton:null==l?void 0:l.autoInsertSpaceInButton},n.children))};function _n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function Dn(e,t,n,r){var i,l=arguments.length,a=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(l<3?i(a):l>3?i(t,n,a):i(t,n))||a);return l>3&&a&&Object.defineProperty(t,n,a),a}function Hn(e,t,n,r){return new(n||(n=Promise))((function(i,l){function a(e){try{s(r.next(e))}catch(e){l(e)}}function o(e){try{s(r.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}s((r=r.apply(e,t||[])).next())}))}function Fn(){const{locale:t}=e.useContext(on);return{t:un,$locale:t}}function Mn(t){const n=e.useRef();n.current=t;return e.useCallback(((...e)=>{var t;return null===(t=n.current)||void 0===t?void 0:t.call(n,...e)}),[])}function $n(t){const{size:n}=e.useContext(on);return{$size:e.useMemo((()=>{var e,r;return null!==(r=null!==(e=t.size)&&void 0!==e?e:n)&&void 0!==r?r:""}),[t.size,n])}}Pn.displayName="QmConfigProvider";var qn="undefined"==typeof window;const jn=e=>t.isValidElement(e),Kn=e=>jn(e)&&e.type===t.Fragment,Vn=()=>{},zn=()=>!0,Wn=e=>Hn(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),Bn=e=>{Promise.resolve().then(e)},Un=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),Gn=e=>!!(!e&&0!==e||le(e)&&!e.length||ae(e)&&!Object.keys(e).length),Yn=(e,t)=>t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e),Xn=(e,t)=>{const n=Object.assign({},e);for(const e of t)delete n[e];return n};const Qn=(e,t=new WeakMap)=>{if(ae(e)||le(e)){const n=Array.isArray(e),r=n?[]:{};if(t.get(e))return e;t.set(e,r);const i=n?void 0:Object.keys(e);return function(e,t){let n=-1;const r=e.length;for(;++n<r;)t(e[n],n)}(i||e,((n,l)=>{i&&(l=n),r[l]=Qn(e[l],t)})),r}return e},Zn=e=>oe(e)?`${e}px`:e.toString();class Jn extends Error{constructor(e){super(e),this.name="QmDesignError"}}function er(e,t){throw new Jn(`[${e}] ${t}`)}function tr(e,t){console.warn(new Jn(`[${e}] ${t}`))}const nr=e=>{const{loading:n,shortcutKey:r,authConfig:i,click:l,confirm:a}=e,{t:o}=Fn(),{$size:s}=$n(e);t.useEffect((()=>(r&&document.addEventListener("keyup",u),()=>document.removeEventListener("keyup",u))),[]);const[c,d]=t.useState(!1),u=Mn((e=>{var t;const n=r.split("+").map((e=>e.trim().toLowerCase())),i=n.includes("alt"),l=n.includes("ctrl"),a=n.includes("shift"),o=n[n.length-1];i&&!e.altKey||l&&!e.ctrlKey||a&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),m.disabled||null===(t=m.onClick)||void 0===t||t.call(m,e))})),p=se(l)?{onClick:t=>Hn(void 0,void 0,void 0,(function*(){var n;d(!0);try{yield null===(n=e.click)||void 0===n?void 0:n.call(e,t)}catch(e){tr("Button","`click`方法执行出错")}d(!1)}))}:null,m=Object.assign(Object.assign(Object.assign({},Xn(e,["shortcutKey","authConfig","click","confirm"])),{size:s,loading:c||n||!1}),p);if(i){const{visible:e=1,disabled:t}=i||{};if(!e)return null;t&&(m.disabled=!0)}const h=t.createElement(E,m,e.children);return a?t.createElement(C,{title:a.title||o("qm.button.confirmTitle"),disabled:m.disabled,onConfirm:e=>{var t,n;null===(t=a.onConfirm)||void 0===t||t.call(a),null===(n=m.onClick)||void 0===n||n.call(m,e)},onCancel:e=>{var t;null===(t=a.onCancel)||void 0===t||t.call(a,e)}},t.createElement(E,Rn({},m,{onClick:Vn}),e.children)):!r||m.disabled?h:t.createElement(w,{placement:"top",title:`${o("qm.button.shortcutKey")}: ${r}`},h)};var rr;nr.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(rr||(rr={}));const ir=e=>{const{$size:n}=$n(e),r=oe(e.size)?e.size:rr[n||"default"],i=Object.assign(Object.assign({},Xn(e,["size"])),{size:r});return t.createElement(S,i,e.children)};ir.displayName="QmSpace";const lr=e=>`qm-${e}`,ar=e=>{const{label:n,extra:r,collapse:i,bordered:l=!0,disabled:a,id:o,className:s,style:c,onCollapseChange:d}=e,{$size:u}=$n(e),{t:p}=Fn(),m=lr("divider"),h={[m]:!0,[`${m}-borderless`]:!l,[`${m}--lg`]:"large"===u,[`${m}--sm`]:"small"===u};return t.createElement("div",{id:o,className:Pe(h,s),style:c},t.createElement("span",{className:`${m}__title`},n),t.createElement("div",{className:`${m}__extra`},r),void 0!==i&&t.createElement(E,{type:"link",className:`${m}__collapse`,disabled:a,onClick:()=>{null==d||d(!i)}},p(i?"qm.divider.collect":"qm.divider.spread"),i?t.createElement(_e,null):t.createElement(De,null)))};ar.displayName="QmDivider";const or=()=>({height:0,opacity:0}),sr=e=>({height:e.scrollHeight,opacity:1}),cr=e=>({height:e?e.offsetHeight:0}),dr=(e,t)=>!0===(null==t?void 0:t.deadline)||"height"===t.propertyName;function ur(e){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ur(e)}function pr(e){var t=function(e,t){if("object"!==ur(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==ur(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ur(t)?t:String(t)}function mr(e,t,n){return(t=pr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hr(Object(n),!0).forEach((function(t){mr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,l,a,o=[],s=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=l.call(n)).done)&&(o.push(r.value),o.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yr(e){return e instanceof HTMLElement||e instanceof SVGElement}function br(e){var n,r=function(e){return e&&"object"===ur(e)&&yr(e.nativeElement)?e.nativeElement:yr(e)?e:null}(e);return r||(e instanceof t.Component?null===(n=Ft.findDOMNode)||void 0===n?void 0:n.call(Ft,e):null)}var xr,Er={exports:{}},wr={};Er.exports=(xr||(xr=1,function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function f(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var f=e.type;switch(f){case r:case l:case i:case d:case u:return f;default:var g=f&&f.$$typeof;switch(g){case s:case o:case c:case m:case p:case a:return g;default:return h}}case n:return h}}}e=Symbol.for("react.module.reference");var g=o,v=a,y=t,b=c,x=r,E=m,w=p,C=n,S=l,N=i,T=d,I=u,R=!1,O=!1;wr.ContextConsumer=g,wr.ContextProvider=v,wr.Element=y,wr.ForwardRef=b,wr.Fragment=x,wr.Lazy=E,wr.Memo=w,wr.Portal=C,wr.Profiler=S,wr.StrictMode=N,wr.Suspense=T,wr.SuspenseList=I,wr.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},wr.isConcurrentMode=function(e){return O||(O=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},wr.isContextConsumer=function(e){return f(e)===o},wr.isContextProvider=function(e){return f(e)===a},wr.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},wr.isForwardRef=function(e){return f(e)===c},wr.isFragment=function(e){return f(e)===r},wr.isLazy=function(e){return f(e)===m},wr.isMemo=function(e){return f(e)===p},wr.isPortal=function(e){return f(e)===n},wr.isProfiler=function(e){return f(e)===l},wr.isStrictMode=function(e){return f(e)===i},wr.isSuspense=function(e){return f(e)===d},wr.isSuspenseList=function(e){return f(e)===u},wr.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===l||t===i||t===d||t===u||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===m||t.$$typeof===p||t.$$typeof===a||t.$$typeof===o||t.$$typeof===c||t.$$typeof===e||void 0!==t.getModuleId)},wr.typeOf=f}()),wr);var Cr=function(e,t){"function"==typeof e?e(t):"object"===ur(e)&&e&&"current"in e&&(e.current=t)},Sr=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.filter(Boolean);return r.length<=1?r[0]:function(e){t.forEach((function(t){Cr(t,e)}))}},Nr=function(e){var t,n,r=Er.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof r||null!==(t=r.prototype)&&void 0!==t&&t.render||r.$$typeof===Er.exports.ForwardRef)&&!!("function"!=typeof e||null!==(n=e.prototype)&&void 0!==n&&n.render||e.$$typeof===Er.exports.ForwardRef)};function Tr(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}Number(r.split(".")[0]);var Ir=e.createContext({});function Rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pr(r.key),r)}}function kr(e,t,n){return t&&Or(e.prototype,t),n&&Or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}function Ar(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lr(e,t)}function Pr(e){return Pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pr(e)}function _r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Pr(e);if(t){var i=Pr(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===ur(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _r(e)}(this,n)}}var Hr=function(t){Ar(r,e.Component);var n=Dr(r);function r(){return Rr(this,r),n.apply(this,arguments)}return kr(r,[{key:"render",value:function(){return this.props.children}}]),r}();function Fr(t){var n=e.useRef(!1),r=vr(e.useState(t),2),i=r[0],l=r[1];return e.useEffect((function(){return n.current=!1,function(){n.current=!0}}),[]),[i,function(e,t){t&&n.current||l(e)}]}var Mr="none",$r="appear",qr="enter",jr="leave",Kr="none",Vr="prepare",zr="start",Wr="active",Br="end",Ur="prepared";function Gr(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var Xr,Qr,Zr,Jr=(Xr=Gr(),Qr="undefined"!=typeof window?window:{},Zr={animationend:Yr("Animation","AnimationEnd"),transitionend:Yr("Transition","TransitionEnd")},Xr&&("AnimationEvent"in Qr||delete Zr.animationend.animation,"TransitionEvent"in Qr||delete Zr.transitionend.transition),Zr),ei={};if(Gr()){var ti=document.createElement("div");ei=ti.style}var ni={};function ri(e){if(ni[e])return ni[e];var t=Jr[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i<r;i+=1){var l=n[i];if(Object.prototype.hasOwnProperty.call(t,l)&&l in ei)return ni[e]=t[l],ni[e]}return""}var ii=ri("animationend"),li=ri("transitionend"),ai=!(!ii||!li),oi=ii||"animationend",si=li||"transitionend";function ci(e,t){return e?"object"===ur(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var di=function(t){var n=l(),r=l(t);r.current=t;var i=e.useCallback((function(e){r.current(e)}),[]);function a(e){e&&(e.removeEventListener(si,i),e.removeEventListener(oi,i))}return e.useEffect((function(){return function(){a(n.current)}}),[]),[function(e){n.current&&n.current!==e&&a(n.current),e&&e!==n.current&&(e.addEventListener(si,i),e.addEventListener(oi,i),n.current=e)},a]},ui=Gr()?a:o,pi=function(e){return+setTimeout(e,16)},mi=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(pi=function(e){return window.requestAnimationFrame(e)},mi=function(e){return window.cancelAnimationFrame(e)});var hi=0,fi=new Map;function gi(e){fi.delete(e)}var vi=function(e){var t=hi+=1;return function n(r){if(0===r)gi(t),e();else{var i=pi((function(){n(r-1)}));fi.set(t,i)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};vi.cancel=function(e){var t=fi.get(e);return gi(e),mi(t)},vi.ids=function(){return fi};var yi=[Vr,zr,Wr,Br],bi=[Vr,Ur],xi=!1,Ei=!0;function wi(e){return e===Wr||e===Br}var Ci=function(t,n,r){var i=vr(Fr(Kr),2),l=i[0],a=i[1],o=function(){var t=e.useRef(null);function n(){vi.cancel(t.current)}return e.useEffect((function(){return function(){n()}}),[]),[function e(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n();var l=vi((function(){i<=1?r({isCanceled:function(){return l!==t.current}}):e(r,i-1)}));t.current=l},n]}(),s=vr(o,2),c=s[0],d=s[1];var u=n?bi:yi;return ui((function(){if(l!==Kr&&l!==Br){var e=u.indexOf(l),t=u[e+1],n=r(l);n===xi?a(t,!0):t&&c((function(e){function r(){e.isCanceled()||a(t,!0)}!0===n?r():Promise.resolve(n).then(r)}))}}),[t,l]),e.useEffect((function(){return function(){d()}}),[]),[function(){a(Vr,!0)},l]};var Si=function(t){var n=t;"object"===ur(t)&&(n=t.transitionSupport);var r=e.forwardRef((function(t,r){var i=t.visible,a=void 0===i||i,s=t.removeOnLeave,c=void 0===s||s,d=t.forceRender,u=t.children,p=t.motionName,m=t.leavedClassName,h=t.eventProps,f=function(e,t){return!(!e.motionName||!n||!1===t)}(t,e.useContext(Ir).motion),g=l(),v=l();var y=function(t,n,r,i){var a=i.motionEnter,s=void 0===a||a,c=i.motionAppear,d=void 0===c||c,u=i.motionLeave,p=void 0===u||u,m=i.motionDeadline,h=i.motionLeaveImmediately,f=i.onAppearPrepare,g=i.onEnterPrepare,v=i.onLeavePrepare,y=i.onAppearStart,b=i.onEnterStart,x=i.onLeaveStart,E=i.onAppearActive,w=i.onEnterActive,C=i.onLeaveActive,S=i.onAppearEnd,N=i.onEnterEnd,T=i.onLeaveEnd,I=i.onVisibleChanged,R=vr(Fr(),2),O=R[0],k=R[1],L=vr(Fr(Mr),2),A=L[0],P=L[1],_=vr(Fr(null),2),D=_[0],H=_[1],F=l(!1),M=l(null);function $(){return r()}var q=l(!1);function j(){P(Mr,!0),H(null,!0)}function K(e){var t=$();if(!e||e.deadline||e.target===t){var n,r=q.current;A===$r&&r?n=null==S?void 0:S(t,e):A===qr&&r?n=null==N?void 0:N(t,e):A===jr&&r&&(n=null==T?void 0:T(t,e)),A!==Mr&&r&&!1!==n&&j()}}var V=vr(di(K),1)[0],z=function(e){var t,n,r;switch(e){case $r:return mr(t={},Vr,f),mr(t,zr,y),mr(t,Wr,E),t;case qr:return mr(n={},Vr,g),mr(n,zr,b),mr(n,Wr,w),n;case jr:return mr(r={},Vr,v),mr(r,zr,x),mr(r,Wr,C),r;default:return{}}},W=e.useMemo((function(){return z(A)}),[A]),B=vr(Ci(A,!t,(function(e){if(e===Vr){var t=W[Vr];return t?t($()):xi}var n;return G in W&&H((null===(n=W[G])||void 0===n?void 0:n.call(W,$(),null))||null),G===Wr&&(V($()),m>0&&(clearTimeout(M.current),M.current=setTimeout((function(){K({deadline:!0})}),m))),G===Ur&&j(),Ei})),2),U=B[0],G=B[1],Y=wi(G);q.current=Y,ui((function(){k(n);var e,r=F.current;F.current=!0,!r&&n&&d&&(e=$r),r&&n&&s&&(e=qr),(r&&!n&&p||!r&&h&&!n&&p)&&(e=jr);var i=z(e);e&&(t||i[Vr])?(P(e),U()):P(Mr)}),[n]),o((function(){(A===$r&&!d||A===qr&&!s||A===jr&&!p)&&P(Mr)}),[d,s,p]),o((function(){return function(){F.current=!1,clearTimeout(M.current)}}),[]);var X=e.useRef(!1);o((function(){O&&(X.current=!0),void 0!==O&&A===Mr&&((X.current||O)&&(null==I||I(O)),X.current=!0)}),[O,A]);var Q=D;return W[Vr]&&G===zr&&(Q=fr({transition:"none"},Q)),[A,G,Q,null!=O?O:n]}(f,a,(function(){try{return g.current instanceof HTMLElement?g.current:br(v.current)}catch(e){return null}}),t),b=vr(y,4),x=b[0],E=b[1],w=b[2],C=b[3],S=e.useRef(C);C&&(S.current=!0);var N,T=e.useCallback((function(e){g.current=e,Cr(r,e)}),[r]),I=fr(fr({},h),{},{visible:a});if(u)if(x===Mr)N=C?u(fr({},I),T):!c&&S.current&&m?u(fr(fr({},I),{},{className:m}),T):d||!c&&!m?u(fr(fr({},I),{},{style:{display:"none"}}),T):null;else{var R,O;E===Vr?O="prepare":wi(E)?O="active":E===zr&&(O="start");var k=ci(p,"".concat(x,"-").concat(O));N=u(fr(fr({},I),{},{className:Pe(ci(p,x),(R={},mr(R,k,k&&O),mr(R,p,"string"==typeof p),R)),style:w}),T)}else N=null;e.isValidElement(N)&&Nr(N)&&(N.ref||(N=e.cloneElement(N,{ref:T})));return e.createElement(Hr,{ref:v},N)}));return r.displayName="CSSMotion",r}(ai);function Ni(){return Ni=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},Ni.apply(this,arguments)}var Ti="add",Ii="keep",Ri="remove",Oi="removed";function ki(e){var t;return fr(fr({},t=e&&"object"===ur(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Li(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(ki)}var Ai=["component","children","onVisibleChanged","onAllRemoved"],Pi=["status"],_i=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Si,r=function(t){Ar(i,e.Component);var r=Dr(i);function i(){var e;Rr(this,i);for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];return mr(_r(e=r.call.apply(r,[this].concat(n))),"state",{keyEntities:[]}),mr(_r(e),"removeKey",(function(t){var n=e.state.keyEntities.map((function(e){return e.key!==t?e:fr(fr({},e),{},{status:Oi})}));return e.setState({keyEntities:n}),n.filter((function(e){return e.status!==Oi})).length})),e}return kr(i,[{key:"render",value:function(){var t=this,r=this.state.keyEntities,i=this.props,l=i.component,a=i.children,o=i.onVisibleChanged,s=i.onAllRemoved,c=Tr(i,Ai),d=l||e.Fragment,u={};return _i.forEach((function(e){u[e]=c[e],delete c[e]})),delete c.keys,e.createElement(d,c,r.map((function(r){var i=r.status,l=Tr(r,Pi),c=i===Ti||i===Ii;return e.createElement(n,Ni({},u,{key:l.key,visible:c,eventProps:l,onVisibleChanged:function(e){(null==o||o(e,{key:l.key}),e)||0===t.removeKey(l.key)&&s&&s()}}),a)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.keys,r=t.keyEntities,i=Li(n),l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,l=Li(e),a=Li(t);l.forEach((function(e){for(var t=!1,l=r;l<i;l+=1){var o=a[l];if(o.key===e.key){r<l&&(n=n.concat(a.slice(r,l).map((function(e){return fr(fr({},e),{},{status:Ti})}))),r=l),n.push(fr(fr({},o),{},{status:Ii})),r+=1,t=!0;break}}t||n.push(fr(fr({},e),{},{status:Ri}))})),r<i&&(n=n.concat(a.slice(r).map((function(e){return fr(fr({},e),{},{status:Ti})}))));var o={};return n.forEach((function(e){var t=e.key;o[t]=(o[t]||0)+1})),Object.keys(o).filter((function(e){return o[e]>1})).forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Ri}))).forEach((function(t){t.key===e&&(t.status=Ii)}))})),n}(r,i);return{keyEntities:l.filter((function(e){var t=r.find((function(t){var n=t.key;return e.key===n}));return!t||t.status!==Oi||e.status!==Ri}))}}}]),i}();mr(r,"defaultProps",{component:"div"})}(ai);const Di=t.forwardRef(((e,n)=>{const{forceRender:r,className:i,style:l,boxStyle:a,isActive:o}=e,[s,c]=t.useState(o||r);if(t.useEffect((()=>{(r||o)&&c(!0)}),[r,o]),!s)return null;const d=lr("collapse");return t.createElement("div",{ref:n,className:Pe(`${d}-content`,{[`${d}-content-active`]:o,[`${d}-content-inactive`]:!o},i),style:l},t.createElement("div",{className:`${d}-content-box`,style:a},e.children))}));Di.displayName="PanelContent";const Hi=e=>{const{defaultActive:n,label:r,extra:i,className:l,style:a,containerStyle:o,bordered:s,disabled:c,forceRender:d,destroyOnClose:u=!1,onChange:p}=e,[m,h]=t.useState(!!n),f=lr("collapse"),g=Pe({[`${f}`]:!0,[`${f}-active`]:m,[`${f}-disabled`]:c},l);return t.createElement("div",{className:g,style:a},t.createElement(ar,{label:r,extra:i,collapse:m,bordered:s,disabled:c,onCollapseChange:e=>{h(e),null==p||p(e)}}),t.createElement(Si,Rn({visible:m},((e=lr("motion-collapse"))=>({motionName:e,onAppearStart:or,onEnterStart:or,onAppearActive:sr,onEnterActive:sr,onLeaveStart:cr,onLeaveActive:or,onAppearEnd:dr,onEnterEnd:dr,onLeaveEnd:dr,motionDeadline:500}))(),{forceRender:d,removeOnLeave:u}),(({className:n,style:r},i)=>t.createElement(Di,{ref:i,prefixCls:f,className:n,style:r,boxStyle:o,isActive:m,forceRender:d},e.children))))};Hi.displayName="QmCollapse";const Fi=t.createContext(void 0);function Mi(t,n){((t,n)=>{const r=e.useRef(!0);e.useEffect((()=>t(r.current)),n),e.useEffect((()=>(r.current=!1,()=>{r.current=!0})),[])})((e=>{if(!e)return t()}),n)}const $i=(e,t,n)=>{e&&t&&n&&e.addEventListener(t,n,!1)},qi=(e,t,n)=>{e&&t&&n&&e.removeEventListener(t,n,!1)},ji=e=>e.preventDefault(),Ki=(e,t)=>{if(qn||!e||!t)return null;"float"===(t=Un(t))&&(t="cssFloat");try{const n=e.style[t];if(n)return n;const r=window.getComputedStyle(e);return r?r[t]:""}catch(n){return e.style[t]}},Vi=(e,t,n)=>{!qn&&e&&t&&(ae(t)?Object.keys(t).forEach((n=>{Vi(e,n,t[n])})):(t=Un(t),e.style[t]=n))},zi=e=>{let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t},Wi=(e,t)=>Math.abs(zi(e)-zi(t)),Bi=e=>{let t=0,n=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,n+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:n}},Ui=(e,t)=>{var n;let r=e;for(;r;){if(null===(n=r.classList)||void 0===n?void 0:n.contains(t))return r;r=r.parentNode}return null},Gi=(e,t)=>{if(qn||!e||!t)return!1;let n=e;for(;n;){if(n===t)return!0;n=n.parentNode}return!1},Yi=e=>Math.pow(e,3),Xi=e=>e<.5?Yi(2*e)/2:1-Yi(2*(1-e))/2,Qi=e=>{const{minValues:n,onDragChange:r,onDragging:i}=e,{splitRef:l,direction:a}=t.useContext(Fi),{t:o}=Fn(),s=t.useRef(qn?null:document.onselectstart),c=t.useMemo((()=>"horizontal"===a),[a]),d=t.useMemo((()=>c?"X":"Y"),[c]),u=t.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),p=e=>{u.current=Object.assign({},u.current,e)},m=e=>{if(1!==e.buttons)return h();const t=e[`page${d}`]-u.current[`start${d}`],r=[n[0],u.current[`containerSize${d}`]-n[1]];let l=u.current[`firstElementSize${d}`]+t;l=Math.max(r[0],l),l=Math.min(r[1],l),i(l)},h=()=>{p({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),r(!1),qi(document,"mousemove",m),qi(document,"mouseup",h),f()},f=()=>{document.onselectstart!==s.current&&(document.onselectstart=s.current)},g={[`${lr("split")}__resize-bar`]:!0,vertical:"vertical"===a,horizontal:"horizontal"===a};return t.createElement("div",{className:Pe(g),title:o("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=l.current,n=t.children[0];p({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),$i(document,"mousemove",m),$i(document,"mouseup",h),r(!0),s.current=document.onselectstart,document.onselectstart=()=>!1}})};Qi.displayName="ResizeBar";const Zi=t.forwardRef(((e,n)=>{const{offset:r,className:i,style:l}=e,{direction:a,dragging:o}=t.useContext(Fi),s="vertical"===a?"height":"width",c={[lr("split-pane")]:!0,isLocked:o,horizontal:"horizontal"===a,vertical:"vertical"===a,[i]:!!i},d=void 0!==r?{[s]:Zn(r)}:{flex:1,[s]:0};return t.createElement("div",{ref:n,className:Pe(c),style:Object.assign(Object.assign({},d),l)},e.children)}));Zi.displayName="SplitPane";const Ji=e=>{const{direction:n="horizontal",defaultValue:r="50%",uniqueKey:i,className:l,style:a,onDragStart:o,onDrag:s=Vn,onDragEnd:c}=e,{global:d}=t.useContext(on),u=t.useRef(null),p=t.useRef(null),m=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,h=e=>Number.parseInt(e,10),f=e=>{var t;const n=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return n>=0?n:0},g=t.useMemo((()=>i?`split_${i}`:""),[i]),[v,y]=t.useState(!1),[b,x]=t.useState(m(r));Mi((()=>{v?null==o||o(h(b)):(null==c||c(h(b)),localStorage.setItem(g,b),C(g,b))}),[v]),t.useEffect((()=>{E()}),[]);const E=()=>{if(!g)return;const e=localStorage.getItem(g);e?x(m(e)):w(g).then((e=>{localStorage.setItem(g,m(e||r)),E()})).catch((()=>{}))},w=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),C=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),S=t.useMemo((()=>({splitRef:u,direction:n,dragging:v})),[n,v]),N=[];t.Children.map(e.children,(e=>{var t;jn(e)&&!Kn(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const[T,I]=N,R=t.useMemo((()=>[f(T),f(I)]),[T,I]),O={[lr("split")]:!0,vertical:"vertical"===n};return t.createElement(Fi.Provider,{value:S},t.createElement("div",{ref:u,className:Pe(O,l),style:a},t.createElement(Zi,Rn({},T.props,{ref:p,offset:b})),t.createElement(Qi,{minValues:R,onDragChange:e=>y(e),onDragging:e=>{x(`${e}px`),s(e)}}),t.createElement(Zi,I.props)))};Ji.displayName="QmSplit",Ji.Pane=Zi;const el=e=>{const{className:n,style:r}=e,{$size:i}=$n(e),l=lr("countup"),a={[l]:!0,[`${l}--lg`]:"large"===i,[`${l}--sm`]:"small"===i};return t.createElement($t,Rn({},e,{className:Pe(a,n),style:r}),e.children)};el.displayName="QmCountup";const tl=e=>{const{className:n}=e,{$size:r}=$n(e),i=lr("empty"),l=Object.assign(Object.assign({},e),{image:N.PRESENTED_IMAGE_SIMPLE}),a={[i]:!0,[`${i}--lg`]:"large"===r,[`${i}--sm`]:"small"===r};return t.createElement(N,Rn({},l,{className:Pe(a,n)}))};tl.displayName="QmEmpty";const nl=e=>{const n=pn({tip:"Loading..."},e),{fullHeight:r,className:i,style:l}=n,a=lr("spin"),o={[a]:!0,[`${a}-fullHeight`]:!!r},s=Object.assign(Object.assign({wrapperClassName:Pe(o,i)},Xn(n,["fullHeight"])),{style:Object.assign(Object.assign({},l),{maxHeight:"none"})});return t.createElement(T,s,n.children)};nl.displayName="QmSpin";const rl=t.createContext(void 0),il=new Map;const ll=new qt((function(e){e.forEach((e=>{var t;const{target:n}=e;null===(t=il.get(n))||void 0===t||t.forEach((e=>e(n)))}))}));function al(e,t){il.has(e)||(il.set(e,new Set),ll.observe(e)),il.get(e).add(t)}function ol(e,t){il.has(e)&&(il.get(e).delete(t),il.get(e).size||(ll.unobserve(e),il.delete(e)))}function sl(t){const[n,r]=e.useState({width:0,height:0});return e.useLayoutEffect((()=>{const e=t.current,n=e=>{r({width:e.offsetWidth,height:e.offsetHeight})};return e&&al(e,n),()=>{e&&ol(e,n)}}),[t]),n}function cl(t,n){const r=e.useRef(null);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{r.current&&clearTimeout(r.current),r.current=setTimeout((()=>t.apply(this,e)),n)}),[t,n])}const dl=(e,...n)=>t.isValidElement(e)?t.cloneElement(e,...n):null,ul=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],pl=e=>({_s:e,status:ul[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),ml=e=>e?6:5,hl=(e,t,n,r,i)=>{clearTimeout(r.current);const l=pl(e);t(l),n.current=l,null==i||i({current:l})},fl=(e={})=>{const{enter:t=!0,exit:n=!0,preEnter:r,preExit:i,timeout:a,initialEntered:d,mountOnEnter:u,unmountOnExit:p,onStateChange:m}=e||{},[h,f]=s((()=>pl(d?2:ml(u)))),g=l(h),v=l(),[y,b]=(e=>ae(e)?[e.enter,e.exit]:[e,e])(a),x=c((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return ml(t)}})(g.current._s,p);e&&hl(e,f,g,v,m)}),[m,p]),E=c((e=>{const l=e=>{switch(hl(e,f,g,v,m),e){case 1:y>=0&&(v.current=setTimeout(x,y));break;case 4:b>=0&&(v.current=setTimeout(x,b));break;case 0:case 3:v.current=setTimeout((()=>l(e+1)),0)}},a=g.current.isEnter;"boolean"!=typeof e&&(e=!a),e?!a&&l(t?r?0:1:2):a&&l(n?i?3:4:ml(p))}),[x,m,t,n,r,i,y,b,p]);return o((()=>()=>clearTimeout(v.current)),[]),[h,E,x]},gl=e=>{const{name:n,in:r,timeout:i,preEnter:l=!0,preExit:a}=e,[o,s]=fl({timeout:i,preEnter:l,preExit:a,initialEntered:r});return hn((()=>{s()}),[r]),t.createElement(t.Fragment,null,t.Children.map(e.children,(e=>t.isValidElement(e)?dl(e,{className:Pe(e.props.className,n,o.status)}):e)))},vl=6,yl={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",reverse:"width",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",reverse:"height",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},bl=e=>{const{thumb:n,always:r,className:i,barSize:l=vl,direction:a="vertical",onDrag:o=Vn}=e,{dragging:s,scrollbarElement:c,wrapElement:d}=t.useContext(rl),u=yl[a],p=t.useRef(n),m=t.useRef(null),h=t.useRef(null),f=t.useRef({}),g=t.useRef(!1),v=t.useRef(!1),y=t.useRef(qn?null:document.onselectstart),[b,x]=t.useState(!1);t.useLayoutEffect((()=>{p.current=n}),[n]),t.useEffect((()=>{const e=c.current;return $i(e,"mousemove",S),$i(e,"mouseleave",N),()=>{C(),qi(document,"mouseup",w),qi(e,"mousemove",S),qi(e,"mouseleave",N)}}),[]);const E=e=>{if(!m.current||!h.current)return;if(!g.current)return;const t=f.current[u.axis];if(!t)return;const n=100*(-1*(m.current.getBoundingClientRect()[u.direction]-e[u.client])-(h.current[u.offset]-t))/m.current[u.offset];d.current[u.scroll]=n*d.current[u.scrollSize]/100,o(!0)},w=()=>{g.current=!1,f.current={[u.axis]:0},qi(document,"mousemove",E),qi(document,"mouseup",w),C(),v.current&&x(!1),o(!1)},C=()=>{document.onselectstart!==y.current&&(document.onselectstart=y.current)},S=()=>{v.current=!1,x(!!p.current.size)},N=()=>{v.current=!0,x(g.current)},T=lr("scrollbar"),I={[`${T}__bar`]:!0,"is-vertical":"vertical"===a,"is-horizontal":"horizontal"===a},R={[u.reverse]:l},O={[u.size]:n.size,transform:`translate${u.axis}(${n.offset}%)`};return t.createElement(gl,{name:"fade",in:r||s||b,timeout:300},t.createElement("div",{ref:m,className:Pe(I,i),style:R},t.createElement("div",{ref:h,className:`${T}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),$i(document,"mousemove",E),$i(document,"mouseup",w),g.current=!0,y.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(f.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},xl=20,El=t.forwardRef(((e,n)=>{const{wrapClassName:r,wrapStyle:i,innerStyle:l,barWidth:a,always:o,native:s,showTopScrollbar:c,minSize:d=xl,onScroll:u}=e,p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),[f,g]=t.useState({size:0,offset:0,ratio:1}),[v,y]=t.useState({size:0,offset:0,ratio:1}),[b,x]=t.useState(!1),E=sl(p),w=sl(h);hn((()=>{!s&&C()}),[w.width,w.height,E.width,E.height]);const C=cl((()=>{if(!m.current)return;const e=m.current.offsetHeight-4,t=m.current.offsetWidth-4,n=Math.pow(e,2)/m.current.scrollHeight,r=Math.pow(t,2)/m.current.scrollWidth,i=Math.max(n,d),l=Math.max(r,d),a=n/(e-n)/(i/(e-i)),o=r/(t-r)/(l/(t-l)),s=i+4<e?i:0,c=l+4<t?l:0,u=100*m.current.scrollTop/e*a,p=100*m.current.scrollLeft/t*o;g(Object.assign({},f,{size:c,ratio:o,offset:p})),y(Object.assign({},v,{size:s,ratio:a,offset:u}))}),5),S=e=>{x(e)},N=(e,t)=>{oe(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollTop,i=window.requestAnimationFrame,l=()=>{const a=(Date.now()-n)/500;a<1?(e.scrollTop=r+(t-r)*Xi(a),i(l)):e.scrollTop=t};i(l)})(m.current,e):m.current.scrollTop=e:tr("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},T=(e,t)=>{oe(e)?t?((e,t)=>{const n=Date.now(),r=e.scrollLeft,i=window.requestAnimationFrame,l=()=>{const a=(Date.now()-n)/500;a<1?(e.scrollLeft=r+(t-r)*Xi(a),i(l)):e.scrollLeft=t};i(l)})(m.current,e):m.current.scrollLeft=e:tr("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};t.useImperativeHandle(n,(()=>{var e,t;return{container:p.current,scrollTop:(null===(e=m.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=m.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:N,SET_SCROLL_LEFT:T}}));const I=t.useMemo((()=>({dragging:b,scrollbarElement:p,wrapElement:m})),[b]),R=lr("scrollbar"),O={[`${R}__wrap`]:!0,[`${R}__wrap--hidden`]:!s};return t.createElement("div",{ref:p,className:Pe(R,e.className),style:e.style},t.createElement("div",{ref:m,className:Pe(O,r),style:i,onScroll:e=>{const{scrollTop:t,scrollLeft:n}=e.target;!s&&(()=>{if(!m.current)return;const e=m.current.offsetHeight-4,t=m.current.offsetWidth-4,n=100*m.current.scrollTop/e*v.ratio,r=100*m.current.scrollLeft/t*f.ratio;g(Object.assign({},f,{offset:r})),y(Object.assign({},v,{offset:n}))})(),null==u||u({scrollTop:t,scrollLeft:n})}},t.createElement("div",{ref:h,className:`${R}__view`,style:l},e.children)),!s&&t.createElement(rl.Provider,{value:I},c&&t.createElement(bl,{className:"top",direction:"horizontal",thumb:f,barSize:a,always:o,onDrag:S}),t.createElement(bl,{direction:"horizontal",thumb:f,barSize:a,always:o,onDrag:S}),t.createElement(bl,{direction:"vertical",thumb:v,barSize:a,always:o,onDrag:S})))}));El.displayName="QmScrollbar";const wl=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const n=window.URL.createObjectURL(e);let r=document.createElement("a");r.href=n,r.download=decodeURI(t),r.click(),r=null}},Cl=(e,{fileName:t,headers:n,params:r})=>Hn(void 0,void 0,void 0,(function*(){const i=r?new URLSearchParams(r).toString():"",l=i?e.includes("?")?"&":"?":"",a=yield fetch(e+`${l+i}`,{method:"GET",headers:n});if(!a.ok)throw new Error(un("qm.download.error"));const o=yield a.blob(),s=a.headers.get("content-disposition"),c=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));wl(o,c)})),Sl=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},Nl=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},Tl=e=>{var n,r;const i=pn({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:l=[],fileDirection:a="vertical",batchDownload:o,draggable:s,editable:c,disabled:d,readOnly:u,button:p={},className:m,onPreview:h,onSortChange:f,onEditChange:g,onDownload:v,onChange:y}=i,{t:b}=Fn(),{$size:x}=$n(i),w=t.useRef(null),C=t.useRef(null),[S,N]=t.useState({}),T=t.useMemo((()=>d||u),[d,u]);t.useEffect((()=>(A(),()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.destroy()})),[]);const k=(e,t)=>{N((n=>Object.assign({},n,{[e]:null!=t?t:!n[e]})))},L=Mn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...l],[r]=e.splice(t,1);e.splice(n,0,r),null==f||f(e),null==y||y({file:l[t],fileList:e})}})),A=()=>{s&&(C.current=jt.create(Ui(w.current,lr("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:L}))},P=e=>Hn(void 0,void 0,void 0,(function*(){if(v)return void(yield v(e));const{downloadWithHeaders:t,headers:n}=i;try{e.url&&(yield Cl(e.url,Object.assign({fileName:e.name},t?{headers:n}:null)))}catch(e){R.error(b("qm.download.error"))}})),_=lr("upload-file"),D={[_]:!0,[`${_}--lg`]:"large"===x,[`${_}--sm`]:"small"===x,[`${_}--horizontal`]:"horizontal"===a};return t.createElement(I,Rn({className:Pe(D,m)},Xn(i,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((n,r)=>Hn(void 0,void 0,void 0,(function*(){const{fileTypes:l=[],fileSize:a,maxCount:o,fileList:s=[],beforeUpload:c}=i,d=!l.length||l.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!a||e.size/1024/1024<a,p=!(o>1)||s.length<o,m=d&&u&&p;if(d||R.warning(b("qm.upload.tooltip",{type:l.join(",")})),u||R.warning(b("qm.upload.sizeLimit",{size:a})),p||R.warning(b("qm.upload.countLimit",{count:o})),!m)return I.LIST_IGNORE;if(c){const i=c(e,t);if(!0===i)return n(e);if(!1===i)return r("not upload");if(i&&"function"==typeof i.then)try{const e=yield i;n(e)}catch(e){r(e)}}else n(e)})))),disabled:T,onChange:y,onPreview:e=>Hn(void 0,void 0,void 0,(function*(){if("function"==typeof h)return h(e,(t=>P(t||e)));d||(yield P(e))})),onDownload:e=>Hn(void 0,void 0,void 0,(function*(){yield P(e)})),itemRender:(e,n,r,a)=>((e,n)=>{const{iconRender:r}=i,{uid:a,name:o,url:u,status:p="done"}=e,m="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return t.createElement("div",{className:Pe("ant-upload-list-item",`ant-upload-list-item-${p}`,"ant-upload-list-item-list-type-text",{handle:s})},t.createElement("div",{className:"ant-upload-list-item-info"},t.createElement("span",{className:"ant-upload-span"},t.createElement("div",{className:"ant-upload-text-icon"},r?r(e):t.createElement(Fe,null)),t.createElement("div",{className:"ant-upload-list-item-name"},S[a]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:Sl(o),onBlur:t=>{const{value:n}=t.target;if(n!==Sl(o)){const t=Object.assign({},e,{name:`${n}.${Nl(o)}`}),r=l.map((e=>e.uid!==a?e:t));null==g||g(t,r),null==y||y({file:t,fileList:r})}k(a,!1)}}):t.createElement("a",{rel:"noreferrer",target:"_blank",title:o,href:u,onClick:e=>{e.preventDefault(),c?T||k(a,!0):n.preview()}},o)),t.createElement("span",{className:"ant-upload-list-item-card-actions"},c&&!T&&t.createElement("button",{type:"button",className:m,onClick:()=>k(a)},S[a]?t.createElement($e,null):t.createElement(Me,null)),c&&t.createElement("button",{type:"button",className:Pe(m,"preview"),onClick:()=>n.preview()},t.createElement(qe,null)),t.createElement("button",{type:"button",className:Pe(m,"download"),disabled:d,onClick:()=>n.download()},t.createElement(je,null)),t.createElement("button",{type:"button",className:Pe(m,"delete"),disabled:T,onClick:()=>n.remove()},t.createElement(Ke,null))))))})(n,a)}),t.createElement("span",{className:"inner",ref:w},i.children||u&&l.length?i.children:t.createElement(E,{type:null!==(n=p.type)&&void 0!==n?n:"default",icon:null!==(r=p.icon)&&void 0!==r?r:t.createElement(He,null),disabled:T},p.text||b("qm.upload.text")),o&&!!l.length&&t.createElement(E,{disabled:d,style:{marginLeft:8},onClick:e=>Hn(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof o)yield o(l);else for(const e of l)yield P(e)}))},b("qm.upload.batchDownload"))))};Tl.displayName="QmUploadFile";const Il=e=>{const n=pn({icon:t.createElement(je,null),withCredentials:!1},e),{$size:r}=$n(n),{t:i}=Fn(),[l,a]=t.useState(!1),o=Xn(n,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return t.createElement(E,Rn({},o,{size:r,loading:l,onClick:()=>Hn(void 0,void 0,void 0,(function*(){var e;a(!0);try{const{action:e,fileName:t,headers:r,params:l,beforeDownload:a=zn,onSuccess:o}=n,s=ce(e)?e:yield Hn(void 0,void 0,void 0,(function*(){const e=n.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!s)return tr("Download","参数 `action` 有误!");if(!a(s))return;yield Cl(s,{fileName:t,headers:r,params:l}),yield Wn(100),null==o||o(),R.success(i("qm.download.success"))}catch(t){null===(e=n.onError)||void 0===e||e.call(n,t),R.error(i("qm.download.error"))}a(!1)}))}),n.children||i("qm.download.text"))};function Rl(t,n){const r=e.useRef(null),i=e.useRef(0);e.useEffect((()=>()=>{clearTimeout(r.current),r.current=null}),[]);return e.useCallback(((...e)=>{const r=Date.now();(!i.current||r-i.current>n)&&(t.apply(this,e),i.current=r)}),[t,n])}Il.displayName="QmDownload";const Ol=e=>{const{activeKey:n,labels:r,onTabClick:i}=e;return t.createElement(t.Fragment,null,r.map(((e,r)=>{const l={item:!0,actived:r===n};return t.createElement("div",{key:r,className:Pe(l),onClick:e=>i(r,e)},t.createElement("span",null,e))})))},kl=e=>{const{label:n,showDivider:r,className:i,style:l}=e,a={[lr("anchor-item")]:!0};return t.createElement("div",{className:Pe(a,i),style:l},r&&t.createElement(ar,{label:n,style:{marginBottom:10}}),e.children)};kl.displayName="AnchorItem";const Ll=t.forwardRef(((e,n)=>{const{labelList:r=[],defaultActiveIndex:i,labelWidth:l,tabPosition:a="left",onTabClick:o,className:s,style:c}=e,{$size:d}=$n(e),u=t.useRef(null),p=t.useRef(),m=t.useRef("ready"),h=t.useRef(0),[f,g]=t.useState(i||0),v=t.useMemo((()=>!!(null==r?void 0:r.length)),[r]);t.useEffect((()=>{y();const e=Kt(u.current,"scroll",E);return()=>{e.remove()}}),[]);const y=()=>{f>0&&(u.current.scrollTop=Wi(x(f),u.current))},b=e=>{const t=Math.abs(e),n=(v?r.map((e=>document.getElementById(e.id))):Array.from((null===(i=u.current)||void 0===i?void 0:i.children)||[])).map((e=>Wi(e,u.current)));var i;let l=-1;for(let e=0;e<n.length;e++){const r=n[e],i=n[e+1]||1e4;t>=r-1&&t<i&&(l=e)}return l},x=e=>v?document.getElementById(r[e].id):u.current.children[e],E=Rl((e=>{if("ready"!==m.current)return;const t=b(e.target.scrollTop);-1!==t&&g(t)}),60),w=e=>{const t=x(e);t&&(g(e),m.current="stop",p.current&&clearTimeout(p.current),Vt(t,{block:"start",behavior:"smooth",boundary:u.current}),p.current=setTimeout((()=>m.current="ready"),500))};t.useImperativeHandle(n,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>h.current?h.current:e,w(e)}})));const C=lr("anchor"),S={[C]:!0,[`${C}-left`]:"left"===a,[`${C}-top`]:"top"===a,[`${C}--lg`]:"large"===d,[`${C}--sm`]:"small"===d},N=[];t.Children.map(e.children,(e=>{var t;jn(e)&&!Kn(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&N.push(e)}));const T=v?r.map((e=>e.label)):N.map((e=>e.props.label)),I=v?r.map((e=>e.id)):N.map(((e,t)=>e.props["data-id"]||t.toString()));return h.current=T.length,t.createElement("div",{className:Pe(S,s),style:c},t.createElement("div",{className:Pe("anchor-nav"),style:{width:l?Zn(l):""}},t.createElement(Ol,{activeKey:f,labels:T,onTabClick:(e,t)=>{w(e),null==o||o({label:T[e],id:I[e]},t)}})),t.createElement("div",{ref:u,className:Pe("anchor-container")},v?e.children:N))}));Ll.displayName="QmAnchor",Ll.Item=kl;const Al=e=>t.createElement(k.TabPane,e,e.children);Al.displayName="TabPane";const Pl=e=>{const n=pn({tabPosition:"top"},e),{items:r,tabPosition:i,tabBarGutter:l,className:a,authConfig:o}=n,{$size:s}=$n(n),c=lr("tabs"),d={[c]:!0,[`${c}--lg`]:"large"===s,[`${c}--sm`]:"small"===s},u=Object.assign(Object.assign({},Xn(n,["items","authConfig"])),{size:s,tabBarGutter:null!=l?l:["top","bottom"].includes(i)?30:0}),p=[];t.Children.map(n.children,(e=>{var t;jn(e)&&!Kn(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&p.push(e)}));const m=r?[...r]:p.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(o){const{fieldList:e=[]}=o||{};for(let t=0;t<m.length;t++){const n=m[t],r=e.find((e=>e.dataIndex===n.key)),{visible:i=1,disabled:l}=r||{};i?l&&(n.disabled=!0):(m.splice(t,1),t--)}}return t.createElement(k,Rn({},u,{items:m,className:Pe(d,a)}))};Pl.displayName="QmTabs",Pl.TabPane=Al;const _l=t.forwardRef(((e,n)=>{var r;const i=pn({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:l,open:a,className:o,loading:s,showHeader:c,showFullScreen:d,maskClosable:u,destroyOnClose:p,onClose:m,onClosed:h,onFullChange:f}=i,{global:g}=t.useContext(on),{$size:v}=$n(i),y=t.useRef(null),b=t.useRef(null),x=t.useRef(!1),[E,w]=t.useState(!1),[C,S]=t.useState(!1),[N,T]=t.useState(!1);Mi((()=>{(null!=a?a:l)&&(!p&&x.current||de(s)&&S(!0))}),[null!=a?a:l]),Mi((()=>{b.current&&Vi(b.current,E?{width:"100%"}:{width:Zn(i.width||"72%")})}),[E]);const I=()=>{b.current=Ui(y.current,"ant-drawer-content-wrapper"),w(!E),null==f||f(!E)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>T(!0),STOP_LOADING:()=>T(!1)})));const R=lr("drawer"),O={[R]:!0,"no-header":!c,[`${R}--lg`]:"large"===v,[`${R}--sm`]:"small"===v};return t.createElement(L,Rn({},Xn(i,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=a?a:l,maskClosable:null!==(r=null!=u?u:null==g?void 0:g.maskClosable)&&void 0!==r&&r,className:Pe(O,o),title:t.createElement(t.Fragment,null,t.createElement("span",{ref:y,className:"text"},c&&i.title),d&&t.createElement("button",{type:"button",className:"full-screen",onClick:I},t.createElement(E?Ve:ze))),footer:null,afterOpenChange:e=>{e?(x.current=!0,de(s)&&setTimeout((()=>S(!1)),100)):(w(!1),null==h||h())},onClose:m}),i.children,(s||N||C)&&t.createElement(nl,{spinning:!0,className:Pe("spinning")}))}));_l.displayName="QmDrawer";const Dl="10vh";var Hl;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Hl||(Hl={}));const Fl=t.forwardRef(((e,n)=>{var r;const i=pn({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Dl}},e),{visible:l,open:a,width:o,height:s,className:c,loading:d,draggable:u,showHeader:p,showFullScreen:m,maskClosable:h,destroyOnClose:f,bodyStyle:g,onFullChange:v,onClose:y,onClosed:b}=i,{global:x}=t.useContext(on),{$size:E}=$n(i),w=t.createRef(),C=t.useRef(!1),S=t.useMemo((()=>`calc(100vh - ${Dl} - ${Dl} - ${Hl[p?E:"none"]}px)`),[E,p]),[N,T]=t.useState(!1),[I,R]=t.useState(!1),[O,k]=t.useState(!1),[L,P]=t.useState(!0),[_,D]=t.useState({left:0,top:0,bottom:0,right:0}),[H,F]=t.useState();Mi((()=>{if(null!=a?a:l){if(!f&&C.current||de(d)&&R(!0),!f&&C.current)return;setTimeout((()=>{C.current=!0,de(d)&&R(!1)}),400)}}),[null!=a?a:l]),Mi((()=>{F(N?{x:0,y:0}:void 0)}),[N]);const M=e=>{const t=Ui(e.target,"ant-modal");if(!t)return;const n=t.querySelector(".ant-modal-body");N?(Vi(t,{width:Zn(o||"60%"),height:"auto",top:Dl}),Vi(n,{height:s?Zn(s):S,maxHeight:"auto"===s?S:""})):(Vi(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),Vi(n,{height:`calc(100vh - ${Hl[p?E:"none"]}px)`,maxHeight:""})),T(!N),null==v||v(!N)};t.useImperativeHandle(n,(()=>({START_LOADING:()=>k(!0),STOP_LOADING:()=>k(!1)})));const $=lr("modal"),q={height:s?Zn(s):S,maxHeight:"auto"===s?S:"",overflow:"auto"},j={[$]:!0,"no-header":!p,[`${$}--lg`]:"large"===E,[`${$}--sm`]:"small"===E};return t.createElement(A,Rn({},Xn(i,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=a?a:l,maskClosable:null!==(r=null!=h?h:null==x?void 0:x.maskClosable)&&void 0!==r&&r,className:Pe(j,c),title:t.createElement("div",{onMouseOver:()=>{L&&P(!1)},onMouseOut:()=>{P(!0)}},t.createElement("span",{className:"text"},p&&i.title),m&&t.createElement("button",{type:"button",className:"full-screen",onClick:M},t.createElement(N?Ve:ze))),footer:null,bodyStyle:Object.assign({},q,g),onCancel:y,afterClose:()=>{null==b||b(),T(!1)},modalRender:e=>t.createElement(zt,{nodeRef:w,bounds:_,position:H,disabled:!u||L||N,onStart:(e,t)=>((e,t)=>{const{clientWidth:n,clientHeight:r}=window.document.documentElement,i=w.current.getBoundingClientRect();i&&D({left:-i.left+t.x,right:n-(i.right-t.x)-1,top:-i.top+t.y,bottom:r-(i.bottom-t.y)-1})})(0,t)},t.createElement("div",{ref:w},e))}),i.children,(d||O||I)&&t.createElement(nl,{spinning:!0,className:Pe("spinning")}))}));Fl.displayName="QmModal";const Ml=n(void 0),$l=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ql={operations:function(e){const t=e.split(" "),n=[];let r=0;n[r]=[];for(let e=0;e<t.length;e++)$l.includes(t[e])?(n[r]=n[r].join(" "),r++,n[r]=[]):n[r].push(t[e]);return n[r]=n[r].join(" "),n},number_operations:function(e){return this.operations(e).length},string_format:function(e){return"string"!=typeof e?e:e.split(/[\s'\s"]/).join("")},stringify:function(e,t=" "){return"string"==typeof e?"'"+e.trim().replace(/(')/g,"\\$1").replace(/\(/g,"├").replace(/\)/g,"┤").replace(/\s/g,t)+"'":e},array_format:function(e){let t="[";for(let n=0,r=(e=Array.isArray(e)?e:[e]).length;n<r;n++)t+="number"==typeof e[n]?e[n]:"'"+e[n]+"'",n<r-1&&(t+=",");return t+="]",t},operation_format:function(e){const t=e.split(" ");for(let e=0;e<t.length;e++)""==t[e]&&(t.splice(e,1),e--);if("("==t[0]?t.splice(0,1):"("==t[0][0]&&(t[0]=t[0].split(""),t[0].splice(0,1),t[0]=t[0].join("")),")"==t[t.length-1])t.splice(t.length-1,1);else if(")"==t[t.length-1][t[t.length-1].length-1]){const e=t.length-1;t[e]=t[e].split(""),t[e].splice(t[e].length-1,1).join(""),t[e]=t[e].join("")}return t},find_replace:function(e,t,n){return e.split(t).join(n)},replace_symbols:function(e){return e=this.find_replace(e," AND "," && "),e=this.find_replace(e," and "," && "),e=this.find_replace(e," OR "," || "),e=this.find_replace(e," or "," || "),e=this.find_replace(e," <> "," != "),e=this.find_replace(e," LIKE "," like "),e=this.find_replace(e," LIKES "," likes "),e=this.find_replace(e," IN "," in "),e=this.find_replace(e," NIN "," nin ")}};const jl=["==","<",">","<=",">=","!=","like","likes","in","nin"];var Kl=function(e){let t=0;const n=e.length;for(let r=0;r<n;r++){const n=e.charAt(r);"("===n&&t++,")"===n&&t--}return 0===t},Vl=function(e,t){let n="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?n+=" "+e[t]+" ":n+=e[t];const r=n.split(" ").filter((e=>""!==e));for(let e=0;e<r.length;e++)jl.includes(r[e])&&("this"!=r[e-1]?r[e-1]=t+"."+r[e-1]:r[e-1]=t),jl.includes(r[e])&&(r.splice(e-1,3,`__query__(${r[e-1]}, '${r[e]}', ${r[e+1]})`),e-=2);return e=r.join(" ")};const zl=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,Wl=["string","number","boolean","symbol"],Bl=e=>Wl.includes(typeof e),Ul=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),Gl=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(zl,"\\$1"),"i");window.__query__=(...e)=>((e,t,n)=>{e=null!=e?e:"";let r=!0;switch(t){case"like":r=null!==e.toString().match(Gl(n));break;case"likes":r=n.split(/,|,/).some((t=>null!==e.toString().match(Gl(t))));break;case"in":Bl(n)&&(n=[n]),Array.isArray(n)&&(r=Array.isArray(e)?n.every((t=>e.includes(t))):n.includes(e));break;case"nin":Bl(n)&&(n=[n]),Array.isArray(n)&&(r=!(Array.isArray(e)?n.some((t=>e.includes(t))):n.includes(e)));break;case"!=":case"<>":r=(Ul(e)?e.slice(0,10):e)!=n;break;case"<":r=(Ul(e)?e.slice(0,10):e)<n;break;case"<=":r=(Ul(e)?e.slice(0,10):e)<=n;break;case">":r=(Ul(e)?e.slice(0,10):e)>n;break;case">=":r=(Ul(e)?e.slice(0,10):e)>=n;break;default:r=(Ul(e)?e.slice(0,10):e)==n}return r})(e[0],e[1],e[2]);const Yl=ql.stringify,Xl=ql.array_format,Ql=Kl,Zl=(e,t,n)=>{let r=[];t=ql.replace_symbols(t);try{if(n){const n=new Function("record",`return ${Vl(t,"record")};`);r=_a(e,(e=>n(e)))}else{const n=new Function("array","i",`return ${Vl(t,"array[i]")};`);for(let t=0,i=e.length;t<i;t++)n(e,t)&&r.push(e[t])}}catch(t){tr("Table","组件 `initialFilter` 参数有误!"),r=e}return r},Jl=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...Jl(e.children)):t.push(e)})),t},ea=e=>e.filter((e=>(e.children&&(e.children=ea(e.children)),!e.hidden&&!e.noAuth))),ta=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...ta(e.children))})),t},na=(e,t)=>e.map((e=>(e.children&&(e.children=na(e.children,t)),null==t||t(e),e))),ra=(e,t)=>{for(const n of e){if(n.dataIndex===t)return n;if(n.children){const e=ra(n.children,t);if(e)return e}}return null},ia=e=>{const t=e.children;return t?t[0].children?ia(t[0]):t[0]:e},la=e=>{const t=e.children;return t?t[t.length-1].children?la(t[t.length-1]):t[t.length-1]:e},aa=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),oa=(e,t)=>{for(const n of e){if(n.rowKey===t)return n;if(n.children){const e=oa(n.children,t);if(e)return e}}return null},sa=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...sa(e.children))})),t},ca=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...ca(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(t(e))})),n},da=e=>{let t=1;const n=(e,r)=>{var i;if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{e.fixed?r.fixed=e.fixed:delete r.fixed,n(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=null!==(i=e.colSpan)&&void 0!==i?i:1};e.forEach((e=>{e.level=1,n(e,null)}));const r=[];for(let e=0;e<t;e++)r.push([]);return ta(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r},ua=e=>Object.assign(e,{__prevent__:!0}),pa=e=>{delete e.__prevent__},ma=(e,t,n={left:0,top:0})=>{if(e){const r=e.parentNode;if(n.top+=e.offsetTop,n.left+=e.offsetLeft,r&&r!==document.documentElement&&r!==document.body&&(n.top-=r.scrollTop,n.left-=r.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return ma(e.offsetParent,t,n)}return n},ha=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,fa=(e,t)=>pe(e,((e,n,r)=>{me(n,t[r])||(e[r]=ae(n)&&ae(t[r])?fa(n,t[r]):n)})),ga=(e,t)=>{var n;return null!==(n=ue(e,t))&&void 0!==n?n:""},va=(e,t,n,r)=>{r>=0&&null!=n&&(n=Number(n).toFixed(r)),he(e,t,null!=n?n:"")},ya=(e,t)=>{if(!t.includes("|"))return ga(e,t);const n=[];return t.split("|").forEach((t=>{t&&n.push(ga(e,t))})),n.every((e=>!e))?"":n.join(" | ")},ba=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),xa=e=>{const t=(e=e.toString()).split("."),n="-"===t[0].charAt(0)?"-":"";let r=n?t[0].slice(1):t[0],i="";for(;r.length>3;)i=`,${r.slice(-3)}${i}`,r=r.slice(0,r.length-3);return r&&(i=r+i),`${n}${i}${t[1]?`.${t[1]}`:""}`},Ea=(e,t)=>{const n=e.toString();if(!ba(n)||0===t)return e;const r=Number.parseFloat(n).toString(),i=r.indexOf(".");if(-1===i)return r+"."+"0".repeat(t);const l=Math.max(0,t-(r.length-i-1));return r+"0".repeat(l)},wa=(e,t)=>e?m(e,t):null,Ca=(e,t)=>e?m(e).format(t):"",Sa=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},Na=e=>{const n=[];if(t.isValidElement(e)){const{children:r}=e.props;t.Children.forEach(r,(e=>{n.push(...Na(e))}))}else n.push(e);return n},Ta=e=>Na(e).join(""),Ia=e=>e.filter((e=>!e._group)),Ra=(e,t=!1)=>{let n="";if(Array.isArray(e)){let r=0;for(let i=0,l=e.length;i<l;i++){const l=e[i];if(!l.fieldName)continue;const a=Array.isArray(l.condition)?Xl(l.condition):Yl(l.condition,"^");n+=`${l.bracketLeft} ${t?`${l.fieldName}|${l.fieldType}`:l.fieldName} ${l.expression} ${a} ${l.bracketRight} ${l.logic} `,r=l.logic.length}n=n.slice(0,-1*r-2)}else{const r=5;for(const r in e){const[i,l]=r.includes("|")?r.split("|"):[r,""],a=e[r];for(const e in a){n+=`${t?`${i}|${l}`:i} ${e} ${Array.isArray(a[e])?Xl(a[e]):Yl(a[e],"^")} and `}}n=n.slice(0,-1*r)}return n.replace(/\s+/g," ").trim()},Oa=(e=[],t=[])=>{const n={};return e.forEach((e=>{const r=JSON.stringify((e=>{const n=[];return t.forEach((t=>n.push(ga(e,t)))),n})(e));n[r]=n[r]||[],n[r].push(e)})),Object.keys(n).map((e=>n[e]))},ka=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].dataIndex===t)return[e[n]];if(Array.isArray(e[n].children)){const r=ka(e[n].children,t);if(r)return[e[n],r].flat()}}},La=(e,t)=>{for(let n=0;n<e.length;n++){if(e[n].rowKey===t)return[t];if(Array.isArray(e[n].children)){const r=La(e[n].children,t);if(r)return[e[n].rowKey,r].flat()}}},Aa=(e,t)=>{for(const n of e){if(Array.isArray(n.children)){const e=Aa(n.children,t);if(e)return e}if(t(n))return n}return null},Pa=e=>{const t=[];for(let n=0;n<e.length;n++)Array.isArray(e[n].children)&&t.push(...Pa(e[n].children)),t.push(e[n].rowKey);return t},_a=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&_a(e.children,t),t(e)||e.children&&e.children.length))),Da=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Ha=(e,t,n=!1)=>{const r=new Set;return function e(t,i,l=1){if(r.has(t))return!1;if(t===i)return!0;if(n&&l>1)return!1;r.add(t);const a=l+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],i[n],a))return!1;return!0}if(t&&i&&"object"==typeof t&&"object"==typeof i){const n=Object.keys(t);return n.length===Object.keys(i).length&&n.every((n=>e(t[n],i[n],a)))}return!1}(e,t)},Fa=e=>["","small","middle","large"].includes(e),Ma=80,$a="1",qa="0",ja=400,Ka=["RANGE_INPUT","RANGE_INPUT_NUMBER","RANGE_SEARCH_HELPER","MULTIPLE_CHECKBOX","MULTIPLE_SELECT","RANGE_DATE","RANGE_TIME","MULTIPLE_TREE_SELECT","MULTIPLE_SEARCH_HELPER","MULTIPLE_TREE_TABLE_HELPER","MULTIPLE_CASCADER","UPLOAD_IMG","UPLOAD_FILE"],Va={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var za,Wa,Ba;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(za||(za={})),function(e){e.date="YYYY-MM-DD HH:mm:ss",e.datetime="YYYY-MM-DD HH:mm:ss",e.exactdate="YYYY-MM-DD",e.week="YYYY-wo",e.month="YYYY-MM",e.quarter="YYYY-[Q]Q",e.year="YYYY"}(Wa||(Wa={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(Ba||(Ba={}));const Ua={items:Ut.arrayOf(Ut.shape({type:Ut.string.isRequired,fieldName:Ut.string.isRequired})),initialValues:Ut.object,initialExtras:Ut.object,layout:Ut.oneOf(["horizontal","vertical"]),size:(e,t,n)=>{if(!Fa(e[t]||""))return er("Form","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},cols:Ut.number,className:Ut.string,style:Ut.object,compactMode:Ut.bool,labelWidth:Ut.oneOfType([Ut.number,Ut.string]),labelAlign:Ut.oneOf(["left","right"]),labelWrap:Ut.bool,formType:Ut.oneOf(["default","search","onlyShow"]),disabled:Ut.bool,uniqueKey:Ut.string,defaultRows:Ut.number,defaultExpand:Ut.bool,searchButtonCols:Ut.number,scrollToFirstError:Ut.bool,authConfig:Ut.object,isAutoFocus:Ut.bool,isCollapse:Ut.bool,isFieldsDefine:Ut.bool,isSearchBtn:Ut.bool,isSubmitBtn:Ut.bool,fieldsChange:Ut.func,onValuesChange:Ut.func,onFieldsChange:Ut.func,onFinish:Ut.func,onFinishFailed:Ut.func,onReset:Ut.func,onCollapse:Ut.func},Ga={layout:"horizontal",labelWidth:Ma,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:Vn,onFieldsChange:Vn,onFinish:Vn,onFinishFailed:Vn,onReset:Vn,onCollapse:Vn},Ya=(e,t)=>{if(!e)return null;if(t===Wa.week){const t=e.match(/^(\d{4})-(\d+)/);return t?m().year(Number(t[1])).week(Number(t[2])):null}if(t===Wa.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?m().year(Number(t[1])).quarter(Number(t[2])):null}return m(e,t)},Xa=(e,t)=>e?m(e).format(t):"",Qa=e=>""===e||null==e,Za=(e,t)=>{var n;if(!e)return"";if(!t.includes("|"))return e[t];const r=t.split("|");let i="";for(let t=0,l=r.length;t<l;t++){i+=(null!==(n=e[r[t].trim()])&&void 0!==n?n:"")+(t===l-1?"":" | ")}return i},Ja=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),l=n[r].split("|");i.forEach(((t,n)=>e[t]=e[l[n]]))}else e[t[r]]=e[n[r]]},eo=(e,t,n)=>{for(const r in n)if(Object.keys(t).includes(r)&&t[r]!==n[r])if(t[r].includes("|")){const i=t[r].split("|"),l=n[r].split("|");i.forEach(((t,n)=>e[t]=e[l[n]]))}else e[t[r]]=e[n[r]]},to=(e,t,n)=>e.map((e=>{const r={value:e[t],text:e[n]};return e.disabled&&(r.disabled=!0),de(e.isLeaf)||(r.isLeaf=!!e.isLeaf),de(e.selectable)||(r.selectable=!!e.selectable),Array.isArray(e.children)&&(r.children=to(e.children,t,n)),r})),no=(e,t)=>{for(const n of e){if(n.value===t)return n;if(Array.isArray(n.children)){const e=no(n.children,t);if(e)return e}}return null},ro=(e,t,n=0)=>{const r=[];return e.forEach((e=>{e.value==t.split(",")[n]&&r.push(e),Array.isArray(e.children)&&r.push(...ro(e.children,t,n+1))})),r},io=e=>jn(e)||"string"==typeof e,lo=e=>jn(e)?Na(e).join(""):null!=e?e:"",ao=(e,t,n,r)=>{var i;const l={};return l.filters=(null===(i=e.filters)||void 0===i?void 0:i.filter((e=>"1"===e.isQuery)).map((e=>{const t={type:e.type,label:e.label,fieldName:e.fieldName,options:{}};return Array.isArray(e.dicData)&&(t.options.itemList=e.dicData),t})))||[],l.table={columns:e.columns||[],rowKey:e.valueName},l.fieldsDefine={valueKey:e.valueKey||e.valueName},l.fieldAliasMap={[r?"textKey":t]:e.displayName[0],[r?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(l.table.fetch={api:n(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(l.echoRequest={fetchApi:n(e.echoSetting.api),formatter:t=>{var n;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(n=t.key)&&void 0!==n?n:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(l.echoRequest.fieldAliasMap={[r?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(l.tree={fetch:{api:n(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const n={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>n[e.tableField]=e.treeField)),n}}),e.emmediateSetting&&(l.columns=e.emmediateSetting.columns,l.request={fetchApi:n(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),l};var oo={PINYINS:["A","AI","AN","ANG","AO","BA","BAI","BAN","BANG","BAO","BEI","BEN","BENG","BI","BIAN","BIAO","BIE","BIN","BING","BO","BU","CA","CAI","CAN","CANG","CAO","CE","CEN","CENG","CHA","CHAI","CHAN","CHANG","CHAO","CHE","CHEN","CHENG","CHI","CHONG","CHOU","CHU","CHUA","CHUAI","CHUAN","CHUANG","CHUI","CHUN","CHUO","CI","CONG","COU","CU","CUAN","CUI","CUN","CUO","DA","DAI","DAN","DANG","DAO","DE","DEN","DENG","DI","DIAN","DIAO","DIE","DING","DIU","DONG","DOU","DU","DUAN","DUI","DUN","DUO","E","EI","EN","ENG","ER","FA","FAN","FANG","FEI","FEN","FENG","FIAO","FO","FOU","FU","GA","GAI","GAN","GANG","GAO","GE","GEI","GEN","GENG","GONG","GOU","GU","GUA","GUAI","GUAN","GUANG","GUI","GUN","GUO","HA","HAI","HAN","HANG","HAO","HE","HEI","HEN","HENG","HM","HONG","HOU","HU","HUA","HUAI","HUAN","HUANG","HUI","HUN","HUO","JI","JIA","JIAN","JIANG","JIAO","JIE","JIN","JING","JIONG","JIU","JU","JUAN","JUE","JUN","KA","KAI","KAN","KANG","KAO","KE","KEN","KENG","KONG","KOU","KU","KUA","KUAI","KUAN","KUANG","KUI","KUN","KUO","LA","LAI","LAN","LANG","LAO","LE","LEI","LENG","LI","LIA","LIAN","LIANG","LIAO","LIE","LIN","LING","LIU","LO","LONG","LOU","LU","LV","LUAN","LVE","LUN","LUO","M","MA","MAI","MAN","MANG","MAO","ME","MEI","MEN","MENG","MI","MIAN","MIAO","MIE","MIN","MING","MIU","MO","MOU","MU","N","NA","NAI","NAN","NANG","NAO","NE","NEI","NEN","NENG","NI","NIAN","NIANG","NIAO","NIE","NIN","NING","NIU","NONG","NOU","NU","NV","NUAN","NVE","NUN","NUO","O","OU","PA","PAI","PAN","PANG","PAO","PEI","PEN","PENG","PI","PIAN","PIAO","PIE","PIN","PING","PO","POU","PU","QI","QIA","QIAN","QIANG","QIAO","QIE","QIN","QING","QIONG","QIU","QU","QUAN","QUE","QUN","RAN","RANG","RAO","RE","REN","RENG","RI","RONG","ROU","RU","RUA","RUAN","RUI","RUN","RUO","SA","SAI","SAN","SANG","SAO","SE","SEN","SENG","SHA","SHAI","SHAN","SHANG","SHAO","SHE","SHEN","SHENG","SHI","SHOU","SHU","SHUA","SHUAI","SHUAN","SHUANG","SHUI","SHUN","SHUO","SI","SONG","SOU","SU","SUAN","SUI","SUN","SUO","TA","TAI","TAN","TANG","TAO","TE","TENG","TI","TIAN","TIAO","TIE","TING","TONG","TOU","TU","TUAN","TUI","TUN","TUO","WA","WAI","WAN","WANG","WEI","WEN","WENG","WO","WU","XI","XIA","XIAN","XIANG","XIAO","XIE","XIN","XING","XIONG","XIU","XU","XUAN","XUE","XUN","YA","YAN","YANG","YAO","YE","YI","YIN","YING","YO","YONG","YOU","YU","YUAN","YUE","YUN","ZA","ZAI","ZAN","ZANG","ZAO","ZE","ZEI","ZEN","ZENG","ZHA","ZHAI","ZHAN","ZHANG","ZHAO","ZHE","ZHEN","ZHENG","ZHI","ZHONG","ZHOU","ZHU","ZHUA","ZHUAI","ZHUAN","ZHUANG","ZHUI","ZHUN","ZHUO","ZI","ZONG","ZOU","ZU","ZUAN","ZUI","ZUN","ZUO",""],UNIHANS:["阿","哎","安","肮","凹","八","挀","扳","邦","勹","陂","奔","伻","屄","边","灬","憋","汃","冫","癶","峬","嚓","偲","参","仓","撡","冊","嵾","曽","叉","芆","辿","伥","抄","车","抻","阷","吃","充","抽","出","欻","揣","巛","刅","吹","旾","逴","呲","匆","凑","粗","汆","崔","邨","搓","咑","呆","丹","当","刀","嘚","扥","灯","氐","甸","刁","爹","丁","丟","东","吺","厾","耑","垖","吨","多","妸","诶","奀","鞥","儿","发","帆","匚","飞","分","丰","覅","仏","紑","夫","旮","侅","甘","冈","皋","戈","给","根","刯","工","勾","估","瓜","乖","关","光","归","丨","呙","哈","咍","佄","夯","茠","诃","黒","拫","亨","噷","叿","齁","乎","花","怀","欢","巟","灰","昏","吙","丌","加","戋","江","艽","阶","巾","坕","冂","丩","凥","姢","噘","军","咔","开","刊","忼","尻","匼","肎","劥","空","抠","扝","夸","蒯","宽","匡","亏","坤","扩","垃","来","兰","啷","捞","肋","勒","崚","哩","俩","奁","良","撩","毟","拎","伶","溜","囖","龙","瞜","噜","驴","娈","掠","抡","罗","呣","妈","埋","嫚","牤","猫","么","呅","门","甿","咪","宀","喵","乜","民","名","谬","摸","哞","毪","嗯","拏","腉","囡","囔","孬","疒","娞","恁","能","妮","拈","娘","鸟","捏","囜","宁","妞","农","羺","奴","女","奻","疟","黁","挪","喔","讴","妑","拍","眅","乓","抛","呸","喷","匉","丕","囨","剽","氕","姘","乒","钋","剖","仆","七","掐","千","呛","悄","癿","亲","靑","卭","丘","区","峑","缺","夋","呥","穣","娆","惹","人","扔","日","茸","厹","邚","挼","堧","婑","瞤","捼","仨","毢","三","桒","掻","閪","森","僧","杀","筛","山","伤","弰","奢","申","升","尸","収","书","刷","衰","闩","双","脽","吮","说","厶","忪","捜","苏","狻","夊","孙","唆","他","囼","坍","汤","夲","忑","熥","剔","天","旫","帖","厅","囲","偷","凸","湍","推","吞","乇","穵","歪","弯","尣","危","昷","翁","挝","乌","夕","虲","仙","乡","灱","些","心","星","凶","休","吁","吅","削","坃","丫","恹","央","幺","倻","一","囙","应","哟","佣","优","扜","囦","曰","晕","帀","災","兂","匨","傮","则","贼","怎","増","扎","捚","沾","张","佋","蜇","贞","争","之","中","州","朱","抓","拽","专","妆","隹","宒","卓","乲","宗","邹","租","钻","厜","尊","昨","兙"],EXCEPTIONS:{"曾":"ZENG","沈":"SHEN","嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬤":"MO","嬷":"MO","蹒":"PAN","蹊":"XI","丬":"PAN","霰":"XIAN","莘":"XIN","豉":"CHI","饧":"XING","筠":"JUN","长":"CHANG","帧":"ZHEN","峙":"SHI","郍":"NA","芎":"XIONG","谁":"SHUI"}};const so="阿",co="鿿",uo=1,po=2,mo=3;let ho,fo=null;function go(e){return e||null===fo?("object"==typeof Intl&&Intl.Collator?(ho=new Intl.Collator(["zh-Hans-CN","zh-CN"]),fo=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):fo=!1,fo):fo}function vo(e){const t=oo.UNIHANS,n=oo.PINYINS,r=oo.EXCEPTIONS,i={source:e};if(e in r)return i.type=po,i.target=r[e],i;let l,a=-1;if(e.charCodeAt(0)<256)return i.type=uo,i.target=e,i;if(l=ho.compare(e,so),l<0)return i.type=mo,i.target=e,i;if(0===l)i.type=po,a=0;else{if(l=ho.compare(e,co),l>0)return i.type=mo,i.target=e,i;0===l&&(i.type=po,a=t.length-1)}if(i.type=po,a<0){let n=0,r=t.length-1;for(;n<=r;){a=~~((n+r)/2);const i=t[a];if(l=ho.compare(e,i),0===l)break;l>0?n=a+1:r=a-1}}return l<0&&a--,i.target=n[a],i.target||(i.type=mo,i.target=i.source),i}function yo(e){return"string"==typeof e&&go()?e.split("").map((e=>vo(e))):e}var bo={isSupported:go,parse:yo,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(oo)})))},genToken:vo,convertToPinyin:(e,t,n)=>yo(e).map((e=>t&&e.type===po?e.target.toLowerCase():e.target)).join(n||"")};var xo={patcher:function(e){e.EXCEPTIONS={"嗲":"DIA","碡":"ZHOU","聒":"GUO","炔":"QUE","蚵":"KE","砉":"HUA","嬷":"MO","蹊":"XI","丬":"PAN","霰":"XIAN","豉":"CHI","饧":"XING","帧":"ZHEN","芎":"XIONG","谁":"SHUI","钶":"KE"},e.UNIHANS[91]="伕",e.UNIHANS[347]="仚",e.UNIHANS[393]="诌",e.UNIHANS[39]="婤",e.UNIHANS[50]="腠",e.UNIHANS[369]="攸",e.UNIHANS[123]="乯",e.UNIHANS[171]="刕",e.UNIHANS[102]="佝",e.UNIHANS[126]="犿",e.UNIHANS[176]="列",e.UNIHANS[178]="刢",e.UNIHANS[252]="娝",e.UNIHANS[330]="偸"},shouldPatch:function(e){return"function"==typeof e&&("FOU"===e("伕").target&&"XIA"===e("仚").target&&"ZHONG"===e("诌").target&&"CHONG"===e("婤").target&&"CONG"===e("腠").target&&"YONG"===e("攸").target&&"HOU"===e("乯").target&&"LENG"===e("刕").target&&"GONG"===e("佝").target&&"HUAI"===e("犿").target&&"LIAO"===e("列").target&&"LIN"===e("刢").target&&"E"===e("钶").target)}};bo.isSupported()&&xo.shouldPatch(bo.genToken)&&bo.patchDict(xo);const Eo=e=>{const{value:n,bordered:r}=e;return t.createElement(O,{value:n,title:n,bordered:r,readOnly:!0})};Eo.displayName="FormItemView";const{Option:wo}=H,Co=e=>{const{$$form:n}=t.useContext(Ml),{value:r,items:i,multiple:l,loading:a,onChange:o,onValuesChange:s}=e,{t:c}=Fn(),{fieldName:d,options:u={},style:p={},placeholder:m=c("qm.form.selectPlaceholder"),bordered:h=!0,allowClear:f=!0,readOnly:g,disabled:v,onClear:y}=e.option,{itemList:b=[],filterable:x=!0,listHeight:E=ja,collapseTags:w,maxTagTextLength:C,dropdownStyle:S,openPyt:N=!0}=u,T=Gn(b)?i:b,I=e=>{var t;return(null===(t=T.find((t=>t.value===e)))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},R=e=>l?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return n.isOnlyShow?t.createElement(Eo,{value:R(r),bordered:h}):t.createElement(H,Rn({value:r,mode:l?"multiple":void 0,popupClassName:`form-popper__${d}`,dropdownStyle:S,placeholder:m,style:p,loading:a,bordered:h,allowClear:f,disabled:v,showSearch:x,listHeight:E,maxTagCount:w?"responsive":void 0,maxTagTextLength:C},l?{title:R(r)}:null,{filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"",i=bo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==o||o(e),s(e,R(e),T)})(e)},onClear:y}),T.map((e=>t.createElement(wo,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class So extends d{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,buttonAfter:m,validateTrigger:h,rules:f=[],onChange:g=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(l),className:Pe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Zn(d)},required:e.getFormItemRequired(f)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:f,validateTrigger:h,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(Co,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{g(t,n,r),e.setViewValue(o,n)}}))),m&&t.createElement(D,null,e.renderFormItemButton(o,m)),p&&t.createElement(D,{flex:Zn(p.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}So.contextType=Ml;const No=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{label:a,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToCheckbox:u,falseValue:p=qa,trueValue:m=$a}=o,{t:h}=Fn(),f=e=>h(e===m?"am.form.trueText":"am.form.falseText");return t.createElement(F,{checked:r===m,style:s,disabled:d||n.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==i||i(e),l(e,f(e))})(t?m:p)}},u?a:null)};class To extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option,{labelToCheckbox:h}=o;return t.createElement(P.Item,{label:h?" ":e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(No,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}To.contextType=Ml;const Io=e=>{const{uniqueKey:n,items:r,fieldsChange:i}=e,{global:l}=t.useContext(on),{$$form:a}=t.useContext(Ml),{$size:o}=$n(e),{t:s}=Fn(),c=t.useRef(null),[d,u]=t.useState(!1),p=t.useMemo((()=>n?`form_${n}`:""),[n]);t.useLayoutEffect((()=>{f()}),[]);const m=()=>{if(!p)return;const e=JSON.parse(localStorage.getItem(p));var t;if(e||(t=p,Hn(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(p,JSON.stringify(e)),f()):(null==l?void 0:l.getComponentConfigApi)&&h(r)})).catch((()=>{})),!e)return;return fe(e.map((e=>e.fieldName)),r.map((e=>e.fieldName))).length>0?r.map((t=>{const{fieldName:n}=t,r=e.find((e=>e.fieldName===n));return r?(de(r.hidden)||(t.hidden=r.hidden),t):t})):e.map((e=>{const t=r.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))},h=e=>{if(!p)return;const t=e.map((e=>{const t={};return de(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),n=JSON.parse(localStorage.getItem(p));var r,i;me(t,n)||(localStorage.setItem(p,JSON.stringify(t)),r=p,i=t,Hn(void 0,void 0,void 0,(function*(){const e=null==l?void 0:l.saveComponentConfigApi;if(e)try{yield e({[r]:i})}catch(e){}})))},f=()=>{const e=m();e&&g(e)},g=e=>{null==i||i([...e])},v=()=>t.createElement("div",{className:Pe("ant-dropdown-menu","fields-list")},t.createElement("div",{className:"reset"},t.createElement(nr,{type:"text",size:"small",onClick:()=>(e=>{const t=e.map((e=>{const t=r.find((t=>t.fieldName===e.fieldName))||Qn(e);return Object.assign(t,{hidden:e.hidden})}));g(t),h(t)})(a.getOriginItems())},s("qm.table.columnFilter.reset"))),t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));if(me(t,n))return;a.setExpandHandle(!0);const i=Da(e);g(i),h(i)}},r.map((e=>{var n;return t.createElement("li",{key:e.fieldName,className:"item",style:e.noAuth?{display:"none"}:void 0},t.createElement(F,{disabled:(null===(n=e.rules)||void 0===n?void 0:n.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,g(r),h(r)}}),t.createElement(Be,{className:"handle",title:s("qm.form.draggable")}),t.createElement("span",{className:"title"},a.getFormItemLabel(e.label)))})))),y=lr("form-fields-filter"),b={[y]:!0,[`${y}--lg`]:"large"===o,[`${y}--sm`]:"small"===o};return t.createElement(M,{open:d,trigger:["click"],dropdownRender:()=>v(),overlayClassName:Pe(b),placement:"bottomRight",overlayStyle:{minWidth:160},getPopupContainer:()=>c.current,onOpenChange:e=>{u(e)}},t.createElement("a",{ref:c,style:{padding:"5px 0"}},t.createElement(We,null)))};Io.displayName="FieldsFilter";const Ro=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(Ml),{value:i,onChange:l,onValuesChange:a}=e,{t:o}=Fn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h,onFocus:f,onBlur:g,onEnter:v,onClear:y}=e.option,{prefix:b,suffix:x,password:E,maxLength:w,pattern:C,toUpper:S,toTrim:N,autoFocus:T,autoComplete:I,secretType:R}=s,k=R&&(m||h),L=t.useRef(),A=t.useRef(!1);t.useEffect((()=>{var e;const t=()=>null==y?void 0:y(),n=null===(e=L.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return p&&n&&n.addEventListener("click",t),()=>{null==n||n.removeEventListener("click",t)}}),[]);const P=e=>{null==l||l(e),a(e)},_=E?O.Password:O,D=k?((e="",t)=>(e=e.toString(),"finance"===t&&(e=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","))(e)),"name"===t&&(e=e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**")),"phone"===t&&(e=e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2")),"IDnumber"===t&&(e=e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2")),"bankNumber"===t&&(e=e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")),e))(i,R):i;return r.isOnlyShow?t.createElement(Eo,{value:(e=>e&&E?new Array(e.length).fill("*").join(""):e)(D),bordered:u}):t.createElement(_,{ref:e=>{L.current=e,"function"==typeof n&&n(e)},value:D,autoComplete:E?"new-password":I,autoFocus:T,placeholder:d,style:c,title:E?"":D,prefix:b,suffix:x,maxLength:w,bordered:u,allowClear:p,readOnly:m,disabled:h,onFocus:e=>{null==f||f(e.target.value,e)},onBlur:t=>{var n;let r=null!==(n=t.target.value)&&void 0!==n?n:"";if(N){const e=r.trim();r!==e&&(r=e,P(r))}(t=>{const{onBlur:n}=e;null==n||n(t)})(r),null==g||g(r,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==v||v(n,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=L.current)||void 0===t||t.blur())}},onCompositionStart:()=>{A.current=!0},onCompositionEnd:()=>{A.current=!1},onChange:e=>{let t=e.target.value;ge(C)&&(t=C.test(t)?t:null!=i?i:""),S&&!A.current&&(t=t.toUpperCase()),P(t)}})}));Ro.displayName="VInput";class Oo extends d{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Ro,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:t=>{h(t),e.setViewValue(l,t)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Oo.contextType=Ml;const ko=e=>{const{$$form:n}=t.useContext(Ml),{value:r=[],onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{options:o={},placeholder:s=a("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{prefix:m,suffix:h,maxLength:f}=o,g=e=>{const t=e.every((e=>!e))?[]:e;null==i||i(t),l(t,v(t))},v=e=>e.join(" - ");return n.isOnlyShow?t.createElement(Eo,{value:v(r),bordered:c}):t.createElement(O.Group,null,t.createElement(O,{value:r[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:s[0],prefix:m,suffix:h,maxLength:f,allowClear:d,bordered:c,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([t,r[1]])}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t.createElement(O,{value:r[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:s[1],prefix:m,suffix:h,maxLength:f,bordered:c,allowClear:d,readOnly:u,disabled:p,onChange:e=>{const{value:t}=e.target;g([r[0],t])}}))};class Lo extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(s),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(o)},required:e.getFormItemRequired(u)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ko,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(l,n)}}))),c&&t.createElement(D,{flex:Zn(c.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},c)))))}}Lo.contextType=Ml;const Ao=t.forwardRef(((e,n)=>{const{$$form:r}=t.useContext(Ml),{value:i,onChange:l,onValuesChange:a}=e,{t:o}=Fn(),{options:s={},style:c={},placeholder:d=o("qm.form.inputPlaceholder"),bordered:u=!0,readOnly:p,disabled:m,onFocus:h,onBlur:f,onEnter:g}=e.option,{step:v=1,min:y,max:b,precision:x,autoFocus:E,stringMode:w,textAlign:C="left",controls:S=!0,formatter:N,parser:T}=s,I=t.useRef(),R=t.useRef(i),O=e=>{const t=Qa(e)?"":oe(e)?e.toFixed(x):new Yt(e).toFixed(x);return"function"==typeof N?N(t):t},k={[C]:!0,controls:S};return r.isOnlyShow?t.createElement(Eo,{value:O(i),bordered:u}):t.createElement($,{ref:e=>{I.current=e,"function"==typeof n&&n(e)},value:i,className:Pe(k),placeholder:d,style:Object.assign({width:"100%"},c),step:v,min:y,max:b,controls:S,precision:x,autoFocus:E,stringMode:w,formatter:N,parser:T,bordered:u,readOnly:p,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{Bn((()=>{(t=>{const{onBlur:n}=e;null==n||n(t)})(R.current),null==f||f(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==g||g(i,e),r.isFilterType&&(r.SUBMIT_FORM(),null===(t=I.current)||void 0===t||t.blur()))},onChange:e=>{const t=null!=e?e:"";!w&&(Number(t)>Number.MAX_SAFE_INTEGER||Number(t)<Number.MIN_SAFE_INTEGER)||(e=>{R.current=e,null==l||l(e),a(e,O(e))})(t)}})}));Ao.displayName="VInputNumber";class Po extends d{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Ao,{ref:e=>this[n]=e,option:this.props.option,onValuesChange:(t,n)=>{h(t),e.setViewValue(l,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(l,u)),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Po.contextType=Ml;const _o=e=>{const{$$form:n}=t.useContext(Ml),{value:r=[],onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{options:o={},placeholder:s=a("qm.form.rangeInputNumberPlaceholder"),bordered:c=!0,allowClear:d,readOnly:u,disabled:p}=e.option,{step:m=1,min:h=0,max:f,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=o,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),w(e)},w=e=>{const t=e.every((e=>null===e))?[]:[...e];null==i||i(t),l(t,C(t))},C=e=>Qa(e)?"":e.map((e=>Qa(e)?"":Number(e).toFixed(y))),S={[g]:!0,controls:v};return n.isOnlyShow?t.createElement(Eo,{value:C(r),bordered:c}):t.createElement(O.Group,null,t.createElement($,{value:r[0],className:Pe("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:s[0],step:m,min:h,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{w([e,r[1]])},onBlur:()=>{E(r)}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:c,disabled:p,readOnly:!0}),t.createElement($,{value:r[1],className:Pe("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:s[1],step:m,min:h,max:f,controls:v,precision:y,formatter:b,parser:x,bordered:c,readOnly:u,disabled:p,onChange:e=>{w([r[0],e])},onBlur:()=>{E(r)}}))};class Do extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,labelWidth:o=e.props.labelWidth,className:s,extra:c,validateTrigger:d,rules:u=[],onChange:p=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(s),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(o)},required:e.getFormItemRequired(u)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:u,validateTrigger:d,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(_o,{option:this.props.option,onValuesChange:(t=[],n)=>{p(t),e.setViewValue(l,n)}}))),c&&t.createElement(D,{flex:Zn(c.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},c)))))}}var Ho;Do.contextType=Ml,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Ho||(Ho={}));const Fo=n(void 0),Mo={dataIndex:Ut.string.isRequired,title:Ut.string.isRequired,description:Ut.string,colSpan:Ut.number,width:Ut.number,minWidth:Ut.number,fixed:Ut.oneOf(["left","right"]),align:Ut.oneOf(["left","center","right"]),theadAlign:Ut.oneOf(["left","center","right"]),printFixed:Ut.bool,hidden:Ut.bool,noAuth:Ut.bool,noFixed:Ut.bool,ellipsis:Ut.bool,className:Ut.string,theadClassName:Ut.string,children:Ut.array,sorter:Ut.oneOfType([Ut.bool,Ut.func]),filter:Ut.shape({type:Ut.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:Ut.arrayOf(Ut.shape({text:Ut.string,value:Ut.oneOfType([Ut.string,Ut.number])})),style:Ut.object}),precision:Ut.number,displayPrecision:Ut.number,formatType:Ut.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:Ut.bool,canCopy:Ut.bool,editRender:Ut.func,dictItems:Ut.arrayOf(Ut.shape({text:Ut.string,value:Ut.oneOfType([Ut.string,Ut.number])})),summation:Ut.shape({sumBySelection:Ut.bool,displayWhenNotSelect:Ut.bool,dataKey:Ut.string,unit:Ut.string,render:Ut.func}),groupSummary:Ut.shape({dataKey:Ut.string,unit:Ut.string,render:Ut.func}),shouldCellUpdate:Ut.func,headRender:Ut.func,render:Ut.func};Ut.arrayOf(Ut.shape(Mo)).isRequired,Ut.func,Ut.array,Ut.oneOfType([Ut.string,Ut.func]).isRequired,Ut.number,Ut.bool,Ut.bool,Ut.shape({api:Ut.func.isRequired,params:Ut.object.isRequired,formatter:Ut.func,beforeFetch:Ut.func,afterFetch:Ut.func,stopToFirst:Ut.bool,dataKey:Ut.string,callback:Ut.func}),Ut.bool,Ut.bool,Ut.string,Ut.string,Ut.object,Ut.bool,Ut.bool,Ut.bool,Ut.oneOfType([Ut.object,Ut.func]),Ut.oneOfType([Ut.object,Ut.func]),Ut.array,Ut.func,Ut.bool,Ut.object,Ut.object,Ut.shape({type:Ut.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:Ut.array,selectedRowKeys:Ut.array,hideSelectAll:Ut.bool,checkStrictly:Ut.bool,filterable:Ut.bool,selectByClickRow:Ut.bool,selectFirstRowOnChange:Ut.bool,clearableAfterFetched:Ut.bool,selectAllOnCurrentPage:Ut.bool,fetchSelectedRows:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),fetchAllRowKeys:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),disabled:Ut.func,onChange:Ut.func,onSelect:Ut.func,onSelectAll:Ut.func}),Ut.shape({currentRowKey:Ut.oneOfType([Ut.number,Ut.string]),disabled:Ut.func,onChange:Ut.func}),Ut.shape({virtual:Ut.bool,overscan:Ut.number,doubleXScrollbar:Ut.bool}),Ut.shape({expandIconColumn:Ut.string}),Ut.shape({defaultExpandAllRows:Ut.bool,defaultExpandedRowKeys:Ut.array,expandedRowKeys:Ut.array,hideExpandAll:Ut.bool,rowExpandable:Ut.func,expandedRowClassName:Ut.string,expandedRowRender:Ut.func,onExpand:Ut.func,onChange:Ut.func}),Ut.shape({cellMerge:Ut.bool,onCellMerge:Ut.func,onSelectChange:Ut.func}),Ut.shape({groupItems:Ut.arrayOf(Ut.shape({dataIndex:Ut.string.isRequired,titleIndex:Ut.string,color:Ut.string,backgroundColor:Ut.string})),fetch:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),onChange:Ut.func}),Ut.func,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.shape({current:Ut.number,pageSize:Ut.number,pageSizeOptions:Ut.array,showSizeChanger:Ut.bool,showQuickJumper:Ut.bool}),Ut.shape({fileName:Ut.string,fetch:Ut.shape({api:Ut.func.isRequired,params:Ut.object}),beforeExport:Ut.func,cellStyle:Ut.bool,hideIcon:Ut.bool}),Ut.shape({showLogo:Ut.bool}),Ut.shape({fetch:Ut.shape({api:Ut.func.isRequired,params:Ut.object,dataKey:Ut.string}),fieldList:Ut.arrayOf(Ut.object)}),Ut.shape({position:Ut.oneOf(["top","bottom"]),hideAlert:Ut.bool,hideClearButton:Ut.bool}),Ut.oneOf(["left","right"]),Ut.func,Ut.func,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.bool,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func,Ut.func;const $o={columns:[],dataSource:[],rowKey:"id",border:!0,resizable:!0,showHeader:!0,ellipsis:!0,multipleSort:!0,topSpaceAlign:"right",showFullScreen:!0,showRefresh:!0,showClipboard:!0,showSelectCollection:!0,showSuperSearch:!0,showFastSearch:!0,showGroupSummary:!0,showColumnDefine:!0,showTableInfo:!0},qo=10,jo="1",Ko="0",Vo="YYYY-MM-DD",zo="YYYY-MM-DD HH:mm:ss",Wo="YYYYMMDDHHmmss",Bo={bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}}};var Uo;!function(e){e.left="flex-start",e.right="flex-end"}(Uo||(Uo={}));const Go=Object.assign({},e).useId;let Yo=0;var Xo=Go?function(e){const t=Go();return e||t}:function(t){const[n]=e.useState(`qm_unique_${Yo}`);return e.useEffect((()=>{Yo+=1}),[]),t||n};let Qo=[];const Zo={_getInstance:function(e){var t;return null!==(t=Qo.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=Qo[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==Qo.findIndex((e=>e===t))&&(this.deregister(e),Qo=[t,...Qo])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),Qo=[{id:e,vm:t},...Qo])},deregister:function(e){e&&(Qo=Qo.filter((t=>t.id!==e)))}};class Jo{constructor(){this.state={required:[],validate:[],edited:[],inserted:[],updated:[],removed:[]},this.addToRequired=e=>{-1===this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.required.push(e)},this.removeFromRequired=e=>{const t=this.state.required.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.required.splice(t,1)},this.addToValidate=e=>{-1===this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.validate.push(e)},this.removeFromValidate=e=>{const t=this.state.validate.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.validate.splice(t,1)},this.addToEdited=e=>{-1===this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y))&&this.state.edited.push(e)},this.removeFromEdited=e=>{const t=this.state.edited.findIndex((t=>t.x===e.x&&t.y===e.y));t<0||this.state.edited.splice(t,1)},this.addToInserted=e=>{-1===this.state.inserted.findIndex((t=>t===e))&&this.state.inserted.push(e)},this.removeFromInserted=e=>{const t=this.state.inserted.findIndex((t=>t===e));t<0||this.state.inserted.splice(t,1)},this.addToUpdated=e=>{-1===this.state.updated.findIndex((t=>t===e))&&this.state.updated.push(e)},this.removeFromUpdated=e=>{const t=this.state.updated.findIndex((t=>t===e));t<0||this.state.updated.splice(t,1)},this.addToRemoved=e=>{-1===this.state.removed.findIndex((t=>t===e))&&this.state.removed.push(e)},this.removeFromRemoved=e=>{const t=this.state.removed.findIndex((t=>t===e));t<0||this.state.removed.splice(t,1)},this.clearAllLog=()=>{this.state.required=[],this.state.validate=[],this.state.edited=[],this.state.inserted=[],this.state.updated=[],this.state.removed=[]}}destroy(){for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}const es={defaultColumnWidth:80,selectionColumnWidth:50,rowHeightMaps:{large:42,middle:34,small:26},sortDirections:["ascend","descend"],pagination:{current:1,pageSize:20,pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showQuickJumper:!0},groupSummary:{total:{text:"记录数",value:"*"},recordTotalIndex:"nRecordsCount",summaryFieldName:"tsummary",groupbyFieldName:"tgroupby"},highSearch:{showSQL:!1},treeTable:{textIndent:17},dataKey:"records",summationKey:"summation",totalKey:"total",virtualScrollX:50,virtualScrollY:100,sorterFieldName:"tsortby",filterFieldName:"twhere",currentPageName:"currentPage",pageSizeName:"pageSize",showFilterType:!0,printWidth:1040,operationColumn:"__action__",selectionColumn:"__selection__",expandableColumn:"__expandable__",summaryIgnore:"sumIgnored",popupClassName:"table-editable__popper"};function ts(e){return void 0!==e}function ns(t,n){const{defaultValue:r,value:i,onChange:l,postState:a}=n||{},[o,s]=e.useState((()=>ts(i)?i:ts(r)?"function"==typeof r?r():r:"function"==typeof t?t():t)),c=ts(i)?i:o,d=a?a(c):c,u=Mn(l),[p,m]=e.useState([c]);hn((()=>{const e=p[0];o!==e&&u(o,e)}),[p]),hn((()=>{ts(i)||s(i)}),[i]);return[d,Mn((e=>{s(e),m([c])}))]}const rs=e=>e.map((e=>{const t=Object.assign({},e);return t.children&&(t.children.forEach((e=>{t.fixed?e.fixed=t.fixed:delete e.fixed})),t.children=rs(t.children)),t})),is=(e,n)=>{const{fetch:r,columns:i,border:l,rowSelection:a,summation:o,expandable:s,treeConfig:c,webPagination:d,scrollPagination:u,showSuperSearch:p,showFastSearch:m,showGroupSummary:h,showTableImport:f,showClipboard:g,showSelectCollection:v,showPivotGrid:y,footRender:b}=e,{tableRef:x,getRowKey:E,tableFullData:w,tableFlatData:C,selectionKeys:S,sorter:N,filters:T,superFilters:I,pagination:R,mergedTdCells:O}=n,{selectionRows:k,summaries:L}=x.current,{expandIconColumn:A=""}=c||{},{t:P}=Fn(),_=e=>{const t=(e=>{const t=[],n=[],r=[];for(let i=0;i<e.length;i++){const l=e[i];"left"===l.fixed?t.push(l):"right"===l.fixed?n.push(l):r.push(l)}return[...t,...r,...n]})(rs(e)),n=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:es.selectionColumn,title:"radio"===t?P("qm.table.config.selectionText"):"",width:es.selectionColumnWidth,fixed:"left",type:t}})(a),r=(null==(i=s)?void 0:i.expandedRowRender)?{dataIndex:es.expandableColumn,title:"",width:es.selectionColumnWidth,fixed:"left",type:"expand"}:null;var i;return n&&t.unshift(n),r&&t.unshift(r),ea(t)},D=(e,t,n,r,i)=>{const l=`${t},${n}`;e.has(l)||e.set(l,{row:t,col:n,rowSpan:r,colSpan:i})},H=t.useMemo((()=>!!(null==r?void 0:r.api)),[null==r?void 0:r.api]),F=t.useMemo((()=>!H&&!!d),[H,d]),M=t.useMemo((()=>H&&!!u),[H,u]),$=t.useMemo((()=>(H||F)&&!M),[H,F,M]),q=t.useMemo((()=>_(i)),[i]),j=t.useMemo((()=>Jl(q)),[q]),K=t.useMemo((()=>j.filter((e=>"function"==typeof e.editRender))),[j]),V=t.useMemo((()=>j.filter((e=>!!e.summation))),[j]),z=t.useMemo((()=>j.filter((e=>"left"===e.fixed))),[j]),W=t.useMemo((()=>j.filter((e=>"right"===e.fixed))),[j]),B=t.useMemo((()=>(e=>{const t=new Map;return e.forEach((e=>{const n=C.findIndex((t=>E(t,t.index)===e.rowKey)),r=j.findIndex((t=>t.dataIndex===e.dataIndex));if(!(n<0||r<0)){D(t,n,r,e.rowSpan,e.colSpan);for(let i=0;i<e.rowSpan;i++)for(let l=0;l<e.colSpan;l++)0===i&&0===l||D(t,n+i,r+l,0,0)}})),Array.from(t.values()).sort(((e,t)=>e.row-t.row||e.col-t.col))})(O)),[O,j,w]),U=t.useMemo((()=>{var e,t;const n=j.filter((e=>![es.expandableColumn,es.selectionColumn,es.operationColumn].includes(e.dataIndex)));return A&&n.some((e=>e.dataIndex===A))?A:null!==(t=null===(e=n[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[j,A]),G=t.useMemo((()=>V.length>0),[V]),Y=t.useMemo((()=>!!b||G),[b,G]),X=t.useMemo((()=>da(q).length>1),[q]),Q=t.useMemo((()=>l||X),[l,X]),Z=t.useMemo((()=>j.some((e=>e.sorter))),[j]),J=t.useMemo((()=>j.some((e=>e.filter))),[j]),ee=t.useMemo((()=>V.some((e=>!!e.summation.dataKey))),[V]),te=t.useMemo((()=>!H&&!!f),[H,f]),ne=t.useMemo((()=>!!g&&K.length>0),[g,K]),re=t.useMemo((()=>!!v&&"checkbox"===(null==a?void 0:a.type)),[v,a]),ie=t.useMemo((()=>!!p&&J),[p,J]),le=t.useMemo((()=>!H&&!!m),[H,m]),ae=t.useMemo((()=>!H&&!!y),[H,y]),oe=t.useMemo((()=>!!h&&j.some((e=>!!e.groupSummary))),[j]),se=t.useMemo((()=>{var e;return!!(null===(e=null==o?void 0:o.groupItems)||void 0===e?void 0:e.length)}),[o]),ce=t.useMemo((()=>!C.length),[C]),de=t.useMemo((()=>(()=>{const e={};return V.forEach((t=>{const{dataIndex:n,precision:r,displayPrecision:i,summation:l}=t,{sumBySelection:a,displayWhenNotSelect:o,unit:s}=l,c=se?Ia(x.current.tableFullData):x.current.tableFullData,d=!k.length&&!!o;let u=(!a||d?c:k).reduce(((e,t)=>{if(null==t?void 0:t[es.summaryIgnore])return e;const r=ga(t,n);return ba(r)?e.plus(r):e}),new Yt(0));!Object.keys(L).includes(n)||a&&!d||(u=new Yt(ga(L,n))),va(e,n,u.toNumber());let p=r>=0?u.toFixed(r):u.toString();i>=0&&""!==p&&(p=Ea(p,i)),p=xa(p),va(e,`${n}_text`,s?`${p} ${s}`:p)})),[e]})()),[C,S,L]),ue=t.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(V)),[V]),pe=t.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((n=>{null!==e[n]&&t.push(`${n}|${e[n]}`)})),t.join(",")})(N),n=((e,t)=>{const n=[];if(Object.keys(e).length)for(const t in e){const[r,i]=t.split("|"),l=e[t];Object.keys(l).forEach((e=>{n.push({type:i,bracketLeft:"",fieldName:r,expression:e,value:l[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{n.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),n.length&&(n[n.length-1].logic=""),n})(T,I),i=t?{[es.sorterFieldName]:t}:null,l=n.length?{[es.filterFieldName]:n}:null,a=ue?{[es.groupSummary.summaryFieldName]:ue,usedJH:1}:null,o=null!==(e=null==r?void 0:r.params)&&void 0!==e?e:null,s={[es.currentPageName]:R.current,[es.pageSizeName]:R.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},i),l),a),o),s)}),[null==r?void 0:r.params,R.current,R.pageSize,N,T,I,ue]);return{isFetch:H,isWebPagination:F,isScrollPagination:M,showPagination:$,tableColumns:q,flattenColumns:j,editableColumns:K,summationColumns:V,leftFixedColumns:z,rightFixedColumns:W,derivedMergeCells:B,treeExpandIndex:U,showSummary:G,showFooter:Y,isHeadGroup:X,bordered:Q,isHeadSorter:Z,isHeadFilter:J,isServiceSummation:ee,isSelectCollection:re,isTableImport:te,isTableClipboard:ne,isSuperSearch:ie,isFastSearch:le,isPivotGrid:ae,isGroupSummary:oe,isGroupSubtotal:se,isTableEmpty:ce,summationRows:de,fetchParams:pe}},ls=(e,n)=>{const{rowKey:r,height:i,dataSource:l,summation:a,fetch:o,initialSorter:s,initialFilter:c,rowSelection:d,expandable:u,tableConfig:p,authConfig:m,ignorePageIndex:h,columnsChange:f,onChange:g,onDataChange:v,onDataLoad:y,onScrollEnd:b,onFetchError:x}=e,{getRowKey:E,tableRef:w,tableElementRef:C,tableBodyRef:S,$size:N,tableColumns:T,flattenColumns:I,tableFullData:R,pagination:O,layout:k,filters:L,sorter:A,superFilters:P,fetchParams:_,selectionKeys:D,rowExpandedKeys:H,highlightKey:F,summationColumns:M,isFetch:$,isWebPagination:q,isScrollPagination:j,isServiceSummation:K,isGroupSubtotal:V,doLayout:z,setTableFullData:W,setTableOriginData:B,setTableFlatData:U,setAllTableData:G,setDeriveRowKeys:Y,setPagination:X,setPingRight:Q,setPingLeft:Z,setSpinning:J,setSorter:ee,setFilters:te,setSuperFilters:ne,setSelectionKeys:re,setRowExpandedKeys:ie,setHighlightKey:le,setSelectionRows:ae,setScrollXLoad:oe,setScrollYLoad:se,setFieldAuth:ce,setResizeState:de,setSummaries:pe,setPermission:me,setRecordsMap:he,resetTableScroll:fe,clearElementStore:ge,clearRecordsMap:ye}=n,{t:be}=Fn(),{store:xe}=w.current,Ee=t.useRef(Object.assign({},_)),we=t.useRef(!1),Ce=sl(C);hn((()=>{Oe(),z()}),[T]),hn((()=>{Se()}),[Ce.width,Ce.height,N,i,k.tableAutoHeight]),Mi((()=>{rt(),it(),lt(),$||(q&&Xe(),ze(l)),s&&ee(s),c&&te(c)}),[l,null==o?void 0:o.params]),Mi((()=>{const e=$e(_,Ee.current);e||$&&(null==d?void 0:d.clearableAfterFetched)&&at(),!e&&_[es.currentPageName]>1&&!(null==o?void 0:o.stopToFirst)?Xe():$&&Ke(),Ee.current=_}),[_]),Mi((()=>{q&&Je(),j||fe(),He()}),[O.current,O.pageSize]),Mi((()=>{$||Te(R.length),z()}),[R]),Mi((()=>{w.current.isTreeTable&&Je()}),[H]);const Se=()=>{const{scrollBarRef:e,resizeState:t}=w.current,{width:n,height:r}=Ce;z(),k.tableBodyWidth>n&&Q(!0),e.current.scrollLeft>0&&Z(!0),de(Object.assign({},t,{width:n,height:r}))},Ne=()=>{F&&S.current.setClickedValues([F,""]),"radio"===(null==d?void 0:d.type)&&D.length&&S.current.setClickedValues([D[0],""])},Te=e=>{e!==O.total&&X((t=>Object.assign({},t,{total:e})))},Ie=e=>{we.current=e},Re=cl((e=>{Ue(),null==b||b(e)})),Oe=()=>{oe(I.length>es.virtualScrollX)},ke=(e=[])=>{let t=e.length>es.virtualScrollY;w.current.isTreeTable&&(t=!0),(null==p?void 0:p.virtual)&&(t=!0),se(t)},Le=e=>V?Ae(Pe(e,0)):e,Ae=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Ae(e.children)),delete e.children,t.push(e)})),t},Pe=(e,t)=>{var n;const i=null===(n=a.groupItems)||void 0===n?void 0:n[t];if(!i)return e.forEach(((t,n)=>{t._rowSpan=0===n?e.length:0,t._colSpan=1})),e;return Oa(e,[i.dataIndex]).map((e=>{const n={children:Pe(e,t+1),_group:i.dataIndex};return"function"!=typeof r&&va(n,r.toString(),Sa()),i.titleIndex&&va(n,i.titleIndex,ga(e[0],i.titleIndex)),va(n,i.dataIndex,ga(e[0],i.dataIndex)),M.forEach((e=>{var t;const{dataIndex:r}=e,i=null===(t=n.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[es.summaryIgnore])return e;const n=Number(ga(t,r));return Number.isNaN(n)?e:e+n}),0);va(n,r,i)})),n}))},_e=e=>{re(e),ae((e=>{const{selectionRows:t,recordsMap:n}=w.current,r=new Map;t.forEach((e=>r.set(E(e,e.index),e)));const i=[];for(let t=0,l=e.length;t<l;t++){const l=r.get(e[t])||n.get(e[t]);l&&i.push(l)}return i})(e))},De=e=>{const{type:t,checkStrictly:n=!0}=d||{},r=Array.isArray(e)?e:D;let i=[];return w.current.isTreeTable&&!n&&r.forEach((e=>{i.push(...((e,t)=>{var n;const{disabled:r}=d||{},{deriveRowKeys:i,recordsMap:l}=w.current,a=oa(i,e);let o=[];if(!a)return o;let s=Pa((null==a?void 0:a.children)||[]);return r&&(s=s.filter((e=>!l.has(e)||!r(l.get(e))))),o=[...new Set([...t,...s])],((null===(n=La(i,e))||void 0===n?void 0:n.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=oa(i,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=r?[...o,e]:o.filter((t=>t!==e))})),o})(e,r))})),i="radio"===t?r.slice(0,1):[...new Set([...r,...i])],i},He=cl((()=>{null==g||g(O,Me(L),Fe(A),P,{currentDataSource:Ze()})})),Fe=e=>{const t={};for(const n in e)null!==e[n]&&(t[n]=e[n]);return t},Me=e=>{const t={};for(const n in e){if(!n.includes("|"))continue;const[r,i]=n.split("|");t[`${r}|${i}`]=e[n]}return t},$e=(e,t)=>{const n=Object.keys(fa(e,t));return 1===n.length&&(n.includes(es.currentPageName)||n.includes(es.pageSizeName))},qe=()=>Hn(void 0,void 0,void 0,(function*(){var t;if(!m)return;let n=Xn(m,["fetch"]);if(m.fetch){const{api:e,params:r,dataKey:i}=m.fetch;try{const l=yield e(r);200===l.code&&(n=null!==(t=i?ue(l.data,i):l.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(n).length){const{isExport:e=1,isImport:t=1,isPrint:r=1}=n;me((n=>Object.assign({},n,{export:!!e,import:!!t,print:!!r})))}if(Array.isArray(n.fieldList)){const t=na(e.columns,(e=>{const{dataIndex:t}=e,r=n.fieldList.find((e=>e.dataIndex===t));if(r){const{visible:n=1,disabled:i,secretName:l}=r,a=ra(w.current.originColumns,t);ce(t,{visible:n,disabled:i,secretName:l}),n||(e.noAuth=!0,a.noAuth=!0),l&&(e.formatType=`secret-${l}`,a.formatType=`secret-${l}`)}}));null==f||f(t)}})),je=Mn((()=>Hn(void 0,void 0,void 0,(function*(){var e,t,n;if(!o)return;const{formatter:r=(e=>e),beforeFetch:i=zn,afterFetch:l,callback:s}=o;if(!i(_))return;const c=!!(null===(e=null==a?void 0:a.fetch)||void 0===e?void 0:e.api);J(!0);try{const[e,i]=c?yield Promise.all([o.api(r(_)),a.fetch.api(r(_))]):[yield o.api(r(_))];if(w.current.unMounted)return;if(c?200===e.code&&200===i.code:200===e.code){const r=null!==(t=o.dataKey)&&void 0!==t?t:es.dataKey;let a=null!==(n=ue(e.data,r))&&void 0!==n?n:[];a="function"==typeof l?yield l(a):a;const c=ue(e.data,r.replace(/[^.]+$/,es.totalKey))||a.length||0,d=Math.max(Math.ceil(c/O.pageSize),1);if(_[es.currentPageName]>d)return Ge(Object.assign(Object.assign({},O),{current:d}));ze(we.current?w.current.tableFullData.concat(a):a),Te(c),We((null==i?void 0:i.data)||e.data),null==s||s(e.data,e)}}catch(e){null==x||x(e)}var d,u;d=o,u="stopToFirst",Object.prototype.hasOwnProperty.call(d,u)&&(o.stopToFirst=!1),J(!1),Ie(!1)})))),Ke=cl(je),Ve=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=Ve(e.children)),e.index=t,h||(e.pageIndex=(e=>{const{current:t,pageSize:n}=O;return!$||j?e:(t-1)*n+e})(t)),e))),ze=e=>{const t=Le(Ve(e));et(t),tt(t),_e(De()),ie((e=>{const{isTreeTable:t,allRowKeys:n,allParentRowKeys:r,deriveRowKeys:i,recordsMap:l}=w.current,{defaultExpandAllRows:a,rowExpandable:o,expandedRowRender:s}=u||{};let c=Array.isArray(e)?e:[...H];if(a)c=t?r:n;else if(t){s&&tr("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[...D];F&&e.unshift(F),e.forEach((e=>{const t=La(i,e)||[];c.push(...t.length>1?t.slice(0,-1).reverse():t)})),c=[...new Set(c)]}return o&&c.filter((e=>{const t=l.get(e);return!!t&&o(t)})),c})()),Be(),null==y||y(t)},We=e=>{var t,n,r;if(!K)return;const i=null!==(n=null===(t=null==a?void 0:a.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==n?n:es.summationKey,l=null!==(r=i?ue(e,i):e)&&void 0!==r?r:{},o={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{va(o,e.dataIndex,Number(ga(l,e.summation.dataKey)))})),pe(o)},Be=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=Ze();if(e.length){const t=E(e[0],e[0].index);_e([t])}else _e([])}},Ue=()=>{if(!j)return;const e=Ye();we.current||O.current>=e||(Ie(!0),Ge(Object.assign(Object.assign({},O),{current:O.current+1})))},Ge=({current:e,pageSize:t})=>{X((n=>Object.assign({},n,{current:e,pageSize:t})))},Ye=()=>{const{pageSize:e,total:t}=O;return Math.ceil(t/e)||1},Xe=()=>{Ge(Object.assign({},O,{current:1}))},Qe=()=>{const{current:e,pageSize:t}=O;return w.current.tableFullData.slice((e-1)*t,e*t)},Ze=()=>q?Qe():w.current.tableFullData,Je=()=>{const{allTableData:e,isTreeTable:t}=w.current,n=q?sa(Qe()):e,r=t?(e=>{const t=new Map,n=[];return e.forEach((e=>{const r=E(e,e.index);if(!e._parentRowKey)return n.push(e),t.set(r,!0);H.includes(e._parentRowKey)&&t.get(e._parentRowKey)&&(n.push(e),t.set(r,!0))})),t.clear(),n})(n):n;ke(r),U(r)},et=e=>{W(e),G(e),Y(e),nt(),Je()},tt=e=>{B(e)},nt=()=>{ye(),w.current.allTableData.forEach((e=>he(E(e,e.index),e)))},rt=()=>{ee({})},it=()=>{te({})},lt=()=>{ne([])},at=()=>{_e([])};return{initialTable:()=>{qe(),Ne(),Oe(),ke(),$?je():ze(l)},checkDataIndex:()=>{const e=I.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&tr("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:et,getTableData:je,createTableList:Ze,createTableData:ze,createGroupData:Le,setSelectionKeysEffect:_e,doFieldValidate:(e,t,n,r,i)=>{if(!Array.isArray(e))return tr("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(xe.removeFromRequired({x:n,y:r}),xe.removeFromValidate({x:n,y:r}),e.forEach((e=>{var l;e.required&&Gn(t)&&xe.addToRequired({x:n,y:r,text:e.message||i+be("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(l=e.validator)||void 0===l?void 0:l.call(e,t))||xe.addToValidate({x:n,y:r,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:n,updated:r,removed:i}=xe.state,l=ve(n,i),a=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:a(e),validate:a(t),inserted:n.filter((e=>!l.includes(e))),updated:r.filter((e=>![...ve(r,n),...ve(r,i)].includes(e))),removed:i.filter((e=>!l.includes(e)))}},dataChange:()=>{null==v||v(w.current.tableFullData)},tableChange:He,toLastPage:()=>{const e=Ye();O.current!==e&&Ge(Object.assign({},O,{current:e}))},toFirstPage:Xe,getPageCount:Ye,pagerChangeHandle:Ge,scrollBottomDebouncer:Re,clearTableSorter:rt,clearTableFilter:it,clearSuperFilters:lt,clearRowSelection:at,clearRowHighlight:()=>{le("")},clearTableLog:()=>{xe.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=w.current;ge(),xe.destroy(),e.deregister(t)}}},as=(e,n)=>{const{height:r,minHeight:i,maxHeight:l,ellipsis:a,showHeader:o,spanMethod:s}=e,{getRowKey:c,tableRef:d,topElementRef:u,tableElementRef:p,tableBodyRef:m,$size:h,tableColumns:f,flattenColumns:g,leftFixedColumns:v,derivedMergeCells:y,tableFlatData:b,layout:x,showFooter:E,showPagination:w,isFullScreen:C,setLayout:S,setElementStore:N}=n,T=t.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=x,n={};return i&&Object.assign(n,{minHeight:`${ha(i)}px`}),l&&Object.assign(n,{maxHeight:`${ha(l)}px`}),C?Object.assign(Object.assign({},n),{maxHeight:"",minHeight:"",height:`${e}px`}):r?Object.assign(Object.assign({},n),{height:"auto"!==r?`${ha(r)}px`:`${t}px`}):n}),[r,l,i,C,x]),I=(e,t)=>{const{scrollBarRef:n,scrollYLoad:r,rowHeight:i}=d.current;if(void 0!==t&&t>=0)if(t<b.length)if(r)m.current.scrollToYIndex(t);else{const e=R(c(b[t],b[t].index));e&&n.current.SET_SCROLL_TOP(e.offsetTop)}else n.current.SET_SCROLL_TOP(t*i);else if(r){const t=b.findIndex((t=>e===c(t,t.index)));t>=0&&m.current.scrollToYIndex(t)}else{const t=R(e);t&&n.current.SET_SCROLL_TOP(t.offsetTop)}},R=e=>d.current.elementStore.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);return{createElementStore:()=>{N("$toper",u.current),N("$table",p.current)},tableStyles:T,getSpan:(e,t,n,r,i)=>{let l=1,a=1;if("function"==typeof s){const o=s({row:e,column:t,rowIndex:n,columnIndex:r,tableData:i});Array.isArray(o)?(l=o[0],a=o[1]):ae(o)&&(l=o.rowSpan,a=o.colSpan)}if(y.length>0){const e=y.find((e=>e.row===n&&e.col===r));e&&(l=e.rowSpan,a=e.colSpan)}return{rowSpan:l,colSpan:a}},getStickyLeft:e=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=ra(f,e);e=t?ia(t).dataIndex:""}let t=0;for(let n=0;n<g.length;n++){const r=g[n];if(r.dataIndex===e)break;t+=r.width||r.renderWidth||0}return t},getStickyRight:(e,t)=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=ra(f,e);e=t?la(t).dataIndex:""}const n="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let n=[];return e.forEach((e=>{e.colSpan>0&&n.length>0&&(t.push(n),n=[]),n.push(e)})),n.length>0&&t.push(n),t.map((e=>{const[t,n]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...n,...t.reverse()]})).flat()})(g):g;let r=0;for(let t=n.length-1;t>=0;t--){const i=n[t];if(i.dataIndex===e)break;r+=i.width||i.renderWidth||0}return r},scrollXToColumn:(e,t)=>{const n=void 0===t?g.findIndex((t=>t.dataIndex===e)):t;if(n<0)return;const{scrollBarRef:r}=d.current,i=v.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),l=g.slice(0,n).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);r.current.SET_SCROLL_LEFT(l-i)},scrollYToRecord:I,calcTableHeight:()=>{if("auto"!==r)return;const{elementStore:e,resizeState:t}=d.current;try{const n=t.winHeight-e.$table.getBoundingClientRect().top-(w?Ho["small"!==h?"middle":h]+qo:0)-qo;S((e=>Object.assign({},e,{tableAutoHeight:n})))}catch(e){}},resetTableScroll:()=>{I("",0)},doLayout:()=>{(()=>{const{elementStore:e,scrollXLoad:t}=d.current,n=e.$table.clientWidth,{defaultColumnWidth:r}=es,i=[];let l=0;if(g.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,l+=e.width):(e.renderWidth=void 0,i.push(e))})),i.length>0){const e=g.reduce(((e,t)=>e+(t.width||t.minWidth||r)),0);if(e<=n){const t=n-e;if(1===i.length)i[0].renderWidth=(i[0].minWidth||r)+t;else{const e=t/i.reduce(((e,t)=>e+(t.minWidth||r)),0);let n=0;i.forEach(((t,i)=>{if(0===i)return;const l=Math.floor((t.minWidth||r)*e);n+=l,t.renderWidth=(t.minWidth||r)+l})),i[0].renderWidth=(i[0].minWidth||r)+t-n}}else i.forEach((e=>{e.renderWidth=e.minWidth||r}));S((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,n)})))}else l=g.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||r)),0),S((e=>Object.assign(Object.assign({},e),{tableBodyWidth:l})));S((e=>Object.assign(Object.assign({},e),{tableWidth:n}))),t&&m.current.resetItemXSize(g)})(),Bn((()=>(()=>{const{elementStore:e,scrollYLoad:t,resizeState:n}=d.current;if(!e.$table.offsetParent)return;const r=e.$table.offsetHeight,i=o?e.$header.offsetHeight:x.headerHeight,l=E?e.$footer.offsetHeight:x.footerHeight,a=r-i-l,s=e.$tableBody.offsetHeight;let c=0;if(C){const t=e.$toper?e.$toper.offsetHeight+qo:0,r=e.$pager?e.$pager.offsetHeight+qo:0;c=n.winHeight-t-r-20}S((e=>Object.assign({},e,{headerHeight:i,footerHeight:l,viewportHeight:a,tableBodyHeight:s,tableFullHeight:c})))})()))}}};function os({handler:t,delay:n=0}){const r=Rl(t,n),i=Mn(n>0?r:t);e.useEffect((()=>(window.addEventListener("resize",i),()=>window.removeEventListener("resize",i))),[i])}const ss=e=>{const{total:n}=e,{tableRef:r,prefixCls:i,selectionKeys:l,isHeadSorter:a,isHeadFilter:o,clearTableSorter:s,clearTableFilter:c,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:p,setActivedCell:m}=t.useContext(Fo),{infoBarConfig:h,rowSelection:f,rowHighlight:g}=r.current.props,{allTableData:v,invalidRowKeys:y}=r.current,{hideAlert:b,hideClearButton:x}=h||{},{t:E}=Fn(),w=t.useMemo((()=>!b),[b]),C=t.useMemo((()=>!x&&!!(a||o||f||g)),[x,a,o,f,g]),S={[`${i}__alert`]:!0};return w?t.createElement("div",{className:Pe(S)},t.createElement("i",{className:"svgicon icon"},t.createElement(Ue,null)),t.createElement("span",null,E("qm.table.alert.total",{total:r.current.isTreeTable?v.length:n}),f?`,${E("qm.table.alert.selected",{total:Math.max(l.length-y.length,0)})}`:""),C&&t.createElement("em",{onClick:()=>{c(),d(),u(),p(),Bn((()=>s())),m({})}},E("qm.table.alert.clear"))):null},cs=t.forwardRef(((e,n)=>{const{isFullScreen:r,open:i=!0}=e,{prefixCls:l,setFullScreen:a}=t.useContext(Fo),{t:o}=Fn(),s=()=>{a(!r)};return t.useImperativeHandle(n,(()=>({clickHandle:s}))),i?t.createElement("span",{className:`${l}-full-screen`,title:o(r?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},r?t.createElement(Ve,null):t.createElement(ze,null))):null}));cs.displayName="FullScreen";const ds=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i,getTableData:l}=t.useContext(Fo),{t:a}=Fn(),o=()=>{l()};return t.useImperativeHandle(n,(()=>({clickHandle:o}))),r?t.createElement("span",{className:`${i}-reload`,title:a("qm.table.refresh.text"),onClick:()=>o()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ge,null))):null}));ds.displayName="Reload";const us=()=>{const e={dateFormat:e=>{const t=e?m(e).format(Vo):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?m(e).format(zo):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?m(e).format(zo.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>ba(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>xa(e.toString()),secretNameFormat:e=>e.replace(/^([\u4e00-\u9fa5]{1}).+$/,"$1**"),secretPhoneFormat:e=>e.replace(/^(\d{3}).+(\d{4})$/,"$1****$2"),secretIDnumberFormat:e=>e.replace(/^(\d{3}).+(\w{4})$/,"$1***********$2"),secretBankNumberFormat:e=>e.replace(/^(\d{4}).+(\w{3})$/,"$1************$2")},t=(t,n,r)=>{var i,l,a,o;const{dictItems:s,precision:c,displayPrecision:d,formatType:u,editRender:p}=n,m=s||(null===(i=null==p?void 0:p(r,n))||void 0===i?void 0:i.items)||[];let h=null!==(o=null!==(a=null===(l=m.find((e=>e.value==t)))||void 0===l?void 0:l.text)&&void 0!==a?a:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(h=t.map((e=>{var t,n;return null!==(n=null===(t=m.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==n?n:e})).join(",")),c>=0&&""!==h&&(h=ba(h)?new Yt(h).toFixed(c):h),d>=0&&""!==h&&(h=Ea(h,d)),u){const t=e[`${Un(u)}Format`];t?h=t(h):tr("Table","字段的格式化类型 `formatType` 配置不正确")}return h},n=e=>jn(e)?Na(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:n,getTitleFromCellValue:(e,r,i,l)=>{const a=ga(e,r.dataIndex),o=r.render?r.render(a,e,r,i,l):t(a,r,e);return n(o)}}},ps=t.forwardRef(((e,n)=>{var r,i,l,a;const{tableColumns:o,open:s=!0}=e,{global:c}=t.useContext(on),{tableRef:d,prefixCls:u,flattenColumns:p,summationRows:m,showSummary:h,getSpan:f}=t.useContext(Fo),{tablePrint:g,showHeader:v}=d.current.props,{t:y}=Fn(),{getTitleFromCellValue:b}=us(),x=null!==(i=null===(r=null==c?void 0:c.print)||void 0===r?void 0:r.leftLogo)&&void 0!==i?i:"",E=null!==(a=null===(l=null==c?void 0:c.print)||void 0===l?void 0:l.rightLogo)&&void 0!==a?a:"",w=!(!x&&!E),C=t.useMemo((()=>Qn(aa(o,[es.expandableColumn,es.selectionColumn,es.operationColumn]))),[o]),S=t.useMemo((()=>Qn(aa(p,[es.expandableColumn,es.selectionColumn,es.operationColumn]))),[p]),N=t.useMemo((()=>Qn(o.filter((e=>e.printFixed)))),[o]),T=e=>{const t=Object.assign({},ka(C,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?T(t):t},I=(e,t)=>ye(be(xe(e),t),Ee(((...e)=>we(...e,((e,n)=>{if(Array.isArray(e))return I(e.concat(n),t)}))))),R=e=>{const t=[];return e.forEach((e=>{let n=[];e.forEach((e=>{1===e.level?n.push(e):n.push(T(e))})),n=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const n=e.filter((e=>e.dataIndex===t));return n.length<=1?n[0]:I(n,"dataIndex")[0]})))(n),t.push(da(n))})),t},O=()=>{const e=(e=>{const t=[];let n=[],r=0,i=0;for(;i<e.length;){const l=e[i];r+=l.width||l.renderWidth,r<=es.printWidth?(n.push(l),i===e.length-1&&t.push(n),i++):i>0?(e.splice(0,i),N.length&&e.unshift(...N),t.push(n),n=[],r=0,i=0):(l.width=es.printWidth,n.push(l),t.push(n),i++)}return t})([...S]),t=R(e);let n=["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">',"<style>\n * {\n margin: 0;\n padding: 0;\n }\n body * {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n }\n table--print {\n font-size: 14px;\n text-align: left;\n }\n .table--print th,\n .table--print td {\n padding: 5px;\n border: 1px solid #000;\n }\n .no-border th,\n .no-border td {\n border: 0!important;\n }\n .table--print th[colspan]:not([colspan='1']) {\n text-align: center;\n }\n .page-break {\n page-break-after: always;\n }\n</style>","</head>","<body>"].join("");for(let r=0;r<e.length;r++)n+=k(t[r],e[r],d.current.tableFullData),n+='<div class="page-break"></div>';return n+"</body></html>"},k=(e,t,n)=>{const{showLogo:r=!0}=g;let i='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${t.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,v&&(i+=["<thead>",r&&w?`<tr><th colspan="${t.length}" style="border: 0">${['<table class="no-border" width="100%" border="0" cellspacing="0" cellpadding="0">',"<tr>",'<td width="50%" align="left">',x?`<img src="${x}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',E?`<img src="${E}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Ta(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),n.length&&(i+=`<tbody>${sa(n).map((e=>`<tr>${t.map(((t,r)=>{const{rowSpan:i,colSpan:l}=f(e,t,e.index,r,n);if(!i||!l)return null;return`<td rowspan="${i}" colspan="${l}">${0===r&&e._level?`<span style="padding-left:${e._level*es.treeTable.textIndent}px"></span>`:""}${b(e,t,e.index,r)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),h&&m.length&&(i+=["<tfoot>",m.map((e=>`<tr>${t.map(((t,r)=>{const{dataIndex:i,summation:l}=t,a=(null==l?void 0:l.render)?l.render(n):ga(e,`${i}_text`);return`<td>${0===r&&""===a?y("qm.table.config.summaryText"):jn(a)?Na(a).join(""):a}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},L=()=>{var e;null===(e=((e,t)=>{const{filename:n,type:r,isDownload:i}=e,l=`${n}.${r}`;if(window.Blob){const e=new Blob([t],{type:`text/${r}`});if(!i)return Promise.resolve({type:r,content:t,blob:e});wl(e,l)}})({filename:"print",type:"html",isDownload:!1},O()))||void 0===e||e.then((({content:e,blob:t})=>{let n=document.createElement("iframe");n.setAttribute("frameborder","0"),n.setAttribute("width","100%"),n.setAttribute("height","0"),n.style.display="none",document.body.appendChild(n),d.current.isIE?(n.contentDocument.write(e),n.contentDocument.execCommand("print"),n.parentNode.removeChild(n),n=null):(n.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{n.parentNode.removeChild(n),n=null}))},n.src=URL.createObjectURL(t))}))};return t.useImperativeHandle(n,(()=>({clickHandle:L}))),s?t.createElement("span",{className:`${u}-print`,title:y("qm.table.print.text"),onClick:()=>L()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ye,null))):null}));ps.displayName="TablePrint";const ms="606060",hs="thin",fs="d4d4d4",gs=(e,t)=>{t&&(e.height=Math.floor(.75*t))},vs=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},ys=()=>({top:{style:hs,color:{argb:fs}},left:{style:hs,color:{argb:fs}},bottom:{style:hs,color:{argb:fs}},right:{style:hs,color:{argb:fs}}}),bs=e=>{const{children:t}=e;return t&&t.length?bs(t[0]):e},xs=e=>{const{precision:t,formatType:n}=e,r=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:r?`0${r}%`:"0%"}:"finance"===n?{numFmt:r?`#,##0${r}`:"#,##0"}:r?{numFmt:`0${r}`}:null},Es=()=>{const{tableRef:e,getSpan:n,showSummary:r,isHeadGroup:i}=t.useContext(Fo),{spanMethod:l,showHeader:a}=e.current.props,{t:o}=Fn(),s=(e,t)=>{var n,r,i;return null!==(i=null!==(r=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==r?r:t)&&void 0!==i?i:""};return{exportXLSX:(t,s,c,d)=>Hn(void 0,void 0,void 0,(function*(){const{columns:u,footSummation:p}=t,{rowHeight:m}=e.current,h=Jl(u),f=da(u),g=[],v=[],y=[],b=[];let x=0;const E={};h.forEach((e=>{const{dataIndex:t,width:n,renderWidth:r}=e;E[t]=Ta(e.title),y.push({key:t,width:(n||r||es.defaultColumnWidth)/8})})),a&&(i?f.forEach(((e,t)=>{const n={};e.forEach((e=>{const{colSpan:r,rowSpan:i}=e,l=bs(e),a=h.findIndex((({dataIndex:e})=>e===l.dataIndex));n[l.dataIndex]=Ta(e.title),0!==r&&(r>1||i>1)&&b.push({s:{r:t,c:a},e:{r:t+i-1,c:a+r-1}})})),g.push(n)})):(h.forEach(((e,t)=>{const{colSpan:n,rowSpan:r}=e;(n>1||r>1)&&b.push({s:{r:x,c:t},e:{r:x+r-1,c:t+n-1}})})),g.push(E)),x+=g.length);const w=sa(s).map(((e,t)=>{const r={};return h.forEach(((i,a)=>{if("function"==typeof l){const{rowSpan:r,colSpan:l}=n(e,i,t,a,s);(l>1||r>1)&&b.push({s:{r:t+x,c:a},e:{r:t+x+r-1,c:a+l-1}})}const o=["percent","finance"].includes(i.formatType);r[i.dataIndex]=o?ga(e,i.dataIndex):d(e,t,i,a)})),r._level=e._level,r}));x+=w.length,r&&p&&c(h,s).forEach(((e,t)=>{const n={};h.forEach(((t,r)=>{const{dataIndex:i,summation:l}=t,a=(null==l?void 0:l.render)?l.render(s):ga(e,i);n[i]=0===r&&""===a?o("qm.table.config.summaryText"):jn(a)?Na(a).join(""):a})),v.push(n)}));const{sheetName:C,useStyle:S}=t,N=new Xt.Workbook,T=N.addWorksheet(C);T.columns=y,a&&T.addRows(g).forEach((e=>{S&&gs(e,m),e.eachCell((e=>{const t=T.getColumn(e.col),n=ra(u,t.key),{align:r,theadAlign:i}=n;vs(e,i||r),S&&Object.assign(e,{font:{bold:!0,color:{argb:ms}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:ys()})}))})),T.addRows(w).forEach(((e,t)=>{const{_level:n}=w[t];S&&gs(e,m),e.eachCell((e=>{const t=T.getColumn(e.col),r=ra(u,t.key),{align:i}=r;vs(e,i),Object.assign(e,xs(r)),S&&Object.assign(e,{font:{color:{argb:ms}},border:ys()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),r&&p&&T.addRows(v).forEach((e=>{S&&gs(e,m),e.eachCell((e=>{const t=T.getColumn(e.col),n=ra(u,t.key),{align:r}=n;vs(e,r),Object.assign(e,xs(n)),S&&Object.assign(e,{font:{color:{argb:ms}},border:ys()})}))})),b.forEach((({s:e,e:t})=>{T.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const I=yield N.xlsx.writeBuffer();return new Blob([I],{type:"application/octet-stream"})})),exportCSV:(e,t)=>{const n=e=>{let t=e;const n=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),r=-1!==e.indexOf('"');return r&&(t=t.replace(/"/g,'""')),(n||r)&&(t='"'+t+'"'),t},r="\ufeff"+(e=>{let t,r,i,l,a="";for(t=0;t<e.rows.length;t+=1){for(i=e.rows[t],r=0;r<i.cells.length;r+=1)l=i.cells[r],a=a+(r?",":"")+n(l.textContent.trim());a+="\r\n"}return a})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var i;return((e,t,n)=>{t=t||"",n=n||512;const r=window.atob(e),i=[];let l;for(l=0;l<r.length;l+=n){const e=r.slice(l,l+n),t=new Array(e.length);let a;for(a=0;a<e.length;a+=1)t[a]=e.charCodeAt(a);const o=new window.Uint8Array(t);i.push(o)}return new window.Blob(i,{type:t})})((i=r,window.btoa(unescape(encodeURIComponent(i)))),"application/csv")},importXLSX:(e,t)=>{const{columns:n,file:r}=e,i=Jl(n),l=new FileReader;l.onerror=()=>{R.error(o("qm.table.import.error"))},l.onload=e=>{const n=i.map((e=>Ta(e.title))),r=new Xt.Workbook,l=e.target;l?r.xlsx.load(l.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),l=e.findIndex((e=>e&&e.length>0)),a=e[l],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(n,a);if(c){const r=e.slice(l+1).map((e=>{const t={};e.forEach(((e,n)=>{var r;let i=e;Array.isArray(null==i?void 0:i.richText)&&(i=i.richText.map((e=>e.text)).join("")),ae(i)&&"text"in i&&(i=i.text),Ce(i)&&(i=Ca(i,zo)),(null==i?void 0:i.formula)&&(i=null!==(r=i.result)&&void 0!==r?r:i.value),t[a[n]]=i}));const r={};return n.forEach(((e,n)=>{var l;const{dataIndex:a,dictItems:o}=i[n];Array.isArray(o)&&((null===(l=t[e])||void 0===l?void 0:l.toString().includes(","))?t[e]=t[e].split(",").map((e=>s(o,e))).filter((e=>""!==e)):t[e]=s(o,t[e])),va(r,a,t[e])})),r}));null==t||t(r)}else R.error(o("qm.table.import.error"))}else R.error(o("qm.table.import.error"))})):R.error(o("qm.table.import.error"))},l.readAsArrayBuffer(r)}}},ws=e=>{const{fileType:n,onChange:r}=e,{prefixCls:i}=t.useContext(Fo),{t:l}=Fn();let a,o;const s=e=>{const t=e.name,n=t.lastIndexOf("."),r=t.substring(n+1,t.length);return{filename:t.substring(0,n),type:r}},c=()=>Hn(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return a||(a=document.createElement("form"),o=document.createElement("input"),a.className=`${i}--file-form`,o.name="file",o.type="file",a.appendChild(o),document.body.appendChild(a)),new Promise(((e,n)=>{const r=!t.type;o.multiple=!!t.multiple,o.accept=r?"":`.${t.type}`,o.onchange=i=>{const{files:c}=i.target,d=c[0];let u="";if(!r)for(let e=0;e<c.length;e++){const{type:n}=s(c[e]);if(t.type!==n){u=n;break}}u?(R.warning(l("qm.upload.notType",{type:u})),n()):e(d),document.body.removeChild(a),a=null,o=null},a.reset(),o.click()}))})({type:n});null==r||r(e.name,e)}catch(e){}}));return t.createElement(nr,{onClick:()=>c()},l("qm.upload.text"))},Cs=e=>{const{columns:n,onClose:r}=e,{tableRef:i,prefixCls:l,createTableData:a,dataChange:o}=t.useContext(Fo),{beforeTableImport:s}=i.current.props,{t:c}=Fn(),{importXLSX:d}=Es(),u=t.useRef(null),[p,m]=t.useState(!1),[h,f]=t.useState(!0),g=e=>e.filter((e=>![es.expandableColumn,es.selectionColumn,"index","pageIndex",es.operationColumn].includes(e.dataIndex))),v={posIndex:"条"},[y,b]=t.useState([{type:"INPUT",label:c("qm.table.export.fileName"),fieldName:"fileName",render:(e,n)=>{const{fileName:r}=n.GET_FIELDS_VALUE(["fileName"]);return t.createElement(t.Fragment,null,r?t.createElement("span",null,r):t.createElement(ws,{fileType:n.state.formData.fileType,onChange:(e,t)=>{n.SET_FIELDS_VALUE({fileName:e,file:t}),t&&f(!1)}}))}},{type:"SELECT",label:c("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:c("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:c("qm.table.import.fillText"),value:"fill"},{text:c("qm.table.import.addText"),value:"add"},{text:c("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{y.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&u.current.SET_FIELDS_EXTRA(v),b([...y])}},{type:"INPUT_NUMBER",label:c("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:i.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]);return t.createElement("div",{className:`${l}-import__setting`},t.createElement(sh,{ref:u,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:v,items:y,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r(),style:{marginRight:8}},c("qm.table.export.closeButton")),t.createElement(nr,{type:"primary",loading:p,disabled:h,onClick:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();e||(m(!0),d({columns:g(n),file:t.file},(e=>Hn(void 0,void 0,void 0,(function*(){const{tableFullData:n,store:l}=i.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof s)try{e=yield s(e)}catch(e){}if("fill"===t.importType&&a(e),"add"===t.importType&&a([...n,...e]),"insert"===t.importType){const r=t.posIndex,i=n.slice(0,r).concat(e).concat(n.slice(r));a(i)}e.forEach((e=>{l.addToInserted(e)})),o(),R.success(c("qm.table.import.success",{total:e.length})),m(!1),r()})))))}))},c("qm.table.import.text"))))},Ss=t.forwardRef(((e,n)=>{const{tableColumns:r,open:i=!0}=e,{prefixCls:l}=t.useContext(Fo),{t:a}=Fn(),[o,s]=t.useState(!1),c=()=>{s(!0)};t.useImperativeHandle(n,(()=>({clickHandle:c})));const d={[`${l}-import`]:!0},u={visible:o,title:a("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>s(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:Pe(d),title:a("qm.table.import.textNoSpace"),onClick:()=>c()},t.createElement("i",{className:"svgicon icon"},t.createElement(Xe,null))),t.createElement(Fl,u,t.createElement(Cs,{columns:r,onClose:()=>s(!1)})))}));function Ns(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}function Ts(e,t,n,r){var i=Ft.unstable_batchedUpdates?function(e){Ft.unstable_batchedUpdates(n,e)}:n;return null!=e&&e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,i,r)}}}Ss.displayName="TableImport";var Is=u((function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,a=l(),s=l();p(t,(function(){return{}}));var c=l(!1);return!c.current&&Gr()&&(s.current=r(),a.current=s.current.parentNode,c.current=!0),o((function(){null==n||n(e)})),o((function(){return null===s.current.parentNode&&null!==a.current&&a.current.appendChild(s.current),function(){var e;null===(e=s.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(s.current)}}),[]),s.current?Ft.createPortal(i,s.current):null}));function Rs(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Os;function ks(e){var t=e.prefixCls,n=e.motion,r=e.animation,i=e.transitionName;return n||(r?{motionName:"".concat(t,"-").concat(r)}:i?{motionName:i}:null)}function Ls(t){var n=t.prefixCls,r=t.visible,i=t.zIndex,l=t.mask,a=t.maskMotion,o=t.maskAnimation,s=t.maskTransitionName;if(!l)return null;var c={};return(a||s||o)&&(c=fr({motionAppear:!0},ks({motion:a,prefixCls:n,transitionName:s,animation:o}))),e.createElement(Si,Ni({},c,{visible:r,removeOnLeave:!0}),(function(t){var r=t.className;return e.createElement("div",{style:{zIndex:i},className:Pe("".concat(n,"-mask"),r)})}))}function As(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?As(Object(n),!0).forEach((function(t){Ds(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):As(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _s(e){return _s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_s(e)}function Ds(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hs={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Fs(){if(void 0!==Os)return Os;Os="";var e=document.createElement("p").style;for(var t in Hs)t+"Transform"in e&&(Os=t);return Os}function Ms(){return Fs()?"".concat(Fs(),"TransitionProperty"):"transitionProperty"}function $s(){return Fs()?"".concat(Fs(),"Transform"):"transform"}function qs(e,t){var n=Ms();n&&(e.style[n]=t,"transitionProperty"!==n&&(e.style.transitionProperty=t))}function js(e,t){var n=$s();n&&(e.style[n]=t,"transform"!==n&&(e.style.transform=t))}var Ks,Vs=/matrix\((.*)\)/,zs=/matrix3d\((.*)\)/;function Ws(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Bs(e,t,n){var r=n;if("object"!==_s(t))return void 0!==r?("number"==typeof r&&(r="".concat(r,"px")),void(e.style[t]=r)):Ks(e,t);for(var i in t)t.hasOwnProperty(i)&&Bs(e,i,t[i])}function Us(e,t){var n=e["page".concat(t?"Y":"X","Offset")],r="scroll".concat(t?"Top":"Left");if("number"!=typeof n){var i=e.document;"number"!=typeof(n=i.documentElement[r])&&(n=i.body[r])}return n}function Gs(e){return Us(e)}function Ys(e){return Us(e,!0)}function Xs(e){var t=function(e){var t,n,r,i=e.ownerDocument,l=i.body,a=i&&i.documentElement;return t=e.getBoundingClientRect(),n=Math.floor(t.left),r=Math.floor(t.top),{left:n-=a.clientLeft||l.clientLeft||0,top:r-=a.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,r=n.defaultView||n.parentWindow;return t.left+=Gs(r),t.top+=Ys(r),t}function Qs(e){return null!=e&&e==e.window}function Zs(e){return Qs(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Js=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),ec=/^(top|right|bottom|left)$/,tc="currentStyle",nc="runtimeStyle",rc="left";function ic(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function lc(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function ac(e,t,n){"static"===Bs(e,"position")&&(e.style.position="relative");var r=-999,i=-999,l=ic("left",n),a=ic("top",n),o=lc(l),s=lc(a);"left"!==l&&(r=999),"top"!==a&&(i=999);var c,d="",u=Xs(e);("left"in t||"top"in t)&&(d=(c=e).style.transitionProperty||c.style[Ms()]||"",qs(e,"none")),"left"in t&&(e.style[o]="",e.style[l]="".concat(r,"px")),"top"in t&&(e.style[s]="",e.style[a]="".concat(i,"px")),Ws(e);var p=Xs(e),m={};for(var h in t)if(t.hasOwnProperty(h)){var f=ic(h,n),g="left"===h?r:i,v=u[h]-p[h];m[f]=f===h?g+v:g-v}Bs(e,m),Ws(e),("left"in t||"top"in t)&&qs(e,d);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=ic(b,n),E=t[b]-u[b];y[x]=b===x?m[x]+E:m[x]-E}Bs(e,y)}function oc(e,t){var n=Xs(e),r=function(e){var t=window.getComputedStyle(e,null),n=t.getPropertyValue("transform")||t.getPropertyValue($s());if(n&&"none"!==n){var r=n.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(r[12]||r[4],0),y:parseFloat(r[13]||r[5],0)}}return{x:0,y:0}}(e),i={x:r.x,y:r.y};"left"in t&&(i.x=r.x+t.left-n.left),"top"in t&&(i.y=r.y+t.top-n.top),function(e,t){var n=window.getComputedStyle(e,null),r=n.getPropertyValue("transform")||n.getPropertyValue($s());if(r&&"none"!==r){var i,l=r.match(Vs);l?((i=(l=l[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,i[5]=t.y,js(e,"matrix(".concat(i.join(","),")"))):((i=r.match(zs)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,i[13]=t.y,js(e,"matrix3d(".concat(i.join(","),")")))}else js(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,i)}function sc(e,t){for(var n=0;n<e.length;n++)t(e[n])}function cc(e){return"border-box"===Ks(e,"boxSizing")}"undefined"!=typeof window&&(Ks=window.getComputedStyle?function(e,t,n){var r=n,i="",l=Zs(e);return(r=r||l.defaultView.getComputedStyle(e,null))&&(i=r.getPropertyValue(t)||r[t]),i}:function(e,t){var n=e[tc]&&e[tc][t];if(Js.test(n)&&!ec.test(t)){var r=e.style,i=r[rc],l=e[nc][rc];e[nc][rc]=e[tc][rc],r[rc]="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r[rc]=i,e[nc][rc]=l}return""===n?"auto":n});var dc=["margin","border","padding"],uc=-1,pc=2,mc=1;function hc(e,t,n){var r,i,l,a=0;for(i=0;i<t.length;i++)if(r=t[i])for(l=0;l<n.length;l++){var o=void 0;o="border"===r?"".concat(r).concat(n[l],"Width"):r+n[l],a+=parseFloat(Ks(e,o))||0}return a}var fc={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function gc(e,t,n){var r=n;if(Qs(e))return"width"===t?fc.viewportWidth(e):fc.viewportHeight(e);if(9===e.nodeType)return"width"===t?fc.docWidth(e):fc.docHeight(e);var i="width"===t?["Left","Right"]:["Top","Bottom"],l="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),a=cc(e),o=0;(null==l||l<=0)&&(l=void 0,(null==(o=Ks(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===r&&(r=a?mc:uc);var s=void 0!==l||a,c=l||o;return r===uc?s?c-hc(e,["border","padding"],i):o:s?r===mc?c:c+(r===pc?-hc(e,["border"],i):hc(e,["margin"],i)):o+hc(e,dc.slice(r),i)}sc(["Width","Height"],(function(e){fc["doc".concat(e)]=function(t){var n=t.document;return Math.max(n.documentElement["scroll".concat(e)],n.body["scroll".concat(e)],fc["viewport".concat(e)](n))},fc["viewport".concat(e)]=function(t){var n="client".concat(e),r=t.document,i=r.body,l=r.documentElement[n];return"CSS1Compat"===r.compatMode&&l||i&&i[n]||l}}));var vc={position:"absolute",visibility:"hidden",display:"block"};function yc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0];return 0!==i.offsetWidth?r=gc.apply(void 0,t):function(e,t,n){var r,i={},l=e.style;for(r in t)t.hasOwnProperty(r)&&(i[r]=l[r],l[r]=t[r]);for(r in n.call(e),t)t.hasOwnProperty(r)&&(l[r]=i[r])}(i,vc,(function(){r=gc.apply(void 0,t)})),r}function bc(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}sc(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);fc["outer".concat(t)]=function(t,n){return t&&yc(t,e,n?0:mc)};var n="width"===e?["Left","Right"]:["Top","Bottom"];fc[e]=function(t,r){var i=r;return void 0!==i?t?(cc(t)&&(i+=hc(t,["padding","border"],n)),Bs(t,e,i)):void 0:t&&yc(t,e,uc)}}));var xc={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Zs,offset:function(e,t,n){if(void 0===t)return Xs(e);!function(e,t,n){if(n.ignoreShake){var r=Xs(e),i=r.left.toFixed(0),l=r.top.toFixed(0),a=t.left.toFixed(0),o=t.top.toFixed(0);if(i===a&&l===o)return}n.useCssRight||n.useCssBottom?ac(e,t,n):n.useCssTransform&&$s()in document.body.style?oc(e,t):ac(e,t,n)}(e,t,n||{})},isWindow:Qs,each:sc,css:Bs,clone:function(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(n.overflow[t]=e.overflow[t]);return n},mix:bc,getWindowScrollLeft:function(e){return Gs(e)},getWindowScrollTop:function(e){return Ys(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)xc.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};bc(xc,fc);var Ec=xc.getParent;function wc(e){if(xc.isWindow(e)||9===e.nodeType)return null;var t,n=xc.getDocument(e).body,r=xc.css(e,"position");if(!("fixed"===r||"absolute"===r))return"html"===e.nodeName.toLowerCase()?null:Ec(e);for(t=Ec(e);t&&t!==n&&9!==t.nodeType;t=Ec(t))if("static"!==(r=xc.css(t,"position")))return t;return null}var Cc=xc.getParent;function Sc(e,t){for(var n={left:0,right:1/0,top:0,bottom:1/0},r=wc(e),i=xc.getDocument(e),l=i.defaultView||i.parentWindow,a=i.body,o=i.documentElement;r;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===r.clientWidth||r===a||r===o||"visible"===xc.css(r,"overflow")){if(r===a||r===o)break}else{var s=xc.offset(r);s.left+=r.clientLeft,s.top+=r.clientTop,n.top=Math.max(n.top,s.top),n.right=Math.min(n.right,s.left+r.clientWidth),n.bottom=Math.min(n.bottom,s.top+r.clientHeight),n.left=Math.max(n.left,s.left)}r=wc(r)}var c=null;xc.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===xc.css(e,"position")&&(e.style.position="fixed"));var d=xc.getWindowScrollLeft(l),u=xc.getWindowScrollTop(l),p=xc.viewportWidth(l),m=xc.viewportHeight(l),h=o.scrollWidth,f=o.scrollHeight,g=window.getComputedStyle(a);if("hidden"===g.overflowX&&(h=l.innerWidth),"hidden"===g.overflowY&&(f=l.innerHeight),e.style&&(e.style.position=c),t||function(e){if(xc.isWindow(e)||9===e.nodeType)return!1;var t=xc.getDocument(e),n=t.body,r=null;for(r=Cc(e);r&&r!==n&&r!==t;r=Cc(r))if("fixed"===xc.css(r,"position"))return!0;return!1}(e))n.left=Math.max(n.left,d),n.top=Math.max(n.top,u),n.right=Math.min(n.right,d+p),n.bottom=Math.min(n.bottom,u+m);else{var v=Math.max(h,d+p);n.right=Math.min(n.right,v);var y=Math.max(f,u+m);n.bottom=Math.min(n.bottom,y)}return n.top>=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Nc(e){var t,n,r;if(xc.isWindow(e)||9===e.nodeType){var i=xc.getWindow(e);t={left:xc.getWindowScrollLeft(i),top:xc.getWindowScrollTop(i)},n=xc.viewportWidth(i),r=xc.viewportHeight(i)}else t=xc.offset(e),n=xc.outerWidth(e),r=xc.outerHeight(e);return t.width=n,t.height=r,t}function Tc(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,l=e.height,a=e.left,o=e.top;return"c"===n?o+=l/2:"b"===n&&(o+=l),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:o}}function Ic(e,t,n,r,i){var l=Tc(t,n[1]),a=Tc(e,n[0]),o=[a.left-l.left,a.top-l.top];return{left:Math.round(e.left-o[0]+r[0]-i[0]),top:Math.round(e.top-o[1]+r[1]-i[1])}}function Rc(e,t,n){return e.left<n.left||e.left+t.width>n.right}function Oc(e,t,n){return e.top<n.top||e.top+t.height>n.bottom}function kc(e,t,n){var r=[];return xc.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Lc(e,t){return e[t]=-e[t],e}function Ac(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Pc(e,t){e[0]=Ac(e[0],t.width),e[1]=Ac(e[1],t.height)}function _c(e,t,n,r){var i=n.points,l=n.offset||[0,0],a=n.targetOffset||[0,0],o=n.overflow,s=n.source||e;l=[].concat(l),a=[].concat(a);var c={},d=0,u=Sc(s,!(!(o=o||{})||!o.alwaysByViewport)),p=Nc(s);Pc(l,p),Pc(a,t);var m=Ic(p,t,i,l,a),h=xc.merge(p,m);if(u&&(o.adjustX||o.adjustY)&&r){if(o.adjustX&&Rc(m,p,u)){var f=kc(i,/[lr]/gi,{l:"r",r:"l"}),g=Lc(l,0),v=Lc(a,0);(function(e,t,n){return e.left>n.right||e.left+t.width<n.left})(Ic(p,t,f,g,v),p,u)||(d=1,i=f,l=g,a=v)}if(o.adjustY&&Oc(m,p,u)){var y=kc(i,/[tb]/gi,{t:"b",b:"t"}),b=Lc(l,1),x=Lc(a,1);(function(e,t,n){return e.top>n.bottom||e.top+t.height<n.top})(Ic(p,t,y,b,x),p,u)||(d=1,i=y,l=b,a=x)}d&&(m=Ic(p,t,i,l,a),xc.mix(h,m));var E=Rc(m,p,u),w=Oc(m,p,u);if(E||w){var C=i;E&&(C=kc(i,/[lr]/gi,{l:"r",r:"l"})),w&&(C=kc(i,/[tb]/gi,{t:"b",b:"t"})),i=C,l=n.offset||[0,0],a=n.targetOffset||[0,0]}c.adjustX=o.adjustX&&E,c.adjustY=o.adjustY&&w,(c.adjustX||c.adjustY)&&(h=function(e,t,n,r){var i=xc.clone(e),l={width:t.width,height:t.height};return r.adjustX&&i.left<n.left&&(i.left=n.left),r.resizeWidth&&i.left>=n.left&&i.left+l.width>n.right&&(l.width-=i.left+l.width-n.right),r.adjustX&&i.left+l.width>n.right&&(i.left=Math.max(n.right-l.width,n.left)),r.adjustY&&i.top<n.top&&(i.top=n.top),r.resizeHeight&&i.top>=n.top&&i.top+l.height>n.bottom&&(l.height-=i.top+l.height-n.bottom),r.adjustY&&i.top+l.height>n.bottom&&(i.top=Math.max(n.bottom-l.height,n.top)),xc.mix(i,l)}(m,p,u,c))}return h.width!==p.width&&xc.css(s,"width",xc.width(s)+h.width-p.width),h.height!==p.height&&xc.css(s,"height",xc.height(s)+h.height-p.height),xc.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:l,targetOffset:a,overflow:c}}function Dc(e,t,n){var r=n.target||t,i=Nc(r),l=!function(e,t){var n=Sc(e,t),r=Nc(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return _c(e,i,n,l)}Dc.__getOffsetParent=wc,Dc.__getVisibleRectForElement=Sc;var Hc=Gr()?e.useLayoutEffect:e.useEffect,Fc=function(t,n){var r=e.useRef(!0);Hc((function(){return t(r.current)}),n),Hc((function(){return r.current=!1,function(){r.current=!0}}),[])};function Mc(e,t){var n=null,r=null;var i=new qt((function(e){var i=vr(e,1)[0].target;if(document.documentElement.contains(i)){var l=i.getBoundingClientRect(),a=l.width,o=l.height,s=Math.floor(a),c=Math.floor(o);n===s&&r===c||Promise.resolve().then((function(){t({width:s,height:c})})),n=s,r=c}}));return e&&i.observe(e),function(){i.disconnect()}}function $c(e){return"function"!=typeof e?null:e()}function qc(e){return"object"===ur(e)&&e?e:null}var jc=function(e,n){var r=e.children,i=e.disabled,l=e.target,a=e.align,o=e.onAlign,s=e.monitorWindowResize,c=e.monitorBufferTime,d=void 0===c?0:c,u=t.useRef({}),p=t.useRef(),m=t.Children.only(r),h=t.useRef({});h.current.disabled=i,h.current.target=l,h.current.align=a,h.current.onAlign=o;var f=function(e,n){var r=t.useRef(!1),i=t.useRef(null);function l(){window.clearTimeout(i.current)}return[function t(a){if(l(),r.current&&!0!==a)i.current=window.setTimeout((function(){r.current=!1,t()}),n);else{if(!1===e(a))return;r.current=!0,i.current=window.setTimeout((function(){r.current=!1}),n)}},function(){r.current=!1,l()}]}((function(){var e=h.current,t=e.disabled,n=e.target,r=e.align,i=e.onAlign,l=p.current;if(!t&&n&&l){var a,o=$c(n),s=qc(n);u.current.element=o,u.current.point=s,u.current.align=r;var c=document.activeElement;return o&&function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var i=e.getBoundingClientRect(),l=i.width,a=i.height;if(l||a)return!0}}return!1}(o)?a=Dc(l,o,r):s&&(a=function(e,t,n){var r,i,l=xc.getDocument(e),a=l.defaultView||l.parentWindow,o=xc.getWindowScrollLeft(a),s=xc.getWindowScrollTop(a),c=xc.viewportWidth(a),d=xc.viewportHeight(a),u={left:r="pageX"in t?t.pageX:o+t.clientX,top:i="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=o+c&&i>=0&&i<=s+d,m=[n.points[0],"cc"];return _c(e,u,Ps(Ps({},n),{},{points:m}),p)}(l,s,r)),function(e,t){e!==document.activeElement&&Ns(t,e)&&"function"==typeof e.focus&&e.focus()}(c,l),i&&a&&i(l,a),!0}return!1}),d),g=vr(f,2),v=g[0],y=g[1],b=vr(t.useState(),2),x=b[0],E=b[1],w=vr(t.useState(),2),C=w[0],S=w[1];return Fc((function(){E($c(l)),S(qc(l))})),t.useEffect((function(){var e,t;u.current.element===x&&((e=u.current.point)===(t=C)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(t);if(xn(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(n&&l>1)return!1;r.add(t);var o=l+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],i[s],o))return!1;return!0}if(t&&i&&"object"===ur(t)&&"object"===ur(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every((function(n){return e(t[n],i[n],o)}))}return!1}(e,t)}(u.current.align,a)||v()})),t.useEffect((function(){return Mc(p.current,v)}),[p.current]),t.useEffect((function(){return Mc(x,v)}),[x]),t.useEffect((function(){i?y():v()}),[i]),t.useEffect((function(){if(s)return Ts(window,"resize",v).remove}),[s]),t.useEffect((function(){return function(){y()}}),[]),t.useImperativeHandle(n,(function(){return{forceAlign:function(){return v(!0)}}})),t.isValidElement(m)&&(m=t.cloneElement(m,{ref:Sr(m.ref,p)})),m},Kc=t.forwardRef(jc);function Vc(){Vc=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var l=t&&t.prototype instanceof p?t:p,a=Object.create(l.prototype),o=new N(i||[]);return r(a,"_invoke",{value:E(e,n,o)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function m(){}function h(){}var f={};s(f,l,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==t&&n.call(v,l)&&(f=v);var y=h.prototype=p.prototype=Object.create(f);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,l,a,o){var s=d(e[r],e,l);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==ur(u)&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){i("next",e,a,o)}),(function(e){i("throw",e,a,o)})):t.resolve(u).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,o)}))}o(s.arg)}var l;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return l=l?l.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(i,l){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw l;return I()}for(n.method=i,n.arg=l;;){var a=n.delegate;if(a){var o=w(a,n);if(o){if(o===u)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=d(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function w(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),u;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,u;var l=i.arg;return l?l.done?(t[e.resultName]=l.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function T(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return m.prototype=h,r(y,"constructor",{value:h,configurable:!0}),r(h,"constructor",{value:m,configurable:!0}),m.displayName=s(h,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,l){void 0===l&&(l=Promise);var a=new x(c(t,n,r,i),l);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),s(y,o,"Generator"),s(y,l,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=T,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],a=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var o=n.call(l,"catchLoc"),s=n.call(l,"finallyLoc");if(o&&s){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(o){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return r(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var l=i;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var a=l?l.completion:{};return a.type=e,a.arg=t,l?(this.method="next",this.next=l.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:T(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function zc(e,t,n,r,i,l,a){try{var o=e[l](a),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,i)}function Wc(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var l=e.apply(t,n);function a(e){zc(l,r,i,a,o,"next",e)}function o(e){zc(l,r,i,a,o,"throw",e)}a(void 0)}))}}Kc.displayName="Align";var Bc=["measure","alignPre","align",null,"motion"],Uc=e.forwardRef((function(t,n){var r=t.visible,i=t.prefixCls,a=t.className,c=t.style,d=t.children,u=t.zIndex,p=t.stretch,m=t.destroyPopupOnHide,h=t.forceRender,f=t.align,g=t.point,v=t.getRootDomNode,y=t.getClassNameFromAlign,b=t.onAlign,x=t.onMouseEnter,E=t.onMouseLeave,w=t.onMouseDown,C=t.onTouchStart,S=t.onClick,N=l(),T=l(),I=vr(s(),2),R=I[0],O=I[1],k=function(t){var n=vr(e.useState({width:0,height:0}),2),r=n[0],i=n[1];return[e.useMemo((function(){var e={};if(t){var n=r.width,i=r.height;-1!==t.indexOf("height")&&i?e.height=i:-1!==t.indexOf("minHeight")&&i&&(e.minHeight=i),-1!==t.indexOf("width")&&n?e.width=n:-1!==t.indexOf("minWidth")&&n&&(e.minWidth=n)}return e}),[t,r]),function(e){var t=e.offsetWidth,n=e.offsetHeight,r=e.getBoundingClientRect(),l=r.width,a=r.height;Math.abs(t-l)<1&&Math.abs(n-a)<1&&(t=l,n=a),i({width:t,height:n})}]}(p),L=vr(k,2),A=L[0],P=L[1];var _=function(e,t){var n=vr(Fr(null),2),r=n[0],i=n[1],a=l();function s(e){i(e,!0)}function c(){vi.cancel(a.current)}return o((function(){s("measure")}),[e]),o((function(){"measure"===r&&t(),r&&(a.current=vi(Wc(Vc().mark((function e(){var t,n;return Vc().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Bc.indexOf(r),(n=Bc[t+1])&&-1!==t&&s(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),o((function(){return function(){c()}}),[]),[r,function(e){c(),a.current=vi((function(){s((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r,(function(){p&&P(v())})),D=vr(_,2),H=D[0],F=D[1],M=vr(s(0),2),$=M[0],q=M[1],j=l();function K(){var e;null===(e=N.current)||void 0===e||e.forceAlign()}function V(e,t){var n=y(t);R!==n&&O(n),q((function(e){return e+1})),"align"===H&&(null==b||b(e,t))}Fc((function(){"alignPre"===H&&q(0)}),[H]),Fc((function(){"align"===H&&($<3?K():F((function(){var e;null===(e=j.current)||void 0===e||e.call(j)})))}),[$]);var z=fr({},ks(t));function W(){return new Promise((function(e){j.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=z[e];z[e]=function(e,n){return F(),null==t?void 0:t(e,n)}})),e.useEffect((function(){z.motionName||"motion"!==H||F()}),[z.motionName,H]),e.useImperativeHandle(n,(function(){return{forceAlign:K,getElement:function(){return T.current}}}));var B=fr(fr({},A),{},{zIndex:u,opacity:"motion"!==H&&"stable"!==H&&r?0:void 0,pointerEvents:r||"stable"===H?void 0:"none"},c),U=!0;null==f||!f.points||"align"!==H&&"stable"!==H||(U=!1);var G=d;return e.Children.count(d)>1&&(G=e.createElement("div",{className:"".concat(i,"-content")},d)),e.createElement(Si,Ni({visible:r,ref:T,leavedClassName:"".concat(i,"-hidden")},z,{onAppearPrepare:W,onEnterPrepare:W,removeOnLeave:m,forceRender:h}),(function(t,n){var r=t.className,l=t.style,o=Pe(i,a,R,r);return e.createElement(Kc,{target:g||v,key:"popup",ref:N,monitorWindowResize:!0,disabled:U,align:f,onAlign:V},e.createElement("div",{ref:n,className:o,onMouseEnter:x,onMouseLeave:E,onMouseDownCapture:w,onTouchStartCapture:C,onClick:S,style:fr(fr({},l),B)},G))}))}));Uc.displayName="PopupInner";var Gc=e.forwardRef((function(t,n){var r=t.prefixCls,i=t.visible,l=t.zIndex,a=t.children,o=t.mobile,s=(o=void 0===o?{}:o).popupClassName,c=o.popupStyle,d=o.popupMotion,u=void 0===d?{}:d,p=o.popupRender,m=t.onClick,h=e.useRef();e.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return h.current}}}));var f=fr({zIndex:l},c),g=a;return e.Children.count(a)>1&&(g=e.createElement("div",{className:"".concat(r,"-content")},a)),p&&(g=p(g)),e.createElement(Si,Ni({visible:i,ref:h,removeOnLeave:!0},u),(function(t,n){var i=t.className,l=t.style,a=Pe(r,s,i);return e.createElement("div",{ref:n,className:a,onClick:m,style:fr(fr({},l),f)},g)}))}));Gc.displayName="MobilePopupInner";var Yc=["visible","mobile"],Xc=e.forwardRef((function(t,n){var r=t.visible,i=t.mobile,l=Tr(t,Yc),a=vr(s(r),2),c=a[0],d=a[1],u=vr(s(!1),2),p=u[0],m=u[1],h=fr(fr({},l),{},{visible:c});o((function(){d(r),r&&i&&m(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|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|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())}),[r,i]);var f=p?e.createElement(Gc,Ni({},h,{mobile:i,ref:n})):e.createElement(Uc,Ni({},h,{ref:n}));return e.createElement("div",null,e.createElement(Ls,h),f)}));Xc.displayName="Popup";var Qc=e.createContext(null);function Zc(){}function Jc(){return""}function ed(e){return e?e.ownerDocument:window.document}var td=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var nd=function(t){var n=function(n){Ar(i,e.Component);var r=Dr(i);function i(t){var n,l;return Rr(this,i),mr(_r(n=r.call(this,t)),"popupRef",e.createRef()),mr(_r(n),"triggerRef",e.createRef()),mr(_r(n),"portalContainer",void 0),mr(_r(n),"attachId",void 0),mr(_r(n),"clickOutsideHandler",void 0),mr(_r(n),"touchOutsideHandler",void 0),mr(_r(n),"contextMenuOutsideHandler1",void 0),mr(_r(n),"contextMenuOutsideHandler2",void 0),mr(_r(n),"mouseDownTimeout",void 0),mr(_r(n),"focusTime",void 0),mr(_r(n),"preClickTime",void 0),mr(_r(n),"preTouchTime",void 0),mr(_r(n),"delayTimer",void 0),mr(_r(n),"hasPopupMouseDown",void 0),mr(_r(n),"onMouseEnter",(function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)})),mr(_r(n),"onMouseMove",(function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)})),mr(_r(n),"onMouseLeave",(function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),mr(_r(n),"onPopupMouseEnter",(function(){n.clearDelayTimer()})),mr(_r(n),"onPopupMouseLeave",(function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&Ns(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)})),mr(_r(n),"onFocus",(function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))})),mr(_r(n),"onMouseDown",(function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()})),mr(_r(n),"onTouchStart",(function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()})),mr(_r(n),"onBlur",(function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)})),mr(_r(n),"onContextMenu",(function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)})),mr(_r(n),"onContextMenuClose",(function(){n.isContextMenuToShow()&&n.close()})),mr(_r(n),"onClick",(function(e){if(n.fireEvents("onClick",e),n.focusTime){var t;if(n.preClickTime&&n.preTouchTime?t=Math.min(n.preClickTime,n.preTouchTime):n.preClickTime?t=n.preClickTime:n.preTouchTime&&(t=n.preTouchTime),Math.abs(t-n.focusTime)<20)return;n.focusTime=0}n.preClickTime=0,n.preTouchTime=0,n.isClickToShow()&&(n.isClickToHide()||n.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!n.state.popupVisible;(n.isClickToHide()&&!r||r&&n.isClickToShow())&&n.setPopupVisible(!n.state.popupVisible,e)})),mr(_r(n),"onPopupMouseDown",(function(){var e;(n.hasPopupMouseDown=!0,clearTimeout(n.mouseDownTimeout),n.mouseDownTimeout=window.setTimeout((function(){n.hasPopupMouseDown=!1}),0),n.context)&&(e=n.context).onPopupMouseDown.apply(e,arguments)})),mr(_r(n),"onDocumentClick",(function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),i=n.getPopupDomNode();Ns(r,t)&&!n.isContextMenuOnly()||Ns(i,t)||n.hasPopupMouseDown||n.close()}})),mr(_r(n),"getRootDomNode",(function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=br(n.triggerRef.current);if(t)return t}catch(e){}return Ft.findDOMNode(_r(n))})),mr(_r(n),"getPopupClassNameFromAlign",(function(e){var t=[],r=n.props,i=r.popupPlacement,l=r.builtinPlacements,a=r.prefixCls,o=r.alignPoint,s=r.getPopupClassNameFromAlign;return i&&l&&t.push(function(e,t,n,r){for(var i=n.points,l=Object.keys(e),a=0;a<l.length;a+=1){var o=l[a];if(Rs(e[o].points,i,r))return"".concat(t,"-placement-").concat(o)}return""}(l,a,e,o)),s&&t.push(s(e)),t.join(" ")})),mr(_r(n),"getComponent",(function(){var t=n.props,r=t.prefixCls,i=t.destroyPopupOnHide,l=t.popupClassName,a=t.onPopupAlign,o=t.popupMotion,s=t.popupAnimation,c=t.popupTransitionName,d=t.popupStyle,u=t.mask,p=t.maskAnimation,m=t.maskTransitionName,h=t.maskMotion,f=t.zIndex,g=t.popup,v=t.stretch,y=t.alignPoint,b=t.mobile,x=t.forceRender,E=t.onPopupClick,w=n.state,C=w.popupVisible,S=w.point,N=n.getPopupAlign(),T={};return n.isMouseEnterToShow()&&(T.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(T.onMouseLeave=n.onPopupMouseLeave),T.onMouseDown=n.onPopupMouseDown,T.onTouchStart=n.onPopupMouseDown,e.createElement(Xc,Ni({prefixCls:r,destroyPopupOnHide:i,visible:C,point:y&&S,className:l,align:N,onAlign:a,animation:s,getClassNameFromAlign:n.getPopupClassNameFromAlign},T,{stretch:v,getRootDomNode:n.getRootDomNode,style:d,mask:u,zIndex:f,transitionName:c,maskAnimation:p,maskTransitionName:m,maskMotion:h,ref:n.popupRef,motion:o,mobile:b,forceRender:x,onClick:E}),"function"==typeof g?g():g)})),mr(_r(n),"attachParent",(function(e){vi.cancel(n.attachId);var t,r=n.props,i=r.getPopupContainer,l=r.getDocument,a=n.getRootDomNode();i?(a||0===i.length)&&(t=i(a)):t=l(n.getRootDomNode()).body,t?t.appendChild(e):n.attachId=vi((function(){n.attachParent(e)}))})),mr(_r(n),"getContainer",(function(){if(!n.portalContainer){var e=(0,n.props.getDocument)(n.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",n.portalContainer=e}return n.attachParent(n.portalContainer),n.portalContainer})),mr(_r(n),"setPoint",(function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),mr(_r(n),"handlePortalUpdate",(function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)})),mr(_r(n),"triggerContextValue",{onPopupMouseDown:n.onPopupMouseDown}),l="popupVisible"in t?!!t.popupVisible:!!t.defaultPopupVisible,n.state={prevPopupVisible:l,popupVisible:l},td.forEach((function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}})),n}return kr(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Ts(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Ts(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Ts(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Ts(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),vi.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,n=e.popupAlign,r=e.builtinPlacements;return t&&r?function(e,t,n){return fr(fr({},e[t]||{}),n)}(r,t,n):n}},{key:"setPopupVisible",value:function(e,t){var n=this.props.alignPoint,r=this.state.popupVisible;this.clearDelayTimer(),r!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:r}),this.props.onPopupVisibleChange(e)),n&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,n){var r=this,i=1e3*t;if(this.clearDelayTimer(),i){var l=n?{pageX:n.pageX,pageY:n.pageY}:null;this.delayTimer=window.setTimeout((function(){r.setPopupVisible(e,l),r.clearDelayTimer()}),i)}else this.setPopupVisible(e,n)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,n=this.props;return t[e]&&n[e]?this["fire".concat(e)]:t[e]||n[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==n.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("click")||-1!==n.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("hover")||-1!==n.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,n=e.showAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,n=e.hideAction;return-1!==t.indexOf("focus")||-1!==n.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var n=this.props.children.props[e];n&&n(t);var r=this.props[e];r&&r(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var n=this.state.popupVisible,r=this.props,i=r.children,l=r.forceRender,a=r.alignPoint,o=r.className,s=r.autoDestroy,c=e.Children.only(i),d={key:"trigger"};this.isContextMenuToShow()?d.onContextMenu=this.onContextMenu:d.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(d.onClick=this.onClick,d.onMouseDown=this.onMouseDown,d.onTouchStart=this.onTouchStart):(d.onClick=this.createTwoChains("onClick"),d.onMouseDown=this.createTwoChains("onMouseDown"),d.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(d.onMouseEnter=this.onMouseEnter,a&&(d.onMouseMove=this.onMouseMove)):d.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?d.onMouseLeave=this.onMouseLeave:d.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(d.onFocus=this.onFocus,d.onBlur=this.onBlur):(d.onFocus=this.createTwoChains("onFocus"),d.onBlur=this.createTwoChains("onBlur"));var u=Pe(c&&c.props&&c.props.className,o);u&&(d.className=u);var p=fr({},d);Nr(c)&&(p.ref=Sr(this.triggerRef,c.ref));var m,h=e.cloneElement(c,p);return(n||this.popupRef.current||l)&&(m=e.createElement(t,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!n&&s&&(m=null),e.createElement(Qc.Provider,{value:this.triggerContextValue},h,m)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.popupVisible,r={};return void 0!==n&&t.popupVisible!==n&&(r.popupVisible=n,r.prevPopupVisible=t.popupVisible),r}}]),i}();return mr(n,"contextType",Qc),mr(n,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Jc,getDocument:ed,onPopupVisibleChange:Zc,afterPopupVisibleChange:Zc,onPopupAlign:Zc,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),n}(Is);const rd=e=>{const{columns:n,onChange:r}=e,{prefixCls:i,$size:l}=t.useContext(Fo),{t:a}=Fn(),o=t.useRef([]),[s,c]=t.useState(!1),[d,u]=t.useState(n);Mi((()=>{m()}),[d]),t.useEffect((()=>{p()}),[n]);const p=()=>{const e=[];n.forEach(((t,r)=>{const i=t.colSpan;i>1&&n.slice(r+1,r+i).every((({colSpan:e})=>0===e))&&e.push(n.slice(r,r+i))})),o.current=e},m=()=>{const e=[];d.forEach((t=>{const{colSpan:n,dataIndex:r}=t;if(0===n)return;if(1===n)return e.push(t);const i=o.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(r)));if(-1===i)return e.push(t);e.push(...o.current[i].map((({dataIndex:e},n)=>{const r=d.find((t=>t.dataIndex===e));return n>0&&void 0!==t.hidden&&(r.hidden=t.hidden),r})))})),null==r||r(e)},h={[`${i}__popper`]:!0,"column-filter__popper":!0,[`${i}--lg`]:"large"===l,[`${i}--sm`]:"small"===l},f=[`${i}-column-filter`,{selected:s}];return t.createElement(nd,{action:["click"],popupVisible:s,popup:t.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"main"},t.createElement(Gt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:d,setList:e=>{const t=e.map((e=>e.dataIndex)),n=d.map((e=>e.dataIndex));me(t,n)||u(Da(e))}},d.map((e=>((e,n)=>{const{colSpan:r}=e;if(0===r)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=["svgicon","handle",`${n}-handle`];return t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(F,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,u([...d])}}),t.createElement("i",{className:Pe(i),title:a("qm.table.columnFilter.draggable")},t.createElement(Be,null)),t.createElement("span",{className:"text"},Ta(e.title)))})(e,"main")))))),popupClassName:Pe(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{c(e)},builtinPlacements:Bo,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Pe(f),title:a("qm.table.columnFilter.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(Qe,null)),t.createElement("span",null,a("qm.table.columnFilter.text"))))},id=e=>{const{defaultValue:n,onClose:r,onOk:i}=e,{tableRef:l,prefixCls:a,selectionKeys:o,pagination:s,showSummary:c}=t.useContext(Fo),{rowSelection:d}=l.current.props,{t:u}=Fn(),p=t.useRef(null),[h,f]=t.useState(!1),g=t.useMemo((()=>Object.assign({},{fileName:`${m().format(Wo)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:o.length?"selected":"all","startIndex|endIndex":[1,s.total],footSummation:c?1:0,useStyle:0},n,{columns:Qn(n.columns||[])})),[]),[v,y]=t.useState([{type:"INPUT",label:u("qm.table.export.fileName"),fieldName:"fileName"},{type:"SELECT",label:u("qm.table.export.fileType"),fieldName:"fileType",options:{itemList:[{text:"xlsx",value:"xlsx"},{text:"csv",value:"csv"}]}},{type:"INPUT",label:u("qm.table.export.sheetName"),fieldName:"sheetName"},{type:"RANGE_INPUT_NUMBER",fieldName:"startIndex|endIndex",label:{type:"SELECT",fieldName:"exportType",options:{itemList:[{text:u("qm.table.export.all"),value:"all"},{text:u("qm.table.export.selected"),value:"selected",disabled:"checkbox"!==(null==d?void 0:d.type)},{text:u("qm.table.export.custom"),value:"custom"}]},onChange:e=>{v.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,y([...v])}},options:{min:1},disabled:!0},{type:"INPUT",label:u("qm.table.columnFilter.text"),fieldName:"columns",render:(e,n)=>t.createElement(rd,{columns:n.state.formData.columns,onChange:e=>{n.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:u("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!c,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:u("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]);return t.createElement("div",{className:`${a}-export__setting`},t.createElement(sh,{ref:p,initialValues:g,items:v,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r(),style:{marginRight:8}},u("qm.table.export.closeButton")),t.createElement(nr,{type:"primary",loading:h,onClick:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield p.current.GET_FORM_DATA();if(!e){f(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);i(t),yield Wn(1e3),f(!1),r()}}))},u("qm.table.export.text"))))},ld=t.forwardRef(((e,n)=>{var r;const{tableColumns:i,open:l=!0}=e,{global:a}=t.useContext(on),{tableRef:o,prefixCls:s,flattenColumns:c,pagination:d,fetchParams:u,isFetch:p,isGroupSubtotal:h,showSummary:f,getSpan:g}=t.useContext(Fo),{exportExcel:v,fetch:y,showHeader:b}=o.current.props,{t:x}=Fn(),{getTitleFromCellValue:E}=us(),[w,C]=t.useState(!1),[S,N]=t.useState(!1),T=t.useMemo((()=>{var e;return!!(null===(e=null==v?void 0:v.fetch)||void 0===e?void 0:e.api)}),[v]),I=t.useMemo((()=>!d.total||S),[d.total,S]),O=t.useMemo((()=>aa(i,[es.expandableColumn,es.selectionColumn,es.operationColumn])),[i]),k=t.useMemo((()=>aa(c,[es.expandableColumn,es.selectionColumn,es.operationColumn])),[c]),L=(e,t="",n=0)=>e.map(((e,r)=>{const i=Object.assign(Object.assign({},e),{index:r,pageIndex:r}),l=t?`${t}.${i.index+1}`:`${i.index+1}`;return i.indexPath=l,i._level=n,Array.isArray(e.children)&&(i.children=L(e.children,l,n+1)),k.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&va(i,t,ga(i,t))})),i})),A=(e,t)=>{const n={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:r}=e,i=(h?Ia(t):t).reduce(((e,t)=>{if(null==t?void 0:t[es.summaryIgnore])return e;const n=Number(ga(t,r));return Number.isNaN(n)?e:e+n}),0);va(n,r,i)})),[n]},P=(e,t,n,r)=>{const{precision:i,formatType:l}=n;let a=E(e,n,t,r);return i>=0&&!l&&""!==a&&(a=Number(a)),a},{exportXLSX:_,exportCSV:D}=Es(),H=e=>Hn(void 0,void 0,void 0,(function*(){var t;const{api:n,formatter:r=(e=>e),afterFetch:i,dataKey:l}=y;let a=[];try{N(!0);const o=yield n(Object.assign(Object.assign({},r(u)),{[es.currentPageName]:1,[es.pageSizeName]:null!=e?e:d.total}));if(200===o.code){let e=Array.isArray(o.data)?o.data:null!==(t=ue(o.data,l))&&void 0!==t?t:[];e="function"==typeof i?yield i(e):e,a=L(e)}}catch(e){}return N(!1),a})),F=e=>{var t;const n=null===(t=null==a?void 0:a.table)||void 0===t?void 0:t.recordExportLog;try{null==n||n({fileName:e})}catch(e){}},M=(e,t)=>{const{columns:n,footSummation:r}=e,i=da(n),l=Jl(n);let a='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${l.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,b&&(a+=["<thead>",i.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:n}=e;return 0===n?null:`<th colspan="${n}" rowspan="${t}">${Ta(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(a+=`<tbody>${sa(t).map((e=>`<tr>${l.map(((n,r)=>{const{rowSpan:i,colSpan:l}=g(e,n,e.index,r,t);return i&&l?`<td rowspan="${i}" colspan="${l}">${P(e,e.index,n,r)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),f&&r&&(a+=["<tfoot>",A(l,t).map((e=>`<tr>${l.map(((n,r)=>{const{dataIndex:i,summation:l}=n,a=(null==l?void 0:l.render)?l.render(t):ga(e,i);return`<td>${0===r&&""===a?x("qm.table.config.summaryText"):jn(a)?Na(a).join(""):a}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},$=null!==(r=null==v?void 0:v.fileName)&&void 0!==r?r:`${m().format(Wo)}.xlsx`,q=$.slice($.lastIndexOf(".")+1).toLowerCase(),j=()=>{if(I)return R.warning(x("qm.table.export.warnText"));var e;T?(e=$,Hn(void 0,void 0,void 0,(function*(){N(!0);try{const{api:t,params:n}=v.fetch,r=yield t(Object.assign(Object.assign(Object.assign({columns:k.map((e=>{const{title:t,dataIndex:n,hidden:r}=e,{type:i}=e.filter||{};return{title:t,dataIndex:n,type:i,hidden:r}}))},u),n),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[es.currentPageName]:void 0,[es.pageSizeName]:void 0}));r.data&&(wl(r.data,e),F(e))}catch(e){}N(!1)}))):C(!0)};t.useImperativeHandle(n,(()=>({clickHandle:j})));const K={[`${s}-export`]:!0},V={visible:w,title:x("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>C(!1)},z={fileName:$.slice(0,$.lastIndexOf(".")),fileType:q,columns:O,useStyle:(null==v?void 0:v.cellStyle)?1:0};return t.createElement(t.Fragment,null,l&&t.createElement("span",{className:Pe(K),title:x("qm.table.export.textNoSpace"),onClick:()=>j()},t.createElement("i",{className:"svgicon icon"},t.createElement(je,null))),t.createElement(Fl,V,t.createElement(id,{defaultValue:z,onClose:()=>C(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ea(e.columns)}),Hn(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:n,exportType:r,startIndex:i=1,endIndex:l}=t,{tableFullData:a,selectionRows:s}=o.current;let c=[];if(p?("all"===r&&(c=yield H()),"custom"===r&&(c=yield H(l),c=c.slice(i-1))):("all"===r&&(c=a.slice(0)),"custom"===r&&(c=a.slice(i-1,l||void 0))),"selected"===r&&(c=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==v?void 0:v.beforeExport))try{c=null==v?void 0:v.beforeExport(c)}catch(e){}if("xlsx"===n){const n=yield _(t,c,A,P);wl(n,`${e}.xlsx`),F(`${e}.xlsx`)}if("csv"===n){const n=D(t,M(t,c));wl(n,`${e}.csv`),F(`${e}.csv`)}}))}})))}));ld.displayName="TableExport";const ad=e=>{const{columns:n,onClose:r}=e,{tableRef:i,tableBodyRef:l,prefixCls:a,dataChange:o}=t.useContext(Fo),{beforeClipboard:s}=i.current.props,{t:c}=Fn(),d=t.useRef(null),[u,p]=t.useState([{type:"INPUT_NUMBER",label:c("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:c("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:n.map(((e,t)=>({value:t,text:Ta(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:c("qm.table.clipboard.content"),fieldName:"content",placeholder:c("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[m,h]=t.useState(!1);return t.createElement("div",{className:`${a}-clipboard__setting`},t.createElement("h3",{className:"info"},c("qm.table.clipboard.supportText")),t.createElement(sh,{ref:d,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:u,cols:1,labelWidth:100}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r(),style:{marginRight:8}},c("qm.table.export.closeButton")),t.createElement(nr,{type:"primary",loading:m,onClick:()=>Hn(void 0,void 0,void 0,(function*(){var e;const[t,a]=yield d.current.GET_FORM_DATA();if(t)return;const{tableFullData:u,store:p,fieldAuth:m}=i.current;h(!0);const f=a.content.trim().replace(/(\r|\n)$/,"");let g=f.replace(/"[^"]+"/g,"^");((null===(e=f.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{g=g.replace(/\^/,e)}));let v=g.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof s)try{v=yield s(v,v[0].map(((e,t)=>n[a.colIndex+t].dataIndex)))}catch(t){}v.forEach(((e,t)=>{e.forEach(((e,r)=>{var i,l;const o=u[a.rowIndex-1+t],s=n[a.colIndex+r];if(o&&s){let t=!1;if(s.editRender){const e=s.editRender(o,s);t=!(e.disabled||(null===(i=e.extra)||void 0===i?void 0:i.disabled)||(null===(l=m[s.dataIndex])||void 0===l?void 0:l.disabled))}t&&s.dictItems&&(t=s.dictItems.some((t=>t.value==e))),t&&(va(o,s.dataIndex,e),p.addToUpdated(o))}}))})),l.current.forceUpdate(),o(),R.success(c("qm.table.clipboard.success",{total:v.length})),h(!1),r()}))},c("qm.table.clipboard.text"))))},od=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i,flattenColumns:l}=t.useContext(Fo),{t:a}=Fn(),[o,s]=t.useState(!1),c=t.useMemo((()=>(e=>e.filter((e=>![es.expandableColumn,es.selectionColumn,"index","pageIndex",es.operationColumn].includes(e.dataIndex))))(l)),[l]),d=()=>{s(!0)};t.useImperativeHandle(n,(()=>({clickHandle:d})));const u={[`${i}-clipboard`]:!0},p={visible:o,title:a("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>s(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:Pe(u),title:a("qm.table.clipboard.textNoSpace"),onClick:()=>d()},t.createElement("i",{className:"svgicon icon"},t.createElement(Ze,null))),t.createElement(Fl,p,t.createElement(ad,{columns:c,onClose:()=>s(!1)})))}));od.displayName="TableClipboard";const sd=e=>{const{columns:n,onClose:r}=e,{tableRef:i,$size:l,selectionKeys:a,setSelectionKeysEffect:o}=t.useContext(Fo),{rowKey:s,rowSelection:c}=i.current.props,{t:d}=Fn(),u=t.useRef(null),p=sl(u),m=e=>e.map((e=>{var t;const n={dataIndex:e.dataIndex,title:e.title,width:e.width,minWidth:e.minWidth,precision:e.precision,dictItems:null!==(t=e.dictItems)&&void 0!==t?t:[],render:e.render};return Array.isArray(e.children)&&(n.children=m(e.children)),n})),[h,f]=t.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...m(n.filter((e=>![es.expandableColumn,es.selectionColumn,"index","pageIndex",es.operationColumn].includes(e.dataIndex))))]),[g]=t.useState((()=>{const{disabled:e}=c||{},t=i.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[v,y]=t.useState(300),b=cl((()=>{const e=u.current;y(e.offsetHeight-2*Ho[l]-30)}),5);return hn((()=>{b()}),[p.width]),t.createElement("div",{ref:u,style:{height:"100%"}},t.createElement(Rp,{size:l,columns:h,dataSource:g,rowKey:s,height:v,rowSelection:{type:"checkbox",selectedRowKeys:a,onChange:e=>o(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>f(e)}),t.createElement("div",{style:{height:10}}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>r()},d("qm.table.selectCollection.closeButton"))))},cd=t.forwardRef(((e,n)=>{const{columns:r,open:i=!0}=e,{tableRef:l,getRowKey:a,prefixCls:o,selectionKeys:s,isFetch:c,isTableEmpty:d,setSelectionKeysEffect:u,setSelectionRows:p}=t.useContext(Fo),{rowSelection:m}=l.current.props,{t:h}=Fn(),[f,g]=t.useState(!1),v=t.useRef(!1);Mi((()=>{!v.current&&y()}),[d]);const y=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:n=(e=>!1)}=m;if(c&&t)try{const r=yield t.api(Object.assign({},{selectedKeys:s},t.params));if(200===r.code){let i=Array.isArray(r.data)?r.data:null!==(e=ue(r.data,t.dataKey))&&void 0!==e?e:[];i=i.filter((e=>!n(e))),u(i.map(((e,t)=>a(e,t)))),p(i),v.current=!0}}catch(e){}})),b=()=>{g(!0)};t.useImperativeHandle(n,(()=>({clickHandle:b})));const x={visible:f,title:h("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>g(!1)};return t.createElement(t.Fragment,null,i&&t.createElement("span",{className:`${o}-select-collection`,title:h("qm.table.selectCollection.text"),onClick:()=>b()},t.createElement("i",{className:"svgicon icon"},t.createElement(Je,null))),t.createElement(Fl,x,t.createElement(sd,{columns:r,onClose:()=>g(!1)})))}));cd.displayName="SelectCollection";const dd=e=>{const{onClose:n}=e,{global:r}=t.useContext(on),{tableRef:i,getRowKey:l,prefixCls:a,$size:o,tableFlatData:s,flattenColumns:c,setActivedCell:d,scrollXToColumn:u,scrollYToRecord:p}=t.useContext(Fo),{uniqueKey:m}=i.current.props,{t:h}=Fn(),{getTitleFromCellValue:f}=us(),g=t.useRef(""),[v,y]=t.useState(""),[b,x]=t.useState([]),[E,w]=t.useState(0),[C,S]=t.useState(!1),[N,T]=t.useState({case:0,fullchar:0}),I=t.useMemo((()=>`${b.length>0?E+1:E}/${b.length}`),[E,b]);Mi((()=>{_(b[E])}),[E,b]);const R=e=>{T(Object.assign({},N,e))},k=(e,t,n)=>new Promise(((r,i)=>{A.confirm({title:h("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),r()},onCancel:()=>{n(),r()}})})),L=Mn((e=>Hn(void 0,void 0,void 0,(function*(){if(!v)return g.current=v,P();const t=((e,t)=>{const n=new RegExp(N.fullchar?`^${t}$`:t,N.case?"":"i"),r=[];return e.forEach(((e,t)=>{c.forEach(((i,a)=>{const{dataIndex:o}=i;if([es.expandableColumn,es.selectionColumn,"index","pageIndex",es.operationColumn].includes(o))return;const s=f(e,i,e.index,a);n.test(s)&&r.push({value:s,rowKey:l(e,e.index),dataIndex:o,rowIndex:t,colIndex:a})}))})),r})(s,v);if(!t.length)return A.warning({title:h("qm.button.confirmPrompt"),content:h("qm.table.fastSearch.notMatch")});if(x(t),"all"===e&&S(!0),v!==g.current)return g.current=v,w(0);if("next"===e){const e=E+1;e>t.length-1?yield k(h("qm.table.fastSearch.toTheEnd"),(()=>w(0)),(()=>{})):w(e)}if("prev"===e){const e=E-1;e<0?yield k(h("qm.table.fastSearch.toStart"),(()=>w(t.length-1)),(()=>{})):w(e)}})))),P=()=>{w(0),x([]),d({})},_=e=>{e&&(p(e.rowKey),u(e.dataIndex),d(e))},D=t.useMemo((()=>m?`fastSearch_${m}`:""),[m]),[H,M]=t.useState([]),[$,q]=t.useState(""),[j,K]=t.useState("");Mi((()=>{if(j){const{input:e,config:t}=H.find((e=>e.value===j)).condition;y(e),T(t),setTimeout((()=>L()))}}),[j]),t.useEffect((()=>{V()}),[]);const V=()=>Hn(void 0,void 0,void 0,(function*(){if(!D)return;let e=yield Qt.getItem(D);e||(e=yield z(D),Array.isArray(e)&&(yield Qt.setItem(D,e))),Array.isArray(e)&&e.length&&M(e)})),z=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),W=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return t.createElement("div",{className:`${a}-fast-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement("div",{className:"search-box"},t.createElement("span",{className:"label"},h("qm.table.fastSearch.queryLabel"),":"),t.createElement(O,{value:v,placeholder:h("qm.table.fastSearch.queryCondition"),allowClear:!0,style:{width:"100%"},onChange:e=>y(e.target.value)})),t.createElement("div",{className:"condition"},t.createElement(F,{checked:!!N.case,onChange:e=>R({case:e.target.checked})},h("qm.table.fastSearch.matchCase")),t.createElement(F,{checked:!!N.fullchar,onChange:e=>R({fullchar:e.target.checked})},h("qm.table.fastSearch.matchFullchar"))),t.createElement("div",{className:"all-list"},C&&t.createElement("table",{className:"rtable",tabIndex:-1,cellSpacing:"0",cellPadding:"0"},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",{style:{width:40,minWidth:40}},"#"),t.createElement("th",{style:{width:130,minWidth:130}},h("qm.table.fastSearch.cellText")),t.createElement("th",null,h("qm.table.fastSearch.valText")))),t.createElement("tbody",null,b.map(((e,n)=>t.createElement("tr",{key:n,className:Pe({active:E===n}),onClick:()=>w(n)},t.createElement("td",null,n+1),t.createElement("td",null,"Row:",e.rowIndex+1,", Col:",e.colIndex+1),t.createElement("td",null,e.value)))))))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:o,value:$,placeholder:h("qm.table.highSearch.configText"),disabled:!v,onChange:e=>{const{value:t}=e.target;q(t)}}),t.createElement(nr,{type:"primary",disabled:!$||!v,style:{marginLeft:"10px"},onClick:()=>Hn(void 0,void 0,void 0,(function*(){if(!D)return tr("Table","必须设置组件参数 `uniqueKey` 才能保存");if(!v)return;const e=Sa(),t=[...H,{text:$,value:e,condition:{input:v,config:N}}];M(t),q(""),yield Qt.setItem(D,t),yield W(D,t)}))},h("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${es.rowHeightMaps[o]}px`}},t.createElement("span",null,h("qm.table.fastSearch.savedSetting"))),t.createElement("ul",null,H.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===j}),title:e.text,onClick:()=>{return t=e.value,void K(t!==j?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:h("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Hn(void 0,void 0,void 0,(function*(){if(!n)return;const e=H.filter((e=>e.value!==n));M(e),yield Qt.setItem(D,e),yield W(D,e)}))}},t.createElement(et,null))))),!H.length&&t.createElement("div",{style:{padding:qo}},t.createElement(tl,null)))))),t.createElement("div",{className:"bottom-bar",style:{position:"absolute",left:0,bottom:0,right:0,height:`${Ho[o]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",boxSizing:"border-box"}},t.createElement("div",null,h("qm.table.fastSearch.findTotal",{total:I})),t.createElement("div",null,t.createElement(nr,{onClick:()=>L("all"),style:{marginRight:8}},h("qm.table.fastSearch.queryAll")),t.createElement(nr,{type:"primary",onClick:()=>L("prev"),style:{marginRight:8}},h("qm.table.fastSearch.queryPrev")),t.createElement(nr,{type:"primary",onClick:()=>L("next"),style:{marginRight:8}},h("qm.table.fastSearch.queryNext")),t.createElement(nr,{onClick:()=>n()},h("qm.table.fastSearch.closeButton")))))},ud=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i,$size:l}=t.useContext(Fo),{t:a}=Fn(),[o,s]=t.useState(!1),c=()=>{s(!0)};t.useImperativeHandle(n,(()=>({clickHandle:c})));const d={visible:o,title:a("qm.table.fastSearch.settingTitle"),width:650,loading:!1,bodyStyle:{paddingBottom:`${Ho[l]+20}px`},onClose:()=>s(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${i}-super-search`,title:a("qm.table.fastSearch.text"),onClick:()=>c()},t.createElement("i",{className:"svgicon icon"},t.createElement(tt,null))),t.createElement(Fl,d,t.createElement(dd,{onClose:()=>s(!1)})))}));ud.displayName="FastSearch";var pd={selectionColumnDefine:{title:"",dataIndex:"__selection__",width:80,fixed:"left"},indentWidth:16,groupMargin:15,separator:"^"};const md=e=>[pd.selectionColumnDefine,...e].filter((e=>!e.hidden)),hd=e=>e.some((e=>Array.isArray(e.children))),fd=e=>void 0!==e._groupLevel,gd=(e,t)=>t.split(pd.separator).reduce(((e,t)=>null==e?void 0:e[t]),e),vd=e=>Array.isArray(e)?0:"object"==typeof e&&null!==e?1+Math.max(0,...Object.values(e).map(vd)):0,yd=(e,t="")=>Array.isArray(e)?[]:Object.keys(e).reduce(((n,r)=>{const i=t?`${t}${pd.separator}${r}`:r;if(n.push(i),Array.isArray(e[r]))return n;const l=yd(e[r],i);return n.concat(l)}),[]),bd=(e,t=[],n)=>{const r=(e,t)=>{if(0===t.length)return e;const[{[Object.keys(t[0])[0]]:i}]=t,l=Object.keys(t[0])[0],a=t.slice(1),o=Object.groupBy(e,(e=>n(e,l))),s=Object.keys(o).sort(((e,t)=>{const n=(r=e,l=t,Number.isNaN(r-l)?r.toString().localeCompare(l.toString()):r-l);var r,l;return"ascend"===i?n:-n})),c={};return s.forEach((e=>{c[`#${e}`]=r(o[e],a)})),c};return r(e,t)},xd={sum:e=>xa(e.reduce(((e,t)=>e+t),0)),avg:e=>e.length>0?(e.reduce(((e,t)=>e+t),0)/e.length).toFixed(2):0,max:e=>e.length>0?Math.max(...e):void 0,min:e=>e.length>0?Math.min(...e):void 0,count:e=>xa(e.length),unique:e=>new Set(e).size,empty:e=>e.filter((e=>Gn(e))).length,notEmpty:e=>e.filter((e=>!Gn(e))).length},Ed=t.createContext(void 0),wd=e=>{const{prefixCls:n,pivotProps:r,size:i,getRowKey:l,flatColumns:a,tableData:o}=e,{initialGroup:s,initialCount:c}=r,d=e=>{const t=new Map;return sa(e).forEach((e=>t.set(l(e,e.index),e))),t},u=t.useRef({props:r,originGridData:o,flatGroupData:[],isTree:hd(o),keyRecordMap:d(o)}),[p,m]=t.useState({pivotRef:u,prefixCls:n,size:i,viewMode:"table",columns:a,gridData:o,groupGridData:[],groupList:s?(e=>{const t=[],n=a.map((e=>e.dataIndex));return e.forEach((e=>{n.includes(e.fieldName)&&["ascend","descend"].includes(e.order)&&t.push(e)})),t})(s):[],filterList:[],sorterList:[],colorList:[],expandedKeys:[],searchResults:[],switchIndex:0,fillColorCells:new Map,countMethod:c?(e=>{const t=["count","unique","empty","notEmpty","sum","max","min","avg"],n=a.map((e=>e.dataIndex)),r={};for(const i in e)n.includes(i)&&t.includes(e[i])&&(r[i]=e[i]);return r})(c):{},summationData:{}}),h=e=>{m((t=>{const n=Object.assign({},t);let r=!1;return Object.keys(e).forEach((i=>{const l=i;Object.is(t[l],e[l])||(n[l]=e[l],r=!0)})),r?n:t}))};hn((()=>{v(o),f("originGridData",o),f("isTree",hd(o)),f("keyRecordMap",d(o))}),[o]),hn((()=>{g(a)}),[a]),hn((()=>{h({size:i})}),[i]);const f=(e,t)=>{p.pivotRef.current[e]=t};f("props",r);const g=e=>{h({columns:e})},v=e=>{h({gridData:e})},y=e=>{h({groupGridData:e})},b=e=>{h({groupList:e})},x=e=>{h({filterList:e})},E=e=>{h({sorterList:e})},w=e=>{h({colorList:e})},C=e=>{h({expandedKeys:e})},S=e=>{h({searchResults:e})},N=e=>{h({switchIndex:e})},T=e=>{const t=new Map;e.forEach((e=>t.set(`${e.rowKey}|${e.dataIndex}`,e.color))),h({fillColorCells:t})},I=e=>{var t;h({countMethod:(t=Object.assign({},p.countMethod,e),Object.fromEntries(Object.entries(t).filter((([e,t])=>void 0!==t))))})},R=e=>{h({summationData:e})},O=t.useMemo((()=>Object.assign(Object.assign({},p),{setContext:h,getRowKey:l,setPivotGridRef:f,setColumns:g,setGridData:v,setGroupGridData:y,setGroupList:b,setFilterList:x,setSorterList:E,setColorList:w,setExpandedKeys:C,setSearchResults:S,setSwitchIndex:N,setFillColor:T,setCountMethod:I,setSummationData:R})),[p]);return t.createElement(Ed.Provider,{value:O},e.children)},Cd=()=>t.useContext(Ed),Sd=()=>{const{prefixCls:e,pivotRef:n,groupList:r,columns:i,gridData:l,setGroupList:a,setExpandedKeys:o,setGroupGridData:s,setPivotGridRef:c}=Cd(),{originGridData:d}=n.current,{onGroupChange:u,onDataChange:p}=n.current.props,{t:m}=Fn(),h=t.useRef([]),f=t.useRef([]),g=t.useMemo((()=>r.filter((e=>e.fieldName&&e.order))),[r]),v=t.useMemo((()=>i.map((e=>({label:Ta(e.title),value:e.dataIndex,disabled:r.some((t=>t.fieldName===e.dataIndex))})))),[r,i]),y=t.useMemo((()=>{const e=g.map((e=>({[e.fieldName]:e.order})));return me(e,h.current)?h.current:(h.current=e,e)}),[g]),b=[{label:m("qm.pivotGrid.group.ascend"),value:"ascend"},{label:m("qm.pivotGrid.group.descend"),value:"descend"}];t.useEffect((()=>{o(f.current)}),[y,d]),t.useLayoutEffect((()=>{const e=bd(l,y,((e,t)=>{let n=ga(e,t);return ae(n)&&(n=Object.values(n)),Array.isArray(n)&&(n=n.join(",")),Gn(n)?m("qm.pivotGrid.group.empty"):n}));var t;s(e),t=yd(e),f.current=t,c("flatGroupData",((e,t=[])=>{const n=[];return function e(r,i,l=""){if(Array.isArray(r))r.forEach(((e,t)=>{e._varIndex=t,l?e._parentRowKey=l:delete e._parentRowKey})),n.push(...sa(r));else for(const a in r){const o=l?`${l}${pd.separator}${a}`:a,s=Object.keys(t[i])[0];n.push({id:o,_fieldName:s,_groupLevel:i}),e(r[a],i+1,o)}}(e,0),n})(e,y))}),[y,l]),Mi((()=>{null==u||u(g)}),[y]),Mi((()=>{null==p||p(l)}),[l]);const x=()=>{a([...r,{fieldName:"",order:"ascend"}])},E=(e,t,n)=>{Object.assign(t,{[e]:n}),a([...r])},w=e=>t.createElement(t.Fragment,null,t.createElement(Be,{className:"icon handle"}),t.createElement(H,{value:e.fieldName||void 0,placeholder:m("qm.table.editable.selectPlaceholder"),options:v,style:{width:160,margin:"0 10px"},onChange:t=>E("fieldName",e,t)}),t.createElement(H,{value:e.order,options:b,placeholder:m("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>E("order",e,t)}),t.createElement(it,{className:"icon close",onClick:()=>(e=>{a(r.filter((t=>t!==e)))})(e)}));return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,m("qm.pivotGrid.group.title")),!!g.length&&t.createElement("div",null,t.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o([])},m("qm.pivotGrid.group.foldAll")),t.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>o(f.current)},m("qm.pivotGrid.group.unfoldAll")))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.fieldName)),n=r.map((e=>e.fieldName));me(t,n)||a(e)}},r.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},w(e)))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:x},t.createElement(rt,{className:"icon"}),m("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!g.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(nt,{className:"icon"}),m("qm.pivotGrid.group.text"),g.length?`(${g.length})`:null))},Nd=()=>{const{prefixCls:e,pivotRef:n,columns:r,filterList:i,setFilterList:l,setGridData:a}=Cd(),{originGridData:o,isTree:s}=n.current,{onFilterChange:c}=n.current.props,{t:d}=Fn(),u=t.useRef([]),p=t.useMemo((()=>i.filter((e=>e.fieldName&&("nil"===e.expression||!Gn(e.value))))),[i]),m=t.useMemo((()=>r.map((e=>({label:Ta(e.title),value:e.dataIndex})))),[r]),[h,f]=t.useState("and"),g=t.useMemo((()=>{const e=p.map((e=>{var t;return`${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}));return me(e,u.current)?u.current:(u.current=e,e)}),[p]);Mi((()=>{l(i.map((e=>Object.assign(Object.assign({},e),{logic:h}))))}),[h]),Mi((()=>{v(),null==c||c(p)}),[g]);const v=cl((()=>{const e=Ra(p.map((e=>Object.assign(Object.assign({},Xn(e,["value"])),{expression:"nil"!==e.expression?e.expression:"==",condition:e.value}))));a(e?Zl(o,e,s):o)}),200),y=[{label:d("qm.pivotGrid.filter.matchAll"),value:"and"},{label:d("qm.pivotGrid.filter.matchAny"),value:"or"}],b=()=>{l([...i,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:h}])},x=(e,t,n)=>{var a;if(Object.assign(t,{[e]:n}),"fieldName"===e){const e=(null===(a=r.find((e=>e.dataIndex===n)).filter)||void 0===a?void 0:a.type)||"text";Object.assign(t,{type:e,expression:w(e)[0].value,value:""})}"expression"===e&&"nil"===n&&Object.assign(t,{value:""}),l([...i])},E=e=>t.createElement(t.Fragment,null,t.createElement(H,{value:e.fieldName||void 0,options:m,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>x("fieldName",e,t)}),t.createElement(H,{value:e.expression||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),options:w(e.type),style:{width:100,margin:"0 10px"},onChange:t=>x("expression",e,t)}),C(e),t.createElement(it,{className:"icon close",onClick:()=>(e=>{l(i.filter((t=>t!==e)))})(e)})),w=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:d("qm.table.highSearch.gtText")},{value:"<",label:d("qm.table.highSearch.ltText")},{value:">=",label:d("qm.table.highSearch.gteText")},{value:"<=",label:d("qm.table.highSearch.lteText")},{value:"==",label:d("qm.table.highSearch.eqText")},{value:"!=",label:d("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:d("qm.table.highSearch.inText")},{value:"nin",label:d("qm.table.highSearch.ninText")},{value:"==",label:d("qm.table.highSearch.eqText")},{value:"!=",label:d("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",label:d("qm.table.highSearch.likeText")},{value:"==",label:d("qm.table.highSearch.eqText")},{value:"!=",label:d("qm.table.highSearch.neqText")},{value:"nil",label:d("qm.table.highSearch.nullText")}]}return t},C=e=>{var n,i;switch(e.type){case"number":return t.createElement($,{defaultValue:e.value,style:{width:150},onChange:t=>{x("value",e,Gn(t)?"":t)}});case"date":return t.createElement(In,{popupClassName:es.popupClassName,defaultValue:null!==(n=wa(e.value,"YYYY-MM-DD"))&&void 0!==n?n:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{x("value",e,Ca(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const n=(null===(i=r.find((t=>t.dataIndex===e.fieldName)))||void 0===i?void 0:i.dictItems)||[];return t.createElement(H,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{x("value",e,t)}},n.map((e=>t.createElement(H.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return t.createElement(O,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{x("value",e,t.target.value)}})}};return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,d("qm.pivotGrid.filter.title")),!!p.length&&t.createElement(H,{value:h,options:y,style:{width:130},onChange:e=>f(e)})),t.createElement("div",{className:"list"},i.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},E(e))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:b},t.createElement(rt,{className:"icon"}),d("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!p.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(lt,{className:"icon"}),d("qm.pivotGrid.filter.text"),p.length?`(${p.length})`:null))},Td=()=>{const{prefixCls:e,pivotRef:n,columns:r,gridData:i,sorterList:l,setSorterList:a,setGridData:o}=Cd(),{onSorterChange:s}=n.current.props,{t:c}=Fn(),d=t.useMemo((()=>l.filter((e=>e.fieldName&&e.order))),[l]),u=t.useMemo((()=>r.map((e=>({label:Ta(e.title),value:e.dataIndex,disabled:l.some((t=>t.fieldName===e.dataIndex))})))),[l,r]);Mi((()=>{h(),null==s||s(d)}),[t.useMemo((()=>d.map((e=>Object.values(e).join(":"))).join(",")),[d])]);const p=[{label:c("qm.pivotGrid.sorter.ascend"),value:"ascend"},{label:c("qm.pivotGrid.sorter.descend"),value:"descend"}],m=(e,t)=>"number"==typeof e&&"number"==typeof t?e-t:"string"==typeof e&&"string"==typeof t?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():0,h=()=>{var e;o((e=d,i.sort(((t,n)=>{for(const r of e){const{fieldName:e,order:i}=r,l=ga(t,e),a=ga(n,e),o=m(l,a);if(0!==o)return"ascend"===i?o:-o}return 0})).slice(0)))},f=()=>{a([...l,{fieldName:"",order:"ascend"}])},g=(e,t,n)=>{Object.assign(t,{[e]:n}),a([...l])},v=e=>t.createElement(t.Fragment,null,t.createElement(Be,{className:"icon handle"}),t.createElement(H,{value:e.fieldName||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),options:u,style:{width:160,margin:"0 10px"},onChange:t=>g("fieldName",e,t)}),t.createElement(H,{value:e.order,options:p,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>g("order",e,t)}),t.createElement(it,{className:"icon close",onClick:()=>(e=>{a(l.filter((t=>t!==e)))})(e)}));return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,c("qm.pivotGrid.sorter.title"))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.fieldName)),n=l.map((e=>e.fieldName));me(t,n)||a(e)}},l.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},v(e)))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:f},t.createElement(rt,{className:"icon"}),c("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!d.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(at,{className:"icon"}),c("qm.pivotGrid.sorter.text"),d.length?`(${d.length})`:null))},Id=()=>{const{prefixCls:e,getRowKey:n,gridData:r,columns:i,searchResults:l,switchIndex:a,setSearchResults:o,setSwitchIndex:s}=Cd(),{t:c}=Fn(),{getTitleFromCellValue:d}=us(),[u,p]=t.useState(!1),m=t.useMemo((()=>l.length),[l]);Mi((()=>{u||setTimeout((()=>{s(0),o([])}),200)}),[u]);const h=(e,t)=>{const r=[];return e.forEach(((e,l)=>{i.forEach(((i,a)=>{const o=d(e,i,l,a)+"";o.includes(t)&&r.push({value:o,rowKey:n(e,e.index),dataIndex:i.dataIndex})})),Array.isArray(e.children)&&r.push(...h(e.children,t))})),r},f=cl((e=>{const t=e.target.value.trim();s(0),o(t?h(r,t):[])}),200),g=e=>{const{keyCode:t}=e;e.preventDefault(),13===t&&v()},v=()=>{if(!m)return;s((a+1)%m)},y=()=>t.createElement("div",{className:"search-switch"},t.createElement("button",{className:"button-icon",onClick:()=>(()=>{if(!m)return;s((a-1+m)%m)})()},t.createElement(ot,null)),t.createElement("span",{className:"num"},m>0?a+1:a,"/",m),t.createElement("button",{className:"button-icon",onClick:()=>v()},t.createElement(st,null)));return t.createElement(M,{open:u,trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,c("qm.pivotGrid.search.title")),t.createElement("button",{className:"button-icon",onClick:()=>p(!1)},t.createElement(it,null))),t.createElement("div",{className:"list search",style:{margin:"10px 0"}},t.createElement(O,{autoFocus:!0,style:{width:280},suffix:y(),onChange:f,onKeyUp:g}))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300},destroyPopupOnHide:!0},t.createElement("span",{onClick:()=>p(!u)},t.createElement(tt,{className:"icon"}),c("qm.pivotGrid.search.text")))},Rd=(e,t)=>e.map((e=>(e.children&&(e.children=Rd(e.children,t)),t(e)))),Od=()=>{const{prefixCls:e,pivotRef:n,columns:r,setColumns:i}=Cd(),{uniqueKey:l,onColumnsChange:a}=n.current.props,{t:o}=Fn(),s=t.useMemo((()=>l?`grid_field_${l}`:""),[l]);t.useLayoutEffect((()=>{c()}),[]),Mi((()=>{u(r)}),[r]);const c=()=>{const e=p();e&&(null==a||a(e))},d=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=d(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),u=e=>{if(!s)return;const t=d(e),n=JSON.parse(localStorage.getItem(s));me(t,n)||localStorage.setItem(s,JSON.stringify(t))},p=()=>{if(!s)return;const e=JSON.parse(localStorage.getItem(s));if(!e)return;return fe(e.map((e=>e.dataIndex)),r.map((e=>e.dataIndex))).length>0?Rd(r,(t=>{const n=e.find((e=>e.dataIndex===t.dataIndex));return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Rd(e,(e=>{const t=r.find((t=>t.dataIndex===e.dataIndex));return t&&void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},m=t.useMemo((()=>{let e=0;for(let t=0;t<r.length-1&&("left"!==r[t].fixed||r[t+1].fixed||(e=t+1),!(e>0));t++);const t=[];for(let n=0;n<r.length;n++)n===e&&t.push({title:"",dataIndex:"__divider__"}),t.push(r[n]);return t}),[r]),h=()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container","scroll-y"),style:{padding:5}},t.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},t.createElement("span",null,o("qm.pivotGrid.field.title"))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"dataIndex",handle:".handle",tag:"ul",animation:200,list:m,setList:e=>{const t=e.map((e=>e.dataIndex)),n=m.map((e=>e.dataIndex));me(t,n)||(e=>{const t=e.findIndex((e=>"__divider__"===e.dataIndex)),n=[];for(let r=0;r<e.length;r++){const i=e[r];r<t?i.fixed="left":delete i.fixed,r!==t&&n.push(i)}i(n),null==a||a(n)})(Da(e))}},m.map((e=>"__divider__"!==e.dataIndex?t.createElement("li",{key:e.dataIndex,className:"ant-dropdown-menu-item sort-item"},t.createElement(Be,{className:"handle"}),t.createElement("span",{className:"label"},t.createElement("span",{className:"title"},Ta(e.title)),t.createElement("button",{className:"button-icon",onClick:()=>(e=>{e.hidden=!e.hidden;const t=[...r];i(t),null==a||a(t)})(e)},e.hidden?t.createElement(ct,null):t.createElement(qe,null)))):t.createElement("li",{key:e.dataIndex,className:"divider"}))))));return t.createElement(M,{trigger:["click"],dropdownRender:()=>h(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:240}},t.createElement("span",null,t.createElement(Qe,{className:"icon"}),o("qm.pivotGrid.field.text")))},kd=()=>{const{prefixCls:e,size:n,setContext:r}=Cd(),{t:i}=Fn(),l=[{label:i("qm.pivotGrid.lineHeight.size")[0],value:"small"},{label:i("qm.pivotGrid.lineHeight.size")[1],value:"middle"},{label:i("qm.pivotGrid.lineHeight.size")[2],value:"large"}];return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container"),style:{padding:5}},t.createElement("div",{className:"list"},l.map((e=>t.createElement("li",{key:e.value,className:Pe("ant-dropdown-menu-item check-item",{active:n===e.value}),onClick:()=>r({size:e.value})},t.createElement("span",{className:"label"},e.label),t.createElement("i",{className:"icon"},t.createElement($e,null))))))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:160}},t.createElement("span",null,t.createElement(dt,{className:"icon"}),i("qm.pivotGrid.lineHeight.text")))},Ld="606060",Ad="thin",Pd="d4d4d4",_d=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Dd=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Hd=()=>({top:{style:Ad,color:{argb:Pd}},left:{style:Ad,color:{argb:Pd}},bottom:{style:Ad,color:{argb:Pd}},right:{style:Ad,color:{argb:Pd}}}),Fd=e=>{const{precision:t,formatType:n}=e,r=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===n?{numFmt:r?`0${r}%`:"0%"}:"finance"===n?{numFmt:r?`#,##0${r}`:"#,##0"}:r?{numFmt:`0${r}`}:null},Md=()=>{const{prefixCls:e,pivotRef:n,columns:r,countMethod:i,summationData:l}=Cd(),{t:a}=Fn(),{exportXLSX:o}=(()=>{const{size:e}=Cd(),{t:t}=Fn(),{rowHeightMaps:n}=es,r=(e,t)=>{var n,r,i;return null!==(i=null!==(r=null===(n=e.find((e=>e.text==t)))||void 0===n?void 0:n.value)&&void 0!==r?r:t)&&void 0!==i?i:""};return{exportXLSX:(r,i,l,a)=>Hn(void 0,void 0,void 0,(function*(){const{columns:o,footSummation:s}=r,c=n[e],d=Jl(o),u=[],p=[],m=[];let h=0;const f={};d.forEach((e=>{const{dataIndex:t,width:n,renderWidth:r}=e;f[t]=Ta(e.title),m.push({key:t,width:(n||r)/8})})),u.push(f),h+=u.length;const g=i.map(((e,t)=>{const n={};return d.forEach(((r,i)=>{const l=["percent","finance"].includes(r.formatType);n[r.dataIndex]=l?ga(e,r.dataIndex):a(e,t,r,i)})),n._level=e._level,n._groupLevel=e._groupLevel,n}));h+=g.length,s&&l(d,i).forEach(((e,n)=>{const r={};d.forEach(((n,l)=>{const{dataIndex:a,summation:o}=n,s=(null==o?void 0:o.render)?o.render(i):ga(e,a);r[a]=0===l&&""===s?t("qm.table.config.summaryText"):jn(s)?Na(s).join(""):s})),p.push(r)}));const{sheetName:v,useStyle:y}=r,b=new Xt.Workbook,x=b.addWorksheet(v);x.columns=m,x.addRows(u).forEach((e=>{y&&_d(e,c),e.eachCell((e=>{const t=x.getColumn(e.col),n=ra(o,t.key),{align:r,theadAlign:i}=n;Dd(e,i||r),y&&Object.assign(e,{font:{bold:!0,color:{argb:Ld}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Hd()})}))})),x.addRows(g).forEach(((e,t)=>{const{_level:n,_groupLevel:r}=g[t];y&&_d(e,c),e.eachCell(((e,t)=>{const i=x.getColumn(e.col),l=ra(o,i.key),{align:a}=l;Dd(e,1===t||void 0===r?a:"right"),Object.assign(e,Fd(l)),y&&Object.assign(e,{font:{color:{argb:Ld}},border:Hd()}),1===Number(e.col)&&n&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:n}))}))})),s&&x.addRows(p).forEach((e=>{y&&_d(e,c),e.eachCell(((e,t)=>{const n=x.getColumn(e.col),r=ra(o,n.key),{align:i}=r;Dd(e,1===t?i:"right"),Object.assign(e,Fd(r)),y&&Object.assign(e,{font:{color:{argb:Ld}},border:Hd()})}))})),[].forEach((({s:e,e:t})=>{x.mergeCells(e.r+1,e.c+1,t.r+1,t.c+1)}));const E=yield b.xlsx.writeBuffer();return new Blob([E],{type:"application/octet-stream"})})),importXLSX:(e,n)=>{const{columns:i,file:l}=e,a=Jl(i),o=new FileReader;o.onerror=()=>{R.error(t("qm.table.import.error"))},o.onload=e=>{const i=a.map((e=>Ta(e.title))),l=new Xt.Workbook,o=e.target;o?l.xlsx.load(o.result).then((e=>{const l=e.worksheets[0];if(l){const e=l.getSheetValues(),o=e.findIndex((e=>e&&e.length>0)),s=e[o],c=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(i,s);if(c){const t=e.slice(o+1).map((e=>{const t={};e.forEach(((e,n)=>{var r;let i=e;Array.isArray(null==i?void 0:i.richText)&&(i=i.richText.map((e=>e.text)).join("")),ae(i)&&"text"in i&&(i=i.text),Ce(i)&&(i=Ca(i,zo)),(null==i?void 0:i.formula)&&(i=null!==(r=i.result)&&void 0!==r?r:i.value),t[s[n]]=i}));const n={};return i.forEach(((e,i)=>{var l;const{dataIndex:o,dictItems:s}=a[i];Array.isArray(s)&&((null===(l=t[e])||void 0===l?void 0:l.toString().includes(","))?t[e]=t[e].split(",").map((e=>r(s,e))).filter((e=>""!==e)):t[e]=r(s,t[e])),va(n,o,t[e])})),n}));null==n||n(t)}else R.error(t("qm.table.import.error"))}else R.error(t("qm.table.import.error"))})):R.error(t("qm.table.import.error"))},o.readAsArrayBuffer(l)}}})(),{getTitleFromCellValue:s}=us(),c=[{text:a("qm.pivotGrid.count.records"),value:"count"},{text:a("qm.pivotGrid.count.unique"),value:"unique"},{text:a("qm.pivotGrid.count.empty"),value:"empty"},{text:a("qm.pivotGrid.count.notEmpty"),value:"notEmpty"},{text:a("qm.pivotGrid.count.sum"),value:"sum"},{text:a("qm.pivotGrid.count.max"),value:"max"},{text:a("qm.pivotGrid.count.min"),value:"min"},{text:a("qm.pivotGrid.count.avg"),value:"avg"}],d={columns:ea(r),fileName:m().format(Wo),fileType:"xlsx",sheetName:"sheet1",footSummation:!1,useStyle:!1},u=(e,t,n,r)=>{const{dataIndex:i,precision:l,formatType:a}=n;if(fd(e))return ga(e,i);let o=s(e,n,t,r);return l>=0&&!a&&""!==o&&(o=Number(o)),o},p=()=>{if(!i||!Object.keys(i).length)return[];const e={};return d.columns.map((e=>e.dataIndex)).forEach(((t,n)=>{if(n>0){let n="";(null==i?void 0:i[t])&&(n=c.find((e=>e.value===i[t])).text+" "+l.total[t]),va(e,t,n)}})),[e]},h=e=>Hn(void 0,void 0,void 0,(function*(){const t=yield o(Object.assign(Object.assign({},d),{footSummation:!!Object.keys(i).length}),e,p,u);wl(t,`${m().format(Wo)}.xlsx`)})),f=[{key:"1",label:t.createElement(t.Fragment,null,t.createElement(ut,{style:{marginRight:4}})," ",a("qm.pivotGrid.export.group")),onClick:()=>{h((()=>{const e=[];let t=0;return n.current.flatGroupData.forEach((n=>{const a=Object.assign({},n);fd(n)?(a._level=n._groupLevel,d.columns.map((e=>e.dataIndex)).forEach(((e,t)=>{if(0===t)va(a,e,s(n._record,r.find((e=>e.dataIndex===n._fieldName)),0,0));else{let t="";(null==i?void 0:i[e])&&(t=c.find((t=>t.value===i[e])).text+" "+gd(l,n.id).subtotal[e]),va(a,e,t)}})),t=n._groupLevel):t>0&&(a._level=n._level+t+1),e.push(a)})),e})())}},{key:"2",label:t.createElement(t.Fragment,null,t.createElement(pt,{style:{marginRight:4}})," ",a("qm.pivotGrid.export.list")),onClick:()=>{h(Array.from(n.current.keyRecordMap.values()))}}];return t.createElement(M,{trigger:["click"],menu:{items:f},className:Pe("action-btn"),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:140}},t.createElement("span",null,t.createElement(je,{className:"icon"}),a("qm.pivotGrid.export.text")))},$d=()=>{const{prefixCls:e,pivotRef:n,groupList:r,filterList:i,sorterList:l,colorList:a,countMethod:o,setContext:s}=Cd(),{uniqueKey:c}=n.current.props,{t:d}=Fn(),u=t.useMemo((()=>c?`grid_conf_${c}`:""),[c]),p=t.useRef({}),[h,f]=t.useState([]),[g,v]=t.useState({}),[y,b]=t.useState(""),x=(e,t)=>{v((n=>Object.assign({},n,{[e]:null!=t?t:!n[e]})))};t.useLayoutEffect((()=>{E()}),[]),Mi((()=>{w()}),[h]);const E=()=>Hn(void 0,void 0,void 0,(function*(){try{if(!u)return;const e=yield Qt.getItem(u);Array.isArray(e)&&(f(e),v(e.reduce(((e,t)=>(t.id&&(e[t.id]=!1),e)),{})))}catch(e){}})),w=()=>Hn(void 0,void 0,void 0,(function*(){try{if(!u)return;yield Qt.setItem(u,h)}catch(e){}})),C=()=>{const e=Sa();f([{id:e,label:m().format(Wo),value:{groupList:r,filterList:i,sorterList:l,colorList:a,countMethod:o}},...h]),Bn((()=>x(e,!0)))},S=()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container"),style:{padding:5}},t.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},t.createElement("span",null,d("qm.pivotGrid.saved.title"))),t.createElement("div",{className:"list"},t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.id,className:Pe("ant-dropdown-menu-item sort-item",{active:e.id===y}),onClick:()=>(e=>{if(g[e.id])return;const t=y!==e.id,n=t?e.value:p.current;s({groupList:n.groupList,filterList:n.filterList,sorterList:n.sorterList,colorList:n.colorList,countMethod:n.countMethod}),b(t?e.id:"")})(e)},t.createElement("div",{className:"label",style:{width:200}},g[e.id]?t.createElement(O,{size:"small",autoFocus:!0,defaultValue:e.label,style:{width:"100%",marginLeft:-8},onBlur:t=>{const{value:n}=t.target;n!==e.label&&(e.label=n,f([...h])),x(e.id,!1)}}):t.createElement("span",null,e.label)),t.createElement("button",{className:"button-icon",onClick:t=>{t.stopPropagation(),x(e.id)}},g[e.id]?t.createElement($e,null):t.createElement(Me,null)),t.createElement("button",{className:"button-icon",style:{marginLeft:4},onClick:t=>{var n;t.stopPropagation(),n=e.id,f(h.filter((e=>e.id!==n)))}},t.createElement(it,null))))))),t.createElement("div",{className:"add-record",style:{padding:10}},t.createElement("span",{className:"insert",onClick:C},t.createElement(rt,{className:"icon"}),d("qm.pivotGrid.saved.add"))));return t.createElement(M,{trigger:["click"],dropdownRender:()=>S(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomRight",overlayStyle:{minWidth:280},onOpenChange:e=>{var t;t=e?{groupList:r,filterList:i,sorterList:l,colorList:a,countMethod:o}:{},p.current=t}},t.createElement("span",null,t.createElement(mt,{className:"icon"}),d("qm.pivotGrid.saved.text")))},qd=()=>{const{gridData:e}=Cd(),{t:n}=Fn();return t.createElement("div",{className:"alert-info"},t.createElement(ht,{className:"icon"}),n("qm.table.alert.total",{total:(()=>{let t=0;return function e(n){n.forEach((n=>{Array.isArray(n.children)&&e(n.children),t+=1}))}(e),t})()}))},jd=8;const Kd={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},Vd={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},zd=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function Wd(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:l,visibleFirst:a}=e,o=t/2,s={};return Object.keys(Kd).forEach((e=>{const c=r&&Vd[e]||Kd[e],d=Object.assign(Object.assign({},c),{offset:[0,0],dynamicInset:!0});switch(s[e]=d,zd.has(e)&&(d.autoArrow=!1),e){case"top":case"topLeft":case"topRight":d.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+i}const u=function(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?jd:r}}({contentRadius:l,limitVerticalRadius:!0});if(r)switch(e){case"topLeft":case"bottomLeft":d.offset[0]=-u.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=u.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=2*-u.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":d.offset[1]=2*u.arrowOffsetHorizontal-o}d.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};const i=r&&"object"==typeof r?r:{},l={};switch(e){case"top":case"bottom":l.shiftX=2*t.arrowOffsetHorizontal+n,l.shiftY=!0,l.adjustY=!0;break;case"left":case"right":l.shiftY=2*t.arrowOffsetVertical+n,l.shiftX=!0,l.adjustX=!0}const a=Object.assign(Object.assign({},l),i);return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}(e,u,t,n),a&&(d.htmlRegion="visibleFirst")})),s}const Bd=e=>{const{value:n,defaultValue:r,disabled:i,disabledAlpha:l,className:a,style:o,onChange:s,onChangeComplete:c}=e,[d,u]=ns("",{value:n,defaultValue:r}),p=e=>({hex:e.toHexString(),rgb:e.toRgbString(),hsb:e.toHsbString()}),m=Wd({offset:0,arrowWidth:16,borderRadius:6}),h=lr("color-picker");return t.createElement(Zt,{action:["click"],prefixCls:h,popupPlacement:"bottomLeft",builtinPlacements:m,popup:()=>t.createElement(Jt,{prefixCls:h,value:d,disabled:i,disabledAlpha:l,onChange:(e,t)=>{u(e.toRgbString()),null==s||s(p(e),t)},onChangeComplete:(e,t)=>{null==c||c(p(e),t)}})},t.createElement("div",{className:Pe(`${h}-btn`,a),style:o},t.createElement(en,{color:d,prefixCls:h})))};Bd.displayName="ColorPicker";const Ud=()=>{const{prefixCls:e,pivotRef:n,getRowKey:r,columns:i,colorList:l,setColorList:a,setFillColor:o}=Cd(),{flatGroupData:s}=n.current,{t:c}=Fn(),d=t.useRef([]),u=t.useMemo((()=>l.filter((e=>e.fieldName&&e.color&&("nil"===e.expression||!Gn(e.value)||"col"===e.mode)))),[l]),p=t.useMemo((()=>i.map((e=>({label:Ta(e.title),value:e.dataIndex})))),[i]),m=t.useMemo((()=>md(i)),[i]),h=[{label:c("qm.pivotGrid.fillColor.cell"),value:"cell"},{label:c("qm.pivotGrid.fillColor.row"),value:"row"},{label:c("qm.pivotGrid.fillColor.col"),value:"col"}];Mi((()=>{f()}),[t.useMemo((()=>{const e=u.map((e=>{var t;return{[e.color]:`${e.mode},${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}}));return me(e,d.current)?d.current:(d.current=e,e)}),[u])]);const f=cl((()=>{const e=[];u.forEach((t=>{const n=Ra([Object.assign(Object.assign({},Xn(t,["value"])),{expression:"nil"!==t.expression?t.expression:"==",condition:t.value})]),i=Zl(s.filter((e=>!fd(e))),n);if("cell"===t.mode||"col"===t.mode)for(let n=0;n<i.length;n++)e.push({color:t.color,rowKey:r(i[n],i[n].index),dataIndex:t.fieldName});if("row"===t.mode)for(let n=0;n<i.length;n++){const l=r(i[n],i[n].index);for(let n=0;n<m.length;n++)e.push({color:t.color,rowKey:l,dataIndex:m[n].dataIndex})}})),o(e)}),200),g=()=>{a([...l,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:"and",color:"",mode:"cell"}])},v=(e,t,n)=>{var r;if(Object.assign(t,{[e]:n}),"fieldName"===e){const e=(null===(r=i.find((e=>e.dataIndex===n)).filter)||void 0===r?void 0:r.type)||"text";Object.assign(t,{type:e,expression:y(e)[0].value,value:""})}"expression"===e&&"nil"===n&&Object.assign(t,{value:""}),a([...l])},y=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:c("qm.table.highSearch.gtText")},{value:"<",label:c("qm.table.highSearch.ltText")},{value:">=",label:c("qm.table.highSearch.gteText")},{value:"<=",label:c("qm.table.highSearch.lteText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:c("qm.table.highSearch.inText")},{value:"nin",label:c("qm.table.highSearch.ninText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",label:c("qm.table.highSearch.likeText")},{value:"==",label:c("qm.table.highSearch.eqText")},{value:"!=",label:c("qm.table.highSearch.neqText")},{value:"nil",label:c("qm.table.highSearch.nullText")}]}return t},b=e=>t.createElement(t.Fragment,null,t.createElement(Be,{className:"icon handle"}),t.createElement(Bd,{defaultValue:e.color,style:{marginLeft:5},onChangeComplete:t=>v("color",e,t.hex)}),t.createElement(H,{value:e.mode,options:h,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:90,marginLeft:10,marginRight:20},onChange:t=>v("mode",e,t)}),t.createElement(H,{value:e.fieldName||void 0,options:p,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>v("fieldName",e,t)}),"col"!==e.mode&&t.createElement(H,{value:e.expression||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),options:y(e.type),style:{width:100,margin:"0 10px"},onChange:t=>v("expression",e,t)}),"col"!==e.mode&&(e=>{var n,r;switch(e.type){case"number":return t.createElement($,{defaultValue:e.value,style:{width:150},onChange:t=>{v("value",e,Gn(t)?"":t)}});case"date":return t.createElement(In,{popupClassName:es.popupClassName,defaultValue:null!==(n=wa(e.value,"YYYY-MM-DD"))&&void 0!==n?n:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{v("value",e,Ca(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const n=(null===(r=i.find((t=>t.dataIndex===e.fieldName)))||void 0===r?void 0:r.dictItems)||[];return t.createElement(H,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:c("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{v("value",e,t)}},n.map((e=>t.createElement(H.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return t.createElement(O,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{v("value",e,t.target.value)}})}})(e),t.createElement(it,{className:"icon close",onClick:()=>(e=>{a(l.filter((t=>t!==e)))})(e)}));return t.createElement(M,{trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container")},t.createElement("div",{className:"label"},t.createElement("span",null,c("qm.pivotGrid.fillColor.title"))),t.createElement("div",{className:"list"},t.createElement(Gt,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:l,setList:e=>{const t=e.map((e=>e.fieldName)),n=l.map((e=>e.fieldName));me(t,n)||a(e)}},l.map(((e,n)=>t.createElement("li",{key:`${e.fieldName}-${n}`,className:"item"},b(e)))))),t.createElement("div",{className:"add-record"},t.createElement("span",{className:"insert",onClick:g},t.createElement(rt,{className:"icon"}),c("qm.pivotGrid.fillColor.add")))),className:Pe("action-btn",{active:!!u.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},t.createElement("span",null,t.createElement(ft,{className:"icon"}),c("qm.pivotGrid.fillColor.text"),u.length?`(${u.length})`:null))},Gd=()=>t.createElement("div",{className:"top-bar"},t.createElement(ir,{size:4},t.createElement(qd,null),t.createElement(q,{type:"vertical"}),t.createElement(Od,null),t.createElement(Sd,null),t.createElement(Nd,null),t.createElement(Td,null),t.createElement(q,{type:"vertical"}),t.createElement(kd,null),t.createElement(Ud,null),t.createElement(Id,null),t.createElement(q,{type:"vertical"}),t.createElement(Md,null)),t.createElement(ir,{size:4},t.createElement($d,null))),Yd=t.createContext(void 0),Xd=e=>{var n,r;const{scrollbar:i}=e,{pivotRef:l,getRowKey:a,columns:o,groupGridData:s,setPivotGridRef:c}=Cd(),{rowSelection:d,treeExpandable:u,rowHighlight:p}=l.current.props,m=null===(n=null==u?void 0:u.defaultExpandAllRows)||void 0===n||n,h=t.useRef({bodyEl:null,rowVirtualizer:null}),[f,g]=t.useState({gridRef:h,scrollbarRef:i,selectionKeys:null!==(r=null==d?void 0:d.defaultSelectedRowKeys)&&void 0!==r?r:[],treeExpandKeys:m?ca(l.current.originGridData,(e=>a(e,e.index))):[],highlightKey:"",checkedColumnKey:"",updateLayout:0,clicked:[],isPingLeft:!1}),v=t.useMemo((()=>Math.max(0,vd(s)-1)),[s]),y=e=>{g((t=>{const n=Object.assign({},t);let r=!1;return Object.keys(e).forEach((i=>{const l=i;Object.is(t[l],e[l])||(n[l]=e[l],r=!0)})),r?n:t}))},b=(e,t)=>{f.gridRef.current[e]=t};t.useLayoutEffect((()=>{I(),S()}),[o]),t.useLayoutEffect((()=>{(null==d?void 0:d.selectedRowKeys)&&y({selectionKeys:d.selectedRowKeys})}),[null==d?void 0:d.selectedRowKeys]),t.useLayoutEffect((()=>{void 0!==(null==p?void 0:p.currentRowKey)&&y({highlightKey:p.currentRowKey})}),[null==p?void 0:p.currentRowKey]);const x=e=>{Array.isArray(null==d?void 0:d.selectedRowKeys)||y({selectionKeys:e})},E=e=>{y({treeExpandKeys:e})},w=e=>{void 0===(null==p?void 0:p.currentRowKey)&&y({highlightKey:e})},C=e=>{y({checkedColumnKey:e})},S=()=>{y({updateLayout:f.updateLayout+1})},N=e=>{Ha(e,f.clicked,!0)||y({clicked:e})},T=e=>{y({isPingLeft:e})},I=()=>{const e=i.current.container.clientWidth,{defaultColumnWidth:t}=es,n=[];let r=0;if(o.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,r+=e.width):(e.renderWidth=void 0,n.push(e))})),n.length>0){const r=o.reduce(((e,n)=>e+(n.width||n.minWidth||t)),0);if(r<=e){const i=e-r;if(1===n.length)n[0].renderWidth=(n[0].minWidth||t)+i;else{const e=i/n.reduce(((e,n)=>e+(n.minWidth||t)),0);let r=0;n.forEach(((n,i)=>{if(0===i)return;const l=Math.floor((n.minWidth||t)*e);r+=l,n.renderWidth=(n.minWidth||t)+l})),n[0].renderWidth=(n[0].minWidth||t)+i-r}}else n.forEach((e=>{e.renderWidth=e.minWidth||t}))}else r=o.reduce(((e,n)=>e+(n.renderWidth=n.width||n.minWidth||t)),0)},R=t.useMemo((()=>Object.assign(Object.assign({},f),{indentDepth:v,setContext:y,setGridLayoutRef:b,setSelectionKeys:x,setTreeExpandKeys:E,setHighlightKey:w,setCheckColumnKey:C,forceUpdateLayout:S,setClicked:N,setPingLeft:T,updateColumnsWidth:I})),[f,v]);return t.createElement(Yd.Provider,{value:R},e.children)},Qd=()=>t.useContext(Yd),Zd=e=>{var n;const{column:r}=e,{columns:i,setColumns:l}=Cd(),{scrollbarRef:a}=Qd(),o=t.useRef(null),[s,c]=t.useState(!1),d=t.useRef(document.onselectstart),u=t.useRef({startX:0,originSizeX:0,columnWidth:0}),p=e=>{u.current=Object.assign({},u.current,e)},m=e=>{if(1!==e.buttons)return h();const t=e.clientX-u.current.startX,n=(r.width||r.renderWidth)+t;n<(r.minWidth||es.defaultColumnWidth)||(p({columnWidth:n}),o.current.style.left=`${u.current.originSizeX+t}px`)},h=()=>{a.current.container.style.cursor="",r.width=u.current.columnWidth,l([...i]),Bn((()=>c(!1))),qi(document,"mousemove",m),qi(document,"mouseup",h),p({startX:0,originSizeX:0,columnWidth:0}),f()},f=()=>{document.onselectstart!==d.current&&(document.onselectstart=d.current)};return t.createElement(t.Fragment,null,t.createElement("div",{className:"resize-bar",onMouseDown:e=>{e.preventDefault(),a.current.container.style.cursor="col-resize";const t=ma(e.target,a.current.container).left-a.current.scrollLeft+3;p({startX:e.clientX,originSizeX:t,columnWidth:r.width||r.renderWidth||0}),$i(document,"mousemove",m),$i(document,"mouseup",h),c(!0),Bn((()=>o.current.style.left=`${t}px`)),d.current=document.onselectstart,document.onselectstart=()=>!1}}),t.createElement(tn,{open:s,getContainer:null===(n=a.current)||void 0===n?void 0:n.container},t.createElement("div",{ref:o,className:"resize-line"})))},Jd=e=>{var n;const{left:r}=e,{scrollbarRef:i,isPingLeft:l,setPingLeft:a}=Qd(),o=Mn((e=>{a(e.target.scrollLeft>1)}));return t.useEffect((()=>{const e=i.current.container.children[0];return e.addEventListener("scroll",o),()=>{e.removeEventListener("scroll",o)}}),[]),t.createElement(tn,{open:!0,getContainer:null===(n=i.current)||void 0===n?void 0:n.container},t.createElement("div",{className:Pe("fixed-line",{active:l}),style:{left:r}}))},eu=()=>{const{pivotRef:e,columns:n}=Cd(),{indentDepth:r,updateLayout:i,checkedColumnKey:l,selectionKeys:a,setSelectionKeys:o,setCheckColumnKey:s}=Qd(),{rowSelection:c}=e.current.props,{selectionColumn:d}=es,{indentWidth:u,selectionColumnDefine:p}=pd,m=t.useMemo((()=>md(n)),[n]),h=t.useMemo((()=>m.filter((e=>"left"===e.fixed))),[m]),f=t.useMemo((()=>m.filter((e=>"left"!==e.fixed))),[m]),g=t.useMemo((()=>"radio"!==(null==c?void 0:c.type)),[c]),v=t.useMemo((()=>h.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?r*u:0)),0)),[r,i,h]),y=t.useMemo((()=>a.length>0&&a.length===e.current.keyRecordMap.size),[a]),b=t.useMemo((()=>a.length>0&&a.length<e.current.keyRecordMap.size),[a]),x=(n,i)=>t.createElement("div",{className:Pe(i?"fixed-left":"no-fixed"),style:{width:i?v:""}},n.map(((a,m)=>{const{dataIndex:h,title:f,align:v,width:x,renderWidth:E}=a,w={"selection-column":h===d,"col--center":"center"===v,"col--right":"right"===v,"col--checked":l===h},C=i&&1===m||!i&&m===n.length-1?r*u:0,S={width:`${(x||E||0)+C}px`,minWidth:`${(x||E||0)+C}px`};return t.createElement("div",{key:h,className:Pe("table-cell",w),style:S,onClick:()=>{return e=h,void([p.dataIndex].includes(e)||s(l!==e?e:""));var e}},h!==d?t.createElement("span",{className:"cell"},f):c&&g?t.createElement(F,{checked:y,indeterminate:b,onChange:t=>(t=>{var n;const r=t?Array.from(e.current.keyRecordMap.keys()):[];o(r),null===(n=null==c?void 0:c.onChange)||void 0===n||n.call(c,r,t?Array.from(e.current.keyRecordMap.values()):[])})(t.target.checked)}):"#",h!==d&&t.createElement(Zd,{column:a}))})));return t.createElement("div",{className:"header"},x(h,!0),(e=>x(e))(f),t.createElement(Jd,{left:v}))};function tu(e,t,n){var r;let i,l=null!==(r=n.initialDeps)&&void 0!==r?r:[];function a(){var r,a,o,s,c;let d;n.key&&(null===(r=n.debug)||void 0===r?void 0:r.call(n))&&(d=Date.now());const u=e(),p=u.length!==l.length||u.some(((e,t)=>l[t]!==e));if(!(null===(a=n.noCache)||void 0===a?void 0:a.call(n))&&!p)return i;let m;if(l=u,n.key&&(null===(o=n.debug)||void 0===o?void 0:o.call(n))&&(m=Date.now()),i=t(...u),n.key&&(null===(s=n.debug)||void 0===s?void 0:s.call(n))){const e=Math.round(100*(Date.now()-d))/100,t=Math.round(100*(Date.now()-m))/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${i(t,5)} / ${i(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null===(c=null==n?void 0:n.onChange)||void 0===c||c.call(n,i),i}return a.updateDeps=e=>{l=e},a}function nu(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const ru=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout((()=>t.apply(this,i)),n)}},iu=e=>e,lu=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},au=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(n.getBoundingClientRect())}));return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},ou={passive:!0},su="undefined"==typeof window||"onscrollend"in window,cu=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const l=e.options.useScrollendEvent&&su?()=>{}:ru(r,(()=>{t(i,!1)}),e.options.isScrollingResetDelay),a=r=>()=>{const{horizontal:a,isRtl:o}=e.options;i=a?n.scrollLeft*(o?-1:1):n.scrollTop,l(),t(i,r)},o=a(!0),s=a(!1);return s(),n.addEventListener("scroll",o,ou),n.addEventListener("scrollend",s,ou),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",s)}},du=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},uu=(e,{adjustments:t=0,behavior:n},r)=>{var i,l;const a=e+t;null===(l=null===(i=r.scrollElement)||void 0===i?void 0:i.scrollTo)||void 0===l||l.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class pu{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver((e=>{e.forEach((e=>{this._measureElement(e.target,e)}))})):null);return{disconnect:()=>{var n;null===(n=t())||void 0===n||n.disconnect(),e=null},observe:e=>{var n;return null===(n=t())||void 0===n?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null===(n=t())||void 0===n?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,n])=>{void 0===n&&delete e[t]})),this.options=Object.assign({debug:!1,noCache:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:iu,rangeExtractor:lu,onChange:()=>{},measureElement:du,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0},e)},this.notify=e=>{var t,n;null===(n=(t=this.options).onChange)||void 0===n||n.call(t,this,e)},this.maybeNotify=tu((()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null])),(e=>{this.notify(e)}),{key:"maybeNotify",noCache:()=>this.options.noCache,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach((e=>e())),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e,t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n)return void this.maybeNotify();this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=null!==(t=null===(e=this.scrollElement)||void 0===e?void 0:e.window)&&void 0!==t?t:null,this.elementsCache.forEach((e=>{this.observer.observe(e)})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,(e=>{this.scrollRect=e,this.maybeNotify()}))),this.unsubs.push(this.options.observeElementOffset(this,((e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})))}},this.getSize=()=>{var e;return this.options.enabled?(this.scrollRect=null!==(e=this.scrollRect)&&void 0!==e?e:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var e;return this.options.enabled?(this.scrollOffset=null!==(e=this.scrollOffset)&&void 0!==e?e:"function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const l=r.get(t.lane);if(null==l||t.end>l.end?r.set(t.lane,t):t.end<l.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=tu((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,n,r,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i})),{key:!1}),this.getMeasurements=tu((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((e=>{this.itemSizeCache.set(e.key,e.size)})));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const o=this.measurementsCache.slice(0,a);for(let i=a;i<e;i++){const e=r(i),a=1===this.options.lanes?o[i-1]:this.getFurthestMeasurement(o,i),s=a?a.end+this.options.gap:t+n,c=l.get(e),d="number"==typeof c?c:this.options.estimateSize(i),u=s+d,p=a?a.lane:i%this.options.lanes;o[i]={index:i,start:s,size:d,end:u,key:e,lane:p}}return this.measurementsCache=o,o}),{key:"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=tu((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=t=>e[t].start,l=mu(0,r,i,n);let a=l;for(;a<r&&e[a].end<n+t;)a++;return{startIndex:l,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:n}):null),{key:"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=tu((()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,n,r,i)=>null===r||null===i?[]:e({startIndex:r,endIndex:i,overscan:t,count:n})),{key:"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const n=this.indexFromElement(e),r=this.measurementsCache[n];if(!r)return;const i=r.key,l=this.elementsCache.get(i);l!==e&&(l&&this.observer.unobserve(l),this.observer.observe(e),this.elementsCache.set(i,e)),e.isConnected&&this.resizeItem(n,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var n;const r=this.measurementsCache[e];if(!r)return;const i=t-(null!==(n=this.itemSizeCache.get(r.key))&&void 0!==n?n:r.size);0!==i&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach(((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))}))},this.getVirtualItems=tu((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n}),{key:"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return nu(t[mu(0,t.length-1,(e=>nu(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize(),r=this.getScrollOffset();"auto"===t&&e>=r+n&&(t="end"),"end"===t&&(e-=n);const i=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-n;return Math.max(Math.min(l,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.measurementsCache[e];if(!n)return;const r=this.getSize(),i=this.getScrollOffset();if("auto"===t)if(n.end>=i+r-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=i+this.options.scrollPaddingStart))return[i,t];t="start"}const l=n.start-this.options.scrollPaddingStart+(n.size-r)/2;switch(t){case"center":return[this.getOffsetForAlignment(l,t),t];case"end":return[this.getOffsetForAlignment(n.end+this.options.scrollPaddingEnd,t),t];default:return[this.getOffsetForAlignment(n.start-this.options.scrollPaddingStart,t),t]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const r=this.getOffsetForIndex(e,t);if(!r)return;const[i,l]=r;this._scrollToOffset(i,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const[i]=nu(this.getOffsetForIndex(e,l));t=i,r=this.getScrollOffset(),Math.abs(t-r)<1||this.scrollToIndex(e,{align:l,behavior:n})}else this.scrollToIndex(e,{align:l,behavior:n});var t,r})))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e,t;const n=this.getMeasurements();let r;return r=0===n.length?this.options.paddingStart:1===this.options.lanes?null!==(t=null===(e=n[n.length-1])||void 0===e?void 0:e.end)&&void 0!==t?t:0:Math.max(...n.slice(-this.options.lanes).map((e=>e.end))),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const mu=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,l=n(i);if(l<r)e=i+1;else{if(!(l>r))return i;t=i-1}}return e>0?e-1:0};const hu="undefined"!=typeof document?t.useLayoutEffect:t.useEffect,fu=e=>(e=>{const n=t.useReducer((()=>({})),{})[1],r=Object.assign(Object.assign({},e),{onChange:(t,r)=>{var i;r?Mt(n):n(),null===(i=e.onChange)||void 0===i||i.call(e,t,r)}}),[i]=t.useState((()=>new pu(r)));return i.setOptions(r),hu((()=>i._didMount()),[]),hu((()=>i._willUpdate())),i})(Object.assign({observeElementRect:au,observeElementOffset:cu,scrollToFn:uu},e)),gu=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,vu=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),yu=(e,t)=>{var n;const r=e.target;return!("button"in e&&e.button>0)&&(!(r&&!gu(r).contains(r))&&!(null===(n=t.current)||void 0===n?void 0:n.contains(r)))};function bu({ref:t,handler:n,enabled:r=!0,omitClassNames:i=[]}){const l=Mn(n),a=e.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});e.useEffect((()=>{if(!r)return;const e=e=>{yu(e,t)&&(a.current.isPointerDown=!0)},o=e=>{a.current.ignoreEmulatedMouseEvents?a.current.ignoreEmulatedMouseEvents=!1:n&&a.current.isPointerDown&&yu(e,t)&&vu(e,i)&&(a.current.isPointerDown=!1,l(e))},s=e=>{a.current.ignoreEmulatedMouseEvents=!0,n&&a.current.isPointerDown&&yu(e,t)&&vu(e,i)&&(a.current.isPointerDown=!1,l(e))},c=gu(t.current);return c.addEventListener("mousedown",e,!0),c.addEventListener("mouseup",o,!0),c.addEventListener("touchstart",e,!0),c.addEventListener("touchend",s,!0),()=>{c.removeEventListener("mousedown",e,!0),c.removeEventListener("mouseup",o,!0),c.removeEventListener("touchstart",e,!0),c.removeEventListener("touchend",s,!0)}}),[n,t,l,a,r])}const xu=e=>{const{pivotRef:n,getRowKey:r,size:i}=Cd(),{scrollbarRef:l,clicked:a,setHighlightKey:o,setClicked:s}=Qd(),{flatGroupData:c}=n.current,{rowHighlight:d}=n.current.props,u=t.useMemo((()=>2*es.rowHeightMaps[i]),[i]),p=t.useMemo((()=>c.filter((e=>!fd(e)))),[c]),m=Mn((t=>{var n,i;const{keyCode:c}=t;if(!Gn(a)&&(27===c&&(o(""),s([])),38===c||40===c)){ji(t);const m=p.length;let h=p.findIndex((e=>r(e,e.index)===a[0]));const f=38===c?(--h+m)%m:++h%m,g=p[f],v=r(g,g.index);d&&!(null===(n=d.disabled)||void 0===n?void 0:n.call(d,g))&&(o(v),null===(i=d.onChange)||void 0===i||i.call(d,v,g)),((t,n,r)=>{const i=p.length,a=e.find((e=>e.key===r)),o=l.current.scrollTop,s=l.current.container.offsetHeight,c=a.top,d=a.height;"top"===t?c<o?l.current.SET_SCROLL_TOP(c):n===i-1&&l.current.SET_SCROLL_TOP(c-(s-d)):c+d>o+(s-u)?l.current.SET_SCROLL_TOP(c-(s-u-d)):0===n&&l.current.SET_SCROLL_TOP(c)})(38===c?"top":"bottom",f,v),s([v,a[1]])}}));t.useLayoutEffect((()=>(window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m))),[])},Eu=e=>{const{column:n,keyPath:r,type:i}=e,{prefixCls:l,countMethod:a,summationData:o,setCountMethod:s}=Cd(),{t:c}=Fn(),{dataIndex:d,filter:u}=n,[p,m]=t.useState(!1),h=t.useMemo((()=>{const e=[{text:c("qm.pivotGrid.count.records"),value:"count",fn:xd.count},{text:c("qm.pivotGrid.count.unique"),value:"unique",fn:xd.unique},{text:c("qm.pivotGrid.count.empty"),value:"empty",fn:xd.empty},{text:c("qm.pivotGrid.count.notEmpty"),value:"notEmpty",fn:xd.notEmpty},{text:c("qm.pivotGrid.count.sum"),value:"sum",fn:xd.sum},{text:c("qm.pivotGrid.count.max"),value:"max",fn:xd.max},{text:c("qm.pivotGrid.count.min"),value:"min",fn:xd.min},{text:c("qm.pivotGrid.count.avg"),value:"avg",fn:xd.avg}];return"number"===(null==u?void 0:u.type)?e:e.slice(0,-4)}),[]),f=t.useMemo((()=>{var e,t,n;const l=a[d];if(!l)return c("qm.pivotGrid.count.statistic");return`${h.find((e=>e.value===l)).text} ${null!==(n=null===(t=null===(s=o,u=r,e=u?gd(s,u):s)||void 0===e?void 0:e[i])||void 0===t?void 0:t[d])&&void 0!==n?n:""}`;var s,u}),[o,a]);return t.createElement(M,{open:p,trigger:["click"],dropdownRender:()=>t.createElement("div",{className:Pe("ant-dropdown-menu","container"),style:{padding:5}},t.createElement("div",{className:"list"},h.map((e=>{const n=e.value===a[d];return t.createElement("li",{key:e.value,className:Pe("ant-dropdown-menu-item check-item",{active:n}),onClick:()=>{s({[d]:n?void 0:e.value}),m(!1)}},t.createElement("span",{className:"label"},e.text),t.createElement("i",{className:"icon"},t.createElement($e,null)))})))),className:Pe("count-select",{show:!!a[d]}),overlayClassName:`${l}__popper`,placement:"bottomRight",overlayStyle:{minWidth:140},onOpenChange:e=>m(e)},t.createElement("span",null,f," ",t.createElement(gt,{className:"icon"})))},wu=(e,n)=>{const{pivotRef:r,columns:i,expandedKeys:l,searchResults:a,switchIndex:o,fillColorCells:s,setExpandedKeys:c}=Cd(),{gridRef:d,indentDepth:u,highlightKey:p,checkedColumnKey:m,selectionKeys:h,treeExpandKeys:f,setSelectionKeys:g,setTreeExpandKeys:v,setHighlightKey:y,setClicked:b}=Qd(),{keyRecordMap:x,isTree:E}=r.current,{bodyEl:w,rowVirtualizer:C}=d.current,{rowSelection:S,treeExpandable:N,rowHighlight:T,onRowEdit:I,onRowClick:R}=r.current.props,{t:O}=Fn(),{renderText:k,getTitleFromCellNode:L}=us(),{selectionColumn:A,treeTable:P}=es,{indentWidth:_}=pd,D=t.useMemo((()=>n?0:md(i).length-e.length),[i,e]),H=t.useMemo((()=>"radio"!==(null==S?void 0:S.type)),[S]),M=(e,t)=>{var n,r;null==S||S.checkStrictly;const i=H?e?[...h,t]:h.filter((e=>e!==t)):[t];g(i),null===(n=null==S?void 0:S.onSelect)||void 0===n||n.call(S,e,x.get(t)),null===(r=null==S?void 0:S.onChange)||void 0===r||r.call(S,i,$(i))},$=e=>{const t=[];return e.forEach((e=>t.push(x.get(e)))),t},q=(e,t)=>{var n,r;return(null===(n=a[o])||void 0===n?void 0:n.rowKey)===e&&(null===(r=a[o])||void 0===r?void 0:r.dataIndex)===t},K=(e,t)=>{const n=w.querySelectorAll(`li.table-row[data-row-key='${e}']`);Array.from(n).forEach((e=>{e.classList[t&&!(null==C?void 0:C.isScrolling)?"add":"remove"]("row--hover")}))},V=e=>t.createElement("button",{className:Pe("button-icon",{expand:l.includes(e.id)}),onClick:()=>{return t=e.id,void c(l.includes(t)?l.filter((e=>e!==t)):[...l,t]);var t}},t.createElement(yt,null)),z=(e,n,r,l)=>{const{dataIndex:a,width:o,renderWidth:s}=e,c={"expandable-column":a===A},d=1===n?(u-r._groupLevel)*_:0,p={width:`${(o||s||0)+d}px`,minWidth:`${(o||s||0)+d}px`};return t.createElement("div",{key:a,className:Pe("label-cell",c),style:p},a!==A?t.createElement(t.Fragment,null,1===n&&t.createElement("span",{className:"title"},(e=>{const{_record:n,_fieldName:r}=e,l=ga(n,r),a=i.find((e=>e.dataIndex===r));return Gn(l)||!a?t.createElement("span",{className:"empty"},O("qm.pivotGrid.group.empty")):a.render?a.render(l,n,a,0,0):k(l,a,n)})(r)),t.createElement(Eu,{column:e,keyPath:r.id,type:"subtotal"})):V(r))},W=(e,n)=>{var r,i;const l=null===(r=null==N?void 0:N.rowExpandable)||void 0===r?void 0:r.call(N,e);return t.createElement(De,{className:Pe("cell--expand",{fold:!f.includes(n),disabled:l}),style:{visibility:(null===(i=e.children)||void 0===i?void 0:i.length)>0?"visible":"hidden"},onClick:()=>{l||(e=>{var t,n;const r=f.includes(e),i=r?f.filter((t=>t!==e)):[...f,e];v(i),null===(t=null==N?void 0:N.onExpand)||void 0===t||t.call(N,!r,x.get(e)),null===(n=null==N?void 0:N.onChange)||void 0===n||n.call(N,i)})(n)}})},B=(e,n,r,i,l)=>{var a,o;const{dataIndex:c,width:d,renderWidth:u,align:p,render:f}=e,g=ga(r,c),v=f?f(g,r,e,r.index,n):k(g,e,r),x=L(v),w=h.includes(l),C={"selection-column":c===A,"col--center":"center"===p,"col--right":"right"===p,"col--checked":m===c,active:q(l,c)},N={width:`${d||u||0}px`,minWidth:`${d||u||0}px`,backgroundColor:s.get(`${l}|${c}`)};return t.createElement("div",{key:c,"data-col-index":n,title:x,className:Pe("table-cell",C),style:N,onClick:t=>{var n,i;c!==A&&(b([l,c]),T&&!(null===(n=T.disabled)||void 0===n?void 0:n.call(T,r))&&(y(l),null===(i=T.onChange)||void 0===i||i.call(T,l,r)),null==R||R(r,e,t))}},c!==A?t.createElement(t.Fragment,null,E&&1===n&&t.createElement(t.Fragment,null,(O=r._level)?t.createElement("span",{key:O,className:`cell--indent indent-level-${O}`,style:{paddingLeft:O*P.textIndent+"px"}}):null,W(r,l)),t.createElement("span",{className:"cell"},v)):t.createElement("div",{className:"action"},t.createElement("span",{className:"drag-icon"}),t.createElement("div",{className:"middle"},t.createElement("span",{className:"order"},((e,t)=>E?0===e._level?e._varIndex+1:null:t+1)(r,i)),S&&t.createElement(t.Fragment,null,H?t.createElement(F,{className:"checkbox",checked:w,disabled:null===(a=null==S?void 0:S.disabled)||void 0===a?void 0:a.call(S,r),onChange:e=>M(e.target.checked,l)}):t.createElement(j,{className:"checkbox",checked:w,disabled:null===(o=null==S?void 0:S.disabled)||void 0===o?void 0:o.call(S,r),onChange:e=>M(e.target.checked,l)}))),t.createElement("span",{className:"expand-icon",onClick:()=>null==I?void 0:I(r,i)},I?t.createElement(vt,null):null)));var O};return{renderGroupRow:(n,r)=>t.createElement("div",{className:"label-row"},e.map(((e,t)=>z(e,D+t,n)))),renderRow:(n,r,i)=>{const l={"row--selection":h.includes(i),"row--highlight":p===i};return t.createElement("li",{key:i,"data-row-key":i,className:Pe("table-row",l),onMouseEnter:()=>K(i,!0),onMouseLeave:()=>K(i)},e.map(((e,t)=>B(e,D+t,n,r,i))))}}},Cu=e=>{const{tbodyColumns:n,layout:r,displayList:i,virtualRows:l,notGroup:a}=e,{indentDepth:o,updateLayout:s}=Qd(),{indentWidth:c}=pd,d=t.useMemo((()=>n.filter((e=>"left"===e.fixed))),[n]),u=t.useMemo((()=>d.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?o*c:0)),0)),[o,s,d]),{renderGroupRow:p,renderRow:m}=wu(d,!0);return t.createElement("div",{className:"left-panel",style:{width:u}},t.createElement("div",{className:Pe("container",{"no-group":a})},l.map((e=>{const n=e.index,l=r[n],a=i[n];if(fd(a))return t.createElement("div",{key:a.id,className:Pe("group-label",`level${a._groupLevel}`),style:{top:l.top,left:l.left,right:0,height:l.height}},p(a,l.key));const o=n===r.length-1||fd(i[n+1]);return t.createElement("div",{key:l.key,className:Pe("row-item",{last:o}),style:{top:l.top,left:l.left,right:0,height:l.height}},m(a,a._varIndex,l.key))}))))},Su=e=>{const{tbodyColumns:n,layout:r,displayList:i,virtualRows:l,notGroup:a}=e;Cd();const o=t.useMemo((()=>n.filter((e=>"left"!==e.fixed))),[n]),{renderGroupRow:s,renderRow:c}=wu(o);return t.createElement("div",{className:"main-panel"},t.createElement("div",{className:Pe("container",{"no-group":a})},l.map((e=>{const n=e.index,l=r[n],a=i[n];if(fd(a))return t.createElement("div",{key:a.id,className:Pe("group-label",`level${a._groupLevel}`),style:{top:l.top,left:0,right:l.right,height:l.height}},s(a,l.key));const o=n===r.length-1||fd(i[n+1]);return t.createElement("div",{key:l.key,className:Pe("row-item",{last:o}),style:{top:l.top,left:0,right:l.right,height:l.height}},c(a,a._varIndex,l.key))}))))},Nu=()=>{const{pivotRef:e,getRowKey:n,prefixCls:r,size:i,columns:l,groupGridData:a,expandedKeys:o,searchResults:s,switchIndex:c}=Cd(),{scrollbarRef:d,treeExpandKeys:u,setGridLayoutRef:p}=Qd(),{flatGroupData:m}=e.current,{contextMenues:h}=e.current.props,{groupMargin:f}=pd,{rowHeightMaps:g}=es,v=t.useRef(null),y=t.useMemo((()=>md(l)),[l]),b=t.useMemo((()=>Array.isArray(a)),[a]),{contextMenu:x,closeMenu:E}=(({ref:e,popup:n,getTriggerContainer:r,prevent:i,prefixCls:l="",enabled:a=!0})=>{const o=t.useRef(null),s=t.useRef(null),c=e=>{s.current=e},[d,u]=t.useState(!1),[p,m]=t.useState(null),h={width:150,height:200,zIndex:9999};bu({ref:o,handler:()=>f()});const f=()=>{u(!1),m(null),c(null)},g=Mn((e=>{if(e.preventDefault(),null==i?void 0:i(e.target))return f();c(e),u(!0),Bn((()=>{var t;const{width:n,height:r}=(null===(t=o.current)||void 0===t?void 0:t.getBoundingClientRect())||h,i=n,l=r,a=window.innerWidth,s=window.innerHeight;let c=e.clientX,d=e.clientY;c+i>a&&(c=Math.max(c-i,0)),d+l>s&&(d=Math.max(d-l,0)),m({x:c,y:d})}))}));t.useEffect((()=>{const t=(null==r?void 0:r(e.current))||e.current;return a&&t&&t.addEventListener("contextmenu",g),()=>{t&&t.removeEventListener("contextmenu",g)}}),[e]);const v={position:"fixed",top:`${(null==p?void 0:p.y)||0}px`,left:`${(null==p?void 0:p.x)||0}px`,zIndex:h.zIndex};return{contextMenu:t.createElement(tn,{open:d},t.createElement("div",{ref:o,className:`${l}__context-menu`,style:v},s.current?n(s.current):null)),closeMenu:f}})({ref:v,prevent:e=>e.offsetParent.classList.contains("group-label"),prefixCls:r,enabled:!!h,popup:e=>{var r;const i=Ui(e.target,"table-cell"),l=(null===(r=null==i?void 0:i.parentNode)||void 0===r?void 0:r.getAttribute("data-row-key"))||"",a=m.find((e=>n(e,e.index)==l)),o=Number((null==i?void 0:i.getAttribute("data-col-index"))||-1),s=y[o];return t.createElement("ul",{className:"ant-dropdown-menu",style:{padding:5}},h.map((e=>{var n;const r=(null===(n=e.disabled)||void 0===n?void 0:n.call(e,a,s))||!1;return t.createElement("li",{key:e.key,className:Pe("ant-dropdown-menu-item",{"ant-dropdown-menu-item-disabled":r}),onClick:()=>{var t;r||(Bn((()=>E())),null===(t=e.onClick)||void 0===t||t.call(e,a,s))}},e.prefix&&t.createElement("span",{className:"prefix"},e.prefix),t.createElement("span",{className:"label"},e.label),e.suffix&&t.createElement("span",{className:"suffix"},e.suffix))})))}}),w=e=>{var t;const n=m[e];for(let r=e+1;r<m.length;r++)if(null===(t=m[r]._parentRowKey)||void 0===t?void 0:t.startsWith(n.id)){Object.assign(n,{_record:m[r]});break}},C=t.useMemo((()=>{const e=new Map,t=[];return m.forEach(((r,i)=>{if(fd(r)){if(0===r._groupLevel)return e.set(r.id,o.includes(r.id)),w(i),void t.push(r);const n=r.id.slice(0,r.id.lastIndexOf(pd.separator));return void(o.includes(n)&&e.get(n)&&(e.set(r.id,o.includes(r.id)),w(i),t.push(r)))}const l=n(r,r.index);r._parentRowKey&&!e.get(r._parentRowKey)||(e.set(l,u.includes(l)),t.push(r))})),e.clear(),t}),[a,o,u]),S=t.useMemo((()=>((e,{getRowKey:t,rowHeight:n})=>{const r=[],i=[],l=n,a=pd.indentWidth,o=pd.groupMargin;let s=o;for(e.forEach((e=>{if(void 0!==e._groupLevel){for(;i.length>0&&i[i.length-1]._level>=e._groupLevel;){const e=i.pop();if(e.height=e._childHeight+l,r[e._index].height=e.height,i.length>0){const t=i[i.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}i[i.length-1];const t={key:e.id,top:s,left:a*e._groupLevel,right:a*e._groupLevel,height:l,_childHeight:0,_subGroupCount:0,_index:r.length,_level:e._groupLevel};r.push(t),i.push(t),s+=l}else{const n=i[i.length-1]||{left:0,right:0},a={key:t(e,e.index),top:s,left:n.left,right:n.right,height:l};r.push(a),s+=l,i.length>0&&(n._childHeight+=l)}}));i.length>0;){const e=i.pop();if(e.height=e._childHeight+l,r[e._index].height=e.height,i.length>0){const t=i[i.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}return r})(C,{getRowKey:n,rowHeight:g[i]})),[C,i]);xu(S);const N=t.useMemo((()=>{if(b)return S.reduce(((e,t)=>e+t.height),0)+2*f;const e=S.filter((e=>0===e._level));return e.reduce(((e,t)=>e+t.height),0)+(e.length-1)*f+2*f}),[b,S]),{rowVirtualizer:T,virtualRows:I}=(e=>{const{layout:n,isGroup:r}=e,{size:i}=Cd(),{scrollbarRef:l}=Qd(),{rowHeightMaps:a}=es,o=t.useMemo((()=>{var e,t;return null!==(t=null===(e=l.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null}),[l.current]),s=fu({count:n.length,getScrollElement:()=>o,estimateSize:e=>n[e].height,overscan:1,noCache:r,rangeExtractor:e=>{var t;if(!r)return lu(e);const c=l.current.scrollTop,d=(null===(t=s.scrollElement)||void 0===t?void 0:t.offsetHeight)||o.offsetHeight,u=[];for(let e=0;e<n.length;e++){const t=n[e];c>t.top+t.height+a[i]||c+d+a[i]<t.top||u.push(e)}return u}}),c=s.getVirtualItems();return{rowVirtualizer:s,virtualRows:c}})({layout:S,isGroup:!b});Mi((()=>{const e=m.findIndex((e=>{var t;return n(e,e.index)===(null===(t=s[c])||void 0===t?void 0:t.rowKey)}));e>=0&&d.current.SET_SCROLL_TOP(e*g[i]);const t=y.findIndex((e=>{var t;return e.dataIndex===(null===(t=s[c])||void 0===t?void 0:t.dataIndex)}));if(t>=0){const e=y.slice(0,t).filter((e=>"left"!==e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);d.current.SET_SCROLL_LEFT(e)}}),[c,s]),t.useLayoutEffect((()=>{p("bodyEl",v.current),p("rowVirtualizer",T)}),[]);const R={tbodyColumns:y,layout:S,displayList:C,virtualRows:I,notGroup:b};return t.createElement("div",{ref:v,className:"body",style:{height:N}},t.createElement(Cu,R),t.createElement(Su,R),x)},Tu=()=>{const{columns:e,groupGridData:n,countMethod:r,setSummationData:i}=Cd(),{indentDepth:l,updateLayout:a}=Qd(),{selectionColumn:o}=es,{indentWidth:s}=pd,c=t.useMemo((()=>md(e)),[e]),d=t.useMemo((()=>c.filter((e=>"left"===e.fixed))),[c]),u=t.useMemo((()=>c.filter((e=>"left"!==e.fixed))),[c]),p=t.useMemo((()=>d.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?l*s:0)),0)),[l,a,d]);Mi((()=>{i(((e,t)=>{const n=[],r=e=>{const n={};for(const r in t){const i=e.map((e=>Yn(e,r)||0));n[r]=t[r](i)}return n},i=e=>{if(Array.isArray(e))return n.push(...e),{total:r(e)};const l={},a={};Object.keys(t).forEach((e=>{a[e]=[]}));for(const r in e){const o=e[r];if(Array.isArray(o)){n.push(...o);const e={};for(const n in t){const r=o.map((e=>Yn(e,n)||0));e[n]=t[n](r),a[n].push(...r)}l[r]={subtotal:e}}else{const e=i(o);l[r]=e;for(const n in t){const t=e.subtotal[n];void 0!==t&&a[n].push(t)}}}if(0===n.length)return l;const o={};for(const e in t)o[e]=t[e](a[e]);return l.subtotal=o,l},l=Array.isArray(e)?{total:r(e)}:i(e);return n.length>0&&(l.total=r(n)),delete l.subtotal,l})(n,(e=>{const t={};for(const n in e)e[n]&&Object.assign(t,{[n]:xd[e[n]]});return t})(r)))}),[r,n]);const m=(e,n)=>t.createElement("div",{className:Pe(n?"fixed-left":"no-fixed"),style:{width:n?p:""}},e.map(((r,i)=>{const{dataIndex:a,width:c,renderWidth:d}=r,u={"selection-column":a===o,"col--right":!0},p=n&&1===i||!n&&i===e.length-1?l*s:0,m={width:`${(c||d||0)+p}px`,minWidth:`${(c||d||0)+p}px`};return t.createElement("div",{key:a,className:Pe("table-cell",u),style:m},a!==o?t.createElement(Eu,{column:r,keyPath:"",type:"total"}):null)})));return t.createElement("div",{className:"footer"},m(d,!0),(e=>m(e))(u))},Iu=()=>{const{prefixCls:e,size:n}=Cd(),r=t.useRef(null);return t.createElement(Xd,{scrollbar:r},t.createElement(El,{ref:r,className:Pe(`${e}__layout`,n)},t.createElement(eu,null),t.createElement(Nu,null),t.createElement(Tu,null)))},Ru=()=>t.createElement("div",{className:"wrapper"},t.createElement(Iu,null)),Ou={rowKey:"id",columns:[],dataSource:[]},ku=e=>{const n=pn(Ou,e),{rowKey:r,fromTable:i,columns:l,dataSource:a,height:o,maxHeight:s,className:c,style:d}=n,{$size:u}=$n(n),p=Mn(((e,t)=>{const n="function"==typeof r?r(e,t):null==e?void 0:e[r];return void 0===n?(tr("PivotGrid","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),m=(e,t="",n=0)=>e.map(((e,r)=>{const i=p(e,e.index);return e.index=r,e._level=n,Array.isArray(e.children)&&(e.children=m(e.children,i,n+1)),t?Object.assign(e,{_parentRowKey:t}):e})),h=e=>{let t=!1;const n=(e=>e.filter((e=>![es.expandableColumn,es.selectionColumn,"index","pageIndex",es.operationColumn].includes(e.dataIndex))))(e).map((e=>{"left"===e.fixed&&(t=!0);const n=Object.assign(Object.assign({},e),{fixed:"left"===e.fixed?"left":void 0,editRender:void 0});return i&&(void 0===n.fixed&&delete n.fixed,delete n.editRender),n}));return!t&&n.length&&(n[0].fixed="left",tr("PivotGrid","至少需要有一项 `fixed: left` 的固定列")),n},f=t.useMemo((()=>h(l)),[l]),g=t.useMemo((()=>m(a)),[a]),v=lr("pivot-grid"),y={[v]:!0,"is-from-table":i},b={height:o,maxHeight:o||s?s:500},x={prefixCls:v,size:u,getRowKey:p,flatColumns:f,tableData:g,pivotProps:Xn(n,["columns","dataSource","rowKey","size","height","maxHeight","className","style"])};return t.createElement("div",{className:Pe(y,c),style:Object.assign(Object.assign({},d),b)},t.createElement(wd,x,t.createElement(Gd,null),t.createElement(Ru,null)))};ku.displayName="PivotGrid";const Lu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{tableRef:i,prefixCls:l,flattenColumns:a}=t.useContext(Fo),{rowKey:o,uniqueKey:s}=i.current.props,{t:c}=Fn(),{tableFullData:d}=i.current,[u,p]=t.useState(!1),m=()=>{p(!0)};t.useImperativeHandle(n,(()=>({clickHandle:m})));const h={visible:u,title:c("qm.table.pivotGrid.settingTitle"),width:"80vw",loading:!1,bodyStyle:{padding:0},onClose:()=>p(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${l}-pivot-grid`,title:c("qm.table.pivotGrid.text"),onClick:()=>m()},t.createElement("i",{className:"svgicon icon"},t.createElement(bt,null))),t.createElement(Fl,h,t.createElement(ku,{fromTable:!0,rowKey:o,uniqueKey:s,columns:a,dataSource:d})))}));Lu.displayName="PivotGrid";const Au=e=>{const{columns:n,group:r,summary:i}=e,{tableRef:l,$size:a,pagination:o,fetchParams:s,isFetch:c}=t.useContext(Fo),{fetch:d}=l.current.props,{t:u}=Fn(),p=e=>{var t;const r=n.find((t=>t.dataIndex===e));return{title:r.title,precision:r.precision,dictItems:null!==(t=r.dictItems)&&void 0!==t?t:[]}},h=r.map((e=>Object.assign({dataIndex:e.group},p(e.group)))),f=i.map((e=>e.summary===es.groupSummary.total.value?{dataIndex:e.summary,title:es.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},p(e.summary)),{formula:e.formula}))),g=t.useMemo((()=>Object.assign({},s,{[es.sorterFieldName]:void 0,[es.groupSummary.summaryFieldName]:i.map((e=>`${e.formula}|${e.summary}`)).join(","),[es.groupSummary.groupbyFieldName]:r.map((e=>e.group)).join(","),usedJH:2,[es.currentPageName]:1})),[s,r,i]),[v,y]=t.useState(((e,t)=>[{title:u("qm.table.groupSummary.index"),dataIndex:"pageIndex",width:80,render:e=>e+1},...e.map((e=>({title:e.title,dataIndex:e.dataIndex,dictItems:e.dictItems}))),...t.map((e=>{var t;const r=null===(t=n.find((t=>t.dataIndex===e.dataIndex)))||void 0===t?void 0:t.groupSummary;let i=r?{summation:r}:null;return e.dataIndex===es.groupSummary.total.value&&(i={dataIndex:es.groupSummary.recordTotalIndex,summation:{render:()=>o.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?i:null)}))])(h,f)),[b]=t.useState(c?[]:(e=>{const t=Oa(e,r.map((e=>e.group))),n=[];return t.forEach((e=>{const t={};v.forEach((n=>{const{dataIndex:r}=n;"index"!==r&&va(t,r,ga(e[0],r))})),i.forEach((n=>{const r=n.summary!==es.groupSummary.total.value?n.summary:es.groupSummary.recordTotalIndex,i=n.formula;"count"===i&&va(t,r,e.length),"sum"===i&&va(t,r,Se(e,r)),"max"===i&&va(t,r,Ne(e,r)[r]),"min"===i&&va(t,r,Te(e,r)[r]),"avg"===i&&va(t,r,(Se(e,r)/e.length).toFixed(2))})),n.push(t)})),n})(l.current.tableFullData)),x=Object.assign(Object.assign({size:a,height:400},c?{fetch:{api:d.api,params:g,dataKey:null==d?void 0:d.dataKey}}:{dataSource:b}),{columns:v,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${m().format(Wo)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>y(e)});return t.createElement(Rp,x)},Pu=e=>{const{onClose:n}=e,{global:r}=t.useContext(on),{tableRef:i,prefixCls:l,$size:a,flattenColumns:o}=t.useContext(Fo),{uniqueKey:s}=i.current.props,{t:c}=Fn(),d=t.useRef(null),u=t.useRef(null),[p,m]=t.useState(!1),[h,f]=t.useState([]),[g,v]=t.useState(""),[y,b]=t.useState("");Mi((()=>{if(y){const{group:e,summary:t}=h.find((e=>e.value===y)).list;T(e),L(t)}else{const e=H();T((null==e?void 0:e.group)||[]),L((null==e?void 0:e.summary)||[])}}),[y]),t.useEffect((()=>{F()}),[]);const x=t.useMemo((()=>s?`summary_${s}`:""),[s]),E=t.useMemo((()=>o.filter((e=>![es.expandableColumn,es.selectionColumn,"index","pageIndex",es.operationColumn].includes(e.dataIndex)))),[o]),w=E.filter((e=>!e.groupSummary)).map((e=>({text:Ta(e.title),value:e.dataIndex}))),C=[es.groupSummary.total,...E.filter((e=>!!e.groupSummary)).map((e=>({text:Ta(e.title),value:e.dataIndex})))],S=[{text:c("qm.table.groupSummary.sumText"),value:"sum"},{text:c("qm.table.groupSummary.maxText"),value:"max"},{text:c("qm.table.groupSummary.minText"),value:"min"},{text:c("qm.table.groupSummary.avgText"),value:"avg"},{text:c("qm.table.groupSummary.countText"),value:"count"}],[N,T]=t.useState([]),[I,R]=t.useState([{title:c("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(nr,{type:"text",onClick:()=>{d.current.REMOVE_RECORDS(n)}},c("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:c("qm.table.groupSummary.groupItem"),minWidth:200,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:w.map((e=>Object.assign(Object.assign({},e),{disabled:N.findIndex((t=>t.group===e.value))>-1})))})}]),[k,L]=t.useState([]),[A,P]=t.useState([{title:c("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(nr,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(n)}},c("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:c("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:C.map((e=>Object.assign(Object.assign({},e),{disabled:k.findIndex((t=>t.summary===e.value))>-1}))),extra:{cornerSign:!1},onChange:t=>{e.formula=""}})},{dataIndex:"formula",title:c("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===es.groupSummary.total.value?S.slice(S.length-1):S})}]),_=t.useMemo((()=>{const e=N.length&&N.every((e=>Object.values(e).every((e=>""!==e)))),t=k.length&&k.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[N,k]),D=()=>{x&&sessionStorage.setItem(x,JSON.stringify({group:N.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}))},H=()=>{if(!x)return;const e=sessionStorage.getItem(x);return e?JSON.parse(e):null},F=()=>Hn(void 0,void 0,void 0,(function*(){if(!x)return;const e=H();if(e){const{group:t,summary:n}=e;T(t),L(n)}let t=yield Qt.getItem(x);t||(t=yield M(x),Array.isArray(t)&&(yield Qt.setItem(x,t))),Array.isArray(t)&&t.length&&(f(t),!e&&b(t[0].value))})),M=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),$=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),q={visible:p,title:c("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>m(!1)};return t.createElement("div",{className:`${l}-group-summary__setting`},t.createElement("div",{className:"main"},t.createElement("div",{style:{width:"30%"}},t.createElement(Rp,{ref:d,size:a,columns:I,dataSource:N,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>R(e),onDataChange:e=>{T(e)}},t.createElement(nr,{type:"primary",icon:t.createElement(rt,null),onClick:()=>{d.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"container line"},t.createElement(Rp,{ref:u,size:a,columns:A,dataSource:k,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onDataChange:e=>{L(e)}},t.createElement(nr,{type:"primary",icon:t.createElement(rt,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:a,value:g,placeholder:c("qm.table.groupSummary.configText"),disabled:_,onChange:e=>{const{value:t}=e.target;v(t)}}),t.createElement(nr,{type:"primary",disabled:!g||_,style:{marginLeft:"10px"},onClick:()=>Hn(void 0,void 0,void 0,(function*(){if(!x)return tr("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Sa(),t=[...h,{text:g,value:e,list:{group:N.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}}];f(t),b(e),v(""),yield Qt.setItem(x,t),yield $(x,t)}))},c("qm.table.groupSummary.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${es.rowHeightMaps[a]}px`}},t.createElement("span",null,c("qm.table.groupSummary.savedSetting"))),t.createElement("ul",null,h.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===y}),title:e.text,onClick:()=>{return t=e.value,void b(t!==y?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:c("qm.table.groupSummary.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Hn(void 0,void 0,void 0,(function*(){if(!n)return;const e=h.filter((e=>e.value!==n));f(e),n===y&&b(""),yield Qt.setItem(x,e),yield $(x,e)}))}},t.createElement(et,null))))),!h.length&&t.createElement("div",{style:{padding:qo}},t.createElement(tl,null)))))),t.createElement(Fl,q,t.createElement(Au,{columns:E,group:N,summary:k})),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>n(),style:{marginRight:8}},c("qm.table.groupSummary.closeButton")),t.createElement(nr,{type:"primary",disabled:_,onClick:()=>(D(),void m(!0))},c("qm.table.groupSummary.confirmButton"))))},_u=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i}=t.useContext(Fo),{t:l}=Fn(),[a,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={visible:a,title:l("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${i}-group-summary`,title:l("qm.table.groupSummary.text"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(xt,null))),t.createElement(Fl,c,t.createElement(Pu,{onClose:()=>o(!1)})))}));_u.displayName="GroupSummary";const Du=e=>{const{onClose:n}=e,{global:r}=t.useContext(on),{tableRef:i,$size:l,prefixCls:a,flattenColumns:o,setSuperFilters:s,clearTableFilter:c}=t.useContext(Fo),{uniqueKey:d}=i.current.props,{t:u}=Fn(),p=t.useRef(null),[m,h]=t.useState([]),[f,g]=t.useState([]),[v,y]=t.useState(""),[b,x]=t.useState("");Mi((()=>{h(b?f.find((e=>e.value===b)).list:H()||[])}),[b]),t.useEffect((()=>{F()}),[]);const E=t.useMemo((()=>d?`superSearch_${d}`:""),[d]),w=t.useMemo((()=>o.filter((e=>!!e.filter))),[o]),C=Ra(m),S=t.useMemo((()=>!(C&&Ql(C))),[C]),N=t.useMemo((()=>!!m.length&&S),[m,S]),T=[{value:"and",text:u("qm.table.highSearch.andText")},{value:"or",text:u("qm.table.highSearch.orText")}],I=o.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:Ta(e.title)}))),R=e=>["in","nin"].includes(e),k=(e,t)=>{let n;switch(e){case"number":n="number";break;case"date":n="date";break;case"checkbox":case"radio":n=t?"select-multiple":"select";break;default:n="text"}return n},L=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:u("qm.table.highSearch.gtText")},{value:"<",text:u("qm.table.highSearch.ltText")},{value:">=",text:u("qm.table.highSearch.gteText")},{value:"<=",text:u("qm.table.highSearch.lteText")},{value:"==",text:u("qm.table.highSearch.eqText")},{value:"!=",text:u("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",text:u("qm.table.highSearch.inText")},{value:"nin",text:u("qm.table.highSearch.ninText")},{value:"==",text:u("qm.table.highSearch.eqText")},{value:"!=",text:u("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:u("qm.table.highSearch.likeText")},{value:"==",text:u("qm.table.highSearch.eqText")},{value:"!=",text:u("qm.table.highSearch.neqText")}]}return t},[A,P]=t.useState([{title:u("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,n)=>t.createElement("div",null,t.createElement(nr,{type:"text",onClick:()=>{p.current.REMOVE_RECORDS(n)}},u("qm.table.highSearch.removeText")))},{title:u("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:u("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:I,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:u("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var n,r;const i=Object.values(t)[0],l=null===(n=w.find((e=>e.dataIndex===i)))||void 0===n?void 0:n.filter.type,a=L(l);e.fieldType=l,e.expression=i?null===(r=a[0])||void 0===r?void 0:r.value:"",e.condition=R(e.expression)?[]:"",i||(e.bracketLeft=e.bracketRight="")}})},{title:u("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:u("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const n=null===(t=w.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:L(n),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=R(e.expression)?[]:""}}}},{title:u("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,n,r;const i=w.find((t=>t.dataIndex===e.fieldName)),l=null==i?void 0:i.filter.type,a=null!==(r=null!==(n=null===(t=null==i?void 0:i.filter)||void 0===t?void 0:t.items)&&void 0!==n?n:null==i?void 0:i.dictItems)&&void 0!==r?r:[];return{type:k(l,R(e.expression)),editable:!0,items:a,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:u("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,n)=>t.createElement("span",{style:{fontSize:"20px"}},e)},{title:u("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:T,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),_=()=>{c(),s(m.map((e=>Xn(e,["index","pageIndex"])))),D(),n()},D=()=>{E&&sessionStorage.setItem(E,JSON.stringify(m.filter((e=>!!e.fieldName))))},H=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},F=()=>Hn(void 0,void 0,void 0,(function*(){if(!E)return;const e=H();e&&h(e);let t=yield Qt.getItem(E);t||(t=yield M(E),Array.isArray(t)&&(yield Qt.setItem(E,t))),Array.isArray(t)&&t.length&&(g(t),!e&&x(t[0].value))})),M=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==r?void 0:r.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),$=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==r?void 0:r.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return t.createElement("div",{className:`${a}-super-search__setting`},t.createElement("div",{className:"main"},t.createElement("div",{className:"container"},t.createElement(Rp,{ref:p,size:l,columns:A,dataSource:m,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>P(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(n)&&("bracketLeft"===n&&(e[n]=e[n]?"":"("),"bracketRight"===n&&(e[n]=e[n]?"":")"),h([...m]))},onDataChange:e=>{h(e)}},t.createElement(nr,{type:"primary",icon:t.createElement(rt,null),onClick:()=>{p.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),es.highSearch.showSQL&&C&&t.createElement("code",{className:"lang-js"},C)),t.createElement("div",{className:"saved line"},t.createElement("div",{className:"form-wrap"},t.createElement(O,{size:l,value:v,placeholder:u("qm.table.highSearch.configText"),disabled:S,onChange:e=>{const{value:t}=e.target;y(t)}}),t.createElement(nr,{type:"primary",disabled:!v||S,style:{marginLeft:"10px"},onClick:()=>Hn(void 0,void 0,void 0,(function*(){if(!E)return tr("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Sa(),t=[...f,{text:v,value:e,list:m.filter((e=>!!e.fieldName))}];g(t),x(e),y(""),yield Qt.setItem(E,t),yield $(E,t)}))},u("qm.table.highSearch.saveButton"))),t.createElement("div",{className:"card-wrap"},t.createElement("h5",{style:{height:`${es.rowHeightMaps[l]}px`}},t.createElement("span",null,u("qm.table.highSearch.savedSetting"))),t.createElement("ul",null,f.map((e=>t.createElement("li",{key:e.value,className:Pe({selected:e.value===b}),title:e.text,onClick:()=>{return t=e.value,void x(t!==b?t:"");var t}},t.createElement("span",{className:"title"},e.text),t.createElement("i",{className:"svgicon close",title:u("qm.table.highSearch.removeText"),onClick:t=>{var n;t.stopPropagation(),n=e.value,Hn(void 0,void 0,void 0,(function*(){if(!n)return;const e=f.filter((e=>e.value!==n));g(e),n===b&&x(""),yield Qt.setItem(E,e),yield $(E,e)}))}},t.createElement(et,null))))),!f.length&&t.createElement("div",{style:{padding:qo}},t.createElement(tl,null)))))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>n(),style:{marginRight:8}},u("qm.table.highSearch.closeButton")),t.createElement(nr,{type:"primary",disabled:N,onClick:()=>_()},u("qm.table.highSearch.searchButton"))))},Hu=t.forwardRef(((e,n)=>{const{open:r=!0}=e,{prefixCls:i}=t.useContext(Fo),{t:l}=Fn(),[a,o]=t.useState(!1),s=()=>{o(!0)};t.useImperativeHandle(n,(()=>({clickHandle:s})));const c={visible:a,title:l("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return t.createElement(t.Fragment,null,r&&t.createElement("span",{className:`${i}-super-search`,title:l("qm.table.highSearch.text"),onClick:()=>s()},t.createElement("i",{className:"svgicon icon"},t.createElement(Et,null))),t.createElement(Fl,c,t.createElement(Du,{onClose:()=>o(!1)})))}));Hu.displayName="SuperSearch";const Fu=t.forwardRef(((e,n)=>{const{tableColumns:r,showFullScreen:i,showReload:l,showPrint:a,showImport:o,showExport:s,showClipboard:c,showCollection:d,showFastSearch:u,showSuperSearch:p,showPivotGrid:m,showGroupSummary:h,showToolBox:f}=e,{global:g}=t.useContext(on),{tableRef:v,$size:y,prefixCls:b,isFullScreen:x}=t.useContext(Fo),{uniqueKey:E,exportExcel:w}=v.current.props,{t:C}=Fn(),S=t.useRef(null),N=t.useRef(null),T=t.useRef(null),I=t.useRef(null),R=t.useRef(null),O=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(null),_=t.useRef(null),D=t.useRef(!1),H=t.useMemo((()=>E?`toolBox_${E}`:""),[E]),[$,q]=t.useState({fullScreen:!1,reload:!1,print:!1,import:!1,export:!1,clipboard:!1,collection:!1,fastSearch:!1,superSearch:!1,pivotGrid:!1,groupSummary:!1}),j={fullScreen:i,reload:l,print:a,import:o,export:s&&!(null==w?void 0:w.hideIcon),clipboard:c,collection:d,fastSearch:u,superSearch:p,pivotGrid:m,groupSummary:h},[V,z]=t.useState(!1);Mi((()=>{D.current&&(B(),D.current=!1)}),[$]),t.useEffect((()=>{W()}),[]),t.useImperativeHandle(n,(()=>({exportHandle:()=>{if(!R.current)return tr("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const W=()=>{if(!H||!f)return;const e=JSON.parse(localStorage.getItem(H));e||U(H).then((e=>{e&&(q(Object.assign({},$,e)),localStorage.setItem(H,JSON.stringify(e)))})).catch((()=>{})),e&&q(Object.assign({},$,e))},B=()=>{if(!H||!f)return;const e={};for(const t in $)$[t]&&(e[t]=$[t]);localStorage.setItem(H,JSON.stringify(e)),G(H,e)},U=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==g?void 0:g.getComponentConfigApi;if(t)try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),G=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==g?void 0:g.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),Y=e=>Hn(void 0,void 0,void 0,(function*(){z(!1),yield Wn(100),e.current.clickHandle()})),X=(e,t)=>{D.current=!0,q(Object.assign({},$,{[t]:e}))},Q={"top-toolbox__popper":!0,[`${b}--lg`]:"large"===y,[`${b}--sm`]:"small"===y};return t.createElement(t.Fragment,null,i&&t.createElement(cs,{ref:S,isFullScreen:x,open:!f||$.fullScreen}),l&&t.createElement(ds,{ref:N,open:!f||$.reload}),a&&t.createElement(ps,{ref:T,tableColumns:r,open:!f||$.print}),o&&t.createElement(Ss,{ref:I,tableColumns:r,open:!f||$.import}),s&&t.createElement(ld,{ref:R,tableColumns:r,open:(!f||$.export)&&!(null==w?void 0:w.hideIcon)}),c&&t.createElement(od,{ref:O,open:!f||$.clipboard}),d&&t.createElement(cd,{ref:k,columns:r,open:!f||$.collection}),u&&t.createElement(ud,{ref:L,open:!f||$.fastSearch}),m&&t.createElement(Lu,{ref:A,open:!f||$.pivotGrid}),h&&t.createElement(_u,{ref:P,open:!f||$.groupSummary}),p&&t.createElement(Hu,{ref:_,open:!f||$.superSearch}),f&&t.createElement(M,{open:V,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.fullScreen,style:{marginRight:6},onChange:e=>X(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.screen.full"))),onClick:()=>Y(S)},{key:"reload",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.reload,style:{marginRight:6},onChange:e=>X(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.refresh.text"))),onClick:()=>Y(N)},{key:"print",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.print,style:{marginRight:6},onChange:e=>X(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.print.text"))),onClick:()=>Y(T)},{key:"import",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.import,style:{marginRight:6},onChange:e=>X(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.import.textNoSpace"))),onClick:()=>Y(I)},{key:"export",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.export,style:{marginRight:6},onChange:e=>X(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.export.textNoSpace"))),onClick:()=>Y(R)},{key:"clipboard",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.clipboard,style:{marginRight:6},onChange:e=>X(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.clipboard.textNoSpace"))),onClick:()=>Y(O)},{key:"collection",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.collection,style:{marginRight:6},onChange:e=>X(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.selectCollection.text"))),onClick:()=>Y(k)},{key:"fastSearch",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.fastSearch,style:{marginRight:6},onChange:e=>X(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.fastSearch.text"))),onClick:()=>Y(L)},{key:"pivotGrid",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.pivotGrid,style:{marginRight:6},onChange:e=>X(e.target.checked,"pivotGrid"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.pivotGrid.text"))),onClick:()=>Y(A)},{key:"groupSummary",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.groupSummary,style:{marginRight:6},onChange:e=>X(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.groupSummary.text"))),onClick:()=>Y(P)},{key:"superSearch",label:t.createElement(t.Fragment,null,t.createElement(F,{checked:$.superSearch,style:{marginRight:6},onChange:e=>X(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),t.createElement("span",null,C("qm.table.highSearch.text"))),onClick:()=>Y(_)}];return t.createElement(K,{items:e.filter((e=>j[e.key]))})})(),overlayClassName:Pe(Q),overlayStyle:{minWidth:120},onOpenChange:e=>{z(e)}},t.createElement("span",{className:`${b}-toolbox`,title:C("qm.table.toolbox.text")},t.createElement("i",{className:"svgicon icon"},t.createElement(wt,null)))))}));Fu.displayName="ToolBox";const Mu=(e,t)=>e.map((e=>(e.children&&(e.children=Mu(e.children,t)),t(e)))),$u=t.forwardRef(((e,n)=>{const{columns:r}=e,{global:i}=t.useContext(on),{tableRef:l,prefixCls:a,$size:o}=t.useContext(Fo),{showColumnDefine:s,uniqueKey:c,onlyShowIcon:d,columnsChange:u}=l.current.props,{t:p}=Fn(),m=t.useRef([]),[h,f]=t.useState(!1),g=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(r)),[r]),v=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(r)),[r]),y=t.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(r)),[r]),b=t.useMemo((()=>c?`table_${c}`:""),[c]);Mi((()=>{w(r)}),[r]),t.useLayoutEffect((()=>{C()}),[]),t.useImperativeHandle(n,(()=>({initialHandler:C})));const x=()=>{if(!b)return;const e=JSON.parse(localStorage.getItem(b));var t;if(e||(t=b,Hn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.getComponentConfigApi;if(e)try{const n=yield e({key:t});if(200===n.code)return n.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(b,JSON.stringify(e)),C()):(null==i?void 0:i.getComponentConfigApi)&&w(r)})).catch((()=>{})),!e)return;return fe(ta(e).map((e=>e.dataIndex)),ta(r).map((e=>e.dataIndex))).length>0?Mu(r,(t=>{const n=ra(e,t.dataIndex);return n&&(void 0!==n.hidden&&(t.hidden=n.hidden),void 0!==n.fixed&&(t.fixed=n.fixed),void 0!==n.width&&(t.width=n.width),void 0!==n.renderWidth&&(t.renderWidth=n.renderWidth)),t})):Mu(e,(e=>{const t=ra(r,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},E=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=E(e.children)),void 0!==e.hidden&&(t.hidden=e.hidden),void 0!==e.fixed&&(t.fixed=e.fixed),void 0!==e.width&&(t.width=e.width),void 0!==e.renderWidth&&(t.renderWidth=e.renderWidth),Object.assign({dataIndex:e.dataIndex},t)})),w=e=>{if(!b)return;const t=E(e),n=JSON.parse(localStorage.getItem(b));var r,a;l.current.columnsDefined&&!me(t,n)&&(localStorage.setItem(b,JSON.stringify(t)),r=b,a=t,Hn(void 0,void 0,void 0,(function*(){const e=null==i?void 0:i.saveComponentConfigApi;if(e)try{yield e({[r]:a})}catch(e){}})))},C=()=>{const e=x();var t;e&&(t=S(e),m.current=t,null==u||u(e))},S=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((n,r)=>{const i=n.colSpan;i>1&&e.slice(r+1,r+i).every((({colSpan:e})=>0===e))&&t.push(e.slice(r,r+i))})),t},N=()=>{const e=t=>t.map((t=>{const n=ra(r,t.dataIndex)||Qn(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==u||u(e(l.current.originColumns))},T=e=>{const t=[];e.forEach((n=>{const{colSpan:r,dataIndex:i}=n;if(0===r)return;if(1===r)return t.push(n);const l=m.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(i)));if(-1===l)return t.push(n);t.push(...m.current[l].map((({dataIndex:t},r)=>{const i=e.find((e=>e.dataIndex===t));return r>0&&(void 0!==n.hidden&&(i.hidden=n.hidden),void 0!==n.fixed?i.fixed=n.fixed:i.fixed&&delete i.fixed),i})))})),r.forEach(((e,n)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(n,0,e)})),null==u||u(t)},I=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,T(r))},R=(e,n)=>{var i;const{colSpan:l,noFixed:a}=e;if(0===l)return t.createElement("li",{key:e.dataIndex,style:{display:"none"}});const o=Ta(e.title),s=["svgicon","handle",`${n}-handle`],c=t.createElement("li",{key:e.dataIndex,className:"item"},t.createElement(F,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,T(r)}}),t.createElement("i",{className:Pe(s),title:p("qm.table.columnFilter.draggable")},t.createElement(Be,null)),t.createElement("span",{className:"text",title:o},o),"main"===n?t.createElement("span",{className:Pe("fixed",a?"disabled":"")},t.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedLeft"),onClick:()=>I(e,"left")},t.createElement(Ct,null)),t.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.fixedRight"),onClick:()=>I(e,"right")},t.createElement(St,null))):"sub"!==n?t.createElement("span",{className:Pe("fixed",a?"disabled":"")},t.createElement("i",{className:"svgicon",title:p("qm.table.columnFilter.cancelFixed"),onClick:()=>I(e)},t.createElement(et,null))):null);return!e.hidden&&(null===(i=e.children)||void 0===i?void 0:i.length)?t.createElement(V,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:O(e.children,e.dataIndex)},c):c},O=(e,n)=>t.createElement("div",{className:"column-filter--wrap"},t.createElement(Gt,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:t=>{const i=t.map((e=>e.dataIndex)),l=e.map((e=>e.dataIndex));me(i,l)||((e,t)=>{ra(r,t).children=e,null==u||u([...r])})(Da(t),n)}},e.map((e=>R(e,"sub"))))),k={[`${a}__popper`]:!0,"column-filter__popper":!0,[`${a}--lg`]:"large"===o,[`${a}--sm`]:"small"===o},L=[`${a}-column-filter`,{selected:h}];return s?t.createElement(nd,{action:["click"],popupVisible:h,popup:t.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},t.createElement("div",{className:"reset"},t.createElement(nr,{type:"text",size:"small",onClick:N},p("qm.table.columnFilter.reset"))),t.createElement("div",{className:"left"},t.createElement(Gt,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:g,setList:e=>{const t=e.map((e=>e.dataIndex)),n=g.map((e=>e.dataIndex));me(t,n)||T([...Da(e),...y,...v])}},g.map((e=>R(e,"left"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"main"},t.createElement(Gt,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),n=y.map((e=>e.dataIndex));me(t,n)||T([...g,...Da(e),...v])}},y.map((e=>R(e,"main"))))),t.createElement("div",{className:"divider"}),t.createElement("div",{className:"right"},t.createElement(Gt,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:v,setList:e=>{const t=e.map((e=>e.dataIndex)),n=v.map((e=>e.dataIndex));me(t,n)||T([...g,...y,...Da(e)])}},v.map((e=>R(e,"right")))))),popupClassName:Pe(k),popupStyle:{minWidth:160},onPopupVisibleChange:e=>{f(e)},builtinPlacements:Bo,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("span",{className:Pe(L),title:d?p("qm.table.columnFilter.text"):void 0},t.createElement("i",{className:"svgicon icon"},t.createElement(Qe,null)),!d&&t.createElement("span",null,p("qm.table.columnFilter.text")))):null}));$u.displayName="ColumnFilter";const qu=(e,t,n)=>{let r;for(let i=0;i<e.length;i++){const l=e[i];if(l.children)if(l.children.some((e=>e[n]===t)))r=l[n];else{const e=qu(l.children,t,n);e&&(r=e)}}return r},ju=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&ju(e.children,t),t(e)||e.children&&e.children.length))),Ku=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Ku(e.children,t)),t(e)&&n.push(e)})),n},Vu=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=Vu(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},zu=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:zu(e.children,t,n,r)}):e)),Wu=(e,t)=>{const n=[];return e.forEach((e=>{e.children&&n.push(...Wu(e.children,t)),Array.isArray(e.children)&&e.children.length&&n.push(e[t])})),n},Bu=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][n]===t)return[t];if(Array.isArray(e[r].children)){const i=Bu(e[r].children,t,n);if(i)return[e[r][n],i].flat()}}},Uu=(e,t)=>{var n;const r=(null===(n=e.children)||void 0===n?void 0:n.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>r.push(...Uu(e,t)))),r},Gu=t.forwardRef(((e,n)=>{const{className:r,style:i,filterable:l=!0,multiple:a,draggable:o,dataSource:s,fetch:c,autoFocus:d,asyncLoad:u,checkStrictly:p,checkStrategy:m="SHOW_CHILD",placeholder:h,fieldsDefine:f,value:g,height:v,defaultSelectedKeys:y=[],defaultExpandedKeys:b=[],defaultExpandAll:x=!0,showSearchBar:E=!0,showCollapse:w=!0,onSelectChange:C,onCheckChange:S,onDragStart:N,onDragChange:T,onExpand:I}=e,{$size:R}=$n(e),{t:k}=Fn(),L=(null==f?void 0:f.valueKey)||"value",A=(null==f?void 0:f.textKey)||"text";null==f||f.children;const P=t.useRef(null),_=t.useRef(null),D=sl(P),[H,F]=t.useState(v),[M,$]=t.useState(!1),q=cl((()=>{F(P.current.offsetHeight-ee.current.offsetHeight-10)}),5);hn((()=>{v||q()}),[D.height]);const[j,K]=t.useState([]),[V,W]=t.useState({}),[B,U]=t.useState([]),[G,Y]=t.useState([]),[X,Q]=t.useState(""),[Z,J]=t.useState(x),ee=t.useRef(null),te=t.useRef([]),ne=t.useRef([]);t.useEffect((()=>{Array.isArray(s)&&(re(s),U(ie(s)),W({}))}),[s]),t.useEffect((()=>{var e;oe(),d&&(null===(e=_.current)||void 0===e||e.focus())}),[]),Mi((()=>{oe()}),[null==c?void 0:c.params]),Mi((()=>{Y(ae())}),[V]),t.useImperativeHandle(n,(()=>({INSERT_RECORD:(e,t)=>{const n=Array.isArray(t)?t:[t],r=Vu(j,(t=>e===t[L]));r&&(Array.isArray(r.children)?r.children.push(...n):r.children=[...n],re([...j]))},REMOVE_RECORD:e=>{var t;const n=qu(j,e,L);if(void 0===n&&j.find((t=>t[L]===e)))re(j.filter((t=>t[L]!==e)));else{const r=Vu(j,(e=>n===e[L]));if(!r)return;const i=null===(t=r.children)||void 0===t?void 0:t.findIndex((t=>e===t[L]));i>=0&&(r.children.splice(i,1),re([...j]))}},UPDATE_RECORD:(e,t)=>{const n=Vu(j,(t=>e===t[L]));n&&(Ie(n,t),re([...j]))}})));const re=e=>{K(e),te.current=e,ne.current=Wu(e,L)},ie=e=>{if(a)return y;const t=Ku(e,(e=>y.includes(e[A])));return 1===t.length?[t[0][L]]:[]},le=e=>{var t;return(null===(t=Bu(j,e,L))||void 0===t?void 0:t.slice(0,-1))||[]},ae=()=>{if(x)return ne.current;const e=[];return B.forEach((t=>{if(a){if("SHOW_ALL"===m&&!ne.current.includes(t)&&e.push(...le(t)),"SHOW_CHILD"===m&&e.push(...le(t)),"SHOW_PARENT"===m){const n=no(j,t);if(n){const r=le(t),i=Uu(n,L);e.push(...r,...[t,...i].filter((e=>ne.current.includes(e))))}}}else e.push(...le(t))})),[...new Set([...b,...e])]},oe=()=>Hn(void 0,void 0,void 0,(function*(){var e;if(!c)return;const{api:t,params:n,dataKey:r,afterFetch:i,callback:l}=c;try{$(!0);const a=yield t(n);if(200===a.code){let t=Array.isArray(a.data)?a.data:null!==(e=ue(a.data,r))&&void 0!==e?e:[];t="function"==typeof i?yield i(t):t,re(t),U(ie(t)),W({}),null==l||l(t)}}catch(e){}$(!1)})),se=e=>`${e}|${bo.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ce=lr("search-tree"),de={[ce]:!0,[`${ce}--lg`]:"large"===R,[`${ce}--sm`]:"small"===R};return t.createElement("div",{ref:P,className:Pe(de,r),style:i},t.createElement("div",{ref:ee,className:"topper"},E&&t.createElement(O,{ref:_,value:X,size:R,placeholder:h||k("qm.form.inputPlaceholder"),suffix:t.createElement(Nt,null),allowClear:!0,onChange:e=>(e=>{if(!l)return;const t=ju(te.current,(t=>{if(!e)return!0;const n=t[A]||"";return-1!==se(n).indexOf(e)}));Q(e),K(t),Y(x||e?Wu(t,L):ae())})(e.target.value)}),w&&t.createElement("a",{className:"trigger",onClick:()=>{J(!Z),Y(Z?[]:ne.current)}},Z?t.createElement(_e,null):t.createElement(De,null)," ",k(Z?"qm.form.collect":"qm.form.spread"))),t.createElement(nl,{spinning:M},t.createElement(z,{fieldNames:{title:A,key:L,children:"children"},multiple:a,draggable:o,blockNode:o,checkable:a,selectable:!a,height:H,disabled:e.disabled,checkStrictly:p,selectedKeys:null!=g?g:B,checkedKeys:null!=g?g:B,expandedKeys:G,treeData:j,loadData:u?({key:e,children:t})=>Hn(void 0,void 0,void 0,(function*(){var n;if(!c||t)return;const{api:r,params:i,dataKey:l,formatter:a=(e=>e),afterFetch:o}=c;try{const t=yield r(a(Object.assign(Object.assign({},i),{[L]:e})));if(200===t.code){let r=Array.isArray(t.data)?t.data:null!==(n=ue(t.data,l))&&void 0!==n?n:[];r="function"==typeof o?yield o(r):r;const i=zu(te.current,e,L,r);re(i)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!X)return!1;const t=e[A]||"";return-1!==se(t).indexOf(X)},onDragStart:N,onDragEnter:e=>{Y(e.expandedKeys)},onDrop:e=>{const t=e.node.key,n=e.dragNode.key,r=e.node.pos.split("-"),i=e.dropPosition-Number(r[r.length-1]),l=(e,t,n)=>{for(let r=0;r<e.length;r++){if(e[r][L]===t)return n(e[r],r,e);e[r].children&&l(e[r].children,t,n)}},a=[...j];let o;if(l(a,n,((e,t,n)=>{n.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===i)l(a,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,n=[];l(a,t,((t,r,i)=>{n=i,e=r})),-1===i?n.splice(e,0,o):n.splice(e+1,0,o)}else l(a,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));re(a)},onDragEnd:e=>{null==T||T(e,j)},onExpand:(e,t)=>{Gn(e)&&J(!1),ne.current.every((t=>e.includes(t)))&&J(!0),Y(e),null==I||I(e,t)},onSelect:e=>{U(e);const t=Ku(te.current,(t=>e.includes(ue(t,L))));null==C||C(a?t:t[0])},onCheck:e=>{p&&(e=e.checked),U(e),p||("SHOW_CHILD"===m&&(e=e.filter((e=>!ne.current.includes(e)))),"SHOW_PARENT"===m&&(e=e.filter(((e,t,n)=>!n.includes(qu(j,e,L))))));const t=Ku(te.current,(t=>e.includes(ue(t,L))));null==S||S(a?t:t[0])}})))}));Gu.displayName="QmSearchTree";const Yu=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"})),Xu=e=>{const{column:n,filters:r}=e,{$size:i,prefixCls:l,setFilters:a,clearSuperFilters:o}=t.useContext(Fo),{t:s}=Fn(),c=t.useRef(null),d=t.useRef(null),u=t.useRef(null),[p,m]=t.useState(!1),[h,f]=t.useState(!1),[g,v]=t.useState({}),y=t.useMemo((()=>{const{dataIndex:e,filter:t}=n;return`${e}|${t.type}`}),[n]),b=t.useMemo((()=>{let e=!1;for(const t in r[y])if(!Gn(r[y][t])||h){e=!0;break}return e}),[y,r,h]);t.useLayoutEffect((()=>{p&&setTimeout((()=>x()),20)}),[p]),t.useEffect((()=>{var e;me(g[y],r[y])||v({[y]:r[y]||{}}),f(""===(null===(e=r[y])||void 0===e?void 0:e["=="]))}),[r]);const x=()=>{switch(n.filter.type){case"text":c.current.focus();break;case"number":d.current.focus();break;case"textarea":u.current.focus()}},E=e=>{e&&v(e),o(),a((e=>{for(const t in e){for(const n in e[t])if(Gn(e[t][n])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][n])continue;delete e[t][n]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},r),g),e))),m(!1)},w={text:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O,{ref:c,size:i,placeholder:s("qm.table.filter.searchText",{text:Ta(e.title)}),style:{width:"180px"},value:null!==(r=null===(n=g[y])||void 0===n?void 0:n.like)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;v((e=>Object.assign({},e,{[y]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&E()}}),t.createElement("div",{style:{marginTop:8}},t.createElement(F,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;v((e=>Object.assign({},e,{[y]:{"==":n,like:null}}))),f(t)}},s("qm.table.filter.nullValue"))))},textarea:e=>{var n,r;return t.createElement(t.Fragment,null,t.createElement(O.TextArea,{ref:u,size:i,placeholder:s("qm.table.filter.searchAreaText",{text:Ta(e.title)}),style:{width:"220px"},value:null!==(r=null===(n=g[y])||void 0===n?void 0:n.likes)&&void 0!==r?r:"",disabled:h,onChange:e=>{const{value:t}=e.target;v((e=>Object.assign({},e,{[y]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),E())}}),t.createElement("div",{style:{marginTop:8}},t.createElement(F,{checked:h,onChange:e=>{const{checked:t}=e.target,n=t?"":null;v((e=>Object.assign({},e,{[y]:{"==":n,like:null}}))),f(t)}},s("qm.table.filter.nullValue"))))},number:e=>{const n=e=>{var t,n;return{value:null!==(n=null===(t=g[y])||void 0===t?void 0:t[e])&&void 0!==n?n:"",size:i,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||v((n=>Object.assign({},n,{[y]:Object.assign({},n[y],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&E()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement($,Rn({ref:d},n(">"),{placeholder:s("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement($,Rn({},n("<"),{placeholder:s("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement($,Rn({},n("=="),{placeholder:s("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement($,Rn({},n("!="),{placeholder:s("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const n=e=>{var t;return{value:wa(null===(t=g[y])||void 0===t?void 0:t[e],Vo),format:Vo,size:i,onChange:t=>{v((n=>Object.assign({},n,{[y]:Object.assign({},n[y],{[e]:Ca(t,Vo)})})))},onKeyDown:e=>{13===e.keyCode&&E()}}};return t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"> "),t.createElement(In,Rn({},n(">"),{placeholder:s("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"< "),t.createElement(In,Rn({},n("<"),{placeholder:s("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"= "),t.createElement(In,Rn({},n("=="),{placeholder:s("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),t.createElement("li",null,t.createElement("span",null,"!="),t.createElement(In,Rn({},n("!="),{placeholder:s("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("ul",null,t.createElement(j.Group,{style:{width:"100%"},value:null===(n=g[y])||void 0===n?void 0:n["=="],onChange:e=>{const{value:t}=e.target;v((e=>Object.assign({},e,{[y]:{"==":t}})))}},l.map((e=>t.createElement("li",{key:e.value},t.createElement(j,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("ul",null,t.createElement(F.Group,{style:{width:"100%"},value:null===(n=g[y])||void 0===n?void 0:n.in,onChange:e=>{v((t=>Object.assign({},t,{[y]:{in:e}})))}},l.map((e=>t.createElement("li",{key:e.value},t.createElement(F,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var n;const{filter:r,dictItems:i=[]}=e,l=r.items||i;return t.createElement("div",{style:Object.assign({height:200},r.style)},t.createElement(Gu,{multiple:!0,value:(null===(n=g[y])||void 0===n?void 0:n.in)||[],dataSource:l,onCheckChange:e=>{const t=e.map((e=>e.value));v((e=>Object.assign({},e,{[y]:{in:t}})))}}))}},C=()=>t.createElement(S,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},t.createElement(nr,{size:i,onClick:()=>(E({[y]:{}}),void f(!1))},s("qm.table.filter.reset")),t.createElement(nr,{type:"primary",size:i,onClick:()=>E()},s("qm.table.filter.search"))),N={"head-filter__popper":!0,[`${l}--lg`]:"large"===i,[`${l}--sm`]:"small"===i},T=["cell--filter",{selected:p,actived:b}];return t.createElement(nd,{action:["click"],popupVisible:p,popup:(()=>{const e=n.filter.type,r=w[e];return r?t.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},t.createElement("div",null,r(n)),C()):(tr("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:Pe(N),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{m(e)},builtinPlacements:Bo,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},t.createElement("div",{className:Pe(T),title:s("qm.table.filter.text"),onClick:e=>e.stopPropagation()},t.createElement("span",{className:"svgicon icon"},t.createElement(Yu,null))))},Qu=e=>{const{column:n}=e,{tableRef:r,bordered:i}=t.useContext(Fo),{columns:l,resizable:a,columnsChange:o=Vn}=r.current.props,s=t.useMemo((()=>la(n)),[n]),c={resizable:!0,"is--line":a&&!i};return t.createElement("div",{className:Pe(c),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n,scrollBarRef:i}=r.current,a=n.$resizableBar,c=t.offsetWidth/2,d=e.clientX,u=ma(t,n.$table).left-i.current.scrollLeft+c;n.$table.classList.add("c--resize"),a.style.left=`${u}px`,a.style.display="block";const p=s.width||s.renderWidth;let m=p;return document.onmousemove=function(e){if("number"!=typeof p)return;const t=e.clientX-d,n=p+t;n<(s.minWidth||es.defaultColumnWidth)||(m=Math.floor(n),a.style.left=`${t+u}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),a.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof m&&(ra(l,s.dataIndex).width=m,o([...l]))},!1}})},Zu=e=>{const{selectionKeys:n}=e,{tableRef:r,getRowKey:i,fetchParams:l,createTableList:a,setSelectionKeysEffect:o,setInvalidRowKeys:s,setSpinning:c,isFetch:d,isWebPagination:u}=t.useContext(Fo),{rowSelection:p}=r.current.props,{fetchAllRowKeys:m,selectAllOnCurrentPage:h,filterable:f,onSelectAll:g}=p,{t:v}=Fn(),y=t.useRef([]),b=t.useMemo((()=>d&&!!m),[d,m]),x=t.useMemo((()=>!b&&!!h),[b,h]),E=t.useMemo((()=>(null==f||f)&&!x),[f,x]),C=()=>{const{selectionRows:e}=r.current,{disabled:t}=p;return(t?e.filter((e=>!t(e))):e).map((e=>i(e,e.index)))},S=(()=>{const{recordsMap:e,allRowKeys:t}=r.current,{disabled:n}=p;if(b)return y.current.length?y.current:Re(t,C());if(!x)return n?t.filter((t=>!n(e.get(t)))):t;const l=n?a().filter((e=>!n(e))).map((e=>i(e,e.index))):a().map((e=>i(e,e.index)));return Re(l,C())})(),N=n.filter((e=>!S.includes(e))),T=n.length-N.length,I=T>0&&T<S.length,R=!!T&&T===S.length;s(N);const O=()=>Hn(void 0,void 0,void 0,(function*(){var e;const t=m;let n=[];c(!0);try{const r=yield t.api(l);if(200===r.code){n=Array.isArray(r.data)?r.data:null!==(e=ue(r.data,t.dataKey))&&void 0!==e?e:[];const{disabled:l}=p;l&&(n=fe(n,a().filter((e=>l(e))).map((e=>i(e,e.index))))),y.current=n}}catch(e){}return c(!1),n})),k=e=>Hn(void 0,void 0,void 0,(function*(){let t=[];t=b?e?yield O():[]:e?S.slice(0):[],t=[...new Set([...t,...N])],o(t),null==g||g(e,t)})),L=()=>{const e=[{key:1,label:v("qm.table.selection.all"),onClick:()=>{k(!0)}},{key:2,label:v("qm.table.selection.invert"),onClick:()=>Hn(void 0,void 0,void 0,(function*(){let e=[];e=fe(n,b?yield O():S),e=[...new Set([...e,...N])],o(e)}))},{key:3,label:v("qm.table.selection.clear"),onClick:()=>{k(!1)}}];return t.createElement(K,{items:e})};return t.createElement("div",{className:"cell--selection"},t.createElement(F,{checked:R,indeterminate:I,disabled:!S.length,onChange:e=>k(e.target.checked)}),E&&t.createElement(M,{overlayClassName:"all-selection__popper",dropdownRender:()=>L()},t.createElement(De,{className:"svgicon icon"})),x&&t.createElement(w,{placement:"top",title:v("qm.table.selection.currentPage")},t.createElement(ht,{className:"info"})))},Ju=e=>{const{style:n}=e,{tableRef:r,setRowExpandedKeys:i}=t.useContext(Fo),{expandable:l}=r.current.props,[a,o]=t.useState((null==l?void 0:l.defaultExpandAllRows)||!1);Mi((()=>{i(a?[...r.current.allParentRowKeys]:[])}),[a]);const s={[`${lr("expand")}--icon`]:!0,expanded:a,collapsed:!a};return t.createElement("span",{className:Pe(s),title:"",onClick:e=>{e.stopPropagation(),o(!a)},style:n})},ep=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"})),tp=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"})),np=e=>{const{tableColumns:n}=e,{tableRef:r,prefixCls:i,layout:l,flattenColumns:a,sorter:o,filters:s,superFilters:c,selectionKeys:d,isFetch:u,isGroupSubtotal:p,treeExpandIndex:m,tableChange:h,setSorter:f,setElementStore:g,resetTableScroll:v,getStickyLeft:y,getStickyRight:b,createGroupData:x,createTableFullData:E}=t.useContext(Fo),{ellipsis:C,resizable:S,multipleSort:N,rowSelection:T,expandable:I}=r.current.props,[R,O]=es.sortDirections,{tableOriginData:k}=r.current,{t:L}=Fn(),A=t.useRef(null),P=t.useMemo((()=>k.some((e=>Array.isArray(e.children)))),[k]),_=t.useMemo((()=>!u),[u]),D=t.useMemo((()=>!u),[u]),H=t.useMemo((()=>!(null==I?void 0:I.hideExpandAll)),[I]),F=t.useMemo((()=>!!T&&(u?!(!T.selectAllOnCurrentPage&&!T.fetchAllRowKeys):!T.hideSelectAll)),[u,T]);Mi((()=>{z(),h(),v()}),[o]),Mi((()=>{G(),h(),v()}),[s]),Mi((()=>{G(),h(),v()}),[c]),t.useEffect((()=>{!Gn(o)&&Bn((()=>z())),!Gn(s)&&Bn((()=>G()))}),[]),t.useLayoutEffect((()=>{M()}),[]);const M=()=>{g("$header",A.current)},$=(e,n,i)=>{var l,a,s;const{dataIndex:c,colSpan:d,rowSpan:u,fixed:p,align:m,theadAlign:h,theadClassName:f="",sorter:g,filter:v,required:x,headRender:E}=e;if(0===d)return null;const w=h||m,N=["header--column",{"col--ellipsis":null!==(l=e.ellipsis)&&void 0!==l?l:C,"col--center":"center"===w,"col--right":"right"===w,"column--required":!!x,"column-has-sorter":g,"column-has-filter":v,"column--sort":!!o[c],"cell-fix-left":"left"===p,"cell-fix-right":"right"===p,"cell-fix-left-last":"left"===p&&!(null===(a=i[n+(null!=d?d:1)])||void 0===a?void 0:a.fixed),"cell-fix-right-first":"right"===p&&!(null===(s=i[n-1])||void 0===s?void 0:s.fixed),[f]:!!f}],T={left:"left"===p?`${y(c)}px`:"",right:"right"===p?`${b(c,"thead")}px`:""},I=S&&![es.expandableColumn,es.selectionColumn].includes(c);return t.createElement("th",{key:c,className:Pe(N),colSpan:d,rowSpan:u,style:Object.assign({},T),onClick:t=>V(t,e)},t.createElement("div",{className:"cell--wrapper"},E?t.createElement("div",{className:"cell--text cell"},E(e,r.current.tableFullData)):t.createElement(t.Fragment,null,t.createElement("div",{className:"cell--text"},q(e)),v?K(e):null)),I&&t.createElement(Qu,{column:e}))},q=e=>{const{dataIndex:n,type:i,sorter:l,title:a,description:s}=e;if(n===es.selectionColumn&&"checkbox"===i){if("checkbox"===i)return t.createElement("div",{className:"cell"},F?t.createElement(Zu,{selectionKeys:d}):L("qm.table.config.selectionText"));if("radio"===i)return t.createElement("div",{className:"cell"},a)}const c=[];return c.push(t.createElement("div",{key:0,className:"cell",title:Ta(a)},r.current.isTreeTable&&n===m&&H?t.createElement(Ju,null):null,n===es.expandableColumn&&H?t.createElement(Ju,null):a)),s&&c.push(t.createElement(w,{key:1,placement:"top",title:s},t.createElement(ht,{className:"tip"}))),l&&c.push(j(o[n])),c},j=e=>{const n=["svgicon cell--sorter__asc",{actived:e===R}],r=["svgicon cell--sorter__desc",{actived:e===O}];return t.createElement("div",{key:2,className:"cell--sorter",title:L("qm.table.sorter.text")},t.createElement("span",{className:Pe(n)},t.createElement(ep,null)),t.createElement("span",{className:Pe(r)},t.createElement(tp,null)))},K=e=>t.createElement(Xu,{column:e,filters:s}),V=(e,t)=>{const{sorter:n,dataIndex:r}=t;if(n){const e=o[r],t=e?e===O?null:O:R;N?(delete o[r],f(Object.assign({},o,{[r]:t}))):f(Object.assign({},{[r]:t}))}},z=()=>{_&&W()},W=e=>{const t=Oe(o,(e=>null!==e));U(t),e||Object.keys(t).length||U({index:R})},B=(e,t)=>Number.isNaN(e-t)?e.toString().localeCompare(t.toString()):e-t,U=e=>{const{tableFullData:t}=r.current,n=((e,t)=>e.sort(((e,n)=>{for(const r in t){const i=a.find((e=>e.dataIndex===r)),l=t[r],o=ga(e,r),s=ga(n,r),c="function"!=typeof(null==i?void 0:i.sorter)?B(o,s):i.sorter(e,n);if(0!==c)return"ascend"===l?c:-c}return 0})).slice(0))(p?x(Ia(t)):t,e);E(n)},G=()=>{D&&Y()},Y=()=>{const e=c.length?Ra(c):Ra(s),t=""!==e?p?x(Zl(Ia(k),e,P)):Zl(k,e,P):k;E(t),W(!0)},X=da(n),{tableBodyWidth:Q}=l;return t.createElement("div",{ref:A,className:`${i}--header-wrapper`},t.createElement("table",{className:`${i}--header`,cellSpacing:"0",cellPadding:"0",style:{width:Q?`${Q}px`:""}},t.createElement("colgroup",null,a.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})}))),t.createElement("thead",null,(e=>e.map(((e,n)=>t.createElement("tr",{key:n,className:"header--row"},e.map(((t,n)=>$(t,n,e)))))))(X))))},rp=t.createContext([]),ip=(e,t,n,r,i,l,a,o,s,c)=>{var d;const{clientX:u,clientY:p}=e,{top:m,height:h}=e.target.getBoundingClientRect(),f=(((null==i?void 0:i.x)||0)-u-12)/r,g=s.filter((e=>{var t,n;return null===(n=null===(t=o[e])||void 0===t?void 0:t.children)||void 0===n?void 0:n.length}));let v=lp(o,n.eventKey);if(p<m+h/2){const e=a.findIndex((e=>e===v.key)),t=a[e<=0?0:e-1];v=lp(o,t)}const y=v.key,b=v,x=v.key;let E=0,w=0;if(!g.includes(y))for(let e=0;e<f&&op(v);e+=1)v=v.parent,w+=1;const C=t.data,S=v.node;let N=!0;return sp(v)&&0===v.level&&p<m+h/2&&l({dragNode:C,dropNode:S,dropPosition:-1})&&v.key===n.eventKey?E=-1:(b.children||[]).length&&g.includes(x)?l({dragNode:C,dropNode:S,dropPosition:0})?E=0:N=!1:0===w?f>-1.5?l({dragNode:C,dropNode:S,dropPosition:1})?E=1:N=!1:l({dragNode:C,dropNode:S,dropPosition:0})?E=c?1:0:l({dragNode:C,dropNode:S,dropPosition:1})?E=1:N=!1:l({dragNode:C,dropNode:S,dropPosition:1})?E=1:N=!1,{dropPosition:E,dropLevelOffset:w,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:x,dropContainerKey:0===E?null:(null===(d=v.parent)||void 0===d?void 0:d.key)||null,dropAllowed:N}},lp=(e,t)=>e[t],ap=e=>e.split("-"),op=e=>{if(e.parent){const t=ap(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1},sp=e=>{const t=ap(e.pos);return 0===Number(t[t.length-1])},cp=({openDragSort:e})=>{const{tableRef:n,getRowKey:r,rowExpandedKeys:i,setRowExpandedKeys:l,createTableFullData:a,dataChange:o}=t.useContext(Fo),{tableFullData:s,allRowKeys:c,isTreeTable:d}=n.current,u=zn,p=t.useRef(null),m=t.useRef(null),h=t.useRef(null),f=t.useRef(),[g,v]=t.useState({}),[y,b]=t.useState(null),[x,E]=t.useState([]),[w,C]=t.useState(0),[S,N]=t.useState({dropPosition:null,dropLevelOffset:null,dropContainerKey:null,dropTargetKey:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),T=e=>{N((t=>Object.assign({},t,e)))};t.useLayoutEffect((()=>{e&&v((e=>{const t={},n=(e,i=null,l=0)=>{const a=[];return e.forEach(((e,o)=>{const s=r(e,e.index),c={index:o,key:s,level:l,node:e,parent:i,pos:(d=(null==i?void 0:i.pos)||"0",u=o,`${d}-${u}`),nodes:[...(null==i?void 0:i.nodes)||[],e]};var d,u;Array.isArray(e.children)&&(c.children=n(e.children,c,l+1)),t[s]=c,a.push(c)})),a};return n(e),t})(s))}),[s]),t.useEffect((()=>()=>{window.removeEventListener("dragend",O)}),[]);const I=()=>{T({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},R=()=>{null!==y&&(b(null),T({dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null})),m.current=null,h.current=null},O=e=>{k(),window.removeEventListener("dragend",O)},k=(e,t,n)=>{T({dragOverNodeKey:null}),R(),p.current=null,window.removeEventListener("dragend",O)},L=e=>{const t=e.node.eventKey,n=e.dragNode.eventKey,i=e.node.pos.split("-"),l=e.dropPosition-Number(i[i.length-1]),c=(e,t,n)=>{for(let i=0;i<e.length;i++){if(r(e[i],e[i].index)===t)return n(e[i],i,e);e[i].children&&c(e[i].children,t,n)}},d=[...s];let u;if(c(d,n,((e,t,n)=>{n.splice(t,1),u=e})),e.dropToGap){let e,n=[];c(d,t,((t,r,i)=>{n=i,e=r})),-1===l?n.splice(e,0,u):n.splice(e+1,0,u)}else c(d,t,(e=>{e.children=e.children||[],e.children.unshift(u)}));a(d),o()};return{onNodeDragStart:(e,t)=>{const{eventKey:n}=t;p.current=t,m.current={x:e.clientX,y:e.clientY};const r=((e,t)=>{if(!e)return[];const n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n})(i,n);b(n),E(((e,t)=>{const n=[];return function e(t=[]){t.forEach((({key:t,children:r})=>{n.push(t),e(r)}))}(lp(t,e).children),n})(n,g)),C(2*es.treeTable.textIndent),l(r),window.addEventListener("dragend",O)},onNodeDragEnter:(e,t)=>{const{eventKey:n}=t;if(h.current!==n&&(h.current=n),!p.current)return void I();const{dropPosition:r,dropLevelOffset:a,dropTargetKey:o,dropContainerKey:s,dropTargetPos:v,dropAllowed:b,dragOverNodeKey:E}=ip(e,p.current,t,w,m.current,u,c,g,i,!d);-1===x.indexOf(o)&&b?(f.current||(f.current={}),Object.keys(f.current).forEach((e=>{clearTimeout(f.current[e])})),p.current.eventKey!==n&&(e.persist(),f.current[n]=window.setTimeout((()=>{var e;if(null===y)return;let t=[...i];const r=lp(g,n);r&&(null===(e=r.children)||void 0===e?void 0:e.length)&&(t=((e,t)=>{const n=(e||[]).slice();return-1===n.indexOf(t)&&n.push(t),n})(i,n)),l(t)}),800)),p.current.eventKey!==o||0!==a?T({dragOverNodeKey:E,dropPosition:r,dropLevelOffset:a,dropTargetKey:o,dropContainerKey:s,dropTargetPos:v,dropAllowed:b}):I()):I()},onNodeDragOver:(e,t)=>{if(!p.current)return;const{dropPosition:n,dropLevelOffset:r,dropTargetKey:l,dropContainerKey:a,dropAllowed:o,dropTargetPos:s,dragOverNodeKey:h}=ip(e,p.current,t,w,m.current,u,c,g,i,!d);-1===x.indexOf(l)&&o&&(p.current.eventKey===l&&0===r?null===S.dropPosition&&null===S.dropLevelOffset&&null===S.dropTargetKey&&null===S.dropContainerKey&&null===S.dropTargetPos&&!1===S.dropAllowed&&null===S.dragOverNodeKey||I():n===S.dropPosition&&r===S.dropLevelOffset&&l===S.dropTargetKey&&a===S.dropContainerKey&&s===S.dropTargetPos&&o===S.dropAllowed&&h===S.dragOverNodeKey||T({dropPosition:n,dropLevelOffset:r,dropTargetKey:l,dropContainerKey:a,dropTargetPos:s,dropAllowed:o,dragOverNodeKey:h}))},onNodeDragLeave:(e,t)=>{h.current!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(I(),h.current=null)},onNodeDragEnd:k,onNodeDrop:(e,t,n=!1)=>{const{dropPosition:r,dropTargetKey:i,dropTargetPos:l,dropAllowed:a,dragOverNodeKey:o}=S;if(!a)return;if(T({dragOverNodeKey:null}),R(),null===i)return;const s=Object.assign(Object.assign({},((e,{dragOverNodeKey:t,dropPosition:n,keyEntities:r})=>{const i=lp(r,e);return{eventKey:e,pos:i?i.pos:"",dragOver:t===e&&0===n,dragOverGapTop:t===e&&-1===n,dragOverGapBottom:t===e&&1===n}})(i,{dropPosition:r,dragOverNodeKey:o,keyEntities:g})),{data:lp(g,i).node});-1!==x.indexOf(i)&&tr("Table Draggable","无法拖放到 `dragNode` 的子节点");const c=ap(l),d={event:e,node:s,dragNode:p.current,dragNodesKeys:[p.current.eventKey].concat(x),dropToGap:0!==r,dropPosition:r+Number(c[c.length-1])};n||L(d),p.current=null},indent:w,dropOptions:S}};function dp(){const[,t]=e.useReducer((e=>e+1),0);return t}const up=t.forwardRef(((e,n)=>{const{rowKey:r,rowIndex:i,row:l,className:a,style:o,indent:s,filter:c,dropOption:d,onNodeDragStart:u,onNodeDragEnter:p,onNodeDragOver:m,onNodeDragLeave:h,onNodeDragEnd:f,onNodeDrop:g}=e,v=t.useRef({eventKey:r,data:l,props:e}),y=t.useRef(!1),[b,x]=t.useState(!1),{dropPosition:E,dropLevelOffset:w,dragOverNodeKey:C,dropTargetKey:S,dropContainerKey:N}=d,T=C===r&&0===E,I=C===r&&-1===E,R=C===r&&1===E,O=l._level||0,k={};switch(E){case-1:Object.assign(k,{top:0,left:-w*s+O*s});break;case 1:Object.assign(k,{bottom:0,left:-w*s+O*s});break;case 0:Object.assign(k,{bottom:0,left:s+O*s})}const L={"body--row-draggable":!0,"body--row-dragging":b,"drop-target":S===r,"drop-container":N===r,"drag-over":T,"drag-over-gap-top":I,"drag-over-gap-bottom":R};return t.createElement("tr",{ref:n,"data-row-key":r,"data-row-index":i,className:Pe(a,L),style:o,draggable:!0,onMouseDown:e=>{var t;c&&(t=e.target.matches(c),y.current=t)},onDragStart:e=>{if(e.stopPropagation(),y.current)return e.preventDefault();x(!0),u(e,v.current);try{e.dataTransfer.setData("text/plain","")}catch(e){}},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),p(e,v.current)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),m(e,v.current)},onDragLeave:e=>{e.stopPropagation(),h(e,v.current)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),x(!1),g(e,v.current)},onDragEnd:e=>{e.stopPropagation(),x(!1),f(e,v.current)}},e.children,C===r&&null!==E&&null!==w&&t.createElement("td",{className:"drop-indicator",style:k}))}));up.displayName="DraggableTr";const pp=e=>{const{selectionKeys:n,column:r,record:i,rowKey:l}=e,{tableRef:a}=t.useContext(Fo),{rowSelection:o}=a.current.props,s=t.useMemo((()=>r.type||""),[r.type]),c=e=>{var t,r;const i=null===(t=o.checkStrictly)||void 0===t||t;if(!a.current.isTreeTable||i)return!1;const l=oa(a.current.deriveRowKeys,e);return((e,t)=>{const n=new Set(t);let r=!1,i=!1;for(const t of e)if(n.has(t)?r=!0:i=!0,r&&i)break;return r&&i})(Pa(null!==(r=null==l?void 0:l.children)&&void 0!==r?r:[]),n)};return"radio"===s?(()=>{const e=o.disabled,r=null==e?void 0:e(i),a=!r&&n[0]===l;return t.createElement(j,{checked:a,disabled:r})})():(()=>{const e=o.disabled,r=null==e?void 0:e(i),a=!!n.includes(l);return t.createElement(F,{checked:a,indeterminate:c(l),disabled:r})})()},mp=e=>{const{record:n,rowKey:r,style:i}=e,{tableRef:l,rowExpandedKeys:a,setRowExpandedKeys:o}=t.useContext(Fo),{expandable:s={}}=l.current.props,[c]=t.useState("function"==typeof s.rowExpandable&&!s.rowExpandable(n)),d=t.useMemo((()=>a.includes(r)),[a,r]);Mi((()=>{var e;null===(e=s.onExpand)||void 0===e||e.call(s,d,n)}),[d]);const u={[`${lr("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:c};return t.createElement("span",{className:Pe(u),title:"",onClick:e=>{if(e.stopPropagation(),c)return;const t=d?a.filter((e=>e!==r)):[...a,r];o(t)},style:i})},hp=t.forwardRef(((e,n)=>{const{size:r,defaultValue:i,value:l,min:a,max:o,prefix:s,suffix:c,placeholder:d,maxLength:u,precision:p,stringMode:m,allowClear:h,readOnly:f,disabled:g,formatter:v=(e=>e.toString()),parser:y=(e=>e),onFocus:b}=e,x=e=>{let t=e.toString();return"."!==t.charAt(t.length-1)&&"-"!==t||(t=t.slice(0,-1)),t&&Number(t)>o&&(t=o.toString()),t&&Number(t)<a&&(t=a.toString()),p>=0&&""!==t&&(t=new Yt(t).toFixed(p)),t},E=void 0!==l,[w,C]=t.useState(null!=i?i:""),S=v(E?l:w),N=y(S);Mi((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[w]);return t.createElement(O,{ref:n,size:r,value:S,maxLength:u,prefix:s,suffix:c,placeholder:d,allowClear:h,readOnly:f,disabled:g,onChange:t=>{const n=y(t.target.value.replace(/\s+/g,""));let r=/^-?\d*(\.\d*)?$/.test(n)||""===n||"-"===n;if(0===p&&n.includes(".")&&(r=!1),a>=0&&n.startsWith("-")&&(r=!1),r){if(!m&&(Number(n)>Number.MAX_SAFE_INTEGER||Number(n)<Number.MIN_SAFE_INTEGER))return;(t=>{var n;E?null===(n=e.onChange)||void 0===n||n.call(e,t):C(t)})(n)}},onFocus:b,onBlur:()=>{var t;const n=x(N);null===(t=e.onBlur)||void 0===t||t.call(e,n,N)},onKeyUp:t=>{var n;13===t.keyCode&&(null===(n=e.onEnter)||void 0===n||n.call(e,x(N),N))}})}));hp.displayName="InputNumber";const fp=e=>{var n,r,i;const{multiple:l,tree:a={},defaultSelectedKeys:o,className:s,style:c,onClose:d}=e,{$size:u}=$n(e),{t:p}=Fn(),[m,h]=t.useState(),[f]=t.useState(null===(n=a.fetch)||void 0===n?void 0:n.params),g={[`${lr("tree-helper")}--wrapper`]:!0},v=a.fetch?Object.assign(Object.assign({},Xn(a.fetch,["params","valueKey","textKey"])),{params:f}):void 0;return t.createElement("div",{className:Pe(g,s),style:c},t.createElement(Gu,{multiple:l,fetch:v,fieldsDefine:{valueKey:null===(r=a.fetch)||void 0===r?void 0:r.valueKey,textKey:null===(i=a.fetch)||void 0===i?void 0:i.textKey},autoFocus:!0,asyncLoad:a.asyncLoad,checkStrictly:a.checkStrictly,checkStrategy:a.checkStrategy,defaultSelectedKeys:o,defaultExpandAll:a.defaultExpandAll,onSelectChange:e=>h(e),onCheckChange:e=>h(e)}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Ho[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>d(null),style:{marginRight:8}},p("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!m,onClick:()=>d(m)},p("qm.dialog.confirm"))))};fp.displayName="TreeHelper";const{Search:gp}=O,vp=t.forwardRef(((e,n)=>{var r,i,l,a,o,s;const{column:c,record:d,rowKey:u,columnKey:p}=e,{tableRef:m,tableBodyRef:h,$size:f,flattenColumns:g,updateTableFlatData:v,doFieldValidate:y,dataChange:b}=t.useContext(Fo),x=t.useContext(rp),{t:w}=Fn(),C=dp(),{store:S,fieldAuth:N}=m.current,T=(null===(r=c.editRender)||void 0===r?void 0:r.call(c,d,c))||{},I=t.useRef(null),R=t.useRef(null),k=t.useRef(null),L=t.useRef(null),A=t.useRef(null),P=t.useRef(!1),_=t.useRef({}),D=t.useRef({}),M=t.useRef([]),[$,q]=t.useState(!1),[j,K]=t.useState(!1),[V,z]=t.useState(T.items||[]),[B,U]=t.useState(),G=(T.editable||me(x,[u,p]))&&!T.disabled&&!(null===(i=N[p])||void 0===i?void 0:i.disabled),Y=`${u}|${p}`,X=2===x.length?`${x[0]}|${x[1]}`:"",Q=![...S.state.required,...S.state.validate].some((({x:e,y:t})=>e===u&&t===p)),Z=(null===(l=S.state.required.find((({x:e,y:t})=>e===u&&t===p)))||void 0===l?void 0:l.text)||"",J=(null===(a=S.state.validate.find((({x:e,y:t})=>e===u&&t===p)))||void 0===a?void 0:a.text)||"",ee=S.state.edited.some((({x:e,y:t})=>e===u&&t===p)),te=G||!Q||$||j,ne=!!(null===(o=T.helper)||void 0===o?void 0:o.combinedDataIndex)&&("search-helper"===T.type||"tree-helper"===T.type),re=null===(s=T.type)||void 0===s?void 0:s.endsWith("multiple");t.useLayoutEffect((()=>{te&&X===Y&&oe()}),[x]),t.useLayoutEffect((()=>{const{items:e}=T;re&&e&&le(e.map((e=>({[D.current.valueKey]:e.value,[D.current.textKey]:e.text}))))}),[]);const ie=()=>{v(),b()},le=e=>{M.current=e},oe=()=>{var e,t,n,r;const{type:i}=T;switch(i){case"text":null===(e=R.current)||void 0===e||e.focus();break;case"number":null===(t=k.current)||void 0===t||t.select();break;case"search-helper":null===(n=L.current)||void 0===n||n.focus();break;case"tree-helper":null===(r=A.current)||void 0===r||r.focus()}},se=()=>{var e,t,n,r;const{type:i}=T;switch(i){case"text":null===(e=R.current)||void 0===e||e.blur();break;case"number":null===(t=k.current)||void 0===t||t.blur();break;case"search-helper":null===(n=L.current)||void 0===n||n.blur();break;case"tree-helper":null===(r=A.current)||void 0===r||r.blur()}};t.useImperativeHandle(n,(()=>({focus:oe,blur:se,isEditable:()=>!T.disabled,isOpening:()=>$})));const ce=(e,t,n)=>{const{cornerSign:r=!0}=T.extra||{};S.addToUpdated(e),r&&S.addToEdited({x:t,y:n})},de=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",pe={text:(e,n,r)=>{var i;const{dataIndex:l}=n,{type:a,extra:o={},rules:s=[],onInput:c,onChange:d,onEnter:m,onBlur:h}=T,g=ga(e,l),v=Object.assign({},{minRows:1,maxRows:4},o.autoSize),b=r?{rows:v.minRows,autoSize:v}:null,x=o.password?O.Password:r?O.TextArea:O;return t.createElement(x,Rn({ref:R,size:f,value:g,maxLength:o.maxLength,showCount:o.showCount},b,{autoComplete:o.password?"new-password":"off",placeholder:null!==(i=o.placeholder)&&void 0!==i?i:w("qm.table.editable.inputPlaceholder"),allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,suffix:o.suffix,onChange:t=>{var r;const i=null!==(r=t.target.value)&&void 0!==r?r:"";va(e,l,i),y(s,i,u,p,Ta(n.title)),C(),null==c||c({[Y]:i}),P.current=!0},onBlur:t=>{var n;const r=null!==(n=t.target.value)&&void 0!==n?n:"";P.current&&(P.current=!1,ce(e,u,p),null==d||d({[Y]:r},e),null==h||h({[Y]:r},e),ie())},onKeyUp:t=>{var n;if(13===t.keyCode&&!t.shiftKey){const r=null!==(n=t.target.value)&&void 0!==n?n:"";null==m||m({[Y]:r},e)}},onKeyDown:e=>{r&&13===e.keyCode&&!e.shiftKey&&m&&e.preventDefault()}}))},textarea:(e,t)=>pe.text(e,t,!0),number:(e,n)=>{var r,i;const{dataIndex:l,precision:a,formatType:o}=n,{type:s,extra:c={},rules:d=[],onInput:m,onChange:h,onEnter:g,onBlur:v}=T,b=ga(e,l);let x,E;return"finance"===o&&(x=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},E=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===o&&(x=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new Yt(e).times(100).toNumber()}`,E=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new Yt(e).times(.01).toString()),t.createElement(hp,{ref:k,size:f,value:b,min:c.min,max:c.max,precision:a,stringMode:c.stringMode,prefix:c.prefix,suffix:null!==(r=c.suffix)&&void 0!==r?r:"percent"===o?"%":void 0,placeholder:null!==(i=c.placeholder)&&void 0!==i?i:w("qm.table.editable.inputPlaceholder"),maxLength:c.maxLength,allowClear:c.allowClear,readOnly:c.readOnly,disabled:c.disabled,formatter:x,parser:E,onChange:t=>{va(e,l,t),y(d,t,u,p,Ta(n.title)),C(),null==m||m({[Y]:t}),P.current=!0},onBlur:(t,n)=>{if(!P.current)return;P.current=!1;let r=c.stringMode?t:de(t);"percent"===o&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),va(e,l,r),ce(e,u,p),null==h||h({[Y]:r},e),null==v||v({[Y]:r},e),ie()},onEnter:(t,n)=>{let r=c.stringMode?t:de(t);"percent"===o&&"."===n.charAt(n.length-1)&&(r=Number(t)/100),null==g||g({[Y]:r},e)}})},select:(e,n,r)=>{var i,l;const{dataIndex:a,dictItems:o=[]}=n,{type:s,extra:c={},rules:d=[],items:m,onChange:h,onEnter:g}=T,v=m||o,b=ga(e,a);let x=b;return t.createElement(H,{mode:r?"multiple":void 0,size:f,popupClassName:es.popupClassName,value:b||void 0,placeholder:null!==(i=c.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:c.allowClear,listHeight:c.listHeight,maxTagCount:c.collapseTags?"responsive":void 0,maxTagTextLength:c.maxTagTextLength,disabled:c.disabled,style:{width:"100%"},showSearch:null===(l=c.filterable)||void 0===l||l,filterOption:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"";return`${r}|${bo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onDropdownVisibleChange:e=>q(e),onChange:t=>{va(e,a,t),y(d,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e),ie()},onSelect:e=>{x=e},onInputKeyDown:t=>{13===t.keyCode&&Bn((()=>null==g?void 0:g({[Y]:x},e)))}},v.map((e=>t.createElement(H.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>pe.select(e,t,!0),date:(e,n,r)=>{var i;const{dataIndex:l}=n,{type:a,extra:o={},rules:s=[],onChange:c}=T,d=r||"exactdate",m=ga(e,l);return t.createElement(In,{size:f,popupClassName:es.popupClassName,value:null!==(i=wa(m,Wa[d]))&&void 0!==i?i:void 0,picker:za[d],format:o.format,showTime:"datetime"===d,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:n}=o;return t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day")})(e),placeholder:o.placeholder,allowClear:o.allowClear,disabled:o.disabled,style:{width:"100%"},onChange:t=>{const r=Ca(t,Wa[d]);va(e,l,r),y(s,r,u,p,Ta(n.title)),ce(e,u,p),null==c||c({[Y]:r},e),ie()}})},datetime:(e,t)=>pe.date(e,t,"datetime"),month:(e,t)=>pe.date(e,t,"month"),year:(e,t)=>pe.date(e,t,"year"),time:(e,n)=>{var r;const{dataIndex:i}=n,{type:l,extra:a={},rules:o=[],onChange:s}=T,c="HH:mm:ss",d=ga(e,i);return t.createElement(On,{size:f,popupClassName:es.popupClassName,value:null!==(r=wa(d,c))&&void 0!==r?r:void 0,format:a.format||c,placeholder:a.placeholder,allowClear:a.allowClear,disabled:a.disabled,style:{width:"100%"},onChange:t=>{const r=Ca(t,c);va(e,i,r),y(o,r,u,p,Ta(n.title)),ce(e,u,p),null==s||s({[Y]:r},e),ie()}})},checkbox:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],onChange:o}=T,{trueValue:s=jo,falseValue:c=Ko,disabled:d}=l,m=ga(e,r);return t.createElement(F,{checked:m===s,disabled:d,onChange:t=>{const i=t.target.checked?s:c;va(e,r,i),y(a,i,u,p,Ta(n.title)),ce(e,u,p),null==o||o({[Y]:i},e),ie()}})},switch:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],onChange:o}=T,{trueValue:s=jo,falseValue:c=Ko,disabled:d}=l,m=ga(e,r);return t.createElement(W,{checked:m===s,disabled:d,onChange:t=>{const i=t?s:c;va(e,r,i),y(a,i,u,p,Ta(n.title)),ce(e,u,p),null==o||o({[Y]:i},e),ie()}})},"search-helper":(e,n)=>{var r,i;const{dataIndex:l,precision:a}=n,{type:o,extra:s={},rules:c=[],helper:d={},onInput:m,onChange:h,onEnter:v}=T,b=ya(e,ne?d.combinedDataIndex:l),x=d.fieldAliasMap;x||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof x?x():x||{};Object.keys(E).includes(l)||tr("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ne&&(d.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||tr("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[l].includes("|")&&tr("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=e=>{const{filterAliasMap:t}=d,n=""!==e?e:void 0,r=("function"==typeof t?t():t)||[],i={[l]:n};return(Array.isArray(r)?r:[r]).forEach((e=>{if(ae(e))for(const t in e)i[t]="function"==typeof e[t]?e[t](n):n;else i[e]=n})),i},S=e=>{const{autoQueryAssign:t=!0}=d;t&&(_.current=C(e)),q(!0)},N=(t,r)=>{const{beforeOpen:i}=d,l=(null!=i?i:zn)({[Y]:b},e,n);(null==l?void 0:l.then)?l.then((()=>{S(t),null==r||r()})).catch((()=>{})):!1!==l&&(S(t),null==r||r())},I=e=>{const t={};for(const n in E){const r=E[n];n!==l&&(t[n]=ya(e,r))}const n=E[l]?ya(e,E[l]):"";O(n,t);const{closed:r}=d;q(!1),null==r||r(e)},R=()=>{const{onlySelect:e=!0}=d;P.current&&O(e?"":b),q(!1)},O=(t="",r)=>{var i;if(ae(r)&&Object.keys(r).length)for(const t in r){const n=r[t],l=g.find((e=>e.dataIndex===t));if(l){va(e,t,n,l.precision);const r=null===(i=l.editRender)||void 0===i?void 0:i.call(l,e,l);r&&Array.isArray(r.rules)&&y(r.rules,n,u,t,Ta(l.title))}else va(e,t,n)}ne&&!t&&((e,t,n,r)=>{if(!t.includes("|"))return va(e,t,n,r);const i=n.split("|")||[];t.split("|").forEach(((t,n)=>{var r;t&&va(e,t,null===(r=i[n])||void 0===r?void 0:r.trim())}))})(e,d.combinedDataIndex,""),va(e,l,t,a),y(c,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e),ie(),_.current={},P.current=!1,U(void 0)},k={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:es.popupClassName,bodyStyle:{paddingBottom:`${Ho[f]+20}px`},onClose:()=>{R()}},A=Object.assign(Object.assign({},d),{size:f,initialValue:Object.assign({},_.current,d.initialValue),onClose:e=>{e?I(e):R()}});return t.createElement(t.Fragment,null,t.createElement(gp,{ref:L,value:null!=B?B:b,placeholder:null!==(i=s.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:r=!0,table:i}=d;if(P.current&&!$)return n&&r&&(null===(t=null==i?void 0:i.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:n={}}=d,{beforeFetch:r=zn}=t.fetch;return new Promise(((i,l)=>Hn(void 0,void 0,void 0,(function*(){var a;const o=Ie({},t.fetch.params,Object.assign(Object.assign({},n),C(e)),{currentPage:1,pageSize:500});if(!r(o))return l();K(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(a=ue(e.data,t.fetch.dataKey))&&void 0!==a?a:[];i(n)}else l()}catch(e){l(e)}finally{Bn((()=>K(!1)))}}))))})(n).then((e=>((e=[],t)=>{const n=e.filter((e=>ya(e,E[l]).toString().includes(t)));if(1===n.length)return I(n[0]);N(t)})(e,n))).catch((()=>O(""))):void O(n)},onChange:e=>{const{value:t}=e.target;null==m||m({[Y]:t}),P.current=!0,U(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const n=null!==(t=e.target.value)&&void 0!==t?t:"";!$&&N(n)}},onDoubleClick:e=>{const{value:t}=e.target;N(t)},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&"INPUT"!==t.target.tagName&&N(e)}}),t.createElement(Fl,k,t.createElement(Op,A)))},"search-helper-multiple":(e,n)=>{var r,i;const{dataIndex:l}=n,{type:a,items:o=[],extra:s={},rules:c=[],helper:d={},onInput:m,onChange:h,onEnter:g}=T,v=ga(e,l),b=d.fieldAliasMap;b||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes("valueKey")&&Object.keys(x).includes("textKey")||tr("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),D.current=x;const C=t=>{const{beforeOpen:r}=d,i=(null!=r?r:zn)({[Y]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{q(!1)},N=t=>{va(e,l,t),y(c,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e,M.current),ie()},I={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"60%",loading:!1,wrapClassName:es.popupClassName,bodyStyle:{paddingBottom:`${Ho[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},d),{size:f,multiple:!0,initialValue:Ie({},d.initialValue),defaultSelectedKeys:v,onClose:(e,t)=>{e?((e,t)=>{const{textKey:n,valueKey:r}=x;le(ke([...M.current.filter((e=>t.includes(e[r]))),...e],r));const i=M.current.map((e=>({text:e[n],value:e[r]}))),l=ke([...i,...o],"value").filter((e=>t.includes(e.value)));z(l),N(l.map((e=>e.value)));const{closed:a}=d;q(!1),null==a||a(M.current)})(e,t):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement(H,{mode:"multiple",open:!1,value:v,placeholder:null!==(i=s.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:s.allowClear,maxTagCount:s.collapseTags?"responsive":void 0,maxTagTextLength:s.maxTagTextLength,disabled:s.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!$&&C()},onDoubleClick:()=>{s.disabled||C()},onChange:e=>{const{valueKey:t}=x;le(M.current.filter((n=>e.includes(n[t])))),N(e)}},V.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:s.disabled,icon:t.createElement(Nt,null),onClick:()=>{C()}})))),t.createElement(Fl,I,t.createElement(Op,R)))},"tree-helper":(e,n)=>{var r,i,l;const{dataIndex:a,precision:o}=n,{type:s,extra:c={},rules:d=[],helper:m={},onChange:h,onEnter:v}=T,b=ya(e,ne?m.combinedDataIndex:a),x=m.fieldAliasMap;x||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof x?x():x||{};Object.keys(E).includes(a)||tr("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),ne&&(m.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||tr("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[a].includes("|")&&tr("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=t=>{const{beforeOpen:r}=m,i=(null!=r?r:zn)({[Y]:b},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{q(!1)},N=(t="",r)=>{var i;if(ae(r)&&Object.keys(r).length)for(const t in r){const n=r[t],l=g.find((e=>e.dataIndex===t));if(l){va(e,t,n,l.precision);const r=null===(i=l.editRender)||void 0===i?void 0:i.call(l,e,l);r&&Array.isArray(r.rules)&&y(r.rules,n,u,t,Ta(l.title))}else va(e,t,n)}va(e,a,t,o),y(d,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e),ie()},I={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=m.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:es.popupClassName,bodyStyle:{paddingBottom:`${Ho[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},m),{defaultSelectedKeys:[b],size:f,onClose:e=>{e?(e=>{const t={};for(const n in E){const r=E[n];n!==a&&(t[n]=ya(e,r))}const n=E[a]?ya(e,E[a]):"";N(n,t);const{closed:r}=m;q(!1),null==r||r(e)})(e):S()}});return t.createElement(t.Fragment,null,t.createElement(gp,{ref:A,value:b,allowClear:null===(i=c.allowClear)||void 0===i||i,readOnly:c.readOnly,disabled:c.disabled,placeholder:null!==(l=c.placeholder)&&void 0!==l?l:w("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!$&&C())},onDoubleClick:()=>{C()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?C():N(""))}}),t.createElement(Fl,I,t.createElement(fp,R)))},"tree-helper-multiple":(e,n)=>{var r,i;const{dataIndex:l}=n,{type:a,extra:o={},items:s=[],rules:c=[],helper:d={},onInput:m,onChange:h,onEnter:g}=T,v=ga(e,l),b=d.fieldAliasMap;b||tr("Table","helper 需要配置 `fieldAliasMap` 选项");const x="function"==typeof b?b():b||{};Object.keys(x).includes("valueKey")&&Object.keys(x).includes("textKey")||tr("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),D.current=x;const C=t=>{const{beforeOpen:r}=d,i=(null!=r?r:zn)({[Y]:v},e,n);(null==i?void 0:i.then)?i.then((()=>{q(!0),null==t||t()})).catch((()=>{})):!1!==i&&(q(!0),null==t||t())},S=()=>{q(!1)},N=t=>{va(e,l,t),y(c,t,u,p,Ta(n.title)),ce(e,u,p),null==h||h({[Y]:t},e,M.current),ie()},I={visible:$,title:w("qm.searchHelper.text"),width:null!==(r=d.width)&&void 0!==r?r:"40%",loading:!1,wrapClassName:es.popupClassName,bodyStyle:{paddingBottom:`${Ho[f]+20}px`},onClose:()=>{S()}},R=Object.assign(Object.assign({},d),{size:f,multiple:!0,initialValue:Ie({},d.initialValue),defaultSelectedKeys:v,onClose:e=>{e?(e=>{const{textKey:t,valueKey:n}=x;le(e);const r=M.current.map((e=>({text:e[t],value:e[n]})));z(r),N(r.map((e=>e.value)));const{closed:i}=d;q(!1),null==i||i(M.current)})(e):S()}});return t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{className:"ant-input-wrapper ant-input-group"},t.createElement(H,{mode:"multiple",open:!1,value:v,placeholder:null!==(i=o.placeholder)&&void 0!==i?i:w("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,maxTagCount:o.collapseTags?"responsive":void 0,maxTagTextLength:o.maxTagTextLength,disabled:o.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!$&&C()},onDoubleClick:()=>{o.disabled||C()},onChange:e=>{const{valueKey:t}=x;le(M.current.filter((n=>e.includes(n[t])))),N(e)}},V.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text)))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:o.disabled,icon:t.createElement(Nt,null),onClick:()=>{C()}})))),t.createElement(Fl,I,t.createElement(fp,R)))},custom:(e,n)=>{const{dataIndex:r}=n,{type:i,extra:l={},rules:a=[],render:o,onChange:s}=T;if(!o)return tr("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const c=ga(e,r),d=t=>{va(e,r,t),y(a,t,u,p,Ta(n.title)),ce(e,u,p),null==s||s({[Y]:t},e),ie()},m=o(e,n,d);return t.isValidElement(m)?t.cloneElement(m,{value:c,disabled:l.disabled,readOnly:l.readOnly,popupClassName:es.popupClassName,onChange:d}):null}};return t.createElement(t.Fragment,null,te?(()=>{const{type:e}=T,n=pe[e];if(!n)return tr("Table","单元格编辑的类型 `type` 配置不正确"),null;const r=["cell--edit",{"is-error":!Q}];return t.createElement("div",{ref:I,className:Pe(r)},n(d,c),!Q&&t.createElement("div",{className:"cell-error"},Z||J))})():(()=>{const{disabled:n,extra:r={}}=T,{disabledColor:i,disabledBgColor:l}=r,a=["cell--show",{"is-cell-bg":n&&l}];return t.createElement(t.Fragment,null,t.createElement("span",{className:Pe(a),style:{color:n?i:""}},e.children),n&&l&&t.createElement("i",{className:"cell--bg",style:{background:l}}))})(),ee&&t.createElement("i",{className:"cell--sign"}))}));vp.displayName="CellEdit";const yp=e=>{const{text:n,options:r,showMessage:i=!0,onCopy:l}=e,{t:a}=Fn();return dl(e.children,{onClick:o=>{const s=t.Children.only(e.children),c=nn(n,r);null==l||l(n,c),c&&i&&R.success(a("qm.clipboard.success")),s&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(o)}})};yp.displayName="QmCopyToClipboard";const bp=t.forwardRef(((n,r)=>{const{column:i,row:l,rowIndex:a,columnIndex:o,rowKey:s,showTitle:c}=n,{tableRef:d,selectionKeys:u,treeExpandIndex:p,updateMark:m}=t.useContext(Fo),{dataIndex:h,canCopy:f,render:g,editRender:v,shouldCellUpdate:y}=i,{t:b}=Fn(),{renderText:x,getTitleFromCellNode:E}=us(),w=t.useRef(null),C=ga(l,h),[S,N]=function(t,n,r){const i=e.useRef({});return"value"in i.current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value}((()=>{const e=g?g(C,l,i,a,o):x(C,i,l);return[e,v?t.createElement(vp,{ref:r,column:i,record:l,rowKey:s,columnKey:h},e):null]}),[m,l,C,g,v],((e,t)=>{if(y){const[,n]=e,[,r]=t;return y(r,n,l)}return!Ha(e,t,!0)}));t.useEffect((()=>{if([es.expandableColumn,es.selectionColumn,es.operationColumn].includes(h))return;const e=w.current.parentNode;c?e.title=E(S):e.removeAttribute("title")}),[c,S]);const T=e=>Array.isArray(e.children);return t.createElement("div",{ref:w,className:"cell"},(()=>{if(h===es.expandableColumn)return t.createElement(mp,{record:l,rowKey:s});if(h===es.selectionColumn)return t.createElement(pp,{selectionKeys:u,column:i,record:l,rowKey:s});if(N)return N;if(d.current.isTreeTable&&h===p)return t.createElement(t.Fragment,null,(e=l._level)?t.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*es.treeTable.textIndent+"px"}}):null,t.createElement(mp,{key:"expand",record:l,rowKey:s,style:T(l)?{}:{visibility:"hidden"}}),S);var e;if(f){const e=E(S);return t.createElement("div",{className:"cell--copy"},t.createElement("span",{className:"text"},S),e&&t.createElement(yp,{text:e},t.createElement(Ze,{className:"icon",title:b("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return S})())}));bp.displayName="Cell";const xp={open:!1,offsetX:0,offsetY:0},Ep=t.forwardRef(((e,n)=>{const{rowVirtualize:r}=e,{tableRef:i,getRowKey:l,prefixCls:a,tableFlatData:o,flattenColumns:s,mergedTdCells:c,setMergedCells:d}=t.useContext(Fo),{areaSelection:u={}}=i.current.props,{elementStore:p,scrollYLoad:m}=i.current,{t:h}=Fn(),f=t.useRef(document.onselectstart),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=e=>{y.current=e},[x,E]=t.useState(null),[w,C]=t.useState(null),[S,N]=t.useState(null),T=e=>{if(!e)return N(null);let t=!1;for(const n in e)if((null==S?void 0:S[n])!==e[n]){t=!0;break}t&&N(Object.assign({},S,e))};bu({ref:g,handler:()=>K()}),t.useEffect((()=>{const e=Kt(p.$tableBody,"mousedown",H),t=Kt(p.$tableBody,"contextmenu",_),n=Kt(document,"keydown",D);return()=>{e.remove(),t.remove(),n.remove()}}),[]);const I=()=>{E(null),T(null),b(null),C(null)};t.useImperativeHandle(n,(()=>({blur:I})));const R=e=>{let t=e;for(;t;){if(!p.$tableBody.contains(t))return null;if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},O=e=>({rowIndex:parseInt(e.parentNode.getAttribute("data-row-index"),10),colIndex:parseInt(e.getAttribute("data-col-index"),10),rowspan:Number(e.getAttribute("rowspan")||1),colspan:Number(e.getAttribute("colspan")||1),l:e.offsetLeft,t:e.offsetTop,w:e.offsetWidth,h:e.offsetHeight}),k=e=>({colStart:e.colIndex,colEnd:e.colIndex+e.colspan,rowStart:e.rowIndex,rowEnd:e.rowIndex+e.rowspan}),L=e=>{let[t,n,r,i]=[1/0,-1/0,1/0,-1/0];for(const l of e)t=Math.min(t,l.rowStart),n=Math.max(n,l.rowEnd),r=Math.min(r,l.colStart),i=Math.max(i,l.colEnd);return{rowStart:t,rowEnd:n,colStart:r,colEnd:i}},A=cl((e=>{let t=L([k(e),y.current]);c.forEach((e=>{const n=o.findIndex((t=>l(t,t.index)===e.rowKey)),r=s.findIndex((t=>t.dataIndex===e.dataIndex)),i={rowStart:n,rowEnd:n+e.rowSpan,colStart:r,colEnd:r+e.colSpan};var a,c;c=i,(a=t).rowEnd<=c.rowStart||a.rowStart>=c.rowEnd||a.colEnd<=c.colStart||a.colStart>=c.colEnd||(t=L([t,i]))})),T(t)}),5),P=e=>{var t;d(e),null===(t=u.onCellMerge)||void 0===t||t.call(u,e),Bn((()=>I()))},_=Mn((e=>{u.cellMerge&&x&&q(e.clientX,e.clientY)?(e.preventDefault(),j(e)):(null==w?void 0:w.open)&&K()})),D=Mn((e=>{27===e.keyCode&&I()})),H=Mn((e=>{e.stopPropagation();const t=R(e.target);if(1!==e.buttons||!t)return;K();const n=O(t);E(n);const r=k(n);b(r),T(r),document.addEventListener("mousemove",F),document.addEventListener("mouseup",M),f.current=document.onselectstart,document.onselectstart=()=>!1})),F=Mn((e=>{const t=R(e.target);t&&A(O(t))})),M=Mn((()=>{var e;null===(e=u.onSelectChange)||void 0===e||e.call(u,(()=>{const e=[];if(!x||!S)return e;for(let t=S.rowStart;t<S.rowEnd;t++)for(let n=S.colStart;n<S.colEnd;n++)e.push({rowKey:l(o[t],o[t].index),dataIndex:s[n].dataIndex,cellValue:ga(o[t],s[n].dataIndex)});return e})()),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",M),$()})),$=()=>{document.onselectstart!==f.current&&(document.onselectstart=f.current)},q=(e,t)=>{const{top:n,left:r}=p.$tableBody.parentNode.getBoundingClientRect(),[i,l]=[e-r,t-n],{el:a,et:o,ew:s,eh:c}=U();return!(i<a||i>a+s||l<o||l>o+c)},j=e=>{const{top:t,left:n,height:r}=v.current.getBoundingClientRect();C({open:!0,offsetX:e.clientX-n,offsetY:-1*(r-(e.clientY-t))})},K=()=>{C((e=>Object.assign(Object.assign({},e),{open:!1})))},V=e=>({rowIndex:o.findIndex((t=>l(t,t.index)===e.rowKey)),colIndex:s.findIndex((t=>t.dataIndex===e.dataIndex)),rowSpan:e.rowSpan,colSpan:e.colSpan}),z=()=>{if(!x||!S||(t=S,(e=x).rowIndex===t.rowStart&&e.colIndex===t.colStart&&e.rowspan===t.rowEnd-t.rowStart&&e.colspan===t.colEnd-t.colStart))return I();var e,t;const n={rowKey:l(o[S.rowStart],o[S.rowStart].index),dataIndex:s[S.colStart].dataIndex,rowSpan:S.rowEnd-S.rowStart,colSpan:S.colEnd-S.colStart};P([...c.filter((e=>!((e,t)=>{const n=V(e),r=V(t),[i,l,a,o]=[n.rowIndex,n.colIndex,n.rowIndex+n.rowSpan-1,n.colIndex+n.colSpan-1],[s,c,d,u]=[r.rowIndex,r.colIndex,r.rowIndex+r.rowSpan-1,r.colIndex+r.colSpan-1];return i<=s&&l<=c&&a>=d&&o>=u||s<=i&&c<=l&&d>=a&&u>=o})(e,n))),n])},W=()=>{const e=l(o[S.rowStart],o[S.rowStart].index),t=s[S.colStart].dataIndex;P(c.filter((n=>!(n.rowKey===e&&n.dataIndex===t))))},B=e=>{if(m){return r.measurementsCache.slice(0,e).map((e=>e.size)).reduce(((e,t)=>e+t),0)}if(e>=o.length)return p.$tableBody.parentNode.offsetHeight;const t=l(o[e],o[e].index),n=p.$tableBody.querySelector(`tbody > tr[data-row-key="${t}"]`);return n?n.offsetTop:i.current.rowHeight*e},U=()=>{const{w:e,h:t,l:n,t:r}=x,i=s.slice(0,S.colStart).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),l=B(S.rowStart);return{sl:n,st:r,sw:e,sh:t,el:i,et:l,ew:s.slice(0,S.colEnd).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)-i,eh:B(S.rowEnd)-l}};return t.createElement("div",{className:`${a}--area-select`},(()=>{if(!x||!S)return null;const{sl:e,st:n,sw:r,sh:i,el:l,et:a,ew:o,eh:s}=U(),{open:c,offsetX:d,offsetY:u}=w||xp,p=t.createElement("ul",{ref:g,className:"ant-dropdown-menu"},t.createElement("li",{className:"ant-dropdown-menu-item",onClick:z},h("qm.table.areaSelect.mergeCell")),t.createElement("li",{className:"ant-dropdown-menu-item",onClick:W},h("qm.table.areaSelect.cancelMerge")));return t.createElement(t.Fragment,null,t.createElement("div",{className:"active-area",style:{left:e,top:n,width:r,height:i}}),t.createElement(nd,{popupVisible:c,popup:p,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:es.popupClassName,builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,u+4],overflow:{adjustX:1,adjustY:1}}}},t.createElement("div",{ref:v,className:"checked-area",style:{left:l,top:a,width:o,height:s}})))})())}));Ep.displayName="AreaSelect";const wp=t.forwardRef(((e,n)=>{const{tableRef:r,getRowKey:i,prefixCls:l,tableFlatData:a,flattenColumns:o,editableColumns:s,leftFixedColumns:c,rightFixedColumns:d,derivedMergeCells:u,sorter:p,layout:m,showFooter:h,selectionKeys:f,rowExpandedKeys:g,highlightKey:v,activedCell:y,isPingLeft:b,isPingRight:x,isTableEmpty:E,isGroupSubtotal:w,setElementStore:C,setSelectionKeysEffect:S,setHighlightKey:N,setActivedCell:T,getStickyLeft:I,getStickyRight:R,setPingLeft:O,setPingRight:k,setFullScreen:L,scrollBottomDebouncer:A}=t.useContext(Fo),{height:P,minHeight:_,maxHeight:D,rowHeight:H,rowSelection:F,rowHighlight:M,expandable:$,stripe:q,summation:j,rowStyle:K,cellStyle:V,spanMethod:z,tableConfig:W,areaSelection:B,ellipsis:U,showHeader:G,rowDraggable:Y,onRowClick:X,onRowDblclick:Q,onRowContextmenu:Z,onRowEnter:J}=r.current.props,ee=t.useRef(null),te=t.useRef({}),ne=t.useRef(null),re=t.useRef({prevST:0,prevSL:0}),{onNodeDragStart:ie,onNodeDragEnter:le,onNodeDragOver:oe,onNodeDragLeave:se,onNodeDragEnd:ce,onNodeDrop:de,indent:ue,dropOptions:pe}=cp({openDragSort:Y}),{rowVirtualizer:he,columnVirtualizer:fe,virtualRows:ge,virtualColumns:ve,resetItemXSize:ye,getYIndexes:be,virtualTranslateY:xe,virtualTranslateX:Ee,calcVirtualYSize:we,calcVirtualXSize:Ce,scrollToYIndex:Se}=((e,n)=>{var r;const{tableRef:i}=t.useContext(Fo),{props:l,scrollBarRef:a,rowHeight:o}=i.current,s=(null===(r=l.tableConfig)||void 0===r?void 0:r.overscan)||1,c=t.useMemo((()=>{var e,t;return null!==(t=null===(e=a.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null}),[a.current]),d=t.useMemo((()=>{const e=[],t=[];return n.forEach(((n,r)=>{"left"===n.fixed&&e.push(r),"right"===n.fixed&&t.push(r)})),[e,t]}),[n]),u=fu({count:e.length,getScrollElement:()=>c,estimateSize:()=>o,indexAttribute:"data-row-index",overscan:s,enabled:i.current.scrollYLoad}),p=u.getVirtualItems(),m=fu({horizontal:!0,count:n.length,getScrollElement:()=>c,estimateSize:e=>n[e].width||n[e].renderWidth||0,indexAttribute:"data-col-index",overscan:s,enabled:i.current.scrollXLoad,rangeExtractor:e=>[...new Set([...d[0],...lu(e),...d[1]])]}),h=m.getVirtualItems();return{rowVirtualizer:u,columnVirtualizer:m,virtualRows:p,virtualColumns:h,resetItemXSize:e=>{e.forEach(((e,t)=>{m.resizeItem(t,e.width||e.renderWidth||es.defaultColumnWidth)}))},getYIndexes:()=>u.getVirtualIndexes()||[],getXIndexes:()=>m.getVirtualIndexes()||[],virtualTranslateY:()=>{var e,t;return null!==(t=null===(e=p[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},virtualTranslateX:()=>{var e,t,n,r,i,l,a;const o=d[0].length;return o?(null===(n=h[o])||void 0===n?void 0:n.index)===o?null!==(i=null===(r=h[0])||void 0===r?void 0:r.start)&&void 0!==i?i:0:(null!==(a=null===(l=h[o])||void 0===l?void 0:l.start)&&void 0!==a?a:0)-h.slice(0,o).reduce(((e,t)=>e+t.size),0):null!==(t=null===(e=h[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},calcVirtualYSize:()=>u.getTotalSize()||void 0,calcVirtualXSize:()=>m.getTotalSize()||void 0,scrollToYIndex:e=>{u.scrollToIndex(e)},scrollToXIndex:e=>{m.scrollToIndex(e)}}})(a,o),Ne=be(),Te=e=>{if(e&&!U)return he.measureElement(e)},Ie=t.useMemo((()=>u.length&&r.current.scrollYLoad?((e,t)=>{const n=[],r=new Set(t);return e.forEach((({row:e,col:t,rowSpan:i,colSpan:l})=>{const a=e+i-1,o=[];for(let t=e;t<=a;t++)r.has(t)&&o.push(t);if(0===o.length)return;const s=o.length;o.forEach(((e,r)=>{0===r&&n.push({row:e,col:t,rowSpan:s,colSpan:l});for(let i=t;i<t+l;i++)0===r&&i===t||n.push({row:e,col:i,rowSpan:0,colSpan:0})}))})),n})(u,Ne):u),[u,Ne.join(",")]),[Re,Oe]=t.useState([]),ke=dp();bu({ref:ee,omitClassNames:[`.${es.popupClassName}`],handler:()=>{var e;ze([]),null===(e=ne.current)||void 0===e||e.blur()}}),t.useImperativeHandle(n,(()=>({setClickedValues:ze,createFocus:Me,forceUpdate:ke,resetItemXSize:ye,scrollToYIndex:Se}))),Mi((()=>{Re.length&&r.current.tableManager.focus(r.current.uid)}),[Re]),t.useLayoutEffect((()=>{Fe();const e=Kt(document,"keydown",_e);return()=>e.remove()}),[]);const Le=t.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:n,tableFullHeight:r,tableAutoHeight:i}=m,l={};return E&&Object.assign(l,{minHeight:"100px"}),_&&Object.assign(l,{minHeight:ha(_)-e-n+"px"}),D&&Object.assign(l,{maxHeight:ha(D)-e-n+"px"}),P||r||i?Object.assign(Object.assign({},l),{maxHeight:"",minHeight:"",height:`${t}px`}):l}),[P,D,_,E,m]),Ae=Mn((e=>{const{elementStore:t}=r.current,{prevST:n,prevSL:i}=re.current,{scrollTop:l,scrollLeft:a}=e;if(a!==i){G&&(t.$header.scrollLeft=a),h&&(t.$footer.scrollLeft=a);const e=a>0,n=Math.ceil(a)+m.tableWidth<m.tableBodyWidth;b!==e&&O(e),x!==n&&k(n)}l!==n&&Math.ceil(l)+m.viewportHeight>=ee.current.parentNode.offsetHeight&&A({type:"scroll",target:e,preventDefault:Vn,stopPropagation:Vn}),re.current={prevST:l,prevSL:a}})),_e=Mn((e=>{var t,n,l,o,c,d,u;const{keyCode:p}=e;if(r.current.uid===(null===(t=r.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id)&&(27===p&&(ze([]),N(""),T({}),L(!1)),Re.length&&(Gi(document.activeElement,ee.current)||"INPUT"!==(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)))){if(13===p&&("radio"===(null==F?void 0:F.type)||M)){const t=null!==(o=null!==(l=f[0])&&void 0!==l?l:v)&&void 0!==o?o:null,n=null!==(c=a.find((e=>i(e,e.index)===t)))&&void 0!==c?c:null;n&&(null==J||J(n,e))}if(!je(Re[0],Re[1])){if(38===p||40===p){ji(e);const t=a.length;let n=a.findIndex((e=>i(e,e.index)===Re[0]));const r=38===p?(--n+t)%t:++n%t,l=a[r],o=i(l,l.index),s=qe(o,Re[1]);"radio"!==(null==F?void 0:F.type)||(null===(d=F.disabled)||void 0===d?void 0:d.call(F,l))||s||S([o]),!M||(null===(u=M.disabled)||void 0===u?void 0:u.call(M,l))||s||N(o),De(38===p?"top":"bottom",r),$e(...Re),ze([o,Re[1]])}if(9===p||e.shiftKey&&9===p){if(ji(e),!s.length)return ze([]);const t=s.length;let n=s.findIndex((e=>e.dataIndex===Re[1]));const r=e.shiftKey&&9===p?(--n+t)%t:++n%t;$e(...Re),He(e.shiftKey&&9===p?"left":"right",r),ze([Re[0],s[r].dataIndex])}}}})),De=(e,t)=>{const{scrollBarRef:n,scrollYLoad:i}=r.current;if(i)return he.scrollToIndex(t);const l=a.length,o=t,s=ee.current.querySelectorAll("tbody > tr"),c=a.map(((e,t)=>t)).slice(0,o).reduce(((e,t)=>e+s[t].offsetHeight),0),d=s[o].offsetHeight;"top"===e?c<n.current.scrollTop?n.current.SET_SCROLL_TOP(c):t===l-1&&n.current.SET_SCROLL_TOP(c-(m.viewportHeight-d)):c+d>n.current.scrollTop+m.viewportHeight?n.current.SET_SCROLL_TOP(c-(m.viewportHeight-d)):0===t&&n.current.SET_SCROLL_TOP(c)},He=(e,t)=>{const{scrollBarRef:n}=r.current,i=s.length,l=o.findIndex((e=>e.dataIndex===s[t].dataIndex)),a=o.slice(0,l).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),u=o[l].width||o[l].renderWidth,p=c.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),h=d.reduce(((e,t)=>e+(t.width||t.renderWidth)),0);"left"===e?a<n.current.scrollLeft+p?n.current.SET_SCROLL_LEFT(a-p):t===i-1&&n.current.SET_SCROLL_LEFT(a-(m.tableWidth-u)+h):a+u>n.current.scrollLeft+(m.tableWidth-h)?n.current.SET_SCROLL_LEFT(a-(m.tableWidth-u)+h):0===t&&n.current.SET_SCROLL_LEFT(a-p)},Fe=()=>{C("$tableBody",ee.current)},Me=(e,t)=>{var n;null===(n=te.current[`${e}-${t}`])||void 0===n||n.focus()},$e=(e,t)=>{var n;null===(n=te.current[`${e}-${t}`])||void 0===n||n.blur()},qe=(e,t)=>{var n,r;return null!==(r=null===(n=te.current[`${e}-${t}`])||void 0===n?void 0:n.isEditable())&&void 0!==r&&r},je=(e,t)=>{var n,r;return null!==(r=null===(n=te.current[`${e}-${t}`])||void 0===n?void 0:n.isOpening())&&void 0!==r&&r},Ke=e=>{const t=j.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ve=(e,t,n)=>{var l;const{dataIndex:a}=n;if([es.expandableColumn,es.operationColumn].includes(a))return;const o=i(t,t.index);ze([o,a]);const s=qe(o,a),{type:c,selectByClickRow:d=!0,disabled:u=Vn}=F||{};!c||u(t)||s||(d||a===es.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:i=!0,onSelect:l}=F||{};if("radio"===n&&S([e]),"checkbox"===n){const n=!f.includes(e),a=r.current.isTreeTable&&!i?Be(e,f,n):We(e,f,n);S(a),null==l||l(n,t,a)}})(o,t),[es.selectionColumn].includes(a)||(!M||(null===(l=M.disabled)||void 0===l?void 0:l.call(M,t))||s||N(o),null==X||X(t,n,e))},ze=e=>{me(e,Re)||Oe(e)},We=(e,t,n)=>n?[...t,e]:t.filter((t=>t!==e)),Be=(e,t,n)=>{var i;const{disabled:l}=F||{},{deriveRowKeys:a,recordsMap:o}=r.current,s=oa(a,e);let c=[],d=Pa((null==s?void 0:s.children)||[]);l&&(d=d.filter((e=>!o.has(e)||!l(o.get(e))))),c=n?[...new Set([...t,e,...d])]:t.filter((t=>![e,...d].includes(t)));return((null===(i=La(a,e))||void 0===i?void 0:i.slice(0,-1).reverse())||[]).forEach((e=>{var t;const n=oa(a,e),r=null===(t=null==n?void 0:n.children)||void 0===t?void 0:t.every((e=>c.includes(e.rowKey)));c=r?[...c,e]:c.filter((t=>t!==e))})),c},Ue=(e,n,i)=>{const{scrollXLoad:l}=r.current,{disabled:a}=F||{},s=["body--row",Object.assign({"body--row-striped":q&&n%2!=0,"body--row-selected":f.includes(i)&&!(null==a?void 0:a(e)),"body--row-current":v===i},w?Ke(e._group):null)],c=(l?ve:o).map(((t,r)=>Ge(l?o[t.index]:t,l?t.index:r,e,n,i)));return Y?t.createElement(up,{key:i,ref:Te,className:Pe(s),rowKey:i,rowIndex:n,row:e,indent:ue,filter:".cell--edit input",dropOption:pe,onNodeDragStart:ie,onNodeDragEnter:le,onNodeDragOver:oe,onNodeDragLeave:se,onNodeDragEnd:ce,onNodeDrop:de},c):t.createElement("tr",{key:i,ref:Te,"data-row-key":i,"data-row-index":n,className:Pe(s)},c)},Ge=(e,n,r,i,l)=>{var a,o,s;const{dataIndex:u,fixed:m,align:h,className:f=""}=e,{rowSpan:g,colSpan:v}=Ye(r,e,i,n);if(!g||!v)return null;const b=null!==(a=e.ellipsis)&&void 0!==a?a:U,x=["body--column",{"col--ellipsis":b,"col--center":"center"===h,"col--right":"right"===h,"col-active":y.rowKey===l&&y.dataIndex===u,"column--sort":!!p[u],"cell-fix-left":"left"===m,"cell-fix-right":"right"===m,"cell-fix-left-last":"left"===m&&(null===(o=c[c.length-v])||void 0===o?void 0:o.dataIndex)===u,"cell-fix-right-first":"right"===m&&(null===(s=d[0])||void 0===s?void 0:s.dataIndex)===u,[f]:!!f}],E={left:"left"===m?`${I(u)}px`:"",right:"right"===m?`${R(u)}px`:""},C=K?"function"==typeof K?K(r,i):K:null,S=V?"function"==typeof V?V(r,e,i,n):V:null,N=w?(e=>{var t;const{backgroundColor:n,color:r}=null!==(t=j.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:n,color:r}})(r._group):null,T=Object.assign({},E,{height:H},N,C,S);return t.createElement("td",{key:u,"data-col-index":n,rowSpan:g>1?g:void 0,colSpan:v>1?v:void 0,className:Pe(x),style:T,onClick:t=>Ve(t,r,e),onDoubleClick:t=>((e,t,n)=>{const{dataIndex:r}=n;[es.expandableColumn,es.selectionColumn,es.operationColumn].includes(r)||null==Q||Q(t,n,e)})(t,r,e),onContextMenu:t=>((e,t,n)=>{const{dataIndex:r}=n;[es.expandableColumn,es.selectionColumn,es.operationColumn].includes(r)||null==Z||Z(t,n,e)})(t,r,e)},t.createElement(bp,{ref:e=>te.current[`${l}-${u}`]=e,row:r,column:e,rowIndex:i,columnIndex:n,rowKey:l,showTitle:b}))},Ye=(e,t,n,r)=>{var i;let l=1,o=1;const s=z;if("function"==typeof s){const c=s({row:e,column:t,rowIndex:n,columnIndex:r,tableData:a});Array.isArray(c)?(l=c[0],o=c[1]):ae(c)&&(l=c.rowSpan,o=c.colSpan);const d=null!==(i=Ne[0])&&void 0!==i?i:0;if(e===a[d]&&0===l)for(let e=d;e<a.length;e++){const n=s({row:a[e],column:t,rowIndex:e,columnIndex:r,tableData:a});if((Array.isArray(n)?n[0]:n.rowSpan)>0)break;l++}}if(Ie.length>0){const e=Ie.find((e=>e.row===n&&e.col===r));e&&(l=e.rowSpan,o=e.colSpan)}return{rowSpan:l,colSpan:o}};return t.createElement(t.Fragment,null,t.createElement(El,{ref:r.current.scrollBarRef,wrapClassName:`${l}--body-wrapper`,wrapStyle:Le,innerStyle:{height:we(),width:Ce()},showTopScrollbar:null==W?void 0:W.doubleXScrollbar,onScroll:Ae},t.createElement(rp.Provider,{value:Re},t.createElement("table",{ref:ee,style:{width:0,marginTop:xe(),marginLeft:Ee()},className:Pe(`${l}--body`,{"virtual-container":r.current.scrollYLoad||r.current.scrollXLoad}),tabIndex:-1,cellSpacing:"0",cellPadding:"0"},(()=>{const{scrollXLoad:e}=r.current;return t.createElement("colgroup",null,(e?ve:o).map((n=>{const{dataIndex:r,width:i,renderWidth:l}=e?o[n.index]:n;return t.createElement("col",{key:r,style:{width:`${i||l}px`,minWidth:`${i||l}px`}})})))})(),t.createElement("tbody",null,(e=>{const{scrollYLoad:n,scrollXLoad:l}=r.current,s=[];return(n?e:a).forEach(((e,r)=>{const c=n?a[e.index]:e,d=n?e.index:r,u=i(c,c.index);if(s.push(Ue(c,d,u)),null==$?void 0:$.expandedRowRender){const{expandedRowClassName:e,rowExpandable:n=zn}=$;g.includes(u)&&n(c)&&s.push(t.createElement("tr",{key:`expand_${u}`,className:"body--row-expanded"},t.createElement("td",{colSpan:(l?ve:o).length,className:"body--column",style:{paddingLeft:F?2*es.selectionColumnWidth:es.selectionColumnWidth}},t.createElement("div",{className:Pe("cell",e)},$.expandedRowRender(c,d)))))}})),s})(ge)))),!!B&&t.createElement(Ep,{ref:ne,rowVirtualize:he})))}));wp.displayName="TableBody";const Cp=()=>{const{tableRef:e,prefixCls:n,sorter:r,layout:i,flattenColumns:l,leftFixedColumns:a,rightFixedColumns:o,summationRows:s,setElementStore:c,getStickyLeft:d,getStickyRight:u}=t.useContext(Fo),{footRender:p}=e.current.props,{t:m}=Fn(),h=t.useRef(null);t.useLayoutEffect((()=>{f()}),[]);const f=()=>{c("$footer",h.current)},g=(n,i,l)=>{var s,c;const{dataIndex:p,fixed:h,align:f,summation:g}=n,v=["footer--column","col--ellipsis",{"col--center":"center"===f,"col--right":"right"===f,"column--sort":!!r[p],"cell-fix-left":"left"===h,"cell-fix-right":"right"===h,"cell-fix-left-last":"left"===h&&(null===(s=a[a.length-1])||void 0===s?void 0:s.dataIndex)===p,"cell-fix-right-first":"right"===h&&(null===(c=o[0])||void 0===c?void 0:c.dataIndex)===p}],y={left:"left"===h?`${d(p)}px`:"",right:"right"===h?`${u(p)}px`:""},b=(null==g?void 0:g.render)?g.render(e.current.tableFullData):ga(i,`${p}_text`),x=0===l&&""===b?m("qm.table.config.summaryText"):b;return t.createElement("td",{key:p,title:x,className:Pe(v),style:Object.assign({},y)},t.createElement("div",{className:"cell"},x))},{tableBodyWidth:v}=i;return t.createElement("div",{ref:h,className:`${n}--footer-wrapper`},p?p(l,e.current.tableFullData):t.createElement("table",{className:`${n}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:v?`${v}px`:""}},t.createElement("colgroup",null,l.map((e=>{const{dataIndex:n,width:r,renderWidth:i}=e;return t.createElement("col",{key:n,style:{width:`${r||i}px`,minWidth:`${r||i}px`}})}))),t.createElement("tfoot",null,s.map(((e,n)=>t.createElement("tr",{key:n,className:"footer--row"},l.map(((t,n)=>g(t,e,n)))))))))};var Sp;!function(e){e.small="small",e.middle="default",e.large="default"}(Sp||(Sp={}));const Np=e=>{var n,r,i,l;const{current:a,pageSize:o,total:s,onChange:c}=e,{global:d}=t.useContext(on),{tableRef:u,prefixCls:p,$size:m,setElementStore:h}=t.useContext(Fo),{uniqueKey:f,paginationConfig:g,infoBarConfig:v}=u.current.props,y=t.useRef(null),b=t.useMemo((()=>f?`tablePager_${f}`:""),[f]);t.useLayoutEffect((()=>{x(),S()}),[]);const x=()=>{h("$pager",y.current)},E=null!==(n=null==g?void 0:g.showSizeChanger)&&void 0!==n?n:es.pagination.showSizeChanger,w=null!==(r=null==g?void 0:g.showQuickJumper)&&void 0!==r?r:es.pagination.showQuickJumper,C=(null==g?void 0:g.pageSizeOptions)||(null===(l=null===(i=null==d?void 0:d.table)||void 0===i?void 0:i.pagination)||void 0===l?void 0:l.pageSizeOptions)||es.pagination.pageSizeOptions,S=()=>Hn(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield N(b);e&&e!==o&&(c(a,e),localStorage.setItem(b,e.toString()))})),N=e=>Hn(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const n=yield t({key:e});if(200===n.code)return n.data}catch(e){}})),T=(e,t)=>Hn(void 0,void 0,void 0,(function*(){const n=null==d?void 0:d.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),I={[`${p}-pager`]:!0};return t.createElement("div",{ref:y,className:Pe(I)},t.createElement("div",{className:"pager-alert"},"bottom"===(null==v?void 0:v.position)&&t.createElement(ss,{total:s})),t.createElement(B,{size:Sp[m],showSizeChanger:E,showQuickJumper:w,pageSizeOptions:C,current:a,pageSize:o,total:s,onChange:(e,t)=>{c(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},Tp=()=>{const{prefixCls:e,layout:n}=t.useContext(Fo),r=t.useMemo((()=>{const{headerHeight:e,viewportHeight:t}=n;return{top:`${e}px`,height:`${t}px`}}),[n]);return t.createElement("div",{className:`${e}--empty`,style:r},t.createElement(tl,null))},Ip=()=>{const{prefixCls:e,setElementStore:n}=t.useContext(Fo),r=t.useRef(null);t.useLayoutEffect((()=>{i()}),[]);const i=()=>{n("$resizableBar",r.current)};return t.createElement("div",{ref:r,className:`${e}--resizable-bar`})},Rp=t.forwardRef(((e,n)=>{const r=pn($o,e),{rowKey:i,columns:l,loading:a,resizable:o,customClass:s,areaSelection:c,tablePrint:d,exportExcel:u,infoBarConfig:p,topSpaceAlign:m,showTableInfo:h,showFullScreen:f,showRefresh:g,showToolBox:v,showHeader:y,className:b,style:x}=r,{$size:E}=$n(r),w=t.useRef(null),C=t.useRef(null),S=t.useRef(null),N=t.useRef(null),T=t.useRef(null),I=lr("table"),R=Mn(((e,t)=>{const n="function"==typeof i?i(e,t):null==e?void 0:e[i];return void 0===n?(tr("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),{tableRef:O,tableFullData:k,setElementStore:L,setOriginColumns:A,setTableFullData:P,setTableOriginData:_,setAllTableData:D,setDeriveRowKeys:H,setInvalidRowKeys:F,setFieldAuth:M,setColumnsDefined:$,setScrollXLoad:q,setScrollYLoad:j,setResizeState:K,setHandleState:V,setSummaries:z,setSelectionRows:W,setRecordsMap:B,setUnMounted:U,clearElementStore:G,clearRecordsMap:Y}=((e,{getRowKey:n,$size:r})=>{const{rowHeight:i,dynamicThead:l}=e,a=t.useRef({props:e,uid:Xo(),tableManager:Zo,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],allParentRowKeys:[],deriveRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!l,scrollBarRef:t.createRef(),rowHeight:i||es.rowHeightMaps[r],store:new Jo,resizeState:{width:0,height:0,winHeight:window.innerHeight},handleState:{insert:null,remove:!1},summaries:{},isTreeTable:!1,scrollXLoad:!1,scrollYLoad:!1,selectionRows:[],recordsMap:new Map,unMounted:!1,isIE:!qn&&/MSIE|Trident/.test(navigator.userAgent)});var o;o=e,a.current.props=o;const s=(e,t,r="",i=0)=>e.map((e=>{const l=n(e,e.index),a=r?`${r}.${e.index+1}`:`${e.index+1}`,o={level:i,rowKey:l,indexPath:a};return e.indexPath=a,e._level=i,e._parentRowKey=i?t:null,Array.isArray(e.children)&&(o.children=s(e.children,l,a,i+1)),t?Object.assign(o,{parentRowKey:t}):o}));return Object.assign(Object.assign({tableRef:a},a.current),{setElementStore:(e,t)=>{a.current.elementStore[e]=t},setOriginColumns:e=>{a.current.originColumns=e},setTableFullData:e=>{a.current.tableFullData=e},setTableOriginData:e=>{a.current.tableOriginData=e},setAllTableData:e=>{const t=sa(e);a.current.allTableData=t,a.current.allRowKeys=t.map((e=>n(e,e.index)))},setDeriveRowKeys:e=>{const t=e.some((e=>Array.isArray(e.children)));a.current.isTreeTable=t,a.current.deriveRowKeys=t?s(e,""):[],a.current.allParentRowKeys=t?ca(e,(e=>n(e,e.index))):[]},setInvalidRowKeys:e=>{a.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{a.current.fieldAuth[e]=t},setColumnsDefined:e=>{a.current.columnsDefined=e},setResizeState:e=>{a.current.resizeState=e},setHandleState:e=>{a.current.handleState=e},setSummaries:e=>{a.current.summaries=e},setScrollXLoad:e=>{a.current.scrollXLoad=e},setScrollYLoad:e=>{a.current.scrollYLoad=e},setSelectionRows:e=>{a.current.selectionRows=e},setRecordsMap:(e,t)=>{a.current.recordsMap.set(e,t)},setUnMounted:e=>{a.current.unMounted=e},clearElementStore:()=>{for(const e in a.current.elementStore)a.current.elementStore[e]=null},clearRecordsMap:()=>{a.current.recordsMap.clear()}})})(r,{getRowKey:R,$size:E}),{tableFlatData:X,setTableFlatData:Q,filters:Z,setFilters:J,sorter:ee,setSorter:te,superFilters:ne,setSuperFilters:re,pagination:ie,setPagination:le,selectionKeys:oe,setSelectionKeys:se,rowExpandedKeys:ce,setRowExpandedKeys:de,highlightKey:ue,setHighlightKey:pe,updateMark:fe,forceUpdate:ge,activedCell:ve,setActivedCell:ye,mergedTdCells:be,setMergedCells:xe,layout:Ee,setLayout:we,permission:Ce,setPermission:Se,spinning:Ne,setSpinning:Te,isPingLeft:Ie,setPingLeft:Re,isPingRight:Oe,setPingRight:ke,isFullScreen:Le,setFullScreen:Ae,updateTableFlatData:_e}=(e=>{var n,r,i,l,a,o,s,c,d,u,p;const{uniqueKey:m,initialSorter:h={},initialFilter:f={},paginationConfig:g,rowSelection:v,expandable:y,rowHighlight:b,mergedCells:x}=e,{global:E}=t.useContext(on),w={current:null!==(n=null==g?void 0:g.current)&&void 0!==n?n:es.pagination.current,pageSize:null!==(o=null!==(i=null!==(r=(()=>{if(m)return Number(localStorage.getItem(`tablePager_${m}`))||void 0})())&&void 0!==r?r:null==g?void 0:g.pageSize)&&void 0!==i?i:null===(a=null===(l=null==E?void 0:E.table)||void 0===l?void 0:l.pagination)||void 0===a?void 0:a.pageSize)&&void 0!==o?o:es.pagination.pageSize,total:0},C=null!==(c=null!==(s=null==v?void 0:v.selectedRowKeys)&&void 0!==s?s:null==v?void 0:v.defaultSelectedRowKeys)&&void 0!==c?c:[],S=null!==(u=null!==(d=null==y?void 0:y.expandedRowKeys)&&void 0!==d?d:null==y?void 0:y.defaultExpandedRowKeys)&&void 0!==u?u:[],[N,T]=t.useState([]),[I,R]=t.useReducer(((e,t)=>me(e,t)?e:t),f),[O,k]=t.useReducer(((e,t)=>me(e,t)?e:t),h),[L,A]=t.useReducer(((e,t)=>me(e,t)?e:t),[]),[P,_]=t.useState(w),[D,H]=t.useReducer(((e,t)=>me(e,t)?e:t),C),[F,M]=t.useReducer(((e,t)=>me(e,t)?e:t),S),[$,q]=t.useState(null!==(p=null==b?void 0:b.currentRowKey)&&void 0!==p?p:""),[j,K]=t.useReducer((e=>e+1),0),[V,z]=t.useReducer(((e,t)=>me(e,t)?e:t),{}),[W,B]=ns([],{value:x}),[U,G]=t.useState({gutterWidth:0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[Y,X]=t.useState({export:!0,import:!0,print:!0}),[Q,Z]=t.useState(!1),[J,ee]=t.useState(!1),[te,ne]=t.useState(!1),[re,ie]=t.useState(!1);return{tableFlatData:N,setTableFlatData:T,filters:I,setFilters:R,sorter:O,setSorter:k,superFilters:L,setSuperFilters:A,pagination:P,setPagination:_,selectionKeys:D,setSelectionKeys:H,rowExpandedKeys:F,setRowExpandedKeys:M,highlightKey:$,setHighlightKey:q,updateMark:j,forceUpdate:K,activedCell:V,setActivedCell:z,mergedTdCells:W,setMergedCells:B,layout:U,permission:Y,setPermission:X,setLayout:G,spinning:Q,setSpinning:Z,isPingLeft:J,setPingLeft:ee,isPingRight:te,setPingRight:ne,isFullScreen:re,setFullScreen:ie,updateTableFlatData:()=>T([...N])}})(r),{isFetch:De,isWebPagination:He,isScrollPagination:Fe,showPagination:Me,tableColumns:$e,flattenColumns:qe,editableColumns:je,summationColumns:Ke,leftFixedColumns:Ve,rightFixedColumns:ze,derivedMergeCells:We,treeExpandIndex:Be,showSummary:Ue,showFooter:Ge,isHeadGroup:Ye,bordered:Xe,isHeadSorter:Qe,isHeadFilter:Ze,isServiceSummation:Je,isSelectCollection:et,isTableImport:tt,isTableClipboard:nt,isSuperSearch:rt,isFastSearch:it,isPivotGrid:lt,isGroupSummary:at,isGroupSubtotal:ot,isTableEmpty:st,summationRows:ct,fetchParams:dt}=is(r,{getRowKey:R,tableRef:O,tableFullData:k,tableFlatData:X,sorter:ee,filters:Z,superFilters:ne,selectionKeys:oe,pagination:ie,mergedTdCells:be}),{createElementStore:ut,tableStyles:pt,getSpan:mt,getStickyLeft:ht,getStickyRight:ft,scrollXToColumn:gt,scrollYToRecord:vt,calcTableHeight:yt,resetTableScroll:bt,doLayout:xt}=as(r,{getRowKey:R,tableRef:O,topElementRef:w,tableElementRef:C,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,leftFixedColumns:Ve,derivedMergeCells:We,tableFlatData:X,layout:Ee,showFooter:Ge,showPagination:Me,isFullScreen:Le,setLayout:we,setElementStore:L}),{initialTable:Et,checkDataIndex:wt,createTableFullData:Ct,getTableData:St,createTableList:Nt,createTableData:Tt,createGroupData:It,setSelectionKeysEffect:Rt,doFieldValidate:Ot,getTableLog:kt,dataChange:Lt,tableChange:At,toLastPage:Pt,toFirstPage:_t,getPageCount:Dt,pagerChangeHandle:Ht,scrollBottomDebouncer:Ft,clearTableSorter:Mt,clearTableFilter:$t,clearSuperFilters:qt,clearRowSelection:jt,clearRowHighlight:Kt,clearTableLog:Vt,destroy:zt}=ls(r,{getRowKey:R,tableRef:O,tableElementRef:C,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,tableFullData:k,pagination:ie,layout:Ee,filters:Z,sorter:ee,superFilters:ne,fetchParams:dt,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,summationColumns:Ke,isFetch:De,isWebPagination:He,isScrollPagination:Fe,isServiceSummation:Je,isGroupSubtotal:ot,doLayout:xt,setTableFlatData:Q,setTableFullData:P,setTableOriginData:_,setAllTableData:D,setDeriveRowKeys:H,setPagination:le,setPingRight:ke,setPingLeft:Re,setSpinning:Te,setSorter:te,setFilters:J,setSuperFilters:re,setSelectionKeys:se,setRowExpandedKeys:de,setHighlightKey:pe,setSelectionRows:W,setScrollXLoad:q,setScrollYLoad:j,setFieldAuth:M,setResizeState:K,setSummaries:z,setPermission:Se,setRecordsMap:B,resetTableScroll:bt,clearElementStore:G,clearRecordsMap:Y});((e,n)=>{const{columns:r,summation:i,rowSelection:l,expandable:a,rowHighlight:o}=e,{tableRef:s,tableBodyRef:c,$size:d,pagination:u,selectionKeys:p,rowExpandedKeys:m,highlightKey:h,summationRows:f,showSummary:g,isWebPagination:v,isScrollPagination:y,checkDataIndex:b,toLastPage:x,toFirstPage:E,getPageCount:w,setHandleState:C,scrollYToRecord:S,setSelectionKeysEffect:N,setOriginColumns:T,setRowExpandedKeys:I,setHighlightKey:R,setResizeState:O,setUnMounted:k,calcTableHeight:L,initialTable:A,destroy:P}=n,_=t.useRef(f);Mi((()=>{if(!l)return;const{onChange:e}=l;"radio"===l.type&&c.current.setClickedValues(p.length?[p[0],""]:[]),p.__prevent__||null==e||e(p,s.current.selectionRows),pa(p)}),[p]),Mi((()=>{if(!a)return;const{onChange:e}=a;m.__prevent__||null==e||e(m,m.map((e=>s.current.recordsMap.get(e)))),pa(m)}),[m]),Mi((()=>{var e,t;o&&(c.current.setClickedValues(h?[h,""]:[]),null===(e=o.onChange)||void 0===e||e.call(o,h,null!==(t=s.current.recordsMap.get(h))&&void 0!==t?t:null))}),[h]),Mi((()=>{var e;me(f,_.current)||(_.current=f,g&&i&&(null===(e=i.onChange)||void 0===e||e.call(i,f)))}),[f]),Mi((()=>{const e=l.selectedRowKeys||[];me(e,p)||N(ua(e))}),[null==l?void 0:l.selectedRowKeys]),Mi((()=>{const e=a.expandedRowKeys||[];me(e,m)||I(ua(e))}),[null==a?void 0:a.expandedRowKeys]),Mi((()=>{const{currentRowKey:e}=o;e!==h&&R(null!=e?e:"")}),[null==o?void 0:o.currentRowKey]),Mi((()=>{const{insert:e,remove:t}=s.current.handleState;e&&(v&&("after"===e?x():E()),S("","after"===e?1e5:0)),t&&u.current>w()&&x(),(e||t)&&C({insert:null,remove:!1})}),[u.total]),Mi((()=>{L()}),[d]),Mi((()=>{(s.current.scrollYLoad||y)&&(e.height||e.maxHeight||tr("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[s.current.scrollYLoad,y]),os({handler:()=>{const{resizeState:e}=s.current,{winHeight:t}=e,n=window.innerHeight;n!==t&&(O(Object.assign({},e,{winHeight:n})),L())},delay:16}),t.useEffect((()=>(T(Qn(r)),A(),b(),Bn((()=>L())),()=>{P(),k(!0)})),[])})(r,{tableRef:O,tableBodyRef:S,$size:E,pagination:ie,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,showSummary:Ue,summationRows:ct,isWebPagination:He,isScrollPagination:Fe,checkDataIndex:wt,toLastPage:Pt,toFirstPage:_t,getPageCount:Dt,setHandleState:V,scrollYToRecord:vt,setOriginColumns:A,setSelectionKeysEffect:Rt,setRowExpandedKeys:de,setHighlightKey:pe,setResizeState:K,setUnMounted:U,calcTableHeight:yt,initialTable:Et,destroy:zt});const Wt=t.useMemo((()=>({getRowKey:R,tableRef:O,tableBodyRef:S,prefixCls:I,$size:E,tableFlatData:X,flattenColumns:qe,editableColumns:je,leftFixedColumns:Ve,rightFixedColumns:ze,treeExpandIndex:Be,sorter:ee,filters:Z,superFilters:ne,layout:Ee,bordered:Xe,showFooter:Ge,showSummary:Ue,summationRows:ct,pagination:ie,fetchParams:dt,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,activedCell:ve,mergedTdCells:be,derivedMergeCells:We,updateMark:fe,isFetch:De,isPingLeft:Ie,isPingRight:Oe,isHeadSorter:Qe,isHeadFilter:Ze,isFullScreen:Le,isTableEmpty:st,isHeadGroup:Ye,isGroupSubtotal:ot,isWebPagination:He,dataChange:Lt,tableChange:At,getTableData:St,setElementStore:L,createTableList:Nt,createTableFullData:Ct,updateTableFlatData:_e,setSorter:te,setFilters:J,setSuperFilters:re,setHighlightKey:pe,setRowExpandedKeys:de,setSelectionRows:W,setSelectionKeysEffect:Rt,setInvalidRowKeys:F,setActivedCell:ye,setMergedCells:xe,getSpan:mt,getStickyLeft:ht,getStickyRight:ft,scrollXToColumn:gt,scrollYToRecord:vt,setPagination:le,setPingLeft:Re,setPingRight:ke,setSpinning:Te,setFullScreen:Ae,doFieldValidate:Ot,createTableData:Tt,createGroupData:It,scrollBottomDebouncer:Ft,resetTableScroll:bt,clearTableSorter:Mt,clearTableFilter:$t,clearSuperFilters:qt,clearRowSelection:jt,clearRowHighlight:Kt})),[E,X,qe,ee,Z,ne,Ee,Xe,Ge,Ue,ct,ie,dt,oe,ce,ue,ve,We,fe,De,Ie,Oe,Qe,Ze,Le,st,Ye,ot,He]);((e,n)=>{const{getRowKey:r,tableRef:i,toolBoxRef:l,tableBodyRef:a,columnFilterRef:o,flattenColumns:s,editableColumns:c,pagination:d,fetchParams:u,selectionKeys:p,rowExpandedKeys:m,highlightKey:h,isFetch:f,dataChange:g,getTableData:v,createTableData:y,createTableFullData:b,calcTableHeight:x,scrollXToColumn:E,scrollYToRecord:w,doFieldValidate:C,setTableOriginData:S,setHandleState:N,setColumnsDefined:T,setSelectionKeysEffect:I,setRowExpandedKeys:R,setHighlightKey:O,setSelectionRows:k,setOriginColumns:L,forceUpdate:A,getTableLog:P,clearRowSelection:_,clearRowHighlight:D,clearTableSorter:H,clearTableFilter:F,clearSuperFilters:M,clearTableLog:$}=n,{columns:q,columnsChange:j}=i.current.props,K=(e,t,n)=>e.filter((e=>{const i=r(e,e.index);e.children&&(e.children=K(e.children,t,n));const l=t.includes(i);return l&&(null==n||n(e,i)),!l}));t.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{x()},DO_REFRESH:e=>Hn(void 0,void 0,void 0,(function*(){f&&(yield v(),null==e||e())})),GET_LOG:()=>P(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{f||(_(),D(),H(),F(),M(),$(),y([]))},CLEAR_LOG:()=>{$(),A()},CREATE_FOCUS:(e,t)=>{a.current.createFocus(e,t)},FORCE_UPDATE:()=>{A()},DO_EXPORT:()=>{l.current.exportHandle()},SCROLL_TO_RECORD:e=>{w(e)},SCROLL_TO_COLUMN:e=>{E(e)},SET_SELECTION:(e,t)=>{I(t?ua([...e]):e)},SET_EXPANDABLE:(e,t)=>{R(t?ua([...e]):e)},SET_HIGHLIGHT:e=>{O(e)},SET_SELECTION_ROWS:e=>{k(e)},SET_TABLE_DATA:e=>{b(e)},DEFINE_INITIAL_COLUMNS:e=>{L(e),T(!0),o.current.initialHandler()},SET_TABLE_COLUMN:(e,t,n)=>{const r=ra(q,e);if(!r)return tr("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!ae(t))return tr("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(r.noAuth)return tr("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&he(r,e,t[e]);n&&(j?j([...q]):tr("Table","需要设置 `columnsChange` 参数"),A())},INSERT_RECORDS:(e,t)=>{const{store:n,tableFullData:l}=i.current,a=(Array.isArray(e)?e:[e]).filter((e=>ae(e)));if(!a.length)return;a.forEach((e=>{s.forEach((t=>{const{dataIndex:n}=t;[es.expandableColumn,es.selectionColumn,es.operationColumn].includes(n)||va(e,n,ga(e,n))})),n.addToInserted(e)}));const o="before"===(null==t?void 0:t.mode),c=void 0===(null==t?void 0:t.parentRowKey),d=l;if(c)o?d.unshift(...a):d.push(...a);else{const e=Aa(l,(e=>t.parentRowKey===r(e,e.index)));e&&(Array.isArray(e.children)?o?e.children.unshift(...a):e.children.push(...a):e.children=a)}c&&N(Object.assign({},i.current.handleState,{insert:o?"before":"after"})),y(d),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:n}=i.current,l=(Array.isArray(e)?e:[e]).map((e=>ae(e)?r(e,e.index):e));if(!l.length)return;let a=!1;const o=K(n,l,((e,n)=>{t.addToRemoved(e),c.forEach((r=>{const{dataIndex:i,editRender:l}=r,a=null==l?void 0:l(e,r);if(!a)return;const{rules:o=[],disabled:s}=a;!s&&o.length&&(t.removeFromRequired({x:n,y:i}),t.removeFromValidate({x:n,y:i}),t.removeFromEdited({x:n,y:i}))})),a=!0}));a&&(N(Object.assign({},i.current.handleState,{remove:!0})),b(o),I(p.filter((e=>!l.includes(e)))),l.includes(h)&&D(),R(m.filter((e=>!l.includes(e)))),g(),Bn((()=>{S(K(i.current.tableOriginData,l))})))},VALIDATE_FIELDS:(e,t)=>{i.current.allTableData.forEach((n=>{c.forEach((i=>{const{dataIndex:l,title:a,editRender:o}=i,s=null==o?void 0:o(n,i);if(!s)return;const c=r(n,n.index);if(e&&!e.includes(c))return;if(t&&!t.includes(l))return;const{rules:d=[],disabled:u}=s;u||C(d,ga(n,l),c,l,Ta(a))}))}));const{required:n,validate:l}=P(),a=[...n,...l];return a.length&&w(a[0].rowKey),A(),{required:n,validate:l}}})))})(n,{getRowKey:R,tableRef:O,toolBoxRef:N,tableBodyRef:S,columnFilterRef:T,flattenColumns:qe,editableColumns:je,pagination:ie,fetchParams:dt,selectionKeys:oe,rowExpandedKeys:ce,highlightKey:ue,isFetch:De,dataChange:Lt,getTableData:St,createTableData:Tt,createTableFullData:Ct,calcTableHeight:yt,scrollXToColumn:gt,scrollYToRecord:vt,doFieldValidate:Ot,setTableOriginData:_,setHandleState:V,setColumnsDefined:$,setSelectionKeysEffect:Rt,setRowExpandedKeys:de,setHighlightKey:pe,setSelectionRows:W,setOriginColumns:A,forceUpdate:ge,getTableLog:kt,clearRowSelection:jt,clearRowHighlight:Kt,clearTableSorter:Mt,clearTableFilter:$t,clearSuperFilters:qt,clearTableLog:Vt}),t.useLayoutEffect((()=>{ut(),O.current.tableManager.register(O.current.uid,null!=n?n:{current:null})}),[]);const Bt={[`${I}--wrapper`]:!0,[`${I}--lg`]:"large"===E,[`${I}--sm`]:"small"===E,[`${I}--maximize`]:Le,[s]:!!s},Ut={[I]:!0,"is--border":Xe,"is--fixed":Ve.length||ze.length,"is--sortable":Qe,"is--filterable":Ze,"is--head-group":Ye,"is--area-select":!!c,"is--ping-left":Ie,"is--ping-right":Oe};return t.createElement(Fo.Provider,{value:Wt},t.createElement("div",{className:Pe(Bt,b),style:x},h&&t.createElement("div",{ref:w,className:`${I}-top`},t.createElement("div",{className:`${I}-top__space`},"bottom"!==(null==p?void 0:p.position)&&t.createElement(ss,{total:ie.total}),t.createElement("div",{className:`${I}-top__space-slot`,style:{justifyContent:Uo[m]}},r.children)),t.createElement("div",{className:`${I}-top__actions`},t.createElement(Fu,{ref:N,showFullScreen:f,showReload:g&&De,showPrint:Ce.print&&!!d,showImport:Ce.import&&tt,showExport:Ce.export&&!!u,showClipboard:nt,showCollection:et,showFastSearch:it,showSuperSearch:rt,showPivotGrid:lt,showGroupSummary:at,showToolBox:v,tableColumns:$e}),t.createElement($u,{ref:T,columns:l}))),t.createElement(nl,{spinning:null!=a?a:Ne},t.createElement("div",{ref:C,className:Pe(Ut),style:pt},t.createElement("div",{className:`${I}--main-wrapper`},y&&t.createElement(np,{tableColumns:$e}),t.createElement(wp,{ref:S}),Ge&&t.createElement(Cp,null)),Xe&&t.createElement("div",{className:`${I}--border-line`}),st&&t.createElement(Tp,null),o&&t.createElement(Ip,null))),Me&&t.createElement(Np,Rn({},ie,{onChange:(e,t)=>Ht({current:e,pageSize:t})}))))}));Rp.displayName="QmTable";const Op=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:l,selectionRows:a,defaultSelectedKeys:o=[],filters:s=[],table:c={},className:d,style:u,onClose:p}=e,{$size:m}=$n(e),{t:h}=Fn(),f=t.useRef(null),g=t.useRef(null),v=t.useRef(null),y=sl(f),[b,x]=t.useState(c),[E,w]=t.useState(),[C,S]=t.useState(o),[N,T]=t.useState(!1),[I,R]=t.useState(300),[O,k]=t.useState(s),[L,A]=t.useState((e=>[{title:h("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[P,_]=t.useState(Ie({},null===(n=c.fetch)||void 0===n?void 0:n.params,l)),[D,H]=t.useState([]),F=()=>{const e=f.current,t=e.querySelector(".form-wrap");R(e.offsetHeight-t.offsetHeight-2*Ho[m]-30)},M=cl(F,5);hn((()=>{M()}),[y.width]),Mi((()=>{me(s,O)||k(s)}),[s]),t.useEffect((()=>{$()}),[P]),t.useEffect((()=>{a&&v.current.SET_SELECTION_ROWS(a)}),[a]),t.useEffect((()=>{var e;l&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(l))}),[]);const $=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=b;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:l,beforeFetch:a=zn}=n;if(a(P)){T(!0);try{const t=yield r(P);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,l))&&void 0!==e?e:[];i||(S([]),yield Wn(0)),H(n)}}catch(e){}T(!1)}})),q=e=>{i||(w(e),p(e))},j=e=>{_(Object.assign({},P,e))},K={[`${lr("search-helper")}--wrapper`]:!0},V=b.webPagination?{dataSource:D,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:P})};return t.createElement("div",{ref:f,className:Pe(K,d),style:u},t.createElement("div",{className:"form-wrap"},O.length?t.createElement(sh,{ref:g,items:O,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>F(),onFinish:e=>j(e),onReset:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||j(t)}))}):null),t.createElement("div",null,t.createElement(Rp,Rn({ref:v,uniqueKey:r,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},V,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:C,onChange:(e,t)=>{S(e),w(i?t:t[0])}},topSpaceAlign:"left",paginationConfig:b.paginationConfig,columnsChange:e=>A(e),onRowDblclick:q,onRowEnter:q}),b.topBarExtra)),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Ho[m]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>p(null),style:{marginRight:8}},h("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!E,onClick:()=>p(E,i?C:void 0)},h("qm.dialog.confirm"))))};Op.displayName="QmSearchHelper";const{Search:kp}=O;class Lp extends d{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||tr("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||tr("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&tr("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Hn(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t&&!Gn(u)){this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Ja(e,this.alias,c),d&&eo(e,this.extras,d),this._record=e,this.setFieldsValue(e),a){const t=Za(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==l||l([e])}}}catch(e){}this.setState({loading:!1})}})),this.todoOpen=e=>{const{autoQueryAssign:t=!0}=this.searchHelper;t&&(this.deriveParams=this.createFilters(e)),this.setVisible(!0)},this.createFilters=e=>{const{fieldName:t}=this.props.option,{filterAliasMap:n}=this.searchHelper,r=""!==e?e:void 0,i=("function"==typeof n?n():n)||[],l={[t]:r};return(Array.isArray(i)?i:[i]).forEach((e=>{if(ae(e))for(const t in e)l[t]="function"==typeof e[t]?e[t](r):r;else l[e]=r})),l},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=zn,formatter:i=(e=>e)}=t.fetch;return new Promise(((l,a)=>Hn(this,void 0,void 0,(function*(){var o;const s=Ie({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});if(!r(s))return a();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=ue(e.data,t.fetch.dataKey))&&void 0!==o?o:[];l(n)}else a()}catch(e){a(e)}finally{Bn((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=Za(e,this.alias[r]);void 0!==i&&(t.SET_FIELDS_VALUE({[r]:i}),r===this.valueKey&&(this._prevValue=i),r===n&&t.setViewValue(n,i))}for(const n in this.extras){const r=Za(e,this.extras[n]);void 0!==r&&t.SET_FIELDS_EXTRA({[n]:r})}},this.resetSearchHelperValue=(e=[],t)=>Hn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,r=e.filter((e=>{var r;return null===(r=Za(e,this.alias[n]))||void 0===r?void 0:r.toString().toLowerCase().includes(t.toLowerCase())}));if(1===r.length)return this.closeSearchHelper(r[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:n}=this.context,{beforeOpen:r}=this.searchHelper,i=(null!=r?r:zn)(n.state.formData);(null==i?void 0:i.then)?i.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==i&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias){if(r===n)continue;const i=Za(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===this.valueKey&&(this._prevValue=i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Za(e,this.extras[n])});const r=Za(e,this.alias[n]);this.triggerChange(r),this.searchHelperChangeHandle(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.closeButNotSelect=()=>{const{onlySelect:e=!0}=this.searchHelper;this._is_change&&(e?this.clearSearchHelperValue():this.searchHelperChangeHandle(this.props.value)),this._is_change=!1,this.setVisible(!1)},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;if(this.triggerChange(""),null!==this._record){for(const n in this.alias)n!==t&&(e.SET_FIELDS_VALUE({[n]:void 0}),n===this.valueKey&&(this._prevValue=null));for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.searchHelperChangeHandle("")}},this.searchHelperChangeHandle=e=>{const{onChange:t}=this.props.option;this.deriveParams={},this._is_change=!1,null==t||t(e,this._record)},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.focus=()=>{const{type:e}=this.props.option;this[`${e}_Ref`].focus({cursor:"end"})},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:l}=this.props,{type:a,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=un("qm.form.inputPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:un("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${Ho[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:Object.assign({},this.deriveParams,c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(Eo,{value:l,bordered:p}):t.createElement(t.Fragment,null,t.createElement(kp,{ref:e=>this[`${a}_Ref`]=e,value:l,title:l,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:m,readOnly:h,disabled:f,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:i=!0,table:l}=this.searchHelper;this.triggerBlur(n),this._is_change&&!r&&(n?i?(null===(t=null==l?void 0:l.fetch)||void 0===t?void 0:t.api)&&this.getSearchHelperTableData(n).then((e=>this.resetSearchHelperValue(e,n))).catch((()=>this.clearSearchHelperValue())):this.searchHelperChangeHandle(n):this.clearSearchHelperValue())},onKeyDown:e=>{if(13===e.keyCode){e.preventDefault();const{value:t}=e.target;!r&&this.openSearchHelper(t)}},onDoubleClick:e=>{const{value:t}=e.target;this.openSearchHelper(t)},onChange:e=>{const{value:t}=e.target;this.triggerChange(t),this._is_change=!0},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper(e):Bn((()=>this.clearSearchHelperValue())))}}),t.createElement(Fl,b,t.createElement(Op,x)))}}Lp.contextType=Ml;class Ap extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=ao(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[]}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Lp,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Ap.contextType=Ml;const Pp=e=>{class n extends d{constructor(){super(...arguments),this.event1=null,this.event2=null,this.$el=null,this.omitClassNames=[],this.state={clickOutside:!1},this.mousedownHandler=e=>{this.startClick=e},this.mouseupHandler=e=>{this.documentHandler(e,this.startClick)},this.documentHandler=(e,t)=>{var n,r;const i=e.target,l=null==t?void 0:t.target,a=!i||!l,o=(null===(n=this.$el)||void 0===n?void 0:n.contains(i))||(null===(r=this.$el)||void 0===r?void 0:r.contains(l)),s=this.$el===i,c=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),d=c.some((e=>null==e?void 0:e.contains(i)))||c.includes(l);let u;u=!(a||o||s||d),this.setState({clickOutside:u})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=Kt(document,"mousedown",this.mousedownHandler),this.event2=Kt(document,"mouseup",this.mouseupHandler)}componentWillUnmount(){var e,t;null===(e=this.event1)||void 0===e||e.remove(),null===(t=this.event2)||void 0===t||t.remove()}render(){const{forwardedRef:n}=this.props,{clickOutside:r}=this.state;return t.createElement(e,Rn({ref:n},this.props,{clickOutside:r,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return n.displayName=`OutsideClick(${e.displayName||e.name})`,t.forwardRef(((e,r)=>t.createElement(n,Rn({},e,{forwardedRef:r}))))};let _p=class extends d{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||tr("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||tr("Form","MULTIPLE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(ke([...this._records.filter((e=>t.includes(e[n]))),...e],n));const r=this.recordsToDict();this.setItemList(r),this.triggerChange(r.map((e=>e.value)));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;me(n,r)||me(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:l={},formatter:a=(e=>e),dataKey:o,callback:s,fieldAliasMap:c}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof c?c():c||{},{value:u}=this.props;if(i){if(Gn(u))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(a(Object.assign(Object.assign({},l),{keys:u})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=ue(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==r&&(e[r]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==n&&(e[n]=e[d.textKey])})),i=i.filter((e=>u.includes(e[r])));const l=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(l),this.setViewValue(u),null==s||s(i)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:l,visible2:a,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:m={},placeholder:h=un("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,w={visible:l,title:un("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${Ho[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:Ie({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),S=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},un("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=lr("form-multiple-search-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(Eo,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(nd,{popupVisible:!y&&a,popup:N,popupClassName:Pe(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Va,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement(H,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:h,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},m),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Nt,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(Fl,w,t.createElement(Op,C)))}};_p.contextType=Ml,_p=Dn([Pp],_p);class Dp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=ao(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(_p,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(a,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Dp.contextType=Ml;const Hp=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Hp(e.children)),e.children&&t.push(e.value)})),t},Fp=(e,t)=>{let n=null;for(let r=0;r<e.length;r++){if(Array.isArray(e[r].children)&&(n=Fp(e[r].children,t)),n)return n;if(t(e[r]))return e[r]}return n},Mp=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Mp(e.children,t),t(e)||e.children&&e.children.length))),$p=e=>{var n;const{uniqueKey:r,multiple:i,initialValue:l,selectionRows:a,defaultSelectedKeys:o=[],filters:s=[],table:c={},tree:d={},className:u,style:p,onClose:m}=e,{$size:h}=$n(e),{t:f}=Fn(),g=t.useRef(null),v=t.useRef(null),y=t.useRef(null),b=sl(g),[x,E]=t.useState(c),[w,C]=t.useState(),[S,N]=t.useState(o),[T,I]=t.useState(!1),[R,k]=t.useState(300),[L,A]=t.useState(300),[P,_]=t.useState(s),[D,H]=t.useState((e=>[{title:f("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},...e||(c.columns||[])])()),[F,M]=t.useState(Ie({},null===(n=c.fetch)||void 0===n?void 0:n.params,l)),[$,q]=t.useState([]),j=()=>{const e=g.current,t=e.querySelector(".form-wrap"),n=e.querySelector(".input-wrap");k(e.offsetHeight-n.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*Ho[h]-30)},K=cl(j,5);hn((()=>{K()}),[b.width]),Mi((()=>{me(s,P)||_(s)}),[s]),t.useEffect((()=>{V()}),[F]),t.useEffect((()=>{a&&y.current.SET_SELECTION_ROWS(a)}),[a]),t.useEffect((()=>{var e;l&&(null===(e=v.current)||void 0===e||e.SET_FIELDS_VALUE(l)),te()}),[]);const V=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=x;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:l,beforeFetch:a=zn}=n;if(a(F)){I(!0);try{const t=yield r(F);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,l))&&void 0!==e?e:[];i||(N([]),yield Wn(0)),q(n)}}catch(e){}I(!1)}})),W=e=>{i||(C(e),m(e))},B=e=>{M(Object.assign({},F,e))},[U,G]=t.useState([]),[Y,X]=t.useState([]),[Q,Z]=t.useState(""),J=t.useRef(U),ee=t.useRef([]);Mi((()=>{X(Hp(U))}),[U]);const te=()=>Hn(void 0,void 0,void 0,(function*(){var e;if(!d.fetch)return;const{api:t,params:n,dataKey:r,valueKey:i="value",textKey:l="text"}=d.fetch;try{const a=yield t(n);if(200===a.code){const t=Array.isArray(a.data)?a.data:null!==(e=ue(a.data,r))&&void 0!==e?e:[],n=to(t,i,l);G(n),J.current=n,ee.current=t}}catch(e){}})),ne=e=>`${e}|${bo.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${lr("tree-table-helper")}--wrapper`]:!0},ie=x.webPagination?{dataSource:$,loading:T,webPagination:!0}:{fetch:Object.assign(Object.assign({},x.fetch),{params:F})};return t.createElement("div",{ref:g,className:Pe(re,u),style:p},t.createElement(Ji,{defaultValue:200,style:{height:"100%"}},t.createElement(Ji.Pane,{min:100,style:{overflowY:"auto"}},t.createElement(O,{className:"input-wrap",value:Q,style:{marginBottom:8},placeholder:f("qm.form.inputPlaceholder"),suffix:t.createElement(Nt,null),allowClear:!0,onChange:e=>(e=>{const t=Mp(J.current,(t=>{if(!e)return!0;const n=t.text||"";return-1!==ne(n).indexOf(e)}));Z(e),G(t)})(e.target.value)}),t.createElement(z,{fieldNames:{title:"text",key:"value",children:"children"},height:R,defaultExpandAll:!0,expandedKeys:Y,treeData:U,filterTreeNode:e=>{if(!Q)return!1;const t=e.text||"";return-1!==ne(t).indexOf(Q)},onExpand:e=>{X(e)},onSelect:e=>{const{valueKey:t="value"}=d.fetch;(e=>{if(!d.tableParamsMap)return tr("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof d.tableParamsMap?d.tableParamsMap():d.tableParamsMap,n={};for(const r in t)n[r]=ue(e,t[r]);B(n)})(Fp(ee.current,(n=>ue(n,t)===e[0]))||{})}})),t.createElement(Ji.Pane,{className:"split-pane"},t.createElement("div",{className:"form-wrap"},P.length?t.createElement(sh,{ref:v,items:P,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>j(),onFinish:e=>B(e),onReset:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield v.current.GET_FORM_DATA();e||B(t)}))}):null),t.createElement("div",null,t.createElement(Rp,Rn({ref:y,uniqueKey:r,height:L,columns:D,rowKey:x.rowKey||"pageIndex"},ie,{rowSelection:{type:i?"checkbox":"radio",clearableAfterFetched:!i,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:S,onChange:(e,t)=>{N(e),C(i?t:t[0])}},topSpaceAlign:"left",paginationConfig:x.paginationConfig,columnsChange:e=>H(e),onRowDblclick:W,onRowEnter:W}),x.topBarExtra)))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Ho[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>m(null),style:{marginRight:8}},f("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!w,onClick:()=>m(w,i?S:void 0)},f("qm.dialog.confirm"))))};$p.displayName="TreeTableHelper";const{Search:qp}=O;class jp extends d{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:n,echoRequest:r}=this.searchHelper;if(t||tr("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),n){const e=["valueKey","displayKey","extraKey"];for(const t in n)e.includes(t)&&(this[t]=n[t])}Object.keys(this.alias).includes(e)||tr("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&tr("Form","TREE_TABLE_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Hn(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t&&!Gn(u)){this.setState({loading:!0});try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Ja(e,this.alias,c),d&&eo(e,this.extras,d),this._record=e,this.setFieldsValue(e),a){const t=Za(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==l||l([e])}}}catch(e){}this.setState({loading:!1})}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;for(const r in this.alias){const i=Za(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===this.valueKey&&(this._prevValue=i),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Za(e,this.extras[n])})},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias){if(r===n)continue;const i=Za(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===this.valueKey&&(this._prevValue=i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Za(e,this.extras[n])});const r=Za(e,this.alias[n]);this.triggerChange(r);const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const n in this.alias)n!==t&&(e.SET_FIELDS_VALUE({[n]:void 0}),n===this.valueKey&&(this._prevValue=null));for(const t in this.extras)e.SET_FIELDS_EXTRA({[t]:""});this._record=null,this.triggerChange("")},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(){this.echoSearchHelper()}render(){var e;const{$$form:n}=this.context,{visible:r,loading:i}=this.state,{value:l=""}=this.props,{type:a,fieldName:o,options:s={},searchHelper:c={},style:d={},placeholder:u=un("qm.form.selectPlaceholder"),bordered:p=!0,allowClear:m=!0,readOnly:h,disabled:f}=this.props.option,{prefix:g,suffix:v,maxLength:y}=s,b={visible:r,title:un("qm.searchHelper.text"),width:null!==(e=c.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${o}`,loading:!1,bodyStyle:{paddingBottom:`${Ho[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${o}`:"",initialValue:Ie({},c.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return n.isOnlyShow?t.createElement(Eo,{value:l,bordered:p}):t.createElement(t.Fragment,null,t.createElement(qp,{ref:e=>this[`${a}_Ref`]=e,value:l,title:l,loading:i,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:p,allowClear:m,readOnly:h,disabled:f,onBlur:e=>{const{value:t}=e.target;this.triggerBlur(t)},onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onDoubleClick:e=>{this.openSearchHelper()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():this.clearSearchHelperValue())}}),t.createElement(Fl,b,t.createElement($p,x)))}}jp.contextType=Ml;class Kp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=ao(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(jp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n)=>{f(t,n),e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Kp.contextType=Ml;let Vp=class extends d{constructor(e){super(e),this.searchRef=t.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||tr("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||tr("Form","MULTIPLE_TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setItemList=e=>{this.setState({itemList:e})},this.setRecords=e=>{this._records=e},this.recordsToDict=()=>this._records.map((e=>({text:e[this.alias.textKey],value:e[this.alias.valueKey]}))),this.setViewValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;t.setViewValue(n,this.createViewText(e))},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:n}=this.alias;this.setRecords(ke([...this._records.filter((e=>t.includes(e[n]))),...e],n));const r=this.recordsToDict();this.setItemList(r),this.triggerChange(r.map((e=>e.value)));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props,{valueKey:r}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[r])))),null==t||t(e),n(e,this.createViewText(e),this._records)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e,t){const{value:n=[]}=e,{value:r=[],clickOutside:i}=this.props;me(n,r)||me(r,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),i&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:n,valueKey:r}=this.alias,{fetchApi:i,params:l={},formatter:a=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},c="function"==typeof s?s():s||{},{value:d}=this.props;if(i){if(Gn(d))return this.setRecords([]);this.setState({loading:!0});try{const e=yield i(a(Object.assign(Object.assign({},l),{keys:d})));if(200===e.code){let i=Array.isArray(e.data)?e.data:null!==(t=ue(e.data,o))&&void 0!==t?t:[];i.forEach((e=>{(null==c?void 0:c.valueKey)&&c.valueKey!==r&&(e[r]=e[c.valueKey]),(null==c?void 0:c.textKey)&&c.textKey!==n&&(e[n]=e[c.textKey])})),i=i.filter((e=>d.includes(e[r])));const l=i.map((e=>({value:e[r],text:e[n]})));this.setRecords(i),this.setItemList(l),this.setViewValue(d)}}catch(e){}this.setState({loading:!1})}}))}createViewText(e){return this.recordsToDict().filter((t=>e.includes(t.value))).map((e=>e.text)).join(",")}render(){var e,n,r;const{$$form:i}=this.context,{visible:l,visible2:a,loading:o,itemList:s}=this.state,{value:c}=this.props,{fieldName:d,options:u={},searchHelper:p={},style:m={},placeholder:h=un("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,readOnly:v,disabled:y}=this.props.option,{collapseTags:b,maxTagTextLength:x}=u,w={visible:l,title:un("qm.searchHelper.text"),width:null!==(e=p.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${d}`,loading:!1,bodyStyle:{paddingBottom:`${Ho[i.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},C=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:i.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${d}`:"",initialValue:Ie({},p.initialValue),defaultSelectedKeys:c,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),S=s.filter((e=>null==c?void 0:c.includes(e.value))),N=t.createElement("ul",{className:"ant-dropdown-menu"},S.length?S.map((e=>t.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):t.createElement("li",{className:"ant-dropdown-menu-item"},un("qm.table.config.emptyText"))),T=this.searchRef.current?this.searchRef.current.offsetWidth:300,I=lr("form-multiple-tree-table-helper"),{size:R}=i.context,O={[I]:!0,[`${I}--lg`]:"large"===R,[`${I}--sm`]:"small"===R};null===(r=(n=this.props).setOmitClassNames)||void 0===r||r.call(n,[`.${I}`]);const k=s.filter((e=>null==c?void 0:c.includes(e.value))).map((e=>e.text)).join(",");return i.isOnlyShow?t.createElement(Eo,{value:k,bordered:f}):t.createElement(t.Fragment,null,t.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},t.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},t.createElement(nd,{popupVisible:!y&&a,popup:N,popupClassName:Pe(O),popupStyle:{minWidth:T},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:Va,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement(H,{mode:"multiple",maxTagCount:b?"responsive":void 0,maxTagTextLength:x,open:!1,value:c,placeholder:h,loading:o,bordered:f,allowClear:g,disabled:y,style:Object.assign({width:"100%"},m),title:k,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,n;const r=e.target;r.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(n=(t=this.props).setCurrentElement)||void 0===n||n.call(t,r),this.setState({visible2:!0}))},onDoubleClick:()=>{y||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},s.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",{className:"ant-input-group-addon"},t.createElement(E,{className:"ant-input-search-button",disabled:y,icon:t.createElement(Nt,null),onClick:()=>{this.openSearchHelper()}})))),t.createElement(Fl,w,t.createElement($p,C)))}};Vp.contextType=Ml,Vp=Dn([Pp],Vp);class zp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=ao(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Vp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{f(t,r),e.setViewValue(a,n)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}zp.contextType=Ml;const Wp="_startSign",Bp="_endSign",Up=e=>{var n;const{uniqueKey:r,initialValue:i,filters:l=[],table:a={},onClose:o}=e,{$size:s}=$n(e),{t:c}=Fn(),d=t.useRef(null),u=t.useRef(null),p=t.useRef(null),m=sl(d),[h,f]=t.useState(a),[g,v]=t.useState(!1),[y,b]=t.useState([]),[x,E]=t.useState(300),[w,C]=t.useState(l),[S,N]=t.useState((e=>[{title:c("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>t.createElement("span",null,e+1)},{title:c("qm.form.rangeSearchHelper")[0],dataIndex:Wp,width:80,align:"right",render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)},...e||(a.columns||[]),{title:c("qm.form.rangeSearchHelper")[1],dataIndex:Bp,fixed:"right",width:80,render:(e,n)=>t.createElement("span",{className:"icon-sign"},e)}])()),[T,I]=t.useState(Ie({},null===(n=a.fetch)||void 0===n?void 0:n.params,i)),[O,k]=t.useState([]),L=t.useMemo((()=>y.map((e=>null==e?void 0:e.pageIndex))),[y]),A=t.useMemo((()=>2===L.length&&L.every((e=>void 0!==e))),[L]),P=()=>{const e=d.current.parentNode.children[0],t=e.querySelector(".form-wrap");E(e.offsetHeight-t.offsetHeight-2*Ho[s]-30)},_=cl(P,5);hn((()=>{_()}),[m.width]),Mi((()=>{me(l,w)||C(l)}),[l]),t.useEffect((()=>{D()}),[T]);const D=()=>Hn(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:n}=h;if(!t||!(null==n?void 0:n.api))return;const{api:r,dataKey:i,beforeFetch:l=zn}=n;if(l(T)){v(!0);try{const t=yield r(T);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[];k(n)}}catch(e){}v(!1)}})),H=(e,t)=>{delete e[t]},F=()=>{y.forEach((e=>{e&&(H(e,Wp),H(e,Bp))})),b([])},M=e=>{F(),I(Object.assign({},T,e))},$=lr("range-helper"),q=h.webPagination?{dataSource:O,loading:g,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:T})};return t.createElement("div",{ref:d,className:`${$}--wrapper`},t.createElement("div",{className:"form-wrap"},w.length?t.createElement(sh,{ref:u,items:w,initialValues:i,uniqueKey:r,formType:"search",isAutoFocus:!1,fieldsChange:e=>C(e),onCollapse:()=>P(),onFinish:e=>M(e),onReset:()=>Hn(void 0,void 0,void 0,(function*(){const[e,t]=yield u.current.GET_FORM_DATA();e||M(t)}))}):null),t.createElement("div",null,t.createElement(Rp,Rn({ref:p,height:x,columns:S,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=L[0]&&e.pageIndex<=L[1]?{backgroundColor:"#f5f5f5"}:{}},q,{columnsChange:e=>N(e),onRowClick:(e,t)=>{const{dataIndex:n}=t;[Wp,Bp].includes(n)&&(n===Wp&&(e[n]?(H(e,n),b([void 0,y[1]])):e.pageIndex>L[1]?R.warning(c("qm.searchHelper.rangeStartTip")):(y[0]&&H(y[0],n),e[n]="[",b([e,y[1]]))),n===Bp&&(e[n]?(H(e,n),b([y[0],void 0])):e.pageIndex<L[0]?R.warning(c("qm.searchHelper.rangeEndTip")):(y[1]&&H(y[1],n),e[n]="]",b([y[0],e]))),p.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===L[0]&&(e[Wp]="["),e.pageIndex===L[1]&&(e[Bp]="]")}))}}),t.createElement(nr,{type:"primary",icon:t.createElement(Tt,null),title:c("qm.table.alert.clear"),onClick:()=>F()}))),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Ho[s]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},t.createElement(nr,{onClick:()=>o(null),style:{marginRight:8}},c("qm.dialog.cancel")),t.createElement(nr,{type:"primary",disabled:!A,onClick:()=>o(y.map((e=>(e=>{const t={};for(const n in e)[Wp,Bp].includes(n)||(t[n]=e[n]);return t})(e))))},c("qm.dialog.confirm"))))};Up.displayName="RangeTableHelper";const Gp=new Array(2).fill("");class Yp extends d{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:Gp},this.getSearchHelper=Wt((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||tr("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||tr("Form","RANGE_SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`")})),this.getDerivedSearchHelper=()=>(this.searchHelper.table&&!this.searchHelper.table.rowKey&&(this.searchHelper.table.rowKey=this.alias.valueKey),this.searchHelper),this.setItemList=e=>{this.setState({itemList:e})},this.setVisible=(e,t)=>{this.setState({visible:e},t)},this.setTextValue=e=>{this.setState({textValue:e})},this.setRecords=e=>{this._records=e},this.setViewValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;e.setViewValue(t,this.createViewText())},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;this._is_change=!1,null==t||t(e),n(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(Gp),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:n}=this.alias,r=e.map((e=>({value:e[t],text:e[n]})));this.setRecords(e),this.setItemList(r),this.setTextValue(r.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:i}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==i?void 0:i(this._records)),200)}))},this.openSearchHelper=e=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:n}=this.searchHelper,r=(null!=n?n:zn)(t.state.formData);(null==r?void 0:r.then)?r.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==r&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:Gn(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:n={}}=this.searchHelper,{beforeFetch:r=zn,formatter:i=(e=>e)}=t.fetch;return new Promise(((l,a)=>Hn(this,void 0,void 0,(function*(){var o;const s=Ie({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},n),i(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!r(s))return a();this.setState({loading:!0});const e=yield t.fetch.api(s);if(Bn((()=>this.setState({loading:!1}))),200===e.code){const n=Array.isArray(e.data)?e.data:null!==(o=ue(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return l(n)}}catch(e){this.setState({loading:!1})}a()}))))},this.resetSearchHelperValue=(e=[])=>Hn(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:n}=this.alias,r=e.filter((e=>{var r;const i=null===(r=e[n])||void 0===r?void 0:r.toString().toLowerCase();return t.some((e=>null==i?void 0:i.includes(e.toLowerCase())))}));if(2===r.length)return this.closeSearchHelper(r);this.openSearchHelper()})),this.closeButNotSelect=()=>{this._is_change&&this.clearSearchHelperValue(),this.setVisible(!1)},this.initialHandle()}get uniqueKey(){const{$$form:e}=this.context;return e.props.uniqueKey||""}get searchHelper(){return this.getSearchHelper(this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidMount(){this.getItemList()}componentDidUpdate(e){const{value:t=[]}=e,{value:n=[]}=this.props;me(t,n)||me(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:r}=this.context,{fieldName:i}=this.props.option;if(!me(r[i],this._ceho_data)&&(this._ceho_data=r[i],this.setItemList(r[i]),n.length)){const e=Gp.map(((e,t)=>{var l,a;return null!==(a=null===(l=r[i].find((e=>e.value===n[t])))||void 0===l?void 0:l.text)&&void 0!==a?a:""}));this.setTextValue(e)}}getItemList(){var e;return Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:n}=this.alias,{fetchApi:r,params:i={},formatter:l=(e=>e),dataKey:a,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:c}=this.props;if(r){if(Gn(c))return this.setRecords([]);this.setState({loading:!0});try{const o=yield r(l(Object.assign(Object.assign({},i),{keys:c})));if(200===o.code){let r=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,a))&&void 0!==e?e:[];r.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==n&&(e[n]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),r=r.filter((e=>c.includes(e[n]))).slice(0,2);const i=r.map((e=>({value:e[n],text:e[t]})));this.setRecords(r),this.setItemList(i),this.setTextValue(i.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.setViewValue()}}catch(e){}this.setState({loading:!1})}}))}createViewText(){const{textKey:e}=this.alias;return this._records.map((t=>t[e])).join(" - ")}render(){var e;const{$$form:n}=this.context;this.props;const{visible:r,loading:i,textValue:l}=this.state,{fieldName:a,options:o={},searchHelper:s={},placeholder:c=un("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,readOnly:u,disabled:p}=this.props.option,{onlySelect:m=!0}=this.searchHelper||s,h=l.every((e=>Qa(e)))?"":l.join(" - "),f={visible:r,title:un("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${a}`,loading:!1,bodyStyle:{paddingBottom:`${Ho[n.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},g=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${a}`:"",initialValue:Ie({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return n.isOnlyShow?t.createElement(Eo,{value:h,bordered:d}):t.createElement(t.Fragment,null,t.createElement(O.Group,null,t.createElement(O,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:c[0],allowClear:!1,bordered:d,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?l.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):l.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;m||(this._is_change=!0,this.setTextValue([t,l[1]]))}}),t.createElement(O,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:p,readOnly:!0}),t.createElement(O.Search,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:c[1],loading:i,bordered:d,allowClear:!0,readOnly:u,disabled:p,onBlur:e=>{var t,n;const{value:i}=e.target;this._is_change&&!r&&(i?l.every((e=>!!e))&&(null===(n=null===(t=this.searchHelper.table)||void 0===t?void 0:t.fetch)||void 0===n?void 0:n.api)&&this.getSearchHelperTableData(l).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):l.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:m||(this._is_change=!0,this.setTextValue([l[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),t.createElement(Fl,f,t.createElement(Up,g)))}}Yp.contextType=Ml;class Xp extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=ao(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,labelWidth:s=e.props.labelWidth,className:c,extra:d,buttonAfter:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(c),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Yp,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t,n,r)=>{h(t,r),e.setViewValue(a,n)}}))),u&&t.createElement(D,null,e.renderFormItemButton(a,u)),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}Xp.contextType=Ml;const Qp=e=>{const{$$form:n}=t.useContext(Ml),{value:r,items:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u}=e.option,{itemList:p=[]}=o,m=Gn(p)?i:p,h=e=>m.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return n.isOnlyShow?t.createElement(Eo,{value:h(r),bordered:c}):t.createElement(F.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u,onChange:e=>{(e=>{null==l||l(e),a(e,h(e))})(e)}},m.map((e=>t.createElement(F,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Zp extends d{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}getItemList(){var e;return Hn(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(Qp,{option:this.props.option,items:n,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Zp.contextType=Ml;const Jp=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},style:o={},allowClear:s=!0,readOnly:c,disabled:d=n.isFormDisabled}=e.option,{allowHalf:u,count:p=5,tooltips:m}=a,h=e=>m?m[Math.ceil(e)-1]:e.toString();return t.createElement(U,{value:r,count:p,style:o,allowHalf:u,allowClear:s,tooltips:m,disabled:d||n.isOnlyShow,onChange:e=>{(e=>{null==i||i(e),l(e,h(e))})(e)}})};class em extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Jp,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}em.contextType=Ml;const tm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,items:i,onChange:l,onValuesChange:a}=e,{options:o={},style:s={},bordered:c=!1,readOnly:d,disabled:u=n.isFormDisabled}=e.option,{itemList:p=[]}=o,m=Gn(p)?i:p,h=e=>{var t,n;return null!==(n=null===(t=m.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==n?n:""};return n.isOnlyShow?t.createElement(Eo,{value:h(r),bordered:c}):t.createElement(j.Group,{value:r,style:Object.assign({width:"100%"},s),disabled:u||n.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==l||l(e),a(e,h(e))})(t)}},m.map((e=>t.createElement(j,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class nm extends d{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n)try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=n.map((e=>({value:e[l],text:e[a]})));this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,validateTrigger:p,rules:m=[],onChange:h=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(m)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(tm,{option:this.props.option,items:n,onValuesChange:(t,n)=>{h(t),e.setViewValue(a,n)}}))),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}nm.contextType=Ml;const rm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{label:a,options:o={},style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{labelToSwitch:u,falseValue:p=qa,trueValue:m=$a}=o,{t:h}=Fn();return t.createElement(t.Fragment,null,t.createElement(W,{checked:r===m,style:s,disabled:d||n.isOnlyShow,checkedChildren:t.createElement($e,null),unCheckedChildren:t.createElement(it,null),onChange:e=>{(e=>{null==i||i(e),l(e,h(e===m?"am.form.trueText":"am.form.falseText"))})(e?m:p)}}),u?t.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},a):null)};class im extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option,{labelToSwitch:h}=o;return t.createElement(P.Item,{label:h?" ":e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(rm,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}im.contextType=Ml;const lm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{options:o={},style:s={},placeholder:c=a("qm.form.inputPlaceholder"),bordered:d=!0,allowClear:u,readOnly:p,disabled:m,onFocus:h,onBlur:f,onEnter:g}=e.option,{showCount:v,maxLength:y,autoSize:b}=o,x=Object.assign({},{minRows:1,maxRows:3},b);return t.createElement(O.TextArea,{value:r,placeholder:c,style:s,maxLength:y,showCount:v,autoSize:x,bordered:d,allowClear:u,readOnly:p||n.isOnlyShow,disabled:m,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{const{value:n}=t.target;(t=>{const{onBlur:n}=e;null==n||n(t)})(n),null==f||f(n,t)},onKeyUp:e=>{if(13===e.keyCode){const{value:t}=e.target;null==g||g(t,e)}},onChange:e=>{const{value:t}=e.target;(e=>{null==i||i(e),l(e)})(t)}})};class am extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(lm,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}am.contextType=Ml;const om=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.datePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:f}=e.option,{dateType:g="date",format:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=s,w=t.createRef(),C=e=>{e&&"date"===g&&(e=e.slice(0,10)+" 00:00:00"),null==i||i(e),l(e,S(e))},S=e=>Qa(e)?"":["date","exactdate"].includes(g)?e.slice(0,10):e,N=e=>{let t=Xa(m().subtract(e,"day"),Wa[g]);"date"===g&&(t=t.slice(0,10)),C(t),w.current.blur(),w.current.focus()};return n.isOnlyShow?t.createElement(Eo,{value:S(r),bordered:u}):t.createElement(In,{ref:w,style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:za[g],format:v,bordered:u,showToday:!1,showTime:"datetime"===g&&{defaultValue:m("00:00:00","HH:mm:ss")},allowClear:p,disabled:f,inputReadOnly:h,disabledDate:null!=y?y:e=>((e,[t,n])=>t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day"))(e,[b,x]),renderExtraFooter:E&&g.includes("date")?()=>"function"==typeof E?E():t.createElement(t.Fragment,null,t.createElement(G,{color:"processing",onClick:()=>N(0)},a("qm.form.datePickers")[0]),t.createElement(G,{color:"processing",onClick:()=>N(1)},a("qm.form.datePickers")[1]),t.createElement(G,{color:"processing",onClick:()=>N(7)},a("qm.form.datePickers")[2]),t.createElement(G,{color:"processing",onClick:()=>N(30)},a("qm.form.datePickers")[3])):void 0,value:Ya(r,Wa[g]),onChange:(e,t)=>{C(Xa(e,Wa[g]))}})};class sm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(om,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}sm.contextType=Ml;const cm=e=>[m().subtract(e,"day"),m()],dm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:h,disabled:f=n.isFormDisabled}=e.option,{dateType:g="date",format:v,disableds:y=[!1,!1],allowEmpty:b,disabledDate:x,minDateTime:E,maxDateTime:w,shortCuts:C=!0}=s,S={[a("qm.form.dateRangePickers")[0]]:cm(7),[a("qm.form.dateRangePickers")[1]]:cm(30),[a("qm.form.dateRangePickers")[2]]:cm(90),[a("qm.form.dateRangePickers")[3]]:cm(180)},N=e=>Qa(e)?"":e.map((e=>["date","exactdate"].includes(g)?null==e?void 0:e.slice(0,10):e)).join(" - ");return n.isOnlyShow?t.createElement(Eo,{value:N(r),bordered:u}):t.createElement(In.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,picker:za[g],format:v,bordered:u,showTime:"datetime"===g&&{defaultValue:[m("00:00:00","HH:mm:ss"),m("23:59:59","HH:mm:ss")]},allowClear:p,allowEmpty:b,disabled:f?[!0,!0]:y,inputReadOnly:h,disabledDate:null!=x?x:e=>((e,[t,n])=>t&&n?e.isBefore(t,"day")||e.isAfter(n,"day"):t?e.isBefore(t,"day"):!!n&&e.isAfter(n,"day"))(e,[E,w]),ranges:C&&g.includes("date")?S:void 0,value:Gn(r)?null:[Ya(null==r?void 0:r[0],Wa[g]),Ya(null==r?void 0:r[1],Wa[g])],onChange:(e,t)=>{(e=>{"date"===g&&(e=e.map(((e,t)=>e?0===t?e.slice(0,10)+" 00:00:00":e.slice(0,10)+" 23:59:59":e))),e.every((e=>!e))&&(e=[]),null==i||i(e),l(e,N(e))})([Xa(null==e?void 0:e[0],Wa[g]),Xa(null==e?void 0:e[1],Wa[g])])}})};class um extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(dm,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}um.contextType=Ml;const pm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.timePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=e.option,{timeType:f="hour-minute-second",hourStep:g=1,minuteStep:v=1,secondStep:y=1}=s;return n.isOnlyShow?t.createElement(Eo,{value:r,bordered:u}):t.createElement(On,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!0,hourStep:g,minuteStep:v,secondStep:y,allowClear:p,disabled:h,inputReadOnly:m,format:Ba[f],value:Ya(r,Ba[f]),onChange:(e,t)=>{(e=>{const t=Xa(e,Ba[f]);null==i||i(t),l(t)})(e)}})};class mm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(pm,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}mm.contextType=Ml;const hm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h=n.isFormDisabled}=e.option,{timeType:f="hour-minute-second",disableds:g=[!1,!1],allowEmpty:v,hourStep:y=1,minuteStep:b=1,secondStep:x=1}=s,E=e=>Qa(e)?"":e.join(" - ");return n.isOnlyShow?t.createElement(Eo,{value:E(r),bordered:u}):t.createElement(On.RangePicker,{style:Object.assign({width:"100%"},c),popupClassName:`form-popper__${o}`,bordered:u,showNow:!1,hourStep:y,minuteStep:b,secondStep:x,allowClear:p,allowEmpty:v,disabled:h?[!0,!0]:g,inputReadOnly:m,format:Ba[f],value:Gn(r)?null:[Ya(null==r?void 0:r[0],Ba[f]),Ya(null==r?void 0:r[1],Ba[f])],onChange:(e,t)=>{(e=>{const t=[Xa(null==e?void 0:e[0],Ba[f]),Xa(null==e?void 0:e[1],Ba[f])];null==i||i(t),l(t,E(t))})(e)}})};class fm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(hm,{option:this.props.option,onValuesChange:(t,n)=>{m(t),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}fm.contextType=Ml;class gm extends d{constructor(e){super(e),this.searchRef=t.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=Wt(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.paramsChangeHandler=(e,t)=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting(),me(e,t)||this.getItemList()})),this.echoSearchHelper=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.initialHandle=()=>Hn(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:n}=this.props.option,{fieldAliasMap:r,fieldsDefine:i,echoRequest:l}=this.searchHelper;if(r||tr("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),i){const e=["valueKey","displayKey","extraKey"];for(const t in i)e.includes(t)&&(this[t]=i[t])}Object.keys(this.alias).includes(e)||tr("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),l&&!this.valueKey&&tr("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!n&&tr("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getItemText=()=>Hn(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:n={},formatter:r=(e=>e),dataKey:i,callback:l,triggeredChange:a,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},c="function"==typeof o?o():o||{},d="function"==typeof s?s():s||{},u=this.getItemValue();if(t&&!Gn(u))try{const o=yield t(r(Object.assign(Object.assign({},n),{key:u})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=ue(o.data,i))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(c&&Ja(e,this.alias,c),d&&eo(e,this.extras,d),this._record=e,this.setFieldsValue(e),a){const t=Za(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==l||l([e])}}}catch(e){}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:n}=this.props.option;this._record=e;for(const r in this.alias){const i=Za(e,this.alias[r]);t.SET_FIELDS_VALUE({[r]:i}),r===this.valueKey&&(this._prevValue=i),r===n&&t.setViewValue(n,i)}for(const n in this.extras)t.SET_FIELDS_EXTRA({[n]:Za(e,this.extras[n])})},this.fetchHandle=Le(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:n}=this.context,{fieldName:r}=this.props.option;for(const t in this.alias){if(t===r)continue;const i=Za(e,this.alias[t]);n.SET_FIELDS_VALUE({[t]:i}),t===this.valueKey&&(this._prevValue=e?i:null)}for(const t in this.extras)n.SET_FIELDS_EXTRA({[t]:Za(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const i=Za(e,this.alias[r]);this.triggerChange(i),this.setState({inputText:void 0}),t&&t()},this.initialHandle()}get searchHelper(){return this.getSearchHelper(this.props.option.options,this.props.option.searchHelper)}get alias(){const{fieldAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}get extras(){const{extraAliasMap:e}=this.searchHelper;return"function"==typeof e?e():e||{}}componentDidUpdate(e){var t,n,r,i,l,a;const o=(null===(n=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===n?void 0:n.params)||(null===(r=e.option.request)||void 0===r?void 0:r.params),s=(null===(l=null===(i=this.props.option.searchHelper)||void 0===i?void 0:i.request)||void 0===l?void 0:l.params)||(null===(a=this.props.option.request)||void 0===a?void 0:a.params);this.paramsChangeHandler(s,o),this.echoSearchHelper()}getItemList(e){var t;return Hn(this,void 0,void 0,(function*(){const{fieldName:n}=this.props.option,{fetchApi:r,params:i={},formatter:l=(e=>e),dataKey:a}=this.searchHelper.request||this.props.option.request||{};if(r){this.setState({loading:!0});try{const o=yield r(l(Object.assign(Object.assign({},i),{[n]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=ue(o.data,a))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:n,loading:r,itemList:i,inputText:l}=this.state,{value:a}=this.props,{fieldName:o,options:s={},style:c={},placeholder:d=un("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:p=!0,readOnly:m,disabled:h}=this.props.option,{listHeight:f=ja}=s,{hideHeader:g,onlySelect:v=!0}=this.searchHelper||s,y=this.searchHelper.columns||[],b=lr("form-immediate"),x=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,E=t.createElement(T,{spinning:r},i.length?t.createElement("table",{cellSpacing:0,cellPadding:0,className:Pe("table")},!g&&t.createElement("thead",null,t.createElement("tr",null,y.filter((e=>!e.hidden)).map((e=>t.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),t.createElement("tbody",null,i.map(((e,n)=>t.createElement("tr",{key:n,className:this.state.activeIndex===n?"active":"",onMouseEnter:()=>{this.setState({activeIndex:n})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},y.filter((e=>!e.hidden)).map((n=>t.createElement("td",{key:n.dataIndex},ue(e,n.dataIndex))))))))):t.createElement(tl,null));return t.createElement(on.Consumer,null,(r=>{const s={[b]:!0,[`${b}--lg`]:"large"===(null==r?void 0:r.size),[`${b}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(Eo,{value:a,bordered:u}):t.createElement(nd,{action:h?[]:["click"],popupVisible:!h&&n,popup:E,popupClassName:Pe(s,`form-popper__${o}`),popupStyle:{minWidth:x,maxHeight:f},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Va,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:d,allowClear:p,bordered:u,readOnly:m,disabled:h,style:Object.assign({width:"100%"},c),value:null!=l?l:a,title:a,onFocus:()=>{!i.length&&this.fetchHandle(a)},onBlur:e=>{v&&!this._clicking&&l!==a&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(i[this.state.activeIndex],(()=>this.handleVisibleChange(!1))),38===e.keyCode||40===e.keyCode){if(!this.state.visible)return this.handleVisibleChange(!0);let t=this.state.activeIndex;const n=40===e.keyCode?++t%i.length:(--t+i.length)%i.length;this.setState({activeIndex:n})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),v?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}gm.contextType=Ml;class vm extends d{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Hn(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){er("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,n;const{global:r}=e,{name:i,fieldsDefine:l}=this.props.option.searchHelper||{};if(!i)return;if(!(null===(t=null==r?void 0:r.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(n=null==r?void 0:r.searchHelper)||void 0===n?void 0:n.createFetchApi))return tr("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:a}=this.props.option;this.promiseRef=new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){try{const n=yield r.searchHelper.getServerConfig({searchHelperId:i});if(200===n.code){const t=ao(Object.assign({},n.data,l),a,r.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:n}=this.state,{type:r,label:i,tooltip:l,fieldName:a,invisible:o,options:s={},labelWidth:c=e.props.labelWidth,className:d,extra:u,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(i),className:Pe(d),tooltip:l,hidden:o,labelCol:{flex:e.verticalLayout?"initial":Zn(c)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:a,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(i)}},t.createElement(gm,{option:this.props.option,helperConfig:n,waiting:this.waiting,onValuesChange:(t="",n)=>{f(t,n),e.setViewValue(a,t)}}))),p&&t.createElement(D,null,e.renderFormItemButton(a,p)),u&&t.createElement(D,{flex:Zn(u.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}vm.contextType=Ml;class ym extends d{render(){var e;const{$$form:n}=this.context,{type:r,label:i,fieldName:l,className:a,style:o={},collapse:s={}}=this.props.option,{expand:c}=n.state,{showLimit:d,remarkItems:u=[],onCollapse:p=Vn}=s,m=[];if(u.length){const t=null!==(e=n.getBlockDerivedItems().find((e=>e[0].fieldName===l)))&&void 0!==e?e:[],r=null!=d?d:t.length-1;t.slice(r+1).forEach((e=>{var t;const r=u.find((t=>t.fieldName===e.fieldName));if(!r)return;const i=r.showLabel?`${e.label}:`:"",l=null!==(t=n.getViewValue(e.fieldName))&&void 0!==t?t:"";""!==l&&m.push(Object.assign(Object.assign({},e),{text:`${i}${l}`}))}))}return t.createElement(P.Item,{labelCol:{span:0},wrapperCol:{span:24}},t.createElement(ar,{id:l,label:i,className:a,extra:m.map((e=>e.text)).join(" | "),style:Object.assign({},o),collapse:c[l],onCollapseChange:e=>{n.setState((t=>({expand:Object.assign({},t.expand,{[l]:e})}))),p(e)}}))}}ym.contextType=Ml;const bm=(e,t,n,r)=>e.map((e=>e[n]===t?Object.assign(Object.assign({},e),{children:r}):e.children?Object.assign(Object.assign({},e),{children:bm(e.children,t,n,r)}):e)),xm=e=>{var n;const{$$form:r}=t.useContext(Ml),{value:i,items:l,multiple:a,loading:o,onChange:s,onValuesChange:c}=e,{t:d}=Fn(),{fieldName:u,options:p={},style:m={},placeholder:h=d("qm.form.selectPlaceholder"),bordered:f=!0,allowClear:g=!0,asyncLoad:v,readOnly:y,disabled:b}=e.option,{itemList:x,filterable:E=!0,listHeight:w=ja,checkStrictly:C,checkStrategy:S="SHOW_CHILD",collapseTags:N,echoRequest:T,defaultExpandAll:I=!v,defaultExpandedKeys:R,dropdownStyle:O,openPyt:k=!0}=p,[L,A]=t.useState(Gn(x)?l:x),[P,_]=t.useState([]),[D,H]=t.useState(!1),[F,M]=t.useState(!1),$=t.useRef(null),q=t.useRef(null),j=t.useRef(L),K=t.useRef(F),V=t.useRef(null),z=e=>{M(e),K.current=e};bu({ref:q,handler:()=>z(!1)}),t.useEffect((()=>{i!==V.current&&(U(),V.current=i),(()=>{var e;q.current=(null===(e=$.current)||void 0===e?void 0:e.querySelector(".ant-select-selection-overflow-item-rest"))||null})()}),[i]),Mi((()=>{const e=Gn(x)?l:x;v?me(e,j.current)||(A((t=>[...e,...t.filter((e=>!!e.style))])),j.current=e):A(e)}),[x,l]),Mi((()=>{A((e=>[...e,...P.filter((t=>!e.some((e=>e.value===t.value))))]))}),[P]);const W=e=>{var t;return(null===(t=no(L,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},B=e=>(C&&Array.isArray(i)&&i.every((e=>ae(e)))&&(e=e.map((e=>e.value))),a?(null==e?void 0:e.map((e=>W(e))).join(","))||"":W(e)),U=()=>Hn(void 0,void 0,void 0,(function*(){var e;if(!T)return;if(!v)return tr("Form","TREE_SELECT 的 echoRequest 选项必须组合 `asyncLoad` 一起使用");const{fetchApi:t,params:n,dataKey:r,callback:l,formatter:a=(e=>e)}=T||{},{textKey:o="text",valueKey:s="value"}=v;if(t&&!Gn(i))try{const c=yield t(a(Object.assign(Object.assign({},n),{[s]:i})));if(200===c.code){const t=Array.isArray(c.data)?c.data:null!==(e=ue(c.data,r))&&void 0!==e?e:[];if(t.length){const e=to(t,s,o);_(e.map((e=>Object.assign(Object.assign({},e),{style:{display:"none"}})))),null==l||l(t)}}}catch(e){}}));return r.isOnlyShow?t.createElement(Eo,{value:B(i),bordered:f}):t.createElement(nd,{popupVisible:!b&&F,popup:(()=>{if(!a)return null;const e=(null==i?void 0:i.map((e=>W(e))))||[];return t.createElement("ul",{className:"ant-dropdown-menu"},e.length?e.map(((e,n)=>t.createElement("li",{key:`${e}-${n}`,className:"ant-dropdown-menu-item"},e))):t.createElement("li",{className:"ant-dropdown-menu-item"},d("qm.table.config.emptyText")))})(),popupStyle:{minWidth:null===(n=$.current)||void 0===n?void 0:n.offsetWidth},onPopupVisibleChange:e=>z(e),builtinPlacements:Va,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",{ref:$,style:{width:"100%"}},t.createElement(Y,Rn({open:D,fieldNames:{label:"text",value:"value",children:"children"},value:i,multiple:a,treeCheckable:a,treeCheckStrictly:C,showCheckedStrategy:Y[S],popupClassName:`form-popper__${u}`,dropdownStyle:O,placeholder:h,listHeight:w,style:m,loading:o,bordered:f,allowClear:g,disabled:b,treeDefaultExpandAll:I,treeDefaultExpandedKeys:R,showSearch:E,maxTagCount:N?"responsive":void 0,loadData:v?({key:e,children:t})=>Hn(void 0,void 0,void 0,(function*(){var n;if(!v||t)return;const{fetchApi:r,params:i,dataKey:l,textKey:a="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=v;if(r)try{const t=yield r(c(Object.assign(Object.assign({},i),{[o]:e})));if(200===t.code){const r=Array.isArray(t.data)?t.data:null!==(n=ue(t.data,l))&&void 0!==n?n:[],i=bm(L,e,o,to(r,o,a));A(i),null==s||s(r)}}catch(e){}})):void 0,treeData:L},a?{title:B(i)}:null,{filterTreeNode:(e,t)=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=bo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(k?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0},onMouseDown:e=>{e.target.classList.contains("ant-select-selection-overflow-item-rest")&&(z(!0),H(!1))},onDropdownVisibleChange:e=>{if(!e)return H(e);Bn((()=>{K.current||H(e)}))},onChange:e=>{(e=>{null==s||s(e),c(e,B(e),L)})(e),V.current=e}}))))};class Em extends d{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=to(n,l,a);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:n,loading:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(l),className:Pe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Zn(d)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(xm,{option:this.props.option,items:n,loading:r,multiple:this.props.multiple,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Zn(p.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Em.contextType=Ml;const wm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,multiple:i,items:l}=e,{t:a}=Fn(),{fieldName:o,options:s={},style:c={},placeholder:d=a("qm.form.selectPlaceholder"),bordered:u=!0,allowClear:p=!0,asyncLoad:m,readOnly:h,disabled:f}=e.option,{itemList:g,changeOnSelect:v,checkStrictly:y,checkStrategy:b="SHOW_PARENT",filterable:x=!0,dropdownStyle:E,openPyt:w=!0}=s,[C,S]=t.useState(Gn(g)?l:g),N=t.useRef(C);Mi((()=>{const e=Gn(g)?l:g;m?me(e,N.current)||(S(e),N.current=e):S(e)}),[g,l]);const T=e=>ro(C,null!=e?e:"").map((e=>e.text)).join("/"),I=e=>i?(null==e?void 0:e.map((e=>T(e))).join(","))||"":T(e);return n.isOnlyShow?t.createElement(Eo,{value:I(r),bordered:u}):t.createElement(X,Rn({value:(e=>Gn(e)?[]:i?e.map((e=>e.split(","))):e.split(","))(r),fieldNames:{label:"text",value:"value",children:"children"},options:C,multiple:i,maxTagCount:"responsive",changeOnSelect:v||y,showCheckedStrategy:X[b],popupClassName:`form-popper__${o}`,dropdownStyle:E,placeholder:d,style:c,bordered:u,allowClear:p,disabled:f,showSearch:x&&!m&&{filter:(e,t)=>t.some((t=>{var n;const r=(null===(n=null==t?void 0:t.text)||void 0===n?void 0:n.toString())||"",i=bo.parse(r).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(w?`${r}|${i}`:r).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:m?e=>Hn(void 0,void 0,void 0,(function*(){var t;const n=e[e.length-1];if(!m||n.children)return;const{fetchApi:r,params:i,dataKey:l,textKey:a="text",valueKey:o="value",callback:s,formatter:c=(e=>e)}=m;if(r)try{const e=yield r(c(Object.assign(Object.assign({},i),{[o]:n.value})));if(200===e.code){const r=Array.isArray(e.data)?e.data:null!==(t=ue(e.data,l))&&void 0!==t?t:[],i=bm(C,n.value,o,to(r,o,a));S(i),null==s||s(r)}}catch(e){}})):void 0},i?{title:I(r)}:null,{onChange:t=>{(t=>{const{onChange:n,onValuesChange:r}=e;null==n||n(t),r(t,I(t),C)})(((e=[])=>i?e.map((e=>e.join(","))):e.join(","))(t))}}))};class Cm extends d{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Hn(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:n,params:r={},dataKey:i,valueKey:l="value",textKey:a="text",callback:o}=t;if(n){this.setState({loading:!0});try{const t=yield n(r);if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(e=ue(t.data,i))&&void 0!==e?e:[],r=to(n,l,a);this.setState({itemList:r},(()=>null==o?void 0:o(n)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,n;const r=null===(t=e.option.request)||void 0===t?void 0:t.params,i=null===(n=this.props.option.request)||void 0===n?void 0:n.params;me(r,i)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:n}=this.props,{itemList:r}=this.state,{type:i,label:l,tooltip:a,fieldName:o,invisible:s,options:c={},labelWidth:d=e.props.labelWidth,className:u,extra:p,validateTrigger:m,rules:h=[],onChange:f=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(l),className:Pe(u),tooltip:a,hidden:s,labelCol:{flex:e.verticalLayout?"initial":Zn(d)},required:e.getFormItemRequired(h)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:o,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(l)}},t.createElement(wm,{option:this.props.option,multiple:n,items:r,onValuesChange:(t,n,r)=>{f(t,n,r),e.setViewValue(o,n)}}))),p&&t.createElement(D,{flex:Zn(p.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:o},p)))))}}Cm.contextType=Ml;const Sm=["110000","120000","310000","500000"],Nm=["810000","820000"],Tm=[{text:"A",value:"A"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"L",value:"L"},{text:"N",value:"N"},{text:"Q",value:"Q"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Im=[{text:"A",value:"A"},{text:"B",value:"B"},{text:"C",value:"C"},{text:"D",value:"D"},{text:"E",value:"E"},{text:"F",value:"F"},{text:"G",value:"G"},{text:"H",value:"H"},{text:"J",value:"J"},{text:"K",value:"K"},{text:"L",value:"L"},{text:"M",value:"M"},{text:"N",value:"N"},{text:"P",value:"P"},{text:"Q",value:"Q"},{text:"R",value:"R"},{text:"S",value:"S"},{text:"T",value:"T"},{text:"W",value:"W"},{text:"X",value:"X"},{text:"Y",value:"Y"},{text:"Z",value:"Z"},{text:"直辖市",value:"Z1"},{text:"港澳",value:"Z2"}],Rm=e=>bo.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Om=(e,t,n=1)=>{if(n>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Sm,...Nm].includes(e))):Object.keys(e[t])).map((r=>({l:Rm(e[t][r].slice(0,1)).toUpperCase(),n:e[t][r],c:r,p:t,children:Om(e,r,n+1)})))},km=(e,t)=>t.map((t=>({l:Rm(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Lm extends d{constructor(e){super(e),this.searchRef=t.createRef(),this.scrollRef=t.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)},this.zxsAndGa=this.createZxsAndGa(),this.provinces=this.createProvince(),this.allCities=this.createAllCity(),this.letterCities=this.createCity()}componentDidMount(){this.setInputReadonly()}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}scrollHandle(e){this.setState({active_key:e}),Vt(this[`${e}Ref`],{block:"start",behavior:"smooth",boundary:this.scrollRef.current})}clickHadnle(e){this.triggerChange(e)}createTextValue(e){var t;return(null===(t=this.allCities.find((t=>t.c===e)))||void 0===t?void 0:t.n)||""}createZxsAndGa(){return[{l:"Z1",n:"直辖市",c:"",p:"",children:km(rn,Sm)},{l:"Z2",n:"港澳",c:"",p:"",children:km(rn,Nm)}]}createProvince(){var e;return(null!==(e=Om(rn,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return Im.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Sm,...Nm].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return t.createElement(j.Group,{size:"small",buttonStyle:"solid",value:e,onChange:e=>{const{value:t}=e.target;this.setState({select_type:t,active_key:""},(()=>{this.scrollRef.current.scrollTop=0}))}},t.createElement(j.Button,{value:"0"},un("qm.form.citySelectType.0")),t.createElement(j.Button,{value:"1"},un("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:n}=this.state;return("0"===n?Tm:Im).map((n=>t.createElement("li",{key:n.value,className:Pe({tag:!0,actived:n.value===e}),onClick:()=>this.scrollHandle(n.value.toString())},n.text)))}renderSelect(){const{value:e}=this.props;return t.createElement(H,{size:"small",placeholder:un("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var n;return((null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>t.createElement(H.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:n}=this.state;return("0"===n?this.provinces:this.letterCities).map(((n,r)=>{var i;return t.createElement("div",{key:r},t.createElement("dt",{ref:e=>this[`${n.l}Ref`]=e},n.n,":"),t.createElement("dd",null,null===(i=n.children)||void 0===i?void 0:i.map((n=>t.createElement("li",{key:n.c,className:Pe({actived:n.c===e}),onClick:()=>this.clickHadnle(n.c)},n.n)))))}))}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:l={},style:a={},placeholder:o=un("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=lr("form-city-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=this.createTextValue(r),f=t.createElement("div",{className:"container",style:Object.assign({},a)},t.createElement("div",{className:"city-drop"},t.createElement("div",{className:"city-drop-toper"},t.createElement("div",{className:"city-drop-toper__type"},this.renderType()),t.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),t.createElement("div",{className:"city-drop-letter"},this.renderLetter()),t.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},t.createElement("dl",null,this.renderCity(r)))));return t.createElement(on.Consumer,null,(r=>{const l={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(Eo,{value:h,bordered:s}):t.createElement(nd,{action:u?[]:["click"],popupVisible:!u&&n,popup:f,popupClassName:Pe(l,`form-popper__${i}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Va,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,readOnly:d,disabled:u,style:Object.assign({width:"100%"},a),value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}Lm.contextType=Ml;class Am extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Lm,{option:this.props.option,onValuesChange:(t,n)=>{m(t,n),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Am.contextType=Ml;const Pm=(e,t)=>{if(e[t])return Object.keys(e[t]).map((n=>({text:e[t][n],value:n,children:Pm(e,n)})))};class _m extends d{constructor(e){super(e),this.searchRef=t.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:n}=this.props;null==t||t(e),n(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const n=Pm(rn,"86")||[];this.state={results:n,visible:!1,values:[],tabs:[n.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:n}=this.props;t!==n&&this.state.values.join(",")!==(null!=n?n:"")&&this.initial()}get isFetch(){var e;return!!(null===(e=this.props.option.request)||void 0===e?void 0:e.fetchApi)}get level(){let{selectLevel:e=0}=this.props.option.options||{};return(e<1||e>3)&&(e=3),this.isFetch?4:e}setInputReadonly(){var e;null===(e=this.searchRef.current)||void 0===e||e.input.setAttribute("readonly","readonly")}createTextValue(e){return(e?e.split(","):[]).map(((e,t)=>{var n,r;return null===(r=null===(n=this.state.tabs[t])||void 0===n?void 0:n.find((t=>t.value===e)))||void 0===r?void 0:r.text})).join("/")}initial(){const{value:e}=this.props,t=e?e.split(","):[];this.setState({values:t},(()=>{this.createTabs(),this.createActiveName(t.length?t.length-1:0)}))}createActiveName(e){this.setState({activeName:e.toString()})}createTabs(){const{results:e,values:t}=this.state;if(!e.length)return;const n=this.state.tabs.slice(0,1);for(let r=0;r<t.length;r++){const i=no(e,t[r]);if(i&&Gn(i.children)){this.isFetch&&this.getStreetList(t[r]);break}Array.isArray(null==i?void 0:i.children)&&(n[r+1]=null==i?void 0:i.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:n})}getStreetList(e){var t;return Hn(this,void 0,void 0,(function*(){const{request:n={}}=this.props.option,{fetchApi:r,formatter:i=(e=>e),dataKey:l,valueKey:a="value",textKey:o="text"}=n;if(r)try{const n=yield r(i({code:e}));if(200===n.code){const e=Array.isArray(n.data)?n.data:null!==(t=ue(n.data,l))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[a]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,n=this.state.tabs.map(((n,r)=>{var i;const l=(null===(i=n.find((t=>t.value===e[r])))||void 0===i?void 0:i.text)||`${un("qm.form.selectPlaceholder").replace("...","")}(${un("qm.form.regionSelectLabel")[r]})`;return t.createElement(Pl.TabPane,{key:r.toString(),tab:l},t.createElement("div",{className:"region-box"},n.map((n=>t.createElement("span",{key:n.value,className:Pe({"region-box__item":!0,actived:e.includes(n.value.toString())}),title:n.text,onClick:()=>{let{values:e}=this.state;e[r]=n.value.toString(),e=e.slice(0,r+1),this.setState({values:e},(()=>{const t=(e=>["810000","820000"].includes(e[0]))(e)?this.level<3?this.level:this.level-1:this.level;if(r+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(r+1)}))}},n.text)))))}));return n.length?t.createElement(Pl,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},n):t.createElement(tl,null)}render(){const{$$form:e}=this.context,{visible:n}=this.state,{value:r}=this.props,{fieldName:i,options:l={},style:a={},placeholder:o=un("qm.form.selectPlaceholder"),bordered:s=!0,allowClear:c=!0,readOnly:d,disabled:u}=this.props.option,p=lr("form-region-select"),m=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,h=t.createElement("div",{className:"container"},this.renderTabs());let f=this.prevText;if(!n){const e=this.createTextValue(r);(""===e||e.split("/").every((e=>""!==e)))&&(f=e,this.prevText=f)}return t.createElement(on.Consumer,null,(r=>{const l={[p]:!0,[`${p}--lg`]:"large"===(null==r?void 0:r.size),[`${p}--sm`]:"small"===(null==r?void 0:r.size)};return e.isOnlyShow?t.createElement(Eo,{value:f,bordered:s}):t.createElement(nd,{action:u?[]:["click"],popupVisible:!u&&n,popup:h,popupClassName:Pe(l,`form-popper__${i}`),popupStyle:{minWidth:m},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:Va,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},t.createElement("div",null,t.createElement(O,{ref:this.searchRef,placeholder:o,allowClear:c,bordered:s,style:Object.assign({width:"100%"},a),readOnly:d,disabled:u,value:f,title:f,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&Bn((()=>this.initial()))}})))}))}}_m.contextType=Ml;class Dm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(_m,{option:this.props.option,onValuesChange:(t,n)=>{m(t,n),e.setViewValue(l,n)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Dm.contextType=Ml;const Hm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fileTypes:p,fileSize:m,draggable:h,editable:f,batchDownload:g,fileDirection:v,onPreview:y,onDownload:b,onRemove:x,onSortChange:E,onEditChange:w}=a,{action:C,headers:S,params:N,withCredentials:T=!1,dataKey:I="",downloadWithHeaders:O,fieldAliasMap:k,beforeUpload:L,button:A}=o,P="function"==typeof k?k():k||{},{t:_}=Fn();return t.createElement(Tl,{name:"file",action:C,multiple:d,headers:S,data:N,withCredentials:T,downloadWithHeaders:O,beforeUpload:L,maxCount:u,fileTypes:p,fileSize:m,draggable:h,editable:f,batchDownload:g,fileDirection:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,button:A,showUploadList:{showDownloadIcon:!0,downloadIcon:t.createElement(je,null)},fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in P)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[P[i]])||"";return e.response&&200!==n.code&&R.error(n.message||_("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(I?ue(n.data,I):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&l(t)})(e)},onPreview:y,onDownload:b,onRemove:x,onSortChange:E,onEditChange:w})};class Fm extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(Hm,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,"")}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Fm.contextType=Ml;const Mm=t.forwardRef(((e,n)=>{const r=pn({src:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0},e),{className:i,style:l,src:a,alt:o,imgStyle:s}=r,c=_n(r,["className","style","src","alt","imgStyle"]),d=t.useRef(null),u=t.useRef(null);t.useEffect((()=>{const e={};for(const t in c)void 0!==r[t]&&(e[t]=r[t]);return u.current=new ln(d.current,e),()=>{y(),u.current=null}}),[]);const p=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.reset()},m=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.clear()},h=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.crop()},f=(e,t=!1)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.replace(e,t)},g=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.enable()},v=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.disable()},y=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.destroy()},b=(e,t)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.move(e,t)},x=(e,t=e)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.moveTo(e,t)},E=(e,t)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.zoom(e)},w=(e,t)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.zoomTo(e,t)},C=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotate(e)},S=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotateTo(e)},N=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleX(e)},T=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleY(e)},I=(e,t=e)=>{var n;return null===(n=u.current)||void 0===n?void 0:n.scale(e,t)},R=(e=!1)=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getData(e)},O=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setData(e)},k=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getContainerData()},L=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getImageData()},A=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCanvasData()},P=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCanvasData(e)},_=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getCropBoxData()},D=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setCropBoxData(e)},H=(e={})=>{var t;return null===(t=u.current)||void 0===t?void 0:t.getCroppedCanvas(e)},F=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setAspectRatio(e)},M=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setDragMode(e)};t.useImperativeHandle(n,(()=>({reset:p,clear:m,initCrop:h,replace:f,enable:g,disable:v,destroy:y,move:b,moveTo:x,relativeZoom:E,zoomTo:w,rotate:C,rotateTo:S,scaleX:N,scaleY:T,scale:I,getData:R,setData:O,getContainerData:k,getImageData:L,getCanvasData:A,setCanvasData:P,getCropBoxData:_,setCropBoxData:D,getCroppedCanvas:H,setAspectRatio:F,setDragMode:M})));const $={[lr("cropper")]:!0};return t.createElement("div",{className:Pe($,i),style:l},t.createElement("img",{ref:d,src:a,alt:o,style:Object.assign({maxWidth:"100%"},s)}))}));Mm.displayName="Cropper";const $m=e=>{const{fileTypes:n=[],fileSize:r,fixedSize:i,quality:l,beforeCrop:a,className:o}=e,{t:s}=Fn(),c=t.useRef(null),d=t.useRef(),u=t.useRef(),p=t.useRef(),m=t.useRef(),[h,f]=t.useState(""),g=e=>{c.current.relativeZoom(e)},v=e=>{c.current.rotate(e)},y=()=>{f("")},b=lr("cropper-preview");return t.createElement(t.Fragment,null,(()=>{const n=Array.isArray(e.children)?e.children[0]:e.children;if(!n)return null;const r=n.props,{beforeUpload:i}=r,l=_n(r,["beforeUpload"]);return d.current=i,t.createElement(n.type,Object.assign(Object.assign({},l),{beforeUpload:(e,t)=>new Promise(((n,r)=>Hn(void 0,void 0,void 0,(function*(){const r=()=>n(I.LIST_IGNORE);if(a&&!(yield a(e,t)))return void r();u.current=e,p.current=n,m.current=r;const i=new FileReader;i.onload=()=>{f(i.result),i.onload=null},i.readAsDataURL(e)}))))}))})(),h&&t.createElement(A,{open:!0,wrapClassName:Pe(b,o),title:s("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{Hn(void 0,void 0,void 0,(function*(){const{type:e,name:t,uid:r}=u.current;c.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((i=>Hn(void 0,void 0,void 0,(function*(){let l=new File([i],t,{type:e});if(Object.assign(l,{uid:r}),n.length&&!n.includes(l.name.slice(l.name.lastIndexOf(".")+1).toLowerCase()))return R.warning(s("qm.upload.tooltip",{type:n.join(",")})),m.current("file type is error");if("function"!=typeof d.current)return p.current(l);const a=d.current(l,[l]);if("boolean"==typeof a||a){if(!0===a)return p.current(l);if(!1===a)return m.current("not upload");if(a&&"function"==typeof a.then)try{const e=yield a,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(l=e),p.current(l)}catch(e){m.current(e)}}else tr("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,l),yield Wn(100),y()}))},onCancel:y,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:i?`calc(380px * ${i[1]/i[0]})`:"auto"};return t.createElement("div",{className:"cropper-preview"},t.createElement("div",{className:"cropper-area"},t.createElement("div",{className:"img-cropper"},t.createElement(Mm,{ref:c,aspectRatio:i?i[0]/i[1]:i,src:h,dragMode:"move",preview:".preview"})),t.createElement("div",{className:"actions"},t.createElement(S,{size:"small"},t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(It,null),onClick:()=>g(.2)},s("qm.uploadCropper.zoomIn")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Rt,null),onClick:()=>g(-.2)},s("qm.uploadCropper.zoomOut")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(Ot,null),onClick:()=>v(90)},s("qm.uploadCropper.rotatePlus")),t.createElement(E,{type:"primary",size:"middle",icon:t.createElement(kt,null),onClick:()=>v(-90)},s("qm.uploadCropper.rotateSubtract"))))),t.createElement("div",{className:"preview-area"},t.createElement("div",{className:"preview",style:e})))})()))},qm=e=>{const n=pn({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:r=[],openCropper:i=!0,fixedSize:l,quality:a=1,fileTypes:o,fileSize:s,maxCount:c,draggable:d,disabled:u,readOnly:p,className:m,popupClassName:h,beforeCrop:f,onSortChange:g,onChange:v}=n,{t:y}=Fn(),{$size:b}=$n(n),x=t.useRef(null),E=t.useRef(null),w=t.useRef(!1),[C,S]=t.useState(!1),[N,T]=t.useState(0),O=t.useMemo((()=>u||p),[u,p]),k=t.useMemo((()=>!c||r.length<c),[r,c]);t.useEffect((()=>(A(),document.addEventListener("paste",_),()=>{var e;null===(e=E.current)||void 0===e||e.destroy(),document.removeEventListener("paste",_)})),[]),Mi((()=>{k||(w.current=!1)}),[r]);const L=Mn((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...r],[i]=e.splice(t,1);e.splice(n,0,i),null==g||g(e),null==v||v({file:r[t],fileList:e})}})),A=()=>{d&&(E.current=jt.create(Ui(x.current,lr("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:L}))},P=(e,t)=>new Promise(((r,i)=>Hn(void 0,void 0,void 0,(function*(){const{fileTypes:l=[],fileSize:a,beforeUpload:o}=n,s=!l.length||l.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),c=!a||e.size/1024/1024<a,d=s&&c;if(s||R.warning(y("qm.upload.tooltip",{type:l.join(",")})),c||R.warning(y("qm.upload.sizeLimit",{size:a})),!d)return I.LIST_IGNORE;if(o){const n=o(e,t);if(!0===n)return r(e);if(!1===n)return i("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;r(e)}catch(e){i(e)}}else r(e)})))),_=Mn((e=>Hn(void 0,void 0,void 0,(function*(){const{action:t,data:i,headers:l}=n;if(w.current&&k&&t)for(const n of e.clipboardData.items)if("file"===n.kind&&n.type.startsWith("image/")){const e=n.getAsFile(),a=Date.now(),o=new File([e],`screenshot-${a}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${a}`});try{yield P(o,[...r,o]);const e=new FormData;if(e.append("file",o),i)for(const t in i)e.append(t,i[t]);const n="string"==typeof t?t:yield t(o),a=yield fetch(n,{method:"POST",body:e,headers:l});if(!a.ok)throw new Error(y("qm.upload.uploadError"));const s=yield a.json();null==v||v({file:o,fileList:[...r,{uid:o.uid,lastModified:o.lastModified,lastModifiedDate:o.lastModifiedDate,name:o.name,type:o.type,size:o.size,response:s,status:"done",percent:100,originFileObj:o}]})}catch(e){}}})))),D=lr("upload-img"),H={[D]:!0,[`${D}--lg`]:"large"===b,[`${D}--sm`]:"small"===b},F=t.createElement(I,Rn({className:Pe(H,m)},Xn(n,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=r.findIndex((t=>t.url===e.url));t<0||(T(t),S(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,n,r,i)=>t.createElement("div",{className:Pe("upload-item",{handle:d})},e,!O&&t.createElement(it,{title:y("qm.upload.remove"),className:"icon",onClick:()=>i.remove()}))}),t.createElement("span",{className:"inner",ref:x},k&&!(p&&r.length)&&t.createElement(t.Fragment,null,t.createElement("p",{className:"ant-upload-drag-icon"},t.createElement(Lt,null)),t.createElement("p",{className:"ant-upload-text"},y("qm.uploadCropper.dragableText")),t.createElement("button",{className:Pe("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{w.current=!0},onBlur:()=>{w.current=!1}},y("qm.uploadCropper.pasteText")))));return t.createElement(t.Fragment,null,i?t.createElement($m,{className:h,fixedSize:l,quality:a,fileTypes:o,fileSize:s,beforeCrop:f},F):F,t.createElement("div",{style:{display:"none"}},t.createElement(Q.PreviewGroup,{key:r.map((e=>e.uid||"")).join(","),preview:{visible:C,current:N,rootClassName:h,onVisibleChange:e=>S(e)}},r.map(((e,n)=>t.createElement(Q,{key:e.uid||n,src:e.url,alt:""}))))))};qm.displayName="QmUploadImg";const jm=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o={},disabled:s,readOnly:c}=e.option,{multiple:d=!0,maxCount:u=1,fixedSize:p,quality:m,openCropper:h,fileTypes:f,fileSize:g,draggable:v,onRemove:y,onSortChange:b}=a,{action:x,headers:E,params:w,withCredentials:C=!1,dataKey:S="",popupClassName:N,fieldAliasMap:T,beforeUpload:I}=o,O="function"==typeof T?T():T||{},{t:k}=Fn();return t.createElement(qm,{name:"file",action:x,multiple:d,headers:E,data:w,withCredentials:C,popupClassName:N,beforeUpload:I,maxCount:u,fixedSize:p,quality:m,openCropper:h,fileTypes:f,fileSize:g,draggable:v,disabled:s||n.props.disabled,readOnly:n.isOnlyShow||c,fileList:r,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const n=e.response||{},r={};for(const i in O)r[i]=e[i]||(null===(t=n.data)||void 0===t?void 0:t[O[i]])||"";return e.response&&200!==n.code&&R.error(n.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},r),{url:e.url||(S?ue(n.data,S):n.data)||"",status:e.status})}));null==i||i(t),t.every((e=>"done"===e.status&&e.url))&&l(t)})(e)},onRemove:y,onSortChange:b})};class Km extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(jm,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,"")}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}Km.contextType=Ml;const Vm={onActivate:Bt.func,onAddUndo:Bt.func,onBeforeAddUndo:Bt.func,onBeforeExecCommand:Bt.func,onBeforeGetContent:Bt.func,onBeforeRenderUI:Bt.func,onBeforeSetContent:Bt.func,onBeforePaste:Bt.func,onBlur:Bt.func,onChange:Bt.func,onClearUndos:Bt.func,onClick:Bt.func,onContextMenu:Bt.func,onCommentChange:Bt.func,onCopy:Bt.func,onCut:Bt.func,onDblclick:Bt.func,onDeactivate:Bt.func,onDirty:Bt.func,onDrag:Bt.func,onDragDrop:Bt.func,onDragEnd:Bt.func,onDragGesture:Bt.func,onDragOver:Bt.func,onDrop:Bt.func,onExecCommand:Bt.func,onFocus:Bt.func,onFocusIn:Bt.func,onFocusOut:Bt.func,onGetContent:Bt.func,onHide:Bt.func,onInit:Bt.func,onKeyDown:Bt.func,onKeyPress:Bt.func,onKeyUp:Bt.func,onLoadContent:Bt.func,onMouseDown:Bt.func,onMouseEnter:Bt.func,onMouseLeave:Bt.func,onMouseMove:Bt.func,onMouseOut:Bt.func,onMouseOver:Bt.func,onMouseUp:Bt.func,onNodeChange:Bt.func,onObjectResizeStart:Bt.func,onObjectResized:Bt.func,onObjectSelected:Bt.func,onPaste:Bt.func,onPostProcess:Bt.func,onPostRender:Bt.func,onPreProcess:Bt.func,onProgressState:Bt.func,onRedo:Bt.func,onRemove:Bt.func,onReset:Bt.func,onSaveContent:Bt.func,onSelectionChange:Bt.func,onSetAttrib:Bt.func,onSetContent:Bt.func,onShow:Bt.func,onSubmit:Bt.func,onUndo:Bt.func,onVisualAid:Bt.func,onSkinLoadError:Bt.func,onThemeLoadError:Bt.func,onModelLoadError:Bt.func,onPluginLoadError:Bt.func,onIconsLoadError:Bt.func,onLanguageLoadError:Bt.func},zm=Object.assign({apiKey:Bt.string,id:Bt.string,inline:Bt.bool,init:Bt.object,initialValue:Bt.string,onEditorChange:Bt.func,value:Bt.string,tagName:Bt.string,cloudChannel:Bt.string,plugins:Bt.oneOfType([Bt.string,Bt.array]),toolbar:Bt.oneOfType([Bt.string,Bt.array]),disabled:Bt.bool,textareaName:Bt.string,tinymceScriptSrc:Bt.string,rollback:Bt.oneOfType([Bt.number,Bt.oneOf([!1])]),scriptLoading:Bt.shape({async:Bt.bool,defer:Bt.bool,delay:Bt.number})},Vm),Wm=e=>"function"==typeof e,Bm=e=>e in Vm,Um=e=>e.substr(2),Gm=(e,t,n,r,i)=>((e,t,n,r,i,l,a)=>{const o=Object.keys(i).filter(Bm),s=Object.keys(l).filter(Bm),c=o.filter((e=>void 0===l[e])),d=s.filter((e=>void 0===i[e]));c.forEach((e=>{const t=Um(e),r=a[t];n(t,r),delete a[t]})),d.forEach((n=>{const i=r(e,n),l=Um(n);a[l]=i,t(l,i)}))})(i,e.on.bind(e),e.off.bind(e),((t,n)=>r=>{var i;return null===(i=t(n))||void 0===i?void 0:i(r,e)}),t,n,r);let Ym=0;const Xm=e=>{const t=Date.now(),n=Math.floor(1e9*Math.random());return Ym++,e+"_"+n+Ym+String(t)},Qm=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),Zm=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),Jm=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},eh=()=>({listeners:[],scriptId:Xm("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),th=(()=>{let e=eh();return{load:(t,n,r,i,l,a)=>{const o=()=>((e,t,n,r,i,l)=>{const a=t.createElement("script");a.referrerPolicy="origin",a.type="application/javascript",a.id=e,a.src=n,a.async=r,a.defer=i;const o=()=>{a.removeEventListener("load",o),l()};a.addEventListener("load",o),t.head&&t.head.appendChild(a)})(e.scriptId,t,n,r,i,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?a():(e.listeners.push(a),e.scriptLoading||(e.scriptLoading=!0,l>0?setTimeout(o,l):o()))},reinitialize:()=>{e=eh()}}})(),nh=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class rh extends e.Component{constructor(t){var n,r,i;super(t),this.rollbackTimer=void 0,this.valueCursor=void 0,this.rollbackChange=()=>{const e=this.editor,t=this.props.value;e&&t&&t!==this.currentContent&&e.undoManager.ignore((()=>{if(e.setContent(t),this.valueCursor&&(!this.inline||e.hasFocus()))try{e.selection.moveToBookmark(this.valueCursor)}catch(e){}})),this.rollbackTimer=void 0},this.handleBeforeInput=e=>{if(void 0!==this.props.value&&this.props.value===this.currentContent&&this.editor&&(!this.inline||this.editor.hasFocus()))try{this.valueCursor=this.editor.selection.getBookmark(3)}catch(e){}},this.handleBeforeInputSpecial=e=>{"Enter"!==e.key&&"Backspace"!==e.key&&"Delete"!==e.key||this.handleBeforeInput(e)},this.handleEditorChange=e=>{const t=this.editor;if(t&&t.initialized){const e=t.getContent();void 0!==this.props.value&&this.props.value!==e&&!1!==this.props.rollback&&(this.rollbackTimer||(this.rollbackTimer=window.setTimeout(this.rollbackChange,"number"==typeof this.props.rollback?this.props.rollback:200))),e!==this.currentContent&&(this.currentContent=e,"function"==typeof this.props.onEditorChange&&this.props.onEditorChange(e,t))}},this.handleEditorChangeSpecial=e=>{"Backspace"!==e.key&&"Delete"!==e.key||this.handleEditorChange(e)},this.initialise=(e=0)=>{var t,n,r;const i=this.elementRef.current;if(!i)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,n=e.parentNode;for(;null!=n;)t=n,n=t.parentNode;return t===e.ownerDocument}return e.isConnected})(i)){if(0===e)setTimeout((()=>this.initialise(1)),1);else{if(!(e<100))throw new Error("tinymce can only be initialised when in a document");setTimeout((()=>this.initialise(e+1)),100)}return}const l=nh(this.view);if(!l)throw new Error("tinymce should have been loaded into global scope");const a=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:i,readonly:this.props.disabled,inline:this.inline,plugins:(o=null===(t=this.props.init)||void 0===t?void 0:t.plugins,s=this.props.plugins,Zm(o).concat(Zm(s))),toolbar:null!==(n=this.props.toolbar)&&void 0!==n?n:null===(r=this.props.init)||void 0===r?void 0:r.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!Qm(i)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&Wm(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,n;const r=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==r&&(this.currentContent=r,e.setContent(r),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const i=null!==(n=this.props.disabled)&&void 0!==n&&n;Jm(this.editor,i?"readonly":"design"),this.props.init&&Wm(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(i.style.visibility=""),Qm(i)&&(i.value=this.getInitialValue()),l.init(a)},this.id=this.props.id||Xm("tiny-react"),this.elementRef=e.createRef(),this.inline=null!==(i=null!==(n=this.props.inline)&&void 0!==n?n:null===(r=this.props.init)||void 0===r?void 0:r.inline)&&void 0!==i&&i,this.boundHandlers={}}get view(){var e,t;return null!==(t=null===(e=this.elementRef.current)||void 0===e?void 0:e.ownerDocument.defaultView)&&void 0!==t?t:window}componentDidUpdate(e){var t,n;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(e),this.editor.initialized)){if(this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:this.editor.getContent(),"string"==typeof this.props.initialValue&&this.props.initialValue!==e.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if("string"==typeof this.props.value&&this.props.value!==this.currentContent){const e=this.editor;e.undoManager.transact((()=>{let t;if(!this.inline||e.hasFocus())try{t=e.selection.getBookmark(3)}catch(e){}const n=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const r of[t,n])if(r)try{e.selection.moveToBookmark(r),this.valueCursor=r;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(n=this.props.disabled)&&void 0!==n&&n;Jm(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,n,r,i,l;null!==nh(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&th.load(this.elementRef.current.ownerDocument,this.getScriptSrc(),null!==(t=null===(e=this.props.scriptLoading)||void 0===e?void 0:e.async)&&void 0!==t&&t,null!==(r=null===(n=this.props.scriptLoading)||void 0===n?void 0:n.defer)&&void 0!==r&&r,null!==(l=null===(i=this.props.scriptLoading)||void 0===i?void 0:i.delay)&&void 0!==l?l:0,this.initialise)}componentWillUnmount(){const e=this.editor;e&&(e.off(this.changeEvents(),this.handleEditorChange),e.off(this.beforeInputEvent(),this.handleBeforeInput),e.off("keypress",this.handleEditorChangeSpecial),e.off("keydown",this.handleBeforeInputSpecial),e.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach((t=>{e.off(t,this.boundHandlers[t])})),this.boundHandlers={},e.remove(),this.editor=void 0)}render(){return this.inline?this.renderInline():this.renderIframe()}changeEvents(){var e,t,n;return(null===(n=null===(t=null===(e=nh(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===n?void 0:n.isIE())?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"}beforeInputEvent(){return window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges?"beforeinput SelectionChange":"SelectionChange"}renderInline(){const{tagName:t="div"}=this.props;return e.createElement(t,{ref:this.elementRef,id:this.id})}renderIframe(){return e.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})}getScriptSrc(){if("string"==typeof this.props.tinymceScriptSrc)return this.props.tinymceScriptSrc;{const e=this.props.cloudChannel;return`https://cdn.tiny.cloud/1/${this.props.apiKey?this.props.apiKey:"no-api-key"}/tinymce/${e}/tinymce.min.js`}}getInitialValue(){return"string"==typeof this.props.initialValue?this.props.initialValue:"string"==typeof this.props.value?this.props.value:""}bindHandlers(e){if(void 0!==this.editor){Gm(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,n=t(e),r=t(this.props);!n&&r?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):n&&!r&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}}}var ih;rh.propTypes=zm,rh.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(ih||(ih={}));const lh=e=>{var n;const{className:r,style:i,tinymce:l={},upload:a={},thresholdSize:o=.5,tinymceScriptSrc:s,disabled:c,value:d,onResizeEditor:u,onChange:p}=e,{global:m}=t.useContext(on),{$size:h}=$n(e),{$locale:f,t:g}=Fn(),v=400,y="preview importcss searchreplace autolink save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons",b="file edit view insert format tools table help",x="undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | align numlist bullist | link image | table media | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | code fullscreen preview | save print | pagebreak anchor codesample | ltr rtl",E=Object.assign(Object.assign({height:l.height||v,plugins:l.plugins||y,toolbar:l.toolbar||x,menubar:l.menubar||b,font_family_formats:"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",font_size_formats:"10px 12px 14px 16px 18px 20px 24px 36px 48px 56px 72px",language:ih[f],skin:"tinymce-5"},Xn(l,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,n)=>Hn(void 0,void 0,void 0,(function*(){const{action:n,headers:r,dataKey:i}=a,l=`data:image/jpeg;base64,${e.base64()}`,s=new FormData;s.append("file",e.blob(),e.filename());const c=e.blob().size;if(n&&c/1024/1024>o)try{const e=yield fetch(n,{method:"POST",body:s,headers:r});if(!e.ok)throw new Error(g("qm.upload.uploadError"));const l=yield e.json();if(200===l.code){const e=i?ue(l.data,i):l.data;t(e)}}catch(e){R.error(g("qm.uploadCropper.uploadError"))}else t(l)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:n,offsetHeight:r}=e.editorContainer;null==u||u({width:n,height:r},t)}))}}),w=lr("tinymce"),C={[w]:!0,[`${w}--lg`]:"large"===h,[`${w}--sm`]:"small"===h},S={init:E,value:d,disabled:c,tinymceScriptSrc:s||(null===(n=null==m?void 0:m.tinymce)||void 0===n?void 0:n.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==p||p(t.getContent(),t)}};return t.createElement("div",{className:Pe(C,r),style:i},t.createElement(rh,S))};lh.displayName="QmTinymce";const ah=e=>{const{$$form:n}=t.useContext(Ml),{value:r,onChange:i,onValuesChange:l}=e,{options:a={},upload:o,style:s={},readOnly:c,disabled:d=n.isFormDisabled}=e.option,{tinymce:u,thresholdSize:p,onResizeEditor:m}=a;return t.createElement(lh,{value:r,tinymce:u,upload:o,thresholdSize:p,style:Object.assign({width:"100%"},s),disabled:d||c||n.isOnlyShow,onResizeEditor:m,onChange:e=>{(e=>{null==i||i(e),l(e)})(e)}})};class oh extends d{render(){const{$$form:e}=this.context,{type:n,label:r,tooltip:i,fieldName:l,invisible:a,options:o={},labelWidth:s=e.props.labelWidth,className:c,extra:d,validateTrigger:u,rules:p=[],onChange:m=Vn}=this.props.option;return t.createElement(P.Item,{label:e.renderFormLabel(r),className:Pe(c),tooltip:i,hidden:a,labelCol:{flex:e.verticalLayout?"initial":Zn(s)},required:e.getFormItemRequired(p)},t.createElement(_,{wrap:!1,gutter:4},t.createElement(D,{flex:"auto"},t.createElement(P.Item,{name:l,noStyle:!0,rules:p,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(r)}},t.createElement(ah,{option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(l,t)}}))),d&&t.createElement(D,{flex:Zn(d.labelWidth||Ma)},e.renderFormItemExtra(Object.assign({fieldName:l},d)))))}}oh.contextType=Ml;class sh extends d{constructor(e){var n;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=t.createRef(),this.formRef=t.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(n=this.props.cols)&&void 0!==n?n:4,collapse:!!this.props.defaultExpand},this.resizeObserveHandler=()=>{var e;const t=null===(e=this.wrapperRef.current)||void 0===e?void 0:e.offsetWidth;if(void 0===t||0===t||this.props.cols>0)return;let n=Math.floor(t/300);n=24%n==0?n:n-1,n=n<1?1:n,n=n>8?8:n,n!==this.state.flexCols&&this.setState({flexCols:n})},this.resizeListenerHandle=Le(this.resizeObserveHandler,10),this.getFormItems=Wt((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=Wt((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{ae(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onValuesChange)||void 0===r||r.call(n,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var n,r;null===(r=(n=this.props).onFieldsChange)||void 0===r||r.call(n,e,t)},this.finishHandle=e=>{var t,n;null===(n=(t=this.props).onFinish)||void 0===n||n.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var n,r;null===(r=(n=this.props).onFinishFailed)||void 0===r||r.call(n,t)},this.openValidateInfo=e=>{const n=t.createElement("ul",null,e.map((e=>{const{label:n}=this.formItems.find((t=>t.fieldName===e.name[0]));return t.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof n?`${n}: `:"")+e.errors.join(","),"]")})));Z.error({message:un("qm.form.validatePrompt"),description:n,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&Vt(t,{scrollMode:"if-needed",block:"nearest",behavior:"smooth"})},this.createOriginItems(),this.createInitialValues(),this.createInitialOthers(),this.createInitialExtras(),this.createFormAuth()}get $size(){var e,t;return null!==(t=null!==(e=this.props.size)&&void 0!==e?e:this.context.size)&&void 0!==t?t:""}get verticalLayout(){return"vertical"===this.props.layout}get formItems(){return this.getFormItems(this.props.items)}get flattenItems(){return this.getFlattenItems(this.formItems)}get dividers(){return this.formItems.filter((e=>"DIVIDER"===e.type))}get isFilterType(){return"search"===this.props.formType}get isOnlyShow(){return"onlyShow"===this.props.formType}get isFormDisabled(){return this.props.disabled}get isCompactMode(){var e;const t=this.context.global;return null!==(e=this.props.compactMode)&&void 0!==e?e:"small"===this.$size&&!!(null==t?void 0:t.compactModeInSmallSize)}get showDividerCollapse(){return this.dividers.some((e=>!!e.collapse))}get showFilterCollapse(){return this.props.isCollapse&&this.formItems.length>=this.state.flexCols}componentDidMount(){this.checkFieldNames(),this.initialHandle(),this.createInputFocus(),this.bindResizeEvent(),this.resizeObserveHandler()}componentDidUpdate(e,t){this.props.items!==e.items&&this.checkFieldNames()}componentWillUnmount(){this.removeResizeEvent()}bindResizeEvent(){al(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){ol(this.wrapperRef.current,this.resizeListenerHandle)}initialHandle(){this.setState({formData:this.createFormValue(this.props.initialValues),other:this.createOtherValue(this.props.initialValues),extra:this.createExtraValue(this.props.initialExtras),expand:this.createDividerExpand()})}checkFieldNames(){const e=this.flattenItems.map((e=>e.fieldName));[...new Set(e)].length!==e.length&&tr("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return Object.assign({},n)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>ae(e.extra))).forEach((n=>{var r;t[n.fieldName]=null!==(r=e[n.fieldName])&&void 0!==r?r:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>ae(e.collapse))).forEach((t=>{var n;e[t.fieldName]=null!==(n=t.collapse.defaultExpand)&&void 0!==n&&n})),Object.assign({},e)}getInitialValue(e,t){var n;const{type:r,options:i}=e;return t=null!=t?t:void 0,Ka.includes(r)&&(t=null!=t?t:[]),"CHECKBOX"!==r&&"SWITCH"!==r||(t=null!==(n=null!=t?t:null==i?void 0:i.falseValue)&&void 0!==n?n:qa),t}createFormValue(e){const t={};return this.flattenItems.forEach((n=>{t[n.fieldName]=this.getInitialValue(n,e[n.fieldName])})),Object.assign({},e,t)}createInitialValues(){this._initialValues=this.createFormValue(this.props.initialValues)}createInitialOthers(){this._initialOthers=this.createOtherValue(this.props.initialValues)}createInitialExtras(){this._initialExtras=this.createExtraValue(this.props.initialExtras)}createOriginItems(){this.originItems=Qn(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((n=>({viewData:Object.assign({},n.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){var t,n;e!==this.state.collapse&&(this.setState({collapse:e}),null===(n=(t=this.props).onCollapse)||void 0===n||n.call(t,e),Bn((()=>{var t,n;return null===(n=(t=this.props).onCollapse)||void 0===n?void 0:n.call(t,e)})))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:n}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!n||setTimeout((()=>this.CREATE_FOCUS(n)))}getFormItemLabel(e){var t,n,r,i,l;if(io(e))return lo(e);if(ae(e)){const{fieldName:a,label:o,options:s={}}=e;if(io(o))return lo(o);const{itemList:c=[]}=s,d=null!==(r=null!==(n=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([a])[a])&&void 0!==n?n:this._initialValues[a])&&void 0!==r?r:null===(i=c[0])||void 0===i?void 0:i.value;return(null===(l=c.find((e=>e.value===d)))||void 0===l?void 0:l.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,n=this.dividers.length;t<n;t++){const n=this.formItems.findIndex((e=>e===this.dividers[t]));let r=this.formItems.findIndex((e=>e===this.dividers[t+1]));r=r>-1?r:void 0,e.push(this.formItems.slice(n,r).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var n,r;if("DIVIDER"===e)return!0;const i=this.getBlockDerivedItems();for(let e=0,l=i.length;e<l;e++){const l=i[e],a=this.dividers.find((e=>e.fieldName===l[0].fieldName)),o=null!==(r=null===(n=null==a?void 0:a.collapse)||void 0===n?void 0:n.showLimit)&&void 0!==r?r:l.length-1;for(let e=1;e<l.length;e++){if(l[e].fieldName===t&&e>o)return this.state.expand[l[0].fieldName]}}return!0}formatFormValue(e){var t,n;for(const r in e){const i=e[r];if(Qa(i)&&(e[r]=""),Array.isArray(i)&&i.forEach(((t,n)=>{Qa(t)&&(e[r][n]="")})),r.includes("|")&&Array.isArray(i)){const[l,a]=r.split("|");e[l]=null!==(t=i[0])&&void 0!==t?t:"",e[a]=null!==(n=i[1])&&void 0!==n?n:""}}if(this.isFilterType)for(const t in e)Gn(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,n;return Hn(this,void 0,void 0,(function*(){const{authConfig:r}=this.props;if(!r)return;let i=Xn(r,["fetch"]);if(r.fetch){const{api:t,params:n,dataKey:l}=r.fetch;try{const r=yield t(n);200===r.code&&(i=null!==(e=l?ue(r.data,l):r.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(i.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,n=i.fieldList.find((e=>e.dataIndex===t));if(n){const r=this.originItems.find((e=>e.fieldName===t)),{visible:i=1,disabled:l,secretName:a}=n;i||(e.noAuth=!0,r.noAuth=!0),l&&(e.disabled=!0,r.disabled=!0),a&&(e.options?e.options.secretType=a:e.options={secretType:a},r.options=Object.assign({},r.options,{secretType:a})),this.setFieldAuth(t,{visible:i,disabled:l,secretName:a})}return e}));null===(n=(t=this.props).fieldsChange)||void 0===n||n.call(t,e)}}))}INPUT(e){return t.createElement(Oo,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return t.createElement(Lo,{option:e})}INPUT_NUMBER(e){return t.createElement(Po,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return t.createElement(Do,{option:e})}SEARCH_HELPER(e){return t.createElement(Ap,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return t.createElement(Dp,{option:e})}TREE_TABLE_HELPER(e){return t.createElement(Kp,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return t.createElement(zp,{option:e})}RANGE_SEARCH_HELPER(e){return t.createElement(Xp,{option:e})}CHECKBOX(e){return t.createElement(To,{option:e})}MULTIPLE_CHECKBOX(e){return t.createElement(Zp,{option:e})}RATE(e){return t.createElement(em,{option:e})}RADIO(e){return t.createElement(nm,{option:e})}SWITCH(e){return t.createElement(im,{option:e})}TEXT_AREA(e){return t.createElement(am,{option:e})}DATE(e){return t.createElement(sm,{option:e})}RANGE_DATE(e){return t.createElement(um,{option:e})}TIME(e){return t.createElement(mm,{option:e})}RANGE_TIME(e){return t.createElement(fm,{option:e})}SELECT(e){return t.createElement(So,{option:e})}MULTIPLE_SELECT(e){return t.createElement(So,{option:e,multiple:!0})}IMMEDIATE(e){return t.createElement(vm,{option:e})}DIVIDER(e){return t.createElement(ym,{option:e})}TREE_SELECT(e){return t.createElement(Em,{option:e})}MULTIPLE_TREE_SELECT(e){return t.createElement(Em,{option:e,multiple:!0})}CASCADER(e){return t.createElement(Cm,{option:e})}MULTIPLE_CASCADER(e){return t.createElement(Cm,{option:e,multiple:!0})}CITY_SELECT(e){return t.createElement(Am,{option:e})}REGION_SELECT(e){return t.createElement(Dm,{option:e})}UPLOAD_FILE(e){return t.createElement(Fm,{option:e})}UPLOAD_IMG(e){return t.createElement(Km,{option:e})}TINYMCE(e){return t.createElement(oh,{option:e})}renderFormLabel(e){if(io(e)||!ae(e))return e;const{type:n,fieldName:r,label:i,options:l={},onChange:a=Vn}=e,{itemList:o=[]}=l;return"SELECT"===n?t.createElement(P.Item,{name:r,noStyle:!0},t.createElement(Co,{option:e,items:o,loading:!1,onValuesChange:(e,t)=>a(e,t)})):"CHECKBOX"===n?t.createElement(t.Fragment,null,t.createElement("span",{style:{paddingRight:5}},i),t.createElement(P.Item,{name:r,noStyle:!0},t.createElement(No,{option:e,onValuesChange:e=>a(e)}))):null}renderFormItemExtra(e){const{fieldName:n,isTooltip:r,style:i={},render:l}=e,{extra:a}=this.state;if(r)return t.createElement(w,{className:"extra-tooltip",title:a[n]},t.createElement(At,{style:{marginLeft:4}}));const o=this.formItems.find((e=>e.fieldName===n));return t.createElement("div",{className:"extra-text",title:l?"":a[n],style:i},t.createElement("span",{className:"extra-overflow-cut"},l?l(o,this):a[n]))}renderFormItemButton(e,t){const n=this.formItems.find((t=>t.fieldName===e)),r="function"==typeof t?t(n):t;return this.isOnlyShow?null:r}renderFormItem(e){const{label:n,fieldName:r,invisible:i,tooltip:l,className:a,labelWidth:o=this.props.labelWidth,validateTrigger:s,rules:c=[],style:d={},render:u}=e;return t.createElement(P.Item,{label:this.renderFormLabel(n),name:r,rules:c,tooltip:l,hidden:i,className:Pe(a),style:Object.assign({width:"100%"},d),labelCol:{flex:this.verticalLayout?"initial":Zn(o)},validateTrigger:s,messageVariables:{label:this.getFormItemLabel(n)}},this.formRef.current?u(e,this):t.createElement(t.Fragment,null))}createFormItem(e){return se(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(tr("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:n,defaultRows:r,isFieldsDefine:i}=this.props,l=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:n=0}=e;for(let e=0;e<t;e++)l.push({});l.push(e);for(let e=0;e<n;e++)l.push({})}));const a=24/e,o=[],s=l.reduce(((e,t)=>{const{selfCol:n=1}=t,r=e+n;return o.push(r),r}),0),c=r>Math.ceil(s/e)?Math.ceil(s/e):r,d=[],u=l.map(((n,r)=>{let{selfCol:i=1}=n;const{type:l,fieldName:s}=n;i=i>=24||"DIVIDER"===l||"TINYMCE"===l?e:i;const u=!(!this.state.collapse&&this.showFilterCollapse)||o[r]<c*e,p=!this.showDividerCollapse||this.getFormItemDisplay(n);return u&&d.push(o[r]),t.createElement(D,{key:null!=s?s:r,className:s,span:i*a,style:this.isFilterType?{display:!this.showFilterCollapse||u?"block":"none"}:{display:p?"block":"none"}},l?this.createFormItem(Qn(n)):null)}));return i&&"default"===n&&u.push(t.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...u,this.createSearchButtonLayout(d[d.length-1])]}createSearchButtonLayout(e=0){const{flexCols:n,collapse:r}=this.state,{searchButtonCols:i,isSearchBtn:l,isFieldsDefine:a=!0}=this.props;if(!this.isFilterType)return null;const o=24/n,s=i||1,c=n-e%n-s;return l?t.createElement(D,{key:"-",span:s*o,offset:c*o,style:{textAlign:"right"}},t.createElement(S,{style:{marginBottom:12}},t.createElement(nr,{type:"primary",size:this.$size,icon:t.createElement(Nt,null),onClick:()=>this.SUBMIT_FORM()},un("qm.form.search")),t.createElement(nr,{size:this.$size,icon:t.createElement(Ge,null),onClick:()=>this.RESET_FORM()},un("qm.form.reset")),a?this.createFieldsDefine():null,this.showFilterCollapse&&t.createElement("a",{onClick:()=>this.setExpandHandle(!r)},r?t.createElement(_e,null):t.createElement(De,null)," ",un(r?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:n,isSubmitBtn:r}=this.props;if(this.isFilterType)return null;const i=24/e;return r&&"default"===n?t.createElement(_,{gutter:0},t.createElement(D,{key:"-",span:i},t.createElement(P.Item,null,t.createElement(S,{style:{marginBottom:12}},t.createElement(nr,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},un("qm.form.save")),t.createElement(nr,{size:this.$size,onClick:()=>this.RESET_FORM()},un("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:n,fieldsChange:r}=this.props;return t.createElement(Io,{uniqueKey:e,items:n,fieldsChange:r})}set_fields_other(e){this.setState((t=>({other:Object.assign({},t.other,this.createOtherValue(e))})))}get_fields_other(e){if(!e)return this.state.other;const t={};return e.forEach((e=>{t[e]=this.state.other[e]})),t}formValidate(){return new Promise(((e,t)=>Hn(this,void 0,void 0,(function*(){const[n,r]=yield this.VALIDATE_FIELDS(),i=this.formItems.filter((e=>"SEARCH_HELPER"===e.type)).filter((e=>{var t;return null===(t=this[`${e.fieldName}_Ref`])||void 0===t?void 0:t.searchRef._is_change})).map((e=>({name:[e.fieldName],errors:[un("qm.form.searchHelperTips")],warnings:[]})));n||i.length?t((n||[]).concat(i)):e(r)}))))}SET_FIELDS_VALUE(e){this.formRef.current.setFieldsValue(e),this.set_fields_other(e)}GET_FIELDS_VALUE(e){return e?Object.assign({},this.get_fields_other(e),this.formRef.current.getFieldsValue(e)):Object.assign({},this.state.other,this.formRef.current.getFieldsValue(!0))}GET_FORM_DATA(){return Hn(this,void 0,void 0,(function*(){try{const e=yield this.formValidate();return[null,Object.assign({},this.get_fields_other(),this.formatFormValue(e))]}catch(e){return this.props.scrollToFirstError&&this.scrollToField(e[0].name[0]),[e,null]}}))}VALIDATE_FIELDS(e){return Hn(this,void 0,void 0,(function*(){try{return[null,yield this.formRef.current.validateFields(e)]}catch({errorFields:e}){return this.isCompactMode&&this.openValidateInfo(e),[e,null]}}))}SET_FIELDS_EXTRA(e){this.setState((t=>({extra:Object.assign({},t.extra,e)})))}SET_FIELDS_ECHO(e){Object.keys(e).length&&(Object.assign(this.provide,{echo_data:Object.assign({},this.provide.echo_data,e)}),this.forceUpdate())}GET_FIELDS_EXTRA(e){if(!e)return this.state.extra;const t={};return e.forEach((e=>{t[e]=this.state.extra[e]})),t}GET_FIELDS_TOUCHED(e){return this.formRef.current.isFieldsTouched(e)}SUBMIT_FORM(){return Hn(this,void 0,void 0,(function*(){try{yield this.formValidate(),this.formRef.current.submit()}catch(e){this.isFilterType&&this.setExpandHandle(!0)}}))}RESET_FORM(){var e,t;const n=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),r=this.flattenItems.map((e=>e.fieldName)).filter((e=>!n.includes(e)));r.length&&this.formRef.current.resetFields(r),this.setState((e=>{const t=Object.keys(e.other),n=Object.keys(this._initialOthers),r=t.filter((e=>!n.includes(e))),i={};return r.forEach((e=>i[e]=void 0)),{other:Object.assign({},this._initialOthers,i)}})),this.setState({extra:Object.assign({},this._initialExtras)}),null===(t=(e=this.props).onReset)||void 0===t||t.call(e)}CREATE_FOCUS(e){try{this[`${e}_Ref`].focus()}catch(e){tr("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,n){const{items:r,fieldsChange:i}=this.props,l=r.find((t=>t.fieldName===e));if(!l)return tr("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!ae(t))return tr("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(l.noAuth)return tr("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const n in t)n&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===n||he(l,n,t[n]));n&&(i?i([...r]):tr("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:n,layout:r,disabled:i,labelWidth:l,labelAlign:a,labelWrap:o,customClass:s}=this.props,c=lr("form"),d={required:"${label}"+un("qm.form.requiredTips")},u={[c]:!0,[`${c}--lg`]:"large"===this.$size,[`${c}--sm`]:"small"===this.$size,[`${c}__only-show`]:this.isOnlyShow,[`${c}__compact`]:this.isCompactMode,[s]:!!s};return t.createElement("div",{ref:this.wrapperRef,className:Pe(u,e),style:n},t.createElement(P,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:r,labelAlign:a,labelWrap:o,colon:!1,disabled:i,labelCol:{flex:this.verticalLayout?"initial":Zn(l)},validateMessages:d,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},t.createElement(Ml.Provider,{value:this.provide},t.createElement(_,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}sh.contextType=on,sh.propTypes=Ua,sh.defaultProps=Ga;const ch=e=>null!=e;function dh(e,n,r,i){const[l,a]=t.useState(void 0);t.useLayoutEffect((()=>{const t="function"==typeof e?e():e;a(t||null)}));const[o,s]=t.useState(null),c=()=>{if(l){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:r,right:i,bottom:l,left:a}=e.getBoundingClientRect();return r>=0&&a>=0&&i<=t&&l<=n})(l)&&n&&l.scrollIntoView(i);const{left:e,top:t,width:r,height:a}=l.getBoundingClientRect(),o={left:e,top:t,width:r,height:a,radius:0};s((e=>JSON.stringify(e)!==JSON.stringify(o)?o:e))}else s(null)};t.useLayoutEffect((()=>{c()}),[l,n]),os({handler:c});return[t.useMemo((()=>{if(!o)return o;const e=(null==r?void 0:r.offset)||6,t=(null==r?void 0:r.radius)||2;return{left:o.left-e,top:o.top-e,width:o.width+2*e,height:o.height+2*e,radius:t}}),[o,r]),l]}const uh={fill:"transparent",pointerEvents:"auto"},ph=e=>{const{prefixCls:n,rootClassName:r,pos:i,showMask:l,style:a={},fill:o="rgba(0,0,0,0.5)",open:s,animated:c,zIndex:d}=e,u=`${n}-mask-${Xo()}`,p="object"==typeof c?null==c?void 0:c.placeholder:c;return t.createElement(tn,{open:s,autoLock:!0},t.createElement("div",{className:Pe(`${n}-mask`,r),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},a)},l?t.createElement("svg",{style:{width:"100%",height:"100%"}},t.createElement("defs",null,t.createElement("mask",{id:u},t.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),i&&t.createElement("rect",{x:i.left,y:i.top,rx:i.radius,width:i.width,height:i.height,fill:"black",className:p?`${n}-placeholder-animated`:""}))),t.createElement("rect",Rn({},i?null:uh,{x:"0",y:"0",width:"100%",height:"100%",fill:o,mask:`url(#${u})`})),i&&t.createElement(t.Fragment,null,t.createElement("rect",Rn({},uh,{x:"0",y:"0",width:"100%",height:`${i.top}px`})),t.createElement("rect",Rn({},uh,{x:"0",y:"0",width:i.left,height:"100%"})),t.createElement("rect",Rn({},uh,{x:"0",y:i.top+i.height,width:"100%",height:`calc(100vh - ${i.top+i.height}px)`})),t.createElement("rect",Rn({},uh,{x:i.left+i.width,y:"0",width:`calc(100vw - ${i.left+i.width}px)`,height:"100%"})))):null))},mh=e=>{const{prefixCls:n,zIndex:r,open:i,onPause:l,onPlay:a}=e,[o,s]=ns(void 0,{value:i,postState:e=>null==e||e}),c=t.useRef(null),d=t.useRef(!1),u=Mn((e=>{p(e),e.shiftKey&&32===e.keyCode&&m()}));t.useEffect((()=>{const e=Kt(document,"keyup",u);return()=>e.remove()}),[]);const p=e=>{e.stopPropagation(),e.preventDefault()},m=()=>{d.current?d.current=!1:(s(!o),o?null==l||l():null==a||a())};return t.createElement("div",{ref:c,className:`${n}-control`,style:{zIndex:r+1},onMouseDown:e=>{p(e);const t=c.current,n=t.offsetWidth,r=t.offsetHeight,i=window.innerWidth,l=window.innerHeight,a=e.clientX-Bi(t).x,o=e.clientY-Bi(t).y;return document.onmousemove=e=>{let s=e.clientX-a,c=e.clientY-o;s<0&&(s=0),s>i-n-1&&(s=i-n-1),c<0&&(c=0),c>l-r-1&&(c=l-r-1),Vi(t,{left:`${s}px`,top:`${c}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>m()},o?t.createElement(Pt,null):t.createElement(yt,null))},hh=e=>{const{prefixCls:n,current:r,total:i=0,cover:l,title:a,description:o,helper:s={},type:c,zIndex:d,onClose:u,onPrev:p,onNext:m,onFinish:h,className:f,indicatorsRender:g}=e,{t:v}=Fn(),y="primary"!==c?"primary":"default",b=Mn((e=>{C(e),40===e.keyCode&&(r<i-1?null==m||m():null==h||h()),38===e.keyCode&&r>0&&(null==p||p())}));t.useEffect((()=>{const e=Kt(document,"keyup",b);return()=>e.remove()}),[]);const x=ch(l)?t.createElement("div",{className:`${n}-cover`},l):null,E=ch(o)?t.createElement("div",{className:`${n}-description`},o):null;let w;w=g?g(r,i):[...Array.from({length:i}).keys()].map(((e,i)=>t.createElement("span",{key:e,className:Pe(i===r&&`${n}-indicator-active`,`${n}-indicator`)})));const C=e=>{e.stopPropagation(),e.preventDefault()};return t.createElement("div",{className:Pe(`${n}-content`,f)},t.createElement("div",{className:`${n}-inner`},t.createElement(it,{className:`${n}-close`,onClick:u}),s.content&&t.createElement(V,{placement:"bottom",overlayStyle:{width:360,zIndex:d},content:s.content,title:s.title},t.createElement(_t,{className:Pe(`${n}-close`,"help-icon")})),x,t.createElement("div",{className:`${n}-header`},t.createElement("div",{className:`${n}-title`},a)),E,t.createElement("div",{className:`${n}-footer`},i>1&&t.createElement("div",{className:`${n}-indicators`},w),t.createElement(ir,{className:`${n}-buttons`},0!==r?t.createElement(nr,{className:`${n}-prev-btn`,size:"small",onMouseDown:C,onClick:p},v("qm.tour.prevStep")):null,r===i-1?t.createElement(nr,{className:`${n}-finish-btn`,type:y,size:"small",onClick:h},v("qm.tour.finish")):t.createElement(nr,{className:`${n}-next-btn`,type:y,size:"small",onMouseDown:C,onClick:m},v("qm.tour.nextStep"))))))},fh=e=>{const{current:n,renderPanel:r}=e;return t.createElement(t.Fragment,null,"function"==typeof r?r(e,n):t.createElement(hh,e))},gh={left:"50%",top:"50%",width:1,height:1},vh=t.forwardRef(((e,n)=>{const{steps:r=[],defaultCurrent:i,current:l,onChange:a,onClose:o,onFinish:s,open:c,type:d="default",mask:u=!0,arrow:p=!0,control:m=!0,overlayClassName:h,overlayStyle:f,placement:g,helper:v,zIndex:y,renderPanel:b,indicatorsRender:x,gap:E,animated:w=!0,scrollIntoViewOptions:C=!0}=e,S=_n(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),N=t.useRef(),[T,I]=ns(0,{value:l,defaultValue:i}),[R,O]=ns(void 0,{value:c,postState:e=>!(T<0||T>=r.length)&&(null!=e&&e)}),[k,L]=ns(1051,{value:y,defaultValue:y}),[A,P]=t.useState(),_=t.useRef(R);t.useLayoutEffect((()=>{R&&!_.current&&I(0),_.current=R,P(R)}),[R]),t.useImperativeHandle(n,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>L(e)})));const{target:D,type:H,placement:F,trigger:M,delay:$,style:q,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:W,action:B}=r[T]||{},U=W||k,G=H||d,Y=R&&(null!=V?V:u),X=null!=z?z:C,[Q,Z]=dh(D,!!c,E,X),J=((e,t,n)=>{var r;return null!==(r=null!=n?n:t)&&void 0!==r?r:null===e?"center":"bottom"})(Z,g,F),ee=!!Z&&(void 0===j?p:j),te="object"==typeof ee&&ee.pointAtCenter;t.useLayoutEffect((()=>{var e;null===(e=N.current)||void 0===e||e.forceAlign()}),[te,T]),Mi((()=>{R&&(ie(),null==B||B(Z,T))}),[R,Z]);const ne=e=>{I(e),null==a||a(e)},re=()=>{O(!1),null==o||o(T)},ie=()=>{if(!Z)return;const e=[];!function t(n){if(1===n.nodeType){var r;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName||("none"===Ki(r=n,"display")||"hidden"===Ki(r,"visibility")||"0"===Ki(r,"opacity"))||e.push(n);for(const e of Array.from(n.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const le=()=>Hn(void 0,void 0,void 0,(function*(){if(!M||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),n=Z.offsetWidth,r=Z.offsetHeight,[i,l]=[e+n/2,t+r/2],a=new MouseEvent(M,{bubbles:!0,cancelable:!0,button:0,clientX:i,clientY:l}),o=document.elementFromPoint(i,l);o&&(o.dispatchEvent(a),yield Wn(null!=$?$:320))})),ae="boolean"==typeof Y?Y:!!Y,oe="boolean"==typeof Y?void 0:Y,se=Object.assign({},f,q),ce=lr("tour"),de=[{[`${ce}-primary`]:"primary"===G},h,K],ue=Wd({arrowPointAtCenter:te,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(ph,{zIndex:U,prefixCls:ce,pos:Q,showMask:ae,style:null==oe?void 0:oe.style,fill:null==oe?void 0:oe.color,open:A,animated:w,rootClassName:h}),t.createElement(tn,{open:A,autoLock:!0},t.createElement(Zt,Rn({ref:N},S,{zIndex:U,builtinPlacements:ue,popupStyle:se,popupPlacement:J,popupVisible:A,popupClassName:Pe(de),prefixCls:ce,popup:()=>t.createElement(fh,Rn({key:"content",arrow:ee,prefixCls:ce,total:r.length,helper:v,renderPanel:b,indicatorsRender:x,onPrev:()=>Hn(void 0,void 0,void 0,(function*(){yield le(),ne(T-1)})),onNext:()=>Hn(void 0,void 0,void 0,(function*(){yield le(),ne(T+1)})),onClose:re,current:T,onFinish:()=>{re(),null==s||s()}},Object.assign({},r[T],{zIndex:U,type:G}))),arrow:!!ee,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),t.createElement("div",{className:Pe(h,`${ce}-target-placeholder`),style:Object.assign(Object.assign({},Q||gh),{position:"fixed",pointerEvents:"none"})}))),m&&t.createElement(tn,{open:R},t.createElement(mh,{zIndex:U,prefixCls:ce,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));vh.displayName="QmTour";var yh={previewWidth:1100,defaultDistance:.45,logoHeight:60};const bh=n(void 0);var xh=null;function Eh(){try{var e=navigator.userAgent;if(e.match(/Windows\sPhone/i))return!0;if(e.match(/iPhone|iPod|iPad/i))return!0;if(e.match(/Android/i))return!0;if(e.match(/Edge\D?\d+/i))return!0;var t=e.match(/Trident\D?\d+/i),n=e.match(/MSIE\D?\d+/i),r=e.match(/OPR\D?\d+/i),i=e.match(/Firefox\D?\d+/i),l=e.match(/x64/i);if(!t&&!n&&l)return!0;if(i){if((i=i[0].match(/\d+/))[0]>=41||l)return!0}else if(r){if((r=r[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!n){var a=e.match(/Chrome\D?\d+/i);if(a&&(a=a[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function wh(e,t){var n;try{var r=navigator.userAgent,i=!!r.match(/MSIE/i)||!!r.match(/Trident/i);if(Eh()){try{n=getCLodop()}catch(e){}if(!n&&"complete"!==document.readyState)return void R.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!n)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{i&&r.match(/x64/i);if(e||t?n=i?e:t:xh?n=xh:((n=document.createElement("object")).setAttribute("width",0),n.setAttribute("height",0),n.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),i?n.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):n.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(n),xh=n),!n||!n.VERSION)return r.indexOf("Chrome"),r.indexOf("Firefox"),n}return n.VERSION<"6.2.2.6"&&Eh(),n}catch(e){R.error("getLodop 出错:"+e)}}Eh();const Ch=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:n,deviceYDPI:r}=window.screen;if(n&&r)t[0]=n,t[1]=r;else{let n=document.createElement("DIV");n.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(n),t[0]=parseInt(n.offsetWidth.toString()),t[1]=parseInt(n.offsetHeight.toString()),null===(e=n.parentNode)||void 0===e||e.removeChild(n),n=null}return t})()[0];return Math.ceil(t)},Sh=t.forwardRef(((e,n)=>{const{templateRender:r,directPrint:i}=e,{global:l}=t.useContext(on),{$$preview:a}=t.useContext(bh),{state:o,isWindowsPrinter:s,pageSize:c}=a,d=t.useRef(null),u=t.useRef({}),p=t.useRef([]),m=t.useRef([]),h=t.useRef([]),[f,g]=t.useState(!0);t.useImperativeHandle(n,(()=>({createPreviewDom:O,createExportHtml:L,createPrintHtml:k,SHOW_PREVIEW:A,DIRECT_PRINT:P}))),Mi((()=>{R()}),[o.form.printerType,o.form.setting.direction,o.form.setting.distance,o.form.setting.fixedLogo]),t.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const v=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*yh.defaultDistance+10*yh.defaultDistance:0;return("vertical"===e?c[0]:c[1])-t}),[o,s,c]),y=t.useMemo((()=>{const{form:{setting:{direction:e}}}=o,t=s?10*yh.defaultDistance+10*yh.defaultDistance:0;return("vertical"===e?c[1]:c[0])-t}),[o,s,c]),b=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return Ch(v-10*(e.left-yh.defaultDistance)-10*(e.right-yh.defaultDistance))}),[o,v]),x=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return Ch(y-10*(e.top-yh.defaultDistance)-10*(e.bottom-yh.defaultDistance))}),[o,y]),E=o.form.scale,w=t.useMemo((()=>{const{form:{setting:{distance:e}}}=o;return{left:Ch(10*e.left),right:Ch(10*e.right),top:Ch(10*e.top),bottom:Ch(10*e.bottom)}}),[o]),C=t.useMemo((()=>{const{form:{printerType:e}}=o,{left:t,right:n,top:r,bottom:i}=w,l=b+t+n,a=yh.previewWidth-l<=0?0:(yh.previewWidth-l)/2,s=Math.abs((1-E)*l/2);let c=0;return E>1&&(c=s>a?-1*a:-1*s),E<1&&(c=l-2*s>yh.previewWidth?0:a>0?s:(yh.previewWidth-(l-2*s))/2),{width:`${b}px`,height:""+("stylus"===e?"auto":x+"px"),paddingLeft:`${t}px`,paddingRight:`${n}px`,paddingTop:`${r}px`,paddingBottom:`${i}px`,transform:`translateX(${c}px) scale(${E})`,opacity:f?0:1}}),[o,f,w,E,x,b]);p.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const S=()=>{var e,t,n,r;const i=null!==(t=null===(e=null==l?void 0:l.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",a=null!==(r=null===(n=null==l?void 0:l.print)||void 0===n?void 0:n.rightLogo)&&void 0!==r?r:"";return[`<tr style="height: ${yh.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',a?`<img src="${a}" border="0" height="46" />`:"","</td>","</tr>"].join("")},N=()=>{let e='<tr style="height: 0;">';for(let t=0;t<24;t++)e+=`<td width="${100/24}%" style="width: ${100/24}%; padding: 0;"></td>`;return e+="</tr>",e},T=()=>{let e=document.createElement("tr");var t,n;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=N().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(n=u.current.templateEl.children[0]).children[0]?n.insertBefore(t,n.children[0]):n.appendChild(t),e=null},I=()=>{const e=u.current.templateEl.children[0].children,t=[],n=[];for(let r=0;r<e.length;r++){if("template-cols"===e[r].getAttribute("type"))continue;const i=e[r].clientHeight;e[r].style.height=i+"px",n.push(i),t.push(e[r].outerHTML)}m.current=n,p.current=t},R=()=>{var e;if(!p.current.length)return;const{form:{setting:t,printerType:n}}=o;if(i)return h.current.push([N(),S(),...p.current]);const r=t.fixedLogo?x-yh.logoHeight:x;let l=[];if(h.current=[],"stylus"===n)h.current.push([N(),...t.fixedLogo?[S()]:[],...p.current]);else{let e=0;for(let n=0,i=m.current.length;n<i;n++){const a=p.current[n],o=m.current[n];t.fixedLogo||0!==n||(e+=yh.logoHeight),e+=o,e<=r?l.push(a):(h.current.push([N(),...t.fixedLogo?[S()]:[],...l]),l=[],e=0,n-=1),n===i-1&&l.length&&h.current.push([N(),...t.fixedLogo?[S()]:[],...l])}}t.fixedLogo||null===(e=h.current[0])||void 0===e||e.splice(1,0,S());for(let e=0,t=h.current.length;e<t&&e!==t-1;e++)h.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');a.setState({currentPage:1,totalPage:h.current.length}),O()},O=()=>{var e,t;const{currentPage:n}=o;let r=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;r+=null!==(t=null===(e=h.current[n-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",r+="</table>",u.current.previewEl.innerHTML=r,u.current.previewEl.parentNode.scrollTop=0},k=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...h.current[e-1]].join("")}else for(let e=0;e<h.current.length;e++)t+=h.current[e].join("");return t+="</table>",t},L=()=>{const e=[];for(let t=0;t<p.current.length;t++)e[t]=p.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+S()+N()+e.join("")+"</table>"},A=()=>Hn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();u.current.previewEl.innerHTML||(T(),yield Wn(0),I(),R(),g(!1))})),P=()=>Hn(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return _();T(),yield Wn(0),I(),R(),g(!1),a.doPrint(k()),yield Wn(0),a.doClose()})),_=()=>{tr("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D={[lr("print-container")]:!0,"no-visible":i};return t.createElement("div",{ref:d,className:Pe(D)},t.createElement(nl,{wrapperClassName:"spin",spinning:f,tip:"Loading..."},t.createElement("div",{className:"preview"},t.createElement("div",{className:"origin-template",style:{width:`${b}px`,marginLeft:`-${Math.floor(b/2)}px`}},null==r?void 0:r()),t.createElement("div",{className:"workspace",style:C}))))}));Sh.displayName="Container";class Nh extends d{constructor(){super(...arguments),this.formRef=t.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:un("qm.print.setPanel.printParameter")},{type:"SELECT",label:un("qm.print.setPanel.pagerType"),fieldName:"pageSize",options:{itemList:[{text:"A2",value:"420*594"},{text:"A3",value:"420*297"},{text:"A4",value:"210*297"},{text:"A5",value:"210*148"},{text:un("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:un("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:un("qm.print.setPanel.vertical"),value:"vertical"},{text:un("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:un("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:un("qm.print.setPanel.manualDoublePrint"),value:"manual"}]},disabled:!this.props.setting.doubleSide},options:{trueValue:1,falseValue:0},onChange:e=>{const{formList:t}=this.state;t.find((e=>"doubleSide"===e.fieldName)).label.disabled=!e,this.setState({formList:t})}},{type:"CHECKBOX",label:un("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:un("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:yh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:yh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:yh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:un("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:yh.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:un("qm.print.setPanel.noEmpty")}]}],this.getInitialvalue=()=>{const{setting:e}=this.props,{distance:t}=e;return Object.assign({},{disleft:t.left,disright:t.right,distop:t.top,disbottom:t.bottom,pageSize:e.pageSize,direction:e.direction,doubleSide:e.doubleSide,doubleSideType:e.doubleSideType,fixedLogo:e.fixedLogo})},this.getInitialExtra=()=>({disleft:un("qm.print.setPanel.sizeUnit"),disright:un("qm.print.setPanel.sizeUnit"),distop:un("qm.print.setPanel.sizeUnit"),disbottom:un("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Hn(this,void 0,void 0,(function*(){const[e,t]=yield this.formRef.current.GET_FORM_DATA();e||(this.props.onChange({distance:{left:t.disleft,right:t.disright,top:t.distop,bottom:t.disbottom},pageSize:t.pageSize,direction:t.direction,doubleSide:t.doubleSide,doubleSideType:t.doubleSideType,fixedLogo:t.fixedLogo}),this.cancelHandle())})),this.cancelHandle=()=>{this.props.onClose()}}render(){const{formList:e}=this.state;return t.createElement(t.Fragment,null,t.createElement(sh,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),t.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},t.createElement(nr,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},un("qm.dialog.close")),t.createElement(nr,{type:"primary",onClick:()=>this.confirmHandle()},un("qm.dialog.confirm"))))}}Nh.contextType=on;class Th extends d{constructor(){var e,n,r;super(...arguments),this.provide={$$preview:this},this.containRef=t.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(n=this.props.defaultConfig)||void 0===n?void 0:n.copies)||1,scale:1,setting:{distance:{left:yh.defaultDistance,right:yh.defaultDistance,top:yh.defaultDistance,bottom:yh.defaultDistance},pageSize:"210*297",direction:(null===(r=this.props.defaultConfig)||void 0===r?void 0:r.direction)||"vertical",doubleSide:0,doubleSideType:"auto",fixedLogo:0}},printPage:void 0,currentPage:1,totalPage:0},this.pageChangeHandle=e=>{this.setState({currentPage:e},(()=>{this.containRef.current.createPreviewDom()}))},this.exportClickHandle=()=>{this.doExport(this.containRef.current.createExportHtml())},this.printClickHandle=()=>Hn(this,void 0,void 0,(function*(){if(this.doPrint(this.containRef.current.createPrintHtml(this.state.printPage)),this.props.uniqueKey)try{const e=Object.assign(Object.assign({},this.state.form),{printerName:this.printerItems.find((e=>e.value===this.state.form.printerName)).text});yield Qt.setItem(this.printerKey,e),yield this.savePrintConfig(this.printerKey,e)}catch(e){}})),this.doClose=()=>{var e,t;null===(t=(e=this.props).onClose)||void 0===t||t.call(e)},this.getPrintConfig=e=>Hn(this,void 0,void 0,(function*(){const t=this.context.global,n=null==t?void 0:t.getComponentConfigApi;if(n)try{const t=yield n({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Hn(this,void 0,void 0,(function*(){const n=this.context.global,r=null==n?void 0:n.saveComponentConfigApi;if(r)try{yield r({[e]:t})}catch(e){}})),this.createStyle=()=>'\n <style type="text/css">\n table {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n table-layout: fixed;\n }\n table tr td {\n padding: 2px;\n line-height: 1.2;\n word-wrap: break-word;\n }\n .fs12 {\n font-size: 12px;\n }\n .fs13 {\n font-size: 13px;\n }\n .fs14 {\n font-size: 14px;\n }\n .fw500 {\n font-weight: 500;\n }\n .fw700 {\n font-weight: 700;\n }\n .fl {\n float: left;\n }\n .fr {\n float: right;\n }\n .tc {\n text-align: center;\n }\n .tr {\n text-align: right;\n }\n .bor {\n border: 1px solid #000;\n }\n .bor-t {\n border-top: 1px solid #000;\n }\n .bor-b {\n border-bottom: 1px solid #000;\n }\n .bor-l {\n border-left: 1px solid #000;\n }\n .bor-r {\n border-right: 1px solid #000;\n }\n .no-bor {\n border: none !important;\n }\n </style>\n ',this.doPrint=e=>{const t=wh();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i,printerName:l,printerType:a,copies:o}}=this.state,{pageSize:s}=this,{defaultDistance:c}=yh,{left:d,right:u,top:p,bottom:m}=i.distance;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(l),t.SET_PRINT_COPIES(o),i.doubleSide&&("auto"===i.doubleSideType?(t.SET_PRINT_MODE("PRINT_DUPLEX",2),t.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1)):t.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",1)),t.SET_PRINT_MODE("AUTO_CLOSE_PREWINDOW",1),"laser"===a&&("vertical"===i.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===i.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===a&&t.SET_PRINT_PAGESIZE(3,10*s[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(p-c)+"mm",10*(d-c)+"mm",`RightMargin: ${10*(u-c)}mm`,`BottomMargin: ${"stylus"!==a?10*(m-c):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?r&&this.doClose():R.error(un("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=wh();if(!t)return;const{uniqueKey:n,closeAfterPrint:r}=this.props,{form:{setting:i}}=this.state;t.PRINT_INIT(null!=n?n:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?r&&this.doClose():R.error(un("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===i.direction?1:2),t.SAVE_TO_FILE(`${m().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:un("qm.print.laserPrinter"),value:"laser"},{text:un("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=wh(),t=[{text:un("qm.print.defaultPrinter"),value:-1}];try{const n=e.GET_PRINTER_COUNT();for(let r=0;r<n;r++)t.push({text:e.GET_PRINTER_NAME(r),value:r})}catch(e){tr("Print","[ClientPrint]: 请安装 LODOP 打印插件")}return t}get isWindowsPrinter(){const{form:{printerName:e}}=this.state;return!/OneNote|Microsoft|Fax/.test(this.printerItems.find((t=>t.value===e)).text)}get pageSize(){return this.state.form.setting.pageSize.split("*").map((e=>Number(e)))}get printerKey(){return this.props.uniqueKey?`print_${this.props.uniqueKey}`:""}componentDidMount(){var e,t;return Hn(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let n=yield Qt.getItem(this.printerKey);n||(n=yield this.getPrintConfig(this.printerKey),ae(n)&&(yield Qt.setItem(this.printerKey,n))),ae(n)&&Object.keys(n).length&&Ie(this.state.form,Object.assign(Object.assign({},n),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===n.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:n}=this.props,{visible:r,form:i,currentPage:l,totalPage:a,printPage:o}=this.state,s=lr("print-preview"),c={visible:r,title:un("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},d={[s]:!0};return e?t.createElement(t.Fragment,null,t.createElement("div",{className:Pe(d)},t.createElement("div",{className:"outer"},t.createElement("div",{className:"header"},t.createElement("span",null,un("qm.print.printer"),":",t.createElement(H,{value:i.printerName,onChange:e=>{this.setState((t=>Ie({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,un("qm.print.type"),":",t.createElement(H,{value:i.printerType,onChange:e=>{this.setState((t=>Ie({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>t.createElement(H.Option,{key:e.value,value:e.value},e.text))))),t.createElement("span",null,un("qm.print.copies"),":",t.createElement($,{value:i.copies,min:1,precision:0,onChange:e=>{this.setState((t=>Ie({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),t.createElement("span",null,un("qm.print.printPage.0"),t.createElement($,{value:o,min:1,max:a,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),un("qm.print.printPage.1")),t.createElement("span",null,t.createElement(B,{size:"small",current:l,pageSize:1,total:a,onChange:this.pageChangeHandle})),t.createElement("span",null,t.createElement(nr,{type:"text",icon:t.createElement(Qe,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},un("qm.print.setting"))),t.createElement("span",null,t.createElement(nr,{type:"text",icon:t.createElement(je,null),className:"text-btn",onClick:()=>this.exportClickHandle()},un("qm.print.export"))),t.createElement("span",null,t.createElement(nr,{icon:t.createElement(Ye,null),type:"primary",onClick:this.printClickHandle},un("qm.print.print")))),t.createElement("div",{className:"main"},t.createElement(bh.Provider,{value:this.provide},t.createElement(Sh,{ref:this.containRef,templateRender:n,directPrint:!1}))),t.createElement("div",{className:"footer"},t.createElement("span",null,un("qm.print.scale"),":",t.createElement(J,{value:i.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>Ie({},t,{form:{scale:e}})))}}),t.createElement("em",{className:"scale-text"},`${Math.floor(100*i.scale)}%`)),t.createElement("span",null,un("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),t.createElement("span",null,un("qm.print.pageNumber"),":",un("qm.print.pagination",{currentPage:l,totalPage:a}))))),t.createElement(Fl,c,t.createElement(Nh,{setting:i.setting,onChange:e=>{this.setState((t=>Ie({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):t.createElement(bh.Provider,{value:this.provide},t.createElement(Sh,{ref:this.containRef,templateRender:n,directPrint:!0}))}}Th.contextType=on;class Ih extends d{constructor(){super(...arguments),this.previewRef=t.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Hn(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const n=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof n&&!n)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:n,uniqueKey:r,defaultConfig:i,preview:l,closeAfterPrint:a}=this.props,o={visible:e,title:un("qm.print.preview"),width:`${yh.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},s={ref:this.previewRef,templateRender:n,uniqueKey:r,defaultConfig:i,preview:l,closeAfterPrint:a,onClose:()=>{this.setState({visible:!1})}};return l?t.createElement(Fl,o,t.createElement(Th,s)):e?t.createElement(Th,s):null},this.DO_PRINT=()=>Hn(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield Wn(0),this.setState({visible:!0}),yield Wn(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:n,icon:r,type:i,disabled:l,shape:a}=this.props,o={size:n||this.context.size||"",type:i,shape:a,icon:r,loading:e,disabled:l,click:this.clickHandle};return t.createElement(t.Fragment,null,this.props.children&&t.createElement(nr,o,this.props.children),this.createRender())}}function Rh(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function Oh(e){const t=Rh(e);return t?t.frameElement:null}function kh(e){const t=Ph(e);return Lh([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Lh(e){return e.reduce(((e,t)=>null==e?t:{top:e.top+t.top,left:e.left+t.left,width:e.width,height:e.height,bottom:e.bottom+t.bottom,right:e.right+t.right}))}function Ah(e,t){const n=Oh(e);if(n&&n!==t){const r=[e.getBoundingClientRect()];let i=n,l=!1;for(;i;){const e=kh(i);if(r.push(e),i=Oh(i),l)break;i&&Rh(i)===t&&(l=!0)}return Lh(r)}return e.getBoundingClientRect()}function Ph(e){const t=window.getComputedStyle(e);return{borderLeft:parseInt(t.borderLeftWidth,10),borderRight:parseInt(t.borderRightWidth,10),borderTop:parseInt(t.borderTopWidth,10),borderBottom:parseInt(t.borderBottomWidth,10),marginLeft:parseInt(t.marginLeft,10),marginRight:parseInt(t.marginRight,10),marginTop:parseInt(t.marginTop,10),marginBottom:parseInt(t.marginBottom,10),paddingLeft:parseInt(t.paddingLeft,10),paddingRight:parseInt(t.paddingRight,10),paddingTop:parseInt(t.paddingTop,10),paddingBottom:parseInt(t.paddingBottom,10)}}Ih.propTypes={size:(e,t,n)=>{if(!Fa(e[t]||""))return er("Print","Invalid prop `"+t+"` supplied to `"+n+"`. Validation failed.")},templateRender:Ut.elementType},Ih.defaultProps={preview:!0,type:"primary",icon:t.createElement(Ye,null)},Ih.contextType=on;const _h=Object.assign;class Dh{constructor(e,t){this.node=e.createElement("div"),this.border=e.createElement("div"),this.padding=e.createElement("div"),this.content=e.createElement("div"),this.border.style.borderColor=$h.border,this.padding.style.borderColor=$h.padding,this.content.style.backgroundColor=$h.background,_h(this.node.style,{borderColor:$h.margin,pointerEvents:"none",position:"fixed"}),this.node.style.zIndex="10000000",this.node.appendChild(this.border),this.border.appendChild(this.padding),this.padding.appendChild(this.content),t.appendChild(this.node)}remove(){this.node.parentNode&&this.node.parentNode.removeChild(this.node)}update(e,t){Mh(t,"margin",this.node),Mh(t,"border",this.border),Mh(t,"padding",this.padding),_h(this.content.style,{height:e.height-t.borderTop-t.borderBottom-t.paddingTop-t.paddingBottom+"px",width:e.width-t.borderLeft-t.borderRight-t.paddingLeft-t.paddingRight+"px"}),_h(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Hh{constructor(e,t){this.tip=e.createElement("div"),_h(this.tip.style,{display:"flex",flexFlow:"row nowrap",backgroundColor:"#333740",borderRadius:"2px",fontFamily:'"SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace',fontWeight:"bold",padding:"3px 5px",pointerEvents:"none",position:"fixed",fontSize:"12px",whiteSpace:"nowrap"}),this.nameSpan=e.createElement("span"),this.tip.appendChild(this.nameSpan),_h(this.nameSpan.style,{color:"#ee78e6",borderRight:"1px solid #aaaaaa",paddingRight:"0.5rem",marginRight:"0.5rem"}),this.dimSpan=e.createElement("span"),this.tip.appendChild(this.dimSpan),_h(this.dimSpan.style,{color:"#d7d7d7"}),this.tip.style.zIndex="10000000",t.appendChild(this.tip)}remove(){this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip)}updateText(e,t,n){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(n)+"px"}updatePosition(e,t){const n=this.tip.getBoundingClientRect(),r=function(e,t,n){const r=Math.max(n.height,20),i=Math.max(n.width,60),l=5;let a;a=e.top+e.height+r<=t.top+t.height?e.top+e.height<t.top+0?t.top+l:e.top+e.height+l:e.top-r<=t.top+t.height?e.top-r-l<t.top+l?t.top+l:e.top-r-l:t.top+t.height-r-l;let o=e.left+l;e.left<t.left&&(o=t.left+l);e.left+i>t.left+t.width&&(o=t.left+t.width-i-l);return a+="px",o+="px",{style:{top:a,left:o}}}(e,t,{width:n.width,height:n.height});_h(this.tip.style,r.style)}}class Fh{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const n=e.document;this.container=n.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Hh(n,this.container),this.rects=[],n.body.appendChild(this.container)}remove(){this.tip.remove(),this.rects.forEach((e=>{e.remove()})),this.rects.length=0,this.container.parentNode&&this.container.parentNode.removeChild(this.container)}inspect(e,t){const n=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>n.length;){const e=this.rects.pop();null==e||e.remove()}if(0===n.length)return;for(;this.rects.length<n.length;)this.rects.push(new Dh(this.window.document,this.container));const r={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};n.forEach(((e,t)=>{const n=Ah(e,this.window),i=Ph(e);r.top=Math.min(r.top,n.top-i.marginTop),r.right=Math.max(r.right,n.left+n.width+i.marginRight),r.bottom=Math.max(r.bottom,n.top+n.height+i.marginBottom),r.left=Math.min(r.left,n.left-i.marginLeft);this.rects[t].update(n,i)})),t||(t=n[0].nodeName.toLowerCase(),n[0]),this.tip.updateText(t,r.right-r.left,r.bottom-r.top);const i=Ah(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:r.top,left:r.left,height:r.bottom-r.top,width:r.right-r.left},{top:i.top+this.tipBoundsWindow.scrollY,left:i.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Mh(e,t,n){_h(n.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const $h={background:"rgba(120, 170, 210, 0.7)",padding:"rgba(77, 200, 0, 0.3)",margin:"rgba(255, 155, 0, 0.3)",border:"rgba(255, 200, 50, 0.3)"};let qh=null,jh=null;function Kh(){null!=window.document&&(qh=null,null!==jh&&(jh.remove(),jh=null))}class Vh{constructor(e){this._lastHoveredNode=null,this.iframesListeningTo=new Set,this.onClick=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onMouseEvent=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.onPointerDown=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation(),this.selectFiberForNode(this.getEventTarget(e)))},this.onPointerMove=e=>{e.preventDefault(),e.stopPropagation();const t=this.getEventTarget(e);if(this._lastHoveredNode!==t){if(this._lastHoveredNode=t,this.excludeSelectors.some((e=>Gi(t,window.document.querySelector(e)))))return this._selectIgnore=!0,Kh();if(this._selectIgnore=!1,"IFRAME"===t.tagName){const e=t;try{if(!this.iframesListeningTo.has(e)){const t=e.contentWindow;this.registerListenersOnWindow(t),this.iframesListeningTo.add(e)}}catch(e){}}var n,r,i;n=[t],r=null,i=!1,null!=window.document?(null!==qh&&clearTimeout(qh),null!=n&&(null===jh&&(jh=new Fh),jh.inspect(n,r),i&&(qh=setTimeout((()=>Kh()),2e3)))):null!=n&&null!=n[0]&&console.error("showNativeHighlight",n[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=Ae((e=>{var t;this._selectIgnore||null===(t=this.onSelect)||void 0===t||t.call(this,e,function(e){if(!(e instanceof Element))return"";const t=document.documentElement;let n=e;const r=[];for(;n!==t&&null!==n;){let e=n.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,r=Array.from(n.classList).reverse();e<r.length;e++)t.test(r[e])&&n.classList.remove(r[e]);if(n.id&&/^rc-\w+/.test(n.id)&&n.removeAttribute("id"),n.id)e+=`#${n.id}`;else{const t=Array.from(n.parentElement.children).filter((e=>e.tagName===n.tagName)),r=n.className.trim();if(t.filter((e=>e.className.includes(r))).length<=1){if(r){const t=r.split(/\s+/);let n="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(n+=`.${t[e]}`);e+=n}}else n.getAttribute("name")?e+=`[name=${n.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(n)+1})`}n.nodeType!==Node.TEXT_NODE&&r.unshift(e),n=n.parentElement}return r.join(" > ")}(e))}),200,{leading:!1}),this.excludeSelectors=e.excludeSelectors||[],this.onSelect=e.onSelect}startHandle(){this.startInspectingNative()}stopHandle(){this.stopInspectingNative()}startInspectingNative(){this._isRunning||(this.registerListenersOnWindow(window),this._isRunning=!0)}stopInspectingNative(){Kh(),this.removeListenersOnWindow(window),this.iframesListeningTo.forEach((function(e){try{this.removeListenersOnWindow(e.contentWindow)}catch(e){}})),this.iframesListeningTo=new Set,this._isRunning=!1}registerListenersOnWindow(e){e&&"function"==typeof e.addEventListener&&(e.addEventListener("click",this.onClick,!0),e.addEventListener("mousedown",this.onMouseEvent,!0),e.addEventListener("mouseover",this.onMouseEvent,!0),e.addEventListener("mouseup",this.onMouseEvent,!0),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0))}removeListenersOnWindow(e){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("click",this.onClick,!0),e.removeEventListener("mousedown",this.onMouseEvent,!0),e.removeEventListener("mouseover",this.onMouseEvent,!0),e.removeEventListener("mouseup",this.onMouseEvent,!0),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0))}getEventTarget(e){return e.composed?e.composedPath()[0]:e.target}}function zh(e){return document.querySelector(e)}const Wh=e=>{const{action:n,onConfirm:r,onCancel:i,onFinish:l}=e,{t:a}=Fn();return t.createElement(t.Fragment,null,t.createElement("div",{style:{height:100}},a("qm.table.config.emptyText")),t.createElement(ir,{style:{width:"100%",justifyContent:"flex-end"}},t.createElement(nr,{size:"small",onClick:()=>null==i?void 0:i()},a("qm.guideTracker.closeButton")),t.createElement(nr,{size:"small",onClick:()=>null==r?void 0:r()},a("add"===n?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),t.createElement(nr,{size:"small",onClick:()=>null==l?void 0:l()},a("qm.guideTracker.finishButton"))))},Bh={left:"50%",top:"50%",width:1,height:1},Uh=t.forwardRef(((e,n)=>{const{open:r,current:i,defaultCurrent:l,steps:a=[],placement:o="bottom",control:s=!0,overlayClassName:c,overlayStyle:d,destroyOnHide:u,contentRender:p,zIndex:m,helper:h={},selectFilter:f=(e=>e),onSelect:g,onChange:v,onClose:y,onFinish:b}=e,{t:x}=Fn(),E=t.useRef(),w=t.useRef(a.length),[S,N]=ns(0,{value:i,defaultValue:l}),[T,I]=ns(void 0,{value:r,postState:e=>null!=e&&e}),[R,O]=ns(1051,{value:m,defaultValue:m}),[k,L]=t.useState({}),[A,P]=t.useState(!1),[_,D]=t.useState(T),[H,F]=t.useState(!1),[$,q]=dh(k.node,!!r),[j,K]=t.useState(22),z=t.useRef(!1),W=t.useMemo((()=>S>=a.length?"add":"edit"),[S,a]),B=t.useMemo((()=>`${S+1} / ${a.length}`),[S,a]);t.useLayoutEffect((()=>{E.current=new Vh({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=f(t),L({id:Sa(),node:e,path:t}),N(w.current),P(!0),G(),null==g||g(t,e)}})}),[]),t.useEffect((()=>(T?U():G(),T?setTimeout((()=>D(!0)),16):D(!1),()=>{G()})),[T]),t.useEffect((()=>{w.current=a.length}),[a]);const U=()=>{E.current.startHandle()},G=()=>{E.current.stopHandle()},Y=e=>{e.stopPropagation(),e.preventDefault()};t.useImperativeHandle(n,(()=>({OPEN:()=>I(!0),CLOSE:()=>I(!1),GET_CURRENT_STEP:()=>({current:S,selector:k.path})})));const X=lr("guide-tracker"),Q=[{[`${X}-primary`]:!0}],Z=Wd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return t.createElement(t.Fragment,null,t.createElement(tn,{open:T&&A,autoLock:!0},t.createElement(Zt,{zIndex:R,builtinPlacements:Z,popupPlacement:o,popupVisible:T&&A,popupClassName:Pe(Q,c),popupStyle:d,prefixCls:X,popup:()=>{const e=()=>{P(!1),U()};return t.createElement("div",{className:`${X}-content`},t.createElement("div",{className:`${X}-inner`},t.createElement(it,{className:`${X}-close`,onClick:()=>{null==y||y(S),e()}}),t.createElement(M,{open:H,trigger:["click"],dropdownRender:()=>a.length?t.createElement("div",{className:"ant-dropdown-menu step-list"},t.createElement(Gt,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.id)),n=a.map((e=>e.id));if(me(t,n))return;const r=t.findIndex((e=>e===k.id)),i=-1!==r?r:S;N(i),null==v||v(Da(e),i)}},a.map(((e,n)=>t.createElement("li",{key:n,className:Pe("item",{actived:e.id===k.id})},t.createElement(Be,{className:"handle",title:x("qm.form.draggable")}),t.createElement("span",{className:"box"},t.createElement("span",{className:"title",title:e.title,onClick:()=>{n!==S&&(L({id:e.id,node:zh(e.selector),path:e.selector}),N(n),K(22===j?j+1:j-1),null==v||v(a,n))}},e.title),t.createElement(C,{title:x("qm.button.confirmTitle"),zIndex:R+1,onConfirm:()=>{const t=a.filter((t=>t.id!==e.id)),r=n===S;let i=n<=S?S-1:S;if(i=i<0?0:i,i=i>t.length?t.length:i,r&&t[i]){const{id:e,selector:n}=t[i];L({id:e,node:zh(n),path:n})}N(i),null==v||v(t,i)}},t.createElement(it,{className:"close-icon"})))))))):t.createElement(t.Fragment,null),overlayClassName:`${X}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:R},onOpenChange:e=>F(e)},t.createElement(Dt,{className:Pe(`${X}-close`,"menu-icon"),style:{width:j}})),h.content&&t.createElement(V,{placement:"bottom",overlayStyle:{width:360,zIndex:R},content:h.content,title:h.title},t.createElement(_t,{className:Pe(`${X}-close`,"help-icon")})),t.createElement("div",{className:"panel-label"},t.createElement("span",{className:"title"},x("qm.guideTracker.label")),t.createElement("span",{className:"step"},x("qm.guideTracker.currentStep"),B)),p?p({id:k.id,selector:k.path,actionStatus:W,DO_CLOSE:e},S):t.createElement(Wh,{action:W,onConfirm:()=>{null==v||v("add"===W?[...a,{id:k.id,selector:k.path,title:"Guide Title"}]:[...a],S),e()},onCancel:()=>{null==y||y(S),e()},onFinish:()=>{e(),null==y||y(S),null==b||b()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:u},t.createElement("div",{className:Pe(`${X}-target-placeholder`),style:Object.assign(Object.assign({},$||Bh),{position:"fixed",zIndex:R-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:Y,onClick:Y}))),s&&t.createElement(tn,{open:_},t.createElement(mh,{zIndex:R,prefixCls:X,onPause:()=>{z.current=A,P(!1),G()},onPlay:()=>{z.current?P(!0):U()}})))}));Uh.displayName="QmGuideTracker";const Gh=n=>{var r,i,l,a,o,s,c,d;const{content:u,image:p,width:m,height:h,font:f={},gap:g=[100,100],offset:v=[50,50],rotate:y=-22,zIndex:b=9,alpha:x=1,antiTamper:E=!0,grayscale:w,className:C,style:S}=n,N=t.useRef(null),T=t.useRef(new Map),I=null!==(r=f.fontSize)&&void 0!==r?r:16,R=null!==(i=f.fontWeight)&&void 0!==i?i:"normal",O=null!==(l=f.fontStyle)&&void 0!==l?l:"normal",k=null!==(a=f.fontFamily)&&void 0!==a?a:"sans-serif",L=null!==(o=f.color)&&void 0!==o?o:"rgba(0, 0, 0, 0.15)",A=null!==(s=f.textAlign)&&void 0!==s?s:"center",P=Array.isArray(u)?u:[u],_=g[0],D=g[1],H=_/2,F=D/2,M=null!==(c=v[0])&&void 0!==c?c:H,$=null!==(d=v[1])&&void 0!==d?d:F,q=t.useMemo((()=>{const e=M-H,t=$-F;return{position:"absolute",left:e>0?`${e}px`:0,top:t>0?`${t}px`:0,width:e>0?`calc(100% - ${e}px)`:"100%",height:t>0?`calc(100% - ${t}px)`:"100%",pointerEvents:"none",backgroundRepeat:"repeat",backgroundPosition:`${e>0?0:e}px ${t>0?0:t}px`,zIndex:b}}),[H,F,M,$,b]),j=(e,t)=>{var n;if(N.current){const r=T.current.get(N.current);r&&(N.current.contains(r)&&N.current.removeChild(r),T.current.delete(N.current));const i=document.createElement("div");i.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${n=e,n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var n})).join(";"))(Object.assign(Object.assign({},q),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(n=N.current)||void 0===n||n.append(i),T.current.set(N.current,i)}},K=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const n=(e=>{if(!e)return 1;const t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t})(t),[r,i]=(e=>{let t=120,n=64;if(!p&&e.measureText){e.font=`${I}px ${k}`;const r=P.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...r)),n=I*P.length+3*(P.length-1)}return[null!=m?m:t,null!=h?h:n]})(t),l=r*n,a=i*n,o=(_+r)*n,s=(D+i)*n,c=_/2*n,d=D/2*n,u=o/2,f=s/2,g=2*(_+r);e.width=2*o,e.height=2*s,t.globalAlpha=x,t.save(),t.translate(u,f),t.rotate(Math.PI/180*y),t.translate(-u,-f);const v=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),w&&(e=>{const t=e.getContext("2d");if(!t)return;const n=t.getImageData(0,0,e.width,e.height),{data:r}=n;for(let e=0;e<r.length;e+=4){const t=(r[e]+r[e+1]+r[e+2])/3;r[e]=t,r[e+1]=t,r[e+2]=t}t.putImageData(n,0,0)})(e),j(e.toDataURL(),g)},b=()=>{const e=Number(I)*n;t.font=`${O} normal ${R} ${e}px/${i}px ${k}`,t.fillStyle=L,t.textAlign=A,t.textBaseline="top",t.translate(l/2,0),P.forEach(((r,i)=>{t.fillText(null!=r?r:"",c,d+i*(e+3*n))})),v()};if(p){const e=new Image;e.onload=()=>{t.drawImage(e,c,d,l,a),v()},e.onerror=()=>{b()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=p}else b()},V=e=>Array.from(T.current.values()).includes(e);t.useEffect((()=>{K()}),[u,p,m,h,f,g,v,y,b,x,E,w]),function(t,n,r={}){const i=window&&"MutationObserver"in window,l=e.useRef(),a=()=>{l.current&&(l.current.disconnect(),l.current=void 0)};e.useLayoutEffect((()=>(a(),i&&t.current&&(l.current=new MutationObserver(n),l.current.observe(t.current,r)),()=>a())),[t])}(N,(e=>{if(E)for(const t of e){const e=Array.from(t.removedNodes).some((e=>V(e))),n="attributes"===t.type&&V(t.target);if(e||n){K();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=lr("watermark");return t.createElement("div",{ref:N,className:Pe(z,C),style:Object.assign({position:"relative"},S)},n.children)},Yh=new Map,Xh=new WeakMap;let Qh,Zh=0;function Jh(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Xh.has(n)||(Zh+=1,Xh.set(n,Zh.toString())),Xh.get(n)):"0"):e[t]}`;var n})).toString()}function ef(e,t,n={},r=Qh){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:l,elements:a}=function(e){const t=Jh(e);let n=Yh.get(t);if(!n){const r=new Map;let i=[];const l=new IntersectionObserver((t=>{t.forEach((t=>{var n;const l=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=l),null===(n=r.get(t.target))||void 0===n||n.forEach((e=>{e(l,t)}))}))}),e);i=l.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:l,elements:r},Yh.set(t,n)}return n}(n),o=a.get(e)||[];return a.has(e)||a.set(e,o),o.push(t),l.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(a.delete(e),l.unobserve(e)),0===a.size&&(l.disconnect(),Yh.delete(i))}}const tf=e=>{const{forceRender:n,height:r,placeholder:i=null,unmountIfInvisible:l,className:a,style:o}=e,{ref:s,inView:c,entry:d}=(({root:e,rootMargin:n,threshold:r,triggerOnce:i,fallbackInView:l,trackVisibility:a,skip:o,delay:s,onChange:c}={})=>{var d;const[u,p]=t.useState(null),[m,h]=t.useState({inView:!1,entry:void 0}),f=t.useRef(c);t.useEffect((()=>{if(o||!u)return;let t;return t=ef(u,((e,n)=>{var r;h({inView:e,entry:n}),null===(r=f.current)||void 0===r||r.call(f,e,n),n.isIntersecting&&i&&t&&(t(),t=void 0)}),{root:e,rootMargin:n,threshold:r,trackVisibility:a,delay:s},l),()=>{t&&t()}}),[Array.isArray(r)?r.toString():r,u,e,n,i,o,a,l,s]);const g=null===(d=m.entry)||void 0===d?void 0:d.target,v=t.useRef();u||!g||i||o||v.current===g||(v.current=g,h({inView:!1,entry:void 0}));const y=[p,m.inView,m.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y})(Object.assign({},e,{triggerOnce:!l}));t.useEffect((()=>{r||tr("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[lr("lazy-load")]:!0};return t.createElement("div",{ref:s,className:Pe(u,a),style:o},n||c?e.children:t.createElement("div",{className:"placeholder",style:{height:r}},i))};class nf{constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class rf{static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,r=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new rf(e[1],n,r,e[2],t.start,t.end)}static calculateControlPoints(e,t,n){const r=e.x-t.x,i=e.y-t.y,l=t.x-n.x,a=t.y-n.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,c=(t.x+n.x)/2,d=(t.y+n.y)/2,u=Math.sqrt(r*r+i*i),p=Math.sqrt(l*l+a*a),m=p/(u+p),h=c+(o-c)*m,f=d+(s-d)*m,g=t.x-h,v=t.y-f;return{c1:new nf(o+g,s+v),c2:new nf(c+g,d+v)}}constructor(e,t,n,r,i,l){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=r,this.startWidth=i,this.endWidth=l}length(){let e,t,n=0;for(let r=0;r<=10;r+=1){const i=r/10,l=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){const r=l-e,i=a-t;n+=Math.sqrt(r*r+i*i)}e=l,t=a}return n}point(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e}}class lf{constructor(e,t){this.width=320,this.height=200,this.ratio=Math.max(window.devicePixelRatio||1,1),this.penColor="rgba(0,0,0,1)",this.backgroundColor="rgba(0,0,0,0)",this.canAddHistory=!1,this.openSmooth=!0,this.dotSize=0,this.throttle=16,this.minDistance=5,this.velocityFilterWeight=.7,this.compositeOperation="source-over",this.minWidth=.5,this.maxWidth=2.5,this.fontSize=16,this.eraserSize=20,this.lineHeight=1.25,this.degreeOfBlur=5,this.textInputPos={x:0,y:0},this.onStart=()=>{},this.onEnd=()=>{},this._drawingStroke=!1,this._lastPoints=[],this._data=[],this._historyList=[],this._lastVelocity=0,this._lastWidth=0,this.setCanvasSize=()=>{this.canvas.style.height=`${this.height}px`,this.canvas.style.width=`${this.width}px`,this.canvas.height=this.height*this.ratio,this.canvas.width=this.width*this.ratio,1!==this.ratio&&this.ctx.scale(this.ratio,this.ratio)},this.setTextInput=()=>{this.openSmooth||(this.textInput.setAttribute("class","signature__text-input"),this.textInput.setAttribute("contentEditable","true"),this.textInput.setAttribute("spellCheck","false"),this.canvas.parentNode.appendChild(this.textInput))},this.isTouchEvent=e=>"touches"in e,this.addListener=()=>{this.removeListener(),this.canvas.style.touchAction="none",this.canvas.style.userSelect="none",("ontouchstart"in window||navigator.maxTouchPoints)&&(this.canvas.addEventListener("touchstart",this.onDrawStart,{passive:!1}),this.canvas.addEventListener("touchmove",this.onDrawMove,{passive:!1}),document.addEventListener("touchcancel",this.onDrawEnd,{passive:!1}),document.addEventListener("touchend",this.onDrawEnd,{passive:!1})),this.canvas.addEventListener("mousedown",this.onDrawStart),this.canvas.addEventListener("mousemove",this.onDrawMove),document.addEventListener("mouseup",this.onDrawEnd),this.textInput.addEventListener("blur",this.onInputBlur)},this.removeListener=()=>{this.canvas.style.touchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("touchstart",this.onDrawStart),this.canvas.removeEventListener("touchmove",this.onDrawMove),document.removeEventListener("touchend",this.onDrawEnd),document.removeEventListener("touchcancel",this.onDrawEnd),this.canvas.removeEventListener("mousedown",this.onDrawStart),this.canvas.removeEventListener("mousemove",this.onDrawMove),document.removeEventListener("mouseup",this.onDrawEnd),this.textInput.removeEventListener("blur",this.onInputBlur)},this._isLeftButtonPressed=(e,t)=>this.isTouchEvent(e)?!!e.touches.length:t?1===e.buttons:1==(1&e.buttons),this._pointerEventToSignatureEvent=e=>{var t,n;return{event:e,type:e.type,x:this.isTouchEvent(e)?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX,y:this.isTouchEvent(e)?null===(n=e.touches[0])||void 0===n?void 0:n.clientY:e.clientY,pressure:"pressure"in e?e.pressure:0}},this._getPointGroupOptions=e=>({penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}),this._strokeBegin=e=>{this._drawingStroke=!0;const t=this._getPointGroupOptions(),n=Object.assign(Object.assign({},t),{points:[]});this._data.push(n),this._reset(t),this._strokeUpdate(e,!1)},this._strokeUpdate=(e,t=!0)=>{if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);const n=this._createPoint(e.x,e.y,e.pressure),r=this._data[this._data.length-1],i=r.points,l=i.length>0&&i[i.length-1],a=!!l&&n.distanceTo(l)<=this.minDistance,o=this._getPointGroupOptions(r);if(!l||!l||!a){const e=this._addPoint(n,o);t&&(l?e&&this._drawCurve(e,o):this._drawDot(n,o)),i.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}},this._strokeEnd=(e,t=!1)=>{this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1)},this._reset=e=>{this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this.ctx.fillStyle=e.penColor,this.ctx.globalCompositeOperation=e.compositeOperation},this._drawDot=(e,t)=>{const n=this.ctx,r=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=t.penColor,n.fill()},this._drawCurve=(e,t)=>{const n=this.ctx,r=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<i;n+=1){const l=n/i,a=l*l,o=a*l,s=1-l,c=s*s,d=c*s;let u=d*e.startPoint.x;u+=3*c*l*e.control1.x,u+=3*s*a*e.control2.x,u+=o*e.endPoint.x;let p=d*e.startPoint.y;p+=3*c*l*e.control1.y,p+=3*s*a*e.control2.y,p+=o*e.endPoint.y;const m=Math.min(e.startWidth+o*r,t.maxWidth);this._drawCurveSegment(u,p,m)}n.closePath(),n.fill()},this._drawCurveSegment=(e,t,n)=>{const r=this.ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1)},this._createPoint=(e,t,n)=>{const r=this.canvas.getBoundingClientRect();return new nf(e-r.left,t-r.top,n,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);const e=this._calculateCurveWidths(n[1],n[2],t),r=rf.fromPoints(n,e);return n.shift(),r}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,n)=>{const r=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(r,n),l={end:i,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=i,l},this.onDrawStart=e=>{var t;e.preventDefault(),this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&(this._strokeBegin(this._pointerEventToSignatureEvent(e)),this.ctx.strokeStyle=this.penColor,this.ctx.lineWidth=this.maxWidth,"line"===this.mode&&this.createPencil(e),"eraser"===this.mode&&this.createEraser(e),"text"===this.mode&&this.createTextInput(e),null===(t=this.onStart)||void 0===t||t.call(this,e))},this.onDrawMove=e=>{e.preventDefault(),"text"!==this.mode&&(this._isLeftButtonPressed(e,!0)&&this._drawingStroke?window.requestAnimationFrame?window.requestAnimationFrame((()=>this.drawHandler(e))):this.drawHandler(e):this._strokeEnd(this._pointerEventToSignatureEvent(e)))},this.onDrawEnd=e=>{var t;this._isLeftButtonPressed(e)||(this._strokeEnd(this._pointerEventToSignatureEvent(e)),"text"!==this.mode&&this.addHistory(),null===(t=this.onEnd)||void 0===t||t.call(this,e))},this.onInputBlur=e=>{this.textInput.classList.remove("show"),this.drawHandler(e),this.textInput.innerText="",this.addHistory()},this.drawHandler=e=>{switch(this.mode){case"line":this.drawLine(e);break;case"square":this.drawSquare(e);break;case"round":this.drawRound(e);break;case"arrow":this.drawArrow(e);break;case"mosaic":this.drawMosaic(e);break;case"text":this.drawText(e);break;case"eraser":this.drawEraser(e)}this.canAddHistory=!0},this.drawSquare=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,n,r-t,i-n),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=Math.min(r,t),a=Math.min(i,n),o=.5*(Math.max(r,t)-l),s=.5*(Math.max(i,n)-a),c=l+o,d=a+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(c,d,o,s,0,0,2*Math.PI),this.ctx.stroke(),this.ctx.closePath(),this.ctx.restore()},this.drawArrow=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0],{x:r,y:i}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),l=180*Math.atan2(n-i,t-r)/Math.PI,a=(l+25)*Math.PI/180,o=(l-25)*Math.PI/180,s=15*Math.cos(a),c=15*Math.sin(a),d=15*Math.cos(o),u=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(r,i),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(r,i);const p=r+s,m=i+c;this.ctx.lineTo(p,m);const h=r+d,f=i+u;this.ctx.lineTo(h,f),this.ctx.lineTo(r,i),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,n)=>{const r=e.width,i=e.data,l=[];return l[0]=i[4*(n*r+t)],l[1]=i[4*(n*r+t)+1],l[2]=i[4*(n*r+t)+2],l[3]=i[4*(n*r+t)+3],l},this.setAxisColor=(e,t,n,r)=>{const i=e.width,l=e.data;l[4*(n*i+t)]=r[0],l[4*(n*i+t)+1]=r[1],l[4*(n*i+t)+2]=r[2],l[4*(n*i+t)+3]=r[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=this.ctx.getImageData(t*this.ratio,n*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),i=r.width,l=r.height,a=i/this.degreeOfBlur,o=l/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=this.getAxisColor(r,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let i=0;i<this.degreeOfBlur;i++)for(let l=0;l<this.degreeOfBlur;l++)this.setAxisColor(r,t*this.degreeOfBlur+l,e*this.degreeOfBlur+i,n)}this.ctx.putImageData(r,t*this.ratio,n*this.ratio)},this.drawText=e=>{const{x:t,y:n}=this.textInputPos;if(0===t&&0===n)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const r=this.fontSize*this.lineHeight,i=this.width-t,l=e.target.innerText,a=[];let o="";for(let e=0;e<l.length;e++){const t=o+l[e];this.ctx.measureText(t).width>i&&o.length>0?(a.push(o),o=l[e]):o=t}a.push(o),a.forEach(((e,i)=>{this.ctx.fillText(e,t+1,n+i*r+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawPencil=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,n)},this.drawEraser=e=>{const{x:t,y:n}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,n),this.ctx.stroke(),this.ctx.globalCompositeOperation="source-over"},this.drawLine=e=>{this.openSmooth?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e)):this.drawPencil(e)},this.createTextInput=e=>{if(!this._lastPoints.length)return;const{x:t,y:n}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=n?this.textInput.blur():(this.textInput.classList.add("show"),this.setInputStyle(),this.textInput.focus())},this.setInputStyle=()=>{if(!this._lastPoints.length)return;const{x:e,y:t}=this._lastPoints[0];this.textInput.style.left=e+"px",this.textInput.style.lineHeight=this.lineHeight.toString(),this.textInput.style.fontSize=this.fontSize+"px",this.textInput.style.color=this.penColor,this.textInput.style.top=t-Math.floor((this.textInput.offsetHeight-2)/2)+"px",this.textInputPos={x:e,y:t}},this.drawBgColor=()=>{this.backgroundColor&&(this.ctx.fillStyle=this.backgroundColor,this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height))},this.clearWorkSpace=()=>{this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)},this.addHistory=()=>{this.canAddHistory&&(this.canAddHistory=!1,this._historyList.push(this.ctx.getImageData(0,0,this.canvas.width,this.canvas.height)))},this.getLastHistory=()=>this._historyList[this._historyList.length-1],this.setLastHistory=()=>{const e=this.getLastHistory();e?this.ctx.putImageData(e,0,0):this.clearWorkSpace()},this.clear=()=>{this.clearWorkSpace(),this.drawBgColor(),this._historyList=[],this._data=[],this._reset(this._getPointGroupOptions())},this.undo=()=>{const e=this._historyList[this._historyList.length-2];e?(this.ctx.putImageData(e,0,0),this._historyList.pop()):this.clear()},this.setDrawMode=e=>{this.mode=e},this.setLineWidth=e=>{this.maxWidth=e},this.setPenColor=e=>{this.penColor=e},this.setFontSize=e=>{this.fontSize=e},this.isEmpty=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");return e.width=this.canvas.width,e.height=this.canvas.height,1!==this.ratio&&t.scale(this.ratio,this.ratio),this.backgroundColor&&(t.fillStyle=this.backgroundColor,t.fillRect(0,0,e.width,e.height)),e.toDataURL()===this.canvas.toDataURL()},this.toDataURL=(e="image/png",t=1)=>{if(this.canvas.width===this.width)return this.canvas.toDataURL(e,t);const n=document.createElement("canvas");n.width=this.width,n.height=this.height;return n.getContext("2d").drawImage(this.canvas,0,0,n.width,n.height),n.toDataURL(e,t)},this.getPNG=()=>this.toDataURL(),this.getJPG=(e=.8)=>this.toDataURL("image/jpeg",e),this.initial(e,t)}initial(e,t={}){e&&(this.canvas=e,this.ctx=e.getContext("2d"),this.textInput=document.createElement("div"),this.width=t.width||e.clientWidth||this.width,this.height=t.height||e.clientHeight||this.height,this.penColor=t.penColor||this.penColor,this.fontSize=t.fontSize||this.fontSize,this.openSmooth=void 0===t.openSmooth?this.openSmooth:!!t.openSmooth,this.backgroundColor=this.openSmooth&&t.backgroundColor||this.backgroundColor,this.mode=t.mode||this.mode,this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,r,i,l=0,a=null;const o=()=>{l=Date.now(),a=null,n=e.apply(r,i),a||(r=null,i=[])};return function(...s){const c=Date.now(),d=t-(c-l);return r=this,i=s,d<=0||d>t?(a&&(clearTimeout(a),a=null),l=c,n=e.apply(r,i),a||(r=null,i=[])):a||(a=window.setTimeout(o,d)),n}}(this._strokeUpdate,this.throttle):this._strokeUpdate,this.minWidth=t.minWidth||this.minWidth,this.maxWidth=t.maxWidth||this.maxWidth,this.onStart=t.onStart,this.onEnd=t.onEnd,this.setCanvasSize(),this.setTextInput(),this.drawBgColor(),this.addListener())}update(){this.setCanvasSize(),this.clear()}destroy(){this.removeListener();for(const e in this)Object.prototype.hasOwnProperty.call(this,e)&&(this[e]=null)}}lf.dataURLToBlob=e=>{const t=e.split(";base64,"),n=t[0].split(":")[1],r=window.atob(t[1]),i=r.length,l=new Uint8Array(i);for(let e=0;e<i;++e)l[e]=r.charCodeAt(e);return new Blob([l],{type:n})},lf.canvasToDataURL=e=>e.toDataURL("image/png",1),lf.canvasToBlob=e=>new Promise(((t,n)=>{e.toBlob((e=>e?t(e):n(null)),"image/png",1)}));const af=()=>t.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"})),of=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M839.111111 269.198222V122.908444A9.159111 9.159111 0 0 0 829.980444 113.777778H208.213333A9.159111 9.159111 0 0 0 199.111111 122.908444v146.289778c0 5.034667 4.124444 9.159111 9.130667 9.159111h64a9.159111 9.159111 0 0 0 9.159111-9.159111V196.067556h192v640h-105.159111a9.159111 9.159111 0 0 0-9.130667 9.130666v64c0 5.034667 4.124444 9.159111 9.130667 9.159111h301.738666a9.159111 9.159111 0 0 0 9.130667-9.159111v-64a9.159111 9.159111 0 0 0-9.130667-9.130666h-105.159111v-640h192v73.130666c0 5.034667 4.124444 9.159111 9.159111 9.159111h64a9.159111 9.159111 0 0 0 9.130667-9.159111z"})),sf=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M887.65217391 606.59279489a31.26857185 31.26857185 0 0 1-31.26857185-31.26857087v-363.48819946L158.38608696 909.83354065a31.26857185 31.26857185 0 1 1-44.21962762-44.21962761l697.99751609-698.06906805h-363.48819945a31.26857185 31.26857185 0 0 1 0-62.46559075h439.04795087c17.17267109 0 31.26857185 13.95279489 31.26857086 31.19701891v439.04795087a31.26857185 31.26857185 0 0 1-31.3401238 31.26857087z"})),cf=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M606.4 103.424a64 64 0 0 1 0.704 0.64l320.256 280.32a64 64 0 0 1 7.104 89.024l-330.432 398.72 320.448 0.128a32 32 0 0 1 0 64.064H397.632a32.128 32.128 0 0 1-6.208-0.64h-20.736a64 64 0 0 1-42.304-16.064l-238.08-210.112A64 64 0 0 1 83.84 620.16l432.32-509.312a64 64 0 0 1 90.24-7.36zM242.048 537.536l-87.04 101.76a32 32 0 0 0 3.584 45.248l213.12 180.672a32 32 0 0 0 20.736 7.616l-0.64-0.064a32.192 32.192 0 0 1 5.76-0.512h102.016a32 32 0 0 0 18.176-10.496l40.96-47.232-316.672-276.992zM592.96 177.28a32 32 0 0 0-45.12 3.456L283.712 488.96l316.928 277.248 264.512-304.96a32 32 0 0 0 1.024-40.704l-3.904-4.16-268.928-238.72a32 32 0 0 0-0.384-0.32z"})),df=()=>t.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},t.createElement("path",{d:"M607.75537778 291.05948444H223.6416l115.34336-115.41617778a36.37248 36.37248 0 1 0-51.48216889-51.44576L132.61937778 279.04455111c-13.54410667 13.50769778-21.04433778 31.67573333-21.11715556 50.97244444a71.72551111 71.72551111 0 0 0 21.11715556 51.51857778l154.88341333 154.91982222a36.29966222 36.29966222 0 0 0 51.48216889 0 36.37248 36.37248 0 0 0 0-51.48216889l-121.46005333-121.16878222H607.75537778c130.70791111 0 237.02186667 106.16832 237.02186667 236.65777777s-106.31395555 236.65777778-237.02186667 236.65777778h-254.13404445a36.40888889 36.40888889 0 0 0 0 72.81777779h254.13404445c170.83050667 0 309.83964445-138.82709333 309.83964444-309.47555557 0-170.64846222-139.00913778-309.47555555-309.83964444-309.47555555"})),uf=t.forwardRef(((e,n)=>{const{open:r,width:i,height:l,imageName:a,penColor:o,penMode:s,minWidth:c,maxWidth:d,backgroundColor:u,className:p,style:h,onOk:f,onCancel:g}=e,{t:v}=Fn(),y=t.useRef(),b=t.useRef(null),x=t.useRef(null),E=t.useRef(null),w=[2,4,6],C=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[N,T]=ns(void 0,{value:r,postState:e=>null!=e&&e}),I=t.useMemo((()=>!!e.children),[e.children]),[R,O]=t.useState(s||(I?"square":"line")),[k,L]=t.useState(w[0]),[A,P]=t.useState(I?S[0]:S[4]),[_,D]=t.useState(C[1]),[F,$]=t.useState("bottomLeft"),[q,j]=t.useState(!1),[K,V]=t.useState(!1);t.useEffect((()=>{var e,t;const n={width:null!=i?i:null===(e=x.current)||void 0===e?void 0:e.offsetWidth,height:null!=l?l:null===(t=x.current)||void 0===t?void 0:t.offsetHeight,maxWidth:k,mode:R,penColor:A,fontSize:_,backgroundColor:u,openSmooth:!I};return n.openSmooth&&Object.assign(n,{penColor:o,minWidth:c,maxWidth:d}),y.current=new lf(b.current,n),()=>y.current.destroy()}),[]);const z=e=>{var t,n;const[r,a]=[null!=i?i:null===(t=x.current)||void 0===t?void 0:t.offsetWidth,null!=l?l:null===(n=x.current)||void 0===n?void 0:n.offsetHeight],{width:o,height:s}=y.current;let c=!1;r&&r!==o&&(y.current.width=r,c=!0),a&&a!==s&&(y.current.height=a,c=!0),(c||e)&&y.current.update()};Mi((()=>{I&&N&&z()}),[N,I]),Mi((()=>{y.current.setDrawMode(R)}),[R]),Mi((()=>{y.current.setLineWidth(k)}),[k]),Mi((()=>{y.current.setPenColor(A)}),[A]),Mi((()=>{y.current.setFontSize(_)}),[_]);const W=()=>Hn(void 0,void 0,void 0,(function*(){const e=I?x.current.parentNode:b.current;if(e)try{const t=yield an(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return lf.canvasToDataURL(t)}catch(e){tr("Signature","生成合成图片失败!")}})),B=()=>{y.current.clear(),null==g||g()};t.useImperativeHandle(n,(()=>({OPEN:()=>T(!0),CLOSE:()=>T(!1),CLEAR:()=>y.current.clear(),UNDO:()=>y.current.undo(),IS_EMPTY:()=>y.current.isEmpty(),UPDATE:z,GET_DATE_URL:W})));const U=e=>{e&&$((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},G=e=>t.createElement("div",{className:Pe("ant-dropdown-menu","content")},"text"!==e?t.createElement("div",{className:"lineWidth"},w.map((e=>t.createElement("span",{key:e,className:Pe("dot",`s${e}`,{active:e===k}),onClick:()=>L(e)})))):t.createElement("div",{className:"fontSize"},t.createElement(H,{size:"small",value:_,options:C.map((e=>({value:e,label:e.toString()}))),onChange:e=>D(e)})),t.createElement("span",{className:"divider"}),t.createElement("div",{className:"penColor"},S.map((e=>t.createElement("span",{key:e,className:Pe("dot",{active:e===A}),style:{backgroundColor:e},onClick:()=>P(e)},t.createElement($e,{className:"icon"})))))),Y=lr("signature"),X={[Y]:!0,"is-annotation":I},Q=i?Object.assign(Object.assign({},h),{width:i}):h;return t.createElement("div",{className:Pe(X,p),style:Q},I&&t.createElement(t.Fragment,null,t.createElement("div",{ref:x,className:"content"},e.children),K&&t.createElement(nl,{spinning:!0,className:"spinning"})),t.createElement("div",{className:Pe("signature",{show:N})},t.createElement("canvas",{ref:b,className:R}),I&&t.createElement("div",{ref:E,className:"signature__tool-bar"},t.createElement("div",{className:"wrapper"},t.createElement("div",{className:Pe("actions",{hidden:q})},t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("square")},t.createElement(Ht,null))),t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("round")},t.createElement(af,null))),t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("arrow")},t.createElement(sf,null))),t.createElement(M,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("line")},t.createElement(Me,null))),t.createElement(M,{dropdownRender:()=>G("text"),overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},t.createElement("button",{className:"btn",onClick:()=>O("text")},t.createElement(of,null))),t.createElement("button",{className:"btn",onClick:()=>Hn(void 0,void 0,void 0,(function*(){yield Hn(void 0,void 0,void 0,(function*(){V(!0);const e=yield W();if(e){const t=a?a.slice(0,a.lastIndexOf(".")>0?a.lastIndexOf("."):void 0):m().format(Wo);wl(lf.dataURLToBlob(e),`${t}.png`)}V(!1)})),B()}))},t.createElement(je,null)),t.createElement("button",{className:"btn",onClick:()=>O("eraser")},t.createElement(cf,null)),t.createElement("button",{className:"btn",onClick:()=>y.current.undo()},t.createElement(df,null)),t.createElement("button",{className:"btn",onClick:()=>y.current.clear()},t.createElement(Tt,null)),t.createElement("span",{className:"divider"}),t.createElement("button",{className:"btn",onClick:()=>null==g?void 0:g()},t.createElement(it,null)),t.createElement("button",{className:"btn",onClick:()=>Hn(void 0,void 0,void 0,(function*(){V(!0),yield Wn(10);const e=yield W();V(!1),B(),null==f||f(e)}))},t.createElement($e,null))),t.createElement("button",{className:"btn btn-fold",title:v(q?"qm.divider.spread":"qm.divider.collect"),onClick:()=>j(!q)},q?t.createElement(ot,null):t.createElement(st,null))))))}));uf.displayName="QmSignature";const pf=t.forwardRef(((e,n)=>{const{dataIndex:r,className:i,style:l}=e;return t.createElement("li",{ref:n,"data-index":r,className:Pe("list-item",i),style:l},e.children)}));pf.displayName="ListItem";const mf=t.forwardRef(((e,n)=>{var r,i;const{dataSource:l=[],height:a,maxHeight:o,itemHeight:s,renderItem:c,onScroll:d,className:u}=e,p=t.useRef(null),m=fu({count:l.length,getScrollElement:()=>{var e,t;return null!==(t=null===(e=p.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null},estimateSize:()=>s||40,overscan:3,onChange:(e,t)=>null==d?void 0:d(e,t)}),h=m.getVirtualItems();t.useImperativeHandle(n,(()=>({SCROLL_TO_INDEX:e=>m.scrollToIndex(e),SCROLL_TO_OFFSET:e=>m.scrollToOffset(e)})));const f=lr("virtual-list");return t.createElement(El,{ref:p,className:Pe(f,u),style:Object.assign(Object.assign({},e.style),{height:a,maxHeight:o})},t.createElement("div",{className:"container",style:{height:m.getTotalSize()}},t.createElement("ul",{style:{transform:`translateY(${null!==(i=null===(r=h[0])||void 0===r?void 0:r.start)&&void 0!==i?i:0}px)`}},h.map((e=>t.createElement(pf,{ref:m.measureElement,key:e.index,dataIndex:e.index,style:{height:s}},null==c?void 0:c(l[e.index],e.index)))))))}));mf.displayName="VirtualList";const hf="1.11.21";export{Tn as Calendar,In as DatePicker,Ll as DcpAnchor,nr as DcpButton,Hi as DcpCollapse,Bd as DcpColorPicker,Pn as DcpConfigProvider,yp as DcpCopyToClipboard,el as DcpCountup,Mm as DcpCropper,ar as DcpDivider,Il as DcpDownload,_l as DcpDrawer,tl as DcpEmpty,sh as DcpForm,Uh as DcpGuideTracker,tf as DcpLazyLoad,Fl as DcpModal,ku as DcpPivotGrid,Ih as DcpPrint,Up as DcpRangeTableHelper,El as DcpScrollbar,Op as DcpSearchHelper,Gu as DcpSearchTree,uf as DcpSignature,ir as DcpSpace,nl as DcpSpin,Ji as DcpSplit,Rp as DcpTable,Pl as DcpTabs,lh as DcpTinymce,vh as DcpTour,gl as DcpTransition,fp as DcpTreeHelper,$p as DcpTreeTableHelper,Tl as DcpUploadFile,qm as DcpUploadImg,mf as DcpVirtualList,Gh as DcpWatermark,Ll as QmAnchor,nr as QmButton,Hi as QmCollapse,Bd as QmColorPicker,Pn as QmConfigProvider,yp as QmCopyToClipboard,el as QmCountup,Mm as QmCropper,ar as QmDivider,Il as QmDownload,_l as QmDrawer,tl as QmEmpty,sh as QmForm,Uh as QmGuideTracker,tf as QmLazyLoad,Fl as QmModal,ku as QmPivotGrid,Ih as QmPrint,Up as QmRangeTableHelper,El as QmScrollbar,Op as QmSearchHelper,Gu as QmSearchTree,uf as QmSignature,ir as QmSpace,nl as QmSpin,Ji as QmSplit,Rp as QmTable,Pl as QmTabs,lh as QmTinymce,vh as QmTour,gl as QmTransition,fp as QmTreeHelper,$p as QmTreeTableHelper,Tl as QmUploadFile,qm as QmUploadImg,mf as QmVirtualList,Gh as QmWatermark,On as TimePicker,bo as pinyin,hf as version};