@jiaozhiye/qm-design-react 1.11.23 → 1.11.25
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/collapse/style/index.less +24 -24
- package/lib/collapse/style/motion.less +11 -11
- package/lib/color-picker/style/index.less +119 -119
- package/lib/index.esm.js +1 -1
- package/lib/index.full.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/en.js +5 -5
- package/lib/locale/lang/zh-cn.js +5 -5
- package/lib/pivot-grid/style/context-menu.less +28 -28
- package/lib/pivot-grid/style/grid-layout.less +409 -409
- package/lib/pivot-grid/style/index.less +11 -11
- package/lib/pivot-grid/style/main.less +33 -33
- package/lib/pivot-grid/style/top-bar.less +189 -189
- package/lib/search-tree/style/index.less +34 -35
- package/lib/style/index.css +5 -3
- package/lib/style/index.less +44 -44
- package/lib/style/index.min.css +1 -1
- package/lib/table/style/body.less +105 -104
- package/lib/table/style/fast-search.less +150 -150
- package/lib/table/style/variable.less +51 -51
- package/lib/tinymce/src/index.d.ts +1 -0
- package/lib/virtual-list/style/index.less +22 -22
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("dayjs");require("dayjs/locale/zh-cn");var l=require("dayjs/plugin/localeData"),n=require("dayjs/plugin/advancedFormat"),a=require("dayjs/plugin/customParseFormat"),r=require("dayjs/plugin/quarterOfYear"),i=require("dayjs/plugin/weekOfYear"),o=require("dayjs/plugin/weekday"),s=require("antd"),d=require("dayjs/plugin/weekYear"),u=require("antd/es/calendar/generateCalendar"),c=require("antd/es/date-picker/generatePicker"),f=require("antd/es/locale/zh_CN"),p=require("antd/es/locale/en_GB"),m=require("lodash-es"),h=require("classnames"),g=require("@ant-design/icons"),v=require("react-dom"),y=require("react-countup"),b=require("resize-observer-polyfill"),x=require("sortablejs"),E=require("add-dom-event-listener"),C=require("scroll-into-view-if-needed"),w=require("react-draggable"),S=require("memoize-one"),N=require("prop-types"),T=require("react-sortablejs"),I=require("big.js"),O=require("exceljs"),R=require("localforage"),k=require("@rc-component/trigger"),L=require("@rc-component/color-picker"),P=require("@rc-component/portal"),A=require("copy-to-clipboard"),D=require("china-area-data"),_=require("cropperjs"),F=require("html2canvas");function H(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function M(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),t.default=e,Object.freeze(t)}var $=M(e),q=H(e),j=H(t),K=H(l),V=H(n),z=H(a),W=H(r),B=H(i),U=H(o),G=H(d),Y=H(u),X=H(c),Q=H(f),Z=H(p),J=H(h),ee=H(v),te=H(y),le=H(b),ne=H(x),ae=H(E),re=H(C),ie=H(w),oe=H(S),se=H(N),de=M(N),ue=H(I),ce=H(O),fe=H(R),pe=H(k),me=H(L),he=H(P),ge=H(A),ve=H(D),ye=H(_),be=H(F);const xe=e.createContext({locale:"zh-cn",size:"middle"});var Ee={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 Ce=Ee;function we(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,l)=>t[l])):e}const Se=(...e)=>{const[t,l]=e;let n;const a=t.split(".");let r=Ce;for(let e=0,t=a.length;e<t;e++){if(n=r[a[e]],e===t-1)return we(n,l);if(!n)return"";r=n}return""},Ne=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((l,n)=>(l[n]=void 0!==t[n]?t[n]:e[n],l)),{})),Te=(e,t)=>{const l=$.useRef(!0);$.useLayoutEffect((()=>e(l.current)),t),$.useLayoutEffect((()=>(l.current=!1,()=>{l.current=!0})),[])};function Ie(e,t){Te((t=>{if(!t)return e()}),t)}j.default.extend(K.default),j.default.extend(V.default),j.default.extend(z.default),j.default.extend(W.default),j.default.extend(B.default),j.default.extend(U.default);var Oe={},Re=[];function ke(e,t){if(!e&&void 0!==console){var l=Re.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);l&&console.error("Warning: ".concat(l))}}function Le(e,t){if(!e&&void 0!==console){var l=Re.reduce((function(e,t){return t(null!=e?e:"","note")}),t);l&&console.warn("Note: ".concat(l))}}function Pe(e,t,l){t||Oe[l]||(e(!1,l),Oe[l]=!0)}function Ae(e,t){Pe(ke,e,t)}function De(e,t){Pe(Le,e,t)}Ae.preMessage=function(e){Re.push(e)},Ae.resetWarned=function(){Oe={}},Ae.noteOnce=De,j.default.extend(z.default),j.default.extend(V.default),j.default.extend(U.default),j.default.extend(K.default),j.default.extend(B.default),j.default.extend(G.default),j.default.extend((function(e,t){var l=t.prototype,n=l.format;l.format=function(e){var t=(e||"").replace("Wo","wo");return n.bind(this)(t)}}));var _e={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"},Fe=function(e){return _e[e]||e.split("_")[0]},He=function(){De(!1,"Not match any format. Please help to fire a issue about this.")},Me={getNow:function(){return j.default()},getFixedDate:function(e){return j.default(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 j.default().locale(Fe(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(Fe(e)).weekday(0)},getWeek:function(e,t){return t.locale(Fe(e)).week()},getShortWeekDays:function(e){return j.default().locale(Fe(e)).localeData().weekdaysMin()},getShortMonths:function(e){return j.default().locale(Fe(e)).localeData().monthsShort()},format:function(e,t,l){return t.locale(Fe(e)).format(l)},parse:function(e,t,l){for(var n=Fe(e),a=0;a<l.length;a+=1){var r=l[a],i=t;if(r.includes("wo")||r.includes("Wo")){for(var o=i.split("-")[0],s=i.split("-")[1],d=j.default(o,"YYYY").startOf("year").locale(n),u=0;u<=52;u+=1){var c=d.add(u,"week");if(c.format("Wo")===s)return c}return He(),null}var f=j.default(i,r).locale(n);if(f.isValid())return f}return t&&He(),null}}};const $e=Y.default(Me),qe=X.default(Me);function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},je.apply(null,arguments)}const Ke=$.forwardRef(((e,t)=>$.createElement(qe,je({},e,{picker:"time",mode:void 0,ref:t}))));Ke.displayName="TimePicker";const Ve=$.forwardRef(((e,t)=>$.createElement(qe.RangePicker,je({},e,{picker:"time",mode:void 0,ref:t}))));Ve.displayName="RangePicker",Ke.RangePicker=Ve;var ze={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 We={[ze.name]:{qm:ze,antd:Z.default},[Ee.name]:{qm:Ee,antd:Q.default}},Be=e=>{const t=Ne({locale:"zh-cn",size:"middle"},e),{locale:l,size:n,global:a}=t;q.default.useMemo((()=>{return e=Object.assign({},We,null==a?void 0:a.langPackage)[l].qm,Ce=e||Ce,void(Ce.name&&j.default.locale(Ce.name));var e}),[l]);const r=q.default.useMemo((()=>Object.assign({},We,null==a?void 0:a.langPackage)),[a]),[i,o]=q.default.useState({locale:l,size:n,global:a});return Ie((()=>{o((e=>Object.assign({},e,{locale:l,size:n})))}),[n,l]),q.default.createElement(xe.Provider,{value:i},q.default.createElement(s.ConfigProvider,{locale:r[i.locale].antd,componentSize:i.size,autoInsertSpaceInButton:null==a?void 0:a.autoInsertSpaceInButton},t.children))};function Ue(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(l[n[a]]=e[n[a]])}return l}function Ge(e,t,l,n){var a,r=arguments.length,i=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,l):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,l,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r<3?a(i):r>3?a(t,l,i):a(t,l))||i);return r>3&&i&&Object.defineProperty(t,l,i),i}function Ye(e,t,l,n){return new(l||(l=Promise))((function(a,r){function i(e){try{s(n.next(e))}catch(e){r(e)}}function o(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(i,o)}s((n=n.apply(e,t||[])).next())}))}function Xe(){const{locale:e}=$.useContext(xe);return{t:Se,$locale:e}}function Qe(e){const t=$.useRef();t.current=e;return $.useCallback(((...e)=>{var l;return null===(l=t.current)||void 0===l?void 0:l.call(t,...e)}),[])}function Ze(e){const{size:t}=$.useContext(xe);return{$size:$.useMemo((()=>{var l,n;return null!==(n=null!==(l=e.size)&&void 0!==l?l:t)&&void 0!==n?n:""}),[e.size,t])}}Be.displayName="QmConfigProvider";var Je="undefined"==typeof window;const et=e=>q.default.isValidElement(e),tt=e=>et(e)&&e.type===q.default.Fragment,lt=()=>{},nt=()=>!0,at=e=>Ye(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),rt=e=>{Promise.resolve().then(e)},it=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),ot=e=>!!(!e&&0!==e||m.isArray(e)&&!e.length||m.isPlainObject(e)&&!Object.keys(e).length),st=(e,t)=>t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e),dt=(e,t)=>{const l=Object.assign({},e);for(const e of t)delete l[e];return l};const ut=(e,t=new WeakMap)=>{if(m.isPlainObject(e)||m.isArray(e)){const l=Array.isArray(e),n=l?[]:{};if(t.get(e))return e;t.set(e,n);const a=l?void 0:Object.keys(e);return function(e,t){let l=-1;const n=e.length;for(;++l<n;)t(e[l],l)}(a||e,((l,r)=>{a&&(r=l),n[r]=ut(e[r],t)})),n}return e},ct=e=>m.isNumber(e)?`${e}px`:e.toString();class ft extends Error{constructor(e){super(e),this.name="QmDesignError"}}function pt(e,t){throw new ft(`[${e}] ${t}`)}function mt(e,t){console.warn(new ft(`[${e}] ${t}`))}const ht=e=>{const{loading:t,shortcutKey:l,authConfig:n,click:a,confirm:r}=e,{t:i}=Xe(),{$size:o}=Ze(e);q.default.useEffect((()=>(l&&document.addEventListener("keyup",c),()=>document.removeEventListener("keyup",c))),[]);const[d,u]=q.default.useState(!1),c=Qe((e=>{var t;const n=l.split("+").map((e=>e.trim().toLowerCase())),a=n.includes("alt"),r=n.includes("ctrl"),i=n.includes("shift"),o=n[n.length-1];a&&!e.altKey||r&&!e.ctrlKey||i&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),p.disabled||null===(t=p.onClick)||void 0===t||t.call(p,e))})),f=m.isFunction(a)?{onClick:t=>Ye(void 0,void 0,void 0,(function*(){var l;u(!0);try{yield null===(l=e.click)||void 0===l?void 0:l.call(e,t)}catch(e){mt("Button","`click`方法执行出错")}u(!1)}))}:null,p=Object.assign(Object.assign(Object.assign({},dt(e,["shortcutKey","authConfig","click","confirm"])),{size:o,loading:d||t||!1}),f);if(n){const{visible:e=1,disabled:t}=n||{};if(!e)return null;t&&(p.disabled=!0)}const h=q.default.createElement(s.Button,p,e.children);return r?q.default.createElement(s.Popconfirm,{title:r.title||i("qm.button.confirmTitle"),disabled:p.disabled,onConfirm:e=>{var t,l;null===(t=r.onConfirm)||void 0===t||t.call(r),null===(l=p.onClick)||void 0===l||l.call(p,e)},onCancel:e=>{var t;null===(t=r.onCancel)||void 0===t||t.call(r,e)}},q.default.createElement(s.Button,je({},p,{onClick:lt}),e.children)):!l||p.disabled?h:q.default.createElement(s.Tooltip,{placement:"top",title:`${i("qm.button.shortcutKey")}: ${l}`},h)};var gt;ht.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(gt||(gt={}));const vt=e=>{const{$size:t}=Ze(e),l=m.isNumber(e.size)?e.size:gt[t||"default"],n=Object.assign(Object.assign({},dt(e,["size"])),{size:l});return q.default.createElement(s.Space,n,e.children)};vt.displayName="QmSpace";const yt=e=>`qm-${e}`,bt=e=>{const{label:t,extra:l,collapse:n,bordered:a=!0,disabled:r,id:i,className:o,style:d,onCollapseChange:u}=e,{$size:c}=Ze(e),{t:f}=Xe(),p=yt("divider"),m={[p]:!0,[`${p}-borderless`]:!a,[`${p}--lg`]:"large"===c,[`${p}--sm`]:"small"===c};return q.default.createElement("div",{id:i,className:J.default(m,o),style:d},q.default.createElement("span",{className:`${p}__title`},t),q.default.createElement("div",{className:`${p}__extra`},l),void 0!==n&&q.default.createElement(s.Button,{type:"link",className:`${p}__collapse`,disabled:r,onClick:()=>{null==u||u(!n)}},f(n?"qm.divider.collect":"qm.divider.spread"),n?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)))};bt.displayName="QmDivider";const xt=()=>({height:0,opacity:0}),Et=e=>({height:e.scrollHeight,opacity:1}),Ct=e=>({height:e?e.offsetHeight:0}),wt=(e,t)=>!0===(null==t?void 0:t.deadline)||"height"===t.propertyName;function St(e){return St="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},St(e)}function Nt(e){var t=function(e,t){if("object"!==St(e)||null===e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!==St(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===St(t)?t:String(t)}function Tt(e,t,l){return(t=Nt(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function It(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Ot(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?It(Object(l),!0).forEach((function(t){Tt(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):It(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=new Array(t);l<t;l++)n[l]=e[l];return n}function kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var n,a,r,i,o=[],s=!0,d=!1;try{if(r=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;s=!1}else for(;!(s=(n=r.call(l)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){d=!0,a=e}finally{try{if(!s&&null!=l.return&&(i=l.return(),Object(i)!==i))return}finally{if(d)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Rt(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?Rt(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 Lt(e){return e instanceof HTMLElement||e instanceof SVGElement}function Pt(e){var t,l=function(e){return e&&"object"===St(e)&&Lt(e.nativeElement)?e.nativeElement:Lt(e)?e:null}(e);return l||(e instanceof q.default.Component?null===(t=ee.default.findDOMNode)||void 0===t?void 0:t.call(ee.default,e):null)}var At,Dt={exports:{}},_t={};Dt.exports=(At||(At=1,function(){var e,t=Symbol.for("react.element"),l=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var h=e.type;switch(h){case n:case r:case a:case u:case c:return h;default:var g=h&&h.$$typeof;switch(g){case s:case o:case d:case p:case f:case i:return g;default:return m}}case l:return m}}}e=Symbol.for("react.module.reference");var g=o,v=i,y=t,b=d,x=n,E=p,C=f,w=l,S=r,N=a,T=u,I=c,O=!1,R=!1;_t.ContextConsumer=g,_t.ContextProvider=v,_t.Element=y,_t.ForwardRef=b,_t.Fragment=x,_t.Lazy=E,_t.Memo=C,_t.Portal=w,_t.Profiler=S,_t.StrictMode=N,_t.Suspense=T,_t.SuspenseList=I,_t.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},_t.isConcurrentMode=function(e){return R||(R=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},_t.isContextConsumer=function(e){return h(e)===o},_t.isContextProvider=function(e){return h(e)===i},_t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},_t.isForwardRef=function(e){return h(e)===d},_t.isFragment=function(e){return h(e)===n},_t.isLazy=function(e){return h(e)===p},_t.isMemo=function(e){return h(e)===f},_t.isPortal=function(e){return h(e)===l},_t.isProfiler=function(e){return h(e)===r},_t.isStrictMode=function(e){return h(e)===a},_t.isSuspense=function(e){return h(e)===u},_t.isSuspenseList=function(e){return h(e)===c},_t.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===r||t===a||t===u||t===c||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===i||t.$$typeof===o||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},_t.typeOf=h}()),_t);var Ft=function(e,t){"function"==typeof e?e(t):"object"===St(e)&&e&&"current"in e&&(e.current=t)},Ht=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n=t.filter(Boolean);return n.length<=1?n[0]:function(e){t.forEach((function(t){Ft(t,e)}))}},Mt=function(e){var t,l,n=Dt.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof n||null!==(t=n.prototype)&&void 0!==t&&t.render||n.$$typeof===Dt.exports.ForwardRef)&&!!("function"!=typeof e||null!==(l=e.prototype)&&void 0!==l&&l.render||e.$$typeof===Dt.exports.ForwardRef)};function $t(e,t){if(null==e)return{};var l,n,a=function(e,t){if(null==e)return{};var l,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||(a[l]=e[l]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(a[l]=e[l])}return a}Number(e.version.split(".")[0]);var qt=$.createContext({});function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kt(e,t){for(var l=0;l<t.length;l++){var n=t[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nt(n.key),n)}}function Vt(e,t,l){return t&&Kt(e.prototype,t),l&&Kt(e,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function zt(e,t){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zt(e,t)}function Wt(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&&zt(e,t)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bt(e)}function Ut(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gt(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 l,n=Bt(e);if(t){var a=Bt(this).constructor;l=Reflect.construct(n,arguments,a)}else l=n.apply(this,arguments);return function(e,t){if(t&&("object"===St(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ut(e)}(this,l)}}var Yt=function(e){Wt(l,$.Component);var t=Gt(l);function l(){return jt(this,l),t.apply(this,arguments)}return Vt(l,[{key:"render",value:function(){return this.props.children}}]),l}();function Xt(e){var t=$.useRef(!1),l=kt($.useState(e),2),n=l[0],a=l[1];return $.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[n,function(e,l){l&&t.current||a(e)}]}var Qt="none",Zt="appear",Jt="enter",el="leave",tl="none",ll="prepare",nl="start",al="active",rl="end",il="prepared";function ol(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function sl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit".concat(e)]="webkit".concat(t),l["Moz".concat(e)]="moz".concat(t),l["ms".concat(e)]="MS".concat(t),l["O".concat(e)]="o".concat(t.toLowerCase()),l}var dl,ul,cl,fl=(dl=ol(),ul="undefined"!=typeof window?window:{},cl={animationend:sl("Animation","AnimationEnd"),transitionend:sl("Transition","TransitionEnd")},dl&&("AnimationEvent"in ul||delete cl.animationend.animation,"TransitionEvent"in ul||delete cl.transitionend.transition),cl),pl={};if(ol()){var ml=document.createElement("div");pl=ml.style}var hl={};function gl(e){if(hl[e])return hl[e];var t=fl[e];if(t)for(var l=Object.keys(t),n=l.length,a=0;a<n;a+=1){var r=l[a];if(Object.prototype.hasOwnProperty.call(t,r)&&r in pl)return hl[e]=t[r],hl[e]}return""}var vl=gl("animationend"),yl=gl("transitionend"),bl=!(!vl||!yl),xl=vl||"animationend",El=yl||"transitionend";function Cl(e,t){return e?"object"===St(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var wl=function(t){var l=e.useRef(),n=e.useRef(t);n.current=t;var a=$.useCallback((function(e){n.current(e)}),[]);function r(e){e&&(e.removeEventListener(El,a),e.removeEventListener(xl,a))}return $.useEffect((function(){return function(){r(l.current)}}),[]),[function(e){l.current&&l.current!==e&&r(l.current),e&&e!==l.current&&(e.addEventListener(El,a),e.addEventListener(xl,a),l.current=e)},r]},Sl=ol()?e.useLayoutEffect:e.useEffect,Nl=function(e){return+setTimeout(e,16)},Tl=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Nl=function(e){return window.requestAnimationFrame(e)},Tl=function(e){return window.cancelAnimationFrame(e)});var Il=0,Ol=new Map;function Rl(e){Ol.delete(e)}var kl=function(e){var t=Il+=1;return function l(n){if(0===n)Rl(t),e();else{var a=Nl((function(){l(n-1)}));Ol.set(t,a)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};kl.cancel=function(e){var t=Ol.get(e);return Rl(e),Tl(t)},kl.ids=function(){return Ol};var Ll=[ll,nl,al,rl],Pl=[ll,il],Al=!1,Dl=!0;function _l(e){return e===al||e===rl}var Fl=function(e,t,l){var n=kt(Xt(tl),2),a=n[0],r=n[1],i=function(){var e=$.useRef(null);function t(){kl.cancel(e.current)}return $.useEffect((function(){return function(){t()}}),[]),[function l(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var r=kl((function(){a<=1?n({isCanceled:function(){return r!==e.current}}):l(n,a-1)}));e.current=r},t]}(),o=kt(i,2),s=o[0],d=o[1];var u=t?Pl:Ll;return Sl((function(){if(a!==tl&&a!==rl){var e=u.indexOf(a),t=u[e+1],n=l(a);n===Al?r(t,!0):t&&s((function(e){function l(){e.isCanceled()||r(t,!0)}!0===n?l():Promise.resolve(n).then(l)}))}}),[e,a]),$.useEffect((function(){return function(){d()}}),[]),[function(){r(ll,!0)},a]};var Hl=function(t){var l=t;"object"===St(t)&&(l=t.transitionSupport);var n=$.forwardRef((function(t,n){var a=t.visible,r=void 0===a||a,i=t.removeOnLeave,o=void 0===i||i,s=t.forceRender,d=t.children,u=t.motionName,c=t.leavedClassName,f=t.eventProps,p=function(e,t){return!(!e.motionName||!l||!1===t)}(t,$.useContext(qt).motion),m=e.useRef(),h=e.useRef();var g=function(t,l,n,a){var r=a.motionEnter,i=void 0===r||r,o=a.motionAppear,s=void 0===o||o,d=a.motionLeave,u=void 0===d||d,c=a.motionDeadline,f=a.motionLeaveImmediately,p=a.onAppearPrepare,m=a.onEnterPrepare,h=a.onLeavePrepare,g=a.onAppearStart,v=a.onEnterStart,y=a.onLeaveStart,b=a.onAppearActive,x=a.onEnterActive,E=a.onLeaveActive,C=a.onAppearEnd,w=a.onEnterEnd,S=a.onLeaveEnd,N=a.onVisibleChanged,T=kt(Xt(),2),I=T[0],O=T[1],R=kt(Xt(Qt),2),k=R[0],L=R[1],P=kt(Xt(null),2),A=P[0],D=P[1],_=e.useRef(!1),F=e.useRef(null);function H(){return n()}var M=e.useRef(!1);function q(){L(Qt,!0),D(null,!0)}function j(e){var t=H();if(!e||e.deadline||e.target===t){var l,n=M.current;k===Zt&&n?l=null==C?void 0:C(t,e):k===Jt&&n?l=null==w?void 0:w(t,e):k===el&&n&&(l=null==S?void 0:S(t,e)),k!==Qt&&n&&!1!==l&&q()}}var K=kt(wl(j),1)[0],V=function(e){var t,l,n;switch(e){case Zt:return Tt(t={},ll,p),Tt(t,nl,g),Tt(t,al,b),t;case Jt:return Tt(l={},ll,m),Tt(l,nl,v),Tt(l,al,x),l;case el:return Tt(n={},ll,h),Tt(n,nl,y),Tt(n,al,E),n;default:return{}}},z=$.useMemo((function(){return V(k)}),[k]),W=kt(Fl(k,!t,(function(e){if(e===ll){var t=z[ll];return t?t(H()):Al}var l;return U in z&&D((null===(l=z[U])||void 0===l?void 0:l.call(z,H(),null))||null),U===al&&(K(H()),c>0&&(clearTimeout(F.current),F.current=setTimeout((function(){j({deadline:!0})}),c))),U===il&&q(),Dl})),2),B=W[0],U=W[1],G=_l(U);M.current=G,Sl((function(){O(l);var e,n=_.current;_.current=!0,!n&&l&&s&&(e=Zt),n&&l&&i&&(e=Jt),(n&&!l&&u||!n&&f&&!l&&u)&&(e=el);var a=V(e);e&&(t||a[ll])?(L(e),B()):L(Qt)}),[l]),e.useEffect((function(){(k===Zt&&!s||k===Jt&&!i||k===el&&!u)&&L(Qt)}),[s,i,u]),e.useEffect((function(){return function(){_.current=!1,clearTimeout(F.current)}}),[]);var Y=$.useRef(!1);e.useEffect((function(){I&&(Y.current=!0),void 0!==I&&k===Qt&&((Y.current||I)&&(null==N||N(I)),Y.current=!0)}),[I,k]);var X=A;return z[ll]&&U===nl&&(X=Ot({transition:"none"},X)),[k,U,X,null!=I?I:l]}(p,r,(function(){try{return m.current instanceof HTMLElement?m.current:Pt(h.current)}catch(e){return null}}),t),v=kt(g,4),y=v[0],b=v[1],x=v[2],E=v[3],C=$.useRef(E);E&&(C.current=!0);var w,S=$.useCallback((function(e){m.current=e,Ft(n,e)}),[n]),N=Ot(Ot({},f),{},{visible:r});if(d)if(y===Qt)w=E?d(Ot({},N),S):!o&&C.current&&c?d(Ot(Ot({},N),{},{className:c}),S):s||!o&&!c?d(Ot(Ot({},N),{},{style:{display:"none"}}),S):null;else{var T,I;b===ll?I="prepare":_l(b)?I="active":b===nl&&(I="start");var O=Cl(u,"".concat(y,"-").concat(I));w=d(Ot(Ot({},N),{},{className:J.default(Cl(u,y),(T={},Tt(T,O,O&&I),Tt(T,u,"string"==typeof u),T)),style:x}),S)}else w=null;$.isValidElement(w)&&Mt(w)&&(w.ref||(w=$.cloneElement(w,{ref:S})));return $.createElement(Yt,{ref:h},w)}));return n.displayName="CSSMotion",n}(bl);function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},Ml.apply(this,arguments)}var $l="add",ql="keep",jl="remove",Kl="removed";function Vl(e){var t;return Ot(Ot({},t=e&&"object"===St(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function zl(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Vl)}var Wl=["component","children","onVisibleChanged","onAllRemoved"],Bl=["status"],Ul=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hl,l=function(e){Wt(n,$.Component);var l=Gt(n);function n(){var e;jt(this,n);for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return Tt(Ut(e=l.call.apply(l,[this].concat(a))),"state",{keyEntities:[]}),Tt(Ut(e),"removeKey",(function(t){var l=e.state.keyEntities.map((function(e){return e.key!==t?e:Ot(Ot({},e),{},{status:Kl})}));return e.setState({keyEntities:l}),l.filter((function(e){return e.status!==Kl})).length})),e}return Vt(n,[{key:"render",value:function(){var e=this,l=this.state.keyEntities,n=this.props,a=n.component,r=n.children,i=n.onVisibleChanged,o=n.onAllRemoved,s=$t(n,Wl),d=a||$.Fragment,u={};return Ul.forEach((function(e){u[e]=s[e],delete s[e]})),delete s.keys,$.createElement(d,s,l.map((function(l){var n=l.status,a=$t(l,Bl),s=n===$l||n===ql;return $.createElement(t,Ml({},u,{key:a.key,visible:s,eventProps:a,onVisibleChanged:function(t){(null==i||i(t,{key:a.key}),t)||0===e.removeKey(a.key)&&o&&o()}}),r)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.keys,n=t.keyEntities,a=zl(l),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=[],n=0,a=t.length,r=zl(e),i=zl(t);r.forEach((function(e){for(var t=!1,r=n;r<a;r+=1){var o=i[r];if(o.key===e.key){n<r&&(l=l.concat(i.slice(n,r).map((function(e){return Ot(Ot({},e),{},{status:$l})}))),n=r),l.push(Ot(Ot({},o),{},{status:ql})),n+=1,t=!0;break}}t||l.push(Ot(Ot({},e),{},{status:jl}))})),n<a&&(l=l.concat(i.slice(n).map((function(e){return Ot(Ot({},e),{},{status:$l})}))));var o={};return l.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){(l=l.filter((function(t){var l=t.key,n=t.status;return l!==e||n!==jl}))).forEach((function(t){t.key===e&&(t.status=ql)}))})),l}(n,a);return{keyEntities:r.filter((function(e){var t=n.find((function(t){var l=t.key;return e.key===l}));return!t||t.status!==Kl||e.status!==jl}))}}}]),n}();Tt(l,"defaultProps",{component:"div"})}(bl);const Gl=q.default.forwardRef(((e,t)=>{const{forceRender:l,className:n,style:a,boxStyle:r,isActive:i}=e,[o,s]=q.default.useState(i||l);if(q.default.useEffect((()=>{(l||i)&&s(!0)}),[l,i]),!o)return null;const d=yt("collapse");return q.default.createElement("div",{ref:t,className:J.default(`${d}-content`,{[`${d}-content-active`]:i,[`${d}-content-inactive`]:!i},n),style:a},q.default.createElement("div",{className:`${d}-content-box`,style:r},e.children))}));Gl.displayName="PanelContent";const Yl=e=>{const{defaultActive:t,label:l,extra:n,className:a,style:r,containerStyle:i,bordered:o,disabled:s,forceRender:d,destroyOnClose:u=!1,onChange:c}=e,[f,p]=q.default.useState(!!t),m=yt("collapse"),h=J.default({[`${m}`]:!0,[`${m}-active`]:f,[`${m}-disabled`]:s},a);return q.default.createElement("div",{className:h,style:r},q.default.createElement(bt,{label:l,extra:n,collapse:f,bordered:o,disabled:s,onCollapseChange:e=>{p(e),null==c||c(e)}}),q.default.createElement(Hl,je({visible:f},((e=yt("motion-collapse"))=>({motionName:e,onAppearStart:xt,onEnterStart:xt,onAppearActive:Et,onEnterActive:Et,onLeaveStart:Ct,onLeaveActive:xt,onAppearEnd:wt,onEnterEnd:wt,onLeaveEnd:wt,motionDeadline:500}))(),{forceRender:d,removeOnLeave:u}),(({className:t,style:l},n)=>q.default.createElement(Gl,{ref:n,prefixCls:m,className:t,style:l,boxStyle:i,isActive:f,forceRender:d},e.children))))};Yl.displayName="QmCollapse";const Xl=q.default.createContext(void 0);function Ql(e,t){((e,t)=>{const l=$.useRef(!0);$.useEffect((()=>e(l.current)),t),$.useEffect((()=>(l.current=!1,()=>{l.current=!0})),[])})((t=>{if(!t)return e()}),t)}const Zl=(e,t,l)=>{e&&t&&l&&e.addEventListener(t,l,!1)},Jl=(e,t,l)=>{e&&t&&l&&e.removeEventListener(t,l,!1)},en=e=>e.preventDefault(),tn=(e,t)=>{if(Je||!e||!t)return null;"float"===(t=it(t))&&(t="cssFloat");try{const l=e.style[t];if(l)return l;const n=window.getComputedStyle(e);return n?n[t]:""}catch(l){return e.style[t]}},ln=(e,t,l)=>{!Je&&e&&t&&(m.isPlainObject(t)?Object.keys(t).forEach((l=>{ln(e,l,t[l])})):(t=it(t),e.style[t]=l))},nn=e=>{let t=0,l=e;for(;l;)t+=l.offsetTop,l=l.offsetParent;return t},an=(e,t)=>Math.abs(nn(e)-nn(t)),rn=e=>{let t=0,l=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:l}},on=(e,t)=>{var l;let n=e;for(;n;){if(null===(l=n.classList)||void 0===l?void 0:l.contains(t))return n;n=n.parentNode}return null},sn=(e,t)=>{if(Je||!e||!t)return!1;let l=e;for(;l;){if(l===t)return!0;l=l.parentNode}return!1},dn=e=>Math.pow(e,3),un=e=>e<.5?dn(2*e)/2:1-dn(2*(1-e))/2,cn=e=>{const{minValues:t,onDragChange:l,onDragging:n}=e,{splitRef:a,direction:r}=q.default.useContext(Xl),{t:i}=Xe(),o=q.default.useRef(Je?null:document.onselectstart),s=q.default.useMemo((()=>"horizontal"===r),[r]),d=q.default.useMemo((()=>s?"X":"Y"),[s]),u=q.default.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),c=e=>{u.current=Object.assign({},u.current,e)},f=e=>{if(1!==e.buttons)return p();const l=e[`page${d}`]-u.current[`start${d}`],a=[t[0],u.current[`containerSize${d}`]-t[1]];let r=u.current[`firstElementSize${d}`]+l;r=Math.max(a[0],r),r=Math.min(a[1],r),n(r)},p=()=>{c({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),l(!1),Jl(document,"mousemove",f),Jl(document,"mouseup",p),m()},m=()=>{document.onselectstart!==o.current&&(document.onselectstart=o.current)},h={[`${yt("split")}__resize-bar`]:!0,vertical:"vertical"===r,horizontal:"horizontal"===r};return q.default.createElement("div",{className:J.default(h),title:i("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];c({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),Zl(document,"mousemove",f),Zl(document,"mouseup",p),l(!0),o.current=document.onselectstart,document.onselectstart=()=>!1}})};cn.displayName="ResizeBar";const fn=q.default.forwardRef(((e,t)=>{const{offset:l,className:n,style:a}=e,{direction:r,dragging:i}=q.default.useContext(Xl),o="vertical"===r?"height":"width",s={[yt("split-pane")]:!0,isLocked:i,horizontal:"horizontal"===r,vertical:"vertical"===r,[n]:!!n},d=void 0!==l?{[o]:ct(l)}:{flex:1,[o]:0};return q.default.createElement("div",{ref:t,className:J.default(s),style:Object.assign(Object.assign({},d),a)},e.children)}));fn.displayName="SplitPane";const pn=e=>{const{direction:t="horizontal",defaultValue:l="50%",uniqueKey:n,className:a,style:r,onDragStart:i,onDrag:o=lt,onDragEnd:s}=e,{global:d}=q.default.useContext(xe),u=q.default.useRef(null),c=q.default.useRef(null),f=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,p=e=>Number.parseInt(e,10),m=e=>{var t;const l=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return l>=0?l:0},h=q.default.useMemo((()=>n?`split_${n}`:""),[n]),[g,v]=q.default.useState(!1),[y,b]=q.default.useState(f(l));Ql((()=>{g?null==i||i(p(y)):(null==s||s(p(y)),localStorage.setItem(h,y),C(h,y))}),[g]),q.default.useEffect((()=>{x()}),[]);const x=()=>{if(!h)return;const e=localStorage.getItem(h);e?b(f(e)):E(h).then((e=>{localStorage.setItem(h,f(e||l)),x()})).catch((()=>{}))},E=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),C=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==d?void 0:d.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),w=q.default.useMemo((()=>({splitRef:u,direction:t,dragging:g})),[t,g]),S=[];q.default.Children.map(e.children,(e=>{var t;et(e)&&!tt(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const[N,T]=S,I=q.default.useMemo((()=>[m(N),m(T)]),[N,T]),O={[yt("split")]:!0,vertical:"vertical"===t};return q.default.createElement(Xl.Provider,{value:w},q.default.createElement("div",{ref:u,className:J.default(O,a),style:r},q.default.createElement(fn,je({},N.props,{ref:c,offset:y})),q.default.createElement(cn,{minValues:I,onDragChange:e=>v(e),onDragging:e=>{b(`${e}px`),o(e)}}),q.default.createElement(fn,T.props)))};pn.displayName="QmSplit",pn.Pane=fn;const mn=e=>{const{className:t,style:l}=e,{$size:n}=Ze(e),a=yt("countup"),r={[a]:!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n};return q.default.createElement(te.default,je({},e,{className:J.default(r,t),style:l}),e.children)};mn.displayName="QmCountup";const hn=e=>{const{className:t}=e,{$size:l}=Ze(e),n=yt("empty"),a=Object.assign(Object.assign({},e),{image:s.Empty.PRESENTED_IMAGE_SIMPLE}),r={[n]:!0,[`${n}--lg`]:"large"===l,[`${n}--sm`]:"small"===l};return q.default.createElement(s.Empty,je({},a,{className:J.default(r,t)}))};hn.displayName="QmEmpty";const gn=e=>{const t=Ne({tip:"Loading..."},e),{fullHeight:l,className:n,style:a}=t,r=yt("spin"),i={[r]:!0,[`${r}-fullHeight`]:!!l},o=Object.assign(Object.assign({wrapperClassName:J.default(i,n)},dt(t,["fullHeight"])),{style:Object.assign(Object.assign({},a),{maxHeight:"none"})});return q.default.createElement(s.Spin,o,t.children)};gn.displayName="QmSpin";const vn=q.default.createContext(void 0),yn=new Map;const bn=new le.default((function(e){e.forEach((e=>{var t;const{target:l}=e;null===(t=yn.get(l))||void 0===t||t.forEach((e=>e(l)))}))}));function xn(e,t){yn.has(e)||(yn.set(e,new Set),bn.observe(e)),yn.get(e).add(t)}function En(e,t){yn.has(e)&&(yn.get(e).delete(t),yn.get(e).size||(bn.unobserve(e),yn.delete(e)))}function Cn(e){const[t,l]=$.useState({width:0,height:0});return $.useLayoutEffect((()=>{const t=e.current,n=e=>{l({width:e.offsetWidth,height:e.offsetHeight})};return t&&xn(t,n),()=>{t&&En(t,n)}}),[e]),t}function wn(e,t){const l=$.useRef(null);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...n)=>{l.current&&clearTimeout(l.current),l.current=setTimeout((()=>e.apply(this,n)),t)}),[e,t])}const Sn=(e,...t)=>q.default.isValidElement(e)?q.default.cloneElement(e,...t):null,Nn=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Tn=e=>({_s:e,status:Nn[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),In=e=>e?6:5,On=(e,t,l,n,a)=>{clearTimeout(n.current);const r=Tn(e);t(r),l.current=r,null==a||a({current:r})},Rn=(t={})=>{const{enter:l=!0,exit:n=!0,preEnter:a,preExit:r,timeout:i,initialEntered:o,mountOnEnter:s,unmountOnExit:d,onStateChange:u}=t||{},[c,f]=e.useState((()=>Tn(o?2:In(s)))),p=e.useRef(c),h=e.useRef(),[g,v]=(e=>m.isPlainObject(e)?[e.enter,e.exit]:[e,e])(i),y=e.useCallback((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return In(t)}})(p.current._s,d);e&&On(e,f,p,h,u)}),[u,d]),b=e.useCallback((e=>{const t=e=>{switch(On(e,f,p,h,u),e){case 1:g>=0&&(h.current=setTimeout(y,g));break;case 4:v>=0&&(h.current=setTimeout(y,v));break;case 0:case 3:h.current=setTimeout((()=>t(e+1)),0)}},i=p.current.isEnter;"boolean"!=typeof e&&(e=!i),e?!i&&t(l?a?0:1:2):i&&t(n?r?3:4:In(d))}),[y,u,l,n,a,r,g,v,d]);return e.useEffect((()=>()=>clearTimeout(h.current)),[]),[c,b,y]},kn=e=>{const{name:t,in:l,timeout:n,preEnter:a=!0,preExit:r}=e,[i,o]=Rn({timeout:n,preEnter:a,preExit:r,initialEntered:l});return Ie((()=>{o()}),[l]),q.default.createElement(q.default.Fragment,null,q.default.Children.map(e.children,(e=>q.default.isValidElement(e)?Sn(e,{className:J.default(e.props.className,t,i.status)}):e)))},Ln=6,Pn={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"}},An=e=>{const{thumb:t,always:l,className:n,barSize:a=Ln,direction:r="vertical",onDrag:i=lt}=e,{dragging:o,scrollbarElement:s,wrapElement:d}=q.default.useContext(vn),u=Pn[r],c=q.default.useRef(t),f=q.default.useRef(null),p=q.default.useRef(null),m=q.default.useRef({}),h=q.default.useRef(!1),g=q.default.useRef(!1),v=q.default.useRef(Je?null:document.onselectstart),[y,b]=q.default.useState(!1);q.default.useLayoutEffect((()=>{c.current=t}),[t]),q.default.useEffect((()=>{const e=s.current;return Zl(e,"mousemove",w),Zl(e,"mouseleave",S),()=>{C(),Jl(document,"mouseup",E),Jl(e,"mousemove",w),Jl(e,"mouseleave",S)}}),[]);const x=e=>{if(!f.current||!p.current)return;if(!h.current)return;const t=m.current[u.axis];if(!t)return;const l=100*(-1*(f.current.getBoundingClientRect()[u.direction]-e[u.client])-(p.current[u.offset]-t))/f.current[u.offset];d.current[u.scroll]=l*d.current[u.scrollSize]/100,i(!0)},E=()=>{h.current=!1,m.current={[u.axis]:0},Jl(document,"mousemove",x),Jl(document,"mouseup",E),C(),g.current&&b(!1),i(!1)},C=()=>{document.onselectstart!==v.current&&(document.onselectstart=v.current)},w=()=>{g.current=!1,b(!!c.current.size)},S=()=>{g.current=!0,b(h.current)},N=yt("scrollbar"),T={[`${N}__bar`]:!0,"is-vertical":"vertical"===r,"is-horizontal":"horizontal"===r},I={[u.reverse]:a},O={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return q.default.createElement(kn,{name:"fade",in:l||o||y,timeout:300},q.default.createElement("div",{ref:f,className:J.default(T,n),style:I},q.default.createElement("div",{ref:p,className:`${N}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),Zl(document,"mousemove",x),Zl(document,"mouseup",E),h.current=!0,v.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(m.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},Dn=20,_n=q.default.forwardRef(((e,t)=>{const{wrapClassName:l,wrapStyle:n,innerStyle:a,barWidth:r,always:i,native:o,showTopScrollbar:s,minSize:d=Dn,onScroll:u}=e,c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef(null),[h,g]=q.default.useState({size:0,offset:0,ratio:1}),[v,y]=q.default.useState({size:0,offset:0,ratio:1}),[b,x]=q.default.useState(!1),E=Cn(c),C=Cn(p);Ie((()=>{!o&&w()}),[C.width,C.height,E.width,E.height]);const w=wn((()=>{if(!f.current)return;const e=f.current.offsetHeight-4,t=f.current.offsetWidth-4,l=Math.pow(e,2)/f.current.scrollHeight,n=Math.pow(t,2)/f.current.scrollWidth,a=Math.max(l,d),r=Math.max(n,d),i=l/(e-l)/(a/(e-a)),o=n/(t-n)/(r/(t-r)),s=a+4<e?a:0,u=r+4<t?r:0,c=100*f.current.scrollTop/e*i,p=100*f.current.scrollLeft/t*o;g(Object.assign({},h,{size:u,ratio:o,offset:p})),y(Object.assign({},v,{size:s,ratio:i,offset:c}))}),5),S=e=>{x(e)},N=(e,t)=>{m.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollTop,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollTop=n+(t-n)*un(i),a(r)):e.scrollTop=t};a(r)})(f.current,e):f.current.scrollTop=e:mt("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},T=(e,t)=>{m.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollLeft,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollLeft=n+(t-n)*un(i),a(r)):e.scrollLeft=t};a(r)})(f.current,e):f.current.scrollLeft=e:mt("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};q.default.useImperativeHandle(t,(()=>{var e,t;return{container:c.current,scrollTop:(null===(e=f.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=f.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:N,SET_SCROLL_LEFT:T}}));const I=q.default.useMemo((()=>({dragging:b,scrollbarElement:c,wrapElement:f})),[b]),O=yt("scrollbar"),R={[`${O}__wrap`]:!0,[`${O}__wrap--hidden`]:!o};return q.default.createElement("div",{ref:c,className:J.default(O,e.className),style:e.style},q.default.createElement("div",{ref:f,className:J.default(R,l),style:n,onScroll:e=>{const{scrollTop:t,scrollLeft:l}=e.target;!o&&(()=>{if(!f.current)return;const e=f.current.offsetHeight-4,t=f.current.offsetWidth-4,l=100*f.current.scrollTop/e*v.ratio,n=100*f.current.scrollLeft/t*h.ratio;g(Object.assign({},h,{offset:n})),y(Object.assign({},v,{offset:l}))})(),null==u||u({scrollTop:t,scrollLeft:l})}},q.default.createElement("div",{ref:p,className:`${O}__view`,style:a},e.children)),!o&&q.default.createElement(vn.Provider,{value:I},s&&q.default.createElement(An,{className:"top",direction:"horizontal",thumb:h,barSize:r,always:i,onDrag:S}),q.default.createElement(An,{direction:"horizontal",thumb:h,barSize:r,always:i,onDrag:S}),q.default.createElement(An,{direction:"vertical",thumb:v,barSize:r,always:i,onDrag:S})))}));_n.displayName="QmScrollbar";const Fn=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const l=window.URL.createObjectURL(e);let n=document.createElement("a");n.href=l,n.download=decodeURI(t),n.click(),n=null}},Hn=(e,{fileName:t,headers:l,params:n})=>Ye(void 0,void 0,void 0,(function*(){const a=n?new URLSearchParams(n).toString():"",r=a?e.includes("?")?"&":"?":"",i=yield fetch(e+`${r+a}`,{method:"GET",headers:l});if(!i.ok)throw new Error(Se("qm.download.error"));const o=yield i.blob(),s=i.headers.get("content-disposition"),d=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Fn(o,d)})),Mn=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},$n=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},qn=e=>{var t,l;const n=Ne({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:a=[],fileDirection:r="vertical",batchDownload:i,draggable:o,editable:d,disabled:u,readOnly:c,button:f={},className:p,onPreview:m,onSortChange:h,onEditChange:v,onDownload:y,onChange:b}=n,{t:x}=Xe(),{$size:E}=Ze(n),C=q.default.useRef(null),w=q.default.useRef(null),[S,N]=q.default.useState({}),T=q.default.useMemo((()=>u||c),[u,c]);q.default.useEffect((()=>(R(),()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.destroy()})),[]);const I=(e,t)=>{N((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))},O=Qe((e=>{const{oldIndex:t,newIndex:l}=e;if(t!==l){const e=[...a],[n]=e.splice(t,1);e.splice(l,0,n),null==h||h(e),null==b||b({file:a[t],fileList:e})}})),R=()=>{o&&(w.current=ne.default.create(on(C.current,yt("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:O}))},k=e=>Ye(void 0,void 0,void 0,(function*(){if(y)return void(yield y(e));const{downloadWithHeaders:t,headers:l}=n;try{e.url&&(yield Hn(e.url,Object.assign({fileName:e.name},t?{headers:l}:null)))}catch(e){s.message.error(x("qm.download.error"))}})),L=yt("upload-file"),P={[L]:!0,[`${L}--lg`]:"large"===E,[`${L}--sm`]:"small"===E,[`${L}--horizontal`]:"horizontal"===r};return q.default.createElement(s.Upload,je({className:J.default(P,p)},dt(n,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((l,a)=>Ye(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,maxCount:o,fileList:d=[],beforeUpload:u}=n,c=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),f=!i||e.size/1024/1024<i,p=!(o>1)||d.length<o,m=c&&f&&p;if(c||s.message.warning(x("qm.upload.tooltip",{type:r.join(",")})),f||s.message.warning(x("qm.upload.sizeLimit",{size:i})),p||s.message.warning(x("qm.upload.countLimit",{count:o})),!m)return s.Upload.LIST_IGNORE;if(u){const n=u(e,t);if(!0===n)return l(e);if(!1===n)return a("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;l(e)}catch(e){a(e)}}else l(e)})))),disabled:T,onChange:b,onPreview:e=>Ye(void 0,void 0,void 0,(function*(){if("function"==typeof m)return m(e,(t=>k(t||e)));u||(yield k(e))})),onDownload:e=>Ye(void 0,void 0,void 0,(function*(){yield k(e)})),itemRender:(e,t,l,r)=>((e,t)=>{const{iconRender:l}=n,{uid:r,name:i,url:c,status:f="done"}=e,p="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return q.default.createElement("div",{className:J.default("ant-upload-list-item",`ant-upload-list-item-${f}`,"ant-upload-list-item-list-type-text",{handle:o})},q.default.createElement("div",{className:"ant-upload-list-item-info"},q.default.createElement("span",{className:"ant-upload-span"},q.default.createElement("div",{className:"ant-upload-text-icon"},l?l(e):q.default.createElement(g.LinkOutlined,null)),q.default.createElement("div",{className:"ant-upload-list-item-name"},S[r]?q.default.createElement(s.Input,{size:"small",autoFocus:!0,defaultValue:Mn(i),onBlur:t=>{const{value:l}=t.target;if(l!==Mn(i)){const t=Object.assign({},e,{name:`${l}.${$n(i)}`}),n=a.map((e=>e.uid!==r?e:t));null==v||v(t,n),null==b||b({file:t,fileList:n})}I(r,!1)}}):q.default.createElement("a",{rel:"noreferrer",target:"_blank",title:i,href:c,onClick:e=>{e.preventDefault(),d?T||I(r,!0):t.preview()}},i)),q.default.createElement("span",{className:"ant-upload-list-item-card-actions"},d&&!T&&q.default.createElement("button",{type:"button",className:p,onClick:()=>I(r)},S[r]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),d&&q.default.createElement("button",{type:"button",className:J.default(p,"preview"),onClick:()=>t.preview()},q.default.createElement(g.EyeOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"download"),disabled:u,onClick:()=>t.download()},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"delete"),disabled:T,onClick:()=>t.remove()},q.default.createElement(g.DeleteOutlined,null))))))})(t,r)}),q.default.createElement("span",{className:"inner",ref:C},n.children||c&&a.length?n.children:q.default.createElement(s.Button,{type:null!==(t=f.type)&&void 0!==t?t:"default",icon:null!==(l=f.icon)&&void 0!==l?l:q.default.createElement(g.UploadOutlined,null),disabled:T},f.text||x("qm.upload.text")),i&&!!a.length&&q.default.createElement(s.Button,{disabled:u,style:{marginLeft:8},onClick:e=>Ye(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof i)yield i(a);else for(const e of a)yield k(e)}))},x("qm.upload.batchDownload"))))};qn.displayName="QmUploadFile";const jn=e=>{const t=Ne({icon:q.default.createElement(g.DownloadOutlined,null),withCredentials:!1},e),{$size:l}=Ze(t),{t:n}=Xe(),[a,r]=q.default.useState(!1),i=dt(t,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return q.default.createElement(s.Button,je({},i,{size:l,loading:a,onClick:()=>Ye(void 0,void 0,void 0,(function*(){var e;r(!0);try{const{action:e,fileName:l,headers:a,params:r,beforeDownload:i=nt,onSuccess:o}=t,d=m.isString(e)?e:yield Ye(void 0,void 0,void 0,(function*(){const e=t.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!d)return mt("Download","参数 `action` 有误!");if(!i(d))return;yield Hn(d,{fileName:l,headers:a,params:r}),yield at(100),null==o||o(),s.message.success(n("qm.download.success"))}catch(l){null===(e=t.onError)||void 0===e||e.call(t,l),s.message.error(n("qm.download.error"))}r(!1)}))}),t.children||n("qm.download.text"))};function Kn(e,t){const l=$.useRef(null),n=$.useRef(0);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...l)=>{const a=Date.now();(!n.current||a-n.current>t)&&(e.apply(this,l),n.current=a)}),[e,t])}jn.displayName="QmDownload";const Vn=e=>{const{activeKey:t,labels:l,onTabClick:n}=e;return q.default.createElement(q.default.Fragment,null,l.map(((e,l)=>{const a={item:!0,actived:l===t};return q.default.createElement("div",{key:l,className:J.default(a),onClick:e=>n(l,e)},q.default.createElement("span",null,e))})))},zn=e=>{const{label:t,showDivider:l,className:n,style:a}=e,r={[yt("anchor-item")]:!0};return q.default.createElement("div",{className:J.default(r,n),style:a},l&&q.default.createElement(bt,{label:t,style:{marginBottom:10}}),e.children)};zn.displayName="AnchorItem";const Wn=q.default.forwardRef(((e,t)=>{const{labelList:l=[],defaultActiveIndex:n,labelWidth:a,tabPosition:r="left",onTabClick:i,className:o,style:s}=e,{$size:d}=Ze(e),u=q.default.useRef(null),c=q.default.useRef(),f=q.default.useRef("ready"),p=q.default.useRef(0),[m,h]=q.default.useState(n||0),g=q.default.useMemo((()=>!!(null==l?void 0:l.length)),[l]);q.default.useEffect((()=>{v();const e=ae.default(u.current,"scroll",x);return()=>{e.remove()}}),[]);const v=()=>{m>0&&(u.current.scrollTop=an(b(m),u.current))},y=e=>{const t=Math.abs(e),n=(g?l.map((e=>document.getElementById(e.id))):Array.from((null===(a=u.current)||void 0===a?void 0:a.children)||[])).map((e=>an(e,u.current)));var a;let r=-1;for(let e=0;e<n.length;e++){const l=n[e],a=n[e+1]||1e4;t>=l-1&&t<a&&(r=e)}return r},b=e=>g?document.getElementById(l[e].id):u.current.children[e],x=Kn((e=>{if("ready"!==f.current)return;const t=y(e.target.scrollTop);-1!==t&&h(t)}),60),E=e=>{const t=b(e);t&&(h(e),f.current="stop",c.current&&clearTimeout(c.current),re.default(t,{block:"start",behavior:"smooth",boundary:u.current}),c.current=setTimeout((()=>f.current="ready"),500))};q.default.useImperativeHandle(t,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>p.current?p.current:e,E(e)}})));const C=yt("anchor"),w={[C]:!0,[`${C}-left`]:"left"===r,[`${C}-top`]:"top"===r,[`${C}--lg`]:"large"===d,[`${C}--sm`]:"small"===d},S=[];q.default.Children.map(e.children,(e=>{var t;et(e)&&!tt(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const N=g?l.map((e=>e.label)):S.map((e=>e.props.label)),T=g?l.map((e=>e.id)):S.map(((e,t)=>e.props["data-id"]||t.toString()));return p.current=N.length,q.default.createElement("div",{className:J.default(w,o),style:s},q.default.createElement("div",{className:J.default("anchor-nav"),style:{width:a?ct(a):""}},q.default.createElement(Vn,{activeKey:m,labels:N,onTabClick:(e,t)=>{E(e),null==i||i({label:N[e],id:T[e]},t)}})),q.default.createElement("div",{ref:u,className:J.default("anchor-container")},g?e.children:S))}));Wn.displayName="QmAnchor",Wn.Item=zn;const Bn=e=>q.default.createElement(s.Tabs.TabPane,e,e.children);Bn.displayName="TabPane";const Un=e=>{const t=Ne({tabPosition:"top"},e),{items:l,tabPosition:n,tabBarGutter:a,className:r,authConfig:i}=t,{$size:o}=Ze(t),d=yt("tabs"),u={[d]:!0,[`${d}--lg`]:"large"===o,[`${d}--sm`]:"small"===o},c=Object.assign(Object.assign({},dt(t,["items","authConfig"])),{size:o,tabBarGutter:null!=a?a:["top","bottom"].includes(n)?30:0}),f=[];q.default.Children.map(t.children,(e=>{var t;et(e)&&!tt(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&f.push(e)}));const p=l?[...l]:f.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(i){const{fieldList:e=[]}=i||{};for(let t=0;t<p.length;t++){const l=p[t],n=e.find((e=>e.dataIndex===l.key)),{visible:a=1,disabled:r}=n||{};a?r&&(l.disabled=!0):(p.splice(t,1),t--)}}return q.default.createElement(s.Tabs,je({},c,{items:p,className:J.default(u,r)}))};Un.displayName="QmTabs",Un.TabPane=Bn;const Gn=q.default.forwardRef(((e,t)=>{var l;const n=Ne({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:a,open:r,className:i,loading:o,showHeader:d,showFullScreen:u,maskClosable:c,destroyOnClose:f,onClose:p,onClosed:h,onFullChange:v}=n,{global:y}=q.default.useContext(xe),{$size:b}=Ze(n),x=q.default.useRef(null),E=q.default.useRef(null),C=q.default.useRef(!1),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(!1);Ql((()=>{(null!=r?r:a)&&(!f&&C.current||m.isUndefined(o)&&T(!0))}),[null!=r?r:a]),Ql((()=>{E.current&&ln(E.current,w?{width:"100%"}:{width:ct(n.width||"72%")})}),[w]);const R=()=>{E.current=on(x.current,"ant-drawer-content-wrapper"),S(!w),null==v||v(!w)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>O(!0),STOP_LOADING:()=>O(!1)})));const k=yt("drawer"),L={[k]:!0,"no-header":!d,[`${k}--lg`]:"large"===b,[`${k}--sm`]:"small"===b};return q.default.createElement(s.Drawer,je({},dt(n,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=r?r:a,maskClosable:null!==(l=null!=c?c:null==y?void 0:y.maskClosable)&&void 0!==l&&l,className:J.default(L,i),title:q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{ref:x,className:"text"},d&&n.title),u&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:R},q.default.createElement(w?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,afterOpenChange:e=>{e?(C.current=!0,m.isUndefined(o)&&setTimeout((()=>T(!1)),100)):(S(!1),null==h||h())},onClose:p}),n.children,(o||I||N)&&q.default.createElement(gn,{spinning:!0,className:J.default("spinning")}))}));Gn.displayName="QmDrawer";const Yn="10vh";var Xn;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Xn||(Xn={}));const Qn=q.default.forwardRef(((e,t)=>{var l;const n=Ne({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Yn}},e),{visible:a,open:r,width:i,height:o,className:d,loading:u,draggable:c,showHeader:f,showFullScreen:p,maskClosable:h,destroyOnClose:v,bodyStyle:y,onFullChange:b,onClose:x,onClosed:E}=n,{global:C}=q.default.useContext(xe),{$size:w}=Ze(n),S=q.default.createRef(),N=q.default.useRef(!1),T=q.default.useMemo((()=>`calc(100vh - ${Yn} - ${Yn} - ${Xn[f?w:"none"]}px)`),[w,f]),[I,O]=q.default.useState(!1),[R,k]=q.default.useState(!1),[L,P]=q.default.useState(!1),[A,D]=q.default.useState(!0),[_,F]=q.default.useState({left:0,top:0,bottom:0,right:0}),[H,M]=q.default.useState();Ql((()=>{if(null!=r?r:a){if(!v&&N.current||m.isUndefined(u)&&k(!0),!v&&N.current)return;setTimeout((()=>{N.current=!0,m.isUndefined(u)&&k(!1)}),400)}}),[null!=r?r:a]),Ql((()=>{M(I?{x:0,y:0}:void 0)}),[I]);const $=e=>{const t=on(e.target,"ant-modal");if(!t)return;const l=t.querySelector(".ant-modal-body");I?(ln(t,{width:ct(i||"60%"),height:"auto",top:Yn}),ln(l,{height:o?ct(o):T,maxHeight:"auto"===o?T:""})):(ln(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),ln(l,{height:`calc(100vh - ${Xn[f?w:"none"]}px)`,maxHeight:""})),O(!I),null==b||b(!I)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>P(!0),STOP_LOADING:()=>P(!1)})));const j=yt("modal"),K={height:o?ct(o):T,maxHeight:"auto"===o?T:"",overflow:"auto"},V={[j]:!0,"no-header":!f,[`${j}--lg`]:"large"===w,[`${j}--sm`]:"small"===w};return q.default.createElement(s.Modal,je({},dt(n,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=r?r:a,maskClosable:null!==(l=null!=h?h:null==C?void 0:C.maskClosable)&&void 0!==l&&l,className:J.default(V,d),title:q.default.createElement("div",{onMouseOver:()=>{A&&D(!1)},onMouseOut:()=>{D(!0)}},q.default.createElement("span",{className:"text"},f&&n.title),p&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:$},q.default.createElement(I?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,bodyStyle:Object.assign({},K,y),onCancel:x,afterClose:()=>{null==E||E(),O(!1)},modalRender:e=>q.default.createElement(ie.default,{nodeRef:S,bounds:_,position:H,disabled:!c||A||I,onStart:(e,t)=>((e,t)=>{const{clientWidth:l,clientHeight:n}=window.document.documentElement,a=S.current.getBoundingClientRect();a&&F({left:-a.left+t.x,right:l-(a.right-t.x)-1,top:-a.top+t.y,bottom:n-(a.bottom-t.y)-1})})(0,t)},q.default.createElement("div",{ref:S},e))}),n.children,(u||L||R)&&q.default.createElement(gn,{spinning:!0,className:J.default("spinning")}))}));Qn.displayName="QmModal";const Zn=e.createContext(void 0),Jn=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ea={operations:function(e){const t=e.split(" "),l=[];let n=0;l[n]=[];for(let e=0;e<t.length;e++)Jn.includes(t[e])?(l[n]=l[n].join(" "),n++,l[n]=[]):l[n].push(t[e]);return l[n]=l[n].join(" "),l},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 l=0,n=(e=Array.isArray(e)?e:[e]).length;l<n;l++)t+="number"==typeof e[l]?e[l]:"'"+e[l]+"'",l<n-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,l){return e.split(t).join(l)},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 ta=["==","<",">","<=",">=","!=","like","likes","in","nin"];var la=function(e){let t=0;const l=e.length;for(let n=0;n<l;n++){const l=e.charAt(n);"("===l&&t++,")"===l&&t--}return 0===t},na=function(e,t){let l="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?l+=" "+e[t]+" ":l+=e[t];const n=l.split(" ").filter((e=>""!==e));for(let e=0;e<n.length;e++)ta.includes(n[e])&&("this"!=n[e-1]?n[e-1]=t+"."+n[e-1]:n[e-1]=t),ta.includes(n[e])&&(n.splice(e-1,3,`__query__(${n[e-1]}, '${n[e]}', ${n[e+1]})`),e-=2);return e=n.join(" ")};const aa=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,ra=["string","number","boolean","symbol"],ia=e=>ra.includes(typeof e),oa=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),sa=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(aa,"\\$1"),"i");window.__query__=(...e)=>((e,t,l)=>{e=null!=e?e:"";let n=!0;switch(t){case"like":n=null!==e.toString().match(sa(l));break;case"likes":n=l.split(/,|,/).some((t=>null!==e.toString().match(sa(t))));break;case"in":ia(l)&&(l=[l]),Array.isArray(l)&&(n=Array.isArray(e)?l.every((t=>e.includes(t))):l.includes(e));break;case"nin":ia(l)&&(l=[l]),Array.isArray(l)&&(n=!(Array.isArray(e)?l.some((t=>e.includes(t))):l.includes(e)));break;case"!=":case"<>":n=(oa(e)?e.slice(0,10):e)!=l;break;case"<":n=(oa(e)?e.slice(0,10):e)<l;break;case"<=":n=(oa(e)?e.slice(0,10):e)<=l;break;case">":n=(oa(e)?e.slice(0,10):e)>l;break;case">=":n=(oa(e)?e.slice(0,10):e)>=l;break;default:n=(oa(e)?e.slice(0,10):e)==l}return n})(e[0],e[1],e[2]);const da=ea.stringify,ua=ea.array_format,ca=la,fa=(e,t,l)=>{let n=[];t=ea.replace_symbols(t);try{if(l){const l=new Function("record",`return ${na(t,"record")};`);n=Ga(e,(e=>l(e)))}else{const l=new Function("array","i",`return ${na(t,"array[i]")};`);for(let t=0,a=e.length;t<a;t++)l(e,t)&&n.push(e[t])}}catch(t){mt("Table","组件 `initialFilter` 参数有误!"),n=e}return n},pa=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...pa(e.children)):t.push(e)})),t},ma=e=>e.filter((e=>(e.children&&(e.children=ma(e.children)),!e.hidden&&!e.noAuth))),ha=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...ha(e.children))})),t},ga=(e,t)=>e.map((e=>(e.children&&(e.children=ga(e.children,t)),null==t||t(e),e))),va=(e,t)=>{for(const l of e){if(l.dataIndex===t)return l;if(l.children){const e=va(l.children,t);if(e)return e}}return null},ya=e=>{const t=e.children;return t?t[0].children?ya(t[0]):t[0]:e},ba=e=>{const t=e.children;return t?t[t.length-1].children?ba(t[t.length-1]):t[t.length-1]:e},xa=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ea=(e,t)=>{for(const l of e){if(l.rowKey===t)return l;if(l.children){const e=Ea(l.children,t);if(e)return e}}return null},Ca=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Ca(e.children))})),t},wa=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...wa(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(t(e))})),l},Sa=e=>{let t=1;const l=(e,n)=>{var a;if(n&&(e.level=n.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((n=>{e.fixed?n.fixed=e.fixed:delete n.fixed,l(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=null!==(a=e.colSpan)&&void 0!==a?a:1};e.forEach((e=>{e.level=1,l(e,null)}));const n=[];for(let e=0;e<t;e++)n.push([]);return ha(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n},Na=e=>Object.assign(e,{__prevent__:!0}),Ta=e=>{delete e.__prevent__},Ia=(e,t,l={left:0,top:0})=>{if(e){const n=e.parentNode;if(l.top+=e.offsetTop,l.left+=e.offsetLeft,n&&n!==document.documentElement&&n!==document.body&&(l.top-=n.scrollTop,l.left-=n.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Ia(e.offsetParent,t,l)}return l},Oa=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Ra=(e,t)=>m.transform(e,((e,l,n)=>{m.isEqual(l,t[n])||(e[n]=m.isPlainObject(l)&&m.isPlainObject(t[n])?Ra(l,t[n]):l)})),ka=(e,t)=>{var l;return null!==(l=m.get(e,t))&&void 0!==l?l:""},La=(e,t,l,n)=>{n>=0&&null!=l&&(l=Number(l).toFixed(n)),m.set(e,t,null!=l?l:"")},Pa=(e,t)=>{if(!t.includes("|"))return ka(e,t);const l=[];return t.split("|").forEach((t=>{t&&l.push(ka(e,t))})),l.every((e=>!e))?"":l.join(" | ")},Aa=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),Da=e=>{const t=(e=e.toString()).split("."),l="-"===t[0].charAt(0)?"-":"";let n=l?t[0].slice(1):t[0],a="";for(;n.length>3;)a=`,${n.slice(-3)}${a}`,n=n.slice(0,n.length-3);return n&&(a=n+a),`${l}${a}${t[1]?`.${t[1]}`:""}`},_a=(e,t)=>{const l=e.toString();if(!Aa(l)||0===t)return e;const n=Number.parseFloat(l).toString(),a=n.indexOf(".");if(-1===a)return n+"."+"0".repeat(t);const r=Math.max(0,t-(n.length-a-1));return n+"0".repeat(r)},Fa=(e,t)=>e?j.default(e,t):null,Ha=(e,t)=>e?j.default(e).format(t):"",Ma=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const l=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?l:3&l|8).toString(16)}))},$a=e=>{const t=[];if(q.default.isValidElement(e)){const{children:l}=e.props;q.default.Children.forEach(l,(e=>{t.push(...$a(e))}))}else t.push(e);return t},qa=e=>$a(e).join(""),ja=e=>e.filter((e=>!e._group)),Ka=(e,t=!1)=>{let l="";if(Array.isArray(e)){let n=0;for(let a=0,r=e.length;a<r;a++){const r=e[a];if(!r.fieldName)continue;const i=Array.isArray(r.condition)?ua(r.condition):da(r.condition,"^");l+=`${r.bracketLeft} ${t?`${r.fieldName}|${r.fieldType}`:r.fieldName} ${r.expression} ${i} ${r.bracketRight} ${r.logic} `,n=r.logic.length}l=l.slice(0,-1*n-2)}else{const n=5;for(const n in e){const[a,r]=n.includes("|")?n.split("|"):[n,""],i=e[n];for(const e in i){l+=`${t?`${a}|${r}`:a} ${e} ${Array.isArray(i[e])?ua(i[e]):da(i[e],"^")} and `}}l=l.slice(0,-1*n)}return l.replace(/\s+/g," ").trim()},Va=(e=[],t=[])=>{const l={};return e.forEach((e=>{const n=JSON.stringify((e=>{const l=[];return t.forEach((t=>l.push(ka(e,t)))),l})(e));l[n]=l[n]||[],l[n].push(e)})),Object.keys(l).map((e=>l[e]))},za=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].dataIndex===t)return[e[l]];if(Array.isArray(e[l].children)){const n=za(e[l].children,t);if(n)return[e[l],n].flat()}}},Wa=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].rowKey===t)return[t];if(Array.isArray(e[l].children)){const n=Wa(e[l].children,t);if(n)return[e[l].rowKey,n].flat()}}},Ba=(e,t)=>{for(const l of e){if(Array.isArray(l.children)){const e=Ba(l.children,t);if(e)return e}if(t(l))return l}return null},Ua=e=>{const t=[];for(let l=0;l<e.length;l++)Array.isArray(e[l].children)&&t.push(...Ua(e[l].children)),t.push(e[l].rowKey);return t},Ga=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Ga(e.children,t),t(e)||e.children&&e.children.length))),Ya=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Xa=(e,t,l=!1)=>{const n=new Set;return function e(t,a,r=1){if(n.has(t))return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);const i=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(let l=0;l<t.length;l++)if(!e(t[l],a[l],i))return!1;return!0}if(t&&a&&"object"==typeof t&&"object"==typeof a){const l=Object.keys(t);return l.length===Object.keys(a).length&&l.every((l=>e(t[l],a[l],i)))}return!1}(e,t)},Qa=e=>["","small","middle","large"].includes(e),Za=80,Ja="1",er="0",tr=400,lr=["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"],nr={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 ar,rr,ir;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(ar||(ar={})),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"}(rr||(rr={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ir||(ir={}));const or={items:se.default.arrayOf(se.default.shape({type:se.default.string.isRequired,fieldName:se.default.string.isRequired})),initialValues:se.default.object,initialExtras:se.default.object,layout:se.default.oneOf(["horizontal","vertical"]),size:(e,t,l)=>{if(!Qa(e[t]||""))return pt("Form","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},cols:se.default.number,className:se.default.string,style:se.default.object,compactMode:se.default.bool,labelWidth:se.default.oneOfType([se.default.number,se.default.string]),labelAlign:se.default.oneOf(["left","right"]),labelWrap:se.default.bool,formType:se.default.oneOf(["default","search","onlyShow"]),disabled:se.default.bool,uniqueKey:se.default.string,defaultRows:se.default.number,defaultExpand:se.default.bool,searchButtonCols:se.default.number,scrollToFirstError:se.default.bool,authConfig:se.default.object,isAutoFocus:se.default.bool,isCollapse:se.default.bool,isFieldsDefine:se.default.bool,isSearchBtn:se.default.bool,isSubmitBtn:se.default.bool,fieldsChange:se.default.func,onValuesChange:se.default.func,onFieldsChange:se.default.func,onFinish:se.default.func,onFinishFailed:se.default.func,onReset:se.default.func,onCollapse:se.default.func},sr={layout:"horizontal",labelWidth:Za,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:lt,onFieldsChange:lt,onFinish:lt,onFinishFailed:lt,onReset:lt,onCollapse:lt},dr=(e,t)=>{if(!e)return null;if(t===rr.week){const t=e.match(/^(\d{4})-(\d+)/);return t?j.default().year(Number(t[1])).week(Number(t[2])):null}if(t===rr.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?j.default().year(Number(t[1])).quarter(Number(t[2])):null}return j.default(e,t)},ur=(e,t)=>e?j.default(e).format(t):"",cr=e=>""===e||null==e,fr=(e,t)=>{var l;if(!e)return"";if(!t.includes("|"))return e[t];const n=t.split("|");let a="";for(let t=0,r=n.length;t<r;t++){a+=(null!==(l=e[n[t].trim()])&&void 0!==l?l:"")+(t===r-1?"":" | ")}return a},pr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},mr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},hr=(e,t,l)=>e.map((e=>{const n={value:e[t],text:e[l]};return e.disabled&&(n.disabled=!0),m.isUndefined(e.isLeaf)||(n.isLeaf=!!e.isLeaf),m.isUndefined(e.selectable)||(n.selectable=!!e.selectable),Array.isArray(e.children)&&(n.children=hr(e.children,t,l)),n})),gr=(e,t)=>{for(const l of e){if(l.value===t)return l;if(Array.isArray(l.children)){const e=gr(l.children,t);if(e)return e}}return null},vr=(e,t,l=0)=>{const n=[];return e.forEach((e=>{e.value==t.split(",")[l]&&n.push(e),Array.isArray(e.children)&&n.push(...vr(e.children,t,l+1))})),n},yr=e=>et(e)||"string"==typeof e,br=e=>et(e)?$a(e).join(""):null!=e?e:"",xr=(e,t,l,n)=>{var a;const r={};return r.filters=(null===(a=e.filters)||void 0===a?void 0:a.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})))||[],r.table={columns:e.columns||[],rowKey:e.valueName},r.fieldsDefine={valueKey:e.valueKey||e.valueName},r.fieldAliasMap={[n?"textKey":t]:e.displayName[0],[n?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(r.table.fetch={api:l(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(r.echoRequest={fetchApi:l(e.echoSetting.api),formatter:t=>{var l;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(l=t.key)&&void 0!==l?l:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(r.echoRequest.fieldAliasMap={[n?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(r.tree={fetch:{api:l(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const l={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>l[e.tableField]=e.treeField)),l}}),e.emmediateSetting&&(r.columns=e.emmediateSetting.columns,r.request={fetchApi:l(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),r};var Er={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 Cr="阿",wr="鿿",Sr=1,Nr=2,Tr=3;let Ir,Or=null;function Rr(e){return e||null===Or?("object"==typeof Intl&&Intl.Collator?(Ir=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Or=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Or=!1,Or):Or}function kr(e){const t=Er.UNIHANS,l=Er.PINYINS,n=Er.EXCEPTIONS,a={source:e};if(e in n)return a.type=Nr,a.target=n[e],a;let r,i=-1;if(e.charCodeAt(0)<256)return a.type=Sr,a.target=e,a;if(r=Ir.compare(e,Cr),r<0)return a.type=Tr,a.target=e,a;if(0===r)a.type=Nr,i=0;else{if(r=Ir.compare(e,wr),r>0)return a.type=Tr,a.target=e,a;0===r&&(a.type=Nr,i=t.length-1)}if(a.type=Nr,i<0){let l=0,n=t.length-1;for(;l<=n;){i=~~((l+n)/2);const a=t[i];if(r=Ir.compare(e,a),0===r)break;r>0?l=i+1:n=i-1}}return r<0&&i--,a.target=l[i],a.target||(a.type=Tr,a.target=a.source),a}function Lr(e){return"string"==typeof e&&Rr()?e.split("").map((e=>kr(e))):e}var Pr={isSupported:Rr,parse:Lr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Er)})))},genToken:kr,convertToPinyin:(e,t,l)=>Lr(e).map((e=>t&&e.type===Nr?e.target.toLowerCase():e.target)).join(l||"")};var Ar={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)}};Pr.isSupported()&&Ar.shouldPatch(Pr.genToken)&&Pr.patchDict(Ar);const Dr=e=>{const{value:t,bordered:l}=e;return q.default.createElement(s.Input,{value:t,title:t,bordered:l,readOnly:!0})};Dr.displayName="FormItemView";const{Option:_r}=s.Select,Fr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{t:d}=Xe(),{fieldName:u,options:c={},style:f={},placeholder:p=d("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:h=!0,readOnly:g,disabled:v,onClear:y}=e.option,{itemList:b=[],filterable:x=!0,listHeight:E=tr,collapseTags:C,maxTagTextLength:w,dropdownStyle:S,openPyt:N=!0}=c,T=ot(b)?n: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())||""},O=e=>a?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return t.isOnlyShow?q.default.createElement(Dr,{value:O(l),bordered:m}):q.default.createElement(s.Select,je({value:l,mode:a?"multiple":void 0,popupClassName:`form-popper__${u}`,dropdownStyle:S,placeholder:p,style:f,loading:r,bordered:m,allowClear:h,disabled:v,showSearch:x,listHeight:E,maxTagCount:C?"responsive":void 0,maxTagTextLength:w},a?{title:O(l)}:null,{filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"",a=Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,O(e),T)})(e)},onClear:y}),T.map((e=>q.default.createElement(_r,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Hr extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l){this.setState({loading:!0});try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=l.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:d={},labelWidth:u=e.props.labelWidth,className:c,extra:f,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:g=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":ct(u)},required:e.getFormItemRequired(h)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(Fr,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{g(t,l,n),e.setViewValue(i,l)}}))),p&&q.default.createElement(s.Col,null,e.renderFormItemButton(i,p)),f&&q.default.createElement(s.Col,{flex:ct(f.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}Hr.contextType=Zn;const Mr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:d,disabled:u=t.isFormDisabled}=e.option,{labelToCheckbox:c,falseValue:f=er,trueValue:p=Ja}=i,{t:m}=Xe(),h=e=>m(e===p?"am.form.trueText":"am.form.falseText");return q.default.createElement(s.Checkbox,{checked:l===p,style:o,disabled:u||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==n||n(e),a(e,h(e))})(t?p:f)}},c?r:null)};class $r extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option,{labelToCheckbox:m}=i;return q.default.createElement(s.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Mr,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}$r.contextType=Zn;const qr=e=>{const{uniqueKey:t,items:l,fieldsChange:n}=e,{global:a}=q.default.useContext(xe),{$$form:r}=q.default.useContext(Zn),{$size:i}=Ze(e),{t:o}=Xe(),d=q.default.useRef(null),[u,c]=q.default.useState(!1),f=q.default.useMemo((()=>t?`form_${t}`:""),[t]);q.default.useLayoutEffect((()=>{v()}),[]);const p=()=>{if(!f)return;const e=JSON.parse(localStorage.getItem(f));var t;if(e||(t=f,Ye(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.getComponentConfigApi;if(e)try{const l=yield e({key:t});if(200===l.code)return l.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(f,JSON.stringify(e)),v()):(null==a?void 0:a.getComponentConfigApi)&&h(l)})).catch((()=>{})),!e)return;return m.xor(e.map((e=>e.fieldName)),l.map((e=>e.fieldName))).length>0?l.map((t=>{const{fieldName:l}=t,n=e.find((e=>e.fieldName===l));return n?(m.isUndefined(n.hidden)||(t.hidden=n.hidden),t):t})):e.map((e=>{const t=l.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))},h=e=>{if(!f)return;const t=e.map((e=>{const t={};return m.isUndefined(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),l=JSON.parse(localStorage.getItem(f));var n,r;m.isEqual(t,l)||(localStorage.setItem(f,JSON.stringify(t)),n=f,r=t,Ye(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.saveComponentConfigApi;if(e)try{yield e({[n]:r})}catch(e){}})))},v=()=>{const e=p();e&&y(e)},y=e=>{null==n||n([...e])},b=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","fields-list")},q.default.createElement("div",{className:"reset"},q.default.createElement(ht,{type:"text",size:"small",onClick:()=>(e=>{const t=e.map((e=>{const t=l.find((t=>t.fieldName===e.fieldName))||ut(e);return Object.assign(t,{hidden:e.hidden})}));y(t),h(t)})(r.getOriginItems())},o("qm.table.columnFilter.reset"))),q.default.createElement(T.ReactSortable,{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));if(m.isEqual(t,n))return;r.setExpandHandle(!0);const a=Ya(e);y(a),h(a)}},l.map((e=>{var t;return q.default.createElement("li",{key:e.fieldName,className:"item",style:e.noAuth?{display:"none"}:void 0},q.default.createElement(s.Checkbox,{disabled:(null===(t=e.rules)||void 0===t?void 0:t.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,y(l),h(l)}}),q.default.createElement(g.HolderOutlined,{className:"handle",title:o("qm.form.draggable")}),q.default.createElement("span",{className:"title"},r.getFormItemLabel(e.label)))})))),x=yt("form-fields-filter"),E={[x]:!0,[`${x}--lg`]:"large"===i,[`${x}--sm`]:"small"===i};return q.default.createElement(s.Dropdown,{open:u,trigger:["click"],dropdownRender:()=>b(),overlayClassName:J.default(E),placement:"bottomRight",overlayStyle:{minWidth:160},getPopupContainer:()=>d.current,onOpenChange:e=>{c(e)}},q.default.createElement("a",{ref:d,style:{padding:"5px 0"}},q.default.createElement(g.UnorderedListOutlined,null)))};qr.displayName="FieldsFilter";const jr=q.default.forwardRef(((e,t)=>{const{$$form:l}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{t:i}=Xe(),{options:o={},style:d={},placeholder:u=i("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h,onFocus:g,onBlur:v,onEnter:y,onClear:b}=e.option,{prefix:x,suffix:E,password:C,maxLength:w,pattern:S,toUpper:N,toTrim:T,autoFocus:I,autoComplete:O,secretType:R}=o,k=R&&(p||h),L=q.default.useRef(),P=q.default.useRef(!1);q.default.useEffect((()=>{var e;const t=()=>null==b?void 0:b(),l=null===(e=L.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return f&&l&&l.addEventListener("click",t),()=>{null==l||l.removeEventListener("click",t)}}),[]);const A=e=>{null==a||a(e),r(e)},D=C?s.Input.Password:s.Input,_=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))(n,R):n;return l.isOnlyShow?q.default.createElement(Dr,{value:(e=>e&&C?new Array(e.length).fill("*").join(""):e)(_),bordered:c}):q.default.createElement(D,{ref:e=>{L.current=e,"function"==typeof t&&t(e)},value:_,autoComplete:C?"new-password":O,autoFocus:I,placeholder:u,style:d,title:C?"":_,prefix:x,suffix:E,maxLength:w,bordered:c,allowClear:f,readOnly:p,disabled:h,onFocus:e=>{null==g||g(e.target.value,e)},onBlur:t=>{var l;let n=null!==(l=t.target.value)&&void 0!==l?l:"";if(T){const e=n.trim();n!==e&&(n=e,A(n))}(t=>{const{onBlur:l}=e;null==l||l(t)})(n),null==v||v(n,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==y||y(n,e),l.isFilterType&&(l.SUBMIT_FORM(),null===(t=L.current)||void 0===t||t.blur())}},onCompositionStart:()=>{P.current=!0},onCompositionEnd:()=>{P.current=!1},onChange:e=>{let t=e.target.value;m.isRegExp(S)&&(t=S.test(t)?t:null!=n?n:""),N&&!P.current&&(t=t.toUpperCase()),A(t)}})}));jr.displayName="VInput";class Kr extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(jr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(a,t)}}))),c&&q.default.createElement(s.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Kr.contextType=Zn;const Vr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{prefix:p,suffix:m,maxLength:h}=i,g=e=>{const t=e.every((e=>!e))?[]:e;null==n||n(t),a(t,v(t))},v=e=>e.join(" - ");return t.isOnlyShow?q.default.createElement(Dr,{value:v(l),bordered:d}):q.default.createElement(s.Input.Group,null,q.default.createElement(s.Input,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:p,suffix:m,maxLength:h,allowClear:u,bordered:d,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([t,l[1]])}}),q.default.createElement(s.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:f,readOnly:!0}),q.default.createElement(s.Input,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:p,suffix:m,maxLength:h,bordered:d,allowClear:u,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([l[0],t])}}))};class zr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:d,validateTrigger:u,rules:c=[],onChange:f=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(i)},required:e.getFormItemRequired(c)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Vr,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),d&&q.default.createElement(s.Col,{flex:ct(d.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}zr.contextType=Zn;const Wr=q.default.forwardRef(((e,t)=>{const{$$form:l}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{t:i}=Xe(),{options:o={},style:d={},placeholder:u=i("qm.form.inputPlaceholder"),bordered:c=!0,readOnly:f,disabled:p,onFocus:h,onBlur:g,onEnter:v}=e.option,{step:y=1,min:b,max:x,precision:E,autoFocus:C,stringMode:w,textAlign:S="left",controls:N=!0,formatter:T,parser:I}=o,O=q.default.useRef(),R=q.default.useRef(n),k=e=>{const t=cr(e)?"":m.isNumber(e)?e.toFixed(E):new ue.default(e).toFixed(E);return"function"==typeof T?T(t):t},L={[S]:!0,controls:N};return l.isOnlyShow?q.default.createElement(Dr,{value:k(n),bordered:c}):q.default.createElement(s.InputNumber,{ref:e=>{O.current=e,"function"==typeof t&&t(e)},value:n,className:J.default(L),placeholder:u,style:Object.assign({width:"100%"},d),step:y,min:b,max:x,controls:N,precision:E,autoFocus:C,stringMode:w,formatter:T,parser:I,bordered:c,readOnly:f,disabled:p,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{rt((()=>{(t=>{const{onBlur:l}=e;null==l||l(t)})(R.current),null==g||g(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==v||v(n,e),l.isFilterType&&(l.SUBMIT_FORM(),null===(t=O.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==a||a(e),r(e,k(e))})(t)}})}));Wr.displayName="VInputNumber";class Br extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Wr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,l)=>{m(t),e.setViewValue(a,l)}}))),c&&q.default.createElement(s.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Br.contextType=Zn;const Ur=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{step:p=1,min:m=0,max:h,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=i,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),C(e)},C=e=>{const t=e.every((e=>null===e))?[]:[...e];null==n||n(t),a(t,w(t))},w=e=>cr(e)?"":e.map((e=>cr(e)?"":Number(e).toFixed(y))),S={[g]:!0,controls:v};return t.isOnlyShow?q.default.createElement(Dr,{value:w(l),bordered:d}):q.default.createElement(s.Input.Group,null,q.default.createElement(s.InputNumber,{value:l[0],className:J.default("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:d,readOnly:c,disabled:f,onChange:e=>{C([e,l[1]])},onBlur:()=>{E(l)}}),q.default.createElement(s.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:f,readOnly:!0}),q.default.createElement(s.InputNumber,{value:l[1],className:J.default("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:d,readOnly:c,disabled:f,onChange:e=>{C([l[0],e])},onBlur:()=>{E(l)}}))};class Gr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:d,validateTrigger:u,rules:c=[],onChange:f=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(i)},required:e.getFormItemRequired(c)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ur,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),d&&q.default.createElement(s.Col,{flex:ct(d.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}var Yr;Gr.contextType=Zn,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Yr||(Yr={}));const Xr=e.createContext(void 0),Qr={dataIndex:se.default.string.isRequired,title:se.default.string.isRequired,description:se.default.string,colSpan:se.default.number,width:se.default.number,minWidth:se.default.number,fixed:se.default.oneOf(["left","right"]),align:se.default.oneOf(["left","center","right"]),theadAlign:se.default.oneOf(["left","center","right"]),printFixed:se.default.bool,hidden:se.default.bool,noAuth:se.default.bool,noFixed:se.default.bool,ellipsis:se.default.bool,className:se.default.string,theadClassName:se.default.string,children:se.default.array,sorter:se.default.oneOfType([se.default.bool,se.default.func]),filter:se.default.shape({type:se.default.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),style:se.default.object}),precision:se.default.number,displayPrecision:se.default.number,formatType:se.default.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:se.default.bool,canCopy:se.default.bool,editRender:se.default.func,dictItems:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),summation:se.default.shape({sumBySelection:se.default.bool,displayWhenNotSelect:se.default.bool,dataKey:se.default.string,unit:se.default.string,render:se.default.func}),groupSummary:se.default.shape({dataKey:se.default.string,unit:se.default.string,render:se.default.func}),shouldCellUpdate:se.default.func,headRender:se.default.func,render:se.default.func};se.default.arrayOf(se.default.shape(Qr)).isRequired,se.default.func,se.default.array,se.default.oneOfType([se.default.string,se.default.func]).isRequired,se.default.number,se.default.bool,se.default.bool,se.default.shape({api:se.default.func.isRequired,params:se.default.object.isRequired,formatter:se.default.func,beforeFetch:se.default.func,afterFetch:se.default.func,stopToFirst:se.default.bool,dataKey:se.default.string,callback:se.default.func}),se.default.bool,se.default.bool,se.default.string,se.default.string,se.default.object,se.default.bool,se.default.bool,se.default.bool,se.default.oneOfType([se.default.object,se.default.func]),se.default.oneOfType([se.default.object,se.default.func]),se.default.array,se.default.func,se.default.bool,se.default.object,se.default.object,se.default.shape({type:se.default.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:se.default.array,selectedRowKeys:se.default.array,hideSelectAll:se.default.bool,checkStrictly:se.default.bool,filterable:se.default.bool,selectByClickRow:se.default.bool,selectFirstRowOnChange:se.default.bool,clearableAfterFetched:se.default.bool,selectAllOnCurrentPage:se.default.bool,fetchSelectedRows:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fetchAllRowKeys:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),disabled:se.default.func,onChange:se.default.func,onSelect:se.default.func,onSelectAll:se.default.func}),se.default.shape({currentRowKey:se.default.oneOfType([se.default.number,se.default.string]),disabled:se.default.func,onChange:se.default.func}),se.default.shape({virtual:se.default.bool,overscan:se.default.number,doubleXScrollbar:se.default.bool}),se.default.shape({expandIconColumn:se.default.string}),se.default.shape({defaultExpandAllRows:se.default.bool,defaultExpandedRowKeys:se.default.array,expandedRowKeys:se.default.array,hideExpandAll:se.default.bool,rowExpandable:se.default.func,expandedRowClassName:se.default.string,expandedRowRender:se.default.func,onExpand:se.default.func,onChange:se.default.func}),se.default.shape({cellMerge:se.default.bool,onCellMerge:se.default.func,onSelectChange:se.default.func}),se.default.shape({groupItems:se.default.arrayOf(se.default.shape({dataIndex:se.default.string.isRequired,titleIndex:se.default.string,color:se.default.string,backgroundColor:se.default.string})),fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),onChange:se.default.func}),se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.shape({current:se.default.number,pageSize:se.default.number,pageSizeOptions:se.default.array,showSizeChanger:se.default.bool,showQuickJumper:se.default.bool}),se.default.shape({fileName:se.default.string,fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object}),beforeExport:se.default.func,cellStyle:se.default.bool,hideIcon:se.default.bool}),se.default.shape({showLogo:se.default.bool}),se.default.shape({fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fieldList:se.default.arrayOf(se.default.object)}),se.default.shape({position:se.default.oneOf(["top","bottom"]),hideAlert:se.default.bool,hideClearButton:se.default.bool}),se.default.oneOf(["left","right"]),se.default.func,se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func;const Zr={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},Jr=10,ei="1",ti="0",li="YYYY-MM-DD",ni="YYYY-MM-DD HH:mm:ss",ai="YYYYMMDDHHmmss",ri={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 ii;!function(e){e.left="flex-start",e.right="flex-end"}(ii||(ii={}));const oi=Object.assign({},$).useId;let si=0;var di=oi?function(e){const t=oi();return e||t}:function(e){const[t]=$.useState(`qm_unique_${si}`);return $.useEffect((()=>{si+=1}),[]),e||t};let ui=[];const ci={_getInstance:function(e){var t;return null!==(t=ui.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=ui[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==ui.findIndex((e=>e===t))&&(this.deregister(e),ui=[t,...ui])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),ui=[{id:e,vm:t},...ui])},deregister:function(e){e&&(ui=ui.filter((t=>t.id!==e)))}};class fi{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 pi={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 mi(e){return void 0!==e}function hi(e,t){const{defaultValue:l,value:n,onChange:a,postState:r}=t||{},[i,o]=$.useState((()=>mi(n)?n:mi(l)?"function"==typeof l?l():l:"function"==typeof e?e():e)),s=mi(n)?n:i,d=r?r(s):s,u=Qe(a),[c,f]=$.useState([s]);Ie((()=>{const e=c[0];i!==e&&u(i,e)}),[c]),Ie((()=>{mi(n)||o(n)}),[n]);return[d,Qe((e=>{o(e),f([s])}))]}const gi=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=gi(t.children)),t})),vi=(e,t)=>{const{fetch:l,columns:n,border:a,rowSelection:r,summation:i,expandable:o,treeConfig:s,webPagination:d,scrollPagination:u,showSuperSearch:c,showFastSearch:f,showGroupSummary:p,showTableImport:m,showClipboard:h,showSelectCollection:g,showPivotGrid:v,footRender:y}=e,{tableRef:b,getRowKey:x,tableFullData:E,tableFlatData:C,updateMark:w,selectionKeys:S,sorter:N,filters:T,superFilters:I,pagination:O,mergedTdCells:R}=t,{selectionRows:k,summaries:L}=b.current,{expandIconColumn:P=""}=s||{},{t:A}=Xe(),D=e=>{const t=(e=>{const t=[],l=[],n=[];for(let a=0;a<e.length;a++){const r=e[a];"left"===r.fixed?t.push(r):"right"===r.fixed?l.push(r):n.push(r)}return[...t,...n,...l]})(gi(e)),l=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:pi.selectionColumn,title:"radio"===t?A("qm.table.config.selectionText"):"",width:pi.selectionColumnWidth,fixed:"left",type:t}})(r),n=(null==(a=o)?void 0:a.expandedRowRender)?{dataIndex:pi.expandableColumn,title:"",width:pi.selectionColumnWidth,fixed:"left",type:"expand"}:null;var a;return l&&t.unshift(l),n&&t.unshift(n),ma(t)},_=(e,t,l,n,a)=>{const r=`${t},${l}`;e.has(r)||e.set(r,{row:t,col:l,rowSpan:n,colSpan:a})},F=q.default.useMemo((()=>!!(null==l?void 0:l.api)),[null==l?void 0:l.api]),H=q.default.useMemo((()=>!F&&!!d),[F,d]),M=q.default.useMemo((()=>F&&!!u),[F,u]),$=q.default.useMemo((()=>(F||H)&&!M),[F,H,M]),j=q.default.useMemo((()=>D(n)),[n]),K=q.default.useMemo((()=>pa(j)),[j]),V=q.default.useMemo((()=>K.filter((e=>"function"==typeof e.editRender))),[K]),z=q.default.useMemo((()=>K.filter((e=>!!e.summation))),[K]),W=q.default.useMemo((()=>K.filter((e=>"left"===e.fixed))),[K]),B=q.default.useMemo((()=>K.filter((e=>"right"===e.fixed))),[K]),U=q.default.useMemo((()=>(e=>{const t=new Map;return e.forEach((e=>{const l=C.findIndex((t=>x(t,t.index)===e.rowKey)),n=K.findIndex((t=>t.dataIndex===e.dataIndex));if(!(l<0||n<0)){_(t,l,n,e.rowSpan,e.colSpan);for(let a=0;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)0===a&&0===r||_(t,l+a,n+r,0,0)}})),Array.from(t.values()).sort(((e,t)=>e.row-t.row||e.col-t.col))})(R)),[R,K,E]),G=q.default.useMemo((()=>{var e,t;const l=K.filter((e=>![pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(e.dataIndex)));return P&&l.some((e=>e.dataIndex===P))?P:null!==(t=null===(e=l[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[K,P]),Y=q.default.useMemo((()=>z.length>0),[z]),X=q.default.useMemo((()=>!!y||Y),[y,Y]),Q=q.default.useMemo((()=>Sa(j).length>1),[j]),Z=q.default.useMemo((()=>a||Q),[a,Q]),J=q.default.useMemo((()=>K.some((e=>e.sorter))),[K]),ee=q.default.useMemo((()=>K.some((e=>e.filter))),[K]),te=q.default.useMemo((()=>z.some((e=>!!e.summation.dataKey))),[z]),le=q.default.useMemo((()=>!F&&!!m),[F,m]),ne=q.default.useMemo((()=>!!h&&V.length>0),[h,V]),ae=q.default.useMemo((()=>!!g&&"checkbox"===(null==r?void 0:r.type)),[g,r]),re=q.default.useMemo((()=>!!c&&ee),[c,ee]),ie=q.default.useMemo((()=>!F&&!!f),[F,f]),oe=q.default.useMemo((()=>!F&&!!v),[F,v]),se=q.default.useMemo((()=>!!p&&K.some((e=>!!e.groupSummary))),[K]),de=q.default.useMemo((()=>{var e;return!!(null===(e=null==i?void 0:i.groupItems)||void 0===e?void 0:e.length)}),[i]),ce=q.default.useMemo((()=>!C.length),[C]),fe=q.default.useMemo((()=>(()=>{const e={};return z.forEach((t=>{const{dataIndex:l,precision:n,displayPrecision:a,summation:r}=t,{sumBySelection:i,displayWhenNotSelect:o,unit:s}=r,d=de?ja(b.current.tableFullData):b.current.tableFullData,u=!k.length&&!!o;let c=(!i||u?d:k).reduce(((e,t)=>{if(null==t?void 0:t[pi.summaryIgnore])return e;const n=ka(t,l);return Aa(n)?e.plus(n):e}),new ue.default(0));!Object.keys(L).includes(l)||i&&!u||(c=new ue.default(ka(L,l))),La(e,l,c.toNumber());let f=n>=0?c.toFixed(n):c.toString();a>=0&&""!==f&&(f=_a(f,a)),f=Da(f),La(e,`${l}_text`,s?`${f} ${s}`:f)})),[e]})()),[C,w,S,L]),pe=q.default.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(z)),[z]),me=q.default.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((l=>{null!==e[l]&&t.push(`${l}|${e[l]}`)})),t.join(",")})(N),n=((e,t)=>{const l=[];if(Object.keys(e).length)for(const t in e){const[n,a]=t.split("|"),r=e[t];Object.keys(r).forEach((e=>{l.push({type:a,bracketLeft:"",fieldName:n,expression:e,value:r[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{l.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),l.length&&(l[l.length-1].logic=""),l})(T,I),a=t?{[pi.sorterFieldName]:t}:null,r=n.length?{[pi.filterFieldName]:n}:null,i=pe?{[pi.groupSummary.summaryFieldName]:pe,usedJH:1}:null,o=null!==(e=null==l?void 0:l.params)&&void 0!==e?e:null,s={[pi.currentPageName]:O.current,[pi.pageSizeName]:O.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),r),i),o),s)}),[null==l?void 0:l.params,O.current,O.pageSize,N,T,I,pe]);return{isFetch:F,isWebPagination:H,isScrollPagination:M,showPagination:$,tableColumns:j,flattenColumns:K,editableColumns:V,summationColumns:z,leftFixedColumns:W,rightFixedColumns:B,derivedMergeCells:U,treeExpandIndex:G,showSummary:Y,showFooter:X,isHeadGroup:Q,bordered:Z,isHeadSorter:J,isHeadFilter:ee,isServiceSummation:te,isSelectCollection:ae,isTableImport:le,isTableClipboard:ne,isSuperSearch:re,isFastSearch:ie,isPivotGrid:oe,isGroupSummary:se,isGroupSubtotal:de,isTableEmpty:ce,summationRows:fe,fetchParams:me}},yi=(e,t)=>{const{rowKey:l,height:n,dataSource:a,summation:r,fetch:i,initialSorter:o,initialFilter:s,rowSelection:d,expandable:u,tableConfig:c,authConfig:f,ignorePageIndex:p,columnsChange:h,onChange:g,onDataChange:v,onDataLoad:y,onScrollEnd:b,onFetchError:x}=e,{getRowKey:E,tableRef:C,tableElementRef:w,tableBodyRef:S,$size:N,tableColumns:T,flattenColumns:I,tableFullData:O,pagination:R,layout:k,filters:L,sorter:P,superFilters:A,fetchParams:D,selectionKeys:_,rowExpandedKeys:F,highlightKey:H,summationColumns:M,isFetch:$,isWebPagination:j,isScrollPagination:K,isServiceSummation:V,isGroupSubtotal:z,doLayout:W,setTableFullData:B,setTableOriginData:U,setTableFlatData:G,setAllTableData:Y,setDeriveRowKeys:X,setPagination:Q,setPingRight:Z,setPingLeft:J,setSpinning:ee,setSorter:te,setFilters:le,setSuperFilters:ne,setSelectionKeys:ae,setRowExpandedKeys:re,setHighlightKey:ie,setSelectionRows:oe,setScrollXLoad:se,setScrollYLoad:de,setFieldAuth:ue,setResizeState:ce,setSummaries:fe,setPermission:pe,setRecordsMap:me,resetTableScroll:he,clearElementStore:ge,clearRecordsMap:ve}=t,{t:ye}=Xe(),{store:be}=C.current,xe=q.default.useRef(Object.assign({},D)),Ee=q.default.useRef(!1),Ce=Cn(w);Ie((()=>{Re(),W()}),[T]),Ie((()=>{we()}),[Ce.width,Ce.height,N,n,k.tableAutoHeight]),Ql((()=>{st(),ut(),ct(),$||(j&&Je(),ze(a)),o&&te(o),s&&le(s)}),[a,null==i?void 0:i.params]),Ql((()=>{const e=$e(D,xe.current);e||$&&(null==d?void 0:d.clearableAfterFetched)&&ft(),!e&&D[pi.currentPageName]>1&&!(null==i?void 0:i.stopToFirst)?Je():$&&Ke(),xe.current=D}),[D]),Ql((()=>{j&<(),K||he(),Fe()}),[R.current,R.pageSize]),Ql((()=>{$||Ne(O.length),W()}),[O]),Ql((()=>{C.current.isTreeTable&<()}),[F]);const we=()=>{const{scrollBarRef:e,resizeState:t}=C.current,{width:l,height:n}=Ce;W(),k.tableBodyWidth>l&&Z(!0),e.current.scrollLeft>0&&J(!0),ce(Object.assign({},t,{width:l,height:n}))},Se=()=>{H&&S.current.setClickedValues([H,""]),"radio"===(null==d?void 0:d.type)&&_.length&&S.current.setClickedValues([_[0],""])},Ne=e=>{e!==R.total&&Q((t=>Object.assign({},t,{total:e})))},Te=e=>{Ee.current=e},Oe=wn((e=>{Ue(),null==b||b(e)})),Re=()=>{se(I.length>pi.virtualScrollX)},ke=(e=[])=>{let t=e.length>pi.virtualScrollY;C.current.isTreeTable&&(t=!0),(null==c?void 0:c.virtual)&&(t=!0),de(t)},Le=e=>z?Pe(Ae(e,0)):e,Pe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Pe(e.children)),delete e.children,t.push(e)})),t},Ae=(e,t)=>{var n;const a=null===(n=r.groupItems)||void 0===n?void 0:n[t];if(!a)return e.forEach(((t,l)=>{t._rowSpan=0===l?e.length:0,t._colSpan=1})),e;return Va(e,[a.dataIndex]).map((e=>{const n={children:Ae(e,t+1),_group:a.dataIndex};return"function"!=typeof l&&La(n,l.toString(),Ma()),a.titleIndex&&La(n,a.titleIndex,ka(e[0],a.titleIndex)),La(n,a.dataIndex,ka(e[0],a.dataIndex)),M.forEach((e=>{var t;const{dataIndex:l}=e,a=null===(t=n.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[pi.summaryIgnore])return e;const n=Number(ka(t,l));return Number.isNaN(n)?e:e+n}),0);La(n,l,a)})),n}))},De=e=>{ae(e),oe((e=>{const{selectionRows:t,recordsMap:l}=C.current,n=new Map;t.forEach((e=>n.set(E(e,e.index),e)));const a=[];for(let t=0,r=e.length;t<r;t++){const r=n.get(e[t])||l.get(e[t]);r&&a.push(r)}return a})(e))},_e=e=>{const{type:t,checkStrictly:l=!0}=d||{},n=Array.isArray(e)?e:_;let a=[];return C.current.isTreeTable&&!l&&n.forEach((e=>{a.push(...((e,t)=>{var l;const{disabled:n}=d||{},{deriveRowKeys:a,recordsMap:r}=C.current,i=Ea(a,e);let o=[];if(!i)return o;let s=Ua((null==i?void 0:i.children)||[]);return n&&(s=s.filter((e=>!r.has(e)||!n(r.get(e))))),o=[...new Set([...t,...s])],((null===(l=Wa(a,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ea(a,e),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=n?[...o,e]:o.filter((t=>t!==e))})),o})(e,n))})),a="radio"===t?n.slice(0,1):[...new Set([...n,...a])],a},Fe=wn((()=>{null==g||g(R,Me(L),He(P),A,{currentDataSource:tt()})})),He=e=>{const t={};for(const l in e)null!==e[l]&&(t[l]=e[l]);return t},Me=e=>{const t={};for(const l in e){if(!l.includes("|"))continue;const[n,a]=l.split("|");t[`${n}|${a}`]=e[l]}return t},$e=(e,t)=>{const l=Object.keys(Ra(e,t));return 1===l.length&&(l.includes(pi.currentPageName)||l.includes(pi.pageSizeName))},qe=()=>Ye(void 0,void 0,void 0,(function*(){var t;if(!f)return;let l=dt(f,["fetch"]);if(f.fetch){const{api:e,params:n,dataKey:a}=f.fetch;try{const r=yield e(n);200===r.code&&(l=null!==(t=a?m.get(r.data,a):r.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(l).length){const{isExport:e=1,isImport:t=1,isPrint:n=1}=l;pe((l=>Object.assign({},l,{export:!!e,import:!!t,print:!!n})))}if(Array.isArray(l.fieldList)){const t=ga(e.columns,(e=>{const{dataIndex:t}=e,n=l.fieldList.find((e=>e.dataIndex===t));if(n){const{visible:l=1,disabled:a,secretName:r}=n,i=va(C.current.originColumns,t);ue(t,{visible:l,disabled:a,secretName:r}),l||(e.noAuth=!0,i.noAuth=!0),r&&(e.formatType=`secret-${r}`,i.formatType=`secret-${r}`)}}));null==h||h(t)}})),je=Qe((()=>Ye(void 0,void 0,void 0,(function*(){var e,t,l;if(!i)return;const{formatter:n=(e=>e),beforeFetch:a=nt,afterFetch:o,callback:s}=i;if(!a(D))return;const d=!!(null===(e=null==r?void 0:r.fetch)||void 0===e?void 0:e.api);ee(!0);try{const[e,a]=d?yield Promise.all([i.api(n(D)),r.fetch.api(n(D))]):[yield i.api(n(D))];if(C.current.unMounted)return;if(d?200===e.code&&200===a.code:200===e.code){const n=null!==(t=i.dataKey)&&void 0!==t?t:pi.dataKey;let r=null!==(l=m.get(e.data,n))&&void 0!==l?l:[];r="function"==typeof o?yield o(r):r;const d=m.get(e.data,n.replace(/[^.]+$/,pi.totalKey))||r.length||0,u=Math.max(Math.ceil(d/R.pageSize),1);if(D[pi.currentPageName]>u)return Ge(Object.assign(Object.assign({},R),{current:u}));ze(Ee.current?C.current.tableFullData.concat(r):r),Ne(d),We((null==a?void 0:a.data)||e.data),null==s||s(e.data,e)}}catch(e){null==x||x(e)}var u,c;u=i,c="stopToFirst",Object.prototype.hasOwnProperty.call(u,c)&&(i.stopToFirst=!1),ee(!1),Te(!1)})))),Ke=wn(je),Ve=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=Ve(e.children)),e.index=t,p||(e.pageIndex=(e=>{const{current:t,pageSize:l}=R;return!$||K?e:(t-1)*l+e})(t)),e))),ze=e=>{const t=Le(Ve(e));at(t),rt(t),De(_e()),re((e=>{const{isTreeTable:t,allRowKeys:l,allParentRowKeys:n,deriveRowKeys:a,recordsMap:r}=C.current,{defaultExpandAllRows:i,rowExpandable:o,expandedRowRender:s}=u||{};let d=Array.isArray(e)?e:[...F];if(i)d=t?n:l;else if(t){s&&mt("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[..._];H&&e.unshift(H),e.forEach((e=>{const t=Wa(a,e)||[];d.push(...t.length>1?t.slice(0,-1).reverse():t)})),d=[...new Set(d)]}return o&&d.filter((e=>{const t=r.get(e);return!!t&&o(t)})),d})()),Be(),null==y||y(t)},We=e=>{var t,l,n;if(!V)return;const a=null!==(l=null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==l?l:pi.summationKey,i=null!==(n=a?m.get(e,a):e)&&void 0!==n?n:{},o={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{La(o,e.dataIndex,Number(ka(i,e.summation.dataKey)))})),fe(o)},Be=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=tt();if(e.length){const t=E(e[0],e[0].index);De([t])}else De([])}},Ue=()=>{if(!K)return;const e=Ze();Ee.current||R.current>=e||(Te(!0),Ge(Object.assign(Object.assign({},R),{current:R.current+1})))},Ge=({current:e,pageSize:t})=>{Q((l=>Object.assign({},l,{current:e,pageSize:t})))},Ze=()=>{const{pageSize:e,total:t}=R;return Math.ceil(t/e)||1},Je=()=>{Ge(Object.assign({},R,{current:1}))},et=()=>{const{current:e,pageSize:t}=R;return C.current.tableFullData.slice((e-1)*t,e*t)},tt=()=>j?et():C.current.tableFullData,lt=()=>{const{allTableData:e,isTreeTable:t}=C.current,l=j?Ca(et()):e,n=t?(e=>{const t=new Map,l=[];return e.forEach((e=>{const n=E(e,e.index);if(!e._parentRowKey)return l.push(e),t.set(n,!0);F.includes(e._parentRowKey)&&t.get(e._parentRowKey)&&(l.push(e),t.set(n,!0))})),t.clear(),l})(l):l;ke(n),G(n)},at=e=>{B(e),Y(e),X(e),it(),lt()},rt=e=>{U(e)},it=()=>{ve(),C.current.allTableData.forEach((e=>me(E(e,e.index),e)))},st=()=>{te({})},ut=()=>{le({})},ct=()=>{ne([])},ft=()=>{De([])};return{initialTable:()=>{qe(),Se(),Re(),ke(),$?je():ze(a)},checkDataIndex:()=>{const e=I.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&mt("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:at,getTableData:je,createTableList:tt,createTableData:ze,createGroupData:Le,setSelectionKeysEffect:De,doFieldValidate:(e,t,l,n,a)=>{if(!Array.isArray(e))return mt("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(be.removeFromRequired({x:l,y:n}),be.removeFromValidate({x:l,y:n}),e.forEach((e=>{var r;e.required&&ot(t)&&be.addToRequired({x:l,y:n,text:e.message||a+ye("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(r=e.validator)||void 0===r?void 0:r.call(e,t))||be.addToValidate({x:l,y:n,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:l,updated:n,removed:a}=be.state,r=m.intersection(l,a),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:l.filter((e=>!r.includes(e))),updated:n.filter((e=>![...m.intersection(n,l),...m.intersection(n,a)].includes(e))),removed:a.filter((e=>!r.includes(e)))}},dataChange:()=>{null==v||v(C.current.tableFullData)},tableChange:Fe,toLastPage:()=>{const e=Ze();R.current!==e&&Ge(Object.assign({},R,{current:e}))},toFirstPage:Je,getPageCount:Ze,pagerChangeHandle:Ge,scrollBottomDebouncer:Oe,clearTableSorter:st,clearTableFilter:ut,clearSuperFilters:ct,clearRowSelection:ft,clearRowHighlight:()=>{ie("")},clearTableLog:()=>{be.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=C.current;ge(),be.destroy(),e.deregister(t)}}},bi=(e,t)=>{const{height:l,minHeight:n,maxHeight:a,ellipsis:r,showHeader:i,spanMethod:o}=e,{getRowKey:s,tableRef:d,topElementRef:u,tableElementRef:c,tableBodyRef:f,$size:p,tableColumns:h,flattenColumns:g,leftFixedColumns:v,derivedMergeCells:y,tableFlatData:b,layout:x,showFooter:E,showPagination:C,isFullScreen:w,setLayout:S,setElementStore:N}=t,T=q.default.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=x,r={};return n&&Object.assign(r,{minHeight:`${Oa(n)}px`}),a&&Object.assign(r,{maxHeight:`${Oa(a)}px`}),w?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${e}px`}):l?Object.assign(Object.assign({},r),{height:"auto"!==l?`${Oa(l)}px`:`${t}px`}):r}),[l,a,n,w,x]),I=(e,t)=>{const{scrollBarRef:l,scrollYLoad:n,rowHeight:a}=d.current;if(void 0!==t&&t>=0)if(t<b.length)if(n)f.current.scrollToYIndex(t);else{const e=O(s(b[t],b[t].index));e&&l.current.SET_SCROLL_TOP(e.offsetTop)}else l.current.SET_SCROLL_TOP(t*a);else if(n){const t=b.findIndex((t=>e===s(t,t.index)));t>=0&&f.current.scrollToYIndex(t)}else{const t=O(e);t&&l.current.SET_SCROLL_TOP(t.offsetTop)}},O=e=>d.current.elementStore.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);return{createElementStore:()=>{N("$toper",u.current),N("$table",c.current)},tableStyles:T,getSpan:(e,t,l,n,a)=>{let r=1,i=1;if("function"==typeof o){const s=o({row:e,column:t,rowIndex:l,columnIndex:n,tableData:a});Array.isArray(s)?(r=s[0],i=s[1]):m.isPlainObject(s)&&(r=s.rowSpan,i=s.colSpan)}if(y.length>0){const e=y.find((e=>e.row===l&&e.col===n));e&&(r=e.rowSpan,i=e.colSpan)}return{rowSpan:r,colSpan:i}},getStickyLeft:e=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=va(h,e);e=t?ya(t).dataIndex:""}let t=0;for(let l=0;l<g.length;l++){const n=g[l];if(n.dataIndex===e)break;t+=n.width||n.renderWidth||0}return t},getStickyRight:(e,t)=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=va(h,e);e=t?ba(t).dataIndex:""}const l="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let l=[];return e.forEach((e=>{e.colSpan>0&&l.length>0&&(t.push(l),l=[]),l.push(e)})),l.length>0&&t.push(l),t.map((e=>{const[t,l]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...l,...t.reverse()]})).flat()})(g):g;let n=0;for(let t=l.length-1;t>=0;t--){const a=l[t];if(a.dataIndex===e)break;n+=a.width||a.renderWidth||0}return n},scrollXToColumn:(e,t)=>{const l=void 0===t?g.findIndex((t=>t.dataIndex===e)):t;if(l<0)return;const{scrollBarRef:n}=d.current,a=v.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=g.slice(0,l).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);n.current.SET_SCROLL_LEFT(r-a)},scrollYToRecord:I,calcTableHeight:()=>{if("auto"!==l)return;const{elementStore:e,resizeState:t}=d.current;try{const l=t.winHeight-e.$table.getBoundingClientRect().top-(C?Yr["small"!==p?"middle":p]+Jr:0)-Jr;S((e=>Object.assign({},e,{tableAutoHeight:l})))}catch(e){}},resetTableScroll:()=>{I("",0)},doLayout:()=>{(()=>{const{elementStore:e,scrollXLoad:t}=d.current,l=e.$table.clientWidth,{defaultColumnWidth:n}=pi,a=[];let r=0;if(g.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,r+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=g.reduce(((e,t)=>e+(t.width||t.minWidth||n)),0);if(e<=l){const t=l-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||n)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||n)),0);let l=0;a.forEach(((t,a)=>{if(0===a)return;const r=Math.floor((t.minWidth||n)*e);l+=r,t.renderWidth=(t.minWidth||n)+r})),a[0].renderWidth=(a[0].minWidth||n)+t-l}}else a.forEach((e=>{e.renderWidth=e.minWidth||n}));S((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,l)})))}else r=g.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||n)),0),S((e=>Object.assign(Object.assign({},e),{tableBodyWidth:r})));S((e=>Object.assign(Object.assign({},e),{tableWidth:l}))),t&&f.current.resetItemXSize(g)})(),rt((()=>(()=>{const{elementStore:e,scrollYLoad:t,resizeState:l}=d.current;if(!e.$table.offsetParent)return;const n=e.$table.offsetHeight,a=i?e.$header.offsetHeight:x.headerHeight,r=E?e.$footer.offsetHeight:x.footerHeight,o=n-a-r,s=e.$tableBody.offsetHeight;let u=0;if(w){const t=e.$toper?e.$toper.offsetHeight+Jr:0,n=e.$pager?e.$pager.offsetHeight+Jr:0;u=l.winHeight-t-n-20}S((e=>Object.assign({},e,{headerHeight:a,footerHeight:r,viewportHeight:o,tableBodyHeight:s,tableFullHeight:u})))})()))}}};function xi({handler:e,delay:t=0}){const l=Kn(e,t),n=Qe(t>0?l:e);$.useEffect((()=>(window.addEventListener("resize",n),()=>window.removeEventListener("resize",n))),[n])}const Ei=e=>{const{total:t}=e,{tableRef:l,prefixCls:n,selectionKeys:a,isHeadSorter:r,isHeadFilter:i,clearTableSorter:o,clearTableFilter:s,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:c,setActivedCell:f}=q.default.useContext(Xr),{infoBarConfig:p,rowSelection:m,rowHighlight:h}=l.current.props,{allTableData:v,invalidRowKeys:y}=l.current,{hideAlert:b,hideClearButton:x}=p||{},{t:E}=Xe(),C=q.default.useMemo((()=>!b),[b]),w=q.default.useMemo((()=>!x&&!!(r||i||m||h)),[x,r,i,m,h]),S={[`${n}__alert`]:!0};return C?q.default.createElement("div",{className:J.default(S)},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.InfoCircleFilled,null)),q.default.createElement("span",null,E("qm.table.alert.total",{total:l.current.isTreeTable?v.length:t}),m?`,${E("qm.table.alert.selected",{total:Math.max(a.length-y.length,0)})}`:""),w&&q.default.createElement("em",{onClick:()=>{s(),d(),u(),c(),rt((()=>o())),f({})}},E("qm.table.alert.clear"))):null},Ci=q.default.forwardRef(((e,t)=>{const{isFullScreen:l,open:n=!0}=e,{prefixCls:a,setFullScreen:r}=q.default.useContext(Xr),{t:i}=Xe(),o=()=>{r(!l)};return q.default.useImperativeHandle(t,(()=>({clickHandle:o}))),n?q.default.createElement("span",{className:`${a}-full-screen`,title:i(l?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},l?q.default.createElement(g.FullscreenExitOutlined,null):q.default.createElement(g.FullscreenOutlined,null))):null}));Ci.displayName="FullScreen";const wi=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,getTableData:a}=q.default.useContext(Xr),{t:r}=Xe(),i=()=>{a()};return q.default.useImperativeHandle(t,(()=>({clickHandle:i}))),l?q.default.createElement("span",{className:`${n}-reload`,title:r("qm.table.refresh.text"),onClick:()=>i()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ReloadOutlined,null))):null}));wi.displayName="Reload";const Si=()=>{const e={dateFormat:e=>{const t=e?j.default(e).format(li):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?j.default(e).format(ni):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?j.default(e).format(ni.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Aa(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>Da(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,l,n)=>{var a,r,i,o;const{dictItems:s,precision:d,displayPrecision:u,formatType:c,editRender:f}=l,p=s||(null===(a=null==f?void 0:f(n,l))||void 0===a?void 0:a.items)||[];let m=null!==(o=null!==(i=null===(r=p.find((e=>e.value==t)))||void 0===r?void 0:r.text)&&void 0!==i?i:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(m=t.map((e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==l?l:e})).join(",")),d>=0&&""!==m&&(m=Aa(m)?new ue.default(m).toFixed(d):m),u>=0&&""!==m&&(m=_a(m,u)),c){const t=e[`${it(c)}Format`];t?m=t(m):mt("Table","字段的格式化类型 `formatType` 配置不正确")}return m},l=e=>et(e)?$a(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:l,getTitleFromCellValue:(e,n,a,r)=>{const i=ka(e,n.dataIndex),o=n.render?n.render(i,e,n,a,r):t(i,n,e);return l(o)}}},Ni=q.default.forwardRef(((e,t)=>{var l,n,a,r;const{tableColumns:i,open:o=!0}=e,{global:s}=q.default.useContext(xe),{tableRef:d,prefixCls:u,flattenColumns:c,summationRows:f,showSummary:p,getSpan:h}=q.default.useContext(Xr),{tablePrint:v,showHeader:y}=d.current.props,{t:b}=Xe(),{getTitleFromCellValue:x}=Si(),E=null!==(n=null===(l=null==s?void 0:s.print)||void 0===l?void 0:l.leftLogo)&&void 0!==n?n:"",C=null!==(r=null===(a=null==s?void 0:s.print)||void 0===a?void 0:a.rightLogo)&&void 0!==r?r:"",w=!(!E&&!C),S=q.default.useMemo((()=>ut(xa(i,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn]))),[i]),N=q.default.useMemo((()=>ut(xa(c,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn]))),[c]),T=q.default.useMemo((()=>ut(i.filter((e=>e.printFixed)))),[i]),I=e=>{const t=Object.assign({},za(S,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?I(t):t},O=(e,t)=>m.map(m.groupBy(m.flatten(e),t),m.spread(((...e)=>m.mergeWith(...e,((e,l)=>{if(Array.isArray(e))return O(e.concat(l),t)}))))),R=e=>{const t=[];return e.forEach((e=>{let l=[];e.forEach((e=>{1===e.level?l.push(e):l.push(I(e))})),l=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const l=e.filter((e=>e.dataIndex===t));return l.length<=1?l[0]:O(l,"dataIndex")[0]})))(l),t.push(Sa(l))})),t},k=()=>{const e=(e=>{const t=[];let l=[],n=0,a=0;for(;a<e.length;){const r=e[a];n+=r.width||r.renderWidth,n<=pi.printWidth?(l.push(r),a===e.length-1&&t.push(l),a++):a>0?(e.splice(0,a),T.length&&e.unshift(...T),t.push(l),l=[],n=0,a=0):(r.width=pi.printWidth,l.push(r),t.push(l),a++)}return t})([...N]),t=R(e);let l=["<!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 n=0;n<e.length;n++)l+=L(t[n],e[n],d.current.tableFullData),l+='<div class="page-break"></div>';return l+"</body></html>"},L=(e,t,l)=>{const{showLogo:n=!0}=v;let a='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${t.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,y&&(a+=["<thead>",n&&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">',E?`<img src="${E}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',C?`<img src="${C}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${qa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),l.length&&(a+=`<tbody>${Ca(l).map((e=>`<tr>${t.map(((t,n)=>{const{rowSpan:a,colSpan:r}=h(e,t,e.index,n,l);if(!a||!r)return null;return`<td rowspan="${a}" colspan="${r}">${0===n&&e._level?`<span style="padding-left:${e._level*pi.treeTable.textIndent}px"></span>`:""}${x(e,t,e.index,n)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),p&&f.length&&(a+=["<tfoot>",f.map((e=>`<tr>${t.map(((t,n)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(l):ka(e,`${a}_text`);return`<td>${0===n&&""===i?b("qm.table.config.summaryText"):et(i)?$a(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},P=()=>{var e;null===(e=((e,t)=>{const{filename:l,type:n,isDownload:a}=e,r=`${l}.${n}`;if(window.Blob){const e=new Blob([t],{type:`text/${n}`});if(!a)return Promise.resolve({type:n,content:t,blob:e});Fn(e,r)}})({filename:"print",type:"html",isDownload:!1},k()))||void 0===e||e.then((({content:e,blob:t})=>{let l=document.createElement("iframe");l.setAttribute("frameborder","0"),l.setAttribute("width","100%"),l.setAttribute("height","0"),l.style.display="none",document.body.appendChild(l),d.current.isIE?(l.contentDocument.write(e),l.contentDocument.execCommand("print"),l.parentNode.removeChild(l),l=null):(l.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{l.parentNode.removeChild(l),l=null}))},l.src=URL.createObjectURL(t))}))};return q.default.useImperativeHandle(t,(()=>({clickHandle:P}))),o?q.default.createElement("span",{className:`${u}-print`,title:b("qm.table.print.text"),onClick:()=>P()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PrinterOutlined,null))):null}));Ni.displayName="TablePrint";const Ti="606060",Ii="thin",Oi="d4d4d4",Ri=(e,t)=>{t&&(e.height=Math.floor(.75*t))},ki=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Li=()=>({top:{style:Ii,color:{argb:Oi}},left:{style:Ii,color:{argb:Oi}},bottom:{style:Ii,color:{argb:Oi}},right:{style:Ii,color:{argb:Oi}}}),Pi=e=>{const{children:t}=e;return t&&t.length?Pi(t[0]):e},Ai=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},Di=()=>{const{tableRef:e,getSpan:t,showSummary:l,isHeadGroup:n}=q.default.useContext(Xr),{spanMethod:a,showHeader:r}=e.current.props,{t:i}=Xe(),o=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(o,s,d,u)=>Ye(void 0,void 0,void 0,(function*(){const{columns:c,footSummation:f}=o,{rowHeight:p}=e.current,m=pa(c),h=Sa(c),g=[],v=[],y=[],b=[];let x=0;const E={};m.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;E[t]=qa(e.title),y.push({key:t,width:(l||n||pi.defaultColumnWidth)/8})})),r&&(n?h.forEach(((e,t)=>{const l={};e.forEach((e=>{const{colSpan:n,rowSpan:a}=e,r=Pi(e),i=m.findIndex((({dataIndex:e})=>e===r.dataIndex));l[r.dataIndex]=qa(e.title),0!==n&&(n>1||a>1)&&b.push({s:{r:t,c:i},e:{r:t+a-1,c:i+n-1}})})),g.push(l)})):(m.forEach(((e,t)=>{const{colSpan:l,rowSpan:n}=e;(l>1||n>1)&&b.push({s:{r:x,c:t},e:{r:x+n-1,c:t+l-1}})})),g.push(E)),x+=g.length);const C=Ca(s).map(((e,l)=>{const n={};return m.forEach(((r,i)=>{if("function"==typeof a){const{rowSpan:n,colSpan:a}=t(e,r,l,i,s);(a>1||n>1)&&b.push({s:{r:l+x,c:i},e:{r:l+x+n-1,c:i+a-1}})}const o=["percent","finance"].includes(r.formatType);n[r.dataIndex]=o?ka(e,r.dataIndex):u(e,l,r,i)})),n._level=e._level,n}));x+=C.length,l&&f&&d(m,s).forEach(((e,t)=>{const l={};m.forEach(((t,n)=>{const{dataIndex:a,summation:r}=t,o=(null==r?void 0:r.render)?r.render(s):ka(e,a);l[a]=0===n&&""===o?i("qm.table.config.summaryText"):et(o)?$a(o).join(""):o})),v.push(l)}));const{sheetName:w,useStyle:S}=o,N=new ce.default.Workbook,T=N.addWorksheet(w);T.columns=y,r&&T.addRows(g).forEach((e=>{S&&Ri(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),l=va(c,t.key),{align:n,theadAlign:a}=l;ki(e,a||n),S&&Object.assign(e,{font:{bold:!0,color:{argb:Ti}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Li()})}))})),T.addRows(C).forEach(((e,t)=>{const{_level:l}=C[t];S&&Ri(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),n=va(c,t.key),{align:a}=n;ki(e,a),Object.assign(e,Ai(n)),S&&Object.assign(e,{font:{color:{argb:Ti}},border:Li()}),1===Number(e.col)&&l&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:l}))}))})),l&&f&&T.addRows(v).forEach((e=>{S&&Ri(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),l=va(c,t.key),{align:n}=l;ki(e,n),Object.assign(e,Ai(l)),S&&Object.assign(e,{font:{color:{argb:Ti}},border:Li()})}))})),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 l=e=>{let t=e;const l=-1!==e.indexOf(",")||-1!==e.indexOf("\r")||-1!==e.indexOf("\n"),n=-1!==e.indexOf('"');return n&&(t=t.replace(/"/g,'""')),(l||n)&&(t='"'+t+'"'),t},n="\ufeff"+(e=>{let t,n,a,r,i="";for(t=0;t<e.rows.length;t+=1){for(a=e.rows[t],n=0;n<a.cells.length;n+=1)r=a.cells[n],i=i+(n?",":"")+l(r.textContent.trim());i+="\r\n"}return i})((e=>{const t=document.createElement("div");return t.innerHTML=e,t.firstChild})(t));var a;return((e,t,l)=>{t=t||"",l=l||512;const n=window.atob(e),a=[];let r;for(r=0;r<n.length;r+=l){const e=n.slice(r,r+l),t=new Array(e.length);let i;for(i=0;i<e.length;i+=1)t[i]=e.charCodeAt(i);const o=new window.Uint8Array(t);a.push(o)}return new window.Blob(a,{type:t})})((a=n,window.btoa(unescape(encodeURIComponent(a)))),"application/csv")},importXLSX:(e,t)=>{const{columns:l,file:n}=e,a=pa(l),r=new FileReader;r.onerror=()=>{s.message.error(i("qm.table.import.error"))},r.onload=e=>{const l=a.map((e=>qa(e.title))),n=new ce.default.Workbook,r=e.target;r?n.xlsx.load(r.result).then((e=>{const n=e.worksheets[0];if(n){const e=n.getSheetValues(),r=e.findIndex((e=>e&&e.length>0)),d=e[r],u=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(l,d);if(u){const n=e.slice(r+1).map((e=>{const t={};e.forEach(((e,l)=>{var n;let a=e;Array.isArray(null==a?void 0:a.richText)&&(a=a.richText.map((e=>e.text)).join("")),m.isPlainObject(a)&&"text"in a&&(a=a.text),m.isDate(a)&&(a=Ha(a,ni)),(null==a?void 0:a.formula)&&(a=null!==(n=a.result)&&void 0!==n?n:a.value),t[d[l]]=a}));const n={};return l.forEach(((e,l)=>{var r;const{dataIndex:i,dictItems:s}=a[l];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>o(s,e))).filter((e=>""!==e)):t[e]=o(s,t[e])),La(n,i,t[e])})),n}));null==t||t(n)}else s.message.error(i("qm.table.import.error"))}else s.message.error(i("qm.table.import.error"))})):s.message.error(i("qm.table.import.error"))},r.readAsArrayBuffer(n)}}},_i=e=>{const{fileType:t,onChange:l}=e,{prefixCls:n}=q.default.useContext(Xr),{t:a}=Xe();let r,i;const o=e=>{const t=e.name,l=t.lastIndexOf("."),n=t.substring(l+1,t.length);return{filename:t.substring(0,l),type:n}},d=()=>Ye(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return r||(r=document.createElement("form"),i=document.createElement("input"),r.className=`${n}--file-form`,i.name="file",i.type="file",r.appendChild(i),document.body.appendChild(r)),new Promise(((e,l)=>{const n=!t.type;i.multiple=!!t.multiple,i.accept=n?"":`.${t.type}`,i.onchange=d=>{const{files:u}=d.target,c=u[0];let f="";if(!n)for(let e=0;e<u.length;e++){const{type:l}=o(u[e]);if(t.type!==l){f=l;break}}f?(s.message.warning(a("qm.upload.notType",{type:f})),l()):e(c),document.body.removeChild(r),r=null,i=null},r.reset(),i.click()}))})({type:t});null==l||l(e.name,e)}catch(e){}}));return q.default.createElement(ht,{onClick:()=>d()},a("qm.upload.text"))},Fi=e=>{const{columns:t,onClose:l}=e,{tableRef:n,prefixCls:a,createTableData:r,dataChange:i}=q.default.useContext(Xr),{beforeTableImport:o}=n.current.props,{t:d}=Xe(),{importXLSX:u}=Di(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState(!0),g=e=>e.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))),v={posIndex:"条"},[y,b]=q.default.useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:l}=t.GET_FIELDS_VALUE(["fileName"]);return q.default.createElement(q.default.Fragment,null,l?q.default.createElement("span",null,l):q.default.createElement(_i,{fileType:t.state.formData.fileType,onChange:(e,l)=>{t.SET_FIELDS_VALUE({fileName:e,file:l}),l&&h(!1)}}))}},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:d("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:d("qm.table.import.fillText"),value:"fill"},{text:d("qm.table.import.addText"),value:"add"},{text:d("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{y.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&c.current.SET_FIELDS_EXTRA(v),b([...y])}},{type:"INPUT_NUMBER",label:d("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:n.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]);return q.default.createElement("div",{className:`${a}-import__setting`},q.default.createElement(wf,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:v,items:y,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.export.closeButton")),q.default.createElement(ht,{type:"primary",loading:f,disabled:m,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,a]=yield c.current.GET_FORM_DATA();e||(p(!0),u({columns:g(t),file:a.file},(e=>Ye(void 0,void 0,void 0,(function*(){const{tableFullData:t,store:u}=n.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof o)try{e=yield o(e)}catch(e){}if("fill"===a.importType&&r(e),"add"===a.importType&&r([...t,...e]),"insert"===a.importType){const l=a.posIndex,n=t.slice(0,l).concat(e).concat(t.slice(l));r(n)}e.forEach((e=>{u.addToInserted(e)})),i(),s.message.success(d("qm.table.import.success",{total:e.length})),p(!1),l()})))))}))},d("qm.table.import.text"))))},Hi=q.default.forwardRef(((e,t)=>{const{tableColumns:l,open:n=!0}=e,{prefixCls:a}=q.default.useContext(Xr),{t:r}=Xe(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={[`${a}-import`]:!0},u={visible:i,title:r("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement("span",{className:J.default(d),title:r("qm.table.import.textNoSpace"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ImportOutlined,null))),q.default.createElement(Qn,u,q.default.createElement(Fi,{columns:l,onClose:()=>o(!1)})))}));function Mi(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var l=t;l;){if(l===e)return!0;l=l.parentNode}return!1}function $i(e,t,l,n){var a=ee.default.unstable_batchedUpdates?function(e){ee.default.unstable_batchedUpdates(l,e)}:l;return null!=e&&e.addEventListener&&e.addEventListener(t,a,n),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,a,n)}}}Hi.displayName="TableImport";var qi=e.forwardRef((function(t,l){var n=t.didUpdate,a=t.getContainer,r=t.children,i=e.useRef(),o=e.useRef();e.useImperativeHandle(l,(function(){return{}}));var s=e.useRef(!1);return!s.current&&ol()&&(o.current=a(),i.current=o.current.parentNode,s.current=!0),e.useEffect((function(){null==n||n(t)})),e.useEffect((function(){return null===o.current.parentNode&&null!==i.current&&i.current.appendChild(o.current),function(){var e;null===(e=o.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(o.current)}}),[]),o.current?ee.default.createPortal(r,o.current):null}));function ji(e,t,l){return l?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Ki;function Vi(e){var t=e.prefixCls,l=e.motion,n=e.animation,a=e.transitionName;return l||(n?{motionName:"".concat(t,"-").concat(n)}:a?{motionName:a}:null)}function zi(e){var t=e.prefixCls,l=e.visible,n=e.zIndex,a=e.mask,r=e.maskMotion,i=e.maskAnimation,o=e.maskTransitionName;if(!a)return null;var s={};return(r||o||i)&&(s=Ot({motionAppear:!0},Vi({motion:r,prefixCls:t,transitionName:o,animation:i}))),$.createElement(Hl,Ml({},s,{visible:l,removeOnLeave:!0}),(function(e){var l=e.className;return $.createElement("div",{style:{zIndex:n},className:J.default("".concat(t,"-mask"),l)})}))}function Wi(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Bi(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(l),!0).forEach((function(t){Gi(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Wi(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function Ui(e){return Ui="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},Ui(e)}function Gi(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var Yi={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Xi(){if(void 0!==Ki)return Ki;Ki="";var e=document.createElement("p").style;for(var t in Yi)t+"Transform"in e&&(Ki=t);return Ki}function Qi(){return Xi()?"".concat(Xi(),"TransitionProperty"):"transitionProperty"}function Zi(){return Xi()?"".concat(Xi(),"Transform"):"transform"}function Ji(e,t){var l=Qi();l&&(e.style[l]=t,"transitionProperty"!==l&&(e.style.transitionProperty=t))}function eo(e,t){var l=Zi();l&&(e.style[l]=t,"transform"!==l&&(e.style.transform=t))}var to,lo=/matrix\((.*)\)/,no=/matrix3d\((.*)\)/;function ao(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function ro(e,t,l){var n=l;if("object"!==Ui(t))return void 0!==n?("number"==typeof n&&(n="".concat(n,"px")),void(e.style[t]=n)):to(e,t);for(var a in t)t.hasOwnProperty(a)&&ro(e,a,t[a])}function io(e,t){var l=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if("number"!=typeof l){var a=e.document;"number"!=typeof(l=a.documentElement[n])&&(l=a.body[n])}return l}function oo(e){return io(e)}function so(e){return io(e,!0)}function uo(e){var t=function(e){var t,l,n,a=e.ownerDocument,r=a.body,i=a&&a.documentElement;return t=e.getBoundingClientRect(),l=Math.floor(t.left),n=Math.floor(t.top),{left:l-=i.clientLeft||r.clientLeft||0,top:n-=i.clientTop||r.clientTop||0}}(e),l=e.ownerDocument,n=l.defaultView||l.parentWindow;return t.left+=oo(n),t.top+=so(n),t}function co(e){return null!=e&&e==e.window}function fo(e){return co(e)?e.document:9===e.nodeType?e:e.ownerDocument}var po=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),mo=/^(top|right|bottom|left)$/,ho="currentStyle",go="runtimeStyle",vo="left";function yo(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function bo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function xo(e,t,l){"static"===ro(e,"position")&&(e.style.position="relative");var n=-999,a=-999,r=yo("left",l),i=yo("top",l),o=bo(r),s=bo(i);"left"!==r&&(n=999),"top"!==i&&(a=999);var d,u="",c=uo(e);("left"in t||"top"in t)&&(u=(d=e).style.transitionProperty||d.style[Qi()]||"",Ji(e,"none")),"left"in t&&(e.style[o]="",e.style[r]="".concat(n,"px")),"top"in t&&(e.style[s]="",e.style[i]="".concat(a,"px")),ao(e);var f=uo(e),p={};for(var m in t)if(t.hasOwnProperty(m)){var h=yo(m,l),g="left"===m?n:a,v=c[m]-f[m];p[h]=h===m?g+v:g-v}ro(e,p),ao(e),("left"in t||"top"in t)&&Ji(e,u);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=yo(b,l),E=t[b]-c[b];y[x]=b===x?p[x]+E:p[x]-E}ro(e,y)}function Eo(e,t){var l=uo(e),n=function(e){var t=window.getComputedStyle(e,null),l=t.getPropertyValue("transform")||t.getPropertyValue(Zi());if(l&&"none"!==l){var n=l.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}(e),a={x:n.x,y:n.y};"left"in t&&(a.x=n.x+t.left-l.left),"top"in t&&(a.y=n.y+t.top-l.top),function(e,t){var l=window.getComputedStyle(e,null),n=l.getPropertyValue("transform")||l.getPropertyValue(Zi());if(n&&"none"!==n){var a,r=n.match(lo);r?((a=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,a[5]=t.y,eo(e,"matrix(".concat(a.join(","),")"))):((a=n.match(no)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,a[13]=t.y,eo(e,"matrix3d(".concat(a.join(","),")")))}else eo(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,a)}function Co(e,t){for(var l=0;l<e.length;l++)t(e[l])}function wo(e){return"border-box"===to(e,"boxSizing")}"undefined"!=typeof window&&(to=window.getComputedStyle?function(e,t,l){var n=l,a="",r=fo(e);return(n=n||r.defaultView.getComputedStyle(e,null))&&(a=n.getPropertyValue(t)||n[t]),a}:function(e,t){var l=e[ho]&&e[ho][t];if(po.test(l)&&!mo.test(t)){var n=e.style,a=n[vo],r=e[go][vo];e[go][vo]=e[ho][vo],n[vo]="fontSize"===t?"1em":l||0,l=n.pixelLeft+"px",n[vo]=a,e[go][vo]=r}return""===l?"auto":l});var So=["margin","border","padding"],No=-1,To=2,Io=1;function Oo(e,t,l){var n,a,r,i=0;for(a=0;a<t.length;a++)if(n=t[a])for(r=0;r<l.length;r++){var o=void 0;o="border"===n?"".concat(n).concat(l[r],"Width"):n+l[r],i+=parseFloat(to(e,o))||0}return i}var Ro={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 ko(e,t,l){var n=l;if(co(e))return"width"===t?Ro.viewportWidth(e):Ro.viewportHeight(e);if(9===e.nodeType)return"width"===t?Ro.docWidth(e):Ro.docHeight(e);var a="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=wo(e),o=0;(null==r||r<=0)&&(r=void 0,(null==(o=to(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===n&&(n=i?Io:No);var s=void 0!==r||i,d=r||o;return n===No?s?d-Oo(e,["border","padding"],a):o:s?n===Io?d:d+(n===To?-Oo(e,["border"],a):Oo(e,["margin"],a)):o+Oo(e,So.slice(n),a)}Co(["Width","Height"],(function(e){Ro["doc".concat(e)]=function(t){var l=t.document;return Math.max(l.documentElement["scroll".concat(e)],l.body["scroll".concat(e)],Ro["viewport".concat(e)](l))},Ro["viewport".concat(e)]=function(t){var l="client".concat(e),n=t.document,a=n.body,r=n.documentElement[l];return"CSS1Compat"===n.compatMode&&r||a&&a[l]||r}}));var Lo={position:"absolute",visibility:"hidden",display:"block"};function Po(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n,a=t[0];return 0!==a.offsetWidth?n=ko.apply(void 0,t):function(e,t,l){var n,a={},r=e.style;for(n in t)t.hasOwnProperty(n)&&(a[n]=r[n],r[n]=t[n]);for(n in l.call(e),t)t.hasOwnProperty(n)&&(r[n]=a[n])}(a,Lo,(function(){n=ko.apply(void 0,t)})),n}function Ao(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l]);return e}Co(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Ro["outer".concat(t)]=function(t,l){return t&&Po(t,e,l?0:Io)};var l="width"===e?["Left","Right"]:["Top","Bottom"];Ro[e]=function(t,n){var a=n;return void 0!==a?t?(wo(t)&&(a+=Oo(t,["padding","border"],l)),ro(t,e,a)):void 0:t&&Po(t,e,No)}}));var Do={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:fo,offset:function(e,t,l){if(void 0===t)return uo(e);!function(e,t,l){if(l.ignoreShake){var n=uo(e),a=n.left.toFixed(0),r=n.top.toFixed(0),i=t.left.toFixed(0),o=t.top.toFixed(0);if(a===i&&r===o)return}l.useCssRight||l.useCssBottom?xo(e,t,l):l.useCssTransform&&Zi()in document.body.style?Eo(e,t):xo(e,t,l)}(e,t,l||{})},isWindow:co,each:Co,css:ro,clone:function(e){var t,l={};for(t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(l.overflow[t]=e.overflow[t]);return l},mix:Ao,getWindowScrollLeft:function(e){return oo(e)},getWindowScrollTop:function(e){return so(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)Do.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};Ao(Do,Ro);var _o=Do.getParent;function Fo(e){if(Do.isWindow(e)||9===e.nodeType)return null;var t,l=Do.getDocument(e).body,n=Do.css(e,"position");if(!("fixed"===n||"absolute"===n))return"html"===e.nodeName.toLowerCase()?null:_o(e);for(t=_o(e);t&&t!==l&&9!==t.nodeType;t=_o(t))if("static"!==(n=Do.css(t,"position")))return t;return null}var Ho=Do.getParent;function Mo(e,t){for(var l={left:0,right:1/0,top:0,bottom:1/0},n=Fo(e),a=Do.getDocument(e),r=a.defaultView||a.parentWindow,i=a.body,o=a.documentElement;n;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===n.clientWidth||n===i||n===o||"visible"===Do.css(n,"overflow")){if(n===i||n===o)break}else{var s=Do.offset(n);s.left+=n.clientLeft,s.top+=n.clientTop,l.top=Math.max(l.top,s.top),l.right=Math.min(l.right,s.left+n.clientWidth),l.bottom=Math.min(l.bottom,s.top+n.clientHeight),l.left=Math.max(l.left,s.left)}n=Fo(n)}var d=null;Do.isWindow(e)||9===e.nodeType||(d=e.style.position,"absolute"===Do.css(e,"position")&&(e.style.position="fixed"));var u=Do.getWindowScrollLeft(r),c=Do.getWindowScrollTop(r),f=Do.viewportWidth(r),p=Do.viewportHeight(r),m=o.scrollWidth,h=o.scrollHeight,g=window.getComputedStyle(i);if("hidden"===g.overflowX&&(m=r.innerWidth),"hidden"===g.overflowY&&(h=r.innerHeight),e.style&&(e.style.position=d),t||function(e){if(Do.isWindow(e)||9===e.nodeType)return!1;var t=Do.getDocument(e),l=t.body,n=null;for(n=Ho(e);n&&n!==l&&n!==t;n=Ho(n))if("fixed"===Do.css(n,"position"))return!0;return!1}(e))l.left=Math.max(l.left,u),l.top=Math.max(l.top,c),l.right=Math.min(l.right,u+f),l.bottom=Math.min(l.bottom,c+p);else{var v=Math.max(m,u+f);l.right=Math.min(l.right,v);var y=Math.max(h,c+p);l.bottom=Math.min(l.bottom,y)}return l.top>=0&&l.left>=0&&l.bottom>l.top&&l.right>l.left?l:null}function $o(e){var t,l,n;if(Do.isWindow(e)||9===e.nodeType){var a=Do.getWindow(e);t={left:Do.getWindowScrollLeft(a),top:Do.getWindowScrollTop(a)},l=Do.viewportWidth(a),n=Do.viewportHeight(a)}else t=Do.offset(e),l=Do.outerWidth(e),n=Do.outerHeight(e);return t.width=l,t.height=n,t}function qo(e,t){var l=t.charAt(0),n=t.charAt(1),a=e.width,r=e.height,i=e.left,o=e.top;return"c"===l?o+=r/2:"b"===l&&(o+=r),"c"===n?i+=a/2:"r"===n&&(i+=a),{left:i,top:o}}function jo(e,t,l,n,a){var r=qo(t,l[1]),i=qo(e,l[0]),o=[i.left-r.left,i.top-r.top];return{left:Math.round(e.left-o[0]+n[0]-a[0]),top:Math.round(e.top-o[1]+n[1]-a[1])}}function Ko(e,t,l){return e.left<l.left||e.left+t.width>l.right}function Vo(e,t,l){return e.top<l.top||e.top+t.height>l.bottom}function zo(e,t,l){var n=[];return Do.each(e,(function(e){n.push(e.replace(t,(function(e){return l[e]})))})),n}function Wo(e,t){return e[t]=-e[t],e}function Bo(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Uo(e,t){e[0]=Bo(e[0],t.width),e[1]=Bo(e[1],t.height)}function Go(e,t,l,n){var a=l.points,r=l.offset||[0,0],i=l.targetOffset||[0,0],o=l.overflow,s=l.source||e;r=[].concat(r),i=[].concat(i);var d={},u=0,c=Mo(s,!(!(o=o||{})||!o.alwaysByViewport)),f=$o(s);Uo(r,f),Uo(i,t);var p=jo(f,t,a,r,i),m=Do.merge(f,p);if(c&&(o.adjustX||o.adjustY)&&n){if(o.adjustX&&Ko(p,f,c)){var h=zo(a,/[lr]/gi,{l:"r",r:"l"}),g=Wo(r,0),v=Wo(i,0);(function(e,t,l){return e.left>l.right||e.left+t.width<l.left})(jo(f,t,h,g,v),f,c)||(u=1,a=h,r=g,i=v)}if(o.adjustY&&Vo(p,f,c)){var y=zo(a,/[tb]/gi,{t:"b",b:"t"}),b=Wo(r,1),x=Wo(i,1);(function(e,t,l){return e.top>l.bottom||e.top+t.height<l.top})(jo(f,t,y,b,x),f,c)||(u=1,a=y,r=b,i=x)}u&&(p=jo(f,t,a,r,i),Do.mix(m,p));var E=Ko(p,f,c),C=Vo(p,f,c);if(E||C){var w=a;E&&(w=zo(a,/[lr]/gi,{l:"r",r:"l"})),C&&(w=zo(a,/[tb]/gi,{t:"b",b:"t"})),a=w,r=l.offset||[0,0],i=l.targetOffset||[0,0]}d.adjustX=o.adjustX&&E,d.adjustY=o.adjustY&&C,(d.adjustX||d.adjustY)&&(m=function(e,t,l,n){var a=Do.clone(e),r={width:t.width,height:t.height};return n.adjustX&&a.left<l.left&&(a.left=l.left),n.resizeWidth&&a.left>=l.left&&a.left+r.width>l.right&&(r.width-=a.left+r.width-l.right),n.adjustX&&a.left+r.width>l.right&&(a.left=Math.max(l.right-r.width,l.left)),n.adjustY&&a.top<l.top&&(a.top=l.top),n.resizeHeight&&a.top>=l.top&&a.top+r.height>l.bottom&&(r.height-=a.top+r.height-l.bottom),n.adjustY&&a.top+r.height>l.bottom&&(a.top=Math.max(l.bottom-r.height,l.top)),Do.mix(a,r)}(p,f,c,d))}return m.width!==f.width&&Do.css(s,"width",Do.width(s)+m.width-f.width),m.height!==f.height&&Do.css(s,"height",Do.height(s)+m.height-f.height),Do.offset(s,{left:m.left,top:m.top},{useCssRight:l.useCssRight,useCssBottom:l.useCssBottom,useCssTransform:l.useCssTransform,ignoreShake:l.ignoreShake}),{points:a,offset:r,targetOffset:i,overflow:d}}function Yo(e,t,l){var n=l.target||t,a=$o(n),r=!function(e,t){var l=Mo(e,t),n=$o(e);return!l||n.left+n.width<=l.left||n.top+n.height<=l.top||n.left>=l.right||n.top>=l.bottom}(n,l.overflow&&l.overflow.alwaysByViewport);return Go(e,a,l,r)}Yo.__getOffsetParent=Fo,Yo.__getVisibleRectForElement=Mo;var Xo=ol()?$.useLayoutEffect:$.useEffect,Qo=function(e,t){var l=$.useRef(!0);Xo((function(){return e(l.current)}),t),Xo((function(){return l.current=!1,function(){l.current=!0}}),[])};function Zo(e,t){var l=null,n=null;var a=new le.default((function(e){var a=kt(e,1)[0].target;if(document.documentElement.contains(a)){var r=a.getBoundingClientRect(),i=r.width,o=r.height,s=Math.floor(i),d=Math.floor(o);l===s&&n===d||Promise.resolve().then((function(){t({width:s,height:d})})),l=s,n=d}}));return e&&a.observe(e),function(){a.disconnect()}}function Jo(e){return"function"!=typeof e?null:e()}function es(e){return"object"===St(e)&&e?e:null}var ts=function(e,t){var l=e.children,n=e.disabled,a=e.target,r=e.align,i=e.onAlign,o=e.monitorWindowResize,s=e.monitorBufferTime,d=void 0===s?0:s,u=q.default.useRef({}),c=q.default.useRef(),f=q.default.Children.only(l),p=q.default.useRef({});p.current.disabled=n,p.current.target=a,p.current.align=r,p.current.onAlign=i;var m=function(e,t){var l=q.default.useRef(!1),n=q.default.useRef(null);function a(){window.clearTimeout(n.current)}return[function r(i){if(a(),l.current&&!0!==i)n.current=window.setTimeout((function(){l.current=!1,r()}),t);else{if(!1===e(i))return;l.current=!0,n.current=window.setTimeout((function(){l.current=!1}),t)}},function(){l.current=!1,a()}]}((function(){var e=p.current,t=e.disabled,l=e.target,n=e.align,a=e.onAlign,r=c.current;if(!t&&l&&r){var i,o=Jo(l),s=es(l);u.current.element=o,u.current.point=s,u.current.align=n;var d=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(),l=t.width,n=t.height;if(l||n)return!0}if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),r=a.width,i=a.height;if(r||i)return!0}}return!1}(o)?i=Yo(r,o,n):s&&(i=function(e,t,l){var n,a,r=Do.getDocument(e),i=r.defaultView||r.parentWindow,o=Do.getWindowScrollLeft(i),s=Do.getWindowScrollTop(i),d=Do.viewportWidth(i),u=Do.viewportHeight(i),c={left:n="pageX"in t?t.pageX:o+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},f=n>=0&&n<=o+d&&a>=0&&a<=s+u,p=[l.points[0],"cc"];return Go(e,c,Bi(Bi({},l),{},{points:p}),f)}(r,s,n)),function(e,t){e!==document.activeElement&&Mi(t,e)&&"function"==typeof e.focus&&e.focus()}(d,r),a&&i&&a(r,i),!0}return!1}),d),h=kt(m,2),g=h[0],v=h[1],y=kt(q.default.useState(),2),b=y[0],x=y[1],E=kt(q.default.useState(),2),C=E[0],w=E[1];return Qo((function(){x(Jo(a)),w(es(a))})),q.default.useEffect((function(){var e,t;u.current.element===b&&((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 l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function e(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=n.has(t);if(Ae(!i,"Warning: There may be circular references"),i)return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);var o=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],a[s],o))return!1;return!0}if(t&&a&&"object"===St(t)&&"object"===St(a)){var d=Object.keys(t);return d.length===Object.keys(a).length&&d.every((function(l){return e(t[l],a[l],o)}))}return!1}(e,t)}(u.current.align,r)||g()})),q.default.useEffect((function(){return Zo(c.current,g)}),[c.current]),q.default.useEffect((function(){return Zo(b,g)}),[b]),q.default.useEffect((function(){n?v():g()}),[n]),q.default.useEffect((function(){if(o)return $i(window,"resize",g).remove}),[o]),q.default.useEffect((function(){return function(){v()}}),[]),q.default.useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),q.default.isValidElement(f)&&(f=q.default.cloneElement(f,{ref:Ht(f.ref,c)})),f},ls=q.default.forwardRef(ts);function ns(){ns=function(){return e};var e={},t=Object.prototype,l=t.hasOwnProperty,n=Object.defineProperty||function(e,t,l){e[t]=l.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function s(e,t,l){return Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,l){return e[t]=l}}function d(e,t,l,a){var r=t&&t.prototype instanceof f?t:f,i=Object.create(r.prototype),o=new N(a||[]);return n(i,"_invoke",{value:E(e,l,o)}),i}function u(e,t,l){try{return{type:"normal",arg:e.call(t,l)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var c={};function f(){}function p(){}function m(){}var h={};s(h,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==t&&l.call(v,r)&&(h=v);var y=m.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function a(n,r,i,o){var s=u(e[n],e,r);if("throw"!==s.type){var d=s.arg,c=d.value;return c&&"object"==St(c)&&l.call(c,"__await")?t.resolve(c.__await).then((function(e){a("next",e,i,o)}),(function(e){a("throw",e,i,o)})):t.resolve(c).then((function(e){d.value=e,i(d)}),(function(e){return a("throw",e,i,o)}))}o(s.arg)}var r;n(this,"_invoke",{value:function(e,l){function n(){return new t((function(t,n){a(e,l,t,n)}))}return r=r?r.then(n,n):n()}})}function E(e,t,l){var n="suspendedStart";return function(a,r){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw r;return I()}for(l.method=a,l.arg=r;;){var i=l.delegate;if(i){var o=C(i,l);if(o){if(o===c)continue;return o}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===n)throw n="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);n="executing";var s=u(e,t,l);if("normal"===s.type){if(n=l.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:l.done}}"throw"===s.type&&(n="completed",l.method="throw",l.arg=s.arg)}}}function C(e,t){var l=t.method,n=e.iterator[l];if(void 0===n)return t.delegate=null,"throw"===l&&e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method)||"return"!==l&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+l+"' method")),c;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(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(w,this),this.reset(!0)}function T(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=m,n(y,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,l,n,a,r){void 0===r&&(r=Promise);var i=new x(d(t,l,n,a),r);return e.isGeneratorFunction(l)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),s(y,o,"Generator"),s(y,r,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),l=[];for(var n in t)l.push(n);return l.reverse(),function e(){for(;l.length;){var n=l.pop();if(n in t)return e.value=n,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)&&l.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 n(l,n){return i.type="throw",i.arg=e,t.next=l,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],i=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var o=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&l.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var i=r?r.completion:{};return i.type=e,i.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(i)},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),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.finallyLoc===e)return this.complete(l.completion,l.afterLoc),S(l),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.tryLoc===e){var n=l.completion;if("throw"===n.type){var a=n.arg;S(l)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,l){return this.delegate={iterator:T(e),resultName:t,nextLoc:l},"next"===this.method&&(this.arg=void 0),c}},e}function as(e,t,l,n,a,r,i){try{var o=e[r](i),s=o.value}catch(e){return void l(e)}o.done?t(s):Promise.resolve(s).then(n,a)}function rs(e){return function(){var t=this,l=arguments;return new Promise((function(n,a){var r=e.apply(t,l);function i(e){as(r,n,a,i,o,"next",e)}function o(e){as(r,n,a,i,o,"throw",e)}i(void 0)}))}}ls.displayName="Align";var is=["measure","alignPre","align",null,"motion"],os=$.forwardRef((function(t,l){var n=t.visible,a=t.prefixCls,r=t.className,i=t.style,o=t.children,s=t.zIndex,d=t.stretch,u=t.destroyPopupOnHide,c=t.forceRender,f=t.align,p=t.point,m=t.getRootDomNode,h=t.getClassNameFromAlign,g=t.onAlign,v=t.onMouseEnter,y=t.onMouseLeave,b=t.onMouseDown,x=t.onTouchStart,E=t.onClick,C=e.useRef(),w=e.useRef(),S=kt(e.useState(),2),N=S[0],T=S[1],I=function(e){var t=kt($.useState({width:0,height:0}),2),l=t[0],n=t[1];return[$.useMemo((function(){var t={};if(e){var n=l.width,a=l.height;-1!==e.indexOf("height")&&a?t.height=a:-1!==e.indexOf("minHeight")&&a&&(t.minHeight=a),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,l]),function(e){var t=e.offsetWidth,l=e.offsetHeight,a=e.getBoundingClientRect(),r=a.width,i=a.height;Math.abs(t-r)<1&&Math.abs(l-i)<1&&(t=r,l=i),n({width:t,height:l})}]}(d),O=kt(I,2),R=O[0],k=O[1];var L=function(t,l){var n=kt(Xt(null),2),a=n[0],r=n[1],i=e.useRef();function o(e){r(e,!0)}function s(){kl.cancel(i.current)}return e.useEffect((function(){o("measure")}),[t]),e.useEffect((function(){"measure"===a&&l(),a&&(i.current=kl(rs(ns().mark((function e(){var t,l;return ns().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=is.indexOf(a),(l=is[t+1])&&-1!==t&&o(l);case 3:case"end":return e.stop()}}),e)})))))}),[a]),e.useEffect((function(){return function(){s()}}),[]),[a,function(e){s(),i.current=kl((function(){o((function(e){switch(a){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n,(function(){d&&k(m())})),P=kt(L,2),A=P[0],D=P[1],_=kt(e.useState(0),2),F=_[0],H=_[1],M=e.useRef();function q(){var e;null===(e=C.current)||void 0===e||e.forceAlign()}function j(e,t){var l=h(t);N!==l&&T(l),H((function(e){return e+1})),"align"===A&&(null==g||g(e,t))}Qo((function(){"alignPre"===A&&H(0)}),[A]),Qo((function(){"align"===A&&(F<3?q():D((function(){var e;null===(e=M.current)||void 0===e||e.call(M)})))}),[F]);var K=Ot({},Vi(t));function V(){return new Promise((function(e){M.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=K[e];K[e]=function(e,l){return D(),null==t?void 0:t(e,l)}})),$.useEffect((function(){K.motionName||"motion"!==A||D()}),[K.motionName,A]),$.useImperativeHandle(l,(function(){return{forceAlign:q,getElement:function(){return w.current}}}));var z=Ot(Ot({},R),{},{zIndex:s,opacity:"motion"!==A&&"stable"!==A&&n?0:void 0,pointerEvents:n||"stable"===A?void 0:"none"},i),W=!0;null==f||!f.points||"align"!==A&&"stable"!==A||(W=!1);var B=o;return $.Children.count(o)>1&&(B=$.createElement("div",{className:"".concat(a,"-content")},o)),$.createElement(Hl,Ml({visible:n,ref:w,leavedClassName:"".concat(a,"-hidden")},K,{onAppearPrepare:V,onEnterPrepare:V,removeOnLeave:u,forceRender:c}),(function(e,t){var l=e.className,n=e.style,i=J.default(a,r,N,l);return $.createElement(ls,{target:p||m,key:"popup",ref:C,monitorWindowResize:!0,disabled:W,align:f,onAlign:j},$.createElement("div",{ref:t,className:i,onMouseEnter:v,onMouseLeave:y,onMouseDownCapture:b,onTouchStartCapture:x,onClick:E,style:Ot(Ot({},n),z)},B))}))}));os.displayName="PopupInner";var ss=$.forwardRef((function(e,t){var l=e.prefixCls,n=e.visible,a=e.zIndex,r=e.children,i=e.mobile,o=(i=void 0===i?{}:i).popupClassName,s=i.popupStyle,d=i.popupMotion,u=void 0===d?{}:d,c=i.popupRender,f=e.onClick,p=$.useRef();$.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var m=Ot({zIndex:a},s),h=r;return $.Children.count(r)>1&&(h=$.createElement("div",{className:"".concat(l,"-content")},r)),c&&(h=c(h)),$.createElement(Hl,Ml({visible:n,ref:p,removeOnLeave:!0},u),(function(e,t){var n=e.className,a=e.style,r=J.default(l,o,n);return $.createElement("div",{ref:t,className:r,onClick:f,style:Ot(Ot({},a),m)},h)}))}));ss.displayName="MobilePopupInner";var ds=["visible","mobile"],us=$.forwardRef((function(t,l){var n=t.visible,a=t.mobile,r=$t(t,ds),i=kt(e.useState(n),2),o=i[0],s=i[1],d=kt(e.useState(!1),2),u=d[0],c=d[1],f=Ot(Ot({},r),{},{visible:o});e.useEffect((function(){s(n),n&&a&&c(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))}())}),[n,a]);var p=u?$.createElement(ss,Ml({},f,{mobile:a,ref:l})):$.createElement(os,Ml({},f,{ref:l}));return $.createElement("div",null,$.createElement(zi,f),p)}));us.displayName="Popup";var cs=$.createContext(null);function fs(){}function ps(){return""}function ms(e){return e?e.ownerDocument:window.document}var hs=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var gs=function(e){var t=function(t){Wt(n,$.Component);var l=Gt(n);function n(e){var t,a;return jt(this,n),Tt(Ut(t=l.call(this,e)),"popupRef",$.createRef()),Tt(Ut(t),"triggerRef",$.createRef()),Tt(Ut(t),"portalContainer",void 0),Tt(Ut(t),"attachId",void 0),Tt(Ut(t),"clickOutsideHandler",void 0),Tt(Ut(t),"touchOutsideHandler",void 0),Tt(Ut(t),"contextMenuOutsideHandler1",void 0),Tt(Ut(t),"contextMenuOutsideHandler2",void 0),Tt(Ut(t),"mouseDownTimeout",void 0),Tt(Ut(t),"focusTime",void 0),Tt(Ut(t),"preClickTime",void 0),Tt(Ut(t),"preTouchTime",void 0),Tt(Ut(t),"delayTimer",void 0),Tt(Ut(t),"hasPopupMouseDown",void 0),Tt(Ut(t),"onMouseEnter",(function(e){var l=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,l,l?null:e)})),Tt(Ut(t),"onMouseMove",(function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)})),Tt(Ut(t),"onMouseLeave",(function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),Tt(Ut(t),"onPopupMouseEnter",(function(){t.clearDelayTimer()})),Tt(Ut(t),"onPopupMouseLeave",(function(e){var l;e.relatedTarget&&!e.relatedTarget.setTimeout&&Mi(null===(l=t.popupRef.current)||void 0===l?void 0:l.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),Tt(Ut(t),"onFocus",(function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))})),Tt(Ut(t),"onMouseDown",(function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()})),Tt(Ut(t),"onTouchStart",(function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()})),Tt(Ut(t),"onBlur",(function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)})),Tt(Ut(t),"onContextMenu",(function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)})),Tt(Ut(t),"onContextMenuClose",(function(){t.isContextMenuToShow()&&t.close()})),Tt(Ut(t),"onClick",(function(e){if(t.fireEvents("onClick",e),t.focusTime){var l;if(t.preClickTime&&t.preTouchTime?l=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?l=t.preClickTime:t.preTouchTime&&(l=t.preTouchTime),Math.abs(l-t.focusTime)<20)return;t.focusTime=0}t.preClickTime=0,t.preTouchTime=0,t.isClickToShow()&&(t.isClickToHide()||t.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!t.state.popupVisible;(t.isClickToHide()&&!n||n&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)})),Tt(Ut(t),"onPopupMouseDown",(function(){var e;(t.hasPopupMouseDown=!0,clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=window.setTimeout((function(){t.hasPopupMouseDown=!1}),0),t.context)&&(e=t.context).onPopupMouseDown.apply(e,arguments)})),Tt(Ut(t),"onDocumentClick",(function(e){if(!t.props.mask||t.props.maskClosable){var l=e.target,n=t.getRootDomNode(),a=t.getPopupDomNode();Mi(n,l)&&!t.isContextMenuOnly()||Mi(a,l)||t.hasPopupMouseDown||t.close()}})),Tt(Ut(t),"getRootDomNode",(function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var l=Pt(t.triggerRef.current);if(l)return l}catch(e){}return ee.default.findDOMNode(Ut(t))})),Tt(Ut(t),"getPopupClassNameFromAlign",(function(e){var l=[],n=t.props,a=n.popupPlacement,r=n.builtinPlacements,i=n.prefixCls,o=n.alignPoint,s=n.getPopupClassNameFromAlign;return a&&r&&l.push(function(e,t,l,n){for(var a=l.points,r=Object.keys(e),i=0;i<r.length;i+=1){var o=r[i];if(ji(e[o].points,a,n))return"".concat(t,"-placement-").concat(o)}return""}(r,i,e,o)),s&&l.push(s(e)),l.join(" ")})),Tt(Ut(t),"getComponent",(function(){var e=t.props,l=e.prefixCls,n=e.destroyPopupOnHide,a=e.popupClassName,r=e.onPopupAlign,i=e.popupMotion,o=e.popupAnimation,s=e.popupTransitionName,d=e.popupStyle,u=e.mask,c=e.maskAnimation,f=e.maskTransitionName,p=e.maskMotion,m=e.zIndex,h=e.popup,g=e.stretch,v=e.alignPoint,y=e.mobile,b=e.forceRender,x=e.onPopupClick,E=t.state,C=E.popupVisible,w=E.point,S=t.getPopupAlign(),N={};return t.isMouseEnterToShow()&&(N.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(N.onMouseLeave=t.onPopupMouseLeave),N.onMouseDown=t.onPopupMouseDown,N.onTouchStart=t.onPopupMouseDown,$.createElement(us,Ml({prefixCls:l,destroyPopupOnHide:n,visible:C,point:v&&w,className:a,align:S,onAlign:r,animation:o,getClassNameFromAlign:t.getPopupClassNameFromAlign},N,{stretch:g,getRootDomNode:t.getRootDomNode,style:d,mask:u,zIndex:m,transitionName:s,maskAnimation:c,maskTransitionName:f,maskMotion:p,ref:t.popupRef,motion:i,mobile:y,forceRender:b,onClick:x}),"function"==typeof h?h():h)})),Tt(Ut(t),"attachParent",(function(e){kl.cancel(t.attachId);var l,n=t.props,a=n.getPopupContainer,r=n.getDocument,i=t.getRootDomNode();a?(i||0===a.length)&&(l=a(i)):l=r(t.getRootDomNode()).body,l?l.appendChild(e):t.attachId=kl((function(){t.attachParent(e)}))})),Tt(Ut(t),"getContainer",(function(){if(!t.portalContainer){var e=(0,t.props.getDocument)(t.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",t.portalContainer=e}return t.attachParent(t.portalContainer),t.portalContainer})),Tt(Ut(t),"setPoint",(function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Tt(Ut(t),"handlePortalUpdate",(function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)})),Tt(Ut(t),"triggerContextValue",{onPopupMouseDown:t.onPopupMouseDown}),a="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:a,popupVisible:a},hs.forEach((function(e){t["fire".concat(e)]=function(l){t.fireEvents(e,l)}})),t}return Vt(n,[{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=$i(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=$i(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=$i(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=$i(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),kl.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,l=e.popupAlign,n=e.builtinPlacements;return t&&n?function(e,t,l){return Ot(Ot({},e[t]||{}),l)}(n,t,l):l}},{key:"setPopupVisible",value:function(e,t){var l=this.props.alignPoint,n=this.state.popupVisible;this.clearDelayTimer(),n!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:n}),this.props.onPopupVisibleChange(e)),l&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,l){var n=this,a=1e3*t;if(this.clearDelayTimer(),a){var r=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout((function(){n.setPopupVisible(e,r),n.clearDelayTimer()}),a)}else this.setPopupVisible(e,l)}},{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,l=this.props;return t[e]&&l[e]?this["fire".concat(e)]:t[e]||l[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("click")||-1!==l.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,l=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==l.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("click")||-1!==l.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("focus")||-1!==l.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("focus")||-1!==l.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 l=this.props.children.props[e];l&&l(t);var n=this.props[e];n&&n(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,l=this.props,n=l.children,a=l.forceRender,r=l.alignPoint,i=l.className,o=l.autoDestroy,s=$.Children.only(n),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,r&&(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=J.default(s&&s.props&&s.props.className,i);u&&(d.className=u);var c=Ot({},d);Mt(s)&&(c.ref=Ht(this.triggerRef,s.ref));var f,p=$.cloneElement(s,c);return(t||this.popupRef.current||a)&&(f=$.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&o&&(f=null),$.createElement(cs.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.popupVisible,n={};return void 0!==l&&t.popupVisible!==l&&(n.popupVisible=l,n.prevPopupVisible=t.popupVisible),n}}]),n}();return Tt(t,"contextType",cs),Tt(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ps,getDocument:ms,onPopupVisibleChange:fs,afterPopupVisibleChange:fs,onPopupAlign:fs,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}(qi);const vs=e=>{const{columns:t,onChange:l}=e,{prefixCls:n,$size:a}=q.default.useContext(Xr),{t:r}=Xe(),i=q.default.useRef([]),[o,d]=q.default.useState(!1),[u,c]=q.default.useState(t);Ql((()=>{p()}),[u]),q.default.useEffect((()=>{f()}),[t]);const f=()=>{const e=[];t.forEach(((l,n)=>{const a=l.colSpan;a>1&&t.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&e.push(t.slice(n,n+a))})),i.current=e},p=()=>{const e=[];u.forEach((t=>{const{colSpan:l,dataIndex:n}=t;if(0===l)return;if(1===l)return e.push(t);const a=i.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(n)));if(-1===a)return e.push(t);e.push(...i.current[a].map((({dataIndex:e},l)=>{const n=u.find((t=>t.dataIndex===e));return l>0&&void 0!==t.hidden&&(n.hidden=t.hidden),n})))})),null==l||l(e)},h={[`${n}__popper`]:!0,"column-filter__popper":!0,[`${n}--lg`]:"large"===a,[`${n}--sm`]:"small"===a},v=[`${n}-column-filter`,{selected:o}];return q.default.createElement(gs,{action:["click"],popupVisible:o,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"main"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:u,setList:e=>{const t=e.map((e=>e.dataIndex)),l=u.map((e=>e.dataIndex));m.isEqual(t,l)||c(Ya(e))}},u.map((e=>((e,t)=>{const{colSpan:l}=e;if(0===l)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle",`${t}-handle`];return q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(s.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,c([...u])}}),q.default.createElement("i",{className:J.default(n),title:r("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text"},qa(e.title)))})(e,"main")))))),popupClassName:J.default(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{d(e)},builtinPlacements:ri,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(v),title:r("qm.table.columnFilter.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),q.default.createElement("span",null,r("qm.table.columnFilter.text"))))},ys=e=>{const{defaultValue:t,onClose:l,onOk:n}=e,{tableRef:a,prefixCls:r,selectionKeys:i,pagination:o,showSummary:s}=q.default.useContext(Xr),{rowSelection:d}=a.current.props,{t:u}=Xe(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>Object.assign({},{fileName:`${j.default().format(ai)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:i.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},t,{columns:ut(t.columns||[])})),[]),[h,g]=q.default.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=>{h.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,g([...h])}},options:{min:1},disabled:!0},{type:"INPUT",label:u("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>q.default.createElement(vs,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:u("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:u("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]);return q.default.createElement("div",{className:`${r}-export__setting`},q.default.createElement(wf,{ref:c,initialValues:m,items:h,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l(),style:{marginRight:8}},u("qm.table.export.closeButton")),q.default.createElement(ht,{type:"primary",loading:f,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();if(!e){p(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);n(t),yield at(1e3),p(!1),l()}}))},u("qm.table.export.text"))))},bs=q.default.forwardRef(((e,t)=>{var l;const{tableColumns:n,open:a=!0}=e,{global:r}=q.default.useContext(xe),{tableRef:i,prefixCls:o,flattenColumns:d,pagination:u,fetchParams:c,isFetch:f,isGroupSubtotal:p,showSummary:h,getSpan:v}=q.default.useContext(Xr),{exportExcel:y,fetch:b,showHeader:x}=i.current.props,{t:E}=Xe(),{getTitleFromCellValue:C}=Si(),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),I=q.default.useMemo((()=>{var e;return!!(null===(e=null==y?void 0:y.fetch)||void 0===e?void 0:e.api)}),[y]),O=q.default.useMemo((()=>!u.total||N),[u.total,N]),R=q.default.useMemo((()=>xa(n,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn])),[n]),k=q.default.useMemo((()=>xa(d,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn])),[d]),L=(e,t="",l=0)=>e.map(((e,n)=>{const a=Object.assign(Object.assign({},e),{index:n,pageIndex:n}),r=t?`${t}.${a.index+1}`:`${a.index+1}`;return a.indexPath=r,a._level=l,Array.isArray(e.children)&&(a.children=L(e.children,r,l+1)),k.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&La(a,t,ka(a,t))})),a})),P=(e,t)=>{const l={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:n}=e,a=(p?ja(t):t).reduce(((e,t)=>{if(null==t?void 0:t[pi.summaryIgnore])return e;const l=Number(ka(t,n));return Number.isNaN(l)?e:e+l}),0);La(l,n,a)})),[l]},A=(e,t,l,n)=>{const{precision:a,formatType:r}=l;let i=C(e,l,t,n);return a>=0&&!r&&""!==i&&(i=Number(i)),i},{exportXLSX:D,exportCSV:_}=Di(),F=e=>Ye(void 0,void 0,void 0,(function*(){var t;const{api:l,formatter:n=(e=>e),afterFetch:a,dataKey:r}=b;let i=[];try{T(!0);const o={[pi.currentPageName]:1,[pi.pageSizeName]:null!=e?e:u.total},s=yield l(Object.assign(Object.assign({},n(Object.assign(Object.assign({},c),o))),o));if(200===s.code){let e=Array.isArray(s.data)?s.data:null!==(t=m.get(s.data,r))&&void 0!==t?t:[];e="function"==typeof a?yield a(e):e,i=L(e)}}catch(e){}return T(!1),i})),H=e=>{var t;const l=null===(t=null==r?void 0:r.table)||void 0===t?void 0:t.recordExportLog;try{null==l||l({fileName:e})}catch(e){}},M=(e,t)=>{const{columns:l,footSummation:n}=e,a=Sa(l),r=pa(l);let i='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return i+=`<colgroup>${r.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,x&&(i+=["<thead>",a.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${qa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),t.length&&(i+=`<tbody>${Ca(t).map((e=>`<tr>${r.map(((l,n)=>{const{rowSpan:a,colSpan:r}=v(e,l,e.index,n,t);return a&&r?`<td rowspan="${a}" colspan="${r}">${A(e,e.index,l,n)}</td>`:null})).join("")}</tr>`)).join("")}</tbody>`),h&&n&&(i+=["<tfoot>",P(r,t).map((e=>`<tr>${r.map(((l,n)=>{const{dataIndex:a,summation:r}=l,i=(null==r?void 0:r.render)?r.render(t):ka(e,a);return`<td>${0===n&&""===i?E("qm.table.config.summaryText"):et(i)?$a(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),i+="</table>",i},$=null!==(l=null==y?void 0:y.fileName)&&void 0!==l?l:`${j.default().format(ai)}.xlsx`,K=$.slice($.lastIndexOf(".")+1).toLowerCase(),V=()=>{if(O)return s.message.warning(E("qm.table.export.warnText"));var e;I?(e=$,Ye(void 0,void 0,void 0,(function*(){T(!0);try{const{api:t,params:l}=y.fetch,n=yield t(Object.assign(Object.assign(Object.assign({columns:k.map((e=>{const{title:t,dataIndex:l,hidden:n}=e,{type:a}=e.filter||{};return{title:t,dataIndex:l,type:a,hidden:n}}))},c),l),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[pi.currentPageName]:void 0,[pi.pageSizeName]:void 0}));n.data&&(Fn(n.data,e),H(e))}catch(e){}T(!1)}))):S(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:V})));const z={[`${o}-export`]:!0},W={visible:w,title:E("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},B={fileName:$.slice(0,$.lastIndexOf(".")),fileType:K,columns:R,useStyle:(null==y?void 0:y.cellStyle)?1:0};return q.default.createElement(q.default.Fragment,null,a&&q.default.createElement("span",{className:J.default(z),title:E("qm.table.export.textNoSpace"),onClick:()=>V()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.DownloadOutlined,null))),q.default.createElement(Qn,W,q.default.createElement(ys,{defaultValue:B,onClose:()=>S(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ma(e.columns)}),Ye(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:l,exportType:n,startIndex:a=1,endIndex:r}=t,{tableFullData:o,selectionRows:s}=i.current;let d=[];if(f?("all"===n&&(d=yield F()),"custom"===n&&(d=yield F(r),d=d.slice(a-1))):("all"===n&&(d=o.slice(0)),"custom"===n&&(d=o.slice(a-1,r||void 0))),"selected"===n&&(d=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==y?void 0:y.beforeExport))try{d=null==y?void 0:y.beforeExport(d)}catch(e){}if("xlsx"===l){const l=yield D(t,d,P,A);Fn(l,`${e}.xlsx`),H(`${e}.xlsx`)}if("csv"===l){const l=_(t,M(t,d));Fn(l,`${e}.csv`),H(`${e}.csv`)}}))}})))}));bs.displayName="TableExport";const xs=e=>{const{columns:t,onClose:l}=e,{tableRef:n,tableBodyRef:a,prefixCls:r,dataChange:i}=q.default.useContext(Xr),{beforeClipboard:o}=n.current.props,{t:d}=Xe(),u=q.default.useRef(null),[c,f]=q.default.useState([{type:"INPUT_NUMBER",label:d("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:d("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:qa(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:d("qm.table.clipboard.content"),fieldName:"content",placeholder:d("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[p,m]=q.default.useState(!1);return q.default.createElement("div",{className:`${r}-clipboard__setting`},q.default.createElement("h3",{className:"info"},d("qm.table.clipboard.supportText")),q.default.createElement(wf,{ref:u,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.export.closeButton")),q.default.createElement(ht,{type:"primary",loading:p,onClick:()=>Ye(void 0,void 0,void 0,(function*(){var e;const[r,c]=yield u.current.GET_FORM_DATA();if(r)return;const{tableFullData:f,store:p,fieldAuth:h}=n.current;m(!0);const g=c.content.trim().replace(/(\r|\n)$/,"");let v=g.replace(/"[^"]+"/g,"^");((null===(e=g.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{v=v.replace(/\^/,e)}));let y=v.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{y=yield o(y,y[0].map(((e,l)=>t[c.colIndex+l].dataIndex)))}catch(r){}y.forEach(((e,l)=>{e.forEach(((e,n)=>{var a,r;const i=f[c.rowIndex-1+l],o=t[c.colIndex+n];if(i&&o){let t=!1;if(o.editRender){const e=o.editRender(i,o);t=!(e.disabled||(null===(a=e.extra)||void 0===a?void 0:a.disabled)||(null===(r=h[o.dataIndex])||void 0===r?void 0:r.disabled))}t&&o.dictItems&&(t=o.dictItems.some((t=>t.value==e))),t&&(La(i,o.dataIndex,e),p.addToUpdated(i))}}))})),a.current.forceUpdate(),i(),s.message.success(d("qm.table.clipboard.success",{total:y.length})),m(!1),l()}))},d("qm.table.clipboard.text"))))},Es=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,flattenColumns:a}=q.default.useContext(Xr),{t:r}=Xe(),[i,o]=q.default.useState(!1),s=q.default.useMemo((()=>(e=>e.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))))(a)),[a]),d=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:d})));const u={[`${n}-clipboard`]:!0},c={visible:i,title:r("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:J.default(u),title:r("qm.table.clipboard.textNoSpace"),onClick:()=>d()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CopyOutlined,null))),q.default.createElement(Qn,c,q.default.createElement(xs,{columns:s,onClose:()=>o(!1)})))}));Es.displayName="TableClipboard";const Cs=e=>{const{columns:t,onClose:l}=e,{tableRef:n,$size:a,selectionKeys:r,setSelectionKeysEffect:i}=q.default.useContext(Xr),{rowKey:o,rowSelection:s}=n.current.props,{t:d}=Xe(),u=q.default.useRef(null),c=Cn(u),f=e=>e.map((e=>{var t;const l={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)&&(l.children=f(e.children)),l})),[p,m]=q.default.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...f(t.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))))]),[h]=q.default.useState((()=>{const{disabled:e}=s||{},t=n.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[g,v]=q.default.useState(300),y=wn((()=>{const e=u.current;v(e.offsetHeight-2*Yr[a]-30)}),5);return Ie((()=>{y()}),[c.width]),q.default.createElement("div",{ref:u,style:{height:"100%"}},q.default.createElement(Ku,{size:a,columns:p,dataSource:h,rowKey:o,height:g,rowSelection:{type:"checkbox",selectedRowKeys:r,onChange:e=>i(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),q.default.createElement("div",{style:{height:10}}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l()},d("qm.table.selectCollection.closeButton"))))},ws=q.default.forwardRef(((e,t)=>{const{columns:l,open:n=!0}=e,{tableRef:a,getRowKey:r,prefixCls:i,selectionKeys:o,isFetch:s,isTableEmpty:d,setSelectionKeysEffect:u,setSelectionRows:c}=q.default.useContext(Xr),{rowSelection:f}=a.current.props,{t:p}=Xe(),[h,v]=q.default.useState(!1),y=q.default.useRef(!1);Ql((()=>{!y.current&&b()}),[d]);const b=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:l=(e=>!1)}=f;if(s&&t)try{const n=yield t.api(Object.assign({},{selectedKeys:o},t.params));if(200===n.code){let a=Array.isArray(n.data)?n.data:null!==(e=m.get(n.data,t.dataKey))&&void 0!==e?e:[];a=a.filter((e=>!l(e))),u(a.map(((e,t)=>r(e,t)))),c(a),y.current=!0}}catch(e){}})),x=()=>{v(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:x})));const E={visible:h,title:p("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>v(!1)};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement("span",{className:`${i}-select-collection`,title:p("qm.table.selectCollection.text"),onClick:()=>x()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CheckSquareOutlined,null))),q.default.createElement(Qn,E,q.default.createElement(Cs,{columns:l,onClose:()=>v(!1)})))}));ws.displayName="SelectCollection";const Ss=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,getRowKey:a,prefixCls:r,$size:i,tableFlatData:o,flattenColumns:d,setActivedCell:u,scrollXToColumn:c,scrollYToRecord:f}=q.default.useContext(Xr),{uniqueKey:p}=n.current.props,{t:m}=Xe(),{getTitleFromCellValue:h}=Si(),v=q.default.useRef(""),[y,b]=q.default.useState(""),[x,E]=q.default.useState([]),[C,w]=q.default.useState(0),[S,N]=q.default.useState(!1),[T,I]=q.default.useState({case:0,fullchar:0}),O=q.default.useMemo((()=>`${x.length>0?C+1:C}/${x.length}`),[C,x]);Ql((()=>{A(x[C])}),[C,x]);const R=e=>{I(Object.assign({},T,e))},k=(e,t,l)=>new Promise(((n,a)=>{s.Modal.confirm({title:m("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),n()},onCancel:()=>{l(),n()}})})),L=Qe((e=>Ye(void 0,void 0,void 0,(function*(){if(!y)return v.current=y,P();const t=((e,t)=>{const l=new RegExp(T.fullchar?`^${t}$`:t,T.case?"":"i"),n=[];return e.forEach(((e,t)=>{d.forEach(((r,i)=>{const{dataIndex:o}=r;if([pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(o))return;const s=h(e,r,e.index,i);l.test(s)&&n.push({value:s,rowKey:a(e,e.index),dataIndex:o,rowIndex:t,colIndex:i})}))})),n})(o,y);if(!t.length)return s.Modal.warning({title:m("qm.button.confirmPrompt"),content:m("qm.table.fastSearch.notMatch")});if(E(t),"all"===e&&N(!0),y!==v.current)return v.current=y,w(0);if("next"===e){const e=C+1;e>t.length-1?yield k(m("qm.table.fastSearch.toTheEnd"),(()=>w(0)),(()=>{})):w(e)}if("prev"===e){const e=C-1;e<0?yield k(m("qm.table.fastSearch.toStart"),(()=>w(t.length-1)),(()=>{})):w(e)}})))),P=()=>{w(0),E([]),u({})},A=e=>{e&&(f(e.rowKey),c(e.dataIndex),u(e))},D=q.default.useMemo((()=>p?`fastSearch_${p}`:""),[p]),[_,F]=q.default.useState([]),[H,M]=q.default.useState(""),[$,j]=q.default.useState("");Ql((()=>{if($){const{input:e,config:t}=_.find((e=>e.value===$)).condition;b(e),I(t),setTimeout((()=>L()))}}),[$]),q.default.useEffect((()=>{K()}),[]);const K=()=>Ye(void 0,void 0,void 0,(function*(){if(!D)return;let e=yield fe.default.getItem(D);e||(e=yield V(D),Array.isArray(e)&&(yield fe.default.setItem(D,e))),Array.isArray(e)&&e.length&&F(e)})),V=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),z=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-fast-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement("div",{className:"search-box"},q.default.createElement("span",{className:"label"},m("qm.table.fastSearch.queryLabel"),":"),q.default.createElement(s.Input,{value:y,placeholder:m("qm.table.fastSearch.queryCondition"),allowClear:!0,style:{width:"100%"},onChange:e=>b(e.target.value)})),q.default.createElement("div",{className:"condition"},q.default.createElement(s.Checkbox,{checked:!!T.case,onChange:e=>R({case:e.target.checked})},m("qm.table.fastSearch.matchCase")),q.default.createElement(s.Checkbox,{checked:!!T.fullchar,onChange:e=>R({fullchar:e.target.checked})},m("qm.table.fastSearch.matchFullchar"))),q.default.createElement("div",{className:"all-list"},S&&q.default.createElement("table",{className:"rtable",tabIndex:-1,cellSpacing:"0",cellPadding:"0"},q.default.createElement("thead",null,q.default.createElement("tr",null,q.default.createElement("th",{style:{width:40,minWidth:40}},"#"),q.default.createElement("th",{style:{width:130,minWidth:130}},m("qm.table.fastSearch.cellText")),q.default.createElement("th",null,m("qm.table.fastSearch.valText")))),q.default.createElement("tbody",null,x.map(((e,t)=>q.default.createElement("tr",{key:t,className:J.default({active:C===t}),onClick:()=>w(t)},q.default.createElement("td",null,t+1),q.default.createElement("td",null,"Row:",e.rowIndex+1,", Col:",e.colIndex+1),q.default.createElement("td",null,e.value)))))))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(s.Input,{size:i,value:H,placeholder:m("qm.table.highSearch.configText"),disabled:!y,onChange:e=>{const{value:t}=e.target;M(t)}}),q.default.createElement(ht,{type:"primary",disabled:!H||!y,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!D)return mt("Table","必须设置组件参数 `uniqueKey` 才能保存");if(!y)return;const e=Ma(),t=[..._,{text:H,value:e,condition:{input:y,config:T}}];F(t),M(""),yield fe.default.setItem(D,t),yield z(D,t)}))},m("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${pi.rowHeightMaps[i]}px`}},q.default.createElement("span",null,m("qm.table.fastSearch.savedSetting"))),q.default.createElement("ul",null,_.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===$}),title:e.text,onClick:()=>{return t=e.value,void j(t!==$?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:m("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ye(void 0,void 0,void 0,(function*(){if(!l)return;const e=_.filter((e=>e.value!==l));F(e),yield fe.default.setItem(D,e),yield z(D,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!_.length&&q.default.createElement("div",{style:{padding:Jr}},q.default.createElement(hn,null)))))),q.default.createElement("div",{className:"bottom-bar",style:{position:"absolute",left:0,bottom:0,right:0,height:`${Yr[i]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",boxSizing:"border-box"}},q.default.createElement("div",null,m("qm.table.fastSearch.findTotal",{total:O})),q.default.createElement("div",null,q.default.createElement(ht,{onClick:()=>L("all"),style:{marginRight:8}},m("qm.table.fastSearch.queryAll")),q.default.createElement(ht,{type:"primary",onClick:()=>L("prev"),style:{marginRight:8}},m("qm.table.fastSearch.queryPrev")),q.default.createElement(ht,{type:"primary",onClick:()=>L("next"),style:{marginRight:8}},m("qm.table.fastSearch.queryNext")),q.default.createElement(ht,{onClick:()=>t()},m("qm.table.fastSearch.closeButton")))))},Ns=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,$size:a}=q.default.useContext(Xr),{t:r}=Xe(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={visible:i,title:r("qm.table.fastSearch.settingTitle"),width:650,loading:!1,bodyStyle:{paddingBottom:`${Yr[a]+20}px`},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:r("qm.table.fastSearch.text"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.MonitorOutlined,null))),q.default.createElement(Qn,d,q.default.createElement(Ss,{onClose:()=>o(!1)})))}));Ns.displayName="FastSearch";var Ts={selectionColumnDefine:{title:"",dataIndex:"__selection__",width:80,fixed:"left"},indentWidth:16,groupMargin:15,separator:"^"};const Is=e=>[Ts.selectionColumnDefine,...e].filter((e=>!e.hidden)),Os=e=>e.some((e=>Array.isArray(e.children))),Rs=e=>void 0!==e._groupLevel,ks=(e,t)=>t.split(Ts.separator).reduce(((e,t)=>null==e?void 0:e[t]),e),Ls=e=>Array.isArray(e)?0:"object"==typeof e&&null!==e?1+Math.max(0,...Object.values(e).map(Ls)):0,Ps=(e,t="")=>Array.isArray(e)?[]:Object.keys(e).reduce(((l,n)=>{const a=t?`${t}${Ts.separator}${n}`:n;if(l.push(a),Array.isArray(e[n]))return l;const r=Ps(e[n],a);return l.concat(r)}),[]),As=(e,t=[],l)=>{const n=(e,t)=>{if(0===t.length)return e;const[{[Object.keys(t[0])[0]]:a}]=t,r=Object.keys(t[0])[0],i=t.slice(1),o=Object.groupBy(e,(e=>l(e,r))),s=Object.keys(o).sort(((e,t)=>{const l=(n=e,r=t,Number.isNaN(n-r)?n.toString().localeCompare(r.toString()):n-r);var n,r;return"ascend"===a?l:-l})),d={};return s.forEach((e=>{d[`#${e}`]=n(o[e],i)})),d};return n(e,t)},Ds={sum:e=>Da(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=>Da(e.length),unique:e=>new Set(e).size,empty:e=>e.filter((e=>ot(e))).length,notEmpty:e=>e.filter((e=>!ot(e))).length},_s=q.default.createContext(void 0),Fs=e=>{const{prefixCls:t,pivotProps:l,size:n,getRowKey:a,flatColumns:r,tableData:i}=e,{initialGroup:o,initialCount:s}=l,d=e=>{const t=new Map;return Ca(e).forEach((e=>t.set(a(e,e.index),e))),t},u=q.default.useRef({props:l,originGridData:i,flatGroupData:[],isTree:Os(i),keyRecordMap:d(i)}),[c,f]=q.default.useState({pivotRef:u,prefixCls:t,size:n,viewMode:"table",columns:r,gridData:i,groupGridData:[],groupList:o?(e=>{const t=[],l=r.map((e=>e.dataIndex));return e.forEach((e=>{l.includes(e.fieldName)&&["ascend","descend"].includes(e.order)&&t.push(e)})),t})(o):[],filterList:[],sorterList:[],colorList:[],expandedKeys:[],searchResults:[],switchIndex:0,fillColorCells:new Map,countMethod:s?(e=>{const t=["count","unique","empty","notEmpty","sum","max","min","avg"],l=r.map((e=>e.dataIndex)),n={};for(const a in e)l.includes(a)&&t.includes(e[a])&&(n[a]=e[a]);return n})(s):{},summationData:{}}),p=e=>{f((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))};Ie((()=>{g(i),m("originGridData",i),m("isTree",Os(i)),m("keyRecordMap",d(i))}),[i]),Ie((()=>{h(r)}),[r]),Ie((()=>{p({size:n})}),[n]);const m=(e,t)=>{c.pivotRef.current[e]=t};m("props",l);const h=e=>{p({columns:e})},g=e=>{p({gridData:e})},v=e=>{p({groupGridData:e})},y=e=>{p({groupList:e})},b=e=>{p({filterList:e})},x=e=>{p({sorterList:e})},E=e=>{p({colorList:e})},C=e=>{p({expandedKeys:e})},w=e=>{p({searchResults:e})},S=e=>{p({switchIndex:e})},N=e=>{const t=new Map;e.forEach((e=>t.set(`${e.rowKey}|${e.dataIndex}`,e.color))),p({fillColorCells:t})},T=e=>{var t;p({countMethod:(t=Object.assign({},c.countMethod,e),Object.fromEntries(Object.entries(t).filter((([e,t])=>void 0!==t))))})},I=e=>{p({summationData:e})},O=q.default.useMemo((()=>Object.assign(Object.assign({},c),{setContext:p,getRowKey:a,setPivotGridRef:m,setColumns:h,setGridData:g,setGroupGridData:v,setGroupList:y,setFilterList:b,setSorterList:x,setColorList:E,setExpandedKeys:C,setSearchResults:w,setSwitchIndex:S,setFillColor:N,setCountMethod:T,setSummationData:I})),[c]);return q.default.createElement(_s.Provider,{value:O},e.children)},Hs=()=>q.default.useContext(_s),Ms=()=>{const{prefixCls:e,pivotRef:t,groupList:l,columns:n,gridData:a,setGroupList:r,setExpandedKeys:i,setGroupGridData:o,setPivotGridRef:d}=Hs(),{originGridData:u}=t.current,{onGroupChange:c,onDataChange:f}=t.current.props,{t:p}=Xe(),h=q.default.useRef([]),v=q.default.useRef([]),y=q.default.useMemo((()=>l.filter((e=>e.fieldName&&e.order))),[l]),b=q.default.useMemo((()=>n.map((e=>({label:qa(e.title),value:e.dataIndex,disabled:l.some((t=>t.fieldName===e.dataIndex))})))),[l,n]),x=q.default.useMemo((()=>{const e=y.map((e=>({[e.fieldName]:e.order})));return m.isEqual(e,h.current)?h.current:(h.current=e,e)}),[y]),E=[{label:p("qm.pivotGrid.group.ascend"),value:"ascend"},{label:p("qm.pivotGrid.group.descend"),value:"descend"}];q.default.useEffect((()=>{i(v.current)}),[x,u]),q.default.useLayoutEffect((()=>{const e=As(a,x,((e,t)=>{let l=ka(e,t);return m.isPlainObject(l)&&(l=Object.values(l)),Array.isArray(l)&&(l=l.join(",")),ot(l)?p("qm.pivotGrid.group.empty"):l}));var t;o(e),t=Ps(e),v.current=t,d("flatGroupData",((e,t=[])=>{const l=[];return function e(n,a,r=""){if(Array.isArray(n))n.forEach(((e,t)=>{e._varIndex=t,r?e._parentRowKey=r:delete e._parentRowKey})),l.push(...Ca(n));else for(const i in n){const o=r?`${r}${Ts.separator}${i}`:i,s=Object.keys(t[a])[0];l.push({id:o,_fieldName:s,_groupLevel:a}),e(n[i],a+1,o)}}(e,0),l})(e,x))}),[x,a]),Ql((()=>{null==c||c(y)}),[x]),Ql((()=>{null==f||f(a)}),[a]);const C=()=>{r([...l,{fieldName:"",order:"ascend"}])},w=(e,t,n)=>{Object.assign(t,{[e]:n}),r([...l])},S=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(s.Select,{value:e.fieldName||void 0,placeholder:p("qm.table.editable.selectPlaceholder"),options:b,style:{width:160,margin:"0 10px"},onChange:t=>w("fieldName",e,t)}),q.default.createElement(s.Select,{value:e.order,options:E,placeholder:p("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>w("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(l.filter((t=>t!==e)))})(e)}));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,p("qm.pivotGrid.group.title")),!!y.length&&q.default.createElement("div",null,q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>i([])},p("qm.pivotGrid.group.foldAll")),q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>i(v.current)},p("qm.pivotGrid.group.unfoldAll")))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{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));m.isEqual(t,n)||r(e)}},l.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},S(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:C},q.default.createElement(g.PlusOutlined,{className:"icon"}),p("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!y.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FolderOpenOutlined,{className:"icon"}),p("qm.pivotGrid.group.text"),y.length?`(${y.length})`:null))},$s=()=>{const{prefixCls:e,pivotRef:t,columns:l,filterList:n,setFilterList:a,setGridData:r}=Hs(),{originGridData:i,isTree:o}=t.current,{onFilterChange:d}=t.current.props,{t:u}=Xe(),c=q.default.useRef([]),f=q.default.useMemo((()=>n.filter((e=>e.fieldName&&("nil"===e.expression||!ot(e.value))))),[n]),p=q.default.useMemo((()=>l.map((e=>({label:qa(e.title),value:e.dataIndex})))),[l]),[h,v]=q.default.useState("and"),y=q.default.useMemo((()=>{const e=f.map((e=>{var t;return`${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}));return m.isEqual(e,c.current)?c.current:(c.current=e,e)}),[f]);Ql((()=>{a(n.map((e=>Object.assign(Object.assign({},e),{logic:h}))))}),[h]),Ql((()=>{b(),null==d||d(f)}),[y]);const b=wn((()=>{const e=Ka(f.map((e=>Object.assign(Object.assign({},dt(e,["value"])),{expression:"nil"!==e.expression?e.expression:"==",condition:e.value}))));r(e?fa(i,e,o):i)}),200),x=[{label:u("qm.pivotGrid.filter.matchAll"),value:"and"},{label:u("qm.pivotGrid.filter.matchAny"),value:"or"}],E=()=>{a([...n,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:h}])},C=(e,t,r)=>{var i;if(Object.assign(t,{[e]:r}),"fieldName"===e){const e=(null===(i=l.find((e=>e.dataIndex===r)).filter)||void 0===i?void 0:i.type)||"text";Object.assign(t,{type:e,expression:S(e)[0].value,value:""})}"expression"===e&&"nil"===r&&Object.assign(t,{value:""}),a([...n])},w=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Select,{value:e.fieldName||void 0,options:p,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>C("fieldName",e,t)}),q.default.createElement(s.Select,{value:e.expression||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),options:S(e.type),style:{width:100,margin:"0 10px"},onChange:t=>C("expression",e,t)}),N(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{a(n.filter((t=>t!==e)))})(e)})),S=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:u("qm.table.highSearch.gtText")},{value:"<",label:u("qm.table.highSearch.ltText")},{value:">=",label:u("qm.table.highSearch.gteText")},{value:"<=",label:u("qm.table.highSearch.lteText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:u("qm.table.highSearch.inText")},{value:"nin",label:u("qm.table.highSearch.ninText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",label:u("qm.table.highSearch.likeText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"nil",label:u("qm.table.highSearch.nullText")}]}return t},N=e=>{var t,n;switch(e.type){case"number":return q.default.createElement(s.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{C("value",e,ot(t)?"":t)}});case"date":return q.default.createElement(qe,{popupClassName:pi.popupClassName,defaultValue:null!==(t=Fa(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{C("value",e,Ha(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(n=l.find((t=>t.dataIndex===e.fieldName)))||void 0===n?void 0:n.dictItems)||[];return q.default.createElement(s.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{C("value",e,t)}},t.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(s.Input,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{C("value",e,t.target.value)}})}};return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,u("qm.pivotGrid.filter.title")),!!f.length&&q.default.createElement(s.Select,{value:h,options:x,style:{width:130},onChange:e=>v(e)})),q.default.createElement("div",{className:"list"},n.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},w(e))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:E},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!f.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FilterOutlined,{className:"icon"}),u("qm.pivotGrid.filter.text"),f.length?`(${f.length})`:null))},qs=()=>{const{prefixCls:e,pivotRef:t,columns:l,gridData:n,sorterList:a,setSorterList:r,setGridData:i}=Hs(),{onSorterChange:o}=t.current.props,{t:d}=Xe(),u=q.default.useMemo((()=>a.filter((e=>e.fieldName&&e.order))),[a]),c=q.default.useMemo((()=>l.map((e=>({label:qa(e.title),value:e.dataIndex,disabled:a.some((t=>t.fieldName===e.dataIndex))})))),[a,l]);Ql((()=>{h(),null==o||o(u)}),[q.default.useMemo((()=>u.map((e=>Object.values(e).join(":"))).join(",")),[u])]);const f=[{label:d("qm.pivotGrid.sorter.ascend"),value:"ascend"},{label:d("qm.pivotGrid.sorter.descend"),value:"descend"}],p=(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;i((e=u,n.sort(((t,l)=>{for(const n of e){const{fieldName:e,order:a}=n,r=ka(t,e),i=ka(l,e),o=p(r,i);if(0!==o)return"ascend"===a?o:-o}return 0})).slice(0)))},v=()=>{r([...a,{fieldName:"",order:"ascend"}])},y=(e,t,l)=>{Object.assign(t,{[e]:l}),r([...a])},b=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(s.Select,{value:e.fieldName||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),options:c,style:{width:160,margin:"0 10px"},onChange:t=>y("fieldName",e,t)}),q.default.createElement(s.Select,{value:e.order,options:f,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>y("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(a.filter((t=>t!==e)))})(e)}));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,d("qm.pivotGrid.sorter.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.fieldName)),l=a.map((e=>e.fieldName));m.isEqual(t,l)||r(e)}},a.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},b(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:v},q.default.createElement(g.PlusOutlined,{className:"icon"}),d("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!u.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.SortAscendingOutlined,{className:"icon"}),d("qm.pivotGrid.sorter.text"),u.length?`(${u.length})`:null))},js=()=>{const{prefixCls:e,getRowKey:t,gridData:l,columns:n,searchResults:a,switchIndex:r,setSearchResults:i,setSwitchIndex:o}=Hs(),{t:d}=Xe(),{getTitleFromCellValue:u}=Si(),[c,f]=q.default.useState(!1),p=q.default.useMemo((()=>a.length),[a]);Ql((()=>{c||setTimeout((()=>{o(0),i([])}),200)}),[c]);const m=(e,l)=>{const a=[];return e.forEach(((e,r)=>{n.forEach(((n,i)=>{const o=u(e,n,r,i)+"";o.includes(l)&&a.push({value:o,rowKey:t(e,e.index),dataIndex:n.dataIndex})})),Array.isArray(e.children)&&a.push(...m(e.children,l))})),a},h=wn((e=>{const t=e.target.value.trim();o(0),i(t?m(l,t):[])}),200),v=e=>{const{keyCode:t}=e;e.preventDefault(),13===t&&y()},y=()=>{if(!p)return;o((r+1)%p)},b=()=>q.default.createElement("div",{className:"search-switch"},q.default.createElement("button",{className:"button-icon",onClick:()=>(()=>{if(!p)return;o((r-1+p)%p)})()},q.default.createElement(g.LeftOutlined,null)),q.default.createElement("span",{className:"num"},p>0?r+1:r,"/",p),q.default.createElement("button",{className:"button-icon",onClick:()=>y()},q.default.createElement(g.RightOutlined,null)));return q.default.createElement(s.Dropdown,{open:c,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,d("qm.pivotGrid.search.title")),q.default.createElement("button",{className:"button-icon",onClick:()=>f(!1)},q.default.createElement(g.CloseOutlined,null))),q.default.createElement("div",{className:"list search",style:{margin:"10px 0"}},q.default.createElement(s.Input,{autoFocus:!0,style:{width:280},suffix:b(),onChange:h,onKeyUp:v}))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300},destroyPopupOnHide:!0},q.default.createElement("span",{onClick:()=>f(!c)},q.default.createElement(g.MonitorOutlined,{className:"icon"}),d("qm.pivotGrid.search.text")))},Ks=(e,t)=>e.map((e=>(e.children&&(e.children=Ks(e.children,t)),t(e)))),Vs=()=>{const{prefixCls:e,pivotRef:t,columns:l,setColumns:n}=Hs(),{uniqueKey:a,onColumnsChange:r}=t.current.props,{t:i}=Xe(),o=q.default.useMemo((()=>a?`grid_field_${a}`:""),[a]);q.default.useLayoutEffect((()=>{d()}),[]),Ql((()=>{c(l)}),[l]);const d=()=>{const e=f();e&&(null==r||r(e))},u=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=u(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)})),c=e=>{if(!o)return;const t=u(e),l=JSON.parse(localStorage.getItem(o));m.isEqual(t,l)||localStorage.setItem(o,JSON.stringify(t))},f=()=>{if(!o)return;const e=JSON.parse(localStorage.getItem(o));if(!e)return;return m.xor(e.map((e=>e.dataIndex)),l.map((e=>e.dataIndex))).length>0?Ks(l,(t=>{const l=e.find((e=>e.dataIndex===t.dataIndex));return l&&(void 0!==l.hidden&&(t.hidden=l.hidden),void 0!==l.fixed&&(t.fixed=l.fixed),void 0!==l.width&&(t.width=l.width),void 0!==l.renderWidth&&(t.renderWidth=l.renderWidth)),t})):Ks(e,(e=>{const t=l.find((t=>t.dataIndex===e.dataIndex));return t&&void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},p=q.default.useMemo((()=>{let e=0;for(let t=0;t<l.length-1&&("left"!==l[t].fixed||l[t+1].fixed||(e=t+1),!(e>0));t++);const t=[];for(let n=0;n<l.length;n++)n===e&&t.push({title:"",dataIndex:"__divider__"}),t.push(l[n]);return t}),[l]),h=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container","scroll-y"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,i("qm.pivotGrid.field.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".handle",tag:"ul",animation:200,list:p,setList:e=>{const t=e.map((e=>e.dataIndex)),l=p.map((e=>e.dataIndex));m.isEqual(t,l)||(e=>{const t=e.findIndex((e=>"__divider__"===e.dataIndex)),l=[];for(let n=0;n<e.length;n++){const a=e[n];n<t?a.fixed="left":delete a.fixed,n!==t&&l.push(a)}n(l),null==r||r(l)})(Ya(e))}},p.map((e=>"__divider__"!==e.dataIndex?q.default.createElement("li",{key:e.dataIndex,className:"ant-dropdown-menu-item sort-item"},q.default.createElement(g.HolderOutlined,{className:"handle"}),q.default.createElement("span",{className:"label"},q.default.createElement("span",{className:"title"},qa(e.title)),q.default.createElement("button",{className:"button-icon",onClick:()=>(e=>{e.hidden=!e.hidden;const t=[...l];n(t),null==r||r(t)})(e)},e.hidden?q.default.createElement(g.EyeInvisibleOutlined,null):q.default.createElement(g.EyeOutlined,null)))):q.default.createElement("li",{key:e.dataIndex,className:"divider"}))))));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>h(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:240}},q.default.createElement("span",null,q.default.createElement(g.SettingOutlined,{className:"icon"}),i("qm.pivotGrid.field.text")))},zs=()=>{const{prefixCls:e,size:t,setContext:l}=Hs(),{t:n}=Xe(),a=[{label:n("qm.pivotGrid.lineHeight.size")[0],value:"small"},{label:n("qm.pivotGrid.lineHeight.size")[1],value:"middle"},{label:n("qm.pivotGrid.lineHeight.size")[2],value:"large"}];return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},a.map((e=>q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t===e.value}),onClick:()=>l({size:e.value})},q.default.createElement("span",{className:"label"},e.label),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null))))))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:160}},q.default.createElement("span",null,q.default.createElement(g.ColumnHeightOutlined,{className:"icon"}),n("qm.pivotGrid.lineHeight.text")))},Ws="606060",Bs="thin",Us="d4d4d4",Gs=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Ys=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Xs=()=>({top:{style:Bs,color:{argb:Us}},left:{style:Bs,color:{argb:Us}},bottom:{style:Bs,color:{argb:Us}},right:{style:Bs,color:{argb:Us}}}),Qs=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},Zs=()=>{const{prefixCls:e,pivotRef:t,columns:l,countMethod:n,summationData:a}=Hs(),{t:r}=Xe(),{exportXLSX:i}=(()=>{const{size:e}=Hs(),{t:t}=Xe(),{rowHeightMaps:l}=pi,n=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(n,a,r,i)=>Ye(void 0,void 0,void 0,(function*(){const{columns:o,footSummation:s}=n,d=l[e],u=pa(o),c=[],f=[],p=[];let m=0;const h={};u.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;h[t]=qa(e.title),p.push({key:t,width:(l||n)/8})})),c.push(h),m+=c.length;const g=a.map(((e,t)=>{const l={};return u.forEach(((n,a)=>{const r=["percent","finance"].includes(n.formatType);l[n.dataIndex]=r?ka(e,n.dataIndex):i(e,t,n,a)})),l._level=e._level,l._groupLevel=e._groupLevel,l}));m+=g.length,s&&r(u,a).forEach(((e,l)=>{const n={};u.forEach(((l,r)=>{const{dataIndex:i,summation:o}=l,s=(null==o?void 0:o.render)?o.render(a):ka(e,i);n[i]=0===r&&""===s?t("qm.table.config.summaryText"):et(s)?$a(s).join(""):s})),f.push(n)}));const{sheetName:v,useStyle:y}=n,b=new ce.default.Workbook,x=b.addWorksheet(v);x.columns=p,x.addRows(c).forEach((e=>{y&&Gs(e,d),e.eachCell((e=>{const t=x.getColumn(e.col),l=va(o,t.key),{align:n,theadAlign:a}=l;Ys(e,a||n),y&&Object.assign(e,{font:{bold:!0,color:{argb:Ws}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Xs()})}))})),x.addRows(g).forEach(((e,t)=>{const{_level:l,_groupLevel:n}=g[t];y&&Gs(e,d),e.eachCell(((e,t)=>{const a=x.getColumn(e.col),r=va(o,a.key),{align:i}=r;Ys(e,1===t||void 0===n?i:"right"),Object.assign(e,Qs(r)),y&&Object.assign(e,{font:{color:{argb:Ws}},border:Xs()}),1===Number(e.col)&&l&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:l}))}))})),s&&x.addRows(f).forEach((e=>{y&&Gs(e,d),e.eachCell(((e,t)=>{const l=x.getColumn(e.col),n=va(o,l.key),{align:a}=n;Ys(e,1===t?a:"right"),Object.assign(e,Qs(n)),y&&Object.assign(e,{font:{color:{argb:Ws}},border:Xs()})}))})),[].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,l)=>{const{columns:a,file:r}=e,i=pa(a),o=new FileReader;o.onerror=()=>{s.message.error(t("qm.table.import.error"))},o.onload=e=>{const a=i.map((e=>qa(e.title))),r=new ce.default.Workbook,o=e.target;o?r.xlsx.load(o.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),o=e.findIndex((e=>e&&e.length>0)),d=e[o],u=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(a,d);if(u){const t=e.slice(o+1).map((e=>{const t={};e.forEach(((e,l)=>{var n;let a=e;Array.isArray(null==a?void 0:a.richText)&&(a=a.richText.map((e=>e.text)).join("")),m.isPlainObject(a)&&"text"in a&&(a=a.text),m.isDate(a)&&(a=Ha(a,ni)),(null==a?void 0:a.formula)&&(a=null!==(n=a.result)&&void 0!==n?n:a.value),t[d[l]]=a}));const l={};return a.forEach(((e,a)=>{var r;const{dataIndex:o,dictItems:s}=i[a];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>n(s,e))).filter((e=>""!==e)):t[e]=n(s,t[e])),La(l,o,t[e])})),l}));null==l||l(t)}else s.message.error(t("qm.table.import.error"))}else s.message.error(t("qm.table.import.error"))})):s.message.error(t("qm.table.import.error"))},o.readAsArrayBuffer(r)}}})(),{getTitleFromCellValue:o}=Si(),d=[{text:r("qm.pivotGrid.count.records"),value:"count"},{text:r("qm.pivotGrid.count.unique"),value:"unique"},{text:r("qm.pivotGrid.count.empty"),value:"empty"},{text:r("qm.pivotGrid.count.notEmpty"),value:"notEmpty"},{text:r("qm.pivotGrid.count.sum"),value:"sum"},{text:r("qm.pivotGrid.count.max"),value:"max"},{text:r("qm.pivotGrid.count.min"),value:"min"},{text:r("qm.pivotGrid.count.avg"),value:"avg"}],u={columns:ma(l),fileName:j.default().format(ai),fileType:"xlsx",sheetName:"sheet1",footSummation:!1,useStyle:!1},c=(e,t,l,n)=>{const{dataIndex:a,precision:r,formatType:i}=l;if(Rs(e))return ka(e,a);let s=o(e,l,t,n);return r>=0&&!i&&""!==s&&(s=Number(s)),s},f=()=>{if(!n||!Object.keys(n).length)return[];const e={};return u.columns.map((e=>e.dataIndex)).forEach(((t,l)=>{if(l>0){let l="";(null==n?void 0:n[t])&&(l=d.find((e=>e.value===n[t])).text+" "+a.total[t]),La(e,t,l)}})),[e]},p=e=>Ye(void 0,void 0,void 0,(function*(){const t=yield i(Object.assign(Object.assign({},u),{footSummation:!!Object.keys(n).length}),e,f,c);Fn(t,`${j.default().format(ai)}.xlsx`)})),h=[{key:"1",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.FolderOutlined,{style:{marginRight:4}})," ",r("qm.pivotGrid.export.group")),onClick:()=>{p((()=>{const e=[];let r=0;return t.current.flatGroupData.forEach((t=>{const i=Object.assign({},t);Rs(t)?(i._level=t._groupLevel,u.columns.map((e=>e.dataIndex)).forEach(((e,r)=>{if(0===r)La(i,e,o(t._record,l.find((e=>e.dataIndex===t._fieldName)),0,0));else{let l="";(null==n?void 0:n[e])&&(l=d.find((t=>t.value===n[e])).text+" "+ks(a,t.id).subtotal[e]),La(i,e,l)}})),r=t._groupLevel):r>0&&(i._level=t._level+r+1),e.push(i)})),e})())}},{key:"2",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.BarsOutlined,{style:{marginRight:4}})," ",r("qm.pivotGrid.export.list")),onClick:()=>{p(Array.from(t.current.keyRecordMap.values()))}}];return q.default.createElement(s.Dropdown,{trigger:["click"],menu:{items:h},className:J.default("action-btn"),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:140}},q.default.createElement("span",null,q.default.createElement(g.DownloadOutlined,{className:"icon"}),r("qm.pivotGrid.export.text")))},Js=()=>{const{prefixCls:e,pivotRef:t,groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i,setContext:o}=Hs(),{uniqueKey:d}=t.current.props,{t:u}=Xe(),c=q.default.useMemo((()=>d?`grid_conf_${d}`:""),[d]),f=q.default.useRef({}),[p,m]=q.default.useState([]),[h,v]=q.default.useState({}),[y,b]=q.default.useState(""),x=(e,t)=>{v((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))};q.default.useLayoutEffect((()=>{E()}),[]),Ql((()=>{C()}),[p]);const E=()=>Ye(void 0,void 0,void 0,(function*(){try{if(!c)return;const e=yield fe.default.getItem(c);Array.isArray(e)&&(m(e),v(e.reduce(((e,t)=>(t.id&&(e[t.id]=!1),e)),{})))}catch(e){}})),C=()=>Ye(void 0,void 0,void 0,(function*(){try{if(!c)return;yield fe.default.setItem(c,p)}catch(e){}})),w=()=>{const e=Ma();m([{id:e,label:j.default().format(ai),value:{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}},...p]),rt((()=>x(e,!0)))},S=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,u("qm.pivotGrid.saved.title"))),q.default.createElement("div",{className:"list"},q.default.createElement("ul",null,p.map((e=>q.default.createElement("li",{key:e.id,className:J.default("ant-dropdown-menu-item sort-item",{active:e.id===y}),onClick:()=>(e=>{if(h[e.id])return;const t=y!==e.id,l=t?e.value:f.current;o({groupList:l.groupList,filterList:l.filterList,sorterList:l.sorterList,colorList:l.colorList,countMethod:l.countMethod}),b(t?e.id:"")})(e)},q.default.createElement("div",{className:"label",style:{width:200}},h[e.id]?q.default.createElement(s.Input,{size:"small",autoFocus:!0,defaultValue:e.label,style:{width:"100%",marginLeft:-8},onBlur:t=>{const{value:l}=t.target;l!==e.label&&(e.label=l,m([...p])),x(e.id,!1)}}):q.default.createElement("span",null,e.label)),q.default.createElement("button",{className:"button-icon",onClick:t=>{t.stopPropagation(),x(e.id)}},h[e.id]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),q.default.createElement("button",{className:"button-icon",style:{marginLeft:4},onClick:t=>{var l;t.stopPropagation(),l=e.id,m(p.filter((e=>e.id!==l)))}},q.default.createElement(g.CloseOutlined,null))))))),q.default.createElement("div",{className:"add-record",style:{padding:10}},q.default.createElement("span",{className:"insert",onClick:w},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.saved.add"))));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>S(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomRight",overlayStyle:{minWidth:280},onOpenChange:e=>{var t;t=e?{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}:{},f.current=t}},q.default.createElement("span",null,q.default.createElement(g.SaveOutlined,{className:"icon"}),u("qm.pivotGrid.saved.text")))},ed=()=>{const{gridData:e}=Hs(),{t:t}=Xe();return q.default.createElement("div",{className:"alert-info"},q.default.createElement(g.InfoCircleOutlined,{className:"icon"}),t("qm.table.alert.total",{total:(()=>{let t=0;return function e(l){l.forEach((l=>{Array.isArray(l.children)&&e(l.children),t+=1}))}(e),t})()}))},td=8;const ld={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"]}},nd={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"]}},ad=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function rd(e){const{arrowWidth:t,autoAdjustOverflow:l,arrowPointAtCenter:n,offset:a,borderRadius:r,visibleFirst:i}=e,o=t/2,s={};return Object.keys(ld).forEach((e=>{const d=n&&nd[e]||ld[e],u=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(s[e]=u,ad.has(e)&&(u.autoArrow=!1),e){case"top":case"topLeft":case"topRight":u.offset[1]=-o-a;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=o+a;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-o-a;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=o+a}const c=function(e){const{contentRadius:t,limitVerticalRadius:l}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:l?td:n}}({contentRadius:r,limitVerticalRadius:!0});if(n)switch(e){case"topLeft":case"bottomLeft":u.offset[0]=-c.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":u.offset[0]=c.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":u.offset[1]=2*-c.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":u.offset[1]=2*c.arrowOffsetHorizontal-o}u.overflow=function(e,t,l,n){if(!1===n)return{adjustX:!1,adjustY:!1};const a=n&&"object"==typeof n?n:{},r={};switch(e){case"top":case"bottom":r.shiftX=2*t.arrowOffsetHorizontal+l,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=2*t.arrowOffsetVertical+l,r.shiftX=!0,r.adjustX=!0}const i=Object.assign(Object.assign({},r),a);return i.shiftX||(i.adjustX=!0),i.shiftY||(i.adjustY=!0),i}(e,c,t,l),i&&(u.htmlRegion="visibleFirst")})),s}const id=e=>{const{value:t,defaultValue:l,disabled:n,disabledAlpha:a,className:r,style:i,onChange:o,onChangeComplete:s}=e,[d,u]=hi("",{value:t,defaultValue:l}),c=e=>({hex:e.toHexString(),rgb:e.toRgbString(),hsb:e.toHsbString()}),f=rd({offset:0,arrowWidth:16,borderRadius:6}),p=yt("color-picker");return q.default.createElement(pe.default,{action:["click"],prefixCls:p,popupPlacement:"bottomLeft",builtinPlacements:f,popup:()=>q.default.createElement(me.default,{prefixCls:p,value:d,disabled:n,disabledAlpha:a,onChange:(e,t)=>{u(e.toRgbString()),null==o||o(c(e),t)},onChangeComplete:(e,t)=>{null==s||s(c(e),t)}})},q.default.createElement("div",{className:J.default(`${p}-btn`,r),style:i},q.default.createElement(L.ColorBlock,{color:d,prefixCls:p})))};id.displayName="ColorPicker";const od=()=>{const{prefixCls:e,pivotRef:t,getRowKey:l,columns:n,colorList:a,setColorList:r,setFillColor:i}=Hs(),{flatGroupData:o}=t.current,{t:d}=Xe(),u=q.default.useRef([]),c=q.default.useMemo((()=>a.filter((e=>e.fieldName&&e.color&&("nil"===e.expression||!ot(e.value)||"col"===e.mode)))),[a]),f=q.default.useMemo((()=>n.map((e=>({label:qa(e.title),value:e.dataIndex})))),[n]),p=q.default.useMemo((()=>Is(n)),[n]),h=[{label:d("qm.pivotGrid.fillColor.cell"),value:"cell"},{label:d("qm.pivotGrid.fillColor.row"),value:"row"},{label:d("qm.pivotGrid.fillColor.col"),value:"col"}];Ql((()=>{v()}),[q.default.useMemo((()=>{const e=c.map((e=>{var t;return{[e.color]:`${e.mode},${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}}));return m.isEqual(e,u.current)?u.current:(u.current=e,e)}),[c])]);const v=wn((()=>{const e=[];c.forEach((t=>{const n=Ka([Object.assign(Object.assign({},dt(t,["value"])),{expression:"nil"!==t.expression?t.expression:"==",condition:t.value})]),a=fa(o.filter((e=>!Rs(e))),n);if("cell"===t.mode||"col"===t.mode)for(let n=0;n<a.length;n++)e.push({color:t.color,rowKey:l(a[n],a[n].index),dataIndex:t.fieldName});if("row"===t.mode)for(let n=0;n<a.length;n++){const r=l(a[n],a[n].index);for(let l=0;l<p.length;l++)e.push({color:t.color,rowKey:r,dataIndex:p[l].dataIndex})}})),i(e)}),200),y=()=>{r([...a,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:"and",color:"",mode:"cell"}])},b=(e,t,l)=>{var i;if(Object.assign(t,{[e]:l}),"fieldName"===e){const e=(null===(i=n.find((e=>e.dataIndex===l)).filter)||void 0===i?void 0:i.type)||"text";Object.assign(t,{type:e,expression:x(e)[0].value,value:""})}"expression"===e&&"nil"===l&&Object.assign(t,{value:""}),r([...a])},x=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},E=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(id,{defaultValue:e.color,style:{marginLeft:5},onChangeComplete:t=>b("color",e,t.hex)}),q.default.createElement(s.Select,{value:e.mode,options:h,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:90,marginLeft:10,marginRight:20},onChange:t=>b("mode",e,t)}),q.default.createElement(s.Select,{value:e.fieldName||void 0,options:f,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>b("fieldName",e,t)}),"col"!==e.mode&&q.default.createElement(s.Select,{value:e.expression||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),options:x(e.type),style:{width:100,margin:"0 10px"},onChange:t=>b("expression",e,t)}),"col"!==e.mode&&(e=>{var t,l;switch(e.type){case"number":return q.default.createElement(s.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{b("value",e,ot(t)?"":t)}});case"date":return q.default.createElement(qe,{popupClassName:pi.popupClassName,defaultValue:null!==(t=Fa(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{b("value",e,Ha(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(l=n.find((t=>t.dataIndex===e.fieldName)))||void 0===l?void 0:l.dictItems)||[];return q.default.createElement(s.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{b("value",e,t)}},t.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(s.Input,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{b("value",e,t.target.value)}})}})(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(a.filter((t=>t!==e)))})(e)}));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,d("qm.pivotGrid.fillColor.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.fieldName)),l=a.map((e=>e.fieldName));m.isEqual(t,l)||r(e)}},a.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},E(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:y},q.default.createElement(g.PlusOutlined,{className:"icon"}),d("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!c.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.BgColorsOutlined,{className:"icon"}),d("qm.pivotGrid.fillColor.text"),c.length?`(${c.length})`:null))},sd=()=>q.default.createElement("div",{className:"top-bar"},q.default.createElement(vt,{size:4},q.default.createElement(ed,null),q.default.createElement(s.Divider,{type:"vertical"}),q.default.createElement(Vs,null),q.default.createElement(Ms,null),q.default.createElement($s,null),q.default.createElement(qs,null),q.default.createElement(s.Divider,{type:"vertical"}),q.default.createElement(zs,null),q.default.createElement(od,null),q.default.createElement(js,null),q.default.createElement(s.Divider,{type:"vertical"}),q.default.createElement(Zs,null)),q.default.createElement(vt,{size:4},q.default.createElement(Js,null))),dd=q.default.createContext(void 0),ud=e=>{var t,l;const{scrollbar:n}=e,{pivotRef:a,getRowKey:r,columns:i,groupGridData:o,setPivotGridRef:s}=Hs(),{rowSelection:d,treeExpandable:u,rowHighlight:c}=a.current.props,f=null===(t=null==u?void 0:u.defaultExpandAllRows)||void 0===t||t,p=q.default.useRef({bodyEl:null,rowVirtualizer:null}),[m,h]=q.default.useState({gridRef:p,scrollbarRef:n,selectionKeys:null!==(l=null==d?void 0:d.defaultSelectedRowKeys)&&void 0!==l?l:[],treeExpandKeys:f?wa(a.current.originGridData,(e=>r(e,e.index))):[],highlightKey:"",checkedColumnKey:"",updateLayout:0,clicked:[],isPingLeft:!1}),g=q.default.useMemo((()=>Math.max(0,Ls(o)-1)),[o]),v=e=>{h((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))},y=(e,t)=>{m.gridRef.current[e]=t};q.default.useLayoutEffect((()=>{T(),w()}),[i]),q.default.useLayoutEffect((()=>{(null==d?void 0:d.selectedRowKeys)&&v({selectionKeys:d.selectedRowKeys})}),[null==d?void 0:d.selectedRowKeys]),q.default.useLayoutEffect((()=>{void 0!==(null==c?void 0:c.currentRowKey)&&v({highlightKey:c.currentRowKey})}),[null==c?void 0:c.currentRowKey]);const b=e=>{Array.isArray(null==d?void 0:d.selectedRowKeys)||v({selectionKeys:e})},x=e=>{v({treeExpandKeys:e})},E=e=>{void 0===(null==c?void 0:c.currentRowKey)&&v({highlightKey:e})},C=e=>{v({checkedColumnKey:e})},w=()=>{v({updateLayout:m.updateLayout+1})},S=e=>{Xa(e,m.clicked,!0)||v({clicked:e})},N=e=>{v({isPingLeft:e})},T=()=>{const e=n.current.container.clientWidth,{defaultColumnWidth:t}=pi,l=[];let a=0;if(i.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,a+=e.width):(e.renderWidth=void 0,l.push(e))})),l.length>0){const n=i.reduce(((e,l)=>e+(l.width||l.minWidth||t)),0);if(n<=e){const a=e-n;if(1===l.length)l[0].renderWidth=(l[0].minWidth||t)+a;else{const e=a/l.reduce(((e,l)=>e+(l.minWidth||t)),0);let n=0;l.forEach(((l,a)=>{if(0===a)return;const r=Math.floor((l.minWidth||t)*e);n+=r,l.renderWidth=(l.minWidth||t)+r})),l[0].renderWidth=(l[0].minWidth||t)+a-n}}else l.forEach((e=>{e.renderWidth=e.minWidth||t}))}else a=i.reduce(((e,l)=>e+(l.renderWidth=l.width||l.minWidth||t)),0)},I=q.default.useMemo((()=>Object.assign(Object.assign({},m),{indentDepth:g,setContext:v,setGridLayoutRef:y,setSelectionKeys:b,setTreeExpandKeys:x,setHighlightKey:E,setCheckColumnKey:C,forceUpdateLayout:w,setClicked:S,setPingLeft:N,updateColumnsWidth:T})),[m,g]);return q.default.createElement(dd.Provider,{value:I},e.children)},cd=()=>q.default.useContext(dd),fd=e=>{var t;const{column:l}=e,{columns:n,setColumns:a}=Hs(),{scrollbarRef:r}=cd(),i=q.default.useRef(null),[o,s]=q.default.useState(!1),d=q.default.useRef(document.onselectstart),u=q.default.useRef({startX:0,originSizeX:0,columnWidth:0}),c=e=>{u.current=Object.assign({},u.current,e)},f=e=>{if(1!==e.buttons)return p();const t=e.clientX-u.current.startX,n=(l.width||l.renderWidth)+t;n<(l.minWidth||pi.defaultColumnWidth)||(c({columnWidth:n}),i.current.style.left=`${u.current.originSizeX+t}px`)},p=()=>{r.current.container.style.cursor="",l.width=u.current.columnWidth,a([...n]),rt((()=>s(!1))),Jl(document,"mousemove",f),Jl(document,"mouseup",p),c({startX:0,originSizeX:0,columnWidth:0}),m()},m=()=>{document.onselectstart!==d.current&&(document.onselectstart=d.current)};return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"resize-bar",onMouseDown:e=>{e.preventDefault(),r.current.container.style.cursor="col-resize";const t=Ia(e.target,r.current.container).left-r.current.scrollLeft+3;c({startX:e.clientX,originSizeX:t,columnWidth:l.width||l.renderWidth||0}),Zl(document,"mousemove",f),Zl(document,"mouseup",p),s(!0),rt((()=>i.current.style.left=`${t}px`)),d.current=document.onselectstart,document.onselectstart=()=>!1}}),q.default.createElement(he.default,{open:o,getContainer:null===(t=r.current)||void 0===t?void 0:t.container},q.default.createElement("div",{ref:i,className:"resize-line"})))},pd=e=>{var t;const{left:l}=e,{scrollbarRef:n,isPingLeft:a,setPingLeft:r}=cd(),i=Qe((e=>{r(e.target.scrollLeft>1)}));return q.default.useEffect((()=>{const e=n.current.container.children[0];return e.addEventListener("scroll",i),()=>{e.removeEventListener("scroll",i)}}),[]),q.default.createElement(he.default,{open:!0,getContainer:null===(t=n.current)||void 0===t?void 0:t.container},q.default.createElement("div",{className:J.default("fixed-line",{active:a}),style:{left:l}}))},md=()=>{const{pivotRef:e,columns:t}=Hs(),{indentDepth:l,updateLayout:n,checkedColumnKey:a,selectionKeys:r,setSelectionKeys:i,setCheckColumnKey:o}=cd(),{rowSelection:d}=e.current.props,{selectionColumn:u}=pi,{indentWidth:c,selectionColumnDefine:f}=Ts,p=q.default.useMemo((()=>Is(t)),[t]),m=q.default.useMemo((()=>p.filter((e=>"left"===e.fixed))),[p]),h=q.default.useMemo((()=>p.filter((e=>"left"!==e.fixed))),[p]),g=q.default.useMemo((()=>"radio"!==(null==d?void 0:d.type)),[d]),v=q.default.useMemo((()=>m.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?l*c:0)),0)),[l,n,m]),y=q.default.useMemo((()=>r.length>0&&r.length===e.current.keyRecordMap.size),[r]),b=q.default.useMemo((()=>r.length>0&&r.length<e.current.keyRecordMap.size),[r]),x=(t,n)=>q.default.createElement("div",{className:J.default(n?"fixed-left":"no-fixed"),style:{width:n?v:""}},t.map(((r,p)=>{const{dataIndex:m,title:h,align:v,width:x,renderWidth:E}=r,C={"selection-column":m===u,"col--center":"center"===v,"col--right":"right"===v,"col--checked":a===m},w=n&&1===p||!n&&p===t.length-1?l*c:0,S={width:`${(x||E||0)+w}px`,minWidth:`${(x||E||0)+w}px`};return q.default.createElement("div",{key:m,className:J.default("table-cell",C),style:S,onClick:()=>{return e=m,void([f.dataIndex].includes(e)||o(a!==e?e:""));var e}},m!==u?q.default.createElement("span",{className:"cell"},h):d&&g?q.default.createElement(s.Checkbox,{checked:y,indeterminate:b,onChange:t=>(t=>{var l;const n=t?Array.from(e.current.keyRecordMap.keys()):[];i(n),null===(l=null==d?void 0:d.onChange)||void 0===l||l.call(d,n,t?Array.from(e.current.keyRecordMap.values()):[])})(t.target.checked)}):"#",m!==u&&q.default.createElement(fd,{column:r}))})));return q.default.createElement("div",{className:"header"},x(m,!0),(e=>x(e))(h),q.default.createElement(pd,{left:v}))};function hd(e,t,l){var n;let a,r=null!==(n=l.initialDeps)&&void 0!==n?n:[];function i(){var n,i,o,s,d;let u;l.key&&(null===(n=l.debug)||void 0===n?void 0:n.call(l))&&(u=Date.now());const c=e(),f=c.length!==r.length||c.some(((e,t)=>r[t]!==e));if(!(null===(i=l.noCache)||void 0===i?void 0:i.call(l))&&!f)return a;let p;if(r=c,l.key&&(null===(o=l.debug)||void 0===o?void 0:o.call(l))&&(p=Date.now()),a=t(...c),l.key&&(null===(s=l.debug)||void 0===s?void 0:s.call(l))){const e=Math.round(100*(Date.now()-u))/100,t=Math.round(100*(Date.now()-p))/100,n=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} / ${a(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==l?void 0:l.key)}return null===(d=null==l?void 0:l.onChange)||void 0===d||d.call(l,a),a}return i.updateDeps=e=>{r=e},i}function gd(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const vd=(e,t,l)=>{let n;return function(...a){e.clearTimeout(n),n=e.setTimeout((()=>t.apply(this,a)),l)}},yd=e=>e,bd=e=>{const t=Math.max(e.startIndex-e.overscan,0),l=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let e=t;e<=l;e++)n.push(e);return n},xd=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;const a=e=>{const{width:l,height:n}=e;t({width:Math.round(l),height:Math.round(n)})};if(a(l.getBoundingClientRect()),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void a({width:e.inlineSize,height:e.blockSize})}a(l.getBoundingClientRect())}));return r.observe(l,{box:"border-box"}),()=>{r.unobserve(l)}},Ed={passive:!0},Cd="undefined"==typeof window||"onscrollend"in window,wd=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;let a=0;const r=e.options.useScrollendEvent&&Cd?()=>{}:vd(n,(()=>{t(a,!1)}),e.options.isScrollingResetDelay),i=n=>()=>{const{horizontal:i,isRtl:o}=e.options;a=i?l.scrollLeft*(o?-1:1):l.scrollTop,r(),t(a,n)},o=i(!0),s=i(!1);return s(),l.addEventListener("scroll",o,Ed),l.addEventListener("scrollend",s,Ed),()=>{l.removeEventListener("scroll",o),l.removeEventListener("scrollend",s)}},Sd=(e,t,l)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[l.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(e.getBoundingClientRect()[l.options.horizontal?"width":"height"])},Nd=(e,{adjustments:t=0,behavior:l},n)=>{var a,r;const i=e+t;null===(r=null===(a=n.scrollElement)||void 0===a?void 0:a.scrollTo)||void 0===r||r.call(a,{[n.options.horizontal?"left":"top"]:i,behavior:l})};class Td{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 l;null===(l=t())||void 0===l||l.disconnect(),e=null},observe:e=>{var l;return null===(l=t())||void 0===l?void 0:l.observe(e,{box:"border-box"})},unobserve:e=>{var l;return null===(l=t())||void 0===l?void 0:l.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,l])=>{void 0===l&&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:yd,rangeExtractor:bd,onChange:()=>{},measureElement:Sd,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,l;null===(l=(t=this.options).onChange)||void 0===l||l.call(t,this,e)},this.maybeNotify=hd((()=>(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 l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l)return void this.maybeNotify();this.scrollElement=l,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 l=new Map,n=new Map;for(let a=t-1;a>=0;a--){const t=e[a];if(l.has(t.lane))continue;const r=n.get(t.lane);if(null==r||t.end>r.end?n.set(t.lane,t):t.end<r.end&&l.set(t.lane,!0),l.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=hd((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,l,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a})),{key:!1}),this.getMeasurements=hd((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a},r)=>{if(!a)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 i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const o=this.measurementsCache.slice(0,i);for(let a=i;a<e;a++){const e=n(a),i=1===this.options.lanes?o[a-1]:this.getFurthestMeasurement(o,a),s=i?i.end+this.options.gap:t+l,d=r.get(e),u="number"==typeof d?d:this.options.estimateSize(a),c=s+u,f=i?i.lane:a%this.options.lanes;o[a]={index:a,start:s,size:u,end:c,key:e,lane:f}}return this.measurementsCache=o,o}),{key:"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=hd((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,l)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:l}){const n=e.length-1,a=t=>e[t].start,r=Id(0,n,a,l);let i=r;for(;i<n&&e[i].end<l+t;)i++;return{startIndex:r,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:l}):null),{key:"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=hd((()=>{let e=null,t=null;const l=this.calculateRange();return l&&(e=l.startIndex,t=l.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,l,n,a)=>null===n||null===a?[]:e({startIndex:n,endIndex:a,overscan:t,count:l})),{key:"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,l=e.getAttribute(t);return l?parseInt(l,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const l=this.indexFromElement(e),n=this.measurementsCache[l];if(!n)return;const a=n.key,r=this.elementsCache.get(a);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(l,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var l;const n=this.measurementsCache[e];if(!n)return;const a=t-(null!==(l=this.itemSizeCache.get(n.key))&&void 0!==l?l:n.size);0!==a&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,a,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&(this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.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=hd((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const l=[];for(let n=0,a=e.length;n<a;n++){const a=t[e[n]];l.push(a)}return l}),{key:"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return gd(t[Id(0,t.length-1,(e=>gd(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const l=this.getSize(),n=this.getScrollOffset();"auto"===t&&e>=n+l&&(t="end"),"end"===t&&(e-=l);const a=this.options.horizontal?"scrollWidth":"scrollHeight",r=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-l;return Math.max(Math.min(r,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const l=this.measurementsCache[e];if(!l)return;const n=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(l.end>=a+n-this.options.scrollPaddingEnd)t="end";else{if(!(l.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}const r=l.start-this.options.scrollPaddingStart+(l.size-n)/2;switch(t){case"center":return[this.getOffsetForAlignment(r,t),t];case"end":return[this.getOffsetForAlignment(l.end+this.options.scrollPaddingEnd,t),t];default:return[this.getOffsetForAlignment(l.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:l}={})=>{this.cancelScrollToIndex(),"smooth"===l&&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:l})},this.scrollToIndex=(e,{align:t="auto",behavior:l}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===l&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(e,t);if(!n)return;const[a,r]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:l}),"smooth"!==l&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const[a]=gd(this.getOffsetForIndex(e,r));t=a,n=this.getScrollOffset(),Math.abs(t-n)<1||this.scrollToIndex(e,{align:r,behavior:l})}else this.scrollToIndex(e,{align:r,behavior:l});var t,n})))},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 l=this.getMeasurements();let n;return n=0===l.length?this.options.paddingStart:1===this.options.lanes?null!==(t=null===(e=l[l.length-1])||void 0===e?void 0:e.end)&&void 0!==t?t:0:Math.max(...l.slice(-this.options.lanes).map((e=>e.end))),Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:l})=>{this.options.scrollToFn(e,{behavior:l,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Id=(e,t,l,n)=>{for(;e<=t;){const a=(e+t)/2|0,r=l(a);if(r<n)e=a+1;else{if(!(r>n))return a;t=a-1}}return e>0?e-1:0};const Od="undefined"!=typeof document?q.default.useLayoutEffect:q.default.useEffect,Rd=e=>(e=>{const t=q.default.useReducer((()=>({})),{})[1],l=Object.assign(Object.assign({},e),{onChange:(l,n)=>{var a;n?v.flushSync(t):t(),null===(a=e.onChange)||void 0===a||a.call(e,l,n)}}),[n]=q.default.useState((()=>new Td(l)));return n.setOptions(l),Od((()=>n._didMount()),[]),Od((()=>n._willUpdate())),n})(Object.assign({observeElementRect:xd,observeElementOffset:wd,scrollToFn:Nd},e)),kd=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Ld=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),Pd=(e,t)=>{var l;const n=e.target;return!("button"in e&&e.button>0)&&(!(n&&!kd(n).contains(n))&&!(null===(l=t.current)||void 0===l?void 0:l.contains(n)))};function Ad({ref:e,handler:t,enabled:l=!0,omitClassNames:n=[]}){const a=Qe(t),r=$.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});$.useEffect((()=>{if(!l)return;const i=t=>{Pd(t,e)&&(r.current.isPointerDown=!0)},o=l=>{r.current.ignoreEmulatedMouseEvents?r.current.ignoreEmulatedMouseEvents=!1:t&&r.current.isPointerDown&&Pd(l,e)&&Ld(l,n)&&(r.current.isPointerDown=!1,a(l))},s=l=>{r.current.ignoreEmulatedMouseEvents=!0,t&&r.current.isPointerDown&&Pd(l,e)&&Ld(l,n)&&(r.current.isPointerDown=!1,a(l))},d=kd(e.current);return d.addEventListener("mousedown",i,!0),d.addEventListener("mouseup",o,!0),d.addEventListener("touchstart",i,!0),d.addEventListener("touchend",s,!0),()=>{d.removeEventListener("mousedown",i,!0),d.removeEventListener("mouseup",o,!0),d.removeEventListener("touchstart",i,!0),d.removeEventListener("touchend",s,!0)}}),[t,e,a,r,l])}const Dd=e=>{const{pivotRef:t,getRowKey:l,size:n}=Hs(),{scrollbarRef:a,clicked:r,setHighlightKey:i,setClicked:o}=cd(),{flatGroupData:s}=t.current,{rowHighlight:d}=t.current.props,u=q.default.useMemo((()=>2*pi.rowHeightMaps[n]),[n]),c=q.default.useMemo((()=>s.filter((e=>!Rs(e)))),[s]),f=Qe((t=>{var n,s;const{keyCode:f}=t;if(!ot(r)&&(27===f&&(i(""),o([])),38===f||40===f)){en(t);const p=c.length;let m=c.findIndex((e=>l(e,e.index)===r[0]));const h=38===f?(--m+p)%p:++m%p,g=c[h],v=l(g,g.index);d&&!(null===(n=d.disabled)||void 0===n?void 0:n.call(d,g))&&(i(v),null===(s=d.onChange)||void 0===s||s.call(d,v,g)),((t,l,n)=>{const r=c.length,i=e.find((e=>e.key===n)),o=a.current.scrollTop,s=a.current.container.offsetHeight,d=i.top,f=i.height;"top"===t?d<o?a.current.SET_SCROLL_TOP(d):l===r-1&&a.current.SET_SCROLL_TOP(d-(s-f)):d+f>o+(s-u)?a.current.SET_SCROLL_TOP(d-(s-u-f)):0===l&&a.current.SET_SCROLL_TOP(d)})(38===f?"top":"bottom",h,v),o([v,r[1]])}}));q.default.useLayoutEffect((()=>(window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f))),[])},_d=e=>{const{column:t,keyPath:l,type:n}=e,{prefixCls:a,countMethod:r,summationData:i,setCountMethod:o}=Hs(),{t:d}=Xe(),{dataIndex:u,filter:c}=t,[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>{const e=[{text:d("qm.pivotGrid.count.records"),value:"count",fn:Ds.count},{text:d("qm.pivotGrid.count.unique"),value:"unique",fn:Ds.unique},{text:d("qm.pivotGrid.count.empty"),value:"empty",fn:Ds.empty},{text:d("qm.pivotGrid.count.notEmpty"),value:"notEmpty",fn:Ds.notEmpty},{text:d("qm.pivotGrid.count.sum"),value:"sum",fn:Ds.sum},{text:d("qm.pivotGrid.count.max"),value:"max",fn:Ds.max},{text:d("qm.pivotGrid.count.min"),value:"min",fn:Ds.min},{text:d("qm.pivotGrid.count.avg"),value:"avg",fn:Ds.avg}];return"number"===(null==c?void 0:c.type)?e:e.slice(0,-4)}),[]),h=q.default.useMemo((()=>{var e,t,a;const o=r[u];if(!o)return d("qm.pivotGrid.count.statistic");return`${m.find((e=>e.value===o)).text} ${null!==(a=null===(t=null===(s=i,c=l,e=c?ks(s,c):s)||void 0===e?void 0:e[n])||void 0===t?void 0:t[u])&&void 0!==a?a:""}`;var s,c}),[i,r]);return q.default.createElement(s.Dropdown,{open:f,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},m.map((e=>{const t=e.value===r[u];return q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t}),onClick:()=>{o({[u]:t?void 0:e.value}),p(!1)}},q.default.createElement("span",{className:"label"},e.text),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null)))})))),className:J.default("count-select",{show:!!r[u]}),overlayClassName:`${a}__popper`,placement:"bottomRight",overlayStyle:{minWidth:140},onOpenChange:e=>p(e)},q.default.createElement("span",null,h," ",q.default.createElement(g.CaretDownOutlined,{className:"icon"})))},Fd=(e,t)=>{const{pivotRef:l,columns:n,expandedKeys:a,searchResults:r,switchIndex:i,fillColorCells:o,setExpandedKeys:d}=Hs(),{gridRef:u,indentDepth:c,highlightKey:f,checkedColumnKey:p,selectionKeys:m,treeExpandKeys:h,setSelectionKeys:v,setTreeExpandKeys:y,setHighlightKey:b,setClicked:x}=cd(),{keyRecordMap:E,isTree:C}=l.current,{bodyEl:w,rowVirtualizer:S}=u.current,{rowSelection:N,treeExpandable:T,rowHighlight:I,onRowEdit:O,onRowClick:R}=l.current.props,{t:k}=Xe(),{renderText:L,getTitleFromCellNode:P}=Si(),{selectionColumn:A,treeTable:D}=pi,{indentWidth:_}=Ts,F=q.default.useMemo((()=>t?0:Is(n).length-e.length),[n,e]),H=q.default.useMemo((()=>"radio"!==(null==N?void 0:N.type)),[N]),M=(e,t)=>{var l,n;null==N||N.checkStrictly;const a=H?e?[...m,t]:m.filter((e=>e!==t)):[t];v(a),null===(l=null==N?void 0:N.onSelect)||void 0===l||l.call(N,e,E.get(t)),null===(n=null==N?void 0:N.onChange)||void 0===n||n.call(N,a,$(a))},$=e=>{const t=[];return e.forEach((e=>t.push(E.get(e)))),t},j=(e,t)=>{var l,n;return(null===(l=r[i])||void 0===l?void 0:l.rowKey)===e&&(null===(n=r[i])||void 0===n?void 0:n.dataIndex)===t},K=(e,t)=>{const l=w.querySelectorAll(`li.table-row[data-row-key='${e}']`);Array.from(l).forEach((e=>{e.classList[t&&!(null==S?void 0:S.isScrolling)?"add":"remove"]("row--hover")}))},V=e=>q.default.createElement("button",{className:J.default("button-icon",{expand:a.includes(e.id)}),onClick:()=>{return t=e.id,void d(a.includes(t)?a.filter((e=>e!==t)):[...a,t]);var t}},q.default.createElement(g.CaretRightOutlined,null)),z=(e,t,l,a)=>{const{dataIndex:r,width:i,renderWidth:o}=e,s={"expandable-column":r===A},d=1===t?(c-l._groupLevel)*_:0,u={width:`${(i||o||0)+d}px`,minWidth:`${(i||o||0)+d}px`};return q.default.createElement("div",{key:r,className:J.default("label-cell",s),style:u},r!==A?q.default.createElement(q.default.Fragment,null,1===t&&q.default.createElement("span",{className:"title"},(e=>{const{_record:t,_fieldName:l}=e,a=ka(t,l),r=n.find((e=>e.dataIndex===l));return ot(a)||!r?q.default.createElement("span",{className:"empty"},k("qm.pivotGrid.group.empty")):r.render?r.render(a,t,r,0,0):L(a,r,t)})(l)),q.default.createElement(_d,{column:e,keyPath:l.id,type:"subtotal"})):V(l))},W=(e,t)=>{var l,n;const a=null===(l=null==T?void 0:T.rowExpandable)||void 0===l?void 0:l.call(T,e);return q.default.createElement(g.DownOutlined,{className:J.default("cell--expand",{fold:!h.includes(t),disabled:a}),style:{visibility:(null===(n=e.children)||void 0===n?void 0:n.length)>0?"visible":"hidden"},onClick:()=>{a||(e=>{var t,l;const n=h.includes(e),a=n?h.filter((t=>t!==e)):[...h,e];y(a),null===(t=null==T?void 0:T.onExpand)||void 0===t||t.call(T,!n,E.get(e)),null===(l=null==T?void 0:T.onChange)||void 0===l||l.call(T,a)})(t)}})},B=(e,t,l,n,a)=>{var r,i;const{dataIndex:d,width:u,renderWidth:c,align:f,render:h}=e,v=ka(l,d),y=h?h(v,l,e,l.index,t):L(v,e,l),E=P(y),w=m.includes(a),S={"selection-column":d===A,"col--center":"center"===f,"col--right":"right"===f,"col--checked":p===d,active:j(a,d)},T={width:`${u||c||0}px`,minWidth:`${u||c||0}px`,backgroundColor:o.get(`${a}|${d}`)};return q.default.createElement("div",{key:d,"data-col-index":t,title:E,className:J.default("table-cell",S),style:T,onClick:t=>{var n,r;d!==A&&(x([a,d]),I&&!(null===(n=I.disabled)||void 0===n?void 0:n.call(I,l))&&(b(a),null===(r=I.onChange)||void 0===r||r.call(I,a,l)),null==R||R(l,e,t))}},d!==A?q.default.createElement(q.default.Fragment,null,C&&1===t&&q.default.createElement(q.default.Fragment,null,(k=l._level)?q.default.createElement("span",{key:k,className:`cell--indent indent-level-${k}`,style:{paddingLeft:k*D.textIndent+"px"}}):null,W(l,a)),q.default.createElement("span",{className:"cell"},y)):q.default.createElement("div",{className:"action"},q.default.createElement("span",{className:"drag-icon"}),q.default.createElement("div",{className:"middle"},q.default.createElement("span",{className:"order"},((e,t)=>C?0===e._level?e._varIndex+1:null:t+1)(l,n)),N&&q.default.createElement(q.default.Fragment,null,H?q.default.createElement(s.Checkbox,{className:"checkbox",checked:w,disabled:null===(r=null==N?void 0:N.disabled)||void 0===r?void 0:r.call(N,l),onChange:e=>M(e.target.checked,a)}):q.default.createElement(s.Radio,{className:"checkbox",checked:w,disabled:null===(i=null==N?void 0:N.disabled)||void 0===i?void 0:i.call(N,l),onChange:e=>M(e.target.checked,a)}))),q.default.createElement("span",{className:"expand-icon",onClick:()=>null==O?void 0:O(l,n)},O?q.default.createElement(g.ExpandAltOutlined,null):null)));var k};return{renderGroupRow:(t,l)=>q.default.createElement("div",{className:"label-row"},e.map(((e,l)=>z(e,F+l,t)))),renderRow:(t,l,n)=>{const a={"row--selection":m.includes(n),"row--highlight":f===n};return q.default.createElement("li",{key:n,"data-row-key":n,className:J.default("table-row",a),onMouseEnter:()=>K(n,!0),onMouseLeave:()=>K(n)},e.map(((e,a)=>B(e,F+a,t,l,n))))}}},Hd=e=>{const{tbodyColumns:t,layout:l,displayList:n,virtualRows:a,notGroup:r}=e,{indentDepth:i,updateLayout:o}=cd(),{indentWidth:s}=Ts,d=q.default.useMemo((()=>t.filter((e=>"left"===e.fixed))),[t]),u=q.default.useMemo((()=>d.reduce(((e,t,l)=>e+(t.width||t.renderWidth||0)+(1===l?i*s:0)),0)),[i,o,d]),{renderGroupRow:c,renderRow:f}=Fd(d,!0);return q.default.createElement("div",{className:"left-panel",style:{width:u}},q.default.createElement("div",{className:J.default("container",{"no-group":r})},a.map((e=>{const t=e.index,a=l[t],r=n[t];if(Rs(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:a.left,right:0,height:a.height}},c(r,a.key));const i=t===l.length-1||Rs(n[t+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{last:i}),style:{top:a.top,left:a.left,right:0,height:a.height}},f(r,r._varIndex,a.key))}))))},Md=e=>{const{tbodyColumns:t,layout:l,displayList:n,virtualRows:a,notGroup:r}=e;Hs();const i=q.default.useMemo((()=>t.filter((e=>"left"!==e.fixed))),[t]),{renderGroupRow:o,renderRow:s}=Fd(i);return q.default.createElement("div",{className:"main-panel"},q.default.createElement("div",{className:J.default("container",{"no-group":r})},a.map((e=>{const t=e.index,a=l[t],r=n[t];if(Rs(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:0,right:a.right,height:a.height}},o(r,a.key));const i=t===l.length-1||Rs(n[t+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{last:i}),style:{top:a.top,left:0,right:a.right,height:a.height}},s(r,r._varIndex,a.key))}))))},$d=()=>{const{pivotRef:e,getRowKey:t,prefixCls:l,size:n,columns:a,groupGridData:r,expandedKeys:i,searchResults:o,switchIndex:s}=Hs(),{scrollbarRef:d,treeExpandKeys:u,setGridLayoutRef:c}=cd(),{flatGroupData:f}=e.current,{contextMenues:p}=e.current.props,{groupMargin:m}=Ts,{rowHeightMaps:h}=pi,g=q.default.useRef(null),v=q.default.useMemo((()=>Is(a)),[a]),y=q.default.useMemo((()=>Array.isArray(r)),[r]),{contextMenu:b,closeMenu:x}=(({ref:e,popup:t,getTriggerContainer:l,prevent:n,prefixCls:a="",enabled:r=!0})=>{const i=q.default.useRef(null),o=q.default.useRef(null),s=e=>{o.current=e},[d,u]=q.default.useState(!1),[c,f]=q.default.useState(null),p={width:150,height:200,zIndex:9999};Ad({ref:i,handler:()=>m()});const m=()=>{u(!1),f(null),s(null)},h=Qe((e=>{if(e.preventDefault(),null==n?void 0:n(e.target))return m();s(e),u(!0),rt((()=>{var t;const{width:l,height:n}=(null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect())||p,a=l,r=n,o=window.innerWidth,s=window.innerHeight;let d=e.clientX,u=e.clientY;d+a>o&&(d=Math.max(d-a,0)),u+r>s&&(u=Math.max(u-r,0)),f({x:d,y:u})}))}));q.default.useEffect((()=>{const t=(null==l?void 0:l(e.current))||e.current;return r&&t&&t.addEventListener("contextmenu",h),()=>{t&&t.removeEventListener("contextmenu",h)}}),[e]);const g={position:"fixed",top:`${(null==c?void 0:c.y)||0}px`,left:`${(null==c?void 0:c.x)||0}px`,zIndex:p.zIndex};return{contextMenu:q.default.createElement(he.default,{open:d},q.default.createElement("div",{ref:i,className:`${a}__context-menu`,style:g},o.current?t(o.current):null)),closeMenu:m}})({ref:g,prevent:e=>e.offsetParent.classList.contains("group-label"),prefixCls:l,enabled:!!p,popup:e=>{var l;const n=on(e.target,"table-cell"),a=(null===(l=null==n?void 0:n.parentNode)||void 0===l?void 0:l.getAttribute("data-row-key"))||"",r=f.find((e=>t(e,e.index)==a)),i=Number((null==n?void 0:n.getAttribute("data-col-index"))||-1),o=v[i];return q.default.createElement("ul",{className:"ant-dropdown-menu",style:{padding:5}},p.map((e=>{var t;const l=(null===(t=e.disabled)||void 0===t?void 0:t.call(e,r,o))||!1;return q.default.createElement("li",{key:e.key,className:J.default("ant-dropdown-menu-item",{"ant-dropdown-menu-item-disabled":l}),onClick:()=>{var t;l||(rt((()=>x())),null===(t=e.onClick)||void 0===t||t.call(e,r,o))}},e.prefix&&q.default.createElement("span",{className:"prefix"},e.prefix),q.default.createElement("span",{className:"label"},e.label),e.suffix&&q.default.createElement("span",{className:"suffix"},e.suffix))})))}}),E=e=>{var t;const l=f[e];for(let n=e+1;n<f.length;n++)if(null===(t=f[n]._parentRowKey)||void 0===t?void 0:t.startsWith(l.id)){Object.assign(l,{_record:f[n]});break}},C=q.default.useMemo((()=>{const e=new Map,l=[];return f.forEach(((n,a)=>{if(Rs(n)){if(0===n._groupLevel)return e.set(n.id,i.includes(n.id)),E(a),void l.push(n);const t=n.id.slice(0,n.id.lastIndexOf(Ts.separator));return void(i.includes(t)&&e.get(t)&&(e.set(n.id,i.includes(n.id)),E(a),l.push(n)))}const r=t(n,n.index);n._parentRowKey&&!e.get(n._parentRowKey)||(e.set(r,u.includes(r)),l.push(n))})),e.clear(),l}),[r,i,u]),w=q.default.useMemo((()=>((e,{getRowKey:t,rowHeight:l})=>{const n=[],a=[],r=l,i=Ts.indentWidth,o=Ts.groupMargin;let s=o;for(e.forEach((e=>{if(void 0!==e._groupLevel){for(;a.length>0&&a[a.length-1]._level>=e._groupLevel;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}a[a.length-1];const t={key:e.id,top:s,left:i*e._groupLevel,right:i*e._groupLevel,height:r,_childHeight:0,_subGroupCount:0,_index:n.length,_level:e._groupLevel};n.push(t),a.push(t),s+=r}else{const l=a[a.length-1]||{left:0,right:0},i={key:t(e,e.index),top:s,left:l.left,right:l.right,height:r};n.push(i),s+=r,a.length>0&&(l._childHeight+=r)}}));a.length>0;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}return n})(C,{getRowKey:t,rowHeight:h[n]})),[C,n]);Dd(w);const S=q.default.useMemo((()=>{if(y)return w.reduce(((e,t)=>e+t.height),0)+2*m;const e=w.filter((e=>0===e._level));return e.reduce(((e,t)=>e+t.height),0)+(e.length-1)*m+2*m}),[y,w]),{rowVirtualizer:N,virtualRows:T}=(e=>{const{layout:t,isGroup:l}=e,{size:n}=Hs(),{scrollbarRef:a}=cd(),{rowHeightMaps:r}=pi,i=q.default.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]),o=Rd({count:t.length,getScrollElement:()=>i,estimateSize:e=>t[e].height,overscan:1,noCache:l,rangeExtractor:e=>{var s;if(!l)return bd(e);const d=a.current.scrollTop,u=(null===(s=o.scrollElement)||void 0===s?void 0:s.offsetHeight)||i.offsetHeight,c=[];for(let e=0;e<t.length;e++){const l=t[e];d>l.top+l.height+r[n]||d+u+r[n]<l.top||c.push(e)}return c}}),s=o.getVirtualItems();return{rowVirtualizer:o,virtualRows:s}})({layout:w,isGroup:!y});Ql((()=>{const e=f.findIndex((e=>{var l;return t(e,e.index)===(null===(l=o[s])||void 0===l?void 0:l.rowKey)}));e>=0&&d.current.SET_SCROLL_TOP(e*h[n]);const l=v.findIndex((e=>{var t;return e.dataIndex===(null===(t=o[s])||void 0===t?void 0:t.dataIndex)}));if(l>=0){const e=v.slice(0,l).filter((e=>"left"!==e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);d.current.SET_SCROLL_LEFT(e)}}),[s,o]),q.default.useLayoutEffect((()=>{c("bodyEl",g.current),c("rowVirtualizer",N)}),[]);const I={tbodyColumns:v,layout:w,displayList:C,virtualRows:T,notGroup:y};return q.default.createElement("div",{ref:g,className:"body",style:{height:S}},q.default.createElement(Hd,I),q.default.createElement(Md,I),b)},qd=()=>{const{columns:e,groupGridData:t,countMethod:l,setSummationData:n}=Hs(),{indentDepth:a,updateLayout:r}=cd(),{selectionColumn:i}=pi,{indentWidth:o}=Ts,s=q.default.useMemo((()=>Is(e)),[e]),d=q.default.useMemo((()=>s.filter((e=>"left"===e.fixed))),[s]),u=q.default.useMemo((()=>s.filter((e=>"left"!==e.fixed))),[s]),c=q.default.useMemo((()=>d.reduce(((e,t,l)=>e+(t.width||t.renderWidth||0)+(1===l?a*o:0)),0)),[a,r,d]);Ql((()=>{n(((e,t)=>{const l=[],n=e=>{const l={};for(const n in t){const a=e.map((e=>st(e,n)||0));l[n]=t[n](a)}return l},a=e=>{if(Array.isArray(e))return l.push(...e),{total:n(e)};const r={},i={};Object.keys(t).forEach((e=>{i[e]=[]}));for(const n in e){const o=e[n];if(Array.isArray(o)){l.push(...o);const e={};for(const l in t){const n=o.map((e=>st(e,l)||0));e[l]=t[l](n),i[l].push(...n)}r[n]={subtotal:e}}else{const e=a(o);r[n]=e;for(const l in t){const t=e.subtotal[l];void 0!==t&&i[l].push(t)}}}if(0===l.length)return r;const o={};for(const e in t)o[e]=t[e](i[e]);return r.subtotal=o,r},r=Array.isArray(e)?{total:n(e)}:a(e);return l.length>0&&(r.total=n(l)),delete r.subtotal,r})(t,(e=>{const t={};for(const l in e)e[l]&&Object.assign(t,{[l]:Ds[e[l]]});return t})(l)))}),[l,t]);const f=(e,t)=>q.default.createElement("div",{className:J.default(t?"fixed-left":"no-fixed"),style:{width:t?c:""}},e.map(((l,n)=>{const{dataIndex:r,width:s,renderWidth:d}=l,u={"selection-column":r===i,"col--right":!0},c=t&&1===n||!t&&n===e.length-1?a*o:0,f={width:`${(s||d||0)+c}px`,minWidth:`${(s||d||0)+c}px`};return q.default.createElement("div",{key:r,className:J.default("table-cell",u),style:f},r!==i?q.default.createElement(_d,{column:l,keyPath:"",type:"total"}):null)})));return q.default.createElement("div",{className:"footer"},f(d,!0),(e=>f(e))(u))},jd=()=>{const{prefixCls:e,size:t}=Hs(),l=q.default.useRef(null);return q.default.createElement(ud,{scrollbar:l},q.default.createElement(_n,{ref:l,className:J.default(`${e}__layout`,t)},q.default.createElement(md,null),q.default.createElement($d,null),q.default.createElement(qd,null)))},Kd=()=>q.default.createElement("div",{className:"wrapper"},q.default.createElement(jd,null)),Vd={rowKey:"id",columns:[],dataSource:[]},zd=e=>{const t=Ne(Vd,e),{rowKey:l,fromTable:n,columns:a,dataSource:r,height:i,maxHeight:o,className:s,style:d}=t,{$size:u}=Ze(t),c=Qe(((e,t)=>{const n="function"==typeof l?l(e,t):null==e?void 0:e[l];return void 0===n?(mt("PivotGrid","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),f=(e,t="",l=0)=>e.map(((e,n)=>{const a=c(e,e.index);return e.index=n,e._level=l,Array.isArray(e.children)&&(e.children=f(e.children,a,l+1)),t?Object.assign(e,{_parentRowKey:t}):e})),p=e=>{let t=!1;const l=(e=>e.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))))(e).map((e=>{"left"===e.fixed&&(t=!0);const l=Object.assign(Object.assign({},e),{fixed:"left"===e.fixed?"left":void 0,editRender:void 0});return n&&(void 0===l.fixed&&delete l.fixed,delete l.editRender),l}));return!t&&l.length&&(l[0].fixed="left",mt("PivotGrid","至少需要有一项 `fixed: left` 的固定列")),l},m=q.default.useMemo((()=>p(a)),[a]),h=q.default.useMemo((()=>f(r)),[r]),g=yt("pivot-grid"),v={[g]:!0,"is-from-table":n},y={height:i,maxHeight:i||o?o:500},b={prefixCls:g,size:u,getRowKey:c,flatColumns:m,tableData:h,pivotProps:dt(t,["columns","dataSource","rowKey","size","height","maxHeight","className","style"])};return q.default.createElement("div",{className:J.default(v,s),style:Object.assign(Object.assign({},d),y)},q.default.createElement(Fs,b,q.default.createElement(sd,null),q.default.createElement(Kd,null)))};zd.displayName="PivotGrid";const Wd=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{tableRef:n,prefixCls:a,flattenColumns:r}=q.default.useContext(Xr),{rowKey:i,uniqueKey:o}=n.current.props,{t:s}=Xe(),{tableFullData:d}=n.current,[u,c]=q.default.useState(!1),f=()=>{c(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:f})));const p={visible:u,title:s("qm.table.pivotGrid.settingTitle"),width:"80vw",loading:!1,bodyStyle:{padding:0},onClose:()=>c(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${a}-pivot-grid`,title:s("qm.table.pivotGrid.text"),onClick:()=>f()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.LineChartOutlined,null))),q.default.createElement(Qn,p,q.default.createElement(zd,{fromTable:!0,rowKey:i,uniqueKey:o,columns:r,dataSource:d})))}));Wd.displayName="PivotGrid";const Bd=e=>{const{columns:t,group:l,summary:n}=e,{tableRef:a,$size:r,pagination:i,fetchParams:o,isFetch:s}=q.default.useContext(Xr),{fetch:d}=a.current.props,{t:u}=Xe(),c=e=>{var l;const n=t.find((t=>t.dataIndex===e));return{title:n.title,precision:n.precision,dictItems:null!==(l=n.dictItems)&&void 0!==l?l:[]}},f=l.map((e=>Object.assign({dataIndex:e.group},c(e.group)))),p=n.map((e=>e.summary===pi.groupSummary.total.value?{dataIndex:e.summary,title:pi.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},c(e.summary)),{formula:e.formula}))),h=q.default.useMemo((()=>Object.assign({},o,{[pi.sorterFieldName]:void 0,[pi.groupSummary.summaryFieldName]:n.map((e=>`${e.formula}|${e.summary}`)).join(","),[pi.groupSummary.groupbyFieldName]:l.map((e=>e.group)).join(","),usedJH:2,[pi.currentPageName]:1})),[o,l,n]),[g,v]=q.default.useState(((e,l)=>[{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}))),...l.map((e=>{var l;const n=null===(l=t.find((t=>t.dataIndex===e.dataIndex)))||void 0===l?void 0:l.groupSummary;let a=n?{summation:n}:null;return e.dataIndex===pi.groupSummary.total.value&&(a={dataIndex:pi.groupSummary.recordTotalIndex,summation:{render:()=>i.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?a:null)}))])(f,p)),[y]=q.default.useState(s?[]:(e=>{const t=Va(e,l.map((e=>e.group))),a=[];return t.forEach((e=>{const t={};g.forEach((l=>{const{dataIndex:n}=l;"index"!==n&&La(t,n,ka(e[0],n))})),n.forEach((l=>{const n=l.summary!==pi.groupSummary.total.value?l.summary:pi.groupSummary.recordTotalIndex,a=l.formula;"count"===a&&La(t,n,e.length),"sum"===a&&La(t,n,m.sumBy(e,n)),"max"===a&&La(t,n,m.maxBy(e,n)[n]),"min"===a&&La(t,n,m.minBy(e,n)[n]),"avg"===a&&La(t,n,(m.sumBy(e,n)/e.length).toFixed(2))})),a.push(t)})),a})(a.current.tableFullData)),b=Object.assign(Object.assign({size:r,height:400},s?{fetch:{api:d.api,params:h,dataKey:null==d?void 0:d.dataKey}}:{dataSource:y}),{columns:g,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${j.default().format(ai)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)});return q.default.createElement(Ku,b)},Ud=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,prefixCls:a,$size:r,flattenColumns:i}=q.default.useContext(Xr),{uniqueKey:o}=n.current.props,{t:d}=Xe(),u=q.default.useRef(null),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState([]),[v,y]=q.default.useState(""),[b,x]=q.default.useState("");Ql((()=>{if(b){const{group:e,summary:t}=m.find((e=>e.value===b)).list;I(e),L(t)}else{const e=F();I((null==e?void 0:e.group)||[]),L((null==e?void 0:e.summary)||[])}}),[b]),q.default.useEffect((()=>{H()}),[]);const E=q.default.useMemo((()=>o?`summary_${o}`:""),[o]),C=q.default.useMemo((()=>i.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex)))),[i]),w=C.filter((e=>!e.groupSummary)).map((e=>({text:qa(e.title),value:e.dataIndex}))),S=[pi.groupSummary.total,...C.filter((e=>!!e.groupSummary)).map((e=>({text:qa(e.title),value:e.dataIndex})))],N=[{text:d("qm.table.groupSummary.sumText"),value:"sum"},{text:d("qm.table.groupSummary.maxText"),value:"max"},{text:d("qm.table.groupSummary.minText"),value:"min"},{text:d("qm.table.groupSummary.avgText"),value:"avg"},{text:d("qm.table.groupSummary.countText"),value:"count"}],[T,I]=q.default.useState([]),[O,R]=q.default.useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(ht,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(t)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:d("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:T.findIndex((t=>t.group===e.value))>-1})))})}]),[k,L]=q.default.useState([]),[P,A]=q.default.useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(ht,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(t)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:d("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:S.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:d("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===pi.groupSummary.total.value?N.slice(N.length-1):N})}]),D=q.default.useMemo((()=>{const e=T.length&&T.every((e=>Object.values(e).every((e=>""!==e)))),t=k.length&&k.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[T,k]),_=()=>{E&&sessionStorage.setItem(E,JSON.stringify({group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}))},F=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},H=()=>Ye(void 0,void 0,void 0,(function*(){if(!E)return;const e=F();if(e){const{group:t,summary:l}=e;I(t),L(l)}let t=yield fe.default.getItem(E);t||(t=yield M(E),Array.isArray(t)&&(yield fe.default.setItem(E,t))),Array.isArray(t)&&t.length&&(h(t),!e&&x(t[0].value))})),M=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),$=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),j={visible:f,title:d("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return q.default.createElement("div",{className:`${a}-group-summary__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{style:{width:"30%"}},q.default.createElement(Ku,{ref:u,size:r,columns:O,dataSource:T,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>R(e),onDataChange:e=>{I(e)}},q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"container line"},q.default.createElement(Ku,{ref:c,size:r,columns:P,dataSource:k,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onDataChange:e=>{L(e)}},q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(s.Input,{size:r,value:v,placeholder:d("qm.table.groupSummary.configText"),disabled:D,onChange:e=>{const{value:t}=e.target;y(t)}}),q.default.createElement(ht,{type:"primary",disabled:!v||D,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!E)return mt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ma(),t=[...m,{text:v,value:e,list:{group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}}];h(t),x(e),y(""),yield fe.default.setItem(E,t),yield $(E,t)}))},d("qm.table.groupSummary.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${pi.rowHeightMaps[r]}px`}},q.default.createElement("span",null,d("qm.table.groupSummary.savedSetting"))),q.default.createElement("ul",null,m.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===b}),title:e.text,onClick:()=>{return t=e.value,void x(t!==b?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:d("qm.table.groupSummary.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ye(void 0,void 0,void 0,(function*(){if(!l)return;const e=m.filter((e=>e.value!==l));h(e),l===b&&x(""),yield fe.default.setItem(E,e),yield $(E,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!m.length&&q.default.createElement("div",{style:{padding:Jr}},q.default.createElement(hn,null)))))),q.default.createElement(Qn,j,q.default.createElement(Bd,{columns:C,group:T,summary:k})),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>t(),style:{marginRight:8}},d("qm.table.groupSummary.closeButton")),q.default.createElement(ht,{type:"primary",disabled:D,onClick:()=>(_(),void p(!0))},d("qm.table.groupSummary.confirmButton"))))},Gd=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(Xr),{t:a}=Xe(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-group-summary`,title:a("qm.table.groupSummary.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PieChartOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(Ud,{onClose:()=>i(!1)})))}));Gd.displayName="GroupSummary";const Yd=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,$size:a,prefixCls:r,flattenColumns:i,setSuperFilters:o,clearTableFilter:d}=q.default.useContext(Xr),{uniqueKey:u}=n.current.props,{t:c}=Xe(),f=q.default.useRef(null),[p,m]=q.default.useState([]),[h,v]=q.default.useState([]),[y,b]=q.default.useState(""),[x,E]=q.default.useState("");Ql((()=>{m(x?h.find((e=>e.value===x)).list:F()||[])}),[x]),q.default.useEffect((()=>{H()}),[]);const C=q.default.useMemo((()=>u?`superSearch_${u}`:""),[u]),w=q.default.useMemo((()=>i.filter((e=>!!e.filter))),[i]),S=Ka(p),N=q.default.useMemo((()=>!(S&&ca(S))),[S]),T=q.default.useMemo((()=>!!p.length&&N),[p,N]),I=[{value:"and",text:c("qm.table.highSearch.andText")},{value:"or",text:c("qm.table.highSearch.orText")}],O=i.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:qa(e.title)}))),R=e=>["in","nin"].includes(e),k=(e,t)=>{let l;switch(e){case"number":l="number";break;case"date":l="date";break;case"checkbox":case"radio":l=t?"select-multiple":"select";break;default:l="text"}return l},L=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:c("qm.table.highSearch.gtText")},{value:"<",text:c("qm.table.highSearch.ltText")},{value:">=",text:c("qm.table.highSearch.gteText")},{value:"<=",text:c("qm.table.highSearch.lteText")},{value:"==",text:c("qm.table.highSearch.eqText")},{value:"!=",text:c("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",text:c("qm.table.highSearch.inText")},{value:"nin",text:c("qm.table.highSearch.ninText")},{value:"==",text:c("qm.table.highSearch.eqText")},{value:"!=",text:c("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:c("qm.table.highSearch.likeText")},{value:"==",text:c("qm.table.highSearch.eqText")},{value:"!=",text:c("qm.table.highSearch.neqText")}]}return t},[P,A]=q.default.useState([{title:c("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(ht,{type:"text",onClick:()=>{f.current.REMOVE_RECORDS(t)}},c("qm.table.highSearch.removeText")))},{title:c("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:c("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:O,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:c("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var l,n;const a=Object.values(t)[0],r=null===(l=w.find((e=>e.dataIndex===a)))||void 0===l?void 0:l.filter.type,i=L(r);e.fieldType=r,e.expression=a?null===(n=i[0])||void 0===n?void 0:n.value:"",e.condition=R(e.expression)?[]:"",a||(e.bracketLeft=e.bracketRight="")}})},{title:c("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:c("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const l=null===(t=w.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:L(l),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=R(e.expression)?[]:""}}}},{title:c("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,l,n;const a=w.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,i=null!==(n=null!==(l=null===(t=null==a?void 0:a.filter)||void 0===t?void 0:t.items)&&void 0!==l?l:null==a?void 0:a.dictItems)&&void 0!==n?n:[];return{type:k(r,R(e.expression)),editable:!0,items:i,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:c("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:c("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:I,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),D=()=>{d(),o(p.map((e=>dt(e,["index","pageIndex"])))),_(),t()},_=()=>{C&&sessionStorage.setItem(C,JSON.stringify(p.filter((e=>!!e.fieldName))))},F=()=>{if(!C)return;const e=sessionStorage.getItem(C);return e?JSON.parse(e):null},H=()=>Ye(void 0,void 0,void 0,(function*(){if(!C)return;const e=F();e&&m(e);let t=yield fe.default.getItem(C);t||(t=yield M(C),Array.isArray(t)&&(yield fe.default.setItem(C,t))),Array.isArray(t)&&t.length&&(v(t),!e&&E(t[0].value))})),M=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),$=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-super-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement(Ku,{ref:f,size:a,columns:P,dataSource:p,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(l)&&("bracketLeft"===l&&(e[l]=e[l]?"":"("),"bracketRight"===l&&(e[l]=e[l]?"":")"),m([...p]))},onDataChange:e=>{m(e)}},q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{f.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),pi.highSearch.showSQL&&S&&q.default.createElement("code",{className:"lang-js"},S)),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(s.Input,{size:a,value:y,placeholder:c("qm.table.highSearch.configText"),disabled:N,onChange:e=>{const{value:t}=e.target;b(t)}}),q.default.createElement(ht,{type:"primary",disabled:!y||N,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!C)return mt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ma(),t=[...h,{text:y,value:e,list:p.filter((e=>!!e.fieldName))}];v(t),E(e),b(""),yield fe.default.setItem(C,t),yield $(C,t)}))},c("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${pi.rowHeightMaps[a]}px`}},q.default.createElement("span",null,c("qm.table.highSearch.savedSetting"))),q.default.createElement("ul",null,h.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===x}),title:e.text,onClick:()=>{return t=e.value,void E(t!==x?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:c("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ye(void 0,void 0,void 0,(function*(){if(!l)return;const e=h.filter((e=>e.value!==l));v(e),l===x&&E(""),yield fe.default.setItem(C,e),yield $(C,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!h.length&&q.default.createElement("div",{style:{padding:Jr}},q.default.createElement(hn,null)))))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>t(),style:{marginRight:8}},c("qm.table.highSearch.closeButton")),q.default.createElement(ht,{type:"primary",disabled:T,onClick:()=>D()},c("qm.table.highSearch.searchButton"))))},Xd=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(Xr),{t:a}=Xe(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:a("qm.table.highSearch.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.FunnelPlotOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(Yd,{onClose:()=>i(!1)})))}));Xd.displayName="SuperSearch";const Qd=q.default.forwardRef(((e,t)=>{const{tableColumns:l,showFullScreen:n,showReload:a,showPrint:r,showImport:i,showExport:o,showClipboard:d,showCollection:u,showFastSearch:c,showSuperSearch:f,showPivotGrid:p,showGroupSummary:m,showToolBox:h}=e,{global:v}=q.default.useContext(xe),{tableRef:y,$size:b,prefixCls:x,isFullScreen:E}=q.default.useContext(Xr),{uniqueKey:C,exportExcel:w}=y.current.props,{t:S}=Xe(),N=q.default.useRef(null),T=q.default.useRef(null),I=q.default.useRef(null),O=q.default.useRef(null),R=q.default.useRef(null),k=q.default.useRef(null),L=q.default.useRef(null),P=q.default.useRef(null),A=q.default.useRef(null),D=q.default.useRef(null),_=q.default.useRef(null),F=q.default.useRef(!1),H=q.default.useMemo((()=>C?`toolBox_${C}`:""),[C]),[M,$]=q.default.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:n,reload:a,print:r,import:i,export:o&&!(null==w?void 0:w.hideIcon),clipboard:d,collection:u,fastSearch:c,superSearch:f,pivotGrid:p,groupSummary:m},[K,V]=q.default.useState(!1);Ql((()=>{F.current&&(W(),F.current=!1)}),[M]),q.default.useEffect((()=>{z()}),[]),q.default.useImperativeHandle(t,(()=>({exportHandle:()=>{if(!R.current)return mt("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const z=()=>{if(!H||!h)return;const e=JSON.parse(localStorage.getItem(H));e||B(H).then((e=>{e&&($(Object.assign({},M,e)),localStorage.setItem(H,JSON.stringify(e)))})).catch((()=>{})),e&&$(Object.assign({},M,e))},W=()=>{if(!H||!h)return;const e={};for(const t in M)M[t]&&(e[t]=M[t]);localStorage.setItem(H,JSON.stringify(e)),U(H,e)},B=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==v?void 0:v.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),U=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==v?void 0:v.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),G=e=>Ye(void 0,void 0,void 0,(function*(){V(!1),yield at(100),e.current.clickHandle()})),Y=(e,t)=>{F.current=!0,$(Object.assign({},M,{[t]:e}))},X={"top-toolbox__popper":!0,[`${x}--lg`]:"large"===b,[`${x}--sm`]:"small"===b};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement(Ci,{ref:N,isFullScreen:E,open:!h||M.fullScreen}),a&&q.default.createElement(wi,{ref:T,open:!h||M.reload}),r&&q.default.createElement(Ni,{ref:I,tableColumns:l,open:!h||M.print}),i&&q.default.createElement(Hi,{ref:O,tableColumns:l,open:!h||M.import}),o&&q.default.createElement(bs,{ref:R,tableColumns:l,open:(!h||M.export)&&!(null==w?void 0:w.hideIcon)}),d&&q.default.createElement(Es,{ref:k,open:!h||M.clipboard}),u&&q.default.createElement(ws,{ref:L,columns:l,open:!h||M.collection}),c&&q.default.createElement(Ns,{ref:P,open:!h||M.fastSearch}),p&&q.default.createElement(Wd,{ref:A,open:!h||M.pivotGrid}),m&&q.default.createElement(Gd,{ref:D,open:!h||M.groupSummary}),f&&q.default.createElement(Xd,{ref:_,open:!h||M.superSearch}),h&&q.default.createElement(s.Dropdown,{open:K,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.fullScreen,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.screen.full"))),onClick:()=>G(N)},{key:"reload",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.reload,style:{marginRight:6},onChange:e=>Y(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.refresh.text"))),onClick:()=>G(T)},{key:"print",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.print,style:{marginRight:6},onChange:e=>Y(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.print.text"))),onClick:()=>G(I)},{key:"import",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.import,style:{marginRight:6},onChange:e=>Y(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.import.textNoSpace"))),onClick:()=>G(O)},{key:"export",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.export,style:{marginRight:6},onChange:e=>Y(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.export.textNoSpace"))),onClick:()=>G(R)},{key:"clipboard",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.clipboard,style:{marginRight:6},onChange:e=>Y(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.clipboard.textNoSpace"))),onClick:()=>G(k)},{key:"collection",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.collection,style:{marginRight:6},onChange:e=>Y(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.selectCollection.text"))),onClick:()=>G(L)},{key:"fastSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.fastSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.fastSearch.text"))),onClick:()=>G(P)},{key:"pivotGrid",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.pivotGrid,style:{marginRight:6},onChange:e=>Y(e.target.checked,"pivotGrid"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.pivotGrid.text"))),onClick:()=>G(A)},{key:"groupSummary",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.groupSummary,style:{marginRight:6},onChange:e=>Y(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.groupSummary.text"))),onClick:()=>G(D)},{key:"superSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.superSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.highSearch.text"))),onClick:()=>G(_)}];return q.default.createElement(s.Menu,{items:e.filter((e=>j[e.key]))})})(),overlayClassName:J.default(X),overlayStyle:{minWidth:120},onOpenChange:e=>{V(e)}},q.default.createElement("span",{className:`${x}-toolbox`,title:S("qm.table.toolbox.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.AppstoreAddOutlined,null)))))}));Qd.displayName="ToolBox";const Zd=(e,t)=>e.map((e=>(e.children&&(e.children=Zd(e.children,t)),t(e)))),Jd=q.default.forwardRef(((e,t)=>{const{columns:l}=e,{global:n}=q.default.useContext(xe),{tableRef:a,prefixCls:r,$size:i}=q.default.useContext(Xr),{showColumnDefine:o,uniqueKey:d,onlyShowIcon:u,columnsChange:c}=a.current.props,{t:f}=Xe(),p=q.default.useRef([]),[h,v]=q.default.useState(!1),y=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(l)),[l]),b=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(l)),[l]),x=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(l)),[l]),E=q.default.useMemo((()=>d?`table_${d}`:""),[d]);Ql((()=>{S(l)}),[l]),q.default.useLayoutEffect((()=>{N()}),[]),q.default.useImperativeHandle(t,(()=>({initialHandler:N})));const C=()=>{if(!E)return;const e=JSON.parse(localStorage.getItem(E));var t;if(e||(t=E,Ye(void 0,void 0,void 0,(function*(){const e=null==n?void 0:n.getComponentConfigApi;if(e)try{const l=yield e({key:t});if(200===l.code)return l.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(E,JSON.stringify(e)),N()):(null==n?void 0:n.getComponentConfigApi)&&S(l)})).catch((()=>{})),!e)return;return m.xor(ha(e).map((e=>e.dataIndex)),ha(l).map((e=>e.dataIndex))).length>0?Zd(l,(t=>{const l=va(e,t.dataIndex);return l&&(void 0!==l.hidden&&(t.hidden=l.hidden),void 0!==l.fixed&&(t.fixed=l.fixed),void 0!==l.width&&(t.width=l.width),void 0!==l.renderWidth&&(t.renderWidth=l.renderWidth)),t})):Zd(e,(e=>{const t=va(l,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},w=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=w(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)})),S=e=>{if(!E)return;const t=w(e),l=JSON.parse(localStorage.getItem(E));var r,i;a.current.columnsDefined&&!m.isEqual(t,l)&&(localStorage.setItem(E,JSON.stringify(t)),r=E,i=t,Ye(void 0,void 0,void 0,(function*(){const e=null==n?void 0:n.saveComponentConfigApi;if(e)try{yield e({[r]:i})}catch(e){}})))},N=()=>{const e=C();var t;e&&(t=I(e),p.current=t,null==c||c(e))},I=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((l,n)=>{const a=l.colSpan;a>1&&e.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&t.push(e.slice(n,n+a))})),t},O=()=>{const e=t=>t.map((t=>{const n=va(l,t.dataIndex)||ut(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==c||c(e(a.current.originColumns))},R=e=>{const t=[];e.forEach((l=>{const{colSpan:n,dataIndex:a}=l;if(0===n)return;if(1===n)return t.push(l);const r=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return t.push(l);t.push(...p.current[r].map((({dataIndex:t},n)=>{const a=e.find((e=>e.dataIndex===t));return n>0&&(void 0!==l.hidden&&(a.hidden=l.hidden),void 0!==l.fixed?a.fixed=l.fixed:a.fixed&&delete a.fixed),a})))})),l.forEach(((e,l)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(l,0,e)})),null==c||c(t)},k=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,R(l))},L=(e,t)=>{var n;const{colSpan:a,noFixed:r}=e;if(0===a)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=qa(e.title),o=["svgicon","handle",`${t}-handle`],d=q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(s.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,R(l)}}),q.default.createElement("i",{className:J.default(o),title:f("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text",title:i},i),"main"===t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedLeft"),onClick:()=>k(e,"left")},q.default.createElement(g.StepBackwardOutlined,null)),q.default.createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedRight"),onClick:()=>k(e,"right")},q.default.createElement(g.StepForwardOutlined,null))):"sub"!==t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.cancelFixed"),onClick:()=>k(e)},q.default.createElement(g.CloseCircleOutlined,null))):null);return!e.hidden&&(null===(n=e.children)||void 0===n?void 0:n.length)?q.default.createElement(s.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:P(e.children,e.dataIndex)},d):d},P=(e,t)=>q.default.createElement("div",{className:"column-filter--wrap"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:n=>{const a=n.map((e=>e.dataIndex)),r=e.map((e=>e.dataIndex));m.isEqual(a,r)||((e,t)=>{va(l,t).children=e,null==c||c([...l])})(Ya(n),t)}},e.map((e=>L(e,"sub"))))),A={[`${r}__popper`]:!0,"column-filter__popper":!0,[`${r}--lg`]:"large"===i,[`${r}--sm`]:"small"===i},D=[`${r}-column-filter`,{selected:h}];return o?q.default.createElement(gs,{action:["click"],popupVisible:h,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"reset"},q.default.createElement(ht,{type:"text",size:"small",onClick:O},f("qm.table.columnFilter.reset"))),q.default.createElement("div",{className:"left"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),l=y.map((e=>e.dataIndex));m.isEqual(t,l)||R([...Ya(e),...x,...b])}},y.map((e=>L(e,"left"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"main"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),l=x.map((e=>e.dataIndex));m.isEqual(t,l)||R([...y,...Ya(e),...b])}},x.map((e=>L(e,"main"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"right"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:b,setList:e=>{const t=e.map((e=>e.dataIndex)),l=b.map((e=>e.dataIndex));m.isEqual(t,l)||R([...y,...x,...Ya(e)])}},b.map((e=>L(e,"right")))))),popupClassName:J.default(A),popupStyle:{minWidth:160},onPopupVisibleChange:e=>{v(e)},builtinPlacements:ri,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(D),title:u?f("qm.table.columnFilter.text"):void 0},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),!u&&q.default.createElement("span",null,f("qm.table.columnFilter.text")))):null}));Jd.displayName="ColumnFilter";const eu=(e,t,l)=>{let n;for(let a=0;a<e.length;a++){const r=e[a];if(r.children)if(r.children.some((e=>e[l]===t)))n=r[l];else{const e=eu(r.children,t,l);e&&(n=e)}}return n},tu=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&tu(e.children,t),t(e)||e.children&&e.children.length))),lu=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...lu(e.children,t)),t(e)&&l.push(e)})),l},nu=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=nu(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},au=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:au(e.children,t,l,n)}):e)),ru=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...ru(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(e[t])})),l},iu=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][l]===t)return[t];if(Array.isArray(e[n].children)){const a=iu(e[n].children,t,l);if(a)return[e[n][l],a].flat()}}},ou=(e,t)=>{var l;const n=(null===(l=e.children)||void 0===l?void 0:l.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>n.push(...ou(e,t)))),n},su=q.default.forwardRef(((e,t)=>{const{className:l,style:n,filterable:a=!0,multiple:r,draggable:i,dataSource:o,fetch:d,autoFocus:u,asyncLoad:c,checkStrictly:f,checkStrategy:p="SHOW_CHILD",placeholder:h,fieldsDefine:v,value:y,height:b,defaultSelectedKeys:x=[],defaultExpandedKeys:E=[],defaultExpandAll:C=!0,showSearchBar:w=!0,showCollapse:S=!0,onSelectChange:N,onCheckChange:T,onDragStart:I,onDragChange:O,onExpand:R}=e,{$size:k}=Ze(e),{t:L}=Xe(),P=(null==v?void 0:v.valueKey)||"value",A=(null==v?void 0:v.textKey)||"text";null==v||v.children;const D=q.default.useRef(null),_=q.default.useRef(null),F=Cn(D),[H,M]=q.default.useState(b),[$,j]=q.default.useState(!1),K=wn((()=>{M(D.current.offsetHeight-le.current.offsetHeight-10)}),5);Ie((()=>{b||K()}),[F.height]);const[V,z]=q.default.useState([]),[W,B]=q.default.useState({}),[U,G]=q.default.useState([]),[Y,X]=q.default.useState([]),[Q,Z]=q.default.useState(""),[ee,te]=q.default.useState(C),le=q.default.useRef(null),ne=q.default.useRef([]),ae=q.default.useRef([]);q.default.useEffect((()=>{Array.isArray(o)&&(re(o),G(ie(o)),B({}))}),[o]),q.default.useEffect((()=>{var e;de(),u&&(null===(e=_.current)||void 0===e||e.focus())}),[]),Ql((()=>{de()}),[null==d?void 0:d.params]),Ql((()=>{X(se())}),[W]),q.default.useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const l=Array.isArray(t)?t:[t],n=nu(V,(t=>e===t[P]));n&&(Array.isArray(n.children)?n.children.push(...l):n.children=[...l],re([...V]))},REMOVE_RECORD:e=>{var t;const l=eu(V,e,P);if(void 0===l&&V.find((t=>t[P]===e)))re(V.filter((t=>t[P]!==e)));else{const n=nu(V,(e=>l===e[P]));if(!n)return;const a=null===(t=n.children)||void 0===t?void 0:t.findIndex((t=>e===t[P]));a>=0&&(n.children.splice(a,1),re([...V]))}},UPDATE_RECORD:(e,t)=>{const l=nu(V,(t=>e===t[P]));l&&(m.merge(l,t),re([...V]))}})));const re=e=>{z(e),ne.current=e,ae.current=ru(e,P)},ie=e=>{if(r)return x;const t=lu(e,(e=>x.includes(e[A])));return 1===t.length?[t[0][P]]:[]},oe=e=>{var t;return(null===(t=iu(V,e,P))||void 0===t?void 0:t.slice(0,-1))||[]},se=()=>{if(C)return ae.current;const e=[];return U.forEach((t=>{if(r){if("SHOW_ALL"===p&&!ae.current.includes(t)&&e.push(...oe(t)),"SHOW_CHILD"===p&&e.push(...oe(t)),"SHOW_PARENT"===p){const l=gr(V,t);if(l){const n=oe(t),a=ou(l,P);e.push(...n,...[t,...a].filter((e=>ae.current.includes(e))))}}}else e.push(...oe(t))})),[...new Set([...E,...e])]},de=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!d)return;const{api:t,params:l,dataKey:n,afterFetch:a,callback:r}=d;try{j(!0);const i=yield t(l);if(200===i.code){let t=Array.isArray(i.data)?i.data:null!==(e=m.get(i.data,n))&&void 0!==e?e:[];t="function"==typeof a?yield a(t):t,re(t),G(ie(t)),B({}),null==r||r(t)}}catch(e){}j(!1)})),ue=e=>`${e}|${Pr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ce=yt("search-tree"),fe={[ce]:!0,[`${ce}--lg`]:"large"===k,[`${ce}--sm`]:"small"===k};return q.default.createElement("div",{ref:D,className:J.default(fe,l),style:n},q.default.createElement("div",{ref:le,className:"topper"},w&&q.default.createElement(s.Input,{ref:_,value:Q,size:k,placeholder:h||L("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=tu(ne.current,(t=>{if(!e)return!0;const l=t[A]||"";return-1!==ue(l).indexOf(e)}));Z(e),z(t),X(C||e?ru(t,P):se())})(e.target.value)}),S&&q.default.createElement("a",{className:"trigger",onClick:()=>{te(!ee),X(ee?[]:ae.current)}},ee?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",L(ee?"qm.form.collect":"qm.form.spread"))),q.default.createElement(gn,{spinning:$},q.default.createElement(s.Tree,{fieldNames:{title:A,key:P,children:"children"},multiple:r,draggable:i,blockNode:i,checkable:r,selectable:!r,height:H,disabled:e.disabled,checkStrictly:f,selectedKeys:null!=y?y:U,checkedKeys:null!=y?y:U,expandedKeys:Y,treeData:V,loadData:c?({key:e,children:t})=>Ye(void 0,void 0,void 0,(function*(){var l;if(!d||t)return;const{api:n,params:a,dataKey:r,formatter:i=(e=>e),afterFetch:o}=d;try{const t=yield n(i(Object.assign(Object.assign({},a),{[P]:e})));if(200===t.code){let n=Array.isArray(t.data)?t.data:null!==(l=m.get(t.data,r))&&void 0!==l?l:[];n="function"==typeof o?yield o(n):n;const a=au(ne.current,e,P,n);re(a)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!Q)return!1;const t=e[A]||"";return-1!==ue(t).indexOf(Q)},onDragStart:I,onDragEnter:e=>{X(e.expandedKeys)},onDrop:e=>{const t=e.node.key,l=e.dragNode.key,n=e.node.pos.split("-"),a=e.dropPosition-Number(n[n.length-1]),r=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][P]===t)return l(e[n],n,e);e[n].children&&r(e[n].children,t,l)}},i=[...V];let o;if(r(i,l,((e,t,l)=>{l.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===a)r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,l=[];r(i,t,((t,n,a)=>{l=a,e=n})),-1===a?l.splice(e,0,o):l.splice(e+1,0,o)}else r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));re(i)},onDragEnd:e=>{null==O||O(e,V)},onExpand:(e,t)=>{ot(e)&&te(!1),ae.current.every((t=>e.includes(t)))&&te(!0),X(e),null==R||R(e,t)},onSelect:e=>{G(e);const t=lu(ne.current,(t=>e.includes(m.get(t,P))));null==N||N(r?t:t[0])},onCheck:e=>{f&&(e=e.checked),G(e),f||("SHOW_CHILD"===p&&(e=e.filter((e=>!ae.current.includes(e)))),"SHOW_PARENT"===p&&(e=e.filter(((e,t,l)=>!l.includes(eu(V,e,P))))));const t=lu(ne.current,(t=>e.includes(m.get(t,P))));null==T||T(r?t:t[0])}})))}));su.displayName="QmSearchTree";const du=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),uu=e=>{const{column:t,filters:l}=e,{$size:n,prefixCls:a,setFilters:r,clearSuperFilters:i}=q.default.useContext(Xr),{t:o}=Xe(),d=q.default.useRef(null),u=q.default.useRef(null),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[h,g]=q.default.useState(!1),[v,y]=q.default.useState({}),b=q.default.useMemo((()=>{const{dataIndex:e,filter:l}=t;return`${e}|${l.type}`}),[t]),x=q.default.useMemo((()=>{let e=!1;for(const t in l[b])if(!ot(l[b][t])||h){e=!0;break}return e}),[b,l,h]);q.default.useLayoutEffect((()=>{f&&setTimeout((()=>E()),20)}),[f]),q.default.useEffect((()=>{var e;m.isEqual(v[b],l[b])||y({[b]:l[b]||{}}),g(""===(null===(e=l[b])||void 0===e?void 0:e["=="]))}),[l]);const E=()=>{switch(t.filter.type){case"text":d.current.focus();break;case"number":u.current.focus();break;case"textarea":c.current.focus()}},C=e=>{e&&y(e),i(),r((e=>{for(const t in e){for(const l in e[t])if(ot(e[t][l])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][l])continue;delete e[t][l]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},l),v),e))),p(!1)},w={text:e=>{var t,l;return q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Input,{ref:d,size:n,placeholder:o("qm.table.filter.searchText",{text:qa(e.title)}),style:{width:"180px"},value:null!==(l=null===(t=v[b])||void 0===t?void 0:t.like)&&void 0!==l?l:"",disabled:h,onChange:e=>{const{value:t}=e.target;y((e=>Object.assign({},e,{[b]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&C()}}),q.default.createElement("div",{style:{marginTop:8}},q.default.createElement(s.Checkbox,{checked:h,onChange:e=>{const{checked:t}=e.target,l=t?"":null;y((e=>Object.assign({},e,{[b]:{"==":l,like:null}}))),g(t)}},o("qm.table.filter.nullValue"))))},textarea:e=>{var t,l;return q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Input.TextArea,{ref:c,size:n,placeholder:o("qm.table.filter.searchAreaText",{text:qa(e.title)}),style:{width:"220px"},value:null!==(l=null===(t=v[b])||void 0===t?void 0:t.likes)&&void 0!==l?l:"",disabled:h,onChange:e=>{const{value:t}=e.target;y((e=>Object.assign({},e,{[b]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),C())}}),q.default.createElement("div",{style:{marginTop:8}},q.default.createElement(s.Checkbox,{checked:h,onChange:e=>{const{checked:t}=e.target,l=t?"":null;y((e=>Object.assign({},e,{[b]:{"==":l,like:null}}))),g(t)}},o("qm.table.filter.nullValue"))))},number:e=>{const t=e=>{var t,l;return{value:null!==(l=null===(t=v[b])||void 0===t?void 0:t[e])&&void 0!==l?l:"",size:n,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||y((l=>Object.assign({},l,{[b]:Object.assign({},l[b],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&C()}}};return q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",null,"> "),q.default.createElement(s.InputNumber,je({ref:u},t(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"< "),q.default.createElement(s.InputNumber,je({},t("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"= "),q.default.createElement(s.InputNumber,je({},t("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"!="),q.default.createElement(s.InputNumber,je({},t("!="),{placeholder:o("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const t=e=>{var t;return{value:Fa(null===(t=v[b])||void 0===t?void 0:t[e],li),format:li,size:n,onChange:t=>{y((l=>Object.assign({},l,{[b]:Object.assign({},l[b],{[e]:Ha(t,li)})})))},onKeyDown:e=>{13===e.keyCode&&C()}}};return q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",null,"> "),q.default.createElement(qe,je({},t(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"< "),q.default.createElement(qe,je({},t("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"= "),q.default.createElement(qe,je({},t("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"!="),q.default.createElement(qe,je({},t("!="),{placeholder:o("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var t;const{filter:l,dictItems:n=[]}=e,a=l.items||n;return q.default.createElement("ul",null,q.default.createElement(s.Radio.Group,{style:{width:"100%"},value:null===(t=v[b])||void 0===t?void 0:t["=="],onChange:e=>{const{value:t}=e.target;y((e=>Object.assign({},e,{[b]:{"==":t}})))}},a.map((e=>q.default.createElement("li",{key:e.value},q.default.createElement(s.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var t;const{filter:l,dictItems:n=[]}=e,a=l.items||n;return q.default.createElement("ul",null,q.default.createElement(s.Checkbox.Group,{style:{width:"100%"},value:null===(t=v[b])||void 0===t?void 0:t.in,onChange:e=>{y((t=>Object.assign({},t,{[b]:{in:e}})))}},a.map((e=>q.default.createElement("li",{key:e.value},q.default.createElement(s.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var t;const{filter:l,dictItems:n=[]}=e,a=l.items||n;return q.default.createElement("div",{style:Object.assign({height:200},l.style)},q.default.createElement(su,{multiple:!0,value:(null===(t=v[b])||void 0===t?void 0:t.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));y((e=>Object.assign({},e,{[b]:{in:t}})))}}))}},S=()=>q.default.createElement(s.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},q.default.createElement(ht,{size:n,onClick:()=>(C({[b]:{}}),void g(!1))},o("qm.table.filter.reset")),q.default.createElement(ht,{type:"primary",size:n,onClick:()=>C()},o("qm.table.filter.search"))),N={"head-filter__popper":!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n},T=["cell--filter",{selected:f,actived:x}];return q.default.createElement(gs,{action:["click"],popupVisible:f,popup:(()=>{const e=t.filter.type,l=w[e];return l?q.default.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},q.default.createElement("div",null,l(t)),S()):(mt("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:J.default(N),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{p(e)},builtinPlacements:ri,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{className:J.default(T),title:o("qm.table.filter.text"),onClick:e=>e.stopPropagation()},q.default.createElement("span",{className:"svgicon icon"},q.default.createElement(du,null))))},cu=e=>{const{column:t}=e,{tableRef:l,bordered:n}=q.default.useContext(Xr),{columns:a,resizable:r,columnsChange:i=lt}=l.current.props,o=q.default.useMemo((()=>ba(t)),[t]),s={resizable:!0,"is--line":r&&!n};return q.default.createElement("div",{className:J.default(s),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n,scrollBarRef:r}=l.current,s=n.$resizableBar,d=t.offsetWidth/2,u=e.clientX,c=Ia(t,n.$table).left-r.current.scrollLeft+d;n.$table.classList.add("c--resize"),s.style.left=`${c}px`,s.style.display="block";const f=o.width||o.renderWidth;let p=f;return document.onmousemove=function(e){if("number"!=typeof f)return;const t=e.clientX-u,l=f+t;l<(o.minWidth||pi.defaultColumnWidth)||(p=Math.floor(l),s.style.left=`${t+c}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),s.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(va(a,o.dataIndex).width=p,i([...a]))},!1}})},fu=e=>{const{selectionKeys:t}=e,{tableRef:l,getRowKey:n,fetchParams:a,createTableList:r,setSelectionKeysEffect:i,setInvalidRowKeys:o,setSpinning:d,isFetch:u,isWebPagination:c}=q.default.useContext(Xr),{rowSelection:f}=l.current.props,{fetchAllRowKeys:p,selectAllOnCurrentPage:h,filterable:v,onSelectAll:y}=f,{t:b}=Xe(),x=q.default.useRef([]),E=q.default.useMemo((()=>u&&!!p),[u,p]),C=q.default.useMemo((()=>!E&&!!h),[E,h]),w=q.default.useMemo((()=>(null==v||v)&&!C),[v,C]),S=()=>{const{selectionRows:e}=l.current,{disabled:t}=f;return(t?e.filter((e=>!t(e))):e).map((e=>n(e,e.index)))},N=(()=>{const{recordsMap:e,allRowKeys:t}=l.current,{disabled:a}=f;if(E)return x.current.length?x.current:m.union(t,S());if(!C)return a?t.filter((t=>!a(e.get(t)))):t;const i=a?r().filter((e=>!a(e))).map((e=>n(e,e.index))):r().map((e=>n(e,e.index)));return m.union(i,S())})(),T=t.filter((e=>!N.includes(e))),I=t.length-T.length,O=I>0&&I<N.length,R=!!I&&I===N.length;o(T);const k=()=>Ye(void 0,void 0,void 0,(function*(){var e;const t=p;let l=[];d(!0);try{const i=yield t.api(a);if(200===i.code){l=Array.isArray(i.data)?i.data:null!==(e=m.get(i.data,t.dataKey))&&void 0!==e?e:[];const{disabled:a}=f;a&&(l=m.xor(l,r().filter((e=>a(e))).map((e=>n(e,e.index))))),x.current=l}}catch(e){}return d(!1),l})),L=e=>Ye(void 0,void 0,void 0,(function*(){let t=[];t=E?e?yield k():[]:e?N.slice(0):[],t=[...new Set([...t,...T])],i(t),null==y||y(e,t)})),P=()=>{const e=[{key:1,label:b("qm.table.selection.all"),onClick:()=>{L(!0)}},{key:2,label:b("qm.table.selection.invert"),onClick:()=>Ye(void 0,void 0,void 0,(function*(){let e=[];e=E?m.xor(t,yield k()):m.xor(t,N),e=[...new Set([...e,...T])],i(e)}))},{key:3,label:b("qm.table.selection.clear"),onClick:()=>{L(!1)}}];return q.default.createElement(s.Menu,{items:e})};return q.default.createElement("div",{className:"cell--selection"},q.default.createElement(s.Checkbox,{checked:R,indeterminate:O,disabled:!N.length,onChange:e=>L(e.target.checked)}),w&&q.default.createElement(s.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>P()},q.default.createElement(g.DownOutlined,{className:"svgicon icon"})),C&&q.default.createElement(s.Tooltip,{placement:"top",title:b("qm.table.selection.currentPage")},q.default.createElement(g.InfoCircleOutlined,{className:"info"})))},pu=e=>{const{style:t}=e,{tableRef:l,setRowExpandedKeys:n}=q.default.useContext(Xr),{expandable:a}=l.current.props,[r,i]=q.default.useState((null==a?void 0:a.defaultExpandAllRows)||!1);Ql((()=>{n(r?[...l.current.allParentRowKeys]:[])}),[r]);const o={[`${yt("expand")}--icon`]:!0,expanded:r,collapsed:!r};return q.default.createElement("span",{className:J.default(o),title:"",onClick:e=>{e.stopPropagation(),i(!r)},style:t})},mu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),hu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),gu=e=>{const{tableColumns:t}=e,{tableRef:l,prefixCls:n,layout:a,flattenColumns:r,sorter:i,filters:o,superFilters:d,selectionKeys:u,isFetch:c,isGroupSubtotal:f,treeExpandIndex:p,tableChange:h,setSorter:v,setElementStore:y,resetTableScroll:b,getStickyLeft:x,getStickyRight:E,createGroupData:C,createTableFullData:w}=q.default.useContext(Xr),{ellipsis:S,resizable:N,multipleSort:T,rowSelection:I,expandable:O}=l.current.props,[R,k]=pi.sortDirections,{tableOriginData:L}=l.current,{t:P}=Xe(),A=q.default.useRef(null),D=q.default.useMemo((()=>L.some((e=>Array.isArray(e.children)))),[L]),_=q.default.useMemo((()=>!c),[c]),F=q.default.useMemo((()=>!c),[c]),H=q.default.useMemo((()=>!(null==O?void 0:O.hideExpandAll)),[O]),M=q.default.useMemo((()=>!!I&&(c?!(!I.selectAllOnCurrentPage&&!I.fetchAllRowKeys):!I.hideSelectAll)),[c,I]);Ql((()=>{B(),h(),b()}),[i]),Ql((()=>{X(),h(),b()}),[o]),Ql((()=>{X(),h(),b()}),[d]),q.default.useEffect((()=>{!ot(i)&&rt((()=>B())),!ot(o)&&rt((()=>X()))}),[]),q.default.useLayoutEffect((()=>{$()}),[]);const $=()=>{y("$header",A.current)},j=(e,t,n)=>{var a,r,o;const{dataIndex:s,colSpan:d,rowSpan:u,fixed:c,align:f,theadAlign:p,theadClassName:m="",sorter:h,filter:g,required:v,headRender:y}=e;if(0===d)return null;const b=p||f,C=["header--column",{"col--ellipsis":null!==(a=e.ellipsis)&&void 0!==a?a:S,"col--center":"center"===b,"col--right":"right"===b,"column--required":!!v,"column-has-sorter":h,"column-has-filter":g,"column--sort":!!i[s],"cell-fix-left":"left"===c,"cell-fix-right":"right"===c,"cell-fix-left-last":"left"===c&&!(null===(r=n[t+(null!=d?d:1)])||void 0===r?void 0:r.fixed),"cell-fix-right-first":"right"===c&&!(null===(o=n[t-1])||void 0===o?void 0:o.fixed),[m]:!!m}],w={left:"left"===c?`${x(s)}px`:"",right:"right"===c?`${E(s,"thead")}px`:""},T=N&&![pi.expandableColumn,pi.selectionColumn].includes(s);return q.default.createElement("th",{key:s,className:J.default(C),colSpan:d,rowSpan:u,style:Object.assign({},w),onClick:t=>W(t,e)},q.default.createElement("div",{className:"cell--wrapper"},y?q.default.createElement("div",{className:"cell--text cell"},y(e,l.current.tableFullData)):q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"cell--text"},K(e)),g?z(e):null)),T&&q.default.createElement(cu,{column:e}))},K=e=>{const{dataIndex:t,type:n,sorter:a,title:r,description:o}=e;if(t===pi.selectionColumn&&"checkbox"===n){if("checkbox"===n)return q.default.createElement("div",{className:"cell"},M?q.default.createElement(fu,{selectionKeys:u}):P("qm.table.config.selectionText"));if("radio"===n)return q.default.createElement("div",{className:"cell"},r)}const d=[];return d.push(q.default.createElement("div",{key:0,className:"cell",title:qa(r)},l.current.isTreeTable&&t===p&&H?q.default.createElement(pu,null):null,t===pi.expandableColumn&&H?q.default.createElement(pu,null):r)),o&&d.push(q.default.createElement(s.Tooltip,{key:1,placement:"top",title:o},q.default.createElement(g.InfoCircleOutlined,{className:"tip"}))),a&&d.push(V(i[t])),d},V=e=>{const t=["svgicon cell--sorter__asc",{actived:e===R}],l=["svgicon cell--sorter__desc",{actived:e===k}];return q.default.createElement("div",{key:2,className:"cell--sorter",title:P("qm.table.sorter.text")},q.default.createElement("span",{className:J.default(t)},q.default.createElement(mu,null)),q.default.createElement("span",{className:J.default(l)},q.default.createElement(hu,null)))},z=e=>q.default.createElement(uu,{column:e,filters:o}),W=(e,t)=>{const{sorter:l,dataIndex:n}=t;if(l){const e=i[n],t=e?e===k?null:k:R;T?(delete i[n],v(Object.assign({},i,{[n]:t}))):v(Object.assign({},{[n]:t}))}},B=()=>{_&&U()},U=e=>{const t=m.pickBy(i,(e=>null!==e));Y(t),e||Object.keys(t).length||Y({index:R})},G=(e,t)=>Number.isNaN(e-t)?e.toString().localeCompare(t.toString()):e-t,Y=e=>{const{tableFullData:t}=l.current,n=((e,t)=>e.sort(((e,l)=>{for(const n in t){const a=r.find((e=>e.dataIndex===n)),i=t[n],o=ka(e,n),s=ka(l,n),d="function"!=typeof(null==a?void 0:a.sorter)?G(o,s):a.sorter(e,l);if(0!==d)return"ascend"===i?d:-d}return 0})).slice(0))(f?C(ja(t)):t,e);w(n)},X=()=>{F&&Q()},Q=()=>{const e=d.length?Ka(d):Ka(o),t=""!==e?f?C(fa(ja(L),e,D)):fa(L,e,D):L;w(t),U(!0)},Z=Sa(t),{tableBodyWidth:ee}=a;return q.default.createElement("div",{ref:A,className:`${n}--header-wrapper`},q.default.createElement("table",{className:`${n}--header`,cellSpacing:"0",cellPadding:"0",style:{width:ee?`${ee}px`:""}},q.default.createElement("colgroup",null,r.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("thead",null,(e=>e.map(((e,t)=>q.default.createElement("tr",{key:t,className:"header--row"},e.map(((t,l)=>j(t,l,e)))))))(Z))))},vu=q.default.createContext([]),yu=(e,t,l,n,a,r,i,o,s,d)=>{var u;const{clientX:c,clientY:f}=e,{top:p,height:m}=e.target.getBoundingClientRect(),h=(((null==a?void 0:a.x)||0)-c-12)/n,g=s.filter((e=>{var t,l;return null===(l=null===(t=o[e])||void 0===t?void 0:t.children)||void 0===l?void 0:l.length}));let v=bu(o,l.eventKey);if(f<p+m/2){const e=i.findIndex((e=>e===v.key)),t=i[e<=0?0:e-1];v=bu(o,t)}const y=v.key,b=v,x=v.key;let E=0,C=0;if(!g.includes(y))for(let e=0;e<h&&Eu(v);e+=1)v=v.parent,C+=1;const w=t.data,S=v.node;let N=!0;return Cu(v)&&0===v.level&&f<p+m/2&&r({dragNode:w,dropNode:S,dropPosition:-1})&&v.key===l.eventKey?E=-1:(b.children||[]).length&&g.includes(x)?r({dragNode:w,dropNode:S,dropPosition:0})?E=0:N=!1:0===C?h>-1.5?r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:0})?E=d?1:0:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1,{dropPosition:E,dropLevelOffset:C,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:x,dropContainerKey:0===E?null:(null===(u=v.parent)||void 0===u?void 0:u.key)||null,dropAllowed:N}},bu=(e,t)=>e[t],xu=e=>e.split("-"),Eu=e=>{if(e.parent){const t=xu(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1},Cu=e=>{const t=xu(e.pos);return 0===Number(t[t.length-1])},wu=({openDragSort:e})=>{const{tableRef:t,getRowKey:l,rowExpandedKeys:n,setRowExpandedKeys:a,createTableFullData:r,dataChange:i}=q.default.useContext(Xr),{tableFullData:o,allRowKeys:s,isTreeTable:d}=t.current,u=nt,c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef(null),m=q.default.useRef(),[h,g]=q.default.useState({}),[v,y]=q.default.useState(null),[b,x]=q.default.useState([]),[E,C]=q.default.useState(0),[w,S]=q.default.useState({dropPosition:null,dropLevelOffset:null,dropContainerKey:null,dropTargetKey:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),N=e=>{S((t=>Object.assign({},t,e)))};q.default.useLayoutEffect((()=>{e&&g((e=>{const t={},n=(e,a=null,r=0)=>{const i=[];return e.forEach(((e,o)=>{const s=l(e,e.index),d={index:o,key:s,level:r,node:e,parent:a,pos:(u=(null==a?void 0:a.pos)||"0",c=o,`${u}-${c}`),nodes:[...(null==a?void 0:a.nodes)||[],e]};var u,c;Array.isArray(e.children)&&(d.children=n(e.children,d,r+1)),t[s]=d,i.push(d)})),i};return n(e),t})(o))}),[o]),q.default.useEffect((()=>()=>{window.removeEventListener("dragend",O)}),[]);const T=()=>{N({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},I=()=>{null!==v&&(y(null),N({dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null})),f.current=null,p.current=null},O=e=>{R(),window.removeEventListener("dragend",O)},R=(e,t,l)=>{N({dragOverNodeKey:null}),I(),c.current=null,window.removeEventListener("dragend",O)},k=e=>{const t=e.node.eventKey,n=e.dragNode.eventKey,a=e.node.pos.split("-"),s=e.dropPosition-Number(a[a.length-1]),d=(e,t,n)=>{for(let a=0;a<e.length;a++){if(l(e[a],e[a].index)===t)return n(e[a],a,e);e[a].children&&d(e[a].children,t,n)}},u=[...o];let c;if(d(u,n,((e,t,l)=>{l.splice(t,1),c=e})),e.dropToGap){let e,l=[];d(u,t,((t,n,a)=>{l=a,e=n})),-1===s?l.splice(e,0,c):l.splice(e+1,0,c)}else d(u,t,(e=>{e.children=e.children||[],e.children.unshift(c)}));r(u),i()};return{onNodeDragStart:(e,t)=>{const{eventKey:l}=t;c.current=t,f.current={x:e.clientX,y:e.clientY};const r=((e,t)=>{if(!e)return[];const l=e.slice(),n=l.indexOf(t);return n>=0&&l.splice(n,1),l})(n,l);y(l),x(((e,t)=>{const l=[];return function e(t=[]){t.forEach((({key:t,children:n})=>{l.push(t),e(n)}))}(bu(t,e).children),l})(l,h)),C(2*pi.treeTable.textIndent),a(r),window.addEventListener("dragend",O)},onNodeDragEnter:(e,t)=>{const{eventKey:l}=t;if(p.current!==l&&(p.current=l),!c.current)return void T();const{dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:g,dropTargetPos:y,dropAllowed:x,dragOverNodeKey:C}=yu(e,c.current,t,E,f.current,u,s,h,n,!d);-1===b.indexOf(o)&&x?(m.current||(m.current={}),Object.keys(m.current).forEach((e=>{clearTimeout(m.current[e])})),c.current.eventKey!==l&&(e.persist(),m.current[l]=window.setTimeout((()=>{var e;if(null===v)return;let t=[...n];const r=bu(h,l);r&&(null===(e=r.children)||void 0===e?void 0:e.length)&&(t=((e,t)=>{const l=(e||[]).slice();return-1===l.indexOf(t)&&l.push(t),l})(n,l)),a(t)}),800)),c.current.eventKey!==o||0!==i?N({dragOverNodeKey:C,dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:g,dropTargetPos:y,dropAllowed:x}):T()):T()},onNodeDragOver:(e,t)=>{if(!c.current)return;const{dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropAllowed:o,dropTargetPos:p,dragOverNodeKey:m}=yu(e,c.current,t,E,f.current,u,s,h,n,!d);-1===b.indexOf(r)&&o&&(c.current.eventKey===r&&0===a?null===w.dropPosition&&null===w.dropLevelOffset&&null===w.dropTargetKey&&null===w.dropContainerKey&&null===w.dropTargetPos&&!1===w.dropAllowed&&null===w.dragOverNodeKey||T():l===w.dropPosition&&a===w.dropLevelOffset&&r===w.dropTargetKey&&i===w.dropContainerKey&&p===w.dropTargetPos&&o===w.dropAllowed&&m===w.dragOverNodeKey||N({dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropTargetPos:p,dropAllowed:o,dragOverNodeKey:m}))},onNodeDragLeave:(e,t)=>{p.current!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(T(),p.current=null)},onNodeDragEnd:R,onNodeDrop:(e,t,l=!1)=>{const{dropPosition:n,dropTargetKey:a,dropTargetPos:r,dropAllowed:i,dragOverNodeKey:o}=w;if(!i)return;if(N({dragOverNodeKey:null}),I(),null===a)return;const s=Object.assign(Object.assign({},((e,{dragOverNodeKey:t,dropPosition:l,keyEntities:n})=>{const a=bu(n,e);return{eventKey:e,pos:a?a.pos:"",dragOver:t===e&&0===l,dragOverGapTop:t===e&&-1===l,dragOverGapBottom:t===e&&1===l}})(a,{dropPosition:n,dragOverNodeKey:o,keyEntities:h})),{data:bu(h,a).node});-1!==b.indexOf(a)&&mt("Table Draggable","无法拖放到 `dragNode` 的子节点");const d=xu(r),u={event:e,node:s,dragNode:c.current,dragNodesKeys:[c.current.eventKey].concat(b),dropToGap:0!==n,dropPosition:n+Number(d[d.length-1])};l||k(u),c.current=null},indent:E,dropOptions:w}};function Su(){const[,e]=$.useReducer((e=>e+1),0);return e}const Nu=q.default.forwardRef(((e,t)=>{const{rowKey:l,rowIndex:n,row:a,className:r,style:i,indent:o,filter:s,dropOption:d,onNodeDragStart:u,onNodeDragEnter:c,onNodeDragOver:f,onNodeDragLeave:p,onNodeDragEnd:m,onNodeDrop:h}=e,g=q.default.useRef({eventKey:l,data:a,props:e}),v=q.default.useRef(!1),[y,b]=q.default.useState(!1),{dropPosition:x,dropLevelOffset:E,dragOverNodeKey:C,dropTargetKey:w,dropContainerKey:S}=d,N=C===l&&0===x,T=C===l&&-1===x,I=C===l&&1===x,O=a._level||0,R={};switch(x){case-1:Object.assign(R,{top:0,left:-E*o+O*o});break;case 1:Object.assign(R,{bottom:0,left:-E*o+O*o});break;case 0:Object.assign(R,{bottom:0,left:o+O*o})}const k={"body--row-draggable":!0,"body--row-dragging":y,"drop-target":w===l,"drop-container":S===l,"drag-over":N,"drag-over-gap-top":T,"drag-over-gap-bottom":I};return q.default.createElement("tr",{ref:t,"data-row-key":l,"data-row-index":n,className:J.default(r,k),style:i,draggable:!0,onMouseDown:e=>{var t;s&&(t=e.target.matches(s),v.current=t)},onDragStart:e=>{if(e.stopPropagation(),v.current)return e.preventDefault();b(!0),u(e,g.current);try{e.dataTransfer.setData("text/plain","")}catch(e){}},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),c(e,g.current)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),f(e,g.current)},onDragLeave:e=>{e.stopPropagation(),p(e,g.current)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),b(!1),h(e,g.current)},onDragEnd:e=>{e.stopPropagation(),b(!1),m(e,g.current)}},e.children,C===l&&null!==x&&null!==E&&q.default.createElement("td",{className:"drop-indicator",style:R}))}));Nu.displayName="DraggableTr";const Tu=e=>{const{selectionKeys:t,column:l,record:n,rowKey:a}=e,{tableRef:r}=q.default.useContext(Xr),{rowSelection:i}=r.current.props,o=q.default.useMemo((()=>l.type||""),[l.type]),d=e=>{var l,n;const a=null===(l=i.checkStrictly)||void 0===l||l;if(!r.current.isTreeTable||a)return!1;const o=Ea(r.current.deriveRowKeys,e);return((e,t)=>{const l=new Set(t);let n=!1,a=!1;for(const t of e)if(l.has(t)?n=!0:a=!0,n&&a)break;return n&&a})(Ua(null!==(n=null==o?void 0:o.children)&&void 0!==n?n:[]),t)};return"radio"===o?(()=>{const e=i.disabled,l=null==e?void 0:e(n),r=!l&&t[0]===a;return q.default.createElement(s.Radio,{checked:r,disabled:l})})():(()=>{const e=i.disabled,l=null==e?void 0:e(n),r=!!t.includes(a);return q.default.createElement(s.Checkbox,{checked:r,indeterminate:d(a),disabled:l})})()},Iu=e=>{const{record:t,rowKey:l,style:n}=e,{tableRef:a,rowExpandedKeys:r,setRowExpandedKeys:i}=q.default.useContext(Xr),{expandable:o={}}=a.current.props,[s]=q.default.useState("function"==typeof o.rowExpandable&&!o.rowExpandable(t)),d=q.default.useMemo((()=>r.includes(l)),[r,l]);Ql((()=>{var e;null===(e=o.onExpand)||void 0===e||e.call(o,d,t)}),[d]);const u={[`${yt("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:s};return q.default.createElement("span",{className:J.default(u),title:"",onClick:e=>{if(e.stopPropagation(),s)return;const t=d?r.filter((e=>e!==l)):[...r,l];i(t)},style:n})},Ou=q.default.forwardRef(((e,t)=>{const{size:l,defaultValue:n,value:a,min:r,max:i,prefix:o,suffix:d,placeholder:u,maxLength:c,precision:f,stringMode:p,allowClear:m,readOnly:h,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)>i&&(t=i.toString()),t&&Number(t)<r&&(t=r.toString()),f>=0&&""!==t&&(t=new ue.default(t).toFixed(f)),t},E=void 0!==a,[C,w]=q.default.useState(null!=n?n:""),S=v(E?a:C),N=y(S);Ql((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[C]);return q.default.createElement(s.Input,{ref:t,size:l,value:S,maxLength:c,prefix:o,suffix:d,placeholder:u,allowClear:m,readOnly:h,disabled:g,onChange:t=>{const l=y(t.target.value.replace(/\s+/g,""));let n=/^-?\d*(\.\d*)?$/.test(l)||""===l||"-"===l;if(0===f&&l.includes(".")&&(n=!1),r>=0&&l.startsWith("-")&&(n=!1),n){if(!p&&(Number(l)>Number.MAX_SAFE_INTEGER||Number(l)<Number.MIN_SAFE_INTEGER))return;(t=>{var l;E?null===(l=e.onChange)||void 0===l||l.call(e,t):w(t)})(l)}},onFocus:b,onBlur:()=>{var t;const l=x(N);null===(t=e.onBlur)||void 0===t||t.call(e,l,N)},onKeyUp:t=>{var l;13===t.keyCode&&(null===(l=e.onEnter)||void 0===l||l.call(e,x(N),N))}})}));Ou.displayName="InputNumber";const Ru=e=>{var t,l,n;const{multiple:a,tree:r={},defaultSelectedKeys:i,className:o,style:s,onClose:d}=e,{$size:u}=Ze(e),{t:c}=Xe(),[f,p]=q.default.useState(),[m]=q.default.useState(null===(t=r.fetch)||void 0===t?void 0:t.params),h={[`${yt("tree-helper")}--wrapper`]:!0},g=r.fetch?Object.assign(Object.assign({},dt(r.fetch,["params","valueKey","textKey"])),{params:m}):void 0;return q.default.createElement("div",{className:J.default(h,o),style:s},q.default.createElement(su,{multiple:a,fetch:g,fieldsDefine:{valueKey:null===(l=r.fetch)||void 0===l?void 0:l.valueKey,textKey:null===(n=r.fetch)||void 0===n?void 0:n.textKey},autoFocus:!0,asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:i,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>d(null),style:{marginRight:8}},c("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!f,onClick:()=>d(f)},c("qm.dialog.confirm"))))};Ru.displayName="TreeHelper";const{Search:ku}=s.Input,Lu=q.default.forwardRef(((e,t)=>{var l,n,a,r,i,o;const{column:d,record:u,rowKey:c,columnKey:f}=e,{tableRef:p,tableBodyRef:h,$size:v,flattenColumns:y,updateTableFlatData:b,doFieldValidate:x,dataChange:E}=q.default.useContext(Xr),C=q.default.useContext(vu),{t:w}=Xe(),S=Su(),{store:N,fieldAuth:T}=p.current,I=(null===(l=d.editRender)||void 0===l?void 0:l.call(d,u,d))||{},O=q.default.useRef(null),R=q.default.useRef(null),k=q.default.useRef(null),L=q.default.useRef(null),P=q.default.useRef(null),A=q.default.useRef(!1),D=q.default.useRef({}),_=q.default.useRef({}),F=q.default.useRef([]),[H,M]=q.default.useState(!1),[$,j]=q.default.useState(!1),[K,V]=q.default.useState(I.items||[]),[z,W]=q.default.useState(),B=(I.editable||m.isEqual(C,[c,f]))&&!I.disabled&&!(null===(n=T[f])||void 0===n?void 0:n.disabled),U=`${c}|${f}`,G=2===C.length?`${C[0]}|${C[1]}`:"",Y=![...N.state.required,...N.state.validate].some((({x:e,y:t})=>e===c&&t===f)),X=(null===(a=N.state.required.find((({x:e,y:t})=>e===c&&t===f)))||void 0===a?void 0:a.text)||"",Q=(null===(r=N.state.validate.find((({x:e,y:t})=>e===c&&t===f)))||void 0===r?void 0:r.text)||"",Z=N.state.edited.some((({x:e,y:t})=>e===c&&t===f)),ee=B||!Y||H||$,te=!!(null===(i=I.helper)||void 0===i?void 0:i.combinedDataIndex)&&("search-helper"===I.type||"tree-helper"===I.type),le=null===(o=I.type)||void 0===o?void 0:o.endsWith("multiple");q.default.useLayoutEffect((()=>{ee&&G===U&&re()}),[C]),q.default.useLayoutEffect((()=>{const{items:e}=I;le&&e&&ae(e.map((e=>({[_.current.valueKey]:e.value,[_.current.textKey]:e.text}))))}),[]);const ne=()=>{b(),E()},ae=e=>{F.current=e},re=()=>{var e,t,l,n;const{type:a}=I;switch(a){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===(l=L.current)||void 0===l||l.focus();break;case"tree-helper":null===(n=P.current)||void 0===n||n.focus()}},ie=()=>{var e,t,l,n;const{type:a}=I;switch(a){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===(l=L.current)||void 0===l||l.blur();break;case"tree-helper":null===(n=P.current)||void 0===n||n.blur()}};q.default.useImperativeHandle(t,(()=>({focus:re,blur:ie,isEditable:()=>!I.disabled,isOpening:()=>H})));const oe=(e,t,l)=>{const{cornerSign:n=!0}=I.extra||{};N.addToUpdated(e),n&&N.addToEdited({x:t,y:l})},se=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",de={text:(e,t,l)=>{var n;const{dataIndex:a}=t,{type:r,extra:i={},rules:o=[],onInput:d,onChange:u,onEnter:p,onBlur:m}=I,h=ka(e,a),g=Object.assign({},{minRows:1,maxRows:4},i.autoSize),y=l?{rows:g.minRows,autoSize:g}:null,b=i.password?s.Input.Password:l?s.Input.TextArea:s.Input;return q.default.createElement(b,je({ref:R,size:v,value:h,maxLength:i.maxLength,showCount:i.showCount},y,{autoComplete:i.password?"new-password":"off",placeholder:null!==(n=i.placeholder)&&void 0!==n?n:w("qm.table.editable.inputPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,suffix:i.suffix,onChange:l=>{var n;const r=null!==(n=l.target.value)&&void 0!==n?n:"";La(e,a,r),x(o,r,c,f,qa(t.title)),S(),null==d||d({[U]:r}),A.current=!0},onBlur:t=>{var l;const n=null!==(l=t.target.value)&&void 0!==l?l:"";A.current&&(A.current=!1,oe(e,c,f),null==u||u({[U]:n},e),null==m||m({[U]:n},e),ne())},onKeyUp:t=>{var l;if(13===t.keyCode&&!t.shiftKey){const n=null!==(l=t.target.value)&&void 0!==l?l:"";null==p||p({[U]:n},e)}},onKeyDown:e=>{l&&13===e.keyCode&&!e.shiftKey&&p&&e.preventDefault()}}))},textarea:(e,t)=>de.text(e,t,!0),number:(e,t)=>{var l,n;const{dataIndex:a,precision:r,formatType:i}=t,{type:o,extra:s={},rules:d=[],onInput:u,onChange:p,onEnter:m,onBlur:h}=I,g=ka(e,a);let y,b;return"finance"===i&&(y=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},b=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===i&&(y=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new ue.default(e).times(100).toNumber()}`,b=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new ue.default(e).times(.01).toString()),q.default.createElement(Ou,{ref:k,size:v,value:g,min:s.min,max:s.max,precision:r,stringMode:s.stringMode,prefix:s.prefix,suffix:null!==(l=s.suffix)&&void 0!==l?l:"percent"===i?"%":void 0,placeholder:null!==(n=s.placeholder)&&void 0!==n?n:w("qm.table.editable.inputPlaceholder"),maxLength:s.maxLength,allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,formatter:y,parser:b,onChange:l=>{La(e,a,l),x(d,l,c,f,qa(t.title)),S(),null==u||u({[U]:l}),A.current=!0},onBlur:(t,l)=>{if(!A.current)return;A.current=!1;let n=s.stringMode?t:se(t);"percent"===i&&"."===l.charAt(l.length-1)&&(n=Number(t)/100),La(e,a,n),oe(e,c,f),null==p||p({[U]:n},e),null==h||h({[U]:n},e),ne()},onEnter:(t,l)=>{let n=s.stringMode?t:se(t);"percent"===i&&"."===l.charAt(l.length-1)&&(n=Number(t)/100),null==m||m({[U]:n},e)}})},select:(e,t,l)=>{var n,a;const{dataIndex:r,dictItems:i=[]}=t,{type:o,extra:d={},rules:u=[],items:p,onChange:m,onEnter:h}=I,g=p||i,y=ka(e,r);let b=y;return q.default.createElement(s.Select,{mode:l?"multiple":void 0,size:v,popupClassName:pi.popupClassName,value:y||void 0,placeholder:null!==(n=d.placeholder)&&void 0!==n?n:w("qm.table.editable.selectPlaceholder"),allowClear:d.allowClear,listHeight:d.listHeight,maxTagCount:d.collapseTags?"responsive":void 0,maxTagTextLength:d.maxTagTextLength,disabled:d.disabled,style:{width:"100%"},showSearch:null===(a=d.filterable)||void 0===a||a,filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"";return`${n}|${Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onDropdownVisibleChange:e=>M(e),onChange:l=>{La(e,r,l),x(u,l,c,f,qa(t.title)),oe(e,c,f),null==m||m({[U]:l},e),ne()},onSelect:e=>{b=e},onInputKeyDown:t=>{13===t.keyCode&&rt((()=>null==h?void 0:h({[U]:b},e)))}},g.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>de.select(e,t,!0),date:(e,t,l)=>{var n;const{dataIndex:a}=t,{type:r,extra:i={},rules:o=[],onChange:s}=I,d=l||"exactdate",u=ka(e,a);return q.default.createElement(qe,{size:v,popupClassName:pi.popupClassName,value:null!==(n=Fa(u,rr[d]))&&void 0!==n?n:void 0,picker:ar[d],format:i.format,showTime:"datetime"===d,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:l}=i;return t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day")})(e),placeholder:i.placeholder,allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:l=>{const n=Ha(l,rr[d]);La(e,a,n),x(o,n,c,f,qa(t.title)),oe(e,c,f),null==s||s({[U]:n},e),ne()}})},datetime:(e,t)=>de.date(e,t,"datetime"),month:(e,t)=>de.date(e,t,"month"),year:(e,t)=>de.date(e,t,"year"),time:(e,t)=>{var l;const{dataIndex:n}=t,{type:a,extra:r={},rules:i=[],onChange:o}=I,s="HH:mm:ss",d=ka(e,n);return q.default.createElement(Ke,{size:v,popupClassName:pi.popupClassName,value:null!==(l=Fa(d,s))&&void 0!==l?l:void 0,format:r.format||s,placeholder:r.placeholder,allowClear:r.allowClear,disabled:r.disabled,style:{width:"100%"},onChange:l=>{const a=Ha(l,s);La(e,n,a),x(i,a,c,f,qa(t.title)),oe(e,c,f),null==o||o({[U]:a},e),ne()}})},checkbox:(e,t)=>{const{dataIndex:l}=t,{type:n,extra:a={},rules:r=[],onChange:i}=I,{trueValue:o=ei,falseValue:d=ti,disabled:u}=a,p=ka(e,l);return q.default.createElement(s.Checkbox,{checked:p===o,disabled:u,onChange:n=>{const a=n.target.checked?o:d;La(e,l,a),x(r,a,c,f,qa(t.title)),oe(e,c,f),null==i||i({[U]:a},e),ne()}})},switch:(e,t)=>{const{dataIndex:l}=t,{type:n,extra:a={},rules:r=[],onChange:i}=I,{trueValue:o=ei,falseValue:d=ti,disabled:u}=a,p=ka(e,l);return q.default.createElement(s.Switch,{checked:p===o,disabled:u,onChange:n=>{const a=n?o:d;La(e,l,a),x(r,a,c,f,qa(t.title)),oe(e,c,f),null==i||i({[U]:a},e),ne()}})},"search-helper":(e,t)=>{var l,n;const{dataIndex:a,precision:r}=t,{type:i,extra:o={},rules:s=[],helper:d={},onInput:u,onChange:p,onEnter:h}=I,g=Pa(e,te?d.combinedDataIndex:a),b=d.fieldAliasMap;b||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof b?b():b||{};Object.keys(E).includes(a)||mt("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(d.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||mt("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[a].includes("|")&&mt("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=e=>{const{filterAliasMap:t}=d,l=""!==e?e:void 0,n=("function"==typeof t?t():t)||[],r={[a]:l};return(Array.isArray(n)?n:[n]).forEach((e=>{if(m.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](l):l;else r[e]=l})),r},S=e=>{const{autoQueryAssign:t=!0}=d;t&&(D.current=C(e)),M(!0)},N=(l,n)=>{const{beforeOpen:a}=d,r=(null!=a?a:nt)({[U]:g},e,t);(null==r?void 0:r.then)?r.then((()=>{S(l),null==n||n()})).catch((()=>{})):!1!==r&&(S(l),null==n||n())},T=e=>{const t={};for(const l in E){const n=E[l];l!==a&&(t[l]=Pa(e,n))}const l=E[a]?Pa(e,E[a]):"";R(l,t);const{closed:n}=d;M(!1),null==n||n(e)},O=()=>{const{onlySelect:e=!0}=d;A.current&&R(e?"":g),M(!1)},R=(l="",n)=>{var i;if(m.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const l=n[t],a=y.find((e=>e.dataIndex===t));if(a){La(e,t,l,a.precision);const n=null===(i=a.editRender)||void 0===i?void 0:i.call(a,e,a);n&&Array.isArray(n.rules)&&x(n.rules,l,c,t,qa(a.title))}else La(e,t,l)}te&&!l&&((e,t,l,n)=>{if(!t.includes("|"))return La(e,t,l,n);const a=l.split("|")||[];t.split("|").forEach(((t,l)=>{var n;t&&La(e,t,null===(n=a[l])||void 0===n?void 0:n.trim())}))})(e,d.combinedDataIndex,""),La(e,a,l,r),x(s,l,c,f,qa(t.title)),oe(e,c,f),null==p||p({[U]:l},e),ne(),D.current={},A.current=!1,W(void 0)},k={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=d.width)&&void 0!==l?l:"60%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{O()}},P=Object.assign(Object.assign({},d),{size:v,initialValue:Object.assign({},D.current,d.initialValue),onClose:e=>{e?T(e):O()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(ku,{ref:L,value:null!=z?z:g,placeholder:null!==(n=o.placeholder)&&void 0!==n?n:w("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,onBlur:e=>{var t;const{value:l}=e.target,{onlySelect:n=!0,table:r}=d;if(A.current&&!H)return l&&n&&(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:l={}}=d,{beforeFetch:n=nt}=t.fetch;return new Promise(((a,r)=>Ye(void 0,void 0,void 0,(function*(){var i;const o=m.merge({},t.fetch.params,Object.assign(Object.assign({},l),C(e)),{currentPage:1,pageSize:500});if(!n(o))return r();j(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const l=Array.isArray(e.data)?e.data:null!==(i=m.get(e.data,t.fetch.dataKey))&&void 0!==i?i:[];a(l)}else r()}catch(e){r(e)}finally{rt((()=>j(!1)))}}))))})(l).then((e=>((e=[],t)=>{const l=e.filter((e=>Pa(e,E[a]).toString().includes(t)));if(1===l.length)return T(l[0]);N(t)})(e,l))).catch((()=>R(""))):void R(l)},onChange:e=>{const{value:t}=e.target;null==u||u({[U]:t}),A.current=!0,W(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const l=null!==(t=e.target.value)&&void 0!==t?t:"";!H&&N(l)}},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)}}),q.default.createElement(Qn,k,q.default.createElement(Vu,P)))},"search-helper-multiple":(e,t)=>{var l,n;const{dataIndex:a}=t,{type:r,items:i=[],extra:o={},rules:d=[],helper:u={},onInput:p,onChange:h,onEnter:y}=I,b=ka(e,a),E=u.fieldAliasMap;E||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes("valueKey")&&Object.keys(C).includes("textKey")||mt("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),_.current=C;const S=l=>{const{beforeOpen:n}=u,a=(null!=n?n:nt)({[U]:b},e,t);(null==a?void 0:a.then)?a.then((()=>{M(!0),null==l||l()})).catch((()=>{})):!1!==a&&(M(!0),null==l||l())},N=()=>{M(!1)},T=l=>{La(e,a,l),x(d,l,c,f,qa(t.title)),oe(e,c,f),null==h||h({[U]:l},e,F.current),ne()},O={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=u.width)&&void 0!==l?l:"60%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{N()}},R=Object.assign(Object.assign({},u),{size:v,multiple:!0,initialValue:m.merge({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:l,valueKey:n}=C;ae(m.uniqBy([...F.current.filter((e=>t.includes(e[n]))),...e],n));const a=F.current.map((e=>({text:e[l],value:e[n]}))),r=m.uniqBy([...a,...i],"value").filter((e=>t.includes(e.value)));V(r),T(r.map((e=>e.value)));const{closed:o}=u;M(!1),null==o||o(F.current)})(e,t):N()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(s.Select,{mode:"multiple",open:!1,value:b,placeholder:null!==(n=o.placeholder)&&void 0!==n?n: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&&!H&&S()},onDoubleClick:()=>{o.disabled||S()},onChange:e=>{const{valueKey:t}=C;ae(F.current.filter((l=>e.includes(l[t])))),T(e)}},K.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:o.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{S()}})))),q.default.createElement(Qn,O,q.default.createElement(Vu,R)))},"tree-helper":(e,t)=>{var l,n,a;const{dataIndex:r,precision:i}=t,{type:o,extra:s={},rules:d=[],helper:u={},onChange:p,onEnter:h}=I,g=Pa(e,te?u.combinedDataIndex:r),b=u.fieldAliasMap;b||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof b?b():b||{};Object.keys(E).includes(r)||mt("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(u.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||mt("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[r].includes("|")&&mt("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=l=>{const{beforeOpen:n}=u,a=(null!=n?n:nt)({[U]:g},e,t);(null==a?void 0:a.then)?a.then((()=>{M(!0),null==l||l()})).catch((()=>{})):!1!==a&&(M(!0),null==l||l())},S=()=>{M(!1)},N=(l="",n)=>{var a;if(m.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const l=n[t],r=y.find((e=>e.dataIndex===t));if(r){La(e,t,l,r.precision);const n=null===(a=r.editRender)||void 0===a?void 0:a.call(r,e,r);n&&Array.isArray(n.rules)&&x(n.rules,l,c,t,qa(r.title))}else La(e,t,l)}La(e,r,l,i),x(d,l,c,f,qa(t.title)),oe(e,c,f),null==p||p({[U]:l},e),ne()},T={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=u.width)&&void 0!==l?l:"40%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{S()}},O=Object.assign(Object.assign({},u),{defaultSelectedKeys:[g],size:v,onClose:e=>{e?(e=>{const t={};for(const l in E){const n=E[l];l!==r&&(t[l]=Pa(e,n))}const l=E[r]?Pa(e,E[r]):"";N(l,t);const{closed:n}=u;M(!1),null==n||n(e)})(e):S()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(ku,{ref:P,value:g,allowClear:null===(n=s.allowClear)||void 0===n||n,readOnly:s.readOnly,disabled:s.disabled,placeholder:null!==(a=s.placeholder)&&void 0!==a?a:w("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!H&&C())},onDoubleClick:()=>{C()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?C():N(""))}}),q.default.createElement(Qn,T,q.default.createElement(Ru,O)))},"tree-helper-multiple":(e,t)=>{var l,n;const{dataIndex:a}=t,{type:r,extra:i={},items:o=[],rules:d=[],helper:u={},onInput:p,onChange:h,onEnter:y}=I,b=ka(e,a),E=u.fieldAliasMap;E||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes("valueKey")&&Object.keys(C).includes("textKey")||mt("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),_.current=C;const S=l=>{const{beforeOpen:n}=u,a=(null!=n?n:nt)({[U]:b},e,t);(null==a?void 0:a.then)?a.then((()=>{M(!0),null==l||l()})).catch((()=>{})):!1!==a&&(M(!0),null==l||l())},N=()=>{M(!1)},T=l=>{La(e,a,l),x(d,l,c,f,qa(t.title)),oe(e,c,f),null==h||h({[U]:l},e,F.current),ne()},O={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=u.width)&&void 0!==l?l:"40%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{N()}},R=Object.assign(Object.assign({},u),{size:v,multiple:!0,initialValue:m.merge({},u.initialValue),defaultSelectedKeys:b,onClose:e=>{e?(e=>{const{textKey:t,valueKey:l}=C;ae(e);const n=F.current.map((e=>({text:e[t],value:e[l]})));V(n),T(n.map((e=>e.value)));const{closed:a}=u;M(!1),null==a||a(F.current)})(e):N()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(s.Select,{mode:"multiple",open:!1,value:b,placeholder:null!==(n=i.placeholder)&&void 0!==n?n:w("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,maxTagTextLength:i.maxTagTextLength,disabled:i.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!H&&S()},onDoubleClick:()=>{i.disabled||S()},onChange:e=>{const{valueKey:t}=C;ae(F.current.filter((l=>e.includes(l[t])))),T(e)}},K.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{S()}})))),q.default.createElement(Qn,O,q.default.createElement(Ru,R)))},custom:(e,t)=>{const{dataIndex:l}=t,{type:n,extra:a={},rules:r=[],render:i,onChange:o}=I;if(!i)return mt("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const s=ka(e,l),d=n=>{La(e,l,n),x(r,n,c,f,qa(t.title)),oe(e,c,f),null==o||o({[U]:n},e),ne()},u=i(e,t,d);return q.default.isValidElement(u)?q.default.cloneElement(u,{value:s,disabled:a.disabled,readOnly:a.readOnly,popupClassName:pi.popupClassName,onChange:d}):null}};return q.default.createElement(q.default.Fragment,null,ee?(()=>{const{type:e}=I,t=de[e];if(!t)return mt("Table","单元格编辑的类型 `type` 配置不正确"),null;const l=["cell--edit",{"is-error":!Y}];return q.default.createElement("div",{ref:O,className:J.default(l)},t(u,d),!Y&&q.default.createElement("div",{className:"cell-error"},X||Q))})():(()=>{const{disabled:t,extra:l={}}=I,{disabledColor:n,disabledBgColor:a}=l,r=["cell--show",{"is-cell-bg":t&&a}];return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:J.default(r),style:{color:t?n:""}},e.children),t&&a&&q.default.createElement("i",{className:"cell--bg",style:{background:a}}))})(),Z&&q.default.createElement("i",{className:"cell--sign"}))}));Lu.displayName="CellEdit";const Pu=e=>{const{text:t,options:l,showMessage:n=!0,onCopy:a}=e,{t:r}=Xe();return Sn(e.children,{onClick:i=>{const o=q.default.Children.only(e.children),d=ge.default(t,l);null==a||a(t,d),d&&n&&s.message.success(r("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};Pu.displayName="QmCopyToClipboard";const Au=q.default.forwardRef(((e,t)=>{const{column:l,row:n,rowIndex:a,columnIndex:r,rowKey:i,showTitle:o}=e,{tableRef:s,selectionKeys:d,treeExpandIndex:u,updateMark:c}=q.default.useContext(Xr),{dataIndex:f,canCopy:p,render:m,editRender:h,shouldCellUpdate:v}=l,{t:y}=Xe(),{renderText:b,getTitleFromCellNode:x}=Si(),E=q.default.useRef(null),C=ka(n,f),[w,S]=function(e,t,l){const n=$.useRef({});return"value"in n.current&&!l(n.current.condition,t)||(n.current.value=e(),n.current.condition=t),n.current.value}((()=>{const e=m?m(C,n,l,a,r):b(C,l,n);return[e,h?q.default.createElement(Lu,{ref:t,column:l,record:n,rowKey:i,columnKey:f},e):null]}),[c,n,C,m,h],((e,t)=>{if(v){const[,l]=e,[,a]=t;return v(a,l,n)}return!Xa(e,t,!0)}));q.default.useEffect((()=>{if([pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(f))return;const e=E.current.parentNode;o?e.title=x(w):e.removeAttribute("title")}),[o,w]);const N=e=>Array.isArray(e.children);return q.default.createElement("div",{ref:E,className:"cell"},(()=>{if(f===pi.expandableColumn)return q.default.createElement(Iu,{record:n,rowKey:i});if(f===pi.selectionColumn)return q.default.createElement(Tu,{selectionKeys:d,column:l,record:n,rowKey:i});if(S)return S;if(s.current.isTreeTable&&f===u)return q.default.createElement(q.default.Fragment,null,(e=n._level)?q.default.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*pi.treeTable.textIndent+"px"}}):null,q.default.createElement(Iu,{key:"expand",record:n,rowKey:i,style:N(n)?{}:{visibility:"hidden"}}),w);var e;if(p){const e=x(w);return q.default.createElement("div",{className:"cell--copy"},q.default.createElement("span",{className:"text"},w),e&&q.default.createElement(Pu,{text:e},q.default.createElement(g.CopyOutlined,{className:"icon",title:y("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return w})())}));Au.displayName="Cell";const Du={open:!1,offsetX:0,offsetY:0},_u=q.default.forwardRef(((e,t)=>{const{rowVirtualize:l}=e,{tableRef:n,getRowKey:a,prefixCls:r,tableFlatData:i,flattenColumns:o,mergedTdCells:s,setMergedCells:d}=q.default.useContext(Xr),{areaSelection:u={}}=n.current.props,{elementStore:c,scrollYLoad:f}=n.current,{t:p}=Xe(),m=q.default.useRef(document.onselectstart),h=q.default.useRef(null),g=q.default.useRef(null),v=q.default.useRef(null),y=e=>{v.current=e},[b,x]=q.default.useState(null),[E,C]=q.default.useState(null),[w,S]=q.default.useState(null),N=e=>{if(!e)return S(null);let t=!1;for(const l in e)if((null==w?void 0:w[l])!==e[l]){t=!0;break}t&&S(Object.assign({},w,e))};Ad({ref:h,handler:()=>K()}),q.default.useEffect((()=>{const e=ae.default(c.$tableBody,"mousedown",_),t=ae.default(c.$tableBody,"contextmenu",A),l=ae.default(document,"keydown",D);return()=>{e.remove(),t.remove(),l.remove()}}),[]);const T=()=>{x(null),N(null),y(null),C(null)};q.default.useImperativeHandle(t,(()=>({blur:T})));const I=e=>{let t=e;for(;t;){if(!c.$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}),R=e=>({colStart:e.colIndex,colEnd:e.colIndex+e.colspan,rowStart:e.rowIndex,rowEnd:e.rowIndex+e.rowspan}),k=e=>{let[t,l,n,a]=[1/0,-1/0,1/0,-1/0];for(const r of e)t=Math.min(t,r.rowStart),l=Math.max(l,r.rowEnd),n=Math.min(n,r.colStart),a=Math.max(a,r.colEnd);return{rowStart:t,rowEnd:l,colStart:n,colEnd:a}},L=wn((e=>{let t=k([R(e),v.current]);s.forEach((e=>{const l=i.findIndex((t=>a(t,t.index)===e.rowKey)),n=o.findIndex((t=>t.dataIndex===e.dataIndex)),r={rowStart:l,rowEnd:l+e.rowSpan,colStart:n,colEnd:n+e.colSpan};var s,d;d=r,(s=t).rowEnd<=d.rowStart||s.rowStart>=d.rowEnd||s.colEnd<=d.colStart||s.colStart>=d.colEnd||(t=k([t,r]))})),N(t)}),5),P=e=>{var t;d(e),null===(t=u.onCellMerge)||void 0===t||t.call(u,e),rt((()=>T()))},A=Qe((e=>{u.cellMerge&&b&&$(e.clientX,e.clientY)?(e.preventDefault(),j(e)):(null==E?void 0:E.open)&&K()})),D=Qe((e=>{27===e.keyCode&&T()})),_=Qe((e=>{e.stopPropagation();const t=I(e.target);if(1!==e.buttons||!t)return;K();const l=O(t);x(l);const n=R(l);y(n),N(n),document.addEventListener("mousemove",F),document.addEventListener("mouseup",H),m.current=document.onselectstart,document.onselectstart=()=>!1})),F=Qe((e=>{const t=I(e.target);t&&L(O(t))})),H=Qe((()=>{var e;null===(e=u.onSelectChange)||void 0===e||e.call(u,(()=>{const e=[];if(!b||!w)return e;for(let t=w.rowStart;t<w.rowEnd;t++)for(let l=w.colStart;l<w.colEnd;l++)e.push({rowKey:a(i[t],i[t].index),dataIndex:o[l].dataIndex,cellValue:ka(i[t],o[l].dataIndex)});return e})()),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",H),M()})),M=()=>{document.onselectstart!==m.current&&(document.onselectstart=m.current)},$=(e,t)=>{const{top:l,left:n}=c.$tableBody.parentNode.getBoundingClientRect(),[a,r]=[e-n,t-l],{el:i,et:o,ew:s,eh:d}=U();return!(a<i||a>i+s||r<o||r>o+d)},j=e=>{const{top:t,left:l,height:n}=g.current.getBoundingClientRect();C({open:!0,offsetX:e.clientX-l,offsetY:-1*(n-(e.clientY-t))})},K=()=>{C((e=>Object.assign(Object.assign({},e),{open:!1})))},V=e=>({rowIndex:i.findIndex((t=>a(t,t.index)===e.rowKey)),colIndex:o.findIndex((t=>t.dataIndex===e.dataIndex)),rowSpan:e.rowSpan,colSpan:e.colSpan}),z=()=>{if(!b||!w||(t=w,(e=b).rowIndex===t.rowStart&&e.colIndex===t.colStart&&e.rowspan===t.rowEnd-t.rowStart&&e.colspan===t.colEnd-t.colStart))return T();var e,t;const l={rowKey:a(i[w.rowStart],i[w.rowStart].index),dataIndex:o[w.colStart].dataIndex,rowSpan:w.rowEnd-w.rowStart,colSpan:w.colEnd-w.colStart};P([...s.filter((e=>!((e,t)=>{const l=V(e),n=V(t),[a,r,i,o]=[l.rowIndex,l.colIndex,l.rowIndex+l.rowSpan-1,l.colIndex+l.colSpan-1],[s,d,u,c]=[n.rowIndex,n.colIndex,n.rowIndex+n.rowSpan-1,n.colIndex+n.colSpan-1];return a<=s&&r<=d&&i>=u&&o>=c||s<=a&&d<=r&&u>=i&&c>=o})(e,l))),l])},W=()=>{const e=a(i[w.rowStart],i[w.rowStart].index),t=o[w.colStart].dataIndex;P(s.filter((l=>!(l.rowKey===e&&l.dataIndex===t))))},B=e=>{if(f){return l.measurementsCache.slice(0,e).map((e=>e.size)).reduce(((e,t)=>e+t),0)}if(e>=i.length)return c.$tableBody.parentNode.offsetHeight;const t=a(i[e],i[e].index),r=c.$tableBody.querySelector(`tbody > tr[data-row-key="${t}"]`);return r?r.offsetTop:n.current.rowHeight*e},U=()=>{const{w:e,h:t,l:l,t:n}=b,a=o.slice(0,w.colStart).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=B(w.rowStart);return{sl:l,st:n,sw:e,sh:t,el:a,et:r,ew:o.slice(0,w.colEnd).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)-a,eh:B(w.rowEnd)-r}};return q.default.createElement("div",{className:`${r}--area-select`},(()=>{if(!b||!w)return null;const{sl:e,st:t,sw:l,sh:n,el:a,et:r,ew:i,eh:o}=U(),{open:s,offsetX:d,offsetY:u}=E||Du,c=q.default.createElement("ul",{ref:h,className:"ant-dropdown-menu"},q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:z},p("qm.table.areaSelect.mergeCell")),q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:W},p("qm.table.areaSelect.cancelMerge")));return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"active-area",style:{left:e,top:t,width:l,height:n}}),q.default.createElement(gs,{popupVisible:s,popup:c,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:pi.popupClassName,builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,u+4],overflow:{adjustX:1,adjustY:1}}}},q.default.createElement("div",{ref:g,className:"checked-area",style:{left:a,top:r,width:i,height:o}})))})())}));_u.displayName="AreaSelect";const Fu=q.default.forwardRef(((e,t)=>{const{tableRef:l,getRowKey:n,prefixCls:a,tableFlatData:r,flattenColumns:i,editableColumns:o,leftFixedColumns:s,rightFixedColumns:d,derivedMergeCells:u,sorter:c,layout:f,showFooter:p,selectionKeys:h,rowExpandedKeys:g,highlightKey:v,activedCell:y,isPingLeft:b,isPingRight:x,isTableEmpty:E,isGroupSubtotal:C,setElementStore:w,setSelectionKeysEffect:S,setHighlightKey:N,setActivedCell:T,getStickyLeft:I,getStickyRight:O,setPingLeft:R,setPingRight:k,setFullScreen:L,scrollBottomDebouncer:P}=q.default.useContext(Xr),{height:A,minHeight:D,maxHeight:_,rowHeight:F,rowSelection:H,rowHighlight:M,expandable:$,stripe:j,summation:K,rowStyle:V,cellStyle:z,spanMethod:W,tableConfig:B,areaSelection:U,ellipsis:G,showHeader:Y,rowDraggable:X,onRowClick:Q,onRowDblclick:Z,onRowContextmenu:ee,onRowEnter:te}=l.current.props,le=q.default.useRef(null),ne=q.default.useRef({}),re=q.default.useRef(null),ie=q.default.useRef({prevST:0,prevSL:0}),{onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:de,onNodeDragLeave:ue,onNodeDragEnd:ce,onNodeDrop:fe,indent:pe,dropOptions:me}=wu({openDragSort:X}),{rowVirtualizer:he,columnVirtualizer:ge,virtualRows:ve,virtualColumns:ye,resetItemXSize:be,getYIndexes:xe,virtualTranslateY:Ee,virtualTranslateX:Ce,calcVirtualYSize:we,calcVirtualXSize:Se,scrollToYIndex:Ne}=((e,t)=>{var l;const{tableRef:n}=q.default.useContext(Xr),{props:a,scrollBarRef:r,rowHeight:i}=n.current,o=(null===(l=a.tableConfig)||void 0===l?void 0:l.overscan)||1,s=q.default.useMemo((()=>{var e,t;return null!==(t=null===(e=r.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null}),[r.current]),d=q.default.useMemo((()=>{const e=[],l=[];return t.forEach(((t,n)=>{"left"===t.fixed&&e.push(n),"right"===t.fixed&&l.push(n)})),[e,l]}),[t]),u=Rd({count:e.length,getScrollElement:()=>s,estimateSize:()=>i,indexAttribute:"data-row-index",overscan:o,enabled:n.current.scrollYLoad}),c=u.getVirtualItems(),f=Rd({horizontal:!0,count:t.length,getScrollElement:()=>s,estimateSize:e=>t[e].width||t[e].renderWidth||0,indexAttribute:"data-col-index",overscan:o,enabled:n.current.scrollXLoad,rangeExtractor:e=>[...new Set([...d[0],...bd(e),...d[1]])]}),p=f.getVirtualItems();return{rowVirtualizer:u,columnVirtualizer:f,virtualRows:c,virtualColumns:p,resetItemXSize:e=>{e.forEach(((e,t)=>{f.resizeItem(t,e.width||e.renderWidth||pi.defaultColumnWidth)}))},getYIndexes:()=>u.getVirtualIndexes()||[],getXIndexes:()=>f.getVirtualIndexes()||[],virtualTranslateY:()=>{var e,t;return null!==(t=null===(e=c[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},virtualTranslateX:()=>{var e,t,l,n,a,r,i;const o=d[0].length;return o?(null===(l=p[o])||void 0===l?void 0:l.index)===o?null!==(a=null===(n=p[0])||void 0===n?void 0:n.start)&&void 0!==a?a:0:(null!==(i=null===(r=p[o])||void 0===r?void 0:r.start)&&void 0!==i?i:0)-p.slice(0,o).reduce(((e,t)=>e+t.size),0):null!==(t=null===(e=p[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},calcVirtualYSize:()=>u.getTotalSize()||void 0,calcVirtualXSize:()=>f.getTotalSize()||void 0,scrollToYIndex:e=>{u.scrollToIndex(e)},scrollToXIndex:e=>{f.scrollToIndex(e)}}})(r,i),Te=xe(),Ie=e=>{if(e&&!G)return he.measureElement(e)},Oe=q.default.useMemo((()=>u.length&&l.current.scrollYLoad?((e,t)=>{const l=[],n=new Set(t);return e.forEach((({row:e,col:t,rowSpan:a,colSpan:r})=>{const i=e+a-1,o=[];for(let t=e;t<=i;t++)n.has(t)&&o.push(t);if(0===o.length)return;const s=o.length;o.forEach(((e,n)=>{0===n&&l.push({row:e,col:t,rowSpan:s,colSpan:r});for(let a=t;a<t+r;a++)0===n&&a===t||l.push({row:e,col:a,rowSpan:0,colSpan:0})}))})),l})(u,Te):u),[u,Te.join(",")]),[Re,ke]=q.default.useState([]),Le=Su();Ad({ref:le,omitClassNames:[`.${pi.popupClassName}`],handler:()=>{var e;ze([]),null===(e=re.current)||void 0===e||e.blur()}}),q.default.useImperativeHandle(t,(()=>({setClickedValues:ze,createFocus:Me,forceUpdate:Le,resetItemXSize:be,scrollToYIndex:Ne}))),Ql((()=>{Re.length&&l.current.tableManager.focus(l.current.uid)}),[Re]),q.default.useLayoutEffect((()=>{He();const e=ae.default(document,"keydown",De);return()=>e.remove()}),[]);const Pe=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:l,tableFullHeight:n,tableAutoHeight:a}=f,r={};return E&&Object.assign(r,{minHeight:"100px"}),D&&Object.assign(r,{minHeight:Oa(D)-e-l+"px"}),_&&Object.assign(r,{maxHeight:Oa(_)-e-l+"px"}),A||n||a?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${t}px`}):r}),[A,_,D,E,f]),Ae=Qe((e=>{const{elementStore:t}=l.current,{prevST:n,prevSL:a}=ie.current,{scrollTop:r,scrollLeft:i}=e;if(i!==a){Y&&(t.$header.scrollLeft=i),p&&(t.$footer.scrollLeft=i);const e=i>0,l=Math.ceil(i)+f.tableWidth<f.tableBodyWidth;b!==e&&R(e),x!==l&&k(l)}r!==n&&Math.ceil(r)+f.viewportHeight>=le.current.parentNode.offsetHeight&&P({type:"scroll",target:e,preventDefault:lt,stopPropagation:lt}),ie.current={prevST:r,prevSL:i}})),De=Qe((e=>{var t,a,i,s,d,u,c;const{keyCode:f}=e;if(l.current.uid===(null===(t=l.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id)&&(27===f&&(ze([]),N(""),T({}),L(!1)),Re.length&&(sn(document.activeElement,le.current)||"INPUT"!==(null===(a=document.activeElement)||void 0===a?void 0:a.tagName)))){if(13===f&&("radio"===(null==H?void 0:H.type)||M)){const t=null!==(s=null!==(i=h[0])&&void 0!==i?i:v)&&void 0!==s?s:null,l=null!==(d=r.find((e=>n(e,e.index)===t)))&&void 0!==d?d:null;l&&(null==te||te(l,e))}if(!je(Re[0],Re[1])){if(38===f||40===f){en(e);const t=r.length;let l=r.findIndex((e=>n(e,e.index)===Re[0]));const a=38===f?(--l+t)%t:++l%t,i=r[a],o=n(i,i.index),s=qe(o,Re[1]);"radio"!==(null==H?void 0:H.type)||(null===(u=H.disabled)||void 0===u?void 0:u.call(H,i))||s||S([o]),!M||(null===(c=M.disabled)||void 0===c?void 0:c.call(M,i))||s||N(o),_e(38===f?"top":"bottom",a),$e(...Re),ze([o,Re[1]])}if(9===f||e.shiftKey&&9===f){if(en(e),!o.length)return ze([]);const t=o.length;let l=o.findIndex((e=>e.dataIndex===Re[1]));const n=e.shiftKey&&9===f?(--l+t)%t:++l%t;$e(...Re),Fe(e.shiftKey&&9===f?"left":"right",n),ze([Re[0],o[n].dataIndex])}}}})),_e=(e,t)=>{const{scrollBarRef:n,scrollYLoad:a}=l.current;if(a)return he.scrollToIndex(t);const i=r.length,o=t,s=le.current.querySelectorAll("tbody > tr"),d=r.map(((e,t)=>t)).slice(0,o).reduce(((e,t)=>e+s[t].offsetHeight),0),u=s[o].offsetHeight;"top"===e?d<n.current.scrollTop?n.current.SET_SCROLL_TOP(d):t===i-1&&n.current.SET_SCROLL_TOP(d-(f.viewportHeight-u)):d+u>n.current.scrollTop+f.viewportHeight?n.current.SET_SCROLL_TOP(d-(f.viewportHeight-u)):0===t&&n.current.SET_SCROLL_TOP(d)},Fe=(e,t)=>{const{scrollBarRef:n}=l.current,a=o.length,r=i.findIndex((e=>e.dataIndex===o[t].dataIndex)),u=i.slice(0,r).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),c=i[r].width||i[r].renderWidth,p=s.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),m=d.reduce(((e,t)=>e+(t.width||t.renderWidth)),0);"left"===e?u<n.current.scrollLeft+p?n.current.SET_SCROLL_LEFT(u-p):t===a-1&&n.current.SET_SCROLL_LEFT(u-(f.tableWidth-c)+m):u+c>n.current.scrollLeft+(f.tableWidth-m)?n.current.SET_SCROLL_LEFT(u-(f.tableWidth-c)+m):0===t&&n.current.SET_SCROLL_LEFT(u-p)},He=()=>{w("$tableBody",le.current)},Me=(e,t)=>{var l;null===(l=ne.current[`${e}-${t}`])||void 0===l||l.focus()},$e=(e,t)=>{var l;null===(l=ne.current[`${e}-${t}`])||void 0===l||l.blur()},qe=(e,t)=>{var l,n;return null!==(n=null===(l=ne.current[`${e}-${t}`])||void 0===l?void 0:l.isEditable())&&void 0!==n&&n},je=(e,t)=>{var l,n;return null!==(n=null===(l=ne.current[`${e}-${t}`])||void 0===l?void 0:l.isOpening())&&void 0!==n&&n},Ke=e=>{const t=K.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ve=(e,t,a)=>{var r;const{dataIndex:i}=a;if([pi.expandableColumn,pi.operationColumn].includes(i))return;const o=n(t,t.index);ze([o,i]);const s=qe(o,i),{type:d,selectByClickRow:u=!0,disabled:c=lt}=H||{};!d||c(t)||s||(u||i===pi.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:a=!0,onSelect:r}=H||{};if("radio"===n&&S([e]),"checkbox"===n){const n=!h.includes(e),i=l.current.isTreeTable&&!a?Be(e,h,n):We(e,h,n);S(i),null==r||r(n,t,i)}})(o,t),[pi.selectionColumn].includes(i)||(!M||(null===(r=M.disabled)||void 0===r?void 0:r.call(M,t))||s||N(o),null==Q||Q(t,a,e))},ze=e=>{m.isEqual(e,Re)||ke(e)},We=(e,t,l)=>l?[...t,e]:t.filter((t=>t!==e)),Be=(e,t,n)=>{var a;const{disabled:r}=H||{},{deriveRowKeys:i,recordsMap:o}=l.current,s=Ea(i,e);let d=[],u=Ua((null==s?void 0:s.children)||[]);r&&(u=u.filter((e=>!o.has(e)||!r(o.get(e))))),d=n?[...new Set([...t,e,...u])]:t.filter((t=>![e,...u].includes(t)));return((null===(a=Wa(i,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ea(i,e),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>d.includes(e.rowKey)));d=n?[...d,e]:d.filter((t=>t!==e))})),d},Ue=(e,t,n)=>{const{scrollXLoad:a}=l.current,{disabled:r}=H||{},o=["body--row",Object.assign({"body--row-striped":j&&t%2!=0,"body--row-selected":h.includes(n)&&!(null==r?void 0:r(e)),"body--row-current":v===n},C?Ke(e._group):null)],s=(a?ye:i).map(((l,r)=>Ge(a?i[l.index]:l,a?l.index:r,e,t,n)));return X?q.default.createElement(Nu,{key:n,ref:Ie,className:J.default(o),rowKey:n,rowIndex:t,row:e,indent:pe,filter:".cell--edit input",dropOption:me,onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:de,onNodeDragLeave:ue,onNodeDragEnd:ce,onNodeDrop:fe},s):q.default.createElement("tr",{key:n,ref:Ie,"data-row-key":n,"data-row-index":t,className:J.default(o)},s)},Ge=(e,t,l,n,a)=>{var r,i,o;const{dataIndex:u,fixed:f,align:p,className:m=""}=e,{rowSpan:h,colSpan:g}=Ye(l,e,n,t);if(!h||!g)return null;const v=null!==(r=e.ellipsis)&&void 0!==r?r:G,b=["body--column",{"col--ellipsis":v,"col--center":"center"===p,"col--right":"right"===p,"col-active":y.rowKey===a&&y.dataIndex===u,"column--sort":!!c[u],"cell-fix-left":"left"===f,"cell-fix-right":"right"===f,"cell-fix-left-last":"left"===f&&(null===(i=s[s.length-g])||void 0===i?void 0:i.dataIndex)===u,"cell-fix-right-first":"right"===f&&(null===(o=d[0])||void 0===o?void 0:o.dataIndex)===u,[m]:!!m}],x={left:"left"===f?`${I(u)}px`:"",right:"right"===f?`${O(u)}px`:""},E=V?"function"==typeof V?V(l,n):V:null,w=z?"function"==typeof z?z(l,e,n,t):z:null,S=C?(e=>{var t;const{backgroundColor:l,color:n}=null!==(t=K.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:l,color:n}})(l._group):null,N=Object.assign({},x,{height:F},S,E,w);return q.default.createElement("td",{key:u,"data-col-index":t,rowSpan:h>1?h:void 0,colSpan:g>1?g:void 0,className:J.default(b),style:N,onClick:t=>Ve(t,l,e),onDoubleClick:t=>((e,t,l)=>{const{dataIndex:n}=l;[pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(n)||null==Z||Z(t,l,e)})(t,l,e),onContextMenu:t=>((e,t,l)=>{const{dataIndex:n}=l;[pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(n)||null==ee||ee(t,l,e)})(t,l,e)},q.default.createElement(Au,{ref:e=>ne.current[`${a}-${u}`]=e,row:l,column:e,rowIndex:n,columnIndex:t,rowKey:a,showTitle:v}))},Ye=(e,t,l,n)=>{var a;let i=1,o=1;const s=W;if("function"==typeof s){const d=s({row:e,column:t,rowIndex:l,columnIndex:n,tableData:r});Array.isArray(d)?(i=d[0],o=d[1]):m.isPlainObject(d)&&(i=d.rowSpan,o=d.colSpan);const u=null!==(a=Te[0])&&void 0!==a?a:0;if(e===r[u]&&0===i)for(let e=u;e<r.length;e++){const l=s({row:r[e],column:t,rowIndex:e,columnIndex:n,tableData:r});if((Array.isArray(l)?l[0]:l.rowSpan)>0)break;i++}}if(Oe.length>0){const e=Oe.find((e=>e.row===l&&e.col===n));e&&(i=e.rowSpan,o=e.colSpan)}return{rowSpan:i,colSpan:o}};return q.default.createElement(q.default.Fragment,null,q.default.createElement(_n,{ref:l.current.scrollBarRef,wrapClassName:`${a}--body-wrapper`,wrapStyle:Pe,innerStyle:{height:we(),width:Se()},showTopScrollbar:null==B?void 0:B.doubleXScrollbar,onScroll:Ae},q.default.createElement(vu.Provider,{value:Re},q.default.createElement("table",{ref:le,style:{width:0,marginTop:Ee(),marginLeft:Ce()},className:J.default(`${a}--body`,{"virtual-container":l.current.scrollYLoad||l.current.scrollXLoad}),tabIndex:-1,cellSpacing:"0",cellPadding:"0"},(()=>{const{scrollXLoad:e}=l.current;return q.default.createElement("colgroup",null,(e?ye:i).map((t=>{const{dataIndex:l,width:n,renderWidth:a}=e?i[t.index]:t;return q.default.createElement("col",{key:l,style:{width:`${n||a}px`,minWidth:`${n||a}px`}})})))})(),q.default.createElement("tbody",null,(e=>{const{scrollYLoad:t,scrollXLoad:a}=l.current,o=[];return(t?e:r).forEach(((e,l)=>{const s=t?r[e.index]:e,d=t?e.index:l,u=n(s,s.index);if(o.push(Ue(s,d,u)),null==$?void 0:$.expandedRowRender){const{expandedRowClassName:e,rowExpandable:t=nt}=$;g.includes(u)&&t(s)&&o.push(q.default.createElement("tr",{key:`expand_${u}`,className:"body--row-expanded"},q.default.createElement("td",{colSpan:(a?ye:i).length,className:"body--column",style:{paddingLeft:H?2*pi.selectionColumnWidth:pi.selectionColumnWidth}},q.default.createElement("div",{className:J.default("cell",e)},$.expandedRowRender(s,d)))))}})),o})(ve)))),!!U&&q.default.createElement(_u,{ref:re,rowVirtualize:he})))}));Fu.displayName="TableBody";const Hu=()=>{const{tableRef:e,prefixCls:t,sorter:l,layout:n,flattenColumns:a,leftFixedColumns:r,rightFixedColumns:i,summationRows:o,setElementStore:s,getStickyLeft:d,getStickyRight:u}=q.default.useContext(Xr),{footRender:c}=e.current.props,{t:f}=Xe(),p=q.default.useRef(null);q.default.useLayoutEffect((()=>{m()}),[]);const m=()=>{s("$footer",p.current)},h=(t,n,a)=>{var o,s;const{dataIndex:c,fixed:p,align:m,summation:h}=t,g=["footer--column","col--ellipsis",{"col--center":"center"===m,"col--right":"right"===m,"column--sort":!!l[c],"cell-fix-left":"left"===p,"cell-fix-right":"right"===p,"cell-fix-left-last":"left"===p&&(null===(o=r[r.length-1])||void 0===o?void 0:o.dataIndex)===c,"cell-fix-right-first":"right"===p&&(null===(s=i[0])||void 0===s?void 0:s.dataIndex)===c}],v={left:"left"===p?`${d(c)}px`:"",right:"right"===p?`${u(c)}px`:""},y=(null==h?void 0:h.render)?h.render(e.current.tableFullData):ka(n,`${c}_text`),b=0===a&&""===y?f("qm.table.config.summaryText"):y;return q.default.createElement("td",{key:c,title:b,className:J.default(g),style:Object.assign({},v)},q.default.createElement("div",{className:"cell"},b))},{tableBodyWidth:g}=n;return q.default.createElement("div",{ref:p,className:`${t}--footer-wrapper`},c?c(a,e.current.tableFullData):q.default.createElement("table",{className:`${t}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:g?`${g}px`:""}},q.default.createElement("colgroup",null,a.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("tfoot",null,o.map(((e,t)=>q.default.createElement("tr",{key:t,className:"footer--row"},a.map(((t,l)=>h(t,e,l)))))))))};var Mu;!function(e){e.small="small",e.middle="default",e.large="default"}(Mu||(Mu={}));const $u=e=>{var t,l,n,a;const{current:r,pageSize:i,total:o,onChange:d}=e,{global:u}=q.default.useContext(xe),{tableRef:c,prefixCls:f,$size:p,setElementStore:m}=q.default.useContext(Xr),{uniqueKey:h,paginationConfig:g,infoBarConfig:v}=c.current.props,y=q.default.useRef(null),b=q.default.useMemo((()=>h?`tablePager_${h}`:""),[h]);q.default.useLayoutEffect((()=>{x(),S()}),[]);const x=()=>{m("$pager",y.current)},E=null!==(t=null==g?void 0:g.showSizeChanger)&&void 0!==t?t:pi.pagination.showSizeChanger,C=null!==(l=null==g?void 0:g.showQuickJumper)&&void 0!==l?l:pi.pagination.showQuickJumper,w=(null==g?void 0:g.pageSizeOptions)||(null===(a=null===(n=null==u?void 0:u.table)||void 0===n?void 0:n.pagination)||void 0===a?void 0:a.pageSizeOptions)||pi.pagination.pageSizeOptions,S=()=>Ye(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield N(b);e&&e!==i&&(d(r,e),localStorage.setItem(b,e.toString()))})),N=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==u?void 0:u.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),T=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==u?void 0:u.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),I={[`${f}-pager`]:!0};return q.default.createElement("div",{ref:y,className:J.default(I)},q.default.createElement("div",{className:"pager-alert"},"bottom"===(null==v?void 0:v.position)&&q.default.createElement(Ei,{total:o})),q.default.createElement(s.Pagination,{size:Mu[p],showSizeChanger:E,showQuickJumper:C,pageSizeOptions:w,current:r,pageSize:i,total:o,onChange:(e,t)=>{d(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},qu=()=>{const{prefixCls:e,layout:t}=q.default.useContext(Xr),l=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:l}=t;return{top:`${e}px`,height:`${l}px`}}),[t]);return q.default.createElement("div",{className:`${e}--empty`,style:l},q.default.createElement(hn,null))},ju=()=>{const{prefixCls:e,setElementStore:t}=q.default.useContext(Xr),l=q.default.useRef(null);q.default.useLayoutEffect((()=>{n()}),[]);const n=()=>{t("$resizableBar",l.current)};return q.default.createElement("div",{ref:l,className:`${e}--resizable-bar`})},Ku=q.default.forwardRef(((e,t)=>{const l=Ne(Zr,e),{rowKey:n,columns:a,loading:r,resizable:i,customClass:o,areaSelection:s,tablePrint:d,exportExcel:u,infoBarConfig:c,topSpaceAlign:f,showTableInfo:p,showFullScreen:h,showRefresh:g,showToolBox:v,showHeader:y,className:b,style:x}=l,{$size:E}=Ze(l),C=q.default.useRef(null),w=q.default.useRef(null),S=q.default.useRef(null),N=q.default.useRef(null),T=q.default.useRef(null),I=yt("table"),O=Qe(((e,t)=>{const l="function"==typeof n?n(e,t):null==e?void 0:e[n];return void 0===l?(mt("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l})),{tableRef:R,tableFullData:k,setElementStore:L,setOriginColumns:P,setTableFullData:A,setTableOriginData:D,setAllTableData:_,setDeriveRowKeys:F,setInvalidRowKeys:H,setFieldAuth:M,setColumnsDefined:$,setScrollXLoad:j,setScrollYLoad:K,setResizeState:V,setHandleState:z,setSummaries:W,setSelectionRows:B,setRecordsMap:U,setUnMounted:G,clearElementStore:Y,clearRecordsMap:X}=((e,{getRowKey:t,$size:l})=>{const{rowHeight:n,dynamicThead:a}=e,r=q.default.useRef({props:e,uid:di(),tableManager:ci,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],allParentRowKeys:[],deriveRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!a,scrollBarRef:q.default.createRef(),rowHeight:n||pi.rowHeightMaps[l],store:new fi,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:!Je&&/MSIE|Trident/.test(navigator.userAgent)});var i;i=e,r.current.props=i;const o=(e,l,n="",a=0)=>e.map((e=>{const r=t(e,e.index),i=n?`${n}.${e.index+1}`:`${e.index+1}`,s={level:a,rowKey:r,indexPath:i};return e.indexPath=i,e._level=a,e._parentRowKey=a?l:null,Array.isArray(e.children)&&(s.children=o(e.children,r,i,a+1)),l?Object.assign(s,{parentRowKey:l}):s}));return Object.assign(Object.assign({tableRef:r},r.current),{setElementStore:(e,t)=>{r.current.elementStore[e]=t},setOriginColumns:e=>{r.current.originColumns=e},setTableFullData:e=>{r.current.tableFullData=e},setTableOriginData:e=>{r.current.tableOriginData=e},setAllTableData:e=>{const l=Ca(e);r.current.allTableData=l,r.current.allRowKeys=l.map((e=>t(e,e.index)))},setDeriveRowKeys:e=>{const l=e.some((e=>Array.isArray(e.children)));r.current.isTreeTable=l,r.current.deriveRowKeys=l?o(e,""):[],r.current.allParentRowKeys=l?wa(e,(e=>t(e,e.index))):[]},setInvalidRowKeys:e=>{r.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{r.current.fieldAuth[e]=t},setColumnsDefined:e=>{r.current.columnsDefined=e},setResizeState:e=>{r.current.resizeState=e},setHandleState:e=>{r.current.handleState=e},setSummaries:e=>{r.current.summaries=e},setScrollXLoad:e=>{r.current.scrollXLoad=e},setScrollYLoad:e=>{r.current.scrollYLoad=e},setSelectionRows:e=>{r.current.selectionRows=e},setRecordsMap:(e,t)=>{r.current.recordsMap.set(e,t)},setUnMounted:e=>{r.current.unMounted=e},clearElementStore:()=>{for(const e in r.current.elementStore)r.current.elementStore[e]=null},clearRecordsMap:()=>{r.current.recordsMap.clear()}})})(l,{getRowKey:O,$size:E}),{tableFlatData:Q,setTableFlatData:Z,filters:ee,setFilters:te,sorter:le,setSorter:ne,superFilters:ae,setSuperFilters:re,pagination:ie,setPagination:oe,selectionKeys:se,setSelectionKeys:de,rowExpandedKeys:ue,setRowExpandedKeys:ce,highlightKey:fe,setHighlightKey:pe,updateMark:me,forceUpdate:he,activedCell:ge,setActivedCell:ve,mergedTdCells:ye,setMergedCells:be,layout:Ee,setLayout:Ce,permission:we,setPermission:Se,spinning:Te,setSpinning:Ie,isPingLeft:Oe,setPingLeft:Re,isPingRight:ke,setPingRight:Le,isFullScreen:Pe,setFullScreen:Ae,updateTableFlatData:De}=(e=>{var t,l,n,a,r,i,o,s,d,u,c;const{uniqueKey:f,initialSorter:p={},initialFilter:h={},paginationConfig:g,rowSelection:v,expandable:y,rowHighlight:b,mergedCells:x}=e,{global:E}=q.default.useContext(xe),C={current:null!==(t=null==g?void 0:g.current)&&void 0!==t?t:pi.pagination.current,pageSize:null!==(i=null!==(n=null!==(l=(()=>{if(f)return Number(localStorage.getItem(`tablePager_${f}`))||void 0})())&&void 0!==l?l:null==g?void 0:g.pageSize)&&void 0!==n?n:null===(r=null===(a=null==E?void 0:E.table)||void 0===a?void 0:a.pagination)||void 0===r?void 0:r.pageSize)&&void 0!==i?i:pi.pagination.pageSize,total:0},w=null!==(s=null!==(o=null==v?void 0:v.selectedRowKeys)&&void 0!==o?o:null==v?void 0:v.defaultSelectedRowKeys)&&void 0!==s?s:[],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]=q.default.useState([]),[I,O]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),h),[R,k]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),p),[L,P]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),[]),[A,D]=q.default.useState(C),[_,F]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),w),[H,M]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),S),[$,j]=q.default.useState(null!==(c=null==b?void 0:b.currentRowKey)&&void 0!==c?c:""),[K,V]=q.default.useReducer((e=>e+1),0),[z,W]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),{}),[B,U]=hi([],{value:x}),[G,Y]=q.default.useState({gutterWidth:0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[X,Q]=q.default.useState({export:!0,import:!0,print:!0}),[Z,J]=q.default.useState(!1),[ee,te]=q.default.useState(!1),[le,ne]=q.default.useState(!1),[ae,re]=q.default.useState(!1);return{tableFlatData:N,setTableFlatData:T,filters:I,setFilters:O,sorter:R,setSorter:k,superFilters:L,setSuperFilters:P,pagination:A,setPagination:D,selectionKeys:_,setSelectionKeys:F,rowExpandedKeys:H,setRowExpandedKeys:M,highlightKey:$,setHighlightKey:j,updateMark:K,forceUpdate:V,activedCell:z,setActivedCell:W,mergedTdCells:B,setMergedCells:U,layout:G,permission:X,setPermission:Q,setLayout:Y,spinning:Z,setSpinning:J,isPingLeft:ee,setPingLeft:te,isPingRight:le,setPingRight:ne,isFullScreen:ae,setFullScreen:re,updateTableFlatData:()=>T([...N])}})(l),{isFetch:_e,isWebPagination:Fe,isScrollPagination:He,showPagination:Me,tableColumns:$e,flattenColumns:qe,editableColumns:Ke,summationColumns:Ve,leftFixedColumns:ze,rightFixedColumns:We,derivedMergeCells:Be,treeExpandIndex:Ue,showSummary:Ge,showFooter:Xe,isHeadGroup:et,bordered:tt,isHeadSorter:lt,isHeadFilter:nt,isServiceSummation:it,isSelectCollection:ot,isTableImport:st,isTableClipboard:dt,isSuperSearch:ct,isFastSearch:ft,isPivotGrid:pt,isGroupSummary:ht,isGroupSubtotal:gt,isTableEmpty:vt,summationRows:bt,fetchParams:xt}=vi(l,{getRowKey:O,tableRef:R,tableFullData:k,tableFlatData:Q,updateMark:me,sorter:le,filters:ee,superFilters:ae,selectionKeys:se,pagination:ie,mergedTdCells:ye}),{createElementStore:Et,tableStyles:Ct,getSpan:wt,getStickyLeft:St,getStickyRight:Nt,scrollXToColumn:Tt,scrollYToRecord:It,calcTableHeight:Ot,resetTableScroll:Rt,doLayout:kt}=bi(l,{getRowKey:O,tableRef:R,topElementRef:C,tableElementRef:w,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,leftFixedColumns:ze,derivedMergeCells:Be,tableFlatData:Q,layout:Ee,showFooter:Xe,showPagination:Me,isFullScreen:Pe,setLayout:Ce,setElementStore:L}),{initialTable:Lt,checkDataIndex:Pt,createTableFullData:At,getTableData:Dt,createTableList:_t,createTableData:Ft,createGroupData:Ht,setSelectionKeysEffect:Mt,doFieldValidate:$t,getTableLog:qt,dataChange:jt,tableChange:Kt,toLastPage:Vt,toFirstPage:zt,getPageCount:Wt,pagerChangeHandle:Bt,scrollBottomDebouncer:Ut,clearTableSorter:Gt,clearTableFilter:Yt,clearSuperFilters:Xt,clearRowSelection:Qt,clearRowHighlight:Zt,clearTableLog:Jt,destroy:el}=yi(l,{getRowKey:O,tableRef:R,tableElementRef:w,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,tableFullData:k,pagination:ie,layout:Ee,filters:ee,sorter:le,superFilters:ae,fetchParams:xt,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,summationColumns:Ve,isFetch:_e,isWebPagination:Fe,isScrollPagination:He,isServiceSummation:it,isGroupSubtotal:gt,doLayout:kt,setTableFlatData:Z,setTableFullData:A,setTableOriginData:D,setAllTableData:_,setDeriveRowKeys:F,setPagination:oe,setPingRight:Le,setPingLeft:Re,setSpinning:Ie,setSorter:ne,setFilters:te,setSuperFilters:re,setSelectionKeys:de,setRowExpandedKeys:ce,setHighlightKey:pe,setSelectionRows:B,setScrollXLoad:j,setScrollYLoad:K,setFieldAuth:M,setResizeState:V,setSummaries:W,setPermission:Se,setRecordsMap:U,resetTableScroll:Rt,clearElementStore:Y,clearRecordsMap:X});((e,t)=>{const{columns:l,summation:n,rowSelection:a,expandable:r,rowHighlight:i}=e,{tableRef:o,tableBodyRef:s,$size:d,pagination:u,selectionKeys:c,rowExpandedKeys:f,highlightKey:p,summationRows:h,showSummary:g,isWebPagination:v,isScrollPagination:y,checkDataIndex:b,toLastPage:x,toFirstPage:E,getPageCount:C,setHandleState:w,scrollYToRecord:S,setSelectionKeysEffect:N,setOriginColumns:T,setRowExpandedKeys:I,setHighlightKey:O,setResizeState:R,setUnMounted:k,calcTableHeight:L,initialTable:P,destroy:A}=t,D=q.default.useRef(h);Ql((()=>{if(!a)return;const{onChange:e}=a;"radio"===a.type&&s.current.setClickedValues(c.length?[c[0],""]:[]),c.__prevent__||null==e||e(c,o.current.selectionRows),Ta(c)}),[c]),Ql((()=>{if(!r)return;const{onChange:e}=r;f.__prevent__||null==e||e(f,f.map((e=>o.current.recordsMap.get(e)))),Ta(f)}),[f]),Ql((()=>{var e,t;i&&(s.current.setClickedValues(p?[p,""]:[]),null===(e=i.onChange)||void 0===e||e.call(i,p,null!==(t=o.current.recordsMap.get(p))&&void 0!==t?t:null))}),[p]),Ql((()=>{var e;m.isEqual(h,D.current)||(D.current=h,g&&n&&(null===(e=n.onChange)||void 0===e||e.call(n,h)))}),[h]),Ql((()=>{const e=a.selectedRowKeys||[];m.isEqual(e,c)||N(Na(e))}),[null==a?void 0:a.selectedRowKeys]),Ql((()=>{const e=r.expandedRowKeys||[];m.isEqual(e,f)||I(Na(e))}),[null==r?void 0:r.expandedRowKeys]),Ql((()=>{const{currentRowKey:e}=i;e!==p&&O(null!=e?e:"")}),[null==i?void 0:i.currentRowKey]),Ql((()=>{const{insert:e,remove:t}=o.current.handleState;e&&(v&&("after"===e?x():E()),S("","after"===e?1e5:0)),t&&u.current>C()&&x(),(e||t)&&w({insert:null,remove:!1})}),[u.total]),Ql((()=>{L()}),[d]),Ql((()=>{(o.current.scrollYLoad||y)&&(e.height||e.maxHeight||mt("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[o.current.scrollYLoad,y]),xi({handler:()=>{const{resizeState:e}=o.current,{winHeight:t}=e,l=window.innerHeight;l!==t&&(R(Object.assign({},e,{winHeight:l})),L())},delay:16}),q.default.useEffect((()=>(T(ut(l)),P(),b(),rt((()=>L())),()=>{A(),k(!0)})),[])})(l,{tableRef:R,tableBodyRef:S,$size:E,pagination:ie,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,showSummary:Ge,summationRows:bt,isWebPagination:Fe,isScrollPagination:He,checkDataIndex:Pt,toLastPage:Vt,toFirstPage:zt,getPageCount:Wt,setHandleState:z,scrollYToRecord:It,setOriginColumns:P,setSelectionKeysEffect:Mt,setRowExpandedKeys:ce,setHighlightKey:pe,setResizeState:V,setUnMounted:G,calcTableHeight:Ot,initialTable:Lt,destroy:el});const tl=q.default.useMemo((()=>({getRowKey:O,tableRef:R,tableBodyRef:S,prefixCls:I,$size:E,tableFlatData:Q,flattenColumns:qe,editableColumns:Ke,leftFixedColumns:ze,rightFixedColumns:We,treeExpandIndex:Ue,sorter:le,filters:ee,superFilters:ae,layout:Ee,bordered:tt,showFooter:Xe,showSummary:Ge,summationRows:bt,pagination:ie,fetchParams:xt,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,activedCell:ge,mergedTdCells:ye,derivedMergeCells:Be,updateMark:me,isFetch:_e,isPingLeft:Oe,isPingRight:ke,isHeadSorter:lt,isHeadFilter:nt,isFullScreen:Pe,isTableEmpty:vt,isHeadGroup:et,isGroupSubtotal:gt,isWebPagination:Fe,dataChange:jt,tableChange:Kt,getTableData:Dt,setElementStore:L,createTableList:_t,createTableFullData:At,updateTableFlatData:De,setSorter:ne,setFilters:te,setSuperFilters:re,setHighlightKey:pe,setRowExpandedKeys:ce,setSelectionRows:B,setSelectionKeysEffect:Mt,setInvalidRowKeys:H,setActivedCell:ve,setMergedCells:be,getSpan:wt,getStickyLeft:St,getStickyRight:Nt,scrollXToColumn:Tt,scrollYToRecord:It,setPagination:oe,setPingLeft:Re,setPingRight:Le,setSpinning:Ie,setFullScreen:Ae,doFieldValidate:$t,createTableData:Ft,createGroupData:Ht,scrollBottomDebouncer:Ut,resetTableScroll:Rt,clearTableSorter:Gt,clearTableFilter:Yt,clearSuperFilters:Xt,clearRowSelection:Qt,clearRowHighlight:Zt})),[E,Q,qe,le,ee,ae,Ee,tt,Xe,Ge,bt,ie,xt,se,ue,fe,ge,Be,me,_e,Oe,ke,lt,nt,Pe,vt,et,gt,Fe]);((e,t)=>{const{getRowKey:l,tableRef:n,toolBoxRef:a,tableBodyRef:r,columnFilterRef:i,flattenColumns:o,editableColumns:s,pagination:d,fetchParams:u,selectionKeys:c,rowExpandedKeys:f,highlightKey:p,isFetch:h,dataChange:g,getTableData:v,createTableData:y,createTableFullData:b,calcTableHeight:x,scrollXToColumn:E,scrollYToRecord:C,doFieldValidate:w,setTableOriginData:S,setHandleState:N,setColumnsDefined:T,setSelectionKeysEffect:I,setRowExpandedKeys:O,setHighlightKey:R,setSelectionRows:k,setOriginColumns:L,forceUpdate:P,getTableLog:A,clearRowSelection:D,clearRowHighlight:_,clearTableSorter:F,clearTableFilter:H,clearSuperFilters:M,clearTableLog:$}=t,{columns:j,columnsChange:K}=n.current.props,V=(e,t,n)=>e.filter((e=>{const a=l(e,e.index);e.children&&(e.children=V(e.children,t,n));const r=t.includes(a);return r&&(null==n||n(e,a)),!r}));q.default.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{x()},DO_REFRESH:e=>Ye(void 0,void 0,void 0,(function*(){h&&(yield at(0),yield v(),null==e||e())})),GET_LOG:()=>A(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{h||(D(),_(),F(),H(),M(),$(),y([]))},CLEAR_LOG:()=>{$(),P()},CREATE_FOCUS:(e,t)=>{r.current.createFocus(e,t)},FORCE_UPDATE:()=>{P()},DO_EXPORT:()=>{a.current.exportHandle()},SCROLL_TO_RECORD:e=>{C(e)},SCROLL_TO_COLUMN:e=>{E(e)},SET_SELECTION:(e,t)=>{I(t?Na([...e]):e)},SET_EXPANDABLE:(e,t)=>{O(t?Na([...e]):e)},SET_HIGHLIGHT:e=>{R(e)},SET_SELECTION_ROWS:e=>{k(e)},SET_TABLE_DATA:e=>{b(e)},DEFINE_INITIAL_COLUMNS:e=>{L(e),T(!0),i.current.initialHandler()},SET_TABLE_COLUMN:(e,t,l)=>{const n=va(j,e);if(!n)return mt("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!m.isPlainObject(t))return mt("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(n.noAuth)return mt("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&m.set(n,e,t[e]);l&&(K?K([...j]):mt("Table","需要设置 `columnsChange` 参数"),P())},INSERT_RECORDS:(e,t)=>{const{store:a,tableFullData:r}=n.current,i=(Array.isArray(e)?e:[e]).filter((e=>m.isPlainObject(e)));if(!i.length)return;i.forEach((e=>{o.forEach((t=>{const{dataIndex:l}=t;[pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(l)||La(e,l,ka(e,l))})),a.addToInserted(e)}));const s="before"===(null==t?void 0:t.mode),d=void 0===(null==t?void 0:t.parentRowKey),u=r;if(d)s?u.unshift(...i):u.push(...i);else{const e=Ba(r,(e=>t.parentRowKey===l(e,e.index)));e&&(Array.isArray(e.children)?s?e.children.unshift(...i):e.children.push(...i):e.children=i)}d&&N(Object.assign({},n.current.handleState,{insert:s?"before":"after"})),y(u),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:a}=n.current,r=(Array.isArray(e)?e:[e]).map((e=>m.isPlainObject(e)?l(e,e.index):e));if(!r.length)return;let i=!1;const o=V(a,r,((e,l)=>{t.addToRemoved(e),s.forEach((n=>{const{dataIndex:a,editRender:r}=n,i=null==r?void 0:r(e,n);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:l,y:a}),t.removeFromValidate({x:l,y:a}),t.removeFromEdited({x:l,y:a}))})),i=!0}));i&&(N(Object.assign({},n.current.handleState,{remove:!0})),b(o),I(c.filter((e=>!r.includes(e)))),r.includes(p)&&_(),O(f.filter((e=>!r.includes(e)))),g(),rt((()=>{S(V(n.current.tableOriginData,r))})))},VALIDATE_FIELDS:(e,t)=>{n.current.allTableData.forEach((n=>{s.forEach((a=>{const{dataIndex:r,title:i,editRender:o}=a,s=null==o?void 0:o(n,a);if(!s)return;const d=l(n,n.index);if(e&&!e.includes(d))return;if(t&&!t.includes(r))return;const{rules:u=[],disabled:c}=s;c||w(u,ka(n,r),d,r,qa(i))}))}));const{required:a,validate:r}=A(),i=[...a,...r];return i.length&&C(i[0].rowKey),P(),{required:a,validate:r}}})))})(t,{getRowKey:O,tableRef:R,toolBoxRef:N,tableBodyRef:S,columnFilterRef:T,flattenColumns:qe,editableColumns:Ke,pagination:ie,fetchParams:xt,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,isFetch:_e,dataChange:jt,getTableData:Dt,createTableData:Ft,createTableFullData:At,calcTableHeight:Ot,scrollXToColumn:Tt,scrollYToRecord:It,doFieldValidate:$t,setTableOriginData:D,setHandleState:z,setColumnsDefined:$,setSelectionKeysEffect:Mt,setRowExpandedKeys:ce,setHighlightKey:pe,setSelectionRows:B,setOriginColumns:P,forceUpdate:he,getTableLog:qt,clearRowSelection:Qt,clearRowHighlight:Zt,clearTableSorter:Gt,clearTableFilter:Yt,clearSuperFilters:Xt,clearTableLog:Jt}),q.default.useLayoutEffect((()=>{Et(),R.current.tableManager.register(R.current.uid,null!=t?t:{current:null})}),[]);const ll={[`${I}--wrapper`]:!0,[`${I}--lg`]:"large"===E,[`${I}--sm`]:"small"===E,[`${I}--maximize`]:Pe,[o]:!!o},nl={[I]:!0,"is--border":tt,"is--fixed":ze.length||We.length,"is--sortable":lt,"is--filterable":nt,"is--head-group":et,"is--area-select":!!s,"is--ping-left":Oe,"is--ping-right":ke};return q.default.createElement(Xr.Provider,{value:tl},q.default.createElement("div",{className:J.default(ll,b),style:x},p&&q.default.createElement("div",{ref:C,className:`${I}-top`},q.default.createElement("div",{className:`${I}-top__space`},"bottom"!==(null==c?void 0:c.position)&&q.default.createElement(Ei,{total:ie.total}),q.default.createElement("div",{className:`${I}-top__space-slot`,style:{justifyContent:ii[f]}},l.children)),q.default.createElement("div",{className:`${I}-top__actions`},q.default.createElement(Qd,{ref:N,showFullScreen:h,showReload:g&&_e,showPrint:we.print&&!!d,showImport:we.import&&st,showExport:we.export&&!!u,showClipboard:dt,showCollection:ot,showFastSearch:ft,showSuperSearch:ct,showPivotGrid:pt,showGroupSummary:ht,showToolBox:v,tableColumns:$e}),q.default.createElement(Jd,{ref:T,columns:a}))),q.default.createElement(gn,{spinning:null!=r?r:Te},q.default.createElement("div",{ref:w,className:J.default(nl),style:Ct},q.default.createElement("div",{className:`${I}--main-wrapper`},y&&q.default.createElement(gu,{tableColumns:$e}),q.default.createElement(Fu,{ref:S}),Xe&&q.default.createElement(Hu,null)),tt&&q.default.createElement("div",{className:`${I}--border-line`}),vt&&q.default.createElement(qu,null),i&&q.default.createElement(ju,null))),Me&&q.default.createElement($u,je({},ie,{onChange:(e,t)=>Bt({current:e,pageSize:t})}))))}));Ku.displayName="QmTable";const Vu=e=>{var t;const{uniqueKey:l,multiple:n,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:s={},className:d,style:u,onClose:c}=e,{$size:f}=Ze(e),{t:p}=Xe(),h=q.default.useRef(null),g=q.default.useRef(null),v=q.default.useRef(null),y=Cn(h),[b,x]=q.default.useState(s),[E,C]=q.default.useState(),[w,S]=q.default.useState(i),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(300),[R,k]=q.default.useState(o),[L,P]=q.default.useState((e=>[{title:p("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(s.columns||[])])()),[A,D]=q.default.useState(m.merge({},null===(t=s.fetch)||void 0===t?void 0:t.params,a)),[_,F]=q.default.useState([]),H=()=>{const e=h.current,t=e.querySelector(".form-wrap");O(e.offsetHeight-t.offsetHeight-2*Yr[f]-30)},M=wn(H,5);Ie((()=>{M()}),[y.width]),Ql((()=>{m.isEqual(o,R)||k(o)}),[o]),q.default.useEffect((()=>{$()}),[A]),q.default.useEffect((()=>{r&&v.current.SET_SELECTION_ROWS(r)}),[r]),q.default.useEffect((()=>{var e;a&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(a))}),[]);const $=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:l}=b;if(!t||!(null==l?void 0:l.api))return;const{api:a,dataKey:r,beforeFetch:i=nt}=l;if(i(A)){T(!0);try{const t=yield a(A);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,r))&&void 0!==e?e:[];n||(S([]),yield at(0)),F(l)}}catch(e){}T(!1)}})),j=e=>{n||(C(e),c(e))},K=e=>{D(Object.assign({},A,e))},V={[`${yt("search-helper")}--wrapper`]:!0},z=b.webPagination?{dataSource:_,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:A})};return q.default.createElement("div",{ref:h,className:J.default(V,d),style:u},q.default.createElement("div",{className:"form-wrap"},R.length?q.default.createElement(wf,{ref:g,items:R,uniqueKey:l,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>H(),onFinish:e=>K(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||K(t)}))}):null),q.default.createElement("div",null,q.default.createElement(Ku,je({ref:v,uniqueKey:l,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},z,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:w,onChange:(e,t)=>{S(e),C(n?t:t[0])}},topSpaceAlign:"left",paginationConfig:b.paginationConfig,columnsChange:e=>P(e),onRowDblclick:j,onRowEnter:j}),b.topBarExtra)),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[f]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>c(null),style:{marginRight:8}},p("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!E,onClick:()=>c(E,n?w:void 0)},p("qm.dialog.confirm"))))};Vu.displayName="QmSearchHelper";const{Search:zu}=s.Input;class Wu extends e.Component{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ye(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=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||mt("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||mt("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&mt("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:l={},formatter:n=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof o?o():o||{},u="function"==typeof s?s():s||{},c=this.getItemValue();if(t&&!ot(c)){this.setState({loading:!0});try{const o=yield t(n(Object.assign(Object.assign({},l),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(d&&pr(e,this.alias,d),u&&mr(e,this.extras,u),this._record=e,this.setFieldsValue(e),i){const t=fr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==r||r([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:l}=this.searchHelper,n=""!==e?e:void 0,a=("function"==typeof l?l():l)||[],r={[t]:n};return(Array.isArray(a)?a:[a]).forEach((e=>{if(m.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](n):n;else r[e]=n})),r},this.getSearchHelperTableData=e=>{const{table:t,initialValue:l={}}=this.searchHelper,{beforeFetch:n=nt,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=m.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},l),a(this.createFilters(e))),{currentPage:1,pageSize:500});if(!n(s))return i();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const l=Array.isArray(e.data)?e.data:null!==(o=m.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];r(l)}else i()}catch(e){i(e)}finally{rt((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=fr(e,this.alias[n]);void 0!==a&&(t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a))}for(const l in this.extras){const n=fr(e,this.extras[l]);void 0!==n&&t.SET_FIELDS_EXTRA({[l]:n})}},this.resetSearchHelperValue=(e=[],t)=>Ye(this,void 0,void 0,(function*(){const{fieldName:l}=this.props.option,n=e.filter((e=>{var n;return null===(n=fr(e,this.alias[l]))||void 0===n?void 0:n.toString().toLowerCase().includes(t.toLowerCase())}));if(1===n.length)return this.closeSearchHelper(n[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:l}=this.context,{beforeOpen:n}=this.searchHelper,a=(null!=n?n:nt)(l.state.formData);(null==a?void 0:a.then)?a.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==a&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])});const n=fr(e,this.alias[l]);this.triggerChange(n),this.searchHelperChangeHandle(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(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 l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===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:l}=this.props;null==t||t(e),l(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:t}=this.context,{visible:l,loading:n}=this.state,{value:a}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:d={},placeholder:u=Se("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:m}=this.props.option,{prefix:h,suffix:g,maxLength:v}=o,y={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},b=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:Object.assign({},this.deriveParams,s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?q.default.createElement(Dr,{value:a,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(zu,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:n,placeholder:u,style:d,prefix:h,suffix:g,maxLength:v,bordered:c,allowClear:f,readOnly:p,disabled:m,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=this.searchHelper;this.triggerBlur(n),this._is_change&&!l&&(n?a?(null===(t=null==r?void 0:r.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;!l&&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):rt((()=>this.clearSearchHelperValue())))}}),q.default.createElement(Qn,y,q.default.createElement(Vu,b)))}}Wu.contextType=Zn;class Bu extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[]}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Wu,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(r,t)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Bu.contextType=Zn;const Uu=t=>{class l extends e.Component{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 l,n;const a=e.target,r=null==t?void 0:t.target,i=!a||!r,o=(null===(l=this.$el)||void 0===l?void 0:l.contains(a))||(null===(n=this.$el)||void 0===n?void 0:n.contains(r)),s=this.$el===a,d=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),u=d.some((e=>null==e?void 0:e.contains(a)))||d.includes(r);let c;c=!(i||o||s||u),this.setState({clickOutside:c})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=ae.default(document,"mousedown",this.mousedownHandler),this.event2=ae.default(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:e}=this.props,{clickOutside:l}=this.state;return q.default.createElement(t,je({ref:e},this.props,{clickOutside:l,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return l.displayName=`OutsideClick(${t.displayName||t.name})`,q.default.forwardRef(((e,t)=>q.default.createElement(l,je({},e,{forwardedRef:t}))))};let Gu=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||mt("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||mt("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:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:l}=this.alias;this.setRecords(m.uniqBy([...this._records.filter((e=>t.includes(e[l]))),...e],l));const n=this.recordsToDict();this.setItemList(n),this.triggerChange(n.map((e=>e.value)));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(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:l=[]}=e,{value:n=[],clickOutside:a}=this.props;m.isEqual(l,n)||m.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),a&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:l,valueKey:n}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,callback:s,fieldAliasMap:d}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},u="function"==typeof d?d():d||{},{value:c}=this.props;if(a){if(ot(c))return this.setRecords([]);this.setState({loading:!0});try{const e=yield a(i(Object.assign(Object.assign({},r),{keys:c})));if(200===e.code){let a=Array.isArray(e.data)?e.data:null!==(t=m.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==u?void 0:u.valueKey)&&u.valueKey!==n&&(e[n]=e[u.valueKey]),(null==u?void 0:u.textKey)&&u.textKey!==l&&(e[l]=e[u.textKey])})),a=a.filter((e=>c.includes(e[n])));const r=a.map((e=>({value:e[n],text:e[l]})));this.setRecords(a),this.setItemList(r),this.setViewValue(c),null==s||s(a)}}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,t,l;const{$$form:n}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:d}=this.props,{fieldName:u,options:c={},searchHelper:f={},style:p={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,w={visible:a,title:Se("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${u}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${u}`:"",initialValue:m.merge({},f.initialValue),defaultSelectedKeys:d,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=o.filter((e=>null==d?void 0:d.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=yt("form-multiple-search-helper"),{size:R}=n.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(l=(t=this.props).setOmitClassNames)||void 0===l||l.call(t,[`.${O}`]);const L=o.filter((e=>null==d?void 0:d.includes(e.value))).map((e=>e.text)).join(",");return n.isOnlyShow?q.default.createElement(Dr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(gs,{popupVisible:!x&&r,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:nr,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(s.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:d,placeholder:h,loading:i,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},p),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Vu,S)))}};Gu.contextType=Zn,Gu=Ge([Uu],Gu);class Yu extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Gu,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Yu.contextType=Zn;const Xu=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Xu(e.children)),e.children&&t.push(e.value)})),t},Qu=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=Qu(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},Zu=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Zu(e.children,t),t(e)||e.children&&e.children.length))),Ju=e=>{var t;const{uniqueKey:l,multiple:n,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:d={},tree:u={},className:c,style:f,onClose:p}=e,{$size:h}=Ze(e),{t:v}=Xe(),y=q.default.useRef(null),b=q.default.useRef(null),x=q.default.useRef(null),E=Cn(y),[C,w]=q.default.useState(d),[S,N]=q.default.useState(),[T,I]=q.default.useState(i),[O,R]=q.default.useState(!1),[k,L]=q.default.useState(300),[P,A]=q.default.useState(300),[D,_]=q.default.useState(o),[F,H]=q.default.useState((e=>[{title:v("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(d.columns||[])])()),[M,$]=q.default.useState(m.merge({},null===(t=d.fetch)||void 0===t?void 0:t.params,a)),[j,K]=q.default.useState([]),V=()=>{const e=y.current,t=e.querySelector(".form-wrap"),l=e.querySelector(".input-wrap");L(e.offsetHeight-l.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*Yr[h]-30)},z=wn(V,5);Ie((()=>{z()}),[E.width]),Ql((()=>{m.isEqual(o,D)||_(o)}),[o]),q.default.useEffect((()=>{W()}),[M]),q.default.useEffect((()=>{r&&x.current.SET_SELECTION_ROWS(r)}),[r]),q.default.useEffect((()=>{var e;a&&(null===(e=b.current)||void 0===e||e.SET_FIELDS_VALUE(a)),ne()}),[]);const W=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:l}=C;if(!t||!(null==l?void 0:l.api))return;const{api:a,dataKey:r,beforeFetch:i=nt}=l;if(i(M)){R(!0);try{const t=yield a(M);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,r))&&void 0!==e?e:[];n||(I([]),yield at(0)),K(l)}}catch(e){}R(!1)}})),B=e=>{n||(N(e),p(e))},U=e=>{$(Object.assign({},M,e))},[G,Y]=q.default.useState([]),[X,Q]=q.default.useState([]),[Z,ee]=q.default.useState(""),te=q.default.useRef(G),le=q.default.useRef([]);Ql((()=>{Q(Xu(G))}),[G]);const ne=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!u.fetch)return;const{api:t,params:l,dataKey:n,valueKey:a="value",textKey:r="text"}=u.fetch;try{const i=yield t(l);if(200===i.code){const t=Array.isArray(i.data)?i.data:null!==(e=m.get(i.data,n))&&void 0!==e?e:[],l=hr(t,a,r);Y(l),te.current=l,le.current=t}}catch(e){}})),ae=e=>`${e}|${Pr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${yt("tree-table-helper")}--wrapper`]:!0},ie=C.webPagination?{dataSource:j,loading:O,webPagination:!0}:{fetch:Object.assign(Object.assign({},C.fetch),{params:M})};return q.default.createElement("div",{ref:y,className:J.default(re,c),style:f},q.default.createElement(pn,{defaultValue:200,style:{height:"100%"}},q.default.createElement(pn.Pane,{min:100,style:{overflowY:"auto"}},q.default.createElement(s.Input,{className:"input-wrap",value:Z,style:{marginBottom:8},placeholder:v("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{const t=Zu(te.current,(t=>{if(!e)return!0;const l=t.text||"";return-1!==ae(l).indexOf(e)}));ee(e),Y(t)})(e.target.value)}),q.default.createElement(s.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:k,defaultExpandAll:!0,expandedKeys:X,treeData:G,filterTreeNode:e=>{if(!Z)return!1;const t=e.text||"";return-1!==ae(t).indexOf(Z)},onExpand:e=>{Q(e)},onSelect:e=>{const{valueKey:t="value"}=u.fetch;(e=>{if(!u.tableParamsMap)return mt("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof u.tableParamsMap?u.tableParamsMap():u.tableParamsMap,l={};for(const n in t)l[n]=m.get(e,t[n]);U(l)})(Qu(le.current,(l=>m.get(l,t)===e[0]))||{})}})),q.default.createElement(pn.Pane,{className:"split-pane"},q.default.createElement("div",{className:"form-wrap"},D.length?q.default.createElement(wf,{ref:b,items:D,uniqueKey:l,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>V(),onFinish:e=>U(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield b.current.GET_FORM_DATA();e||U(t)}))}):null),q.default.createElement("div",null,q.default.createElement(Ku,je({ref:x,uniqueKey:l,height:P,columns:F,rowKey:C.rowKey||"pageIndex"},ie,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:T,onChange:(e,t)=>{I(e),N(n?t:t[0])}},topSpaceAlign:"left",paginationConfig:C.paginationConfig,columnsChange:e=>H(e),onRowDblclick:B,onRowEnter:B}),C.topBarExtra)))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>p(null),style:{marginRight:8}},v("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!S,onClick:()=>p(S,n?T:void 0)},v("qm.dialog.confirm"))))};Ju.displayName="TreeTableHelper";const{Search:ec}=s.Input;class tc extends e.Component{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ye(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=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||mt("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||mt("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&mt("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=()=>Ye(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:l={},formatter:n=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof o?o():o||{},u="function"==typeof s?s():s||{},c=this.getItemValue();if(t&&!ot(c)){this.setState({loading:!0});try{const o=yield t(n(Object.assign(Object.assign({},l),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(d&&pr(e,this.alias,d),u&&mr(e,this.extras,u),this._record=e,this.setFieldsValue(e),i){const t=fr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==r||r([e])}}}catch(e){}this.setState({loading:!1})}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])})},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])});const n=fr(e,this.alias[l]);this.triggerChange(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===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:l}=this.props;null==t||t(e),l(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:t}=this.context,{visible:l,loading:n}=this.state,{value:a=""}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:d={},placeholder:u=Se("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{prefix:g,suffix:v,maxLength:y}=o,b={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[t.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:m.merge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return t.isOnlyShow?q.default.createElement(Dr,{value:a,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(ec,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:n,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:c,allowClear:f,readOnly:p,disabled:h,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())}}),q.default.createElement(Qn,b,q.default.createElement(Ju,x)))}}tc.contextType=Zn;class lc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(tc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}lc.contextType=Zn;let nc=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||mt("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||mt("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:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:l}=this.alias;this.setRecords(m.uniqBy([...this._records.filter((e=>t.includes(e[l]))),...e],l));const n=this.recordsToDict();this.setItemList(n),this.triggerChange(n.map((e=>e.value)));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(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:l=[]}=e,{value:n=[],clickOutside:a}=this.props;m.isEqual(l,n)||m.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),a&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:l,valueKey:n}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof s?s():s||{},{value:u}=this.props;if(a){if(ot(u))return this.setRecords([]);this.setState({loading:!0});try{const e=yield a(i(Object.assign(Object.assign({},r),{keys:u})));if(200===e.code){let a=Array.isArray(e.data)?e.data:null!==(t=m.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==n&&(e[n]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==l&&(e[l]=e[d.textKey])})),a=a.filter((e=>u.includes(e[n])));const r=a.map((e=>({value:e[n],text:e[l]})));this.setRecords(a),this.setItemList(r),this.setViewValue(u)}}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,t,l;const{$$form:n}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:d}=this.props,{fieldName:u,options:c={},searchHelper:f={},style:p={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,w={visible:a,title:Se("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${u}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${u}`:"",initialValue:m.merge({},f.initialValue),defaultSelectedKeys:d,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=o.filter((e=>null==d?void 0:d.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=yt("form-multiple-tree-table-helper"),{size:R}=n.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(l=(t=this.props).setOmitClassNames)||void 0===l||l.call(t,[`.${O}`]);const L=o.filter((e=>null==d?void 0:d.includes(e.value))).map((e=>e.text)).join(",");return n.isOnlyShow?q.default.createElement(Dr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(gs,{popupVisible:!x&&r,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:nr,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(s.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:d,placeholder:h,loading:i,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},p),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Ju,S)))}};nc.contextType=Zn,nc=Ge([Uu],nc);class ac extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(nc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}ac.contextType=Zn;const rc="_startSign",ic="_endSign",oc=e=>{var t;const{uniqueKey:l,initialValue:n,filters:a=[],table:r={},onClose:i}=e,{$size:o}=Ze(e),{t:d}=Xe(),u=q.default.useRef(null),c=q.default.useRef(null),f=q.default.useRef(null),p=Cn(u),[h,v]=q.default.useState(r),[y,b]=q.default.useState(!1),[x,E]=q.default.useState([]),[C,w]=q.default.useState(300),[S,N]=q.default.useState(a),[T,I]=q.default.useState((e=>[{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},{title:d("qm.form.rangeSearchHelper")[0],dataIndex:rc,width:80,align:"right",render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)},...e||(r.columns||[]),{title:d("qm.form.rangeSearchHelper")[1],dataIndex:ic,fixed:"right",width:80,render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)}])()),[O,R]=q.default.useState(m.merge({},null===(t=r.fetch)||void 0===t?void 0:t.params,n)),[k,L]=q.default.useState([]),P=q.default.useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),A=q.default.useMemo((()=>2===P.length&&P.every((e=>void 0!==e))),[P]),D=()=>{const e=u.current.parentNode.children[0],t=e.querySelector(".form-wrap");w(e.offsetHeight-t.offsetHeight-2*Yr[o]-30)},_=wn(D,5);Ie((()=>{_()}),[p.width]),Ql((()=>{m.isEqual(a,S)||N(a)}),[a]),q.default.useEffect((()=>{F()}),[O]);const F=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:l}=h;if(!t||!(null==l?void 0:l.api))return;const{api:n,dataKey:a,beforeFetch:r=nt}=l;if(r(O)){b(!0);try{const t=yield n(O);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[];L(l)}}catch(e){}b(!1)}})),H=(e,t)=>{delete e[t]},M=()=>{x.forEach((e=>{e&&(H(e,rc),H(e,ic))})),E([])},$=e=>{M(),R(Object.assign({},O,e))},j=yt("range-helper"),K=h.webPagination?{dataSource:k,loading:y,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:O})};return q.default.createElement("div",{ref:u,className:`${j}--wrapper`},q.default.createElement("div",{className:"form-wrap"},S.length?q.default.createElement(wf,{ref:c,items:S,initialValues:n,uniqueKey:l,formType:"search",isAutoFocus:!1,fieldsChange:e=>N(e),onCollapse:()=>D(),onFinish:e=>$(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();e||$(t)}))}):null),q.default.createElement("div",null,q.default.createElement(Ku,je({ref:f,height:C,columns:T,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=P[0]&&e.pageIndex<=P[1]?{backgroundColor:"#f5f5f5"}:{}},K,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;[rc,ic].includes(l)&&(l===rc&&(e[l]?(H(e,l),E([void 0,x[1]])):e.pageIndex>P[1]?s.message.warning(d("qm.searchHelper.rangeStartTip")):(x[0]&&H(x[0],l),e[l]="[",E([e,x[1]]))),l===ic&&(e[l]?(H(e,l),E([x[0],void 0])):e.pageIndex<P[0]?s.message.warning(d("qm.searchHelper.rangeEndTip")):(x[1]&&H(x[1],l),e[l]="]",E([x[0],e]))),f.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===P[0]&&(e[rc]="["),e.pageIndex===P[1]&&(e[ic]="]")}))}}),q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.ClearOutlined,null),title:d("qm.table.alert.clear"),onClick:()=>M()}))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[o]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>i(null),style:{marginRight:8}},d("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!A,onClick:()=>i(x.map((e=>(e=>{const t={};for(const l in e)[rc,ic].includes(l)||(t[l]=e[l]);return t})(e))))},d("qm.dialog.confirm"))))};oc.displayName="RangeTableHelper";const sc=new Array(2).fill("");class dc extends e.Component{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:sc},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||mt("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||mt("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:l}=this.props;this._is_change=!1,null==t||t(e),l(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(sc),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:l}=this.alias,n=e.map((e=>({value:e[t],text:e[l]})));this.setRecords(e),this.setItemList(n),this.setTextValue(n.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:ot(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:l={}}=this.searchHelper,{beforeFetch:n=nt,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=m.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},l),a(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!n(s))return i();this.setState({loading:!0});const e=yield t.fetch.api(s);if(rt((()=>this.setState({loading:!1}))),200===e.code){const l=Array.isArray(e.data)?e.data:null!==(o=m.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return r(l)}}catch(e){this.setState({loading:!1})}i()}))))},this.resetSearchHelperValue=(e=[])=>Ye(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:l}=this.alias,n=e.filter((e=>{var n;const a=null===(n=e[l])||void 0===n?void 0:n.toString().toLowerCase();return t.some((e=>null==a?void 0:a.includes(e.toLowerCase())))}));if(2===n.length)return this.closeSearchHelper(n);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:l=[]}=this.props;m.isEqual(t,l)||m.isEqual(l,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:n}=this.context,{fieldName:a}=this.props.option;if(!m.isEqual(n[a],this._ceho_data)&&(this._ceho_data=n[a],this.setItemList(n[a]),l.length)){const e=sc.map(((e,t)=>{var r,i;return null!==(i=null===(r=n[a].find((e=>e.value===l[t])))||void 0===r?void 0:r.text)&&void 0!==i?i:""}));this.setTextValue(e)}}getItemList(){var e;return Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:l}=this.alias,{fetchApi:n,params:a={},formatter:r=(e=>e),dataKey:i,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:d}=this.props;if(n){if(ot(d))return this.setRecords([]);this.setState({loading:!0});try{const o=yield n(r(Object.assign(Object.assign({},a),{keys:d})));if(200===o.code){let n=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,i))&&void 0!==e?e:[];n.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==l&&(e[l]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),n=n.filter((e=>d.includes(e[l]))).slice(0,2);const a=n.map((e=>({value:e[l],text:e[t]})));this.setRecords(n),this.setItemList(a),this.setTextValue(a.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:t}=this.context;this.props;const{visible:l,loading:n,textValue:a}=this.state,{fieldName:r,options:i={},searchHelper:o={},placeholder:d=Se("qm.form.rangeInputNumberPlaceholder"),bordered:u=!0,readOnly:c,disabled:f}=this.props.option,{onlySelect:p=!0}=this.searchHelper||o,h=a.every((e=>cr(e)))?"":a.join(" - "),g={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=o.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${r}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${r}`:"",initialValue:m.merge({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?q.default.createElement(Dr,{value:h,bordered:u}):q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Input.Group,null,q.default.createElement(s.Input,{value:a[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:d[0],allowClear:!1,bordered:u,readOnly:c,disabled:f,onBlur:e=>{var t,n;const{value:r}=e.target;this._is_change&&!l&&(r?a.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(a).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):a.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;p||(this._is_change=!0,this.setTextValue([t,a[1]]))}}),q.default.createElement(s.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:u,disabled:f,readOnly:!0}),q.default.createElement(s.Input.Search,{value:a[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:d[1],loading:n,bordered:u,allowClear:!0,readOnly:c,disabled:f,onBlur:e=>{var t,n;const{value:r}=e.target;this._is_change&&!l&&(r?a.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(a).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):a.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:p||(this._is_change=!0,this.setTextValue([a[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),q.default.createElement(Qn,g,q.default.createElement(oc,v)))}}dc.contextType=Zn;class uc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,labelWidth:o=e.props.labelWidth,className:d,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(dc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{m(t,n),e.setViewValue(r,l)}}))),c&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,c)),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},u)))))}}uc.contextType=Zn;const cc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:d=!1,readOnly:u,disabled:c}=e.option,{itemList:f=[]}=i,p=ot(f)?n:f,m=e=>p.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?q.default.createElement(Dr,{value:m(l),bordered:d}):q.default.createElement(s.Checkbox.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c,onChange:e=>{(e=>{null==a||a(e),r(e,m(e))})(e)}},p.map((e=>q.default.createElement(s.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class fc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}getItemList(){var e;return Ye(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l)try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=l.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(cc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}fc.contextType=Zn;const pc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},style:i={},allowClear:o=!0,readOnly:d,disabled:u=t.isFormDisabled}=e.option,{allowHalf:c,count:f=5,tooltips:p}=r,m=e=>p?p[Math.ceil(e)-1]:e.toString();return q.default.createElement(s.Rate,{value:l,count:f,style:i,allowHalf:c,allowClear:o,tooltips:p,disabled:u||t.isOnlyShow,onChange:e=>{(e=>{null==n||n(e),a(e,m(e))})(e)}})};class mc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(pc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}mc.contextType=Zn;const hc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:d=!1,readOnly:u,disabled:c=t.isFormDisabled}=e.option,{itemList:f=[]}=i,p=ot(f)?n:f,m=e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==l?l:""};return t.isOnlyShow?q.default.createElement(Dr,{value:m(l),bordered:d}):q.default.createElement(s.Radio.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),r(e,m(e))})(t)}},p.map((e=>q.default.createElement(s.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class gc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l)try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=l.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(hc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}gc.contextType=Zn;const vc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:d,disabled:u=t.isFormDisabled}=e.option,{labelToSwitch:c,falseValue:f=er,trueValue:p=Ja}=i,{t:m}=Xe();return q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Switch,{checked:l===p,style:o,disabled:u||t.isOnlyShow,checkedChildren:q.default.createElement(g.CheckOutlined,null),unCheckedChildren:q.default.createElement(g.CloseOutlined,null),onChange:e=>{(e=>{null==n||n(e),a(e,m(e===p?"am.form.trueText":"am.form.falseText"))})(e?p:f)}}),c?q.default.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},r):null)};class yc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option,{labelToSwitch:m}=i;return q.default.createElement(s.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(vc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}yc.contextType=Zn;const bc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{options:i={},style:o={},placeholder:d=r("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:c,readOnly:f,disabled:p,onFocus:m,onBlur:h,onEnter:g}=e.option,{showCount:v,maxLength:y,autoSize:b}=i,x=Object.assign({},{minRows:1,maxRows:3},b);return q.default.createElement(s.Input.TextArea,{value:l,placeholder:d,style:o,maxLength:y,showCount:v,autoSize:x,bordered:u,allowClear:c,readOnly:f||t.isOnlyShow,disabled:p,onFocus:e=>{null==m||m(e.target.value,e)},onBlur:t=>{const{value:l}=t.target;(t=>{const{onBlur:l}=e;null==l||l(t)})(l),null==h||h(l,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==n||n(e),a(e)})(t)}})};class xc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(bc,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}xc.contextType=Zn;const Ec=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:d={},placeholder:u=r("qm.form.datePlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:m}=e.option,{dateType:h="date",format:g,disabledDate:v,minDateTime:y,maxDateTime:b,shortCuts:x=!0}=o,E=q.default.createRef(),C=e=>{e&&"date"===h&&(e=e.slice(0,10)+" 00:00:00"),null==n||n(e),a(e,w(e))},w=e=>cr(e)?"":["date","exactdate"].includes(h)?e.slice(0,10):e,S=e=>{let t=ur(j.default().subtract(e,"day"),rr[h]);"date"===h&&(t=t.slice(0,10)),C(t),E.current.blur(),E.current.focus()};return t.isOnlyShow?q.default.createElement(Dr,{value:w(l),bordered:c}):q.default.createElement(qe,{ref:E,style:Object.assign({width:"100%"},d),popupClassName:`form-popper__${i}`,picker:ar[h],format:g,bordered:c,showToday:!1,showTime:"datetime"===h&&{defaultValue:j.default("00:00:00","HH:mm:ss")},allowClear:f,disabled:m,inputReadOnly:p,disabledDate:null!=v?v:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[y,b]),renderExtraFooter:x&&h.includes("date")?()=>"function"==typeof x?x():q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(0)},r("qm.form.datePickers")[0]),q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(1)},r("qm.form.datePickers")[1]),q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(7)},r("qm.form.datePickers")[2]),q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(30)},r("qm.form.datePickers")[3])):void 0,value:dr(l,rr[h]),onChange:(e,t)=>{C(ur(e,rr[h]))}})};class Cc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ec,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Cc.contextType=Zn;const wc=e=>[j.default().subtract(e,"day"),j.default()],Sc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{dateType:m="date",format:h,disableds:g=[!1,!1],allowEmpty:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=o,C={[r("qm.form.dateRangePickers")[0]]:wc(7),[r("qm.form.dateRangePickers")[1]]:wc(30),[r("qm.form.dateRangePickers")[2]]:wc(90),[r("qm.form.dateRangePickers")[3]]:wc(180)},w=e=>cr(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return t.isOnlyShow?q.default.createElement(Dr,{value:w(l),bordered:u}):q.default.createElement(qe.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,picker:ar[m],format:h,bordered:u,showTime:"datetime"===m&&{defaultValue:[j.default("00:00:00","HH:mm:ss"),j.default("23:59:59","HH:mm:ss")]},allowClear:c,allowEmpty:v,disabled:p?[!0,!0]:g,inputReadOnly:f,disabledDate:null!=y?y:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[b,x]),ranges:E&&m.includes("date")?C:void 0,value:ot(l)?null:[dr(null==l?void 0:l[0],rr[m]),dr(null==l?void 0:l[1],rr[m])],onChange:(e,t)=>{(e=>{"date"===m&&(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==n||n(e),a(e,w(e))})([ur(null==e?void 0:e[0],rr[m]),ur(null==e?void 0:e[1],rr[m])])}})};class Nc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Sc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Nc.contextType=Zn;const Tc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{timeType:m="hour-minute-second",hourStep:h=1,minuteStep:g=1,secondStep:v=1}=o;return t.isOnlyShow?q.default.createElement(Dr,{value:l,bordered:u}):q.default.createElement(Ke,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!0,hourStep:h,minuteStep:g,secondStep:v,allowClear:c,disabled:p,inputReadOnly:f,format:ir[m],value:dr(l,ir[m]),onChange:(e,t)=>{(e=>{const t=ur(e,ir[m]);null==n||n(t),a(t)})(e)}})};class Ic extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Tc,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Ic.contextType=Zn;const Oc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:h=[!1,!1],allowEmpty:g,hourStep:v=1,minuteStep:y=1,secondStep:b=1}=o,x=e=>cr(e)?"":e.join(" - ");return t.isOnlyShow?q.default.createElement(Dr,{value:x(l),bordered:u}):q.default.createElement(Ke.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!1,hourStep:v,minuteStep:y,secondStep:b,allowClear:c,allowEmpty:g,disabled:p?[!0,!0]:h,inputReadOnly:f,format:ir[m],value:ot(l)?null:[dr(null==l?void 0:l[0],ir[m]),dr(null==l?void 0:l[1],ir[m])],onChange:(e,t)=>{(e=>{const t=[ur(null==e?void 0:e[0],ir[m]),ur(null==e?void 0:e[1],ir[m])];null==n||n(t),a(t,x(t))})(e)}})};class Rc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Oc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Rc.contextType=Zn;class kc extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=oe.default(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.paramsChangeHandler=(e,t)=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting(),m.isEqual(e,t)||this.getItemList()})),this.echoSearchHelper=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:l}=this.props.option,{fieldAliasMap:n,fieldsDefine:a,echoRequest:r}=this.searchHelper;if(n||mt("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),a){const e=["valueKey","displayKey","extraKey"];for(const t in a)e.includes(t)&&(this[t]=a[t])}Object.keys(this.alias).includes(e)||mt("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&mt("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!l&&mt("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:l={},formatter:n=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof o?o():o||{},u="function"==typeof s?s():s||{},c=this.getItemValue();if(t&&!ot(c))try{const o=yield t(n(Object.assign(Object.assign({},l),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(d&&pr(e,this.alias,d),u&&mr(e,this.extras,u),this._record=e,this.setFieldsValue(e),i){const t=fr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==r||r([e])}}}catch(e){}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])})},this.fetchHandle=m.debounce(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:l}=this.context,{fieldName:n}=this.props.option;for(const t in this.alias){if(t===n)continue;const a=fr(e,this.alias[t]);l.SET_FIELDS_VALUE({[t]:a}),t===this.valueKey&&(this._prevValue=e?a:null)}for(const t in this.extras)l.SET_FIELDS_EXTRA({[t]:fr(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const a=fr(e,this.alias[n]);this.triggerChange(a),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,l,n,a,r,i;const o=(null===(l=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===l?void 0:l.params)||(null===(n=e.option.request)||void 0===n?void 0:n.params),s=(null===(r=null===(a=this.props.option.searchHelper)||void 0===a?void 0:a.request)||void 0===r?void 0:r.params)||(null===(i=this.props.option.request)||void 0===i?void 0:i.params);this.paramsChangeHandler(s,o),this.echoSearchHelper()}getItemList(e){var t;return Ye(this,void 0,void 0,(function*(){const{fieldName:l}=this.props.option,{fetchApi:n,params:a={},formatter:r=(e=>e),dataKey:i}=this.searchHelper.request||this.props.option.request||{};if(n){this.setState({loading:!0});try{const o=yield n(r(Object.assign(Object.assign({},a),{[l]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=m.get(o.data,i))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:t,loading:l,itemList:n,inputText:a}=this.state,{value:r}=this.props,{fieldName:i,options:o={},style:d={},placeholder:u=Se("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{listHeight:g=tr}=o,{hideHeader:v,onlySelect:y=!0}=this.searchHelper||o,b=this.searchHelper.columns||[],x=yt("form-immediate"),E=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,C=q.default.createElement(s.Spin,{spinning:l},n.length?q.default.createElement("table",{cellSpacing:0,cellPadding:0,className:J.default("table")},!v&&q.default.createElement("thead",null,q.default.createElement("tr",null,b.filter((e=>!e.hidden)).map((e=>q.default.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),q.default.createElement("tbody",null,n.map(((e,t)=>q.default.createElement("tr",{key:t,className:this.state.activeIndex===t?"active":"",onMouseEnter:()=>{this.setState({activeIndex:t})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},b.filter((e=>!e.hidden)).map((t=>q.default.createElement("td",{key:t.dataIndex},m.get(e,t.dataIndex))))))))):q.default.createElement(hn,null));return q.default.createElement(xe.Consumer,null,(l=>{const o={[x]:!0,[`${x}--lg`]:"large"===(null==l?void 0:l.size),[`${x}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Dr,{value:r,bordered:c}):q.default.createElement(gs,{action:h?[]:["click"],popupVisible:!h&&t,popup:C,popupClassName:J.default(o,`form-popper__${i}`),popupStyle:{minWidth:E,maxHeight:g},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:nr,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(s.Input,{ref:this.searchRef,placeholder:u,allowClear:f,bordered:c,readOnly:p,disabled:h,style:Object.assign({width:"100%"},d),value:null!=a?a:r,title:r,onFocus:()=>{!n.length&&this.fetchHandle(r)},onBlur:e=>{y&&!this._clicking&&a!==r&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(n[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 l=40===e.keyCode?++t%n.length:(--t+n.length)%n.length;this.setState({activeIndex:l})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),y?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}kc.contextType=Zn;class Lc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(kc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="",l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Lc.contextType=Zn;class Pc extends e.Component{render(){var e;const{$$form:t}=this.context,{type:l,label:n,fieldName:a,className:r,style:i={},collapse:o={}}=this.props.option,{expand:d}=t.state,{showLimit:u,remarkItems:c=[],onCollapse:f=lt}=o,p=[];if(c.length){const l=null!==(e=t.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],n=null!=u?u:l.length-1;l.slice(n+1).forEach((e=>{var l;const n=c.find((t=>t.fieldName===e.fieldName));if(!n)return;const a=n.showLabel?`${e.label}:`:"",r=null!==(l=t.getViewValue(e.fieldName))&&void 0!==l?l:"";""!==r&&p.push(Object.assign(Object.assign({},e),{text:`${a}${r}`}))}))}return q.default.createElement(s.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},q.default.createElement(bt,{id:a,label:n,className:r,extra:p.map((e=>e.text)).join(" | "),style:Object.assign({},i),collapse:d[a],onCollapseChange:e=>{t.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),f(e)}}))}}Pc.contextType=Zn;const Ac=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:Ac(e.children,t,l,n)}):e)),Dc=e=>{var t;const{$$form:l}=q.default.useContext(Zn),{value:n,items:a,multiple:r,loading:i,onChange:o,onValuesChange:d}=e,{t:u}=Xe(),{fieldName:c,options:f={},style:p={},placeholder:h=u("qm.form.selectPlaceholder"),bordered:g=!0,allowClear:v=!0,asyncLoad:y,readOnly:b,disabled:x}=e.option,{itemList:E,filterable:C=!0,listHeight:w=tr,checkStrictly:S,checkStrategy:N="SHOW_CHILD",collapseTags:T,echoRequest:I,defaultExpandAll:O=!y,defaultExpandedKeys:R,dropdownStyle:k,openPyt:L=!0}=f,[P,A]=q.default.useState(ot(E)?a:E),[D,_]=q.default.useState([]),[F,H]=q.default.useState(!1),[M,$]=q.default.useState(!1),j=q.default.useRef(null),K=q.default.useRef(null),V=q.default.useRef(P),z=q.default.useRef(M),W=q.default.useRef(null),B=e=>{$(e),z.current=e};Ad({ref:K,handler:()=>B(!1)}),q.default.useEffect((()=>{n!==W.current&&(Y(),W.current=n),(()=>{var e;K.current=(null===(e=j.current)||void 0===e?void 0:e.querySelector(".ant-select-selection-overflow-item-rest"))||null})()}),[n]),Ql((()=>{const e=ot(E)?a:E;y?m.isEqual(e,V.current)||(A((t=>[...e,...t.filter((e=>!!e.style))])),V.current=e):A(e)}),[E,a]),Ql((()=>{A((e=>[...e,...D.filter((t=>!e.some((e=>e.value===t.value))))]))}),[D]);const U=e=>{var t;return(null===(t=gr(P,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},G=e=>(S&&Array.isArray(n)&&n.every((e=>m.isPlainObject(e)))&&(e=e.map((e=>e.value))),r?(null==e?void 0:e.map((e=>U(e))).join(","))||"":U(e)),Y=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!I)return;if(!y)return mt("Form","TREE_SELECT 的 echoRequest 选项必须组合 `asyncLoad` 一起使用");const{fetchApi:t,params:l,dataKey:a,callback:r,formatter:i=(e=>e)}=I||{},{textKey:o="text",valueKey:s="value"}=y;if(t&&!ot(n))try{const d=yield t(i(Object.assign(Object.assign({},l),{[s]:n})));if(200===d.code){const t=Array.isArray(d.data)?d.data:null!==(e=m.get(d.data,a))&&void 0!==e?e:[];if(t.length){const e=hr(t,s,o);_(e.map((e=>Object.assign(Object.assign({},e),{style:{display:"none"}})))),null==r||r(t)}}}catch(e){}}));return l.isOnlyShow?q.default.createElement(Dr,{value:G(n),bordered:g}):q.default.createElement(gs,{popupVisible:!x&&M,popup:(()=>{if(!r)return null;const e=(null==n?void 0:n.map((e=>U(e))))||[];return q.default.createElement("ul",{className:"ant-dropdown-menu"},e.length?e.map(((e,t)=>q.default.createElement("li",{key:`${e}-${t}`,className:"ant-dropdown-menu-item"},e))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},u("qm.table.config.emptyText")))})(),popupStyle:{minWidth:null===(t=j.current)||void 0===t?void 0:t.offsetWidth},onPopupVisibleChange:e=>B(e),builtinPlacements:nr,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{ref:j,style:{width:"100%"}},q.default.createElement(s.TreeSelect,je({open:F,fieldNames:{label:"text",value:"value",children:"children"},value:n,multiple:r,treeCheckable:r,treeCheckStrictly:S,showCheckedStrategy:s.TreeSelect[N],popupClassName:`form-popper__${c}`,dropdownStyle:k,placeholder:h,listHeight:w,style:p,loading:i,bordered:g,allowClear:v,disabled:x,treeDefaultExpandAll:O,treeDefaultExpandedKeys:R,showSearch:C,maxTagCount:T?"responsive":void 0,loadData:y?({key:e,children:t})=>Ye(void 0,void 0,void 0,(function*(){var l;if(!y||t)return;const{fetchApi:n,params:a,dataKey:r,textKey:i="text",valueKey:o="value",callback:s,formatter:d=(e=>e)}=y;if(n)try{const t=yield n(d(Object.assign(Object.assign({},a),{[o]:e})));if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(l=m.get(t.data,r))&&void 0!==l?l:[],a=Ac(P,e,o,hr(n,o,i));A(a),null==s||s(n)}}catch(e){}})):void 0,treeData:P},r?{title:G(n)}:null,{filterTreeNode:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(L?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onMouseDown:e=>{e.target.classList.contains("ant-select-selection-overflow-item-rest")&&(B(!0),H(!1))},onDropdownVisibleChange:e=>{if(!e)return H(e);rt((()=>{z.current||H(e)}))},onChange:e=>{(e=>{null==o||o(e),d(e,G(e),P)})(e),W.current=e}}))))};class _c extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l){this.setState({loading:!0});try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=hr(l,r,i);this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:d={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":ct(u)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(Dc,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(s.Col,{flex:ct(f.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}_c.contextType=Zn;const Fc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,multiple:n,items:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:d={},placeholder:u=r("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:f=!0,asyncLoad:p,readOnly:h,disabled:g}=e.option,{itemList:v,changeOnSelect:y,checkStrictly:b,checkStrategy:x="SHOW_PARENT",filterable:E=!0,dropdownStyle:C,openPyt:w=!0}=o,[S,N]=q.default.useState(ot(v)?a:v),T=q.default.useRef(S);Ql((()=>{const e=ot(v)?a:v;p?m.isEqual(e,T.current)||(N(e),T.current=e):N(e)}),[v,a]);const I=e=>vr(S,null!=e?e:"").map((e=>e.text)).join("/"),O=e=>n?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return t.isOnlyShow?q.default.createElement(Dr,{value:O(l),bordered:c}):q.default.createElement(s.Cascader,je({value:(e=>ot(e)?[]:n?e.map((e=>e.split(","))):e.split(","))(l),fieldNames:{label:"text",value:"value",children:"children"},options:S,multiple:n,maxTagCount:"responsive",changeOnSelect:y||b,showCheckedStrategy:s.Cascader[x],popupClassName:`form-popper__${i}`,dropdownStyle:C,placeholder:u,style:d,bordered:c,allowClear:f,disabled:g,showSearch:E&&!p&&{filter:(e,t)=>t.some((t=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(w?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:p?e=>Ye(void 0,void 0,void 0,(function*(){var t;const l=e[e.length-1];if(!p||l.children)return;const{fetchApi:n,params:a,dataKey:r,textKey:i="text",valueKey:o="value",callback:s,formatter:d=(e=>e)}=p;if(n)try{const e=yield n(d(Object.assign(Object.assign({},a),{[o]:l.value})));if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(t=m.get(e.data,r))&&void 0!==t?t:[],a=Ac(S,l.value,o,hr(n,o,i));N(a),null==s||s(n)}}catch(e){}})):void 0},n?{title:O(l)}:null,{onChange:t=>{(t=>{const{onChange:l,onValuesChange:n}=e;null==l||l(t),n(t,O(t),S)})(((e=[])=>n?e.map((e=>e.join(","))):e.join(","))(t))}}))};class Hc extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l){this.setState({loading:!0});try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=hr(l,r,i);this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:d={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":ct(u)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(Fc,{option:this.props.option,multiple:t,items:l,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(s.Col,{flex:ct(f.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}Hc.contextType=Zn;const Mc=["110000","120000","310000","500000"],$c=["810000","820000"],qc=[{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"}],jc=[{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"}],Kc=e=>Pr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Vc=(e,t,l=1)=>{if(l>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Mc,...$c].includes(e))):Object.keys(e[t])).map((n=>({l:Kc(e[t][n].slice(0,1)).toUpperCase(),n:e[t][n],c:n,p:t,children:Vc(e,n,l+1)})))},zc=(e,t)=>t.map((t=>({l:Kc(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Wc extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.scrollRef=q.default.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(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}),re.default(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:zc(ve.default,Mc)},{l:"Z2",n:"港澳",c:"",p:"",children:zc(ve.default,$c)}]}createProvince(){var e;return(null!==(e=Vc(ve.default,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return jc.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Mc,...$c].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return q.default.createElement(s.Radio.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}))}},q.default.createElement(s.Radio.Button,{value:"0"},Se("qm.form.citySelectType.0")),q.default.createElement(s.Radio.Button,{value:"1"},Se("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?qc:jc).map((t=>q.default.createElement("li",{key:t.value,className:J.default({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return q.default.createElement(s.Select,{size:"small",placeholder:Se("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var l;return((null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>q.default.createElement(s.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:t}=this.state;return("0"===t?this.provinces:this.letterCities).map(((t,l)=>{var n;return q.default.createElement("div",{key:l},q.default.createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),q.default.createElement("dd",null,null===(n=t.children)||void 0===n?void 0:n.map((t=>q.default.createElement("li",{key:t.c,className:J.default({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))}))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:d=!0,readOnly:u,disabled:c}=this.props.option,f=yt("form-city-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=this.createTextValue(l),h=q.default.createElement("div",{className:"container",style:Object.assign({},r)},q.default.createElement("div",{className:"city-drop"},q.default.createElement("div",{className:"city-drop-toper"},q.default.createElement("div",{className:"city-drop-toper__type"},this.renderType()),q.default.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),q.default.createElement("div",{className:"city-drop-letter"},this.renderLetter()),q.default.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},q.default.createElement("dl",null,this.renderCity(l)))));return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Dr,{value:m,bordered:o}):q.default.createElement(gs,{action:c?[]:["click"],popupVisible:!c&&t,popup:h,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:nr,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(s.Input,{ref:this.searchRef,placeholder:i,allowClear:d,bordered:o,readOnly:u,disabled:c,style:Object.assign({width:"100%"},r),value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}Wc.contextType=Zn;class Bc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Wc,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Bc.contextType=Zn;const Uc=(e,t)=>{if(e[t])return Object.keys(e[t]).map((l=>({text:e[t][l],value:l,children:Uc(e,l)})))};class Gc extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const t=Uc(ve.default,"86")||[];this.state={results:t,visible:!1,values:[],tabs:[t.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:l}=this.props;t!==l&&this.state.values.join(",")!==(null!=l?l:"")&&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 l,n;return null===(n=null===(l=this.state.tabs[t])||void 0===l?void 0:l.find((t=>t.value===e)))||void 0===n?void 0:n.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 l=this.state.tabs.slice(0,1);for(let n=0;n<t.length;n++){const a=gr(e,t[n]);if(a&&ot(a.children)){this.isFetch&&this.getStreetList(t[n]);break}Array.isArray(null==a?void 0:a.children)&&(l[n+1]=null==a?void 0:a.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:l})}getStreetList(e){var t;return Ye(this,void 0,void 0,(function*(){const{request:l={}}=this.props.option,{fetchApi:n,formatter:a=(e=>e),dataKey:r,valueKey:i="value",textKey:o="text"}=l;if(n)try{const l=yield n(a({code:e}));if(200===l.code){const e=Array.isArray(l.data)?l.data:null!==(t=m.get(l.data,r))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[i]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,t=this.state.tabs.map(((t,l)=>{var n;const a=(null===(n=t.find((t=>t.value===e[l])))||void 0===n?void 0:n.text)||`${Se("qm.form.selectPlaceholder").replace("...","")}(${Se("qm.form.regionSelectLabel")[l]})`;return q.default.createElement(Un.TabPane,{key:l.toString(),tab:a},q.default.createElement("div",{className:"region-box"},t.map((t=>q.default.createElement("span",{key:t.value,className:J.default({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[l]=t.value.toString(),e=e.slice(0,l+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(l+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(l+1)}))}},t.text)))))}));return t.length?q.default.createElement(Un,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):q.default.createElement(hn,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:d=!0,readOnly:u,disabled:c}=this.props.option,f=yt("form-region-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=q.default.createElement("div",{className:"container"},this.renderTabs());let h=this.prevText;if(!t){const e=this.createTextValue(l);(""===e||e.split("/").every((e=>""!==e)))&&(h=e,this.prevText=h)}return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Dr,{value:h,bordered:o}):q.default.createElement(gs,{action:c?[]:["click"],popupVisible:!c&&t,popup:m,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:nr,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(s.Input,{ref:this.searchRef,placeholder:i,allowClear:d,bordered:o,style:Object.assign({width:"100%"},r),readOnly:u,disabled:c,value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&rt((()=>this.initial()))}})))}))}}Gc.contextType=Zn;class Yc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Gc,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Yc.contextType=Zn;const Xc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i={},disabled:o,readOnly:d}=e.option,{multiple:u=!0,maxCount:c=1,fileTypes:f,fileSize:p,draggable:h,editable:v,batchDownload:y,fileDirection:b,onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S}=r,{action:N,headers:T,params:I,withCredentials:O=!1,dataKey:R="",downloadWithHeaders:k,fieldAliasMap:L,beforeUpload:P,button:A}=i,D="function"==typeof L?L():L||{},{t:_}=Xe();return q.default.createElement(qn,{name:"file",action:N,multiple:u,headers:T,data:I,withCredentials:O,downloadWithHeaders:k,beforeUpload:P,maxCount:c,fileTypes:f,fileSize:p,draggable:h,editable:v,batchDownload:y,fileDirection:b,disabled:o||t.props.disabled,readOnly:t.isOnlyShow||d,button:A,showUploadList:{showDownloadIcon:!0,downloadIcon:q.default.createElement(g.DownloadOutlined,null)},fileList:l,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const l=e.response||{},n={};for(const a in D)n[a]=e[a]||(null===(t=l.data)||void 0===t?void 0:t[D[a]])||"";return e.response&&200!==l.code&&s.message.error(l.message||_("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},n),{url:e.url||(R?m.get(l.data,R):l.data)||"",status:e.status})}));null==n||n(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S})};class Qc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Xc,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Qc.contextType=Zn;const Zc=q.default.forwardRef(((e,t)=>{const l=Ne({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:n,style:a,src:r,alt:i,imgStyle:o}=l,s=Ue(l,["className","style","src","alt","imgStyle"]),d=q.default.useRef(null),u=q.default.useRef(null);q.default.useEffect((()=>{const e={};for(const t in s)void 0!==l[t]&&(e[t]=l[t]);return u.current=new ye.default(d.current,e),()=>{v(),u.current=null}}),[]);const c=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.reset()},f=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.clear()},p=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.crop()},m=(e,t=!1)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.replace(e,t)},h=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.enable()},g=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.disable()},v=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.destroy()},y=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.move(e,t)},b=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.moveTo(e,t)},x=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoom(e)},E=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoomTo(e,t)},C=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotate(e)},w=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotateTo(e)},S=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleX(e)},N=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleY(e)},T=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.scale(e,t)},I=(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)},R=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getContainerData()},k=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getImageData()},L=()=>{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)},A=()=>{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)},_=(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)},H=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setDragMode(e)};q.default.useImperativeHandle(t,(()=>({reset:c,clear:f,initCrop:p,replace:m,enable:h,disable:g,destroy:v,move:y,moveTo:b,relativeZoom:x,zoomTo:E,rotate:C,rotateTo:w,scaleX:S,scaleY:N,scale:T,getData:I,setData:O,getContainerData:R,getImageData:k,getCanvasData:L,setCanvasData:P,getCropBoxData:A,setCropBoxData:D,getCroppedCanvas:_,setAspectRatio:F,setDragMode:H})));const M={[yt("cropper")]:!0};return q.default.createElement("div",{className:J.default(M,n),style:a},q.default.createElement("img",{ref:d,src:r,alt:i,style:Object.assign({maxWidth:"100%"},o)}))}));Zc.displayName="Cropper";const Jc=e=>{const{fileTypes:t=[],fileSize:l,fixedSize:n,quality:a,beforeCrop:r,className:i}=e,{t:o}=Xe(),d=q.default.useRef(null),u=q.default.useRef(),c=q.default.useRef(),f=q.default.useRef(),p=q.default.useRef(),[m,h]=q.default.useState(""),v=e=>{d.current.relativeZoom(e)},y=e=>{d.current.rotate(e)},b=()=>{h("")},x=yt("cropper-preview");return q.default.createElement(q.default.Fragment,null,(()=>{const t=Array.isArray(e.children)?e.children[0]:e.children;if(!t)return null;const l=t.props,{beforeUpload:n}=l,a=Ue(l,["beforeUpload"]);return u.current=n,q.default.createElement(t.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((l,n)=>Ye(void 0,void 0,void 0,(function*(){const n=()=>l(s.Upload.LIST_IGNORE);if(r&&!(yield r(e,t)))return void n();c.current=e,f.current=l,p.current=n;const a=new FileReader;a.onload=()=>{h(a.result),a.onload=null},a.readAsDataURL(e)}))))}))})(),m&&q.default.createElement(s.Modal,{open:!0,wrapClassName:J.default(x,i),title:o("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{Ye(void 0,void 0,void 0,(function*(){const{type:e,name:l,uid:n}=c.current;d.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((a=>Ye(void 0,void 0,void 0,(function*(){let r=new File([a],l,{type:e});if(Object.assign(r,{uid:n}),t.length&&!t.includes(r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()))return s.message.warning(o("qm.upload.tooltip",{type:t.join(",")})),p.current("file type is error");if("function"!=typeof u.current)return f.current(r);const i=u.current(r,[r]);if("boolean"==typeof i||i){if(!0===i)return f.current(r);if(!1===i)return p.current("not upload");if(i&&"function"==typeof i.then)try{const e=yield i,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(r=e),f.current(r)}catch(e){p.current(e)}}else mt("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,a),yield at(100),b()}))},onCancel:b,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:n?`calc(380px * ${n[1]/n[0]})`:"auto"};return q.default.createElement("div",{className:"cropper-preview"},q.default.createElement("div",{className:"cropper-area"},q.default.createElement("div",{className:"img-cropper"},q.default.createElement(Zc,{ref:d,aspectRatio:n?n[0]/n[1]:n,src:m,dragMode:"move",preview:".preview"})),q.default.createElement("div",{className:"actions"},q.default.createElement(s.Space,{size:"small"},q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomInOutlined,null),onClick:()=>v(.2)},o("qm.uploadCropper.zoomIn")),q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomOutOutlined,null),onClick:()=>v(-.2)},o("qm.uploadCropper.zoomOut")),q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateRightOutlined,null),onClick:()=>y(90)},o("qm.uploadCropper.rotatePlus")),q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateLeftOutlined,null),onClick:()=>y(-90)},o("qm.uploadCropper.rotateSubtract"))))),q.default.createElement("div",{className:"preview-area"},q.default.createElement("div",{className:"preview",style:e})))})()))},ef=e=>{const t=Ne({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:l=[],openCropper:n=!0,fixedSize:a,quality:r=1,fileTypes:i,fileSize:o,maxCount:d,draggable:u,disabled:c,readOnly:f,className:p,popupClassName:m,beforeCrop:h,onSortChange:v,onChange:y}=t,{t:b}=Xe(),{$size:x}=Ze(t),E=q.default.useRef(null),C=q.default.useRef(null),w=q.default.useRef(!1),[S,N]=q.default.useState(!1),[T,I]=q.default.useState(0),O=q.default.useMemo((()=>c||f),[c,f]),R=q.default.useMemo((()=>!d||l.length<d),[l,d]);q.default.useEffect((()=>(L(),document.addEventListener("paste",A),()=>{var e;null===(e=C.current)||void 0===e||e.destroy(),document.removeEventListener("paste",A)})),[]),Ql((()=>{R||(w.current=!1)}),[l]);const k=Qe((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...l],[a]=e.splice(t,1);e.splice(n,0,a),null==v||v(e),null==y||y({file:l[t],fileList:e})}})),L=()=>{u&&(C.current=ne.default.create(on(E.current,yt("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:k}))},P=(e,l)=>new Promise(((n,a)=>Ye(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,beforeUpload:o}=t,d=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!i||e.size/1024/1024<i,c=d&&u;if(d||s.message.warning(b("qm.upload.tooltip",{type:r.join(",")})),u||s.message.warning(b("qm.upload.sizeLimit",{size:i})),!c)return s.Upload.LIST_IGNORE;if(o){const t=o(e,l);if(!0===t)return n(e);if(!1===t)return a("not upload");if(t&&"function"==typeof t.then)try{const e=yield t;n(e)}catch(e){a(e)}}else n(e)})))),A=Qe((e=>Ye(void 0,void 0,void 0,(function*(){const{action:n,data:a,headers:r}=t;if(w.current&&R&&n)for(const t of e.clipboardData.items)if("file"===t.kind&&t.type.startsWith("image/")){const e=t.getAsFile(),i=Date.now(),o=new File([e],`screenshot-${i}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${i}`});try{yield P(o,[...l,o]);const e=new FormData;if(e.append("file",o),a)for(const t in a)e.append(t,a[t]);const t="string"==typeof n?n:yield n(o),i=yield fetch(t,{method:"POST",body:e,headers:r});if(!i.ok)throw new Error(b("qm.upload.uploadError"));const s=yield i.json();null==y||y({file:o,fileList:[...l,{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=yt("upload-img"),_={[D]:!0,[`${D}--lg`]:"large"===x,[`${D}--sm`]:"small"===x},F=q.default.createElement(s.Upload,je({className:J.default(_,p)},dt(t,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=l.findIndex((t=>t.url===e.url));t<0||(I(t),N(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,t,l,n)=>q.default.createElement("div",{className:J.default("upload-item",{handle:u})},e,!O&&q.default.createElement(g.CloseOutlined,{title:b("qm.upload.remove"),className:"icon",onClick:()=>n.remove()}))}),q.default.createElement("span",{className:"inner",ref:E},R&&!(f&&l.length)&&q.default.createElement(q.default.Fragment,null,q.default.createElement("p",{className:"ant-upload-drag-icon"},q.default.createElement(g.InboxOutlined,null)),q.default.createElement("p",{className:"ant-upload-text"},b("qm.uploadCropper.dragableText")),q.default.createElement("button",{className:J.default("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{w.current=!0},onBlur:()=>{w.current=!1}},b("qm.uploadCropper.pasteText")))));return q.default.createElement(q.default.Fragment,null,n?q.default.createElement(Jc,{className:m,fixedSize:a,quality:r,fileTypes:i,fileSize:o,beforeCrop:h},F):F,q.default.createElement("div",{style:{display:"none"}},q.default.createElement(s.Image.PreviewGroup,{key:l.map((e=>e.uid||"")).join(","),preview:{visible:S,current:T,rootClassName:m,onVisibleChange:e=>N(e)}},l.map(((e,t)=>q.default.createElement(s.Image,{key:e.uid||t,src:e.url,alt:""}))))))};ef.displayName="QmUploadImg";const tf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i={},disabled:o,readOnly:d}=e.option,{multiple:u=!0,maxCount:c=1,fixedSize:f,quality:p,openCropper:h,fileTypes:g,fileSize:v,draggable:y,onRemove:b,onSortChange:x}=r,{action:E,headers:C,params:w,withCredentials:S=!1,dataKey:N="",popupClassName:T,fieldAliasMap:I,beforeUpload:O}=i,R="function"==typeof I?I():I||{},{t:k}=Xe();return q.default.createElement(ef,{name:"file",action:E,multiple:u,headers:C,data:w,withCredentials:S,popupClassName:T,beforeUpload:O,maxCount:c,fixedSize:f,quality:p,openCropper:h,fileTypes:g,fileSize:v,draggable:y,disabled:o||t.props.disabled,readOnly:t.isOnlyShow||d,fileList:l,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const l=e.response||{},n={};for(const a in R)n[a]=e[a]||(null===(t=l.data)||void 0===t?void 0:t[R[a]])||"";return e.response&&200!==l.code&&s.message.error(l.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},n),{url:e.url||(N?m.get(l.data,N):l.data)||"",status:e.status})}));null==n||n(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onRemove:b,onSortChange:x})};class lf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(tf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}lf.contextType=Zn;const nf={onActivate:de.func,onAddUndo:de.func,onBeforeAddUndo:de.func,onBeforeExecCommand:de.func,onBeforeGetContent:de.func,onBeforeRenderUI:de.func,onBeforeSetContent:de.func,onBeforePaste:de.func,onBlur:de.func,onChange:de.func,onClearUndos:de.func,onClick:de.func,onContextMenu:de.func,onCommentChange:de.func,onCopy:de.func,onCut:de.func,onDblclick:de.func,onDeactivate:de.func,onDirty:de.func,onDrag:de.func,onDragDrop:de.func,onDragEnd:de.func,onDragGesture:de.func,onDragOver:de.func,onDrop:de.func,onExecCommand:de.func,onFocus:de.func,onFocusIn:de.func,onFocusOut:de.func,onGetContent:de.func,onHide:de.func,onInit:de.func,onKeyDown:de.func,onKeyPress:de.func,onKeyUp:de.func,onLoadContent:de.func,onMouseDown:de.func,onMouseEnter:de.func,onMouseLeave:de.func,onMouseMove:de.func,onMouseOut:de.func,onMouseOver:de.func,onMouseUp:de.func,onNodeChange:de.func,onObjectResizeStart:de.func,onObjectResized:de.func,onObjectSelected:de.func,onPaste:de.func,onPostProcess:de.func,onPostRender:de.func,onPreProcess:de.func,onProgressState:de.func,onRedo:de.func,onRemove:de.func,onReset:de.func,onSaveContent:de.func,onSelectionChange:de.func,onSetAttrib:de.func,onSetContent:de.func,onShow:de.func,onSubmit:de.func,onUndo:de.func,onVisualAid:de.func,onSkinLoadError:de.func,onThemeLoadError:de.func,onModelLoadError:de.func,onPluginLoadError:de.func,onIconsLoadError:de.func,onLanguageLoadError:de.func},af=Object.assign({apiKey:de.string,id:de.string,inline:de.bool,init:de.object,initialValue:de.string,onEditorChange:de.func,value:de.string,tagName:de.string,cloudChannel:de.string,plugins:de.oneOfType([de.string,de.array]),toolbar:de.oneOfType([de.string,de.array]),disabled:de.bool,textareaName:de.string,tinymceScriptSrc:de.string,rollback:de.oneOfType([de.number,de.oneOf([!1])]),scriptLoading:de.shape({async:de.bool,defer:de.bool,delay:de.number})},nf),rf=e=>"function"==typeof e,of=e=>e in nf,sf=e=>e.substr(2),df=(e,t,l,n,a)=>((e,t,l,n,a,r,i)=>{const o=Object.keys(a).filter(of),s=Object.keys(r).filter(of),d=o.filter((e=>void 0===r[e])),u=s.filter((e=>void 0===a[e]));d.forEach((e=>{const t=sf(e),n=i[t];l(t,n),delete i[t]})),u.forEach((l=>{const a=n(e,l),r=sf(l);i[r]=a,t(r,a)}))})(a,e.on.bind(e),e.off.bind(e),((t,l)=>n=>{var a;return null===(a=t(l))||void 0===a?void 0:a(n,e)}),t,l,n);let uf=0;const cf=e=>{const t=Date.now(),l=Math.floor(1e9*Math.random());return uf++,e+"_"+l+uf+String(t)},ff=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),pf=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),mf=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},hf=()=>({listeners:[],scriptId:cf("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),gf=(()=>{let e=hf();return{load:(t,l,n,a,r,i)=>{const o=()=>((e,t,l,n,a,r)=>{const i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e,i.src=l,i.async=n,i.defer=a;const o=()=>{i.removeEventListener("load",o),r()};i.addEventListener("load",o),t.head&&t.head.appendChild(i)})(e.scriptId,t,l,n,a,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,r>0?setTimeout(o,r):o()))},reinitialize:()=>{e=hf()}}})(),vf=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class yf extends $.Component{constructor(e){var t,l,n;super(e),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,l,n;const a=this.elementRef.current;if(!a)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,l=e.parentNode;for(;null!=l;)t=l,l=t.parentNode;return t===e.ownerDocument}return e.isConnected})(a)){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 r=vf(this.view);if(!r)throw new Error("tinymce should have been loaded into global scope");const i=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:a,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,pf(o).concat(pf(s))),toolbar:null!==(l=this.props.toolbar)&&void 0!==l?l:null===(n=this.props.init)||void 0===n?void 0:n.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!ff(a)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&rf(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,l;const n=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==n&&(this.currentContent=n,e.setContent(n),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const a=null!==(l=this.props.disabled)&&void 0!==l&&l;mf(this.editor,a?"readonly":"design"),this.props.init&&rf(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(a.style.visibility=""),ff(a)&&(a.value=this.getInitialValue()),r.init(i)},this.id=this.props.id||cf("tiny-react"),this.elementRef=$.createRef(),this.inline=null!==(n=null!==(t=this.props.inline)&&void 0!==t?t:null===(l=this.props.init)||void 0===l?void 0:l.inline)&&void 0!==n&&n,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,l;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 l=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const n of[t,l])if(n)try{e.selection.moveToBookmark(n),this.valueCursor=n;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(l=this.props.disabled)&&void 0!==l&&l;mf(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,l,n,a,r;null!==vf(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&gf.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!==(n=null===(l=this.props.scriptLoading)||void 0===l?void 0:l.defer)&&void 0!==n&&n,null!==(r=null===(a=this.props.scriptLoading)||void 0===a?void 0:a.delay)&&void 0!==r?r: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,l;return(null===(l=null===(t=null===(e=vf(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===l?void 0:l.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:e="div"}=this.props;return $.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return $.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){df(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,l=t(e),n=t(this.props);!l&&n?(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)):l&&!n&&(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 bf;yf.propTypes=af,yf.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(bf||(bf={}));const xf=e=>{var t;const{className:l,style:n,tinymce:a={},upload:r={},thresholdSize:i=.5,tinymceScriptSrc:o,disabled:d,value:u,onResizeEditor:c,onChange:f}=e,{global:p}=q.default.useContext(xe),{$size:h}=Ze(e),{$locale:g,t:v}=Xe(),y=400,b="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",x="file edit view insert format tools table help",E="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",C=Object.assign(Object.assign({height:a.height||y,plugins:a.plugins||b,toolbar:a.toolbar||E,menubar:a.menubar||x,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:bf[g],skin:"tinymce-5"},dt(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>new Promise(((t,l)=>Ye(void 0,void 0,void 0,(function*(){const{action:l,headers:n,dataKey:a}=r,o=`data:image/jpeg;base64,${e.base64()}`,d=new FormData;d.append("file",e.blob(),e.filename());const u=e.blob().size;if(l&&u/1024/1024>i)try{const e=yield fetch(l,{method:"POST",body:d,headers:n});if(!e.ok)throw new Error(v("qm.upload.uploadError"));const r=yield e.json();if(200===r.code){const e=a?m.get(r.data,a):r.data;t(e)}}catch(e){s.message.error(v("qm.uploadCropper.uploadError"))}else t(o)})))),setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:l,offsetHeight:n}=e.editorContainer;null==c||c({width:l,height:n},t)}))}}),w=yt("tinymce"),S={[w]:!0,[`${w}--lg`]:"large"===h,[`${w}--sm`]:"small"===h},N={init:C,value:u,disabled:d,tinymceScriptSrc:o||(null===(t=null==p?void 0:p.tinymce)||void 0===t?void 0:t.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==f||f(t.getContent(),t)}};return q.default.createElement("div",{className:J.default(S,l),style:n},q.default.createElement(yf,N))};xf.displayName="QmTinymce";const Ef=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i,style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{tinymce:u,thresholdSize:c,onResizeEditor:f}=r;return q.default.createElement(xf,{value:l,tinymce:u,upload:i,thresholdSize:c,style:Object.assign({width:"100%"},o),disabled:d||s||t.isOnlyShow,onResizeEditor:f,onChange:e=>{(e=>{null==n||n(e),a(e)})(e)}})};class Cf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ef,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Cf.contextType=Zn;class wf extends e.Component{constructor(e){var t;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=q.default.createRef(),this.formRef=q.default.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(t=this.props.cols)&&void 0!==t?t: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 l=Math.floor(t/300);l=24%l==0?l:l-1,l=l<1?1:l,l=l>8?8:l,l!==this.state.flexCols&&this.setState({flexCols:l})},this.resizeListenerHandle=m.debounce(this.resizeObserveHandler,10),this.getFormItems=oe.default((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=oe.default((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{m.isPlainObject(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onValuesChange)||void 0===n||n.call(l,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onFieldsChange)||void 0===n||n.call(l,e,t)},this.finishHandle=e=>{var t,l;null===(l=(t=this.props).onFinish)||void 0===l||l.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var l,n;null===(n=(l=this.props).onFinishFailed)||void 0===n||n.call(l,t)},this.openValidateInfo=e=>{const t=q.default.createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return q.default.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));s.notification.error({message:Se("qm.form.validatePrompt"),description:t,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&re.default(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(){xn(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){En(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&&mt("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),l={};for(const n in e)t.includes(n)||(l[n]=e[n]);return Object.assign({},l)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>m.isPlainObject(e.extra))).forEach((l=>{var n;t[l.fieldName]=null!==(n=e[l.fieldName])&&void 0!==n?n:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>m.isPlainObject(e.collapse))).forEach((t=>{var l;e[t.fieldName]=null!==(l=t.collapse.defaultExpand)&&void 0!==l&&l})),Object.assign({},e)}getInitialValue(e,t){var l;const{type:n,options:a}=e;return t=null!=t?t:void 0,lr.includes(n)&&(t=null!=t?t:[]),"CHECKBOX"!==n&&"SWITCH"!==n||(t=null!==(l=null!=t?t:null==a?void 0:a.falseValue)&&void 0!==l?l:er),t}createFormValue(e){const t={};return this.flattenItems.forEach((l=>{t[l.fieldName]=this.getInitialValue(l,e[l.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=ut(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((l=>({viewData:Object.assign({},l.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){var t,l;e!==this.state.collapse&&(this.setState({collapse:e}),null===(l=(t=this.props).onCollapse)||void 0===l||l.call(t,e),rt((()=>{var t,l;return null===(l=(t=this.props).onCollapse)||void 0===l?void 0:l.call(t,e)})))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:l}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!l||setTimeout((()=>this.CREATE_FOCUS(l)))}getFormItemLabel(e){var t,l,n,a,r;if(yr(e))return br(e);if(m.isPlainObject(e)){const{fieldName:i,label:o,options:s={}}=e;if(yr(o))return br(o);const{itemList:d=[]}=s,u=null!==(n=null!==(l=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([i])[i])&&void 0!==l?l:this._initialValues[i])&&void 0!==n?n:null===(a=d[0])||void 0===a?void 0:a.value;return(null===(r=d.find((e=>e.value===u)))||void 0===r?void 0:r.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,l=this.dividers.length;t<l;t++){const l=this.formItems.findIndex((e=>e===this.dividers[t]));let n=this.formItems.findIndex((e=>e===this.dividers[t+1]));n=n>-1?n:void 0,e.push(this.formItems.slice(l,n).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var l,n;if("DIVIDER"===e)return!0;const a=this.getBlockDerivedItems();for(let e=0,r=a.length;e<r;e++){const r=a[e],i=this.dividers.find((e=>e.fieldName===r[0].fieldName)),o=null!==(n=null===(l=null==i?void 0:i.collapse)||void 0===l?void 0:l.showLimit)&&void 0!==n?n:r.length-1;for(let e=1;e<r.length;e++){if(r[e].fieldName===t&&e>o)return this.state.expand[r[0].fieldName]}}return!0}formatFormValue(e){var t,l;for(const n in e){const a=e[n];if(cr(a)&&(e[n]=""),Array.isArray(a)&&a.forEach(((t,l)=>{cr(t)&&(e[n][l]="")})),n.includes("|")&&Array.isArray(a)){const[r,i]=n.split("|");e[r]=null!==(t=a[0])&&void 0!==t?t:"",e[i]=null!==(l=a[1])&&void 0!==l?l:""}}if(this.isFilterType)for(const t in e)ot(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,l;return Ye(this,void 0,void 0,(function*(){const{authConfig:n}=this.props;if(!n)return;let a=dt(n,["fetch"]);if(n.fetch){const{api:t,params:l,dataKey:r}=n.fetch;try{const n=yield t(l);200===n.code&&(a=null!==(e=r?m.get(n.data,r):n.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(a.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,l=a.fieldList.find((e=>e.dataIndex===t));if(l){const n=this.originItems.find((e=>e.fieldName===t)),{visible:a=1,disabled:r,secretName:i}=l;a||(e.noAuth=!0,n.noAuth=!0),r&&(e.disabled=!0,n.disabled=!0),i&&(e.options?e.options.secretType=i:e.options={secretType:i},n.options=Object.assign({},n.options,{secretType:i})),this.setFieldAuth(t,{visible:a,disabled:r,secretName:i})}return e}));null===(l=(t=this.props).fieldsChange)||void 0===l||l.call(t,e)}}))}INPUT(e){return q.default.createElement(Kr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return q.default.createElement(zr,{option:e})}INPUT_NUMBER(e){return q.default.createElement(Br,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return q.default.createElement(Gr,{option:e})}SEARCH_HELPER(e){return q.default.createElement(Bu,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return q.default.createElement(Yu,{option:e})}TREE_TABLE_HELPER(e){return q.default.createElement(lc,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return q.default.createElement(ac,{option:e})}RANGE_SEARCH_HELPER(e){return q.default.createElement(uc,{option:e})}CHECKBOX(e){return q.default.createElement($r,{option:e})}MULTIPLE_CHECKBOX(e){return q.default.createElement(fc,{option:e})}RATE(e){return q.default.createElement(mc,{option:e})}RADIO(e){return q.default.createElement(gc,{option:e})}SWITCH(e){return q.default.createElement(yc,{option:e})}TEXT_AREA(e){return q.default.createElement(xc,{option:e})}DATE(e){return q.default.createElement(Cc,{option:e})}RANGE_DATE(e){return q.default.createElement(Nc,{option:e})}TIME(e){return q.default.createElement(Ic,{option:e})}RANGE_TIME(e){return q.default.createElement(Rc,{option:e})}SELECT(e){return q.default.createElement(Hr,{option:e})}MULTIPLE_SELECT(e){return q.default.createElement(Hr,{option:e,multiple:!0})}IMMEDIATE(e){return q.default.createElement(Lc,{option:e})}DIVIDER(e){return q.default.createElement(Pc,{option:e})}TREE_SELECT(e){return q.default.createElement(_c,{option:e})}MULTIPLE_TREE_SELECT(e){return q.default.createElement(_c,{option:e,multiple:!0})}CASCADER(e){return q.default.createElement(Hc,{option:e})}MULTIPLE_CASCADER(e){return q.default.createElement(Hc,{option:e,multiple:!0})}CITY_SELECT(e){return q.default.createElement(Bc,{option:e})}REGION_SELECT(e){return q.default.createElement(Yc,{option:e})}UPLOAD_FILE(e){return q.default.createElement(Qc,{option:e})}UPLOAD_IMG(e){return q.default.createElement(lf,{option:e})}TINYMCE(e){return q.default.createElement(Cf,{option:e})}renderFormLabel(e){if(yr(e)||!m.isPlainObject(e))return e;const{type:t,fieldName:l,label:n,options:a={},onChange:r=lt}=e,{itemList:i=[]}=a;return"SELECT"===t?q.default.createElement(s.Form.Item,{name:l,noStyle:!0},q.default.createElement(Fr,{option:e,items:i,loading:!1,onValuesChange:(e,t)=>r(e,t)})):"CHECKBOX"===t?q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{style:{paddingRight:5}},n),q.default.createElement(s.Form.Item,{name:l,noStyle:!0},q.default.createElement(Mr,{option:e,onValuesChange:e=>r(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:l,style:n={},render:a}=e,{extra:r}=this.state;if(l)return q.default.createElement(s.Tooltip,{className:"extra-tooltip",title:r[t]},q.default.createElement(g.ExclamationCircleOutlined,{style:{marginLeft:4}}));const i=this.formItems.find((e=>e.fieldName===t));return q.default.createElement("div",{className:"extra-text",title:a?"":r[t],style:n},q.default.createElement("span",{className:"extra-overflow-cut"},a?a(i,this):r[t]))}renderFormItemButton(e,t){const l=this.formItems.find((t=>t.fieldName===e)),n="function"==typeof t?t(l):t;return this.isOnlyShow?null:n}renderFormItem(e){const{label:t,fieldName:l,invisible:n,tooltip:a,className:r,labelWidth:i=this.props.labelWidth,validateTrigger:o,rules:d=[],style:u={},render:c}=e;return q.default.createElement(s.Form.Item,{label:this.renderFormLabel(t),name:l,rules:d,tooltip:a,hidden:n,className:J.default(r),style:Object.assign({width:"100%"},u),labelCol:{flex:this.verticalLayout?"initial":ct(i)},validateTrigger:o,messageVariables:{label:this.getFormItemLabel(t)}},this.formRef.current?c(e,this):q.default.createElement(q.default.Fragment,null))}createFormItem(e){return m.isFunction(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(mt("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:l,isFieldsDefine:n}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:l=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<l;e++)a.push({})}));const r=24/e,i=[],o=a.reduce(((e,t)=>{const{selfCol:l=1}=t,n=e+l;return i.push(n),n}),0),d=l>Math.ceil(o/e)?Math.ceil(o/e):l,u=[],c=a.map(((t,l)=>{let{selfCol:n=1}=t;const{type:a,fieldName:o}=t;n=n>=24||"DIVIDER"===a||"TINYMCE"===a?e:n;const c=!(!this.state.collapse&&this.showFilterCollapse)||i[l]<d*e,f=!this.showDividerCollapse||this.getFormItemDisplay(t);return c&&u.push(i[l]),q.default.createElement(s.Col,{key:null!=o?o:l,className:o,span:n*r,style:this.isFilterType?{display:!this.showFilterCollapse||c?"block":"none"}:{display:f?"block":"none"}},a?this.createFormItem(ut(t)):null)}));return n&&"default"===t&&c.push(q.default.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...c,this.createSearchButtonLayout(u[u.length-1])]}createSearchButtonLayout(e=0){const{flexCols:t,collapse:l}=this.state,{searchButtonCols:n,isSearchBtn:a,isFieldsDefine:r=!0}=this.props;if(!this.isFilterType)return null;const i=24/t,o=n||1,d=t-e%t-o;return a?q.default.createElement(s.Col,{key:"-",span:o*i,offset:d*i,style:{textAlign:"right"}},q.default.createElement(s.Space,{style:{marginBottom:12}},q.default.createElement(ht,{type:"primary",size:this.$size,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},Se("qm.form.search")),q.default.createElement(ht,{size:this.$size,icon:q.default.createElement(g.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},Se("qm.form.reset")),r?this.createFieldsDefine():null,this.showFilterCollapse&&q.default.createElement("a",{onClick:()=>this.setExpandHandle(!l)},l?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",Se(l?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:l}=this.props;if(this.isFilterType)return null;const n=24/e;return l&&"default"===t?q.default.createElement(s.Row,{gutter:0},q.default.createElement(s.Col,{key:"-",span:n},q.default.createElement(s.Form.Item,null,q.default.createElement(s.Space,{style:{marginBottom:12}},q.default.createElement(ht,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Se("qm.form.save")),q.default.createElement(ht,{size:this.$size,onClick:()=>this.RESET_FORM()},Se("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:l}=this.props;return q.default.createElement(qr,{uniqueKey:e,items:t,fieldsChange:l})}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)=>Ye(this,void 0,void 0,(function*(){const[l,n]=yield this.VALIDATE_FIELDS(),a=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:[Se("qm.form.searchHelperTips")],warnings:[]})));l||a.length?t((l||[]).concat(a)):e(n)}))))}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 Ye(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 Ye(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 Ye(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 l=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),n=this.flattenItems.map((e=>e.fieldName)).filter((e=>!l.includes(e)));n.length&&this.formRef.current.resetFields(n),this.setState((e=>{const t=Object.keys(e.other),l=Object.keys(this._initialOthers),n=t.filter((e=>!l.includes(e))),a={};return n.forEach((e=>a[e]=void 0)),{other:Object.assign({},this._initialOthers,a)}})),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){mt("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,l){const{items:n,fieldsChange:a}=this.props,r=n.find((t=>t.fieldName===e));if(!r)return mt("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!m.isPlainObject(t))return mt("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(r.noAuth)return mt("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const l in t)l&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===l||m.set(r,l,t[l]));l&&(a?a([...n]):mt("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:t,layout:l,disabled:n,labelWidth:a,labelAlign:r,labelWrap:i,customClass:o}=this.props,d=yt("form"),u={required:"${label}"+Se("qm.form.requiredTips")},c={[d]:!0,[`${d}--lg`]:"large"===this.$size,[`${d}--sm`]:"small"===this.$size,[`${d}__only-show`]:this.isOnlyShow,[`${d}__compact`]:this.isCompactMode,[o]:!!o};return q.default.createElement("div",{ref:this.wrapperRef,className:J.default(c,e),style:t},q.default.createElement(s.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:l,labelAlign:r,labelWrap:i,colon:!1,disabled:n,labelCol:{flex:this.verticalLayout?"initial":ct(a)},validateMessages:u,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},q.default.createElement(Zn.Provider,{value:this.provide},q.default.createElement(s.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}wf.contextType=xe,wf.propTypes=or,wf.defaultProps=sr;const Sf=e=>null!=e;function Nf(e,t,l,n){const[a,r]=q.default.useState(void 0);q.default.useLayoutEffect((()=>{const t="function"==typeof e?e():e;r(t||null)}));const[i,o]=q.default.useState(null),s=()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,l=window.innerHeight||document.documentElement.clientHeight,{top:n,right:a,bottom:r,left:i}=e.getBoundingClientRect();return n>=0&&i>=0&&a<=t&&r<=l})(a)&&t&&a.scrollIntoView(n);const{left:e,top:l,width:r,height:i}=a.getBoundingClientRect(),s={left:e,top:l,width:r,height:i,radius:0};o((e=>JSON.stringify(e)!==JSON.stringify(s)?s:e))}else o(null)};q.default.useLayoutEffect((()=>{s()}),[a,t]),xi({handler:s});return[q.default.useMemo((()=>{if(!i)return i;const e=(null==l?void 0:l.offset)||6,t=(null==l?void 0:l.radius)||2;return{left:i.left-e,top:i.top-e,width:i.width+2*e,height:i.height+2*e,radius:t}}),[i,l]),a]}const Tf={fill:"transparent",pointerEvents:"auto"},If=e=>{const{prefixCls:t,rootClassName:l,pos:n,showMask:a,style:r={},fill:i="rgba(0,0,0,0.5)",open:o,animated:s,zIndex:d}=e,u=`${t}-mask-${di()}`,c="object"==typeof s?null==s?void 0:s.placeholder:s;return q.default.createElement(he.default,{open:o,autoLock:!0},q.default.createElement("div",{className:J.default(`${t}-mask`,l),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},r)},a?q.default.createElement("svg",{style:{width:"100%",height:"100%"}},q.default.createElement("defs",null,q.default.createElement("mask",{id:u},q.default.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),n&&q.default.createElement("rect",{x:n.left,y:n.top,rx:n.radius,width:n.width,height:n.height,fill:"black",className:c?`${t}-placeholder-animated`:""}))),q.default.createElement("rect",je({},n?null:Tf,{x:"0",y:"0",width:"100%",height:"100%",fill:i,mask:`url(#${u})`})),n&&q.default.createElement(q.default.Fragment,null,q.default.createElement("rect",je({},Tf,{x:"0",y:"0",width:"100%",height:`${n.top}px`})),q.default.createElement("rect",je({},Tf,{x:"0",y:"0",width:n.left,height:"100%"})),q.default.createElement("rect",je({},Tf,{x:"0",y:n.top+n.height,width:"100%",height:`calc(100vh - ${n.top+n.height}px)`})),q.default.createElement("rect",je({},Tf,{x:n.left+n.width,y:"0",width:`calc(100vw - ${n.left+n.width}px)`,height:"100%"})))):null))},Of=e=>{const{prefixCls:t,zIndex:l,open:n,onPause:a,onPlay:r}=e,[i,o]=hi(void 0,{value:n,postState:e=>null==e||e}),s=q.default.useRef(null),d=q.default.useRef(!1),u=Qe((e=>{c(e),e.shiftKey&&32===e.keyCode&&f()}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",u);return()=>e.remove()}),[]);const c=e=>{e.stopPropagation(),e.preventDefault()},f=()=>{d.current?d.current=!1:(o(!i),i?null==a||a():null==r||r())};return q.default.createElement("div",{ref:s,className:`${t}-control`,style:{zIndex:l+1},onMouseDown:e=>{c(e);const t=s.current,l=t.offsetWidth,n=t.offsetHeight,a=window.innerWidth,r=window.innerHeight,i=e.clientX-rn(t).x,o=e.clientY-rn(t).y;return document.onmousemove=e=>{let s=e.clientX-i,u=e.clientY-o;s<0&&(s=0),s>a-l-1&&(s=a-l-1),u<0&&(u=0),u>r-n-1&&(u=r-n-1),ln(t,{left:`${s}px`,top:`${u}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>f()},i?q.default.createElement(g.PauseOutlined,null):q.default.createElement(g.CaretRightOutlined,null))},Rf=e=>{const{prefixCls:t,current:l,total:n=0,cover:a,title:r,description:i,helper:o={},type:d,zIndex:u,onClose:c,onPrev:f,onNext:p,onFinish:m,className:h,indicatorsRender:v}=e,{t:y}=Xe(),b="primary"!==d?"primary":"default",x=Qe((e=>{S(e),40===e.keyCode&&(l<n-1?null==p||p():null==m||m()),38===e.keyCode&&l>0&&(null==f||f())}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",x);return()=>e.remove()}),[]);const E=Sf(a)?q.default.createElement("div",{className:`${t}-cover`},a):null,C=Sf(i)?q.default.createElement("div",{className:`${t}-description`},i):null;let w;w=v?v(l,n):[...Array.from({length:n}).keys()].map(((e,n)=>q.default.createElement("span",{key:e,className:J.default(n===l&&`${t}-indicator-active`,`${t}-indicator`)})));const S=e=>{e.stopPropagation(),e.preventDefault()};return q.default.createElement("div",{className:J.default(`${t}-content`,h)},q.default.createElement("div",{className:`${t}-inner`},q.default.createElement(g.CloseOutlined,{className:`${t}-close`,onClick:c}),o.content&&q.default.createElement(s.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:u},content:o.content,title:o.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${t}-close`,"help-icon")})),E,q.default.createElement("div",{className:`${t}-header`},q.default.createElement("div",{className:`${t}-title`},r)),C,q.default.createElement("div",{className:`${t}-footer`},n>1&&q.default.createElement("div",{className:`${t}-indicators`},w),q.default.createElement(vt,{className:`${t}-buttons`},0!==l?q.default.createElement(ht,{className:`${t}-prev-btn`,size:"small",onMouseDown:S,onClick:f},y("qm.tour.prevStep")):null,l===n-1?q.default.createElement(ht,{className:`${t}-finish-btn`,type:b,size:"small",onClick:m},y("qm.tour.finish")):q.default.createElement(ht,{className:`${t}-next-btn`,type:b,size:"small",onMouseDown:S,onClick:p},y("qm.tour.nextStep"))))))},kf=e=>{const{current:t,renderPanel:l}=e;return q.default.createElement(q.default.Fragment,null,"function"==typeof l?l(e,t):q.default.createElement(Rf,e))},Lf={left:"50%",top:"50%",width:1,height:1},Pf=q.default.forwardRef(((e,t)=>{const{steps:l=[],defaultCurrent:n,current:a,onChange:r,onClose:i,onFinish:o,open:s,type:d="default",mask:u=!0,arrow:c=!0,control:f=!0,overlayClassName:p,overlayStyle:m,placement:h,helper:g,zIndex:v,renderPanel:y,indicatorsRender:b,gap:x,animated:E=!0,scrollIntoViewOptions:C=!0}=e,w=Ue(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),S=q.default.useRef(),[N,T]=hi(0,{value:a,defaultValue:n}),[I,O]=hi(void 0,{value:s,postState:e=>!(N<0||N>=l.length)&&(null!=e&&e)}),[R,k]=hi(1051,{value:v,defaultValue:v}),[L,P]=q.default.useState(),A=q.default.useRef(I);q.default.useLayoutEffect((()=>{I&&!A.current&&T(0),A.current=I,P(I)}),[I]),q.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>k(e)})));const{target:D,type:_,placement:F,trigger:H,delay:M,style:$,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:W,action:B}=l[N]||{},U=W||R,G=_||d,Y=I&&(null!=V?V:u),X=null!=z?z:C,[Q,Z]=Nf(D,!!s,x,X),ee=((e,t,l)=>{var n;return null!==(n=null!=l?l:t)&&void 0!==n?n:null===e?"center":"bottom"})(Z,h,F),te=!!Z&&(void 0===j?c:j),le="object"==typeof te&&te.pointAtCenter;q.default.useLayoutEffect((()=>{var e;null===(e=S.current)||void 0===e||e.forceAlign()}),[le,N]),Ql((()=>{I&&(re(),null==B||B(Z,N))}),[I,Z]);const ne=e=>{T(e),null==r||r(e)},ae=()=>{O(!1),null==i||i(N)},re=()=>{if(!Z)return;const e=[];!function t(l){if(1===l.nodeType){var n;"INPUT"!==l.tagName&&"TEXTAREA"!==l.tagName||("none"===tn(n=l,"display")||"hidden"===tn(n,"visibility")||"0"===tn(n,"opacity"))||e.push(l);for(const e of Array.from(l.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ie=()=>Ye(void 0,void 0,void 0,(function*(){if(!H||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),l=Z.offsetWidth,n=Z.offsetHeight,[a,r]=[e+l/2,t+n/2],i=new MouseEvent(H,{bubbles:!0,cancelable:!0,button:0,clientX:a,clientY:r}),o=document.elementFromPoint(a,r);o&&(o.dispatchEvent(i),yield at(null!=M?M:320))})),oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,de=Object.assign({},m,$),ue=yt("tour"),ce=[{[`${ue}-primary`]:"primary"===G},p,K],fe=rd({arrowPointAtCenter:le,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(If,{zIndex:U,prefixCls:ue,pos:Q,showMask:oe,style:null==se?void 0:se.style,fill:null==se?void 0:se.color,open:L,animated:E,rootClassName:p}),q.default.createElement(he.default,{open:L,autoLock:!0},q.default.createElement(pe.default,je({ref:S},w,{zIndex:U,builtinPlacements:fe,popupStyle:de,popupPlacement:ee,popupVisible:L,popupClassName:J.default(ce),prefixCls:ue,popup:()=>q.default.createElement(kf,je({key:"content",arrow:te,prefixCls:ue,total:l.length,helper:g,renderPanel:y,indicatorsRender:b,onPrev:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),ne(N-1)})),onNext:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),ne(N+1)})),onClose:ae,current:N,onFinish:()=>{ae(),null==o||o()}},Object.assign({},l[N],{zIndex:U,type:G}))),arrow:!!te,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),q.default.createElement("div",{className:J.default(p,`${ue}-target-placeholder`),style:Object.assign(Object.assign({},Q||Lf),{position:"fixed",pointerEvents:"none"})}))),f&&q.default.createElement(he.default,{open:I},q.default.createElement(Of,{zIndex:U,prefixCls:ue,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));Pf.displayName="QmTour";var Af={previewWidth:1100,defaultDistance:.45,logoHeight:60};const Df=e.createContext(void 0);var _f=null;function Ff(){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),l=e.match(/MSIE\D?\d+/i),n=e.match(/OPR\D?\d+/i),a=e.match(/Firefox\D?\d+/i),r=e.match(/x64/i);if(!t&&!l&&r)return!0;if(a){if((a=a[0].match(/\d+/))[0]>=41||r)return!0}else if(n){if((n=n[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!l){var i=e.match(/Chrome\D?\d+/i);if(i&&(i=i[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Hf(e,t){var l;try{var n=navigator.userAgent,a=!!n.match(/MSIE/i)||!!n.match(/Trident/i);if(Ff()){try{l=getCLodop()}catch(e){}if(!l&&"complete"!==document.readyState)return void s.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!l)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{a&&n.match(/x64/i);if(e||t?l=a?e:t:_f?l=_f:((l=document.createElement("object")).setAttribute("width",0),l.setAttribute("height",0),l.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),a?l.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):l.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(l),_f=l),!l||!l.VERSION)return n.indexOf("Chrome"),n.indexOf("Firefox"),l}return l.VERSION<"6.2.2.6"&&Ff(),l}catch(e){s.message.error("getLodop 出错:"+e)}}Ff();const Mf=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:l,deviceYDPI:n}=window.screen;if(l&&n)t[0]=l,t[1]=n;else{let l=document.createElement("DIV");l.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(l),t[0]=parseInt(l.offsetWidth.toString()),t[1]=parseInt(l.offsetHeight.toString()),null===(e=l.parentNode)||void 0===e||e.removeChild(l),l=null}return t})()[0];return Math.ceil(t)},$f=q.default.forwardRef(((e,t)=>{const{templateRender:l,directPrint:n}=e,{global:a}=q.default.useContext(xe),{$$preview:r}=q.default.useContext(Df),{state:i,isWindowsPrinter:o,pageSize:s}=r,d=q.default.useRef(null),u=q.default.useRef({}),c=q.default.useRef([]),f=q.default.useRef([]),p=q.default.useRef([]),[m,h]=q.default.useState(!0);q.default.useImperativeHandle(t,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:R,SHOW_PREVIEW:L,DIRECT_PRINT:P}))),Ql((()=>{I()}),[i.form.printerType,i.form.setting.direction,i.form.setting.distance,i.form.setting.fixedLogo]),q.default.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const g=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*Af.defaultDistance+10*Af.defaultDistance:0;return("vertical"===e?s[0]:s[1])-t}),[i,o,s]),v=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*Af.defaultDistance+10*Af.defaultDistance:0;return("vertical"===e?s[1]:s[0])-t}),[i,o,s]),y=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Mf(g-10*(e.left-Af.defaultDistance)-10*(e.right-Af.defaultDistance))}),[i,g]),b=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Mf(v-10*(e.top-Af.defaultDistance)-10*(e.bottom-Af.defaultDistance))}),[i,v]),x=i.form.scale,E=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return{left:Mf(10*e.left),right:Mf(10*e.right),top:Mf(10*e.top),bottom:Mf(10*e.bottom)}}),[i]),C=q.default.useMemo((()=>{const{form:{printerType:e}}=i,{left:t,right:l,top:n,bottom:a}=E,r=y+t+l,o=Af.previewWidth-r<=0?0:(Af.previewWidth-r)/2,s=Math.abs((1-x)*r/2);let d=0;return x>1&&(d=s>o?-1*o:-1*s),x<1&&(d=r-2*s>Af.previewWidth?0:o>0?s:(Af.previewWidth-(r-2*s))/2),{width:`${y}px`,height:""+("stylus"===e?"auto":b+"px"),paddingLeft:`${t}px`,paddingRight:`${l}px`,paddingTop:`${n}px`,paddingBottom:`${a}px`,transform:`translateX(${d}px) scale(${x})`,opacity:m?0:1}}),[i,m,E,x,b,y]);c.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const w=()=>{var e,t,l,n;const r=null!==(t=null===(e=null==a?void 0:a.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",i=null!==(n=null===(l=null==a?void 0:a.print)||void 0===l?void 0:l.rightLogo)&&void 0!==n?n:"";return[`<tr style="height: ${Af.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',r?`<img src="${r}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>","</tr>"].join("")},S=()=>{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},N=()=>{let e=document.createElement("tr");var t,l;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=S().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(l=u.current.templateEl.children[0]).children[0]?l.insertBefore(t,l.children[0]):l.appendChild(t),e=null},T=()=>{const e=u.current.templateEl.children[0].children,t=[],l=[];for(let n=0;n<e.length;n++){if("template-cols"===e[n].getAttribute("type"))continue;const a=e[n].clientHeight;e[n].style.height=a+"px",l.push(a),t.push(e[n].outerHTML)}f.current=l,c.current=t},I=()=>{var e;if(!c.current.length)return;const{form:{setting:t,printerType:l}}=i;if(n)return p.current.push([S(),w(),...c.current]);const a=t.fixedLogo?b-Af.logoHeight:b;let o=[];if(p.current=[],"stylus"===l)p.current.push([S(),...t.fixedLogo?[w()]:[],...c.current]);else{let e=0;for(let l=0,n=f.current.length;l<n;l++){const r=c.current[l],i=f.current[l];t.fixedLogo||0!==l||(e+=Af.logoHeight),e+=i,e<=a?o.push(r):(p.current.push([S(),...t.fixedLogo?[w()]:[],...o]),o=[],e=0,l-=1),l===n-1&&o.length&&p.current.push([S(),...t.fixedLogo?[w()]:[],...o])}}t.fixedLogo||null===(e=p.current[0])||void 0===e||e.splice(1,0,w());for(let e=0,t=p.current.length;e<t&&e!==t-1;e++)p.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');r.setState({currentPage:1,totalPage:p.current.length}),O()},O=()=>{var e,t;const{currentPage:l}=i;let n=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;n+=null!==(t=null===(e=p.current[l-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",n+="</table>",u.current.previewEl.innerHTML=n,u.current.previewEl.parentNode.scrollTop=0},R=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...p.current[e-1]].join("")}else for(let e=0;e<p.current.length;e++)t+=p.current[e].join("");return t+="</table>",t},k=()=>{const e=[];for(let t=0;t<c.current.length;t++)e[t]=c.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+w()+S()+e.join("")+"</table>"},L=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();u.current.previewEl.innerHTML||(N(),yield at(0),T(),I(),h(!1))})),P=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();N(),yield at(0),T(),I(),h(!1),r.doPrint(R()),yield at(0),r.doClose()})),A=()=>{mt("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D={[yt("print-container")]:!0,"no-visible":n};return q.default.createElement("div",{ref:d,className:J.default(D)},q.default.createElement(gn,{wrapperClassName:"spin",spinning:m,tip:"Loading..."},q.default.createElement("div",{className:"preview"},q.default.createElement("div",{className:"origin-template",style:{width:`${y}px`,marginLeft:`-${Math.floor(y/2)}px`}},null==l?void 0:l()),q.default.createElement("div",{className:"workspace",style:C}))))}));$f.displayName="Container";class qf extends e.Component{constructor(){super(...arguments),this.formRef=q.default.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Se("qm.print.setPanel.printParameter")},{type:"SELECT",label:Se("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:Se("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Se("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Se("qm.print.setPanel.vertical"),value:"vertical"},{text:Se("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Se("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Se("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:Se("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Se("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("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:Se("qm.print.setPanel.sizeUnit"),disright:Se("qm.print.setPanel.sizeUnit"),distop:Se("qm.print.setPanel.sizeUnit"),disbottom:Se("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Ye(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 q.default.createElement(q.default.Fragment,null,q.default.createElement(wf,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Se("qm.dialog.close")),q.default.createElement(ht,{type:"primary",onClick:()=>this.confirmHandle()},Se("qm.dialog.confirm"))))}}qf.contextType=xe;class jf extends e.Component{constructor(){var e,t,l;super(...arguments),this.provide={$$preview:this},this.containRef=q.default.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(t=this.props.defaultConfig)||void 0===t?void 0:t.copies)||1,scale:1,setting:{distance:{left:Af.defaultDistance,right:Af.defaultDistance,top:Af.defaultDistance,bottom:Af.defaultDistance},pageSize:"210*297",direction:(null===(l=this.props.defaultConfig)||void 0===l?void 0:l.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=()=>Ye(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 fe.default.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=>Ye(this,void 0,void 0,(function*(){const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=yield l({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Ye(this,void 0,void 0,(function*(){const l=this.context.global,n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[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=Hf();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a,printerName:r,printerType:i,copies:o}}=this.state,{pageSize:d}=this,{defaultDistance:u}=Af,{left:c,right:f,top:p,bottom:m}=a.distance;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(r),t.SET_PRINT_COPIES(o),a.doubleSide&&("auto"===a.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"===i&&("vertical"===a.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===a.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*d[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(p-u)+"mm",10*(c-u)+"mm",`RightMargin: ${10*(f-u)}mm`,`BottomMargin: ${"stylus"!==i?10*(m-u):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?n&&this.doClose():s.message.error(Se("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=Hf();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a}}=this.state;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?n&&this.doClose():s.message.error(Se("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===a.direction?1:2),t.SAVE_TO_FILE(`${j.default().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Se("qm.print.laserPrinter"),value:"laser"},{text:Se("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Hf(),t=[{text:Se("qm.print.defaultPrinter"),value:-1}];try{const l=e.GET_PRINTER_COUNT();for(let n=0;n<l;n++)t.push({text:e.GET_PRINTER_NAME(n),value:n})}catch(e){mt("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 Ye(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let l=yield fe.default.getItem(this.printerKey);l||(l=yield this.getPrintConfig(this.printerKey),m.isPlainObject(l)&&(yield fe.default.setItem(this.printerKey,l))),m.isPlainObject(l)&&Object.keys(l).length&&m.merge(this.state.form,Object.assign(Object.assign({},l),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===l.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:t}=this.props,{visible:l,form:n,currentPage:a,totalPage:r,printPage:i}=this.state,o=yt("print-preview"),d={visible:l,title:Se("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},u={[o]:!0};return e?q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:J.default(u)},q.default.createElement("div",{className:"outer"},q.default.createElement("div",{className:"header"},q.default.createElement("span",null,Se("qm.print.printer"),":",q.default.createElement(s.Select,{value:n.printerName,onChange:e=>{this.setState((t=>m.merge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.type"),":",q.default.createElement(s.Select,{value:n.printerType,onChange:e=>{this.setState((t=>m.merge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.copies"),":",q.default.createElement(s.InputNumber,{value:n.copies,min:1,precision:0,onChange:e=>{this.setState((t=>m.merge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),q.default.createElement("span",null,Se("qm.print.printPage.0"),q.default.createElement(s.InputNumber,{value:i,min:1,max:r,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),Se("qm.print.printPage.1")),q.default.createElement("span",null,q.default.createElement(s.Pagination,{size:"small",current:a,pageSize:1,total:r,onChange:this.pageChangeHandle})),q.default.createElement("span",null,q.default.createElement(ht,{type:"text",icon:q.default.createElement(g.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Se("qm.print.setting"))),q.default.createElement("span",null,q.default.createElement(ht,{type:"text",icon:q.default.createElement(g.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Se("qm.print.export"))),q.default.createElement("span",null,q.default.createElement(ht,{icon:q.default.createElement(g.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},Se("qm.print.print")))),q.default.createElement("div",{className:"main"},q.default.createElement(Df.Provider,{value:this.provide},q.default.createElement($f,{ref:this.containRef,templateRender:t,directPrint:!1}))),q.default.createElement("div",{className:"footer"},q.default.createElement("span",null,Se("qm.print.scale"),":",q.default.createElement(s.Slider,{value:n.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>m.merge({},t,{form:{scale:e}})))}}),q.default.createElement("em",{className:"scale-text"},`${Math.floor(100*n.scale)}%`)),q.default.createElement("span",null,Se("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),q.default.createElement("span",null,Se("qm.print.pageNumber"),":",Se("qm.print.pagination",{currentPage:a,totalPage:r}))))),q.default.createElement(Qn,d,q.default.createElement(qf,{setting:n.setting,onChange:e=>{this.setState((t=>m.merge({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):q.default.createElement(Df.Provider,{value:this.provide},q.default.createElement($f,{ref:this.containRef,templateRender:t,directPrint:!0}))}}jf.contextType=xe;class Kf extends e.Component{constructor(){super(...arguments),this.previewRef=q.default.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Ye(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const l=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof l&&!l)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r}=this.props,i={visible:e,title:Se("qm.print.preview"),width:`${Af.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},o={ref:this.previewRef,templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r,onClose:()=>{this.setState({visible:!1})}};return a?q.default.createElement(Qn,i,q.default.createElement(jf,o)):e?q.default.createElement(jf,o):null},this.DO_PRINT=()=>Ye(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield at(0),this.setState({visible:!0}),yield at(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:t,icon:l,type:n,disabled:a,shape:r}=this.props,i={size:t||this.context.size||"",type:n,shape:r,icon:l,loading:e,disabled:a,click:this.clickHandle};return q.default.createElement(q.default.Fragment,null,this.props.children&&q.default.createElement(ht,i,this.props.children),this.createRender())}}function Vf(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function zf(e){const t=Vf(e);return t?t.frameElement:null}function Wf(e){const t=Gf(e);return Bf([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Bf(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 Uf(e,t){const l=zf(e);if(l&&l!==t){const n=[e.getBoundingClientRect()];let a=l,r=!1;for(;a;){const e=Wf(a);if(n.push(e),a=zf(a),r)break;a&&Vf(a)===t&&(r=!0)}return Bf(n)}return e.getBoundingClientRect()}function Gf(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)}}Kf.propTypes={size:(e,t,l)=>{if(!Qa(e[t]||""))return pt("Print","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},templateRender:se.default.elementType},Kf.defaultProps={preview:!0,type:"primary",icon:q.default.createElement(g.PrinterOutlined,null)},Kf.contextType=xe;const Yf=Object.assign;class Xf{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=ep.border,this.padding.style.borderColor=ep.padding,this.content.style.backgroundColor=ep.background,Yf(this.node.style,{borderColor:ep.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){Jf(t,"margin",this.node),Jf(t,"border",this.border),Jf(t,"padding",this.padding),Yf(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"}),Yf(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Qf{constructor(e,t){this.tip=e.createElement("div"),Yf(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),Yf(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),Yf(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,l){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(l)+"px"}updatePosition(e,t){const l=this.tip.getBoundingClientRect(),n=function(e,t,l){const n=Math.max(l.height,20),a=Math.max(l.width,60),r=5;let i;i=e.top+e.height+n<=t.top+t.height?e.top+e.height<t.top+0?t.top+r:e.top+e.height+r:e.top-n<=t.top+t.height?e.top-n-r<t.top+r?t.top+r:e.top-n-r:t.top+t.height-n-r;let o=e.left+r;e.left<t.left&&(o=t.left+r);e.left+a>t.left+t.width&&(o=t.left+t.width-a-r);return i+="px",o+="px",{style:{top:i,left:o}}}(e,t,{width:l.width,height:l.height});Yf(this.tip.style,n.style)}}class Zf{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const l=e.document;this.container=l.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Qf(l,this.container),this.rects=[],l.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 l=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>l.length;){const e=this.rects.pop();null==e||e.remove()}if(0===l.length)return;for(;this.rects.length<l.length;)this.rects.push(new Xf(this.window.document,this.container));const n={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};l.forEach(((e,t)=>{const l=Uf(e,this.window),a=Gf(e);n.top=Math.min(n.top,l.top-a.marginTop),n.right=Math.max(n.right,l.left+l.width+a.marginRight),n.bottom=Math.max(n.bottom,l.top+l.height+a.marginBottom),n.left=Math.min(n.left,l.left-a.marginLeft);this.rects[t].update(l,a)})),t||(t=l[0].nodeName.toLowerCase(),l[0]),this.tip.updateText(t,n.right-n.left,n.bottom-n.top);const a=Uf(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:n.top,left:n.left,height:n.bottom-n.top,width:n.right-n.left},{top:a.top+this.tipBoundsWindow.scrollY,left:a.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Jf(e,t,l){Yf(l.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const ep={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 tp=null,lp=null;function np(){null!=window.document&&(tp=null,null!==lp&&(lp.remove(),lp=null))}class ap{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=>sn(t,window.document.querySelector(e)))))return this._selectIgnore=!0,np();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 l,n,a;l=[t],n=null,a=!1,null!=window.document?(null!==tp&&clearTimeout(tp),null!=l&&(null===lp&&(lp=new Zf),lp.inspect(l,n),a&&(tp=setTimeout((()=>np()),2e3)))):null!=l&&null!=l[0]&&console.error("showNativeHighlight",l[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=m.throttle((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 l=e;const n=[];for(;l!==t&&null!==l;){let e=l.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,n=Array.from(l.classList).reverse();e<n.length;e++)t.test(n[e])&&l.classList.remove(n[e]);if(l.id&&/^rc-\w+/.test(l.id)&&l.removeAttribute("id"),l.id)e+=`#${l.id}`;else{const t=Array.from(l.parentElement.children).filter((e=>e.tagName===l.tagName)),n=l.className.trim();if(t.filter((e=>e.className.includes(n))).length<=1){if(n){const t=n.split(/\s+/);let l="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(l+=`.${t[e]}`);e+=l}}else l.getAttribute("name")?e+=`[name=${l.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(l)+1})`}l.nodeType!==Node.TEXT_NODE&&n.unshift(e),l=l.parentElement}return n.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(){np(),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 rp(e){return document.querySelector(e)}const ip=e=>{const{action:t,onConfirm:l,onCancel:n,onFinish:a}=e,{t:r}=Xe();return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{style:{height:100}},r("qm.table.config.emptyText")),q.default.createElement(vt,{style:{width:"100%",justifyContent:"flex-end"}},q.default.createElement(ht,{size:"small",onClick:()=>null==n?void 0:n()},r("qm.guideTracker.closeButton")),q.default.createElement(ht,{size:"small",onClick:()=>null==l?void 0:l()},r("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),q.default.createElement(ht,{size:"small",onClick:()=>null==a?void 0:a()},r("qm.guideTracker.finishButton"))))},op={left:"50%",top:"50%",width:1,height:1},sp=q.default.forwardRef(((e,t)=>{const{open:l,current:n,defaultCurrent:a,steps:r=[],placement:i="bottom",control:o=!0,overlayClassName:d,overlayStyle:u,destroyOnHide:c,contentRender:f,zIndex:p,helper:h={},selectFilter:v=(e=>e),onSelect:y,onChange:b,onClose:x,onFinish:E}=e,{t:C}=Xe(),w=q.default.useRef(),S=q.default.useRef(r.length),[N,I]=hi(0,{value:n,defaultValue:a}),[O,R]=hi(void 0,{value:l,postState:e=>null!=e&&e}),[k,L]=hi(1051,{value:p,defaultValue:p}),[P,A]=q.default.useState({}),[D,_]=q.default.useState(!1),[F,H]=q.default.useState(O),[M,$]=q.default.useState(!1),[j,K]=Nf(P.node,!!l),[V,z]=q.default.useState(22),W=q.default.useRef(!1),B=q.default.useMemo((()=>N>=r.length?"add":"edit"),[N,r]),U=q.default.useMemo((()=>`${N+1} / ${r.length}`),[N,r]);q.default.useLayoutEffect((()=>{w.current=new ap({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=v(t),A({id:Ma(),node:e,path:t}),I(S.current),_(!0),Y(),null==y||y(t,e)}})}),[]),q.default.useEffect((()=>(O?G():Y(),O?setTimeout((()=>H(!0)),16):H(!1),()=>{Y()})),[O]),q.default.useEffect((()=>{S.current=r.length}),[r]);const G=()=>{w.current.startHandle()},Y=()=>{w.current.stopHandle()},X=e=>{e.stopPropagation(),e.preventDefault()};q.default.useImperativeHandle(t,(()=>({OPEN:()=>R(!0),CLOSE:()=>R(!1),GET_CURRENT_STEP:()=>({current:N,selector:P.path})})));const Q=yt("guide-tracker"),Z=[{[`${Q}-primary`]:!0}],ee=rd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(he.default,{open:O&&D,autoLock:!0},q.default.createElement(pe.default,{zIndex:k,builtinPlacements:ee,popupPlacement:i,popupVisible:O&&D,popupClassName:J.default(Z,d),popupStyle:u,prefixCls:Q,popup:()=>{const e=()=>{_(!1),G()};return q.default.createElement("div",{className:`${Q}-content`},q.default.createElement("div",{className:`${Q}-inner`},q.default.createElement(g.CloseOutlined,{className:`${Q}-close`,onClick:()=>{null==x||x(N),e()}}),q.default.createElement(s.Dropdown,{open:M,trigger:["click"],dropdownRender:()=>r.length?q.default.createElement("div",{className:"ant-dropdown-menu step-list"},q.default.createElement(T.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.id)),l=r.map((e=>e.id));if(m.isEqual(t,l))return;const n=t.findIndex((e=>e===P.id)),a=-1!==n?n:N;I(a),null==b||b(Ya(e),a)}},r.map(((e,t)=>q.default.createElement("li",{key:t,className:J.default("item",{actived:e.id===P.id})},q.default.createElement(g.HolderOutlined,{className:"handle",title:C("qm.form.draggable")}),q.default.createElement("span",{className:"box"},q.default.createElement("span",{className:"title",title:e.title,onClick:()=>{t!==N&&(A({id:e.id,node:rp(e.selector),path:e.selector}),I(t),z(22===V?V+1:V-1),null==b||b(r,t))}},e.title),q.default.createElement(s.Popconfirm,{title:C("qm.button.confirmTitle"),zIndex:k+1,onConfirm:()=>{const l=r.filter((t=>t.id!==e.id)),n=t===N;let a=t<=N?N-1:N;if(a=a<0?0:a,a=a>l.length?l.length:a,n&&l[a]){const{id:e,selector:t}=l[a];A({id:e,node:rp(t),path:t})}I(a),null==b||b(l,a)}},q.default.createElement(g.CloseOutlined,{className:"close-icon"})))))))):q.default.createElement(q.default.Fragment,null),overlayClassName:`${Q}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:k},onOpenChange:e=>$(e)},q.default.createElement(g.MenuOutlined,{className:J.default(`${Q}-close`,"menu-icon"),style:{width:V}})),h.content&&q.default.createElement(s.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:k},content:h.content,title:h.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${Q}-close`,"help-icon")})),q.default.createElement("div",{className:"panel-label"},q.default.createElement("span",{className:"title"},C("qm.guideTracker.label")),q.default.createElement("span",{className:"step"},C("qm.guideTracker.currentStep"),U)),f?f({id:P.id,selector:P.path,actionStatus:B,DO_CLOSE:e},N):q.default.createElement(ip,{action:B,onConfirm:()=>{null==b||b("add"===B?[...r,{id:P.id,selector:P.path,title:"Guide Title"}]:[...r],N),e()},onCancel:()=>{null==x||x(N),e()},onFinish:()=>{e(),null==x||x(N),null==E||E()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:c},q.default.createElement("div",{className:J.default(`${Q}-target-placeholder`),style:Object.assign(Object.assign({},j||op),{position:"fixed",zIndex:k-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:X,onClick:X}))),o&&q.default.createElement(he.default,{open:F},q.default.createElement(Of,{zIndex:k,prefixCls:Q,onPause:()=>{W.current=D,_(!1),Y()},onPlay:()=>{W.current?_(!0):G()}})))}));sp.displayName="QmGuideTracker";const dp=e=>{var t,l,n,a,r,i,o,s;const{content:d,image:u,width:c,height:f,font:p={},gap:m=[100,100],offset:h=[50,50],rotate:g=-22,zIndex:v=9,alpha:y=1,antiTamper:b=!0,grayscale:x,className:E,style:C}=e,w=q.default.useRef(null),S=q.default.useRef(new Map),N=null!==(t=p.fontSize)&&void 0!==t?t:16,T=null!==(l=p.fontWeight)&&void 0!==l?l:"normal",I=null!==(n=p.fontStyle)&&void 0!==n?n:"normal",O=null!==(a=p.fontFamily)&&void 0!==a?a:"sans-serif",R=null!==(r=p.color)&&void 0!==r?r:"rgba(0, 0, 0, 0.15)",k=null!==(i=p.textAlign)&&void 0!==i?i:"center",L=Array.isArray(d)?d:[d],P=m[0],A=m[1],D=P/2,_=A/2,F=null!==(o=h[0])&&void 0!==o?o:D,H=null!==(s=h[1])&&void 0!==s?s:_,M=q.default.useMemo((()=>{const e=F-D,t=H-_;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:v}}),[D,_,F,H,v]),j=(e,t)=>{var l;if(w.current){const n=S.current.get(w.current);n&&(w.current.contains(n)&&w.current.removeChild(n),S.current.delete(w.current));const a=document.createElement("div");a.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${l=e,l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var l})).join(";"))(Object.assign(Object.assign({},M),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(l=w.current)||void 0===l||l.append(a),S.current.set(w.current,a)}},K=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const l=(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),[n,a]=(e=>{let t=120,l=64;if(!u&&e.measureText){e.font=`${N}px ${O}`;const n=L.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...n)),l=N*L.length+3*(L.length-1)}return[null!=c?c:t,null!=f?f:l]})(t),r=n*l,i=a*l,o=(P+n)*l,s=(A+a)*l,d=P/2*l,p=A/2*l,m=o/2,h=s/2,v=2*(P+n);e.width=2*o,e.height=2*s,t.globalAlpha=y,t.save(),t.translate(m,h),t.rotate(Math.PI/180*g),t.translate(-m,-h);const b=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),x&&(e=>{const t=e.getContext("2d");if(!t)return;const l=t.getImageData(0,0,e.width,e.height),{data:n}=l;for(let e=0;e<n.length;e+=4){const t=(n[e]+n[e+1]+n[e+2])/3;n[e]=t,n[e+1]=t,n[e+2]=t}t.putImageData(l,0,0)})(e),j(e.toDataURL(),v)},E=()=>{const e=Number(N)*l;t.font=`${I} normal ${T} ${e}px/${a}px ${O}`,t.fillStyle=R,t.textAlign=k,t.textBaseline="top",t.translate(r/2,0),L.forEach(((n,a)=>{t.fillText(null!=n?n:"",d,p+a*(e+3*l))})),b()};if(u){const e=new Image;e.onload=()=>{t.drawImage(e,d,p,r,i),b()},e.onerror=()=>{E()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=u}else E()},V=e=>Array.from(S.current.values()).includes(e);q.default.useEffect((()=>{K()}),[d,u,c,f,p,m,h,g,v,y,b,x]),function(e,t,l={}){const n=window&&"MutationObserver"in window,a=$.useRef(),r=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};$.useLayoutEffect((()=>(r(),n&&e.current&&(a.current=new MutationObserver(t),a.current.observe(e.current,l)),()=>r())),[e])}(w,(e=>{if(b)for(const t of e){const e=Array.from(t.removedNodes).some((e=>V(e))),l="attributes"===t.type&&V(t.target);if(e||l){K();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=yt("watermark");return q.default.createElement("div",{ref:w,className:J.default(z,E),style:Object.assign({position:"relative"},C)},e.children)},up=new Map,cp=new WeakMap;let fp,pp=0;function mp(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(l=e.root,l?(cp.has(l)||(pp+=1,cp.set(l,pp.toString())),cp.get(l)):"0"):e[t]}`;var l})).toString()}function hp(e,t,l={},n=fp){if(void 0===window.IntersectionObserver&&void 0!==n){const a=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof l.threshold?l.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:r,elements:i}=function(e){const t=mp(e);let l=up.get(t);if(!l){const n=new Map;let a=[];const r=new IntersectionObserver((t=>{t.forEach((t=>{var l;const r=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null===(l=n.get(t.target))||void 0===l||l.forEach((e=>{e(r,t)}))}))}),e);a=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),l={id:t,observer:r,elements:n},up.set(t,l)}return l}(l),o=i.get(e)||[];return i.has(e)||i.set(e,o),o.push(t),r.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(i.delete(e),r.unobserve(e)),0===i.size&&(r.disconnect(),up.delete(a))}}const gp=e=>{const{forceRender:t,height:l,placeholder:n=null,unmountIfInvisible:a,className:r,style:i}=e,{ref:o,inView:s,entry:d}=(({root:e,rootMargin:t,threshold:l,triggerOnce:n,fallbackInView:a,trackVisibility:r,skip:i,delay:o,onChange:s}={})=>{var d;const[u,c]=q.default.useState(null),[f,p]=q.default.useState({inView:!1,entry:void 0}),m=q.default.useRef(s);q.default.useEffect((()=>{if(i||!u)return;let s;return s=hp(u,((e,t)=>{var l;p({inView:e,entry:t}),null===(l=m.current)||void 0===l||l.call(m,e,t),t.isIntersecting&&n&&s&&(s(),s=void 0)}),{root:e,rootMargin:t,threshold:l,trackVisibility:r,delay:o},a),()=>{s&&s()}}),[Array.isArray(l)?l.toString():l,u,e,t,n,i,r,a,o]);const h=null===(d=f.entry)||void 0===d?void 0:d.target,g=q.default.useRef();u||!h||n||i||g.current===h||(g.current=h,p({inView:!1,entry:void 0}));const v=[c,f.inView,f.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v})(Object.assign({},e,{triggerOnce:!a}));q.default.useEffect((()=>{l||mt("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[yt("lazy-load")]:!0};return q.default.createElement("div",{ref:o,className:J.default(u,r),style:i},t||s?e.children:q.default.createElement("div",{className:"placeholder",style:{height:l}},n))};class vp{constructor(e,t,l,n){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=l||0,this.time=n||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 yp{static fromPoints(e,t){const l=this.calculateControlPoints(e[0],e[1],e[2]).c2,n=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new yp(e[1],l,n,e[2],t.start,t.end)}static calculateControlPoints(e,t,l){const n=e.x-t.x,a=e.y-t.y,r=t.x-l.x,i=t.y-l.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,d=(t.x+l.x)/2,u=(t.y+l.y)/2,c=Math.sqrt(n*n+a*a),f=Math.sqrt(r*r+i*i),p=f/(c+f),m=d+(o-d)*p,h=u+(s-u)*p,g=t.x-m,v=t.y-h;return{c1:new vp(o+g,s+v),c2:new vp(d+g,u+v)}}constructor(e,t,l,n,a,r){this.startPoint=e,this.control2=t,this.control1=l,this.endPoint=n,this.startWidth=a,this.endWidth=r}length(){let e,t,l=0;for(let n=0;n<=10;n+=1){const a=n/10,r=this.point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),i=this.point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){const n=r-e,a=i-t;l+=Math.sqrt(n*n+a*a)}e=r,t=i}return l}point(e,t,l,n,a){return t*(1-e)*(1-e)*(1-e)+3*l*(1-e)*(1-e)*e+3*n*(1-e)*e*e+a*e*e*e}}class bp{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,l;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===(l=e.touches[0])||void 0===l?void 0:l.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(),l=Object.assign(Object.assign({},t),{points:[]});this._data.push(l),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 l=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],a=n.points,r=a.length>0&&a[a.length-1],i=!!r&&l.distanceTo(r)<=this.minDistance,o=this._getPointGroupOptions(n);if(!r||!r||!i){const e=this._addPoint(l,o);t&&(r?e&&this._drawCurve(e,o):this._drawDot(l,o)),a.push({time:l.time,x:l.x,y:l.y,pressure:l.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 l=this.ctx,n=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;l.beginPath(),this._drawCurveSegment(e.x,e.y,n),l.closePath(),l.fillStyle=t.penColor,l.fill()},this._drawCurve=(e,t)=>{const l=this.ctx,n=e.endWidth-e.startWidth,a=2*Math.ceil(e.length());l.beginPath(),l.fillStyle=t.penColor;for(let l=0;l<a;l+=1){const r=l/a,i=r*r,o=i*r,s=1-r,d=s*s,u=d*s;let c=u*e.startPoint.x;c+=3*d*r*e.control1.x,c+=3*s*i*e.control2.x,c+=o*e.endPoint.x;let f=u*e.startPoint.y;f+=3*d*r*e.control1.y,f+=3*s*i*e.control2.y,f+=o*e.endPoint.y;const p=Math.min(e.startWidth+o*n,t.maxWidth);this._drawCurveSegment(c,f,p)}l.closePath(),l.fill()},this._drawCurveSegment=(e,t,l)=>{const n=this.ctx;n.moveTo(e,t),n.arc(e,t,l,0,2*Math.PI,!1)},this._createPoint=(e,t,l)=>{const n=this.canvas.getBoundingClientRect();return new vp(e-n.left,t-n.top,l,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:l}=this;if(l.push(e),l.length>2){3===l.length&&l.unshift(l[0]);const e=this._calculateCurveWidths(l[1],l[2],t),n=yp.fromPoints(l,e);return l.shift(),n}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,l)=>{const n=l.velocityFilterWeight*t.velocityFrom(e)+(1-l.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(n,l),r={end:a,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=a,r},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:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,l,n-t,a-l),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=Math.min(n,t),i=Math.min(a,l),o=.5*(Math.max(n,t)-r),s=.5*(Math.max(a,l)-i),d=r+o,u=i+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(d,u,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:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=180*Math.atan2(l-a,t-n)/Math.PI,i=(r+25)*Math.PI/180,o=(r-25)*Math.PI/180,s=15*Math.cos(i),d=15*Math.sin(i),u=15*Math.cos(o),c=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,l),this.ctx.lineTo(n,a),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n,a);const f=n+s,p=a+d;this.ctx.lineTo(f,p);const m=n+u,h=a+c;this.ctx.lineTo(m,h),this.ctx.lineTo(n,a),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,l)=>{const n=e.width,a=e.data,r=[];return r[0]=a[4*(l*n+t)],r[1]=a[4*(l*n+t)+1],r[2]=a[4*(l*n+t)+2],r[3]=a[4*(l*n+t)+3],r},this.setAxisColor=(e,t,l,n)=>{const a=e.width,r=e.data;r[4*(l*a+t)]=n[0],r[4*(l*a+t)+1]=n[1],r[4*(l*a+t)+2]=n[2],r[4*(l*a+t)+3]=n[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),n=this.ctx.getImageData(t*this.ratio,l*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),a=n.width,r=n.height,i=a/this.degreeOfBlur,o=r/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const l=this.getAxisColor(n,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let a=0;a<this.degreeOfBlur;a++)for(let r=0;r<this.degreeOfBlur;r++)this.setAxisColor(n,t*this.degreeOfBlur+r,e*this.degreeOfBlur+a,l)}this.ctx.putImageData(n,t*this.ratio,l*this.ratio)},this.drawText=e=>{const{x:t,y:l}=this.textInputPos;if(0===t&&0===l)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const n=this.fontSize*this.lineHeight,a=this.width-t,r=e.target.innerText,i=[];let o="";for(let e=0;e<r.length;e++){const t=o+r[e];this.ctx.measureText(t).width>a&&o.length>0?(i.push(o),o=r[e]):o=t}i.push(o),i.forEach(((e,a)=>{this.ctx.fillText(e,t+1,l+a*n+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawPencil=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,l),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawEraser=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,l),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:l}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=l?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 l=document.createElement("canvas");l.width=this.width,l.height=this.height;return l.getContext("2d").drawImage(this.canvas,0,0,l.width,l.height),l.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 l,n,a,r=0,i=null;const o=()=>{r=Date.now(),i=null,l=e.apply(n,a),i||(n=null,a=[])};return function(...s){const d=Date.now(),u=t-(d-r);return n=this,a=s,u<=0||u>t?(i&&(clearTimeout(i),i=null),r=d,l=e.apply(n,a),i||(n=null,a=[])):i||(i=window.setTimeout(o,u)),l}}(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)}}bp.dataURLToBlob=e=>{const t=e.split(";base64,"),l=t[0].split(":")[1],n=window.atob(t[1]),a=n.length,r=new Uint8Array(a);for(let e=0;e<a;++e)r[e]=n.charCodeAt(e);return new Blob([r],{type:l})},bp.canvasToDataURL=e=>e.toDataURL("image/png",1),bp.canvasToBlob=e=>new Promise(((t,l)=>{e.toBlob((e=>e?t(e):l(null)),"image/png",1)}));const xp=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Ep=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Cp=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),wp=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Sp=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Np=q.default.forwardRef(((e,t)=>{const{open:l,width:n,height:a,imageName:r,penColor:i,penMode:o,minWidth:d,maxWidth:u,backgroundColor:c,className:f,style:p,onOk:m,onCancel:h}=e,{t:v}=Xe(),y=q.default.useRef(),b=q.default.useRef(null),x=q.default.useRef(null),E=q.default.useRef(null),C=[2,4,6],w=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[N,T]=hi(void 0,{value:l,postState:e=>null!=e&&e}),I=q.default.useMemo((()=>!!e.children),[e.children]),[O,R]=q.default.useState(o||(I?"square":"line")),[k,L]=q.default.useState(C[0]),[P,A]=q.default.useState(I?S[0]:S[4]),[D,_]=q.default.useState(w[1]),[F,H]=q.default.useState("bottomLeft"),[M,$]=q.default.useState(!1),[K,V]=q.default.useState(!1);q.default.useEffect((()=>{var e,t;const l={width:null!=n?n:null===(e=x.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=x.current)||void 0===t?void 0:t.offsetHeight,maxWidth:k,mode:O,penColor:P,fontSize:D,backgroundColor:c,openSmooth:!I};return l.openSmooth&&Object.assign(l,{penColor:i,minWidth:d,maxWidth:u}),y.current=new bp(b.current,l),()=>y.current.destroy()}),[]);const z=e=>{var t,l;const[r,i]=[null!=n?n:null===(t=x.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(l=x.current)||void 0===l?void 0:l.offsetHeight],{width:o,height:s}=y.current;let d=!1;r&&r!==o&&(y.current.width=r,d=!0),i&&i!==s&&(y.current.height=i,d=!0),(d||e)&&y.current.update()};Ql((()=>{I&&N&&z()}),[N,I]),Ql((()=>{y.current.setDrawMode(O)}),[O]),Ql((()=>{y.current.setLineWidth(k)}),[k]),Ql((()=>{y.current.setPenColor(P)}),[P]),Ql((()=>{y.current.setFontSize(D)}),[D]);const W=()=>Ye(void 0,void 0,void 0,(function*(){const e=I?x.current.parentNode:b.current;if(e)try{const t=yield be.default(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return bp.canvasToDataURL(t)}catch(e){mt("Signature","生成合成图片失败!")}})),B=()=>{y.current.clear(),null==h||h()};q.default.useImperativeHandle(t,(()=>({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&&H((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},G=e=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","content")},"text"!==e?q.default.createElement("div",{className:"lineWidth"},C.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",`s${e}`,{active:e===k}),onClick:()=>L(e)})))):q.default.createElement("div",{className:"fontSize"},q.default.createElement(s.Select,{size:"small",value:D,options:w.map((e=>({value:e,label:e.toString()}))),onChange:e=>_(e)})),q.default.createElement("span",{className:"divider"}),q.default.createElement("div",{className:"penColor"},S.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",{active:e===P}),style:{backgroundColor:e},onClick:()=>A(e)},q.default.createElement(g.CheckOutlined,{className:"icon"})))))),Y=yt("signature"),X={[Y]:!0,"is-annotation":I},Q=n?Object.assign(Object.assign({},p),{width:n}):p;return q.default.createElement("div",{className:J.default(X,f),style:Q},I&&q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{ref:x,className:"content"},e.children),K&&q.default.createElement(gn,{spinning:!0,className:"spinning"})),q.default.createElement("div",{className:J.default("signature",{show:N})},q.default.createElement("canvas",{ref:b,className:O}),I&&q.default.createElement("div",{ref:E,className:"signature__tool-bar"},q.default.createElement("div",{className:"wrapper"},q.default.createElement("div",{className:J.default("actions",{hidden:M})},q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("square")},q.default.createElement(g.BorderOutlined,null))),q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("round")},q.default.createElement(xp,null))),q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("arrow")},q.default.createElement(Cp,null))),q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("line")},q.default.createElement(g.EditOutlined,null))),q.default.createElement(s.Dropdown,{dropdownRender:()=>G("text"),overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("text")},q.default.createElement(Ep,null))),q.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){yield Ye(void 0,void 0,void 0,(function*(){V(!0);const e=yield W();if(e){const t=r?r.slice(0,r.lastIndexOf(".")>0?r.lastIndexOf("."):void 0):j.default().format(ai);Fn(bp.dataURLToBlob(e),`${t}.png`)}V(!1)})),B()}))},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>R("eraser")},q.default.createElement(wp,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.undo()},q.default.createElement(Sp,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.clear()},q.default.createElement(g.ClearOutlined,null)),q.default.createElement("span",{className:"divider"}),q.default.createElement("button",{className:"btn",onClick:()=>null==h?void 0:h()},q.default.createElement(g.CloseOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){V(!0),yield at(10);const e=yield W();V(!1),B(),null==m||m(e)}))},q.default.createElement(g.CheckOutlined,null))),q.default.createElement("button",{className:"btn btn-fold",title:v(M?"qm.divider.spread":"qm.divider.collect"),onClick:()=>$(!M)},M?q.default.createElement(g.LeftOutlined,null):q.default.createElement(g.RightOutlined,null))))))}));Np.displayName="QmSignature";const Tp=q.default.forwardRef(((e,t)=>{const{dataIndex:l,className:n,style:a}=e;return q.default.createElement("li",{ref:t,"data-index":l,className:J.default("list-item",n),style:a},e.children)}));Tp.displayName="ListItem";const Ip=q.default.forwardRef(((e,t)=>{var l,n;const{dataSource:a=[],height:r,maxHeight:i,itemHeight:o,renderItem:s,onScroll:d,className:u}=e,c=q.default.useRef(null),f=Rd({count:a.length,getScrollElement:()=>{var e,t;return null!==(t=null===(e=c.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null},estimateSize:()=>o||40,overscan:3,onChange:(e,t)=>null==d?void 0:d(e,t)}),p=f.getVirtualItems();q.default.useImperativeHandle(t,(()=>({SCROLL_TO_INDEX:e=>f.scrollToIndex(e),SCROLL_TO_OFFSET:e=>f.scrollToOffset(e)})));const m=yt("virtual-list");return q.default.createElement(_n,{ref:c,className:J.default(m,u),style:Object.assign(Object.assign({},e.style),{height:r,maxHeight:i})},q.default.createElement("div",{className:"container",style:{height:f.getTotalSize()}},q.default.createElement("ul",{style:{transform:`translateY(${null!==(n=null===(l=p[0])||void 0===l?void 0:l.start)&&void 0!==n?n:0}px)`}},p.map((e=>q.default.createElement(Tp,{ref:f.measureElement,key:e.index,dataIndex:e.index,style:{height:o}},null==s?void 0:s(a[e.index],e.index)))))))}));Ip.displayName="VirtualList";const Op="1.11.23";Object.defineProperty(exports,"Affix",{enumerable:!0,get:function(){return s.Affix}}),Object.defineProperty(exports,"Alert",{enumerable:!0,get:function(){return s.Alert}}),Object.defineProperty(exports,"Anchor",{enumerable:!0,get:function(){return s.Anchor}}),Object.defineProperty(exports,"AutoComplete",{enumerable:!0,get:function(){return s.AutoComplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return s.Avatar}}),Object.defineProperty(exports,"BackTop",{enumerable:!0,get:function(){return s.BackTop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return s.Badge}}),Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:function(){return s.Breadcrumb}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return s.Button}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return s.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return s.Carousel}}),Object.defineProperty(exports,"Cascader",{enumerable:!0,get:function(){return s.Cascader}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return s.Checkbox}}),Object.defineProperty(exports,"Col",{enumerable:!0,get:function(){return s.Col}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return s.Collapse}}),Object.defineProperty(exports,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(exports,"ConfigProvider",{enumerable:!0,get:function(){return s.ConfigProvider}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return s.Descriptions}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return s.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return s.Drawer}}),Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return s.Dropdown}}),Object.defineProperty(exports,"Empty",{enumerable:!0,get:function(){return s.Empty}}),Object.defineProperty(exports,"Form",{enumerable:!0,get:function(){return s.Form}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return s.Grid}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return s.Image}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return s.Input}}),Object.defineProperty(exports,"InputNumber",{enumerable:!0,get:function(){return s.InputNumber}}),Object.defineProperty(exports,"Layout",{enumerable:!0,get:function(){return s.Layout}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return s.List}}),Object.defineProperty(exports,"Mentions",{enumerable:!0,get:function(){return s.Mentions}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return s.Menu}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return s.Modal}}),Object.defineProperty(exports,"PageHeader",{enumerable:!0,get:function(){return s.PageHeader}}),Object.defineProperty(exports,"Pagination",{enumerable:!0,get:function(){return s.Pagination}}),Object.defineProperty(exports,"Popconfirm",{enumerable:!0,get:function(){return s.Popconfirm}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return s.Popover}}),Object.defineProperty(exports,"Progress",{enumerable:!0,get:function(){return s.Progress}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return s.Radio}}),Object.defineProperty(exports,"Rate",{enumerable:!0,get:function(){return s.Rate}}),Object.defineProperty(exports,"Result",{enumerable:!0,get:function(){return s.Result}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return s.Row}}),Object.defineProperty(exports,"Segmented",{enumerable:!0,get:function(){return s.Segmented}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return s.Select}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return s.Skeleton}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return s.Slider}}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return s.Space}}),Object.defineProperty(exports,"Spin",{enumerable:!0,get:function(){return s.Spin}}),Object.defineProperty(exports,"Statistic",{enumerable:!0,get:function(){return s.Statistic}}),Object.defineProperty(exports,"Steps",{enumerable:!0,get:function(){return s.Steps}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return s.Switch}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return s.Table}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return s.Tabs}}),Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return s.Tag}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return s.Timeline}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return s.Tooltip}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return s.Transfer}}),Object.defineProperty(exports,"Tree",{enumerable:!0,get:function(){return s.Tree}}),Object.defineProperty(exports,"TreeSelect",{enumerable:!0,get:function(){return s.TreeSelect}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return s.Typography}}),Object.defineProperty(exports,"Upload",{enumerable:!0,get:function(){return s.Upload}}),Object.defineProperty(exports,"message",{enumerable:!0,get:function(){return s.message}}),Object.defineProperty(exports,"notification",{enumerable:!0,get:function(){return s.notification}}),exports.Calendar=$e,exports.DatePicker=qe,exports.DcpAnchor=Wn,exports.DcpButton=ht,exports.DcpCollapse=Yl,exports.DcpColorPicker=id,exports.DcpConfigProvider=Be,exports.DcpCopyToClipboard=Pu,exports.DcpCountup=mn,exports.DcpCropper=Zc,exports.DcpDivider=bt,exports.DcpDownload=jn,exports.DcpDrawer=Gn,exports.DcpEmpty=hn,exports.DcpForm=wf,exports.DcpGuideTracker=sp,exports.DcpLazyLoad=gp,exports.DcpModal=Qn,exports.DcpPivotGrid=zd,exports.DcpPrint=Kf,exports.DcpRangeTableHelper=oc,exports.DcpScrollbar=_n,exports.DcpSearchHelper=Vu,exports.DcpSearchTree=su,exports.DcpSignature=Np,exports.DcpSpace=vt,exports.DcpSpin=gn,exports.DcpSplit=pn,exports.DcpTable=Ku,exports.DcpTabs=Un,exports.DcpTinymce=xf,exports.DcpTour=Pf,exports.DcpTransition=kn,exports.DcpTreeHelper=Ru,exports.DcpTreeTableHelper=Ju,exports.DcpUploadFile=qn,exports.DcpUploadImg=ef,exports.DcpVirtualList=Ip,exports.DcpWatermark=dp,exports.QmAnchor=Wn,exports.QmButton=ht,exports.QmCollapse=Yl,exports.QmColorPicker=id,exports.QmConfigProvider=Be,exports.QmCopyToClipboard=Pu,exports.QmCountup=mn,exports.QmCropper=Zc,exports.QmDivider=bt,exports.QmDownload=jn,exports.QmDrawer=Gn,exports.QmEmpty=hn,exports.QmForm=wf,exports.QmGuideTracker=sp,exports.QmLazyLoad=gp,exports.QmModal=Qn,exports.QmPivotGrid=zd,exports.QmPrint=Kf,exports.QmRangeTableHelper=oc,exports.QmScrollbar=_n,exports.QmSearchHelper=Vu,exports.QmSearchTree=su,exports.QmSignature=Np,exports.QmSpace=vt,exports.QmSpin=gn,exports.QmSplit=pn,exports.QmTable=Ku,exports.QmTabs=Un,exports.QmTinymce=xf,exports.QmTour=Pf,exports.QmTransition=kn,exports.QmTreeHelper=Ru,exports.QmTreeTableHelper=Ju,exports.QmUploadFile=qn,exports.QmUploadImg=ef,exports.QmVirtualList=Ip,exports.QmWatermark=dp,exports.TimePicker=Ke,exports.pinyin=Pr,exports.version=Op;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("dayjs");require("dayjs/locale/zh-cn");var l=require("dayjs/plugin/localeData"),n=require("dayjs/plugin/advancedFormat"),a=require("dayjs/plugin/customParseFormat"),r=require("dayjs/plugin/quarterOfYear"),i=require("dayjs/plugin/weekOfYear"),o=require("dayjs/plugin/weekday"),s=require("antd"),d=require("dayjs/plugin/weekYear"),u=require("antd/es/calendar/generateCalendar"),c=require("antd/es/date-picker/generatePicker"),f=require("antd/es/locale/zh_CN"),p=require("antd/es/locale/en_GB"),m=require("lodash-es"),h=require("classnames"),g=require("@ant-design/icons"),v=require("react-dom"),y=require("react-countup"),b=require("resize-observer-polyfill"),x=require("sortablejs"),E=require("add-dom-event-listener"),C=require("scroll-into-view-if-needed"),w=require("react-draggable"),S=require("memoize-one"),N=require("prop-types"),T=require("react-sortablejs"),I=require("big.js"),O=require("exceljs"),R=require("localforage"),k=require("@rc-component/trigger"),L=require("@rc-component/color-picker"),P=require("@rc-component/portal"),A=require("copy-to-clipboard"),D=require("china-area-data"),_=require("cropperjs"),F=require("html2canvas");function H(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function M(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(l){if("default"!==l){var n=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,n.get?n:{enumerable:!0,get:function(){return e[l]}})}})),t.default=e,Object.freeze(t)}var $=M(e),q=H(e),j=H(t),K=H(l),V=H(n),z=H(a),W=H(r),B=H(i),U=H(o),G=H(d),Y=H(u),X=H(c),Q=H(f),Z=H(p),J=H(h),ee=H(v),te=H(y),le=H(b),ne=H(x),ae=H(E),re=H(C),ie=H(w),oe=H(S),se=H(N),de=M(N),ue=H(I),ce=H(O),fe=H(R),pe=H(k),me=H(L),he=H(P),ge=H(A),ve=H(D),ye=H(_),be=H(F);const xe=e.createContext({locale:"zh-cn",size:"middle"});var Ee={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 Ce=Ee;function we(e,t){return e&&t?e.replace(/\{(\w+)\}/g,((e,l)=>t[l])):e}const Se=(...e)=>{const[t,l]=e;let n;const a=t.split(".");let r=Ce;for(let e=0,t=a.length;e<t;e++){if(n=r[a[e]],e===t-1)return we(n,l);if(!n)return"";r=n}return""},Ne=(e,t)=>Object.assign(Object.assign({},e),Object.keys(t).reduce(((l,n)=>(l[n]=void 0!==t[n]?t[n]:e[n],l)),{})),Te=(e,t)=>{const l=$.useRef(!0);$.useLayoutEffect((()=>e(l.current)),t),$.useLayoutEffect((()=>(l.current=!1,()=>{l.current=!0})),[])};function Ie(e,t){Te((t=>{if(!t)return e()}),t)}j.default.extend(K.default),j.default.extend(V.default),j.default.extend(z.default),j.default.extend(W.default),j.default.extend(B.default),j.default.extend(U.default);var Oe={},Re=[];function ke(e,t){if(!e&&void 0!==console){var l=Re.reduce((function(e,t){return t(null!=e?e:"","warning")}),t);l&&console.error("Warning: ".concat(l))}}function Le(e,t){if(!e&&void 0!==console){var l=Re.reduce((function(e,t){return t(null!=e?e:"","note")}),t);l&&console.warn("Note: ".concat(l))}}function Pe(e,t,l){t||Oe[l]||(e(!1,l),Oe[l]=!0)}function Ae(e,t){Pe(ke,e,t)}function De(e,t){Pe(Le,e,t)}Ae.preMessage=function(e){Re.push(e)},Ae.resetWarned=function(){Oe={}},Ae.noteOnce=De,j.default.extend(z.default),j.default.extend(V.default),j.default.extend(U.default),j.default.extend(K.default),j.default.extend(B.default),j.default.extend(G.default),j.default.extend((function(e,t){var l=t.prototype,n=l.format;l.format=function(e){var t=(e||"").replace("Wo","wo");return n.bind(this)(t)}}));var _e={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"},Fe=function(e){return _e[e]||e.split("_")[0]},He=function(){De(!1,"Not match any format. Please help to fire a issue about this.")},Me={getNow:function(){return j.default()},getFixedDate:function(e){return j.default(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 j.default().locale(Fe(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(Fe(e)).weekday(0)},getWeek:function(e,t){return t.locale(Fe(e)).week()},getShortWeekDays:function(e){return j.default().locale(Fe(e)).localeData().weekdaysMin()},getShortMonths:function(e){return j.default().locale(Fe(e)).localeData().monthsShort()},format:function(e,t,l){return t.locale(Fe(e)).format(l)},parse:function(e,t,l){for(var n=Fe(e),a=0;a<l.length;a+=1){var r=l[a],i=t;if(r.includes("wo")||r.includes("Wo")){for(var o=i.split("-")[0],s=i.split("-")[1],d=j.default(o,"YYYY").startOf("year").locale(n),u=0;u<=52;u+=1){var c=d.add(u,"week");if(c.format("Wo")===s)return c}return He(),null}var f=j.default(i,r).locale(n);if(f.isValid())return f}return t&&He(),null}}};const $e=Y.default(Me),qe=X.default(Me);function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},je.apply(null,arguments)}const Ke=$.forwardRef(((e,t)=>$.createElement(qe,je({},e,{picker:"time",mode:void 0,ref:t}))));Ke.displayName="TimePicker";const Ve=$.forwardRef(((e,t)=>$.createElement(qe.RangePicker,je({},e,{picker:"time",mode:void 0,ref:t}))));Ve.displayName="RangePicker",Ke.RangePicker=Ve;var ze={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 We={[ze.name]:{qm:ze,antd:Z.default},[Ee.name]:{qm:Ee,antd:Q.default}},Be=e=>{const t=Ne({locale:"zh-cn",size:"middle"},e),{locale:l,size:n,global:a}=t;q.default.useMemo((()=>{return e=Object.assign({},We,null==a?void 0:a.langPackage)[l].qm,Ce=e||Ce,void(Ce.name&&j.default.locale(Ce.name));var e}),[l]);const r=q.default.useMemo((()=>Object.assign({},We,null==a?void 0:a.langPackage)),[a]),[i,o]=q.default.useState({locale:l,size:n,global:a});return Ie((()=>{o((e=>Object.assign({},e,{locale:l,size:n})))}),[n,l]),q.default.createElement(xe.Provider,{value:i},q.default.createElement(s.ConfigProvider,{locale:r[i.locale].antd,componentSize:i.size,autoInsertSpaceInButton:null==a?void 0:a.autoInsertSpaceInButton},t.children))};function Ue(e,t){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(l[n[a]]=e[n[a]])}return l}function Ge(e,t,l,n){var a,r=arguments.length,i=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,l):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,l,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(i=(r<3?a(i):r>3?a(t,l,i):a(t,l))||i);return r>3&&i&&Object.defineProperty(t,l,i),i}function Ye(e,t,l,n){return new(l||(l=Promise))((function(a,r){function i(e){try{s(n.next(e))}catch(e){r(e)}}function o(e){try{s(n.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(i,o)}s((n=n.apply(e,t||[])).next())}))}function Xe(){const{locale:e}=$.useContext(xe);return{t:Se,$locale:e}}function Qe(e){const t=$.useRef();t.current=e;return $.useCallback(((...e)=>{var l;return null===(l=t.current)||void 0===l?void 0:l.call(t,...e)}),[])}function Ze(e){const{size:t}=$.useContext(xe);return{$size:$.useMemo((()=>{var l,n;return null!==(n=null!==(l=e.size)&&void 0!==l?l:t)&&void 0!==n?n:""}),[e.size,t])}}Be.displayName="QmConfigProvider";var Je="undefined"==typeof window;const et=e=>q.default.isValidElement(e),tt=e=>et(e)&&e.type===q.default.Fragment,lt=()=>{},nt=()=>!0,at=e=>Ye(void 0,void 0,void 0,(function*(){return new Promise((t=>setTimeout(t,e)))})),rt=e=>{Promise.resolve().then(e)},it=e=>e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():"")),ot=e=>!!(!e&&0!==e||m.isArray(e)&&!e.length||m.isPlainObject(e)&&!Object.keys(e).length),st=(e,t)=>t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e),dt=(e,t)=>{const l=Object.assign({},e);for(const e of t)delete l[e];return l};const ut=(e,t=new WeakMap)=>{if(m.isPlainObject(e)||m.isArray(e)){const l=Array.isArray(e),n=l?[]:{};if(t.get(e))return e;t.set(e,n);const a=l?void 0:Object.keys(e);return function(e,t){let l=-1;const n=e.length;for(;++l<n;)t(e[l],l)}(a||e,((l,r)=>{a&&(r=l),n[r]=ut(e[r],t)})),n}return e},ct=e=>m.isNumber(e)?`${e}px`:e.toString();class ft extends Error{constructor(e){super(e),this.name="QmDesignError"}}function pt(e,t){throw new ft(`[${e}] ${t}`)}function mt(e,t){console.warn(new ft(`[${e}] ${t}`))}const ht=e=>{const{loading:t,shortcutKey:l,authConfig:n,click:a,confirm:r}=e,{t:i}=Xe(),{$size:o}=Ze(e);q.default.useEffect((()=>(l&&document.addEventListener("keyup",c),()=>document.removeEventListener("keyup",c))),[]);const[d,u]=q.default.useState(!1),c=Qe((e=>{var t;const n=l.split("+").map((e=>e.trim().toLowerCase())),a=n.includes("alt"),r=n.includes("ctrl"),i=n.includes("shift"),o=n[n.length-1];a&&!e.altKey||r&&!e.ctrlKey||i&&!e.shiftKey||e.key.toLowerCase()!==o||(e.preventDefault(),p.disabled||null===(t=p.onClick)||void 0===t||t.call(p,e))})),f=m.isFunction(a)?{onClick:t=>Ye(void 0,void 0,void 0,(function*(){var l;u(!0);try{yield null===(l=e.click)||void 0===l?void 0:l.call(e,t)}catch(e){mt("Button","`click`方法执行出错")}u(!1)}))}:null,p=Object.assign(Object.assign(Object.assign({},dt(e,["shortcutKey","authConfig","click","confirm"])),{size:o,loading:d||t||!1}),f);if(n){const{visible:e=1,disabled:t}=n||{};if(!e)return null;t&&(p.disabled=!0)}const h=q.default.createElement(s.Button,p,e.children);return r?q.default.createElement(s.Popconfirm,{title:r.title||i("qm.button.confirmTitle"),disabled:p.disabled,onConfirm:e=>{var t,l;null===(t=r.onConfirm)||void 0===t||t.call(r),null===(l=p.onClick)||void 0===l||l.call(p,e)},onCancel:e=>{var t;null===(t=r.onCancel)||void 0===t||t.call(r,e)}},q.default.createElement(s.Button,je({},p,{onClick:lt}),e.children)):!l||p.disabled?h:q.default.createElement(s.Tooltip,{placement:"top",title:`${i("qm.button.shortcutKey")}: ${l}`},h)};var gt;ht.displayName="QmButton",function(e){e[e.default=14]="default",e[e.large=12]="large",e[e.middle=10]="middle",e[e.small=8]="small"}(gt||(gt={}));const vt=e=>{const{$size:t}=Ze(e),l=m.isNumber(e.size)?e.size:gt[t||"default"],n=Object.assign(Object.assign({},dt(e,["size"])),{size:l});return q.default.createElement(s.Space,n,e.children)};vt.displayName="QmSpace";const yt=e=>`qm-${e}`,bt=e=>{const{label:t,extra:l,collapse:n,bordered:a=!0,disabled:r,id:i,className:o,style:d,onCollapseChange:u}=e,{$size:c}=Ze(e),{t:f}=Xe(),p=yt("divider"),m={[p]:!0,[`${p}-borderless`]:!a,[`${p}--lg`]:"large"===c,[`${p}--sm`]:"small"===c};return q.default.createElement("div",{id:i,className:J.default(m,o),style:d},q.default.createElement("span",{className:`${p}__title`},t),q.default.createElement("div",{className:`${p}__extra`},l),void 0!==n&&q.default.createElement(s.Button,{type:"link",className:`${p}__collapse`,disabled:r,onClick:()=>{null==u||u(!n)}},f(n?"qm.divider.collect":"qm.divider.spread"),n?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)))};bt.displayName="QmDivider";const xt=()=>({height:0,opacity:0}),Et=e=>({height:e.scrollHeight,opacity:1}),Ct=e=>({height:e?e.offsetHeight:0}),wt=(e,t)=>!0===(null==t?void 0:t.deadline)||"height"===t.propertyName;function St(e){return St="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},St(e)}function Nt(e){var t=function(e,t){if("object"!==St(e)||null===e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var n=l.call(e,t||"default");if("object"!==St(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===St(t)?t:String(t)}function Tt(e,t,l){return(t=Nt(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function It(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Ot(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?It(Object(l),!0).forEach((function(t){Tt(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):It(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=new Array(t);l<t;l++)n[l]=e[l];return n}function kt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var n,a,r,i,o=[],s=!0,d=!1;try{if(r=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;s=!1}else for(;!(s=(n=r.call(l)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){d=!0,a=e}finally{try{if(!s&&null!=l.return&&(i=l.return(),Object(i)!==i))return}finally{if(d)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Rt(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?Rt(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 Lt(e){return e instanceof HTMLElement||e instanceof SVGElement}function Pt(e){var t,l=function(e){return e&&"object"===St(e)&&Lt(e.nativeElement)?e.nativeElement:Lt(e)?e:null}(e);return l||(e instanceof q.default.Component?null===(t=ee.default.findDOMNode)||void 0===t?void 0:t.call(ee.default,e):null)}var At,Dt={exports:{}},_t={};Dt.exports=(At||(At=1,function(){var e,t=Symbol.for("react.element"),l=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),s=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function h(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var h=e.type;switch(h){case n:case r:case a:case u:case c:return h;default:var g=h&&h.$$typeof;switch(g){case s:case o:case d:case p:case f:case i:return g;default:return m}}case l:return m}}}e=Symbol.for("react.module.reference");var g=o,v=i,y=t,b=d,x=n,E=p,C=f,w=l,S=r,N=a,T=u,I=c,O=!1,R=!1;_t.ContextConsumer=g,_t.ContextProvider=v,_t.Element=y,_t.ForwardRef=b,_t.Fragment=x,_t.Lazy=E,_t.Memo=C,_t.Portal=w,_t.Profiler=S,_t.StrictMode=N,_t.Suspense=T,_t.SuspenseList=I,_t.isAsyncMode=function(e){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},_t.isConcurrentMode=function(e){return R||(R=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},_t.isContextConsumer=function(e){return h(e)===o},_t.isContextProvider=function(e){return h(e)===i},_t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},_t.isForwardRef=function(e){return h(e)===d},_t.isFragment=function(e){return h(e)===n},_t.isLazy=function(e){return h(e)===p},_t.isMemo=function(e){return h(e)===f},_t.isPortal=function(e){return h(e)===l},_t.isProfiler=function(e){return h(e)===r},_t.isStrictMode=function(e){return h(e)===a},_t.isSuspense=function(e){return h(e)===u},_t.isSuspenseList=function(e){return h(e)===c},_t.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===n||t===r||t===a||t===u||t===c||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===p||t.$$typeof===f||t.$$typeof===i||t.$$typeof===o||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},_t.typeOf=h}()),_t);var Ft=function(e,t){"function"==typeof e?e(t):"object"===St(e)&&e&&"current"in e&&(e.current=t)},Ht=function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n=t.filter(Boolean);return n.length<=1?n[0]:function(e){t.forEach((function(t){Ft(t,e)}))}},Mt=function(e){var t,l,n=Dt.exports.isMemo(e)?e.type.type:e.type;return!!("function"!=typeof n||null!==(t=n.prototype)&&void 0!==t&&t.render||n.$$typeof===Dt.exports.ForwardRef)&&!!("function"!=typeof e||null!==(l=e.prototype)&&void 0!==l&&l.render||e.$$typeof===Dt.exports.ForwardRef)};function $t(e,t){if(null==e)return{};var l,n,a=function(e,t){if(null==e)return{};var l,n,a={},r=Object.keys(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||(a[l]=e[l]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)l=r[n],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(a[l]=e[l])}return a}Number(e.version.split(".")[0]);var qt=$.createContext({});function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kt(e,t){for(var l=0;l<t.length;l++){var n=t[l];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Nt(n.key),n)}}function Vt(e,t,l){return t&&Kt(e.prototype,t),l&&Kt(e,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function zt(e,t){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zt(e,t)}function Wt(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&&zt(e,t)}function Bt(e){return Bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bt(e)}function Ut(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gt(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 l,n=Bt(e);if(t){var a=Bt(this).constructor;l=Reflect.construct(n,arguments,a)}else l=n.apply(this,arguments);return function(e,t){if(t&&("object"===St(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ut(e)}(this,l)}}var Yt=function(e){Wt(l,$.Component);var t=Gt(l);function l(){return jt(this,l),t.apply(this,arguments)}return Vt(l,[{key:"render",value:function(){return this.props.children}}]),l}();function Xt(e){var t=$.useRef(!1),l=kt($.useState(e),2),n=l[0],a=l[1];return $.useEffect((function(){return t.current=!1,function(){t.current=!0}}),[]),[n,function(e,l){l&&t.current||a(e)}]}var Qt="none",Zt="appear",Jt="enter",el="leave",tl="none",ll="prepare",nl="start",al="active",rl="end",il="prepared";function ol(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function sl(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit".concat(e)]="webkit".concat(t),l["Moz".concat(e)]="moz".concat(t),l["ms".concat(e)]="MS".concat(t),l["O".concat(e)]="o".concat(t.toLowerCase()),l}var dl,ul,cl,fl=(dl=ol(),ul="undefined"!=typeof window?window:{},cl={animationend:sl("Animation","AnimationEnd"),transitionend:sl("Transition","TransitionEnd")},dl&&("AnimationEvent"in ul||delete cl.animationend.animation,"TransitionEvent"in ul||delete cl.transitionend.transition),cl),pl={};if(ol()){var ml=document.createElement("div");pl=ml.style}var hl={};function gl(e){if(hl[e])return hl[e];var t=fl[e];if(t)for(var l=Object.keys(t),n=l.length,a=0;a<n;a+=1){var r=l[a];if(Object.prototype.hasOwnProperty.call(t,r)&&r in pl)return hl[e]=t[r],hl[e]}return""}var vl=gl("animationend"),yl=gl("transitionend"),bl=!(!vl||!yl),xl=vl||"animationend",El=yl||"transitionend";function Cl(e,t){return e?"object"===St(e)?e[t.replace(/-\w/g,(function(e){return e[1].toUpperCase()}))]:"".concat(e,"-").concat(t):null}var wl=function(t){var l=e.useRef(),n=e.useRef(t);n.current=t;var a=$.useCallback((function(e){n.current(e)}),[]);function r(e){e&&(e.removeEventListener(El,a),e.removeEventListener(xl,a))}return $.useEffect((function(){return function(){r(l.current)}}),[]),[function(e){l.current&&l.current!==e&&r(l.current),e&&e!==l.current&&(e.addEventListener(El,a),e.addEventListener(xl,a),l.current=e)},r]},Sl=ol()?e.useLayoutEffect:e.useEffect,Nl=function(e){return+setTimeout(e,16)},Tl=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(Nl=function(e){return window.requestAnimationFrame(e)},Tl=function(e){return window.cancelAnimationFrame(e)});var Il=0,Ol=new Map;function Rl(e){Ol.delete(e)}var kl=function(e){var t=Il+=1;return function l(n){if(0===n)Rl(t),e();else{var a=Nl((function(){l(n-1)}));Ol.set(t,a)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t};kl.cancel=function(e){var t=Ol.get(e);return Rl(e),Tl(t)},kl.ids=function(){return Ol};var Ll=[ll,nl,al,rl],Pl=[ll,il],Al=!1,Dl=!0;function _l(e){return e===al||e===rl}var Fl=function(e,t,l){var n=kt(Xt(tl),2),a=n[0],r=n[1],i=function(){var e=$.useRef(null);function t(){kl.cancel(e.current)}return $.useEffect((function(){return function(){t()}}),[]),[function l(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var r=kl((function(){a<=1?n({isCanceled:function(){return r!==e.current}}):l(n,a-1)}));e.current=r},t]}(),o=kt(i,2),s=o[0],d=o[1];var u=t?Pl:Ll;return Sl((function(){if(a!==tl&&a!==rl){var e=u.indexOf(a),t=u[e+1],n=l(a);n===Al?r(t,!0):t&&s((function(e){function l(){e.isCanceled()||r(t,!0)}!0===n?l():Promise.resolve(n).then(l)}))}}),[e,a]),$.useEffect((function(){return function(){d()}}),[]),[function(){r(ll,!0)},a]};var Hl=function(t){var l=t;"object"===St(t)&&(l=t.transitionSupport);var n=$.forwardRef((function(t,n){var a=t.visible,r=void 0===a||a,i=t.removeOnLeave,o=void 0===i||i,s=t.forceRender,d=t.children,u=t.motionName,c=t.leavedClassName,f=t.eventProps,p=function(e,t){return!(!e.motionName||!l||!1===t)}(t,$.useContext(qt).motion),m=e.useRef(),h=e.useRef();var g=function(t,l,n,a){var r=a.motionEnter,i=void 0===r||r,o=a.motionAppear,s=void 0===o||o,d=a.motionLeave,u=void 0===d||d,c=a.motionDeadline,f=a.motionLeaveImmediately,p=a.onAppearPrepare,m=a.onEnterPrepare,h=a.onLeavePrepare,g=a.onAppearStart,v=a.onEnterStart,y=a.onLeaveStart,b=a.onAppearActive,x=a.onEnterActive,E=a.onLeaveActive,C=a.onAppearEnd,w=a.onEnterEnd,S=a.onLeaveEnd,N=a.onVisibleChanged,T=kt(Xt(),2),I=T[0],O=T[1],R=kt(Xt(Qt),2),k=R[0],L=R[1],P=kt(Xt(null),2),A=P[0],D=P[1],_=e.useRef(!1),F=e.useRef(null);function H(){return n()}var M=e.useRef(!1);function q(){L(Qt,!0),D(null,!0)}function j(e){var t=H();if(!e||e.deadline||e.target===t){var l,n=M.current;k===Zt&&n?l=null==C?void 0:C(t,e):k===Jt&&n?l=null==w?void 0:w(t,e):k===el&&n&&(l=null==S?void 0:S(t,e)),k!==Qt&&n&&!1!==l&&q()}}var K=kt(wl(j),1)[0],V=function(e){var t,l,n;switch(e){case Zt:return Tt(t={},ll,p),Tt(t,nl,g),Tt(t,al,b),t;case Jt:return Tt(l={},ll,m),Tt(l,nl,v),Tt(l,al,x),l;case el:return Tt(n={},ll,h),Tt(n,nl,y),Tt(n,al,E),n;default:return{}}},z=$.useMemo((function(){return V(k)}),[k]),W=kt(Fl(k,!t,(function(e){if(e===ll){var t=z[ll];return t?t(H()):Al}var l;return U in z&&D((null===(l=z[U])||void 0===l?void 0:l.call(z,H(),null))||null),U===al&&(K(H()),c>0&&(clearTimeout(F.current),F.current=setTimeout((function(){j({deadline:!0})}),c))),U===il&&q(),Dl})),2),B=W[0],U=W[1],G=_l(U);M.current=G,Sl((function(){O(l);var e,n=_.current;_.current=!0,!n&&l&&s&&(e=Zt),n&&l&&i&&(e=Jt),(n&&!l&&u||!n&&f&&!l&&u)&&(e=el);var a=V(e);e&&(t||a[ll])?(L(e),B()):L(Qt)}),[l]),e.useEffect((function(){(k===Zt&&!s||k===Jt&&!i||k===el&&!u)&&L(Qt)}),[s,i,u]),e.useEffect((function(){return function(){_.current=!1,clearTimeout(F.current)}}),[]);var Y=$.useRef(!1);e.useEffect((function(){I&&(Y.current=!0),void 0!==I&&k===Qt&&((Y.current||I)&&(null==N||N(I)),Y.current=!0)}),[I,k]);var X=A;return z[ll]&&U===nl&&(X=Ot({transition:"none"},X)),[k,U,X,null!=I?I:l]}(p,r,(function(){try{return m.current instanceof HTMLElement?m.current:Pt(h.current)}catch(e){return null}}),t),v=kt(g,4),y=v[0],b=v[1],x=v[2],E=v[3],C=$.useRef(E);E&&(C.current=!0);var w,S=$.useCallback((function(e){m.current=e,Ft(n,e)}),[n]),N=Ot(Ot({},f),{},{visible:r});if(d)if(y===Qt)w=E?d(Ot({},N),S):!o&&C.current&&c?d(Ot(Ot({},N),{},{className:c}),S):s||!o&&!c?d(Ot(Ot({},N),{},{style:{display:"none"}}),S):null;else{var T,I;b===ll?I="prepare":_l(b)?I="active":b===nl&&(I="start");var O=Cl(u,"".concat(y,"-").concat(I));w=d(Ot(Ot({},N),{},{className:J.default(Cl(u,y),(T={},Tt(T,O,O&&I),Tt(T,u,"string"==typeof u),T)),style:x}),S)}else w=null;$.isValidElement(w)&&Mt(w)&&(w.ref||(w=$.cloneElement(w,{ref:S})));return $.createElement(Yt,{ref:h},w)}));return n.displayName="CSSMotion",n}(bl);function Ml(){return Ml=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e},Ml.apply(this,arguments)}var $l="add",ql="keep",jl="remove",Kl="removed";function Vl(e){var t;return Ot(Ot({},t=e&&"object"===St(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function zl(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(Vl)}var Wl=["component","children","onVisibleChanged","onAllRemoved"],Bl=["status"],Ul=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hl,l=function(e){Wt(n,$.Component);var l=Gt(n);function n(){var e;jt(this,n);for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];return Tt(Ut(e=l.call.apply(l,[this].concat(a))),"state",{keyEntities:[]}),Tt(Ut(e),"removeKey",(function(t){var l=e.state.keyEntities.map((function(e){return e.key!==t?e:Ot(Ot({},e),{},{status:Kl})}));return e.setState({keyEntities:l}),l.filter((function(e){return e.status!==Kl})).length})),e}return Vt(n,[{key:"render",value:function(){var e=this,l=this.state.keyEntities,n=this.props,a=n.component,r=n.children,i=n.onVisibleChanged,o=n.onAllRemoved,s=$t(n,Wl),d=a||$.Fragment,u={};return Ul.forEach((function(e){u[e]=s[e],delete s[e]})),delete s.keys,$.createElement(d,s,l.map((function(l){var n=l.status,a=$t(l,Bl),s=n===$l||n===ql;return $.createElement(t,Ml({},u,{key:a.key,visible:s,eventProps:a,onVisibleChanged:function(t){(null==i||i(t,{key:a.key}),t)||0===e.removeKey(a.key)&&o&&o()}}),r)})))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.keys,n=t.keyEntities,a=zl(l),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=[],n=0,a=t.length,r=zl(e),i=zl(t);r.forEach((function(e){for(var t=!1,r=n;r<a;r+=1){var o=i[r];if(o.key===e.key){n<r&&(l=l.concat(i.slice(n,r).map((function(e){return Ot(Ot({},e),{},{status:$l})}))),n=r),l.push(Ot(Ot({},o),{},{status:ql})),n+=1,t=!0;break}}t||l.push(Ot(Ot({},e),{},{status:jl}))})),n<a&&(l=l.concat(i.slice(n).map((function(e){return Ot(Ot({},e),{},{status:$l})}))));var o={};return l.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){(l=l.filter((function(t){var l=t.key,n=t.status;return l!==e||n!==jl}))).forEach((function(t){t.key===e&&(t.status=ql)}))})),l}(n,a);return{keyEntities:r.filter((function(e){var t=n.find((function(t){var l=t.key;return e.key===l}));return!t||t.status!==Kl||e.status!==jl}))}}}]),n}();Tt(l,"defaultProps",{component:"div"})}(bl);const Gl=q.default.forwardRef(((e,t)=>{const{forceRender:l,className:n,style:a,boxStyle:r,isActive:i}=e,[o,s]=q.default.useState(i||l);if(q.default.useEffect((()=>{(l||i)&&s(!0)}),[l,i]),!o)return null;const d=yt("collapse");return q.default.createElement("div",{ref:t,className:J.default(`${d}-content`,{[`${d}-content-active`]:i,[`${d}-content-inactive`]:!i},n),style:a},q.default.createElement("div",{className:`${d}-content-box`,style:r},e.children))}));Gl.displayName="PanelContent";const Yl=e=>{const{defaultActive:t,label:l,extra:n,className:a,style:r,containerStyle:i,bordered:o,disabled:s,forceRender:d,destroyOnClose:u=!1,onChange:c}=e,[f,p]=q.default.useState(!!t),m=yt("collapse"),h=J.default({[`${m}`]:!0,[`${m}-active`]:f,[`${m}-disabled`]:s},a);return q.default.createElement("div",{className:h,style:r},q.default.createElement(bt,{label:l,extra:n,collapse:f,bordered:o,disabled:s,onCollapseChange:e=>{p(e),null==c||c(e)}}),q.default.createElement(Hl,je({visible:f},((e=yt("motion-collapse"))=>({motionName:e,onAppearStart:xt,onEnterStart:xt,onAppearActive:Et,onEnterActive:Et,onLeaveStart:Ct,onLeaveActive:xt,onAppearEnd:wt,onEnterEnd:wt,onLeaveEnd:wt,motionDeadline:500}))(),{forceRender:d,removeOnLeave:u}),(({className:t,style:l},n)=>q.default.createElement(Gl,{ref:n,prefixCls:m,className:t,style:l,boxStyle:i,isActive:f,forceRender:d},e.children))))};Yl.displayName="QmCollapse";const Xl=q.default.createContext(void 0);function Ql(e,t){((e,t)=>{const l=$.useRef(!0);$.useEffect((()=>e(l.current)),t),$.useEffect((()=>(l.current=!1,()=>{l.current=!0})),[])})((t=>{if(!t)return e()}),t)}const Zl=(e,t,l)=>{e&&t&&l&&e.addEventListener(t,l,!1)},Jl=(e,t,l)=>{e&&t&&l&&e.removeEventListener(t,l,!1)},en=e=>e.preventDefault(),tn=(e,t)=>{if(Je||!e||!t)return null;"float"===(t=it(t))&&(t="cssFloat");try{const l=e.style[t];if(l)return l;const n=window.getComputedStyle(e);return n?n[t]:""}catch(l){return e.style[t]}},ln=(e,t,l)=>{!Je&&e&&t&&(m.isPlainObject(t)?Object.keys(t).forEach((l=>{ln(e,l,t[l])})):(t=it(t),e.style[t]=l))},nn=e=>{let t=0,l=e;for(;l;)t+=l.offsetTop,l=l.offsetParent;return t},an=(e,t)=>Math.abs(nn(e)-nn(t)),rn=e=>{let t=0,l=0;for(;e;)t+=e.offsetLeft-e.scrollLeft,l+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{x:t,y:l}},on=(e,t)=>{var l;let n=e;for(;n;){if(null===(l=n.classList)||void 0===l?void 0:l.contains(t))return n;n=n.parentNode}return null},sn=(e,t)=>{if(Je||!e||!t)return!1;let l=e;for(;l;){if(l===t)return!0;l=l.parentNode}return!1},dn=e=>Math.pow(e,3),un=e=>e<.5?dn(2*e)/2:1-dn(2*(1-e))/2,cn=e=>{const{minValues:t,onDragChange:l,onDragging:n}=e,{splitRef:a,direction:r}=q.default.useContext(Xl),{t:i}=Xe(),o=q.default.useRef(Je?null:document.onselectstart),s=q.default.useMemo((()=>"horizontal"===r),[r]),d=q.default.useMemo((()=>s?"X":"Y"),[s]),u=q.default.useRef({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),c=e=>{u.current=Object.assign({},u.current,e)},f=e=>{if(1!==e.buttons)return p();const l=e[`page${d}`]-u.current[`start${d}`],a=[t[0],u.current[`containerSize${d}`]-t[1]];let r=u.current[`firstElementSize${d}`]+l;r=Math.max(a[0],r),r=Math.min(a[1],r),n(r)},p=()=>{c({startX:0,startY:0,firstElementSizeX:0,firstElementSizeY:0,containerSizeX:0,containerSizeY:0}),l(!1),Jl(document,"mousemove",f),Jl(document,"mouseup",p),m()},m=()=>{document.onselectstart!==o.current&&(document.onselectstart=o.current)},h={[`${yt("split")}__resize-bar`]:!0,vertical:"vertical"===r,horizontal:"horizontal"===r};return q.default.createElement("div",{className:J.default(h),title:i("qm.split.resize"),onMouseDown:e=>{e.stopPropagation();const t=a.current,n=t.children[0];c({startX:e.pageX,startY:e.pageY,firstElementSizeX:n.offsetWidth,firstElementSizeY:n.offsetHeight,containerSizeX:t.offsetWidth,containerSizeY:t.offsetHeight}),Zl(document,"mousemove",f),Zl(document,"mouseup",p),l(!0),o.current=document.onselectstart,document.onselectstart=()=>!1}})};cn.displayName="ResizeBar";const fn=q.default.forwardRef(((e,t)=>{const{offset:l,className:n,style:a}=e,{direction:r,dragging:i}=q.default.useContext(Xl),o="vertical"===r?"height":"width",s={[yt("split-pane")]:!0,isLocked:i,horizontal:"horizontal"===r,vertical:"vertical"===r,[n]:!!n},d=void 0!==l?{[o]:ct(l)}:{flex:1,[o]:0};return q.default.createElement("div",{ref:t,className:J.default(s),style:Object.assign(Object.assign({},d),a)},e.children)}));fn.displayName="SplitPane";const pn=e=>{const{direction:t="horizontal",defaultValue:l="50%",uniqueKey:n,className:a,style:r,onDragStart:i,onDrag:o=lt,onDragEnd:s}=e,{global:d}=q.default.useContext(xe),u=q.default.useRef(null),c=q.default.useRef(null),f=e=>Number(e)>0?`${e}px`:(e=>["px","em","vw","vh","%"].some((t=>e.endsWith(t))))(e.toString())?e.toString():`${Number.parseFloat(e)}px`,p=e=>Number.parseInt(e,10),m=e=>{var t;const l=Number.parseInt((null===(t=e.props)||void 0===t?void 0:t.min)||0);return l>=0?l:0},h=q.default.useMemo((()=>n?`split_${n}`:""),[n]),[g,v]=q.default.useState(!1),[y,b]=q.default.useState(f(l));Ql((()=>{g?null==i||i(p(y)):(null==s||s(p(y)),localStorage.setItem(h,y),C(h,y))}),[g]),q.default.useEffect((()=>{x()}),[]);const x=()=>{if(!h)return;const e=localStorage.getItem(h);e?b(f(e)):E(h).then((e=>{localStorage.setItem(h,f(e||l)),x()})).catch((()=>{}))},E=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==d?void 0:d.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),C=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==d?void 0:d.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),w=q.default.useMemo((()=>({splitRef:u,direction:t,dragging:g})),[t,g]),S=[];q.default.Children.map(e.children,(e=>{var t;et(e)&&!tt(e)&&"SplitPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const[N,T]=S,I=q.default.useMemo((()=>[m(N),m(T)]),[N,T]),O={[yt("split")]:!0,vertical:"vertical"===t};return q.default.createElement(Xl.Provider,{value:w},q.default.createElement("div",{ref:u,className:J.default(O,a),style:r},q.default.createElement(fn,je({},N.props,{ref:c,offset:y})),q.default.createElement(cn,{minValues:I,onDragChange:e=>v(e),onDragging:e=>{b(`${e}px`),o(e)}}),q.default.createElement(fn,T.props)))};pn.displayName="QmSplit",pn.Pane=fn;const mn=e=>{const{className:t,style:l}=e,{$size:n}=Ze(e),a=yt("countup"),r={[a]:!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n};return q.default.createElement(te.default,je({},e,{className:J.default(r,t),style:l}),e.children)};mn.displayName="QmCountup";const hn=e=>{const{className:t}=e,{$size:l}=Ze(e),n=yt("empty"),a=Object.assign(Object.assign({},e),{image:s.Empty.PRESENTED_IMAGE_SIMPLE}),r={[n]:!0,[`${n}--lg`]:"large"===l,[`${n}--sm`]:"small"===l};return q.default.createElement(s.Empty,je({},a,{className:J.default(r,t)}))};hn.displayName="QmEmpty";const gn=e=>{const t=Ne({tip:"Loading..."},e),{fullHeight:l,className:n,style:a}=t,r=yt("spin"),i={[r]:!0,[`${r}-fullHeight`]:!!l},o=Object.assign(Object.assign({wrapperClassName:J.default(i,n)},dt(t,["fullHeight"])),{style:Object.assign(Object.assign({},a),{maxHeight:"none"})});return q.default.createElement(s.Spin,o,t.children)};gn.displayName="QmSpin";const vn=q.default.createContext(void 0),yn=new Map;const bn=new le.default((function(e){e.forEach((e=>{var t;const{target:l}=e;null===(t=yn.get(l))||void 0===t||t.forEach((e=>e(l)))}))}));function xn(e,t){yn.has(e)||(yn.set(e,new Set),bn.observe(e)),yn.get(e).add(t)}function En(e,t){yn.has(e)&&(yn.get(e).delete(t),yn.get(e).size||(bn.unobserve(e),yn.delete(e)))}function Cn(e){const[t,l]=$.useState({width:0,height:0});return $.useLayoutEffect((()=>{const t=e.current,n=e=>{l({width:e.offsetWidth,height:e.offsetHeight})};return t&&xn(t,n),()=>{t&&En(t,n)}}),[e]),t}function wn(e,t){const l=$.useRef(null);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...n)=>{l.current&&clearTimeout(l.current),l.current=setTimeout((()=>e.apply(this,n)),t)}),[e,t])}const Sn=(e,...t)=>q.default.isValidElement(e)?q.default.cloneElement(e,...t):null,Nn=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Tn=e=>({_s:e,status:Nn[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),In=e=>e?6:5,On=(e,t,l,n,a)=>{clearTimeout(n.current);const r=Tn(e);t(r),l.current=r,null==a||a({current:r})},Rn=(t={})=>{const{enter:l=!0,exit:n=!0,preEnter:a,preExit:r,timeout:i,initialEntered:o,mountOnEnter:s,unmountOnExit:d,onStateChange:u}=t||{},[c,f]=e.useState((()=>Tn(o?2:In(s)))),p=e.useRef(c),h=e.useRef(),[g,v]=(e=>m.isPlainObject(e)?[e.enter,e.exit]:[e,e])(i),y=e.useCallback((()=>{const e=((e,t)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return In(t)}})(p.current._s,d);e&&On(e,f,p,h,u)}),[u,d]),b=e.useCallback((e=>{const t=e=>{switch(On(e,f,p,h,u),e){case 1:g>=0&&(h.current=setTimeout(y,g));break;case 4:v>=0&&(h.current=setTimeout(y,v));break;case 0:case 3:h.current=setTimeout((()=>t(e+1)),0)}},i=p.current.isEnter;"boolean"!=typeof e&&(e=!i),e?!i&&t(l?a?0:1:2):i&&t(n?r?3:4:In(d))}),[y,u,l,n,a,r,g,v,d]);return e.useEffect((()=>()=>clearTimeout(h.current)),[]),[c,b,y]},kn=e=>{const{name:t,in:l,timeout:n,preEnter:a=!0,preExit:r}=e,[i,o]=Rn({timeout:n,preEnter:a,preExit:r,initialEntered:l});return Ie((()=>{o()}),[l]),q.default.createElement(q.default.Fragment,null,q.default.Children.map(e.children,(e=>q.default.isValidElement(e)?Sn(e,{className:J.default(e.props.className,t,i.status)}):e)))},Ln=6,Pn={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"}},An=e=>{const{thumb:t,always:l,className:n,barSize:a=Ln,direction:r="vertical",onDrag:i=lt}=e,{dragging:o,scrollbarElement:s,wrapElement:d}=q.default.useContext(vn),u=Pn[r],c=q.default.useRef(t),f=q.default.useRef(null),p=q.default.useRef(null),m=q.default.useRef({}),h=q.default.useRef(!1),g=q.default.useRef(!1),v=q.default.useRef(Je?null:document.onselectstart),[y,b]=q.default.useState(!1);q.default.useLayoutEffect((()=>{c.current=t}),[t]),q.default.useEffect((()=>{const e=s.current;return Zl(e,"mousemove",w),Zl(e,"mouseleave",S),()=>{C(),Jl(document,"mouseup",E),Jl(e,"mousemove",w),Jl(e,"mouseleave",S)}}),[]);const x=e=>{if(!f.current||!p.current)return;if(!h.current)return;const t=m.current[u.axis];if(!t)return;const l=100*(-1*(f.current.getBoundingClientRect()[u.direction]-e[u.client])-(p.current[u.offset]-t))/f.current[u.offset];d.current[u.scroll]=l*d.current[u.scrollSize]/100,i(!0)},E=()=>{h.current=!1,m.current={[u.axis]:0},Jl(document,"mousemove",x),Jl(document,"mouseup",E),C(),g.current&&b(!1),i(!1)},C=()=>{document.onselectstart!==v.current&&(document.onselectstart=v.current)},w=()=>{g.current=!1,b(!!c.current.size)},S=()=>{g.current=!0,b(h.current)},N=yt("scrollbar"),T={[`${N}__bar`]:!0,"is-vertical":"vertical"===r,"is-horizontal":"horizontal"===r},I={[u.reverse]:a},O={[u.size]:t.size,transform:`translate${u.axis}(${t.offset}%)`};return q.default.createElement(kn,{name:"fade",in:l||o||y,timeout:300},q.default.createElement("div",{ref:f,className:J.default(T,n),style:I},q.default.createElement("div",{ref:p,className:`${N}__thumb`,style:O,onMouseDown:e=>{e.stopPropagation(),Zl(document,"mousemove",x),Zl(document,"mouseup",E),h.current=!0,v.current=document.onselectstart,document.onselectstart=()=>!1;const t=e.target;t&&(m.current={[u.axis]:t[u.offset]-(e[u.client]-t.getBoundingClientRect()[u.direction])})}})))},Dn=20,_n=q.default.forwardRef(((e,t)=>{const{wrapClassName:l,wrapStyle:n,innerStyle:a,barWidth:r,always:i,native:o,showTopScrollbar:s,minSize:d=Dn,onScroll:u}=e,c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef(null),[h,g]=q.default.useState({size:0,offset:0,ratio:1}),[v,y]=q.default.useState({size:0,offset:0,ratio:1}),[b,x]=q.default.useState(!1),E=Cn(c),C=Cn(p);Ie((()=>{!o&&w()}),[C.width,C.height,E.width,E.height]);const w=wn((()=>{if(!f.current)return;const e=f.current.offsetHeight-4,t=f.current.offsetWidth-4,l=Math.pow(e,2)/f.current.scrollHeight,n=Math.pow(t,2)/f.current.scrollWidth,a=Math.max(l,d),r=Math.max(n,d),i=l/(e-l)/(a/(e-a)),o=n/(t-n)/(r/(t-r)),s=a+4<e?a:0,u=r+4<t?r:0,c=100*f.current.scrollTop/e*i,p=100*f.current.scrollLeft/t*o;g(Object.assign({},h,{size:u,ratio:o,offset:p})),y(Object.assign({},v,{size:s,ratio:i,offset:c}))}),5),S=e=>{x(e)},N=(e,t)=>{m.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollTop,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollTop=n+(t-n)*un(i),a(r)):e.scrollTop=t};a(r)})(f.current,e):f.current.scrollTop=e:mt("Scrollbar","SET_SCROLL_TOP 参数必须是数值类型")},T=(e,t)=>{m.isNumber(e)?t?((e,t)=>{const l=Date.now(),n=e.scrollLeft,a=window.requestAnimationFrame,r=()=>{const i=(Date.now()-l)/500;i<1?(e.scrollLeft=n+(t-n)*un(i),a(r)):e.scrollLeft=t};a(r)})(f.current,e):f.current.scrollLeft=e:mt("Scrollbar","SET_SCROLL_LEFT 参数必须是数值类型")};q.default.useImperativeHandle(t,(()=>{var e,t;return{container:c.current,scrollTop:(null===(e=f.current)||void 0===e?void 0:e.scrollTop)||0,scrollLeft:(null===(t=f.current)||void 0===t?void 0:t.scrollLeft)||0,SET_SCROLL_TOP:N,SET_SCROLL_LEFT:T}}));const I=q.default.useMemo((()=>({dragging:b,scrollbarElement:c,wrapElement:f})),[b]),O=yt("scrollbar"),R={[`${O}__wrap`]:!0,[`${O}__wrap--hidden`]:!o};return q.default.createElement("div",{ref:c,className:J.default(O,e.className),style:e.style},q.default.createElement("div",{ref:f,className:J.default(R,l),style:n,onScroll:e=>{const{scrollTop:t,scrollLeft:l}=e.target;!o&&(()=>{if(!f.current)return;const e=f.current.offsetHeight-4,t=f.current.offsetWidth-4,l=100*f.current.scrollTop/e*v.ratio,n=100*f.current.scrollLeft/t*h.ratio;g(Object.assign({},h,{offset:n})),y(Object.assign({},v,{offset:l}))})(),null==u||u({scrollTop:t,scrollLeft:l})}},q.default.createElement("div",{ref:p,className:`${O}__view`,style:a},e.children)),!o&&q.default.createElement(vn.Provider,{value:I},s&&q.default.createElement(An,{className:"top",direction:"horizontal",thumb:h,barSize:r,always:i,onDrag:S}),q.default.createElement(An,{direction:"horizontal",thumb:h,barSize:r,always:i,onDrag:S}),q.default.createElement(An,{direction:"vertical",thumb:v,barSize:r,always:i,onDrag:S})))}));_n.displayName="QmScrollbar";const Fn=(e,t)=>{if(navigator.msSaveBlob)navigator.msSaveBlob(e,decodeURI(t));else{const l=window.URL.createObjectURL(e);let n=document.createElement("a");n.href=l,n.download=decodeURI(t),n.click(),n=null}},Hn=(e,{fileName:t,headers:l,params:n})=>Ye(void 0,void 0,void 0,(function*(){const a=n?new URLSearchParams(n).toString():"",r=a?e.includes("?")?"&":"?":"",i=yield fetch(e+`${r+a}`,{method:"GET",headers:l});if(!i.ok)throw new Error(Se("qm.download.error"));const o=yield i.blob(),s=i.headers.get("content-disposition"),d=t||(s?s.split(";")[1].split("filename=")[1]:e.slice(e.lastIndexOf("/")+1));Fn(o,d)})),Mn=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(0,t):e},$n=e=>{const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},qn=e=>{var t,l;const n=Ne({name:"file",multiple:!0,showUploadList:{showPreviewIcon:!0,showDownloadIcon:!0,showRemoveIcon:!0}},e),{fileList:a=[],fileDirection:r="vertical",batchDownload:i,draggable:o,editable:d,disabled:u,readOnly:c,button:f={},className:p,onPreview:m,onSortChange:h,onEditChange:v,onDownload:y,onChange:b}=n,{t:x}=Xe(),{$size:E}=Ze(n),C=q.default.useRef(null),w=q.default.useRef(null),[S,N]=q.default.useState({}),T=q.default.useMemo((()=>u||c),[u,c]);q.default.useEffect((()=>(R(),()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.destroy()})),[]);const I=(e,t)=>{N((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))},O=Qe((e=>{const{oldIndex:t,newIndex:l}=e;if(t!==l){const e=[...a],[n]=e.splice(t,1);e.splice(l,0,n),null==h||h(e),null==b||b({file:a[t],fileList:e})}})),R=()=>{o&&(w.current=ne.default.create(on(C.current,yt("upload-file")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-text-container",onEnd:O}))},k=e=>Ye(void 0,void 0,void 0,(function*(){if(y)return void(yield y(e));const{downloadWithHeaders:t,headers:l}=n;try{e.url&&(yield Hn(e.url,Object.assign({fileName:e.name},t?{headers:l}:null)))}catch(e){s.message.error(x("qm.download.error"))}})),L=yt("upload-file"),P={[L]:!0,[`${L}--lg`]:"large"===E,[`${L}--sm`]:"small"===E,[`${L}--horizontal`]:"horizontal"===r};return q.default.createElement(s.Upload,je({className:J.default(P,p)},dt(n,["fileTypes","fileSize","fileDirection","batchDownload","draggable","editable","button"]),{beforeUpload:(e,t)=>new Promise(((l,a)=>Ye(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,maxCount:o,fileList:d=[],beforeUpload:u}=n,c=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),f=!i||e.size/1024/1024<i,p=!(o>1)||d.length<o,m=c&&f&&p;if(c||s.message.warning(x("qm.upload.tooltip",{type:r.join(",")})),f||s.message.warning(x("qm.upload.sizeLimit",{size:i})),p||s.message.warning(x("qm.upload.countLimit",{count:o})),!m)return s.Upload.LIST_IGNORE;if(u){const n=u(e,t);if(!0===n)return l(e);if(!1===n)return a("not upload");if(n&&"function"==typeof n.then)try{const e=yield n;l(e)}catch(e){a(e)}}else l(e)})))),disabled:T,onChange:b,onPreview:e=>Ye(void 0,void 0,void 0,(function*(){if("function"==typeof m)return m(e,(t=>k(t||e)));u||(yield k(e))})),onDownload:e=>Ye(void 0,void 0,void 0,(function*(){yield k(e)})),itemRender:(e,t,l,r)=>((e,t)=>{const{iconRender:l}=n,{uid:r,name:i,url:c,status:f="done"}=e,p="ant-btn ant-btn-text ant-btn-sm ant-btn-icon-only ant-upload-list-item-card-actions-btn";return q.default.createElement("div",{className:J.default("ant-upload-list-item",`ant-upload-list-item-${f}`,"ant-upload-list-item-list-type-text",{handle:o})},q.default.createElement("div",{className:"ant-upload-list-item-info"},q.default.createElement("span",{className:"ant-upload-span"},q.default.createElement("div",{className:"ant-upload-text-icon"},l?l(e):q.default.createElement(g.LinkOutlined,null)),q.default.createElement("div",{className:"ant-upload-list-item-name"},S[r]?q.default.createElement(s.Input,{size:"small",autoFocus:!0,defaultValue:Mn(i),onBlur:t=>{const{value:l}=t.target;if(l!==Mn(i)){const t=Object.assign({},e,{name:`${l}.${$n(i)}`}),n=a.map((e=>e.uid!==r?e:t));null==v||v(t,n),null==b||b({file:t,fileList:n})}I(r,!1)}}):q.default.createElement("a",{rel:"noreferrer",target:"_blank",title:i,href:c,onClick:e=>{e.preventDefault(),d?T||I(r,!0):t.preview()}},i)),q.default.createElement("span",{className:"ant-upload-list-item-card-actions"},d&&!T&&q.default.createElement("button",{type:"button",className:p,onClick:()=>I(r)},S[r]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),d&&q.default.createElement("button",{type:"button",className:J.default(p,"preview"),onClick:()=>t.preview()},q.default.createElement(g.EyeOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"download"),disabled:u,onClick:()=>t.download()},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{type:"button",className:J.default(p,"delete"),disabled:T,onClick:()=>t.remove()},q.default.createElement(g.DeleteOutlined,null))))))})(t,r)}),q.default.createElement("span",{className:"inner",ref:C},n.children||c&&a.length?n.children:q.default.createElement(s.Button,{type:null!==(t=f.type)&&void 0!==t?t:"default",icon:null!==(l=f.icon)&&void 0!==l?l:q.default.createElement(g.UploadOutlined,null),disabled:T},f.text||x("qm.upload.text")),i&&!!a.length&&q.default.createElement(s.Button,{disabled:u,style:{marginLeft:8},onClick:e=>Ye(void 0,void 0,void 0,(function*(){if(e.stopPropagation(),"function"==typeof i)yield i(a);else for(const e of a)yield k(e)}))},x("qm.upload.batchDownload"))))};qn.displayName="QmUploadFile";const jn=e=>{const t=Ne({icon:q.default.createElement(g.DownloadOutlined,null),withCredentials:!1},e),{$size:l}=Ze(t),{t:n}=Xe(),[a,r]=q.default.useState(!1),i=dt(t,["action","fileName","headers","withCredentials","params","beforeDownload","onSuccess","onError"]);return q.default.createElement(s.Button,je({},i,{size:l,loading:a,onClick:()=>Ye(void 0,void 0,void 0,(function*(){var e;r(!0);try{const{action:e,fileName:l,headers:a,params:r,beforeDownload:i=nt,onSuccess:o}=t,d=m.isString(e)?e:yield Ye(void 0,void 0,void 0,(function*(){const e=t.action;if(e.api)try{const t=yield e.api(e.params);if(200===t.code)return t.data}catch(e){}return""}));if(!d)return mt("Download","参数 `action` 有误!");if(!i(d))return;yield Hn(d,{fileName:l,headers:a,params:r}),yield at(100),null==o||o(),s.message.success(n("qm.download.success"))}catch(l){null===(e=t.onError)||void 0===e||e.call(t,l),s.message.error(n("qm.download.error"))}r(!1)}))}),t.children||n("qm.download.text"))};function Kn(e,t){const l=$.useRef(null),n=$.useRef(0);$.useEffect((()=>()=>{clearTimeout(l.current),l.current=null}),[]);return $.useCallback(((...l)=>{const a=Date.now();(!n.current||a-n.current>t)&&(e.apply(this,l),n.current=a)}),[e,t])}jn.displayName="QmDownload";const Vn=e=>{const{activeKey:t,labels:l,onTabClick:n}=e;return q.default.createElement(q.default.Fragment,null,l.map(((e,l)=>{const a={item:!0,actived:l===t};return q.default.createElement("div",{key:l,className:J.default(a),onClick:e=>n(l,e)},q.default.createElement("span",null,e))})))},zn=e=>{const{label:t,showDivider:l,className:n,style:a}=e,r={[yt("anchor-item")]:!0};return q.default.createElement("div",{className:J.default(r,n),style:a},l&&q.default.createElement(bt,{label:t,style:{marginBottom:10}}),e.children)};zn.displayName="AnchorItem";const Wn=q.default.forwardRef(((e,t)=>{const{labelList:l=[],defaultActiveIndex:n,labelWidth:a,tabPosition:r="left",onTabClick:i,className:o,style:s}=e,{$size:d}=Ze(e),u=q.default.useRef(null),c=q.default.useRef(),f=q.default.useRef("ready"),p=q.default.useRef(0),[m,h]=q.default.useState(n||0),g=q.default.useMemo((()=>!!(null==l?void 0:l.length)),[l]);q.default.useEffect((()=>{v();const e=ae.default(u.current,"scroll",x);return()=>{e.remove()}}),[]);const v=()=>{m>0&&(u.current.scrollTop=an(b(m),u.current))},y=e=>{const t=Math.abs(e),n=(g?l.map((e=>document.getElementById(e.id))):Array.from((null===(a=u.current)||void 0===a?void 0:a.children)||[])).map((e=>an(e,u.current)));var a;let r=-1;for(let e=0;e<n.length;e++){const l=n[e],a=n[e+1]||1e4;t>=l-1&&t<a&&(r=e)}return r},b=e=>g?document.getElementById(l[e].id):u.current.children[e],x=Kn((e=>{if("ready"!==f.current)return;const t=y(e.target.scrollTop);-1!==t&&h(t)}),60),E=e=>{const t=b(e);t&&(h(e),f.current="stop",c.current&&clearTimeout(c.current),re.default(t,{block:"start",behavior:"smooth",boundary:u.current}),c.current=setTimeout((()=>f.current="ready"),500))};q.default.useImperativeHandle(t,(()=>({SCROLL_TO_ITEM:e=>{e=(e=e<0?0:e)>p.current?p.current:e,E(e)}})));const C=yt("anchor"),w={[C]:!0,[`${C}-left`]:"left"===r,[`${C}-top`]:"top"===r,[`${C}--lg`]:"large"===d,[`${C}--sm`]:"small"===d},S=[];q.default.Children.map(e.children,(e=>{var t;et(e)&&!tt(e)&&"AnchorItem"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&S.push(e)}));const N=g?l.map((e=>e.label)):S.map((e=>e.props.label)),T=g?l.map((e=>e.id)):S.map(((e,t)=>e.props["data-id"]||t.toString()));return p.current=N.length,q.default.createElement("div",{className:J.default(w,o),style:s},q.default.createElement("div",{className:J.default("anchor-nav"),style:{width:a?ct(a):""}},q.default.createElement(Vn,{activeKey:m,labels:N,onTabClick:(e,t)=>{E(e),null==i||i({label:N[e],id:T[e]},t)}})),q.default.createElement("div",{ref:u,className:J.default("anchor-container")},g?e.children:S))}));Wn.displayName="QmAnchor",Wn.Item=zn;const Bn=e=>q.default.createElement(s.Tabs.TabPane,e,e.children);Bn.displayName="TabPane";const Un=e=>{const t=Ne({tabPosition:"top"},e),{items:l,tabPosition:n,tabBarGutter:a,className:r,authConfig:i}=t,{$size:o}=Ze(t),d=yt("tabs"),u={[d]:!0,[`${d}--lg`]:"large"===o,[`${d}--sm`]:"small"===o},c=Object.assign(Object.assign({},dt(t,["items","authConfig"])),{size:o,tabBarGutter:null!=a?a:["top","bottom"].includes(n)?30:0}),f=[];q.default.Children.map(t.children,(e=>{var t;et(e)&&!tt(e)&&"TabPane"===(null===(t=e.type)||void 0===t?void 0:t.displayName)&&f.push(e)}));const p=l?[...l]:f.map((({key:e,props:t})=>({key:e,label:t.tab,disabled:t.disabled,closable:t.closable,forceRender:t.forceRender,children:t.children})));if(i){const{fieldList:e=[]}=i||{};for(let t=0;t<p.length;t++){const l=p[t],n=e.find((e=>e.dataIndex===l.key)),{visible:a=1,disabled:r}=n||{};a?r&&(l.disabled=!0):(p.splice(t,1),t--)}}return q.default.createElement(s.Tabs,je({},c,{items:p,className:J.default(u,r)}))};Un.displayName="QmTabs",Un.TabPane=Bn;const Gn=q.default.forwardRef(((e,t)=>{var l;const n=Ne({width:"72%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,footer:null},e),{visible:a,open:r,className:i,loading:o,showHeader:d,showFullScreen:u,maskClosable:c,destroyOnClose:f,onClose:p,onClosed:h,onFullChange:v}=n,{global:y}=q.default.useContext(xe),{$size:b}=Ze(n),x=q.default.useRef(null),E=q.default.useRef(null),C=q.default.useRef(!1),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(!1);Ql((()=>{(null!=r?r:a)&&(!f&&C.current||m.isUndefined(o)&&T(!0))}),[null!=r?r:a]),Ql((()=>{E.current&&ln(E.current,w?{width:"100%"}:{width:ct(n.width||"72%")})}),[w]);const R=()=>{E.current=on(x.current,"ant-drawer-content-wrapper"),S(!w),null==v||v(!w)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>O(!0),STOP_LOADING:()=>O(!1)})));const k=yt("drawer"),L={[k]:!0,"no-header":!d,[`${k}--lg`]:"large"===b,[`${k}--sm`]:"small"===b};return q.default.createElement(s.Drawer,je({},dt(n,["visible","size","showFullScreen","loading","maskClosable","onClosed"]),{open:null!=r?r:a,maskClosable:null!==(l=null!=c?c:null==y?void 0:y.maskClosable)&&void 0!==l&&l,className:J.default(L,i),title:q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{ref:x,className:"text"},d&&n.title),u&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:R},q.default.createElement(w?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,afterOpenChange:e=>{e?(C.current=!0,m.isUndefined(o)&&setTimeout((()=>T(!1)),100)):(S(!1),null==h||h())},onClose:p}),n.children,(o||I||N)&&q.default.createElement(gn,{spinning:!0,className:J.default("spinning")}))}));Gn.displayName="QmDrawer";const Yn="10vh";var Xn;!function(e){e[e.large=48]="large",e[e.middle=44]="middle",e[e.small=40]="small",e[e.none=0]="none"}(Xn||(Xn={}));const Qn=q.default.forwardRef(((e,t)=>{var l;const n=Ne({width:"60%",showHeader:!0,showFullScreen:!0,destroyOnClose:!0,draggable:!0,footer:null,style:{top:Yn}},e),{visible:a,open:r,width:i,height:o,className:d,loading:u,draggable:c,showHeader:f,showFullScreen:p,maskClosable:h,destroyOnClose:v,bodyStyle:y,onFullChange:b,onClose:x,onClosed:E}=n,{global:C}=q.default.useContext(xe),{$size:w}=Ze(n),S=q.default.createRef(),N=q.default.useRef(!1),T=q.default.useMemo((()=>`calc(100vh - ${Yn} - ${Yn} - ${Xn[f?w:"none"]}px)`),[w,f]),[I,O]=q.default.useState(!1),[R,k]=q.default.useState(!1),[L,P]=q.default.useState(!1),[A,D]=q.default.useState(!0),[_,F]=q.default.useState({left:0,top:0,bottom:0,right:0}),[H,M]=q.default.useState();Ql((()=>{if(null!=r?r:a){if(!v&&N.current||m.isUndefined(u)&&k(!0),!v&&N.current)return;setTimeout((()=>{N.current=!0,m.isUndefined(u)&&k(!1)}),400)}}),[null!=r?r:a]),Ql((()=>{M(I?{x:0,y:0}:void 0)}),[I]);const $=e=>{const t=on(e.target,"ant-modal");if(!t)return;const l=t.querySelector(".ant-modal-body");I?(ln(t,{width:ct(i||"60%"),height:"auto",top:Yn}),ln(l,{height:o?ct(o):T,maxHeight:"auto"===o?T:""})):(ln(t,{width:"100%",height:"100%",top:0,maxWidth:"100%"}),ln(l,{height:`calc(100vh - ${Xn[f?w:"none"]}px)`,maxHeight:""})),O(!I),null==b||b(!I)};q.default.useImperativeHandle(t,(()=>({START_LOADING:()=>P(!0),STOP_LOADING:()=>P(!1)})));const j=yt("modal"),K={height:o?ct(o):T,maxHeight:"auto"===o?T:"",overflow:"auto"},V={[j]:!0,"no-header":!f,[`${j}--lg`]:"large"===w,[`${j}--sm`]:"small"===w};return q.default.createElement(s.Modal,je({},dt(n,["visible","loading","showFullScreen","maskClosable","onClose","onClosed"]),{open:null!=r?r:a,maskClosable:null!==(l=null!=h?h:null==C?void 0:C.maskClosable)&&void 0!==l&&l,className:J.default(V,d),title:q.default.createElement("div",{onMouseOver:()=>{A&&D(!1)},onMouseOut:()=>{D(!0)}},q.default.createElement("span",{className:"text"},f&&n.title),p&&q.default.createElement("button",{type:"button",className:"full-screen",onClick:$},q.default.createElement(I?g.FullscreenExitOutlined:g.FullscreenOutlined))),footer:null,bodyStyle:Object.assign({},K,y),onCancel:x,afterClose:()=>{null==E||E(),O(!1)},modalRender:e=>q.default.createElement(ie.default,{nodeRef:S,bounds:_,position:H,disabled:!c||A||I,onStart:(e,t)=>((e,t)=>{const{clientWidth:l,clientHeight:n}=window.document.documentElement,a=S.current.getBoundingClientRect();a&&F({left:-a.left+t.x,right:l-(a.right-t.x)-1,top:-a.top+t.y,bottom:n-(a.bottom-t.y)-1})})(0,t)},q.default.createElement("div",{ref:S},e))}),n.children,(u||L||R)&&q.default.createElement(gn,{spinning:!0,className:J.default("spinning")}))}));Qn.displayName="QmModal";const Zn=e.createContext(void 0),Jn=["&&","||","AND","OR","and","or","like","likes","in","nin","LIKE","LIKES","IN","NIN"];var ea={operations:function(e){const t=e.split(" "),l=[];let n=0;l[n]=[];for(let e=0;e<t.length;e++)Jn.includes(t[e])?(l[n]=l[n].join(" "),n++,l[n]=[]):l[n].push(t[e]);return l[n]=l[n].join(" "),l},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 l=0,n=(e=Array.isArray(e)?e:[e]).length;l<n;l++)t+="number"==typeof e[l]?e[l]:"'"+e[l]+"'",l<n-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,l){return e.split(t).join(l)},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 ta=["==","<",">","<=",">=","!=","like","likes","in","nin"];var la=function(e){let t=0;const l=e.length;for(let n=0;n<l;n++){const l=e.charAt(n);"("===l&&t++,")"===l&&t--}return 0===t},na=function(e,t){let l="";for(let t=0;t<e.length;t++)"("==e[t]||")"==e[t]?l+=" "+e[t]+" ":l+=e[t];const n=l.split(" ").filter((e=>""!==e));for(let e=0;e<n.length;e++)ta.includes(n[e])&&("this"!=n[e-1]?n[e-1]=t+"."+n[e-1]:n[e-1]=t),ta.includes(n[e])&&(n.splice(e-1,3,`__query__(${n[e-1]}, '${n[e]}', ${n[e+1]})`),e-=2);return e=n.join(" ")};const aa=/(\^|\.|\[|\]|\$|\(|\)|\||\*|\+|\?|\{|\}|\\)/g,ra=["string","number","boolean","symbol"],ia=e=>ra.includes(typeof e),oa=e=>"string"==typeof e&&/^\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}:\d{2})?$/.test(e),sa=e=>new RegExp(e.replace(/├/g,"(").replace(/┤/g,")").replace(/\^/g," ").toString().replace(aa,"\\$1"),"i");window.__query__=(...e)=>((e,t,l)=>{e=null!=e?e:"";let n=!0;switch(t){case"like":n=null!==e.toString().match(sa(l));break;case"likes":n=l.split(/,|,/).some((t=>null!==e.toString().match(sa(t))));break;case"in":ia(l)&&(l=[l]),Array.isArray(l)&&(n=Array.isArray(e)?l.every((t=>e.includes(t))):l.includes(e));break;case"nin":ia(l)&&(l=[l]),Array.isArray(l)&&(n=!(Array.isArray(e)?l.some((t=>e.includes(t))):l.includes(e)));break;case"!=":case"<>":n=(oa(e)?e.slice(0,10):e)!=l;break;case"<":n=(oa(e)?e.slice(0,10):e)<l;break;case"<=":n=(oa(e)?e.slice(0,10):e)<=l;break;case">":n=(oa(e)?e.slice(0,10):e)>l;break;case">=":n=(oa(e)?e.slice(0,10):e)>=l;break;default:n=(oa(e)?e.slice(0,10):e)==l}return n})(e[0],e[1],e[2]);const da=ea.stringify,ua=ea.array_format,ca=la,fa=(e,t,l)=>{let n=[];t=ea.replace_symbols(t);try{if(l){const l=new Function("record",`return ${na(t,"record")};`);n=Ga(e,(e=>l(e)))}else{const l=new Function("array","i",`return ${na(t,"array[i]")};`);for(let t=0,a=e.length;t<a;t++)l(e,t)&&n.push(e[t])}}catch(t){mt("Table","组件 `initialFilter` 参数有误!"),n=e}return n},pa=e=>{const t=[];return e.forEach((e=>{e.children?t.push(...pa(e.children)):t.push(e)})),t},ma=e=>e.filter((e=>(e.children&&(e.children=ma(e.children)),!e.hidden&&!e.noAuth))),ha=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...ha(e.children))})),t},ga=(e,t)=>e.map((e=>(e.children&&(e.children=ga(e.children,t)),null==t||t(e),e))),va=(e,t)=>{for(const l of e){if(l.dataIndex===t)return l;if(l.children){const e=va(l.children,t);if(e)return e}}return null},ya=e=>{const t=e.children;return t?t[0].children?ya(t[0]):t[0]:e},ba=e=>{const t=e.children;return t?t[t.length-1].children?ba(t[t.length-1]):t[t.length-1]:e},xa=(e,t)=>e.filter((e=>!t.includes(e.dataIndex))),Ea=(e,t)=>{for(const l of e){if(l.rowKey===t)return l;if(l.children){const e=Ea(l.children,t);if(e)return e}}return null},Ca=e=>{const t=[];return e.forEach((e=>{t.push(e),e.children&&t.push(...Ca(e.children))})),t},wa=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...wa(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(t(e))})),l},Sa=e=>{let t=1;const l=(e,n)=>{var a;if(n&&(e.level=n.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((n=>{e.fixed?n.fixed=e.fixed:delete n.fixed,l(n,e),t+=n.colSpan})),e.colSpan=t}else e.colSpan=null!==(a=e.colSpan)&&void 0!==a?a:1};e.forEach((e=>{e.level=1,l(e,null)}));const n=[];for(let e=0;e<t;e++)n.push([]);return ha(e).forEach((e=>{e.children?e.rowSpan=1:e.rowSpan=t-e.level+1,n[e.level-1].push(e)})),n},Na=e=>Object.assign(e,{__prevent__:!0}),Ta=e=>{delete e.__prevent__},Ia=(e,t,l={left:0,top:0})=>{if(e){const n=e.parentNode;if(l.top+=e.offsetTop,l.left+=e.offsetLeft,n&&n!==document.documentElement&&n!==document.body&&(l.top-=n.scrollTop,l.left-=n.scrollLeft),(!t||e!==t&&e.offsetParent!==t)&&e.offsetParent)return Ia(e.offsetParent,t,l)}return l},Oa=e=>"number"==typeof e?e:"string"==typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null,Ra=(e,t)=>m.transform(e,((e,l,n)=>{m.isEqual(l,t[n])||(e[n]=m.isPlainObject(l)&&m.isPlainObject(t[n])?Ra(l,t[n]):l)})),ka=(e,t)=>{var l;return null!==(l=m.get(e,t))&&void 0!==l?l:""},La=(e,t,l,n)=>{n>=0&&null!=l&&(l=Number(l).toFixed(n)),m.set(e,t,null!=l?l:"")},Pa=(e,t)=>{if(!t.includes("|"))return ka(e,t);const l=[];return t.split("|").forEach((t=>{t&&l.push(ka(e,t))})),l.every((e=>!e))?"":l.join(" | ")},Aa=e=>/^-?\d+(\.\d+)?$/.test(e.toString()),Da=e=>{const t=(e=e.toString()).split("."),l="-"===t[0].charAt(0)?"-":"";let n=l?t[0].slice(1):t[0],a="";for(;n.length>3;)a=`,${n.slice(-3)}${a}`,n=n.slice(0,n.length-3);return n&&(a=n+a),`${l}${a}${t[1]?`.${t[1]}`:""}`},_a=(e,t)=>{const l=e.toString();if(!Aa(l)||0===t)return e;const n=Number.parseFloat(l).toString(),a=n.indexOf(".");if(-1===a)return n+"."+"0".repeat(t);const r=Math.max(0,t-(n.length-a-1));return n+"0".repeat(r)},Fa=(e,t)=>e?j.default(e,t):null,Ha=(e,t)=>e?j.default(e).format(t):"",Ma=(e="")=>{let t=(new Date).getTime();return e+"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const l=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?l:3&l|8).toString(16)}))},$a=e=>{const t=[];if(q.default.isValidElement(e)){const{children:l}=e.props;q.default.Children.forEach(l,(e=>{t.push(...$a(e))}))}else t.push(e);return t},qa=e=>$a(e).join(""),ja=e=>e.filter((e=>!e._group)),Ka=(e,t=!1)=>{let l="";if(Array.isArray(e)){let n=0;for(let a=0,r=e.length;a<r;a++){const r=e[a];if(!r.fieldName)continue;const i=Array.isArray(r.condition)?ua(r.condition):da(r.condition,"^");l+=`${r.bracketLeft} ${t?`${r.fieldName}|${r.fieldType}`:r.fieldName} ${r.expression} ${i} ${r.bracketRight} ${r.logic} `,n=r.logic.length}l=l.slice(0,-1*n-2)}else{const n=5;for(const n in e){const[a,r]=n.includes("|")?n.split("|"):[n,""],i=e[n];for(const e in i){l+=`${t?`${a}|${r}`:a} ${e} ${Array.isArray(i[e])?ua(i[e]):da(i[e],"^")} and `}}l=l.slice(0,-1*n)}return l.replace(/\s+/g," ").trim()},Va=(e=[],t=[])=>{const l={};return e.forEach((e=>{const n=JSON.stringify((e=>{const l=[];return t.forEach((t=>l.push(ka(e,t)))),l})(e));l[n]=l[n]||[],l[n].push(e)})),Object.keys(l).map((e=>l[e]))},za=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].dataIndex===t)return[e[l]];if(Array.isArray(e[l].children)){const n=za(e[l].children,t);if(n)return[e[l],n].flat()}}},Wa=(e,t)=>{for(let l=0;l<e.length;l++){if(e[l].rowKey===t)return[t];if(Array.isArray(e[l].children)){const n=Wa(e[l].children,t);if(n)return[e[l].rowKey,n].flat()}}},Ba=(e,t)=>{for(const l of e){if(Array.isArray(l.children)){const e=Ba(l.children,t);if(e)return e}if(t(l))return l}return null},Ua=e=>{const t=[];for(let l=0;l<e.length;l++)Array.isArray(e[l].children)&&t.push(...Ua(e[l].children)),t.push(e[l].rowKey);return t},Ga=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Ga(e.children,t),t(e)||e.children&&e.children.length))),Ya=e=>e.map((e=>(delete e.chosen,delete e.selected,e))),Xa=(e,t,l=!1)=>{const n=new Set;return function e(t,a,r=1){if(n.has(t))return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);const i=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(let l=0;l<t.length;l++)if(!e(t[l],a[l],i))return!1;return!0}if(t&&a&&"object"==typeof t&&"object"==typeof a){const l=Object.keys(t);return l.length===Object.keys(a).length&&l.every((l=>e(t[l],a[l],i)))}return!1}(e,t)},Qa=e=>["","small","middle","large"].includes(e),Za=80,Ja="1",er="0",tr=400,lr=["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"],nr={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 ar,rr,ir;!function(e){e.date="date",e.datetime="date",e.exactdate="date",e.week="week",e.month="month",e.quarter="quarter",e.year="year"}(ar||(ar={})),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"}(rr||(rr={})),function(e){e.hour="HH",e["hour-minute"]="HH:mm",e["hour-minute-second"]="HH:mm:ss"}(ir||(ir={}));const or={items:se.default.arrayOf(se.default.shape({type:se.default.string.isRequired,fieldName:se.default.string.isRequired})),initialValues:se.default.object,initialExtras:se.default.object,layout:se.default.oneOf(["horizontal","vertical"]),size:(e,t,l)=>{if(!Qa(e[t]||""))return pt("Form","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},cols:se.default.number,className:se.default.string,style:se.default.object,compactMode:se.default.bool,labelWidth:se.default.oneOfType([se.default.number,se.default.string]),labelAlign:se.default.oneOf(["left","right"]),labelWrap:se.default.bool,formType:se.default.oneOf(["default","search","onlyShow"]),disabled:se.default.bool,uniqueKey:se.default.string,defaultRows:se.default.number,defaultExpand:se.default.bool,searchButtonCols:se.default.number,scrollToFirstError:se.default.bool,authConfig:se.default.object,isAutoFocus:se.default.bool,isCollapse:se.default.bool,isFieldsDefine:se.default.bool,isSearchBtn:se.default.bool,isSubmitBtn:se.default.bool,fieldsChange:se.default.func,onValuesChange:se.default.func,onFieldsChange:se.default.func,onFinish:se.default.func,onFinishFailed:se.default.func,onReset:se.default.func,onCollapse:se.default.func},sr={layout:"horizontal",labelWidth:Za,labelAlign:"right",formType:"default",initialValues:{},initialExtras:{},defaultRows:1,isAutoFocus:!0,isCollapse:!0,isSearchBtn:!0,onValuesChange:lt,onFieldsChange:lt,onFinish:lt,onFinishFailed:lt,onReset:lt,onCollapse:lt},dr=(e,t)=>{if(!e)return null;if(t===rr.week){const t=e.match(/^(\d{4})-(\d+)/);return t?j.default().year(Number(t[1])).week(Number(t[2])):null}if(t===rr.quarter){const t=e.match(/^(\d{4})-Q(\d)/);return t?j.default().year(Number(t[1])).quarter(Number(t[2])):null}return j.default(e,t)},ur=(e,t)=>e?j.default(e).format(t):"",cr=e=>""===e||null==e,fr=(e,t)=>{var l;if(!e)return"";if(!t.includes("|"))return e[t];const n=t.split("|");let a="";for(let t=0,r=n.length;t<r;t++){a+=(null!==(l=e[n[t].trim()])&&void 0!==l?l:"")+(t===r-1?"":" | ")}return a},pr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},mr=(e,t,l)=>{for(const n in l)if(Object.keys(t).includes(n)&&t[n]!==l[n])if(t[n].includes("|")){const a=t[n].split("|"),r=l[n].split("|");a.forEach(((t,l)=>e[t]=e[r[l]]))}else e[t[n]]=e[l[n]]},hr=(e,t,l)=>e.map((e=>{const n={value:e[t],text:e[l]};return e.disabled&&(n.disabled=!0),m.isUndefined(e.isLeaf)||(n.isLeaf=!!e.isLeaf),m.isUndefined(e.selectable)||(n.selectable=!!e.selectable),Array.isArray(e.children)&&(n.children=hr(e.children,t,l)),n})),gr=(e,t)=>{for(const l of e){if(l.value===t)return l;if(Array.isArray(l.children)){const e=gr(l.children,t);if(e)return e}}return null},vr=(e,t,l=0)=>{const n=[];return e.forEach((e=>{e.value==t.split(",")[l]&&n.push(e),Array.isArray(e.children)&&n.push(...vr(e.children,t,l+1))})),n},yr=e=>et(e)||"string"==typeof e,br=e=>et(e)?$a(e).join(""):null!=e?e:"",xr=(e,t,l,n)=>{var a;const r={};return r.filters=(null===(a=e.filters)||void 0===a?void 0:a.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})))||[],r.table={columns:e.columns||[],rowKey:e.valueName},r.fieldsDefine={valueKey:e.valueKey||e.valueName},r.fieldAliasMap={[n?"textKey":t]:e.displayName[0],[n?"valueKey":e.valueKey||e.valueName]:e.valueName},e.tableSetting&&(r.table.fetch={api:l(e.tableSetting.api),dataKey:e.tableSetting.dataKey}),e.echoSetting&&(r.echoRequest={fetchApi:l(e.echoSetting.api),formatter:t=>{var l;return Object.assign({},t,{[e.echoSetting.paramKey]:null!==(l=t.key)&&void 0!==l?l:t.keys})},dataKey:e.echoSetting.dataKey},e.echoSetting.displayKey&&(r.echoRequest.fieldAliasMap={[n?"textKey":t]:e.echoSetting.displayKey[0]})),e.treeSetting&&(r.tree={fetch:{api:l(e.treeSetting.api),dataKey:e.treeSetting.dataKey,valueKey:e.treeSetting.valueKey,textKey:e.treeSetting.textKey},tableParamsMap:()=>{var t;const l={};return null===(t=e.treeSetting.relativeTable)||void 0===t||t.forEach((e=>l[e.tableField]=e.treeField)),l}}),e.emmediateSetting&&(r.columns=e.emmediateSetting.columns,r.request={fetchApi:l(e.emmediateSetting.api),dataKey:e.emmediateSetting.dataKey}),r};var Er={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 Cr="阿",wr="鿿",Sr=1,Nr=2,Tr=3;let Ir,Or=null;function Rr(e){return e||null===Or?("object"==typeof Intl&&Intl.Collator?(Ir=new Intl.Collator(["zh-Hans-CN","zh-CN"]),Or=1===Intl.Collator.supportedLocalesOf(["zh-CN"]).length):Or=!1,Or):Or}function kr(e){const t=Er.UNIHANS,l=Er.PINYINS,n=Er.EXCEPTIONS,a={source:e};if(e in n)return a.type=Nr,a.target=n[e],a;let r,i=-1;if(e.charCodeAt(0)<256)return a.type=Sr,a.target=e,a;if(r=Ir.compare(e,Cr),r<0)return a.type=Tr,a.target=e,a;if(0===r)a.type=Nr,i=0;else{if(r=Ir.compare(e,wr),r>0)return a.type=Tr,a.target=e,a;0===r&&(a.type=Nr,i=t.length-1)}if(a.type=Nr,i<0){let l=0,n=t.length-1;for(;l<=n;){i=~~((l+n)/2);const a=t[i];if(r=Ir.compare(e,a),0===r)break;r>0?l=i+1:n=i-1}}return r<0&&i--,a.target=l[i],a.target||(a.type=Tr,a.target=a.source),a}function Lr(e){return"string"==typeof e&&Rr()?e.split("").map((e=>kr(e))):e}var Pr={isSupported:Rr,parse:Lr,patchDict:function(e){e&&("function"==typeof e&&(e=[e]),e.forEach&&e.forEach((e=>{"function"==typeof e&&e(Er)})))},genToken:kr,convertToPinyin:(e,t,l)=>Lr(e).map((e=>t&&e.type===Nr?e.target.toLowerCase():e.target)).join(l||"")};var Ar={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)}};Pr.isSupported()&&Ar.shouldPatch(Pr.genToken)&&Pr.patchDict(Ar);const Dr=e=>{const{value:t,bordered:l}=e;return q.default.createElement(s.Input,{value:t,title:t,bordered:l,readOnly:!0})};Dr.displayName="FormItemView";const{Option:_r}=s.Select,Fr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,multiple:a,loading:r,onChange:i,onValuesChange:o}=e,{t:d}=Xe(),{fieldName:u,options:c={},style:f={},placeholder:p=d("qm.form.selectPlaceholder"),bordered:m=!0,allowClear:h=!0,readOnly:g,disabled:v,onClear:y}=e.option,{itemList:b=[],filterable:x=!0,listHeight:E=tr,collapseTags:C,maxTagTextLength:w,dropdownStyle:S,openPyt:N=!0}=c,T=ot(b)?n: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())||""},O=e=>a?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return t.isOnlyShow?q.default.createElement(Dr,{value:O(l),bordered:m}):q.default.createElement(s.Select,je({value:l,mode:a?"multiple":void 0,popupClassName:`form-popper__${u}`,dropdownStyle:S,placeholder:p,style:f,loading:r,bordered:m,allowClear:h,disabled:v,showSearch:x,listHeight:E,maxTagCount:C?"responsive":void 0,maxTagTextLength:w},a?{title:O(l)}:null,{filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"",a=Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(N?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onChange:e=>{(e=>{null==i||i(e),o(e,O(e),T)})(e)},onClear:y}),T.map((e=>q.default.createElement(_r,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class Hr extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l){this.setState({loading:!0});try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=l.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:d={},labelWidth:u=e.props.labelWidth,className:c,extra:f,buttonAfter:p,validateTrigger:m,rules:h=[],onChange:g=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":ct(u)},required:e.getFormItemRequired(h)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:i,noStyle:!0,rules:h,validateTrigger:m,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(Fr,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{g(t,l,n),e.setViewValue(i,l)}}))),p&&q.default.createElement(s.Col,null,e.renderFormItemButton(i,p)),f&&q.default.createElement(s.Col,{flex:ct(f.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}Hr.contextType=Zn;const Mr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:d,disabled:u=t.isFormDisabled}=e.option,{labelToCheckbox:c,falseValue:f=er,trueValue:p=Ja}=i,{t:m}=Xe(),h=e=>m(e===p?"am.form.trueText":"am.form.falseText");return q.default.createElement(s.Checkbox,{checked:l===p,style:o,disabled:u||t.isOnlyShow,onChange:e=>{const{checked:t}=e.target;(e=>{null==n||n(e),a(e,h(e))})(t?p:f)}},c?r:null)};class $r extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option,{labelToCheckbox:m}=i;return q.default.createElement(s.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Mr,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}$r.contextType=Zn;const qr=e=>{const{uniqueKey:t,items:l,fieldsChange:n}=e,{global:a}=q.default.useContext(xe),{$$form:r}=q.default.useContext(Zn),{$size:i}=Ze(e),{t:o}=Xe(),d=q.default.useRef(null),[u,c]=q.default.useState(!1),f=q.default.useMemo((()=>t?`form_${t}`:""),[t]);q.default.useLayoutEffect((()=>{v()}),[]);const p=()=>{if(!f)return;const e=JSON.parse(localStorage.getItem(f));var t;if(e||(t=f,Ye(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.getComponentConfigApi;if(e)try{const l=yield e({key:t});if(200===l.code)return l.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(f,JSON.stringify(e)),v()):(null==a?void 0:a.getComponentConfigApi)&&h(l)})).catch((()=>{})),!e)return;return m.xor(e.map((e=>e.fieldName)),l.map((e=>e.fieldName))).length>0?l.map((t=>{const{fieldName:l}=t,n=e.find((e=>e.fieldName===l));return n?(m.isUndefined(n.hidden)||(t.hidden=n.hidden),t):t})):e.map((e=>{const t=l.find((t=>t.fieldName===e.fieldName));return Object.assign(Object.assign({},t),e)}))},h=e=>{if(!f)return;const t=e.map((e=>{const t={};return m.isUndefined(e.hidden)||(t.hidden=e.hidden),Object.assign({fieldName:e.fieldName},t)})),l=JSON.parse(localStorage.getItem(f));var n,r;m.isEqual(t,l)||(localStorage.setItem(f,JSON.stringify(t)),n=f,r=t,Ye(void 0,void 0,void 0,(function*(){const e=null==a?void 0:a.saveComponentConfigApi;if(e)try{yield e({[n]:r})}catch(e){}})))},v=()=>{const e=p();e&&y(e)},y=e=>{null==n||n([...e])},b=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","fields-list")},q.default.createElement("div",{className:"reset"},q.default.createElement(ht,{type:"text",size:"small",onClick:()=>(e=>{const t=e.map((e=>{const t=l.find((t=>t.fieldName===e.fieldName))||ut(e);return Object.assign(t,{hidden:e.hidden})}));y(t),h(t)})(r.getOriginItems())},o("qm.table.columnFilter.reset"))),q.default.createElement(T.ReactSortable,{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));if(m.isEqual(t,n))return;r.setExpandHandle(!0);const a=Ya(e);y(a),h(a)}},l.map((e=>{var t;return q.default.createElement("li",{key:e.fieldName,className:"item",style:e.noAuth?{display:"none"}:void 0},q.default.createElement(s.Checkbox,{disabled:(null===(t=e.rules)||void 0===t?void 0:t.findIndex((e=>e.required)))>-1,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,y(l),h(l)}}),q.default.createElement(g.HolderOutlined,{className:"handle",title:o("qm.form.draggable")}),q.default.createElement("span",{className:"title"},r.getFormItemLabel(e.label)))})))),x=yt("form-fields-filter"),E={[x]:!0,[`${x}--lg`]:"large"===i,[`${x}--sm`]:"small"===i};return q.default.createElement(s.Dropdown,{open:u,trigger:["click"],dropdownRender:()=>b(),overlayClassName:J.default(E),placement:"bottomRight",overlayStyle:{minWidth:160},getPopupContainer:()=>d.current,onOpenChange:e=>{c(e)}},q.default.createElement("a",{ref:d,style:{padding:"5px 0"}},q.default.createElement(g.UnorderedListOutlined,null)))};qr.displayName="FieldsFilter";const jr=q.default.forwardRef(((e,t)=>{const{$$form:l}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{t:i}=Xe(),{options:o={},style:d={},placeholder:u=i("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h,onFocus:g,onBlur:v,onEnter:y,onClear:b}=e.option,{prefix:x,suffix:E,password:C,maxLength:w,pattern:S,toUpper:N,toTrim:T,autoFocus:I,autoComplete:O,secretType:R}=o,k=R&&(p||h),L=q.default.useRef(),P=q.default.useRef(!1);q.default.useEffect((()=>{var e;const t=()=>null==b?void 0:b(),l=null===(e=L.current)||void 0===e?void 0:e.input.parentNode.querySelector("span[class*='clear-icon']");return f&&l&&l.addEventListener("click",t),()=>{null==l||l.removeEventListener("click",t)}}),[]);const A=e=>{null==a||a(e),r(e)},D=C?s.Input.Password:s.Input,_=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))(n,R):n;return l.isOnlyShow?q.default.createElement(Dr,{value:(e=>e&&C?new Array(e.length).fill("*").join(""):e)(_),bordered:c}):q.default.createElement(D,{ref:e=>{L.current=e,"function"==typeof t&&t(e)},value:_,autoComplete:C?"new-password":O,autoFocus:I,placeholder:u,style:d,title:C?"":_,prefix:x,suffix:E,maxLength:w,bordered:c,allowClear:f,readOnly:p,disabled:h,onFocus:e=>{null==g||g(e.target.value,e)},onBlur:t=>{var l;let n=null!==(l=t.target.value)&&void 0!==l?l:"";if(T){const e=n.trim();n!==e&&(n=e,A(n))}(t=>{const{onBlur:l}=e;null==l||l(t)})(n),null==v||v(n,t)},onKeyUp:e=>{var t;if(13===e.keyCode){const{value:n}=e.target;null==y||y(n,e),l.isFilterType&&(l.SUBMIT_FORM(),null===(t=L.current)||void 0===t||t.blur())}},onCompositionStart:()=>{P.current=!0},onCompositionEnd:()=>{P.current=!1},onChange:e=>{let t=e.target.value;m.isRegExp(S)&&(t=S.test(t)?t:null!=n?n:""),N&&!P.current&&(t=t.toUpperCase()),A(t)}})}));jr.displayName="VInput";class Kr extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(jr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:t=>{m(t),e.setViewValue(a,t)}}))),c&&q.default.createElement(s.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Kr.contextType=Zn;const Vr=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{prefix:p,suffix:m,maxLength:h}=i,g=e=>{const t=e.every((e=>!e))?[]:e;null==n||n(t),a(t,v(t))},v=e=>e.join(" - ");return t.isOnlyShow?q.default.createElement(Dr,{value:v(l),bordered:d}):q.default.createElement(s.Input.Group,null,q.default.createElement(s.Input,{value:l[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:o[0],prefix:p,suffix:m,maxLength:h,allowClear:u,bordered:d,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([t,l[1]])}}),q.default.createElement(s.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:f,readOnly:!0}),q.default.createElement(s.Input,{value:l[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:o[1],prefix:p,suffix:m,maxLength:h,bordered:d,allowClear:u,readOnly:c,disabled:f,onChange:e=>{const{value:t}=e.target;g([l[0],t])}}))};class zr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:d,validateTrigger:u,rules:c=[],onChange:f=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(i)},required:e.getFormItemRequired(c)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Vr,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),d&&q.default.createElement(s.Col,{flex:ct(d.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}zr.contextType=Zn;const Wr=q.default.forwardRef(((e,t)=>{const{$$form:l}=q.default.useContext(Zn),{value:n,onChange:a,onValuesChange:r}=e,{t:i}=Xe(),{options:o={},style:d={},placeholder:u=i("qm.form.inputPlaceholder"),bordered:c=!0,readOnly:f,disabled:p,onFocus:h,onBlur:g,onEnter:v}=e.option,{step:y=1,min:b,max:x,precision:E,autoFocus:C,stringMode:w,textAlign:S="left",controls:N=!0,formatter:T,parser:I}=o,O=q.default.useRef(),R=q.default.useRef(n),k=e=>{const t=cr(e)?"":m.isNumber(e)?e.toFixed(E):new ue.default(e).toFixed(E);return"function"==typeof T?T(t):t},L={[S]:!0,controls:N};return l.isOnlyShow?q.default.createElement(Dr,{value:k(n),bordered:c}):q.default.createElement(s.InputNumber,{ref:e=>{O.current=e,"function"==typeof t&&t(e)},value:n,className:J.default(L),placeholder:u,style:Object.assign({width:"100%"},d),step:y,min:b,max:x,controls:N,precision:E,autoFocus:C,stringMode:w,formatter:T,parser:I,bordered:c,readOnly:f,disabled:p,onFocus:e=>{null==h||h(e.target.value,e)},onBlur:t=>{rt((()=>{(t=>{const{onBlur:l}=e;null==l||l(t)})(R.current),null==g||g(R.current,t)}))},onKeyUp:e=>{var t;13===e.keyCode&&(null==v||v(n,e),l.isFilterType&&(l.SUBMIT_FORM(),null===(t=O.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==a||a(e),r(e,k(e))})(t)}})}));Wr.displayName="VInputNumber";class Br extends e.Component{constructor(){super(...arguments),this.focus=()=>{const{type:e}=this.props.option;this[e].focus()}}render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Wr,{ref:e=>this[t]=e,option:this.props.option,onValuesChange:(t,l)=>{m(t),e.setViewValue(a,l)}}))),c&&q.default.createElement(s.Col,null,e.renderFormItemButton(a,c)),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Br.contextType=Zn;const Ur=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l=[],onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{options:i={},placeholder:o=r("qm.form.rangeInputNumberPlaceholder"),bordered:d=!0,allowClear:u,readOnly:c,disabled:f}=e.option,{step:p=1,min:m=0,max:h,textAlign:g="left",controls:v=!0,precision:y,formatter:b,parser:x}=i,E=e=>{e.every((e=>null!==e))&&e[0]>e[1]&&(e[1]=e[0]),C(e)},C=e=>{const t=e.every((e=>null===e))?[]:[...e];null==n||n(t),a(t,w(t))},w=e=>cr(e)?"":e.map((e=>cr(e)?"":Number(e).toFixed(y))),S={[g]:!0,controls:v};return t.isOnlyShow?q.default.createElement(Dr,{value:w(l),bordered:d}):q.default.createElement(s.Input.Group,null,q.default.createElement(s.InputNumber,{value:l[0],className:J.default("site-input-left",S),style:{width:"calc(50% - 5px)",display:"table-cell",float:"left"},placeholder:o[0],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:d,readOnly:c,disabled:f,onChange:e=>{C([e,l[1]])},onBlur:()=>{E(l)}}),q.default.createElement(s.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:d,disabled:f,readOnly:!0}),q.default.createElement(s.InputNumber,{value:l[1],className:J.default("site-input-right",S),style:{width:"calc(50% - 5px)"},placeholder:o[1],step:p,min:m,max:h,controls:v,precision:y,formatter:b,parser:x,bordered:d,readOnly:c,disabled:f,onChange:e=>{C([l[0],e])},onBlur:()=>{E(l)}}))};class Gr extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,labelWidth:i=e.props.labelWidth,className:o,extra:d,validateTrigger:u,rules:c=[],onChange:f=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(o),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(i)},required:e.getFormItemRequired(c)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:c,validateTrigger:u,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ur,{option:this.props.option,onValuesChange:(t=[],l)=>{f(t),e.setViewValue(a,l)}}))),d&&q.default.createElement(s.Col,{flex:ct(d.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},d)))))}}var Yr;Gr.contextType=Zn,function(e){e[e.large=40]="large",e[e.middle=32]="middle",e[e.small=24]="small"}(Yr||(Yr={}));const Xr=e.createContext(void 0),Qr={dataIndex:se.default.string.isRequired,title:se.default.string.isRequired,description:se.default.string,colSpan:se.default.number,width:se.default.number,minWidth:se.default.number,fixed:se.default.oneOf(["left","right"]),align:se.default.oneOf(["left","center","right"]),theadAlign:se.default.oneOf(["left","center","right"]),printFixed:se.default.bool,hidden:se.default.bool,noAuth:se.default.bool,noFixed:se.default.bool,ellipsis:se.default.bool,className:se.default.string,theadClassName:se.default.string,children:se.default.array,sorter:se.default.oneOfType([se.default.bool,se.default.func]),filter:se.default.shape({type:se.default.oneOf(["text","textarea","checkbox","radio","number","date","tree"]).isRequired,items:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),style:se.default.object}),precision:se.default.number,displayPrecision:se.default.number,formatType:se.default.oneOf(["date","datetime","dateShortTime","finance","percent","secret-name","secret-phone","secret-IDnumber","secret-bankNumber"]),required:se.default.bool,canCopy:se.default.bool,editRender:se.default.func,dictItems:se.default.arrayOf(se.default.shape({text:se.default.string,value:se.default.oneOfType([se.default.string,se.default.number])})),summation:se.default.shape({sumBySelection:se.default.bool,displayWhenNotSelect:se.default.bool,dataKey:se.default.string,unit:se.default.string,render:se.default.func}),groupSummary:se.default.shape({dataKey:se.default.string,unit:se.default.string,render:se.default.func}),shouldCellUpdate:se.default.func,headRender:se.default.func,render:se.default.func};se.default.arrayOf(se.default.shape(Qr)).isRequired,se.default.func,se.default.array,se.default.oneOfType([se.default.string,se.default.func]).isRequired,se.default.number,se.default.bool,se.default.bool,se.default.shape({api:se.default.func.isRequired,params:se.default.object.isRequired,formatter:se.default.func,beforeFetch:se.default.func,afterFetch:se.default.func,stopToFirst:se.default.bool,dataKey:se.default.string,callback:se.default.func}),se.default.bool,se.default.bool,se.default.string,se.default.string,se.default.object,se.default.bool,se.default.bool,se.default.bool,se.default.oneOfType([se.default.object,se.default.func]),se.default.oneOfType([se.default.object,se.default.func]),se.default.array,se.default.func,se.default.bool,se.default.object,se.default.object,se.default.shape({type:se.default.oneOf(["checkbox","radio"]).isRequired,defaultSelectedRowKeys:se.default.array,selectedRowKeys:se.default.array,hideSelectAll:se.default.bool,checkStrictly:se.default.bool,filterable:se.default.bool,selectByClickRow:se.default.bool,selectFirstRowOnChange:se.default.bool,clearableAfterFetched:se.default.bool,selectAllOnCurrentPage:se.default.bool,fetchSelectedRows:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fetchAllRowKeys:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),disabled:se.default.func,onChange:se.default.func,onSelect:se.default.func,onSelectAll:se.default.func}),se.default.shape({currentRowKey:se.default.oneOfType([se.default.number,se.default.string]),disabled:se.default.func,onChange:se.default.func}),se.default.shape({virtual:se.default.bool,overscan:se.default.number,doubleXScrollbar:se.default.bool}),se.default.shape({expandIconColumn:se.default.string}),se.default.shape({defaultExpandAllRows:se.default.bool,defaultExpandedRowKeys:se.default.array,expandedRowKeys:se.default.array,hideExpandAll:se.default.bool,rowExpandable:se.default.func,expandedRowClassName:se.default.string,expandedRowRender:se.default.func,onExpand:se.default.func,onChange:se.default.func}),se.default.shape({cellMerge:se.default.bool,onCellMerge:se.default.func,onSelectChange:se.default.func}),se.default.shape({groupItems:se.default.arrayOf(se.default.shape({dataIndex:se.default.string.isRequired,titleIndex:se.default.string,color:se.default.string,backgroundColor:se.default.string})),fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),onChange:se.default.func}),se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.shape({current:se.default.number,pageSize:se.default.number,pageSizeOptions:se.default.array,showSizeChanger:se.default.bool,showQuickJumper:se.default.bool}),se.default.shape({fileName:se.default.string,fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object}),beforeExport:se.default.func,cellStyle:se.default.bool,hideIcon:se.default.bool}),se.default.shape({showLogo:se.default.bool}),se.default.shape({fetch:se.default.shape({api:se.default.func.isRequired,params:se.default.object,dataKey:se.default.string}),fieldList:se.default.arrayOf(se.default.object)}),se.default.shape({position:se.default.oneOf(["top","bottom"]),hideAlert:se.default.bool,hideClearButton:se.default.bool}),se.default.oneOf(["left","right"]),se.default.func,se.default.func,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.bool,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func,se.default.func;const Zr={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},Jr=10,ei="1",ti="0",li="YYYY-MM-DD",ni="YYYY-MM-DD HH:mm:ss",ai="YYYYMMDDHHmmss",ri={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 ii;!function(e){e.left="flex-start",e.right="flex-end"}(ii||(ii={}));const oi=Object.assign({},$).useId;let si=0;var di=oi?function(e){const t=oi();return e||t}:function(e){const[t]=$.useState(`qm_unique_${si}`);return $.useEffect((()=>{si+=1}),[]),e||t};let ui=[];const ci={_getInstance:function(e){var t;return null!==(t=ui.find((t=>t.id===e)))&&void 0!==t?t:null},getFocusInstance:function(){var e;return null!==(e=ui[0])&&void 0!==e?e:null},focus:function(e){const t=this._getInstance(e);t&&0!==ui.findIndex((e=>e===t))&&(this.deregister(e),ui=[t,...ui])},register:function(e,t){e&&t&&(null!==this._getInstance(e)&&this.deregister(e),ui=[{id:e,vm:t},...ui])},deregister:function(e){e&&(ui=ui.filter((t=>t.id!==e)))}};class fi{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 pi={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 mi(e){return void 0!==e}function hi(e,t){const{defaultValue:l,value:n,onChange:a,postState:r}=t||{},[i,o]=$.useState((()=>mi(n)?n:mi(l)?"function"==typeof l?l():l:"function"==typeof e?e():e)),s=mi(n)?n:i,d=r?r(s):s,u=Qe(a),[c,f]=$.useState([s]);Ie((()=>{const e=c[0];i!==e&&u(i,e)}),[c]),Ie((()=>{mi(n)||o(n)}),[n]);return[d,Qe((e=>{o(e),f([s])}))]}const gi=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=gi(t.children)),t})),vi=(e,t)=>{const{fetch:l,columns:n,border:a,rowSelection:r,summation:i,expandable:o,treeConfig:s,webPagination:d,scrollPagination:u,showSuperSearch:c,showFastSearch:f,showGroupSummary:p,showTableImport:m,showClipboard:h,showSelectCollection:g,showPivotGrid:v,footRender:y}=e,{tableRef:b,getRowKey:x,tableFullData:E,tableFlatData:C,updateMark:w,selectionKeys:S,sorter:N,filters:T,superFilters:I,pagination:O,mergedTdCells:R}=t,{selectionRows:k,summaries:L}=b.current,{expandIconColumn:P=""}=s||{},{t:A}=Xe(),D=e=>{const t=(e=>{const t=[],l=[],n=[];for(let a=0;a<e.length;a++){const r=e[a];"left"===r.fixed?t.push(r):"right"===r.fixed?l.push(r):n.push(r)}return[...t,...n,...l]})(gi(e)),l=(e=>{if(!e)return null;const{type:t}=e;return{dataIndex:pi.selectionColumn,title:"radio"===t?A("qm.table.config.selectionText"):"",width:pi.selectionColumnWidth,fixed:"left",type:t}})(r),n=(null==(a=o)?void 0:a.expandedRowRender)?{dataIndex:pi.expandableColumn,title:"",width:pi.selectionColumnWidth,fixed:"left",type:"expand"}:null;var a;return l&&t.unshift(l),n&&t.unshift(n),ma(t)},_=(e,t,l,n,a)=>{const r=`${t},${l}`;e.has(r)||e.set(r,{row:t,col:l,rowSpan:n,colSpan:a})},F=q.default.useMemo((()=>!!(null==l?void 0:l.api)),[null==l?void 0:l.api]),H=q.default.useMemo((()=>!F&&!!d),[F,d]),M=q.default.useMemo((()=>F&&!!u),[F,u]),$=q.default.useMemo((()=>(F||H)&&!M),[F,H,M]),j=q.default.useMemo((()=>D(n)),[n]),K=q.default.useMemo((()=>pa(j)),[j]),V=q.default.useMemo((()=>K.filter((e=>"function"==typeof e.editRender))),[K]),z=q.default.useMemo((()=>K.filter((e=>!!e.summation))),[K]),W=q.default.useMemo((()=>K.filter((e=>"left"===e.fixed))),[K]),B=q.default.useMemo((()=>K.filter((e=>"right"===e.fixed))),[K]),U=q.default.useMemo((()=>(e=>{const t=new Map;return e.forEach((e=>{const l=C.findIndex((t=>x(t,t.index)===e.rowKey)),n=K.findIndex((t=>t.dataIndex===e.dataIndex));if(!(l<0||n<0)){_(t,l,n,e.rowSpan,e.colSpan);for(let a=0;a<e.rowSpan;a++)for(let r=0;r<e.colSpan;r++)0===a&&0===r||_(t,l+a,n+r,0,0)}})),Array.from(t.values()).sort(((e,t)=>e.row-t.row||e.col-t.col))})(R)),[R,K,E]),G=q.default.useMemo((()=>{var e,t;const l=K.filter((e=>![pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(e.dataIndex)));return P&&l.some((e=>e.dataIndex===P))?P:null!==(t=null===(e=l[0])||void 0===e?void 0:e.dataIndex)&&void 0!==t?t:""}),[K,P]),Y=q.default.useMemo((()=>z.length>0),[z]),X=q.default.useMemo((()=>!!y||Y),[y,Y]),Q=q.default.useMemo((()=>Sa(j).length>1),[j]),Z=q.default.useMemo((()=>a||Q),[a,Q]),J=q.default.useMemo((()=>K.some((e=>e.sorter))),[K]),ee=q.default.useMemo((()=>K.some((e=>e.filter))),[K]),te=q.default.useMemo((()=>z.some((e=>!!e.summation.dataKey))),[z]),le=q.default.useMemo((()=>!F&&!!m),[F,m]),ne=q.default.useMemo((()=>!!h&&V.length>0),[h,V]),ae=q.default.useMemo((()=>!!g&&"checkbox"===(null==r?void 0:r.type)),[g,r]),re=q.default.useMemo((()=>!!c&&ee),[c,ee]),ie=q.default.useMemo((()=>!F&&!!f),[F,f]),oe=q.default.useMemo((()=>!F&&!!v),[F,v]),se=q.default.useMemo((()=>!!p&&K.some((e=>!!e.groupSummary))),[K]),de=q.default.useMemo((()=>{var e;return!!(null===(e=null==i?void 0:i.groupItems)||void 0===e?void 0:e.length)}),[i]),ce=q.default.useMemo((()=>!C.length),[C]),fe=q.default.useMemo((()=>(()=>{const e={};return z.forEach((t=>{const{dataIndex:l,precision:n,displayPrecision:a,summation:r}=t,{sumBySelection:i,displayWhenNotSelect:o,unit:s}=r,d=de?ja(b.current.tableFullData):b.current.tableFullData,u=!k.length&&!!o;let c=(!i||u?d:k).reduce(((e,t)=>{if(null==t?void 0:t[pi.summaryIgnore])return e;const n=ka(t,l);return Aa(n)?e.plus(n):e}),new ue.default(0));!Object.keys(L).includes(l)||i&&!u||(c=new ue.default(ka(L,l))),La(e,l,c.toNumber());let f=n>=0?c.toFixed(n):c.toString();a>=0&&""!==f&&(f=_a(f,a)),f=Da(f),La(e,`${l}_text`,s?`${f} ${s}`:f)})),[e]})()),[C,w,S,L]),pe=q.default.useMemo((()=>(e=>e.filter((e=>e.summation.dataKey)).map((e=>`sum|${e.dataIndex}`)).join(","))(z)),[z]),me=q.default.useMemo((()=>{var e;const t=(e=>{const t=[];return Object.keys(e).forEach((l=>{null!==e[l]&&t.push(`${l}|${e[l]}`)})),t.join(",")})(N),n=((e,t)=>{const l=[];if(Object.keys(e).length)for(const t in e){const[n,a]=t.split("|"),r=e[t];Object.keys(r).forEach((e=>{l.push({type:a,bracketLeft:"",fieldName:n,expression:e,value:r[e],bracketRight:"",logic:"and"})}))}return t.length&&t.forEach((e=>{l.push({type:e.fieldType,bracketLeft:e.bracketLeft,fieldName:e.fieldName,expression:e.expression,value:e.condition,bracketRight:e.bracketRight,logic:e.logic})})),l.length&&(l[l.length-1].logic=""),l})(T,I),a=t?{[pi.sorterFieldName]:t}:null,r=n.length?{[pi.filterFieldName]:n}:null,i=pe?{[pi.groupSummary.summaryFieldName]:pe,usedJH:1}:null,o=null!==(e=null==l?void 0:l.params)&&void 0!==e?e:null,s={[pi.currentPageName]:O.current,[pi.pageSizeName]:O.pageSize};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),r),i),o),s)}),[null==l?void 0:l.params,O.current,O.pageSize,N,T,I,pe]);return{isFetch:F,isWebPagination:H,isScrollPagination:M,showPagination:$,tableColumns:j,flattenColumns:K,editableColumns:V,summationColumns:z,leftFixedColumns:W,rightFixedColumns:B,derivedMergeCells:U,treeExpandIndex:G,showSummary:Y,showFooter:X,isHeadGroup:Q,bordered:Z,isHeadSorter:J,isHeadFilter:ee,isServiceSummation:te,isSelectCollection:ae,isTableImport:le,isTableClipboard:ne,isSuperSearch:re,isFastSearch:ie,isPivotGrid:oe,isGroupSummary:se,isGroupSubtotal:de,isTableEmpty:ce,summationRows:fe,fetchParams:me}},yi=(e,t)=>{const{rowKey:l,height:n,dataSource:a,summation:r,fetch:i,initialSorter:o,initialFilter:s,rowSelection:d,expandable:u,tableConfig:c,authConfig:f,ignorePageIndex:p,columnsChange:h,onChange:g,onDataChange:v,onDataLoad:y,onScrollEnd:b,onFetchError:x}=e,{getRowKey:E,tableRef:C,tableElementRef:w,tableBodyRef:S,$size:N,tableColumns:T,flattenColumns:I,tableFullData:O,pagination:R,layout:k,filters:L,sorter:P,superFilters:A,fetchParams:D,selectionKeys:_,rowExpandedKeys:F,highlightKey:H,summationColumns:M,isFetch:$,isWebPagination:j,isScrollPagination:K,isServiceSummation:V,isGroupSubtotal:z,doLayout:W,setTableFullData:B,setTableOriginData:U,setTableFlatData:G,setAllTableData:Y,setDeriveRowKeys:X,setPagination:Q,setPingRight:Z,setPingLeft:J,setSpinning:ee,setSorter:te,setFilters:le,setSuperFilters:ne,setSelectionKeys:ae,setRowExpandedKeys:re,setHighlightKey:ie,setSelectionRows:oe,setScrollXLoad:se,setScrollYLoad:de,setFieldAuth:ue,setResizeState:ce,setSummaries:fe,setPermission:pe,setRecordsMap:me,resetTableScroll:he,clearElementStore:ge,clearRecordsMap:ve}=t,{t:ye}=Xe(),{store:be}=C.current,xe=q.default.useRef(Object.assign({},D)),Ee=q.default.useRef(!1),Ce=Cn(w);Ie((()=>{Re(),W()}),[T]),Ie((()=>{we()}),[Ce.width,Ce.height,N,n,k.tableAutoHeight]),Ql((()=>{st(),ut(),ct(),$||(j&&Je(),ze(a)),o&&te(o),s&&le(s)}),[a,null==i?void 0:i.params]),Ql((()=>{const e=$e(D,xe.current);e||$&&(null==d?void 0:d.clearableAfterFetched)&&ft(),!e&&D[pi.currentPageName]>1&&!(null==i?void 0:i.stopToFirst)?Je():$&&Ke(),xe.current=D}),[D]),Ql((()=>{j&<(),K||he(),Fe()}),[R.current,R.pageSize]),Ql((()=>{$||Ne(O.length),W()}),[O]),Ql((()=>{C.current.isTreeTable&<()}),[F]);const we=()=>{const{scrollBarRef:e,resizeState:t}=C.current,{width:l,height:n}=Ce;W(),k.tableBodyWidth>l&&Z(!0),e.current.scrollLeft>0&&J(!0),ce(Object.assign({},t,{width:l,height:n}))},Se=()=>{H&&S.current.setClickedValues([H,""]),"radio"===(null==d?void 0:d.type)&&_.length&&S.current.setClickedValues([_[0],""])},Ne=e=>{e!==R.total&&Q((t=>Object.assign({},t,{total:e})))},Te=e=>{Ee.current=e},Oe=wn((e=>{Ue(),null==b||b(e)})),Re=()=>{se(I.length>pi.virtualScrollX)},ke=(e=[])=>{let t=e.length>pi.virtualScrollY;C.current.isTreeTable&&(t=!0),(null==c?void 0:c.virtual)&&(t=!0),de(t)},Le=e=>z?Pe(Ae(e,0)):e,Pe=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Pe(e.children)),delete e.children,t.push(e)})),t},Ae=(e,t)=>{var n;const a=null===(n=r.groupItems)||void 0===n?void 0:n[t];if(!a)return e.forEach(((t,l)=>{t._rowSpan=0===l?e.length:0,t._colSpan=1})),e;return Va(e,[a.dataIndex]).map((e=>{const n={children:Ae(e,t+1),_group:a.dataIndex};return"function"!=typeof l&&La(n,l.toString(),Ma()),a.titleIndex&&La(n,a.titleIndex,ka(e[0],a.titleIndex)),La(n,a.dataIndex,ka(e[0],a.dataIndex)),M.forEach((e=>{var t;const{dataIndex:l}=e,a=null===(t=n.children)||void 0===t?void 0:t.reduce(((e,t)=>{if(t[pi.summaryIgnore])return e;const n=Number(ka(t,l));return Number.isNaN(n)?e:e+n}),0);La(n,l,a)})),n}))},De=e=>{ae(e),oe((e=>{const{selectionRows:t,recordsMap:l}=C.current,n=new Map;t.forEach((e=>n.set(E(e,e.index),e)));const a=[];for(let t=0,r=e.length;t<r;t++){const r=n.get(e[t])||l.get(e[t]);r&&a.push(r)}return a})(e))},_e=e=>{const{type:t,checkStrictly:l=!0}=d||{},n=Array.isArray(e)?e:_;let a=[];return C.current.isTreeTable&&!l&&n.forEach((e=>{a.push(...((e,t)=>{var l;const{disabled:n}=d||{},{deriveRowKeys:a,recordsMap:r}=C.current,i=Ea(a,e);let o=[];if(!i)return o;let s=Ua((null==i?void 0:i.children)||[]);return n&&(s=s.filter((e=>!r.has(e)||!n(r.get(e))))),o=[...new Set([...t,...s])],((null===(l=Wa(a,e))||void 0===l?void 0:l.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ea(a,e),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>o.includes(e.rowKey)));o=n?[...o,e]:o.filter((t=>t!==e))})),o})(e,n))})),a="radio"===t?n.slice(0,1):[...new Set([...n,...a])],a},Fe=wn((()=>{null==g||g(R,Me(L),He(P),A,{currentDataSource:tt()})})),He=e=>{const t={};for(const l in e)null!==e[l]&&(t[l]=e[l]);return t},Me=e=>{const t={};for(const l in e){if(!l.includes("|"))continue;const[n,a]=l.split("|");t[`${n}|${a}`]=e[l]}return t},$e=(e,t)=>{const l=Object.keys(Ra(e,t));return 1===l.length&&(l.includes(pi.currentPageName)||l.includes(pi.pageSizeName))},qe=()=>Ye(void 0,void 0,void 0,(function*(){var t;if(!f)return;let l=dt(f,["fetch"]);if(f.fetch){const{api:e,params:n,dataKey:a}=f.fetch;try{const r=yield e(n);200===r.code&&(l=null!==(t=a?m.get(r.data,a):r.data)&&void 0!==t?t:{})}catch(e){}}if(Object.keys(l).length){const{isExport:e=1,isImport:t=1,isPrint:n=1}=l;pe((l=>Object.assign({},l,{export:!!e,import:!!t,print:!!n})))}if(Array.isArray(l.fieldList)){const t=ga(e.columns,(e=>{const{dataIndex:t}=e,n=l.fieldList.find((e=>e.dataIndex===t));if(n){const{visible:l=1,disabled:a,secretName:r}=n,i=va(C.current.originColumns,t);ue(t,{visible:l,disabled:a,secretName:r}),l||(e.noAuth=!0,i.noAuth=!0),r&&(e.formatType=`secret-${r}`,i.formatType=`secret-${r}`)}}));null==h||h(t)}})),je=Qe((()=>Ye(void 0,void 0,void 0,(function*(){var e,t,l;if(!i)return;const{formatter:n=(e=>e),beforeFetch:a=nt,afterFetch:o,callback:s}=i;if(!a(D))return;const d=!!(null===(e=null==r?void 0:r.fetch)||void 0===e?void 0:e.api);ee(!0);try{const[e,a]=d?yield Promise.all([i.api(n(D)),r.fetch.api(n(D))]):[yield i.api(n(D))];if(C.current.unMounted)return;if(d?200===e.code&&200===a.code:200===e.code){const n=null!==(t=i.dataKey)&&void 0!==t?t:pi.dataKey;let r=null!==(l=m.get(e.data,n))&&void 0!==l?l:[];r="function"==typeof o?yield o(r):r;const d=m.get(e.data,n.replace(/[^.]+$/,pi.totalKey))||r.length||0,u=Math.max(Math.ceil(d/R.pageSize),1);if(D[pi.currentPageName]>u)return Ge(Object.assign(Object.assign({},R),{current:u}));ze(Ee.current?C.current.tableFullData.concat(r):r),Ne(d),We((null==a?void 0:a.data)||e.data),null==s||s(e.data,e)}}catch(e){null==x||x(e)}var u,c;u=i,c="stopToFirst",Object.prototype.hasOwnProperty.call(u,c)&&(i.stopToFirst=!1),ee(!1),Te(!1)})))),Ke=wn(je),Ve=e=>e.map(((e,t)=>(Array.isArray(e.children)&&(e.children=Ve(e.children)),e.index=t,p||(e.pageIndex=(e=>{const{current:t,pageSize:l}=R;return!$||K?e:(t-1)*l+e})(t)),e))),ze=e=>{const t=Le(Ve(e));at(t),rt(t),De(_e()),re((e=>{const{isTreeTable:t,allRowKeys:l,allParentRowKeys:n,deriveRowKeys:a,recordsMap:r}=C.current,{defaultExpandAllRows:i,rowExpandable:o,expandedRowRender:s}=u||{};let d=Array.isArray(e)?e:[...F];if(i)d=t?n:l;else if(t){s&&mt("Table","树结构表格不能再设置展开行的 `expandedRowRender` 参数");const e=[..._];H&&e.unshift(H),e.forEach((e=>{const t=Wa(a,e)||[];d.push(...t.length>1?t.slice(0,-1).reverse():t)})),d=[...new Set(d)]}return o&&d.filter((e=>{const t=r.get(e);return!!t&&o(t)})),d})()),Be(),null==y||y(t)},We=e=>{var t,l,n;if(!V)return;const a=null!==(l=null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.dataKey)&&void 0!==l?l:pi.summationKey,i=null!==(n=a?m.get(e,a):e)&&void 0!==n?n:{},o={};M.filter((e=>!!e.summation.dataKey)).forEach((e=>{La(o,e.dataIndex,Number(ka(i,e.summation.dataKey)))})),fe(o)},Be=()=>{const{type:e,selectFirstRowOnChange:t}=d||{};if("radio"===e&&t){const e=tt();if(e.length){const t=E(e[0],e[0].index);De([t])}else De([])}},Ue=()=>{if(!K)return;const e=Ze();Ee.current||R.current>=e||(Te(!0),Ge(Object.assign(Object.assign({},R),{current:R.current+1})))},Ge=({current:e,pageSize:t})=>{Q((l=>Object.assign({},l,{current:e,pageSize:t})))},Ze=()=>{const{pageSize:e,total:t}=R;return Math.ceil(t/e)||1},Je=()=>{Ge(Object.assign({},R,{current:1}))},et=()=>{const{current:e,pageSize:t}=R;return C.current.tableFullData.slice((e-1)*t,e*t)},tt=()=>j?et():C.current.tableFullData,lt=()=>{const{allTableData:e,isTreeTable:t}=C.current,l=j?Ca(et()):e,n=t?(e=>{const t=new Map,l=[];return e.forEach((e=>{const n=E(e,e.index);if(!e._parentRowKey)return l.push(e),t.set(n,!0);F.includes(e._parentRowKey)&&t.get(e._parentRowKey)&&(l.push(e),t.set(n,!0))})),t.clear(),l})(l):l;ke(n),G(n)},at=e=>{B(e),Y(e),X(e),it(),lt()},rt=e=>{U(e)},it=()=>{ve(),C.current.allTableData.forEach((e=>me(E(e,e.index),e)))},st=()=>{te({})},ut=()=>{le({})},ct=()=>{ne([])},ft=()=>{De([])};return{initialTable:()=>{qe(),Se(),Re(),ke(),$?je():ze(a)},checkDataIndex:()=>{const e=I.map((e=>e.dataIndex));[...new Set(e)].length!==e.length&&mt("Table","配置项 dataIndex 属性是唯一的,不能重复")},createTableFullData:at,getTableData:je,createTableList:tt,createTableData:ze,createGroupData:Le,setSelectionKeysEffect:De,doFieldValidate:(e,t,l,n,a)=>{if(!Array.isArray(e))return mt("Table","可编辑单元格的校验规则 `rules` 配置不正确");e.length&&(be.removeFromRequired({x:l,y:n}),be.removeFromValidate({x:l,y:n}),e.forEach((e=>{var r;e.required&&ot(t)&&be.addToRequired({x:l,y:n,text:e.message||a+ye("qm.form.requiredTips")}),"function"!=typeof e.validator||(null===(r=e.validator)||void 0===r?void 0:r.call(e,t))||be.addToValidate({x:l,y:n,text:e.message})})))},getTableLog:()=>{const{required:e,validate:t,inserted:l,updated:n,removed:a}=be.state,r=m.intersection(l,a),i=e=>e.map((e=>({rowKey:e.x,dataIndex:e.y,text:e.text})));return{required:i(e),validate:i(t),inserted:l.filter((e=>!r.includes(e))),updated:n.filter((e=>![...m.intersection(n,l),...m.intersection(n,a)].includes(e))),removed:a.filter((e=>!r.includes(e)))}},dataChange:()=>{null==v||v(C.current.tableFullData)},tableChange:Fe,toLastPage:()=>{const e=Ze();R.current!==e&&Ge(Object.assign({},R,{current:e}))},toFirstPage:Je,getPageCount:Ze,pagerChangeHandle:Ge,scrollBottomDebouncer:Oe,clearTableSorter:st,clearTableFilter:ut,clearSuperFilters:ct,clearRowSelection:ft,clearRowHighlight:()=>{ie("")},clearTableLog:()=>{be.clearAllLog()},destroy:()=>{const{tableManager:e,uid:t}=C.current;ge(),be.destroy(),e.deregister(t)}}},bi=(e,t)=>{const{height:l,minHeight:n,maxHeight:a,ellipsis:r,showHeader:i,spanMethod:o}=e,{getRowKey:s,tableRef:d,topElementRef:u,tableElementRef:c,tableBodyRef:f,$size:p,tableColumns:h,flattenColumns:g,leftFixedColumns:v,derivedMergeCells:y,tableFlatData:b,layout:x,showFooter:E,showPagination:C,isFullScreen:w,setLayout:S,setElementStore:N}=t,T=q.default.useMemo((()=>{const{tableFullHeight:e,tableAutoHeight:t}=x,r={};return n&&Object.assign(r,{minHeight:`${Oa(n)}px`}),a&&Object.assign(r,{maxHeight:`${Oa(a)}px`}),w?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${e}px`}):l?Object.assign(Object.assign({},r),{height:"auto"!==l?`${Oa(l)}px`:`${t}px`}):r}),[l,a,n,w,x]),I=(e,t)=>{const{scrollBarRef:l,scrollYLoad:n,rowHeight:a}=d.current;if(void 0!==t&&t>=0)if(t<b.length)if(n)f.current.scrollToYIndex(t);else{const e=O(s(b[t],b[t].index));e&&l.current.SET_SCROLL_TOP(e.offsetTop)}else l.current.SET_SCROLL_TOP(t*a);else if(n){const t=b.findIndex((t=>e===s(t,t.index)));t>=0&&f.current.scrollToYIndex(t)}else{const t=O(e);t&&l.current.SET_SCROLL_TOP(t.offsetTop)}},O=e=>d.current.elementStore.$tableBody.querySelector(`tbody > tr[data-row-key="${e}"]`);return{createElementStore:()=>{N("$toper",u.current),N("$table",c.current)},tableStyles:T,getSpan:(e,t,l,n,a)=>{let r=1,i=1;if("function"==typeof o){const s=o({row:e,column:t,rowIndex:l,columnIndex:n,tableData:a});Array.isArray(s)?(r=s[0],i=s[1]):m.isPlainObject(s)&&(r=s.rowSpan,i=s.colSpan)}if(y.length>0){const e=y.find((e=>e.row===l&&e.col===n));e&&(r=e.rowSpan,i=e.colSpan)}return{rowSpan:r,colSpan:i}},getStickyLeft:e=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=va(h,e);e=t?ya(t).dataIndex:""}let t=0;for(let l=0;l<g.length;l++){const n=g[l];if(n.dataIndex===e)break;t+=n.width||n.renderWidth||0}return t},getStickyRight:(e,t)=>{if(g.findIndex((t=>t.dataIndex===e))<0){const t=va(h,e);e=t?ba(t).dataIndex:""}const l="thead"===t?(e=>{if(!e.some((e=>e.colSpan>0)))return e;const t=[];let l=[];return e.forEach((e=>{e.colSpan>0&&l.length>0&&(t.push(l),l=[]),l.push(e)})),l.length>0&&t.push(l),t.map((e=>{const[t,l]=e.reduce(((e,t)=>(t.colSpan>0?e[0].push(t):e[1].push(t),e)),[[],[]]);return[...l,...t.reverse()]})).flat()})(g):g;let n=0;for(let t=l.length-1;t>=0;t--){const a=l[t];if(a.dataIndex===e)break;n+=a.width||a.renderWidth||0}return n},scrollXToColumn:(e,t)=>{const l=void 0===t?g.findIndex((t=>t.dataIndex===e)):t;if(l<0)return;const{scrollBarRef:n}=d.current,a=v.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=g.slice(0,l).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);n.current.SET_SCROLL_LEFT(r-a)},scrollYToRecord:I,calcTableHeight:()=>{if("auto"!==l)return;const{elementStore:e,resizeState:t}=d.current;try{const l=t.winHeight-e.$table.getBoundingClientRect().top-(C?Yr["small"!==p?"middle":p]+Jr:0)-Jr;S((e=>Object.assign({},e,{tableAutoHeight:l})))}catch(e){}},resetTableScroll:()=>{I("",0)},doLayout:()=>{(()=>{const{elementStore:e,scrollXLoad:t}=d.current,l=e.$table.clientWidth,{defaultColumnWidth:n}=pi,a=[];let r=0;if(g.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,r+=e.width):(e.renderWidth=void 0,a.push(e))})),a.length>0){const e=g.reduce(((e,t)=>e+(t.width||t.minWidth||n)),0);if(e<=l){const t=l-e;if(1===a.length)a[0].renderWidth=(a[0].minWidth||n)+t;else{const e=t/a.reduce(((e,t)=>e+(t.minWidth||n)),0);let l=0;a.forEach(((t,a)=>{if(0===a)return;const r=Math.floor((t.minWidth||n)*e);l+=r,t.renderWidth=(t.minWidth||n)+r})),a[0].renderWidth=(a[0].minWidth||n)+t-l}}else a.forEach((e=>{e.renderWidth=e.minWidth||n}));S((t=>Object.assign(Object.assign({},t),{tableBodyWidth:Math.max(e,l)})))}else r=g.reduce(((e,t)=>e+(t.renderWidth=t.width||t.minWidth||n)),0),S((e=>Object.assign(Object.assign({},e),{tableBodyWidth:r})));S((e=>Object.assign(Object.assign({},e),{tableWidth:l}))),t&&f.current.resetItemXSize(g)})(),rt((()=>(()=>{const{elementStore:e,scrollYLoad:t,resizeState:l}=d.current;if(!e.$table.offsetParent)return;const n=e.$table.offsetHeight,a=i?e.$header.offsetHeight:x.headerHeight,r=E?e.$footer.offsetHeight:x.footerHeight,o=n-a-r,s=e.$tableBody.offsetHeight;let u=0;if(w){const t=e.$toper?e.$toper.offsetHeight+Jr:0,n=e.$pager?e.$pager.offsetHeight+Jr:0;u=l.winHeight-t-n-20}S((e=>Object.assign({},e,{headerHeight:a,footerHeight:r,viewportHeight:o,tableBodyHeight:s,tableFullHeight:u})))})()))}}};function xi({handler:e,delay:t=0}){const l=Kn(e,t),n=Qe(t>0?l:e);$.useEffect((()=>(window.addEventListener("resize",n),()=>window.removeEventListener("resize",n))),[n])}const Ei=e=>{const{total:t}=e,{tableRef:l,prefixCls:n,selectionKeys:a,isHeadSorter:r,isHeadFilter:i,clearTableSorter:o,clearTableFilter:s,clearSuperFilters:d,clearRowSelection:u,clearRowHighlight:c,setActivedCell:f}=q.default.useContext(Xr),{infoBarConfig:p,rowSelection:m,rowHighlight:h}=l.current.props,{allTableData:v,invalidRowKeys:y}=l.current,{hideAlert:b,hideClearButton:x}=p||{},{t:E}=Xe(),C=q.default.useMemo((()=>!b),[b]),w=q.default.useMemo((()=>!x&&!!(r||i||m||h)),[x,r,i,m,h]),S={[`${n}__alert`]:!0};return C?q.default.createElement("div",{className:J.default(S)},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.InfoCircleFilled,null)),q.default.createElement("span",null,E("qm.table.alert.total",{total:l.current.isTreeTable?v.length:t}),m?`,${E("qm.table.alert.selected",{total:Math.max(a.length-y.length,0)})}`:""),w&&q.default.createElement("em",{onClick:()=>{s(),d(),u(),c(),rt((()=>o())),f({})}},E("qm.table.alert.clear"))):null},Ci=q.default.forwardRef(((e,t)=>{const{isFullScreen:l,open:n=!0}=e,{prefixCls:a,setFullScreen:r}=q.default.useContext(Xr),{t:i}=Xe(),o=()=>{r(!l)};return q.default.useImperativeHandle(t,(()=>({clickHandle:o}))),n?q.default.createElement("span",{className:`${a}-full-screen`,title:i(l?"qm.table.screen.cancelFull":"qm.table.screen.full"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},l?q.default.createElement(g.FullscreenExitOutlined,null):q.default.createElement(g.FullscreenOutlined,null))):null}));Ci.displayName="FullScreen";const wi=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,getTableData:a}=q.default.useContext(Xr),{t:r}=Xe(),i=()=>{a()};return q.default.useImperativeHandle(t,(()=>({clickHandle:i}))),l?q.default.createElement("span",{className:`${n}-reload`,title:r("qm.table.refresh.text"),onClick:()=>i()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ReloadOutlined,null))):null}));wi.displayName="Reload";const Si=()=>{const e={dateFormat:e=>{const t=e?j.default(e).format(li):"";return t.startsWith("1900-01-01")?"":t},datetimeFormat:e=>{const t=e?j.default(e).format(ni):"";return t.startsWith("1900-01-01")?"":t},dateShortTimeFormat:e=>{const t=e?j.default(e).format(ni.slice(0,-3)):"";return t.startsWith("1900-01-01")?"":t},percentFormat:e=>Aa(e)?(100*Number(e)).toFixed(2)+"%":e,financeFormat:e=>Da(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,l,n)=>{var a,r,i,o;const{dictItems:s,precision:d,displayPrecision:u,formatType:c,editRender:f}=l,p=s||(null===(a=null==f?void 0:f(n,l))||void 0===a?void 0:a.items)||[];let m=null!==(o=null!==(i=null===(r=p.find((e=>e.value==t)))||void 0===r?void 0:r.text)&&void 0!==i?i:t)&&void 0!==o?o:"";if(Array.isArray(t)&&(m=t.map((e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value==e)))||void 0===t?void 0:t.text)&&void 0!==l?l:e})).join(",")),d>=0&&""!==m&&(m=Aa(m)?new ue.default(m).toFixed(d):m),u>=0&&""!==m&&(m=_a(m,u)),c){const t=e[`${it(c)}Format`];t?m=t(m):mt("Table","字段的格式化类型 `formatType` 配置不正确")}return m},l=e=>et(e)?$a(e).join(""):null!=e?e:"";return{renderText:t,getTitleFromCellNode:l,getTitleFromCellValue:(e,n,a,r)=>{const i=ka(e,n.dataIndex),o=n.render?n.render(i,e,n,a,r):t(i,n,e);return l(o)}}},Ni=q.default.forwardRef(((e,t)=>{var l,n,a,r;const{tableColumns:i,open:o=!0}=e,{global:s}=q.default.useContext(xe),{tableRef:d,prefixCls:u,flattenColumns:c,summationRows:f,showSummary:p,getSpan:h}=q.default.useContext(Xr),{tablePrint:v,showHeader:y}=d.current.props,{t:b}=Xe(),{getTitleFromCellValue:x}=Si(),E=null!==(n=null===(l=null==s?void 0:s.print)||void 0===l?void 0:l.leftLogo)&&void 0!==n?n:"",C=null!==(r=null===(a=null==s?void 0:s.print)||void 0===a?void 0:a.rightLogo)&&void 0!==r?r:"",w=!(!E&&!C),S=q.default.useMemo((()=>ut(xa(i,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn]))),[i]),N=q.default.useMemo((()=>ut(xa(c,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn]))),[c]),T=q.default.useMemo((()=>ut(i.filter((e=>e.printFixed)))),[i]),I=e=>{const t=Object.assign({},za(S,e.dataIndex).slice(0,-1).reverse()[0]);return t.children=[e],t.level&&t.level>1?I(t):t},O=(e,t)=>m.map(m.groupBy(m.flatten(e),t),m.spread(((...e)=>m.mergeWith(...e,((e,l)=>{if(Array.isArray(e))return O(e.concat(l),t)}))))),R=e=>{const t=[];return e.forEach((e=>{let l=[];e.forEach((e=>{1===e.level?l.push(e):l.push(I(e))})),l=(e=>[...new Set(e.map((e=>e.dataIndex)))].map((t=>{const l=e.filter((e=>e.dataIndex===t));return l.length<=1?l[0]:O(l,"dataIndex")[0]})))(l),t.push(Sa(l))})),t},k=()=>{const e=(e=>{const t=[];let l=[],n=0,a=0;for(;a<e.length;){const r=e[a];n+=r.width||r.renderWidth,n<=pi.printWidth?(l.push(r),a===e.length-1&&t.push(l),a++):a>0?(e.splice(0,a),T.length&&e.unshift(...T),t.push(l),l=[],n=0,a=0):(r.width=pi.printWidth,l.push(r),t.push(l),a++)}return t})([...N]),t=R(e);let l=["<!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 n=0;n<e.length;n++)l+=L(t[n],e[n],d.current.tableFullData),l+='<div class="page-break"></div>';return l+"</body></html>"},L=(e,t,l)=>{const{showLogo:n=!0}=v;let a='<table class="table--print" width="100%" border="0" cellspacing="0" cellpadding="0">';return a+=`<colgroup>${t.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,y&&(a+=["<thead>",n&&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">',E?`<img src="${E}" border="0" height="26" />`:"","</td>",'<td width="50%" align="right">',C?`<img src="${C}" border="0" height="38" />`:"","</td>","</tr>","</table>"].join("")}</th></tr>`:"",e.map((e=>`<tr>${e.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${qa(e.title)}</th>`})).join("")}</tr>`)).join(""),"</thead>"].join("")),l.length&&(a+=`<tbody>${Ca(l).map((e=>`<tr>${t.map(((t,n)=>{const{rowSpan:a,colSpan:r}=h(e,t,e.index,n,l);if(!a||!r)return null;return`<td rowspan="${a}" colspan="${r}">${0===n&&e._level?`<span style="padding-left:${e._level*pi.treeTable.textIndent}px"></span>`:""}${x(e,t,e.index,n)}</td>`})).join("")}</tr>`)).join("")}</tbody>`),p&&f.length&&(a+=["<tfoot>",f.map((e=>`<tr>${t.map(((t,n)=>{const{dataIndex:a,summation:r}=t,i=(null==r?void 0:r.render)?r.render(l):ka(e,`${a}_text`);return`<td>${0===n&&""===i?b("qm.table.config.summaryText"):et(i)?$a(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),a+="</table>",a},P=()=>{var e;null===(e=((e,t)=>{const{filename:l,type:n,isDownload:a}=e,r=`${l}.${n}`;if(window.Blob){const e=new Blob([t],{type:`text/${n}`});if(!a)return Promise.resolve({type:n,content:t,blob:e});Fn(e,r)}})({filename:"print",type:"html",isDownload:!1},k()))||void 0===e||e.then((({content:e,blob:t})=>{let l=document.createElement("iframe");l.setAttribute("frameborder","0"),l.setAttribute("width","100%"),l.setAttribute("height","0"),l.style.display="none",document.body.appendChild(l),d.current.isIE?(l.contentDocument.write(e),l.contentDocument.execCommand("print"),l.parentNode.removeChild(l),l=null):(l.onload=e=>{e.target.src&&e.target.contentWindow.print(),setTimeout((()=>{l.parentNode.removeChild(l),l=null}))},l.src=URL.createObjectURL(t))}))};return q.default.useImperativeHandle(t,(()=>({clickHandle:P}))),o?q.default.createElement("span",{className:`${u}-print`,title:b("qm.table.print.text"),onClick:()=>P()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PrinterOutlined,null))):null}));Ni.displayName="TablePrint";const Ti="606060",Ii="thin",Oi="d4d4d4",Ri=(e,t)=>{t&&(e.height=Math.floor(.75*t))},ki=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Li=()=>({top:{style:Ii,color:{argb:Oi}},left:{style:Ii,color:{argb:Oi}},bottom:{style:Ii,color:{argb:Oi}},right:{style:Ii,color:{argb:Oi}}}),Pi=e=>{const{children:t}=e;return t&&t.length?Pi(t[0]):e},Ai=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},Di=()=>{const{tableRef:e,getSpan:t,showSummary:l,isHeadGroup:n}=q.default.useContext(Xr),{spanMethod:a,showHeader:r}=e.current.props,{t:i}=Xe(),o=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(o,s,d,u)=>Ye(void 0,void 0,void 0,(function*(){const{columns:c,footSummation:f}=o,{rowHeight:p}=e.current,m=pa(c),h=Sa(c),g=[],v=[],y=[],b=[];let x=0;const E={};m.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;E[t]=qa(e.title),y.push({key:t,width:(l||n||pi.defaultColumnWidth)/8})})),r&&(n?h.forEach(((e,t)=>{const l={};e.forEach((e=>{const{colSpan:n,rowSpan:a}=e,r=Pi(e),i=m.findIndex((({dataIndex:e})=>e===r.dataIndex));l[r.dataIndex]=qa(e.title),0!==n&&(n>1||a>1)&&b.push({s:{r:t,c:i},e:{r:t+a-1,c:i+n-1}})})),g.push(l)})):(m.forEach(((e,t)=>{const{colSpan:l,rowSpan:n}=e;(l>1||n>1)&&b.push({s:{r:x,c:t},e:{r:x+n-1,c:t+l-1}})})),g.push(E)),x+=g.length);const C=Ca(s).map(((e,l)=>{const n={};return m.forEach(((r,i)=>{if("function"==typeof a){const{rowSpan:n,colSpan:a}=t(e,r,l,i,s);(a>1||n>1)&&b.push({s:{r:l+x,c:i},e:{r:l+x+n-1,c:i+a-1}})}const o=["percent","finance"].includes(r.formatType);n[r.dataIndex]=o?ka(e,r.dataIndex):u(e,l,r,i)})),n._level=e._level,n}));x+=C.length,l&&f&&d(m,s).forEach(((e,t)=>{const l={};m.forEach(((t,n)=>{const{dataIndex:a,summation:r}=t,o=(null==r?void 0:r.render)?r.render(s):ka(e,a);l[a]=0===n&&""===o?i("qm.table.config.summaryText"):et(o)?$a(o).join(""):o})),v.push(l)}));const{sheetName:w,useStyle:S}=o,N=new ce.default.Workbook,T=N.addWorksheet(w);T.columns=y,r&&T.addRows(g).forEach((e=>{S&&Ri(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),l=va(c,t.key),{align:n,theadAlign:a}=l;ki(e,a||n),S&&Object.assign(e,{font:{bold:!0,color:{argb:Ti}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Li()})}))})),T.addRows(C).forEach(((e,t)=>{const{_level:l}=C[t];S&&Ri(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),n=va(c,t.key),{align:a}=n;ki(e,a),Object.assign(e,Ai(n)),S&&Object.assign(e,{font:{color:{argb:Ti}},border:Li()}),1===Number(e.col)&&l&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:l}))}))})),l&&f&&T.addRows(v).forEach((e=>{S&&Ri(e,p),e.eachCell((e=>{const t=T.getColumn(e.col),l=va(c,t.key),{align:n}=l;ki(e,n),Object.assign(e,Ai(l)),S&&Object.assign(e,{font:{color:{argb:Ti}},border:Li()})}))})),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 l="\ufeff"+(e=>Array.from(e.rows).map((e=>Array.from(e.cells).map((e=>{var t,l;return((e,t)=>{const l=e.replace(/"/g,'""');return"string"===t?`"=""${l}"""`:"number"===t?l:l.includes(",")||l.includes("\r")||l.includes("\n")?`"${l}"`:l})(null!==(l=null===(t=e.textContent)||void 0===t?void 0:t.trim())&&void 0!==l?l:"",e.getAttribute("data-type"))})).join(","))).join("\r\n"))((e=>{const t=document.createElement("div");t.innerHTML=e.trim();const l=t.querySelector("table");if(!l)throw new Error("Invalid table HTML input.");return l})(t));return new Blob([l],{type:"text/csv;charset=utf-8"})},importXLSX:(e,t)=>{const{columns:l,file:n}=e,a=pa(l),r=new FileReader;r.onerror=()=>{s.message.error(i("qm.table.import.error"))},r.onload=e=>{const l=a.map((e=>qa(e.title))),n=new ce.default.Workbook,r=e.target;r?n.xlsx.load(r.result).then((e=>{const n=e.worksheets[0];if(n){const e=n.getSheetValues(),r=e.findIndex((e=>e&&e.length>0)),d=e[r],u=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(l,d);if(u){const n=e.slice(r+1).map((e=>{const t={};e.forEach(((e,l)=>{var n;let a=e;Array.isArray(null==a?void 0:a.richText)&&(a=a.richText.map((e=>e.text)).join("")),m.isPlainObject(a)&&"text"in a&&(a=a.text),m.isDate(a)&&(a=Ha(a,ni)),(null==a?void 0:a.formula)&&(a=null!==(n=a.result)&&void 0!==n?n:a.value),t[d[l]]=a}));const n={};return l.forEach(((e,l)=>{var r;const{dataIndex:i,dictItems:s}=a[l];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>o(s,e))).filter((e=>""!==e)):t[e]=o(s,t[e])),La(n,i,t[e])})),n}));null==t||t(n)}else s.message.error(i("qm.table.import.error"))}else s.message.error(i("qm.table.import.error"))})):s.message.error(i("qm.table.import.error"))},r.readAsArrayBuffer(n)}}},_i=e=>{const{fileType:t,onChange:l}=e,{prefixCls:n}=q.default.useContext(Xr),{t:a}=Xe();let r,i;const o=e=>{const t=e.name,l=t.lastIndexOf("."),n=t.substring(l+1,t.length);return{filename:t.substring(0,l),type:n}},d=()=>Ye(void 0,void 0,void 0,(function*(){try{const e=yield(e=>{const t=Object.assign({},e);return r||(r=document.createElement("form"),i=document.createElement("input"),r.className=`${n}--file-form`,i.name="file",i.type="file",r.appendChild(i),document.body.appendChild(r)),new Promise(((e,l)=>{const n=!t.type;i.multiple=!!t.multiple,i.accept=n?"":`.${t.type}`,i.onchange=d=>{const{files:u}=d.target,c=u[0];let f="";if(!n)for(let e=0;e<u.length;e++){const{type:l}=o(u[e]);if(t.type!==l){f=l;break}}f?(s.message.warning(a("qm.upload.notType",{type:f})),l()):e(c),document.body.removeChild(r),r=null,i=null},r.reset(),i.click()}))})({type:t});null==l||l(e.name,e)}catch(e){}}));return q.default.createElement(ht,{onClick:()=>d()},a("qm.upload.text"))},Fi=e=>{const{columns:t,onClose:l}=e,{tableRef:n,prefixCls:a,createTableData:r,dataChange:i}=q.default.useContext(Xr),{beforeTableImport:o}=n.current.props,{t:d}=Xe(),{importXLSX:u}=Di(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState(!0),g=e=>e.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))),v={posIndex:"条"},[y,b]=q.default.useState([{type:"INPUT",label:d("qm.table.export.fileName"),fieldName:"fileName",render:(e,t)=>{const{fileName:l}=t.GET_FIELDS_VALUE(["fileName"]);return q.default.createElement(q.default.Fragment,null,l?q.default.createElement("span",null,l):q.default.createElement(_i,{fileType:t.state.formData.fileType,onChange:(e,l)=>{t.SET_FIELDS_VALUE({fileName:e,file:l}),l&&h(!1)}}))}},{type:"SELECT",label:d("qm.table.export.fileType"),fieldName:"fileType",allowClear:!1,options:{itemList:[{text:"xlsx",value:"xlsx"}]}},{type:"SELECT",label:d("qm.table.import.importType"),fieldName:"importType",allowClear:!1,options:{itemList:[{text:d("qm.table.import.fillText"),value:"fill"},{text:d("qm.table.import.addText"),value:"add"},{text:d("qm.table.import.insertText"),value:"insert"}]},onChange:e=>{y.find((e=>"posIndex"===e.fieldName)).hidden="insert"!==e,"insert"===e&&c.current.SET_FIELDS_EXTRA(v),b([...y])}},{type:"INPUT_NUMBER",label:d("qm.table.import.insertPos"),fieldName:"posIndex",hidden:!0,rules:[{required:!0}],options:{min:0,max:n.current.tableFullData.length,formatter:e=>`第 ${e}`.replace(/\B(?=(\d{3})+(?!\d))/g,","),parser:e=>e.replace(/第\s?|(,*)/g,"")},extra:{labelWidth:50}}]);return q.default.createElement("div",{className:`${a}-import__setting`},q.default.createElement(wf,{ref:c,initialValues:{fileType:"xlsx",importType:"fill"},initialExtras:v,items:y,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.export.closeButton")),q.default.createElement(ht,{type:"primary",loading:f,disabled:m,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,a]=yield c.current.GET_FORM_DATA();e||(p(!0),u({columns:g(t),file:a.file},(e=>Ye(void 0,void 0,void 0,(function*(){const{tableFullData:t,store:u}=n.current;if(e=Array.from(e).map((e=>e||{})),"function"==typeof o)try{e=yield o(e)}catch(e){}if("fill"===a.importType&&r(e),"add"===a.importType&&r([...t,...e]),"insert"===a.importType){const l=a.posIndex,n=t.slice(0,l).concat(e).concat(t.slice(l));r(n)}e.forEach((e=>{u.addToInserted(e)})),i(),s.message.success(d("qm.table.import.success",{total:e.length})),p(!1),l()})))))}))},d("qm.table.import.text"))))},Hi=q.default.forwardRef(((e,t)=>{const{tableColumns:l,open:n=!0}=e,{prefixCls:a}=q.default.useContext(Xr),{t:r}=Xe(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={[`${a}-import`]:!0},u={visible:i,title:r("qm.table.import.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement("span",{className:J.default(d),title:r("qm.table.import.textNoSpace"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.ImportOutlined,null))),q.default.createElement(Qn,u,q.default.createElement(Fi,{columns:l,onClose:()=>o(!1)})))}));function Mi(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var l=t;l;){if(l===e)return!0;l=l.parentNode}return!1}function $i(e,t,l,n){var a=ee.default.unstable_batchedUpdates?function(e){ee.default.unstable_batchedUpdates(l,e)}:l;return null!=e&&e.addEventListener&&e.addEventListener(t,a,n),{remove:function(){null!=e&&e.removeEventListener&&e.removeEventListener(t,a,n)}}}Hi.displayName="TableImport";var qi=e.forwardRef((function(t,l){var n=t.didUpdate,a=t.getContainer,r=t.children,i=e.useRef(),o=e.useRef();e.useImperativeHandle(l,(function(){return{}}));var s=e.useRef(!1);return!s.current&&ol()&&(o.current=a(),i.current=o.current.parentNode,s.current=!0),e.useEffect((function(){null==n||n(t)})),e.useEffect((function(){return null===o.current.parentNode&&null!==i.current&&i.current.appendChild(o.current),function(){var e;null===(e=o.current)||void 0===e||null===(e=e.parentNode)||void 0===e||e.removeChild(o.current)}}),[]),o.current?ee.default.createPortal(r,o.current):null}));function ji(e,t,l){return l?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}var Ki;function Vi(e){var t=e.prefixCls,l=e.motion,n=e.animation,a=e.transitionName;return l||(n?{motionName:"".concat(t,"-").concat(n)}:a?{motionName:a}:null)}function zi(e){var t=e.prefixCls,l=e.visible,n=e.zIndex,a=e.mask,r=e.maskMotion,i=e.maskAnimation,o=e.maskTransitionName;if(!a)return null;var s={};return(r||o||i)&&(s=Ot({motionAppear:!0},Vi({motion:r,prefixCls:t,transitionName:o,animation:i}))),$.createElement(Hl,Ml({},s,{visible:l,removeOnLeave:!0}),(function(e){var l=e.className;return $.createElement("div",{style:{zIndex:n},className:J.default("".concat(t,"-mask"),l)})}))}function Wi(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),l.push.apply(l,n)}return l}function Bi(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(l),!0).forEach((function(t){Gi(e,t,l[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):Wi(Object(l)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))}))}return e}function Ui(e){return Ui="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},Ui(e)}function Gi(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}var Yi={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Xi(){if(void 0!==Ki)return Ki;Ki="";var e=document.createElement("p").style;for(var t in Yi)t+"Transform"in e&&(Ki=t);return Ki}function Qi(){return Xi()?"".concat(Xi(),"TransitionProperty"):"transitionProperty"}function Zi(){return Xi()?"".concat(Xi(),"Transform"):"transform"}function Ji(e,t){var l=Qi();l&&(e.style[l]=t,"transitionProperty"!==l&&(e.style.transitionProperty=t))}function eo(e,t){var l=Zi();l&&(e.style[l]=t,"transform"!==l&&(e.style.transform=t))}var to,lo=/matrix\((.*)\)/,no=/matrix3d\((.*)\)/;function ao(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function ro(e,t,l){var n=l;if("object"!==Ui(t))return void 0!==n?("number"==typeof n&&(n="".concat(n,"px")),void(e.style[t]=n)):to(e,t);for(var a in t)t.hasOwnProperty(a)&&ro(e,a,t[a])}function io(e,t){var l=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if("number"!=typeof l){var a=e.document;"number"!=typeof(l=a.documentElement[n])&&(l=a.body[n])}return l}function oo(e){return io(e)}function so(e){return io(e,!0)}function uo(e){var t=function(e){var t,l,n,a=e.ownerDocument,r=a.body,i=a&&a.documentElement;return t=e.getBoundingClientRect(),l=Math.floor(t.left),n=Math.floor(t.top),{left:l-=i.clientLeft||r.clientLeft||0,top:n-=i.clientTop||r.clientTop||0}}(e),l=e.ownerDocument,n=l.defaultView||l.parentWindow;return t.left+=oo(n),t.top+=so(n),t}function co(e){return null!=e&&e==e.window}function fo(e){return co(e)?e.document:9===e.nodeType?e:e.ownerDocument}var po=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),mo=/^(top|right|bottom|left)$/,ho="currentStyle",go="runtimeStyle",vo="left";function yo(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function bo(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function xo(e,t,l){"static"===ro(e,"position")&&(e.style.position="relative");var n=-999,a=-999,r=yo("left",l),i=yo("top",l),o=bo(r),s=bo(i);"left"!==r&&(n=999),"top"!==i&&(a=999);var d,u="",c=uo(e);("left"in t||"top"in t)&&(u=(d=e).style.transitionProperty||d.style[Qi()]||"",Ji(e,"none")),"left"in t&&(e.style[o]="",e.style[r]="".concat(n,"px")),"top"in t&&(e.style[s]="",e.style[i]="".concat(a,"px")),ao(e);var f=uo(e),p={};for(var m in t)if(t.hasOwnProperty(m)){var h=yo(m,l),g="left"===m?n:a,v=c[m]-f[m];p[h]=h===m?g+v:g-v}ro(e,p),ao(e),("left"in t||"top"in t)&&Ji(e,u);var y={};for(var b in t)if(t.hasOwnProperty(b)){var x=yo(b,l),E=t[b]-c[b];y[x]=b===x?p[x]+E:p[x]-E}ro(e,y)}function Eo(e,t){var l=uo(e),n=function(e){var t=window.getComputedStyle(e,null),l=t.getPropertyValue("transform")||t.getPropertyValue(Zi());if(l&&"none"!==l){var n=l.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}(e),a={x:n.x,y:n.y};"left"in t&&(a.x=n.x+t.left-l.left),"top"in t&&(a.y=n.y+t.top-l.top),function(e,t){var l=window.getComputedStyle(e,null),n=l.getPropertyValue("transform")||l.getPropertyValue(Zi());if(n&&"none"!==n){var a,r=n.match(lo);r?((a=(r=r[1]).split(",").map((function(e){return parseFloat(e,10)})))[4]=t.x,a[5]=t.y,eo(e,"matrix(".concat(a.join(","),")"))):((a=n.match(no)[1].split(",").map((function(e){return parseFloat(e,10)})))[12]=t.x,a[13]=t.y,eo(e,"matrix3d(".concat(a.join(","),")")))}else eo(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,a)}function Co(e,t){for(var l=0;l<e.length;l++)t(e[l])}function wo(e){return"border-box"===to(e,"boxSizing")}"undefined"!=typeof window&&(to=window.getComputedStyle?function(e,t,l){var n=l,a="",r=fo(e);return(n=n||r.defaultView.getComputedStyle(e,null))&&(a=n.getPropertyValue(t)||n[t]),a}:function(e,t){var l=e[ho]&&e[ho][t];if(po.test(l)&&!mo.test(t)){var n=e.style,a=n[vo],r=e[go][vo];e[go][vo]=e[ho][vo],n[vo]="fontSize"===t?"1em":l||0,l=n.pixelLeft+"px",n[vo]=a,e[go][vo]=r}return""===l?"auto":l});var So=["margin","border","padding"],No=-1,To=2,Io=1;function Oo(e,t,l){var n,a,r,i=0;for(a=0;a<t.length;a++)if(n=t[a])for(r=0;r<l.length;r++){var o=void 0;o="border"===n?"".concat(n).concat(l[r],"Width"):n+l[r],i+=parseFloat(to(e,o))||0}return i}var Ro={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 ko(e,t,l){var n=l;if(co(e))return"width"===t?Ro.viewportWidth(e):Ro.viewportHeight(e);if(9===e.nodeType)return"width"===t?Ro.docWidth(e):Ro.docHeight(e);var a="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=wo(e),o=0;(null==r||r<=0)&&(r=void 0,(null==(o=to(e,t))||Number(o)<0)&&(o=e.style[t]||0),o=Math.floor(parseFloat(o))||0),void 0===n&&(n=i?Io:No);var s=void 0!==r||i,d=r||o;return n===No?s?d-Oo(e,["border","padding"],a):o:s?n===Io?d:d+(n===To?-Oo(e,["border"],a):Oo(e,["margin"],a)):o+Oo(e,So.slice(n),a)}Co(["Width","Height"],(function(e){Ro["doc".concat(e)]=function(t){var l=t.document;return Math.max(l.documentElement["scroll".concat(e)],l.body["scroll".concat(e)],Ro["viewport".concat(e)](l))},Ro["viewport".concat(e)]=function(t){var l="client".concat(e),n=t.document,a=n.body,r=n.documentElement[l];return"CSS1Compat"===n.compatMode&&r||a&&a[l]||r}}));var Lo={position:"absolute",visibility:"hidden",display:"block"};function Po(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];var n,a=t[0];return 0!==a.offsetWidth?n=ko.apply(void 0,t):function(e,t,l){var n,a={},r=e.style;for(n in t)t.hasOwnProperty(n)&&(a[n]=r[n],r[n]=t[n]);for(n in l.call(e),t)t.hasOwnProperty(n)&&(r[n]=a[n])}(a,Lo,(function(){n=ko.apply(void 0,t)})),n}function Ao(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l]);return e}Co(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);Ro["outer".concat(t)]=function(t,l){return t&&Po(t,e,l?0:Io)};var l="width"===e?["Left","Right"]:["Top","Bottom"];Ro[e]=function(t,n){var a=n;return void 0!==a?t?(wo(t)&&(a+=Oo(t,["padding","border"],l)),ro(t,e,a)):void 0:t&&Po(t,e,No)}}));var Do={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:fo,offset:function(e,t,l){if(void 0===t)return uo(e);!function(e,t,l){if(l.ignoreShake){var n=uo(e),a=n.left.toFixed(0),r=n.top.toFixed(0),i=t.left.toFixed(0),o=t.top.toFixed(0);if(a===i&&r===o)return}l.useCssRight||l.useCssBottom?xo(e,t,l):l.useCssTransform&&Zi()in document.body.style?Eo(e,t):xo(e,t,l)}(e,t,l||{})},isWindow:co,each:Co,css:ro,clone:function(e){var t,l={};for(t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(l.overflow[t]=e.overflow[t]);return l},mix:Ao,getWindowScrollLeft:function(e){return oo(e)},getWindowScrollTop:function(e){return so(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)Do.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};Ao(Do,Ro);var _o=Do.getParent;function Fo(e){if(Do.isWindow(e)||9===e.nodeType)return null;var t,l=Do.getDocument(e).body,n=Do.css(e,"position");if(!("fixed"===n||"absolute"===n))return"html"===e.nodeName.toLowerCase()?null:_o(e);for(t=_o(e);t&&t!==l&&9!==t.nodeType;t=_o(t))if("static"!==(n=Do.css(t,"position")))return t;return null}var Ho=Do.getParent;function Mo(e,t){for(var l={left:0,right:1/0,top:0,bottom:1/0},n=Fo(e),a=Do.getDocument(e),r=a.defaultView||a.parentWindow,i=a.body,o=a.documentElement;n;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===n.clientWidth||n===i||n===o||"visible"===Do.css(n,"overflow")){if(n===i||n===o)break}else{var s=Do.offset(n);s.left+=n.clientLeft,s.top+=n.clientTop,l.top=Math.max(l.top,s.top),l.right=Math.min(l.right,s.left+n.clientWidth),l.bottom=Math.min(l.bottom,s.top+n.clientHeight),l.left=Math.max(l.left,s.left)}n=Fo(n)}var d=null;Do.isWindow(e)||9===e.nodeType||(d=e.style.position,"absolute"===Do.css(e,"position")&&(e.style.position="fixed"));var u=Do.getWindowScrollLeft(r),c=Do.getWindowScrollTop(r),f=Do.viewportWidth(r),p=Do.viewportHeight(r),m=o.scrollWidth,h=o.scrollHeight,g=window.getComputedStyle(i);if("hidden"===g.overflowX&&(m=r.innerWidth),"hidden"===g.overflowY&&(h=r.innerHeight),e.style&&(e.style.position=d),t||function(e){if(Do.isWindow(e)||9===e.nodeType)return!1;var t=Do.getDocument(e),l=t.body,n=null;for(n=Ho(e);n&&n!==l&&n!==t;n=Ho(n))if("fixed"===Do.css(n,"position"))return!0;return!1}(e))l.left=Math.max(l.left,u),l.top=Math.max(l.top,c),l.right=Math.min(l.right,u+f),l.bottom=Math.min(l.bottom,c+p);else{var v=Math.max(m,u+f);l.right=Math.min(l.right,v);var y=Math.max(h,c+p);l.bottom=Math.min(l.bottom,y)}return l.top>=0&&l.left>=0&&l.bottom>l.top&&l.right>l.left?l:null}function $o(e){var t,l,n;if(Do.isWindow(e)||9===e.nodeType){var a=Do.getWindow(e);t={left:Do.getWindowScrollLeft(a),top:Do.getWindowScrollTop(a)},l=Do.viewportWidth(a),n=Do.viewportHeight(a)}else t=Do.offset(e),l=Do.outerWidth(e),n=Do.outerHeight(e);return t.width=l,t.height=n,t}function qo(e,t){var l=t.charAt(0),n=t.charAt(1),a=e.width,r=e.height,i=e.left,o=e.top;return"c"===l?o+=r/2:"b"===l&&(o+=r),"c"===n?i+=a/2:"r"===n&&(i+=a),{left:i,top:o}}function jo(e,t,l,n,a){var r=qo(t,l[1]),i=qo(e,l[0]),o=[i.left-r.left,i.top-r.top];return{left:Math.round(e.left-o[0]+n[0]-a[0]),top:Math.round(e.top-o[1]+n[1]-a[1])}}function Ko(e,t,l){return e.left<l.left||e.left+t.width>l.right}function Vo(e,t,l){return e.top<l.top||e.top+t.height>l.bottom}function zo(e,t,l){var n=[];return Do.each(e,(function(e){n.push(e.replace(t,(function(e){return l[e]})))})),n}function Wo(e,t){return e[t]=-e[t],e}function Bo(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Uo(e,t){e[0]=Bo(e[0],t.width),e[1]=Bo(e[1],t.height)}function Go(e,t,l,n){var a=l.points,r=l.offset||[0,0],i=l.targetOffset||[0,0],o=l.overflow,s=l.source||e;r=[].concat(r),i=[].concat(i);var d={},u=0,c=Mo(s,!(!(o=o||{})||!o.alwaysByViewport)),f=$o(s);Uo(r,f),Uo(i,t);var p=jo(f,t,a,r,i),m=Do.merge(f,p);if(c&&(o.adjustX||o.adjustY)&&n){if(o.adjustX&&Ko(p,f,c)){var h=zo(a,/[lr]/gi,{l:"r",r:"l"}),g=Wo(r,0),v=Wo(i,0);(function(e,t,l){return e.left>l.right||e.left+t.width<l.left})(jo(f,t,h,g,v),f,c)||(u=1,a=h,r=g,i=v)}if(o.adjustY&&Vo(p,f,c)){var y=zo(a,/[tb]/gi,{t:"b",b:"t"}),b=Wo(r,1),x=Wo(i,1);(function(e,t,l){return e.top>l.bottom||e.top+t.height<l.top})(jo(f,t,y,b,x),f,c)||(u=1,a=y,r=b,i=x)}u&&(p=jo(f,t,a,r,i),Do.mix(m,p));var E=Ko(p,f,c),C=Vo(p,f,c);if(E||C){var w=a;E&&(w=zo(a,/[lr]/gi,{l:"r",r:"l"})),C&&(w=zo(a,/[tb]/gi,{t:"b",b:"t"})),a=w,r=l.offset||[0,0],i=l.targetOffset||[0,0]}d.adjustX=o.adjustX&&E,d.adjustY=o.adjustY&&C,(d.adjustX||d.adjustY)&&(m=function(e,t,l,n){var a=Do.clone(e),r={width:t.width,height:t.height};return n.adjustX&&a.left<l.left&&(a.left=l.left),n.resizeWidth&&a.left>=l.left&&a.left+r.width>l.right&&(r.width-=a.left+r.width-l.right),n.adjustX&&a.left+r.width>l.right&&(a.left=Math.max(l.right-r.width,l.left)),n.adjustY&&a.top<l.top&&(a.top=l.top),n.resizeHeight&&a.top>=l.top&&a.top+r.height>l.bottom&&(r.height-=a.top+r.height-l.bottom),n.adjustY&&a.top+r.height>l.bottom&&(a.top=Math.max(l.bottom-r.height,l.top)),Do.mix(a,r)}(p,f,c,d))}return m.width!==f.width&&Do.css(s,"width",Do.width(s)+m.width-f.width),m.height!==f.height&&Do.css(s,"height",Do.height(s)+m.height-f.height),Do.offset(s,{left:m.left,top:m.top},{useCssRight:l.useCssRight,useCssBottom:l.useCssBottom,useCssTransform:l.useCssTransform,ignoreShake:l.ignoreShake}),{points:a,offset:r,targetOffset:i,overflow:d}}function Yo(e,t,l){var n=l.target||t,a=$o(n),r=!function(e,t){var l=Mo(e,t),n=$o(e);return!l||n.left+n.width<=l.left||n.top+n.height<=l.top||n.left>=l.right||n.top>=l.bottom}(n,l.overflow&&l.overflow.alwaysByViewport);return Go(e,a,l,r)}Yo.__getOffsetParent=Fo,Yo.__getVisibleRectForElement=Mo;var Xo=ol()?$.useLayoutEffect:$.useEffect,Qo=function(e,t){var l=$.useRef(!0);Xo((function(){return e(l.current)}),t),Xo((function(){return l.current=!1,function(){l.current=!0}}),[])};function Zo(e,t){var l=null,n=null;var a=new le.default((function(e){var a=kt(e,1)[0].target;if(document.documentElement.contains(a)){var r=a.getBoundingClientRect(),i=r.width,o=r.height,s=Math.floor(i),d=Math.floor(o);l===s&&n===d||Promise.resolve().then((function(){t({width:s,height:d})})),l=s,n=d}}));return e&&a.observe(e),function(){a.disconnect()}}function Jo(e){return"function"!=typeof e?null:e()}function es(e){return"object"===St(e)&&e?e:null}var ts=function(e,t){var l=e.children,n=e.disabled,a=e.target,r=e.align,i=e.onAlign,o=e.monitorWindowResize,s=e.monitorBufferTime,d=void 0===s?0:s,u=q.default.useRef({}),c=q.default.useRef(),f=q.default.Children.only(l),p=q.default.useRef({});p.current.disabled=n,p.current.target=a,p.current.align=r,p.current.onAlign=i;var m=function(e,t){var l=q.default.useRef(!1),n=q.default.useRef(null);function a(){window.clearTimeout(n.current)}return[function r(i){if(a(),l.current&&!0!==i)n.current=window.setTimeout((function(){l.current=!1,r()}),t);else{if(!1===e(i))return;l.current=!0,n.current=window.setTimeout((function(){l.current=!1}),t)}},function(){l.current=!1,a()}]}((function(){var e=p.current,t=e.disabled,l=e.target,n=e.align,a=e.onAlign,r=c.current;if(!t&&l&&r){var i,o=Jo(l),s=es(l);u.current.element=o,u.current.point=s,u.current.align=n;var d=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(),l=t.width,n=t.height;if(l||n)return!0}if(e.getBoundingClientRect){var a=e.getBoundingClientRect(),r=a.width,i=a.height;if(r||i)return!0}}return!1}(o)?i=Yo(r,o,n):s&&(i=function(e,t,l){var n,a,r=Do.getDocument(e),i=r.defaultView||r.parentWindow,o=Do.getWindowScrollLeft(i),s=Do.getWindowScrollTop(i),d=Do.viewportWidth(i),u=Do.viewportHeight(i),c={left:n="pageX"in t?t.pageX:o+t.clientX,top:a="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},f=n>=0&&n<=o+d&&a>=0&&a<=s+u,p=[l.points[0],"cc"];return Go(e,c,Bi(Bi({},l),{},{points:p}),f)}(r,s,n)),function(e,t){e!==document.activeElement&&Mi(t,e)&&"function"==typeof e.focus&&e.focus()}(d,r),a&&i&&a(r,i),!0}return!1}),d),h=kt(m,2),g=h[0],v=h[1],y=kt(q.default.useState(),2),b=y[0],x=y[1],E=kt(q.default.useState(),2),C=E[0],w=E[1];return Qo((function(){x(Jo(a)),w(es(a))})),q.default.useEffect((function(){var e,t;u.current.element===b&&((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 l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function e(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=n.has(t);if(Ae(!i,"Warning: There may be circular references"),i)return!1;if(t===a)return!0;if(l&&r>1)return!1;n.add(t);var o=r+1;if(Array.isArray(t)){if(!Array.isArray(a)||t.length!==a.length)return!1;for(var s=0;s<t.length;s++)if(!e(t[s],a[s],o))return!1;return!0}if(t&&a&&"object"===St(t)&&"object"===St(a)){var d=Object.keys(t);return d.length===Object.keys(a).length&&d.every((function(l){return e(t[l],a[l],o)}))}return!1}(e,t)}(u.current.align,r)||g()})),q.default.useEffect((function(){return Zo(c.current,g)}),[c.current]),q.default.useEffect((function(){return Zo(b,g)}),[b]),q.default.useEffect((function(){n?v():g()}),[n]),q.default.useEffect((function(){if(o)return $i(window,"resize",g).remove}),[o]),q.default.useEffect((function(){return function(){v()}}),[]),q.default.useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),q.default.isValidElement(f)&&(f=q.default.cloneElement(f,{ref:Ht(f.ref,c)})),f},ls=q.default.forwardRef(ts);function ns(){ns=function(){return e};var e={},t=Object.prototype,l=t.hasOwnProperty,n=Object.defineProperty||function(e,t,l){e[t]=l.value},a="function"==typeof Symbol?Symbol:{},r=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function s(e,t,l){return Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,l){return e[t]=l}}function d(e,t,l,a){var r=t&&t.prototype instanceof f?t:f,i=Object.create(r.prototype),o=new N(a||[]);return n(i,"_invoke",{value:E(e,l,o)}),i}function u(e,t,l){try{return{type:"normal",arg:e.call(t,l)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var c={};function f(){}function p(){}function m(){}var h={};s(h,r,(function(){return this}));var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==t&&l.call(v,r)&&(h=v);var y=m.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function a(n,r,i,o){var s=u(e[n],e,r);if("throw"!==s.type){var d=s.arg,c=d.value;return c&&"object"==St(c)&&l.call(c,"__await")?t.resolve(c.__await).then((function(e){a("next",e,i,o)}),(function(e){a("throw",e,i,o)})):t.resolve(c).then((function(e){d.value=e,i(d)}),(function(e){return a("throw",e,i,o)}))}o(s.arg)}var r;n(this,"_invoke",{value:function(e,l){function n(){return new t((function(t,n){a(e,l,t,n)}))}return r=r?r.then(n,n):n()}})}function E(e,t,l){var n="suspendedStart";return function(a,r){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw r;return I()}for(l.method=a,l.arg=r;;){var i=l.delegate;if(i){var o=C(i,l);if(o){if(o===c)continue;return o}}if("next"===l.method)l.sent=l._sent=l.arg;else if("throw"===l.method){if("suspendedStart"===n)throw n="completed",l.arg;l.dispatchException(l.arg)}else"return"===l.method&&l.abrupt("return",l.arg);n="executing";var s=u(e,t,l);if("normal"===s.type){if(n=l.done?"completed":"suspendedYield",s.arg===c)continue;return{value:s.arg,done:l.done}}"throw"===s.type&&(n="completed",l.method="throw",l.arg=s.arg)}}}function C(e,t){var l=t.method,n=e.iterator[l];if(void 0===n)return t.delegate=null,"throw"===l&&e.iterator.return&&(t.method="return",t.arg=void 0,C(e,t),"throw"===t.method)||"return"!==l&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+l+"' method")),c;var a=u(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,c;var r=a.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(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(w,this),this.reset(!0)}function T(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=m,n(y,"constructor",{value:m,configurable:!0}),n(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,o,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(x.prototype),s(x.prototype,i,(function(){return this})),e.AsyncIterator=x,e.async=function(t,l,n,a,r){void 0===r&&(r=Promise);var i=new x(d(t,l,n,a),r);return e.isGeneratorFunction(l)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(y),s(y,o,"Generator"),s(y,r,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),l=[];for(var n in t)l.push(n);return l.reverse(),function e(){for(;l.length;){var n=l.pop();if(n in t)return e.value=n,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)&&l.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 n(l,n){return i.type="throw",i.arg=e,t.next=l,n&&(t.method="next",t.arg=void 0),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a],i=r.completion;if("root"===r.tryLoc)return n("end");if(r.tryLoc<=this.prev){var o=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(o&&s){if(this.prev<r.catchLoc)return n(r.catchLoc,!0);if(this.prev<r.finallyLoc)return n(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return n(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return n(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&l.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var r=a;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var i=r?r.completion:{};return i.type=e,i.arg=t,r?(this.method="next",this.next=r.finallyLoc,c):this.complete(i)},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),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.finallyLoc===e)return this.complete(l.completion,l.afterLoc),S(l),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.tryLoc===e){var n=l.completion;if("throw"===n.type){var a=n.arg;S(l)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,l){return this.delegate={iterator:T(e),resultName:t,nextLoc:l},"next"===this.method&&(this.arg=void 0),c}},e}function as(e,t,l,n,a,r,i){try{var o=e[r](i),s=o.value}catch(e){return void l(e)}o.done?t(s):Promise.resolve(s).then(n,a)}function rs(e){return function(){var t=this,l=arguments;return new Promise((function(n,a){var r=e.apply(t,l);function i(e){as(r,n,a,i,o,"next",e)}function o(e){as(r,n,a,i,o,"throw",e)}i(void 0)}))}}ls.displayName="Align";var is=["measure","alignPre","align",null,"motion"],os=$.forwardRef((function(t,l){var n=t.visible,a=t.prefixCls,r=t.className,i=t.style,o=t.children,s=t.zIndex,d=t.stretch,u=t.destroyPopupOnHide,c=t.forceRender,f=t.align,p=t.point,m=t.getRootDomNode,h=t.getClassNameFromAlign,g=t.onAlign,v=t.onMouseEnter,y=t.onMouseLeave,b=t.onMouseDown,x=t.onTouchStart,E=t.onClick,C=e.useRef(),w=e.useRef(),S=kt(e.useState(),2),N=S[0],T=S[1],I=function(e){var t=kt($.useState({width:0,height:0}),2),l=t[0],n=t[1];return[$.useMemo((function(){var t={};if(e){var n=l.width,a=l.height;-1!==e.indexOf("height")&&a?t.height=a:-1!==e.indexOf("minHeight")&&a&&(t.minHeight=a),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t}),[e,l]),function(e){var t=e.offsetWidth,l=e.offsetHeight,a=e.getBoundingClientRect(),r=a.width,i=a.height;Math.abs(t-r)<1&&Math.abs(l-i)<1&&(t=r,l=i),n({width:t,height:l})}]}(d),O=kt(I,2),R=O[0],k=O[1];var L=function(t,l){var n=kt(Xt(null),2),a=n[0],r=n[1],i=e.useRef();function o(e){r(e,!0)}function s(){kl.cancel(i.current)}return e.useEffect((function(){o("measure")}),[t]),e.useEffect((function(){"measure"===a&&l(),a&&(i.current=kl(rs(ns().mark((function e(){var t,l;return ns().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=is.indexOf(a),(l=is[t+1])&&-1!==t&&o(l);case 3:case"end":return e.stop()}}),e)})))))}),[a]),e.useEffect((function(){return function(){s()}}),[]),[a,function(e){s(),i.current=kl((function(){o((function(e){switch(a){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n,(function(){d&&k(m())})),P=kt(L,2),A=P[0],D=P[1],_=kt(e.useState(0),2),F=_[0],H=_[1],M=e.useRef();function q(){var e;null===(e=C.current)||void 0===e||e.forceAlign()}function j(e,t){var l=h(t);N!==l&&T(l),H((function(e){return e+1})),"align"===A&&(null==g||g(e,t))}Qo((function(){"alignPre"===A&&H(0)}),[A]),Qo((function(){"align"===A&&(F<3?q():D((function(){var e;null===(e=M.current)||void 0===e||e.call(M)})))}),[F]);var K=Ot({},Vi(t));function V(){return new Promise((function(e){M.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=K[e];K[e]=function(e,l){return D(),null==t?void 0:t(e,l)}})),$.useEffect((function(){K.motionName||"motion"!==A||D()}),[K.motionName,A]),$.useImperativeHandle(l,(function(){return{forceAlign:q,getElement:function(){return w.current}}}));var z=Ot(Ot({},R),{},{zIndex:s,opacity:"motion"!==A&&"stable"!==A&&n?0:void 0,pointerEvents:n||"stable"===A?void 0:"none"},i),W=!0;null==f||!f.points||"align"!==A&&"stable"!==A||(W=!1);var B=o;return $.Children.count(o)>1&&(B=$.createElement("div",{className:"".concat(a,"-content")},o)),$.createElement(Hl,Ml({visible:n,ref:w,leavedClassName:"".concat(a,"-hidden")},K,{onAppearPrepare:V,onEnterPrepare:V,removeOnLeave:u,forceRender:c}),(function(e,t){var l=e.className,n=e.style,i=J.default(a,r,N,l);return $.createElement(ls,{target:p||m,key:"popup",ref:C,monitorWindowResize:!0,disabled:W,align:f,onAlign:j},$.createElement("div",{ref:t,className:i,onMouseEnter:v,onMouseLeave:y,onMouseDownCapture:b,onTouchStartCapture:x,onClick:E,style:Ot(Ot({},n),z)},B))}))}));os.displayName="PopupInner";var ss=$.forwardRef((function(e,t){var l=e.prefixCls,n=e.visible,a=e.zIndex,r=e.children,i=e.mobile,o=(i=void 0===i?{}:i).popupClassName,s=i.popupStyle,d=i.popupMotion,u=void 0===d?{}:d,c=i.popupRender,f=e.onClick,p=$.useRef();$.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return p.current}}}));var m=Ot({zIndex:a},s),h=r;return $.Children.count(r)>1&&(h=$.createElement("div",{className:"".concat(l,"-content")},r)),c&&(h=c(h)),$.createElement(Hl,Ml({visible:n,ref:p,removeOnLeave:!0},u),(function(e,t){var n=e.className,a=e.style,r=J.default(l,o,n);return $.createElement("div",{ref:t,className:r,onClick:f,style:Ot(Ot({},a),m)},h)}))}));ss.displayName="MobilePopupInner";var ds=["visible","mobile"],us=$.forwardRef((function(t,l){var n=t.visible,a=t.mobile,r=$t(t,ds),i=kt(e.useState(n),2),o=i[0],s=i[1],d=kt(e.useState(!1),2),u=d[0],c=d[1],f=Ot(Ot({},r),{},{visible:o});e.useEffect((function(){s(n),n&&a&&c(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))}())}),[n,a]);var p=u?$.createElement(ss,Ml({},f,{mobile:a,ref:l})):$.createElement(os,Ml({},f,{ref:l}));return $.createElement("div",null,$.createElement(zi,f),p)}));us.displayName="Popup";var cs=$.createContext(null);function fs(){}function ps(){return""}function ms(e){return e?e.ownerDocument:window.document}var hs=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var gs=function(e){var t=function(t){Wt(n,$.Component);var l=Gt(n);function n(e){var t,a;return jt(this,n),Tt(Ut(t=l.call(this,e)),"popupRef",$.createRef()),Tt(Ut(t),"triggerRef",$.createRef()),Tt(Ut(t),"portalContainer",void 0),Tt(Ut(t),"attachId",void 0),Tt(Ut(t),"clickOutsideHandler",void 0),Tt(Ut(t),"touchOutsideHandler",void 0),Tt(Ut(t),"contextMenuOutsideHandler1",void 0),Tt(Ut(t),"contextMenuOutsideHandler2",void 0),Tt(Ut(t),"mouseDownTimeout",void 0),Tt(Ut(t),"focusTime",void 0),Tt(Ut(t),"preClickTime",void 0),Tt(Ut(t),"preTouchTime",void 0),Tt(Ut(t),"delayTimer",void 0),Tt(Ut(t),"hasPopupMouseDown",void 0),Tt(Ut(t),"onMouseEnter",(function(e){var l=t.props.mouseEnterDelay;t.fireEvents("onMouseEnter",e),t.delaySetPopupVisible(!0,l,l?null:e)})),Tt(Ut(t),"onMouseMove",(function(e){t.fireEvents("onMouseMove",e),t.setPoint(e)})),Tt(Ut(t),"onMouseLeave",(function(e){t.fireEvents("onMouseLeave",e),t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),Tt(Ut(t),"onPopupMouseEnter",(function(){t.clearDelayTimer()})),Tt(Ut(t),"onPopupMouseLeave",(function(e){var l;e.relatedTarget&&!e.relatedTarget.setTimeout&&Mi(null===(l=t.popupRef.current)||void 0===l?void 0:l.getElement(),e.relatedTarget)||t.delaySetPopupVisible(!1,t.props.mouseLeaveDelay)})),Tt(Ut(t),"onFocus",(function(e){t.fireEvents("onFocus",e),t.clearDelayTimer(),t.isFocusToShow()&&(t.focusTime=Date.now(),t.delaySetPopupVisible(!0,t.props.focusDelay))})),Tt(Ut(t),"onMouseDown",(function(e){t.fireEvents("onMouseDown",e),t.preClickTime=Date.now()})),Tt(Ut(t),"onTouchStart",(function(e){t.fireEvents("onTouchStart",e),t.preTouchTime=Date.now()})),Tt(Ut(t),"onBlur",(function(e){t.fireEvents("onBlur",e),t.clearDelayTimer(),t.isBlurToHide()&&t.delaySetPopupVisible(!1,t.props.blurDelay)})),Tt(Ut(t),"onContextMenu",(function(e){e.preventDefault(),t.fireEvents("onContextMenu",e),t.setPopupVisible(!0,e)})),Tt(Ut(t),"onContextMenuClose",(function(){t.isContextMenuToShow()&&t.close()})),Tt(Ut(t),"onClick",(function(e){if(t.fireEvents("onClick",e),t.focusTime){var l;if(t.preClickTime&&t.preTouchTime?l=Math.min(t.preClickTime,t.preTouchTime):t.preClickTime?l=t.preClickTime:t.preTouchTime&&(l=t.preTouchTime),Math.abs(l-t.focusTime)<20)return;t.focusTime=0}t.preClickTime=0,t.preTouchTime=0,t.isClickToShow()&&(t.isClickToHide()||t.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!t.state.popupVisible;(t.isClickToHide()&&!n||n&&t.isClickToShow())&&t.setPopupVisible(!t.state.popupVisible,e)})),Tt(Ut(t),"onPopupMouseDown",(function(){var e;(t.hasPopupMouseDown=!0,clearTimeout(t.mouseDownTimeout),t.mouseDownTimeout=window.setTimeout((function(){t.hasPopupMouseDown=!1}),0),t.context)&&(e=t.context).onPopupMouseDown.apply(e,arguments)})),Tt(Ut(t),"onDocumentClick",(function(e){if(!t.props.mask||t.props.maskClosable){var l=e.target,n=t.getRootDomNode(),a=t.getPopupDomNode();Mi(n,l)&&!t.isContextMenuOnly()||Mi(a,l)||t.hasPopupMouseDown||t.close()}})),Tt(Ut(t),"getRootDomNode",(function(){var e=t.props.getTriggerDOMNode;if(e)return e(t.triggerRef.current);try{var l=Pt(t.triggerRef.current);if(l)return l}catch(e){}return ee.default.findDOMNode(Ut(t))})),Tt(Ut(t),"getPopupClassNameFromAlign",(function(e){var l=[],n=t.props,a=n.popupPlacement,r=n.builtinPlacements,i=n.prefixCls,o=n.alignPoint,s=n.getPopupClassNameFromAlign;return a&&r&&l.push(function(e,t,l,n){for(var a=l.points,r=Object.keys(e),i=0;i<r.length;i+=1){var o=r[i];if(ji(e[o].points,a,n))return"".concat(t,"-placement-").concat(o)}return""}(r,i,e,o)),s&&l.push(s(e)),l.join(" ")})),Tt(Ut(t),"getComponent",(function(){var e=t.props,l=e.prefixCls,n=e.destroyPopupOnHide,a=e.popupClassName,r=e.onPopupAlign,i=e.popupMotion,o=e.popupAnimation,s=e.popupTransitionName,d=e.popupStyle,u=e.mask,c=e.maskAnimation,f=e.maskTransitionName,p=e.maskMotion,m=e.zIndex,h=e.popup,g=e.stretch,v=e.alignPoint,y=e.mobile,b=e.forceRender,x=e.onPopupClick,E=t.state,C=E.popupVisible,w=E.point,S=t.getPopupAlign(),N={};return t.isMouseEnterToShow()&&(N.onMouseEnter=t.onPopupMouseEnter),t.isMouseLeaveToHide()&&(N.onMouseLeave=t.onPopupMouseLeave),N.onMouseDown=t.onPopupMouseDown,N.onTouchStart=t.onPopupMouseDown,$.createElement(us,Ml({prefixCls:l,destroyPopupOnHide:n,visible:C,point:v&&w,className:a,align:S,onAlign:r,animation:o,getClassNameFromAlign:t.getPopupClassNameFromAlign},N,{stretch:g,getRootDomNode:t.getRootDomNode,style:d,mask:u,zIndex:m,transitionName:s,maskAnimation:c,maskTransitionName:f,maskMotion:p,ref:t.popupRef,motion:i,mobile:y,forceRender:b,onClick:x}),"function"==typeof h?h():h)})),Tt(Ut(t),"attachParent",(function(e){kl.cancel(t.attachId);var l,n=t.props,a=n.getPopupContainer,r=n.getDocument,i=t.getRootDomNode();a?(i||0===a.length)&&(l=a(i)):l=r(t.getRootDomNode()).body,l?l.appendChild(e):t.attachId=kl((function(){t.attachParent(e)}))})),Tt(Ut(t),"getContainer",(function(){if(!t.portalContainer){var e=(0,t.props.getDocument)(t.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",t.portalContainer=e}return t.attachParent(t.portalContainer),t.portalContainer})),Tt(Ut(t),"setPoint",(function(e){t.props.alignPoint&&e&&t.setState({point:{pageX:e.pageX,pageY:e.pageY}})})),Tt(Ut(t),"handlePortalUpdate",(function(){t.state.prevPopupVisible!==t.state.popupVisible&&t.props.afterPopupVisibleChange(t.state.popupVisible)})),Tt(Ut(t),"triggerContextValue",{onPopupMouseDown:t.onPopupMouseDown}),a="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,t.state={prevPopupVisible:a,popupVisible:a},hs.forEach((function(e){t["fire".concat(e)]=function(l){t.fireEvents(e,l)}})),t}return Vt(n,[{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=$i(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=$i(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=$i(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=$i(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),kl.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,l=e.popupAlign,n=e.builtinPlacements;return t&&n?function(e,t,l){return Ot(Ot({},e[t]||{}),l)}(n,t,l):l}},{key:"setPopupVisible",value:function(e,t){var l=this.props.alignPoint,n=this.state.popupVisible;this.clearDelayTimer(),n!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:n}),this.props.onPopupVisibleChange(e)),l&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,l){var n=this,a=1e3*t;if(this.clearDelayTimer(),a){var r=l?{pageX:l.pageX,pageY:l.pageY}:null;this.delayTimer=window.setTimeout((function(){n.setPopupVisible(e,r),n.clearDelayTimer()}),a)}else this.setPopupVisible(e,l)}},{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,l=this.props;return t[e]&&l[e]?this["fire".concat(e)]:t[e]||l[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("click")||-1!==l.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,l=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==l.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("click")||-1!==l.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("hover")||-1!==l.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,l=e.showAction;return-1!==t.indexOf("focus")||-1!==l.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,l=e.hideAction;return-1!==t.indexOf("focus")||-1!==l.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 l=this.props.children.props[e];l&&l(t);var n=this.props[e];n&&n(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,l=this.props,n=l.children,a=l.forceRender,r=l.alignPoint,i=l.className,o=l.autoDestroy,s=$.Children.only(n),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,r&&(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=J.default(s&&s.props&&s.props.className,i);u&&(d.className=u);var c=Ot({},d);Mt(s)&&(c.ref=Ht(this.triggerRef,s.ref));var f,p=$.cloneElement(s,c);return(t||this.popupRef.current||a)&&(f=$.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&o&&(f=null),$.createElement(cs.Provider,{value:this.triggerContextValue},p,f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var l=e.popupVisible,n={};return void 0!==l&&t.popupVisible!==l&&(n.popupVisible=l,n.prevPopupVisible=t.popupVisible),n}}]),n}();return Tt(t,"contextType",cs),Tt(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:ps,getDocument:ms,onPopupVisibleChange:fs,afterPopupVisibleChange:fs,onPopupAlign:fs,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}(qi);const vs=e=>{const{columns:t,onChange:l}=e,{prefixCls:n,$size:a}=q.default.useContext(Xr),{t:r}=Xe(),i=q.default.useRef([]),[o,d]=q.default.useState(!1),[u,c]=q.default.useState(t);Ql((()=>{p()}),[u]),q.default.useEffect((()=>{f()}),[t]);const f=()=>{const e=[];t.forEach(((l,n)=>{const a=l.colSpan;a>1&&t.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&e.push(t.slice(n,n+a))})),i.current=e},p=()=>{const e=[];u.forEach((t=>{const{colSpan:l,dataIndex:n}=t;if(0===l)return;if(1===l)return e.push(t);const a=i.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(n)));if(-1===a)return e.push(t);e.push(...i.current[a].map((({dataIndex:e},l)=>{const n=u.find((t=>t.dataIndex===e));return l>0&&void 0!==t.hidden&&(n.hidden=t.hidden),n})))})),null==l||l(e)},h={[`${n}__popper`]:!0,"column-filter__popper":!0,[`${n}--lg`]:"large"===a,[`${n}--sm`]:"small"===a},v=[`${n}-column-filter`,{selected:o}];return q.default.createElement(gs,{action:["click"],popupVisible:o,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{overflowY:"auto",maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"main"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:u,setList:e=>{const t=e.map((e=>e.dataIndex)),l=u.map((e=>e.dataIndex));m.isEqual(t,l)||c(Ya(e))}},u.map((e=>((e,t)=>{const{colSpan:l}=e;if(0===l)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const n=["svgicon","handle",`${t}-handle`];return q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(s.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:l}=t.target;e.hidden=!l,c([...u])}}),q.default.createElement("i",{className:J.default(n),title:r("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text"},qa(e.title)))})(e,"main")))))),popupClassName:J.default(h),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{d(e)},builtinPlacements:ri,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(v),title:r("qm.table.columnFilter.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),q.default.createElement("span",null,r("qm.table.columnFilter.text"))))},ys=e=>{const{defaultValue:t,onClose:l,onOk:n}=e,{tableRef:a,prefixCls:r,selectionKeys:i,pagination:o,showSummary:s}=q.default.useContext(Xr),{rowSelection:d}=a.current.props,{t:u}=Xe(),c=q.default.useRef(null),[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>Object.assign({},{fileName:`${j.default().format(ai)}.xlsx`,fileType:"xlsx",sheetName:"sheet1",exportType:i.length?"selected":"all","startIndex|endIndex":[1,o.total],footSummation:s?1:0,useStyle:0},t,{columns:ut(t.columns||[])})),[]),[h,g]=q.default.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=>{h.find((e=>"startIndex|endIndex"===e.fieldName)).disabled="custom"!==e,g([...h])}},options:{min:1},disabled:!0},{type:"INPUT",label:u("qm.table.columnFilter.text"),fieldName:"columns",render:(e,t)=>q.default.createElement(vs,{columns:t.state.formData.columns,onChange:e=>{t.SET_FIELDS_VALUE({columns:e})}})},{type:"CHECKBOX",label:u("qm.table.export.footSummation"),fieldName:"footSummation",disabled:!s,options:{trueValue:1,falseValue:0}},{type:"CHECKBOX",label:u("qm.table.export.useStyle"),fieldName:"useStyle",options:{trueValue:1,falseValue:0}}]);return q.default.createElement("div",{className:`${r}-export__setting`},q.default.createElement(wf,{ref:c,initialValues:m,items:h,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l(),style:{marginRight:8}},u("qm.table.export.closeButton")),q.default.createElement(ht,{type:"primary",loading:f,onClick:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();if(!e){p(!0);for(const e in t)"footSummation"!==e&&"useStyle"!==e||(t[e]=!!t[e]);n(t),yield at(1e3),p(!1),l()}}))},u("qm.table.export.text"))))},bs=q.default.forwardRef(((e,t)=>{var l;const{tableColumns:n,open:a=!0}=e,{global:r}=q.default.useContext(xe),{tableRef:i,prefixCls:o,flattenColumns:d,pagination:u,fetchParams:c,isFetch:f,isGroupSubtotal:p,showSummary:h,getSpan:v}=q.default.useContext(Xr),{exportExcel:y,fetch:b,showHeader:x}=i.current.props,{t:E}=Xe(),{getTitleFromCellValue:C}=Si(),[w,S]=q.default.useState(!1),[N,T]=q.default.useState(!1),I=q.default.useMemo((()=>{var e;return!!(null===(e=null==y?void 0:y.fetch)||void 0===e?void 0:e.api)}),[y]),O=q.default.useMemo((()=>!u.total||N),[u.total,N]),R=q.default.useMemo((()=>xa(n,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn])),[n]),k=q.default.useMemo((()=>xa(d,[pi.expandableColumn,pi.selectionColumn,pi.operationColumn])),[d]),L=(e,t="",l=0)=>e.map(((e,n)=>{const a=Object.assign(Object.assign({},e),{index:n,pageIndex:n}),r=t?`${t}.${a.index+1}`:`${a.index+1}`;return a.indexPath=r,a._level=l,Array.isArray(e.children)&&(a.children=L(e.children,r,l+1)),k.forEach((e=>{const{dataIndex:t}=e;"index"!==t&&"pageIndex"!==t&&"indexPath"!==t&&La(a,t,ka(a,t))})),a})),P=(e,t)=>{const l={};return e.filter((e=>!!e.summation)).forEach((e=>{const{dataIndex:n}=e,a=(p?ja(t):t).reduce(((e,t)=>{if(null==t?void 0:t[pi.summaryIgnore])return e;const l=Number(ka(t,n));return Number.isNaN(l)?e:e+l}),0);La(l,n,a)})),[l]},A=(e,t,l,n)=>{const{precision:a,formatType:r}=l;let i=C(e,l,t,n);return a>=0&&!r&&""!==i&&(i=Number(i)),i},{exportXLSX:D,exportCSV:_}=Di(),F=e=>Ye(void 0,void 0,void 0,(function*(){var t;const{api:l,formatter:n=(e=>e),afterFetch:a,dataKey:r}=b;let i=[];try{T(!0);const o={[pi.currentPageName]:1,[pi.pageSizeName]:null!=e?e:u.total},s=yield l(Object.assign(Object.assign({},n(Object.assign(Object.assign({},c),o))),o));if(200===s.code){let e=Array.isArray(s.data)?s.data:null!==(t=m.get(s.data,r))&&void 0!==t?t:[];e="function"==typeof a?yield a(e):e,i=L(e)}}catch(e){}return T(!1),i})),H=e=>{var t;const l=null===(t=null==r?void 0:r.table)||void 0===t?void 0:t.recordExportLog;try{null==l||l({fileName:e})}catch(e){}},M=(e,t)=>{const{columns:l,footSummation:n}=e,a=pa(l);let r='<table width="100%" border="0" cellspacing="0" cellpadding="0">';return r+=`<colgroup>${a.map((({width:e,renderWidth:t})=>`<col style="width:${e||t}px">`)).join("")}</colgroup>`,x&&(r+=["<thead>","<tr>",a.map((e=>{const{rowSpan:t,colSpan:l}=e;return 0===l?null:`<th colspan="${l}" rowspan="${t}">${qa(e.title)}</th>`})).join(""),"</tr>","</thead>"].join("")),t.length&&(r+=`<tbody>${Ca(t).map((e=>`<tr>${a.map(((l,n)=>{var a;const{rowSpan:r,colSpan:i}=v(e,l,e.index,n,t);if(!r||!i)return null;const o=A(e,e.index,l,n);return`<td rowspan="${r}" colspan="${i}" data-type="${$(o,null===(a=l.filter)||void 0===a?void 0:a.type)}">${o}</td>`})).join("")}</tr>`)).join("")}</tbody>`),h&&n&&(r+=["<tfoot>",P(a,t).map((e=>`<tr>${a.map(((l,n)=>{const{dataIndex:a,summation:r}=l,i=(null==r?void 0:r.render)?r.render(t):ka(e,a);return`<td>${0===n&&""===i?E("qm.table.config.summaryText"):et(i)?$a(i).join(""):i}</td>`})).join("")}</tr>`)).join(""),"</tfoot>"].join("")),r+="</table>",r},$=(e,t)=>{const l={text:"string",textarea:"string",number:"number",date:"date"};return t&&l[t]?l[t]:typeof e},K=null!==(l=null==y?void 0:y.fileName)&&void 0!==l?l:`${j.default().format(ai)}.xlsx`,V=K.slice(K.lastIndexOf(".")+1).toLowerCase(),z=()=>{if(O)return s.message.warning(E("qm.table.export.warnText"));var e;I?(e=K,Ye(void 0,void 0,void 0,(function*(){T(!0);try{const{api:t,params:l}=y.fetch,n=yield t(Object.assign(Object.assign(Object.assign({columns:k.map((e=>{const{title:t,dataIndex:l,hidden:n}=e,{type:a}=e.filter||{};return{title:t,dataIndex:l,type:a,hidden:n}}))},c),l),{tsortby:void 0,tsummary:void 0,tgroupby:void 0,[pi.currentPageName]:void 0,[pi.pageSizeName]:void 0}));n.data&&(Fn(n.data,e),H(e))}catch(e){}T(!1)}))):S(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:z})));const W={[`${o}-export`]:!0},B={visible:w,title:E("qm.table.export.settingTitle"),width:600,loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>S(!1)},U={fileName:K.slice(0,K.lastIndexOf(".")),fileType:V,columns:R,useStyle:(null==y?void 0:y.cellStyle)?1:0};return q.default.createElement(q.default.Fragment,null,a&&q.default.createElement("span",{className:J.default(W),title:E("qm.table.export.textNoSpace"),onClick:()=>z()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.DownloadOutlined,null))),q.default.createElement(Qn,B,q.default.createElement(ys,{defaultValue:U,onClose:()=>S(!1),onOk:e=>{var t;t=Object.assign({},e,{columns:ma(e.columns)}),Ye(void 0,void 0,void 0,(function*(){const{fileName:e,fileType:l,exportType:n,startIndex:a=1,endIndex:r}=t,{tableFullData:o,selectionRows:s}=i.current;let d=[];if(f?("all"===n&&(d=yield F()),"custom"===n&&(d=yield F(r),d=d.slice(a-1))):("all"===n&&(d=o.slice(0)),"custom"===n&&(d=o.slice(a-1,r||void 0))),"selected"===n&&(d=s.slice(0).sort(((e,t)=>e.pageIndex-t.pageIndex))),"function"==typeof(null==y?void 0:y.beforeExport))try{d=null==y?void 0:y.beforeExport(d)}catch(e){}if("xlsx"===l){const l=yield D(t,d,P,A);Fn(l,`${e}.xlsx`),H(`${e}.xlsx`)}if("csv"===l){const l=_(t,M(t,d));Fn(l,`${e}.csv`),H(`${e}.csv`)}}))}})))}));bs.displayName="TableExport";const xs=e=>{const{columns:t,onClose:l}=e,{tableRef:n,tableBodyRef:a,prefixCls:r,dataChange:i}=q.default.useContext(Xr),{beforeClipboard:o}=n.current.props,{t:d}=Xe(),u=q.default.useRef(null),[c,f]=q.default.useState([{type:"INPUT_NUMBER",label:d("qm.table.clipboard.rowIndex"),fieldName:"rowIndex",options:{min:1},extra:{labelWidth:50},rules:[{required:!0}]},{type:"SELECT",label:d("qm.table.clipboard.colIndex"),fieldName:"colIndex",options:{itemList:t.map(((e,t)=>({value:t,text:qa(e.title)})))},rules:[{required:!0}],extra:{labelWidth:50}},{type:"TEXT_AREA",label:d("qm.table.clipboard.content"),fieldName:"content",placeholder:d("qm.table.clipboard.placeholder"),options:{autoSize:{minRows:4}},rules:[{required:!0}]}]),[p,m]=q.default.useState(!1);return q.default.createElement("div",{className:`${r}-clipboard__setting`},q.default.createElement("h3",{className:"info"},d("qm.table.clipboard.supportText")),q.default.createElement(wf,{ref:u,initialValues:{},initialExtras:{rowIndex:"行",colIndex:"列"},items:c,cols:1,labelWidth:100}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l(),style:{marginRight:8}},d("qm.table.export.closeButton")),q.default.createElement(ht,{type:"primary",loading:p,onClick:()=>Ye(void 0,void 0,void 0,(function*(){var e;const[r,c]=yield u.current.GET_FORM_DATA();if(r)return;const{tableFullData:f,store:p,fieldAuth:h}=n.current;m(!0);const g=c.content.trim().replace(/(\r|\n)$/,"");let v=g.replace(/"[^"]+"/g,"^");((null===(e=g.match(/"[^"]+"/g))||void 0===e?void 0:e.map((e=>e.replace(/"/g,"").replace(/\r|\n/g," "))))||[]).forEach((e=>{v=v.replace(/\^/,e)}));let y=v.split(/\r|\n/).map((e=>e.split(/\t/)));if("function"==typeof o)try{y=yield o(y,y[0].map(((e,l)=>t[c.colIndex+l].dataIndex)))}catch(r){}y.forEach(((e,l)=>{e.forEach(((e,n)=>{var a,r;const i=f[c.rowIndex-1+l],o=t[c.colIndex+n];if(i&&o){let t=!1;if(o.editRender){const e=o.editRender(i,o);t=!(e.disabled||(null===(a=e.extra)||void 0===a?void 0:a.disabled)||(null===(r=h[o.dataIndex])||void 0===r?void 0:r.disabled))}t&&o.dictItems&&(t=o.dictItems.some((t=>t.value==e))),t&&(La(i,o.dataIndex,e),p.addToUpdated(i))}}))})),a.current.forceUpdate(),i(),s.message.success(d("qm.table.clipboard.success",{total:y.length})),m(!1),l()}))},d("qm.table.clipboard.text"))))},Es=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,flattenColumns:a}=q.default.useContext(Xr),{t:r}=Xe(),[i,o]=q.default.useState(!1),s=q.default.useMemo((()=>(e=>e.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))))(a)),[a]),d=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:d})));const u={[`${n}-clipboard`]:!0},c={visible:i,title:r("qm.table.clipboard.settingTitle"),width:600,height:"auto",loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:J.default(u),title:r("qm.table.clipboard.textNoSpace"),onClick:()=>d()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CopyOutlined,null))),q.default.createElement(Qn,c,q.default.createElement(xs,{columns:s,onClose:()=>o(!1)})))}));Es.displayName="TableClipboard";const Cs=e=>{const{columns:t,onClose:l}=e,{tableRef:n,$size:a,selectionKeys:r,setSelectionKeysEffect:i}=q.default.useContext(Xr),{rowKey:o,rowSelection:s}=n.current.props,{t:d}=Xe(),u=q.default.useRef(null),c=Cn(u),f=e=>e.map((e=>{var t;const l={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)&&(l.children=f(e.children)),l})),[p,m]=q.default.useState([{title:d("qm.table.groupSummary.index"),dataIndex:"index",width:80,render:e=>e+1},...f(t.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))))]),[h]=q.default.useState((()=>{const{disabled:e}=s||{},t=n.current.selectionRows.map((e=>Object.assign(Object.assign({},e),{children:void 0})));return e?t.filter((t=>!e(t))):t})()),[g,v]=q.default.useState(300),y=wn((()=>{const e=u.current;v(e.offsetHeight-2*Yr[a]-30)}),5);return Ie((()=>{y()}),[c.width]),q.default.createElement("div",{ref:u,style:{height:"100%"}},q.default.createElement(Ku,{size:a,columns:p,dataSource:h,rowKey:o,height:g,rowSelection:{type:"checkbox",selectedRowKeys:r,onChange:e=>i(e)},webPagination:!0,ignorePageIndex:!0,showFastSearch:!1,showTableImport:!1,showSelectCollection:!1,showClipboard:!1,showFullScreen:!1,showColumnDefine:!1,columnsChange:e=>m(e)}),q.default.createElement("div",{style:{height:10}}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>l()},d("qm.table.selectCollection.closeButton"))))},ws=q.default.forwardRef(((e,t)=>{const{columns:l,open:n=!0}=e,{tableRef:a,getRowKey:r,prefixCls:i,selectionKeys:o,isFetch:s,isTableEmpty:d,setSelectionKeysEffect:u,setSelectionRows:c}=q.default.useContext(Xr),{rowSelection:f}=a.current.props,{t:p}=Xe(),[h,v]=q.default.useState(!1),y=q.default.useRef(!1);Ql((()=>{!y.current&&b()}),[d]);const b=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{fetchSelectedRows:t,disabled:l=(e=>!1)}=f;if(s&&t)try{const n=yield t.api(Object.assign({},{selectedKeys:o},t.params));if(200===n.code){let a=Array.isArray(n.data)?n.data:null!==(e=m.get(n.data,t.dataKey))&&void 0!==e?e:[];a=a.filter((e=>!l(e))),u(a.map(((e,t)=>r(e,t)))),c(a),y.current=!0}}catch(e){}})),x=()=>{v(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:x})));const E={visible:h,title:p("qm.table.selectCollection.settingTitle"),loading:!1,bodyStyle:{paddingBottom:"52px"},onClose:()=>v(!1)};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement("span",{className:`${i}-select-collection`,title:p("qm.table.selectCollection.text"),onClick:()=>x()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.CheckSquareOutlined,null))),q.default.createElement(Qn,E,q.default.createElement(Cs,{columns:l,onClose:()=>v(!1)})))}));ws.displayName="SelectCollection";const Ss=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,getRowKey:a,prefixCls:r,$size:i,tableFlatData:o,flattenColumns:d,setActivedCell:u,scrollXToColumn:c,scrollYToRecord:f}=q.default.useContext(Xr),{uniqueKey:p}=n.current.props,{t:m}=Xe(),{getTitleFromCellValue:h}=Si(),v=q.default.useRef(""),[y,b]=q.default.useState(""),[x,E]=q.default.useState([]),[C,w]=q.default.useState(0),[S,N]=q.default.useState(!1),[T,I]=q.default.useState({case:0,fullchar:0}),O=q.default.useMemo((()=>`${x.length>0?C+1:C}/${x.length}`),[C,x]);Ql((()=>{A(x[C])}),[C,x]);const R=e=>{I(Object.assign({},T,e))},k=(e,t,l)=>new Promise(((n,a)=>{s.Modal.confirm({title:m("qm.button.confirmPrompt"),content:e,onOk:()=>{t(),n()},onCancel:()=>{l(),n()}})})),L=Qe((e=>Ye(void 0,void 0,void 0,(function*(){if(!y)return v.current=y,P();const t=((e,t)=>{const l=new RegExp(T.fullchar?`^${t}$`:t,T.case?"":"i"),n=[];return e.forEach(((e,t)=>{d.forEach(((r,i)=>{const{dataIndex:o}=r;if([pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(o))return;const s=h(e,r,e.index,i);l.test(s)&&n.push({value:s,rowKey:a(e,e.index),dataIndex:o,rowIndex:t,colIndex:i})}))})),n})(o,y);if(!t.length)return s.Modal.warning({title:m("qm.button.confirmPrompt"),content:m("qm.table.fastSearch.notMatch")});if(E(t),"all"===e&&N(!0),y!==v.current)return v.current=y,w(0);if("next"===e){const e=C+1;e>t.length-1?yield k(m("qm.table.fastSearch.toTheEnd"),(()=>w(0)),(()=>{})):w(e)}if("prev"===e){const e=C-1;e<0?yield k(m("qm.table.fastSearch.toStart"),(()=>w(t.length-1)),(()=>{})):w(e)}})))),P=()=>{w(0),E([]),u({})},A=e=>{e&&(f(e.rowKey),c(e.dataIndex),u(e))},D=q.default.useMemo((()=>p?`fastSearch_${p}`:""),[p]),[_,F]=q.default.useState([]),[H,M]=q.default.useState(""),[$,j]=q.default.useState("");Ql((()=>{if($){const{input:e,config:t}=_.find((e=>e.value===$)).condition;b(e),I(t),setTimeout((()=>L()))}}),[$]),q.default.useEffect((()=>{K()}),[]);const K=()=>Ye(void 0,void 0,void 0,(function*(){if(!D)return;let e=yield fe.default.getItem(D);e||(e=yield V(D),Array.isArray(e)&&(yield fe.default.setItem(D,e))),Array.isArray(e)&&e.length&&F(e)})),V=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),z=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-fast-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement("div",{className:"search-box"},q.default.createElement("span",{className:"label"},m("qm.table.fastSearch.queryLabel"),":"),q.default.createElement(s.Input,{value:y,placeholder:m("qm.table.fastSearch.queryCondition"),allowClear:!0,style:{width:"100%"},onChange:e=>b(e.target.value)})),q.default.createElement("div",{className:"condition"},q.default.createElement(s.Checkbox,{checked:!!T.case,onChange:e=>R({case:e.target.checked})},m("qm.table.fastSearch.matchCase")),q.default.createElement(s.Checkbox,{checked:!!T.fullchar,onChange:e=>R({fullchar:e.target.checked})},m("qm.table.fastSearch.matchFullchar"))),q.default.createElement("div",{className:"all-list"},S&&q.default.createElement("table",{className:"rtable",tabIndex:-1,cellSpacing:"0",cellPadding:"0"},q.default.createElement("thead",null,q.default.createElement("tr",null,q.default.createElement("th",{style:{width:40,minWidth:40}},"#"),q.default.createElement("th",{style:{width:130,minWidth:130}},m("qm.table.fastSearch.cellText")),q.default.createElement("th",null,m("qm.table.fastSearch.valText")))),q.default.createElement("tbody",null,x.map(((e,t)=>q.default.createElement("tr",{key:t,className:J.default({active:C===t}),onClick:()=>w(t)},q.default.createElement("td",null,t+1),q.default.createElement("td",null,"Row:",e.rowIndex+1,", Col:",e.colIndex+1),q.default.createElement("td",null,e.value)))))))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(s.Input,{size:i,value:H,placeholder:m("qm.table.highSearch.configText"),disabled:!y,onChange:e=>{const{value:t}=e.target;M(t)}}),q.default.createElement(ht,{type:"primary",disabled:!H||!y,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!D)return mt("Table","必须设置组件参数 `uniqueKey` 才能保存");if(!y)return;const e=Ma(),t=[..._,{text:H,value:e,condition:{input:y,config:T}}];F(t),M(""),yield fe.default.setItem(D,t),yield z(D,t)}))},m("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${pi.rowHeightMaps[i]}px`}},q.default.createElement("span",null,m("qm.table.fastSearch.savedSetting"))),q.default.createElement("ul",null,_.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===$}),title:e.text,onClick:()=>{return t=e.value,void j(t!==$?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:m("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ye(void 0,void 0,void 0,(function*(){if(!l)return;const e=_.filter((e=>e.value!==l));F(e),yield fe.default.setItem(D,e),yield z(D,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!_.length&&q.default.createElement("div",{style:{padding:Jr}},q.default.createElement(hn,null)))))),q.default.createElement("div",{className:"bottom-bar",style:{position:"absolute",left:0,bottom:0,right:0,height:`${Yr[i]+20}px`,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",boxSizing:"border-box"}},q.default.createElement("div",null,m("qm.table.fastSearch.findTotal",{total:O})),q.default.createElement("div",null,q.default.createElement(ht,{onClick:()=>L("all"),style:{marginRight:8}},m("qm.table.fastSearch.queryAll")),q.default.createElement(ht,{type:"primary",onClick:()=>L("prev"),style:{marginRight:8}},m("qm.table.fastSearch.queryPrev")),q.default.createElement(ht,{type:"primary",onClick:()=>L("next"),style:{marginRight:8}},m("qm.table.fastSearch.queryNext")),q.default.createElement(ht,{onClick:()=>t()},m("qm.table.fastSearch.closeButton")))))},Ns=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n,$size:a}=q.default.useContext(Xr),{t:r}=Xe(),[i,o]=q.default.useState(!1),s=()=>{o(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:s})));const d={visible:i,title:r("qm.table.fastSearch.settingTitle"),width:650,loading:!1,bodyStyle:{paddingBottom:`${Yr[a]+20}px`},onClose:()=>o(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:r("qm.table.fastSearch.text"),onClick:()=>s()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.MonitorOutlined,null))),q.default.createElement(Qn,d,q.default.createElement(Ss,{onClose:()=>o(!1)})))}));Ns.displayName="FastSearch";var Ts={selectionColumnDefine:{title:"",dataIndex:"__selection__",width:80,fixed:"left"},indentWidth:16,groupMargin:15,separator:"^"};const Is=e=>[Ts.selectionColumnDefine,...e].filter((e=>!e.hidden)),Os=e=>e.some((e=>Array.isArray(e.children))),Rs=e=>void 0!==e._groupLevel,ks=(e,t)=>t.split(Ts.separator).reduce(((e,t)=>null==e?void 0:e[t]),e),Ls=e=>Array.isArray(e)?0:"object"==typeof e&&null!==e?1+Math.max(0,...Object.values(e).map(Ls)):0,Ps=(e,t="")=>Array.isArray(e)?[]:Object.keys(e).reduce(((l,n)=>{const a=t?`${t}${Ts.separator}${n}`:n;if(l.push(a),Array.isArray(e[n]))return l;const r=Ps(e[n],a);return l.concat(r)}),[]),As=(e,t=[],l)=>{const n=(e,t)=>{if(0===t.length)return e;const[{[Object.keys(t[0])[0]]:a}]=t,r=Object.keys(t[0])[0],i=t.slice(1),o=Object.groupBy(e,(e=>l(e,r))),s=Object.keys(o).sort(((e,t)=>{const l=(n=e,r=t,Number.isNaN(n-r)?n.toString().localeCompare(r.toString()):n-r);var n,r;return"ascend"===a?l:-l})),d={};return s.forEach((e=>{d[`#${e}`]=n(o[e],i)})),d};return n(e,t)},Ds={sum:e=>Da(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=>Da(e.length),unique:e=>new Set(e).size,empty:e=>e.filter((e=>ot(e))).length,notEmpty:e=>e.filter((e=>!ot(e))).length},_s=q.default.createContext(void 0),Fs=e=>{const{prefixCls:t,pivotProps:l,size:n,getRowKey:a,flatColumns:r,tableData:i}=e,{initialGroup:o,initialCount:s}=l,d=e=>{const t=new Map;return Ca(e).forEach((e=>t.set(a(e,e.index),e))),t},u=q.default.useRef({props:l,originGridData:i,flatGroupData:[],isTree:Os(i),keyRecordMap:d(i)}),[c,f]=q.default.useState({pivotRef:u,prefixCls:t,size:n,viewMode:"table",columns:r,gridData:i,groupGridData:[],groupList:o?(e=>{const t=[],l=r.map((e=>e.dataIndex));return e.forEach((e=>{l.includes(e.fieldName)&&["ascend","descend"].includes(e.order)&&t.push(e)})),t})(o):[],filterList:[],sorterList:[],colorList:[],expandedKeys:[],searchResults:[],switchIndex:0,fillColorCells:new Map,countMethod:s?(e=>{const t=["count","unique","empty","notEmpty","sum","max","min","avg"],l=r.map((e=>e.dataIndex)),n={};for(const a in e)l.includes(a)&&t.includes(e[a])&&(n[a]=e[a]);return n})(s):{},summationData:{}}),p=e=>{f((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))};Ie((()=>{g(i),m("originGridData",i),m("isTree",Os(i)),m("keyRecordMap",d(i))}),[i]),Ie((()=>{h(r)}),[r]),Ie((()=>{p({size:n})}),[n]);const m=(e,t)=>{c.pivotRef.current[e]=t};m("props",l);const h=e=>{p({columns:e})},g=e=>{p({gridData:e})},v=e=>{p({groupGridData:e})},y=e=>{p({groupList:e})},b=e=>{p({filterList:e})},x=e=>{p({sorterList:e})},E=e=>{p({colorList:e})},C=e=>{p({expandedKeys:e})},w=e=>{p({searchResults:e})},S=e=>{p({switchIndex:e})},N=e=>{const t=new Map;e.forEach((e=>t.set(`${e.rowKey}|${e.dataIndex}`,e.color))),p({fillColorCells:t})},T=e=>{var t;p({countMethod:(t=Object.assign({},c.countMethod,e),Object.fromEntries(Object.entries(t).filter((([e,t])=>void 0!==t))))})},I=e=>{p({summationData:e})},O=q.default.useMemo((()=>Object.assign(Object.assign({},c),{setContext:p,getRowKey:a,setPivotGridRef:m,setColumns:h,setGridData:g,setGroupGridData:v,setGroupList:y,setFilterList:b,setSorterList:x,setColorList:E,setExpandedKeys:C,setSearchResults:w,setSwitchIndex:S,setFillColor:N,setCountMethod:T,setSummationData:I})),[c]);return q.default.createElement(_s.Provider,{value:O},e.children)},Hs=()=>q.default.useContext(_s),Ms=()=>{const{prefixCls:e,pivotRef:t,groupList:l,columns:n,gridData:a,setGroupList:r,setExpandedKeys:i,setGroupGridData:o,setPivotGridRef:d}=Hs(),{originGridData:u}=t.current,{onGroupChange:c,onDataChange:f}=t.current.props,{t:p}=Xe(),h=q.default.useRef([]),v=q.default.useRef([]),y=q.default.useMemo((()=>l.filter((e=>e.fieldName&&e.order))),[l]),b=q.default.useMemo((()=>n.map((e=>({label:qa(e.title),value:e.dataIndex,disabled:l.some((t=>t.fieldName===e.dataIndex))})))),[l,n]),x=q.default.useMemo((()=>{const e=y.map((e=>({[e.fieldName]:e.order})));return m.isEqual(e,h.current)?h.current:(h.current=e,e)}),[y]),E=[{label:p("qm.pivotGrid.group.ascend"),value:"ascend"},{label:p("qm.pivotGrid.group.descend"),value:"descend"}];q.default.useEffect((()=>{i(v.current)}),[x,u]),q.default.useLayoutEffect((()=>{const e=As(a,x,((e,t)=>{let l=ka(e,t);return m.isPlainObject(l)&&(l=Object.values(l)),Array.isArray(l)&&(l=l.join(",")),ot(l)?p("qm.pivotGrid.group.empty"):l}));var t;o(e),t=Ps(e),v.current=t,d("flatGroupData",((e,t=[])=>{const l=[];return function e(n,a,r=""){if(Array.isArray(n))n.forEach(((e,t)=>{e._varIndex=t,r?e._parentRowKey=r:delete e._parentRowKey})),l.push(...Ca(n));else for(const i in n){const o=r?`${r}${Ts.separator}${i}`:i,s=Object.keys(t[a])[0];l.push({id:o,_fieldName:s,_groupLevel:a}),e(n[i],a+1,o)}}(e,0),l})(e,x))}),[x,a]),Ql((()=>{null==c||c(y)}),[x]),Ql((()=>{null==f||f(a)}),[a]);const C=()=>{r([...l,{fieldName:"",order:"ascend"}])},w=(e,t,n)=>{Object.assign(t,{[e]:n}),r([...l])},S=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(s.Select,{value:e.fieldName||void 0,placeholder:p("qm.table.editable.selectPlaceholder"),options:b,style:{width:160,margin:"0 10px"},onChange:t=>w("fieldName",e,t)}),q.default.createElement(s.Select,{value:e.order,options:E,placeholder:p("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>w("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(l.filter((t=>t!==e)))})(e)}));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,p("qm.pivotGrid.group.title")),!!y.length&&q.default.createElement("div",null,q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>i([])},p("qm.pivotGrid.group.foldAll")),q.default.createElement("button",{className:"button-icon no-hover-bg",onClick:()=>i(v.current)},p("qm.pivotGrid.group.unfoldAll")))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{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));m.isEqual(t,n)||r(e)}},l.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},S(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:C},q.default.createElement(g.PlusOutlined,{className:"icon"}),p("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!y.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FolderOpenOutlined,{className:"icon"}),p("qm.pivotGrid.group.text"),y.length?`(${y.length})`:null))},$s=()=>{const{prefixCls:e,pivotRef:t,columns:l,filterList:n,setFilterList:a,setGridData:r}=Hs(),{originGridData:i,isTree:o}=t.current,{onFilterChange:d}=t.current.props,{t:u}=Xe(),c=q.default.useRef([]),f=q.default.useMemo((()=>n.filter((e=>e.fieldName&&("nil"===e.expression||!ot(e.value))))),[n]),p=q.default.useMemo((()=>l.map((e=>({label:qa(e.title),value:e.dataIndex})))),[l]),[h,v]=q.default.useState("and"),y=q.default.useMemo((()=>{const e=f.map((e=>{var t;return`${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}));return m.isEqual(e,c.current)?c.current:(c.current=e,e)}),[f]);Ql((()=>{a(n.map((e=>Object.assign(Object.assign({},e),{logic:h}))))}),[h]),Ql((()=>{b(),null==d||d(f)}),[y]);const b=wn((()=>{const e=Ka(f.map((e=>Object.assign(Object.assign({},dt(e,["value"])),{expression:"nil"!==e.expression?e.expression:"==",condition:e.value}))));r(e?fa(i,e,o):i)}),200),x=[{label:u("qm.pivotGrid.filter.matchAll"),value:"and"},{label:u("qm.pivotGrid.filter.matchAny"),value:"or"}],E=()=>{a([...n,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:h}])},C=(e,t,r)=>{var i;if(Object.assign(t,{[e]:r}),"fieldName"===e){const e=(null===(i=l.find((e=>e.dataIndex===r)).filter)||void 0===i?void 0:i.type)||"text";Object.assign(t,{type:e,expression:S(e)[0].value,value:""})}"expression"===e&&"nil"===r&&Object.assign(t,{value:""}),a([...n])},w=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Select,{value:e.fieldName||void 0,options:p,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>C("fieldName",e,t)}),q.default.createElement(s.Select,{value:e.expression||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),options:S(e.type),style:{width:100,margin:"0 10px"},onChange:t=>C("expression",e,t)}),N(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{a(n.filter((t=>t!==e)))})(e)})),S=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",label:u("qm.table.highSearch.gtText")},{value:"<",label:u("qm.table.highSearch.ltText")},{value:">=",label:u("qm.table.highSearch.gteText")},{value:"<=",label:u("qm.table.highSearch.lteText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",label:u("qm.table.highSearch.inText")},{value:"nin",label:u("qm.table.highSearch.ninText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",label:u("qm.table.highSearch.likeText")},{value:"==",label:u("qm.table.highSearch.eqText")},{value:"!=",label:u("qm.table.highSearch.neqText")},{value:"nil",label:u("qm.table.highSearch.nullText")}]}return t},N=e=>{var t,n;switch(e.type){case"number":return q.default.createElement(s.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{C("value",e,ot(t)?"":t)}});case"date":return q.default.createElement(qe,{popupClassName:pi.popupClassName,defaultValue:null!==(t=Fa(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{C("value",e,Ha(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(n=l.find((t=>t.dataIndex===e.fieldName)))||void 0===n?void 0:n.dictItems)||[];return q.default.createElement(s.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:u("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{C("value",e,t)}},t.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(s.Input,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{C("value",e,t.target.value)}})}};return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,u("qm.pivotGrid.filter.title")),!!f.length&&q.default.createElement(s.Select,{value:h,options:x,style:{width:130},onChange:e=>v(e)})),q.default.createElement("div",{className:"list"},n.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},w(e))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:E},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!f.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.FilterOutlined,{className:"icon"}),u("qm.pivotGrid.filter.text"),f.length?`(${f.length})`:null))},qs=()=>{const{prefixCls:e,pivotRef:t,columns:l,gridData:n,sorterList:a,setSorterList:r,setGridData:i}=Hs(),{onSorterChange:o}=t.current.props,{t:d}=Xe(),u=q.default.useMemo((()=>a.filter((e=>e.fieldName&&e.order))),[a]),c=q.default.useMemo((()=>l.map((e=>({label:qa(e.title),value:e.dataIndex,disabled:a.some((t=>t.fieldName===e.dataIndex))})))),[a,l]);Ql((()=>{h(),null==o||o(u)}),[q.default.useMemo((()=>u.map((e=>Object.values(e).join(":"))).join(",")),[u])]);const f=[{label:d("qm.pivotGrid.sorter.ascend"),value:"ascend"},{label:d("qm.pivotGrid.sorter.descend"),value:"descend"}],p=(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;i((e=u,n.sort(((t,l)=>{for(const n of e){const{fieldName:e,order:a}=n,r=ka(t,e),i=ka(l,e),o=p(r,i);if(0!==o)return"ascend"===a?o:-o}return 0})).slice(0)))},v=()=>{r([...a,{fieldName:"",order:"ascend"}])},y=(e,t,l)=>{Object.assign(t,{[e]:l}),r([...a])},b=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(s.Select,{value:e.fieldName||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),options:c,style:{width:160,margin:"0 10px"},onChange:t=>y("fieldName",e,t)}),q.default.createElement(s.Select,{value:e.order,options:f,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:100},onChange:t=>y("order",e,t)}),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(a.filter((t=>t!==e)))})(e)}));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,d("qm.pivotGrid.sorter.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.fieldName)),l=a.map((e=>e.fieldName));m.isEqual(t,l)||r(e)}},a.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},b(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:v},q.default.createElement(g.PlusOutlined,{className:"icon"}),d("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!u.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.SortAscendingOutlined,{className:"icon"}),d("qm.pivotGrid.sorter.text"),u.length?`(${u.length})`:null))},js=()=>{const{prefixCls:e,getRowKey:t,gridData:l,columns:n,searchResults:a,switchIndex:r,setSearchResults:i,setSwitchIndex:o}=Hs(),{t:d}=Xe(),{getTitleFromCellValue:u}=Si(),[c,f]=q.default.useState(!1),p=q.default.useMemo((()=>a.length),[a]);Ql((()=>{c||setTimeout((()=>{o(0),i([])}),200)}),[c]);const m=(e,l)=>{const a=[];return e.forEach(((e,r)=>{n.forEach(((n,i)=>{const o=u(e,n,r,i)+"";o.includes(l)&&a.push({value:o,rowKey:t(e,e.index),dataIndex:n.dataIndex})})),Array.isArray(e.children)&&a.push(...m(e.children,l))})),a},h=wn((e=>{const t=e.target.value.trim();o(0),i(t?m(l,t):[])}),200),v=e=>{const{keyCode:t}=e;e.preventDefault(),13===t&&y()},y=()=>{if(!p)return;o((r+1)%p)},b=()=>q.default.createElement("div",{className:"search-switch"},q.default.createElement("button",{className:"button-icon",onClick:()=>(()=>{if(!p)return;o((r-1+p)%p)})()},q.default.createElement(g.LeftOutlined,null)),q.default.createElement("span",{className:"num"},p>0?r+1:r,"/",p),q.default.createElement("button",{className:"button-icon",onClick:()=>y()},q.default.createElement(g.RightOutlined,null)));return q.default.createElement(s.Dropdown,{open:c,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,d("qm.pivotGrid.search.title")),q.default.createElement("button",{className:"button-icon",onClick:()=>f(!1)},q.default.createElement(g.CloseOutlined,null))),q.default.createElement("div",{className:"list search",style:{margin:"10px 0"}},q.default.createElement(s.Input,{autoFocus:!0,style:{width:280},suffix:b(),onChange:h,onKeyUp:v}))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300},destroyPopupOnHide:!0},q.default.createElement("span",{onClick:()=>f(!c)},q.default.createElement(g.MonitorOutlined,{className:"icon"}),d("qm.pivotGrid.search.text")))},Ks=(e,t)=>e.map((e=>(e.children&&(e.children=Ks(e.children,t)),t(e)))),Vs=()=>{const{prefixCls:e,pivotRef:t,columns:l,setColumns:n}=Hs(),{uniqueKey:a,onColumnsChange:r}=t.current.props,{t:i}=Xe(),o=q.default.useMemo((()=>a?`grid_field_${a}`:""),[a]);q.default.useLayoutEffect((()=>{d()}),[]),Ql((()=>{c(l)}),[l]);const d=()=>{const e=f();e&&(null==r||r(e))},u=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=u(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)})),c=e=>{if(!o)return;const t=u(e),l=JSON.parse(localStorage.getItem(o));m.isEqual(t,l)||localStorage.setItem(o,JSON.stringify(t))},f=()=>{if(!o)return;const e=JSON.parse(localStorage.getItem(o));if(!e)return;return m.xor(e.map((e=>e.dataIndex)),l.map((e=>e.dataIndex))).length>0?Ks(l,(t=>{const l=e.find((e=>e.dataIndex===t.dataIndex));return l&&(void 0!==l.hidden&&(t.hidden=l.hidden),void 0!==l.fixed&&(t.fixed=l.fixed),void 0!==l.width&&(t.width=l.width),void 0!==l.renderWidth&&(t.renderWidth=l.renderWidth)),t})):Ks(e,(e=>{const t=l.find((t=>t.dataIndex===e.dataIndex));return t&&void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},p=q.default.useMemo((()=>{let e=0;for(let t=0;t<l.length-1&&("left"!==l[t].fixed||l[t+1].fixed||(e=t+1),!(e>0));t++);const t=[];for(let n=0;n<l.length;n++)n===e&&t.push({title:"",dataIndex:"__divider__"}),t.push(l[n]);return t}),[l]),h=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container","scroll-y"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,i("qm.pivotGrid.field.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".handle",tag:"ul",animation:200,list:p,setList:e=>{const t=e.map((e=>e.dataIndex)),l=p.map((e=>e.dataIndex));m.isEqual(t,l)||(e=>{const t=e.findIndex((e=>"__divider__"===e.dataIndex)),l=[];for(let n=0;n<e.length;n++){const a=e[n];n<t?a.fixed="left":delete a.fixed,n!==t&&l.push(a)}n(l),null==r||r(l)})(Ya(e))}},p.map((e=>"__divider__"!==e.dataIndex?q.default.createElement("li",{key:e.dataIndex,className:"ant-dropdown-menu-item sort-item"},q.default.createElement(g.HolderOutlined,{className:"handle"}),q.default.createElement("span",{className:"label"},q.default.createElement("span",{className:"title"},qa(e.title)),q.default.createElement("button",{className:"button-icon",onClick:()=>(e=>{e.hidden=!e.hidden;const t=[...l];n(t),null==r||r(t)})(e)},e.hidden?q.default.createElement(g.EyeInvisibleOutlined,null):q.default.createElement(g.EyeOutlined,null)))):q.default.createElement("li",{key:e.dataIndex,className:"divider"}))))));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>h(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:240}},q.default.createElement("span",null,q.default.createElement(g.SettingOutlined,{className:"icon"}),i("qm.pivotGrid.field.text")))},zs=()=>{const{prefixCls:e,size:t,setContext:l}=Hs(),{t:n}=Xe(),a=[{label:n("qm.pivotGrid.lineHeight.size")[0],value:"small"},{label:n("qm.pivotGrid.lineHeight.size")[1],value:"middle"},{label:n("qm.pivotGrid.lineHeight.size")[2],value:"large"}];return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},a.map((e=>q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t===e.value}),onClick:()=>l({size:e.value})},q.default.createElement("span",{className:"label"},e.label),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null))))))),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:160}},q.default.createElement("span",null,q.default.createElement(g.ColumnHeightOutlined,{className:"icon"}),n("qm.pivotGrid.lineHeight.text")))},Ws="606060",Bs="thin",Us="d4d4d4",Gs=(e,t)=>{t&&(e.height=Math.floor(.75*t))},Ys=(e,t)=>{e.protection={locked:!1},e.alignment={vertical:"middle",horizontal:t||"left"}},Xs=()=>({top:{style:Bs,color:{argb:Us}},left:{style:Bs,color:{argb:Us}},bottom:{style:Bs,color:{argb:Us}},right:{style:Bs,color:{argb:Us}}}),Qs=e=>{const{precision:t,formatType:l}=e,n=t>=0&&t?`.${"0".repeat(t)}`:"";return"percent"===l?{numFmt:n?`0${n}%`:"0%"}:"finance"===l?{numFmt:n?`#,##0${n}`:"#,##0"}:n?{numFmt:`0${n}`}:null},Zs=()=>{const{prefixCls:e,pivotRef:t,columns:l,countMethod:n,summationData:a}=Hs(),{t:r}=Xe(),{exportXLSX:i}=(()=>{const{size:e}=Hs(),{t:t}=Xe(),{rowHeightMaps:l}=pi,n=(e,t)=>{var l,n,a;return null!==(a=null!==(n=null===(l=e.find((e=>e.text==t)))||void 0===l?void 0:l.value)&&void 0!==n?n:t)&&void 0!==a?a:""};return{exportXLSX:(n,a,r,i)=>Ye(void 0,void 0,void 0,(function*(){const{columns:o,footSummation:s}=n,d=l[e],u=pa(o),c=[],f=[],p=[];let m=0;const h={};u.forEach((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;h[t]=qa(e.title),p.push({key:t,width:(l||n)/8})})),c.push(h),m+=c.length;const g=a.map(((e,t)=>{const l={};return u.forEach(((n,a)=>{const r=["percent","finance"].includes(n.formatType);l[n.dataIndex]=r?ka(e,n.dataIndex):i(e,t,n,a)})),l._level=e._level,l._groupLevel=e._groupLevel,l}));m+=g.length,s&&r(u,a).forEach(((e,l)=>{const n={};u.forEach(((l,r)=>{const{dataIndex:i,summation:o}=l,s=(null==o?void 0:o.render)?o.render(a):ka(e,i);n[i]=0===r&&""===s?t("qm.table.config.summaryText"):et(s)?$a(s).join(""):s})),f.push(n)}));const{sheetName:v,useStyle:y}=n,b=new ce.default.Workbook,x=b.addWorksheet(v);x.columns=p,x.addRows(c).forEach((e=>{y&&Gs(e,d),e.eachCell((e=>{const t=x.getColumn(e.col),l=va(o,t.key),{align:n,theadAlign:a}=l;Ys(e,a||n),y&&Object.assign(e,{font:{bold:!0,color:{argb:Ws}},fill:{type:"pattern",pattern:"solid",fgColor:{argb:"f5f5f5"}},border:Xs()})}))})),x.addRows(g).forEach(((e,t)=>{const{_level:l,_groupLevel:n}=g[t];y&&Gs(e,d),e.eachCell(((e,t)=>{const a=x.getColumn(e.col),r=va(o,a.key),{align:i}=r;Ys(e,1===t||void 0===n?i:"right"),Object.assign(e,Qs(r)),y&&Object.assign(e,{font:{color:{argb:Ws}},border:Xs()}),1===Number(e.col)&&l&&(e.alignment=Object.assign(Object.assign({},e.alignment),{indent:l}))}))})),s&&x.addRows(f).forEach((e=>{y&&Gs(e,d),e.eachCell(((e,t)=>{const l=x.getColumn(e.col),n=va(o,l.key),{align:a}=n;Ys(e,1===t?a:"right"),Object.assign(e,Qs(n)),y&&Object.assign(e,{font:{color:{argb:Ws}},border:Xs()})}))})),[].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,l)=>{const{columns:a,file:r}=e,i=pa(a),o=new FileReader;o.onerror=()=>{s.message.error(t("qm.table.import.error"))},o.onload=e=>{const a=i.map((e=>qa(e.title))),r=new ce.default.Workbook,o=e.target;o?r.xlsx.load(o.result).then((e=>{const r=e.worksheets[0];if(r){const e=r.getSheetValues(),o=e.findIndex((e=>e&&e.length>0)),d=e[o],u=((e,t)=>t.some((t=>e.indexOf(t)>-1)))(a,d);if(u){const t=e.slice(o+1).map((e=>{const t={};e.forEach(((e,l)=>{var n;let a=e;Array.isArray(null==a?void 0:a.richText)&&(a=a.richText.map((e=>e.text)).join("")),m.isPlainObject(a)&&"text"in a&&(a=a.text),m.isDate(a)&&(a=Ha(a,ni)),(null==a?void 0:a.formula)&&(a=null!==(n=a.result)&&void 0!==n?n:a.value),t[d[l]]=a}));const l={};return a.forEach(((e,a)=>{var r;const{dataIndex:o,dictItems:s}=i[a];Array.isArray(s)&&((null===(r=t[e])||void 0===r?void 0:r.toString().includes(","))?t[e]=t[e].split(",").map((e=>n(s,e))).filter((e=>""!==e)):t[e]=n(s,t[e])),La(l,o,t[e])})),l}));null==l||l(t)}else s.message.error(t("qm.table.import.error"))}else s.message.error(t("qm.table.import.error"))})):s.message.error(t("qm.table.import.error"))},o.readAsArrayBuffer(r)}}})(),{getTitleFromCellValue:o}=Si(),d=[{text:r("qm.pivotGrid.count.records"),value:"count"},{text:r("qm.pivotGrid.count.unique"),value:"unique"},{text:r("qm.pivotGrid.count.empty"),value:"empty"},{text:r("qm.pivotGrid.count.notEmpty"),value:"notEmpty"},{text:r("qm.pivotGrid.count.sum"),value:"sum"},{text:r("qm.pivotGrid.count.max"),value:"max"},{text:r("qm.pivotGrid.count.min"),value:"min"},{text:r("qm.pivotGrid.count.avg"),value:"avg"}],u={columns:ma(l),fileName:j.default().format(ai),fileType:"xlsx",sheetName:"sheet1",footSummation:!1,useStyle:!1},c=(e,t,l,n)=>{const{dataIndex:a,precision:r,formatType:i}=l;if(Rs(e))return ka(e,a);let s=o(e,l,t,n);return r>=0&&!i&&""!==s&&(s=Number(s)),s},f=()=>{if(!n||!Object.keys(n).length)return[];const e={};return u.columns.map((e=>e.dataIndex)).forEach(((t,l)=>{if(l>0){let l="";(null==n?void 0:n[t])&&(l=d.find((e=>e.value===n[t])).text+" "+a.total[t]),La(e,t,l)}})),[e]},p=e=>Ye(void 0,void 0,void 0,(function*(){const t=yield i(Object.assign(Object.assign({},u),{footSummation:!!Object.keys(n).length}),e,f,c);Fn(t,`${j.default().format(ai)}.xlsx`)})),h=[{key:"1",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.FolderOutlined,{style:{marginRight:4}})," ",r("qm.pivotGrid.export.group")),onClick:()=>{p((()=>{const e=[];let r=0;return t.current.flatGroupData.forEach((t=>{const i=Object.assign({},t);Rs(t)?(i._level=t._groupLevel,u.columns.map((e=>e.dataIndex)).forEach(((e,r)=>{if(0===r)La(i,e,o(t._record,l.find((e=>e.dataIndex===t._fieldName)),0,0));else{let l="";(null==n?void 0:n[e])&&(l=d.find((t=>t.value===n[e])).text+" "+ks(a,t.id).subtotal[e]),La(i,e,l)}})),r=t._groupLevel):r>0&&(i._level=t._level+r+1),e.push(i)})),e})())}},{key:"2",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(g.BarsOutlined,{style:{marginRight:4}})," ",r("qm.pivotGrid.export.list")),onClick:()=>{p(Array.from(t.current.keyRecordMap.values()))}}];return q.default.createElement(s.Dropdown,{trigger:["click"],menu:{items:h},className:J.default("action-btn"),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:140}},q.default.createElement("span",null,q.default.createElement(g.DownloadOutlined,{className:"icon"}),r("qm.pivotGrid.export.text")))},Js=()=>{const{prefixCls:e,pivotRef:t,groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i,setContext:o}=Hs(),{uniqueKey:d}=t.current.props,{t:u}=Xe(),c=q.default.useMemo((()=>d?`grid_conf_${d}`:""),[d]),f=q.default.useRef({}),[p,m]=q.default.useState([]),[h,v]=q.default.useState({}),[y,b]=q.default.useState(""),x=(e,t)=>{v((l=>Object.assign({},l,{[e]:null!=t?t:!l[e]})))};q.default.useLayoutEffect((()=>{E()}),[]),Ql((()=>{C()}),[p]);const E=()=>Ye(void 0,void 0,void 0,(function*(){try{if(!c)return;const e=yield fe.default.getItem(c);Array.isArray(e)&&(m(e),v(e.reduce(((e,t)=>(t.id&&(e[t.id]=!1),e)),{})))}catch(e){}})),C=()=>Ye(void 0,void 0,void 0,(function*(){try{if(!c)return;yield fe.default.setItem(c,p)}catch(e){}})),w=()=>{const e=Ma();m([{id:e,label:j.default().format(ai),value:{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}},...p]),rt((()=>x(e,!0)))},S=()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"label",style:{padding:"6px 15px 10px"}},q.default.createElement("span",null,u("qm.pivotGrid.saved.title"))),q.default.createElement("div",{className:"list"},q.default.createElement("ul",null,p.map((e=>q.default.createElement("li",{key:e.id,className:J.default("ant-dropdown-menu-item sort-item",{active:e.id===y}),onClick:()=>(e=>{if(h[e.id])return;const t=y!==e.id,l=t?e.value:f.current;o({groupList:l.groupList,filterList:l.filterList,sorterList:l.sorterList,colorList:l.colorList,countMethod:l.countMethod}),b(t?e.id:"")})(e)},q.default.createElement("div",{className:"label",style:{width:200}},h[e.id]?q.default.createElement(s.Input,{size:"small",autoFocus:!0,defaultValue:e.label,style:{width:"100%",marginLeft:-8},onBlur:t=>{const{value:l}=t.target;l!==e.label&&(e.label=l,m([...p])),x(e.id,!1)}}):q.default.createElement("span",null,e.label)),q.default.createElement("button",{className:"button-icon",onClick:t=>{t.stopPropagation(),x(e.id)}},h[e.id]?q.default.createElement(g.CheckOutlined,null):q.default.createElement(g.EditOutlined,null)),q.default.createElement("button",{className:"button-icon",style:{marginLeft:4},onClick:t=>{var l;t.stopPropagation(),l=e.id,m(p.filter((e=>e.id!==l)))}},q.default.createElement(g.CloseOutlined,null))))))),q.default.createElement("div",{className:"add-record",style:{padding:10}},q.default.createElement("span",{className:"insert",onClick:w},q.default.createElement(g.PlusOutlined,{className:"icon"}),u("qm.pivotGrid.saved.add"))));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>S(),className:"action-btn",overlayClassName:`${e}__popper`,placement:"bottomRight",overlayStyle:{minWidth:280},onOpenChange:e=>{var t;t=e?{groupList:l,filterList:n,sorterList:a,colorList:r,countMethod:i}:{},f.current=t}},q.default.createElement("span",null,q.default.createElement(g.SaveOutlined,{className:"icon"}),u("qm.pivotGrid.saved.text")))},ed=()=>{const{gridData:e}=Hs(),{t:t}=Xe();return q.default.createElement("div",{className:"alert-info"},q.default.createElement(g.InfoCircleOutlined,{className:"icon"}),t("qm.table.alert.total",{total:(()=>{let t=0;return function e(l){l.forEach((l=>{Array.isArray(l.children)&&e(l.children),t+=1}))}(e),t})()}))},td=8;const ld={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"]}},nd={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"]}},ad=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function rd(e){const{arrowWidth:t,autoAdjustOverflow:l,arrowPointAtCenter:n,offset:a,borderRadius:r,visibleFirst:i}=e,o=t/2,s={};return Object.keys(ld).forEach((e=>{const d=n&&nd[e]||ld[e],u=Object.assign(Object.assign({},d),{offset:[0,0],dynamicInset:!0});switch(s[e]=u,ad.has(e)&&(u.autoArrow=!1),e){case"top":case"topLeft":case"topRight":u.offset[1]=-o-a;break;case"bottom":case"bottomLeft":case"bottomRight":u.offset[1]=o+a;break;case"left":case"leftTop":case"leftBottom":u.offset[0]=-o-a;break;case"right":case"rightTop":case"rightBottom":u.offset[0]=o+a}const c=function(e){const{contentRadius:t,limitVerticalRadius:l}=e,n=t>12?t+2:12;return{arrowOffsetHorizontal:n,arrowOffsetVertical:l?td:n}}({contentRadius:r,limitVerticalRadius:!0});if(n)switch(e){case"topLeft":case"bottomLeft":u.offset[0]=-c.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":u.offset[0]=c.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":u.offset[1]=2*-c.arrowOffsetHorizontal+o;break;case"leftBottom":case"rightBottom":u.offset[1]=2*c.arrowOffsetHorizontal-o}u.overflow=function(e,t,l,n){if(!1===n)return{adjustX:!1,adjustY:!1};const a=n&&"object"==typeof n?n:{},r={};switch(e){case"top":case"bottom":r.shiftX=2*t.arrowOffsetHorizontal+l,r.shiftY=!0,r.adjustY=!0;break;case"left":case"right":r.shiftY=2*t.arrowOffsetVertical+l,r.shiftX=!0,r.adjustX=!0}const i=Object.assign(Object.assign({},r),a);return i.shiftX||(i.adjustX=!0),i.shiftY||(i.adjustY=!0),i}(e,c,t,l),i&&(u.htmlRegion="visibleFirst")})),s}const id=e=>{const{value:t,defaultValue:l,disabled:n,disabledAlpha:a,className:r,style:i,onChange:o,onChangeComplete:s}=e,[d,u]=hi("",{value:t,defaultValue:l}),c=e=>({hex:e.toHexString(),rgb:e.toRgbString(),hsb:e.toHsbString()}),f=rd({offset:0,arrowWidth:16,borderRadius:6}),p=yt("color-picker");return q.default.createElement(pe.default,{action:["click"],prefixCls:p,popupPlacement:"bottomLeft",builtinPlacements:f,popup:()=>q.default.createElement(me.default,{prefixCls:p,value:d,disabled:n,disabledAlpha:a,onChange:(e,t)=>{u(e.toRgbString()),null==o||o(c(e),t)},onChangeComplete:(e,t)=>{null==s||s(c(e),t)}})},q.default.createElement("div",{className:J.default(`${p}-btn`,r),style:i},q.default.createElement(L.ColorBlock,{color:d,prefixCls:p})))};id.displayName="ColorPicker";const od=()=>{const{prefixCls:e,pivotRef:t,getRowKey:l,columns:n,colorList:a,setColorList:r,setFillColor:i}=Hs(),{flatGroupData:o}=t.current,{t:d}=Xe(),u=q.default.useRef([]),c=q.default.useMemo((()=>a.filter((e=>e.fieldName&&e.color&&("nil"===e.expression||!ot(e.value)||"col"===e.mode)))),[a]),f=q.default.useMemo((()=>n.map((e=>({label:qa(e.title),value:e.dataIndex})))),[n]),p=q.default.useMemo((()=>Is(n)),[n]),h=[{label:d("qm.pivotGrid.fillColor.cell"),value:"cell"},{label:d("qm.pivotGrid.fillColor.row"),value:"row"},{label:d("qm.pivotGrid.fillColor.col"),value:"col"}];Ql((()=>{v()}),[q.default.useMemo((()=>{const e=c.map((e=>{var t;return{[e.color]:`${e.mode},${e.fieldName},${e.expression},${null!==(t=e.value)&&void 0!==t?t:""}`}}));return m.isEqual(e,u.current)?u.current:(u.current=e,e)}),[c])]);const v=wn((()=>{const e=[];c.forEach((t=>{const n=Ka([Object.assign(Object.assign({},dt(t,["value"])),{expression:"nil"!==t.expression?t.expression:"==",condition:t.value})]),a=fa(o.filter((e=>!Rs(e))),n);if("cell"===t.mode||"col"===t.mode)for(let n=0;n<a.length;n++)e.push({color:t.color,rowKey:l(a[n],a[n].index),dataIndex:t.fieldName});if("row"===t.mode)for(let n=0;n<a.length;n++){const r=l(a[n],a[n].index);for(let l=0;l<p.length;l++)e.push({color:t.color,rowKey:r,dataIndex:p[l].dataIndex})}})),i(e)}),200),y=()=>{r([...a,{type:"",bracketLeft:"",fieldName:"",expression:"",value:null,bracketRight:"",logic:"and",color:"",mode:"cell"}])},b=(e,t,l)=>{var i;if(Object.assign(t,{[e]:l}),"fieldName"===e){const e=(null===(i=n.find((e=>e.dataIndex===l)).filter)||void 0===i?void 0:i.type)||"text";Object.assign(t,{type:e,expression:x(e)[0].value,value:""})}"expression"===e&&"nil"===l&&Object.assign(t,{value:""}),r([...a])},x=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},E=e=>q.default.createElement(q.default.Fragment,null,q.default.createElement(g.HolderOutlined,{className:"icon handle"}),q.default.createElement(id,{defaultValue:e.color,style:{marginLeft:5},onChangeComplete:t=>b("color",e,t.hex)}),q.default.createElement(s.Select,{value:e.mode,options:h,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:90,marginLeft:10,marginRight:20},onChange:t=>b("mode",e,t)}),q.default.createElement(s.Select,{value:e.fieldName||void 0,options:f,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>b("fieldName",e,t)}),"col"!==e.mode&&q.default.createElement(s.Select,{value:e.expression||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),options:x(e.type),style:{width:100,margin:"0 10px"},onChange:t=>b("expression",e,t)}),"col"!==e.mode&&(e=>{var t,l;switch(e.type){case"number":return q.default.createElement(s.InputNumber,{defaultValue:e.value,style:{width:150},onChange:t=>{b("value",e,ot(t)?"":t)}});case"date":return q.default.createElement(qe,{popupClassName:pi.popupClassName,defaultValue:null!==(t=Fa(e.value,"YYYY-MM-DD"))&&void 0!==t?t:void 0,picker:"date",allowClear:!0,style:{width:150},onChange:t=>{b("value",e,Ha(t,"YYYY-MM-DD"))}});case"checkbox":case"radio":{const t=(null===(l=n.find((t=>t.dataIndex===e.fieldName)))||void 0===l?void 0:l.dictItems)||[];return q.default.createElement(s.Select,{mode:"checkbox"===e.type?"multiple":void 0,defaultValue:e.value||void 0,placeholder:d("qm.table.editable.selectPlaceholder"),style:{width:150},onChange:t=>{b("value",e,t)}},t.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))}default:return q.default.createElement(s.Input,{value:e.value,style:{width:150},disabled:"nil"===e.expression,onChange:t=>{b("value",e,t.target.value)}})}})(e),q.default.createElement(g.CloseOutlined,{className:"icon close",onClick:()=>(e=>{r(a.filter((t=>t!==e)))})(e)}));return q.default.createElement(s.Dropdown,{trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container")},q.default.createElement("div",{className:"label"},q.default.createElement("span",null,d("qm.pivotGrid.fillColor.title"))),q.default.createElement("div",{className:"list"},q.default.createElement(T.ReactSortable,{itemKey:"fieldName",handle:".handle",tag:"ul",animation:200,list:a,setList:e=>{const t=e.map((e=>e.fieldName)),l=a.map((e=>e.fieldName));m.isEqual(t,l)||r(e)}},a.map(((e,t)=>q.default.createElement("li",{key:`${e.fieldName}-${t}`,className:"item"},E(e)))))),q.default.createElement("div",{className:"add-record"},q.default.createElement("span",{className:"insert",onClick:y},q.default.createElement(g.PlusOutlined,{className:"icon"}),d("qm.pivotGrid.fillColor.add")))),className:J.default("action-btn",{active:!!c.length}),overlayClassName:`${e}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:300}},q.default.createElement("span",null,q.default.createElement(g.BgColorsOutlined,{className:"icon"}),d("qm.pivotGrid.fillColor.text"),c.length?`(${c.length})`:null))},sd=()=>q.default.createElement("div",{className:"top-bar"},q.default.createElement(vt,{size:4},q.default.createElement(ed,null),q.default.createElement(s.Divider,{type:"vertical"}),q.default.createElement(Vs,null),q.default.createElement(Ms,null),q.default.createElement($s,null),q.default.createElement(qs,null),q.default.createElement(s.Divider,{type:"vertical"}),q.default.createElement(zs,null),q.default.createElement(od,null),q.default.createElement(js,null),q.default.createElement(s.Divider,{type:"vertical"}),q.default.createElement(Zs,null)),q.default.createElement(vt,{size:4},q.default.createElement(Js,null))),dd=q.default.createContext(void 0),ud=e=>{var t,l;const{scrollbar:n}=e,{pivotRef:a,getRowKey:r,columns:i,groupGridData:o,setPivotGridRef:s}=Hs(),{rowSelection:d,treeExpandable:u,rowHighlight:c}=a.current.props,f=null===(t=null==u?void 0:u.defaultExpandAllRows)||void 0===t||t,p=q.default.useRef({bodyEl:null,rowVirtualizer:null}),[m,h]=q.default.useState({gridRef:p,scrollbarRef:n,selectionKeys:null!==(l=null==d?void 0:d.defaultSelectedRowKeys)&&void 0!==l?l:[],treeExpandKeys:f?wa(a.current.originGridData,(e=>r(e,e.index))):[],highlightKey:"",checkedColumnKey:"",updateLayout:0,clicked:[],isPingLeft:!1}),g=q.default.useMemo((()=>Math.max(0,Ls(o)-1)),[o]),v=e=>{h((t=>{const l=Object.assign({},t);let n=!1;return Object.keys(e).forEach((a=>{const r=a;Object.is(t[r],e[r])||(l[r]=e[r],n=!0)})),n?l:t}))},y=(e,t)=>{m.gridRef.current[e]=t};q.default.useLayoutEffect((()=>{T(),w()}),[i]),q.default.useLayoutEffect((()=>{(null==d?void 0:d.selectedRowKeys)&&v({selectionKeys:d.selectedRowKeys})}),[null==d?void 0:d.selectedRowKeys]),q.default.useLayoutEffect((()=>{void 0!==(null==c?void 0:c.currentRowKey)&&v({highlightKey:c.currentRowKey})}),[null==c?void 0:c.currentRowKey]);const b=e=>{Array.isArray(null==d?void 0:d.selectedRowKeys)||v({selectionKeys:e})},x=e=>{v({treeExpandKeys:e})},E=e=>{void 0===(null==c?void 0:c.currentRowKey)&&v({highlightKey:e})},C=e=>{v({checkedColumnKey:e})},w=()=>{v({updateLayout:m.updateLayout+1})},S=e=>{Xa(e,m.clicked,!0)||v({clicked:e})},N=e=>{v({isPingLeft:e})},T=()=>{const e=n.current.container.clientWidth,{defaultColumnWidth:t}=pi,l=[];let a=0;if(i.forEach((e=>{"number"==typeof e.width?(e.renderWidth=e.width,a+=e.width):(e.renderWidth=void 0,l.push(e))})),l.length>0){const n=i.reduce(((e,l)=>e+(l.width||l.minWidth||t)),0);if(n<=e){const a=e-n;if(1===l.length)l[0].renderWidth=(l[0].minWidth||t)+a;else{const e=a/l.reduce(((e,l)=>e+(l.minWidth||t)),0);let n=0;l.forEach(((l,a)=>{if(0===a)return;const r=Math.floor((l.minWidth||t)*e);n+=r,l.renderWidth=(l.minWidth||t)+r})),l[0].renderWidth=(l[0].minWidth||t)+a-n}}else l.forEach((e=>{e.renderWidth=e.minWidth||t}))}else a=i.reduce(((e,l)=>e+(l.renderWidth=l.width||l.minWidth||t)),0)},I=q.default.useMemo((()=>Object.assign(Object.assign({},m),{indentDepth:g,setContext:v,setGridLayoutRef:y,setSelectionKeys:b,setTreeExpandKeys:x,setHighlightKey:E,setCheckColumnKey:C,forceUpdateLayout:w,setClicked:S,setPingLeft:N,updateColumnsWidth:T})),[m,g]);return q.default.createElement(dd.Provider,{value:I},e.children)},cd=()=>q.default.useContext(dd),fd=e=>{var t;const{column:l}=e,{columns:n,setColumns:a}=Hs(),{scrollbarRef:r}=cd(),i=q.default.useRef(null),[o,s]=q.default.useState(!1),d=q.default.useRef(document.onselectstart),u=q.default.useRef({startX:0,originSizeX:0,columnWidth:0}),c=e=>{u.current=Object.assign({},u.current,e)},f=e=>{if(1!==e.buttons)return p();const t=e.clientX-u.current.startX,n=(l.width||l.renderWidth)+t;n<(l.minWidth||pi.defaultColumnWidth)||(c({columnWidth:n}),i.current.style.left=`${u.current.originSizeX+t}px`)},p=()=>{r.current.container.style.cursor="",l.width=u.current.columnWidth,a([...n]),rt((()=>s(!1))),Jl(document,"mousemove",f),Jl(document,"mouseup",p),c({startX:0,originSizeX:0,columnWidth:0}),m()},m=()=>{document.onselectstart!==d.current&&(document.onselectstart=d.current)};return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"resize-bar",onMouseDown:e=>{e.preventDefault(),r.current.container.style.cursor="col-resize";const t=Ia(e.target,r.current.container).left-r.current.scrollLeft+3;c({startX:e.clientX,originSizeX:t,columnWidth:l.width||l.renderWidth||0}),Zl(document,"mousemove",f),Zl(document,"mouseup",p),s(!0),rt((()=>i.current.style.left=`${t}px`)),d.current=document.onselectstart,document.onselectstart=()=>!1}}),q.default.createElement(he.default,{open:o,getContainer:null===(t=r.current)||void 0===t?void 0:t.container},q.default.createElement("div",{ref:i,className:"resize-line"})))},pd=e=>{var t;const{left:l}=e,{scrollbarRef:n,isPingLeft:a,setPingLeft:r}=cd(),i=Qe((e=>{r(e.target.scrollLeft>1)}));return q.default.useEffect((()=>{const e=n.current.container.children[0];return e.addEventListener("scroll",i),()=>{e.removeEventListener("scroll",i)}}),[]),q.default.createElement(he.default,{open:!0,getContainer:null===(t=n.current)||void 0===t?void 0:t.container},q.default.createElement("div",{className:J.default("fixed-line",{active:a}),style:{left:l}}))},md=()=>{const{pivotRef:e,columns:t}=Hs(),{indentDepth:l,updateLayout:n,checkedColumnKey:a,selectionKeys:r,setSelectionKeys:i,setCheckColumnKey:o}=cd(),{rowSelection:d}=e.current.props,{selectionColumn:u}=pi,{indentWidth:c,selectionColumnDefine:f}=Ts,p=q.default.useMemo((()=>Is(t)),[t]),m=q.default.useMemo((()=>p.filter((e=>"left"===e.fixed))),[p]),h=q.default.useMemo((()=>p.filter((e=>"left"!==e.fixed))),[p]),g=q.default.useMemo((()=>"radio"!==(null==d?void 0:d.type)),[d]),v=q.default.useMemo((()=>m.reduce(((e,t,n)=>e+(t.width||t.renderWidth||0)+(1===n?l*c:0)),0)),[l,n,m]),y=q.default.useMemo((()=>r.length>0&&r.length===e.current.keyRecordMap.size),[r]),b=q.default.useMemo((()=>r.length>0&&r.length<e.current.keyRecordMap.size),[r]),x=(t,n)=>q.default.createElement("div",{className:J.default(n?"fixed-left":"no-fixed"),style:{width:n?v:""}},t.map(((r,p)=>{const{dataIndex:m,title:h,align:v,width:x,renderWidth:E}=r,C={"selection-column":m===u,"col--center":"center"===v,"col--right":"right"===v,"col--checked":a===m},w=n&&1===p||!n&&p===t.length-1?l*c:0,S={width:`${(x||E||0)+w}px`,minWidth:`${(x||E||0)+w}px`};return q.default.createElement("div",{key:m,className:J.default("table-cell",C),style:S,onClick:()=>{return e=m,void([f.dataIndex].includes(e)||o(a!==e?e:""));var e}},m!==u?q.default.createElement("span",{className:"cell"},h):d&&g?q.default.createElement(s.Checkbox,{checked:y,indeterminate:b,onChange:t=>(t=>{var l;const n=t?Array.from(e.current.keyRecordMap.keys()):[];i(n),null===(l=null==d?void 0:d.onChange)||void 0===l||l.call(d,n,t?Array.from(e.current.keyRecordMap.values()):[])})(t.target.checked)}):"#",m!==u&&q.default.createElement(fd,{column:r}))})));return q.default.createElement("div",{className:"header"},x(m,!0),(e=>x(e))(h),q.default.createElement(pd,{left:v}))};function hd(e,t,l){var n;let a,r=null!==(n=l.initialDeps)&&void 0!==n?n:[];function i(){var n,i,o,s,d;let u;l.key&&(null===(n=l.debug)||void 0===n?void 0:n.call(l))&&(u=Date.now());const c=e(),f=c.length!==r.length||c.some(((e,t)=>r[t]!==e));if(!(null===(i=l.noCache)||void 0===i?void 0:i.call(l))&&!f)return a;let p;if(r=c,l.key&&(null===(o=l.debug)||void 0===o?void 0:o.call(l))&&(p=Date.now()),a=t(...c),l.key&&(null===(s=l.debug)||void 0===s?void 0:s.call(l))){const e=Math.round(100*(Date.now()-u))/100,t=Math.round(100*(Date.now()-p))/100,n=t/16,a=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${a(t,5)} / ${a(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*n,120))}deg 100% 31%);`,null==l?void 0:l.key)}return null===(d=null==l?void 0:l.onChange)||void 0===d||d.call(l,a),a}return i.updateDeps=e=>{r=e},i}function gd(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const vd=(e,t,l)=>{let n;return function(...a){e.clearTimeout(n),n=e.setTimeout((()=>t.apply(this,a)),l)}},yd=e=>e,bd=e=>{const t=Math.max(e.startIndex-e.overscan,0),l=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let e=t;e<=l;e++)n.push(e);return n},xd=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;const a=e=>{const{width:l,height:n}=e;t({width:Math.round(l),height:Math.round(n)})};if(a(l.getBoundingClientRect()),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver((e=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void a({width:e.inlineSize,height:e.blockSize})}a(l.getBoundingClientRect())}));return r.observe(l,{box:"border-box"}),()=>{r.unobserve(l)}},Ed={passive:!0},Cd="undefined"==typeof window||"onscrollend"in window,wd=(e,t)=>{const l=e.scrollElement;if(!l)return;const n=e.targetWindow;if(!n)return;let a=0;const r=e.options.useScrollendEvent&&Cd?()=>{}:vd(n,(()=>{t(a,!1)}),e.options.isScrollingResetDelay),i=n=>()=>{const{horizontal:i,isRtl:o}=e.options;a=i?l.scrollLeft*(o?-1:1):l.scrollTop,r(),t(a,n)},o=i(!0),s=i(!1);return s(),l.addEventListener("scroll",o,Ed),l.addEventListener("scrollend",s,Ed),()=>{l.removeEventListener("scroll",o),l.removeEventListener("scrollend",s)}},Sd=(e,t,l)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e){return Math.round(e[l.options.horizontal?"inlineSize":"blockSize"])}}return Math.round(e.getBoundingClientRect()[l.options.horizontal?"width":"height"])},Nd=(e,{adjustments:t=0,behavior:l},n)=>{var a,r;const i=e+t;null===(r=null===(a=n.scrollElement)||void 0===a?void 0:a.scrollTo)||void 0===r||r.call(a,{[n.options.horizontal?"left":"top"]:i,behavior:l})};class Td{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 l;null===(l=t())||void 0===l||l.disconnect(),e=null},observe:e=>{var l;return null===(l=t())||void 0===l?void 0:l.observe(e,{box:"border-box"})},unobserve:e=>{var l;return null===(l=t())||void 0===l?void 0:l.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach((([t,l])=>{void 0===l&&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:yd,rangeExtractor:bd,onChange:()=>{},measureElement:Sd,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,l;null===(l=(t=this.options).onChange)||void 0===l||l.call(t,this,e)},this.maybeNotify=hd((()=>(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 l=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==l){if(this.cleanup(),!l)return void this.maybeNotify();this.scrollElement=l,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 l=new Map,n=new Map;for(let a=t-1;a>=0;a--){const t=e[a];if(l.has(t.lane))continue;const r=n.get(t.lane);if(null==r||t.end>r.end?n.set(t.lane,t):t.end<r.end&&l.set(t.lane,!0),l.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort(((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end))[0]:void 0},this.getMeasurementOptions=hd((()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled]),((e,t,l,n,a)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a})),{key:!1}),this.getMeasurements=hd((()=>[this.getMeasurementOptions(),this.itemSizeCache]),(({count:e,paddingStart:t,scrollMargin:l,getItemKey:n,enabled:a},r)=>{if(!a)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 i=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const o=this.measurementsCache.slice(0,i);for(let a=i;a<e;a++){const e=n(a),i=1===this.options.lanes?o[a-1]:this.getFurthestMeasurement(o,a),s=i?i.end+this.options.gap:t+l,d=r.get(e),u="number"==typeof d?d:this.options.estimateSize(a),c=s+u,f=i?i.lane:a%this.options.lanes;o[a]={index:a,start:s,size:u,end:c,key:e,lane:f}}return this.measurementsCache=o,o}),{key:"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=hd((()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()]),((e,t,l)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:l}){const n=e.length-1,a=t=>e[t].start,r=Id(0,n,a,l);let i=r;for(;i<n&&e[i].end<l+t;)i++;return{startIndex:r,endIndex:i}}({measurements:e,outerSize:t,scrollOffset:l}):null),{key:"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=hd((()=>{let e=null,t=null;const l=this.calculateRange();return l&&(e=l.startIndex,t=l.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]}),((e,t,l,n,a)=>null===n||null===a?[]:e({startIndex:n,endIndex:a,overscan:t,count:l})),{key:"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,l=e.getAttribute(t);return l?parseInt(l,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const l=this.indexFromElement(e),n=this.measurementsCache[l];if(!n)return;const a=n.key,r=this.elementsCache.get(a);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(a,e)),e.isConnected&&this.resizeItem(l,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{var l;const n=this.measurementsCache[e];if(!n)return;const a=t-(null!==(l=this.itemSizeCache.get(n.key))&&void 0!==l?l:n.size);0!==a&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(n,a,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&(this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.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=hd((()=>[this.getVirtualIndexes(),this.getMeasurements()]),((e,t)=>{const l=[];for(let n=0,a=e.length;n<a;n++){const a=t[e[n]];l.push(a)}return l}),{key:"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return gd(t[Id(0,t.length-1,(e=>gd(t[e]).start),e)])},this.getOffsetForAlignment=(e,t)=>{const l=this.getSize(),n=this.getScrollOffset();"auto"===t&&e>=n+l&&(t="end"),"end"===t&&(e-=l);const a=this.options.horizontal?"scrollWidth":"scrollHeight",r=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-l;return Math.max(Math.min(r,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const l=this.measurementsCache[e];if(!l)return;const n=this.getSize(),a=this.getScrollOffset();if("auto"===t)if(l.end>=a+n-this.options.scrollPaddingEnd)t="end";else{if(!(l.start<=a+this.options.scrollPaddingStart))return[a,t];t="start"}const r=l.start-this.options.scrollPaddingStart+(l.size-n)/2;switch(t){case"center":return[this.getOffsetForAlignment(r,t),t];case"end":return[this.getOffsetForAlignment(l.end+this.options.scrollPaddingEnd,t),t];default:return[this.getOffsetForAlignment(l.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:l}={})=>{this.cancelScrollToIndex(),"smooth"===l&&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:l})},this.scrollToIndex=(e,{align:t="auto",behavior:l}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===l&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const n=this.getOffsetForIndex(e,t);if(!n)return;const[a,r]=n;this._scrollToOffset(a,{adjustments:void 0,behavior:l}),"smooth"!==l&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout((()=>{this.scrollToIndexTimeoutId=null;if(this.elementsCache.has(this.options.getItemKey(e))){const[a]=gd(this.getOffsetForIndex(e,r));t=a,n=this.getScrollOffset(),Math.abs(t-n)<1||this.scrollToIndex(e,{align:r,behavior:l})}else this.scrollToIndex(e,{align:r,behavior:l});var t,n})))},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 l=this.getMeasurements();let n;return n=0===l.length?this.options.paddingStart:1===this.options.lanes?null!==(t=null===(e=l[l.length-1])||void 0===e?void 0:e.end)&&void 0!==t?t:0:Math.max(...l.slice(-this.options.lanes).map((e=>e.end))),Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:l})=>{this.options.scrollToFn(e,{behavior:l,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Id=(e,t,l,n)=>{for(;e<=t;){const a=(e+t)/2|0,r=l(a);if(r<n)e=a+1;else{if(!(r>n))return a;t=a-1}}return e>0?e-1:0};const Od="undefined"!=typeof document?q.default.useLayoutEffect:q.default.useEffect,Rd=e=>(e=>{const t=q.default.useReducer((()=>({})),{})[1],l=Object.assign(Object.assign({},e),{onChange:(l,n)=>{var a;n?v.flushSync(t):t(),null===(a=e.onChange)||void 0===a||a.call(e,l,n)}}),[n]=q.default.useState((()=>new Td(l)));return n.setOptions(l),Od((()=>n._didMount()),[]),Od((()=>n._willUpdate())),n})(Object.assign({observeElementRect:xd,observeElementOffset:wd,scrollToFn:Nd},e)),kd=e=>(e=>null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)(e)?e.ownerDocument:document,Ld=(e,t)=>!t.map((e=>Array.from(document.querySelectorAll(e)))).flat().some((t=>null==t?void 0:t.contains(e.target))),Pd=(e,t)=>{var l;const n=e.target;return!("button"in e&&e.button>0)&&(!(n&&!kd(n).contains(n))&&!(null===(l=t.current)||void 0===l?void 0:l.contains(n)))};function Ad({ref:e,handler:t,enabled:l=!0,omitClassNames:n=[]}){const a=Qe(t),r=$.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1});$.useEffect((()=>{if(!l)return;const i=t=>{Pd(t,e)&&(r.current.isPointerDown=!0)},o=l=>{r.current.ignoreEmulatedMouseEvents?r.current.ignoreEmulatedMouseEvents=!1:t&&r.current.isPointerDown&&Pd(l,e)&&Ld(l,n)&&(r.current.isPointerDown=!1,a(l))},s=l=>{r.current.ignoreEmulatedMouseEvents=!0,t&&r.current.isPointerDown&&Pd(l,e)&&Ld(l,n)&&(r.current.isPointerDown=!1,a(l))},d=kd(e.current);return d.addEventListener("mousedown",i,!0),d.addEventListener("mouseup",o,!0),d.addEventListener("touchstart",i,!0),d.addEventListener("touchend",s,!0),()=>{d.removeEventListener("mousedown",i,!0),d.removeEventListener("mouseup",o,!0),d.removeEventListener("touchstart",i,!0),d.removeEventListener("touchend",s,!0)}}),[t,e,a,r,l])}const Dd=e=>{const{pivotRef:t,getRowKey:l,size:n}=Hs(),{scrollbarRef:a,clicked:r,setHighlightKey:i,setClicked:o}=cd(),{flatGroupData:s}=t.current,{rowHighlight:d}=t.current.props,u=q.default.useMemo((()=>2*pi.rowHeightMaps[n]),[n]),c=q.default.useMemo((()=>s.filter((e=>!Rs(e)))),[s]),f=Qe((t=>{var n,s;const{keyCode:f}=t;if(!ot(r)&&(27===f&&(i(""),o([])),38===f||40===f)){en(t);const p=c.length;let m=c.findIndex((e=>l(e,e.index)===r[0]));const h=38===f?(--m+p)%p:++m%p,g=c[h],v=l(g,g.index);d&&!(null===(n=d.disabled)||void 0===n?void 0:n.call(d,g))&&(i(v),null===(s=d.onChange)||void 0===s||s.call(d,v,g)),((t,l,n)=>{const r=c.length,i=e.find((e=>e.key===n)),o=a.current.scrollTop,s=a.current.container.offsetHeight,d=i.top,f=i.height;"top"===t?d<o?a.current.SET_SCROLL_TOP(d):l===r-1&&a.current.SET_SCROLL_TOP(d-(s-f)):d+f>o+(s-u)?a.current.SET_SCROLL_TOP(d-(s-u-f)):0===l&&a.current.SET_SCROLL_TOP(d)})(38===f?"top":"bottom",h,v),o([v,r[1]])}}));q.default.useLayoutEffect((()=>(window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f))),[])},_d=e=>{const{column:t,keyPath:l,type:n}=e,{prefixCls:a,countMethod:r,summationData:i,setCountMethod:o}=Hs(),{t:d}=Xe(),{dataIndex:u,filter:c}=t,[f,p]=q.default.useState(!1),m=q.default.useMemo((()=>{const e=[{text:d("qm.pivotGrid.count.records"),value:"count",fn:Ds.count},{text:d("qm.pivotGrid.count.unique"),value:"unique",fn:Ds.unique},{text:d("qm.pivotGrid.count.empty"),value:"empty",fn:Ds.empty},{text:d("qm.pivotGrid.count.notEmpty"),value:"notEmpty",fn:Ds.notEmpty},{text:d("qm.pivotGrid.count.sum"),value:"sum",fn:Ds.sum},{text:d("qm.pivotGrid.count.max"),value:"max",fn:Ds.max},{text:d("qm.pivotGrid.count.min"),value:"min",fn:Ds.min},{text:d("qm.pivotGrid.count.avg"),value:"avg",fn:Ds.avg}];return"number"===(null==c?void 0:c.type)?e:e.slice(0,-4)}),[]),h=q.default.useMemo((()=>{var e,t,a;const o=r[u];if(!o)return d("qm.pivotGrid.count.statistic");return`${m.find((e=>e.value===o)).text} ${null!==(a=null===(t=null===(s=i,c=l,e=c?ks(s,c):s)||void 0===e?void 0:e[n])||void 0===t?void 0:t[u])&&void 0!==a?a:""}`;var s,c}),[i,r]);return q.default.createElement(s.Dropdown,{open:f,trigger:["click"],dropdownRender:()=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","container"),style:{padding:5}},q.default.createElement("div",{className:"list"},m.map((e=>{const t=e.value===r[u];return q.default.createElement("li",{key:e.value,className:J.default("ant-dropdown-menu-item check-item",{active:t}),onClick:()=>{o({[u]:t?void 0:e.value}),p(!1)}},q.default.createElement("span",{className:"label"},e.text),q.default.createElement("i",{className:"icon"},q.default.createElement(g.CheckOutlined,null)))})))),className:J.default("count-select",{show:!!r[u]}),overlayClassName:`${a}__popper`,placement:"bottomRight",overlayStyle:{minWidth:140},onOpenChange:e=>p(e)},q.default.createElement("span",null,h," ",q.default.createElement(g.CaretDownOutlined,{className:"icon"})))},Fd=(e,t)=>{const{pivotRef:l,columns:n,expandedKeys:a,searchResults:r,switchIndex:i,fillColorCells:o,setExpandedKeys:d}=Hs(),{gridRef:u,indentDepth:c,highlightKey:f,checkedColumnKey:p,selectionKeys:m,treeExpandKeys:h,setSelectionKeys:v,setTreeExpandKeys:y,setHighlightKey:b,setClicked:x}=cd(),{keyRecordMap:E,isTree:C}=l.current,{bodyEl:w,rowVirtualizer:S}=u.current,{rowSelection:N,treeExpandable:T,rowHighlight:I,onRowEdit:O,onRowClick:R}=l.current.props,{t:k}=Xe(),{renderText:L,getTitleFromCellNode:P}=Si(),{selectionColumn:A,treeTable:D}=pi,{indentWidth:_}=Ts,F=q.default.useMemo((()=>t?0:Is(n).length-e.length),[n,e]),H=q.default.useMemo((()=>"radio"!==(null==N?void 0:N.type)),[N]),M=(e,t)=>{var l,n;null==N||N.checkStrictly;const a=H?e?[...m,t]:m.filter((e=>e!==t)):[t];v(a),null===(l=null==N?void 0:N.onSelect)||void 0===l||l.call(N,e,E.get(t)),null===(n=null==N?void 0:N.onChange)||void 0===n||n.call(N,a,$(a))},$=e=>{const t=[];return e.forEach((e=>t.push(E.get(e)))),t},j=(e,t)=>{var l,n;return(null===(l=r[i])||void 0===l?void 0:l.rowKey)===e&&(null===(n=r[i])||void 0===n?void 0:n.dataIndex)===t},K=(e,t)=>{const l=w.querySelectorAll(`li.table-row[data-row-key='${e}']`);Array.from(l).forEach((e=>{e.classList[t&&!(null==S?void 0:S.isScrolling)?"add":"remove"]("row--hover")}))},V=e=>q.default.createElement("button",{className:J.default("button-icon",{expand:a.includes(e.id)}),onClick:()=>{return t=e.id,void d(a.includes(t)?a.filter((e=>e!==t)):[...a,t]);var t}},q.default.createElement(g.CaretRightOutlined,null)),z=(e,t,l,a)=>{const{dataIndex:r,width:i,renderWidth:o}=e,s={"expandable-column":r===A},d=1===t?(c-l._groupLevel)*_:0,u={width:`${(i||o||0)+d}px`,minWidth:`${(i||o||0)+d}px`};return q.default.createElement("div",{key:r,className:J.default("label-cell",s),style:u},r!==A?q.default.createElement(q.default.Fragment,null,1===t&&q.default.createElement("span",{className:"title"},(e=>{const{_record:t,_fieldName:l}=e,a=ka(t,l),r=n.find((e=>e.dataIndex===l));return ot(a)||!r?q.default.createElement("span",{className:"empty"},k("qm.pivotGrid.group.empty")):r.render?r.render(a,t,r,0,0):L(a,r,t)})(l)),q.default.createElement(_d,{column:e,keyPath:l.id,type:"subtotal"})):V(l))},W=(e,t)=>{var l,n;const a=null===(l=null==T?void 0:T.rowExpandable)||void 0===l?void 0:l.call(T,e);return q.default.createElement(g.DownOutlined,{className:J.default("cell--expand",{fold:!h.includes(t),disabled:a}),style:{visibility:(null===(n=e.children)||void 0===n?void 0:n.length)>0?"visible":"hidden"},onClick:()=>{a||(e=>{var t,l;const n=h.includes(e),a=n?h.filter((t=>t!==e)):[...h,e];y(a),null===(t=null==T?void 0:T.onExpand)||void 0===t||t.call(T,!n,E.get(e)),null===(l=null==T?void 0:T.onChange)||void 0===l||l.call(T,a)})(t)}})},B=(e,t,l,n,a)=>{var r,i;const{dataIndex:d,width:u,renderWidth:c,align:f,render:h}=e,v=ka(l,d),y=h?h(v,l,e,l.index,t):L(v,e,l),E=P(y),w=m.includes(a),S={"selection-column":d===A,"col--center":"center"===f,"col--right":"right"===f,"col--checked":p===d,active:j(a,d)},T={width:`${u||c||0}px`,minWidth:`${u||c||0}px`,backgroundColor:o.get(`${a}|${d}`)};return q.default.createElement("div",{key:d,"data-col-index":t,title:E,className:J.default("table-cell",S),style:T,onClick:t=>{var n,r;d!==A&&(x([a,d]),I&&!(null===(n=I.disabled)||void 0===n?void 0:n.call(I,l))&&(b(a),null===(r=I.onChange)||void 0===r||r.call(I,a,l)),null==R||R(l,e,t))}},d!==A?q.default.createElement(q.default.Fragment,null,C&&1===t&&q.default.createElement(q.default.Fragment,null,(k=l._level)?q.default.createElement("span",{key:k,className:`cell--indent indent-level-${k}`,style:{paddingLeft:k*D.textIndent+"px"}}):null,W(l,a)),q.default.createElement("span",{className:"cell"},y)):q.default.createElement("div",{className:"action"},q.default.createElement("span",{className:"drag-icon"}),q.default.createElement("div",{className:"middle"},q.default.createElement("span",{className:"order"},((e,t)=>C?0===e._level?e._varIndex+1:null:t+1)(l,n)),N&&q.default.createElement(q.default.Fragment,null,H?q.default.createElement(s.Checkbox,{className:"checkbox",checked:w,disabled:null===(r=null==N?void 0:N.disabled)||void 0===r?void 0:r.call(N,l),onChange:e=>M(e.target.checked,a)}):q.default.createElement(s.Radio,{className:"checkbox",checked:w,disabled:null===(i=null==N?void 0:N.disabled)||void 0===i?void 0:i.call(N,l),onChange:e=>M(e.target.checked,a)}))),q.default.createElement("span",{className:"expand-icon",onClick:()=>null==O?void 0:O(l,n)},O?q.default.createElement(g.ExpandAltOutlined,null):null)));var k};return{renderGroupRow:(t,l)=>q.default.createElement("div",{className:"label-row"},e.map(((e,l)=>z(e,F+l,t)))),renderRow:(t,l,n)=>{const a={"row--selection":m.includes(n),"row--highlight":f===n};return q.default.createElement("li",{key:n,"data-row-key":n,className:J.default("table-row",a),onMouseEnter:()=>K(n,!0),onMouseLeave:()=>K(n)},e.map(((e,a)=>B(e,F+a,t,l,n))))}}},Hd=e=>{const{tbodyColumns:t,layout:l,displayList:n,virtualRows:a,notGroup:r}=e,{indentDepth:i,updateLayout:o}=cd(),{indentWidth:s}=Ts,d=q.default.useMemo((()=>t.filter((e=>"left"===e.fixed))),[t]),u=q.default.useMemo((()=>d.reduce(((e,t,l)=>e+(t.width||t.renderWidth||0)+(1===l?i*s:0)),0)),[i,o,d]),{renderGroupRow:c,renderRow:f}=Fd(d,!0);return q.default.createElement("div",{className:"left-panel",style:{width:u}},q.default.createElement("div",{className:J.default("container",{"no-group":r})},a.map((e=>{const t=e.index,a=l[t],r=n[t];if(Rs(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:a.left,right:0,height:a.height}},c(r,a.key));const i=t===l.length-1||Rs(n[t+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{last:i}),style:{top:a.top,left:a.left,right:0,height:a.height}},f(r,r._varIndex,a.key))}))))},Md=e=>{const{tbodyColumns:t,layout:l,displayList:n,virtualRows:a,notGroup:r}=e;Hs();const i=q.default.useMemo((()=>t.filter((e=>"left"!==e.fixed))),[t]),{renderGroupRow:o,renderRow:s}=Fd(i);return q.default.createElement("div",{className:"main-panel"},q.default.createElement("div",{className:J.default("container",{"no-group":r})},a.map((e=>{const t=e.index,a=l[t],r=n[t];if(Rs(r))return q.default.createElement("div",{key:r.id,className:J.default("group-label",`level${r._groupLevel}`),style:{top:a.top,left:0,right:a.right,height:a.height}},o(r,a.key));const i=t===l.length-1||Rs(n[t+1]);return q.default.createElement("div",{key:a.key,className:J.default("row-item",{last:i}),style:{top:a.top,left:0,right:a.right,height:a.height}},s(r,r._varIndex,a.key))}))))},$d=()=>{const{pivotRef:e,getRowKey:t,prefixCls:l,size:n,columns:a,groupGridData:r,expandedKeys:i,searchResults:o,switchIndex:s}=Hs(),{scrollbarRef:d,treeExpandKeys:u,setGridLayoutRef:c}=cd(),{flatGroupData:f}=e.current,{contextMenues:p}=e.current.props,{groupMargin:m}=Ts,{rowHeightMaps:h}=pi,g=q.default.useRef(null),v=q.default.useMemo((()=>Is(a)),[a]),y=q.default.useMemo((()=>Array.isArray(r)),[r]),{contextMenu:b,closeMenu:x}=(({ref:e,popup:t,getTriggerContainer:l,prevent:n,prefixCls:a="",enabled:r=!0})=>{const i=q.default.useRef(null),o=q.default.useRef(null),s=e=>{o.current=e},[d,u]=q.default.useState(!1),[c,f]=q.default.useState(null),p={width:150,height:200,zIndex:9999};Ad({ref:i,handler:()=>m()});const m=()=>{u(!1),f(null),s(null)},h=Qe((e=>{if(e.preventDefault(),null==n?void 0:n(e.target))return m();s(e),u(!0),rt((()=>{var t;const{width:l,height:n}=(null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect())||p,a=l,r=n,o=window.innerWidth,s=window.innerHeight;let d=e.clientX,u=e.clientY;d+a>o&&(d=Math.max(d-a,0)),u+r>s&&(u=Math.max(u-r,0)),f({x:d,y:u})}))}));q.default.useEffect((()=>{const t=(null==l?void 0:l(e.current))||e.current;return r&&t&&t.addEventListener("contextmenu",h),()=>{t&&t.removeEventListener("contextmenu",h)}}),[e]);const g={position:"fixed",top:`${(null==c?void 0:c.y)||0}px`,left:`${(null==c?void 0:c.x)||0}px`,zIndex:p.zIndex};return{contextMenu:q.default.createElement(he.default,{open:d},q.default.createElement("div",{ref:i,className:`${a}__context-menu`,style:g},o.current?t(o.current):null)),closeMenu:m}})({ref:g,prevent:e=>e.offsetParent.classList.contains("group-label"),prefixCls:l,enabled:!!p,popup:e=>{var l;const n=on(e.target,"table-cell"),a=(null===(l=null==n?void 0:n.parentNode)||void 0===l?void 0:l.getAttribute("data-row-key"))||"",r=f.find((e=>t(e,e.index)==a)),i=Number((null==n?void 0:n.getAttribute("data-col-index"))||-1),o=v[i];return q.default.createElement("ul",{className:"ant-dropdown-menu",style:{padding:5}},p.map((e=>{var t;const l=(null===(t=e.disabled)||void 0===t?void 0:t.call(e,r,o))||!1;return q.default.createElement("li",{key:e.key,className:J.default("ant-dropdown-menu-item",{"ant-dropdown-menu-item-disabled":l}),onClick:()=>{var t;l||(rt((()=>x())),null===(t=e.onClick)||void 0===t||t.call(e,r,o))}},e.prefix&&q.default.createElement("span",{className:"prefix"},e.prefix),q.default.createElement("span",{className:"label"},e.label),e.suffix&&q.default.createElement("span",{className:"suffix"},e.suffix))})))}}),E=e=>{var t;const l=f[e];for(let n=e+1;n<f.length;n++)if(null===(t=f[n]._parentRowKey)||void 0===t?void 0:t.startsWith(l.id)){Object.assign(l,{_record:f[n]});break}},C=q.default.useMemo((()=>{const e=new Map,l=[];return f.forEach(((n,a)=>{if(Rs(n)){if(0===n._groupLevel)return e.set(n.id,i.includes(n.id)),E(a),void l.push(n);const t=n.id.slice(0,n.id.lastIndexOf(Ts.separator));return void(i.includes(t)&&e.get(t)&&(e.set(n.id,i.includes(n.id)),E(a),l.push(n)))}const r=t(n,n.index);n._parentRowKey&&!e.get(n._parentRowKey)||(e.set(r,u.includes(r)),l.push(n))})),e.clear(),l}),[r,i,u]),w=q.default.useMemo((()=>((e,{getRowKey:t,rowHeight:l})=>{const n=[],a=[],r=l,i=Ts.indentWidth,o=Ts.groupMargin;let s=o;for(e.forEach((e=>{if(void 0!==e._groupLevel){for(;a.length>0&&a[a.length-1]._level>=e._groupLevel;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}a[a.length-1];const t={key:e.id,top:s,left:i*e._groupLevel,right:i*e._groupLevel,height:r,_childHeight:0,_subGroupCount:0,_index:n.length,_level:e._groupLevel};n.push(t),a.push(t),s+=r}else{const l=a[a.length-1]||{left:0,right:0},i={key:t(e,e.index),top:s,left:l.left,right:l.right,height:r};n.push(i),s+=r,a.length>0&&(l._childHeight+=r)}}));a.length>0;){const e=a.pop();if(e.height=e._childHeight+r,n[e._index].height=e.height,a.length>0){const t=a[a.length-1];t._childHeight+=e.height+o,t._subGroupCount+=1}s+=o}return n})(C,{getRowKey:t,rowHeight:h[n]})),[C,n]);Dd(w);const S=q.default.useMemo((()=>{if(y)return w.reduce(((e,t)=>e+t.height),0)+2*m;const e=w.filter((e=>0===e._level));return e.reduce(((e,t)=>e+t.height),0)+(e.length-1)*m+2*m}),[y,w]),{rowVirtualizer:N,virtualRows:T}=(e=>{const{layout:t,isGroup:l}=e,{size:n}=Hs(),{scrollbarRef:a}=cd(),{rowHeightMaps:r}=pi,i=q.default.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]),o=Rd({count:t.length,getScrollElement:()=>i,estimateSize:e=>t[e].height,overscan:1,noCache:l,rangeExtractor:e=>{var s;if(!l)return bd(e);const d=a.current.scrollTop,u=(null===(s=o.scrollElement)||void 0===s?void 0:s.offsetHeight)||i.offsetHeight,c=[];for(let e=0;e<t.length;e++){const l=t[e];d>l.top+l.height+r[n]||d+u+r[n]<l.top||c.push(e)}return c}}),s=o.getVirtualItems();return{rowVirtualizer:o,virtualRows:s}})({layout:w,isGroup:!y});Ql((()=>{const e=f.findIndex((e=>{var l;return t(e,e.index)===(null===(l=o[s])||void 0===l?void 0:l.rowKey)}));e>=0&&d.current.SET_SCROLL_TOP(e*h[n]);const l=v.findIndex((e=>{var t;return e.dataIndex===(null===(t=o[s])||void 0===t?void 0:t.dataIndex)}));if(l>=0){const e=v.slice(0,l).filter((e=>"left"!==e.fixed)).reduce(((e,t)=>e+(t.width||t.renderWidth)),0);d.current.SET_SCROLL_LEFT(e)}}),[s,o]),q.default.useLayoutEffect((()=>{c("bodyEl",g.current),c("rowVirtualizer",N)}),[]);const I={tbodyColumns:v,layout:w,displayList:C,virtualRows:T,notGroup:y};return q.default.createElement("div",{ref:g,className:"body",style:{height:S}},q.default.createElement(Hd,I),q.default.createElement(Md,I),b)},qd=()=>{const{columns:e,groupGridData:t,countMethod:l,setSummationData:n}=Hs(),{indentDepth:a,updateLayout:r}=cd(),{selectionColumn:i}=pi,{indentWidth:o}=Ts,s=q.default.useMemo((()=>Is(e)),[e]),d=q.default.useMemo((()=>s.filter((e=>"left"===e.fixed))),[s]),u=q.default.useMemo((()=>s.filter((e=>"left"!==e.fixed))),[s]),c=q.default.useMemo((()=>d.reduce(((e,t,l)=>e+(t.width||t.renderWidth||0)+(1===l?a*o:0)),0)),[a,r,d]);Ql((()=>{n(((e,t)=>{const l=[],n=e=>{const l={};for(const n in t){const a=e.map((e=>st(e,n)||0));l[n]=t[n](a)}return l},a=e=>{if(Array.isArray(e))return l.push(...e),{total:n(e)};const r={},i={};Object.keys(t).forEach((e=>{i[e]=[]}));for(const n in e){const o=e[n];if(Array.isArray(o)){l.push(...o);const e={};for(const l in t){const n=o.map((e=>st(e,l)||0));e[l]=t[l](n),i[l].push(...n)}r[n]={subtotal:e}}else{const e=a(o);r[n]=e;for(const l in t){const t=e.subtotal[l];void 0!==t&&i[l].push(t)}}}if(0===l.length)return r;const o={};for(const e in t)o[e]=t[e](i[e]);return r.subtotal=o,r},r=Array.isArray(e)?{total:n(e)}:a(e);return l.length>0&&(r.total=n(l)),delete r.subtotal,r})(t,(e=>{const t={};for(const l in e)e[l]&&Object.assign(t,{[l]:Ds[e[l]]});return t})(l)))}),[l,t]);const f=(e,t)=>q.default.createElement("div",{className:J.default(t?"fixed-left":"no-fixed"),style:{width:t?c:""}},e.map(((l,n)=>{const{dataIndex:r,width:s,renderWidth:d}=l,u={"selection-column":r===i,"col--right":!0},c=t&&1===n||!t&&n===e.length-1?a*o:0,f={width:`${(s||d||0)+c}px`,minWidth:`${(s||d||0)+c}px`};return q.default.createElement("div",{key:r,className:J.default("table-cell",u),style:f},r!==i?q.default.createElement(_d,{column:l,keyPath:"",type:"total"}):null)})));return q.default.createElement("div",{className:"footer"},f(d,!0),(e=>f(e))(u))},jd=()=>{const{prefixCls:e,size:t}=Hs(),l=q.default.useRef(null);return q.default.createElement(ud,{scrollbar:l},q.default.createElement(_n,{ref:l,className:J.default(`${e}__layout`,t)},q.default.createElement(md,null),q.default.createElement($d,null),q.default.createElement(qd,null)))},Kd=()=>q.default.createElement("div",{className:"wrapper"},q.default.createElement(jd,null)),Vd={rowKey:"id",columns:[],dataSource:[]},zd=e=>{const t=Ne(Vd,e),{rowKey:l,fromTable:n,columns:a,dataSource:r,height:i,maxHeight:o,className:s,style:d}=t,{$size:u}=Ze(t),c=Qe(((e,t)=>{const n="function"==typeof l?l(e,t):null==e?void 0:e[l];return void 0===n?(mt("PivotGrid","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):n})),f=(e,t="",l=0)=>e.map(((e,n)=>{const a=c(e,e.index);return e.index=n,e._level=l,Array.isArray(e.children)&&(e.children=f(e.children,a,l+1)),t?Object.assign(e,{_parentRowKey:t}):e})),p=e=>{let t=!1;const l=(e=>e.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex))))(e).map((e=>{"left"===e.fixed&&(t=!0);const l=Object.assign(Object.assign({},e),{fixed:"left"===e.fixed?"left":void 0,editRender:void 0});return n&&(void 0===l.fixed&&delete l.fixed,delete l.editRender),l}));return!t&&l.length&&(l[0].fixed="left",mt("PivotGrid","至少需要有一项 `fixed: left` 的固定列")),l},m=q.default.useMemo((()=>p(a)),[a]),h=q.default.useMemo((()=>f(r)),[r]),g=yt("pivot-grid"),v={[g]:!0,"is-from-table":n},y={height:i,maxHeight:i||o?o:500},b={prefixCls:g,size:u,getRowKey:c,flatColumns:m,tableData:h,pivotProps:dt(t,["columns","dataSource","rowKey","size","height","maxHeight","className","style"])};return q.default.createElement("div",{className:J.default(v,s),style:Object.assign(Object.assign({},d),y)},q.default.createElement(Fs,b,q.default.createElement(sd,null),q.default.createElement(Kd,null)))};zd.displayName="PivotGrid";const Wd=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{tableRef:n,prefixCls:a,flattenColumns:r}=q.default.useContext(Xr),{rowKey:i,uniqueKey:o}=n.current.props,{t:s}=Xe(),{tableFullData:d}=n.current,[u,c]=q.default.useState(!1),f=()=>{c(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:f})));const p={visible:u,title:s("qm.table.pivotGrid.settingTitle"),width:"80vw",loading:!1,bodyStyle:{padding:0},onClose:()=>c(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${a}-pivot-grid`,title:s("qm.table.pivotGrid.text"),onClick:()=>f()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.LineChartOutlined,null))),q.default.createElement(Qn,p,q.default.createElement(zd,{fromTable:!0,rowKey:i,uniqueKey:o,columns:r,dataSource:d})))}));Wd.displayName="PivotGrid";const Bd=e=>{const{columns:t,group:l,summary:n}=e,{tableRef:a,$size:r,pagination:i,fetchParams:o,isFetch:s}=q.default.useContext(Xr),{fetch:d}=a.current.props,{t:u}=Xe(),c=e=>{var l;const n=t.find((t=>t.dataIndex===e));return{title:n.title,precision:n.precision,dictItems:null!==(l=n.dictItems)&&void 0!==l?l:[]}},f=l.map((e=>Object.assign({dataIndex:e.group},c(e.group)))),p=n.map((e=>e.summary===pi.groupSummary.total.value?{dataIndex:e.summary,title:pi.groupSummary.total.text,formula:e.formula}:Object.assign(Object.assign({dataIndex:e.summary},c(e.summary)),{formula:e.formula}))),h=q.default.useMemo((()=>Object.assign({},o,{[pi.sorterFieldName]:void 0,[pi.groupSummary.summaryFieldName]:n.map((e=>`${e.formula}|${e.summary}`)).join(","),[pi.groupSummary.groupbyFieldName]:l.map((e=>e.group)).join(","),usedJH:2,[pi.currentPageName]:1})),[o,l,n]),[g,v]=q.default.useState(((e,l)=>[{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}))),...l.map((e=>{var l;const n=null===(l=t.find((t=>t.dataIndex===e.dataIndex)))||void 0===l?void 0:l.groupSummary;let a=n?{summation:n}:null;return e.dataIndex===pi.groupSummary.total.value&&(a={dataIndex:pi.groupSummary.recordTotalIndex,summation:{render:()=>i.total}}),Object.assign(Object.assign({},e),"count"===e.formula||"sum"===e.formula?a:null)}))])(f,p)),[y]=q.default.useState(s?[]:(e=>{const t=Va(e,l.map((e=>e.group))),a=[];return t.forEach((e=>{const t={};g.forEach((l=>{const{dataIndex:n}=l;"index"!==n&&La(t,n,ka(e[0],n))})),n.forEach((l=>{const n=l.summary!==pi.groupSummary.total.value?l.summary:pi.groupSummary.recordTotalIndex,a=l.formula;"count"===a&&La(t,n,e.length),"sum"===a&&La(t,n,m.sumBy(e,n)),"max"===a&&La(t,n,m.maxBy(e,n)[n]),"min"===a&&La(t,n,m.minBy(e,n)[n]),"avg"===a&&La(t,n,(m.sumBy(e,n)/e.length).toFixed(2))})),a.push(t)})),a})(a.current.tableFullData)),b=Object.assign(Object.assign({size:r,height:400},s?{fetch:{api:d.api,params:h,dataKey:null==d?void 0:d.dataKey}}:{dataSource:y}),{columns:g,rowKey:e=>e.index,showFastSearch:!1,showTableImport:!1,exportExcel:{fileName:`${j.default().format(ai)}.xlsx`},tablePrint:{showLogo:!0},columnsChange:e=>v(e)});return q.default.createElement(Ku,b)},Ud=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,prefixCls:a,$size:r,flattenColumns:i}=q.default.useContext(Xr),{uniqueKey:o}=n.current.props,{t:d}=Xe(),u=q.default.useRef(null),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[m,h]=q.default.useState([]),[v,y]=q.default.useState(""),[b,x]=q.default.useState("");Ql((()=>{if(b){const{group:e,summary:t}=m.find((e=>e.value===b)).list;I(e),L(t)}else{const e=F();I((null==e?void 0:e.group)||[]),L((null==e?void 0:e.summary)||[])}}),[b]),q.default.useEffect((()=>{H()}),[]);const E=q.default.useMemo((()=>o?`summary_${o}`:""),[o]),C=q.default.useMemo((()=>i.filter((e=>![pi.expandableColumn,pi.selectionColumn,"index","pageIndex",pi.operationColumn].includes(e.dataIndex)))),[i]),w=C.filter((e=>!e.groupSummary)).map((e=>({text:qa(e.title),value:e.dataIndex}))),S=[pi.groupSummary.total,...C.filter((e=>!!e.groupSummary)).map((e=>({text:qa(e.title),value:e.dataIndex})))],N=[{text:d("qm.table.groupSummary.sumText"),value:"sum"},{text:d("qm.table.groupSummary.maxText"),value:"max"},{text:d("qm.table.groupSummary.minText"),value:"min"},{text:d("qm.table.groupSummary.avgText"),value:"avg"},{text:d("qm.table.groupSummary.countText"),value:"count"}],[T,I]=q.default.useState([]),[O,R]=q.default.useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(ht,{type:"text",onClick:()=>{u.current.REMOVE_RECORDS(t)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"group",title:d("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:T.findIndex((t=>t.group===e.value))>-1})))})}]),[k,L]=q.default.useState([]),[P,A]=q.default.useState([{title:d("qm.table.groupSummary.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(ht,{type:"text",onClick:()=>{c.current.REMOVE_RECORDS(t)}},d("qm.table.groupSummary.removeText")))},{dataIndex:"summary",title:d("qm.table.groupSummary.summaryColumn"),minWidth:200,editRender:e=>({type:"select",editable:!0,items:S.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:d("qm.table.groupSummary.calcFormula"),width:140,editRender:e=>({type:"select",editable:!0,extra:{cornerSign:!1},items:e.summary===pi.groupSummary.total.value?N.slice(N.length-1):N})}]),D=q.default.useMemo((()=>{const e=T.length&&T.every((e=>Object.values(e).every((e=>""!==e)))),t=k.length&&k.every((e=>Object.values(e).every((e=>""!==e))));return!(e&&t)}),[T,k]),_=()=>{E&&sessionStorage.setItem(E,JSON.stringify({group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}))},F=()=>{if(!E)return;const e=sessionStorage.getItem(E);return e?JSON.parse(e):null},H=()=>Ye(void 0,void 0,void 0,(function*(){if(!E)return;const e=F();if(e){const{group:t,summary:l}=e;I(t),L(l)}let t=yield fe.default.getItem(E);t||(t=yield M(E),Array.isArray(t)&&(yield fe.default.setItem(E,t))),Array.isArray(t)&&t.length&&(h(t),!e&&x(t[0].value))})),M=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),$=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}})),j={visible:f,title:d("qm.table.groupSummary.resultText"),loading:!1,onClose:()=>p(!1)};return q.default.createElement("div",{className:`${a}-group-summary__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{style:{width:"30%"}},q.default.createElement(Ku,{ref:u,size:r,columns:O,dataSource:T,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>R(e),onDataChange:e=>{I(e)}},q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{u.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"container line"},q.default.createElement(Ku,{ref:c,size:r,columns:P,dataSource:k,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onDataChange:e=>{L(e)}},q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{c.current.INSERT_RECORDS({})},style:{marginRight:0}}))),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(s.Input,{size:r,value:v,placeholder:d("qm.table.groupSummary.configText"),disabled:D,onChange:e=>{const{value:t}=e.target;y(t)}}),q.default.createElement(ht,{type:"primary",disabled:!v||D,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!E)return mt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ma(),t=[...m,{text:v,value:e,list:{group:T.filter((e=>!!e.group)),summary:k.filter((e=>!!e.summary))}}];h(t),x(e),y(""),yield fe.default.setItem(E,t),yield $(E,t)}))},d("qm.table.groupSummary.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${pi.rowHeightMaps[r]}px`}},q.default.createElement("span",null,d("qm.table.groupSummary.savedSetting"))),q.default.createElement("ul",null,m.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===b}),title:e.text,onClick:()=>{return t=e.value,void x(t!==b?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:d("qm.table.groupSummary.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ye(void 0,void 0,void 0,(function*(){if(!l)return;const e=m.filter((e=>e.value!==l));h(e),l===b&&x(""),yield fe.default.setItem(E,e),yield $(E,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!m.length&&q.default.createElement("div",{style:{padding:Jr}},q.default.createElement(hn,null)))))),q.default.createElement(Qn,j,q.default.createElement(Bd,{columns:C,group:T,summary:k})),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>t(),style:{marginRight:8}},d("qm.table.groupSummary.closeButton")),q.default.createElement(ht,{type:"primary",disabled:D,onClick:()=>(_(),void p(!0))},d("qm.table.groupSummary.confirmButton"))))},Gd=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(Xr),{t:a}=Xe(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.groupSummary.settingTitle"),loading:!1,width:"65%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-group-summary`,title:a("qm.table.groupSummary.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.PieChartOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(Ud,{onClose:()=>i(!1)})))}));Gd.displayName="GroupSummary";const Yd=e=>{const{onClose:t}=e,{global:l}=q.default.useContext(xe),{tableRef:n,$size:a,prefixCls:r,flattenColumns:i,setSuperFilters:o,clearTableFilter:d}=q.default.useContext(Xr),{uniqueKey:u}=n.current.props,{t:c}=Xe(),f=q.default.useRef(null),[p,m]=q.default.useState([]),[h,v]=q.default.useState([]),[y,b]=q.default.useState(""),[x,E]=q.default.useState("");Ql((()=>{m(x?h.find((e=>e.value===x)).list:F()||[])}),[x]),q.default.useEffect((()=>{H()}),[]);const C=q.default.useMemo((()=>u?`superSearch_${u}`:""),[u]),w=q.default.useMemo((()=>i.filter((e=>!!e.filter))),[i]),S=Ka(p),N=q.default.useMemo((()=>!(S&&ca(S))),[S]),T=q.default.useMemo((()=>!!p.length&&N),[p,N]),I=[{value:"and",text:c("qm.table.highSearch.andText")},{value:"or",text:c("qm.table.highSearch.orText")}],O=i.filter((e=>!!e.filter)).map((e=>({value:e.dataIndex,text:qa(e.title)}))),R=e=>["in","nin"].includes(e),k=(e,t)=>{let l;switch(e){case"number":l="number";break;case"date":l="date";break;case"checkbox":case"radio":l=t?"select-multiple":"select";break;default:l="text"}return l},L=e=>{let t=[];switch(e){case"date":case"number":t=[{value:">",text:c("qm.table.highSearch.gtText")},{value:"<",text:c("qm.table.highSearch.ltText")},{value:">=",text:c("qm.table.highSearch.gteText")},{value:"<=",text:c("qm.table.highSearch.lteText")},{value:"==",text:c("qm.table.highSearch.eqText")},{value:"!=",text:c("qm.table.highSearch.neqText")}];break;case"checkbox":case"radio":case"tree":t=[{value:"in",text:c("qm.table.highSearch.inText")},{value:"nin",text:c("qm.table.highSearch.ninText")},{value:"==",text:c("qm.table.highSearch.eqText")},{value:"!=",text:c("qm.table.highSearch.neqText")}];break;default:t=[{value:"like",text:c("qm.table.highSearch.likeText")},{value:"==",text:c("qm.table.highSearch.eqText")},{value:"!=",text:c("qm.table.highSearch.neqText")}]}return t},[P,A]=q.default.useState([{title:c("qm.table.highSearch.operation"),dataIndex:"__action__",fixed:"left",width:80,render:(e,t)=>q.default.createElement("div",null,q.default.createElement(ht,{type:"text",onClick:()=>{f.current.REMOVE_RECORDS(t)}},c("qm.table.highSearch.removeText")))},{title:c("qm.table.highSearch.bracket"),dataIndex:"bracketLeft",align:"right",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:c("qm.table.highSearch.fieldName"),dataIndex:"fieldName",width:160,required:!0,dictItems:O,editRender:e=>({type:"select",editable:!0,rules:[{required:!0,message:c("qm.table.highSearch.noEmpty")}],extra:{cornerSign:!1},onChange:t=>{var l,n;const a=Object.values(t)[0],r=null===(l=w.find((e=>e.dataIndex===a)))||void 0===l?void 0:l.filter.type,i=L(r);e.fieldType=r,e.expression=a?null===(n=i[0])||void 0===n?void 0:n.value:"",e.condition=R(e.expression)?[]:"",a||(e.bracketLeft=e.bracketRight="")}})},{title:c("qm.table.highSearch.fieldType"),dataIndex:"fieldType",width:100,hidden:!0},{title:c("qm.table.highSearch.expression"),dataIndex:"expression",width:120,required:!0,editRender:e=>{var t;const l=null===(t=w.find((t=>t.dataIndex===e.fieldName)))||void 0===t?void 0:t.filter.type;return{type:"select",editable:!0,items:L(l),extra:{disabled:!e.fieldName,cornerSign:!1},onChange:()=>{e.condition=R(e.expression)?[]:""}}}},{title:c("qm.table.highSearch.condition"),dataIndex:"condition",minWidth:200,editRender:e=>{var t,l,n;const a=w.find((t=>t.dataIndex===e.fieldName)),r=null==a?void 0:a.filter.type,i=null!==(n=null!==(l=null===(t=null==a?void 0:a.filter)||void 0===t?void 0:t.items)&&void 0!==l?l:null==a?void 0:a.dictItems)&&void 0!==n?n:[];return{type:k(r,R(e.expression)),editable:!0,items:i,extra:{disabled:!e.fieldName,cornerSign:!1}}}},{title:c("qm.table.highSearch.bracket"),dataIndex:"bracketRight",width:80,render:(e,t)=>q.default.createElement("span",{style:{fontSize:"20px"}},e)},{title:c("qm.table.highSearch.logic"),dataIndex:"logic",width:100,required:!0,dictItems:I,editRender:e=>({type:"select",editable:!0,extra:{disabled:!e.fieldName,cornerSign:!1}})}]),D=()=>{d(),o(p.map((e=>dt(e,["index","pageIndex"])))),_(),t()},_=()=>{C&&sessionStorage.setItem(C,JSON.stringify(p.filter((e=>!!e.fieldName))))},F=()=>{if(!C)return;const e=sessionStorage.getItem(C);return e?JSON.parse(e):null},H=()=>Ye(void 0,void 0,void 0,(function*(){if(!C)return;const e=F();e&&m(e);let t=yield fe.default.getItem(C);t||(t=yield M(C),Array.isArray(t)&&(yield fe.default.setItem(C,t))),Array.isArray(t)&&t.length&&(v(t),!e&&E(t[0].value))})),M=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==l?void 0:l.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),$=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[e]:t})}catch(e){}}));return q.default.createElement("div",{className:`${r}-super-search__setting`},q.default.createElement("div",{className:"main"},q.default.createElement("div",{className:"container"},q.default.createElement(Ku,{ref:f,size:a,columns:P,dataSource:p,rowKey:"index",height:350,showFastSearch:!1,showTableImport:!1,showFullScreen:!1,showClipboard:!1,showColumnDefine:!1,columnsChange:e=>A(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;e.fieldName&&["bracketLeft","bracketRight"].includes(l)&&("bracketLeft"===l&&(e[l]=e[l]?"":"("),"bracketRight"===l&&(e[l]=e[l]?"":")"),m([...p]))},onDataChange:e=>{m(e)}},q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.PlusOutlined,null),onClick:()=>{f.current.INSERT_RECORDS({bracketLeft:"",bracketRight:"",logic:"and"})},style:{marginRight:0}})),pi.highSearch.showSQL&&S&&q.default.createElement("code",{className:"lang-js"},S)),q.default.createElement("div",{className:"saved line"},q.default.createElement("div",{className:"form-wrap"},q.default.createElement(s.Input,{size:a,value:y,placeholder:c("qm.table.highSearch.configText"),disabled:N,onChange:e=>{const{value:t}=e.target;b(t)}}),q.default.createElement(ht,{type:"primary",disabled:!y||N,style:{marginLeft:"10px"},onClick:()=>Ye(void 0,void 0,void 0,(function*(){if(!C)return mt("Table","必须设置组件参数 `uniqueKey` 才能保存");const e=Ma(),t=[...h,{text:y,value:e,list:p.filter((e=>!!e.fieldName))}];v(t),E(e),b(""),yield fe.default.setItem(C,t),yield $(C,t)}))},c("qm.table.highSearch.saveButton"))),q.default.createElement("div",{className:"card-wrap"},q.default.createElement("h5",{style:{height:`${pi.rowHeightMaps[a]}px`}},q.default.createElement("span",null,c("qm.table.highSearch.savedSetting"))),q.default.createElement("ul",null,h.map((e=>q.default.createElement("li",{key:e.value,className:J.default({selected:e.value===x}),title:e.text,onClick:()=>{return t=e.value,void E(t!==x?t:"");var t}},q.default.createElement("span",{className:"title"},e.text),q.default.createElement("i",{className:"svgicon close",title:c("qm.table.highSearch.removeText"),onClick:t=>{var l;t.stopPropagation(),l=e.value,Ye(void 0,void 0,void 0,(function*(){if(!l)return;const e=h.filter((e=>e.value!==l));v(e),l===x&&E(""),yield fe.default.setItem(C,e),yield $(C,e)}))}},q.default.createElement(g.CloseCircleOutlined,null))))),!h.length&&q.default.createElement("div",{style:{padding:Jr}},q.default.createElement(hn,null)))))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>t(),style:{marginRight:8}},c("qm.table.highSearch.closeButton")),q.default.createElement(ht,{type:"primary",disabled:T,onClick:()=>D()},c("qm.table.highSearch.searchButton"))))},Xd=q.default.forwardRef(((e,t)=>{const{open:l=!0}=e,{prefixCls:n}=q.default.useContext(Xr),{t:a}=Xe(),[r,i]=q.default.useState(!1),o=()=>{i(!0)};q.default.useImperativeHandle(t,(()=>({clickHandle:o})));const s={visible:r,title:a("qm.table.highSearch.settingTitle"),loading:!1,width:"70%",bodyStyle:{paddingBottom:"52px"},onClose:()=>i(!1)};return q.default.createElement(q.default.Fragment,null,l&&q.default.createElement("span",{className:`${n}-super-search`,title:a("qm.table.highSearch.text"),onClick:()=>o()},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.FunnelPlotOutlined,null))),q.default.createElement(Qn,s,q.default.createElement(Yd,{onClose:()=>i(!1)})))}));Xd.displayName="SuperSearch";const Qd=q.default.forwardRef(((e,t)=>{const{tableColumns:l,showFullScreen:n,showReload:a,showPrint:r,showImport:i,showExport:o,showClipboard:d,showCollection:u,showFastSearch:c,showSuperSearch:f,showPivotGrid:p,showGroupSummary:m,showToolBox:h}=e,{global:v}=q.default.useContext(xe),{tableRef:y,$size:b,prefixCls:x,isFullScreen:E}=q.default.useContext(Xr),{uniqueKey:C,exportExcel:w}=y.current.props,{t:S}=Xe(),N=q.default.useRef(null),T=q.default.useRef(null),I=q.default.useRef(null),O=q.default.useRef(null),R=q.default.useRef(null),k=q.default.useRef(null),L=q.default.useRef(null),P=q.default.useRef(null),A=q.default.useRef(null),D=q.default.useRef(null),_=q.default.useRef(null),F=q.default.useRef(!1),H=q.default.useMemo((()=>C?`toolBox_${C}`:""),[C]),[M,$]=q.default.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:n,reload:a,print:r,import:i,export:o&&!(null==w?void 0:w.hideIcon),clipboard:d,collection:u,fastSearch:c,superSearch:f,pivotGrid:p,groupSummary:m},[K,V]=q.default.useState(!1);Ql((()=>{F.current&&(W(),F.current=!1)}),[M]),q.default.useEffect((()=>{z()}),[]),q.default.useImperativeHandle(t,(()=>({exportHandle:()=>{if(!R.current)return mt("Table","执行导出需要配置 `exportExcel` 参数");R.current.clickHandle()}})));const z=()=>{if(!H||!h)return;const e=JSON.parse(localStorage.getItem(H));e||B(H).then((e=>{e&&($(Object.assign({},M,e)),localStorage.setItem(H,JSON.stringify(e)))})).catch((()=>{})),e&&$(Object.assign({},M,e))},W=()=>{if(!H||!h)return;const e={};for(const t in M)M[t]&&(e[t]=M[t]);localStorage.setItem(H,JSON.stringify(e)),U(H,e)},B=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==v?void 0:v.getComponentConfigApi;if(t)try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),U=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==v?void 0:v.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),G=e=>Ye(void 0,void 0,void 0,(function*(){V(!1),yield at(100),e.current.clickHandle()})),Y=(e,t)=>{F.current=!0,$(Object.assign({},M,{[t]:e}))},X={"top-toolbox__popper":!0,[`${x}--lg`]:"large"===b,[`${x}--sm`]:"small"===b};return q.default.createElement(q.default.Fragment,null,n&&q.default.createElement(Ci,{ref:N,isFullScreen:E,open:!h||M.fullScreen}),a&&q.default.createElement(wi,{ref:T,open:!h||M.reload}),r&&q.default.createElement(Ni,{ref:I,tableColumns:l,open:!h||M.print}),i&&q.default.createElement(Hi,{ref:O,tableColumns:l,open:!h||M.import}),o&&q.default.createElement(bs,{ref:R,tableColumns:l,open:(!h||M.export)&&!(null==w?void 0:w.hideIcon)}),d&&q.default.createElement(Es,{ref:k,open:!h||M.clipboard}),u&&q.default.createElement(ws,{ref:L,columns:l,open:!h||M.collection}),c&&q.default.createElement(Ns,{ref:P,open:!h||M.fastSearch}),p&&q.default.createElement(Wd,{ref:A,open:!h||M.pivotGrid}),m&&q.default.createElement(Gd,{ref:D,open:!h||M.groupSummary}),f&&q.default.createElement(Xd,{ref:_,open:!h||M.superSearch}),h&&q.default.createElement(s.Dropdown,{open:K,trigger:["click"],placement:"bottomRight",dropdownRender:()=>(()=>{const e=[{key:"fullScreen",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.fullScreen,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fullScreen"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.screen.full"))),onClick:()=>G(N)},{key:"reload",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.reload,style:{marginRight:6},onChange:e=>Y(e.target.checked,"reload"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.refresh.text"))),onClick:()=>G(T)},{key:"print",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.print,style:{marginRight:6},onChange:e=>Y(e.target.checked,"print"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.print.text"))),onClick:()=>G(I)},{key:"import",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.import,style:{marginRight:6},onChange:e=>Y(e.target.checked,"import"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.import.textNoSpace"))),onClick:()=>G(O)},{key:"export",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.export,style:{marginRight:6},onChange:e=>Y(e.target.checked,"export"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.export.textNoSpace"))),onClick:()=>G(R)},{key:"clipboard",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.clipboard,style:{marginRight:6},onChange:e=>Y(e.target.checked,"clipboard"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.clipboard.textNoSpace"))),onClick:()=>G(k)},{key:"collection",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.collection,style:{marginRight:6},onChange:e=>Y(e.target.checked,"collection"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.selectCollection.text"))),onClick:()=>G(L)},{key:"fastSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.fastSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"fastSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.fastSearch.text"))),onClick:()=>G(P)},{key:"pivotGrid",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.pivotGrid,style:{marginRight:6},onChange:e=>Y(e.target.checked,"pivotGrid"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.pivotGrid.text"))),onClick:()=>G(A)},{key:"groupSummary",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.groupSummary,style:{marginRight:6},onChange:e=>Y(e.target.checked,"groupSummary"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.groupSummary.text"))),onClick:()=>G(D)},{key:"superSearch",label:q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Checkbox,{checked:M.superSearch,style:{marginRight:6},onChange:e=>Y(e.target.checked,"superSearch"),onClick:e=>e.stopPropagation()}),q.default.createElement("span",null,S("qm.table.highSearch.text"))),onClick:()=>G(_)}];return q.default.createElement(s.Menu,{items:e.filter((e=>j[e.key]))})})(),overlayClassName:J.default(X),overlayStyle:{minWidth:120},onOpenChange:e=>{V(e)}},q.default.createElement("span",{className:`${x}-toolbox`,title:S("qm.table.toolbox.text")},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.AppstoreAddOutlined,null)))))}));Qd.displayName="ToolBox";const Zd=(e,t)=>e.map((e=>(e.children&&(e.children=Zd(e.children,t)),t(e)))),Jd=q.default.forwardRef(((e,t)=>{const{columns:l}=e,{global:n}=q.default.useContext(xe),{tableRef:a,prefixCls:r,$size:i}=q.default.useContext(Xr),{showColumnDefine:o,uniqueKey:d,onlyShowIcon:u,columnsChange:c}=a.current.props,{t:f}=Xe(),p=q.default.useRef([]),[h,v]=q.default.useState(!1),y=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"left"===e.fixed)))(l)),[l]),b=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&"right"===e.fixed)))(l)),[l]),x=q.default.useMemo((()=>(e=>e.filter((e=>!e.noAuth&&!e.fixed)))(l)),[l]),E=q.default.useMemo((()=>d?`table_${d}`:""),[d]);Ql((()=>{S(l)}),[l]),q.default.useLayoutEffect((()=>{N()}),[]),q.default.useImperativeHandle(t,(()=>({initialHandler:N})));const C=()=>{if(!E)return;const e=JSON.parse(localStorage.getItem(E));var t;if(e||(t=E,Ye(void 0,void 0,void 0,(function*(){const e=null==n?void 0:n.getComponentConfigApi;if(e)try{const l=yield e({key:t});if(200===l.code)return l.data}catch(e){}}))).then((e=>{e?(localStorage.setItem(E,JSON.stringify(e)),N()):(null==n?void 0:n.getComponentConfigApi)&&S(l)})).catch((()=>{})),!e)return;return m.xor(ha(e).map((e=>e.dataIndex)),ha(l).map((e=>e.dataIndex))).length>0?Zd(l,(t=>{const l=va(e,t.dataIndex);return l&&(void 0!==l.hidden&&(t.hidden=l.hidden),void 0!==l.fixed&&(t.fixed=l.fixed),void 0!==l.width&&(t.width=l.width),void 0!==l.renderWidth&&(t.renderWidth=l.renderWidth)),t})):Zd(e,(e=>{const t=va(l,e.dataIndex);return void 0===e.fixed&&delete t.fixed,Object.assign({},t,e)}))},w=e=>e.map((e=>{const t={};return Array.isArray(e.children)&&(t.children=w(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)})),S=e=>{if(!E)return;const t=w(e),l=JSON.parse(localStorage.getItem(E));var r,i;a.current.columnsDefined&&!m.isEqual(t,l)&&(localStorage.setItem(E,JSON.stringify(t)),r=E,i=t,Ye(void 0,void 0,void 0,(function*(){const e=null==n?void 0:n.saveComponentConfigApi;if(e)try{yield e({[r]:i})}catch(e){}})))},N=()=>{const e=C();var t;e&&(t=I(e),p.current=t,null==c||c(e))},I=e=>{const t=[];return e.filter((e=>!e.noAuth)).forEach(((l,n)=>{const a=l.colSpan;a>1&&e.slice(n+1,n+a).every((({colSpan:e})=>0===e))&&t.push(e.slice(n,n+a))})),t},O=()=>{const e=t=>t.map((t=>{const n=va(l,t.dataIndex)||ut(t);return t.children&&(n.children=e(t.children)),Object.assign(n,{hidden:t.hidden,fixed:t.fixed,width:t.width})}));null==c||c(e(a.current.originColumns))},R=e=>{const t=[];e.forEach((l=>{const{colSpan:n,dataIndex:a}=l;if(0===n)return;if(1===n)return t.push(l);const r=p.current.findIndex((e=>e.map((e=>e.dataIndex)).includes(a)));if(-1===r)return t.push(l);t.push(...p.current[r].map((({dataIndex:t},n)=>{const a=e.find((e=>e.dataIndex===t));return n>0&&(void 0!==l.hidden&&(a.hidden=l.hidden),void 0!==l.fixed?a.fixed=l.fixed:a.fixed&&delete a.fixed),a})))})),l.forEach(((e,l)=>{e.noAuth&&t.findIndex((t=>t.dataIndex===e.dataIndex))<0&&t.splice(l,0,e)})),null==c||c(t)},k=(e,t)=>{e.noFixed||(t?e.fixed=t:delete e.fixed,R(l))},L=(e,t)=>{var n;const{colSpan:a,noFixed:r}=e;if(0===a)return q.default.createElement("li",{key:e.dataIndex,style:{display:"none"}});const i=qa(e.title),o=["svgicon","handle",`${t}-handle`],d=q.default.createElement("li",{key:e.dataIndex,className:"item"},q.default.createElement(s.Checkbox,{disabled:e.required,checked:!e.hidden,onChange:t=>{const{checked:n}=t.target;e.hidden=!n,R(l)}}),q.default.createElement("i",{className:J.default(o),title:f("qm.table.columnFilter.draggable")},q.default.createElement(g.HolderOutlined,null)),q.default.createElement("span",{className:"text",title:i},i),"main"===t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedLeft"),onClick:()=>k(e,"left")},q.default.createElement(g.StepBackwardOutlined,null)),q.default.createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.fixedRight"),onClick:()=>k(e,"right")},q.default.createElement(g.StepForwardOutlined,null))):"sub"!==t?q.default.createElement("span",{className:J.default("fixed",r?"disabled":"")},q.default.createElement("i",{className:"svgicon",title:f("qm.table.columnFilter.cancelFixed"),onClick:()=>k(e)},q.default.createElement(g.CloseCircleOutlined,null))):null);return!e.hidden&&(null===(n=e.children)||void 0===n?void 0:n.length)?q.default.createElement(s.Popover,{key:e.dataIndex,trigger:["hover"],placement:"leftTop",overlayClassName:"column-item__popper",content:P(e.children,e.dataIndex)},d):d},P=(e,t)=>q.default.createElement("div",{className:"column-filter--wrap"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".sub-handle",tag:"ul",animation:200,list:e,setList:n=>{const a=n.map((e=>e.dataIndex)),r=e.map((e=>e.dataIndex));m.isEqual(a,r)||((e,t)=>{va(l,t).children=e,null==c||c([...l])})(Ya(n),t)}},e.map((e=>L(e,"sub"))))),A={[`${r}__popper`]:!0,"column-filter__popper":!0,[`${r}--lg`]:"large"===i,[`${r}--sm`]:"small"===i},D=[`${r}-column-filter`,{selected:h}];return o?q.default.createElement(gs,{action:["click"],popupVisible:h,popup:q.default.createElement("div",{className:"column-filter--wrap",style:{maxHeight:"calc(100vh - 10px)"}},q.default.createElement("div",{className:"reset"},q.default.createElement(ht,{type:"text",size:"small",onClick:O},f("qm.table.columnFilter.reset"))),q.default.createElement("div",{className:"left"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".left-handle",tag:"ul",animation:200,list:y,setList:e=>{const t=e.map((e=>e.dataIndex)),l=y.map((e=>e.dataIndex));m.isEqual(t,l)||R([...Ya(e),...x,...b])}},y.map((e=>L(e,"left"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"main"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".main-handle",tag:"ul",animation:200,list:x,setList:e=>{const t=e.map((e=>e.dataIndex)),l=x.map((e=>e.dataIndex));m.isEqual(t,l)||R([...y,...Ya(e),...b])}},x.map((e=>L(e,"main"))))),q.default.createElement("div",{className:"divider"}),q.default.createElement("div",{className:"right"},q.default.createElement(T.ReactSortable,{itemKey:"dataIndex",handle:".right-handle",tag:"ul",animation:200,list:b,setList:e=>{const t=e.map((e=>e.dataIndex)),l=b.map((e=>e.dataIndex));m.isEqual(t,l)||R([...y,...x,...Ya(e)])}},b.map((e=>L(e,"right")))))),popupClassName:J.default(A),popupStyle:{minWidth:160},onPopupVisibleChange:e=>{v(e)},builtinPlacements:ri,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("span",{className:J.default(D),title:u?f("qm.table.columnFilter.text"):void 0},q.default.createElement("i",{className:"svgicon icon"},q.default.createElement(g.SettingOutlined,null)),!u&&q.default.createElement("span",null,f("qm.table.columnFilter.text")))):null}));Jd.displayName="ColumnFilter";const eu=(e,t,l)=>{let n;for(let a=0;a<e.length;a++){const r=e[a];if(r.children)if(r.children.some((e=>e[l]===t)))n=r[l];else{const e=eu(r.children,t,l);e&&(n=e)}}return n},tu=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&tu(e.children,t),t(e)||e.children&&e.children.length))),lu=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...lu(e.children,t)),t(e)&&l.push(e)})),l},nu=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=nu(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},au=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:au(e.children,t,l,n)}):e)),ru=(e,t)=>{const l=[];return e.forEach((e=>{e.children&&l.push(...ru(e.children,t)),Array.isArray(e.children)&&e.children.length&&l.push(e[t])})),l},iu=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][l]===t)return[t];if(Array.isArray(e[n].children)){const a=iu(e[n].children,t,l);if(a)return[e[n][l],a].flat()}}},ou=(e,t)=>{var l;const n=(null===(l=e.children)||void 0===l?void 0:l.map((e=>e[t])))||[];return Array.isArray(e.children)&&e.children.forEach((e=>n.push(...ou(e,t)))),n},su=q.default.forwardRef(((e,t)=>{const{className:l,style:n,filterable:a=!0,multiple:r,draggable:i,dataSource:o,fetch:d,autoFocus:u,asyncLoad:c,checkStrictly:f,checkStrategy:p="SHOW_CHILD",placeholder:h,fieldsDefine:v,value:y,height:b,defaultSelectedKeys:x=[],defaultExpandedKeys:E=[],defaultExpandAll:C=!0,showSearchBar:w=!0,showCollapse:S=!0,onSelectChange:N,onCheckChange:T,onDragStart:I,onDragChange:O,onExpand:R}=e,{$size:k}=Ze(e),{t:L}=Xe(),P=(null==v?void 0:v.valueKey)||"value",A=(null==v?void 0:v.textKey)||"text";null==v||v.children;const D=q.default.useRef(null),_=q.default.useRef(null),F=Cn(D),[H,M]=hi(b,{value:b}),[$,j]=q.default.useState(!1),K=wn((()=>{M(D.current.offsetHeight-le.current.offsetHeight-10)}),5);Ie((()=>{b||K()}),[F.height]);const[V,z]=q.default.useState([]),[W,B]=q.default.useState({}),[U,G]=q.default.useState([]),[Y,X]=q.default.useState([]),[Q,Z]=q.default.useState(""),[ee,te]=q.default.useState(C),le=q.default.useRef(null),ne=q.default.useRef([]),ae=q.default.useRef([]);q.default.useEffect((()=>{Array.isArray(o)&&(re(o),G(ie(o)),B({}))}),[o]),q.default.useEffect((()=>{var e;de(),u&&(null===(e=_.current)||void 0===e||e.focus())}),[]),Ql((()=>{de()}),[null==d?void 0:d.params]),Ql((()=>{X(se())}),[W]),q.default.useImperativeHandle(t,(()=>({INSERT_RECORD:(e,t)=>{const l=Array.isArray(t)?t:[t],n=nu(V,(t=>e===t[P]));n&&(Array.isArray(n.children)?n.children.push(...l):n.children=[...l],re([...V]))},REMOVE_RECORD:e=>{var t;const l=eu(V,e,P);if(void 0===l&&V.find((t=>t[P]===e)))re(V.filter((t=>t[P]!==e)));else{const n=nu(V,(e=>l===e[P]));if(!n)return;const a=null===(t=n.children)||void 0===t?void 0:t.findIndex((t=>e===t[P]));a>=0&&(n.children.splice(a,1),re([...V]))}},UPDATE_RECORD:(e,t)=>{const l=nu(V,(t=>e===t[P]));l&&(m.merge(l,t),re([...V]))}})));const re=e=>{z(e),ne.current=e,ae.current=ru(e,P)},ie=e=>{if(r)return x;const t=lu(e,(e=>x.includes(e[A])));return 1===t.length?[t[0][P]]:[]},oe=e=>{var t;return(null===(t=iu(V,e,P))||void 0===t?void 0:t.slice(0,-1))||[]},se=()=>{if(C)return ae.current;const e=[];return U.forEach((t=>{if(r){if("SHOW_ALL"===p&&!ae.current.includes(t)&&e.push(...oe(t)),"SHOW_CHILD"===p&&e.push(...oe(t)),"SHOW_PARENT"===p){const l=gr(V,t);if(l){const n=oe(t),a=ou(l,P);e.push(...n,...[t,...a].filter((e=>ae.current.includes(e))))}}}else e.push(...oe(t))})),[...new Set([...E,...e])]},de=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!d)return;const{api:t,params:l,dataKey:n,afterFetch:a,callback:r}=d;try{j(!0);const i=yield t(l);if(200===i.code){let t=Array.isArray(i.data)?i.data:null!==(e=m.get(i.data,n))&&void 0!==e?e:[];t="function"==typeof a?yield a(t):t,re(t),G(ie(t)),B({}),null==r||r(t)}}catch(e){}j(!1)})),ue=e=>`${e}|${Pr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,ce=yt("search-tree"),fe={[ce]:!0,[`${ce}--lg`]:"large"===k,[`${ce}--sm`]:"small"===k};return q.default.createElement("div",{ref:D,className:J.default(fe,l),style:n},q.default.createElement("div",{ref:le,className:"topper",style:{display:w||S?"":"none"}},w&&q.default.createElement(s.Input,{ref:_,value:Q,size:k,placeholder:h||L("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{if(!a)return;const t=tu(ne.current,(t=>{if(!e)return!0;const l=t[A]||"";return-1!==ue(l).indexOf(e)}));Z(e),z(t),X(C||e?ru(t,P):se())})(e.target.value)}),S&&q.default.createElement("a",{className:"trigger",onClick:()=>{te(!ee),X(ee?[]:ae.current)}},ee?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",L(ee?"qm.form.collect":"qm.form.spread"))),q.default.createElement(gn,{spinning:$},q.default.createElement(s.Tree,{fieldNames:{title:A,key:P,children:"children"},multiple:r,draggable:i,blockNode:i,checkable:r,selectable:!r,height:H,disabled:e.disabled,checkStrictly:f,selectedKeys:null!=y?y:U,checkedKeys:null!=y?y:U,expandedKeys:Y,treeData:V,loadData:c?({key:e,children:t})=>Ye(void 0,void 0,void 0,(function*(){var l;if(!d||t)return;const{api:n,params:a,dataKey:r,formatter:i=(e=>e),afterFetch:o}=d;try{const t=yield n(i(Object.assign(Object.assign({},a),{[P]:e})));if(200===t.code){let n=Array.isArray(t.data)?t.data:null!==(l=m.get(t.data,r))&&void 0!==l?l:[];n="function"==typeof o?yield o(n):n;const a=au(ne.current,e,P,n);re(a)}}catch(e){}})):void 0,titleRender:e.titleRender,filterTreeNode:e=>{if(!Q)return!1;const t=e[A]||"";return-1!==ue(t).indexOf(Q)},onDragStart:I,onDragEnter:e=>{X(e.expandedKeys)},onDrop:e=>{const t=e.node.key,l=e.dragNode.key,n=e.node.pos.split("-"),a=e.dropPosition-Number(n[n.length-1]),r=(e,t,l)=>{for(let n=0;n<e.length;n++){if(e[n][P]===t)return l(e[n],n,e);e[n].children&&r(e[n].children,t,l)}},i=[...V];let o;if(r(i,l,((e,t,l)=>{l.splice(t,1),o=e})),e.dropToGap)if((e.node.children||[]).length>0&&e.node.expanded&&1===a)r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));else{let e,l=[];r(i,t,((t,n,a)=>{l=a,e=n})),-1===a?l.splice(e,0,o):l.splice(e+1,0,o)}else r(i,t,(e=>{e.children=e.children||[],e.children.unshift(o)}));re(i)},onDragEnd:e=>{null==O||O(e,V)},onExpand:(e,t)=>{ot(e)&&te(!1),ae.current.every((t=>e.includes(t)))&&te(!0),X(e),null==R||R(e,t)},onSelect:e=>{G(e);const t=lu(ne.current,(t=>e.includes(m.get(t,P))));null==N||N(r?t:t[0])},onCheck:e=>{f&&(e=e.checked),G(e),f||("SHOW_CHILD"===p&&(e=e.filter((e=>!ae.current.includes(e)))),"SHOW_PARENT"===p&&(e=e.filter(((e,t,l)=>!l.includes(eu(V,e,P))))));const t=lu(ne.current,(t=>e.includes(m.get(t,P))));null==T||T(r?t:t[0])}})))}));su.displayName="QmSearchTree";const du=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"filter",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),uu=e=>{const{column:t,filters:l}=e,{$size:n,prefixCls:a,setFilters:r,clearSuperFilters:i}=q.default.useContext(Xr),{t:o}=Xe(),d=q.default.useRef(null),u=q.default.useRef(null),c=q.default.useRef(null),[f,p]=q.default.useState(!1),[h,g]=q.default.useState(!1),[v,y]=q.default.useState({}),b=q.default.useMemo((()=>{const{dataIndex:e,filter:l}=t;return`${e}|${l.type}`}),[t]),x=q.default.useMemo((()=>{let e=!1;for(const t in l[b])if(!ot(l[b][t])||h){e=!0;break}return e}),[b,l,h]);q.default.useLayoutEffect((()=>{f&&setTimeout((()=>E()),20)}),[f]),q.default.useEffect((()=>{var e;m.isEqual(v[b],l[b])||y({[b]:l[b]||{}}),g(""===(null===(e=l[b])||void 0===e?void 0:e["=="]))}),[l]);const E=()=>{switch(t.filter.type){case"text":d.current.focus();break;case"number":u.current.focus();break;case"textarea":c.current.focus()}},C=e=>{e&&y(e),i(),r((e=>{for(const t in e){for(const l in e[t])if(ot(e[t][l])){if(["text","textarea"].includes(t.split("|")[1])&&null!==e[t][l])continue;delete e[t][l]}Object.keys(e[t]).length||delete e[t]}return e})(Object.assign(Object.assign(Object.assign({},l),v),e))),p(!1)},w={text:e=>{var t,l;return q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Input,{ref:d,size:n,placeholder:o("qm.table.filter.searchText",{text:qa(e.title)}),style:{width:"180px"},value:null!==(l=null===(t=v[b])||void 0===t?void 0:t.like)&&void 0!==l?l:"",disabled:h,onChange:e=>{const{value:t}=e.target;y((e=>Object.assign({},e,{[b]:{like:t||null}})))},onKeyDown:e=>{13===e.keyCode&&C()}}),q.default.createElement("div",{style:{marginTop:8}},q.default.createElement(s.Checkbox,{checked:h,onChange:e=>{const{checked:t}=e.target,l=t?"":null;y((e=>Object.assign({},e,{[b]:{"==":l,like:null}}))),g(t)}},o("qm.table.filter.nullValue"))))},textarea:e=>{var t,l;return q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Input.TextArea,{ref:c,size:n,placeholder:o("qm.table.filter.searchAreaText",{text:qa(e.title)}),style:{width:"220px"},value:null!==(l=null===(t=v[b])||void 0===t?void 0:t.likes)&&void 0!==l?l:"",disabled:h,onChange:e=>{const{value:t}=e.target;y((e=>Object.assign({},e,{[b]:{likes:t||null}})))},onKeyDown:e=>{13!==e.keyCode||e.shiftKey||(e.preventDefault(),C())}}),q.default.createElement("div",{style:{marginTop:8}},q.default.createElement(s.Checkbox,{checked:h,onChange:e=>{const{checked:t}=e.target,l=t?"":null;y((e=>Object.assign({},e,{[b]:{"==":l,like:null}}))),g(t)}},o("qm.table.filter.nullValue"))))},number:e=>{const t=e=>{var t,l;return{value:null!==(l=null===(t=v[b])||void 0===t?void 0:t[e])&&void 0!==l?l:"",size:n,onChange:t=>{t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||y((l=>Object.assign({},l,{[b]:Object.assign({},l[b],{[e]:t})})))},onKeyDown:e=>{13===e.keyCode&&C()}}};return q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",null,"> "),q.default.createElement(s.InputNumber,je({ref:u},t(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"< "),q.default.createElement(s.InputNumber,je({},t("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"= "),q.default.createElement(s.InputNumber,je({},t("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"!="),q.default.createElement(s.InputNumber,je({},t("!="),{placeholder:o("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},date:e=>{const t=e=>{var t;return{value:Fa(null===(t=v[b])||void 0===t?void 0:t[e],li),format:li,size:n,onChange:t=>{y((l=>Object.assign({},l,{[b]:Object.assign({},l[b],{[e]:Ha(t,li)})})))},onKeyDown:e=>{13===e.keyCode&&C()}}};return q.default.createElement("ul",null,q.default.createElement("li",null,q.default.createElement("span",null,"> "),q.default.createElement(qe,je({},t(">"),{placeholder:o("qm.table.filter.gtPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"< "),q.default.createElement(qe,je({},t("<"),{placeholder:o("qm.table.filter.ltPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"= "),q.default.createElement(qe,je({},t("=="),{placeholder:o("qm.table.filter.eqPlaceholder"),style:{width:"150px"}}))),q.default.createElement("li",null,q.default.createElement("span",null,"!="),q.default.createElement(qe,je({},t("!="),{placeholder:o("qm.table.filter.neqPlaceholder"),style:{width:"150px"}}))))},radio:e=>{var t;const{filter:l,dictItems:n=[]}=e,a=l.items||n;return q.default.createElement("ul",null,q.default.createElement(s.Radio.Group,{style:{width:"100%"},value:null===(t=v[b])||void 0===t?void 0:t["=="],onChange:e=>{const{value:t}=e.target;y((e=>Object.assign({},e,{[b]:{"==":t}})))}},a.map((e=>q.default.createElement("li",{key:e.value},q.default.createElement(s.Radio,{value:e.value,disabled:e.disabled},e.text))))))},checkbox:e=>{var t;const{filter:l,dictItems:n=[]}=e,a=l.items||n;return q.default.createElement("ul",null,q.default.createElement(s.Checkbox.Group,{style:{width:"100%"},value:null===(t=v[b])||void 0===t?void 0:t.in,onChange:e=>{y((t=>Object.assign({},t,{[b]:{in:e}})))}},a.map((e=>q.default.createElement("li",{key:e.value},q.default.createElement(s.Checkbox,{value:e.value,disabled:e.disabled},e.text))))))},tree:e=>{var t;const{filter:l,dictItems:n=[]}=e,a=l.items||n;return q.default.createElement("div",{style:Object.assign({height:200},l.style)},q.default.createElement(su,{multiple:!0,value:(null===(t=v[b])||void 0===t?void 0:t.in)||[],dataSource:a,onCheckChange:e=>{const t=e.map((e=>e.value));y((e=>Object.assign({},e,{[b]:{in:t}})))}}))}},S=()=>q.default.createElement(s.Space,{style:{width:"100%",marginTop:8,justifyContent:"flex-end"}},q.default.createElement(ht,{size:n,onClick:()=>(C({[b]:{}}),void g(!1))},o("qm.table.filter.reset")),q.default.createElement(ht,{type:"primary",size:n,onClick:()=>C()},o("qm.table.filter.search"))),N={"head-filter__popper":!0,[`${a}--lg`]:"large"===n,[`${a}--sm`]:"small"===n},T=["cell--filter",{selected:f,actived:x}];return q.default.createElement(gs,{action:["click"],popupVisible:f,popup:(()=>{const e=t.filter.type,l=w[e];return l?q.default.createElement("div",{className:"head-filter--wrap",onClick:e=>e.stopPropagation()},q.default.createElement("div",null,l(t)),S()):(mt("Table","表头筛选的类型 `type` 配置不正确"),null)})(),popupClassName:J.default(N),popupStyle:{minWidth:150},onPopupVisibleChange:e=>{p(e)},builtinPlacements:ri,prefixCls:"ant-select-dropdown",popupPlacement:"bottomRight",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{className:J.default(T),title:o("qm.table.filter.text"),onClick:e=>e.stopPropagation()},q.default.createElement("span",{className:"svgicon icon"},q.default.createElement(du,null))))},cu=e=>{const{column:t}=e,{tableRef:l,bordered:n}=q.default.useContext(Xr),{columns:a,resizable:r,columnsChange:i=lt}=l.current.props,o=q.default.useMemo((()=>ba(t)),[t]),s={resizable:!0,"is--line":r&&!n};return q.default.createElement("div",{className:J.default(s),onMouseDown:e=>{e.preventDefault();const t=e.target,{elementStore:n,scrollBarRef:r}=l.current,s=n.$resizableBar,d=t.offsetWidth/2,u=e.clientX,c=Ia(t,n.$table).left-r.current.scrollLeft+d;n.$table.classList.add("c--resize"),s.style.left=`${c}px`,s.style.display="block";const f=o.width||o.renderWidth;let p=f;return document.onmousemove=function(e){if("number"!=typeof f)return;const t=e.clientX-u,l=f+t;l<(o.minWidth||pi.defaultColumnWidth)||(p=Math.floor(l),s.style.left=`${t+c}px`)},document.onmouseup=function(){n.$table.classList.remove("c--resize"),s.style.display="none",this.onmousemove=null,this.onmouseup=null,"number"==typeof p&&(va(a,o.dataIndex).width=p,i([...a]))},!1}})},fu=e=>{const{selectionKeys:t}=e,{tableRef:l,getRowKey:n,fetchParams:a,createTableList:r,setSelectionKeysEffect:i,setInvalidRowKeys:o,setSpinning:d,isFetch:u,isWebPagination:c}=q.default.useContext(Xr),{rowSelection:f}=l.current.props,{fetchAllRowKeys:p,selectAllOnCurrentPage:h,filterable:v,onSelectAll:y}=f,{t:b}=Xe(),x=q.default.useRef([]),E=q.default.useMemo((()=>u&&!!p),[u,p]),C=q.default.useMemo((()=>!E&&!!h),[E,h]),w=q.default.useMemo((()=>(null==v||v)&&!C),[v,C]),S=()=>{const{selectionRows:e}=l.current,{disabled:t}=f;return(t?e.filter((e=>!t(e))):e).map((e=>n(e,e.index)))},N=(()=>{const{recordsMap:e,allRowKeys:t}=l.current,{disabled:a}=f;if(E)return x.current.length?x.current:m.union(t,S());if(!C)return a?t.filter((t=>!a(e.get(t)))):t;const i=a?r().filter((e=>!a(e))).map((e=>n(e,e.index))):r().map((e=>n(e,e.index)));return m.union(i,S())})(),T=t.filter((e=>!N.includes(e))),I=t.length-T.length,O=I>0&&I<N.length,R=!!I&&I===N.length;o(T);const k=()=>Ye(void 0,void 0,void 0,(function*(){var e;const t=p;let l=[];d(!0);try{const i=yield t.api(a);if(200===i.code){l=Array.isArray(i.data)?i.data:null!==(e=m.get(i.data,t.dataKey))&&void 0!==e?e:[];const{disabled:a}=f;a&&(l=m.xor(l,r().filter((e=>a(e))).map((e=>n(e,e.index))))),x.current=l}}catch(e){}return d(!1),l})),L=e=>Ye(void 0,void 0,void 0,(function*(){let t=[];t=E?e?yield k():[]:e?N.slice(0):[],t=[...new Set([...t,...T])],i(t),null==y||y(e,t)})),P=()=>{const e=[{key:1,label:b("qm.table.selection.all"),onClick:()=>{L(!0)}},{key:2,label:b("qm.table.selection.invert"),onClick:()=>Ye(void 0,void 0,void 0,(function*(){let e=[];e=E?m.xor(t,yield k()):m.xor(t,N),e=[...new Set([...e,...T])],i(e)}))},{key:3,label:b("qm.table.selection.clear"),onClick:()=>{L(!1)}}];return q.default.createElement(s.Menu,{items:e})};return q.default.createElement("div",{className:"cell--selection"},q.default.createElement(s.Checkbox,{checked:R,indeterminate:O,disabled:!N.length,onChange:e=>L(e.target.checked)}),w&&q.default.createElement(s.Dropdown,{overlayClassName:"all-selection__popper",dropdownRender:()=>P()},q.default.createElement(g.DownOutlined,{className:"svgicon icon"})),C&&q.default.createElement(s.Tooltip,{placement:"top",title:b("qm.table.selection.currentPage")},q.default.createElement(g.InfoCircleOutlined,{className:"info"})))},pu=e=>{const{style:t}=e,{tableRef:l,rowExpandedKeys:n,setRowExpandedKeys:a}=q.default.useContext(Xr),{expandable:r}=l.current.props,[i,o]=q.default.useState((null==r?void 0:r.defaultExpandAllRows)||!1);Ql((()=>{s(n)!==i&&o(!i)}),[n]);const s=e=>l.current.allParentRowKeys.every((t=>e.includes(t))),d={[`${yt("expand")}--icon`]:!0,expanded:i,collapsed:!i};return q.default.createElement("span",{className:J.default(d),title:"",onClick:e=>{e.stopPropagation(),o(!i),a(i?[]:[...l.current.allParentRowKeys])},style:t})},mu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-up",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),hu=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),gu=e=>{const{tableColumns:t}=e,{tableRef:l,prefixCls:n,layout:a,flattenColumns:r,sorter:i,filters:o,superFilters:d,selectionKeys:u,isFetch:c,isGroupSubtotal:f,treeExpandIndex:p,tableChange:h,setSorter:v,setElementStore:y,resetTableScroll:b,getStickyLeft:x,getStickyRight:E,createGroupData:C,createTableFullData:w}=q.default.useContext(Xr),{ellipsis:S,resizable:N,multipleSort:T,rowSelection:I,expandable:O}=l.current.props,[R,k]=pi.sortDirections,{tableOriginData:L}=l.current,{t:P}=Xe(),A=q.default.useRef(null),D=q.default.useMemo((()=>L.some((e=>Array.isArray(e.children)))),[L]),_=q.default.useMemo((()=>!c),[c]),F=q.default.useMemo((()=>!c),[c]),H=q.default.useMemo((()=>!(null==O?void 0:O.hideExpandAll)),[O]),M=q.default.useMemo((()=>!!I&&(c?!(!I.selectAllOnCurrentPage&&!I.fetchAllRowKeys):!I.hideSelectAll)),[c,I]);Ql((()=>{B(),h(),b()}),[i]),Ql((()=>{X(),h(),b()}),[o]),Ql((()=>{X(),h(),b()}),[d]),q.default.useEffect((()=>{!ot(i)&&rt((()=>B())),!ot(o)&&rt((()=>X()))}),[]),q.default.useLayoutEffect((()=>{$()}),[]);const $=()=>{y("$header",A.current)},j=(e,t,n)=>{var a,r,o;const{dataIndex:s,colSpan:d,rowSpan:u,fixed:c,align:f,theadAlign:p,theadClassName:m="",sorter:h,filter:g,required:v,headRender:y}=e;if(0===d)return null;const b=p||f,C=["header--column",{"col--ellipsis":null!==(a=e.ellipsis)&&void 0!==a?a:S,"col--center":"center"===b,"col--right":"right"===b,"column--required":!!v,"column-has-sorter":h,"column-has-filter":g,"column--sort":!!i[s],"cell-fix-left":"left"===c,"cell-fix-right":"right"===c,"cell-fix-left-last":"left"===c&&!(null===(r=n[t+(null!=d?d:1)])||void 0===r?void 0:r.fixed),"cell-fix-right-first":"right"===c&&!(null===(o=n[t-1])||void 0===o?void 0:o.fixed),[m]:!!m}],w={left:"left"===c?`${x(s)}px`:"",right:"right"===c?`${E(s,"thead")}px`:""},T=N&&![pi.expandableColumn,pi.selectionColumn].includes(s);return q.default.createElement("th",{key:s,className:J.default(C),colSpan:d,rowSpan:u,style:Object.assign({},w),onClick:t=>W(t,e)},q.default.createElement("div",{className:"cell--wrapper"},y?q.default.createElement("div",{className:"cell--text cell"},y(e,l.current.tableFullData)):q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"cell--text"},K(e)),g?z(e):null)),T&&q.default.createElement(cu,{column:e}))},K=e=>{const{dataIndex:t,type:n,sorter:a,title:r,description:o}=e;if(t===pi.selectionColumn&&"checkbox"===n){if("checkbox"===n)return q.default.createElement("div",{className:"cell"},M?q.default.createElement(fu,{selectionKeys:u}):P("qm.table.config.selectionText"));if("radio"===n)return q.default.createElement("div",{className:"cell"},r)}const d=[];return d.push(q.default.createElement("div",{key:0,className:"cell",title:qa(r)},l.current.isTreeTable&&t===p&&H?q.default.createElement(pu,null):null,t===pi.expandableColumn&&H?q.default.createElement(pu,null):r)),o&&d.push(q.default.createElement(s.Tooltip,{key:1,placement:"top",title:o},q.default.createElement(g.InfoCircleOutlined,{className:"tip"}))),a&&d.push(V(i[t])),d},V=e=>{const t=["svgicon cell--sorter__asc",{actived:e===R}],l=["svgicon cell--sorter__desc",{actived:e===k}];return q.default.createElement("div",{key:2,className:"cell--sorter",title:P("qm.table.sorter.text")},q.default.createElement("span",{className:J.default(t)},q.default.createElement(mu,null)),q.default.createElement("span",{className:J.default(l)},q.default.createElement(hu,null)))},z=e=>q.default.createElement(uu,{column:e,filters:o}),W=(e,t)=>{const{sorter:l,dataIndex:n}=t;if(l){const e=i[n],t=e?e===k?null:k:R;T?(delete i[n],v(Object.assign({},i,{[n]:t}))):v(Object.assign({},{[n]:t}))}},B=()=>{_&&U()},U=e=>{const t=m.pickBy(i,(e=>null!==e));Y(t),e||Object.keys(t).length||Y({index:R})},G=(e,t)=>Number.isNaN(e-t)?e.toString().localeCompare(t.toString()):e-t,Y=e=>{const{tableFullData:t}=l.current,n=((e,t)=>e.sort(((e,l)=>{for(const n in t){const a=r.find((e=>e.dataIndex===n)),i=t[n],o=ka(e,n),s=ka(l,n),d="function"!=typeof(null==a?void 0:a.sorter)?G(o,s):a.sorter(e,l);if(0!==d)return"ascend"===i?d:-d}return 0})).slice(0))(f?C(ja(t)):t,e);w(n)},X=()=>{F&&Q()},Q=()=>{const e=d.length?Ka(d):Ka(o),t=""!==e?f?C(fa(ja(L),e,D)):fa(L,e,D):L;w(t),U(!0)},Z=Sa(t),{tableBodyWidth:ee}=a;return q.default.createElement("div",{ref:A,className:`${n}--header-wrapper`},q.default.createElement("table",{className:`${n}--header`,cellSpacing:"0",cellPadding:"0",style:{width:ee?`${ee}px`:""}},q.default.createElement("colgroup",null,r.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("thead",null,(e=>e.map(((e,t)=>q.default.createElement("tr",{key:t,className:"header--row"},e.map(((t,l)=>j(t,l,e)))))))(Z))))},vu=q.default.createContext([]),yu=(e,t,l,n,a,r,i,o,s,d)=>{var u;const{clientX:c,clientY:f}=e,{top:p,height:m}=e.target.getBoundingClientRect(),h=(((null==a?void 0:a.x)||0)-c-12)/n,g=s.filter((e=>{var t,l;return null===(l=null===(t=o[e])||void 0===t?void 0:t.children)||void 0===l?void 0:l.length}));let v=bu(o,l.eventKey);if(f<p+m/2){const e=i.findIndex((e=>e===v.key)),t=i[e<=0?0:e-1];v=bu(o,t)}const y=v.key,b=v,x=v.key;let E=0,C=0;if(!g.includes(y))for(let e=0;e<h&&Eu(v);e+=1)v=v.parent,C+=1;const w=t.data,S=v.node;let N=!0;return Cu(v)&&0===v.level&&f<p+m/2&&r({dragNode:w,dropNode:S,dropPosition:-1})&&v.key===l.eventKey?E=-1:(b.children||[]).length&&g.includes(x)?r({dragNode:w,dropNode:S,dropPosition:0})?E=0:N=!1:0===C?h>-1.5?r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:0})?E=d?1:0:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1:r({dragNode:w,dropNode:S,dropPosition:1})?E=1:N=!1,{dropPosition:E,dropLevelOffset:C,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:x,dropContainerKey:0===E?null:(null===(u=v.parent)||void 0===u?void 0:u.key)||null,dropAllowed:N}},bu=(e,t)=>e[t],xu=e=>e.split("-"),Eu=e=>{if(e.parent){const t=xu(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1},Cu=e=>{const t=xu(e.pos);return 0===Number(t[t.length-1])},wu=({openDragSort:e})=>{const{tableRef:t,getRowKey:l,rowExpandedKeys:n,setRowExpandedKeys:a,createTableFullData:r,dataChange:i}=q.default.useContext(Xr),{tableFullData:o,allRowKeys:s,isTreeTable:d}=t.current,u=nt,c=q.default.useRef(null),f=q.default.useRef(null),p=q.default.useRef(null),m=q.default.useRef(),[h,g]=q.default.useState({}),[v,y]=q.default.useState(null),[b,x]=q.default.useState([]),[E,C]=q.default.useState(0),[w,S]=q.default.useState({dropPosition:null,dropLevelOffset:null,dropContainerKey:null,dropTargetKey:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null}),N=e=>{S((t=>Object.assign({},t,e)))};q.default.useLayoutEffect((()=>{e&&g((e=>{const t={},n=(e,a=null,r=0)=>{const i=[];return e.forEach(((e,o)=>{const s=l(e,e.index),d={index:o,key:s,level:r,node:e,parent:a,pos:(u=(null==a?void 0:a.pos)||"0",c=o,`${u}-${c}`),nodes:[...(null==a?void 0:a.nodes)||[],e]};var u,c;Array.isArray(e.children)&&(d.children=n(e.children,d,r+1)),t[s]=d,i.push(d)})),i};return n(e),t})(o))}),[o]),q.default.useEffect((()=>()=>{window.removeEventListener("dragend",O)}),[]);const T=()=>{N({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})},I=()=>{null!==v&&(y(null),N({dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null})),f.current=null,p.current=null},O=e=>{R(),window.removeEventListener("dragend",O)},R=(e,t,l)=>{N({dragOverNodeKey:null}),I(),c.current=null,window.removeEventListener("dragend",O)},k=e=>{const t=e.node.eventKey,n=e.dragNode.eventKey,a=e.node.pos.split("-"),s=e.dropPosition-Number(a[a.length-1]),d=(e,t,n)=>{for(let a=0;a<e.length;a++){if(l(e[a],e[a].index)===t)return n(e[a],a,e);e[a].children&&d(e[a].children,t,n)}},u=[...o];let c;if(d(u,n,((e,t,l)=>{l.splice(t,1),c=e})),e.dropToGap){let e,l=[];d(u,t,((t,n,a)=>{l=a,e=n})),-1===s?l.splice(e,0,c):l.splice(e+1,0,c)}else d(u,t,(e=>{e.children=e.children||[],e.children.unshift(c)}));r(u),i()};return{onNodeDragStart:(e,t)=>{const{eventKey:l}=t;c.current=t,f.current={x:e.clientX,y:e.clientY};const r=((e,t)=>{if(!e)return[];const l=e.slice(),n=l.indexOf(t);return n>=0&&l.splice(n,1),l})(n,l);y(l),x(((e,t)=>{const l=[];return function e(t=[]){t.forEach((({key:t,children:n})=>{l.push(t),e(n)}))}(bu(t,e).children),l})(l,h)),C(2*pi.treeTable.textIndent),a(r),window.addEventListener("dragend",O)},onNodeDragEnter:(e,t)=>{const{eventKey:l}=t;if(p.current!==l&&(p.current=l),!c.current)return void T();const{dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:g,dropTargetPos:y,dropAllowed:x,dragOverNodeKey:C}=yu(e,c.current,t,E,f.current,u,s,h,n,!d);-1===b.indexOf(o)&&x?(m.current||(m.current={}),Object.keys(m.current).forEach((e=>{clearTimeout(m.current[e])})),c.current.eventKey!==l&&(e.persist(),m.current[l]=window.setTimeout((()=>{var e;if(null===v)return;let t=[...n];const r=bu(h,l);r&&(null===(e=r.children)||void 0===e?void 0:e.length)&&(t=((e,t)=>{const l=(e||[]).slice();return-1===l.indexOf(t)&&l.push(t),l})(n,l)),a(t)}),800)),c.current.eventKey!==o||0!==i?N({dragOverNodeKey:C,dropPosition:r,dropLevelOffset:i,dropTargetKey:o,dropContainerKey:g,dropTargetPos:y,dropAllowed:x}):T()):T()},onNodeDragOver:(e,t)=>{if(!c.current)return;const{dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropAllowed:o,dropTargetPos:p,dragOverNodeKey:m}=yu(e,c.current,t,E,f.current,u,s,h,n,!d);-1===b.indexOf(r)&&o&&(c.current.eventKey===r&&0===a?null===w.dropPosition&&null===w.dropLevelOffset&&null===w.dropTargetKey&&null===w.dropContainerKey&&null===w.dropTargetPos&&!1===w.dropAllowed&&null===w.dragOverNodeKey||T():l===w.dropPosition&&a===w.dropLevelOffset&&r===w.dropTargetKey&&i===w.dropContainerKey&&p===w.dropTargetPos&&o===w.dropAllowed&&m===w.dragOverNodeKey||N({dropPosition:l,dropLevelOffset:a,dropTargetKey:r,dropContainerKey:i,dropTargetPos:p,dropAllowed:o,dragOverNodeKey:m}))},onNodeDragLeave:(e,t)=>{p.current!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(T(),p.current=null)},onNodeDragEnd:R,onNodeDrop:(e,t,l=!1)=>{const{dropPosition:n,dropTargetKey:a,dropTargetPos:r,dropAllowed:i,dragOverNodeKey:o}=w;if(!i)return;if(N({dragOverNodeKey:null}),I(),null===a)return;const s=Object.assign(Object.assign({},((e,{dragOverNodeKey:t,dropPosition:l,keyEntities:n})=>{const a=bu(n,e);return{eventKey:e,pos:a?a.pos:"",dragOver:t===e&&0===l,dragOverGapTop:t===e&&-1===l,dragOverGapBottom:t===e&&1===l}})(a,{dropPosition:n,dragOverNodeKey:o,keyEntities:h})),{data:bu(h,a).node});-1!==b.indexOf(a)&&mt("Table Draggable","无法拖放到 `dragNode` 的子节点");const d=xu(r),u={event:e,node:s,dragNode:c.current,dragNodesKeys:[c.current.eventKey].concat(b),dropToGap:0!==n,dropPosition:n+Number(d[d.length-1])};l||k(u),c.current=null},indent:E,dropOptions:w}};function Su(){const[,e]=$.useReducer((e=>e+1),0);return e}const Nu=q.default.forwardRef(((e,t)=>{const{rowKey:l,rowIndex:n,row:a,className:r,style:i,indent:o,filter:s,dropOption:d,onNodeDragStart:u,onNodeDragEnter:c,onNodeDragOver:f,onNodeDragLeave:p,onNodeDragEnd:m,onNodeDrop:h}=e,g=q.default.useRef({eventKey:l,data:a,props:e}),v=q.default.useRef(!1),[y,b]=q.default.useState(!1),{dropPosition:x,dropLevelOffset:E,dragOverNodeKey:C,dropTargetKey:w,dropContainerKey:S}=d,N=C===l&&0===x,T=C===l&&-1===x,I=C===l&&1===x,O=a._level||0,R={};switch(x){case-1:Object.assign(R,{top:0,left:-E*o+O*o});break;case 1:Object.assign(R,{bottom:0,left:-E*o+O*o});break;case 0:Object.assign(R,{bottom:0,left:o+O*o})}const k={"body--row-draggable":!0,"body--row-dragging":y,"drop-target":w===l,"drop-container":S===l,"drag-over":N,"drag-over-gap-top":T,"drag-over-gap-bottom":I};return q.default.createElement("tr",{ref:t,"data-row-key":l,"data-row-index":n,className:J.default(r,k),style:i,draggable:!0,onMouseDown:e=>{var t;s&&(t=e.target.matches(s),v.current=t)},onDragStart:e=>{if(e.stopPropagation(),v.current)return e.preventDefault();b(!0),u(e,g.current);try{e.dataTransfer.setData("text/plain","")}catch(e){}},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),c(e,g.current)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),f(e,g.current)},onDragLeave:e=>{e.stopPropagation(),p(e,g.current)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),b(!1),h(e,g.current)},onDragEnd:e=>{e.stopPropagation(),b(!1),m(e,g.current)}},e.children,C===l&&null!==x&&null!==E&&q.default.createElement("td",{className:"drop-indicator",style:R}))}));Nu.displayName="DraggableTr";const Tu=e=>{const{selectionKeys:t,column:l,record:n,rowKey:a}=e,{tableRef:r}=q.default.useContext(Xr),{rowSelection:i}=r.current.props,o=q.default.useMemo((()=>l.type||""),[l.type]),d=e=>{var l,n;const a=null===(l=i.checkStrictly)||void 0===l||l;if(!r.current.isTreeTable||a)return!1;const o=Ea(r.current.deriveRowKeys,e);return((e,t)=>{const l=new Set(t);let n=!1,a=!1;for(const t of e)if(l.has(t)?n=!0:a=!0,n&&a)break;return n&&a})(Ua(null!==(n=null==o?void 0:o.children)&&void 0!==n?n:[]),t)};return"radio"===o?(()=>{const e=i.disabled,l=null==e?void 0:e(n),r=!l&&t[0]===a;return q.default.createElement(s.Radio,{checked:r,disabled:l})})():(()=>{const e=i.disabled,l=null==e?void 0:e(n),r=!!t.includes(a);return q.default.createElement(s.Checkbox,{checked:r,indeterminate:d(a),disabled:l})})()},Iu=e=>{const{record:t,rowKey:l,style:n}=e,{tableRef:a,rowExpandedKeys:r,setRowExpandedKeys:i}=q.default.useContext(Xr),{expandable:o={}}=a.current.props,[s]=q.default.useState("function"==typeof o.rowExpandable&&!o.rowExpandable(t)),d=q.default.useMemo((()=>r.includes(l)),[r,l]);Ql((()=>{var e;null===(e=o.onExpand)||void 0===e||e.call(o,d,t)}),[d]);const u={[`${yt("expand")}--icon`]:!0,expanded:d,collapsed:!d,disabled:s};return q.default.createElement("span",{className:J.default(u),title:"",onClick:e=>{if(e.stopPropagation(),s)return;const t=d?r.filter((e=>e!==l)):[...r,l];i(t)},style:n})},Ou=q.default.forwardRef(((e,t)=>{const{size:l,defaultValue:n,value:a,min:r,max:i,prefix:o,suffix:d,placeholder:u,maxLength:c,precision:f,stringMode:p,allowClear:m,readOnly:h,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)>i&&(t=i.toString()),t&&Number(t)<r&&(t=r.toString()),f>=0&&""!==t&&(t=new ue.default(t).toFixed(f)),t},E=void 0!==a,[C,w]=q.default.useState(null!=n?n:""),S=v(E?a:C),N=y(S);Ql((()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,N)}),[C]);return q.default.createElement(s.Input,{ref:t,size:l,value:S,maxLength:c,prefix:o,suffix:d,placeholder:u,allowClear:m,readOnly:h,disabled:g,onChange:t=>{const l=y(t.target.value.replace(/\s+/g,""));let n=/^-?\d*(\.\d*)?$/.test(l)||""===l||"-"===l;if(0===f&&l.includes(".")&&(n=!1),r>=0&&l.startsWith("-")&&(n=!1),n){if(!p&&(Number(l)>Number.MAX_SAFE_INTEGER||Number(l)<Number.MIN_SAFE_INTEGER))return;(t=>{var l;E?null===(l=e.onChange)||void 0===l||l.call(e,t):w(t)})(l)}},onFocus:b,onBlur:()=>{var t;const l=x(N);null===(t=e.onBlur)||void 0===t||t.call(e,l,N)},onKeyUp:t=>{var l;13===t.keyCode&&(null===(l=e.onEnter)||void 0===l||l.call(e,x(N),N))}})}));Ou.displayName="InputNumber";const Ru=e=>{var t,l,n;const{multiple:a,tree:r={},defaultSelectedKeys:i,className:o,style:s,onClose:d}=e,{$size:u}=Ze(e),{t:c}=Xe(),[f,p]=q.default.useState(),[m]=q.default.useState(null===(t=r.fetch)||void 0===t?void 0:t.params),h={[`${yt("tree-helper")}--wrapper`]:!0},g=r.fetch?Object.assign(Object.assign({},dt(r.fetch,["params","valueKey","textKey"])),{params:m}):void 0;return q.default.createElement("div",{className:J.default(h,o),style:s},q.default.createElement(su,{multiple:a,fetch:g,fieldsDefine:{valueKey:null===(l=r.fetch)||void 0===l?void 0:l.valueKey,textKey:null===(n=r.fetch)||void 0===n?void 0:n.textKey},autoFocus:!0,asyncLoad:r.asyncLoad,checkStrictly:r.checkStrictly,checkStrategy:r.checkStrategy,defaultSelectedKeys:i,defaultExpandAll:r.defaultExpandAll,onSelectChange:e=>p(e),onCheckChange:e=>p(e)}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[u]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>d(null),style:{marginRight:8}},c("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!f,onClick:()=>d(f)},c("qm.dialog.confirm"))))};Ru.displayName="TreeHelper";const{Search:ku}=s.Input,Lu=q.default.forwardRef(((e,t)=>{var l,n,a,r,i,o;const{column:d,record:u,rowKey:c,columnKey:f}=e,{tableRef:p,tableBodyRef:h,$size:v,flattenColumns:y,updateTableFlatData:b,doFieldValidate:x,dataChange:E}=q.default.useContext(Xr),C=q.default.useContext(vu),{t:w}=Xe(),S=Su(),{store:N,fieldAuth:T}=p.current,I=(null===(l=d.editRender)||void 0===l?void 0:l.call(d,u,d))||{},O=q.default.useRef(null),R=q.default.useRef(null),k=q.default.useRef(null),L=q.default.useRef(null),P=q.default.useRef(null),A=q.default.useRef(!1),D=q.default.useRef({}),_=q.default.useRef({}),F=q.default.useRef([]),[H,M]=q.default.useState(!1),[$,j]=q.default.useState(!1),[K,V]=q.default.useState(I.items||[]),[z,W]=q.default.useState(),B=(I.editable||m.isEqual(C,[c,f]))&&!I.disabled&&!(null===(n=T[f])||void 0===n?void 0:n.disabled),U=`${c}|${f}`,G=2===C.length?`${C[0]}|${C[1]}`:"",Y=![...N.state.required,...N.state.validate].some((({x:e,y:t})=>e===c&&t===f)),X=(null===(a=N.state.required.find((({x:e,y:t})=>e===c&&t===f)))||void 0===a?void 0:a.text)||"",Q=(null===(r=N.state.validate.find((({x:e,y:t})=>e===c&&t===f)))||void 0===r?void 0:r.text)||"",Z=N.state.edited.some((({x:e,y:t})=>e===c&&t===f)),ee=B||!Y||H||$,te=!!(null===(i=I.helper)||void 0===i?void 0:i.combinedDataIndex)&&("search-helper"===I.type||"tree-helper"===I.type),le=null===(o=I.type)||void 0===o?void 0:o.endsWith("multiple");q.default.useLayoutEffect((()=>{ee&&G===U&&re()}),[C]),q.default.useLayoutEffect((()=>{const{items:e}=I;le&&e&&ae(e.map((e=>({[_.current.valueKey]:e.value,[_.current.textKey]:e.text}))))}),[]);const ne=()=>{b(),E()},ae=e=>{F.current=e},re=()=>{var e,t,l,n;const{type:a}=I;switch(a){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===(l=L.current)||void 0===l||l.focus();break;case"tree-helper":null===(n=P.current)||void 0===n||n.focus()}},ie=()=>{var e,t,l,n;const{type:a}=I;switch(a){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===(l=L.current)||void 0===l||l.blur();break;case"tree-helper":null===(n=P.current)||void 0===n||n.blur()}};q.default.useImperativeHandle(t,(()=>({focus:re,blur:ie,isEditable:()=>!I.disabled,isOpening:()=>H})));const oe=(e,t,l)=>{const{cornerSign:n=!0}=I.extra||{};N.addToUpdated(e),n&&N.addToEdited({x:t,y:l})},se=e=>e?(e=>/^[+-]?\d+(\.\d+)?[eE][+-]?\d+$/.test(e.toString()))(Number(e))?e:Number(e):"",de={text:(e,t,l)=>{var n;const{dataIndex:a}=t,{type:r,extra:i={},rules:o=[],onInput:d,onChange:u,onEnter:p,onBlur:m}=I,h=ka(e,a),g=Object.assign({},{minRows:1,maxRows:4},i.autoSize),y=l?{rows:g.minRows,autoSize:g}:null,b=i.password?s.Input.Password:l?s.Input.TextArea:s.Input;return q.default.createElement(b,je({ref:R,size:v,value:h,maxLength:i.maxLength,showCount:i.showCount},y,{autoComplete:i.password?"new-password":"off",placeholder:null!==(n=i.placeholder)&&void 0!==n?n:w("qm.table.editable.inputPlaceholder"),allowClear:i.allowClear,readOnly:i.readOnly,disabled:i.disabled,suffix:i.suffix,onChange:l=>{var n;const r=null!==(n=l.target.value)&&void 0!==n?n:"";La(e,a,r),x(o,r,c,f,qa(t.title)),S(),null==d||d({[U]:r}),A.current=!0},onBlur:t=>{var l;const n=null!==(l=t.target.value)&&void 0!==l?l:"";A.current&&(A.current=!1,oe(e,c,f),null==u||u({[U]:n},e),null==m||m({[U]:n},e),ne())},onKeyUp:t=>{var l;if(13===t.keyCode&&!t.shiftKey){const n=null!==(l=t.target.value)&&void 0!==l?l:"";null==p||p({[U]:n},e)}},onKeyDown:e=>{l&&13===e.keyCode&&!e.shiftKey&&p&&e.preventDefault()}}))},textarea:(e,t)=>de.text(e,t,!0),number:(e,t)=>{var l,n;const{dataIndex:a,precision:r,formatType:i}=t,{type:o,extra:s={},rules:d=[],onInput:u,onChange:p,onEnter:m,onBlur:h}=I,g=ka(e,a);let y,b;return"finance"===i&&(y=e=>{const t=e.toString().split(".");return`${t[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}${void 0!==t[1]?`.${t[1]}`:""}`},b=e=>e.replace(/\$\s?|(,*)/g,"")),"percent"===i&&(y=e=>"."===(e+="").charAt(e.length-1)||"-"===e||""===e?e:`${new ue.default(e).times(100).toNumber()}`,b=e=>"."===e.charAt(e.length-1)||"-"===e||""===e?e:new ue.default(e).times(.01).toString()),q.default.createElement(Ou,{ref:k,size:v,value:g,min:s.min,max:s.max,precision:r,stringMode:s.stringMode,prefix:s.prefix,suffix:null!==(l=s.suffix)&&void 0!==l?l:"percent"===i?"%":void 0,placeholder:null!==(n=s.placeholder)&&void 0!==n?n:w("qm.table.editable.inputPlaceholder"),maxLength:s.maxLength,allowClear:s.allowClear,readOnly:s.readOnly,disabled:s.disabled,formatter:y,parser:b,onChange:l=>{La(e,a,l),x(d,l,c,f,qa(t.title)),S(),null==u||u({[U]:l}),A.current=!0},onBlur:(t,l)=>{if(!A.current)return;A.current=!1;let n=s.stringMode?t:se(t);"percent"===i&&"."===l.charAt(l.length-1)&&(n=Number(t)/100),La(e,a,n),oe(e,c,f),null==p||p({[U]:n},e),null==h||h({[U]:n},e),ne()},onEnter:(t,l)=>{let n=s.stringMode?t:se(t);"percent"===i&&"."===l.charAt(l.length-1)&&(n=Number(t)/100),null==m||m({[U]:n},e)}})},select:(e,t,l)=>{var n,a;const{dataIndex:r,dictItems:i=[]}=t,{type:o,extra:d={},rules:u=[],items:p,onChange:m,onEnter:h}=I,g=p||i,y=ka(e,r);let b=y;return q.default.createElement(s.Select,{mode:l?"multiple":void 0,size:v,popupClassName:pi.popupClassName,value:y||void 0,placeholder:null!==(n=d.placeholder)&&void 0!==n?n:w("qm.table.editable.selectPlaceholder"),allowClear:d.allowClear,listHeight:d.listHeight,maxTagCount:d.collapseTags?"responsive":void 0,maxTagTextLength:d.maxTagTextLength,disabled:d.disabled,style:{width:"100%"},showSearch:null===(a=d.filterable)||void 0===a||a,filterOption:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"";return`${n}|${Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`.toLowerCase().indexOf(e.toLowerCase())>=0},onDropdownVisibleChange:e=>M(e),onChange:l=>{La(e,r,l),x(u,l,c,f,qa(t.title)),oe(e,c,f),null==m||m({[U]:l},e),ne()},onSelect:e=>{b=e},onInputKeyDown:t=>{13===t.keyCode&&rt((()=>null==h?void 0:h({[U]:b},e)))}},g.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value,disabled:e.disabled},e.text))))},"select-multiple":(e,t)=>de.select(e,t,!0),date:(e,t,l)=>{var n;const{dataIndex:a}=t,{type:r,extra:i={},rules:o=[],onChange:s}=I,d=l||"exactdate",u=ka(e,a);return q.default.createElement(qe,{size:v,popupClassName:pi.popupClassName,value:null!==(n=Fa(u,rr[d]))&&void 0!==n?n:void 0,picker:ar[d],format:i.format,showTime:"datetime"===d,disabledDate:e=>(e=>{const{minDateTime:t,maxDateTime:l}=i;return t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day")})(e),placeholder:i.placeholder,allowClear:i.allowClear,disabled:i.disabled,style:{width:"100%"},onChange:l=>{const n=Ha(l,rr[d]);La(e,a,n),x(o,n,c,f,qa(t.title)),oe(e,c,f),null==s||s({[U]:n},e),ne()}})},datetime:(e,t)=>de.date(e,t,"datetime"),month:(e,t)=>de.date(e,t,"month"),year:(e,t)=>de.date(e,t,"year"),time:(e,t)=>{var l;const{dataIndex:n}=t,{type:a,extra:r={},rules:i=[],onChange:o}=I,s="HH:mm:ss",d=ka(e,n);return q.default.createElement(Ke,{size:v,popupClassName:pi.popupClassName,value:null!==(l=Fa(d,s))&&void 0!==l?l:void 0,format:r.format||s,placeholder:r.placeholder,allowClear:r.allowClear,disabled:r.disabled,style:{width:"100%"},onChange:l=>{const a=Ha(l,s);La(e,n,a),x(i,a,c,f,qa(t.title)),oe(e,c,f),null==o||o({[U]:a},e),ne()}})},checkbox:(e,t)=>{const{dataIndex:l}=t,{type:n,extra:a={},rules:r=[],onChange:i}=I,{trueValue:o=ei,falseValue:d=ti,disabled:u}=a,p=ka(e,l);return q.default.createElement(s.Checkbox,{checked:p===o,disabled:u,onChange:n=>{const a=n.target.checked?o:d;La(e,l,a),x(r,a,c,f,qa(t.title)),oe(e,c,f),null==i||i({[U]:a},e),ne()}})},switch:(e,t)=>{const{dataIndex:l}=t,{type:n,extra:a={},rules:r=[],onChange:i}=I,{trueValue:o=ei,falseValue:d=ti,disabled:u}=a,p=ka(e,l);return q.default.createElement(s.Switch,{checked:p===o,disabled:u,onChange:n=>{const a=n?o:d;La(e,l,a),x(r,a,c,f,qa(t.title)),oe(e,c,f),null==i||i({[U]:a},e),ne()}})},"search-helper":(e,t)=>{var l,n;const{dataIndex:a,precision:r}=t,{type:i,extra:o={},rules:s=[],helper:d={},onInput:u,onChange:p,onEnter:h}=I,g=Pa(e,te?d.combinedDataIndex:a),b=d.fieldAliasMap;b||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof b?b():b||{};Object.keys(E).includes(a)||mt("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(d.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||mt("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[a].includes("|")&&mt("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=e=>{const{filterAliasMap:t}=d,l=""!==e?e:void 0,n=("function"==typeof t?t():t)||[],r={[a]:l};return(Array.isArray(n)?n:[n]).forEach((e=>{if(m.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](l):l;else r[e]=l})),r},S=e=>{const{autoQueryAssign:t=!0}=d;t&&(D.current=C(e)),M(!0)},N=(l,n)=>{const{beforeOpen:a}=d,r=(null!=a?a:nt)({[U]:g},e,t);(null==r?void 0:r.then)?r.then((()=>{S(l),null==n||n()})).catch((()=>{})):!1!==r&&(S(l),null==n||n())},T=e=>{const t={};for(const l in E){const n=E[l];l!==a&&(t[l]=Pa(e,n))}const l=E[a]?Pa(e,E[a]):"";R(l,t);const{closed:n}=d;M(!1),null==n||n(e)},O=()=>{const{onlySelect:e=!0}=d;A.current&&R(e?"":g),M(!1)},R=(l="",n)=>{var i;if(m.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const l=n[t],a=y.find((e=>e.dataIndex===t));if(a){La(e,t,l,a.precision);const n=null===(i=a.editRender)||void 0===i?void 0:i.call(a,e,a);n&&Array.isArray(n.rules)&&x(n.rules,l,c,t,qa(a.title))}else La(e,t,l)}te&&!l&&((e,t,l,n)=>{if(!t.includes("|"))return La(e,t,l,n);const a=l.split("|")||[];t.split("|").forEach(((t,l)=>{var n;t&&La(e,t,null===(n=a[l])||void 0===n?void 0:n.trim())}))})(e,d.combinedDataIndex,""),La(e,a,l,r),x(s,l,c,f,qa(t.title)),oe(e,c,f),null==p||p({[U]:l},e),ne(),D.current={},A.current=!1,W(void 0)},k={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=d.width)&&void 0!==l?l:"60%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{O()}},P=Object.assign(Object.assign({},d),{size:v,initialValue:Object.assign({},D.current,d.initialValue),onClose:e=>{e?T(e):O()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(ku,{ref:L,value:null!=z?z:g,placeholder:null!==(n=o.placeholder)&&void 0!==n?n:w("qm.table.editable.selectPlaceholder"),allowClear:o.allowClear,readOnly:o.readOnly,disabled:o.disabled,onBlur:e=>{var t;const{value:l}=e.target,{onlySelect:n=!0,table:r}=d;if(A.current&&!H)return l&&n&&(null===(t=null==r?void 0:r.fetch)||void 0===t?void 0:t.api)?(e=>{const{table:t,initialValue:l={}}=d,{beforeFetch:n=nt}=t.fetch;return new Promise(((a,r)=>Ye(void 0,void 0,void 0,(function*(){var i;const o=m.merge({},t.fetch.params,Object.assign(Object.assign({},l),C(e)),{currentPage:1,pageSize:500});if(!n(o))return r();j(!0);try{const e=yield t.fetch.api(o);if(200===e.code){const l=Array.isArray(e.data)?e.data:null!==(i=m.get(e.data,t.fetch.dataKey))&&void 0!==i?i:[];a(l)}else r()}catch(e){r(e)}finally{rt((()=>j(!1)))}}))))})(l).then((e=>((e=[],t)=>{const l=e.filter((e=>Pa(e,E[a]).toString().includes(t)));if(1===l.length)return T(l[0]);N(t)})(e,l))).catch((()=>R(""))):void R(l)},onChange:e=>{const{value:t}=e.target;null==u||u({[U]:t}),A.current=!0,W(t)},onKeyDown:e=>{var t;if(13===e.keyCode){const l=null!==(t=e.target.value)&&void 0!==t?t:"";!H&&N(l)}},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)}}),q.default.createElement(Qn,k,q.default.createElement(Vu,P)))},"search-helper-multiple":(e,t)=>{var l,n;const{dataIndex:a}=t,{type:r,items:i=[],extra:o={},rules:d=[],helper:u={},onInput:p,onChange:h,onEnter:y}=I,b=ka(e,a),E=u.fieldAliasMap;E||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes("valueKey")&&Object.keys(C).includes("textKey")||mt("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),_.current=C;const S=l=>{const{beforeOpen:n}=u,a=(null!=n?n:nt)({[U]:b},e,t);(null==a?void 0:a.then)?a.then((()=>{M(!0),null==l||l()})).catch((()=>{})):!1!==a&&(M(!0),null==l||l())},N=()=>{M(!1)},T=l=>{La(e,a,l),x(d,l,c,f,qa(t.title)),oe(e,c,f),null==h||h({[U]:l},e,F.current),ne()},O={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=u.width)&&void 0!==l?l:"60%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{N()}},R=Object.assign(Object.assign({},u),{size:v,multiple:!0,initialValue:m.merge({},u.initialValue),defaultSelectedKeys:b,onClose:(e,t)=>{e?((e,t)=>{const{textKey:l,valueKey:n}=C;ae(m.uniqBy([...F.current.filter((e=>t.includes(e[n]))),...e],n));const a=F.current.map((e=>({text:e[l],value:e[n]}))),r=m.uniqBy([...a,...i],"value").filter((e=>t.includes(e.value)));V(r),T(r.map((e=>e.value)));const{closed:o}=u;M(!1),null==o||o(F.current)})(e,t):N()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(s.Select,{mode:"multiple",open:!1,value:b,placeholder:null!==(n=o.placeholder)&&void 0!==n?n: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&&!H&&S()},onDoubleClick:()=>{o.disabled||S()},onChange:e=>{const{valueKey:t}=C;ae(F.current.filter((l=>e.includes(l[t])))),T(e)}},K.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:o.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{S()}})))),q.default.createElement(Qn,O,q.default.createElement(Vu,R)))},"tree-helper":(e,t)=>{var l,n,a;const{dataIndex:r,precision:i}=t,{type:o,extra:s={},rules:d=[],helper:u={},onChange:p,onEnter:h}=I,g=Pa(e,te?u.combinedDataIndex:r),b=u.fieldAliasMap;b||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const E="function"==typeof b?b():b||{};Object.keys(E).includes(r)||mt("Table","fieldAliasMap 选项必须包含自身 `dataIndex` 值"),te&&(u.combinedDataIndex.split("|").every((e=>Object.keys(E).includes(e)))||mt("Table","所有出现在 `combinedDataIndex` 里的数据字段,在 `fieldAliasMap` 中必须做对应的映射配置"),E[r].includes("|")&&mt("Table","配置了 `combinedDataIndex` 参数后,在 `fieldAliasMap` 中自身 `dataIndex` 值不能再使用分隔符"));const C=l=>{const{beforeOpen:n}=u,a=(null!=n?n:nt)({[U]:g},e,t);(null==a?void 0:a.then)?a.then((()=>{M(!0),null==l||l()})).catch((()=>{})):!1!==a&&(M(!0),null==l||l())},S=()=>{M(!1)},N=(l="",n)=>{var a;if(m.isPlainObject(n)&&Object.keys(n).length)for(const t in n){const l=n[t],r=y.find((e=>e.dataIndex===t));if(r){La(e,t,l,r.precision);const n=null===(a=r.editRender)||void 0===a?void 0:a.call(r,e,r);n&&Array.isArray(n.rules)&&x(n.rules,l,c,t,qa(r.title))}else La(e,t,l)}La(e,r,l,i),x(d,l,c,f,qa(t.title)),oe(e,c,f),null==p||p({[U]:l},e),ne()},T={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=u.width)&&void 0!==l?l:"40%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{S()}},O=Object.assign(Object.assign({},u),{defaultSelectedKeys:[g],size:v,onClose:e=>{e?(e=>{const t={};for(const l in E){const n=E[l];l!==r&&(t[l]=Pa(e,n))}const l=E[r]?Pa(e,E[r]):"";N(l,t);const{closed:n}=u;M(!1),null==n||n(e)})(e):S()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement(ku,{ref:P,value:g,allowClear:null===(n=s.allowClear)||void 0===n||n,readOnly:s.readOnly,disabled:s.disabled,placeholder:null!==(a=s.placeholder)&&void 0!==a?a:w("qm.table.editable.selectPlaceholder"),onChange:e=>{const{value:t}=e.target},onKeyDown:e=>{13===e.keyCode&&(e.target.value,!H&&C())},onDoubleClick:()=>{C()},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?C():N(""))}}),q.default.createElement(Qn,T,q.default.createElement(Ru,O)))},"tree-helper-multiple":(e,t)=>{var l,n;const{dataIndex:a}=t,{type:r,extra:i={},items:o=[],rules:d=[],helper:u={},onInput:p,onChange:h,onEnter:y}=I,b=ka(e,a),E=u.fieldAliasMap;E||mt("Table","helper 需要配置 `fieldAliasMap` 选项");const C="function"==typeof E?E():E||{};Object.keys(C).includes("valueKey")&&Object.keys(C).includes("textKey")||mt("Table","fieldAliasMap 选项必须包含自身 `valueKey` 和 `textKey`"),_.current=C;const S=l=>{const{beforeOpen:n}=u,a=(null!=n?n:nt)({[U]:b},e,t);(null==a?void 0:a.then)?a.then((()=>{M(!0),null==l||l()})).catch((()=>{})):!1!==a&&(M(!0),null==l||l())},N=()=>{M(!1)},T=l=>{La(e,a,l),x(d,l,c,f,qa(t.title)),oe(e,c,f),null==h||h({[U]:l},e,F.current),ne()},O={visible:H,title:w("qm.searchHelper.text"),width:null!==(l=u.width)&&void 0!==l?l:"40%",loading:!1,wrapClassName:pi.popupClassName,bodyStyle:{paddingBottom:`${Yr[v]+20}px`},onClose:()=>{N()}},R=Object.assign(Object.assign({},u),{size:v,multiple:!0,initialValue:m.merge({},u.initialValue),defaultSelectedKeys:b,onClose:e=>{e?(e=>{const{textKey:t,valueKey:l}=C;ae(e);const n=F.current.map((e=>({text:e[t],value:e[l]})));V(n),T(n.map((e=>e.value)));const{closed:a}=u;M(!1),null==a||a(F.current)})(e):N()}});return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{className:"ant-input-wrapper ant-input-group"},q.default.createElement(s.Select,{mode:"multiple",open:!1,value:b,placeholder:null!==(n=i.placeholder)&&void 0!==n?n:w("qm.table.editable.selectPlaceholder"),allowClear:i.allowClear,maxTagCount:i.collapseTags?"responsive":void 0,maxTagTextLength:i.maxTagTextLength,disabled:i.disabled,style:{width:"100%"},onKeyDown:e=>{13===e.keyCode&&!H&&S()},onDoubleClick:()=>{i.disabled||S()},onChange:e=>{const{valueKey:t}=C;ae(F.current.filter((l=>e.includes(l[t])))),T(e)}},K.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text)))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:i.disabled,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{S()}})))),q.default.createElement(Qn,O,q.default.createElement(Ru,R)))},custom:(e,t)=>{const{dataIndex:l}=t,{type:n,extra:a={},rules:r=[],render:i,onChange:o}=I;if(!i)return mt("Table","单元格编辑的自定义渲染,必须设置 `render` 参数"),null;const s=ka(e,l),d=n=>{La(e,l,n),x(r,n,c,f,qa(t.title)),oe(e,c,f),null==o||o({[U]:n},e),ne()},u=i(e,t,d);return q.default.isValidElement(u)?q.default.cloneElement(u,{value:s,disabled:a.disabled,readOnly:a.readOnly,popupClassName:pi.popupClassName,onChange:d}):null}};return q.default.createElement(q.default.Fragment,null,ee?(()=>{const{type:e}=I,t=de[e];if(!t)return mt("Table","单元格编辑的类型 `type` 配置不正确"),null;const l=["cell--edit",{"is-error":!Y}];return q.default.createElement("div",{ref:O,className:J.default(l)},t(u,d),!Y&&q.default.createElement("div",{className:"cell-error"},X||Q))})():(()=>{const{disabled:t,extra:l={}}=I,{disabledColor:n,disabledBgColor:a}=l,r=["cell--show",{"is-cell-bg":t&&a}];return q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:J.default(r),style:{color:t?n:""}},e.children),t&&a&&q.default.createElement("i",{className:"cell--bg",style:{background:a}}))})(),Z&&q.default.createElement("i",{className:"cell--sign"}))}));Lu.displayName="CellEdit";const Pu=e=>{const{text:t,options:l,showMessage:n=!0,onCopy:a}=e,{t:r}=Xe();return Sn(e.children,{onClick:i=>{const o=q.default.Children.only(e.children),d=ge.default(t,l);null==a||a(t,d),d&&n&&s.message.success(r("qm.clipboard.success")),o&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(i)}})};Pu.displayName="QmCopyToClipboard";const Au=q.default.forwardRef(((e,t)=>{const{column:l,row:n,rowIndex:a,columnIndex:r,rowKey:i,showTitle:o}=e,{tableRef:s,selectionKeys:d,treeExpandIndex:u,updateMark:c}=q.default.useContext(Xr),{dataIndex:f,canCopy:p,render:m,editRender:h,shouldCellUpdate:v}=l,{t:y}=Xe(),{renderText:b,getTitleFromCellNode:x}=Si(),E=q.default.useRef(null),C=ka(n,f),[w,S]=function(e,t,l){const n=$.useRef({});return"value"in n.current&&!l(n.current.condition,t)||(n.current.value=e(),n.current.condition=t),n.current.value}((()=>{const e=m?m(C,n,l,a,r):b(C,l,n);return[e,h?q.default.createElement(Lu,{ref:t,column:l,record:n,rowKey:i,columnKey:f},e):null]}),[c,n,C,m,h],((e,t)=>{if(v){const[,l]=e,[,a]=t;return v(a,l,n)}return!Xa(e,t,!0)}));q.default.useEffect((()=>{if([pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(f))return;const e=E.current.parentNode;o?e.title=x(w):e.removeAttribute("title")}),[o,w]);const N=e=>Array.isArray(e.children);return q.default.createElement("div",{ref:E,className:"cell"},(()=>{if(f===pi.expandableColumn)return q.default.createElement(Iu,{record:n,rowKey:i});if(f===pi.selectionColumn)return q.default.createElement(Tu,{selectionKeys:d,column:l,record:n,rowKey:i});if(S)return S;if(s.current.isTreeTable&&f===u)return q.default.createElement(q.default.Fragment,null,(e=n._level)?q.default.createElement("span",{key:e,className:`cell--indent indent-level-${e}`,style:{paddingLeft:e*pi.treeTable.textIndent+"px"}}):null,q.default.createElement(Iu,{key:"expand",record:n,rowKey:i,style:N(n)?{}:{visibility:"hidden"}}),w);var e;if(p){const e=x(w);return q.default.createElement("div",{className:"cell--copy"},q.default.createElement("span",{className:"text"},w),e&&q.default.createElement(Pu,{text:e},q.default.createElement(g.CopyOutlined,{className:"icon",title:y("qm.table.config.copyText"),onClick:e=>e.stopPropagation()})))}return w})())}));Au.displayName="Cell";const Du={open:!1,offsetX:0,offsetY:0},_u=q.default.forwardRef(((e,t)=>{const{rowVirtualize:l}=e,{tableRef:n,getRowKey:a,prefixCls:r,tableFlatData:i,flattenColumns:o,mergedTdCells:s,setMergedCells:d}=q.default.useContext(Xr),{areaSelection:u={}}=n.current.props,{elementStore:c,scrollYLoad:f}=n.current,{t:p}=Xe(),m=q.default.useRef(document.onselectstart),h=q.default.useRef(null),g=q.default.useRef(null),v=q.default.useRef(null),y=e=>{v.current=e},[b,x]=q.default.useState(null),[E,C]=q.default.useState(null),[w,S]=q.default.useState(null),N=e=>{if(!e)return S(null);let t=!1;for(const l in e)if((null==w?void 0:w[l])!==e[l]){t=!0;break}t&&S(Object.assign({},w,e))};Ad({ref:h,handler:()=>K()}),q.default.useEffect((()=>{const e=ae.default(c.$tableBody,"mousedown",_),t=ae.default(c.$tableBody,"contextmenu",A),l=ae.default(document,"keydown",D);return()=>{e.remove(),t.remove(),l.remove()}}),[]);const T=()=>{x(null),N(null),y(null),C(null)};q.default.useImperativeHandle(t,(()=>({blur:T})));const I=e=>{let t=e;for(;t;){if(!c.$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}),R=e=>({colStart:e.colIndex,colEnd:e.colIndex+e.colspan,rowStart:e.rowIndex,rowEnd:e.rowIndex+e.rowspan}),k=e=>{let[t,l,n,a]=[1/0,-1/0,1/0,-1/0];for(const r of e)t=Math.min(t,r.rowStart),l=Math.max(l,r.rowEnd),n=Math.min(n,r.colStart),a=Math.max(a,r.colEnd);return{rowStart:t,rowEnd:l,colStart:n,colEnd:a}},L=wn((e=>{let t=k([R(e),v.current]);s.forEach((e=>{const l=i.findIndex((t=>a(t,t.index)===e.rowKey)),n=o.findIndex((t=>t.dataIndex===e.dataIndex)),r={rowStart:l,rowEnd:l+e.rowSpan,colStart:n,colEnd:n+e.colSpan};var s,d;d=r,(s=t).rowEnd<=d.rowStart||s.rowStart>=d.rowEnd||s.colEnd<=d.colStart||s.colStart>=d.colEnd||(t=k([t,r]))})),N(t)}),5),P=e=>{var t;d(e),null===(t=u.onCellMerge)||void 0===t||t.call(u,e),rt((()=>T()))},A=Qe((e=>{u.cellMerge&&b&&$(e.clientX,e.clientY)?(e.preventDefault(),j(e)):(null==E?void 0:E.open)&&K()})),D=Qe((e=>{27===e.keyCode&&T()})),_=Qe((e=>{e.stopPropagation();const t=I(e.target);if(1!==e.buttons||!t)return;K();const l=O(t);x(l);const n=R(l);y(n),N(n),document.addEventListener("mousemove",F),document.addEventListener("mouseup",H),m.current=document.onselectstart,document.onselectstart=()=>!1})),F=Qe((e=>{const t=I(e.target);t&&L(O(t))})),H=Qe((()=>{var e;null===(e=u.onSelectChange)||void 0===e||e.call(u,(()=>{const e=[];if(!b||!w)return e;for(let t=w.rowStart;t<w.rowEnd;t++)for(let l=w.colStart;l<w.colEnd;l++)e.push({rowKey:a(i[t],i[t].index),dataIndex:o[l].dataIndex,cellValue:ka(i[t],o[l].dataIndex)});return e})()),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",H),M()})),M=()=>{document.onselectstart!==m.current&&(document.onselectstart=m.current)},$=(e,t)=>{const{top:l,left:n}=c.$tableBody.parentNode.getBoundingClientRect(),[a,r]=[e-n,t-l],{el:i,et:o,ew:s,eh:d}=U();return!(a<i||a>i+s||r<o||r>o+d)},j=e=>{const{top:t,left:l,height:n}=g.current.getBoundingClientRect();C({open:!0,offsetX:e.clientX-l,offsetY:-1*(n-(e.clientY-t))})},K=()=>{C((e=>Object.assign(Object.assign({},e),{open:!1})))},V=e=>({rowIndex:i.findIndex((t=>a(t,t.index)===e.rowKey)),colIndex:o.findIndex((t=>t.dataIndex===e.dataIndex)),rowSpan:e.rowSpan,colSpan:e.colSpan}),z=()=>{if(!b||!w||(t=w,(e=b).rowIndex===t.rowStart&&e.colIndex===t.colStart&&e.rowspan===t.rowEnd-t.rowStart&&e.colspan===t.colEnd-t.colStart))return T();var e,t;const l={rowKey:a(i[w.rowStart],i[w.rowStart].index),dataIndex:o[w.colStart].dataIndex,rowSpan:w.rowEnd-w.rowStart,colSpan:w.colEnd-w.colStart};P([...s.filter((e=>!((e,t)=>{const l=V(e),n=V(t),[a,r,i,o]=[l.rowIndex,l.colIndex,l.rowIndex+l.rowSpan-1,l.colIndex+l.colSpan-1],[s,d,u,c]=[n.rowIndex,n.colIndex,n.rowIndex+n.rowSpan-1,n.colIndex+n.colSpan-1];return a<=s&&r<=d&&i>=u&&o>=c||s<=a&&d<=r&&u>=i&&c>=o})(e,l))),l])},W=()=>{const e=a(i[w.rowStart],i[w.rowStart].index),t=o[w.colStart].dataIndex;P(s.filter((l=>!(l.rowKey===e&&l.dataIndex===t))))},B=e=>{if(f){return l.measurementsCache.slice(0,e).map((e=>e.size)).reduce(((e,t)=>e+t),0)}if(e>=i.length)return c.$tableBody.parentNode.offsetHeight;const t=a(i[e],i[e].index),r=c.$tableBody.querySelector(`tbody > tr[data-row-key="${t}"]`);return r?r.offsetTop:n.current.rowHeight*e},U=()=>{const{w:e,h:t,l:l,t:n}=b,a=o.slice(0,w.colStart).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),r=B(w.rowStart);return{sl:l,st:n,sw:e,sh:t,el:a,et:r,ew:o.slice(0,w.colEnd).reduce(((e,t)=>e+(t.width||t.renderWidth)),0)-a,eh:B(w.rowEnd)-r}};return q.default.createElement("div",{className:`${r}--area-select`},(()=>{if(!b||!w)return null;const{sl:e,st:t,sw:l,sh:n,el:a,et:r,ew:i,eh:o}=U(),{open:s,offsetX:d,offsetY:u}=E||Du,c=q.default.createElement("ul",{ref:h,className:"ant-dropdown-menu"},q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:z},p("qm.table.areaSelect.mergeCell")),q.default.createElement("li",{className:"ant-dropdown-menu-item",onClick:W},p("qm.table.areaSelect.cancelMerge")));return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:"active-area",style:{left:e,top:t,width:l,height:n}}),q.default.createElement(gs,{popupVisible:s,popup:c,action:[],popupPlacement:"bottomLeft",prefixCls:"ant-dropdown",popupClassName:pi.popupClassName,builtinPlacements:{bottomLeft:{points:["tl","bl"],offset:[d+4,u+4],overflow:{adjustX:1,adjustY:1}}}},q.default.createElement("div",{ref:g,className:"checked-area",style:{left:a,top:r,width:i,height:o}})))})())}));_u.displayName="AreaSelect";const Fu=q.default.forwardRef(((e,t)=>{const{tableRef:l,getRowKey:n,prefixCls:a,tableFlatData:r,flattenColumns:i,editableColumns:o,leftFixedColumns:s,rightFixedColumns:d,derivedMergeCells:u,sorter:c,layout:f,showFooter:p,selectionKeys:h,rowExpandedKeys:g,highlightKey:v,activedCell:y,isPingLeft:b,isPingRight:x,isTableEmpty:E,isGroupSubtotal:C,setElementStore:w,setSelectionKeysEffect:S,setHighlightKey:N,setActivedCell:T,getStickyLeft:I,getStickyRight:O,setPingLeft:R,setPingRight:k,setFullScreen:L,scrollBottomDebouncer:P}=q.default.useContext(Xr),{height:A,minHeight:D,maxHeight:_,rowHeight:F,rowSelection:H,rowHighlight:M,expandable:$,stripe:j,summation:K,rowStyle:V,cellStyle:z,spanMethod:W,tableConfig:B,areaSelection:U,ellipsis:G,showHeader:Y,rowDraggable:X,onRowClick:Q,onRowDblclick:Z,onRowContextmenu:ee,onRowEnter:te}=l.current.props,le=q.default.useRef(null),ne=q.default.useRef({}),re=q.default.useRef(null),ie=q.default.useRef({prevST:0,prevSL:0}),{onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:de,onNodeDragLeave:ue,onNodeDragEnd:ce,onNodeDrop:fe,indent:pe,dropOptions:me}=wu({openDragSort:X}),{rowVirtualizer:he,columnVirtualizer:ge,virtualRows:ve,virtualColumns:ye,resetItemXSize:be,getYIndexes:xe,virtualTranslateY:Ee,virtualTranslateX:Ce,calcVirtualYSize:we,calcVirtualXSize:Se,scrollToYIndex:Ne}=((e,t)=>{var l;const{tableRef:n}=q.default.useContext(Xr),{props:a,scrollBarRef:r,rowHeight:i}=n.current,o=(null===(l=a.tableConfig)||void 0===l?void 0:l.overscan)||1,s=q.default.useMemo((()=>{var e,t;return null!==(t=null===(e=r.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null}),[r.current]),d=q.default.useMemo((()=>{const e=[],l=[];return t.forEach(((t,n)=>{"left"===t.fixed&&e.push(n),"right"===t.fixed&&l.push(n)})),[e,l]}),[t]),u=Rd({count:e.length,getScrollElement:()=>s,estimateSize:()=>i,indexAttribute:"data-row-index",overscan:o,enabled:n.current.scrollYLoad}),c=u.getVirtualItems(),f=Rd({horizontal:!0,count:t.length,getScrollElement:()=>s,estimateSize:e=>t[e].width||t[e].renderWidth||0,indexAttribute:"data-col-index",overscan:o,enabled:n.current.scrollXLoad,rangeExtractor:e=>[...new Set([...d[0],...bd(e),...d[1]])]}),p=f.getVirtualItems();return{rowVirtualizer:u,columnVirtualizer:f,virtualRows:c,virtualColumns:p,resetItemXSize:e=>{e.forEach(((e,t)=>{f.resizeItem(t,e.width||e.renderWidth||pi.defaultColumnWidth)}))},getYIndexes:()=>u.getVirtualIndexes()||[],getXIndexes:()=>f.getVirtualIndexes()||[],virtualTranslateY:()=>{var e,t;return null!==(t=null===(e=c[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},virtualTranslateX:()=>{var e,t,l,n,a,r,i;const o=d[0].length;return o?(null===(l=p[o])||void 0===l?void 0:l.index)===o?null!==(a=null===(n=p[0])||void 0===n?void 0:n.start)&&void 0!==a?a:0:(null!==(i=null===(r=p[o])||void 0===r?void 0:r.start)&&void 0!==i?i:0)-p.slice(0,o).reduce(((e,t)=>e+t.size),0):null!==(t=null===(e=p[0])||void 0===e?void 0:e.start)&&void 0!==t?t:0},calcVirtualYSize:()=>u.getTotalSize()||void 0,calcVirtualXSize:()=>f.getTotalSize()||void 0,scrollToYIndex:e=>{u.scrollToIndex(e)},scrollToXIndex:e=>{f.scrollToIndex(e)}}})(r,i),Te=xe(),Ie=e=>{if(e&&!G)return he.measureElement(e)},Oe=q.default.useMemo((()=>u.length&&l.current.scrollYLoad?((e,t)=>{const l=[],n=new Set(t);return e.forEach((({row:e,col:t,rowSpan:a,colSpan:r})=>{const i=e+a-1,o=[];for(let t=e;t<=i;t++)n.has(t)&&o.push(t);if(0===o.length)return;const s=o.length;o.forEach(((e,n)=>{0===n&&l.push({row:e,col:t,rowSpan:s,colSpan:r});for(let a=t;a<t+r;a++)0===n&&a===t||l.push({row:e,col:a,rowSpan:0,colSpan:0})}))})),l})(u,Te):u),[u,Te.join(",")]),[Re,ke]=q.default.useState([]),Le=Su();Ad({ref:le,omitClassNames:[`.${pi.popupClassName}`],handler:()=>{var e;ze([]),null===(e=re.current)||void 0===e||e.blur()}}),q.default.useImperativeHandle(t,(()=>({setClickedValues:ze,createFocus:Me,forceUpdate:Le,resetItemXSize:be,scrollToYIndex:Ne}))),Ql((()=>{Re.length&&l.current.tableManager.focus(l.current.uid)}),[Re]),q.default.useLayoutEffect((()=>{He();const e=ae.default(document,"keydown",De);return()=>e.remove()}),[]);const Pe=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:t,footerHeight:l,tableFullHeight:n,tableAutoHeight:a}=f,r={};return E&&Object.assign(r,{minHeight:"100px"}),D&&Object.assign(r,{minHeight:Oa(D)-e-l+"px"}),_&&Object.assign(r,{maxHeight:Oa(_)-e-l+"px"}),A||n||a?Object.assign(Object.assign({},r),{maxHeight:"",minHeight:"",height:`${t}px`}):r}),[A,_,D,E,f]),Ae=Qe((e=>{const{elementStore:t}=l.current,{prevST:n,prevSL:a}=ie.current,{scrollTop:r,scrollLeft:i}=e;if(i!==a){Y&&(t.$header.scrollLeft=i),p&&(t.$footer.scrollLeft=i);const e=i>0,l=Math.ceil(i)+f.tableWidth<f.tableBodyWidth;b!==e&&R(e),x!==l&&k(l)}r!==n&&Math.ceil(r)+f.viewportHeight>=le.current.parentNode.offsetHeight&&P({type:"scroll",target:e,preventDefault:lt,stopPropagation:lt}),ie.current={prevST:r,prevSL:i}})),De=Qe((e=>{var t,a,i,s,d,u,c;const{keyCode:f}=e;if(l.current.uid===(null===(t=l.current.tableManager.getFocusInstance())||void 0===t?void 0:t.id)&&(27===f&&(ze([]),N(""),T({}),L(!1)),Re.length&&(sn(document.activeElement,le.current)||"INPUT"!==(null===(a=document.activeElement)||void 0===a?void 0:a.tagName)))){if(13===f&&("radio"===(null==H?void 0:H.type)||M)){const t=null!==(s=null!==(i=h[0])&&void 0!==i?i:v)&&void 0!==s?s:null,l=null!==(d=r.find((e=>n(e,e.index)===t)))&&void 0!==d?d:null;l&&(null==te||te(l,e))}if(!je(Re[0],Re[1])){if(38===f||40===f){en(e);const t=r.length;let l=r.findIndex((e=>n(e,e.index)===Re[0]));const a=38===f?(--l+t)%t:++l%t,i=r[a],o=n(i,i.index),s=qe(o,Re[1]);"radio"!==(null==H?void 0:H.type)||(null===(u=H.disabled)||void 0===u?void 0:u.call(H,i))||s||S([o]),!M||(null===(c=M.disabled)||void 0===c?void 0:c.call(M,i))||s||N(o),_e(38===f?"top":"bottom",a),$e(...Re),ze([o,Re[1]])}if(9===f||e.shiftKey&&9===f){if(en(e),!o.length)return ze([]);const t=o.length;let l=o.findIndex((e=>e.dataIndex===Re[1]));const n=e.shiftKey&&9===f?(--l+t)%t:++l%t;$e(...Re),Fe(e.shiftKey&&9===f?"left":"right",n),ze([Re[0],o[n].dataIndex])}}}})),_e=(e,t)=>{const{scrollBarRef:n,scrollYLoad:a}=l.current;if(a)return he.scrollToIndex(t);const i=r.length,o=t,s=le.current.querySelectorAll("tbody > tr"),d=r.map(((e,t)=>t)).slice(0,o).reduce(((e,t)=>e+s[t].offsetHeight),0),u=s[o].offsetHeight;"top"===e?d<n.current.scrollTop?n.current.SET_SCROLL_TOP(d):t===i-1&&n.current.SET_SCROLL_TOP(d-(f.viewportHeight-u)):d+u>n.current.scrollTop+f.viewportHeight?n.current.SET_SCROLL_TOP(d-(f.viewportHeight-u)):0===t&&n.current.SET_SCROLL_TOP(d)},Fe=(e,t)=>{const{scrollBarRef:n}=l.current,a=o.length,r=i.findIndex((e=>e.dataIndex===o[t].dataIndex)),u=i.slice(0,r).reduce(((e,t)=>e+(t.width||t.renderWidth)),0),c=i[r].width||i[r].renderWidth,p=s.reduce(((e,t)=>e+(t.width||t.renderWidth)),0),m=d.reduce(((e,t)=>e+(t.width||t.renderWidth)),0);"left"===e?u<n.current.scrollLeft+p?n.current.SET_SCROLL_LEFT(u-p):t===a-1&&n.current.SET_SCROLL_LEFT(u-(f.tableWidth-c)+m):u+c>n.current.scrollLeft+(f.tableWidth-m)?n.current.SET_SCROLL_LEFT(u-(f.tableWidth-c)+m):0===t&&n.current.SET_SCROLL_LEFT(u-p)},He=()=>{w("$tableBody",le.current)},Me=(e,t)=>{var l;null===(l=ne.current[`${e}-${t}`])||void 0===l||l.focus()},$e=(e,t)=>{var l;null===(l=ne.current[`${e}-${t}`])||void 0===l||l.blur()},qe=(e,t)=>{var l,n;return null!==(n=null===(l=ne.current[`${e}-${t}`])||void 0===l?void 0:l.isEditable())&&void 0!==n&&n},je=(e,t)=>{var l,n;return null!==(n=null===(l=ne.current[`${e}-${t}`])||void 0===l?void 0:l.isOpening())&&void 0!==n&&n},Ke=e=>{const t=K.groupItems.findIndex((t=>t.dataIndex===e));return{[`body--row-group_${t+1}`]:t>=0}},Ve=(e,t,a)=>{var r;const{dataIndex:i}=a;if([pi.expandableColumn,pi.operationColumn].includes(i))return;const o=n(t,t.index);ze([o,i]);const s=qe(o,i),{type:d,selectByClickRow:u=!0,disabled:c=lt}=H||{};!d||c(t)||s||(u||i===pi.selectionColumn)&&((e,t)=>{const{type:n,checkStrictly:a=!0,onSelect:r}=H||{};if("radio"===n&&S([e]),"checkbox"===n){const n=!h.includes(e),i=l.current.isTreeTable&&!a?Be(e,h,n):We(e,h,n);S(i),null==r||r(n,t,i)}})(o,t),[pi.selectionColumn].includes(i)||(!M||(null===(r=M.disabled)||void 0===r?void 0:r.call(M,t))||s||N(o),null==Q||Q(t,a,e))},ze=e=>{m.isEqual(e,Re)||ke(e)},We=(e,t,l)=>l?[...t,e]:t.filter((t=>t!==e)),Be=(e,t,n)=>{var a;const{disabled:r}=H||{},{deriveRowKeys:i,recordsMap:o}=l.current,s=Ea(i,e);let d=[],u=Ua((null==s?void 0:s.children)||[]);r&&(u=u.filter((e=>!o.has(e)||!r(o.get(e))))),d=n?[...new Set([...t,e,...u])]:t.filter((t=>![e,...u].includes(t)));return((null===(a=Wa(i,e))||void 0===a?void 0:a.slice(0,-1).reverse())||[]).forEach((e=>{var t;const l=Ea(i,e),n=null===(t=null==l?void 0:l.children)||void 0===t?void 0:t.every((e=>d.includes(e.rowKey)));d=n?[...d,e]:d.filter((t=>t!==e))})),d},Ue=(e,t,n)=>{const{scrollXLoad:a}=l.current,{disabled:r}=H||{},o=["body--row",Object.assign({"body--row-striped":j&&t%2!=0,"body--row-selected":h.includes(n)&&!(null==r?void 0:r(e)),"body--row-current":v===n},C?Ke(e._group):null)],s=(a?ye:i).map(((l,r)=>Ge(a?i[l.index]:l,a?l.index:r,e,t,n)));return X?q.default.createElement(Nu,{key:n,ref:Ie,className:J.default(o),rowKey:n,rowIndex:t,row:e,indent:pe,filter:".cell--edit input",dropOption:me,onNodeDragStart:oe,onNodeDragEnter:se,onNodeDragOver:de,onNodeDragLeave:ue,onNodeDragEnd:ce,onNodeDrop:fe},s):q.default.createElement("tr",{key:n,ref:Ie,"data-row-key":n,"data-row-index":t,className:J.default(o)},s)},Ge=(e,t,l,n,a)=>{var r,i,o;const{dataIndex:u,fixed:f,align:p,className:m=""}=e,{rowSpan:h,colSpan:g}=Ye(l,e,n,t);if(!h||!g)return null;const v=null!==(r=e.ellipsis)&&void 0!==r?r:G,b=["body--column",{"col--ellipsis":v,"col--center":"center"===p,"col--right":"right"===p,"col-active":y.rowKey===a&&y.dataIndex===u,"column--sort":!!c[u],"cell-fix-left":"left"===f,"cell-fix-right":"right"===f,"cell-fix-left-last":"left"===f&&(null===(i=s[s.length-g])||void 0===i?void 0:i.dataIndex)===u,"cell-fix-right-first":"right"===f&&(null===(o=d[0])||void 0===o?void 0:o.dataIndex)===u,[m]:!!m}],x={left:"left"===f?`${I(u)}px`:"",right:"right"===f?`${O(u)}px`:""},E=V?"function"==typeof V?V(l,n):V:null,w=z?"function"==typeof z?z(l,e,n,t):z:null,S=C?(e=>{var t;const{backgroundColor:l,color:n}=null!==(t=K.groupItems.find((t=>t.dataIndex===e)))&&void 0!==t?t:{};return{backgroundColor:l,color:n}})(l._group):null,N=Object.assign({},x,{height:F},S,E,w);return q.default.createElement("td",{key:u,"data-col-index":t,rowSpan:h>1?h:void 0,colSpan:g>1?g:void 0,className:J.default(b),style:N,onClick:t=>Ve(t,l,e),onDoubleClick:t=>((e,t,l)=>{const{dataIndex:n}=l;[pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(n)||null==Z||Z(t,l,e)})(t,l,e),onContextMenu:t=>((e,t,l)=>{const{dataIndex:n}=l;[pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(n)||null==ee||ee(t,l,e)})(t,l,e)},q.default.createElement(Au,{ref:e=>ne.current[`${a}-${u}`]=e,row:l,column:e,rowIndex:n,columnIndex:t,rowKey:a,showTitle:v}))},Ye=(e,t,l,n)=>{var a;let i=1,o=1;const s=W;if("function"==typeof s){const d=s({row:e,column:t,rowIndex:l,columnIndex:n,tableData:r});Array.isArray(d)?(i=d[0],o=d[1]):m.isPlainObject(d)&&(i=d.rowSpan,o=d.colSpan);const u=null!==(a=Te[0])&&void 0!==a?a:0;if(e===r[u]&&0===i)for(let e=u;e<r.length;e++){const l=s({row:r[e],column:t,rowIndex:e,columnIndex:n,tableData:r});if((Array.isArray(l)?l[0]:l.rowSpan)>0)break;i++}}if(Oe.length>0){const e=Oe.find((e=>e.row===l&&e.col===n));e&&(i=e.rowSpan,o=e.colSpan)}return{rowSpan:i,colSpan:o}};return q.default.createElement(q.default.Fragment,null,q.default.createElement(_n,{ref:l.current.scrollBarRef,wrapClassName:`${a}--body-wrapper`,wrapStyle:Pe,innerStyle:{height:we(),width:Se()},showTopScrollbar:null==B?void 0:B.doubleXScrollbar,onScroll:Ae},q.default.createElement(vu.Provider,{value:Re},q.default.createElement("table",{ref:le,style:{width:0,marginTop:Ee(),marginLeft:Ce()},className:J.default(`${a}--body`,{"virtual-container":l.current.scrollYLoad||l.current.scrollXLoad}),tabIndex:-1,cellSpacing:"0",cellPadding:"0"},(()=>{const{scrollXLoad:e}=l.current;return q.default.createElement("colgroup",null,(e?ye:i).map((t=>{const{dataIndex:l,width:n,renderWidth:a}=e?i[t.index]:t;return q.default.createElement("col",{key:l,style:{width:`${n||a}px`,minWidth:`${n||a}px`}})})))})(),q.default.createElement("tbody",null,(e=>{const{scrollYLoad:t,scrollXLoad:a}=l.current,o=[];return(t?e:r).forEach(((e,l)=>{const s=t?r[e.index]:e,d=t?e.index:l,u=n(s,s.index);if(o.push(Ue(s,d,u)),null==$?void 0:$.expandedRowRender){const{expandedRowClassName:e,rowExpandable:t=nt}=$;g.includes(u)&&t(s)&&o.push(q.default.createElement("tr",{key:`expand_${u}`,className:"body--row-expanded"},q.default.createElement("td",{colSpan:(a?ye:i).length,className:"body--column",style:{paddingLeft:H?2*pi.selectionColumnWidth:pi.selectionColumnWidth}},q.default.createElement("div",{className:J.default("cell",e)},$.expandedRowRender(s,d)))))}})),o})(ve)))),!!U&&q.default.createElement(_u,{ref:re,rowVirtualize:he})))}));Fu.displayName="TableBody";const Hu=()=>{const{tableRef:e,prefixCls:t,sorter:l,layout:n,flattenColumns:a,leftFixedColumns:r,rightFixedColumns:i,summationRows:o,setElementStore:s,getStickyLeft:d,getStickyRight:u}=q.default.useContext(Xr),{footRender:c}=e.current.props,{t:f}=Xe(),p=q.default.useRef(null);q.default.useLayoutEffect((()=>{m()}),[]);const m=()=>{s("$footer",p.current)},h=(t,n,a)=>{var o,s;const{dataIndex:c,fixed:p,align:m,summation:h}=t,g=["footer--column","col--ellipsis",{"col--center":"center"===m,"col--right":"right"===m,"column--sort":!!l[c],"cell-fix-left":"left"===p,"cell-fix-right":"right"===p,"cell-fix-left-last":"left"===p&&(null===(o=r[r.length-1])||void 0===o?void 0:o.dataIndex)===c,"cell-fix-right-first":"right"===p&&(null===(s=i[0])||void 0===s?void 0:s.dataIndex)===c}],v={left:"left"===p?`${d(c)}px`:"",right:"right"===p?`${u(c)}px`:""},y=(null==h?void 0:h.render)?h.render(e.current.tableFullData):ka(n,`${c}_text`),b=0===a&&""===y?f("qm.table.config.summaryText"):y;return q.default.createElement("td",{key:c,title:b,className:J.default(g),style:Object.assign({},v)},q.default.createElement("div",{className:"cell"},b))},{tableBodyWidth:g}=n;return q.default.createElement("div",{ref:p,className:`${t}--footer-wrapper`},c?c(a,e.current.tableFullData):q.default.createElement("table",{className:`${t}--footer`,cellSpacing:"0",cellPadding:"0",style:{width:g?`${g}px`:""}},q.default.createElement("colgroup",null,a.map((e=>{const{dataIndex:t,width:l,renderWidth:n}=e;return q.default.createElement("col",{key:t,style:{width:`${l||n}px`,minWidth:`${l||n}px`}})}))),q.default.createElement("tfoot",null,o.map(((e,t)=>q.default.createElement("tr",{key:t,className:"footer--row"},a.map(((t,l)=>h(t,e,l)))))))))};var Mu;!function(e){e.small="small",e.middle="default",e.large="default"}(Mu||(Mu={}));const $u=e=>{var t,l,n,a;const{current:r,pageSize:i,total:o,onChange:d}=e,{global:u}=q.default.useContext(xe),{tableRef:c,prefixCls:f,$size:p,setElementStore:m}=q.default.useContext(Xr),{uniqueKey:h,paginationConfig:g,infoBarConfig:v}=c.current.props,y=q.default.useRef(null),b=q.default.useMemo((()=>h?`tablePager_${h}`:""),[h]);q.default.useLayoutEffect((()=>{x(),S()}),[]);const x=()=>{m("$pager",y.current)},E=null!==(t=null==g?void 0:g.showSizeChanger)&&void 0!==t?t:pi.pagination.showSizeChanger,C=null!==(l=null==g?void 0:g.showQuickJumper)&&void 0!==l?l:pi.pagination.showQuickJumper,w=(null==g?void 0:g.pageSizeOptions)||(null===(a=null===(n=null==u?void 0:u.table)||void 0===n?void 0:n.pagination)||void 0===a?void 0:a.pageSizeOptions)||pi.pagination.pageSizeOptions,S=()=>Ye(void 0,void 0,void 0,(function*(){if(!b)return;const e=yield N(b);e&&e!==i&&(d(r,e),localStorage.setItem(b,e.toString()))})),N=e=>Ye(void 0,void 0,void 0,(function*(){const t=null==u?void 0:u.getComponentConfigApi;if(t&&!localStorage.getItem(b))try{const l=yield t({key:e});if(200===l.code)return l.data}catch(e){}})),T=(e,t)=>Ye(void 0,void 0,void 0,(function*(){const l=null==u?void 0:u.saveComponentConfigApi;if(l)try{yield l({[e]:t})}catch(e){}})),I={[`${f}-pager`]:!0};return q.default.createElement("div",{ref:y,className:J.default(I)},q.default.createElement("div",{className:"pager-alert"},"bottom"===(null==v?void 0:v.position)&&q.default.createElement(Ei,{total:o})),q.default.createElement(s.Pagination,{size:Mu[p],showSizeChanger:E,showQuickJumper:C,pageSizeOptions:w,current:r,pageSize:i,total:o,onChange:(e,t)=>{d(e,t)},onShowSizeChange:(e,t)=>{b&&(T(b,t),localStorage.setItem(b,`${t}`))}}))},qu=()=>{const{prefixCls:e,layout:t}=q.default.useContext(Xr),l=q.default.useMemo((()=>{const{headerHeight:e,viewportHeight:l}=t;return{top:`${e}px`,height:`${l}px`}}),[t]);return q.default.createElement("div",{className:`${e}--empty`,style:l},q.default.createElement(hn,null))},ju=()=>{const{prefixCls:e,setElementStore:t}=q.default.useContext(Xr),l=q.default.useRef(null);q.default.useLayoutEffect((()=>{n()}),[]);const n=()=>{t("$resizableBar",l.current)};return q.default.createElement("div",{ref:l,className:`${e}--resizable-bar`})},Ku=q.default.forwardRef(((e,t)=>{const l=Ne(Zr,e),{rowKey:n,columns:a,loading:r,resizable:i,customClass:o,areaSelection:s,tablePrint:d,exportExcel:u,infoBarConfig:c,topSpaceAlign:f,showTableInfo:p,showFullScreen:h,showRefresh:g,showToolBox:v,showHeader:y,className:b,style:x}=l,{$size:E}=Ze(l),C=q.default.useRef(null),w=q.default.useRef(null),S=q.default.useRef(null),N=q.default.useRef(null),T=q.default.useRef(null),I=yt("table"),O=Qe(((e,t)=>{const l="function"==typeof n?n(e,t):null==e?void 0:e[n];return void 0===l?(mt("Table","Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."),t):l})),{tableRef:R,tableFullData:k,setElementStore:L,setOriginColumns:P,setTableFullData:A,setTableOriginData:D,setAllTableData:_,setDeriveRowKeys:F,setInvalidRowKeys:H,setFieldAuth:M,setColumnsDefined:$,setScrollXLoad:j,setScrollYLoad:K,setResizeState:V,setHandleState:z,setSummaries:W,setSelectionRows:B,setRecordsMap:U,setUnMounted:G,clearElementStore:Y,clearRecordsMap:X}=((e,{getRowKey:t,$size:l})=>{const{rowHeight:n,dynamicThead:a}=e,r=q.default.useRef({props:e,uid:di(),tableManager:ci,elementStore:{},originColumns:[],tableFullData:[],tableOriginData:[],allTableData:[],allRowKeys:[],allParentRowKeys:[],deriveRowKeys:[],invalidRowKeys:[],fieldAuth:{},columnsDefined:!a,scrollBarRef:q.default.createRef(),rowHeight:n||pi.rowHeightMaps[l],store:new fi,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:!Je&&/MSIE|Trident/.test(navigator.userAgent)});var i;i=e,r.current.props=i;const o=(e,l,n="",a=0)=>e.map((e=>{const r=t(e,e.index),i=n?`${n}.${e.index+1}`:`${e.index+1}`,s={level:a,rowKey:r,indexPath:i};return e.indexPath=i,e._level=a,e._parentRowKey=a?l:null,Array.isArray(e.children)&&(s.children=o(e.children,r,i,a+1)),l?Object.assign(s,{parentRowKey:l}):s}));return Object.assign(Object.assign({tableRef:r},r.current),{setElementStore:(e,t)=>{r.current.elementStore[e]=t},setOriginColumns:e=>{r.current.originColumns=e},setTableFullData:e=>{r.current.tableFullData=e},setTableOriginData:e=>{r.current.tableOriginData=e},setAllTableData:e=>{const l=Ca(e);r.current.allTableData=l,r.current.allRowKeys=l.map((e=>t(e,e.index)))},setDeriveRowKeys:e=>{const l=e.some((e=>Array.isArray(e.children)));r.current.isTreeTable=l,r.current.deriveRowKeys=l?o(e,""):[],r.current.allParentRowKeys=l?wa(e,(e=>t(e,e.index))):[]},setInvalidRowKeys:e=>{r.current.invalidRowKeys=e},setFieldAuth:(e,t)=>{r.current.fieldAuth[e]=t},setColumnsDefined:e=>{r.current.columnsDefined=e},setResizeState:e=>{r.current.resizeState=e},setHandleState:e=>{r.current.handleState=e},setSummaries:e=>{r.current.summaries=e},setScrollXLoad:e=>{r.current.scrollXLoad=e},setScrollYLoad:e=>{r.current.scrollYLoad=e},setSelectionRows:e=>{r.current.selectionRows=e},setRecordsMap:(e,t)=>{r.current.recordsMap.set(e,t)},setUnMounted:e=>{r.current.unMounted=e},clearElementStore:()=>{for(const e in r.current.elementStore)r.current.elementStore[e]=null},clearRecordsMap:()=>{r.current.recordsMap.clear()}})})(l,{getRowKey:O,$size:E}),{tableFlatData:Q,setTableFlatData:Z,filters:ee,setFilters:te,sorter:le,setSorter:ne,superFilters:ae,setSuperFilters:re,pagination:ie,setPagination:oe,selectionKeys:se,setSelectionKeys:de,rowExpandedKeys:ue,setRowExpandedKeys:ce,highlightKey:fe,setHighlightKey:pe,updateMark:me,forceUpdate:he,activedCell:ge,setActivedCell:ve,mergedTdCells:ye,setMergedCells:be,layout:Ee,setLayout:Ce,permission:we,setPermission:Se,spinning:Te,setSpinning:Ie,isPingLeft:Oe,setPingLeft:Re,isPingRight:ke,setPingRight:Le,isFullScreen:Pe,setFullScreen:Ae,updateTableFlatData:De}=(e=>{var t,l,n,a,r,i,o,s,d,u,c;const{uniqueKey:f,initialSorter:p={},initialFilter:h={},paginationConfig:g,rowSelection:v,expandable:y,rowHighlight:b,mergedCells:x}=e,{global:E}=q.default.useContext(xe),C={current:null!==(t=null==g?void 0:g.current)&&void 0!==t?t:pi.pagination.current,pageSize:null!==(i=null!==(n=null!==(l=(()=>{if(f)return Number(localStorage.getItem(`tablePager_${f}`))||void 0})())&&void 0!==l?l:null==g?void 0:g.pageSize)&&void 0!==n?n:null===(r=null===(a=null==E?void 0:E.table)||void 0===a?void 0:a.pagination)||void 0===r?void 0:r.pageSize)&&void 0!==i?i:pi.pagination.pageSize,total:0},w=null!==(s=null!==(o=null==v?void 0:v.selectedRowKeys)&&void 0!==o?o:null==v?void 0:v.defaultSelectedRowKeys)&&void 0!==s?s:[],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]=q.default.useState([]),[I,O]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),h),[R,k]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),p),[L,P]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),[]),[A,D]=q.default.useState(C),[_,F]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),w),[H,M]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),S),[$,j]=q.default.useState(null!==(c=null==b?void 0:b.currentRowKey)&&void 0!==c?c:""),[K,V]=q.default.useReducer((e=>e+1),0),[z,W]=q.default.useReducer(((e,t)=>m.isEqual(e,t)?e:t),{}),[B,U]=hi([],{value:x}),[G,Y]=q.default.useState({gutterWidth:0,tableWidth:0,tableBodyWidth:0,tableBodyHeight:0,viewportHeight:0,headerHeight:0,footerHeight:0,tableAutoHeight:0,tableFullHeight:0}),[X,Q]=q.default.useState({export:!0,import:!0,print:!0}),[Z,J]=q.default.useState(!1),[ee,te]=q.default.useState(!1),[le,ne]=q.default.useState(!1),[ae,re]=q.default.useState(!1);return{tableFlatData:N,setTableFlatData:T,filters:I,setFilters:O,sorter:R,setSorter:k,superFilters:L,setSuperFilters:P,pagination:A,setPagination:D,selectionKeys:_,setSelectionKeys:F,rowExpandedKeys:H,setRowExpandedKeys:M,highlightKey:$,setHighlightKey:j,updateMark:K,forceUpdate:V,activedCell:z,setActivedCell:W,mergedTdCells:B,setMergedCells:U,layout:G,permission:X,setPermission:Q,setLayout:Y,spinning:Z,setSpinning:J,isPingLeft:ee,setPingLeft:te,isPingRight:le,setPingRight:ne,isFullScreen:ae,setFullScreen:re,updateTableFlatData:()=>T([...N])}})(l),{isFetch:_e,isWebPagination:Fe,isScrollPagination:He,showPagination:Me,tableColumns:$e,flattenColumns:qe,editableColumns:Ke,summationColumns:Ve,leftFixedColumns:ze,rightFixedColumns:We,derivedMergeCells:Be,treeExpandIndex:Ue,showSummary:Ge,showFooter:Xe,isHeadGroup:et,bordered:tt,isHeadSorter:lt,isHeadFilter:nt,isServiceSummation:it,isSelectCollection:ot,isTableImport:st,isTableClipboard:dt,isSuperSearch:ct,isFastSearch:ft,isPivotGrid:pt,isGroupSummary:ht,isGroupSubtotal:gt,isTableEmpty:vt,summationRows:bt,fetchParams:xt}=vi(l,{getRowKey:O,tableRef:R,tableFullData:k,tableFlatData:Q,updateMark:me,sorter:le,filters:ee,superFilters:ae,selectionKeys:se,pagination:ie,mergedTdCells:ye}),{createElementStore:Et,tableStyles:Ct,getSpan:wt,getStickyLeft:St,getStickyRight:Nt,scrollXToColumn:Tt,scrollYToRecord:It,calcTableHeight:Ot,resetTableScroll:Rt,doLayout:kt}=bi(l,{getRowKey:O,tableRef:R,topElementRef:C,tableElementRef:w,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,leftFixedColumns:ze,derivedMergeCells:Be,tableFlatData:Q,layout:Ee,showFooter:Xe,showPagination:Me,isFullScreen:Pe,setLayout:Ce,setElementStore:L}),{initialTable:Lt,checkDataIndex:Pt,createTableFullData:At,getTableData:Dt,createTableList:_t,createTableData:Ft,createGroupData:Ht,setSelectionKeysEffect:Mt,doFieldValidate:$t,getTableLog:qt,dataChange:jt,tableChange:Kt,toLastPage:Vt,toFirstPage:zt,getPageCount:Wt,pagerChangeHandle:Bt,scrollBottomDebouncer:Ut,clearTableSorter:Gt,clearTableFilter:Yt,clearSuperFilters:Xt,clearRowSelection:Qt,clearRowHighlight:Zt,clearTableLog:Jt,destroy:el}=yi(l,{getRowKey:O,tableRef:R,tableElementRef:w,tableBodyRef:S,$size:E,tableColumns:$e,flattenColumns:qe,tableFullData:k,pagination:ie,layout:Ee,filters:ee,sorter:le,superFilters:ae,fetchParams:xt,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,summationColumns:Ve,isFetch:_e,isWebPagination:Fe,isScrollPagination:He,isServiceSummation:it,isGroupSubtotal:gt,doLayout:kt,setTableFlatData:Z,setTableFullData:A,setTableOriginData:D,setAllTableData:_,setDeriveRowKeys:F,setPagination:oe,setPingRight:Le,setPingLeft:Re,setSpinning:Ie,setSorter:ne,setFilters:te,setSuperFilters:re,setSelectionKeys:de,setRowExpandedKeys:ce,setHighlightKey:pe,setSelectionRows:B,setScrollXLoad:j,setScrollYLoad:K,setFieldAuth:M,setResizeState:V,setSummaries:W,setPermission:Se,setRecordsMap:U,resetTableScroll:Rt,clearElementStore:Y,clearRecordsMap:X});((e,t)=>{const{columns:l,summation:n,rowSelection:a,expandable:r,rowHighlight:i}=e,{tableRef:o,tableBodyRef:s,$size:d,pagination:u,selectionKeys:c,rowExpandedKeys:f,highlightKey:p,summationRows:h,showSummary:g,isWebPagination:v,isScrollPagination:y,checkDataIndex:b,toLastPage:x,toFirstPage:E,getPageCount:C,setHandleState:w,scrollYToRecord:S,setSelectionKeysEffect:N,setOriginColumns:T,setRowExpandedKeys:I,setHighlightKey:O,setResizeState:R,setUnMounted:k,calcTableHeight:L,initialTable:P,destroy:A}=t,D=q.default.useRef(h);Ql((()=>{if(!a)return;const{onChange:e}=a;"radio"===a.type&&s.current.setClickedValues(c.length?[c[0],""]:[]),c.__prevent__||null==e||e(c,o.current.selectionRows),Ta(c)}),[c]),Ql((()=>{if(!r)return;const{onChange:e}=r;f.__prevent__||null==e||e(f,f.map((e=>o.current.recordsMap.get(e)))),Ta(f)}),[f]),Ql((()=>{var e,t;i&&(s.current.setClickedValues(p?[p,""]:[]),null===(e=i.onChange)||void 0===e||e.call(i,p,null!==(t=o.current.recordsMap.get(p))&&void 0!==t?t:null))}),[p]),Ql((()=>{var e;m.isEqual(h,D.current)||(D.current=h,g&&n&&(null===(e=n.onChange)||void 0===e||e.call(n,h)))}),[h]),Ql((()=>{const e=a.selectedRowKeys||[];m.isEqual(e,c)||N(Na(e))}),[null==a?void 0:a.selectedRowKeys]),Ql((()=>{const e=r.expandedRowKeys||[];m.isEqual(e,f)||I(Na(e))}),[null==r?void 0:r.expandedRowKeys]),Ql((()=>{const{currentRowKey:e}=i;e!==p&&O(null!=e?e:"")}),[null==i?void 0:i.currentRowKey]),Ql((()=>{const{insert:e,remove:t}=o.current.handleState;e&&(v&&("after"===e?x():E()),S("","after"===e?1e5:0)),t&&u.current>C()&&x(),(e||t)&&w({insert:null,remove:!1})}),[u.total]),Ql((()=>{L()}),[d]),Ql((()=>{(o.current.scrollYLoad||y)&&(e.height||e.maxHeight||mt("Table","必须设置组件参数 `height` 或 `maxHeight`"))}),[o.current.scrollYLoad,y]),xi({handler:()=>{const{resizeState:e}=o.current,{winHeight:t}=e,l=window.innerHeight;l!==t&&(R(Object.assign({},e,{winHeight:l})),L())},delay:16}),q.default.useEffect((()=>(T(ut(l)),P(),b(),rt((()=>L())),()=>{A(),k(!0)})),[])})(l,{tableRef:R,tableBodyRef:S,$size:E,pagination:ie,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,showSummary:Ge,summationRows:bt,isWebPagination:Fe,isScrollPagination:He,checkDataIndex:Pt,toLastPage:Vt,toFirstPage:zt,getPageCount:Wt,setHandleState:z,scrollYToRecord:It,setOriginColumns:P,setSelectionKeysEffect:Mt,setRowExpandedKeys:ce,setHighlightKey:pe,setResizeState:V,setUnMounted:G,calcTableHeight:Ot,initialTable:Lt,destroy:el});const tl=q.default.useMemo((()=>({getRowKey:O,tableRef:R,tableBodyRef:S,prefixCls:I,$size:E,tableFlatData:Q,flattenColumns:qe,editableColumns:Ke,leftFixedColumns:ze,rightFixedColumns:We,treeExpandIndex:Ue,sorter:le,filters:ee,superFilters:ae,layout:Ee,bordered:tt,showFooter:Xe,showSummary:Ge,summationRows:bt,pagination:ie,fetchParams:xt,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,activedCell:ge,mergedTdCells:ye,derivedMergeCells:Be,updateMark:me,isFetch:_e,isPingLeft:Oe,isPingRight:ke,isHeadSorter:lt,isHeadFilter:nt,isFullScreen:Pe,isTableEmpty:vt,isHeadGroup:et,isGroupSubtotal:gt,isWebPagination:Fe,dataChange:jt,tableChange:Kt,getTableData:Dt,setElementStore:L,createTableList:_t,createTableFullData:At,updateTableFlatData:De,setSorter:ne,setFilters:te,setSuperFilters:re,setHighlightKey:pe,setRowExpandedKeys:ce,setSelectionRows:B,setSelectionKeysEffect:Mt,setInvalidRowKeys:H,setActivedCell:ve,setMergedCells:be,getSpan:wt,getStickyLeft:St,getStickyRight:Nt,scrollXToColumn:Tt,scrollYToRecord:It,setPagination:oe,setPingLeft:Re,setPingRight:Le,setSpinning:Ie,setFullScreen:Ae,doFieldValidate:$t,createTableData:Ft,createGroupData:Ht,scrollBottomDebouncer:Ut,resetTableScroll:Rt,clearTableSorter:Gt,clearTableFilter:Yt,clearSuperFilters:Xt,clearRowSelection:Qt,clearRowHighlight:Zt})),[E,Q,qe,le,ee,ae,Ee,tt,Xe,Ge,bt,ie,xt,se,ue,fe,ge,Be,me,_e,Oe,ke,lt,nt,Pe,vt,et,gt,Fe]);((e,t)=>{const{getRowKey:l,tableRef:n,toolBoxRef:a,tableBodyRef:r,columnFilterRef:i,flattenColumns:o,editableColumns:s,pagination:d,fetchParams:u,selectionKeys:c,rowExpandedKeys:f,highlightKey:p,isFetch:h,dataChange:g,getTableData:v,createTableData:y,createTableFullData:b,calcTableHeight:x,scrollXToColumn:E,scrollYToRecord:C,doFieldValidate:w,setTableOriginData:S,setHandleState:N,setColumnsDefined:T,setSelectionKeysEffect:I,setRowExpandedKeys:O,setHighlightKey:R,setSelectionRows:k,setOriginColumns:L,forceUpdate:P,getTableLog:A,clearRowSelection:D,clearRowHighlight:_,clearTableSorter:F,clearTableFilter:H,clearSuperFilters:M,clearTableLog:$}=t,{columns:j,columnsChange:K}=n.current.props,V=(e,t,n)=>e.filter((e=>{const a=l(e,e.index);e.children&&(e.children=V(e.children,t,n));const r=t.includes(a);return r&&(null==n||n(e,a)),!r}));q.default.useImperativeHandle(e,(()=>({CALCULATE_HEIGHT:()=>{x()},DO_REFRESH:e=>Ye(void 0,void 0,void 0,(function*(){h&&(yield at(0),yield v(),null==e||e())})),GET_LOG:()=>A(),GET_FETCH_PARAMS:()=>{const e={};for(const t in u)Object.keys(d).includes(t)||(e[t]=u[t]);return e},CLEAR_TABLE_DATA:()=>{h||(D(),_(),F(),H(),M(),$(),y([]))},CLEAR_LOG:()=>{$(),P()},CREATE_FOCUS:(e,t)=>{r.current.createFocus(e,t)},FORCE_UPDATE:()=>{P()},DO_EXPORT:()=>{a.current.exportHandle()},SCROLL_TO_RECORD:e=>{C(e)},SCROLL_TO_COLUMN:e=>{E(e)},SET_SELECTION:(e,t)=>{I(t?Na([...e]):e)},SET_EXPANDABLE:(e,t)=>{O(t?Na([...e]):e)},SET_HIGHLIGHT:e=>{R(e)},SET_SELECTION_ROWS:e=>{k(e)},SET_TABLE_DATA:e=>{b(e)},DEFINE_INITIAL_COLUMNS:e=>{L(e),T(!0),i.current.initialHandler()},SET_TABLE_COLUMN:(e,t,l)=>{const n=va(j,e);if(!n)return mt("Table","SET_TABLE_COLUMN 方法参数 `dataIndex` 的值不正确");if(!m.isPlainObject(t))return mt("Table","SET_TABLE_COLUMN 方法参数 `option` 的值不正确");if(n.noAuth)return mt("Table","SET_TABLE_COLUMN 方法不能操作受权限控制的列");for(const e in t)e&&m.set(n,e,t[e]);l&&(K?K([...j]):mt("Table","需要设置 `columnsChange` 参数"),P())},INSERT_RECORDS:(e,t)=>{const{store:a,tableFullData:r}=n.current,i=(Array.isArray(e)?e:[e]).filter((e=>m.isPlainObject(e)));if(!i.length)return;i.forEach((e=>{o.forEach((t=>{const{dataIndex:l}=t;[pi.expandableColumn,pi.selectionColumn,pi.operationColumn].includes(l)||La(e,l,ka(e,l))})),a.addToInserted(e)}));const s="before"===(null==t?void 0:t.mode),d=void 0===(null==t?void 0:t.parentRowKey),u=r;if(d)s?u.unshift(...i):u.push(...i);else{const e=Ba(r,(e=>t.parentRowKey===l(e,e.index)));e&&(Array.isArray(e.children)?s?e.children.unshift(...i):e.children.push(...i):e.children=i)}d&&N(Object.assign({},n.current.handleState,{insert:s?"before":"after"})),y(u),g()},REMOVE_RECORDS:e=>{const{store:t,tableFullData:a}=n.current,r=(Array.isArray(e)?e:[e]).map((e=>m.isPlainObject(e)?l(e,e.index):e));if(!r.length)return;let i=!1;const o=V(a,r,((e,l)=>{t.addToRemoved(e),s.forEach((n=>{const{dataIndex:a,editRender:r}=n,i=null==r?void 0:r(e,n);if(!i)return;const{rules:o=[],disabled:s}=i;!s&&o.length&&(t.removeFromRequired({x:l,y:a}),t.removeFromValidate({x:l,y:a}),t.removeFromEdited({x:l,y:a}))})),i=!0}));i&&(N(Object.assign({},n.current.handleState,{remove:!0})),b(o),I(c.filter((e=>!r.includes(e)))),r.includes(p)&&_(),O(f.filter((e=>!r.includes(e)))),g(),rt((()=>{S(V(n.current.tableOriginData,r))})))},VALIDATE_FIELDS:(e,t)=>{n.current.allTableData.forEach((n=>{s.forEach((a=>{const{dataIndex:r,title:i,editRender:o}=a,s=null==o?void 0:o(n,a);if(!s)return;const d=l(n,n.index);if(e&&!e.includes(d))return;if(t&&!t.includes(r))return;const{rules:u=[],disabled:c}=s;c||w(u,ka(n,r),d,r,qa(i))}))}));const{required:a,validate:r}=A(),i=[...a,...r];return i.length&&C(i[0].rowKey),P(),{required:a,validate:r}}})))})(t,{getRowKey:O,tableRef:R,toolBoxRef:N,tableBodyRef:S,columnFilterRef:T,flattenColumns:qe,editableColumns:Ke,pagination:ie,fetchParams:xt,selectionKeys:se,rowExpandedKeys:ue,highlightKey:fe,isFetch:_e,dataChange:jt,getTableData:Dt,createTableData:Ft,createTableFullData:At,calcTableHeight:Ot,scrollXToColumn:Tt,scrollYToRecord:It,doFieldValidate:$t,setTableOriginData:D,setHandleState:z,setColumnsDefined:$,setSelectionKeysEffect:Mt,setRowExpandedKeys:ce,setHighlightKey:pe,setSelectionRows:B,setOriginColumns:P,forceUpdate:he,getTableLog:qt,clearRowSelection:Qt,clearRowHighlight:Zt,clearTableSorter:Gt,clearTableFilter:Yt,clearSuperFilters:Xt,clearTableLog:Jt}),q.default.useLayoutEffect((()=>{Et(),R.current.tableManager.register(R.current.uid,null!=t?t:{current:null})}),[]);const ll={[`${I}--wrapper`]:!0,[`${I}--lg`]:"large"===E,[`${I}--sm`]:"small"===E,[`${I}--maximize`]:Pe,[o]:!!o},nl={[I]:!0,"is--border":tt,"is--fixed":ze.length||We.length,"is--sortable":lt,"is--filterable":nt,"is--head-group":et,"is--area-select":!!s,"is--ping-left":Oe,"is--ping-right":ke};return q.default.createElement(Xr.Provider,{value:tl},q.default.createElement("div",{className:J.default(ll,b),style:x},p&&q.default.createElement("div",{ref:C,className:`${I}-top`},q.default.createElement("div",{className:`${I}-top__space`},"bottom"!==(null==c?void 0:c.position)&&q.default.createElement(Ei,{total:ie.total}),q.default.createElement("div",{className:`${I}-top__space-slot`,style:{justifyContent:ii[f]}},l.children)),q.default.createElement("div",{className:`${I}-top__actions`},q.default.createElement(Qd,{ref:N,showFullScreen:h,showReload:g&&_e,showPrint:we.print&&!!d,showImport:we.import&&st,showExport:we.export&&!!u,showClipboard:dt,showCollection:ot,showFastSearch:ft,showSuperSearch:ct,showPivotGrid:pt,showGroupSummary:ht,showToolBox:v,tableColumns:$e}),q.default.createElement(Jd,{ref:T,columns:a}))),q.default.createElement(gn,{spinning:null!=r?r:Te},q.default.createElement("div",{ref:w,className:J.default(nl),style:Ct},q.default.createElement("div",{className:`${I}--main-wrapper`},y&&q.default.createElement(gu,{tableColumns:$e}),q.default.createElement(Fu,{ref:S}),Xe&&q.default.createElement(Hu,null)),tt&&q.default.createElement("div",{className:`${I}--border-line`}),vt&&q.default.createElement(qu,null),i&&q.default.createElement(ju,null))),Me&&q.default.createElement($u,je({},ie,{onChange:(e,t)=>Bt({current:e,pageSize:t})}))))}));Ku.displayName="QmTable";const Vu=e=>{var t;const{uniqueKey:l,multiple:n,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:s={},className:d,style:u,onClose:c}=e,{$size:f}=Ze(e),{t:p}=Xe(),h=q.default.useRef(null),g=q.default.useRef(null),v=q.default.useRef(null),y=Cn(h),[b,x]=q.default.useState(s),[E,C]=q.default.useState(),[w,S]=q.default.useState(i),[N,T]=q.default.useState(!1),[I,O]=q.default.useState(300),[R,k]=q.default.useState(o),[L,P]=q.default.useState((e=>[{title:p("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(s.columns||[])])()),[A,D]=q.default.useState(m.merge({},null===(t=s.fetch)||void 0===t?void 0:t.params,a)),[_,F]=q.default.useState([]),H=()=>{const e=h.current,t=e.querySelector(".form-wrap");O(e.offsetHeight-t.offsetHeight-2*Yr[f]-30)},M=wn(H,5);Ie((()=>{M()}),[y.width]),Ql((()=>{m.isEqual(o,R)||k(o)}),[o]),q.default.useEffect((()=>{$()}),[A]),q.default.useEffect((()=>{r&&v.current.SET_SELECTION_ROWS(r)}),[r]),q.default.useEffect((()=>{var e;a&&(null===(e=g.current)||void 0===e||e.SET_FIELDS_VALUE(a))}),[]);const $=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:l}=b;if(!t||!(null==l?void 0:l.api))return;const{api:a,dataKey:r,beforeFetch:i=nt}=l;if(i(A)){T(!0);try{const t=yield a(A);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,r))&&void 0!==e?e:[];n||(S([]),yield at(0)),F(l)}}catch(e){}T(!1)}})),j=e=>{n||(C(e),c(e))},K=e=>{D(Object.assign({},A,e))},V={[`${yt("search-helper")}--wrapper`]:!0},z=b.webPagination?{dataSource:_,loading:N,webPagination:!0}:{fetch:Object.assign(Object.assign({},b.fetch),{params:A})};return q.default.createElement("div",{ref:h,className:J.default(V,d),style:u},q.default.createElement("div",{className:"form-wrap"},R.length?q.default.createElement(wf,{ref:g,items:R,uniqueKey:l,formType:"search",isAutoFocus:!1,fieldsChange:e=>k(e),onCollapse:()=>H(),onFinish:e=>K(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield g.current.GET_FORM_DATA();e||K(t)}))}):null),q.default.createElement("div",null,q.default.createElement(Ku,je({ref:v,uniqueKey:l,height:I,columns:L,rowKey:b.rowKey||"pageIndex"},z,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:w,onChange:(e,t)=>{S(e),C(n?t:t[0])}},topSpaceAlign:"left",paginationConfig:b.paginationConfig,columnsChange:e=>P(e),onRowDblclick:j,onRowEnter:j}),b.topBarExtra)),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[f]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>c(null),style:{marginRight:8}},p("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!E,onClick:()=>c(E,n?w:void 0)},p("qm.dialog.confirm"))))};Vu.displayName="QmSearchHelper";const{Search:zu}=s.Input;class Wu extends e.Component{constructor(e){super(e),this._is_change=!1,this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ye(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=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||mt("Form","SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||mt("Form","SEARCH_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&mt("Form","SEARCH_HELPER 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getDerivedSearchHelper=()=>this.searchHelper,this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:l={},formatter:n=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof o?o():o||{},u="function"==typeof s?s():s||{},c=this.getItemValue();if(t&&!ot(c)){this.setState({loading:!0});try{const o=yield t(n(Object.assign(Object.assign({},l),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(d&&pr(e,this.alias,d),u&&mr(e,this.extras,u),this._record=e,this.setFieldsValue(e),i){const t=fr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t),this.searchHelperChangeHandle(t)}null==r||r([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:l}=this.searchHelper,n=""!==e?e:void 0,a=("function"==typeof l?l():l)||[],r={[t]:n};return(Array.isArray(a)?a:[a]).forEach((e=>{if(m.isPlainObject(e))for(const t in e)r[t]="function"==typeof e[t]?e[t](n):n;else r[e]=n})),r},this.getSearchHelperTableData=e=>{const{table:t,initialValue:l={}}=this.searchHelper,{beforeFetch:n=nt,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=m.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},l),a(this.createFilters(e))),{currentPage:1,pageSize:500});if(!n(s))return i();this.setState({loading:!0});try{const e=yield t.fetch.api(s);if(200===e.code){const l=Array.isArray(e.data)?e.data:null!==(o=m.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];r(l)}else i()}catch(e){i(e)}finally{rt((()=>this.setState({loading:!1})))}}))))},this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=fr(e,this.alias[n]);void 0!==a&&(t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a))}for(const l in this.extras){const n=fr(e,this.extras[l]);void 0!==n&&t.SET_FIELDS_EXTRA({[l]:n})}},this.resetSearchHelperValue=(e=[],t)=>Ye(this,void 0,void 0,(function*(){const{fieldName:l}=this.props.option,n=e.filter((e=>{var n;return null===(n=fr(e,this.alias[l]))||void 0===n?void 0:n.toString().toLowerCase().includes(t.toLowerCase())}));if(1===n.length)return this.closeSearchHelper(n[0]);this.openSearchHelper(t)})),this.openSearchHelper=(e,t)=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:l}=this.context,{beforeOpen:n}=this.searchHelper,a=(null!=n?n:nt)(l.state.formData);(null==a?void 0:a.then)?a.then((()=>{this.todoOpen(e),null==t||t()})).catch((()=>{})):!1!==a&&(this.todoOpen(e),null==t||t())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])});const n=fr(e,this.alias[l]);this.triggerChange(n),this.searchHelperChangeHandle(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(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 l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===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:l}=this.props;null==t||t(e),l(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:t}=this.context,{visible:l,loading:n}=this.state,{value:a}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:d={},placeholder:u=Se("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:m}=this.props.option,{prefix:h,suffix:g,maxLength:v}=o,y={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},b=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:Object.assign({},this.deriveParams,s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?q.default.createElement(Dr,{value:a,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(zu,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:n,placeholder:u,style:d,prefix:h,suffix:g,maxLength:v,bordered:c,allowClear:f,readOnly:p,disabled:m,onBlur:e=>{var t;const{value:n}=e.target,{onlySelect:a=!0,table:r}=this.searchHelper;this.triggerBlur(n),this._is_change&&!l&&(n?a?(null===(t=null==r?void 0:r.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;!l&&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):rt((()=>this.clearSearchHelperValue())))}}),q.default.createElement(Qn,y,q.default.createElement(Vu,b)))}}Wu.contextType=Zn;class Bu extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[]}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Wu,{ref:e=>this.searchRef=e,option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="")=>{e.setViewValue(r,t)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Bu.contextType=Zn;const Uu=t=>{class l extends e.Component{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 l,n;const a=e.target,r=null==t?void 0:t.target,i=!a||!r,o=(null===(l=this.$el)||void 0===l?void 0:l.contains(a))||(null===(n=this.$el)||void 0===n?void 0:n.contains(r)),s=this.$el===a,d=this.omitClassNames.map((e=>Array.from(document.querySelectorAll(e)))).flat(),u=d.some((e=>null==e?void 0:e.contains(a)))||d.includes(r);let c;c=!(i||o||s||u),this.setState({clickOutside:c})},this.setCurrentElement=e=>{e&&(this.$el=e)},this.setOmitClassNames=(e=[])=>{this.omitClassNames=e}}componentDidMount(){this.event1=ae.default(document,"mousedown",this.mousedownHandler),this.event2=ae.default(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:e}=this.props,{clickOutside:l}=this.state;return q.default.createElement(t,je({ref:e},this.props,{clickOutside:l,setCurrentElement:this.setCurrentElement,setOmitClassNames:this.setOmitClassNames}))}}return l.displayName=`OutsideClick(${t.displayName||t.name})`,q.default.forwardRef(((e,t)=>q.default.createElement(l,je({},e,{forwardedRef:t}))))};let Gu=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||mt("Form","MULTIPLE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||mt("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:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:l}=this.alias;this.setRecords(m.uniqBy([...this._records.filter((e=>t.includes(e[l]))),...e],l));const n=this.recordsToDict();this.setItemList(n),this.triggerChange(n.map((e=>e.value)));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(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:l=[]}=e,{value:n=[],clickOutside:a}=this.props;m.isEqual(l,n)||m.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),a&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:l,valueKey:n}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,callback:s,fieldAliasMap:d}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},u="function"==typeof d?d():d||{},{value:c}=this.props;if(a){if(ot(c))return this.setRecords([]);this.setState({loading:!0});try{const e=yield a(i(Object.assign(Object.assign({},r),{keys:c})));if(200===e.code){let a=Array.isArray(e.data)?e.data:null!==(t=m.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==u?void 0:u.valueKey)&&u.valueKey!==n&&(e[n]=e[u.valueKey]),(null==u?void 0:u.textKey)&&u.textKey!==l&&(e[l]=e[u.textKey])})),a=a.filter((e=>c.includes(e[n])));const r=a.map((e=>({value:e[n],text:e[l]})));this.setRecords(a),this.setItemList(r),this.setViewValue(c),null==s||s(a)}}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,t,l;const{$$form:n}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:d}=this.props,{fieldName:u,options:c={},searchHelper:f={},style:p={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,w={visible:a,title:Se("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"60%",wrapClassName:`form-popper__${u}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${u}`:"",initialValue:m.merge({},f.initialValue),defaultSelectedKeys:d,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=o.filter((e=>null==d?void 0:d.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=yt("form-multiple-search-helper"),{size:R}=n.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(l=(t=this.props).setOmitClassNames)||void 0===l||l.call(t,[`.${O}`]);const L=o.filter((e=>null==d?void 0:d.includes(e.value))).map((e=>e.text)).join(",");return n.isOnlyShow?q.default.createElement(Dr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(gs,{popupVisible:!x&&r,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:nr,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(s.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:d,placeholder:h,loading:i,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},p),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Vu,S)))}};Gu.contextType=Zn,Gu=Ge([Uu],Gu);class Yu extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(Gu,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Yu.contextType=Zn;const Xu=e=>{const t=[];return e.forEach((e=>{e.children&&t.push(...Xu(e.children)),e.children&&t.push(e.value)})),t},Qu=(e,t)=>{let l=null;for(let n=0;n<e.length;n++){if(Array.isArray(e[n].children)&&(l=Qu(e[n].children,t)),l)return l;if(t(e[n]))return e[n]}return l},Zu=(e,t)=>e.map((e=>Object.assign({},e))).filter((e=>(e.children=e.children&&Zu(e.children,t),t(e)||e.children&&e.children.length))),Ju=e=>{var t;const{uniqueKey:l,multiple:n,initialValue:a,selectionRows:r,defaultSelectedKeys:i=[],filters:o=[],table:d={},tree:u={},className:c,style:f,onClose:p}=e,{$size:h}=Ze(e),{t:v}=Xe(),y=q.default.useRef(null),b=q.default.useRef(null),x=q.default.useRef(null),E=Cn(y),[C,w]=q.default.useState(d),[S,N]=q.default.useState(),[T,I]=q.default.useState(i),[O,R]=q.default.useState(!1),[k,L]=q.default.useState(300),[P,A]=q.default.useState(300),[D,_]=q.default.useState(o),[F,H]=q.default.useState((e=>[{title:v("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},...e||(d.columns||[])])()),[M,$]=q.default.useState(m.merge({},null===(t=d.fetch)||void 0===t?void 0:t.params,a)),[j,K]=q.default.useState([]),V=()=>{const e=y.current,t=e.querySelector(".form-wrap"),l=e.querySelector(".input-wrap");L(e.offsetHeight-l.offsetHeight-10),A(e.offsetHeight-t.offsetHeight-2*Yr[h]-30)},z=wn(V,5);Ie((()=>{z()}),[E.width]),Ql((()=>{m.isEqual(o,D)||_(o)}),[o]),q.default.useEffect((()=>{W()}),[M]),q.default.useEffect((()=>{r&&x.current.SET_SELECTION_ROWS(r)}),[r]),q.default.useEffect((()=>{var e;a&&(null===(e=b.current)||void 0===e||e.SET_FIELDS_VALUE(a)),ne()}),[]);const W=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:l}=C;if(!t||!(null==l?void 0:l.api))return;const{api:a,dataKey:r,beforeFetch:i=nt}=l;if(i(M)){R(!0);try{const t=yield a(M);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,r))&&void 0!==e?e:[];n||(I([]),yield at(0)),K(l)}}catch(e){}R(!1)}})),B=e=>{n||(N(e),p(e))},U=e=>{$(Object.assign({},M,e))},[G,Y]=q.default.useState([]),[X,Q]=q.default.useState([]),[Z,ee]=q.default.useState(""),te=q.default.useRef(G),le=q.default.useRef([]);Ql((()=>{Q(Xu(G))}),[G]);const ne=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!u.fetch)return;const{api:t,params:l,dataKey:n,valueKey:a="value",textKey:r="text"}=u.fetch;try{const i=yield t(l);if(200===i.code){const t=Array.isArray(i.data)?i.data:null!==(e=m.get(i.data,n))&&void 0!==e?e:[],l=hr(t,a,r);Y(l),te.current=l,le.current=t}}catch(e){}})),ae=e=>`${e}|${Pr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("")}`,re={[`${yt("tree-table-helper")}--wrapper`]:!0},ie=C.webPagination?{dataSource:j,loading:O,webPagination:!0}:{fetch:Object.assign(Object.assign({},C.fetch),{params:M})};return q.default.createElement("div",{ref:y,className:J.default(re,c),style:f},q.default.createElement(pn,{defaultValue:200,style:{height:"100%"}},q.default.createElement(pn.Pane,{min:100,style:{overflowY:"auto"}},q.default.createElement(s.Input,{className:"input-wrap",value:Z,style:{marginBottom:8},placeholder:v("qm.form.inputPlaceholder"),suffix:q.default.createElement(g.SearchOutlined,null),allowClear:!0,onChange:e=>(e=>{const t=Zu(te.current,(t=>{if(!e)return!0;const l=t.text||"";return-1!==ae(l).indexOf(e)}));ee(e),Y(t)})(e.target.value)}),q.default.createElement(s.Tree,{fieldNames:{title:"text",key:"value",children:"children"},height:k,defaultExpandAll:!0,expandedKeys:X,treeData:G,filterTreeNode:e=>{if(!Z)return!1;const t=e.text||"";return-1!==ae(t).indexOf(Z)},onExpand:e=>{Q(e)},onSelect:e=>{const{valueKey:t="value"}=u.fetch;(e=>{if(!u.tableParamsMap)return mt("TreeTableHelper","需要配置 `tree.tableParamsMap` 选项");const t="function"==typeof u.tableParamsMap?u.tableParamsMap():u.tableParamsMap,l={};for(const n in t)l[n]=m.get(e,t[n]);U(l)})(Qu(le.current,(l=>m.get(l,t)===e[0]))||{})}})),q.default.createElement(pn.Pane,{className:"split-pane"},q.default.createElement("div",{className:"form-wrap"},D.length?q.default.createElement(wf,{ref:b,items:D,uniqueKey:l,formType:"search",isAutoFocus:!1,fieldsChange:e=>_(e),onCollapse:()=>V(),onFinish:e=>U(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield b.current.GET_FORM_DATA();e||U(t)}))}):null),q.default.createElement("div",null,q.default.createElement(Ku,je({ref:x,uniqueKey:l,height:P,columns:F,rowKey:C.rowKey||"pageIndex"},ie,{rowSelection:{type:n?"checkbox":"radio",clearableAfterFetched:!n,selectFirstRowOnChange:!0,selectAllOnCurrentPage:!0,selectedRowKeys:T,onChange:(e,t)=>{I(e),N(n?t:t[0])}},topSpaceAlign:"left",paginationConfig:C.paginationConfig,columnsChange:e=>H(e),onRowDblclick:B,onRowEnter:B}),C.topBarExtra)))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[h]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>p(null),style:{marginRight:8}},v("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!S,onClick:()=>p(S,n?T:void 0)},v("qm.dialog.confirm"))))};Ju.displayName="TreeTableHelper";const{Search:ec}=s.Input;class tc extends e.Component{constructor(e){super(e),this._prevValue=null,this.state={visible:!1,loading:!1},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.echoSearchHelper=()=>Ye(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=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e}=this.props.option,{fieldAliasMap:t,fieldsDefine:l,echoRequest:n}=this.searchHelper;if(t||mt("Form","TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),l){const e=["valueKey","displayKey","extraKey"];for(const t in l)e.includes(t)&&(this[t]=l[t])}Object.keys(this.alias).includes(e)||mt("Form","TREE_TABLE_HELPER 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),n&&!this.valueKey&&mt("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=()=>Ye(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:l={},formatter:n=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof o?o():o||{},u="function"==typeof s?s():s||{},c=this.getItemValue();if(t&&!ot(c)){this.setState({loading:!0});try{const o=yield t(n(Object.assign(Object.assign({},l),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(d&&pr(e,this.alias,d),u&&mr(e,this.extras,u),this._record=e,this.setFieldsValue(e),i){const t=fr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==r||r([e])}}}catch(e){}this.setState({loading:!1})}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;for(const n in this.alias){const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])})},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){if(n===l)continue;const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])});const n=fr(e,this.alias[l]);this.triggerChange(n);const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(e)),200)}))},this.clearSearchHelperValue=()=>{const{$$form:e}=this.context,{fieldName:t}=this.props.option;for(const l in this.alias)l!==t&&(e.SET_FIELDS_VALUE({[l]:void 0}),l===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:l}=this.props;null==t||t(e),l(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:t}=this.context,{visible:l,loading:n}=this.state,{value:a=""}=this.props,{type:r,fieldName:i,options:o={},searchHelper:s={},style:d={},placeholder:u=Se("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{prefix:g,suffix:v,maxLength:y}=o,b={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=s.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${i}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[t.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},x=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${i}`:"",initialValue:m.merge({},s.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.setVisible(!1)}});return t.isOnlyShow?q.default.createElement(Dr,{value:a,bordered:c}):q.default.createElement(q.default.Fragment,null,q.default.createElement(ec,{ref:e=>this[`${r}_Ref`]=e,value:a,title:a,loading:n,placeholder:u,style:d,prefix:g,suffix:v,maxLength:y,bordered:c,allowClear:f,readOnly:p,disabled:h,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())}}),q.default.createElement(Qn,b,q.default.createElement(Ju,x)))}}tc.contextType=Zn;class lc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(tc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}lc.contextType=Zn;let nc=class extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._records=[],this.state={visible:!1,visible2:!1,loading:!1,itemList:[]},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||mt("Form","MULTIPLE_TREE_TABLE_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||mt("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:l}=this.props.option;t.setViewValue(l,this.createViewText(e))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.closeSearchHelper=(e,t=[])=>{const{valueKey:l}=this.alias;this.setRecords(m.uniqBy([...this._records.filter((e=>t.includes(e[l]))),...e],l));const n=this.recordsToDict();this.setItemList(n),this.triggerChange(n.map((e=>e.value)));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props,{valueKey:n}=this.alias||{};this.setRecords(this._records.filter((t=>e.includes(t[n])))),null==t||t(e),l(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:l=[]}=e,{value:n=[],clickOutside:a}=this.props;m.isEqual(l,n)||m.isEqual(n,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList(),a&&t.visible2&&this.setState({visible2:!1})}getItemList(){var e,t;return Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:l,valueKey:n}=this.alias,{fetchApi:a,params:r={},formatter:i=(e=>e),dataKey:o,fieldAliasMap:s}=this.searchHelper.echoRequest||(null===(e=this.props.option.searchHelper)||void 0===e?void 0:e.request)||{},d="function"==typeof s?s():s||{},{value:u}=this.props;if(a){if(ot(u))return this.setRecords([]);this.setState({loading:!0});try{const e=yield a(i(Object.assign(Object.assign({},r),{keys:u})));if(200===e.code){let a=Array.isArray(e.data)?e.data:null!==(t=m.get(e.data,o))&&void 0!==t?t:[];a.forEach((e=>{(null==d?void 0:d.valueKey)&&d.valueKey!==n&&(e[n]=e[d.valueKey]),(null==d?void 0:d.textKey)&&d.textKey!==l&&(e[l]=e[d.textKey])})),a=a.filter((e=>u.includes(e[n])));const r=a.map((e=>({value:e[n],text:e[l]})));this.setRecords(a),this.setItemList(r),this.setViewValue(u)}}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,t,l;const{$$form:n}=this.context,{visible:a,visible2:r,loading:i,itemList:o}=this.state,{value:d}=this.props,{fieldName:u,options:c={},searchHelper:f={},style:p={},placeholder:h=Se("qm.form.selectPlaceholder"),bordered:v=!0,allowClear:y=!0,readOnly:b,disabled:x}=this.props.option,{collapseTags:E,maxTagTextLength:C}=c,w={visible:a,title:Se("qm.searchHelper.text"),width:null!==(e=f.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${u}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[n.$size]+20}px`},onClose:()=>{this.setVisible(!1)}},S=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:n.$size,multiple:!0,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${u}`:"",initialValue:m.merge({},f.initialValue),defaultSelectedKeys:d,selectionRows:this._records,onClose:(e,t)=>{e?this.closeSearchHelper(e,t):this.setVisible(!1)}}),N=o.filter((e=>null==d?void 0:d.includes(e.value))),T=q.default.createElement("ul",{className:"ant-dropdown-menu"},N.length?N.map((e=>q.default.createElement("li",{key:e.value,className:"ant-dropdown-menu-item"},e.text))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},Se("qm.table.config.emptyText"))),I=this.searchRef.current?this.searchRef.current.offsetWidth:300,O=yt("form-multiple-tree-table-helper"),{size:R}=n.context,k={[O]:!0,[`${O}--lg`]:"large"===R,[`${O}--sm`]:"small"===R};null===(l=(t=this.props).setOmitClassNames)||void 0===l||l.call(t,[`.${O}`]);const L=o.filter((e=>null==d?void 0:d.includes(e.value))).map((e=>e.text)).join(",");return n.isOnlyShow?q.default.createElement(Dr,{value:L,bordered:v}):q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{className:"ant-input-group-wrapper ant-input-search search-helper-multiple"},q.default.createElement("span",{ref:this.searchRef,className:"ant-input-wrapper ant-input-group"},q.default.createElement(gs,{popupVisible:!x&&r,popup:T,popupClassName:J.default(k),popupStyle:{minWidth:I},onPopupVisibleChange:e=>this.setState({visible2:e}),builtinPlacements:nr,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement(s.Select,{mode:"multiple",maxTagCount:E?"responsive":void 0,maxTagTextLength:C,open:!1,value:d,placeholder:h,loading:i,bordered:v,allowClear:y,disabled:x,style:Object.assign({width:"100%"},p),title:L,onKeyUp:e=>{13===e.keyCode&&(e.preventDefault(),this.openSearchHelper())},onClick:e=>{var t,l;const n=e.target;n.classList.contains("ant-select-selection-overflow-item-rest")&&(null===(l=(t=this.props).setCurrentElement)||void 0===l||l.call(t,n),this.setState({visible2:!0}))},onDoubleClick:()=>{x||this.openSearchHelper()},onChange:e=>{this.triggerChange(e)}},o.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",{className:"ant-input-group-addon"},q.default.createElement(s.Button,{className:"ant-input-search-button",disabled:x,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>{this.openSearchHelper()}})))),q.default.createElement(Qn,w,q.default.createElement(Ju,S)))}};nc.contextType=Zn,nc=Ge([Uu],nc);class ac extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(nc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{h(t,n),e.setViewValue(r,l)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}ac.contextType=Zn;const rc="_startSign",ic="_endSign",oc=e=>{var t;const{uniqueKey:l,initialValue:n,filters:a=[],table:r={},onClose:i}=e,{$size:o}=Ze(e),{t:d}=Xe(),u=q.default.useRef(null),c=q.default.useRef(null),f=q.default.useRef(null),p=Cn(u),[h,v]=q.default.useState(r),[y,b]=q.default.useState(!1),[x,E]=q.default.useState([]),[C,w]=q.default.useState(300),[S,N]=q.default.useState(a),[T,I]=q.default.useState((e=>[{title:d("qm.searchHelper.orderIndex"),dataIndex:"pageIndex",width:80,render:e=>q.default.createElement("span",null,e+1)},{title:d("qm.form.rangeSearchHelper")[0],dataIndex:rc,width:80,align:"right",render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)},...e||(r.columns||[]),{title:d("qm.form.rangeSearchHelper")[1],dataIndex:ic,fixed:"right",width:80,render:(e,t)=>q.default.createElement("span",{className:"icon-sign"},e)}])()),[O,R]=q.default.useState(m.merge({},null===(t=r.fetch)||void 0===t?void 0:t.params,n)),[k,L]=q.default.useState([]),P=q.default.useMemo((()=>x.map((e=>null==e?void 0:e.pageIndex))),[x]),A=q.default.useMemo((()=>2===P.length&&P.every((e=>void 0!==e))),[P]),D=()=>{const e=u.current.parentNode.children[0],t=e.querySelector(".form-wrap");w(e.offsetHeight-t.offsetHeight-2*Yr[o]-30)},_=wn(D,5);Ie((()=>{_()}),[p.width]),Ql((()=>{m.isEqual(a,S)||N(a)}),[a]),q.default.useEffect((()=>{F()}),[O]);const F=()=>Ye(void 0,void 0,void 0,(function*(){var e;const{webPagination:t,fetch:l}=h;if(!t||!(null==l?void 0:l.api))return;const{api:n,dataKey:a,beforeFetch:r=nt}=l;if(r(O)){b(!0);try{const t=yield n(O);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[];L(l)}}catch(e){}b(!1)}})),H=(e,t)=>{delete e[t]},M=()=>{x.forEach((e=>{e&&(H(e,rc),H(e,ic))})),E([])},$=e=>{M(),R(Object.assign({},O,e))},j=yt("range-helper"),K=h.webPagination?{dataSource:k,loading:y,webPagination:!0}:{fetch:Object.assign(Object.assign({},h.fetch),{params:O})};return q.default.createElement("div",{ref:u,className:`${j}--wrapper`},q.default.createElement("div",{className:"form-wrap"},S.length?q.default.createElement(wf,{ref:c,items:S,initialValues:n,uniqueKey:l,formType:"search",isAutoFocus:!1,fieldsChange:e=>N(e),onCollapse:()=>D(),onFinish:e=>$(e),onReset:()=>Ye(void 0,void 0,void 0,(function*(){const[e,t]=yield c.current.GET_FORM_DATA();e||$(t)}))}):null),q.default.createElement("div",null,q.default.createElement(Ku,je({ref:f,height:C,columns:T,rowKey:h.rowKey||"pageIndex",rowStyle:e=>e.pageIndex>=P[0]&&e.pageIndex<=P[1]?{backgroundColor:"#f5f5f5"}:{}},K,{columnsChange:e=>I(e),onRowClick:(e,t)=>{const{dataIndex:l}=t;[rc,ic].includes(l)&&(l===rc&&(e[l]?(H(e,l),E([void 0,x[1]])):e.pageIndex>P[1]?s.message.warning(d("qm.searchHelper.rangeStartTip")):(x[0]&&H(x[0],l),e[l]="[",E([e,x[1]]))),l===ic&&(e[l]?(H(e,l),E([x[0],void 0])):e.pageIndex<P[0]?s.message.warning(d("qm.searchHelper.rangeEndTip")):(x[1]&&H(x[1],l),e[l]="]",E([x[0],e]))),f.current.FORCE_UPDATE())},onDataLoad:e=>{e.forEach((e=>{e.pageIndex===P[0]&&(e[rc]="["),e.pageIndex===P[1]&&(e[ic]="]")}))}}),q.default.createElement(ht,{type:"primary",icon:q.default.createElement(g.ClearOutlined,null),title:d("qm.table.alert.clear"),onClick:()=>M()}))),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,height:`${Yr[o]+20}px`,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right",boxSizing:"border-box"}},q.default.createElement(ht,{onClick:()=>i(null),style:{marginRight:8}},d("qm.dialog.cancel")),q.default.createElement(ht,{type:"primary",disabled:!A,onClick:()=>i(x.map((e=>(e=>{const t={};for(const l in e)[rc,ic].includes(l)||(t[l]=e[l]);return t})(e))))},d("qm.dialog.confirm"))))};oc.displayName="RangeTableHelper";const sc=new Array(2).fill("");class dc extends e.Component{constructor(e){super(e),this._is_change=!1,this._records=[],this._is_clear=!1,this.state={visible:!1,loading:!1,itemList:[],textValue:sc},this.getSearchHelper=oe.default((e=>Object.assign({},this.props.helperConfig,e))),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();this.searchHelper.fieldAliasMap||mt("Form","RANGE_SEARCH_HELPER 需要配置 `fieldAliasMap` 选项"),Object.keys(this.alias).includes("valueKey")&&Object.keys(this.alias).includes("textKey")||mt("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:l}=this.props;this._is_change=!1,null==t||t(e),l(e,this.createViewText(),this._records)},this.clearSearchHelperValue=()=>{this.setRecords([]),this.setTextValue(sc),this.triggerChange([])},this.closeSearchHelper=e=>{const{valueKey:t,textKey:l}=this.alias,n=e.map((e=>({value:e[t],text:e[l]})));this.setRecords(e),this.setItemList(n),this.setTextValue(n.map((e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}))),this.triggerChange(e.map((e=>e[t])));const{closed:a}=this.searchHelper;this.setVisible(!1,(()=>{setTimeout((()=>null==a?void 0:a(this._records)),200)}))},this.openSearchHelper=e=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{$$form:t}=this.context,{beforeOpen:l}=this.searchHelper,n=(null!=l?l:nt)(t.state.formData);(null==n?void 0:n.then)?n.then((()=>{this.setVisible(!0),null==e||e()})).catch((()=>{})):!1!==n&&(this.setVisible(!0),null==e||e())})),this.createFilters=e=>{const{fieldName:t}=this.props.option;return{[t]:ot(e)?void 0:e}},this.getSearchHelperTableData=e=>{const{table:t,initialValue:l={}}=this.searchHelper,{beforeFetch:n=nt,formatter:a=(e=>e)}=t.fetch;return new Promise(((r,i)=>Ye(this,void 0,void 0,(function*(){var o;const s=m.merge({},this.searchHelper.table.fetch.params,Object.assign(Object.assign({},l),a(this.createFilters(e))),{currentPage:1,pageSize:500});try{if(!n(s))return i();this.setState({loading:!0});const e=yield t.fetch.api(s);if(rt((()=>this.setState({loading:!1}))),200===e.code){const l=Array.isArray(e.data)?e.data:null!==(o=m.get(e.data,t.fetch.dataKey))&&void 0!==o?o:[];return r(l)}}catch(e){this.setState({loading:!1})}i()}))))},this.resetSearchHelperValue=(e=[])=>Ye(this,void 0,void 0,(function*(){const{textValue:t}=this.state,{textKey:l}=this.alias,n=e.filter((e=>{var n;const a=null===(n=e[l])||void 0===n?void 0:n.toString().toLowerCase();return t.some((e=>null==a?void 0:a.includes(e.toLowerCase())))}));if(2===n.length)return this.closeSearchHelper(n);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:l=[]}=this.props;m.isEqual(t,l)||m.isEqual(l,this._records.map((e=>e[this.alias.valueKey])))||this.getItemList();const{echo_data:n}=this.context,{fieldName:a}=this.props.option;if(!m.isEqual(n[a],this._ceho_data)&&(this._ceho_data=n[a],this.setItemList(n[a]),l.length)){const e=sc.map(((e,t)=>{var r,i;return null!==(i=null===(r=n[a].find((e=>e.value===l[t])))||void 0===r?void 0:r.text)&&void 0!==i?i:""}));this.setTextValue(e)}}getItemList(){var e;return Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{textKey:t,valueKey:l}=this.alias,{fetchApi:n,params:a={},formatter:r=(e=>e),dataKey:i,fieldAliasMap:o}=this.searchHelper.echoRequest||{},s="function"==typeof o?o():o||{},{value:d}=this.props;if(n){if(ot(d))return this.setRecords([]);this.setState({loading:!0});try{const o=yield n(r(Object.assign(Object.assign({},a),{keys:d})));if(200===o.code){let n=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,i))&&void 0!==e?e:[];n.forEach((e=>{(null==s?void 0:s.valueKey)&&s.valueKey!==l&&(e[l]=e[s.valueKey]),(null==s?void 0:s.textKey)&&s.textKey!==t&&(e[t]=e[s.textKey])})),n=n.filter((e=>d.includes(e[l]))).slice(0,2);const a=n.map((e=>({value:e[l],text:e[t]})));this.setRecords(n),this.setItemList(a),this.setTextValue(a.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:t}=this.context;this.props;const{visible:l,loading:n,textValue:a}=this.state,{fieldName:r,options:i={},searchHelper:o={},placeholder:d=Se("qm.form.rangeInputNumberPlaceholder"),bordered:u=!0,readOnly:c,disabled:f}=this.props.option,{onlySelect:p=!0}=this.searchHelper||o,h=a.every((e=>cr(e)))?"":a.join(" - "),g={visible:l,title:Se("qm.searchHelper.text"),width:null!==(e=o.width)&&void 0!==e?e:"65%",wrapClassName:`form-popper__${r}`,loading:!1,bodyStyle:{paddingBottom:`${Yr[t.$size]+20}px`},onClose:()=>{this.closeButNotSelect()}},v=Object.assign(Object.assign({},this.getDerivedSearchHelper()),{size:t.$size,uniqueKey:this.uniqueKey?`${this.uniqueKey}_${r}`:"",initialValue:m.merge({},o.initialValue),onClose:e=>{e?this.closeSearchHelper(e):this.closeButNotSelect()}});return t.isOnlyShow?q.default.createElement(Dr,{value:h,bordered:u}):q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Input.Group,null,q.default.createElement(s.Input,{value:a[0],className:"site-input-left",style:{width:"calc(50% - 5px)"},placeholder:d[0],allowClear:!1,bordered:u,readOnly:c,disabled:f,onBlur:e=>{var t,n;const{value:r}=e.target;this._is_change&&!l&&(r?a.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(a).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):a.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;p||(this._is_change=!0,this.setTextValue([t,a[1]]))}}),q.default.createElement(s.Input,{className:"site-input-split",style:{width:10,paddingLeft:0,paddingRight:0,borderLeft:0,borderRight:0,textAlign:"center",pointerEvents:"none"},placeholder:"~",bordered:u,disabled:f,readOnly:!0}),q.default.createElement(s.Input.Search,{value:a[1],className:"site-input-right",style:{width:"calc(50% - 5px)"},placeholder:d[1],loading:n,bordered:u,allowClear:!0,readOnly:c,disabled:f,onBlur:e=>{var t,n;const{value:r}=e.target;this._is_change&&!l&&(r?a.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(a).then((e=>this.resetSearchHelperValue(e))).catch((()=>this.clearSearchHelperValue())):a.every((e=>!e))&&this.clearSearchHelperValue())},onDoubleClick:()=>{this.openSearchHelper()},onChange:e=>{const{value:t}=e.target;this._is_clear?this._is_clear=!1:p||(this._is_change=!0,this.setTextValue([a[0],t]))},onSearch:(e,t)=>{"click"===(null==t?void 0:t.type)&&("INPUT"!==t.target.tagName?this.openSearchHelper():(this._is_clear=!0,this.clearSearchHelperValue()))}})),q.default.createElement(Qn,g,q.default.createElement(oc,v)))}}dc.contextType=Zn;class uc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("searchHelper","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi,!0);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,labelWidth:o=e.props.labelWidth,className:d,extra:u,buttonAfter:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(d),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(dc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t,l,n)=>{m(t,n),e.setViewValue(r,l)}}))),c&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,c)),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},u)))))}}uc.contextType=Zn;const cc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:d=!1,readOnly:u,disabled:c}=e.option,{itemList:f=[]}=i,p=ot(f)?n:f,m=e=>p.filter((t=>e.includes(t.value))).map((e=>e.text)).join(",");return t.isOnlyShow?q.default.createElement(Dr,{value:m(l),bordered:d}):q.default.createElement(s.Checkbox.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c,onChange:e=>{(e=>{null==a||a(e),r(e,m(e))})(e)}},p.map((e=>q.default.createElement(s.Checkbox,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class fc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]}}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}getItemList(){var e;return Ye(this,void 0,void 0,(function*(){const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l)try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=l.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}}))}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(cc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}fc.contextType=Zn;const pc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},style:i={},allowClear:o=!0,readOnly:d,disabled:u=t.isFormDisabled}=e.option,{allowHalf:c,count:f=5,tooltips:p}=r,m=e=>p?p[Math.ceil(e)-1]:e.toString();return q.default.createElement(s.Rate,{value:l,count:f,style:i,allowHalf:c,allowClear:o,tooltips:p,disabled:u||t.isOnlyShow,onChange:e=>{(e=>{null==n||n(e),a(e,m(e))})(e)}})};class mc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(pc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}mc.contextType=Zn;const hc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,items:n,onChange:a,onValuesChange:r}=e,{options:i={},style:o={},bordered:d=!1,readOnly:u,disabled:c=t.isFormDisabled}=e.option,{itemList:f=[]}=i,p=ot(f)?n:f,m=e=>{var t,l;return null!==(l=null===(t=p.find((t=>t.value===e)))||void 0===t?void 0:t.text)&&void 0!==l?l:""};return t.isOnlyShow?q.default.createElement(Dr,{value:m(l),bordered:d}):q.default.createElement(s.Radio.Group,{value:l,style:Object.assign({width:"100%"},o),disabled:c||t.isOnlyShow,onChange:e=>{const{value:t}=e.target;(e=>{null==a||a(e),r(e,m(e))})(t)}},p.map((e=>q.default.createElement(s.Radio,{key:e.value,value:e.value,disabled:e.disabled},e.text))))};class gc extends e.Component{constructor(){super(...arguments),this.state={itemList:[]},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l)try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=l.map((e=>({value:e[r],text:e[i]})));this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,validateTrigger:f,rules:p=[],onChange:m=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(p)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:p,validateTrigger:f,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(hc,{option:this.props.option,items:t,onValuesChange:(t,l)=>{m(t),e.setViewValue(r,l)}}))),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}gc.contextType=Zn;const vc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{label:r,options:i={},style:o={},readOnly:d,disabled:u=t.isFormDisabled}=e.option,{labelToSwitch:c,falseValue:f=er,trueValue:p=Ja}=i,{t:m}=Xe();return q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Switch,{checked:l===p,style:o,disabled:u||t.isOnlyShow,checkedChildren:q.default.createElement(g.CheckOutlined,null),unCheckedChildren:q.default.createElement(g.CloseOutlined,null),onChange:e=>{(e=>{null==n||n(e),a(e,m(e===p?"am.form.trueText":"am.form.falseText"))})(e?p:f)}}),c?q.default.createElement("span",{style:{verticalAlign:"middle",marginLeft:8}},r):null)};class yc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option,{labelToSwitch:m}=i;return q.default.createElement(s.Form.Item,{label:m?" ":e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(vc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}yc.contextType=Zn;const bc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{options:i={},style:o={},placeholder:d=r("qm.form.inputPlaceholder"),bordered:u=!0,allowClear:c,readOnly:f,disabled:p,onFocus:m,onBlur:h,onEnter:g}=e.option,{showCount:v,maxLength:y,autoSize:b}=i,x=Object.assign({},{minRows:1,maxRows:3},b);return q.default.createElement(s.Input.TextArea,{value:l,placeholder:d,style:o,maxLength:y,showCount:v,autoSize:x,bordered:u,allowClear:c,readOnly:f||t.isOnlyShow,disabled:p,onFocus:e=>{null==m||m(e.target.value,e)},onBlur:t=>{const{value:l}=t.target;(t=>{const{onBlur:l}=e;null==l||l(t)})(l),null==h||h(l,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==n||n(e),a(e)})(t)}})};class xc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(bc,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}xc.contextType=Zn;const Ec=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:d={},placeholder:u=r("qm.form.datePlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:m}=e.option,{dateType:h="date",format:g,disabledDate:v,minDateTime:y,maxDateTime:b,shortCuts:x=!0}=o,E=q.default.createRef(),C=e=>{e&&"date"===h&&(e=e.slice(0,10)+" 00:00:00"),null==n||n(e),a(e,w(e))},w=e=>cr(e)?"":["date","exactdate"].includes(h)?e.slice(0,10):e,S=e=>{let t=ur(j.default().subtract(e,"day"),rr[h]);"date"===h&&(t=t.slice(0,10)),C(t),E.current.blur(),E.current.focus()};return t.isOnlyShow?q.default.createElement(Dr,{value:w(l),bordered:c}):q.default.createElement(qe,{ref:E,style:Object.assign({width:"100%"},d),popupClassName:`form-popper__${i}`,picker:ar[h],format:g,bordered:c,showToday:!1,showTime:"datetime"===h&&{defaultValue:j.default("00:00:00","HH:mm:ss")},allowClear:f,disabled:m,inputReadOnly:p,disabledDate:null!=v?v:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[y,b]),renderExtraFooter:x&&h.includes("date")?()=>"function"==typeof x?x():q.default.createElement(q.default.Fragment,null,q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(0)},r("qm.form.datePickers")[0]),q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(1)},r("qm.form.datePickers")[1]),q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(7)},r("qm.form.datePickers")[2]),q.default.createElement(s.Tag,{color:"processing",onClick:()=>S(30)},r("qm.form.datePickers")[3])):void 0,value:dr(l,rr[h]),onChange:(e,t)=>{C(ur(e,rr[h]))}})};class Cc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ec,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Cc.contextType=Zn;const wc=e=>[j.default().subtract(e,"day"),j.default()],Sc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.daterangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{dateType:m="date",format:h,disableds:g=[!1,!1],allowEmpty:v,disabledDate:y,minDateTime:b,maxDateTime:x,shortCuts:E=!0}=o,C={[r("qm.form.dateRangePickers")[0]]:wc(7),[r("qm.form.dateRangePickers")[1]]:wc(30),[r("qm.form.dateRangePickers")[2]]:wc(90),[r("qm.form.dateRangePickers")[3]]:wc(180)},w=e=>cr(e)?"":e.map((e=>["date","exactdate"].includes(m)?null==e?void 0:e.slice(0,10):e)).join(" - ");return t.isOnlyShow?q.default.createElement(Dr,{value:w(l),bordered:u}):q.default.createElement(qe.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,picker:ar[m],format:h,bordered:u,showTime:"datetime"===m&&{defaultValue:[j.default("00:00:00","HH:mm:ss"),j.default("23:59:59","HH:mm:ss")]},allowClear:c,allowEmpty:v,disabled:p?[!0,!0]:g,inputReadOnly:f,disabledDate:null!=y?y:e=>((e,[t,l])=>t&&l?e.isBefore(t,"day")||e.isAfter(l,"day"):t?e.isBefore(t,"day"):!!l&&e.isAfter(l,"day"))(e,[b,x]),ranges:E&&m.includes("date")?C:void 0,value:ot(l)?null:[dr(null==l?void 0:l[0],rr[m]),dr(null==l?void 0:l[1],rr[m])],onChange:(e,t)=>{(e=>{"date"===m&&(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==n||n(e),a(e,w(e))})([ur(null==e?void 0:e[0],rr[m]),ur(null==e?void 0:e[1],rr[m])])}})};class Nc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Sc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Nc.contextType=Zn;const Tc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p}=e.option,{timeType:m="hour-minute-second",hourStep:h=1,minuteStep:g=1,secondStep:v=1}=o;return t.isOnlyShow?q.default.createElement(Dr,{value:l,bordered:u}):q.default.createElement(Ke,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!0,hourStep:h,minuteStep:g,secondStep:v,allowClear:c,disabled:p,inputReadOnly:f,format:ir[m],value:dr(l,ir[m]),onChange:(e,t)=>{(e=>{const t=ur(e,ir[m]);null==n||n(t),a(t)})(e)}})};class Ic extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Tc,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Ic.contextType=Zn;const Oc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:s={},placeholder:d=r("qm.form.timerangePlaceholder"),bordered:u=!0,allowClear:c=!0,readOnly:f,disabled:p=t.isFormDisabled}=e.option,{timeType:m="hour-minute-second",disableds:h=[!1,!1],allowEmpty:g,hourStep:v=1,minuteStep:y=1,secondStep:b=1}=o,x=e=>cr(e)?"":e.join(" - ");return t.isOnlyShow?q.default.createElement(Dr,{value:x(l),bordered:u}):q.default.createElement(Ke.RangePicker,{style:Object.assign({width:"100%"},s),popupClassName:`form-popper__${i}`,bordered:u,showNow:!1,hourStep:v,minuteStep:y,secondStep:b,allowClear:c,allowEmpty:g,disabled:p?[!0,!0]:h,inputReadOnly:f,format:ir[m],value:ot(l)?null:[dr(null==l?void 0:l[0],ir[m]),dr(null==l?void 0:l[1],ir[m])],onChange:(e,t)=>{(e=>{const t=[ur(null==e?void 0:e[0],ir[m]),ur(null==e?void 0:e[1],ir[m])];null==n||n(t),a(t,x(t))})(e)}})};class Rc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Oc,{option:this.props.option,onValuesChange:(t,l)=>{p(t),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Rc.contextType=Zn;class kc extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this._clicking=!1,this._prevValue=null,this.state={itemList:[],visible:!1,loading:!1,activeIndex:0,inputText:void 0},this.getSearchHelper=oe.default(((e,t)=>Object.assign({},this.props.helperConfig,e,t))),this.paramsChangeHandler=(e,t)=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting(),m.isEqual(e,t)||this.getItemList()})),this.echoSearchHelper=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const e=this.getItemValue();e!==this._prevValue&&(this.getItemText(),this._prevValue=e)})),this.initialHandle=()=>Ye(this,void 0,void 0,(function*(){yield this.props.waiting();const{fieldName:e,options:t,searchHelper:l}=this.props.option,{fieldAliasMap:n,fieldsDefine:a,echoRequest:r}=this.searchHelper;if(n||mt("Form","IMMEDIATE 需要配置 `fieldAliasMap` 选项"),a){const e=["valueKey","displayKey","extraKey"];for(const t in a)e.includes(t)&&(this[t]=a[t])}Object.keys(this.alias).includes(e)||mt("Form","IMMEDIATE 的 fieldAliasMap 选项必须包含自身 `fieldName` 值"),r&&!this.valueKey&&mt("Form","IMMEDIATE 的 echoRequest 选项必须组合 `fieldsDefine` 中的 `valueKey` 一起使用"),t&&!l&&mt("Form","IMMEDIATE 的 `options` 选项即将在下一个大版本中废弃,请使用 `searchHelper` 参数")})),this.getItemValue=()=>this.context.$$form.GET_FIELDS_VALUE([this.valueKey])[this.valueKey],this.getItemText=()=>Ye(this,void 0,void 0,(function*(){var e;const{fetchApi:t,params:l={},formatter:n=(e=>e),dataKey:a,callback:r,triggeredChange:i,fieldAliasMap:o,extraAliasMap:s}=this.searchHelper.echoRequest||{},d="function"==typeof o?o():o||{},u="function"==typeof s?s():s||{},c=this.getItemValue();if(t&&!ot(c))try{const o=yield t(n(Object.assign(Object.assign({},l),{key:c})));if(200===o.code){const t=Array.isArray(o.data)?o.data:null!==(e=m.get(o.data,a))&&void 0!==e?e:[];if(t[0]){const e=t[0];if(d&&pr(e,this.alias,d),u&&mr(e,this.extras,u),this._record=e,this.setFieldsValue(e),i){const t=fr(e,this.alias[this.props.option.fieldName]);this.triggerChange(t)}null==r||r([e])}}}catch(e){}})),this.setFieldsValue=e=>{const{$$form:t}=this.context,{fieldName:l}=this.props.option;this._record=e;for(const n in this.alias){const a=fr(e,this.alias[n]);t.SET_FIELDS_VALUE({[n]:a}),n===this.valueKey&&(this._prevValue=a),n===l&&t.setViewValue(l,a)}for(const l in this.extras)t.SET_FIELDS_EXTRA({[l]:fr(e,this.extras[l])})},this.fetchHandle=m.debounce(this.getItemList,200),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this._record)},this.triggerBlur=e=>{const{onBlur:t}=this.props;null==t||t(e)},this.clickHandle=(e,t)=>{const{$$form:l}=this.context,{fieldName:n}=this.props.option;for(const t in this.alias){if(t===n)continue;const a=fr(e,this.alias[t]);l.SET_FIELDS_VALUE({[t]:a}),t===this.valueKey&&(this._prevValue=e?a:null)}for(const t in this.extras)l.SET_FIELDS_EXTRA({[t]:fr(e,this.extras[t])});this.searchRef.current.focus({cursor:"end"}),this._record=e;const a=fr(e,this.alias[n]);this.triggerChange(a),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,l,n,a,r,i;const o=(null===(l=null===(t=e.option.searchHelper)||void 0===t?void 0:t.request)||void 0===l?void 0:l.params)||(null===(n=e.option.request)||void 0===n?void 0:n.params),s=(null===(r=null===(a=this.props.option.searchHelper)||void 0===a?void 0:a.request)||void 0===r?void 0:r.params)||(null===(i=this.props.option.request)||void 0===i?void 0:i.params);this.paramsChangeHandler(s,o),this.echoSearchHelper()}getItemList(e){var t;return Ye(this,void 0,void 0,(function*(){const{fieldName:l}=this.props.option,{fetchApi:n,params:a={},formatter:r=(e=>e),dataKey:i}=this.searchHelper.request||this.props.option.request||{};if(n){this.setState({loading:!0});try{const o=yield n(r(Object.assign(Object.assign({},a),{[l]:e})));if(200===o.code){const e=Array.isArray(o.data)?o.data:null!==(t=m.get(o.data,i))&&void 0!==t?t:[];this.setState({itemList:e,activeIndex:0})}}catch(e){}this.setState({loading:!1})}}))}render(){const{$$form:e}=this.context,{visible:t,loading:l,itemList:n,inputText:a}=this.state,{value:r}=this.props,{fieldName:i,options:o={},style:d={},placeholder:u=Se("qm.form.inputPlaceholder"),bordered:c=!0,allowClear:f=!0,readOnly:p,disabled:h}=this.props.option,{listHeight:g=tr}=o,{hideHeader:v,onlySelect:y=!0}=this.searchHelper||o,b=this.searchHelper.columns||[],x=yt("form-immediate"),E=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,C=q.default.createElement(s.Spin,{spinning:l},n.length?q.default.createElement("table",{cellSpacing:0,cellPadding:0,className:J.default("table")},!v&&q.default.createElement("thead",null,q.default.createElement("tr",null,b.filter((e=>!e.hidden)).map((e=>q.default.createElement("th",{key:e.dataIndex,style:{width:`${e.width}px`,backgroundColor:"#f0f0f0"}},e.title))))),q.default.createElement("tbody",null,n.map(((e,t)=>q.default.createElement("tr",{key:t,className:this.state.activeIndex===t?"active":"",onMouseEnter:()=>{this.setState({activeIndex:t})},onMouseDown:()=>{this._clicking=!0},onMouseUp:()=>{this._clicking=!1},onClick:()=>{this.clickHandle(e,(()=>this.handleVisibleChange(!1)))}},b.filter((e=>!e.hidden)).map((t=>q.default.createElement("td",{key:t.dataIndex},m.get(e,t.dataIndex))))))))):q.default.createElement(hn,null));return q.default.createElement(xe.Consumer,null,(l=>{const o={[x]:!0,[`${x}--lg`]:"large"===(null==l?void 0:l.size),[`${x}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Dr,{value:r,bordered:c}):q.default.createElement(gs,{action:h?[]:["click"],popupVisible:!h&&t,popup:C,popupClassName:J.default(o,`form-popper__${i}`),popupStyle:{minWidth:E,maxHeight:g},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:nr,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(s.Input,{ref:this.searchRef,placeholder:u,allowClear:f,bordered:c,readOnly:p,disabled:h,style:Object.assign({width:"100%"},d),value:null!=a?a:r,title:r,onFocus:()=>{!n.length&&this.fetchHandle(r)},onBlur:e=>{y&&!this._clicking&&a!==r&&this.setState({inputText:void 0}),this.triggerBlur(e.target.value)},onKeyDown:e=>{if(27===e.keyCode&&this.handleVisibleChange(!1),13===e.keyCode&&this.clickHandle(n[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 l=40===e.keyCode?++t%n.length:(--t+n.length)%n.length;this.setState({activeIndex:l})}},onChange:e=>{const{value:t}=e.target;this.fetchHandle(t),y?this.setState({inputText:t}):t&&this.triggerChange(t),t?this.handleVisibleChange(!0):this.clickHandle(null)}})))}))}}kc.contextType=Zn;class Lc extends e.Component{constructor(e,{$$form:t}){super(e),this.state={searchHelper:{}},this.waiting=()=>Ye(this,void 0,void 0,(function*(){try{yield this.promiseRef}catch(e){pt("Form","搜索帮助获取定义信息的接口出错")}})),this.getHelperConfig=e=>{var t,l;const{global:n}=e,{name:a,fieldsDefine:r}=this.props.option.searchHelper||{};if(!a)return;if(!(null===(t=null==n?void 0:n.searchHelper)||void 0===t?void 0:t.getServerConfig)||!(null===(l=null==n?void 0:n.searchHelper)||void 0===l?void 0:l.createFetchApi))return mt("immediate","从服务端获取定义信息的时候,ConfigProvider 组件 `getServerConfig` 和 `createFetchApi` 为必选参数");const{fieldName:i}=this.props.option;this.promiseRef=new Promise(((e,t)=>Ye(this,void 0,void 0,(function*(){try{const l=yield n.searchHelper.getServerConfig({searchHelperId:a});if(200===l.code){const t=xr(Object.assign({},l.data,r),i,n.searchHelper.createFetchApi);this.setState({searchHelper:t},(()=>e()))}else t()}catch(e){t()}}))))},this.getHelperConfig(t.context)}render(){const{$$form:e}=this.context,{searchHelper:t}=this.state,{type:l,label:n,tooltip:a,fieldName:r,invisible:i,options:o={},labelWidth:d=e.props.labelWidth,className:u,extra:c,buttonAfter:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(n),className:J.default(u),tooltip:a,hidden:i,labelCol:{flex:e.verticalLayout?"initial":ct(d)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:r,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(n)}},q.default.createElement(kc,{option:this.props.option,helperConfig:t,waiting:this.waiting,onValuesChange:(t="",l)=>{h(t,l),e.setViewValue(r,t)}}))),f&&q.default.createElement(s.Col,null,e.renderFormItemButton(r,f)),c&&q.default.createElement(s.Col,{flex:ct(c.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:r},c)))))}}Lc.contextType=Zn;class Pc extends e.Component{render(){var e;const{$$form:t}=this.context,{type:l,label:n,fieldName:a,className:r,style:i={},collapse:o={}}=this.props.option,{expand:d}=t.state,{showLimit:u,remarkItems:c=[],onCollapse:f=lt}=o,p=[];if(c.length){const l=null!==(e=t.getBlockDerivedItems().find((e=>e[0].fieldName===a)))&&void 0!==e?e:[],n=null!=u?u:l.length-1;l.slice(n+1).forEach((e=>{var l;const n=c.find((t=>t.fieldName===e.fieldName));if(!n)return;const a=n.showLabel?`${e.label}:`:"",r=null!==(l=t.getViewValue(e.fieldName))&&void 0!==l?l:"";""!==r&&p.push(Object.assign(Object.assign({},e),{text:`${a}${r}`}))}))}return q.default.createElement(s.Form.Item,{labelCol:{span:0},wrapperCol:{span:24}},q.default.createElement(bt,{id:a,label:n,className:r,extra:p.map((e=>e.text)).join(" | "),style:Object.assign({},i),collapse:d[a],onCollapseChange:e=>{t.setState((t=>({expand:Object.assign({},t.expand,{[a]:e})}))),f(e)}}))}}Pc.contextType=Zn;const Ac=(e,t,l,n)=>e.map((e=>e[l]===t?Object.assign(Object.assign({},e),{children:n}):e.children?Object.assign(Object.assign({},e),{children:Ac(e.children,t,l,n)}):e)),Dc=e=>{var t;const{$$form:l}=q.default.useContext(Zn),{value:n,items:a,multiple:r,loading:i,onChange:o,onValuesChange:d}=e,{t:u}=Xe(),{fieldName:c,options:f={},style:p={},placeholder:h=u("qm.form.selectPlaceholder"),bordered:g=!0,allowClear:v=!0,asyncLoad:y,readOnly:b,disabled:x}=e.option,{itemList:E,filterable:C=!0,listHeight:w=tr,checkStrictly:S,checkStrategy:N="SHOW_CHILD",collapseTags:T,echoRequest:I,defaultExpandAll:O=!y,defaultExpandedKeys:R,dropdownStyle:k,openPyt:L=!0}=f,[P,A]=q.default.useState(ot(E)?a:E),[D,_]=q.default.useState([]),[F,H]=q.default.useState(!1),[M,$]=q.default.useState(!1),j=q.default.useRef(null),K=q.default.useRef(null),V=q.default.useRef(P),z=q.default.useRef(M),W=q.default.useRef(null),B=e=>{$(e),z.current=e};Ad({ref:K,handler:()=>B(!1)}),q.default.useEffect((()=>{n!==W.current&&(Y(),W.current=n),(()=>{var e;K.current=(null===(e=j.current)||void 0===e?void 0:e.querySelector(".ant-select-selection-overflow-item-rest"))||null})()}),[n]),Ql((()=>{const e=ot(E)?a:E;y?m.isEqual(e,V.current)||(A((t=>[...e,...t.filter((e=>!!e.style))])),V.current=e):A(e)}),[E,a]),Ql((()=>{A((e=>[...e,...D.filter((t=>!e.some((e=>e.value===t.value))))]))}),[D]);const U=e=>{var t;return(null===(t=gr(P,e))||void 0===t?void 0:t.text)||(null==e?void 0:e.toString())||""},G=e=>(S&&Array.isArray(n)&&n.every((e=>m.isPlainObject(e)))&&(e=e.map((e=>e.value))),r?(null==e?void 0:e.map((e=>U(e))).join(","))||"":U(e)),Y=()=>Ye(void 0,void 0,void 0,(function*(){var e;if(!I)return;if(!y)return mt("Form","TREE_SELECT 的 echoRequest 选项必须组合 `asyncLoad` 一起使用");const{fetchApi:t,params:l,dataKey:a,callback:r,formatter:i=(e=>e)}=I||{},{textKey:o="text",valueKey:s="value"}=y;if(t&&!ot(n))try{const d=yield t(i(Object.assign(Object.assign({},l),{[s]:n})));if(200===d.code){const t=Array.isArray(d.data)?d.data:null!==(e=m.get(d.data,a))&&void 0!==e?e:[];if(t.length){const e=hr(t,s,o);_(e.map((e=>Object.assign(Object.assign({},e),{style:{display:"none"}})))),null==r||r(t)}}}catch(e){}}));return l.isOnlyShow?q.default.createElement(Dr,{value:G(n),bordered:g}):q.default.createElement(gs,{popupVisible:!x&&M,popup:(()=>{if(!r)return null;const e=(null==n?void 0:n.map((e=>U(e))))||[];return q.default.createElement("ul",{className:"ant-dropdown-menu"},e.length?e.map(((e,t)=>q.default.createElement("li",{key:`${e}-${t}`,className:"ant-dropdown-menu-item"},e))):q.default.createElement("li",{className:"ant-dropdown-menu-item"},u("qm.table.config.emptyText")))})(),popupStyle:{minWidth:null===(t=j.current)||void 0===t?void 0:t.offsetWidth},onPopupVisibleChange:e=>B(e),builtinPlacements:nr,prefixCls:"ant-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",{ref:j,style:{width:"100%"}},q.default.createElement(s.TreeSelect,je({open:F,fieldNames:{label:"text",value:"value",children:"children"},value:n,multiple:r,treeCheckable:r,treeCheckStrictly:S,showCheckedStrategy:s.TreeSelect[N],popupClassName:`form-popper__${c}`,dropdownStyle:k,placeholder:h,listHeight:w,style:p,loading:i,bordered:g,allowClear:v,disabled:x,treeDefaultExpandAll:O,treeDefaultExpandedKeys:R,showSearch:C,maxTagCount:T?"responsive":void 0,loadData:y?({key:e,children:t})=>Ye(void 0,void 0,void 0,(function*(){var l;if(!y||t)return;const{fetchApi:n,params:a,dataKey:r,textKey:i="text",valueKey:o="value",callback:s,formatter:d=(e=>e)}=y;if(n)try{const t=yield n(d(Object.assign(Object.assign({},a),{[o]:e})));if(200===t.code){const n=Array.isArray(t.data)?t.data:null!==(l=m.get(t.data,r))&&void 0!==l?l:[],a=Ac(P,e,o,hr(n,o,i));A(a),null==s||s(n)}}catch(e){}})):void 0,treeData:P},r?{title:G(n)}:null,{filterTreeNode:(e,t)=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(L?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0},onMouseDown:e=>{e.target.classList.contains("ant-select-selection-overflow-item-rest")&&(B(!0),H(!1))},onDropdownVisibleChange:e=>{if(!e)return H(e);rt((()=>{z.current||H(e)}))},onChange:e=>{(e=>{null==o||o(e),d(e,G(e),P)})(e),W.current=e}}))))};class _c extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l){this.setState({loading:!0});try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=hr(l,r,i);this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{itemList:t,loading:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:d={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":ct(u)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(Dc,{option:this.props.option,items:t,loading:l,multiple:this.props.multiple,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(s.Col,{flex:ct(f.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}_c.contextType=Zn;const Fc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,multiple:n,items:a}=e,{t:r}=Xe(),{fieldName:i,options:o={},style:d={},placeholder:u=r("qm.form.selectPlaceholder"),bordered:c=!0,allowClear:f=!0,asyncLoad:p,readOnly:h,disabled:g}=e.option,{itemList:v,changeOnSelect:y,checkStrictly:b,checkStrategy:x="SHOW_PARENT",filterable:E=!0,dropdownStyle:C,openPyt:w=!0}=o,[S,N]=q.default.useState(ot(v)?a:v),T=q.default.useRef(S);Ql((()=>{const e=ot(v)?a:v;p?m.isEqual(e,T.current)||(N(e),T.current=e):N(e)}),[v,a]);const I=e=>vr(S,null!=e?e:"").map((e=>e.text)).join("/"),O=e=>n?(null==e?void 0:e.map((e=>I(e))).join(","))||"":I(e);return t.isOnlyShow?q.default.createElement(Dr,{value:O(l),bordered:c}):q.default.createElement(s.Cascader,je({value:(e=>ot(e)?[]:n?e.map((e=>e.split(","))):e.split(","))(l),fieldNames:{label:"text",value:"value",children:"children"},options:S,multiple:n,maxTagCount:"responsive",changeOnSelect:y||b,showCheckedStrategy:s.Cascader[x],popupClassName:`form-popper__${i}`,dropdownStyle:C,placeholder:u,style:d,bordered:c,allowClear:f,disabled:g,showSearch:E&&!p&&{filter:(e,t)=>t.some((t=>{var l;const n=(null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.toString())||"",a=Pr.parse(n).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join("");return(w?`${n}|${a}`:n).toLowerCase().indexOf(e.toLowerCase())>=0}))},loadData:p?e=>Ye(void 0,void 0,void 0,(function*(){var t;const l=e[e.length-1];if(!p||l.children)return;const{fetchApi:n,params:a,dataKey:r,textKey:i="text",valueKey:o="value",callback:s,formatter:d=(e=>e)}=p;if(n)try{const e=yield n(d(Object.assign(Object.assign({},a),{[o]:l.value})));if(200===e.code){const n=Array.isArray(e.data)?e.data:null!==(t=m.get(e.data,r))&&void 0!==t?t:[],a=Ac(S,l.value,o,hr(n,o,i));N(a),null==s||s(n)}}catch(e){}})):void 0},n?{title:O(l)}:null,{onChange:t=>{(t=>{const{onChange:l,onValuesChange:n}=e;null==l||l(t),n(t,O(t),S)})(((e=[])=>n?e.map((e=>e.join(","))):e.join(","))(t))}}))};class Hc extends e.Component{constructor(){super(...arguments),this.state={itemList:[],loading:!1},this.getItemList=()=>Ye(this,void 0,void 0,(function*(){var e;const{request:t={}}=this.props.option,{fetchApi:l,params:n={},dataKey:a,valueKey:r="value",textKey:i="text",callback:o}=t;if(l){this.setState({loading:!0});try{const t=yield l(n);if(200===t.code){const l=Array.isArray(t.data)?t.data:null!==(e=m.get(t.data,a))&&void 0!==e?e:[],n=hr(l,r,i);this.setState({itemList:n},(()=>null==o?void 0:o(l)))}}catch(e){}this.setState({loading:!1})}}))}componentDidMount(){this.getItemList()}componentWillUnmount(){this.setState=()=>!1}componentDidUpdate(e){var t,l;const n=null===(t=e.option.request)||void 0===t?void 0:t.params,a=null===(l=this.props.option.request)||void 0===l?void 0:l.params;m.isEqual(n,a)||this.getItemList()}render(){const{$$form:e}=this.context,{multiple:t}=this.props,{itemList:l}=this.state,{type:n,label:a,tooltip:r,fieldName:i,invisible:o,options:d={},labelWidth:u=e.props.labelWidth,className:c,extra:f,validateTrigger:p,rules:m=[],onChange:h=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(a),className:J.default(c),tooltip:r,hidden:o,labelCol:{flex:e.verticalLayout?"initial":ct(u)},required:e.getFormItemRequired(m)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:i,noStyle:!0,rules:m,validateTrigger:p,messageVariables:{label:e.getFormItemLabel(a)}},q.default.createElement(Fc,{option:this.props.option,multiple:t,items:l,onValuesChange:(t,l,n)=>{h(t,l,n),e.setViewValue(i,l)}}))),f&&q.default.createElement(s.Col,{flex:ct(f.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:i},f)))))}}Hc.contextType=Zn;const Mc=["110000","120000","310000","500000"],$c=["810000","820000"],qc=[{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"}],jc=[{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"}],Kc=e=>Pr.parse(e).map((e=>2===e.type?e.target.toLowerCase().slice(0,1):e.target)).join(""),Vc=(e,t,l=1)=>{if(l>2||!e[t])return;return("86"===t?Object.keys(e[t]).filter((e=>![...Mc,...$c].includes(e))):Object.keys(e[t])).map((n=>({l:Kc(e[t][n].slice(0,1)).toUpperCase(),n:e[t][n],c:n,p:t,children:Vc(e,n,l+1)})))},zc=(e,t)=>t.map((t=>({l:Kc(e[86][t].slice(0,1)).toUpperCase(),n:e[86][t],c:t,p:"86",children:void 0})));class Wc extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.scrollRef=q.default.createRef(),this.state={visible:!1,select_type:"0",active_key:""},this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(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}),re.default(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:zc(ve.default,Mc)},{l:"Z2",n:"港澳",c:"",p:"",children:zc(ve.default,$c)}]}createProvince(){var e;return(null!==(e=Vc(ve.default,"86"))&&void 0!==e?e:[]).concat(this.zxsAndGa)}createAllCity(){const e=[];return this.provinces.forEach((t=>e.push(...t.children))),e}createCity(){return jc.filter((e=>"Z1"!==e.value&&"Z2"!==e.value)).map((e=>({l:e.value,n:e.text,c:"",p:"",children:this.allCities.filter((e=>![...Mc,...$c].includes(e.c))).filter((t=>t.l===e.value))}))).concat(this.zxsAndGa)}renderType(){const{select_type:e}=this.state;return q.default.createElement(s.Radio.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}))}},q.default.createElement(s.Radio.Button,{value:"0"},Se("qm.form.citySelectType.0")),q.default.createElement(s.Radio.Button,{value:"1"},Se("qm.form.citySelectType.1")))}renderLetter(){const{active_key:e,select_type:t}=this.state;return("0"===t?qc:jc).map((t=>q.default.createElement("li",{key:t.value,className:J.default({tag:!0,actived:t.value===e}),onClick:()=>this.scrollHandle(t.value.toString())},t.text)))}renderSelect(){const{value:e}=this.props;return q.default.createElement(s.Select,{size:"small",placeholder:Se("qm.form.selectPlaceholder"),style:{width:"200px"},showSearch:!0,filterOption:(e,t)=>{var l;return((null===(l=null==t?void 0:t.children)||void 0===l?void 0:l.toString())||"").toLowerCase().indexOf(e.toLowerCase())>=0},value:e||void 0,onChange:e=>{this.triggerChange(e)}},this.allCities.map((e=>q.default.createElement(s.Select.Option,{key:e.c,value:e.c},e.n))))}renderCity(e){const{select_type:t}=this.state;return("0"===t?this.provinces:this.letterCities).map(((t,l)=>{var n;return q.default.createElement("div",{key:l},q.default.createElement("dt",{ref:e=>this[`${t.l}Ref`]=e},t.n,":"),q.default.createElement("dd",null,null===(n=t.children)||void 0===n?void 0:n.map((t=>q.default.createElement("li",{key:t.c,className:J.default({actived:t.c===e}),onClick:()=>this.clickHadnle(t.c)},t.n)))))}))}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:d=!0,readOnly:u,disabled:c}=this.props.option,f=yt("form-city-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=this.createTextValue(l),h=q.default.createElement("div",{className:"container",style:Object.assign({},r)},q.default.createElement("div",{className:"city-drop"},q.default.createElement("div",{className:"city-drop-toper"},q.default.createElement("div",{className:"city-drop-toper__type"},this.renderType()),q.default.createElement("div",{className:"city-drop-toper__search"},this.renderSelect())),q.default.createElement("div",{className:"city-drop-letter"},this.renderLetter()),q.default.createElement("div",{ref:this.scrollRef,className:"city-drop-list"},q.default.createElement("dl",null,this.renderCity(l)))));return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Dr,{value:m,bordered:o}):q.default.createElement(gs,{action:c?[]:["click"],popupVisible:!c&&t,popup:h,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:nr,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(s.Input,{ref:this.searchRef,placeholder:i,allowClear:d,bordered:o,readOnly:u,disabled:c,style:Object.assign({width:"100%"},r),value:m,title:m,onChange:e=>{const{value:t}=e.target;this.triggerChange(t)}})))}))}}Wc.contextType=Zn;class Bc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Wc,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Bc.contextType=Zn;const Uc=(e,t)=>{if(e[t])return Object.keys(e[t]).map((l=>({text:e[t][l],value:l,children:Uc(e,l)})))};class Gc extends e.Component{constructor(e){super(e),this.searchRef=q.default.createRef(),this.handleVisibleChange=e=>{this.setState({visible:e})},this.triggerChange=e=>{const{onChange:t,onValuesChange:l}=this.props;null==t||t(e),l(e,this.createTextValue(e)),this.handleVisibleChange(!1)};const t=Uc(ve.default,"86")||[];this.state={results:t,visible:!1,values:[],tabs:[t.map((e=>({text:e.text,value:e.value})))],activeName:"0"}}componentDidMount(){this.initial(),this.setInputReadonly()}componentDidUpdate(e){const{value:t}=e,{value:l}=this.props;t!==l&&this.state.values.join(",")!==(null!=l?l:"")&&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 l,n;return null===(n=null===(l=this.state.tabs[t])||void 0===l?void 0:l.find((t=>t.value===e)))||void 0===n?void 0:n.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 l=this.state.tabs.slice(0,1);for(let n=0;n<t.length;n++){const a=gr(e,t[n]);if(a&&ot(a.children)){this.isFetch&&this.getStreetList(t[n]);break}Array.isArray(null==a?void 0:a.children)&&(l[n+1]=null==a?void 0:a.children.map((e=>({text:e.text,value:e.value}))))}this.setState({tabs:l})}getStreetList(e){var t;return Ye(this,void 0,void 0,(function*(){const{request:l={}}=this.props.option,{fetchApi:n,formatter:a=(e=>e),dataKey:r,valueKey:i="value",textKey:o="text"}=l;if(n)try{const l=yield n(a({code:e}));if(200===l.code){const e=Array.isArray(l.data)?l.data:null!==(t=m.get(l.data,r))&&void 0!==t?t:[];this.setState((t=>({tabs:[...t.tabs,e.map((e=>({text:e[o],value:e[i]})))]})))}}catch(e){}}))}renderTabs(){const{values:e}=this.state,t=this.state.tabs.map(((t,l)=>{var n;const a=(null===(n=t.find((t=>t.value===e[l])))||void 0===n?void 0:n.text)||`${Se("qm.form.selectPlaceholder").replace("...","")}(${Se("qm.form.regionSelectLabel")[l]})`;return q.default.createElement(Un.TabPane,{key:l.toString(),tab:a},q.default.createElement("div",{className:"region-box"},t.map((t=>q.default.createElement("span",{key:t.value,className:J.default({"region-box__item":!0,actived:e.includes(t.value.toString())}),title:t.text,onClick:()=>{let{values:e}=this.state;e[l]=t.value.toString(),e=e.slice(0,l+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(l+1>=t)return this.triggerChange(e.join(","));this.createTabs(),this.createActiveName(l+1)}))}},t.text)))))}));return t.length?q.default.createElement(Un,{size:"small",activeKey:this.state.activeName,onChange:e=>{this.createActiveName(e)}},t):q.default.createElement(hn,null)}render(){const{$$form:e}=this.context,{visible:t}=this.state,{value:l}=this.props,{fieldName:n,options:a={},style:r={},placeholder:i=Se("qm.form.selectPlaceholder"),bordered:o=!0,allowClear:d=!0,readOnly:u,disabled:c}=this.props.option,f=yt("form-region-select"),p=this.searchRef.current?this.searchRef.current.input.parentNode.offsetWidth:300,m=q.default.createElement("div",{className:"container"},this.renderTabs());let h=this.prevText;if(!t){const e=this.createTextValue(l);(""===e||e.split("/").every((e=>""!==e)))&&(h=e,this.prevText=h)}return q.default.createElement(xe.Consumer,null,(l=>{const a={[f]:!0,[`${f}--lg`]:"large"===(null==l?void 0:l.size),[`${f}--sm`]:"small"===(null==l?void 0:l.size)};return e.isOnlyShow?q.default.createElement(Dr,{value:h,bordered:o}):q.default.createElement(gs,{action:c?[]:["click"],popupVisible:!c&&t,popup:m,popupClassName:J.default(a,`form-popper__${n}`),popupStyle:{minWidth:p},onPopupVisibleChange:this.handleVisibleChange,builtinPlacements:nr,prefixCls:"ant-select-dropdown",popupPlacement:"bottomLeft",popupTransitionName:"ant-slide-up"},q.default.createElement("div",null,q.default.createElement(s.Input,{ref:this.searchRef,placeholder:i,allowClear:d,bordered:o,style:Object.assign({width:"100%"},r),readOnly:u,disabled:c,value:h,title:h,onChange:e=>{const{value:t}=e.target;this.triggerChange(t),!t&&rt((()=>this.initial()))}})))}))}}Gc.contextType=Zn;class Yc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Gc,{option:this.props.option,onValuesChange:(t,l)=>{p(t,l),e.setViewValue(a,l)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Yc.contextType=Zn;const Xc=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i={},disabled:o,readOnly:d}=e.option,{multiple:u=!0,maxCount:c=1,fileTypes:f,fileSize:p,draggable:h,editable:v,batchDownload:y,fileDirection:b,onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S}=r,{action:N,headers:T,params:I,withCredentials:O=!1,dataKey:R="",downloadWithHeaders:k,fieldAliasMap:L,beforeUpload:P,button:A}=i,D="function"==typeof L?L():L||{},{t:_}=Xe();return q.default.createElement(qn,{name:"file",action:N,multiple:u,headers:T,data:I,withCredentials:O,downloadWithHeaders:k,beforeUpload:P,maxCount:c,fileTypes:f,fileSize:p,draggable:h,editable:v,batchDownload:y,fileDirection:b,disabled:o||t.props.disabled,readOnly:t.isOnlyShow||d,button:A,showUploadList:{showDownloadIcon:!0,downloadIcon:q.default.createElement(g.DownloadOutlined,null)},fileList:l,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const l=e.response||{},n={};for(const a in D)n[a]=e[a]||(null===(t=l.data)||void 0===t?void 0:t[D[a]])||"";return e.response&&200!==l.code&&s.message.error(l.message||_("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},n),{url:e.url||(R?m.get(l.data,R):l.data)||"",status:e.status})}));null==n||n(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onPreview:x,onDownload:E,onRemove:C,onSortChange:w,onEditChange:S})};class Qc extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Xc,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Qc.contextType=Zn;const Zc=q.default.forwardRef(((e,t)=>{const l=Ne({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:n,style:a,src:r,alt:i,imgStyle:o}=l,s=Ue(l,["className","style","src","alt","imgStyle"]),d=q.default.useRef(null),u=q.default.useRef(null);q.default.useEffect((()=>{const e={};for(const t in s)void 0!==l[t]&&(e[t]=l[t]);return u.current=new ye.default(d.current,e),()=>{v(),u.current=null}}),[]);const c=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.reset()},f=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.clear()},p=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.crop()},m=(e,t=!1)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.replace(e,t)},h=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.enable()},g=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.disable()},v=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.destroy()},y=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.move(e,t)},b=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.moveTo(e,t)},x=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoom(e)},E=(e,t)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.zoomTo(e,t)},C=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotate(e)},w=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.rotateTo(e)},S=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleX(e)},N=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.scaleY(e)},T=(e,t=e)=>{var l;return null===(l=u.current)||void 0===l?void 0:l.scale(e,t)},I=(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)},R=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getContainerData()},k=()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.getImageData()},L=()=>{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)},A=()=>{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)},_=(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)},H=e=>{var t;return null===(t=u.current)||void 0===t?void 0:t.setDragMode(e)};q.default.useImperativeHandle(t,(()=>({reset:c,clear:f,initCrop:p,replace:m,enable:h,disable:g,destroy:v,move:y,moveTo:b,relativeZoom:x,zoomTo:E,rotate:C,rotateTo:w,scaleX:S,scaleY:N,scale:T,getData:I,setData:O,getContainerData:R,getImageData:k,getCanvasData:L,setCanvasData:P,getCropBoxData:A,setCropBoxData:D,getCroppedCanvas:_,setAspectRatio:F,setDragMode:H})));const M={[yt("cropper")]:!0};return q.default.createElement("div",{className:J.default(M,n),style:a},q.default.createElement("img",{ref:d,src:r,alt:i,style:Object.assign({maxWidth:"100%"},o)}))}));Zc.displayName="Cropper";const Jc=e=>{const{fileTypes:t=[],fileSize:l,fixedSize:n,quality:a,beforeCrop:r,className:i}=e,{t:o}=Xe(),d=q.default.useRef(null),u=q.default.useRef(),c=q.default.useRef(),f=q.default.useRef(),p=q.default.useRef(),[m,h]=q.default.useState(""),v=e=>{d.current.relativeZoom(e)},y=e=>{d.current.rotate(e)},b=()=>{h("")},x=yt("cropper-preview");return q.default.createElement(q.default.Fragment,null,(()=>{const t=Array.isArray(e.children)?e.children[0]:e.children;if(!t)return null;const l=t.props,{beforeUpload:n}=l,a=Ue(l,["beforeUpload"]);return u.current=n,q.default.createElement(t.type,Object.assign(Object.assign({},a),{beforeUpload:(e,t)=>new Promise(((l,n)=>Ye(void 0,void 0,void 0,(function*(){const n=()=>l(s.Upload.LIST_IGNORE);if(r&&!(yield r(e,t)))return void n();c.current=e,f.current=l,p.current=n;const a=new FileReader;a.onload=()=>{h(a.result),a.onload=null},a.readAsDataURL(e)}))))}))})(),m&&q.default.createElement(s.Modal,{open:!0,wrapClassName:J.default(x,i),title:o("qm.uploadCropper.cropper"),width:790,bodyStyle:{padding:10},onOk:()=>{Ye(void 0,void 0,void 0,(function*(){const{type:e,name:l,uid:n}=c.current;d.current.getCroppedCanvas({maxWidth:1920,fillColor:"image/png"===e?"transparent":"#fff",imageSmoothingEnabled:!1,imageSmoothingQuality:"high"}).toBlob((a=>Ye(void 0,void 0,void 0,(function*(){let r=new File([a],l,{type:e});if(Object.assign(r,{uid:n}),t.length&&!t.includes(r.name.slice(r.name.lastIndexOf(".")+1).toLowerCase()))return s.message.warning(o("qm.upload.tooltip",{type:t.join(",")})),p.current("file type is error");if("function"!=typeof u.current)return f.current(r);const i=u.current(r,[r]);if("boolean"==typeof i||i){if(!0===i)return f.current(r);if(!1===i)return p.current("not upload");if(i&&"function"==typeof i.then)try{const e=yield i,t=Object.prototype.toString.call(e);"[object File]"!==t&&"[object Blob]"!==t||(r=e),f.current(r)}catch(e){p.current(e)}}else mt("CropperPreview","`beforeUpload` 必须返回 `boolean` 或 `Promise` 类型")}))),e,a),yield at(100),b()}))},onCancel:b,maskClosable:!1,destroyOnClose:!0},(()=>{const e={width:"380px",height:n?`calc(380px * ${n[1]/n[0]})`:"auto"};return q.default.createElement("div",{className:"cropper-preview"},q.default.createElement("div",{className:"cropper-area"},q.default.createElement("div",{className:"img-cropper"},q.default.createElement(Zc,{ref:d,aspectRatio:n?n[0]/n[1]:n,src:m,dragMode:"move",preview:".preview"})),q.default.createElement("div",{className:"actions"},q.default.createElement(s.Space,{size:"small"},q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomInOutlined,null),onClick:()=>v(.2)},o("qm.uploadCropper.zoomIn")),q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.ZoomOutOutlined,null),onClick:()=>v(-.2)},o("qm.uploadCropper.zoomOut")),q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateRightOutlined,null),onClick:()=>y(90)},o("qm.uploadCropper.rotatePlus")),q.default.createElement(s.Button,{type:"primary",size:"middle",icon:q.default.createElement(g.RotateLeftOutlined,null),onClick:()=>y(-90)},o("qm.uploadCropper.rotateSubtract"))))),q.default.createElement("div",{className:"preview-area"},q.default.createElement("div",{className:"preview",style:e})))})()))},ef=e=>{const t=Ne({name:"file",multiple:!0,accept:"image/*",listType:"picture-card"},e),{fileList:l=[],openCropper:n=!0,fixedSize:a,quality:r=1,fileTypes:i,fileSize:o,maxCount:d,draggable:u,disabled:c,readOnly:f,className:p,popupClassName:m,beforeCrop:h,onSortChange:v,onChange:y}=t,{t:b}=Xe(),{$size:x}=Ze(t),E=q.default.useRef(null),C=q.default.useRef(null),w=q.default.useRef(!1),[S,N]=q.default.useState(!1),[T,I]=q.default.useState(0),O=q.default.useMemo((()=>c||f),[c,f]),R=q.default.useMemo((()=>!d||l.length<d),[l,d]);q.default.useEffect((()=>(L(),document.addEventListener("paste",A),()=>{var e;null===(e=C.current)||void 0===e||e.destroy(),document.removeEventListener("paste",A)})),[]),Ql((()=>{R||(w.current=!1)}),[l]);const k=Qe((e=>{const{oldIndex:t,newIndex:n}=e;if(t!==n){const e=[...l],[a]=e.splice(t,1);e.splice(n,0,a),null==v||v(e),null==y||y({file:l[t],fileList:e})}})),L=()=>{u&&(C.current=ne.default.create(on(E.current,yt("upload-img")).querySelector(".ant-upload-list"),{animation:150,handle:".handle",filter:".ignore",draggable:".ant-upload-list-picture-card-container",onEnd:k}))},P=(e,l)=>new Promise(((n,a)=>Ye(void 0,void 0,void 0,(function*(){const{fileTypes:r=[],fileSize:i,beforeUpload:o}=t,d=!r.length||r.includes(e.name.slice(e.name.lastIndexOf(".")+1).toLowerCase()),u=!i||e.size/1024/1024<i,c=d&&u;if(d||s.message.warning(b("qm.upload.tooltip",{type:r.join(",")})),u||s.message.warning(b("qm.upload.sizeLimit",{size:i})),!c)return s.Upload.LIST_IGNORE;if(o){const t=o(e,l);if(!0===t)return n(e);if(!1===t)return a("not upload");if(t&&"function"==typeof t.then)try{const e=yield t;n(e)}catch(e){a(e)}}else n(e)})))),A=Qe((e=>Ye(void 0,void 0,void 0,(function*(){const{action:n,data:a,headers:r}=t;if(w.current&&R&&n)for(const t of e.clipboardData.items)if("file"===t.kind&&t.type.startsWith("image/")){const e=t.getAsFile(),i=Date.now(),o=new File([e],`screenshot-${i}.png`,{type:e.type});Object.assign(o,{uid:`rc-upload-${i}`});try{yield P(o,[...l,o]);const e=new FormData;if(e.append("file",o),a)for(const t in a)e.append(t,a[t]);const t="string"==typeof n?n:yield n(o),i=yield fetch(t,{method:"POST",body:e,headers:r});if(!i.ok)throw new Error(b("qm.upload.uploadError"));const s=yield i.json();null==y||y({file:o,fileList:[...l,{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=yt("upload-img"),_={[D]:!0,[`${D}--lg`]:"large"===x,[`${D}--sm`]:"small"===x},F=q.default.createElement(s.Upload,je({className:J.default(_,p)},dt(t,["fileTypes","fileSize","fixedSize","quality","openCropper","draggable","popupClassName"]),{beforeUpload:P,disabled:O,onPreview:e=>{const t=l.findIndex((t=>t.url===e.url));t<0||(I(t),N(!0))},showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:(e,t,l,n)=>q.default.createElement("div",{className:J.default("upload-item",{handle:u})},e,!O&&q.default.createElement(g.CloseOutlined,{title:b("qm.upload.remove"),className:"icon",onClick:()=>n.remove()}))}),q.default.createElement("span",{className:"inner",ref:E},R&&!(f&&l.length)&&q.default.createElement(q.default.Fragment,null,q.default.createElement("p",{className:"ant-upload-drag-icon"},q.default.createElement(g.InboxOutlined,null)),q.default.createElement("p",{className:"ant-upload-text"},b("qm.uploadCropper.dragableText")),q.default.createElement("button",{className:J.default("ant-upload-button",{disabled:O}),onClick:e=>{e.stopPropagation(),e.preventDefault()},onFocus:()=>{w.current=!0},onBlur:()=>{w.current=!1}},b("qm.uploadCropper.pasteText")))));return q.default.createElement(q.default.Fragment,null,n?q.default.createElement(Jc,{className:m,fixedSize:a,quality:r,fileTypes:i,fileSize:o,beforeCrop:h},F):F,q.default.createElement("div",{style:{display:"none"}},q.default.createElement(s.Image.PreviewGroup,{key:l.map((e=>e.uid||"")).join(","),preview:{visible:S,current:T,rootClassName:m,onVisibleChange:e=>N(e)}},l.map(((e,t)=>q.default.createElement(s.Image,{key:e.uid||t,src:e.url,alt:""}))))))};ef.displayName="QmUploadImg";const tf=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i={},disabled:o,readOnly:d}=e.option,{multiple:u=!0,maxCount:c=1,fixedSize:f,quality:p,openCropper:h,fileTypes:g,fileSize:v,draggable:y,onRemove:b,onSortChange:x}=r,{action:E,headers:C,params:w,withCredentials:S=!1,dataKey:N="",popupClassName:T,fieldAliasMap:I,beforeUpload:O}=i,R="function"==typeof I?I():I||{},{t:k}=Xe();return q.default.createElement(ef,{name:"file",action:E,multiple:u,headers:C,data:w,withCredentials:S,popupClassName:T,beforeUpload:O,maxCount:c,fixedSize:f,quality:p,openCropper:h,fileTypes:g,fileSize:v,draggable:y,disabled:o||t.props.disabled,readOnly:t.isOnlyShow||d,fileList:l,onChange:({fileList:e})=>{(e=>{const t=e.map((e=>{var t;const l=e.response||{},n={};for(const a in R)n[a]=e[a]||(null===(t=l.data)||void 0===t?void 0:t[R[a]])||"";return e.response&&200!==l.code&&s.message.error(l.message||k("qm.uploadCropper.uploadError")),Object.assign(Object.assign({uid:e.uid,name:e.name},n),{url:e.url||(N?m.get(l.data,N):l.data)||"",status:e.status})}));null==n||n(t),t.every((e=>"done"===e.status&&e.url))&&a(t)})(e)},onRemove:b,onSortChange:x})};class lf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(tf,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,"")}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}lf.contextType=Zn;const nf={onActivate:de.func,onAddUndo:de.func,onBeforeAddUndo:de.func,onBeforeExecCommand:de.func,onBeforeGetContent:de.func,onBeforeRenderUI:de.func,onBeforeSetContent:de.func,onBeforePaste:de.func,onBlur:de.func,onChange:de.func,onClearUndos:de.func,onClick:de.func,onContextMenu:de.func,onCommentChange:de.func,onCopy:de.func,onCut:de.func,onDblclick:de.func,onDeactivate:de.func,onDirty:de.func,onDrag:de.func,onDragDrop:de.func,onDragEnd:de.func,onDragGesture:de.func,onDragOver:de.func,onDrop:de.func,onExecCommand:de.func,onFocus:de.func,onFocusIn:de.func,onFocusOut:de.func,onGetContent:de.func,onHide:de.func,onInit:de.func,onKeyDown:de.func,onKeyPress:de.func,onKeyUp:de.func,onLoadContent:de.func,onMouseDown:de.func,onMouseEnter:de.func,onMouseLeave:de.func,onMouseMove:de.func,onMouseOut:de.func,onMouseOver:de.func,onMouseUp:de.func,onNodeChange:de.func,onObjectResizeStart:de.func,onObjectResized:de.func,onObjectSelected:de.func,onPaste:de.func,onPostProcess:de.func,onPostRender:de.func,onPreProcess:de.func,onProgressState:de.func,onRedo:de.func,onRemove:de.func,onReset:de.func,onSaveContent:de.func,onSelectionChange:de.func,onSetAttrib:de.func,onSetContent:de.func,onShow:de.func,onSubmit:de.func,onUndo:de.func,onVisualAid:de.func,onSkinLoadError:de.func,onThemeLoadError:de.func,onModelLoadError:de.func,onPluginLoadError:de.func,onIconsLoadError:de.func,onLanguageLoadError:de.func},af=Object.assign({apiKey:de.string,id:de.string,inline:de.bool,init:de.object,initialValue:de.string,onEditorChange:de.func,value:de.string,tagName:de.string,cloudChannel:de.string,plugins:de.oneOfType([de.string,de.array]),toolbar:de.oneOfType([de.string,de.array]),disabled:de.bool,textareaName:de.string,tinymceScriptSrc:de.string,rollback:de.oneOfType([de.number,de.oneOf([!1])]),scriptLoading:de.shape({async:de.bool,defer:de.bool,delay:de.number})},nf),rf=e=>"function"==typeof e,of=e=>e in nf,sf=e=>e.substr(2),df=(e,t,l,n,a)=>((e,t,l,n,a,r,i)=>{const o=Object.keys(a).filter(of),s=Object.keys(r).filter(of),d=o.filter((e=>void 0===r[e])),u=s.filter((e=>void 0===a[e]));d.forEach((e=>{const t=sf(e),n=i[t];l(t,n),delete i[t]})),u.forEach((l=>{const a=n(e,l),r=sf(l);i[r]=a,t(r,a)}))})(a,e.on.bind(e),e.off.bind(e),((t,l)=>n=>{var a;return null===(a=t(l))||void 0===a?void 0:a(n,e)}),t,l,n);let uf=0;const cf=e=>{const t=Date.now(),l=Math.floor(1e9*Math.random());return uf++,e+"_"+l+uf+String(t)},ff=e=>null!==e&&("textarea"===e.tagName.toLowerCase()||"input"===e.tagName.toLowerCase()),pf=e=>void 0===e||""===e?[]:Array.isArray(e)?e:e.split(" "),mf=(e,t)=>{void 0!==e&&(null!=e.mode&&"object"==typeof e.mode&&"function"==typeof e.mode.set?e.mode.set(t):e.setMode(t))},hf=()=>({listeners:[],scriptId:cf("tiny-script"),scriptLoading:!1,scriptLoaded:!1}),gf=(()=>{let e=hf();return{load:(t,l,n,a,r,i)=>{const o=()=>((e,t,l,n,a,r)=>{const i=t.createElement("script");i.referrerPolicy="origin",i.type="application/javascript",i.id=e,i.src=l,i.async=n,i.defer=a;const o=()=>{i.removeEventListener("load",o),r()};i.addEventListener("load",o),t.head&&t.head.appendChild(i)})(e.scriptId,t,l,n,a,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0}));e.scriptLoaded?i():(e.listeners.push(i),e.scriptLoading||(e.scriptLoading=!0,r>0?setTimeout(o,r):o()))},reinitialize:()=>{e=hf()}}})(),vf=e=>{const t=e;return t&&t.tinymce?t.tinymce:null};class yf extends $.Component{constructor(e){var t,l,n;super(e),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,l,n;const a=this.elementRef.current;if(!a)return;if(!(e=>{if(!("isConnected"in Node.prototype)){let t=e,l=e.parentNode;for(;null!=l;)t=l,l=t.parentNode;return t===e.ownerDocument}return e.isConnected})(a)){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 r=vf(this.view);if(!r)throw new Error("tinymce should have been loaded into global scope");const i=Object.assign(Object.assign({},this.props.init),{selector:void 0,target:a,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,pf(o).concat(pf(s))),toolbar:null!==(l=this.props.toolbar)&&void 0!==l?l:null===(n=this.props.init)||void 0===n?void 0:n.toolbar,setup:e=>{this.editor=e,this.bindHandlers({}),this.inline&&!ff(a)&&e.once("PostRender",(t=>{e.setContent(this.getInitialValue(),{no_events:!0})})),this.props.init&&rf(this.props.init.setup)&&this.props.init.setup(e)},init_instance_callback:e=>{var t,l;const n=this.getInitialValue();this.currentContent=null!==(t=this.currentContent)&&void 0!==t?t:e.getContent(),this.currentContent!==n&&(this.currentContent=n,e.setContent(n),e.undoManager.clear(),e.undoManager.add(),e.setDirty(!1));const a=null!==(l=this.props.disabled)&&void 0!==l&&l;mf(this.editor,a?"readonly":"design"),this.props.init&&rf(this.props.init.init_instance_callback)&&this.props.init.init_instance_callback(e)}});var o,s;this.inline||(a.style.visibility=""),ff(a)&&(a.value=this.getInitialValue()),r.init(i)},this.id=this.props.id||cf("tiny-react"),this.elementRef=$.createRef(),this.inline=null!==(n=null!==(t=this.props.inline)&&void 0!==t?t:null===(l=this.props.init)||void 0===l?void 0:l.inline)&&void 0!==n&&n,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,l;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 l=this.valueCursor;if(e.setContent(this.props.value),!this.inline||e.hasFocus())for(const n of[t,l])if(n)try{e.selection.moveToBookmark(n),this.valueCursor=n;break}catch(e){}}))}if(this.props.disabled!==e.disabled){const e=null!==(l=this.props.disabled)&&void 0!==l&&l;mf(this.editor,e?"readonly":"design")}}}componentDidMount(){var e,t,l,n,a,r;null!==vf(this.view)?this.initialise():this.elementRef.current&&this.elementRef.current.ownerDocument&&gf.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!==(n=null===(l=this.props.scriptLoading)||void 0===l?void 0:l.defer)&&void 0!==n&&n,null!==(r=null===(a=this.props.scriptLoading)||void 0===a?void 0:a.delay)&&void 0!==r?r: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,l;return(null===(l=null===(t=null===(e=vf(this.view))||void 0===e?void 0:e.Env)||void 0===t?void 0:t.browser)||void 0===l?void 0:l.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:e="div"}=this.props;return $.createElement(e,{ref:this.elementRef,id:this.id})}renderIframe(){return $.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){df(this.editor,e,this.props,this.boundHandlers,(e=>this.props[e]));const t=e=>void 0!==e.onEditorChange||void 0!==e.value,l=t(e),n=t(this.props);!l&&n?(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)):l&&!n&&(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 bf;yf.propTypes=af,yf.defaultProps={cloudChannel:"6"},function(e){e["zh-cn"]="zh_CN",e["zh-tw"]="zh_TW",e.en="en"}(bf||(bf={}));const xf=e=>{var t;const{className:l,style:n,tinymce:a={},upload:r={},thresholdSize:i=.5,tinymceScriptSrc:o,disabled:d,value:u,onResizeEditor:c,onChange:f}=e,{global:p}=q.default.useContext(xe),{$size:h}=Ze(e),{$locale:g,t:v}=Xe(),y=400,b="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",x="file edit view insert format tools table help",E="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",C=Object.assign(Object.assign({height:a.height||y,plugins:a.plugins||b,toolbar:a.toolbar||E,menubar:a.menubar||x,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:bf[g],skin:"tinymce-5"},dt(a,["height","plugins","toolbar","menubar"])),{images_upload_handler:e=>{const{action:t,headers:l,dataKey:n,customHandler:a}=r;return a?a(e):new Promise(((a,r)=>Ye(void 0,void 0,void 0,(function*(){const o=`data:image/jpeg;base64,${e.base64()}`,d=new FormData;d.append("file",e.blob(),e.filename());const u=e.blob().size;if(t&&u/1024/1024>i)try{const e=yield fetch(t,{method:"POST",body:d,headers:l});if(!e.ok)throw r(""),new Error(v("qm.upload.uploadError"));const i=yield e.json();if(200===i.code){const e=n?m.get(i.data,n):i.data;a(e)}}catch(e){s.message.error(v("qm.uploadCropper.uploadError"))}else a(o)}))))},setup:e=>{e.on("ResizeEditor",(t=>{const{offsetWidth:l,offsetHeight:n}=e.editorContainer;null==c||c({width:l,height:n},t)}))}}),w=yt("tinymce"),S={[w]:!0,[`${w}--lg`]:"large"===h,[`${w}--sm`]:"small"===h},N={init:C,value:u,disabled:d,tinymceScriptSrc:o||(null===(t=null==p?void 0:p.tinymce)||void 0===t?void 0:t.scriptSrc)||void 0,onEditorChange:(e,t)=>{null==f||f(t.getContent(),t)}};return q.default.createElement("div",{className:J.default(S,l),style:n},q.default.createElement(yf,N))};xf.displayName="QmTinymce";const Ef=e=>{const{$$form:t}=q.default.useContext(Zn),{value:l,onChange:n,onValuesChange:a}=e,{options:r={},upload:i,style:o={},readOnly:s,disabled:d=t.isFormDisabled}=e.option,{tinymce:u,thresholdSize:c,onResizeEditor:f}=r;return q.default.createElement(xf,{value:l,tinymce:u,upload:i,thresholdSize:c,style:Object.assign({width:"100%"},o),disabled:d||s||t.isOnlyShow,onResizeEditor:f,onChange:e=>{(e=>{null==n||n(e),a(e)})(e)}})};class Cf extends e.Component{render(){const{$$form:e}=this.context,{type:t,label:l,tooltip:n,fieldName:a,invisible:r,options:i={},labelWidth:o=e.props.labelWidth,className:d,extra:u,validateTrigger:c,rules:f=[],onChange:p=lt}=this.props.option;return q.default.createElement(s.Form.Item,{label:e.renderFormLabel(l),className:J.default(d),tooltip:n,hidden:r,labelCol:{flex:e.verticalLayout?"initial":ct(o)},required:e.getFormItemRequired(f)},q.default.createElement(s.Row,{wrap:!1,gutter:4},q.default.createElement(s.Col,{flex:"auto"},q.default.createElement(s.Form.Item,{name:a,noStyle:!0,rules:f,validateTrigger:c,messageVariables:{label:e.getFormItemLabel(l)}},q.default.createElement(Ef,{option:this.props.option,onValuesChange:t=>{p(t),e.setViewValue(a,t)}}))),u&&q.default.createElement(s.Col,{flex:ct(u.labelWidth||Za)},e.renderFormItemExtra(Object.assign({fieldName:a},u)))))}}Cf.contextType=Zn;class wf extends e.Component{constructor(e){var t;super(e),this.provide={$$form:this,echo_data:{}},this._fieldAuth={},this.wrapperRef=q.default.createRef(),this.formRef=q.default.createRef(),this.originItems=[],this.state={formData:{},viewData:{},other:{},extra:{},expand:{},flexCols:null!==(t=this.props.cols)&&void 0!==t?t: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 l=Math.floor(t/300);l=24%l==0?l:l-1,l=l<1?1:l,l=l>8?8:l,l!==this.state.flexCols&&this.setState({flexCols:l})},this.resizeListenerHandle=m.debounce(this.resizeObserveHandler,10),this.getFormItems=oe.default((e=>e.filter((e=>!e.noAuth&&!e.hidden)))),this.getFlattenItems=oe.default((e=>{const t=[];return e.filter((e=>e.fieldName&&"DIVIDER"!==e.type)).forEach((e=>{m.isPlainObject(e.label)&&e.label.fieldName&&t.push(e.label),t.push(e)})),t})),this.valuesChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onValuesChange)||void 0===n||n.call(l,e,this._initialValues)},this.fieldsChangeHandle=(e,t)=>{var l,n;null===(n=(l=this.props).onFieldsChange)||void 0===n||n.call(l,e,t)},this.finishHandle=e=>{var t,l;null===(l=(t=this.props).onFinish)||void 0===l||l.call(t,Object.assign({},this.get_fields_other(),this.formatFormValue(e)))},this.finishFailedHandle=({values:e,errorFields:t})=>{var l,n;null===(n=(l=this.props).onFinishFailed)||void 0===n||n.call(l,t)},this.openValidateInfo=e=>{const t=q.default.createElement("ul",null,e.map((e=>{const{label:t}=this.formItems.find((t=>t.fieldName===e.name[0]));return q.default.createElement("li",{key:e.name[0],style:{color:"#ff4d4f"}},"[",("string"==typeof t?`${t}: `:"")+e.errors.join(","),"]")})));s.notification.error({message:Se("qm.form.validatePrompt"),description:t,duration:10})},this.scrollToField=e=>{if(!e)return;const t=this.wrapperRef.current.querySelector(`.${e}`);t&&re.default(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(){xn(this.wrapperRef.current,this.resizeListenerHandle)}removeResizeEvent(){En(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&&mt("Form","配置项 fieldName 属性是唯一的,不能重复")}getFormItemRequired(e=[]){return e.some((e=>e.required))}createOtherValue(e){const t=this.flattenItems.map((e=>e.fieldName)),l={};for(const n in e)t.includes(n)||(l[n]=e[n]);return Object.assign({},l)}createExtraValue(e){const t={};return this.flattenItems.filter((e=>m.isPlainObject(e.extra))).forEach((l=>{var n;t[l.fieldName]=null!==(n=e[l.fieldName])&&void 0!==n?n:""})),Object.assign({},t)}createDividerExpand(){const e={};return this.dividers.filter((e=>m.isPlainObject(e.collapse))).forEach((t=>{var l;e[t.fieldName]=null!==(l=t.collapse.defaultExpand)&&void 0!==l&&l})),Object.assign({},e)}getInitialValue(e,t){var l;const{type:n,options:a}=e;return t=null!=t?t:void 0,lr.includes(n)&&(t=null!=t?t:[]),"CHECKBOX"!==n&&"SWITCH"!==n||(t=null!==(l=null!=t?t:null==a?void 0:a.falseValue)&&void 0!==l?l:er),t}createFormValue(e){const t={};return this.flattenItems.forEach((l=>{t[l.fieldName]=this.getInitialValue(l,e[l.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=ut(this.props.items)}getOriginItems(){return this.originItems}setViewValue(e,t=""){t!==this.getViewValue(e)&&this.setState((l=>({viewData:Object.assign({},l.viewData,{[e]:t})})))}getViewValue(e){var t;return null!==(t=this.state.viewData[e])&&void 0!==t?t:""}setExpandHandle(e){e!==this.state.collapse&&this.setState({collapse:e},(()=>{var t,l;return null===(l=(t=this.props).onCollapse)||void 0===l?void 0:l.call(t,e)}))}createInputFocus(){const{isAutoFocus:e}=this.props;if(!e||this.isOnlyShow)return;const{type:t,fieldName:l}=this.formItems.filter((e=>e.fieldName))[0]||{};"INPUT"!==t&&"INPUT_NUMBER"!==t||!l||setTimeout((()=>this.CREATE_FOCUS(l)))}getFormItemLabel(e){var t,l,n,a,r;if(yr(e))return br(e);if(m.isPlainObject(e)){const{fieldName:i,label:o,options:s={}}=e;if(yr(o))return br(o);const{itemList:d=[]}=s,u=null!==(n=null!==(l=null===(t=this.formRef.current)||void 0===t?void 0:t.getFieldsValue([i])[i])&&void 0!==l?l:this._initialValues[i])&&void 0!==n?n:null===(a=d[0])||void 0===a?void 0:a.value;return(null===(r=d.find((e=>e.value===u)))||void 0===r?void 0:r.text)||""}return""}getBlockDerivedItems(){const e=[];for(let t=0,l=this.dividers.length;t<l;t++){const l=this.formItems.findIndex((e=>e===this.dividers[t]));let n=this.formItems.findIndex((e=>e===this.dividers[t+1]));n=n>-1?n:void 0,e.push(this.formItems.slice(l,n).map((e=>({label:e.label,fieldName:e.fieldName}))))}return e}getFormItemDisplay({type:e,fieldName:t}){var l,n;if("DIVIDER"===e)return!0;const a=this.getBlockDerivedItems();for(let e=0,r=a.length;e<r;e++){const r=a[e],i=this.dividers.find((e=>e.fieldName===r[0].fieldName)),o=null!==(n=null===(l=null==i?void 0:i.collapse)||void 0===l?void 0:l.showLimit)&&void 0!==n?n:r.length-1;for(let e=1;e<r.length;e++){if(r[e].fieldName===t&&e>o)return this.state.expand[r[0].fieldName]}}return!0}formatFormValue(e){var t,l;for(const n in e){const a=e[n];if(cr(a)&&(e[n]=""),Array.isArray(a)&&a.forEach(((t,l)=>{cr(t)&&(e[n][l]="")})),n.includes("|")&&Array.isArray(a)){const[r,i]=n.split("|");e[r]=null!==(t=a[0])&&void 0!==t?t:"",e[i]=null!==(l=a[1])&&void 0!==l?l:""}}if(this.isFilterType)for(const t in e)ot(e[t])&&(e[t]=void 0);return e}setFieldAuth(e,t){this._fieldAuth[e]=t}createFormAuth(){var e,t,l;return Ye(this,void 0,void 0,(function*(){const{authConfig:n}=this.props;if(!n)return;let a=dt(n,["fetch"]);if(n.fetch){const{api:t,params:l,dataKey:r}=n.fetch;try{const n=yield t(l);200===n.code&&(a=null!==(e=r?m.get(n.data,r):n.data)&&void 0!==e?e:{})}catch(e){}}if(Array.isArray(a.fieldList)){const e=this.props.items.map((e=>{const{fieldName:t}=e,l=a.fieldList.find((e=>e.dataIndex===t));if(l){const n=this.originItems.find((e=>e.fieldName===t)),{visible:a=1,disabled:r,secretName:i}=l;a||(e.noAuth=!0,n.noAuth=!0),r&&(e.disabled=!0,n.disabled=!0),i&&(e.options?e.options.secretType=i:e.options={secretType:i},n.options=Object.assign({},n.options,{secretType:i})),this.setFieldAuth(t,{visible:a,disabled:r,secretName:i})}return e}));null===(l=(t=this.props).fieldsChange)||void 0===l||l.call(t,e)}}))}INPUT(e){return q.default.createElement(Kr,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT(e){return q.default.createElement(zr,{option:e})}INPUT_NUMBER(e){return q.default.createElement(Br,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}RANGE_INPUT_NUMBER(e){return q.default.createElement(Gr,{option:e})}SEARCH_HELPER(e){return q.default.createElement(Bu,{ref:t=>this[`${e.fieldName}_Ref`]=t,option:e})}MULTIPLE_SEARCH_HELPER(e){return q.default.createElement(Yu,{option:e})}TREE_TABLE_HELPER(e){return q.default.createElement(lc,{option:e})}MULTIPLE_TREE_TABLE_HELPER(e){return q.default.createElement(ac,{option:e})}RANGE_SEARCH_HELPER(e){return q.default.createElement(uc,{option:e})}CHECKBOX(e){return q.default.createElement($r,{option:e})}MULTIPLE_CHECKBOX(e){return q.default.createElement(fc,{option:e})}RATE(e){return q.default.createElement(mc,{option:e})}RADIO(e){return q.default.createElement(gc,{option:e})}SWITCH(e){return q.default.createElement(yc,{option:e})}TEXT_AREA(e){return q.default.createElement(xc,{option:e})}DATE(e){return q.default.createElement(Cc,{option:e})}RANGE_DATE(e){return q.default.createElement(Nc,{option:e})}TIME(e){return q.default.createElement(Ic,{option:e})}RANGE_TIME(e){return q.default.createElement(Rc,{option:e})}SELECT(e){return q.default.createElement(Hr,{option:e})}MULTIPLE_SELECT(e){return q.default.createElement(Hr,{option:e,multiple:!0})}IMMEDIATE(e){return q.default.createElement(Lc,{option:e})}DIVIDER(e){return q.default.createElement(Pc,{option:e})}TREE_SELECT(e){return q.default.createElement(_c,{option:e})}MULTIPLE_TREE_SELECT(e){return q.default.createElement(_c,{option:e,multiple:!0})}CASCADER(e){return q.default.createElement(Hc,{option:e})}MULTIPLE_CASCADER(e){return q.default.createElement(Hc,{option:e,multiple:!0})}CITY_SELECT(e){return q.default.createElement(Bc,{option:e})}REGION_SELECT(e){return q.default.createElement(Yc,{option:e})}UPLOAD_FILE(e){return q.default.createElement(Qc,{option:e})}UPLOAD_IMG(e){return q.default.createElement(lf,{option:e})}TINYMCE(e){return q.default.createElement(Cf,{option:e})}renderFormLabel(e){if(yr(e)||!m.isPlainObject(e))return e;const{type:t,fieldName:l,label:n,options:a={},onChange:r=lt}=e,{itemList:i=[]}=a;return"SELECT"===t?q.default.createElement(s.Form.Item,{name:l,noStyle:!0},q.default.createElement(Fr,{option:e,items:i,loading:!1,onValuesChange:(e,t)=>r(e,t)})):"CHECKBOX"===t?q.default.createElement(q.default.Fragment,null,q.default.createElement("span",{style:{paddingRight:5}},n),q.default.createElement(s.Form.Item,{name:l,noStyle:!0},q.default.createElement(Mr,{option:e,onValuesChange:e=>r(e)}))):null}renderFormItemExtra(e){const{fieldName:t,isTooltip:l,style:n={},render:a}=e,{extra:r}=this.state;if(l)return q.default.createElement(s.Tooltip,{className:"extra-tooltip",title:r[t]},q.default.createElement(g.ExclamationCircleOutlined,{style:{marginLeft:4}}));const i=this.formItems.find((e=>e.fieldName===t));return q.default.createElement("div",{className:"extra-text",title:a?"":r[t],style:n},q.default.createElement("span",{className:"extra-overflow-cut"},a?a(i,this):r[t]))}renderFormItemButton(e,t){const l=this.formItems.find((t=>t.fieldName===e)),n="function"==typeof t?t(l):t;return this.isOnlyShow?null:n}renderFormItem(e){const{label:t,fieldName:l,invisible:n,tooltip:a,className:r,labelWidth:i=this.props.labelWidth,validateTrigger:o,rules:d=[],style:u={},render:c}=e;return q.default.createElement(s.Form.Item,{label:this.renderFormLabel(t),name:l,rules:d,tooltip:a,hidden:n,className:J.default(r),style:Object.assign({width:"100%"},u),labelCol:{flex:this.verticalLayout?"initial":ct(i)},validateTrigger:o,messageVariables:{label:this.getFormItemLabel(t)}},this.formRef.current?c(e,this):q.default.createElement(q.default.Fragment,null))}createFormItem(e){return m.isFunction(this[e.type])?e.render?this.renderFormItem(e):this[e.type](e):(mt("Form",`配置项 ${e.fieldName} 的 type 类型错误`),null)}createFormLayout(){const{flexCols:e}=this.state,{formType:t,defaultRows:l,isFieldsDefine:n}=this.props,a=[];this.formItems.forEach((e=>{const{offsetLeft:t=0,offsetRight:l=0}=e;for(let e=0;e<t;e++)a.push({});a.push(e);for(let e=0;e<l;e++)a.push({})}));const r=24/e,i=[],o=a.reduce(((e,t)=>{const{selfCol:l=1}=t,n=e+l;return i.push(n),n}),0),d=l>Math.ceil(o/e)?Math.ceil(o/e):l,u=[],c=a.map(((t,l)=>{let{selfCol:n=1}=t;const{type:a,fieldName:o}=t;n=n>=24||"DIVIDER"===a||"TINYMCE"===a?e:n;const c=!(!this.state.collapse&&this.showFilterCollapse)||i[l]<d*e,f=!this.showDividerCollapse||this.getFormItemDisplay(t);return c&&u.push(i[l]),q.default.createElement(s.Col,{key:null!=o?o:l,className:o,span:n*r,style:this.isFilterType?{display:!this.showFilterCollapse||c?"block":"none"}:{display:f?"block":"none"}},a?this.createFormItem(ut(t)):null)}));return n&&"default"===t&&c.push(q.default.createElement("div",{className:"form-fields__define"},this.createFieldsDefine())),[...c,this.createSearchButtonLayout(u[u.length-1])]}createSearchButtonLayout(e=0){const{flexCols:t,collapse:l}=this.state,{searchButtonCols:n,isSearchBtn:a,isFieldsDefine:r=!0}=this.props;if(!this.isFilterType)return null;const i=24/t,o=n||1,d=t-e%t-o;return a?q.default.createElement(s.Col,{key:"-",span:o*i,offset:d*i,style:{textAlign:"right"}},q.default.createElement(s.Space,{style:{marginBottom:12}},q.default.createElement(ht,{type:"primary",size:this.$size,icon:q.default.createElement(g.SearchOutlined,null),onClick:()=>this.SUBMIT_FORM()},Se("qm.form.search")),q.default.createElement(ht,{size:this.$size,icon:q.default.createElement(g.ReloadOutlined,null),onClick:()=>this.RESET_FORM()},Se("qm.form.reset")),r?this.createFieldsDefine():null,this.showFilterCollapse&&q.default.createElement("a",{onClick:()=>this.setExpandHandle(!l)},l?q.default.createElement(g.UpOutlined,null):q.default.createElement(g.DownOutlined,null)," ",Se(l?"qm.form.collect":"qm.form.spread")))):null}createFormButtonLayout(){const{flexCols:e}=this.state,{formType:t,isSubmitBtn:l}=this.props;if(this.isFilterType)return null;const n=24/e;return l&&"default"===t?q.default.createElement(s.Row,{gutter:0},q.default.createElement(s.Col,{key:"-",span:n},q.default.createElement(s.Form.Item,null,q.default.createElement(s.Space,{style:{marginBottom:12}},q.default.createElement(ht,{type:"primary",size:this.$size,onClick:()=>this.SUBMIT_FORM()},Se("qm.form.save")),q.default.createElement(ht,{size:this.$size,onClick:()=>this.RESET_FORM()},Se("qm.form.reset")))))):null}createFieldsDefine(){const{uniqueKey:e,items:t,fieldsChange:l}=this.props;return q.default.createElement(qr,{uniqueKey:e,items:t,fieldsChange:l})}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)=>Ye(this,void 0,void 0,(function*(){const[l,n]=yield this.VALIDATE_FIELDS(),a=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:[Se("qm.form.searchHelperTips")],warnings:[]})));l||a.length?t((l||[]).concat(a)):e(n)}))))}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 Ye(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 Ye(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 Ye(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 l=this.flattenItems.filter((e=>e.noReset)).map((e=>e.fieldName)),n=this.flattenItems.map((e=>e.fieldName)).filter((e=>!l.includes(e)));n.length&&this.formRef.current.resetFields(n),this.setState((e=>{const t=Object.keys(e.other),l=Object.keys(this._initialOthers),n=t.filter((e=>!l.includes(e))),a={};return n.forEach((e=>a[e]=void 0)),{other:Object.assign({},this._initialOthers,a)}})),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){mt("Form","参数 `fieldName` 的值不正确或者该表单项不支持获得焦点")}}SET_FORM_ITEM(e,t,l){const{items:n,fieldsChange:a}=this.props,r=n.find((t=>t.fieldName===e));if(!r)return mt("Form","SET_FORM_ITEM 方法参数 `fieldName` 的值不正确");if(!m.isPlainObject(t))return mt("Form","SET_FORM_ITEM 方法参数 `option` 的值不正确");if(r.noAuth)return mt("Form","SET_FORM_ITEM 方法不能操作受权限控制的表单项");for(const l in t)l&&(Object.keys(this._fieldAuth).includes(e)&&"disabled"===l||m.set(r,l,t[l]));l&&(a?a([...n]):mt("Form","需要设置 `fieldsChange` 参数"))}render(){const{className:e,style:t,layout:l,disabled:n,labelWidth:a,labelAlign:r,labelWrap:i,customClass:o}=this.props,d=yt("form"),u={required:"${label}"+Se("qm.form.requiredTips")},c={[d]:!0,[`${d}--lg`]:"large"===this.$size,[`${d}--sm`]:"small"===this.$size,[`${d}__only-show`]:this.isOnlyShow,[`${d}__compact`]:this.isCompactMode,[o]:!!o};return q.default.createElement("div",{ref:this.wrapperRef,className:J.default(c,e),style:t},q.default.createElement(s.Form,{ref:this.formRef,size:this.$size,initialValues:this._initialValues,layout:l,labelAlign:r,labelWrap:i,colon:!1,disabled:n,labelCol:{flex:this.verticalLayout?"initial":ct(a)},validateMessages:u,onValuesChange:this.valuesChangeHandle,onFieldsChange:this.fieldsChangeHandle,onFinish:this.finishHandle,onFinishFailed:this.finishFailedHandle},q.default.createElement(Zn.Provider,{value:this.provide},q.default.createElement(s.Row,{gutter:this.verticalLayout?20:0},this.createFormLayout()),this.createFormButtonLayout())))}}wf.contextType=xe,wf.propTypes=or,wf.defaultProps=sr;const Sf=e=>null!=e;function Nf(e,t,l,n){const[a,r]=q.default.useState(void 0);q.default.useLayoutEffect((()=>{const t="function"==typeof e?e():e;r(t||null)}));const[i,o]=q.default.useState(null),s=()=>{if(a){!(e=>{const t=window.innerWidth||document.documentElement.clientWidth,l=window.innerHeight||document.documentElement.clientHeight,{top:n,right:a,bottom:r,left:i}=e.getBoundingClientRect();return n>=0&&i>=0&&a<=t&&r<=l})(a)&&t&&a.scrollIntoView(n);const{left:e,top:l,width:r,height:i}=a.getBoundingClientRect(),s={left:e,top:l,width:r,height:i,radius:0};o((e=>JSON.stringify(e)!==JSON.stringify(s)?s:e))}else o(null)};q.default.useLayoutEffect((()=>{s()}),[a,t]),xi({handler:s});return[q.default.useMemo((()=>{if(!i)return i;const e=(null==l?void 0:l.offset)||6,t=(null==l?void 0:l.radius)||2;return{left:i.left-e,top:i.top-e,width:i.width+2*e,height:i.height+2*e,radius:t}}),[i,l]),a]}const Tf={fill:"transparent",pointerEvents:"auto"},If=e=>{const{prefixCls:t,rootClassName:l,pos:n,showMask:a,style:r={},fill:i="rgba(0,0,0,0.5)",open:o,animated:s,zIndex:d}=e,u=`${t}-mask-${di()}`,c="object"==typeof s?null==s?void 0:s.placeholder:s;return q.default.createElement(he.default,{open:o,autoLock:!0},q.default.createElement("div",{className:J.default(`${t}-mask`,l),style:Object.assign({position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},r)},a?q.default.createElement("svg",{style:{width:"100%",height:"100%"}},q.default.createElement("defs",null,q.default.createElement("mask",{id:u},q.default.createElement("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"}),n&&q.default.createElement("rect",{x:n.left,y:n.top,rx:n.radius,width:n.width,height:n.height,fill:"black",className:c?`${t}-placeholder-animated`:""}))),q.default.createElement("rect",je({},n?null:Tf,{x:"0",y:"0",width:"100%",height:"100%",fill:i,mask:`url(#${u})`})),n&&q.default.createElement(q.default.Fragment,null,q.default.createElement("rect",je({},Tf,{x:"0",y:"0",width:"100%",height:`${n.top}px`})),q.default.createElement("rect",je({},Tf,{x:"0",y:"0",width:n.left,height:"100%"})),q.default.createElement("rect",je({},Tf,{x:"0",y:n.top+n.height,width:"100%",height:`calc(100vh - ${n.top+n.height}px)`})),q.default.createElement("rect",je({},Tf,{x:n.left+n.width,y:"0",width:`calc(100vw - ${n.left+n.width}px)`,height:"100%"})))):null))},Of=e=>{const{prefixCls:t,zIndex:l,open:n,onPause:a,onPlay:r}=e,[i,o]=hi(void 0,{value:n,postState:e=>null==e||e}),s=q.default.useRef(null),d=q.default.useRef(!1),u=Qe((e=>{c(e),e.shiftKey&&32===e.keyCode&&f()}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",u);return()=>e.remove()}),[]);const c=e=>{e.stopPropagation(),e.preventDefault()},f=()=>{d.current?d.current=!1:(o(!i),i?null==a||a():null==r||r())};return q.default.createElement("div",{ref:s,className:`${t}-control`,style:{zIndex:l+1},onMouseDown:e=>{c(e);const t=s.current,l=t.offsetWidth,n=t.offsetHeight,a=window.innerWidth,r=window.innerHeight,i=e.clientX-rn(t).x,o=e.clientY-rn(t).y;return document.onmousemove=e=>{let s=e.clientX-i,u=e.clientY-o;s<0&&(s=0),s>a-l-1&&(s=a-l-1),u<0&&(u=0),u>r-n-1&&(u=r-n-1),ln(t,{left:`${s}px`,top:`${u}px`}),d.current=!0},document.onmouseup=function(){this.onmousemove=null,this.onmouseup=null},!1},onClick:()=>f()},i?q.default.createElement(g.PauseOutlined,null):q.default.createElement(g.CaretRightOutlined,null))},Rf=e=>{const{prefixCls:t,current:l,total:n=0,cover:a,title:r,description:i,helper:o={},type:d,zIndex:u,onClose:c,onPrev:f,onNext:p,onFinish:m,className:h,indicatorsRender:v}=e,{t:y}=Xe(),b="primary"!==d?"primary":"default",x=Qe((e=>{S(e),40===e.keyCode&&(l<n-1?null==p||p():null==m||m()),38===e.keyCode&&l>0&&(null==f||f())}));q.default.useEffect((()=>{const e=ae.default(document,"keyup",x);return()=>e.remove()}),[]);const E=Sf(a)?q.default.createElement("div",{className:`${t}-cover`},a):null,C=Sf(i)?q.default.createElement("div",{className:`${t}-description`},i):null;let w;w=v?v(l,n):[...Array.from({length:n}).keys()].map(((e,n)=>q.default.createElement("span",{key:e,className:J.default(n===l&&`${t}-indicator-active`,`${t}-indicator`)})));const S=e=>{e.stopPropagation(),e.preventDefault()};return q.default.createElement("div",{className:J.default(`${t}-content`,h)},q.default.createElement("div",{className:`${t}-inner`},q.default.createElement(g.CloseOutlined,{className:`${t}-close`,onClick:c}),o.content&&q.default.createElement(s.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:u},content:o.content,title:o.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${t}-close`,"help-icon")})),E,q.default.createElement("div",{className:`${t}-header`},q.default.createElement("div",{className:`${t}-title`},r)),C,q.default.createElement("div",{className:`${t}-footer`},n>1&&q.default.createElement("div",{className:`${t}-indicators`},w),q.default.createElement(vt,{className:`${t}-buttons`},0!==l?q.default.createElement(ht,{className:`${t}-prev-btn`,size:"small",onMouseDown:S,onClick:f},y("qm.tour.prevStep")):null,l===n-1?q.default.createElement(ht,{className:`${t}-finish-btn`,type:b,size:"small",onClick:m},y("qm.tour.finish")):q.default.createElement(ht,{className:`${t}-next-btn`,type:b,size:"small",onMouseDown:S,onClick:p},y("qm.tour.nextStep"))))))},kf=e=>{const{current:t,renderPanel:l}=e;return q.default.createElement(q.default.Fragment,null,"function"==typeof l?l(e,t):q.default.createElement(Rf,e))},Lf={left:"50%",top:"50%",width:1,height:1},Pf=q.default.forwardRef(((e,t)=>{const{steps:l=[],defaultCurrent:n,current:a,onChange:r,onClose:i,onFinish:o,open:s,type:d="default",mask:u=!0,arrow:c=!0,control:f=!0,overlayClassName:p,overlayStyle:m,placement:h,helper:g,zIndex:v,renderPanel:y,indicatorsRender:b,gap:x,animated:E=!0,scrollIntoViewOptions:C=!0}=e,w=Ue(e,["steps","defaultCurrent","current","onChange","onClose","onFinish","open","type","mask","arrow","control","overlayClassName","overlayStyle","placement","helper","zIndex","renderPanel","indicatorsRender","gap","animated","scrollIntoViewOptions"]),S=q.default.useRef(),[N,T]=hi(0,{value:a,defaultValue:n}),[I,O]=hi(void 0,{value:s,postState:e=>!(N<0||N>=l.length)&&(null!=e&&e)}),[R,k]=hi(1051,{value:v,defaultValue:v}),[L,P]=q.default.useState(),A=q.default.useRef(I);q.default.useLayoutEffect((()=>{I&&!A.current&&T(0),A.current=I,P(I)}),[I]),q.default.useImperativeHandle(t,(()=>({OPEN:()=>O(!0),CLOSE:()=>O(!1),SET_ZINDEX:e=>k(e)})));const{target:D,type:_,placement:F,trigger:H,delay:M,style:$,arrow:j,className:K,mask:V,scrollIntoViewOptions:z,zIndex:W,action:B}=l[N]||{},U=W||R,G=_||d,Y=I&&(null!=V?V:u),X=null!=z?z:C,[Q,Z]=Nf(D,!!s,x,X),ee=((e,t,l)=>{var n;return null!==(n=null!=l?l:t)&&void 0!==n?n:null===e?"center":"bottom"})(Z,h,F),te=!!Z&&(void 0===j?c:j),le="object"==typeof te&&te.pointAtCenter;q.default.useLayoutEffect((()=>{var e;null===(e=S.current)||void 0===e||e.forceAlign()}),[le,N]),Ql((()=>{I&&(re(),null==B||B(Z,N))}),[I,Z]);const ne=e=>{T(e),null==r||r(e)},ae=()=>{O(!1),null==i||i(N)},re=()=>{if(!Z)return;const e=[];!function t(l){if(1===l.nodeType){var n;"INPUT"!==l.tagName&&"TEXTAREA"!==l.tagName||("none"===tn(n=l,"display")||"hidden"===tn(n,"visibility")||"0"===tn(n,"opacity"))||e.push(l);for(const e of Array.from(l.childNodes))t(e)}}(Z),e.length&&e[0].focus()};if(void 0===Z)return null;const ie=()=>Ye(void 0,void 0,void 0,(function*(){if(!H||!Z)return;const{left:e,top:t}=Z.getBoundingClientRect(),l=Z.offsetWidth,n=Z.offsetHeight,[a,r]=[e+l/2,t+n/2],i=new MouseEvent(H,{bubbles:!0,cancelable:!0,button:0,clientX:a,clientY:r}),o=document.elementFromPoint(a,r);o&&(o.dispatchEvent(i),yield at(null!=M?M:320))})),oe="boolean"==typeof Y?Y:!!Y,se="boolean"==typeof Y?void 0:Y,de=Object.assign({},m,$),ue=yt("tour"),ce=[{[`${ue}-primary`]:"primary"===G},p,K],fe=rd({arrowPointAtCenter:le,autoAdjustOverflow:!0,offset:6,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(If,{zIndex:U,prefixCls:ue,pos:Q,showMask:oe,style:null==se?void 0:se.style,fill:null==se?void 0:se.color,open:L,animated:E,rootClassName:p}),q.default.createElement(he.default,{open:L,autoLock:!0},q.default.createElement(pe.default,je({ref:S},w,{zIndex:U,builtinPlacements:fe,popupStyle:de,popupPlacement:ee,popupVisible:L,popupClassName:J.default(ce),prefixCls:ue,popup:()=>q.default.createElement(kf,je({key:"content",arrow:te,prefixCls:ue,total:l.length,helper:g,renderPanel:y,indicatorsRender:b,onPrev:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),ne(N-1)})),onNext:()=>Ye(void 0,void 0,void 0,(function*(){yield ie(),ne(N+1)})),onClose:ae,current:N,onFinish:()=>{ae(),null==o||o()}},Object.assign({},l[N],{zIndex:U,type:G}))),arrow:!!te,getTriggerDOMNode:e=>e||Z||document.body,forceRender:!1,destroyPopupOnHide:!0}),q.default.createElement("div",{className:J.default(p,`${ue}-target-placeholder`),style:Object.assign(Object.assign({},Q||Lf),{position:"fixed",pointerEvents:"none"})}))),f&&q.default.createElement(he.default,{open:I},q.default.createElement(Of,{zIndex:U,prefixCls:ue,onPause:()=>P(!1),onPlay:()=>P(!0)})))}));Pf.displayName="QmTour";var Af={previewWidth:1100,defaultDistance:.45,logoHeight:60};const Df=e.createContext(void 0);var _f=null;function Ff(){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),l=e.match(/MSIE\D?\d+/i),n=e.match(/OPR\D?\d+/i),a=e.match(/Firefox\D?\d+/i),r=e.match(/x64/i);if(!t&&!l&&r)return!0;if(a){if((a=a[0].match(/\d+/))[0]>=41||r)return!0}else if(n){if((n=n[0].match(/\d+/))[0]>=32)return!0}else if(!t&&!l){var i=e.match(/Chrome\D?\d+/i);if(i&&(i=i[0].match(/\d+/))[0]>=41)return!0}return!1}catch(e){return!0}}function Hf(e,t){var l;try{var n=navigator.userAgent,a=!!n.match(/MSIE/i)||!!n.match(/Trident/i);if(Ff()){try{l=getCLodop()}catch(e){}if(!l&&"complete"!==document.readyState)return void s.message.warning("打印组件还没有加载完毕,请稍等一下再操作");if(!l)return;CLODOP.CVERSION,t&&t.parentNode&&t.parentNode.removeChild(t),e&&e.parentNode&&e.parentNode.removeChild(e)}else{a&&n.match(/x64/i);if(e||t?l=a?e:t:_f?l=_f:((l=document.createElement("object")).setAttribute("width",0),l.setAttribute("height",0),l.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;"),a?l.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA"):l.setAttribute("type","application/x-print-lodop"),document.documentElement.appendChild(l),_f=l),!l||!l.VERSION)return n.indexOf("Chrome"),n.indexOf("Firefox"),l}return l.VERSION<"6.2.2.6"&&Ff(),l}catch(e){s.message.error("getLodop 出错:"+e)}}Ff();const Mf=e=>{const t=e/25.4*(()=>{var e;const t=[],{deviceXDPI:l,deviceYDPI:n}=window.screen;if(l&&n)t[0]=l,t[1]=n;else{let l=document.createElement("DIV");l.style.cssText="width: 1in; height: 1in; position: absolute; left: 0px; top: 0px; z-index: -1; visibility: hidden;",document.body.appendChild(l),t[0]=parseInt(l.offsetWidth.toString()),t[1]=parseInt(l.offsetHeight.toString()),null===(e=l.parentNode)||void 0===e||e.removeChild(l),l=null}return t})()[0];return Math.ceil(t)},$f=q.default.forwardRef(((e,t)=>{const{templateRender:l,directPrint:n}=e,{global:a}=q.default.useContext(xe),{$$preview:r}=q.default.useContext(Df),{state:i,isWindowsPrinter:o,pageSize:s}=r,d=q.default.useRef(null),u=q.default.useRef({}),c=q.default.useRef([]),f=q.default.useRef([]),p=q.default.useRef([]),[m,h]=q.default.useState(!0);q.default.useImperativeHandle(t,(()=>({createPreviewDom:O,createExportHtml:k,createPrintHtml:R,SHOW_PREVIEW:L,DIRECT_PRINT:P}))),Ql((()=>{I()}),[i.form.printerType,i.form.setting.direction,i.form.setting.distance,i.form.setting.fixedLogo]),q.default.useEffect((()=>{u.current.templateEl=d.current.querySelector(".origin-template").children[0],u.current.previewEl=d.current.querySelector(".workspace")}),[]);const g=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*Af.defaultDistance+10*Af.defaultDistance:0;return("vertical"===e?s[0]:s[1])-t}),[i,o,s]),v=q.default.useMemo((()=>{const{form:{setting:{direction:e}}}=i,t=o?10*Af.defaultDistance+10*Af.defaultDistance:0;return("vertical"===e?s[1]:s[0])-t}),[i,o,s]),y=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Mf(g-10*(e.left-Af.defaultDistance)-10*(e.right-Af.defaultDistance))}),[i,g]),b=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return Mf(v-10*(e.top-Af.defaultDistance)-10*(e.bottom-Af.defaultDistance))}),[i,v]),x=i.form.scale,E=q.default.useMemo((()=>{const{form:{setting:{distance:e}}}=i;return{left:Mf(10*e.left),right:Mf(10*e.right),top:Mf(10*e.top),bottom:Mf(10*e.bottom)}}),[i]),C=q.default.useMemo((()=>{const{form:{printerType:e}}=i,{left:t,right:l,top:n,bottom:a}=E,r=y+t+l,o=Af.previewWidth-r<=0?0:(Af.previewWidth-r)/2,s=Math.abs((1-x)*r/2);let d=0;return x>1&&(d=s>o?-1*o:-1*s),x<1&&(d=r-2*s>Af.previewWidth?0:o>0?s:(Af.previewWidth-(r-2*s))/2),{width:`${y}px`,height:""+("stylus"===e?"auto":b+"px"),paddingLeft:`${t}px`,paddingRight:`${l}px`,paddingTop:`${n}px`,paddingBottom:`${a}px`,transform:`translateX(${d}px) scale(${x})`,opacity:m?0:1}}),[i,m,E,x,b,y]);c.current.some((e=>/^<tr[^>]+type="page-break"[^>]+><\/tr>$/.test(e)));const w=()=>{var e,t,l,n;const r=null!==(t=null===(e=null==a?void 0:a.print)||void 0===e?void 0:e.leftLogo)&&void 0!==t?t:"",i=null!==(n=null===(l=null==a?void 0:a.print)||void 0===l?void 0:l.rightLogo)&&void 0!==n?n:"";return[`<tr style="height: ${Af.logoHeight}px;">`,'<td colspan="8" align="left" style="vertical-align: top;">',r?`<img src="${r}" border="0" height="46" />`:"","</td>",'<td colspan="16" align="right" style="vertical-align: top;">',i?`<img src="${i}" border="0" height="46" />`:"","</td>","</tr>"].join("")},S=()=>{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},N=()=>{let e=document.createElement("tr");var t,l;e.setAttribute("type","template-cols"),e.style.height="0",e.innerHTML=S().replace(/<tr[^>]+>/,"").replace(/<\/tr>/,""),t=e,(l=u.current.templateEl.children[0]).children[0]?l.insertBefore(t,l.children[0]):l.appendChild(t),e=null},T=()=>{const e=u.current.templateEl.children[0].children,t=[],l=[];for(let n=0;n<e.length;n++){if("template-cols"===e[n].getAttribute("type"))continue;const a=e[n].clientHeight;e[n].style.height=a+"px",l.push(a),t.push(e[n].outerHTML)}f.current=l,c.current=t},I=()=>{var e;if(!c.current.length)return;const{form:{setting:t,printerType:l}}=i;if(n)return p.current.push([S(),w(),...c.current]);const a=t.fixedLogo?b-Af.logoHeight:b;let o=[];if(p.current=[],"stylus"===l)p.current.push([S(),...t.fixedLogo?[w()]:[],...c.current]);else{let e=0;for(let l=0,n=f.current.length;l<n;l++){const r=c.current[l],i=f.current[l];t.fixedLogo||0!==l||(e+=Af.logoHeight),e+=i,e<=a?o.push(r):(p.current.push([S(),...t.fixedLogo?[w()]:[],...o]),o=[],e=0,l-=1),l===n-1&&o.length&&p.current.push([S(),...t.fixedLogo?[w()]:[],...o])}}t.fixedLogo||null===(e=p.current[0])||void 0===e||e.splice(1,0,w());for(let e=0,t=p.current.length;e<t&&e!==t-1;e++)p.current[e].push('<tr type="page-break" style="page-break-after: always;"></tr>');r.setState({currentPage:1,totalPage:p.current.length}),O()},O=()=>{var e,t;const{currentPage:l}=i;let n=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;n+=null!==(t=null===(e=p.current[l-1])||void 0===e?void 0:e.join(""))&&void 0!==t?t:"",n+="</table>",u.current.previewEl.innerHTML=n,u.current.previewEl.parentNode.scrollTop=0},R=e=>{let t=`<table cellspacing="0" cellpadding="0" border="0" class="${u.current.templateEl.className}">`;if(void 0!==e){t+=[...p.current[e-1]].join("")}else for(let e=0;e<p.current.length;e++)t+=p.current[e].join("");return t+="</table>",t},k=()=>{const e=[];for(let t=0;t<c.current.length;t++)e[t]=c.current[t].replace(/\s+/g," ").replace(/(<td[^>]+>)\s+/,"$1").replace(/\s+(<\/td>)/,"$1");return"<table>"+w()+S()+e.join("")+"</table>"},L=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();u.current.previewEl.innerHTML||(N(),yield at(0),T(),I(),h(!1))})),P=()=>Ye(void 0,void 0,void 0,(function*(){var e;if("TABLE"!==(null===(e=u.current.templateEl)||void 0===e?void 0:e.tagName))return A();N(),yield at(0),T(),I(),h(!1),r.doPrint(R()),yield at(0),r.doClose()})),A=()=>{mt("Print","[PrintTemplate] 打印模板组件的根元素必须是 `table` 节点")},D={[yt("print-container")]:!0,"no-visible":n};return q.default.createElement("div",{ref:d,className:J.default(D)},q.default.createElement(gn,{wrapperClassName:"spin",spinning:m,tip:"Loading..."},q.default.createElement("div",{className:"preview"},q.default.createElement("div",{className:"origin-template",style:{width:`${y}px`,marginLeft:`-${Math.floor(y/2)}px`}},null==l?void 0:l()),q.default.createElement("div",{className:"workspace",style:C}))))}));$f.displayName="Container";class qf extends e.Component{constructor(){super(...arguments),this.formRef=q.default.createRef(),this.createFormList=()=>[{type:"DIVIDER",fieldName:"_1",label:Se("qm.print.setPanel.printParameter")},{type:"SELECT",label:Se("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:Se("qm.print.setPanel.carbonPaper"),value:"241*280"}]}},{type:"RADIO",label:Se("qm.print.setPanel.printDirection"),fieldName:"direction",options:{itemList:[{text:Se("qm.print.setPanel.vertical"),value:"vertical"},{text:Se("qm.print.setPanel.horizontal"),value:"horizontal"}]}},{type:"CHECKBOX",fieldName:"doubleSide",label:{type:"SELECT",fieldName:"doubleSideType",options:{itemList:[{text:Se("qm.print.setPanel.autoDoublePrint"),value:"auto"},{text:Se("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:Se("qm.print.setPanel.fixedLogo"),fieldName:"fixedLogo",options:{trueValue:1,falseValue:0}},{type:"DIVIDER",fieldName:"_2",label:Se("qm.print.setPanel.printMargin")},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.leftMargin"),fieldName:"disleft",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.rightMargin"),fieldName:"disright",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.topMargin"),fieldName:"distop",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("qm.print.setPanel.noEmpty")}]},{type:"INPUT_NUMBER",label:Se("qm.print.setPanel.bottomMargin"),fieldName:"disbottom",options:{min:Af.defaultDistance,step:.05,precision:2},extra:{labelWidth:80},rules:[{required:!0,message:Se("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:Se("qm.print.setPanel.sizeUnit"),disright:Se("qm.print.setPanel.sizeUnit"),distop:Se("qm.print.setPanel.sizeUnit"),disbottom:Se("qm.print.setPanel.sizeUnit")}),this.state={formList:this.createFormList()},this.confirmHandle=()=>Ye(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 q.default.createElement(q.default.Fragment,null,q.default.createElement(wf,{ref:this.formRef,items:e,initialValues:this.getInitialvalue(),initialExtras:this.getInitialExtra(),labelWidth:120,cols:2}),q.default.createElement("div",{style:{position:"absolute",left:0,bottom:0,right:0,zIndex:9,borderTop:"1px solid #d9d9d9",padding:"10px 15px",background:"#fff",textAlign:"right"}},q.default.createElement(ht,{onClick:()=>this.cancelHandle(),style:{marginRight:8}},Se("qm.dialog.close")),q.default.createElement(ht,{type:"primary",onClick:()=>this.confirmHandle()},Se("qm.dialog.confirm"))))}}qf.contextType=xe;class jf extends e.Component{constructor(){var e,t,l;super(...arguments),this.provide={$$preview:this},this.containRef=q.default.createRef(),this.state={visible:!1,form:{printerName:-1,printerType:(null===(e=this.props.defaultConfig)||void 0===e?void 0:e.printerType)||"laser",copies:(null===(t=this.props.defaultConfig)||void 0===t?void 0:t.copies)||1,scale:1,setting:{distance:{left:Af.defaultDistance,right:Af.defaultDistance,top:Af.defaultDistance,bottom:Af.defaultDistance},pageSize:"210*297",direction:(null===(l=this.props.defaultConfig)||void 0===l?void 0:l.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=()=>Ye(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 fe.default.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=>Ye(this,void 0,void 0,(function*(){const t=this.context.global,l=null==t?void 0:t.getComponentConfigApi;if(l)try{const t=yield l({key:e});if(200===t.code)return t.data}catch(e){}})),this.savePrintConfig=(e,t)=>Ye(this,void 0,void 0,(function*(){const l=this.context.global,n=null==l?void 0:l.saveComponentConfigApi;if(n)try{yield n({[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=Hf();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a,printerName:r,printerType:i,copies:o}}=this.state,{pageSize:d}=this,{defaultDistance:u}=Af,{left:c,right:f,top:p,bottom:m}=a.distance;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.SET_PRINTER_INDEX(r),t.SET_PRINT_COPIES(o),a.doubleSide&&("auto"===a.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"===i&&("vertical"===a.direction&&t.SET_PRINT_PAGESIZE(1),"horizontal"===a.direction&&(t.SET_PRINT_PAGESIZE(2),t.SET_SHOW_MODE("LANDSCAPE_DEFROTATED",1))),"stylus"===i&&t.SET_PRINT_PAGESIZE(3,10*d[0],100*m*2,""),t.ADD_PRINT_TABLE(10*(p-u)+"mm",10*(c-u)+"mm",`RightMargin: ${10*(f-u)}mm`,`BottomMargin: ${"stylus"!==i?10*(m-u):0}mm`,this.createStyle()+e),t.On_Return=(e,t)=>{t?n&&this.doClose():s.message.error(Se("qm.print.printError"))},t.PRINT()},this.doExport=e=>{const t=Hf();if(!t)return;const{uniqueKey:l,closeAfterPrint:n}=this.props,{form:{setting:a}}=this.state;t.PRINT_INIT(null!=l?l:Math.random().toString().slice(2)),t.On_Return=(e,t)=>{t?n&&this.doClose():s.message.error(Se("qm.print.exportError"))},t.ADD_PRINT_TABLE(0,0,"RightMargin: 0","BottomMargin: 0",this.createStyle()+e),t.SET_SAVE_MODE("Orientation","vertical"===a.direction?1:2),t.SAVE_TO_FILE(`${j.default().format("YYYYMMDDHHmmss")}.xlsx`)}}get printerTypeItems(){return[{text:Se("qm.print.laserPrinter"),value:"laser"},{text:Se("qm.print.stylusPrinter"),value:"stylus"}]}get printerItems(){const e=Hf(),t=[{text:Se("qm.print.defaultPrinter"),value:-1}];try{const l=e.GET_PRINTER_COUNT();for(let n=0;n<l;n++)t.push({text:e.GET_PRINTER_NAME(n),value:n})}catch(e){mt("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 Ye(this,void 0,void 0,(function*(){if(this.props.uniqueKey)try{let l=yield fe.default.getItem(this.printerKey);l||(l=yield this.getPrintConfig(this.printerKey),m.isPlainObject(l)&&(yield fe.default.setItem(this.printerKey,l))),m.isPlainObject(l)&&Object.keys(l).length&&m.merge(this.state.form,Object.assign(Object.assign({},l),{printerName:null!==(t=null===(e=this.printerItems.find((e=>e.text===l.printerName)))||void 0===e?void 0:e.value)&&void 0!==t?t:-1}))}catch(e){}}))}render(){const{preview:e,templateRender:t}=this.props,{visible:l,form:n,currentPage:a,totalPage:r,printPage:i}=this.state,o=yt("print-preview"),d={visible:l,title:Se("qm.print.pageSetting"),width:"50%",loading:!1,containerStyle:{paddingBottom:"52px"},onClose:()=>{this.setState({visible:!1})}},u={[o]:!0};return e?q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{className:J.default(u)},q.default.createElement("div",{className:"outer"},q.default.createElement("div",{className:"header"},q.default.createElement("span",null,Se("qm.print.printer"),":",q.default.createElement(s.Select,{value:n.printerName,onChange:e=>{this.setState((t=>m.merge({},t,{form:{printerName:e}})))},style:{width:"120px"}},this.printerItems.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.type"),":",q.default.createElement(s.Select,{value:n.printerType,onChange:e=>{this.setState((t=>m.merge({},t,{form:{printerType:e,setting:{pageSize:"stylus"===e?"241*280":"210*297"}}})))},style:{width:"120px"}},this.printerTypeItems.map((e=>q.default.createElement(s.Select.Option,{key:e.value,value:e.value},e.text))))),q.default.createElement("span",null,Se("qm.print.copies"),":",q.default.createElement(s.InputNumber,{value:n.copies,min:1,precision:0,onChange:e=>{this.setState((t=>m.merge({},t,{form:{copies:null!=e?e:1}})))},style:{width:"50px"}})),q.default.createElement("span",null,Se("qm.print.printPage.0"),q.default.createElement(s.InputNumber,{value:i,min:1,max:r,precision:0,onChange:e=>{this.setState({printPage:null!=e?e:void 0})},style:{width:"50px",marginLeft:"4px",marginRight:"4px"}}),Se("qm.print.printPage.1")),q.default.createElement("span",null,q.default.createElement(s.Pagination,{size:"small",current:a,pageSize:1,total:r,onChange:this.pageChangeHandle})),q.default.createElement("span",null,q.default.createElement(ht,{type:"text",icon:q.default.createElement(g.SettingOutlined,null),className:"text-btn",onClick:()=>this.setState({visible:!0})},Se("qm.print.setting"))),q.default.createElement("span",null,q.default.createElement(ht,{type:"text",icon:q.default.createElement(g.DownloadOutlined,null),className:"text-btn",onClick:()=>this.exportClickHandle()},Se("qm.print.export"))),q.default.createElement("span",null,q.default.createElement(ht,{icon:q.default.createElement(g.PrinterOutlined,null),type:"primary",onClick:this.printClickHandle},Se("qm.print.print")))),q.default.createElement("div",{className:"main"},q.default.createElement(Df.Provider,{value:this.provide},q.default.createElement($f,{ref:this.containRef,templateRender:t,directPrint:!1}))),q.default.createElement("div",{className:"footer"},q.default.createElement("span",null,Se("qm.print.scale"),":",q.default.createElement(s.Slider,{value:n.scale,step:.1,min:.5,max:1.5,onChange:e=>{this.setState((t=>m.merge({},t,{form:{scale:e}})))}}),q.default.createElement("em",{className:"scale-text"},`${Math.floor(100*n.scale)}%`)),q.default.createElement("span",null,Se("qm.print.paper"),":",this.pageSize[0],"mm * ",this.pageSize[1],"mm"),q.default.createElement("span",null,Se("qm.print.pageNumber"),":",Se("qm.print.pagination",{currentPage:a,totalPage:r}))))),q.default.createElement(Qn,d,q.default.createElement(qf,{setting:n.setting,onChange:e=>{this.setState((t=>m.merge({},t,{form:{setting:e}})))},onClose:()=>{this.setState({visible:!1})}}))):q.default.createElement(Df.Provider,{value:this.provide},q.default.createElement($f,{ref:this.containRef,templateRender:t,directPrint:!0}))}}jf.contextType=xe;class Kf extends e.Component{constructor(){super(...arguments),this.previewRef=q.default.createRef(),this.state={visible:!1,loading:!1},this.clickHandle=()=>Ye(this,void 0,void 0,(function*(){var e,t;this.setState({loading:!0});try{const l=yield null===(t=(e=this.props).click)||void 0===t?void 0:t.call(e);if(this.setState({loading:!1}),"boolean"==typeof l&&!l)return;yield this.DO_PRINT()}catch(e){}this.setState({loading:!1})})),this.createRender=()=>{const{visible:e}=this.state,{templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r}=this.props,i={visible:e,title:Se("qm.print.preview"),width:`${Af.previewWidth}px`,loading:!1,onClose:()=>{this.setState({visible:!1})}},o={ref:this.previewRef,templateRender:t,uniqueKey:l,defaultConfig:n,preview:a,closeAfterPrint:r,onClose:()=>{this.setState({visible:!1})}};return a?q.default.createElement(Qn,i,q.default.createElement(jf,o)):e?q.default.createElement(jf,o):null},this.DO_PRINT=()=>Ye(this,void 0,void 0,(function*(){const{preview:e}=this.props;yield at(0),this.setState({visible:!0}),yield at(e?500:0);const t=this.previewRef.current.containRef.current;e?t.SHOW_PREVIEW():t.DIRECT_PRINT()}))}render(){const{loading:e}=this.state,{size:t,icon:l,type:n,disabled:a,shape:r}=this.props,i={size:t||this.context.size||"",type:n,shape:r,icon:l,loading:e,disabled:a,click:this.clickHandle};return q.default.createElement(q.default.Fragment,null,this.props.children&&q.default.createElement(ht,i,this.props.children),this.createRender())}}function Vf(e){return e.ownerDocument?e.ownerDocument.defaultView:null}function zf(e){const t=Vf(e);return t?t.frameElement:null}function Wf(e){const t=Gf(e);return Bf([e.getBoundingClientRect(),{top:t.borderTop,left:t.borderLeft,bottom:t.borderBottom,right:t.borderRight,width:0,height:0}])}function Bf(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 Uf(e,t){const l=zf(e);if(l&&l!==t){const n=[e.getBoundingClientRect()];let a=l,r=!1;for(;a;){const e=Wf(a);if(n.push(e),a=zf(a),r)break;a&&Vf(a)===t&&(r=!0)}return Bf(n)}return e.getBoundingClientRect()}function Gf(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)}}Kf.propTypes={size:(e,t,l)=>{if(!Qa(e[t]||""))return pt("Print","Invalid prop `"+t+"` supplied to `"+l+"`. Validation failed.")},templateRender:se.default.elementType},Kf.defaultProps={preview:!0,type:"primary",icon:q.default.createElement(g.PrinterOutlined,null)},Kf.contextType=xe;const Yf=Object.assign;class Xf{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=ep.border,this.padding.style.borderColor=ep.padding,this.content.style.backgroundColor=ep.background,Yf(this.node.style,{borderColor:ep.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){Jf(t,"margin",this.node),Jf(t,"border",this.border),Jf(t,"padding",this.padding),Yf(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"}),Yf(this.node.style,{top:e.top-t.marginTop+"px",left:e.left-t.marginLeft+"px"})}}class Qf{constructor(e,t){this.tip=e.createElement("div"),Yf(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),Yf(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),Yf(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,l){this.nameSpan.textContent=e,this.dimSpan.textContent=Math.round(t)+"px × "+Math.round(l)+"px"}updatePosition(e,t){const l=this.tip.getBoundingClientRect(),n=function(e,t,l){const n=Math.max(l.height,20),a=Math.max(l.width,60),r=5;let i;i=e.top+e.height+n<=t.top+t.height?e.top+e.height<t.top+0?t.top+r:e.top+e.height+r:e.top-n<=t.top+t.height?e.top-n-r<t.top+r?t.top+r:e.top-n-r:t.top+t.height-n-r;let o=e.left+r;e.left<t.left&&(o=t.left+r);e.left+a>t.left+t.width&&(o=t.left+t.width-a-r);return i+="px",o+="px",{style:{top:i,left:o}}}(e,t,{width:l.width,height:l.height});Yf(this.tip.style,n.style)}}class Zf{constructor(){const e=window;this.window=e;const t=window;this.tipBoundsWindow=t;const l=e.document;this.container=l.createElement("div"),this.container.style.zIndex="10000000",this.tip=new Qf(l,this.container),this.rects=[],l.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 l=e.filter((e=>e.nodeType===Node.ELEMENT_NODE));for(;this.rects.length>l.length;){const e=this.rects.pop();null==e||e.remove()}if(0===l.length)return;for(;this.rects.length<l.length;)this.rects.push(new Xf(this.window.document,this.container));const n={top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,left:Number.POSITIVE_INFINITY};l.forEach(((e,t)=>{const l=Uf(e,this.window),a=Gf(e);n.top=Math.min(n.top,l.top-a.marginTop),n.right=Math.max(n.right,l.left+l.width+a.marginRight),n.bottom=Math.max(n.bottom,l.top+l.height+a.marginBottom),n.left=Math.min(n.left,l.left-a.marginLeft);this.rects[t].update(l,a)})),t||(t=l[0].nodeName.toLowerCase(),l[0]),this.tip.updateText(t,n.right-n.left,n.bottom-n.top);const a=Uf(this.tipBoundsWindow.document.documentElement,this.window);this.tip.updatePosition({top:n.top,left:n.left,height:n.bottom-n.top,width:n.right-n.left},{top:a.top+this.tipBoundsWindow.scrollY,left:a.left+this.tipBoundsWindow.scrollX,height:this.tipBoundsWindow.innerHeight,width:this.tipBoundsWindow.innerWidth})}}function Jf(e,t,l){Yf(l.style,{borderTopWidth:e[t+"Top"]+"px",borderLeftWidth:e[t+"Left"]+"px",borderRightWidth:e[t+"Right"]+"px",borderBottomWidth:e[t+"Bottom"]+"px",borderStyle:"solid"})}const ep={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 tp=null,lp=null;function np(){null!=window.document&&(tp=null,null!==lp&&(lp.remove(),lp=null))}class ap{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=>sn(t,window.document.querySelector(e)))))return this._selectIgnore=!0,np();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 l,n,a;l=[t],n=null,a=!1,null!=window.document?(null!==tp&&clearTimeout(tp),null!=l&&(null===lp&&(lp=new Zf),lp.inspect(l,n),a&&(tp=setTimeout((()=>np()),2e3)))):null!=l&&null!=l[0]&&console.error("showNativeHighlight",l[0])}},this.onPointerUp=e=>{this._selectIgnore||(e.preventDefault(),e.stopPropagation())},this.selectFiberForNode=m.throttle((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 l=e;const n=[];for(;l!==t&&null!==l;){let e=l.tagName.toLowerCase();const t=/(?:\b|\w+-)(actived?|select(ed)?|focus(ed)?|open(ed)?)$/;for(let e=0,n=Array.from(l.classList).reverse();e<n.length;e++)t.test(n[e])&&l.classList.remove(n[e]);if(l.id&&/^rc-\w+/.test(l.id)&&l.removeAttribute("id"),l.id)e+=`#${l.id}`;else{const t=Array.from(l.parentElement.children).filter((e=>e.tagName===l.tagName)),n=l.className.trim();if(t.filter((e=>e.className.includes(n))).length<=1){if(n){const t=n.split(/\s+/);let l="";for(let e=0;e<t.length;e++)/^ant-col-\d+$/.test(t[e])||(l+=`.${t[e]}`);e+=l}}else l.getAttribute("name")?e+=`[name=${l.getAttribute("name")}]`:e+=`:nth-of-type(${t.indexOf(l)+1})`}l.nodeType!==Node.TEXT_NODE&&n.unshift(e),l=l.parentElement}return n.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(){np(),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 rp(e){return document.querySelector(e)}const ip=e=>{const{action:t,onConfirm:l,onCancel:n,onFinish:a}=e,{t:r}=Xe();return q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{style:{height:100}},r("qm.table.config.emptyText")),q.default.createElement(vt,{style:{width:"100%",justifyContent:"flex-end"}},q.default.createElement(ht,{size:"small",onClick:()=>null==n?void 0:n()},r("qm.guideTracker.closeButton")),q.default.createElement(ht,{size:"small",onClick:()=>null==l?void 0:l()},r("add"===t?"qm.guideTracker.addButton":"qm.guideTracker.editButton")),q.default.createElement(ht,{size:"small",onClick:()=>null==a?void 0:a()},r("qm.guideTracker.finishButton"))))},op={left:"50%",top:"50%",width:1,height:1},sp=q.default.forwardRef(((e,t)=>{const{open:l,current:n,defaultCurrent:a,steps:r=[],placement:i="bottom",control:o=!0,overlayClassName:d,overlayStyle:u,destroyOnHide:c,contentRender:f,zIndex:p,helper:h={},selectFilter:v=(e=>e),onSelect:y,onChange:b,onClose:x,onFinish:E}=e,{t:C}=Xe(),w=q.default.useRef(),S=q.default.useRef(r.length),[N,I]=hi(0,{value:n,defaultValue:a}),[O,R]=hi(void 0,{value:l,postState:e=>null!=e&&e}),[k,L]=hi(1051,{value:p,defaultValue:p}),[P,A]=q.default.useState({}),[D,_]=q.default.useState(!1),[F,H]=q.default.useState(O),[M,$]=q.default.useState(!1),[j,K]=Nf(P.node,!!l),[V,z]=q.default.useState(22),W=q.default.useRef(!1),B=q.default.useMemo((()=>N>=r.length?"add":"edit"),[N,r]),U=q.default.useMemo((()=>`${N+1} / ${r.length}`),[N,r]);q.default.useLayoutEffect((()=>{w.current=new ap({excludeSelectors:[".qm-guide-tracker-control"],onSelect:(e,t)=>{t=v(t),A({id:Ma(),node:e,path:t}),I(S.current),_(!0),Y(),null==y||y(t,e)}})}),[]),q.default.useEffect((()=>(O?G():Y(),O?setTimeout((()=>H(!0)),16):H(!1),()=>{Y()})),[O]),q.default.useEffect((()=>{S.current=r.length}),[r]);const G=()=>{w.current.startHandle()},Y=()=>{w.current.stopHandle()},X=e=>{e.stopPropagation(),e.preventDefault()};q.default.useImperativeHandle(t,(()=>({OPEN:()=>R(!0),CLOSE:()=>R(!1),GET_CURRENT_STEP:()=>({current:N,selector:P.path})})));const Q=yt("guide-tracker"),Z=[{[`${Q}-primary`]:!0}],ee=rd({arrowPointAtCenter:!1,autoAdjustOverflow:!0,offset:5,arrowWidth:16,borderRadius:8});return q.default.createElement(q.default.Fragment,null,q.default.createElement(he.default,{open:O&&D,autoLock:!0},q.default.createElement(pe.default,{zIndex:k,builtinPlacements:ee,popupPlacement:i,popupVisible:O&&D,popupClassName:J.default(Z,d),popupStyle:u,prefixCls:Q,popup:()=>{const e=()=>{_(!1),G()};return q.default.createElement("div",{className:`${Q}-content`},q.default.createElement("div",{className:`${Q}-inner`},q.default.createElement(g.CloseOutlined,{className:`${Q}-close`,onClick:()=>{null==x||x(N),e()}}),q.default.createElement(s.Dropdown,{open:M,trigger:["click"],dropdownRender:()=>r.length?q.default.createElement("div",{className:"ant-dropdown-menu step-list"},q.default.createElement(T.ReactSortable,{itemKey:"id",handle:".handle",tag:"ul",animation:200,list:r,setList:e=>{const t=e.map((e=>e.id)),l=r.map((e=>e.id));if(m.isEqual(t,l))return;const n=t.findIndex((e=>e===P.id)),a=-1!==n?n:N;I(a),null==b||b(Ya(e),a)}},r.map(((e,t)=>q.default.createElement("li",{key:t,className:J.default("item",{actived:e.id===P.id})},q.default.createElement(g.HolderOutlined,{className:"handle",title:C("qm.form.draggable")}),q.default.createElement("span",{className:"box"},q.default.createElement("span",{className:"title",title:e.title,onClick:()=>{t!==N&&(A({id:e.id,node:rp(e.selector),path:e.selector}),I(t),z(22===V?V+1:V-1),null==b||b(r,t))}},e.title),q.default.createElement(s.Popconfirm,{title:C("qm.button.confirmTitle"),zIndex:k+1,onConfirm:()=>{const l=r.filter((t=>t.id!==e.id)),n=t===N;let a=t<=N?N-1:N;if(a=a<0?0:a,a=a>l.length?l.length:a,n&&l[a]){const{id:e,selector:t}=l[a];A({id:e,node:rp(t),path:t})}I(a),null==b||b(l,a)}},q.default.createElement(g.CloseOutlined,{className:"close-icon"})))))))):q.default.createElement(q.default.Fragment,null),overlayClassName:`${Q}__popper`,placement:"bottomLeft",overlayStyle:{minWidth:180,zIndex:k},onOpenChange:e=>$(e)},q.default.createElement(g.MenuOutlined,{className:J.default(`${Q}-close`,"menu-icon"),style:{width:V}})),h.content&&q.default.createElement(s.Popover,{placement:"bottom",overlayStyle:{width:360,zIndex:k},content:h.content,title:h.title},q.default.createElement(g.QuestionCircleOutlined,{className:J.default(`${Q}-close`,"help-icon")})),q.default.createElement("div",{className:"panel-label"},q.default.createElement("span",{className:"title"},C("qm.guideTracker.label")),q.default.createElement("span",{className:"step"},C("qm.guideTracker.currentStep"),U)),f?f({id:P.id,selector:P.path,actionStatus:B,DO_CLOSE:e},N):q.default.createElement(ip,{action:B,onConfirm:()=>{null==b||b("add"===B?[...r,{id:P.id,selector:P.path,title:"Guide Title"}]:[...r],N),e()},onCancel:()=>{null==x||x(N),e()},onFinish:()=>{e(),null==x||x(N),null==E||E()}})))},arrow:!0,forceRender:!1,destroyPopupOnHide:c},q.default.createElement("div",{className:J.default(`${Q}-target-placeholder`),style:Object.assign(Object.assign({},j||op),{position:"fixed",zIndex:k-1,backgroundColor:"rgba(120, 170, 210, 0.7)"}),onMouseDown:X,onClick:X}))),o&&q.default.createElement(he.default,{open:F},q.default.createElement(Of,{zIndex:k,prefixCls:Q,onPause:()=>{W.current=D,_(!1),Y()},onPlay:()=>{W.current?_(!0):G()}})))}));sp.displayName="QmGuideTracker";const dp=e=>{var t,l,n,a,r,i,o,s;const{content:d,image:u,width:c,height:f,font:p={},gap:m=[100,100],offset:h=[50,50],rotate:g=-22,zIndex:v=9,alpha:y=1,antiTamper:b=!0,grayscale:x,className:E,style:C}=e,w=q.default.useRef(null),S=q.default.useRef(new Map),N=null!==(t=p.fontSize)&&void 0!==t?t:16,T=null!==(l=p.fontWeight)&&void 0!==l?l:"normal",I=null!==(n=p.fontStyle)&&void 0!==n?n:"normal",O=null!==(a=p.fontFamily)&&void 0!==a?a:"sans-serif",R=null!==(r=p.color)&&void 0!==r?r:"rgba(0, 0, 0, 0.15)",k=null!==(i=p.textAlign)&&void 0!==i?i:"center",L=Array.isArray(d)?d:[d],P=m[0],A=m[1],D=P/2,_=A/2,F=null!==(o=h[0])&&void 0!==o?o:D,H=null!==(s=h[1])&&void 0!==s?s:_,M=q.default.useMemo((()=>{const e=F-D,t=H-_;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:v}}),[D,_,F,H,v]),j=(e,t)=>{var l;if(w.current){const n=S.current.get(w.current);n&&(w.current.contains(n)&&w.current.removeChild(n),S.current.delete(w.current));const a=document.createElement("div");a.setAttribute("style",(e=>Object.entries(e).map((([e,t])=>{return`${l=e,l.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${t}`;var l})).join(";"))(Object.assign(Object.assign({},M),{backgroundImage:`url('${e}')`,backgroundSize:`${t}px`}))),null===(l=w.current)||void 0===l||l.append(a),S.current.set(w.current,a)}},K=()=>{const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)return;const l=(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),[n,a]=(e=>{let t=120,l=64;if(!u&&e.measureText){e.font=`${N}px ${O}`;const n=L.map((t=>e.measureText(t).width));t=Math.ceil(Math.max(...n)),l=N*L.length+3*(L.length-1)}return[null!=c?c:t,null!=f?f:l]})(t),r=n*l,i=a*l,o=(P+n)*l,s=(A+a)*l,d=P/2*l,p=A/2*l,m=o/2,h=s/2,v=2*(P+n);e.width=2*o,e.height=2*s,t.globalAlpha=y,t.save(),t.translate(m,h),t.rotate(Math.PI/180*g),t.translate(-m,-h);const b=()=>{t.restore(),t.drawImage(e,0,0,o,s,o,s,o,s),x&&(e=>{const t=e.getContext("2d");if(!t)return;const l=t.getImageData(0,0,e.width,e.height),{data:n}=l;for(let e=0;e<n.length;e+=4){const t=(n[e]+n[e+1]+n[e+2])/3;n[e]=t,n[e+1]=t,n[e+2]=t}t.putImageData(l,0,0)})(e),j(e.toDataURL(),v)},E=()=>{const e=Number(N)*l;t.font=`${I} normal ${T} ${e}px/${a}px ${O}`,t.fillStyle=R,t.textAlign=k,t.textBaseline="top",t.translate(r/2,0),L.forEach(((n,a)=>{t.fillText(null!=n?n:"",d,p+a*(e+3*l))})),b()};if(u){const e=new Image;e.onload=()=>{t.drawImage(e,d,p,r,i),b()},e.onerror=()=>{E()},e.crossOrigin="anonymous",e.referrerPolicy="no-referrer",e.src=u}else E()},V=e=>Array.from(S.current.values()).includes(e);q.default.useEffect((()=>{K()}),[d,u,c,f,p,m,h,g,v,y,b,x]),function(e,t,l={}){const n=window&&"MutationObserver"in window,a=$.useRef(),r=()=>{a.current&&(a.current.disconnect(),a.current=void 0)};$.useLayoutEffect((()=>(r(),n&&e.current&&(a.current=new MutationObserver(t),a.current.observe(e.current,l)),()=>r())),[e])}(w,(e=>{if(b)for(const t of e){const e=Array.from(t.removedNodes).some((e=>V(e))),l="attributes"===t.type&&V(t.target);if(e||l){K();break}}}),{attributes:!0,childList:!0,characterData:!0,subtree:!0});const z=yt("watermark");return q.default.createElement("div",{ref:w,className:J.default(z,E),style:Object.assign({position:"relative"},C)},e.children)},up=new Map,cp=new WeakMap;let fp,pp=0;function mp(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(l=e.root,l?(cp.has(l)||(pp+=1,cp.set(l,pp.toString())),cp.get(l)):"0"):e[t]}`;var l})).toString()}function hp(e,t,l={},n=fp){if(void 0===window.IntersectionObserver&&void 0!==n){const a=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof l.threshold?l.threshold:0,time:0,boundingClientRect:a,intersectionRect:a,rootBounds:a}),()=>{}}const{id:a,observer:r,elements:i}=function(e){const t=mp(e);let l=up.get(t);if(!l){const n=new Map;let a=[];const r=new IntersectionObserver((t=>{t.forEach((t=>{var l;const r=t.isIntersecting&&a.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=r),null===(l=n.get(t.target))||void 0===l||l.forEach((e=>{e(r,t)}))}))}),e);a=r.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),l={id:t,observer:r,elements:n},up.set(t,l)}return l}(l),o=i.get(e)||[];return i.has(e)||i.set(e,o),o.push(t),r.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(i.delete(e),r.unobserve(e)),0===i.size&&(r.disconnect(),up.delete(a))}}const gp=e=>{const{forceRender:t,height:l,placeholder:n=null,unmountIfInvisible:a,className:r,style:i}=e,{ref:o,inView:s,entry:d}=(({root:e,rootMargin:t,threshold:l,triggerOnce:n,fallbackInView:a,trackVisibility:r,skip:i,delay:o,onChange:s}={})=>{var d;const[u,c]=q.default.useState(null),[f,p]=q.default.useState({inView:!1,entry:void 0}),m=q.default.useRef(s);q.default.useEffect((()=>{if(i||!u)return;let s;return s=hp(u,((e,t)=>{var l;p({inView:e,entry:t}),null===(l=m.current)||void 0===l||l.call(m,e,t),t.isIntersecting&&n&&s&&(s(),s=void 0)}),{root:e,rootMargin:t,threshold:l,trackVisibility:r,delay:o},a),()=>{s&&s()}}),[Array.isArray(l)?l.toString():l,u,e,t,n,i,r,a,o]);const h=null===(d=f.entry)||void 0===d?void 0:d.target,g=q.default.useRef();u||!h||n||i||g.current===h||(g.current=h,p({inView:!1,entry:void 0}));const v=[c,f.inView,f.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v})(Object.assign({},e,{triggerOnce:!a}));q.default.useEffect((()=>{l||mt("LazyLoad","height 是必要参数,需要设定组件的高度值!")}),[]);const u={[yt("lazy-load")]:!0};return q.default.createElement("div",{ref:o,className:J.default(u,r),style:i},t||s?e.children:q.default.createElement("div",{className:"placeholder",style:{height:l}},n))};class vp{constructor(e,t,l,n){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=l||0,this.time=n||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 yp{static fromPoints(e,t){const l=this.calculateControlPoints(e[0],e[1],e[2]).c2,n=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new yp(e[1],l,n,e[2],t.start,t.end)}static calculateControlPoints(e,t,l){const n=e.x-t.x,a=e.y-t.y,r=t.x-l.x,i=t.y-l.y,o=(e.x+t.x)/2,s=(e.y+t.y)/2,d=(t.x+l.x)/2,u=(t.y+l.y)/2,c=Math.sqrt(n*n+a*a),f=Math.sqrt(r*r+i*i),p=f/(c+f),m=d+(o-d)*p,h=u+(s-u)*p,g=t.x-m,v=t.y-h;return{c1:new vp(o+g,s+v),c2:new vp(d+g,u+v)}}constructor(e,t,l,n,a,r){this.startPoint=e,this.control2=t,this.control1=l,this.endPoint=n,this.startWidth=a,this.endWidth=r}length(){let e,t,l=0;for(let n=0;n<=10;n+=1){const a=n/10,r=this.point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),i=this.point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(n>0){const n=r-e,a=i-t;l+=Math.sqrt(n*n+a*a)}e=r,t=i}return l}point(e,t,l,n,a){return t*(1-e)*(1-e)*(1-e)+3*l*(1-e)*(1-e)*e+3*n*(1-e)*e*e+a*e*e*e}}class bp{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,l;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===(l=e.touches[0])||void 0===l?void 0:l.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(),l=Object.assign(Object.assign({},t),{points:[]});this._data.push(l),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 l=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],a=n.points,r=a.length>0&&a[a.length-1],i=!!r&&l.distanceTo(r)<=this.minDistance,o=this._getPointGroupOptions(n);if(!r||!r||!i){const e=this._addPoint(l,o);t&&(r?e&&this._drawCurve(e,o):this._drawDot(l,o)),a.push({time:l.time,x:l.x,y:l.y,pressure:l.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 l=this.ctx,n=t.dotSize>0?t.dotSize:(t.minWidth+t.maxWidth)/2;l.beginPath(),this._drawCurveSegment(e.x,e.y,n),l.closePath(),l.fillStyle=t.penColor,l.fill()},this._drawCurve=(e,t)=>{const l=this.ctx,n=e.endWidth-e.startWidth,a=2*Math.ceil(e.length());l.beginPath(),l.fillStyle=t.penColor;for(let l=0;l<a;l+=1){const r=l/a,i=r*r,o=i*r,s=1-r,d=s*s,u=d*s;let c=u*e.startPoint.x;c+=3*d*r*e.control1.x,c+=3*s*i*e.control2.x,c+=o*e.endPoint.x;let f=u*e.startPoint.y;f+=3*d*r*e.control1.y,f+=3*s*i*e.control2.y,f+=o*e.endPoint.y;const p=Math.min(e.startWidth+o*n,t.maxWidth);this._drawCurveSegment(c,f,p)}l.closePath(),l.fill()},this._drawCurveSegment=(e,t,l)=>{const n=this.ctx;n.moveTo(e,t),n.arc(e,t,l,0,2*Math.PI,!1)},this._createPoint=(e,t,l)=>{const n=this.canvas.getBoundingClientRect();return new vp(e-n.left,t-n.top,l,(new Date).getTime())},this._createPointByEvent=e=>this._createPoint(e.x,e.y,e.pressure),this._addPoint=(e,t)=>{const{_lastPoints:l}=this;if(l.push(e),l.length>2){3===l.length&&l.unshift(l[0]);const e=this._calculateCurveWidths(l[1],l[2],t),n=yp.fromPoints(l,e);return l.shift(),n}return null},this._strokeWidth=(e,t)=>Math.max(t.maxWidth/(e+1),t.minWidth),this._calculateCurveWidths=(e,t,l)=>{const n=l.velocityFilterWeight*t.velocityFrom(e)+(1-l.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(n,l),r={end:a,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=a,r},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:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.setLastHistory(),this.ctx.beginPath(),this.ctx.rect(t,l,n-t,a-l),this.ctx.stroke(),this.ctx.restore()},this.drawRound=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=Math.min(n,t),i=Math.min(a,l),o=.5*(Math.max(n,t)-r),s=.5*(Math.max(a,l)-i),d=r+o,u=i+s;this.setLastHistory(),this.ctx.beginPath(),this.ctx.ellipse(d,u,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:l}=this._lastPoints[0],{x:n,y:a}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),r=180*Math.atan2(l-a,t-n)/Math.PI,i=(r+25)*Math.PI/180,o=(r-25)*Math.PI/180,s=15*Math.cos(i),d=15*Math.sin(i),u=15*Math.cos(o),c=15*Math.sin(o);this.setLastHistory(),this.ctx.beginPath(),this.ctx.moveTo(t,l),this.ctx.lineTo(n,a),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n,a);const f=n+s,p=a+d;this.ctx.lineTo(f,p);const m=n+u,h=a+c;this.ctx.lineTo(m,h),this.ctx.lineTo(n,a),this.ctx.fill(),this.ctx.restore()},this.getAxisColor=(e,t,l)=>{const n=e.width,a=e.data,r=[];return r[0]=a[4*(l*n+t)],r[1]=a[4*(l*n+t)+1],r[2]=a[4*(l*n+t)+2],r[3]=a[4*(l*n+t)+3],r},this.setAxisColor=(e,t,l,n)=>{const a=e.width,r=e.data;r[4*(l*a+t)]=n[0],r[4*(l*a+t)+1]=n[1],r[4*(l*a+t)+2]=n[2],r[4*(l*a+t)+3]=n[3]},this.drawMosaic=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e)),n=this.ctx.getImageData(t*this.ratio,l*this.ratio,this.maxWidth*this.ratio,this.maxWidth*this.ratio),a=n.width,r=n.height,i=a/this.degreeOfBlur,o=r/this.degreeOfBlur;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const l=this.getAxisColor(n,t*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur),e*this.degreeOfBlur+Math.floor(Math.random()*this.degreeOfBlur));for(let a=0;a<this.degreeOfBlur;a++)for(let r=0;r<this.degreeOfBlur;r++)this.setAxisColor(n,t*this.degreeOfBlur+r,e*this.degreeOfBlur+a,l)}this.ctx.putImageData(n,t*this.ratio,l*this.ratio)},this.drawText=e=>{const{x:t,y:l}=this.textInputPos;if(0===t&&0===l)return;this.ctx.lineWidth=1,this.ctx.fillStyle=this.penColor,this.ctx.textBaseline="middle",this.ctx.font=`bold ${this.fontSize}px none`;const n=this.fontSize*this.lineHeight,a=this.width-t,r=e.target.innerText,i=[];let o="";for(let e=0;e<r.length;e++){const t=o+r[e];this.ctx.measureText(t).width>a&&o.length>0?(i.push(o),o=r[e]):o=t}i.push(o),i.forEach(((e,a)=>{this.ctx.fillText(e,t+1,l+a*n+2)})),this.ctx.restore(),this.textInputPos={x:0,y:0}},this.createPencil=e=>{if(this.openSmooth||!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawPencil=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.lineTo(t,l),this.ctx.stroke(),this.ctx.restore()},this.createEraser=e=>{if(!this._lastPoints.length)return;const{x:t,y:l}=this._lastPoints[0];this.ctx.beginPath(),this.ctx.moveTo(t,l)},this.drawEraser=e=>{const{x:t,y:l}=this._createPointByEvent(this._pointerEventToSignatureEvent(e));this.ctx.globalCompositeOperation="destination-out",this.ctx.lineCap="round",this.ctx.lineWidth=this.eraserSize,this.ctx.lineTo(t,l),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:l}=this._lastPoints[0];0!=this.textInputPos.x&&0!=this.textInputPos.y&&this.textInputPos.x!=t&&this.textInputPos.y!=l?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 l=document.createElement("canvas");l.width=this.width,l.height=this.height;return l.getContext("2d").drawImage(this.canvas,0,0,l.width,l.height),l.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 l,n,a,r=0,i=null;const o=()=>{r=Date.now(),i=null,l=e.apply(n,a),i||(n=null,a=[])};return function(...s){const d=Date.now(),u=t-(d-r);return n=this,a=s,u<=0||u>t?(i&&(clearTimeout(i),i=null),r=d,l=e.apply(n,a),i||(n=null,a=[])):i||(i=window.setTimeout(o,u)),l}}(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)}}bp.dataURLToBlob=e=>{const t=e.split(";base64,"),l=t[0].split(":")[1],n=window.atob(t[1]),a=n.length,r=new Uint8Array(a);for(let e=0;e<a;++e)r[e]=n.charCodeAt(e);return new Blob([r],{type:l})},bp.canvasToDataURL=e=>e.toDataURL("image/png",1),bp.canvasToBlob=e=>new Promise(((t,l)=>{e.toBlob((e=>e?t(e):l(null)),"image/png",1)}));const xp=()=>q.default.createElement("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Ep=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Cp=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),wp=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Sp=()=>q.default.createElement("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},q.default.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"})),Np=q.default.forwardRef(((e,t)=>{const{open:l,width:n,height:a,imageName:r,penColor:i,penMode:o,minWidth:d,maxWidth:u,backgroundColor:c,className:f,style:p,onOk:m,onCancel:h}=e,{t:v}=Xe(),y=q.default.useRef(),b=q.default.useRef(null),x=q.default.useRef(null),E=q.default.useRef(null),C=[2,4,6],w=[14,16,18,20,24,28],S=["#ff0000","#29cc29","#00bfff","#fe6151","#000000","#666666"],[N,T]=hi(void 0,{value:l,postState:e=>null!=e&&e}),I=q.default.useMemo((()=>!!e.children),[e.children]),[O,R]=q.default.useState(o||(I?"square":"line")),[k,L]=q.default.useState(C[0]),[P,A]=q.default.useState(I?S[0]:S[4]),[D,_]=q.default.useState(w[1]),[F,H]=q.default.useState("bottomLeft"),[M,$]=q.default.useState(!1),[K,V]=q.default.useState(!1);q.default.useEffect((()=>{var e,t;const l={width:null!=n?n:null===(e=x.current)||void 0===e?void 0:e.offsetWidth,height:null!=a?a:null===(t=x.current)||void 0===t?void 0:t.offsetHeight,maxWidth:k,mode:O,penColor:P,fontSize:D,backgroundColor:c,openSmooth:!I};return l.openSmooth&&Object.assign(l,{penColor:i,minWidth:d,maxWidth:u}),y.current=new bp(b.current,l),()=>y.current.destroy()}),[]);const z=e=>{var t,l;const[r,i]=[null!=n?n:null===(t=x.current)||void 0===t?void 0:t.offsetWidth,null!=a?a:null===(l=x.current)||void 0===l?void 0:l.offsetHeight],{width:o,height:s}=y.current;let d=!1;r&&r!==o&&(y.current.width=r,d=!0),i&&i!==s&&(y.current.height=i,d=!0),(d||e)&&y.current.update()};Ql((()=>{I&&N&&z()}),[N,I]),Ql((()=>{y.current.setDrawMode(O)}),[O]),Ql((()=>{y.current.setLineWidth(k)}),[k]),Ql((()=>{y.current.setPenColor(P)}),[P]),Ql((()=>{y.current.setFontSize(D)}),[D]);const W=()=>Ye(void 0,void 0,void 0,(function*(){const e=I?x.current.parentNode:b.current;if(e)try{const t=yield be.default(e,{useCORS:!0,logging:!1,ignoreElements:e=>e===E.current||e.classList.contains("spinning")});return bp.canvasToDataURL(t)}catch(e){mt("Signature","生成合成图片失败!")}})),B=()=>{y.current.clear(),null==h||h()};q.default.useImperativeHandle(t,(()=>({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&&H((()=>{const e=E.current.getBoundingClientRect();return e.top+e.height>=window.innerHeight})()?"topLeft":"bottomLeft")},G=e=>q.default.createElement("div",{className:J.default("ant-dropdown-menu","content")},"text"!==e?q.default.createElement("div",{className:"lineWidth"},C.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",`s${e}`,{active:e===k}),onClick:()=>L(e)})))):q.default.createElement("div",{className:"fontSize"},q.default.createElement(s.Select,{size:"small",value:D,options:w.map((e=>({value:e,label:e.toString()}))),onChange:e=>_(e)})),q.default.createElement("span",{className:"divider"}),q.default.createElement("div",{className:"penColor"},S.map((e=>q.default.createElement("span",{key:e,className:J.default("dot",{active:e===P}),style:{backgroundColor:e},onClick:()=>A(e)},q.default.createElement(g.CheckOutlined,{className:"icon"})))))),Y=yt("signature"),X={[Y]:!0,"is-annotation":I},Q=n?Object.assign(Object.assign({},p),{width:n}):p;return q.default.createElement("div",{className:J.default(X,f),style:Q},I&&q.default.createElement(q.default.Fragment,null,q.default.createElement("div",{ref:x,className:"content"},e.children),K&&q.default.createElement(gn,{spinning:!0,className:"spinning"})),q.default.createElement("div",{className:J.default("signature",{show:N})},q.default.createElement("canvas",{ref:b,className:O}),I&&q.default.createElement("div",{ref:E,className:"signature__tool-bar"},q.default.createElement("div",{className:"wrapper"},q.default.createElement("div",{className:J.default("actions",{hidden:M})},q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("square")},q.default.createElement(g.BorderOutlined,null))),q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("round")},q.default.createElement(xp,null))),q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("arrow")},q.default.createElement(Cp,null))),q.default.createElement(s.Dropdown,{dropdownRender:G,overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("line")},q.default.createElement(g.EditOutlined,null))),q.default.createElement(s.Dropdown,{dropdownRender:()=>G("text"),overlayClassName:`${Y}__popper`,placement:F,trigger:["click"],onOpenChange:U},q.default.createElement("button",{className:"btn",onClick:()=>R("text")},q.default.createElement(Ep,null))),q.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){yield Ye(void 0,void 0,void 0,(function*(){V(!0);const e=yield W();if(e){const t=r?r.slice(0,r.lastIndexOf(".")>0?r.lastIndexOf("."):void 0):j.default().format(ai);Fn(bp.dataURLToBlob(e),`${t}.png`)}V(!1)})),B()}))},q.default.createElement(g.DownloadOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>R("eraser")},q.default.createElement(wp,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.undo()},q.default.createElement(Sp,null)),q.default.createElement("button",{className:"btn",onClick:()=>y.current.clear()},q.default.createElement(g.ClearOutlined,null)),q.default.createElement("span",{className:"divider"}),q.default.createElement("button",{className:"btn",onClick:()=>null==h?void 0:h()},q.default.createElement(g.CloseOutlined,null)),q.default.createElement("button",{className:"btn",onClick:()=>Ye(void 0,void 0,void 0,(function*(){V(!0),yield at(10);const e=yield W();V(!1),B(),null==m||m(e)}))},q.default.createElement(g.CheckOutlined,null))),q.default.createElement("button",{className:"btn btn-fold",title:v(M?"qm.divider.spread":"qm.divider.collect"),onClick:()=>$(!M)},M?q.default.createElement(g.LeftOutlined,null):q.default.createElement(g.RightOutlined,null))))))}));Np.displayName="QmSignature";const Tp=q.default.forwardRef(((e,t)=>{const{dataIndex:l,className:n,style:a}=e;return q.default.createElement("li",{ref:t,"data-index":l,className:J.default("list-item",n),style:a},e.children)}));Tp.displayName="ListItem";const Ip=q.default.forwardRef(((e,t)=>{var l,n;const{dataSource:a=[],height:r,maxHeight:i,itemHeight:o,renderItem:s,onScroll:d,className:u}=e,c=q.default.useRef(null),f=Rd({count:a.length,getScrollElement:()=>{var e,t;return null!==(t=null===(e=c.current)||void 0===e?void 0:e.container.children[0])&&void 0!==t?t:null},estimateSize:()=>o||40,overscan:3,onChange:(e,t)=>null==d?void 0:d(e,t)}),p=f.getVirtualItems();q.default.useImperativeHandle(t,(()=>({SCROLL_TO_INDEX:e=>f.scrollToIndex(e),SCROLL_TO_OFFSET:e=>f.scrollToOffset(e)})));const m=yt("virtual-list");return q.default.createElement(_n,{ref:c,className:J.default(m,u),style:Object.assign(Object.assign({},e.style),{height:r,maxHeight:i})},q.default.createElement("div",{className:"container",style:{height:f.getTotalSize()}},q.default.createElement("ul",{style:{transform:`translateY(${null!==(n=null===(l=p[0])||void 0===l?void 0:l.start)&&void 0!==n?n:0}px)`}},p.map((e=>q.default.createElement(Tp,{ref:f.measureElement,key:e.index,dataIndex:e.index,style:{height:o}},null==s?void 0:s(a[e.index],e.index)))))))}));Ip.displayName="VirtualList";const Op="1.11.25";Object.defineProperty(exports,"Affix",{enumerable:!0,get:function(){return s.Affix}}),Object.defineProperty(exports,"Alert",{enumerable:!0,get:function(){return s.Alert}}),Object.defineProperty(exports,"Anchor",{enumerable:!0,get:function(){return s.Anchor}}),Object.defineProperty(exports,"AutoComplete",{enumerable:!0,get:function(){return s.AutoComplete}}),Object.defineProperty(exports,"Avatar",{enumerable:!0,get:function(){return s.Avatar}}),Object.defineProperty(exports,"BackTop",{enumerable:!0,get:function(){return s.BackTop}}),Object.defineProperty(exports,"Badge",{enumerable:!0,get:function(){return s.Badge}}),Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:function(){return s.Breadcrumb}}),Object.defineProperty(exports,"Button",{enumerable:!0,get:function(){return s.Button}}),Object.defineProperty(exports,"Card",{enumerable:!0,get:function(){return s.Card}}),Object.defineProperty(exports,"Carousel",{enumerable:!0,get:function(){return s.Carousel}}),Object.defineProperty(exports,"Cascader",{enumerable:!0,get:function(){return s.Cascader}}),Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:function(){return s.Checkbox}}),Object.defineProperty(exports,"Col",{enumerable:!0,get:function(){return s.Col}}),Object.defineProperty(exports,"Collapse",{enumerable:!0,get:function(){return s.Collapse}}),Object.defineProperty(exports,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(exports,"ConfigProvider",{enumerable:!0,get:function(){return s.ConfigProvider}}),Object.defineProperty(exports,"Descriptions",{enumerable:!0,get:function(){return s.Descriptions}}),Object.defineProperty(exports,"Divider",{enumerable:!0,get:function(){return s.Divider}}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return s.Drawer}}),Object.defineProperty(exports,"Dropdown",{enumerable:!0,get:function(){return s.Dropdown}}),Object.defineProperty(exports,"Empty",{enumerable:!0,get:function(){return s.Empty}}),Object.defineProperty(exports,"Form",{enumerable:!0,get:function(){return s.Form}}),Object.defineProperty(exports,"Grid",{enumerable:!0,get:function(){return s.Grid}}),Object.defineProperty(exports,"Image",{enumerable:!0,get:function(){return s.Image}}),Object.defineProperty(exports,"Input",{enumerable:!0,get:function(){return s.Input}}),Object.defineProperty(exports,"InputNumber",{enumerable:!0,get:function(){return s.InputNumber}}),Object.defineProperty(exports,"Layout",{enumerable:!0,get:function(){return s.Layout}}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return s.List}}),Object.defineProperty(exports,"Mentions",{enumerable:!0,get:function(){return s.Mentions}}),Object.defineProperty(exports,"Menu",{enumerable:!0,get:function(){return s.Menu}}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return s.Modal}}),Object.defineProperty(exports,"PageHeader",{enumerable:!0,get:function(){return s.PageHeader}}),Object.defineProperty(exports,"Pagination",{enumerable:!0,get:function(){return s.Pagination}}),Object.defineProperty(exports,"Popconfirm",{enumerable:!0,get:function(){return s.Popconfirm}}),Object.defineProperty(exports,"Popover",{enumerable:!0,get:function(){return s.Popover}}),Object.defineProperty(exports,"Progress",{enumerable:!0,get:function(){return s.Progress}}),Object.defineProperty(exports,"Radio",{enumerable:!0,get:function(){return s.Radio}}),Object.defineProperty(exports,"Rate",{enumerable:!0,get:function(){return s.Rate}}),Object.defineProperty(exports,"Result",{enumerable:!0,get:function(){return s.Result}}),Object.defineProperty(exports,"Row",{enumerable:!0,get:function(){return s.Row}}),Object.defineProperty(exports,"Segmented",{enumerable:!0,get:function(){return s.Segmented}}),Object.defineProperty(exports,"Select",{enumerable:!0,get:function(){return s.Select}}),Object.defineProperty(exports,"Skeleton",{enumerable:!0,get:function(){return s.Skeleton}}),Object.defineProperty(exports,"Slider",{enumerable:!0,get:function(){return s.Slider}}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return s.Space}}),Object.defineProperty(exports,"Spin",{enumerable:!0,get:function(){return s.Spin}}),Object.defineProperty(exports,"Statistic",{enumerable:!0,get:function(){return s.Statistic}}),Object.defineProperty(exports,"Steps",{enumerable:!0,get:function(){return s.Steps}}),Object.defineProperty(exports,"Switch",{enumerable:!0,get:function(){return s.Switch}}),Object.defineProperty(exports,"Table",{enumerable:!0,get:function(){return s.Table}}),Object.defineProperty(exports,"Tabs",{enumerable:!0,get:function(){return s.Tabs}}),Object.defineProperty(exports,"Tag",{enumerable:!0,get:function(){return s.Tag}}),Object.defineProperty(exports,"Timeline",{enumerable:!0,get:function(){return s.Timeline}}),Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return s.Tooltip}}),Object.defineProperty(exports,"Transfer",{enumerable:!0,get:function(){return s.Transfer}}),Object.defineProperty(exports,"Tree",{enumerable:!0,get:function(){return s.Tree}}),Object.defineProperty(exports,"TreeSelect",{enumerable:!0,get:function(){return s.TreeSelect}}),Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return s.Typography}}),Object.defineProperty(exports,"Upload",{enumerable:!0,get:function(){return s.Upload}}),Object.defineProperty(exports,"message",{enumerable:!0,get:function(){return s.message}}),Object.defineProperty(exports,"notification",{enumerable:!0,get:function(){return s.notification}}),exports.Calendar=$e,exports.DatePicker=qe,exports.DcpAnchor=Wn,exports.DcpButton=ht,exports.DcpCollapse=Yl,exports.DcpColorPicker=id,exports.DcpConfigProvider=Be,exports.DcpCopyToClipboard=Pu,exports.DcpCountup=mn,exports.DcpCropper=Zc,exports.DcpDivider=bt,exports.DcpDownload=jn,exports.DcpDrawer=Gn,exports.DcpEmpty=hn,exports.DcpForm=wf,exports.DcpGuideTracker=sp,exports.DcpLazyLoad=gp,exports.DcpModal=Qn,exports.DcpPivotGrid=zd,exports.DcpPrint=Kf,exports.DcpRangeTableHelper=oc,exports.DcpScrollbar=_n,exports.DcpSearchHelper=Vu,exports.DcpSearchTree=su,exports.DcpSignature=Np,exports.DcpSpace=vt,exports.DcpSpin=gn,exports.DcpSplit=pn,exports.DcpTable=Ku,exports.DcpTabs=Un,exports.DcpTinymce=xf,exports.DcpTour=Pf,exports.DcpTransition=kn,exports.DcpTreeHelper=Ru,exports.DcpTreeTableHelper=Ju,exports.DcpUploadFile=qn,exports.DcpUploadImg=ef,exports.DcpVirtualList=Ip,exports.DcpWatermark=dp,exports.QmAnchor=Wn,exports.QmButton=ht,exports.QmCollapse=Yl,exports.QmColorPicker=id,exports.QmConfigProvider=Be,exports.QmCopyToClipboard=Pu,exports.QmCountup=mn,exports.QmCropper=Zc,exports.QmDivider=bt,exports.QmDownload=jn,exports.QmDrawer=Gn,exports.QmEmpty=hn,exports.QmForm=wf,exports.QmGuideTracker=sp,exports.QmLazyLoad=gp,exports.QmModal=Qn,exports.QmPivotGrid=zd,exports.QmPrint=Kf,exports.QmRangeTableHelper=oc,exports.QmScrollbar=_n,exports.QmSearchHelper=Vu,exports.QmSearchTree=su,exports.QmSignature=Np,exports.QmSpace=vt,exports.QmSpin=gn,exports.QmSplit=pn,exports.QmTable=Ku,exports.QmTabs=Un,exports.QmTinymce=xf,exports.QmTour=Pf,exports.QmTransition=kn,exports.QmTreeHelper=Ru,exports.QmTreeTableHelper=Ju,exports.QmUploadFile=qn,exports.QmUploadImg=ef,exports.QmVirtualList=Ip,exports.QmWatermark=dp,exports.TimePicker=Ke,exports.pinyin=Pr,exports.version=Op;
|